From 4e50046d4b4c57f2b4d7bcf20dedcb913c266020 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Wed, 4 Sep 2019 02:11:21 +0100 Subject: [PATCH] Remove WINDOWS and NONPORTABLE Now that the portable stuff gets its own branch, these are unneeded --- Makefile | 2 +- msvc2003/CSE2.vcproj | 8 ++-- src/Back.cpp | 14 ------- src/Config.cpp | 23 ------------ src/Game.cpp | 30 +-------------- src/Generic.cpp | 39 ------------------- src/Generic.h | 4 -- src/Map.cpp | 5 --- src/MycParam.cpp | 54 --------------------------- src/NpChar.cpp | 13 ------- src/NpcTbl.cpp | 23 ------------ src/Profile.cpp | 89 +------------------------------------------- src/Stage.cpp | 6 +-- src/TextScr.cpp | 34 ++--------------- src/WindowsWrapper.h | 29 --------------- 15 files changed, 12 insertions(+), 361 deletions(-) diff --git a/Makefile b/Makefile index 361e71be..288bdcd1 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ ifeq ($(DEBUG_SAVE), 1) CXXFLAGS += -DDEBUG_SAVE endif -CXXFLAGS += -std=c++98 -MMD -MP -MF $@.d -DWINDOWS -DNONPORTABLE +CXXFLAGS += -std=c++98 -MMD -MP -MF $@.d LIBS += -lkernel32 -lgdi32 -lddraw -ldinput -ldsound -lversion -lshlwapi -limm32 -lwinmm -ldxguid ifeq ($(STATIC), 1) diff --git a/msvc2003/CSE2.vcproj b/msvc2003/CSE2.vcproj index 051ed39e..e1b724c1 100644 --- a/msvc2003/CSE2.vcproj +++ b/msvc2003/CSE2.vcproj @@ -22,7 +22,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;_DEBUG;WINDOWS;NONPORTABLE" + PreprocessorDefinitions="WIN32;_DEBUG" MinimalRebuild="TRUE" BasicRuntimeChecks="0" RuntimeLibrary="1" @@ -74,7 +74,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;NDEBUG;WINDOWS;NONPORTABLE" + PreprocessorDefinitions="WIN32;NDEBUG" MinimalRebuild="TRUE" RuntimeLibrary="0" AssemblerOutput="4" @@ -124,7 +124,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;NDEBUG;WINDOWS;NONPORTABLE;JAPANESE" + PreprocessorDefinitions="WIN32;NDEBUG;JAPANESE" MinimalRebuild="TRUE" RuntimeLibrary="0" AssemblerOutput="4" @@ -174,7 +174,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="" - PreprocessorDefinitions="WIN32;_DEBUG;WINDOWS;NONPORTABLE;JAPANESE" + PreprocessorDefinitions="WIN32;_DEBUG;JAPANESE" MinimalRebuild="TRUE" BasicRuntimeChecks="0" RuntimeLibrary="1" diff --git a/src/Back.cpp b/src/Back.cpp index 0a2f2e97..6470910e 100644 --- a/src/Back.cpp +++ b/src/Back.cpp @@ -31,7 +31,6 @@ BOOL InitBack(const char *fName, int type) if (fp == NULL) return FALSE; -#ifdef NONPORTABLE // This is ridiculously platform-dependant: // It should break on big-endian CPUs, and platforms where short isn't 16-bit and long isn't 32-bit. unsigned short bmp_header_buffer[7]; // These names aren't the original. This ruins the stack frame layout. @@ -54,19 +53,6 @@ BOOL InitBack(const char *fName, int type) gBack.partsW = bmp_header_buffer2[1]; gBack.partsH = bmp_header_buffer2[2]; -#else - if (fgetc(fp) != 'B' || fgetc(fp) != 'M') - { - fclose(fp); - return FALSE; - } - - fseek(fp, 18, SEEK_SET); - - gBack.partsW = File_ReadLE32(fp); - gBack.partsH = File_ReadLE32(fp); - fclose(fp); -#endif // Set background stuff and load texture gBack.flag = 1; diff --git a/src/Config.cpp b/src/Config.cpp index f9b19e5d..cb185a35 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -25,36 +25,13 @@ BOOL LoadConfigData(CONFIG *conf) return FALSE; // Read data -#ifdef NONPORTABLE size_t fread_result = fread(conf, sizeof(CONFIG), 1, fp); // Not the original name -#else - // Read the version id and font name - fread(conf->proof, sizeof(conf->proof), 1, fp); - fread(conf->font_name, sizeof(conf->font_name), 1, fp); - - // Read control settings - conf->move_button_mode = File_ReadLE32(fp); - conf->attack_button_mode = File_ReadLE32(fp); - conf->ok_button_mode = File_ReadLE32(fp); - - // Read display mode (320x240, 640x480, 24-bit fullscreen, 32-bit fullscreen) TODO: add more things? - conf->display_mode = File_ReadLE32(fp); - - // Read joystick configuration (if enabled, and mappings) - conf->bJoystick = File_ReadLE32(fp); - for (int button = 0; button < 8; button++) - conf->joystick_button[button] = File_ReadLE32(fp); -#endif // Close file fclose(fp); // Check if version is not correct, and return if it failed -#ifdef NONPORTABLE if (fread_result != 1 || strcmp(conf->proof, config_magic)) -#else - if (strcmp(conf->proof, config_magic)) -#endif { memset(conf, 0, sizeof(CONFIG)); return FALSE; diff --git a/src/Game.cpp b/src/Game.cpp index 82144322..771664ff 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -682,20 +682,7 @@ BOOL Game(HWND hWnd) if (!LoadGenericData()) { - #if defined(NONPORTABLE) && defined(WINDOWS) - #ifdef JAPANESE - MessageBoxA(hWnd, "\x94\xC4\x97\x70\x83\x74\x83\x40\x83\x43\x83\x8B\x82\xAA\x93\xC7\x82\xDF\x82\xC8\x82\xA2", "\x83\x47\x83\x89\x81\x5B", MB_OK); - #else - MessageBoxA(hWnd, "Couldn't read general purpose files", "Error", MB_OK); - #endif - #else - #ifdef JAPANESE - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "エラー", "汎用ファイルが読めない", NULL); - #else - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", "Couldn't read general purpose files", NULL); - #endif - #endif - + MessageBoxA(hWnd, "\x94\xC4\x97\x70\x83\x74\x83\x40\x83\x43\x83\x8B\x82\xAA\x93\xC7\x82\xDF\x82\xC8\x82\xA2", "\x83\x47\x83\x89\x81\x5B", MB_OK); return FALSE; } @@ -706,20 +693,7 @@ BOOL Game(HWND hWnd) if (!LoadNpcTable(path)) { - #if defined(NONPORTABLE) && defined(WINDOWS) - #ifdef JAPANESE - MessageBoxA(hWnd, "\x4E\x50\x43\x83\x65\x81\x5B\x83\x75\x83\x8B\x82\xAA\x93\xC7\x82\xDF\x82\xC8\x82\xA2", "\x83\x47\x83\x89\x81\x5B", MB_OK); - #else - MessageBoxA(hWnd, "Couldn't read the NPC table", "Error", MB_OK); - #endif - #else - #ifdef JAPANESE - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "エラー", "NPCテーブルが読めない", NULL); - #else - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", "Couldn't read the NPC table", NULL); - #endif - #endif - + MessageBoxA(hWnd, "\x4E\x50\x43\x83\x65\x81\x5B\x83\x75\x83\x8B\x82\xAA\x93\xC7\x82\xDF\x82\xC8\x82\xA2", "\x83\x47\x83\x89\x81\x5B", MB_OK); return FALSE; } diff --git a/src/Generic.cpp b/src/Generic.cpp index cee26700..8ee754f4 100644 --- a/src/Generic.cpp +++ b/src/Generic.cpp @@ -36,7 +36,6 @@ void GetCompileDate(int *year, int *month, int *day) *month = i; } -#ifdef WINDOWS // TODO - Inaccurate stack frame BOOL GetCompileVersion(int *v1, int *v2, int *v3, int *v4) { @@ -95,18 +94,7 @@ BOOL GetCompileVersion(int *v1, int *v2, int *v3, int *v4) return bResult; } -#else -BOOL GetCompileVersion(int *v1, int *v2, int *v3, int *v4) -{ - *v1 = 1; - *v2 = 0; - *v3 = 0; - *v4 = 6; - return TRUE; -} -#endif -#ifdef WINDOWS // This seems to be broken in recent Windows (Sndvol32.exe was renamed 'SndVol.exe') // TODO - Inaccurate stack frame BOOL OpenVolumeConfiguration(HWND hWnd) @@ -170,9 +158,7 @@ BOOL OpenVolumeConfiguration(HWND hWnd) return TRUE; #endif } -#endif -#ifdef WINDOWS void DeleteDebugLog(void) { char path[MAX_PATH]; @@ -196,9 +182,7 @@ BOOL PrintDebugLog(const char *string, int value1, int value2, int value3) fclose(fp); return TRUE; } -#endif -#ifdef WINDOWS /* This function is a mystery. It seems to check if the system time is within a certain range, specified by the two parameters. Nothing in the original game @@ -227,17 +211,12 @@ int CheckTime(SYSTEMTIME *system_time_low, SYSTEMTIME *system_time_high) else return 0; } -#endif BOOL CheckFileExists(const char *name) { char path[MAX_PATH]; -#ifdef NONPORTABLE sprintf(path, "%s\\%s", gModulePath, name); -#else - sprintf(path, "%s/%s", gModulePath, name); -#endif FILE *file = fopen(path, "rb"); @@ -250,7 +229,6 @@ BOOL CheckFileExists(const char *name) long GetFileSizeLong(const char *path) { -#ifdef NONPORTABLE DWORD len; HANDLE hFile; @@ -263,24 +241,8 @@ long GetFileSizeLong(const char *path) len = GetFileSize(hFile, NULL); CloseHandle(hFile); return len; -#else - long len; - FILE *fp; - - len = 0; - - fp = fopen(path, "rb"); - if (fp == NULL) - return -1; - - fseek(fp, 0, SEEK_END); - len = ftell(fp); - fclose(fp); - return len; -#endif } -#ifdef WINDOWS BOOL PrintBitmapError(const char *string, int value) { char path[MAX_PATH]; @@ -299,7 +261,6 @@ BOOL PrintBitmapError(const char *string, int value) fclose(fp); return TRUE; } -#endif BOOL IsShiftJIS(unsigned char c) { diff --git a/src/Generic.h b/src/Generic.h index 1743b0ea..9259689e 100644 --- a/src/Generic.h +++ b/src/Generic.h @@ -4,17 +4,13 @@ void GetCompileDate(int *year, int *month, int *day); BOOL GetCompileVersion(int *v1, int *v2, int *v3, int *v4); -#ifdef WINDOWS BOOL OpenVolumeConfiguration(HWND hWnd); void DeleteDebugLog(void); BOOL PrintDebugLog(const char *string, int value1, int value2, int value3); int CheckTime(SYSTEMTIME *system_time_low, SYSTEMTIME *system_time_high); -#endif BOOL CheckFileExists(const char *name); long GetFileSizeLong(const char *path); -#ifdef WINDOWS BOOL PrintBitmapError(const char *string, int value); -#endif BOOL IsShiftJIS(unsigned char c); BOOL CenterWindow(HWND hWnd); BOOL LoadWindowRect(HWND hWnd, const char *filename, BOOL unknown); diff --git a/src/Map.cpp b/src/Map.cpp index 6a96ce06..028d9885 100644 --- a/src/Map.cpp +++ b/src/Map.cpp @@ -50,14 +50,9 @@ BOOL LoadMapData2(const char *path_map) { fread(&dum, 1, 1, fp); // Get width and height -#ifdef NONPORTABLE // This fails on big-endian hardware, and platforms where short is not two bytes long. fread(&gMap.width, 2, 1, fp); fread(&gMap.length, 2, 1, fp); -#else - gMap.width = File_ReadLE16(fp); - gMap.length = File_ReadLE16(fp); -#endif if (gMap.data == NULL) { diff --git a/src/MycParam.cpp b/src/MycParam.cpp index 21965ff1..73177fcd 100644 --- a/src/MycParam.cpp +++ b/src/MycParam.cpp @@ -449,32 +449,14 @@ BOOL SaveTimeCounter() if (fp) { // Read data -#ifdef NONPORTABLE fread(&rec, sizeof(REC), 1, fp); -#else - rec.counter[0] = File_ReadLE32(fp); - rec.counter[1] = File_ReadLE32(fp); - rec.counter[2] = File_ReadLE32(fp); - rec.counter[3] = File_ReadLE32(fp); - rec.random[0] = fgetc(fp); - rec.random[1] = fgetc(fp); - rec.random[2] = fgetc(fp); - rec.random[3] = fgetc(fp); -#endif fclose(fp); p = (unsigned char*)&rec.counter[0]; -#ifdef NONPORTABLE p[0] -= rec.random[0]; p[1] -= rec.random[0]; p[2] -= rec.random[0]; p[3] -= rec.random[0] / 2; -#else - p[0] -= (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? (rec.random[0]) : (rec.random[0] / 2); - p[1] -= rec.random[0]; - p[2] -= rec.random[0]; - p[3] -= (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? (rec.random[0] / 2) : (rec.random[0]); -#endif // If this is faster than our new time, quit if (rec.counter[0] < time_count) return TRUE; @@ -487,35 +469,17 @@ BOOL SaveTimeCounter() rec.random[i] = Random(0, 250) + i; p = (unsigned char*)&rec.counter[i]; -#ifdef NONPORTABLE p[0] += rec.random[i]; p[1] += rec.random[i]; p[2] += rec.random[i]; p[3] += rec.random[i] / 2; -#else - p[0] += (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? (rec.random[i]) : (rec.random[i] / 2); - p[1] += rec.random[i]; - p[2] += rec.random[i]; - p[3] += (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? (rec.random[i] / 2) : (rec.random[i]); -#endif } fp = fopen(path, "wb"); if (fp == NULL) return FALSE; -#ifdef NONPORTABLE fwrite(&rec, sizeof(REC), 1, fp); -#else - File_WriteLE32(rec.counter[0], fp); - File_WriteLE32(rec.counter[1], fp); - File_WriteLE32(rec.counter[2], fp); - File_WriteLE32(rec.counter[3], fp); - fputc(rec.random[0], fp); - fputc(rec.random[1], fp); - fputc(rec.random[2], fp); - fputc(rec.random[3], fp); -#endif fclose(fp); return TRUE; @@ -537,35 +501,17 @@ int LoadTimeCounter() REC rec; // Read data -#ifdef NONPORTABLE fread(&rec, sizeof(REC), 1, fp); -#else - rec.counter[0] = File_ReadLE32(fp); - rec.counter[1] = File_ReadLE32(fp); - rec.counter[2] = File_ReadLE32(fp); - rec.counter[3] = File_ReadLE32(fp); - rec.random[0] = fgetc(fp); - rec.random[1] = fgetc(fp); - rec.random[2] = fgetc(fp); - rec.random[3] = fgetc(fp); -#endif fclose(fp); // Decode from checksum for (i = 0; i < 4; i++) { p = (unsigned char*)&rec.counter[i]; -#ifdef NONPORTABLE p[0] -= rec.random[i]; p[1] -= rec.random[i]; p[2] -= rec.random[i]; p[3] -= rec.random[i] / 2; -#else - p[0] -= (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? (rec.random[i]) : (rec.random[i] / 2); - p[1] -= rec.random[i]; - p[2] -= rec.random[i]; - p[3] -= (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? (rec.random[i] / 2) : (rec.random[i]); -#endif } // Verify checksum's result diff --git a/src/NpChar.cpp b/src/NpChar.cpp index 79854404..536cd9f2 100644 --- a/src/NpChar.cpp +++ b/src/NpChar.cpp @@ -78,11 +78,7 @@ BOOL LoadEvent(const char *path_event) } // Get amount of NPCs -#ifdef NONPORTABLE fread(&count, 4, 1, fp); -#else - count = File_ReadLE32(fp); -#endif // Load NPCs memset(gNPC, 0, sizeof(gNPC)); @@ -91,16 +87,7 @@ BOOL LoadEvent(const char *path_event) for (i = 0; i < count; i++) { // Get data from file -#ifdef NONPORTABLE fread(&eve, sizeof(EVENT), 1, fp); -#else - eve.x = File_ReadLE16(fp); - eve.y = File_ReadLE16(fp); - eve.code_flag = File_ReadLE16(fp); - eve.code_event = File_ReadLE16(fp); - eve.code_char = File_ReadLE16(fp); - eve.bits = File_ReadLE16(fp); -#endif // Set NPC parameters gNPC[n].direct = (eve.bits & NPC_SPAWN_IN_OTHER_DIRECTION) ? 2 : 0; diff --git a/src/NpcTbl.cpp b/src/NpcTbl.cpp index 25784433..819073eb 100644 --- a/src/NpcTbl.cpp +++ b/src/NpcTbl.cpp @@ -36,7 +36,6 @@ BOOL LoadNpcTable(const char *path) return FALSE; } -#ifdef NONPORTABLE for (n = 0; n < num; n++) // bits fread(&gNpcTable[n].bits, 2, 1, fp); for (n = 0; n < num; n++) // life @@ -57,28 +56,6 @@ BOOL LoadNpcTable(const char *path) fread(&gNpcTable[n].hit, 4, 1, fp); for (n = 0; n < num; n++) // view fread(&gNpcTable[n].view, 4, 1, fp); -#else - for (n = 0; n < num; n++) // bits - gNpcTable[n].bits = File_ReadLE16(fp); - for (n = 0; n < num; n++) // life - gNpcTable[n].life = File_ReadLE16(fp); - for (n = 0; n < num; n++) // surf - fread(&gNpcTable[n].surf, 1, 1, fp); - for (n = 0; n < num; n++) // destroy_voice - fread(&gNpcTable[n].destroy_voice, 1, 1, fp); - for (n = 0; n < num; n++) // hit_voice - fread(&gNpcTable[n].hit_voice, 1, 1, fp); - for (n = 0; n < num; n++) // size - fread(&gNpcTable[n].size, 1, 1, fp); - for (n = 0; n < num; n++) // exp - gNpcTable[n].exp = File_ReadLE32(fp); - for (n = 0; n < num; n++) // damage - gNpcTable[n].damage = File_ReadLE32(fp); - for (n = 0; n < num; n++) // hit - fread(&gNpcTable[n].hit, 4, 1, fp); - for (n = 0; n < num; n++) // view - fread(&gNpcTable[n].view, 4, 1, fp); -#endif fclose(fp); return TRUE; diff --git a/src/Profile.cpp b/src/Profile.cpp index c8f09ac8..c5d35591 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -79,43 +79,7 @@ BOOL SaveProfile(const char *name) memcpy(profile.flags, gFlagNPC, sizeof(profile.flags)); // Write to file -#ifdef NONPORTABLE fwrite(&profile, sizeof(PROFILE), 1, fp); -#else - fwrite(profile.code, 8, 1, fp); - File_WriteLE32(profile.stage, fp); - File_WriteLE32(profile.music, fp); - File_WriteLE32(profile.x, fp); - File_WriteLE32(profile.y, fp); - File_WriteLE32(profile.direct, fp); - File_WriteLE16(profile.max_life, fp); - File_WriteLE16(profile.star, fp); - File_WriteLE16(profile.life, fp); - File_WriteLE16(profile.a, fp); - File_WriteLE32(profile.select_arms, fp); - File_WriteLE32(profile.select_item, fp); - File_WriteLE32(profile.equip, fp); - File_WriteLE32(profile.unit, fp); - File_WriteLE32(profile.counter, fp); - for (int arm = 0; arm < 8; arm++) - { - File_WriteLE32(profile.arms[arm].code, fp); - File_WriteLE32(profile.arms[arm].level, fp); - File_WriteLE32(profile.arms[arm].exp, fp); - File_WriteLE32(profile.arms[arm].max_num, fp); - File_WriteLE32(profile.arms[arm].num, fp); - } - for (int item = 0; item < 32; item++) - File_WriteLE32(profile.items[item].code, fp); - for (int stage = 0; stage < 8; stage++) - { - File_WriteLE32(profile.permitstage[stage].index, fp); - File_WriteLE32(profile.permitstage[stage].event, fp); - } - fwrite(profile.permit_mapping, 0x80, 1, fp); - fwrite(FLAG, 4, 1, fp); - fwrite(profile.flags, 1000, 1, fp); -#endif fclose(fp); return TRUE; @@ -151,43 +115,7 @@ BOOL LoadProfile(const char *name) // Read data fseek(fp, 0, SEEK_SET); memset(&profile, 0, sizeof(PROFILE)); -#ifdef NONPORTABLE fread(&profile, sizeof(PROFILE), 1, fp); -#else - fread(profile.code, 8, 1, fp); - profile.stage = File_ReadLE32(fp); - profile.music = (MusicID)File_ReadLE32(fp); - profile.x = File_ReadLE32(fp); - profile.y = File_ReadLE32(fp); - profile.direct = File_ReadLE32(fp); - profile.max_life = File_ReadLE16(fp); - profile.star = File_ReadLE16(fp); - profile.life = File_ReadLE16(fp); - profile.a = File_ReadLE16(fp); - profile.select_arms = File_ReadLE32(fp); - profile.select_item = File_ReadLE32(fp); - profile.equip = File_ReadLE32(fp); - profile.unit = File_ReadLE32(fp); - profile.counter = File_ReadLE32(fp); - for (int arm = 0; arm < 8; arm++) - { - profile.arms[arm].code = File_ReadLE32(fp); - profile.arms[arm].level = File_ReadLE32(fp); - profile.arms[arm].exp = File_ReadLE32(fp); - profile.arms[arm].max_num = File_ReadLE32(fp); - profile.arms[arm].num = File_ReadLE32(fp); - } - for (int item = 0; item < 32; item++) - profile.items[item].code = File_ReadLE32(fp); - for (int stage = 0; stage < 8; stage++) - { - profile.permitstage[stage].index = File_ReadLE32(fp); - profile.permitstage[stage].event = File_ReadLE32(fp); - } - fread(profile.permit_mapping, 0x80, 1, fp); - fread(profile.FLAG, 4, 1, fp); - fread(profile.flags, 1000, 1, fp); -#endif fclose(fp); // Set things @@ -250,22 +178,7 @@ BOOL InitializeGame(HWND hWnd) InitFlags(); if (!TransferStage(13, 200, 10, 8)) { - #if defined(NONPORTABLE) && defined(WINDOWS) - #ifdef JAPANESE - MessageBoxA(hWnd, "\x83\x58\x83\x65\x81\x5B\x83\x57\x82\xCC\x93\xC7\x82\xDD\x8D\x9E\x82\xDD\x82\xC9\x8E\xB8\x94\x73", "\x83\x47\x83\x89\x81\x5B", MB_OK); - #else - MessageBoxA(hWnd, "Failed to load stage", "Error", MB_OK); - #endif - #else - (void)hWnd; - - #ifdef JAPANESE - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "エラー", "ステージの読み込みに失敗", NULL); - #else - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", "Failed to load stage", NULL); - #endif - #endif - + MessageBoxA(hWnd, "\x83\x58\x83\x65\x81\x5B\x83\x57\x82\xCC\x93\xC7\x82\xDD\x8D\x9E\x82\xDD\x82\xC9\x8E\xB8\x94\x73", "\x83\x47\x83\x89\x81\x5B", MB_OK); return FALSE; } diff --git a/src/Stage.cpp b/src/Stage.cpp index 29ab34e0..1e68fe40 100644 --- a/src/Stage.cpp +++ b/src/Stage.cpp @@ -224,11 +224,7 @@ const char *gMusicTable[42] = "ACCESS", "IRONH", "GRAND", -#ifdef NONPORTABLE - "Curly", // The vanilla game used the original filename instead of the internal 8.3 one -#else - "CURLY", -#endif + "Curly", // Uses the original filename instead of the internal 8.3 one "OSIDE", "REQUIEM", "WANPAK2", diff --git a/src/TextScr.cpp b/src/TextScr.cpp index c8d12781..b8933e49 100644 --- a/src/TextScr.cpp +++ b/src/TextScr.cpp @@ -705,20 +705,7 @@ int TextScriptProc() y = GetTextScriptNo(gTS.p_read + 19); if (!TransferStage(z, w, x, y)) { - #if defined(NONPORTABLE) && defined(WINDOWS) - #ifdef JAPANESE - MessageBoxA(ghWnd, "\x83\x58\x83\x65\x81\x5B\x83\x57\x82\xCC\x93\xC7\x82\xDD\x8D\x9E\x82\xDD\x82\xC9\x8E\xB8\x94\x73", "\x83\x47\x83\x89\x81\x5B", MB_OK); - #else - MessageBoxA(ghWnd, "Failed to load stage", "Error", MB_OK); - #endif - #else - #ifdef JAPANESE - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "エラー", "ステージの読み込みに失敗", NULL); - #else - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", "Failed to load stage", NULL); - #endif - #endif - + MessageBoxA(ghWnd, "\x83\x58\x83\x65\x81\x5B\x83\x57\x82\xCC\x93\xC7\x82\xDD\x8D\x9E\x82\xDD\x82\xC9\x8E\xB8\x94\x73", "\x83\x47\x83\x89\x81\x5B", MB_OK); return 0; } } @@ -1270,23 +1257,8 @@ int TextScriptProc() else { char str_0[0x40]; - #ifdef JAPANESE - #if defined(NONPORTABLE) && defined(WINDOWS) - sprintf(str_0, "\x95\x73\x96\xBE\x82\xCC\x83\x52\x81\x5B\x83\x68:<%c%c%c", gTS.data[gTS.p_read + 1], gTS.data[gTS.p_read + 2], gTS.data[gTS.p_read + 3]); - MessageBoxA(NULL, str_0, "\x83\x47\x83\x89\x81\x5B", MB_OK); - #else - sprintf(str_0, "不明のコード:<%c%c%c", gTS.data[gTS.p_read + 1], gTS.data[gTS.p_read + 2], gTS.data[gTS.p_read + 3]); - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "エラー", str_0, NULL); - #endif - #else - sprintf(str_0, "Unknown code:<%c%c%c", gTS.data[gTS.p_read + 1], gTS.data[gTS.p_read + 2], gTS.data[gTS.p_read + 3]); - #if defined(NONPORTABLE) && defined(WINDOWS) - MessageBoxA(NULL, str_0, "Error", MB_OK); - #else - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", str_0, NULL); - #endif - #endif - + sprintf(str_0, "\x95\x73\x96\xBE\x82\xCC\x83\x52\x81\x5B\x83\x68:<%c%c%c", gTS.data[gTS.p_read + 1], gTS.data[gTS.p_read + 2], gTS.data[gTS.p_read + 3]); + MessageBoxA(NULL, str_0, "\x83\x47\x83\x89\x81\x5B", MB_OK); return 0; } } diff --git a/src/WindowsWrapper.h b/src/WindowsWrapper.h index 42ea3f46..820ee531 100644 --- a/src/WindowsWrapper.h +++ b/src/WindowsWrapper.h @@ -1,35 +1,10 @@ #pragma once -#ifdef WINDOWS #include // Avoid name collisions #undef DrawText #undef FindResource #undef CreateWindow -#else - -#include - -typedef int HWND; - -typedef int BOOL; - -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef TRUE -#define TRUE 1 -#endif - -struct RECT -{ - long left; - long top; - long right; - long bottom; -}; -#endif #define SET_RECT(rect, l, t, r, b) \ rect.left = l; \ @@ -37,8 +12,4 @@ struct RECT rect.right = r; \ rect.bottom = b; -#ifndef MAX_PATH -#define MAX_PATH FILENAME_MAX -#endif - BOOL SystemTask();