From 35344c5f4fa158a5253680cc2e5789df9bac2838 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Mon, 2 Sep 2019 02:02:25 +0100 Subject: [PATCH] Fixes What is it with Pixel's official code, and relying on non-standard stuff? Even his PxTone library had portability issues. --- src/Back.cpp | 1 - src/Config.cpp | 1 - src/Generic.cpp | 4 ++-- src/Generic.h | 4 ++-- src/Main.cpp | 12 ++++++------ src/Map.cpp | 1 - src/MycParam.cpp | 1 - src/NpChar.cpp | 1 - src/NpcTbl.cpp | 1 - src/Organya.cpp | 8 ++++---- src/Profile.cpp | 1 - 11 files changed, 14 insertions(+), 21 deletions(-) diff --git a/src/Back.cpp b/src/Back.cpp index 443503a2..0a2f2e97 100644 --- a/src/Back.cpp +++ b/src/Back.cpp @@ -7,7 +7,6 @@ #include "CommonDefines.h" #include "Draw.h" -#include "File.h" #include "Frame.h" #include "Game.h" #include "Map.h" diff --git a/src/Config.cpp b/src/Config.cpp index d66d1fd6..f9b19e5d 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -5,7 +5,6 @@ #include "WindowsWrapper.h" #include "Config.h" -#include "File.h" #include "Tags.h" static const char* const config_filename = "Config.dat"; // Not the original name diff --git a/src/Generic.cpp b/src/Generic.cpp index 0ce59b7f..cee26700 100644 --- a/src/Generic.cpp +++ b/src/Generic.cpp @@ -281,7 +281,7 @@ long GetFileSizeLong(const char *path) } #ifdef WINDOWS -BOOL PrintBitmapError(char *string, int value) +BOOL PrintBitmapError(const char *string, int value) { char path[MAX_PATH]; FILE *fp; @@ -351,7 +351,7 @@ BOOL CenterWindow(HWND hWnd) } // TODO - Inaccurate stack frame -BOOL LoadWindowRect(HWND hWnd, char *filename, BOOL unknown) +BOOL LoadWindowRect(HWND hWnd, const char *filename, BOOL unknown) { char path[MAX_PATH]; int min_window_width; diff --git a/src/Generic.h b/src/Generic.h index 217a3baa..1743b0ea 100644 --- a/src/Generic.h +++ b/src/Generic.h @@ -13,10 +13,10 @@ int CheckTime(SYSTEMTIME *system_time_low, SYSTEMTIME *system_time_high); BOOL CheckFileExists(const char *name); long GetFileSizeLong(const char *path); #ifdef WINDOWS -BOOL PrintBitmapError(char *string, int value); +BOOL PrintBitmapError(const char *string, int value); #endif BOOL IsShiftJIS(unsigned char c); BOOL CenterWindow(HWND hWnd); -BOOL LoadWindowRect(HWND hWnd, char *filename, BOOL unknown); +BOOL LoadWindowRect(HWND hWnd, const char *filename, BOOL unknown); BOOL SaveWindowRect(HWND hWnd, const char *filename); BOOL IsEnableBitmap(const char *path); diff --git a/src/Main.cpp b/src/Main.cpp index b9a023ca..f31d1b3d 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -31,8 +31,8 @@ int gJoystickButtonTable[8]; HWND ghWnd; BOOL bFullscreen; +BOOL gbUseJoystick = FALSE; -static BOOL gbUseJoystick = FALSE; static BOOL bFps = FALSE; static BOOL bActive = TRUE; @@ -655,24 +655,24 @@ LRESULT __stdcall WindowProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPa break; case 40002: - DialogBoxParamA(ghInstance, "DLG_ABOUT", hWnd, VersionDialog, NULL); + DialogBoxParamA(ghInstance, "DLG_ABOUT", hWnd, VersionDialog, 0); break; case 40004: if (!OpenVolumeConfiguration(hWnd)) #ifdef JAPANESE - MessageBoxA(hWnd, "â{âèâàü[âÇɦÆÞé­ïNô«é+é½é_é¦é±é+éÁé¢", lpWindowName, NULL); + MessageBoxA(hWnd, "â{âèâàü[âÇɦÆÞé­ïNô«é+é½é_é¦é±é+éÁé¢", lpWindowName, 0); #else - MessageBoxA(hWnd, "Could not launch volume configuration", lpWindowName, NULL); + MessageBoxA(hWnd, "Could not launch volume configuration", lpWindowName, 0); #endif break; case 40005: - DialogBoxParamA(ghInstance, "DLG_SAVE", hWnd, DebugSaveDialog, NULL); + DialogBoxParamA(ghInstance, "DLG_SAVE", hWnd, DebugSaveDialog, 0); break; case 40007: - DialogBoxParamA(ghInstance, "DLG_MUTE", hWnd, DebugMuteDialog, NULL); + DialogBoxParamA(ghInstance, "DLG_MUTE", hWnd, DebugMuteDialog, 0); break; } diff --git a/src/Map.cpp b/src/Map.cpp index f0cd6b9e..6a96ce06 100644 --- a/src/Map.cpp +++ b/src/Map.cpp @@ -9,7 +9,6 @@ #include "CommonDefines.h" #include "Draw.h" -#include "File.h" #include "NpChar.h" #include "Tags.h" diff --git a/src/MycParam.cpp b/src/MycParam.cpp index 2d843abc..21965ff1 100644 --- a/src/MycParam.cpp +++ b/src/MycParam.cpp @@ -9,7 +9,6 @@ #include "Caret.h" #include "Draw.h" #include "Game.h" -#include "File.h" #include "MyChar.h" #include "NpChar.h" #include "Sound.h" diff --git a/src/NpChar.cpp b/src/NpChar.cpp index bef60e69..79854404 100644 --- a/src/NpChar.cpp +++ b/src/NpChar.cpp @@ -9,7 +9,6 @@ #include "ArmsItem.h" #include "Caret.h" #include "Draw.h" -#include "File.h" #include "Flags.h" #include "Game.h" #include "MyChar.h" diff --git a/src/NpcTbl.cpp b/src/NpcTbl.cpp index 56a46349..25784433 100644 --- a/src/NpcTbl.cpp +++ b/src/NpcTbl.cpp @@ -6,7 +6,6 @@ #include "WindowsWrapper.h" -#include "File.h" #include "Generic.h" #include "NpcAct.h" diff --git a/src/Organya.cpp b/src/Organya.cpp index 9c207133..8961ab19 100644 --- a/src/Organya.cpp +++ b/src/Organya.cpp @@ -109,7 +109,7 @@ typedef struct OrgData void PlayData(void); void SetPlayPointer(long x); // 再生ポインターを指定の位置に設定 (Set playback pointer to specified position) // 以下はファイル関係 (The following are related to files) - BOOL OrgData::InitMusicData(const char *path); + BOOL InitMusicData(const char *path); } ORGDATA; ORGDATA org_data; @@ -765,7 +765,7 @@ BOOL QuitMMTimer(); //グローバル変数 (Global variable) /*■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/ static UINT ExactTime = 13; // 最小精度 (Minimum accuracy) -static UINT TimerID = NULL; +static UINT TimerID; static BOOL nameless_flag; /*■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/ @@ -799,7 +799,7 @@ BOOL InitMMTimer() /*■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/ BOOL StartTimer(DWORD dwTimer) { - MMRESULT ret = NULL; + MMRESULT ret = MMSYSERR_NOERROR; ExactTime = dwTimer; // タイマーを生成する (Generate timer) @@ -808,7 +808,7 @@ BOOL StartTimer(DWORD dwTimer) dwTimer, // タイマー時間 (Timer time) 10, // 許容できるタイマー精度 (Acceptable timer accuracy) (LPTIMECALLBACK)TimerProc, // コールバックプロシージャ (Callback procedure) - NULL, // ユーザーがコールバック関数のdwUserに送る情報値 (Information value sent by user to dwUser in callback function) + 0, // ユーザーがコールバック関数のdwUserに送る情報値 (Information value sent by user to dwUser in callback function) TIME_PERIODIC // タイマー時間毎にイベントを発生させる (Generate an event every timer time) ); diff --git a/src/Profile.cpp b/src/Profile.cpp index 4136a9bd..c8f09ac8 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -9,7 +9,6 @@ #include "ArmsItem.h" #include "BossLife.h" #include "Fade.h" -#include "File.h" #include "Flags.h" #include "Frame.h" #include "Game.h"