added more definitions

Also clarify .exe on script because Wine cares about that
This commit is contained in:
itsmattkc
2023-06-18 20:45:25 -07:00
parent 5aa7921e90
commit 319b52f248
8 changed files with 61 additions and 33 deletions

View File

@@ -1,17 +1,43 @@
#include "define.h"
// 0x410030
Isle *g_isle = 0;
// 0x410034
unsigned char g_mousedown = 0;
// 0x410038
unsigned char g_mousemoved = 0;
// 0x41003c
int g_closed = 0;
const char *WINDOW_TITLE = "LEGO\xAE";
// 0x410040
RECT g_windowRect = {0, 0, 640, 480};
unsigned char g_mousedown = 0;
unsigned char g_mousemoved = 0;
// 0x410050
int g_rmDisabled = 0;
// 0x410054
int g_waitingForTargetDepth = 1;
// 0x410058
int g_targetWidth = 640;
// 0x41005c
int g_targetHeight = 480;
// 0x410060
unsigned int g_targetDepth = 16;
// 0x410064
int g_reqEnableRMDevice = 0;
// 0x4101bc
int g_startupDelay = 200;
// 0x4101c0
long g_lastFrameTime = 0;
// 0x4101dc
const char *WINDOW_TITLE = "LEGO\xAE";

View File

@@ -1,6 +1,8 @@
#ifndef DEFINE_H
#define DEFINE_H
#include <Windows.h>
class Isle;
extern Isle *g_isle;
@@ -9,6 +11,7 @@ extern int g_closed;
extern const char *WINDOW_TITLE;
extern unsigned char g_mousedown;
extern unsigned char g_mousemoved;
extern RECT g_windowRect;
extern int g_rmDisabled;
extern int g_waitingForTargetDepth;
extern int g_targetWidth;

View File

@@ -7,8 +7,6 @@
#include "mxomni.h"
#include "res/resource.h"
RECT windowRect = {0, 0, 640, 480};
// OFFSET: ISLE 0x401000
Isle::Isle()
{
@@ -303,9 +301,9 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_ACTIVATEAPP:
if (g_isle) {
if ((wParam != 0) && (g_isle->m_fullScreen)) {
MoveWindow(hWnd, windowRect.left, windowRect.top,
(windowRect.right - windowRect.left) + 1,
(windowRect.bottom - windowRect.top) + 1, TRUE);
MoveWindow(hWnd, g_windowRect.left, g_windowRect.top,
(g_windowRect.right - g_windowRect.left) + 1,
(g_windowRect.bottom - g_windowRect.top) + 1, TRUE);
}
g_isle->m_windowActive = wParam;
}
@@ -324,10 +322,10 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
MINMAXINFO *mmi = (MINMAXINFO *) lParam;
mmi->ptMaxTrackSize.x = (windowRect.right - windowRect.left) + 1;
mmi->ptMaxTrackSize.y = (windowRect.bottom - windowRect.top) + 1;
mmi->ptMinTrackSize.x = (windowRect.right - windowRect.left) + 1;
mmi->ptMinTrackSize.y = (windowRect.bottom - windowRect.top) + 1;
mmi->ptMaxTrackSize.x = (g_windowRect.right - g_windowRect.left) + 1;
mmi->ptMaxTrackSize.y = (g_windowRect.bottom - g_windowRect.top) + 1;
mmi->ptMinTrackSize.x = (g_windowRect.right - g_windowRect.left) + 1;
mmi->ptMinTrackSize.y = (g_windowRect.bottom - g_windowRect.top) + 1;
return 0;
}
@@ -498,21 +496,21 @@ MxResult Isle::setupWindow(HINSTANCE hInstance)
int x, y, width, height;
if (!m_fullScreen) {
AdjustWindowRectEx(&windowRect, WS_CAPTION | WS_SYSMENU, 0, WS_EX_APPWINDOW);
AdjustWindowRectEx(&g_windowRect, WS_CAPTION | WS_SYSMENU, 0, WS_EX_APPWINDOW);
height = windowRect.bottom - windowRect.top;
width = windowRect.right - windowRect.left;
height = g_windowRect.bottom - g_windowRect.top;
width = g_windowRect.right - g_windowRect.left;
y = CW_USEDEFAULT;
x = CW_USEDEFAULT;
dwStyle = WS_CAPTION | WS_SYSMENU | WS_MAXIMIZEBOX | WS_MINIMIZEBOX;
} else {
AdjustWindowRectEx(&windowRect, WS_CAPTION | WS_SYSMENU, 0, WS_EX_APPWINDOW);
height = windowRect.bottom - windowRect.top;
width = windowRect.right - windowRect.left;
AdjustWindowRectEx(&g_windowRect, WS_CAPTION | WS_SYSMENU, 0, WS_EX_APPWINDOW);
height = g_windowRect.bottom - g_windowRect.top;
width = g_windowRect.right - g_windowRect.left;
dwStyle = WS_CAPTION | WS_SYSMENU;
x = windowRect.left;
y = windowRect.top;
x = g_windowRect.left;
y = g_windowRect.top;
}
m_windowHandle = CreateWindowExA(WS_EX_APPWINDOW, WNDCLASS_NAME, WINDOW_TITLE, dwStyle,
@@ -522,7 +520,7 @@ MxResult Isle::setupWindow(HINSTANCE hInstance)
}
if (m_fullScreen) {
MoveWindow(m_windowHandle, windowRect.left, windowRect.top, (windowRect.right - windowRect.left) + 1, (windowRect.bottom - windowRect.top) + 1, TRUE);
MoveWindow(m_windowHandle, g_windowRect.left, g_windowRect.top, (g_windowRect.right - g_windowRect.left) + 1, (g_windowRect.bottom - g_windowRect.top) + 1, TRUE);
}
ShowWindow(m_windowHandle, SW_SHOWNORMAL);
@@ -558,7 +556,7 @@ MxResult Isle::setupWindow(HINSTANCE hInstance)
}
}
if (m_fullScreen) {
MoveWindow(m_windowHandle, windowRect.left, windowRect.top, (windowRect.right - windowRect.left) + 1, (windowRect.bottom - windowRect.top) + 1, TRUE);
MoveWindow(m_windowHandle, g_windowRect.left, g_windowRect.top, (g_windowRect.right - g_windowRect.left) + 1, (g_windowRect.bottom - g_windowRect.top) + 1, TRUE);
}
ShowWindow(m_windowHandle, SW_SHOWNORMAL);
UpdateWindow(m_windowHandle);