Made Stage.cpp valid C89

See #41
This commit is contained in:
Clownacy 2020-01-06 20:57:11 +00:00
parent 33c1ea8f20
commit fb8ba25d0f
13 changed files with 107 additions and 13 deletions

View file

@ -2,7 +2,11 @@
#include "WindowsWrapper.h" #include "WindowsWrapper.h"
struct BACK #ifdef __cplusplus
extern "C" {
#endif
typedef struct BACK
{ {
BOOL flag; // Basically unused BOOL flag; // Basically unused
int partsW; int partsW;
@ -11,7 +15,7 @@ struct BACK
int numY; int numY;
int type; int type;
int fx; int fx;
}; } BACK;
extern BACK gBack; extern BACK gBack;
extern int gWaterY; extern int gWaterY;
@ -20,3 +24,7 @@ BOOL InitBack(const char *fName, int type);
void ActBack(void); void ActBack(void);
void PutBack(int fx, int fy); void PutBack(int fx, int fy);
void PutFront(int fx, int fy); void PutFront(int fx, int fy);
#ifdef __cplusplus
}
#endif

View file

@ -2,6 +2,10 @@
#include "NpChar.h" #include "NpChar.h"
#ifdef __cplusplus
extern "C" {
#endif
#define BOSS_MAX 20 #define BOSS_MAX 20
extern NPCHAR gBoss[BOSS_MAX]; extern NPCHAR gBoss[BOSS_MAX];
@ -14,3 +18,7 @@ void SetBossCharActNo(int a);
void HitBossBullet(void); void HitBossBullet(void);
void ActBossChar(void); void ActBossChar(void);
void HitBossMap(void); void HitBossMap(void);
#ifdef __cplusplus
}
#endif

View file

