ref: 35344c5f4fa158a5253680cc2e5789df9bac2838
parent: 2a70cbe89a3c2dea944d7d52edf48c62f79827d8
author: Clownacy <Clownacy@users.noreply.github.com>
date: Sun Sep 1 22:02:25 EDT 2019
Fixes What is it with Pixel's official code, and relying on non-standard stuff? Even his PxTone library had portability issues.
--- 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"
--- 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
--- a/src/Generic.cpp
+++ b/src/Generic.cpp
@@ -281,7 +281,7 @@
}
#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 @@
}
// 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;
--- a/src/Generic.h
+++ b/src/Generic.h
@@ -13,10 +13,10 @@
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);
--- a/src/Main.cpp
+++ b/src/Main.cpp
@@ -31,8 +31,8 @@
HWND ghWnd;
BOOL bFullscreen;
+BOOL gbUseJoystick = FALSE;
-static BOOL gbUseJoystick = FALSE;
static BOOL bFps = FALSE;
static BOOL bActive = TRUE;
@@ -655,24 +655,24 @@
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;
}
--- 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"
--- 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"
--- 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"
--- a/src/NpcTbl.cpp
+++ b/src/NpcTbl.cpp
@@ -6,7 +6,6 @@
#include "WindowsWrapper.h"
-#include "File.h"
#include "Generic.h"
#include "NpcAct.h"
--- a/src/Organya.cpp
+++ b/src/Organya.cpp
@@ -109,7 +109,7 @@
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 @@
//グローバル変数 (Global variable)
/*■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/
static UINT ExactTime = 13; // 最小精度 (Minimum accuracy)
-static UINT TimerID = NULL;
+static UINT TimerID;
static BOOL nameless_flag;
/*■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/
@@ -799,7 +799,7 @@
/*■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/
BOOL StartTimer(DWORD dwTimer)
{
- MMRESULT ret = NULL;
+ MMRESULT ret = MMSYSERR_NOERROR;
ExactTime = dwTimer;
// タイマーを生成する (Generate timer)
@@ -808,7 +808,7 @@
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)
);
--- 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"