Replace magic numbers in main.cpp with macro's

This commit is contained in:
Anonymous Maarten 2023-06-15 03:09:46 +02:00
parent 57c5aebe3e
commit b7ce2a0df5

View File

@ -19,7 +19,7 @@ BOOL findExistingInstance(void)
BOOL startDirectSound(void) BOOL startDirectSound(void)
{ {
LPDIRECTSOUND lpDS = 0; LPDIRECTSOUND lpDS = NULL;
HRESULT ret = DirectSoundCreate(NULL, &lpDS, NULL); HRESULT ret = DirectSoundCreate(NULL, &lpDS, NULL);
if (ret == DS_OK && lpDS != NULL) { if (ret == DS_OK && lpDS != NULL) {
lpDS->Release(); lpDS->Release();
@ -49,7 +49,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
// Throw error if sound unavailable // Throw error if sound unavailable
if (!soundReady) { if (!soundReady) {
MessageBoxA(NULL, "\"LEGO\xAE Island\" is not detecting a DirectSound compatible sound card. Please quit all other applications and try again.", MessageBoxA(NULL, "\"LEGO\xAE Island\" is not detecting a DirectSound compatible sound card. Please quit all other applications and try again.",
"Lego Island Error",0); "Lego Island Error", MB_OK | MB_APPLMODAL);
return 0; return 0;
} }
@ -58,7 +58,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
// 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",0); MessageBoxA(NULL, "\"LEGO\xAE Island\" failed to start. Please quit all other applications and try again.", "LEGO\xAE Island Error", MB_OK | MB_APPLMODAL);
return 0; return 0;
} }