Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
decomp: fix regression in WinVidSetDisplayAdapter
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Apr 25, 2024
1 parent 041ffb9 commit 439e615
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/decomp/decomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -918,10 +918,15 @@ void __cdecl WinVidSetDisplayAdapter(DISPLAY_ADAPTER *disp_adapter)
{
DISPLAY_MODE disp_mode;

disp_adapter->sw_windowed_supported = 0;
disp_adapter->hw_windowed_supported = 0;
disp_adapter->sw_windowed_supported = false;
disp_adapter->hw_windowed_supported = false;
disp_adapter->screen_width = 0;
if (disp_adapter->adapter_guid_ptr != NULL && !DDrawCreate(NULL)) {

if (disp_adapter->adapter_guid_ptr != NULL) {
return;
}

if (!DDrawCreate(NULL)) {
return;
}

Expand All @@ -934,7 +939,7 @@ void __cdecl WinVidSetDisplayAdapter(DISPLAY_ADAPTER *disp_adapter)

disp_mode.width &= ~0x1F;
if (disp_mode.width * 3 / 4 > disp_mode.height) {
disp_mode.width = (disp_mode.height * 4 / 3) & 0x1F;
disp_mode.width = (disp_mode.height * 4 / 3) & ~0x1F;
}

disp_adapter->sw_windowed_supported = disp_mode.vga == VGA_256_COLOR;
Expand Down

0 comments on commit 439e615

Please sign in to comment.