mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-24 17:49:52 +01:00
move detect_cutscene into main.c since it's used by all renderers
This commit is contained in:
parent
b9eda0f6af
commit
67f7f2bfe6
30
src/main.c
30
src/main.c
@ -110,6 +110,36 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static unsigned char getPixel(int x, int y)
|
||||||
|
{
|
||||||
|
return ((unsigned char *)ddraw->primary->surface)[y*ddraw->primary->lPitch + x*ddraw->primary->lXPitch];
|
||||||
|
}
|
||||||
|
|
||||||
|
int* InMovie = (int*)0x00665F58;
|
||||||
|
int* IsVQA640 = (int*)0x0065D7BC;
|
||||||
|
BYTE* ShouldStretch = (BYTE*)0x00607D78;
|
||||||
|
|
||||||
|
BOOL detect_cutscene()
|
||||||
|
{
|
||||||
|
if (ddraw->width <= CUTSCENE_WIDTH || ddraw->height <= CUTSCENE_HEIGHT)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (ddraw->isredalert)
|
||||||
|
{
|
||||||
|
if ((*InMovie && !*IsVQA640) || *ShouldStretch)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
else if (ddraw->iscnc1)
|
||||||
|
{
|
||||||
|
return getPixel(CUTSCENE_WIDTH + 1, 0) == 0 || getPixel(CUTSCENE_WIDTH + 5, 1) == 0 ? TRUE : FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
HRESULT __stdcall ddraw_Compact(IDirectDrawImpl *This)
|
HRESULT __stdcall ddraw_Compact(IDirectDrawImpl *This)
|
||||||
{
|
{
|
||||||
printf("DirectDraw::Compact(This=%p)\n", This);
|
printf("DirectDraw::Compact(This=%p)\n", This);
|
||||||
|
@ -59,7 +59,6 @@ static void DeleteContext(HGLRC context);
|
|||||||
static BOOL TextureUploadTest();
|
static BOOL TextureUploadTest();
|
||||||
static BOOL ShaderTest();
|
static BOOL ShaderTest();
|
||||||
|
|
||||||
BOOL detect_cutscene();
|
|
||||||
DWORD WINAPI render_soft_main(void);
|
DWORD WINAPI render_soft_main(void);
|
||||||
|
|
||||||
DWORD WINAPI render_main(void)
|
DWORD WINAPI render_main(void)
|
||||||
|
@ -23,36 +23,6 @@
|
|||||||
|
|
||||||
BOOL ShowDriverWarning;
|
BOOL ShowDriverWarning;
|
||||||
|
|
||||||
static unsigned char getPixel(int x, int y)
|
|
||||||
{
|
|
||||||
return ((unsigned char *)ddraw->primary->surface)[y*ddraw->primary->lPitch + x*ddraw->primary->lXPitch];
|
|
||||||
}
|
|
||||||
|
|
||||||
int* InMovie = (int*)0x00665F58;
|
|
||||||
int* IsVQA640 = (int*)0x0065D7BC;
|
|
||||||
BYTE* ShouldStretch = (BYTE*)0x00607D78;
|
|
||||||
|
|
||||||
BOOL detect_cutscene()
|
|
||||||
{
|
|
||||||
if(ddraw->width <= CUTSCENE_WIDTH || ddraw->height <= CUTSCENE_HEIGHT)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
if (ddraw->isredalert)
|
|
||||||
{
|
|
||||||
if ((*InMovie && !*IsVQA640) || *ShouldStretch)
|
|
||||||
{
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
else if (ddraw->iscnc1)
|
|
||||||
{
|
|
||||||
return getPixel(CUTSCENE_WIDTH + 1, 0) == 0 || getPixel(CUTSCENE_WIDTH + 5, 1) == 0 ? TRUE : FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
DWORD WINAPI render_soft_main(void)
|
DWORD WINAPI render_soft_main(void)
|
||||||
{
|
{
|
||||||
DWORD warningEndTick = timeGetTime() + (15 * 1000);
|
DWORD warningEndTick = timeGetTime() + (15 * 1000);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user