1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 06:04:49 +01:00

keep old maintas setting working for cutscenes

This commit is contained in:
FunkyFr3sh 2024-12-06 20:00:58 +01:00
parent a556262670
commit 896c2f5def

View File

@ -889,11 +889,23 @@ int WINAPI fake_StretchDIBits(
}
else if (g_ddraw->width > 0 && g_ddraw->render.hdc)
{
int base_width = g_ddraw->height * 4.0/3.0;
double scaling_factor = (double)g_ddraw->render.height / g_ddraw->height;
DestWidth = base_width * scaling_factor;
DestHeight = g_ddraw->render.height;
xDest += (g_ddraw->render.width - DestWidth) / 2;
// new logic by emoon
// g_ddraw->width check detects new widescreen patch
if (g_ddraw->width > 640 && g_config.maintas)
{
int base_width = g_ddraw->height * 4.0 / 3.0;
double scaling_factor = (double)g_ddraw->render.height / g_ddraw->height;
DestWidth = base_width * scaling_factor;
DestHeight = g_ddraw->render.height;
xDest += (g_ddraw->render.width - DestWidth) / 2;
}
else // original 4:3 logic
{
xDest += g_ddraw->render.viewport.x;
yDest += g_ddraw->render.viewport.y;
DestWidth = (int)(DestWidth * g_ddraw->render.scale_w);
DestHeight = (int)(DestHeight * g_ddraw->render.scale_h);
}
return
real_StretchDIBits(