implement GetPrimaryBitDepth

This commit is contained in:
Christian Semmler 2023-06-17 13:49:25 +02:00
parent 216332e64d
commit aae1734860
No known key found for this signature in database
GPG Key ID: 086DAA1360BEEE5C
2 changed files with 18 additions and 4 deletions

View File

@ -2,6 +2,9 @@
#include "mxdirectdraw.h" #include "mxdirectdraw.h"
int g_paletteIndexed8 = 0;
BOOL DAT_10100c70 = 0;
HRESULT MxDirectDraw::SetEntries() HRESULT MxDirectDraw::SetEntries()
{ {
HRESULT ret; HRESULT ret;
@ -49,11 +52,24 @@ void MxDirectDraw::FUN_1009e830(char *error_msg, HRESULT ret)
int MxDirectDraw::GetPrimaryBitDepth() int MxDirectDraw::GetPrimaryBitDepth()
{ {
DWORD dwRGBBitCount;
LPDIRECTDRAW pDDraw; LPDIRECTDRAW pDDraw;
DDSURFACEDESC ddsd;
DirectDrawCreate(NULL, &pDDraw, NULL); HRESULT result = DirectDrawCreate(NULL, &pDDraw, NULL);
dwRGBBitCount = 0;
if (!result)
{
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = 108;
return 0; pDDraw->GetDisplayMode(&ddsd);
dwRGBBitCount = ddsd.ddpfPixelFormat.dwRGBBitCount;
g_paletteIndexed8 = (ddsd.ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8) != 0;
pDDraw->Release();
}
return dwRGBBitCount;
} }
int MxDirectDraw::Pause(int param_1) int MxDirectDraw::Pause(int param_1)

View File

@ -32,6 +32,4 @@ class MxDirectDraw
}; };
BOOL DAT_10100c70 = 0;
#endif // MXDIRECTDRAW_H #endif // MXDIRECTDRAW_H