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

View file

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

View file

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

View file

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

View file

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

View file

@ -2,6 +2,10 @@
#include "WindowsWrapper.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct MAP_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_Front(int fx, int fy);
void PutMapDataVector(int fx, int fy);
#ifdef __cplusplus
}
#endif

View file

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

View file

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

View file

@ -9,6 +9,10 @@
#include "WindowsWrapper.h"
#ifdef __cplusplus
extern "C" {
#endif
#define MAXTRACK 16
#define MAXMELODY 8
#define MAXDRAM 8
@ -27,3 +31,7 @@ void StopOrganyaMusic(void);
void SetOrganyaFadeout(void);
BOOL StartOrganya(LPDIRECTSOUND lpDS, const char *wave_filename);
void EndOrganya(void);
#ifdef __cplusplus
}
#endif

View file

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

View file

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

View file

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

View file

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