shithub: cstory

Download patch

ref: f6606b7748c1b698e7b685c226de8d939a87af9a
parent: ec97ae4805e2733d16fb755f4204bdbe5ebb74dc
author: Clownacy <Clownacy@users.noreply.github.com>
date: Sun Mar 22 11:07:29 EDT 2020

Add some missing function names

These were retrieved from the Mac port (v0.0.7), which kept these
functions.

Unfortunately, this port is missing local variable names, so we can't
use it to make InitBack accurate.

--- a/src/Dialog.cpp
+++ b/src/Dialog.cpp
@@ -40,7 +40,7 @@
 			sprintf(string_buffer, version_string, version1, version2, version3, version4, year, month, day);
 			SetDlgItemTextA(hWnd, 1011, string_buffer);
 
-			CenterWindow(hWnd);
+			CenteringWindowByParent(hWnd);
 
 			return TRUE;
 
@@ -65,7 +65,7 @@
 	switch (Msg)
 	{
 		case WM_INITDIALOG:
-			CenterWindow(hWnd);
+			CenteringWindowByParent(hWnd);
 			CheckDlgButton(hWnd, 1010, g_mute[0] != 0);
 			CheckDlgButton(hWnd, 1018, g_mute[1] != 0);
 			CheckDlgButton(hWnd, 1019, g_mute[2] != 0);
@@ -112,7 +112,7 @@
 	{
 		case WM_INITDIALOG:
 			SetDlgItemTextA(hWnd, 1008, "000.dat");
-			CenterWindow(hWnd);
+			CenteringWindowByParent(hWnd);
 			return TRUE;
 
 		case WM_COMMAND:
@@ -141,7 +141,7 @@
 	{
 		case WM_INITDIALOG:
 			SetDlgItemTextA(hWnd, 1009, (LPCSTR)lParam);
-			CenterWindow(hWnd);
+			CenteringWindowByParent(hWnd);
 			return TRUE;
 
 		case WM_COMMAND:
--- a/src/Draw.cpp
+++ b/src/Draw.cpp
@@ -61,7 +61,7 @@
 #define FRAMERATE 20
 
 // The original name for this function is unknown
-void SetWindowPadding(int width, int height)
+void SetClientOffset(int width, int height)
 {
 	x_offset = width;
 	y_offset = height;
@@ -296,7 +296,7 @@
 
 	if (!IsEnableBitmap(path))
 	{
-		PrintBitmapError(path, 0);
+		ErrorLog(path, 0);
 		return FALSE;
 	}
 
@@ -306,13 +306,13 @@
 	if (surf_no > SURFACE_ID_MAX)
 #endif
 	{
-		PrintBitmapError("surface no", surf_no);
+		ErrorLog("surface no", surf_no);
 		return FALSE;
 	}
 
 	if (surf[surf_no] != NULL)
 	{
-		PrintBitmapError("existing", surf_no);
+		ErrorLog("existing", surf_no);
 		return FALSE;
 	}
 
@@ -319,7 +319,7 @@
 	HANDLE handle = LoadImageA(GetModuleHandleA(NULL), path, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION);
 	if (handle == NULL)
 	{
-		PrintBitmapError(path, 1);
+		ErrorLog(path, 1);
 		return FALSE;
 	}
 
@@ -434,7 +434,7 @@
 
 	if (!IsEnableBitmap(path))
 	{
-		PrintBitmapError(path, 0);
+		ErrorLog(path, 0);
 		return FALSE;
 	}
 
@@ -444,7 +444,7 @@
 	if (surf_no > SURFACE_ID_MAX)
 #endif
 	{
-		PrintBitmapError("surface no", surf_no);
+		ErrorLog("surface no", surf_no);
 		return FALSE;
 	}
 
@@ -451,7 +451,7 @@
 	HANDLE handle = LoadImageA(GetModuleHandleA(NULL), path, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION);
 	if (handle == NULL)
 	{
-		PrintBitmapError(path, 1);
+		ErrorLog(path, 1);
 		return FALSE;
 	}
 
--- a/src/Draw.h
+++ b/src/Draw.h
@@ -44,7 +44,7 @@
 	SURFACE_ID_MAX = 40
 } SurfaceID;
 
-void SetWindowPadding(int width, int height);
+void SetClientOffset(int width, int height);
 BOOL Flip_SystemTask(HWND hWnd);
 BOOL StartDirectDraw(HWND hWnd, int lMagnification, int lColourDepth);
 void EndDirectDraw(HWND hWnd);
--- a/src/Generic.cpp
+++ b/src/Generic.cpp
@@ -85,7 +85,7 @@
 
 // This seems to be broken in recent Windows (Sndvol32.exe was renamed 'SndVol.exe')
 // TODO - Inaccurate stack frame
-BOOL OpenVolumeConfiguration(HWND hWnd)
+BOOL OpenSoundVolume(HWND hWnd)
 {
 #ifdef FIX_BUGS
 	char path[MAX_PATH];
@@ -152,7 +152,7 @@
 #endif
 }
 
-void DeleteDebugLog(void)
+void DeleteLog(void)
 {
 	char path[MAX_PATH];
 
@@ -160,7 +160,7 @@
 	DeleteFileA(path);
 }
 
-BOOL PrintDebugLog(const char *string, int value1, int value2, int value3)
+BOOL WriteLog(const char *string, int value1, int value2, int value3)
 {
 	char path[MAX_PATH];
 	FILE *fp;
@@ -184,7 +184,7 @@
 This is just speculation, but this *might* have been used in those prototypes
 Pixel released to testers, to prevent them from running after a certain date.
 */
-int CheckTime(SYSTEMTIME *system_time_low, SYSTEMTIME *system_time_high)
+int GetDateLimit(SYSTEMTIME *system_time_low, SYSTEMTIME *system_time_high)
 {
 	FILETIME FileTime1;
 	FILETIME FileTime2;
@@ -205,7 +205,7 @@
 	return 0;
 }
 
-BOOL CheckFileExists(const char *name)
+BOOL IsKeyFile(const char *name)
 {
 	char path[MAX_PATH];
 
@@ -236,7 +236,7 @@
 	return len;
 }
 
-BOOL PrintBitmapError(const char *string, int value)
+BOOL ErrorLog(const char *string, int value)
 {
 	char path[MAX_PATH];
 	FILE *fp;
@@ -267,7 +267,7 @@
 }
 
 // TODO - Inaccurate stack frame
-BOOL CenterWindow(HWND hWnd)
+BOOL CenteringWindowByParent(HWND hWnd)
 {
 	RECT window_rect;
 	HWND parent_hwnd;
--- a/src/Generic.h
+++ b/src/Generic.h
@@ -4,15 +4,15 @@
 
 void GetCompileDate(int *year, int *month, int *day);
 BOOL GetCompileVersion(int *v1, int *v2, int *v3, int *v4);
-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);
-BOOL CheckFileExists(const char *name);
+BOOL OpenSoundVolume(HWND hWnd);
+void DebugLog(void);
+BOOL WriteLog(const char *string, int value1, int value2, int value3);
+int GetDateLimit(SYSTEMTIME *system_time_low, SYSTEMTIME *system_time_high);
+BOOL IsKeyFile(const char *name);
 long GetFileSizeLong(const char *path);
-BOOL PrintBitmapError(const char *string, int value);
+BOOL ErrorLog(const char *string, int value);
 BOOL IsShiftJIS(unsigned char c);
-BOOL CenterWindow(HWND hWnd);
+BOOL CenteringWindowByParent(HWND hWnd);
 BOOL LoadWindowRect(HWND hWnd, const char *filename, BOOL unknown);
 BOOL SaveWindowRect(HWND hWnd, const char *filename);
 BOOL IsEnableBitmap(const char *path);
--- a/src/Input.cpp
+++ b/src/Input.cpp
@@ -40,8 +40,8 @@
 	}
 }
 
-// The original name for this function and its variables are unknown
-BOOL SetDeviceAquire(BOOL aquire)
+// The original name for this function's variables are unknown
+BOOL ActivateDirectInput(BOOL aquire)
 {
 	if (aquire == TRUE)
 	{
@@ -176,7 +176,7 @@
 	if (res != DI_OK)
 	{
 		if (res == DIERR_INPUTLOST)
-			SetDeviceAquire(FALSE);
+			ActivateDirectInput(FALSE);
 		else
 			return FALSE;
 	}
@@ -221,7 +221,7 @@
 	if (res != DI_OK)
 	{
 		if (res == DIERR_INPUTLOST)
-			SetDeviceAquire(FALSE);
+			ActivateDirectInput(FALSE);
 		else
 			return FALSE;
 	}
--- a/src/Main.cpp
+++ b/src/Main.cpp
@@ -158,7 +158,7 @@
 	}
 
 	// Swap left and right weapon switch keys
-	if (CheckFileExists("s_reverse"))
+	if (IsKeyFile("s_reverse"))
 	{
 		gKeyArms = KEY_ARMSREV;
 		gKeyArmsRev = KEY_ARMS;
@@ -262,7 +262,7 @@
 			x = (GetSystemMetrics(SM_CXSCREEN) - nWidth) / 2;
 			y = (GetSystemMetrics(SM_CYSCREEN) - nHeight) / 2;
 
-			SetWindowPadding(GetSystemMetrics(SM_CXFIXEDFRAME) + 1, GetSystemMetrics(SM_CYFIXEDFRAME) + GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYMENU) + 1);
+			SetClientOffset(GetSystemMetrics(SM_CXFIXEDFRAME) + 1, GetSystemMetrics(SM_CYFIXEDFRAME) + GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYMENU) + 1);
 
 			hWnd = CreateWindowExA(WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR, lpWindowName, lpWindowName, WS_MINIMIZEBOX | WS_SYSMENU | WS_BORDER | WS_DLGFRAME | WS_VISIBLE, x, y, nWidth, nHeight, NULL, NULL, hInstance, NULL);
 			ghWnd = hWnd;
@@ -309,7 +309,7 @@
 			windowWidth = WINDOW_WIDTH * 2;
 			windowHeight = WINDOW_HEIGHT * 2;
 
-			SetWindowPadding(0, 0);
+			SetClientOffset(0, 0);
 
 			hWnd = CreateWindowExA(WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR, lpWindowName, lpWindowName, WS_SYSMENU | WS_VISIBLE | WS_POPUP, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), NULL, NULL, hInstance, NULL);
 			ghWnd = hWnd;
@@ -457,11 +457,11 @@
 			DrawMenuBar(hWnd);
 
 			hMenu = GetMenu(hWnd);
-			if (!CheckFileExists("mute"))
+			if (!IsKeyFile("mute"))
 				DeleteMenu(hMenu, 40007, MF_BYCOMMAND);
 			DrawMenuBar(hWnd);
 
-			if (CheckFileExists("fps"))
+			if (IsKeyFile("fps"))
 				bFps = TRUE;
 
 			if (!bFullscreen)
@@ -685,7 +685,7 @@
 					break;
 
 				case 40004:
-					if (!OpenVolumeConfiguration(hWnd))
+					if (!OpenSoundVolume(hWnd))
 						MessageBoxA(hWnd, "\x83\x7B\x83\x8A\x83\x85\x81\x5B\x83\x80\x90\xDD\x92\xE8\x82\xF0\x8B\x4E\x93\xAE\x82\xC5\x82\xAB\x82\xDC\x82\xB9\x82\xF1\x82\xC5\x82\xB5\x82\xBD", lpWindowName, 0);	// 'ボリューム設定を起動できませんでした' (Could not launch volume configuration) in Shift-JIS
 					break;