Skip to content

Commit

Permalink
Removes DX2 unused extension code that was making the games not exit …
Browse files Browse the repository at this point in the history
…cleanly if compiled with DirectDraw.
  • Loading branch information
tomsons26 committed Jan 18, 2021
1 parent a8a56dd commit 1cc30e5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 32 deletions.
3 changes: 0 additions & 3 deletions common/drawmisc.cpp
Expand Up @@ -10,9 +10,6 @@ HWND MainWindow; // Handle to programs main window
unsigned char CurrentPalette[768] = {255};
unsigned char PaletteTable[1024] = {0};

bool SystemToVideoBlits = false; // Does hardware support system mem to video mem blits?
bool VideoToSystemBlits = false; // Does hardware support video mem to system mem blits?
bool SystemToSystemBlits = false; // Does hardware support system mem to system mem blits?
bool OverlappedVideoBlits = true; // Can video driver blit overlapped regions?
bool AllowHardwareBlitFills = true;

Expand Down
30 changes: 1 addition & 29 deletions common/video_ddraw.cpp
Expand Up @@ -44,8 +44,7 @@
#include "misc.h"
#include <cstdio>

LPDIRECTDRAW DirectDrawObject = NULL; // Pointer to the direct draw object
LPDIRECTDRAW2 DirectDraw2Interface = NULL; // Pointer to direct draw 2 interface
LPDIRECTDRAW DirectDrawObject = NULL; // Pointer to the direct draw object

PALETTEENTRY PaletteEntries[256]; // 256 windows palette entries
LPDIRECTDRAWPALETTE PalettePtr; // Pointer to direct draw palette object
Expand Down Expand Up @@ -688,33 +687,6 @@ bool Set_Video_Mode(int w, int h, int bits_per_pixel)

Check_Overlapped_Blit_Capability();

/*
** Find out if DirectX 2 extensions are available
*/
result = DirectDrawObject->QueryInterface(IID_IDirectDraw2, (LPVOID*)&DirectDraw2Interface);
SystemToVideoBlits = FALSE;
VideoToSystemBlits = FALSE;
SystemToSystemBlits = FALSE;
if (result != DD_OK) {
DirectDraw2Interface = NULL;
} else {
DDCAPS capabilities;
DDCAPS emulated_capabilities;

memset((char*)&capabilities, 0, sizeof(capabilities));
memset((char*)&emulated_capabilities, 0, sizeof(emulated_capabilities));
capabilities.dwSize = sizeof(capabilities);
emulated_capabilities.dwSize = sizeof(emulated_capabilities);

DirectDrawObject->GetCaps(&capabilities, &emulated_capabilities);

if (capabilities.dwCaps & DDCAPS_CANBLTSYSMEM) {
SystemToVideoBlits = (capabilities.dwSVBCaps & DDCAPS_BLT) ? TRUE : FALSE;
VideoToSystemBlits = (capabilities.dwVSBCaps & DDCAPS_BLT) ? TRUE : FALSE;
SystemToSystemBlits = (capabilities.dwSSBCaps & DDCAPS_BLT) ? TRUE : FALSE;
}
}

/*
** In legacy DirectDraw mode we clip the cursor for the duration of the session.
*/
Expand Down

0 comments on commit 1cc30e5

Please sign in to comment.