diff --git a/src/ArmsItem.h b/src/ArmsItem.h index f15f5e87..be9bc84b 100644 --- a/src/ArmsItem.h +++ b/src/ArmsItem.h @@ -2,6 +2,10 @@ #include "WindowsWrapper.h" +#ifdef __cplusplus +extern "C" { +#endif + // "Arms" is a synonym of "weapon" here // "Code" means "ID" here // "Num" often means "ammo" here @@ -110,3 +114,7 @@ int RotationArmsRev(void); /// Change the current weapon to be the first one and play the usual rotation animation void ChangeToFirstArms(void); + +#ifdef __cplusplus +} +#endif diff --git a/src/Bullet.h b/src/Bullet.h index 6d3214fb..c10e7810 100644 --- a/src/Bullet.h +++ b/src/Bullet.h @@ -2,7 +2,11 @@ #include "WindowsWrapper.h" -struct BULLET +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct BULLET { int flag; int code_bullet; @@ -36,9 +40,9 @@ struct BULLET int back; int bottom; } view; -}; +} BULLET; -struct BULLET_TABLE +typedef struct BULLET_TABLE { signed char damage; signed char life; @@ -55,7 +59,7 @@ struct BULLET_TABLE int back; int bottom; } view; -}; +} BULLET_TABLE; #define BULLET_MAX 0x40 extern BULLET gBul[BULLET_MAX]; @@ -69,3 +73,7 @@ void PutBullet(int fx, int fy); void SetBullet(int no, int x, int y, int dir); void ActBullet(void); BOOL IsActiveSomeBullet(void); + +#ifdef __cplusplus +} +#endif diff --git a/src/Draw.h b/src/Draw.h index 8c4b625d..04018025 100644 --- a/src/Draw.h +++ b/src/Draw.h @@ -2,6 +2,10 @@ #include "WindowsWrapper.h" +#ifdef __cplusplus +extern "C" { +#endif + #ifndef RGB #define RGB(r,g,b) ((r) | ((g) << 8) | ((b) << 16)) #endif @@ -70,3 +74,7 @@ void InitTextObject(const char *font_name); 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 diff --git a/src/Game.h b/src/Game.h index 224ea03f..86edd98b 100644 --- a/src/Game.h +++ b/src/Game.h @@ -2,6 +2,10 @@ #include "WindowsWrapper.h" +#ifdef __cplusplus +extern "C" { +#endif + enum GameFlagsValues { // To be continued @@ -33,3 +37,7 @@ int Random(int min, int max); void PutNumber4(int x, int y, int value, BOOL bZero); BOOL Game(HWND hWnd); + +#ifdef __cplusplus +} +#endif diff --git a/src/MyChar.h b/src/MyChar.h index 3af35b99..e9e01c8c 100644 --- a/src/MyChar.h +++ b/src/MyChar.h @@ -2,10 +2,14 @@ #include "WindowsWrapper.h" +#ifdef __cplusplus +extern "C" { +#endif + // TODO - When I add bitmask constants for gMC.flags... // 0x100 is a 'player is underwater' flag -struct MYCHAR +typedef struct MYCHAR { unsigned char cond; unsigned int flag; @@ -59,7 +63,7 @@ struct MYCHAR signed char ques; // Same for this variable as well signed char boost_sw; int boost_cnt; -}; +} MYCHAR; extern MYCHAR gMC; @@ -83,3 +87,7 @@ void SetNoise(int no, int freq); void CutNoise(void); void ResetNoise(void); void SleepNoise(void); + +#ifdef __cplusplus +} +#endif diff --git a/src/Organya.h b/src/Organya.h index b0e5a792..c81ca8a2 100644 --- a/src/Organya.h +++ b/src/Organya.h @@ -1,4 +1,4 @@ -#pragma once + #pragma once #ifdef FIX_BUGS // The original source code forgot to set this (you can tell because, in the original EXE, diff --git a/src/Star.cpp b/src/Star.cpp index a594395a..79bfaa05 100644 --- a/src/Star.cpp +++ b/src/Star.cpp @@ -119,14 +119,14 @@ void ActStar(void) void PutStar(int fx, int fy) { - int i; - RECT rc[3] = { {192, 0, 200, 8}, {192, 8, 200, 16}, {192, 16, 200, 24}, }; + int i; + if (gMC.cond & 2) return; diff --git a/src/Star.h b/src/Star.h index 672effb0..231242eb 100644 --- a/src/Star.h +++ b/src/Star.h @@ -1,5 +1,13 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + void InitStar(void); void ActStar(void); void PutStar(int fx, int fy); + +#ifdef __cplusplus +} +#endif diff --git a/vs2003/CSE2.vcproj b/vs2003/CSE2.vcproj index 27e0f055..7393511d 100644 --- a/vs2003/CSE2.vcproj +++ b/vs2003/CSE2.vcproj @@ -324,6 +324,12 @@ + + +