implemented WM_DISPLAYCHANGE code

This commit is contained in:
itsmattkc 2023-04-29 20:37:12 -07:00
parent 812ac70957
commit 23f2bf5e03
4 changed files with 51 additions and 14 deletions

View file

@ -9,6 +9,10 @@ const char *WINDOW_TITLE = "LEGO
unsigned char g_mousedown = 0;
unsigned char g_mousemoved = 0;
int _DAT_00410050 = 0;
int _DAT_00410054 = 1;
int g_targetWidth = 640;
int g_targetHeight = 480;
unsigned int g_targetDepth = 16;
int _DAT_00410064 = 0;
int _DAT_004101bc = 200;
long g_lastFrameTime = 0;

View file

@ -10,6 +10,10 @@ extern const char *WINDOW_TITLE;
extern unsigned char g_mousedown;
extern unsigned char g_mousemoved;
extern int _DAT_00410050;
extern int _DAT_00410054;
extern int g_targetWidth;
extern int g_targetHeight;
extern unsigned int g_targetDepth;
extern int _DAT_00410064;
extern int _DAT_004101bc;
extern long g_lastFrameTime;

View file

@ -355,31 +355,27 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
}
return DefWindowProcA(hWnd, WM_NCPAINT, wParam, lParam);
case WM_DISPLAYCHANGE:
/* FIXME: Untangle
if (g_isle && VideoManager() && g_isle->m_fullScreen && ((pLVar7 = VideoManager(), *(int *)(pLVar7 + 0x74) != 0 && (pLVar7 = VideoManager(), *(int *)(*(int *)(pLVar7 + 0x74) + 0x880) != 0))) {
if (g_isle && VideoManager() && g_isle->m_fullScreen && VideoManager()->m_unk74 && VideoManager()->m_unk74[0x220]) {
if (_DAT_00410054 == 0) {
unsigned char bVar1 = FALSE;
if (LOWORD(lParam) == _DAT_00410058 && HIWORD(lParam) == _DAT_0041005c && _DAT_00410060 == wParam) {
bVar1 = TRUE;
unsigned char valid = FALSE;
if (LOWORD(lParam) == g_targetWidth && HIWORD(lParam) == g_targetHeight && g_targetDepth == wParam) {
valid = TRUE;
}
if (_DAT_00410050 == 0) {
if (!bVar1) {
if (!valid) {
_DAT_00410050 = 1;
Lego()->vtable38();
VideoManager()->DisableRMDevice();
}
}
else if (bVar1) {
} else if (valid) {
_DAT_00410064 = 1;
}
}
else {
} else {
_DAT_00410054 = 0;
_DAT_00410060 = wParam;
g_targetDepth = wParam;
}
}*/
return DefWindowProcA(hWnd,WM_DISPLAYCHANGE,wParam,lParam);
}
return DefWindowProcA(hWnd, WM_DISPLAYCHANGE, wParam, lParam);
case WM_SETCURSOR:
case WM_KEYDOWN:
case WM_MOUSEMOVE:

View file

@ -6,10 +6,43 @@ class LegoVideoManager
public:
__declspec(dllexport) int EnableRMDevice();
__declspec(dllexport) int DisableRMDevice();
__declspec(dllexport) void EnableFullScreenMovie(unsigned char a, unsigned char b);
__declspec(dllexport) void MoveCursor(int x, int y);
int m_unk00;
int m_unk04;
int m_unk08;
int m_unk0c;
int m_unk10;
int m_unk14;
int m_unk18;
int m_unk1c;
int m_unk20;
int m_unk24;
int m_unk28;
int m_unk2c;
int m_unk30;
int m_unk34;
int m_unk38;
int m_unk3c;
int m_unk40;
int m_unk44;
int m_unk48;
int m_unk4c;
int m_unk50;
int m_unk54;
int m_unk58;
int m_unk5c;
int m_unk60;
int m_unk64;
int m_unk68;
int m_unk6c;
int m_unk70;
int *m_unk74;
};
#endif // LEGOVIDEOMANAGER_H