@ -2,6 +2,10 @@
#include "WindowsWrapper.h" #include "WindowsWrapper.h"
#ifdef __cplusplus
extern "C" {
#endif
struct CARET_TABLE struct CARET_TABLE
{ {
int view_left; int view_left;
@ -30,3 +34,7 @@ void InitCaret(void);
void ActCaret(void); void ActCaret(void);
void PutCaret(int fx, int fy); void PutCaret(int fx, int fy);
void SetCaret(int x, int y, int code, int dir); void SetCaret(int x, int y, int code, int dir);
#ifdef __cplusplus
}
#endif

View file

@ -1,5 +1,9 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
void InitFlash(void); void InitFlash(void);
void SetFlash(int x, int y, int mode); void SetFlash(int x, int y, int mode);
void ActFlash_Explosion(int flx, int fly); void ActFlash_Explosion(int flx, int fly);
@ -7,3 +11,7 @@ void ActFlash_Flash(void);
void ActFlash(int flx, int fly); void ActFlash(int flx, int fly);
void PutFlash(void); void PutFlash(void);
void ResetFlash(void); void ResetFlash(void);
#ifdef __cplusplus
}
#endif

View file

@ -1,6 +1,10 @@
#pragma once #pragma once
struct FRAME #ifdef __cplusplus
extern "C" {
#endif
typedef struct FRAME
{ {
int x; int x;
int y; int y;
@ -9,7 +13,7 @@ struct FRAME
int wait; int wait;
int quake; int quake;
int quake2; int quake2;
}; } FRAME;
extern FRAME gFrame; extern FRAME gFrame;
@ -23,3 +27,7 @@ void SetFrameTargetBoss(int no, int wait);
void SetQuake(int time); void SetQuake(int time);
void SetQuake2(int time); void SetQuake2(int time);
void ResetQuake(void); void ResetQuake(void);
#ifdef __cplusplus
}
#endif

View file

@ -2,6 +2,10 @@
#include "WindowsWrapper.h" #include "WindowsWrapper.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct MAP_DATA typedef struct MAP_DATA
{ {
unsigned char *data; unsigned char *data;
@ -25,3 +29,7 @@ BOOL ChangeMapParts(int x, int y, unsigned char no);
void PutStage_Back(int fx, int fy); void PutStage_Back(int fx, int fy);
void PutStage_Front(int fx, int fy); void PutStage_Front(int fx, int fy);
void PutMapDataVector(int fx, int fy); void PutMapDataVector(int fx, int fy);
#ifdef __cplusplus
}
#endif

View file

@ -2,7 +2,15 @@
#include "WindowsWrapper.h" #include "WindowsWrapper.h"
#ifdef __cplusplus
extern "C" {
#endif
void ReadyMapName(const char *str); void ReadyMapName(const char *str);
void PutMapName(BOOL bMini); void PutMapName(BOOL bMini);
void StartMapName(void); void StartMapName(void);
void RestoreMapName(void); void RestoreMapName(void);
#ifdef __cplusplus
}
#endif

View file

@ -5,6 +5,10 @@
#include "Draw.h" #include "Draw.h"
#ifdef __cplusplus
extern "C" {
#endif
#define NPC_MAX 0x200 #define NPC_MAX 0x200
enum NPCCond enum NPCCond
@ -51,7 +55,7 @@ enum NPCNames
// To be continued // To be continued
}; };
struct NPCHAR typedef struct NPCHAR
{ {
unsigned char cond; unsigned char cond;
int flag; int flag;
@ -98,8 +102,8 @@ struct NPCHAR
unsigned char shock; unsigned char shock;
int damage_view; int damage_view;
int damage; int damage;
NPCHAR *pNpc; struct NPCHAR *pNpc;
}; } NPCHAR;
struct EVENT struct EVENT
{ {
@ -140,3 +144,7 @@ void GetNpCharPosition(int *x, int *y, int i);
BOOL IsNpCharCode(int code); BOOL IsNpCharCode(int code);
BOOL GetNpCharAlive(int code_event); BOOL GetNpCharAlive(int code_event);
int CountAliveNpChar(void); int CountAliveNpChar(void);
#ifdef __cplusplus
}
#endif

View file

@ -1,4 +1,4 @@
#pragma once #pragma once
#ifdef FIX_BUGS #ifdef FIX_BUGS
// The original source code forgot to set this (you can tell because, in the original EXE, // The original source code forgot to set this (you can tell because, in the original EXE,
@ -9,6 +9,10 @@
#include "WindowsWrapper.h" #include "WindowsWrapper.h"
#ifdef __cplusplus
extern "C" {
#endif
#define MAXTRACK 16 #define MAXTRACK 16
#define MAXMELODY 8 #define MAXMELODY 8
#define MAXDRAM 8 #define MAXDRAM 8
@ -27,3 +31,7 @@ void StopOrganyaMusic(void);
void SetOrganyaFadeout(void); void SetOrganyaFadeout(void);
BOOL StartOrganya(LPDIRECTSOUND lpDS, const char *wave_filename); BOOL StartOrganya(LPDIRECTSOUND lpDS, const char *wave_filename);
void EndOrganya(void); void EndOrganya(void);
#ifdef __cplusplus
}
#endif

View file

@ -248,9 +248,9 @@ const char *gMusicTable[42] = {
"WHITE" "WHITE"
}; };
MusicID gMusicNo;
unsigned int gOldPos; unsigned int gOldPos;
MusicID gOldNo; MusicID gOldNo;
MusicID gMusicNo;
void ChangeMusic(MusicID no) void ChangeMusic(MusicID no)
{ {

View file

@ -2,7 +2,11 @@
#include "WindowsWrapper.h" #include "WindowsWrapper.h"
enum MusicID #ifdef __cplusplus
extern "C" {
#endif
typedef enum MusicID
{ {
MUS_SILENCE = 0x0, MUS_SILENCE = 0x0,
MUS_MISCHIEVOUS_ROBOT = 0x1, MUS_MISCHIEVOUS_ROBOT = 0x1,
@ -46,9 +50,9 @@ enum MusicID
MUS_SEAL_CHAMBER = 0x27, MUS_SEAL_CHAMBER = 0x27,
MUS_TOROKOS_THEME = 0x28, MUS_TOROKOS_THEME = 0x28,
MUS_WHITE = 0x29 MUS_WHITE = 0x29
}; } MusicID;
struct STAGE_TABLE typedef struct STAGE_TABLE
{ {
char parts[0x20]; char parts[0x20];
char map[0x20]; char map[0x20];
@ -58,7 +62,7 @@ struct STAGE_TABLE
char boss[0x20]; char boss[0x20];
signed char boss_no; signed char boss_no;
char name[0x20]; char name[0x20];
}; } STAGE_TABLE;
extern int gStageNo; extern int gStageNo;
extern MusicID gMusicNo; extern MusicID gMusicNo;
@ -66,3 +70,7 @@ extern MusicID gMusicNo;
BOOL TransferStage(int no, int w, int x, int y); BOOL TransferStage(int no, int w, int x, int y);
void ChangeMusic(MusicID no); void ChangeMusic(MusicID no);
void ReCallMusic(void); void ReCallMusic(void);
#ifdef __cplusplus
}
#endif

View file

@ -2,6 +2,10 @@
#include "WindowsWrapper.h" #include "WindowsWrapper.h"
#ifdef __cplusplus
extern "C" {
#endif
struct TEXT_SCRIPT struct TEXT_SCRIPT
{ {
// Path (reload when exit teleporter menu/inventory) // Path (reload when exit teleporter menu/inventory)
@ -64,3 +68,7 @@ void StopTextScript(void);
void PutTextScript(void); void PutTextScript(void);
int TextScriptProc(void); int TextScriptProc(void);
void RestoreTextScript(void); void RestoreTextScript(void);
#ifdef __cplusplus
}
#endif

View file

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