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.
This commit is contained in:
parent
ec97ae4805
commit
f6606b7748
7 changed files with 37 additions and 37 deletions
|
@ -40,7 +40,7 @@ DLGPROC_RET CALLBACK VersionDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lP
|
||||||
sprintf(string_buffer, version_string, version1, version2, version3, version4, year, month, day);
|
sprintf(string_buffer, version_string, version1, version2, version3, version4, year, month, day);
|
||||||
SetDlgItemTextA(hWnd, 1011, string_buffer);
|
SetDlgItemTextA(hWnd, 1011, string_buffer);
|
||||||
|
|
||||||
CenterWindow(hWnd);
|
CenteringWindowByParent(hWnd);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ DLGPROC_RET CALLBACK DebugMuteDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM
|
||||||
switch (Msg)
|
switch (Msg)
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
CenterWindow(hWnd);
|
CenteringWindowByParent(hWnd);
|
||||||
CheckDlgButton(hWnd, 1010, g_mute[0] != 0);
|
CheckDlgButton(hWnd, 1010, g_mute[0] != 0);
|
||||||
CheckDlgButton(hWnd, 1018, g_mute[1] != 0);
|
CheckDlgButton(hWnd, 1018, g_mute[1] != 0);
|
||||||
CheckDlgButton(hWnd, 1019, g_mute[2] != 0);
|
CheckDlgButton(hWnd, 1019, g_mute[2] != 0);
|
||||||
|
@ -112,7 +112,7 @@ DLGPROC_RET CALLBACK DebugSaveDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
SetDlgItemTextA(hWnd, 1008, "000.dat");
|
SetDlgItemTextA(hWnd, 1008, "000.dat");
|
||||||
CenterWindow(hWnd);
|
CenteringWindowByParent(hWnd);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
|
@ -141,7 +141,7 @@ DLGPROC_RET CALLBACK QuitDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPara
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
SetDlgItemTextA(hWnd, 1009, (LPCSTR)lParam);
|
SetDlgItemTextA(hWnd, 1009, (LPCSTR)lParam);
|
||||||
CenterWindow(hWnd);
|
CenteringWindowByParent(hWnd);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
|
|
16
src/Draw.cpp
16
src/Draw.cpp
|
@ -61,7 +61,7 @@ static int y_offset;
|
||||||
#define FRAMERATE 20
|
#define FRAMERATE 20
|
||||||
|
|
||||||
// The original name for this function is unknown
|
// The original name for this function is unknown
|
||||||
void SetWindowPadding(int width, int height)
|
void SetClientOffset(int width, int height)
|
||||||
{
|
{
|
||||||
x_offset = width;
|
x_offset = width;
|
||||||
y_offset = height;
|
y_offset = height;
|
||||||
|
@ -296,7 +296,7 @@ BOOL MakeSurface_File(const char *name, SurfaceID surf_no)
|
||||||
|
|
||||||
if (!IsEnableBitmap(path))
|
if (!IsEnableBitmap(path))
|
||||||
{
|
{
|
||||||
PrintBitmapError(path, 0);
|
ErrorLog(path, 0);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -306,20 +306,20 @@ BOOL MakeSurface_File(const char *name, SurfaceID surf_no)
|
||||||
if (surf_no > SURFACE_ID_MAX)
|
if (surf_no > SURFACE_ID_MAX)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
PrintBitmapError("surface no", surf_no);
|
ErrorLog("surface no", surf_no);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (surf[surf_no] != NULL)
|
if (surf[surf_no] != NULL)
|
||||||
{
|
{
|
||||||
PrintBitmapError("existing", surf_no);
|
ErrorLog("existing", surf_no);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
HANDLE handle = LoadImageA(GetModuleHandleA(NULL), path, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION);
|
HANDLE handle = LoadImageA(GetModuleHandleA(NULL), path, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION);
|
||||||
if (handle == NULL)
|
if (handle == NULL)
|
||||||
{
|
{
|
||||||
PrintBitmapError(path, 1);
|
ErrorLog(path, 1);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -434,7 +434,7 @@ BOOL ReloadBitmap_File(const char *name, SurfaceID surf_no)
|
||||||
|
|
||||||
if (!IsEnableBitmap(path))
|
if (!IsEnableBitmap(path))
|
||||||
{
|
{
|
||||||
PrintBitmapError(path, 0);
|
ErrorLog(path, 0);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -444,14 +444,14 @@ BOOL ReloadBitmap_File(const char *name, SurfaceID surf_no)
|
||||||
if (surf_no > SURFACE_ID_MAX)
|
if (surf_no > SURFACE_ID_MAX)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
PrintBitmapError("surface no", surf_no);
|
ErrorLog("surface no", surf_no);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
HANDLE handle = LoadImageA(GetModuleHandleA(NULL), path, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION);
|
HANDLE handle = LoadImageA(GetModuleHandleA(NULL), path, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION);
|
||||||
if (handle == NULL)
|
if (handle == NULL)
|
||||||
{
|
{
|
||||||
PrintBitmapError(path, 1);
|
ErrorLog(path, 1);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ typedef enum SurfaceID
|
||||||
SURFACE_ID_MAX = 40
|
SURFACE_ID_MAX = 40
|
||||||
} SurfaceID;
|
} SurfaceID;
|
||||||
|
|
||||||
void SetWindowPadding(int width, int height);
|
void SetClientOffset(int width, int height);
|
||||||
BOOL Flip_SystemTask(HWND hWnd);
|
BOOL Flip_SystemTask(HWND hWnd);
|
||||||
BOOL StartDirectDraw(HWND hWnd, int lMagnification, int lColourDepth);
|
BOOL StartDirectDraw(HWND hWnd, int lMagnification, int lColourDepth);
|
||||||
void EndDirectDraw(HWND hWnd);
|
void EndDirectDraw(HWND hWnd);
|
||||||
|
|
|
@ -85,7 +85,7 @@ fail:
|
||||||
|
|
||||||
// This seems to be broken in recent Windows (Sndvol32.exe was renamed 'SndVol.exe')
|
// This seems to be broken in recent Windows (Sndvol32.exe was renamed 'SndVol.exe')
|
||||||
// TODO - Inaccurate stack frame
|
// TODO - Inaccurate stack frame
|
||||||
BOOL OpenVolumeConfiguration(HWND hWnd)
|
BOOL OpenSoundVolume(HWND hWnd)
|
||||||
{
|
{
|
||||||
#ifdef FIX_BUGS
|
#ifdef FIX_BUGS
|
||||||
char path[MAX_PATH];
|
char path[MAX_PATH];
|
||||||
|
@ -152,7 +152,7 @@ BOOL OpenVolumeConfiguration(HWND hWnd)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeleteDebugLog(void)
|
void DeleteLog(void)
|
||||||
{
|
{
|
||||||
char path[MAX_PATH];
|
char path[MAX_PATH];
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ void DeleteDebugLog(void)
|
||||||
DeleteFileA(path);
|
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];
|
char path[MAX_PATH];
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
@ -184,7 +184,7 @@ uses this code.
|
||||||
This is just speculation, but this *might* have been used in those prototypes
|
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.
|
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 FileTime1;
|
||||||
FILETIME FileTime2;
|
FILETIME FileTime2;
|
||||||
|
@ -205,7 +205,7 @@ int CheckTime(SYSTEMTIME *system_time_low, SYSTEMTIME *system_time_high)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL CheckFileExists(const char *name)
|
BOOL IsKeyFile(const char *name)
|
||||||
{
|
{
|
||||||
char path[MAX_PATH];
|
char path[MAX_PATH];
|
||||||
|
|
||||||
|
@ -236,7 +236,7 @@ long GetFileSizeLong(const char *path)
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL PrintBitmapError(const char *string, int value)
|
BOOL ErrorLog(const char *string, int value)
|
||||||
{
|
{
|
||||||
char path[MAX_PATH];
|
char path[MAX_PATH];
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
@ -267,7 +267,7 @@ BOOL IsShiftJIS(unsigned char c)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO - Inaccurate stack frame
|
// TODO - Inaccurate stack frame
|
||||||
BOOL CenterWindow(HWND hWnd)
|
BOOL CenteringWindowByParent(HWND hWnd)
|
||||||
{
|
{
|
||||||
RECT window_rect;
|
RECT window_rect;
|
||||||
HWND parent_hwnd;
|
HWND parent_hwnd;
|
||||||
|
|
|
@ -4,15 +4,15 @@
|
||||||
|
|
||||||
void GetCompileDate(int *year, int *month, int *day);
|
void GetCompileDate(int *year, int *month, int *day);
|
||||||
BOOL GetCompileVersion(int *v1, int *v2, int *v3, int *v4);
|
BOOL GetCompileVersion(int *v1, int *v2, int *v3, int *v4);
|
||||||
BOOL OpenVolumeConfiguration(HWND hWnd);
|
BOOL OpenSoundVolume(HWND hWnd);
|
||||||
void DeleteDebugLog(void);
|
void DebugLog(void);
|
||||||
BOOL PrintDebugLog(const char *string, int value1, int value2, int value3);
|
BOOL WriteLog(const char *string, int value1, int value2, int value3);
|
||||||
int CheckTime(SYSTEMTIME *system_time_low, SYSTEMTIME *system_time_high);
|
int GetDateLimit(SYSTEMTIME *system_time_low, SYSTEMTIME *system_time_high);
|
||||||
BOOL CheckFileExists(const char *name);
|
BOOL IsKeyFile(const char *name);
|
||||||
long GetFileSizeLong(const char *path);
|
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 IsShiftJIS(unsigned char c);
|
||||||
BOOL CenterWindow(HWND hWnd);
|
BOOL CenteringWindowByParent(HWND hWnd);
|
||||||
BOOL LoadWindowRect(HWND hWnd, const char *filename, BOOL unknown);
|
BOOL LoadWindowRect(HWND hWnd, const char *filename, BOOL unknown);
|
||||||
BOOL SaveWindowRect(HWND hWnd, const char *filename);
|
BOOL SaveWindowRect(HWND hWnd, const char *filename);
|
||||||
BOOL IsEnableBitmap(const char *path);
|
BOOL IsEnableBitmap(const char *path);
|
||||||
|
|
|
@ -40,8 +40,8 @@ void ReleaseDirectInput(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The original name for this function and its variables are unknown
|
// The original name for this function's variables are unknown
|
||||||
BOOL SetDeviceAquire(BOOL aquire)
|
BOOL ActivateDirectInput(BOOL aquire)
|
||||||
{
|
{
|
||||||
if (aquire == TRUE)
|
if (aquire == TRUE)
|
||||||
{
|
{
|
||||||
|
@ -176,7 +176,7 @@ BOOL GetJoystickStatus(JOYSTICK_STATUS *status)
|
||||||
if (res != DI_OK)
|
if (res != DI_OK)
|
||||||
{
|
{
|
||||||
if (res == DIERR_INPUTLOST)
|
if (res == DIERR_INPUTLOST)
|
||||||
SetDeviceAquire(FALSE);
|
ActivateDirectInput(FALSE);
|
||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -221,7 +221,7 @@ BOOL ResetJoystickStatus(void)
|
||||||
if (res != DI_OK)
|
if (res != DI_OK)
|
||||||
{
|
{
|
||||||
if (res == DIERR_INPUTLOST)
|
if (res == DIERR_INPUTLOST)
|
||||||
SetDeviceAquire(FALSE);
|
ActivateDirectInput(FALSE);
|
||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
12
src/Main.cpp
12
src/Main.cpp
|
@ -158,7 +158,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||||
}
|
}
|
||||||
|
|
||||||
// Swap left and right weapon switch keys
|
// Swap left and right weapon switch keys
|
||||||
if (CheckFileExists("s_reverse"))
|
if (IsKeyFile("s_reverse"))
|
||||||
{
|
{
|
||||||
gKeyArms = KEY_ARMSREV;
|
gKeyArms = KEY_ARMSREV;
|
||||||
gKeyArmsRev = KEY_ARMS;
|
gKeyArmsRev = KEY_ARMS;
|
||||||
|
@ -262,7 +262,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||||
x = (GetSystemMetrics(SM_CXSCREEN) - nWidth) / 2;
|
x = (GetSystemMetrics(SM_CXSCREEN) - nWidth) / 2;
|
||||||
y = (GetSystemMetrics(SM_CYSCREEN) - nHeight) / 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);
|
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;
|
ghWnd = hWnd;
|
||||||
|
@ -309,7 +309,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||||
windowWidth = WINDOW_WIDTH * 2;
|
windowWidth = WINDOW_WIDTH * 2;
|
||||||
windowHeight = WINDOW_HEIGHT * 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);
|
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;
|
ghWnd = hWnd;
|
||||||
|
@ -457,11 +457,11 @@ LRESULT CALLBACK WindowProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPar
|
||||||
DrawMenuBar(hWnd);
|
DrawMenuBar(hWnd);
|
||||||
|
|
||||||
hMenu = GetMenu(hWnd);
|
hMenu = GetMenu(hWnd);
|
||||||
if (!CheckFileExists("mute"))
|
if (!IsKeyFile("mute"))
|
||||||
DeleteMenu(hMenu, 40007, MF_BYCOMMAND);
|
DeleteMenu(hMenu, 40007, MF_BYCOMMAND);
|
||||||
DrawMenuBar(hWnd);
|
DrawMenuBar(hWnd);
|
||||||
|
|
||||||
if (CheckFileExists("fps"))
|
if (IsKeyFile("fps"))
|
||||||
bFps = TRUE;
|
bFps = TRUE;
|
||||||
|
|
||||||
if (!bFullscreen)
|
if (!bFullscreen)
|
||||||
|
@ -685,7 +685,7 @@ LRESULT CALLBACK WindowProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPar
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 40004:
|
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
|
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;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue