Made Star.cpp compile as C89 in VS2003
I hope this doesn't get *too* invasive.
This commit is contained in:
parent
f36fc61de3
commit
b5ad6f5154
9 changed files with 63 additions and 9 deletions
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
#include "WindowsWrapper.h"
|
#include "WindowsWrapper.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
// "Arms" is a synonym of "weapon" here
|
// "Arms" is a synonym of "weapon" here
|
||||||
// "Code" means "ID" here
|
// "Code" means "ID" here
|
||||||
// "Num" often means "ammo" 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
|
/// Change the current weapon to be the first one and play the usual rotation animation
|
||||||
void ChangeToFirstArms(void);
|
void ChangeToFirstArms(void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
16
src/Bullet.h
16
src/Bullet.h
|
@ -2,7 +2,11 @@
|
||||||
|
|
||||||
#include "WindowsWrapper.h"
|
#include "WindowsWrapper.h"
|
||||||
|
|
||||||
struct BULLET
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct BULLET
|
||||||
{
|
{
|
||||||
int flag;
|
int flag;
|
||||||
int code_bullet;
|
int code_bullet;
|
||||||
|
@ -36,9 +40,9 @@ struct BULLET
|
||||||
int back;
|
int back;
|
||||||
int bottom;
|
int bottom;
|
||||||
} view;
|
} view;
|
||||||
};
|
} BULLET;
|
||||||
|
|
||||||
struct BULLET_TABLE
|
typedef struct BULLET_TABLE
|
||||||
{
|
{
|
||||||
signed char damage;
|
signed char damage;
|
||||||
signed char life;
|
signed char life;
|
||||||
|
@ -55,7 +59,7 @@ struct BULLET_TABLE
|
||||||
int back;
|
int back;
|
||||||
int bottom;
|
int bottom;
|
||||||
} view;
|
} view;
|
||||||
};
|
} BULLET_TABLE;
|
||||||
|
|
||||||
#define BULLET_MAX 0x40
|
#define BULLET_MAX 0x40
|
||||||
extern BULLET gBul[BULLET_MAX];
|
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 SetBullet(int no, int x, int y, int dir);
|
||||||
void ActBullet(void);
|
void ActBullet(void);
|
||||||
BOOL IsActiveSomeBullet(void);
|
BOOL IsActiveSomeBullet(void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
#include "WindowsWrapper.h"
|
#include "WindowsWrapper.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef RGB
|
#ifndef RGB
|
||||||
#define RGB(r,g,b) ((r) | ((g) << 8) | ((b) << 16))
|
#define RGB(r,g,b) ((r) | ((g) << 8) | ((b) << 16))
|
||||||
#endif
|
#endif
|
||||||
|
@ -70,3 +74,7 @@ void InitTextObject(const char *font_name);
|
||||||
void PutText(int x, int y, const char *text, unsigned long color);
|
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 PutText2(int x, int y, const char *text, unsigned long color, SurfaceID surf_no);
|
||||||
void EndTextObject(void);
|
void EndTextObject(void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
#include "WindowsWrapper.h"
|
#include "WindowsWrapper.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
enum GameFlagsValues
|
enum GameFlagsValues
|
||||||
{
|
{
|
||||||
// To be continued
|
// To be continued
|
||||||
|
@ -33,3 +37,7 @@ int Random(int min, int max);
|
||||||
void PutNumber4(int x, int y, int value, BOOL bZero);
|
void PutNumber4(int x, int y, int value, BOOL bZero);
|
||||||
|
|
||||||
BOOL Game(HWND hWnd);
|
BOOL Game(HWND hWnd);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
12
src/MyChar.h
12
src/MyChar.h
|
@ -2,10 +2,14 @@
|
||||||
|
|
||||||
#include "WindowsWrapper.h"
|
#include "WindowsWrapper.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
// TODO - When I add bitmask constants for gMC.flags...
|
// TODO - When I add bitmask constants for gMC.flags...
|
||||||
// 0x100 is a 'player is underwater' flag
|
// 0x100 is a 'player is underwater' flag
|
||||||
|
|
||||||
struct MYCHAR
|
typedef struct MYCHAR
|
||||||
{
|
{
|
||||||
unsigned char cond;
|
unsigned char cond;
|
||||||
unsigned int flag;
|
unsigned int flag;
|
||||||
|
@ -59,7 +63,7 @@ struct MYCHAR
|
||||||
signed char ques; // Same for this variable as well
|
signed char ques; // Same for this variable as well
|
||||||
signed char boost_sw;
|
signed char boost_sw;
|
||||||
int boost_cnt;
|
int boost_cnt;
|
||||||
};
|
} MYCHAR;
|
||||||
|
|
||||||
extern MYCHAR gMC;
|
extern MYCHAR gMC;
|
||||||
|
|
||||||
|
@ -83,3 +87,7 @@ void SetNoise(int no, int freq);
|
||||||
void CutNoise(void);
|
void CutNoise(void);
|
||||||
void ResetNoise(void);
|
void ResetNoise(void);
|
||||||
void SleepNoise(void);
|
void SleepNoise(void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -119,14 +119,14 @@ void ActStar(void)
|
||||||
|
|
||||||
void PutStar(int fx, int fy)
|
void PutStar(int fx, int fy)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
|
|
||||||
RECT rc[3] = {
|
RECT rc[3] = {
|
||||||
{192, 0, 200, 8},
|
{192, 0, 200, 8},
|
||||||
{192, 8, 200, 16},
|
{192, 8, 200, 16},
|
||||||
{192, 16, 200, 24},
|
{192, 16, 200, 24},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int i;
|
||||||
|
|
||||||
if (gMC.cond & 2)
|
if (gMC.cond & 2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,13 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
void InitStar(void);
|
void InitStar(void);
|
||||||
void ActStar(void);
|
void ActStar(void);
|
||||||
void PutStar(int fx, int fy);
|
void PutStar(int fx, int fy);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -324,6 +324,12 @@
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\src\Star.cpp">
|
RelativePath="..\src\Star.cpp">
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
CompileAs="1"/>
|
||||||
|
</FileConfiguration>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\src\TextScr.cpp">
|
RelativePath="..\src\TextScr.cpp">
|
||||||
|
|
Loading…
Add table
Reference in a new issue