shithub: cstory

Download patch

ref: 30968a626cc6c15264a0fd39418def157bf6c064
parent: 7f953924ebace27c2b161468908ddafcc0573f77
author: Clownacy <Clownacy@users.noreply.github.com>
date: Mon Jan 6 23:46:58 EST 2020

Remove all the C-compatibility stuff

--- a/src/ArmsItem.h
+++ b/src/ArmsItem.h
@@ -2,10 +2,6 @@
 
 #include "WindowsWrapper.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 // "Arms" is a synonym of "weapon" here
 // "Code" means "ID" here
 // "Num" often means "ammo" here
@@ -114,7 +110,3 @@
 
 /// Change the current weapon to be the first one and play the usual rotation animation
 void ChangeToFirstArms(void);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/Back.h
+++ b/src/Back.h
@@ -2,10 +2,6 @@
 
 #include "WindowsWrapper.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 typedef struct BACK
 {
 	BOOL flag;	// Basically unused
@@ -24,7 +20,3 @@
 void ActBack(void);
 void PutBack(int fx, int fy);
 void PutFront(int fx, int fy);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/Boss.h
+++ b/src/Boss.h
@@ -2,10 +2,6 @@
 
 #include "NpChar.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #define BOSS_MAX 20
 extern NPCHAR gBoss[BOSS_MAX];
 
@@ -18,7 +14,3 @@
 void HitBossBullet(void);
 void ActBossChar(void);
 void HitBossMap(void);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/Bullet.h
+++ b/src/Bullet.h
@@ -2,10 +2,6 @@
 
 #include "WindowsWrapper.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 typedef struct BULLET
 {
 	int flag;
@@ -73,7 +69,3 @@
 void SetBullet(int no, int x, int y, int dir);
 void ActBullet(void);
 BOOL IsActiveSomeBullet(void);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/Caret.h
+++ b/src/Caret.h
@@ -2,10 +2,6 @@
 
 #include "WindowsWrapper.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct CARET_TABLE
 {
 	int view_left;
@@ -34,7 +30,3 @@
 void ActCaret(void);
 void PutCaret(int fx, int fy);
 void SetCaret(int x, int y, int code, int dir);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/Dialog.h
+++ b/src/Dialog.h
@@ -2,15 +2,7 @@
 
 #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
--- a/src/Draw.h
+++ b/src/Draw.h
@@ -2,10 +2,6 @@
 
 #include "WindowsWrapper.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #ifndef RGB
 #define RGB(r,g,b) ((r) | ((g) << 8) | ((b) << 16))
 #endif
@@ -74,7 +70,3 @@
 void PutText(int x, int y, const char *text, unsigned long color);
 void PutText2(int x, int y, const char *text, unsigned long color, SurfaceID surf_no);
 void EndTextObject(void);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/Ending.h
+++ b/src/Ending.h
@@ -4,10 +4,6 @@
 
 #include "CommonDefines.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct CREDIT
 {
 	long size;
@@ -57,7 +53,3 @@
 void SetCreditIllust(int a);
 void CutCreditIllust(void);
 int Scene_DownIsland(HWND hWnd, int mode);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/Fade.h
+++ b/src/Fade.h
@@ -2,10 +2,6 @@
 
 #include "WindowsWrapper.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 void InitFade(void);
 void SetFadeMask(void);
 void ClearFade(void);
@@ -14,7 +10,3 @@
 void ProcFade(void);
 void PutFade(void);
 BOOL GetFadeActive(void);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/Flags.h
+++ b/src/Flags.h
@@ -2,10 +2,6 @@
 
 #include "WindowsWrapper.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 extern unsigned char gFlagNPC[1000];
 extern unsigned char gSkipFlag[8];
 
@@ -17,7 +13,3 @@
 void SetSkipFlag(long a);
 void CutSkipFlag(long a);
 BOOL GetSkipFlag(long a);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/Flash.h
+++ b/src/Flash.h
@@ -1,9 +1,5 @@
 #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);
@@ -11,7 +7,3 @@
 void ActFlash(int flx, int fly);
 void PutFlash(void);
 void ResetFlash(void);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/Frame.h
+++ b/src/Frame.h
@@ -1,9 +1,5 @@
 #pragma once
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 typedef struct FRAME
 {
 	int x;
@@ -27,7 +23,3 @@
 void SetQuake(int time);
 void SetQuake2(int time);
 void ResetQuake(void);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/Game.h
+++ b/src/Game.h
@@ -2,10 +2,6 @@
 
 #include "WindowsWrapper.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 enum GameFlagsValues
 {
 	// To be continued
@@ -37,7 +33,3 @@
 void PutNumber4(int x, int y, int value, BOOL bZero);
 
 BOOL Game(HWND hWnd);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/Generic.h
+++ b/src/Generic.h
@@ -2,10 +2,6 @@
 
 #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);
@@ -20,7 +16,3 @@
 BOOL LoadWindowRect(HWND hWnd, const char *filename, BOOL unknown);
 BOOL SaveWindowRect(HWND hWnd, const char *filename);
 BOOL IsEnableBitmap(const char *path);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/KeyControl.h
+++ b/src/KeyControl.h
@@ -1,9 +1,5 @@
 #pragma once
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 enum KeyBind
 {
 	//The movement keys go in the order of left, right, up and down
@@ -57,7 +53,3 @@
 extern long gKeyDown;
 
 void GetTrg(void);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/Main.h
+++ b/src/Main.h
@@ -2,10 +2,6 @@
 
 #include "WindowsWrapper.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 extern char gModulePath[MAX_PATH];
 extern char gDataPath[MAX_PATH];
 
@@ -16,7 +12,3 @@
 unsigned long GetFramePerSecound(void);
 
 BOOL SystemTask(void);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/Map.h
+++ b/src/Map.h
@@ -2,10 +2,6 @@
 
 #include "WindowsWrapper.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 typedef struct MAP_DATA
 {
 	unsigned char *data;
@@ -29,7 +25,3 @@
 void PutStage_Back(int fx, int fy);
 void PutStage_Front(int fx, int fy);
 void PutMapDataVector(int fx, int fy);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/MapName.h
+++ b/src/MapName.h
@@ -2,15 +2,7 @@
 
 #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
--- a/src/MiniMap.h
+++ b/src/MiniMap.h
@@ -2,10 +2,6 @@
 
 #include "WindowsWrapper.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 extern char gMapping[0x80];
 
 int MiniMapLoop(void);
@@ -12,7 +8,3 @@
 BOOL IsMapping(void);
 void StartMapping(void);
 void SetMapping(int a);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/MyChar.h
+++ b/src/MyChar.h
@@ -2,10 +2,6 @@
 
 #include "WindowsWrapper.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 // TODO - When I add bitmask constants for gMC.flags...
 // 0x100 is a 'player is underwater' flag
 
@@ -87,7 +83,3 @@
 void CutNoise(void);
 void ResetNoise(void);
 void SleepNoise(void);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/MycParam.h
+++ b/src/MycParam.h
@@ -2,10 +2,6 @@
 
 #include "WindowsWrapper.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 typedef struct ARMS_LEVEL
 {
 	int exp[3];
@@ -34,7 +30,3 @@
 void PutTimeCounter(int x, int y);
 BOOL SaveTimeCounter(void);
 int LoadTimeCounter(void);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/NpChar.h
+++ b/src/NpChar.h
@@ -5,10 +5,6 @@
 
 #include "Draw.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #define NPC_MAX 0x200
 
 enum NPCCond
@@ -144,7 +140,3 @@
 BOOL IsNpCharCode(int code);
 BOOL GetNpCharAlive(int code_event);
 int CountAliveNpChar(void);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/Organya.h
+++ b/src/Organya.h
@@ -9,10 +9,6 @@
 
 #include "WindowsWrapper.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #define MAXTRACK 16
 #define MAXMELODY 8
 #define MAXDRAM 8
@@ -31,7 +27,3 @@
 void SetOrganyaFadeout(void);
 BOOL StartOrganya(LPDIRECTSOUND lpDS, const char *wave_filename);
 void EndOrganya(void);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/PixTone.h
+++ b/src/PixTone.h
@@ -2,10 +2,6 @@
 
 #include "WindowsWrapper.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 typedef struct PIXTONEPARAMETER2
 {
 	int model;
@@ -32,7 +28,3 @@
 
 void MakeWaveTables(void);
 BOOL MakePixelWaveData(const PIXTONEPARAMETER *ptp, unsigned char *pData);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/Profile.h
+++ b/src/Profile.h
@@ -6,10 +6,6 @@
 #include "SelStage.h"
 #include "Stage.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 typedef struct PROFILE
 {
 	char code[8];
@@ -39,7 +35,3 @@
 BOOL SaveProfile(const char *name);
 BOOL LoadProfile(const char *name);
 BOOL InitializeGame(HWND hWnd);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/SelStage.h
+++ b/src/SelStage.h
@@ -2,10 +2,6 @@
 
 #include "WindowsWrapper.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 typedef struct PERMIT_STAGE
 {
 	int index;
@@ -20,7 +16,3 @@
 void MoveStageSelectCursor(void);
 void PutStageSelectObject(void);
 int StageSelectLoop(int *p_event);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/Sound.h
+++ b/src/Sound.h
@@ -11,10 +11,6 @@
 
 #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
@@ -46,7 +42,3 @@
 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
--- a/src/Stage.h
+++ b/src/Stage.h
@@ -2,10 +2,6 @@
 
 #include "WindowsWrapper.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 typedef enum MusicID
 {
 	MUS_SILENCE = 0x0,
@@ -70,7 +66,3 @@
 BOOL TransferStage(int no, int w, int x, int y);
 void ChangeMusic(MusicID no);
 void ReCallMusic(void);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/Star.h
+++ b/src/Star.h
@@ -1,13 +1,5 @@
 #pragma once
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 void InitStar(void);
 void ActStar(void);
 void PutStar(int fx, int fy);
-
-#ifdef __cplusplus
-}
-#endif
--- a/src/TextScr.h
+++ b/src/TextScr.h
@@ -2,10 +2,6 @@
 
 #include "WindowsWrapper.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 typedef struct TEXT_SCRIPT
 {
 	// Path (reload when exit teleporter menu/inventory)
@@ -68,7 +64,3 @@
 void PutTextScript(void);
 int TextScriptProc(void);
 void RestoreTextScript(void);
-
-#ifdef __cplusplus
-}
-#endif