use different naming scheme in ISLE

We now know that ISLE used PascalCase for its function names, so we're using those here now.
This commit is contained in:
itsmattkc 2023-06-18 21:51:06 -07:00
parent 4a41d3fd36
commit 1152feab8d
3 changed files with 45 additions and 45 deletions

View file

@ -54,7 +54,7 @@ Isle::Isle()
Isle::~Isle() Isle::~Isle()
{ {
if (LegoOmni::GetInstance()) { if (LegoOmni::GetInstance()) {
close(); Close();
MxOmni::DestroyInstance(); MxOmni::DestroyInstance();
} }
@ -76,7 +76,7 @@ Isle::~Isle()
} }
// OFFSET: ISLE 0x401260 // OFFSET: ISLE 0x401260
void Isle::close() void Isle::Close()
{ {
MxDSAction ds; MxDSAction ds;
@ -111,7 +111,7 @@ void Isle::close()
} }
// OFFSET: ISLE 0x402740 // OFFSET: ISLE 0x402740
BOOL readReg(LPCSTR name, LPSTR outValue, DWORD outSize) BOOL ReadReg(LPCSTR name, LPSTR outValue, DWORD outSize)
{ {
HKEY hKey; HKEY hKey;
DWORD valueType; DWORD valueType;
@ -130,11 +130,11 @@ BOOL readReg(LPCSTR name, LPSTR outValue, DWORD outSize)
} }
// OFFSET: ISLE 0x4027b0 // OFFSET: ISLE 0x4027b0
int readRegBool(LPCSTR name, BOOL *out) int ReadRegBool(LPCSTR name, BOOL *out)
{ {
char buffer[256]; char buffer[256];
BOOL read = readReg(name, buffer, sizeof(buffer)); BOOL read = ReadReg(name, buffer, sizeof(buffer));
if (read) { if (read) {
if (strcmp("YES", buffer) == 0) { if (strcmp("YES", buffer) == 0) {
*out = TRUE; *out = TRUE;
@ -150,11 +150,11 @@ int readRegBool(LPCSTR name, BOOL *out)
} }
// OFFSET: ISLE 0x402880 // OFFSET: ISLE 0x402880
int readRegInt(LPCSTR name, int *out) int ReadRegInt(LPCSTR name, int *out)
{ {
char buffer[256]; char buffer[256];
if (readReg(name, buffer, sizeof(buffer))) { if (ReadReg(name, buffer, sizeof(buffer))) {
*out = atoi(buffer); *out = atoi(buffer);
return TRUE; return TRUE;
} }
@ -163,11 +163,11 @@ int readRegInt(LPCSTR name, int *out)
} }
// OFFSET: ISLE 0x4028d0 // OFFSET: ISLE 0x4028d0
void Isle::loadConfig() void Isle::LoadConfig()
{ {
char buffer[1024]; char buffer[1024];
if (!readReg("diskpath", buffer, sizeof(buffer))) { if (!ReadReg("diskpath", buffer, sizeof(buffer))) {
strcpy(buffer, MxOmni::GetHD()); strcpy(buffer, MxOmni::GetHD());
} }
@ -175,7 +175,7 @@ void Isle::loadConfig()
strcpy(m_hdPath, buffer); strcpy(m_hdPath, buffer);
MxOmni::SetHD(m_hdPath); MxOmni::SetHD(m_hdPath);
if (!readReg("cdpath", buffer, sizeof(buffer))) { if (!ReadReg("cdpath", buffer, sizeof(buffer))) {
strcpy(buffer, MxOmni::GetCD()); strcpy(buffer, MxOmni::GetCD());
} }
@ -183,22 +183,22 @@ void Isle::loadConfig()
strcpy(m_cdPath, buffer); strcpy(m_cdPath, buffer);
MxOmni::SetCD(m_cdPath); MxOmni::SetCD(m_cdPath);
readRegBool("Flip Surfaces", &m_flipSurfaces); ReadRegBool("Flip Surfaces", &m_flipSurfaces);
readRegBool("Full Screen", &m_fullScreen); ReadRegBool("Full Screen", &m_fullScreen);
readRegBool("Wide View Angle", &m_wideViewAngle); ReadRegBool("Wide View Angle", &m_wideViewAngle);
readRegBool("3DSound", &m_use3dSound); ReadRegBool("3DSound", &m_use3dSound);
readRegBool("Music", &m_useMusic); ReadRegBool("Music", &m_useMusic);
readRegBool("UseJoystick", &m_useJoystick); ReadRegBool("UseJoystick", &m_useJoystick);
readRegInt("JoystickIndex", &m_joystickIndex); ReadRegInt("JoystickIndex", &m_joystickIndex);
readRegBool("Draw Cursor", &m_drawCursor); ReadRegBool("Draw Cursor", &m_drawCursor);
int backBuffersInVRAM; int backBuffersInVRAM;
if (readRegBool("Back Buffers in Video RAM",&backBuffersInVRAM)) { if (ReadRegBool("Back Buffers in Video RAM",&backBuffersInVRAM)) {
m_backBuffersInVram = !backBuffersInVRAM; m_backBuffersInVram = !backBuffersInVRAM;
} }
int bitDepth; int bitDepth;
if (readRegInt("Display Bit Depth", &bitDepth)) { if (ReadRegInt("Display Bit Depth", &bitDepth)) {
if (bitDepth == 8) { if (bitDepth == 8) {
m_using8bit = TRUE; m_using8bit = TRUE;
} else if (bitDepth == 16) { } else if (bitDepth == 16) {
@ -206,29 +206,29 @@ void Isle::loadConfig()
} }
} }
if (!readReg("Island Quality", buffer, sizeof(buffer))) { if (!ReadReg("Island Quality", buffer, sizeof(buffer))) {
strcpy(buffer, "1"); strcpy(buffer, "1");
} }
m_islandQuality = atoi(buffer); m_islandQuality = atoi(buffer);
if (!readReg("Island Texture", buffer, sizeof(buffer))) { if (!ReadReg("Island Texture", buffer, sizeof(buffer))) {
strcpy(buffer, "1"); strcpy(buffer, "1");
} }
m_islandTexture = atoi(buffer); m_islandTexture = atoi(buffer);
if (readReg("3D Device ID", buffer, sizeof(buffer))) { if (ReadReg("3D Device ID", buffer, sizeof(buffer))) {
m_deviceId = new char[strlen(buffer) + 1]; m_deviceId = new char[strlen(buffer) + 1];
strcpy(m_deviceId, buffer); strcpy(m_deviceId, buffer);
} }
if (readReg("savepath", buffer, sizeof(buffer))) { if (ReadReg("savepath", buffer, sizeof(buffer))) {
m_savePath = new char[strlen(buffer) + 1]; m_savePath = new char[strlen(buffer) + 1];
strcpy(m_savePath, buffer); strcpy(m_savePath, buffer);
} }
} }
// OFFSET: ISLE 0x401560 // OFFSET: ISLE 0x401560
void Isle::setupVideoFlags(BOOL fullScreen, BOOL flipSurfaces, BOOL backBuffers, void Isle::SetupVideoFlags(BOOL fullScreen, BOOL flipSurfaces, BOOL backBuffers,
BOOL using8bit, BOOL m_using16bit, BOOL param_6, BOOL param_7, BOOL using8bit, BOOL m_using16bit, BOOL param_6, BOOL param_7,
BOOL wideViewAngle, char *deviceId) BOOL wideViewAngle, char *deviceId)
{ {
@ -249,7 +249,7 @@ void Isle::setupVideoFlags(BOOL fullScreen, BOOL flipSurfaces, BOOL backBuffers,
} }
// OFFSET: ISLE 0x4013b0 // OFFSET: ISLE 0x4013b0
BOOL Isle::setupLegoOmni() BOOL Isle::SetupLegoOmni()
{ {
char mediaPath[256]; char mediaPath[256];
GetProfileStringA("LEGO Island", "MediaPath", "", mediaPath, sizeof(mediaPath)); GetProfileStringA("LEGO Island", "MediaPath", "", mediaPath, sizeof(mediaPath));
@ -264,7 +264,7 @@ BOOL Isle::setupLegoOmni()
} }
// OFFSET: ISLE 0x402e80 // OFFSET: ISLE 0x402e80
void Isle::setupCursor(WPARAM wParam) void Isle::SetupCursor(WPARAM wParam)
{ {
switch (wParam) { switch (wParam) {
case 0: case 0:
@ -428,7 +428,7 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
break; break;
case 0x5400: case 0x5400:
if (g_isle) { if (g_isle) {
g_isle->setupCursor(wParam); g_isle->SetupCursor(wParam);
return 0; return 0;
} }
} }
@ -457,14 +457,14 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
} }
// OFFSET: ISLE 0x4023e0 // OFFSET: ISLE 0x4023e0
MxResult Isle::setupWindow(HINSTANCE hInstance) MxResult Isle::SetupWindow(HINSTANCE hInstance)
{ {
WNDCLASSA wndclass; WNDCLASSA wndclass;
ZeroMemory(&wndclass, sizeof(WNDCLASSA)); ZeroMemory(&wndclass, sizeof(WNDCLASSA));
loadConfig(); LoadConfig();
setupVideoFlags(m_fullScreen, m_flipSurfaces, m_backBuffersInVram, m_using8bit, SetupVideoFlags(m_fullScreen, m_flipSurfaces, m_backBuffersInVram, m_using8bit,
m_using16bit, m_unk24, FALSE, m_wideViewAngle, m_deviceId); m_using16bit, m_unk24, FALSE, m_wideViewAngle, m_deviceId);
MxOmni::SetSound3D(m_use3dSound); MxOmni::SetSound3D(m_use3dSound);
@ -525,7 +525,7 @@ MxResult Isle::setupWindow(HINSTANCE hInstance)
ShowWindow(m_windowHandle, SW_SHOWNORMAL); ShowWindow(m_windowHandle, SW_SHOWNORMAL);
UpdateWindow(m_windowHandle); UpdateWindow(m_windowHandle);
if (!setupLegoOmni()) { if (!SetupLegoOmni()) {
return FAILURE; return FAILURE;
} }
@ -565,7 +565,7 @@ MxResult Isle::setupWindow(HINSTANCE hInstance)
} }
// OFFSET: ISLE 0x402c20 // OFFSET: ISLE 0x402c20
void Isle::tick(BOOL sleepIfNotNextFrame) void Isle::Tick(BOOL sleepIfNotNextFrame)
{ {
if (this->m_windowActive) { if (this->m_windowActive) {
if (!Lego()) return; if (!Lego()) return;

View file

@ -12,21 +12,21 @@ class Isle
Isle(); Isle();
~Isle(); ~Isle();
static void close(); static void Close();
MxResult setupWindow(HINSTANCE hInstance); MxResult SetupWindow(HINSTANCE hInstance);
void tick(BOOL sleepIfNotNextFrame); void Tick(BOOL sleepIfNotNextFrame);
BOOL setupLegoOmni(); BOOL SetupLegoOmni();
void loadConfig(); void LoadConfig();
void setupVideoFlags(BOOL fullScreen, BOOL flipSurfaces, BOOL backBuffers, void SetupVideoFlags(BOOL fullScreen, BOOL flipSurfaces, BOOL backBuffers,
BOOL using8bit, BOOL m_using16bit, BOOL param_6, BOOL param_7, BOOL using8bit, BOOL m_using16bit, BOOL param_6, BOOL param_7,
BOOL wideViewAngle, char *deviceId); BOOL wideViewAngle, char *deviceId);
void setupCursor(WPARAM wParam); void SetupCursor(WPARAM wParam);
//private: // private:
// 0 // 0
LPSTR m_hdPath; LPSTR m_hdPath;

View file

@ -60,7 +60,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
g_isle = new Isle(); g_isle = new Isle();
// Create window // Create window
if (g_isle->setupWindow(hInstance) != SUCCESS) { if (g_isle->SetupWindow(hInstance) != SUCCESS) {
MessageBoxA(NULL, "\"LEGO\xAE Island\" failed to start. Please quit all other applications and try again.", "LEGO\xAE Island Error", MB_OK); MessageBoxA(NULL, "\"LEGO\xAE Island\" failed to start. Please quit all other applications and try again.", "LEGO\xAE Island Error", MB_OK);
return 0; return 0;
} }
@ -79,12 +79,12 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
while (!g_closed) { while (!g_closed) {
while (!PeekMessageA(&msg, NULL, 0, 0, PM_NOREMOVE)) { while (!PeekMessageA(&msg, NULL, 0, 0, PM_NOREMOVE)) {
if (g_isle) { if (g_isle) {
g_isle->tick(1); g_isle->Tick(1);
} }
} }
if (g_isle) { if (g_isle) {
g_isle->tick(1); g_isle->Tick(1);
} }
if (g_closed) { if (g_closed) {
@ -124,7 +124,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
} }
} else if (g_mousemoved) { } else if (g_mousemoved) {
if (g_isle) { if (g_isle) {
g_isle->tick(0); g_isle->Tick(0);
} }
goto LAB_00401bc7; goto LAB_00401bc7;
} }