add support for woms 2 high resolution patch zoom
This commit is contained in:
parent
8326407a64
commit
54d6ff5112
5 changed files with 43 additions and 5 deletions
34
src/utils.c
34
src/utils.c
|
@ -635,9 +635,29 @@ static unsigned char util_get_pixel(int x, int y)
|
|||
|
||||
BOOL util_detect_low_res_screen()
|
||||
{
|
||||
/* struct Copied from wkReSolution */
|
||||
typedef struct
|
||||
{
|
||||
PVOID UnkTable1;
|
||||
DWORD Unk1, Unk2, Unk3, Unk4;
|
||||
PVOID UnkDD, UnkTable2;
|
||||
DWORD Unk5;
|
||||
DWORD RenderWidth, RenderHeight;
|
||||
DWORD Unk6, Unk7;
|
||||
DWORD WidthRT, HeightRT;
|
||||
DWORD HalfWidth, HalfHeight;
|
||||
DWORD Unk8;
|
||||
PCHAR UnkC;
|
||||
LPDIRECTDRAW lpDD;
|
||||
} W2DDSTRUCT, * LPW2DDSTRUCT;
|
||||
|
||||
static int* in_movie = (int*)0x00665F58;
|
||||
static int* is_vqa_640 = (int*)0x0065D7BC;
|
||||
static BYTE* should_stretch = (BYTE*)0x00607D78;
|
||||
static LPW2DDSTRUCT* pW2DS;
|
||||
|
||||
if (!pW2DS)
|
||||
pW2DS = (char*)GetModuleHandleA(NULL) + 0x799C4;
|
||||
|
||||
if (g_ddraw.width <= g_ddraw.upscale_hack_width || g_ddraw.height <= g_ddraw.upscale_hack_height)
|
||||
{
|
||||
|
@ -663,6 +683,20 @@ BOOL util_detect_low_res_screen()
|
|||
{
|
||||
return util_get_pixel(g_ddraw.width - 3, 3) == 0;
|
||||
}
|
||||
else if (g_ddraw.isworms2)
|
||||
{
|
||||
if ((*pW2DS)->RenderWidth < g_ddraw.width && (*pW2DS)->RenderHeight < g_ddraw.height)
|
||||
{
|
||||
if (g_ddraw.upscale_hack_width != (*pW2DS)->RenderWidth || g_ddraw.upscale_hack_height != (*pW2DS)->RenderHeight)
|
||||
{
|
||||
g_ddraw.upscale_hack_width = (*pW2DS)->RenderWidth;
|
||||
g_ddraw.upscale_hack_height = (*pW2DS)->RenderHeight;
|
||||
InterlockedExchange(&g_ddraw.upscale_hack_active, FALSE);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue