Skip to content

Commit

Permalink
fix downscaling with boxing=true
Browse files Browse the repository at this point in the history
  • Loading branch information
FunkyFr3sh committed Oct 25, 2024
1 parent cdec1fe commit ce4860d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/dd.c
Original file line number Diff line number Diff line change
Expand Up @@ -934,15 +934,12 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl

if (g_config.boxing)
{
g_ddraw.render.viewport.width = g_ddraw.width;
g_ddraw.render.viewport.height = g_ddraw.height;

for (int i = 20; i-- > 1;)
{
if (g_ddraw.width * i <= g_ddraw.render.width && g_ddraw.height * i <= g_ddraw.render.height)
{
g_ddraw.render.viewport.width *= i;
g_ddraw.render.viewport.height *= i;
g_ddraw.render.viewport.width = i * g_ddraw.width;
g_ddraw.render.viewport.height = i * g_ddraw.height;
break;
}
}
Expand Down

0 comments on commit ce4860d

Please sign in to comment.