From a9265e8b4553f3aaedf55192b89e2d09ea8d5037 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Thu, 17 Oct 2019 00:47:25 +0100 Subject: [PATCH 1/6] Fix some errors when compiled with Visual Studio 6 Thanks to Mint for testing VS6. The compiler would complain about the declaration of these variables being skipped by the switch's labels. Pretty sure this is perfectly-legal C++98, but whatever. ... Stupid old compilers. --- src/NpcAct140.cpp | 4 +++- src/NpcAct180.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/NpcAct140.cpp b/src/NpcAct140.cpp index 032a4c35..e9a8575c 100644 --- a/src/NpcAct140.cpp +++ b/src/NpcAct140.cpp @@ -1949,6 +1949,8 @@ void ActNpc158(NPCHAR *npc) // Monster X (defeated) void ActNpc159(NPCHAR *npc) { + int i; + RECT rect = {144, 128, 192, 200}; switch (npc->act_no) @@ -1956,7 +1958,7 @@ void ActNpc159(NPCHAR *npc) case 0: npc->act_no = 1; - for (int i = 0; i < 8; ++i) + for (i = 0; i < 8; ++i) SetNpChar(4, npc->x + (Random(-16, 16) * 0x200), npc->y + (Random(-16, 16) * 0x200), Random(-341, 341), Random(-341, 341), 0, 0, 0x100); // Fallthrough case 1: diff --git a/src/NpcAct180.cpp b/src/NpcAct180.cpp index ba41f9a2..7d781346 100644 --- a/src/NpcAct180.cpp +++ b/src/NpcAct180.cpp @@ -970,6 +970,8 @@ void ActNpc189(NPCHAR *npc) // Broken robot void ActNpc190(NPCHAR *npc) { + int i; + RECT rect[2] = { {192, 32, 208, 48}, {208, 32, 224, 48}, @@ -983,7 +985,7 @@ void ActNpc190(NPCHAR *npc) case 10: PlaySoundObject(72, 1); - for (int i = 0; i < 8; i++) + for (i = 0; i < 8; i++) SetNpChar(4, npc->x, npc->y + (Random(-8, 8) << 9), Random(-8, -2) << 9, Random(-3, 3) << 9, 0, 0, 0x100); npc->cond = 0; break; From a8cf5e1846bb20f283c1bd65e0b660394df782d7 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Sun, 20 Oct 2019 21:07:26 +0000 Subject: [PATCH 2/6] Fix a typo in a comment --- src/Draw.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Draw.cpp b/src/Draw.cpp index 41db1003..924a44d7 100644 --- a/src/Draw.cpp +++ b/src/Draw.cpp @@ -833,7 +833,7 @@ void InitTextObject(const char *name) // This breaks the Japanese text on English Windows installations. // Also, the game uses DEFAULT_QUALITY instead of NONANTIALIASED_QUALITY, - // causing font antialiasing to blend with the colour-key, giving text ab + // causing font antialiasing to blend with the colour-key, giving text an // ugly black outline. #ifdef FIX_BUGS #define QUALITY NONANTIALIASED_QUALITY From dda0dd2fac199d7b3885f3def88461437842614c Mon Sep 17 00:00:00 2001 From: Clownacy Date: Mon, 21 Oct 2019 18:56:26 +0100 Subject: [PATCH 3/6] Fix mismatching function declaration in header Noticed this while trying to compile CSE2 with winelib. --- src/Sound.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sound.h b/src/Sound.h index 65691e49..5fc15768 100644 --- a/src/Sound.h +++ b/src/Sound.h @@ -38,7 +38,7 @@ extern LPDIRECTSOUNDBUFFER lpSECONDARYBUFFER[SE_MAX]; BOOL InitDirectSound(HWND hwnd); void EndDirectSound(void); void PlaySoundObject(int no, int mode); -void ChangeSoundFrequency(int no, unsigned long rate); +void ChangeSoundFrequency(int no, DWORD rate); void ChangeSoundVolume(int no, long volume); void ChangeSoundPan(int no, long pan); int MakePixToneObject(const PIXTONEPARAMETER *ptp, int ptp_num, int no); From f6dd58429e62e1b8d8d4e4062f3d69a84482294b Mon Sep 17 00:00:00 2001 From: Clownacy Date: Mon, 21 Oct 2019 19:25:34 +0100 Subject: [PATCH 4/6] Add missing boolean values --- src/Input.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Input.cpp b/src/Input.cpp index bcbff426..b27c063b 100644 --- a/src/Input.cpp +++ b/src/Input.cpp @@ -169,7 +169,7 @@ BOOL GetJoystickStatus(JOYSTICK_STATUS *status) if (res) { if (res == DIERR_INPUTLOST) - SetDeviceAquire(0); + SetDeviceAquire(FALSE); else return FALSE; } @@ -214,7 +214,7 @@ BOOL ResetJoystickStatus(void) if (res) { if (res == DIERR_INPUTLOST) - SetDeviceAquire(0); + SetDeviceAquire(FALSE); else return FALSE; } From f690f9907dd5f5ee7b49e6cfa157141321366e87 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Mon, 21 Oct 2019 19:28:21 +0100 Subject: [PATCH 5/6] Convert some old Shift-JIS comments to UTF-8 --- src/MapName.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/MapName.cpp b/src/MapName.cpp index 0a40ab79..ea257a4e 100644 --- a/src/MapName.cpp +++ b/src/MapName.cpp @@ -16,12 +16,12 @@ void ReadyMapName(const char *str) // Handle "Studio Pixel presents" text in the intro, using an obfuscated string unsigned char presentText[24] = { #ifdef JAPANESE - // "ŠJ”­ŽºPixel presents" - 0x8A - 1, // ŠJ + // "開発室Pixel presents" + 0x8A - 1, // é–‹ 0x4A - 1, - 0x94 - 1, // ”­ + 0x94 - 1, // 発 0xAD - 1, - 0x8E - 1, // Žº + 0x8E - 1, // 室 0xBA - 1, 'P' - 1, 'i' - 1, From b1418f7fae9cdf8e5fb32f99af49e783bf9b0e9f Mon Sep 17 00:00:00 2001 From: Clownacy Date: Mon, 21 Oct 2019 19:33:49 +0100 Subject: [PATCH 6/6] Remove a leftover unsigned literal --- src/NpChar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NpChar.cpp b/src/NpChar.cpp index 846dc54c..9e50f2b3 100644 --- a/src/NpChar.cpp +++ b/src/NpChar.cpp @@ -136,7 +136,7 @@ void SetNpChar(int code_char, int x, int y, int xm, int ym, int dir, NPCHAR *npc // Set NPC parameters memset(&gNPC[n], 0, sizeof(NPCHAR)); - gNPC[n].cond |= 0x80u; + gNPC[n].cond |= 0x80; gNPC[n].direct = dir; gNPC[n].code_char = code_char; gNPC[n].x = x;