Made TextScr.cpp valid C89

See #41
This commit is contained in:
Clownacy 2020-01-06 21:15:42 +00:00
parent 65682dd913
commit 9498fe13be
15 changed files with 117 additions and 16 deletions

View file

@ -2,7 +2,15 @@
#include "WindowsWrapper.h"
#ifdef __cplusplus
extern "C" {
#endif
void InitBossLife(void);
BOOL StartBossLife(int code_event);
BOOL StartBossLife2(void);
void PutBossLife(void);
#ifdef __cplusplus
}
#endif

View file

@ -4,6 +4,10 @@
#include "CommonDefines.h"
#ifdef __cplusplus
extern "C" {
#endif
struct CREDIT
{
long size;
@ -53,3 +57,7 @@ int GetScriptNumber(const char *text);
void SetCreditIllust(int a);
void CutCreditIllust(void);
int Scene_DownIsland(HWND hWnd, int mode);
#ifdef __cplusplus
}
#endif

View file

@ -2,6 +2,10 @@
#include "WindowsWrapper.h"
#ifdef __cplusplus
extern "C" {
#endif
void InitFade(void);
void SetFadeMask(void);
void ClearFade(void);
@ -10,3 +14,7 @@ void StartFadeIn(signed char dir);
void ProcFade(void);
void PutFade(void);
BOOL GetFadeActive(void);
#ifdef __cplusplus
}
#endif

View file

@ -2,6 +2,10 @@
#include "WindowsWrapper.h"
#ifdef __cplusplus
extern "C" {
#endif
extern unsigned char gFlagNPC[1000];
extern unsigned char gSkipFlag[8];
@ -13,3 +17,7 @@ BOOL GetNPCFlag(long a);
void SetSkipFlag(long a);
void CutSkipFlag(long a);
BOOL GetSkipFlag(long a);
#ifdef __cplusplus
}
#endif

View file

@ -1,5 +1,9 @@
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
enum KeyBind
{
//The movement keys go in the order of left, right, up and down
@ -53,3 +57,7 @@ extern long gKeyRight;
extern long gKeyDown;
void GetTrg(void);
#ifdef __cplusplus
}
#endif

View file

@ -20,6 +20,7 @@
#include "Organya.h"
#include "Profile.h"
#include "Sound.h"
#include "Tags.h"
#include "Triangle.h"
LRESULT __stdcall WindowProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);

View file

@ -2,6 +2,10 @@
#include "WindowsWrapper.h"
#ifdef __cplusplus
extern "C" {
#endif
extern HWND ghWnd;
extern BOOL bFullscreen;
@ -9,3 +13,7 @@ void PutFramePerSecound(void);
unsigned long GetFramePerSecound(void);
BOOL SystemTask(void);
#ifdef __cplusplus
}
#endif

View file

@ -2,9 +2,17 @@
#include "WindowsWrapper.h"
#ifdef __cplusplus
extern "C" {
#endif
extern char gMapping[0x80];
int MiniMapLoop(void);
BOOL IsMapping(void);
void StartMapping(void);
void SetMapping(int a);
#ifdef __cplusplus
}
#endif

View file

@ -2,16 +2,20 @@
#include "WindowsWrapper.h"
struct ARMS_LEVEL
#ifdef __cplusplus
extern "C" {
#endif
typedef struct ARMS_LEVEL
{
int exp[3];
};
} ARMS_LEVEL;
struct REC
typedef struct REC
{
long counter[4];
unsigned char random[4];
};
} REC;
extern ARMS_LEVEL gArmsLevelTable[14];
@ -30,3 +34,7 @@ void PutMyAir(int x, int y);
void PutTimeCounter(int x, int y);
BOOL SaveTimeCounter(void);
int LoadTimeCounter(void);
#ifdef __cplusplus
}
#endif

View file

@ -2,15 +2,19 @@
#include "WindowsWrapper.h"
struct PIXTONEPARAMETER2
#ifdef __cplusplus
extern "C" {
#endif
typedef struct PIXTONEPARAMETER2
{
int model;
double num;
int top;
int offset;
};
} PIXTONEPARAMETER2;
struct PIXTONEPARAMETER
typedef struct PIXTONEPARAMETER
{
int use;
int size;
@ -24,7 +28,11 @@ struct PIXTONEPARAMETER
int pointBy;
int pointCx;
int pointCy;
};
} PIXTONEPARAMETER;
void MakeWaveTables(void);
BOOL MakePixelWaveData(const PIXTONEPARAMETER *ptp, unsigned char *pData);
#ifdef __cplusplus
}
#endif

View file

@ -11,6 +11,10 @@
#include "PixTone.h"
#ifdef __cplusplus
extern "C" {
#endif
#define SE_MAX 160 // According to the Organya source code release, this is the real name for this constant
enum SoundEffectNames
@ -42,3 +46,7 @@ void ChangeSoundFrequency(int no, DWORD rate);
void ChangeSoundVolume(int no, long volume);
void ChangeSoundPan(int no, long pan);
int MakePixToneObject(const PIXTONEPARAMETER *ptp, int ptp_num, int no);
#ifdef __cplusplus
}
#endif

View file

@ -2,5 +2,13 @@
#include "WindowsWrapper.h"
#ifdef __cplusplus
extern "C" {
#endif
extern char gModulePath[MAX_PATH];
extern char gDataPath[MAX_PATH];
#ifdef __cplusplus
}
#endif

View file

@ -120,8 +120,10 @@ void EncryptionBinaryData2(unsigned char *pData, long size)
// Load generic .tsc
BOOL LoadTextScript2(const char *name)
{
// Get path
char path[MAX_PATH];
FILE *fp;
// Get path
sprintf(path, "%s\\%s", gDataPath, name);
gTS.size = GetFileSizeLong(path);
@ -129,7 +131,7 @@ BOOL LoadTextScript2(const char *name)
return FALSE;
// Open file
FILE *fp = fopen(path, "rb");
fp = fopen(path, "rb");
if (fp == NULL)
return FALSE;
@ -150,15 +152,19 @@ BOOL LoadTextScript2(const char *name)
// Load stage .tsc
BOOL LoadTextScript_Stage(const char *name)
{
// Open Head.tsc
char path[MAX_PATH];
FILE *fp;
long head_size;
long body_size;
// Open Head.tsc
sprintf(path, "%s\\%s", gDataPath, "Head.tsc");
long head_size = GetFileSizeLong(path);
head_size = GetFileSizeLong(path);
if (head_size == INVALID_FILE_SIZE)
return FALSE;
FILE *fp = fopen(path, "rb");
fp = fopen(path, "rb");
if (fp == NULL)
return FALSE;
@ -171,7 +177,7 @@ BOOL LoadTextScript_Stage(const char *name)
// Open stage's .tsc
sprintf(path, "%s\\%s", gDataPath, name);
long body_size = GetFileSizeLong(path);
body_size = GetFileSizeLong(path);
if (body_size == INVALID_FILE_SIZE)
return FALSE;

View file

@ -6,7 +6,7 @@
extern "C" {
#endif
struct TEXT_SCRIPT
typedef struct TEXT_SCRIPT
{
// Path (reload when exit teleporter menu/inventory)
char path[MAX_PATH];
@ -55,7 +55,7 @@ struct TEXT_SCRIPT
// NOD cursor blink
unsigned char wait_beam;
};
} TEXT_SCRIPT;
BOOL InitTextScript2(void);
void EndTextScript(void);

View file

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