Made Dialog.cpp valid C89

See #41
This commit is contained in:
Clownacy 2020-01-06 21:01:17 +00:00
parent fb8ba25d0f
commit 65682dd913
7 changed files with 50 additions and 12 deletions

View file

@ -11,7 +11,7 @@ extern "C" {
// "Num" often means "ammo" here
/// Weapon struct
struct ARMS
typedef struct ARMS
{
/// ID of the weapon
int code;
@ -27,13 +27,13 @@ struct ARMS
/// Current ammunition
int num;
};
} ARMS;
struct ITEM
typedef struct ITEM
{
/// ID of the item
int code;
};
} ITEM;
// Limits for the amount of weapons and items

View file

@ -19,8 +19,6 @@ static const char *version_string =
// TODO - Inaccurate stack frame
INT_PTR __stdcall VersionDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
(void)lParam;
char string_buffer[104];
int year;
@ -32,6 +30,8 @@ INT_PTR __stdcall VersionDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPara
int version3;
int version4;
(void)lParam;
switch (Msg)
{
case WM_INITDIALOG:
@ -104,10 +104,10 @@ INT_PTR __stdcall DebugMuteDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPa
INT_PTR __stdcall DebugSaveDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
(void)lParam;
char string[100];
(void)lParam;
switch (Msg)
{
case WM_INITDIALOG:

View file

@ -2,7 +2,15 @@
#include "WindowsWrapper.h"
#ifdef __cplusplus
extern "C" {
#endif
INT_PTR __stdcall VersionDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
INT_PTR __stdcall DebugMuteDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
INT_PTR __stdcall DebugSaveDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
INT_PTR __stdcall QuitDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
#ifdef __cplusplus
}
#endif

View file

@ -2,6 +2,10 @@
#include "WindowsWrapper.h"
#ifdef __cplusplus
extern "C" {
#endif
void GetCompileDate(int *year, int *month, int *day);
BOOL GetCompileVersion(int *v1, int *v2, int *v3, int *v4);
BOOL OpenVolumeConfiguration(HWND hWnd);
@ -16,3 +20,7 @@ BOOL CenterWindow(HWND hWnd);
BOOL LoadWindowRect(HWND hWnd, const char *filename, BOOL unknown);
BOOL SaveWindowRect(HWND hWnd, const char *filename);
BOOL IsEnableBitmap(const char *path);
#ifdef __cplusplus
}
#endif

View file

@ -6,7 +6,11 @@
#include "SelStage.h"
#include "Stage.h"
struct PROFILE
#ifdef __cplusplus
extern "C" {
#endif
typedef struct PROFILE
{
char code[8];
int stage;
@ -29,9 +33,13 @@ struct PROFILE
signed char permit_mapping[0x80];
char FLAG[4];
unsigned char flags[1000];
};
} PROFILE;
BOOL IsProfile(void);
BOOL SaveProfile(const char *name);
BOOL LoadProfile(const char *name);
BOOL InitializeGame(HWND hWnd);
#ifdef __cplusplus
}
#endif

View file

@ -2,11 +2,15 @@
#include "WindowsWrapper.h"
struct PERMIT_STAGE
#ifdef __cplusplus
extern "C" {
#endif
typedef struct PERMIT_STAGE
{
int index;
int event;
};
} PERMIT_STAGE;
extern PERMIT_STAGE gPermitStage[8];
@ -16,3 +20,7 @@ BOOL SubPermitStage(int index);
void MoveStageSelectCursor(void);
void PutStageSelectObject(void);
int StageSelectLoop(int *p_event);
#ifdef __cplusplus
}
#endif

View file

@ -243,6 +243,12 @@
</File>
<File
RelativePath="..\src\Dialog.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
CompileAs="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\Draw.cpp">