More cleanup.

This commit is contained in:
onpon4 2016-01-02 17:37:19 -05:00
parent 85de61e2cd
commit d911426c06
3 changed files with 100 additions and 107 deletions

View File

@ -105,9 +105,24 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define SHIP_HIT_INDEX 60 #define SHIP_HIT_INDEX 60
enum keys {
KEY_UP,
KEY_DOWN,
KEY_LEFT,
KEY_RIGHT,
KEY_FIRE,
KEY_ALTFIRE,
KEY_SWITCH,
KEY_PAUSE,
KEY_ESCAPE,
KEY_FULLSCREEN,
KEY_DUMMY,
KEY_LAST
};
// AI Types // AI Types
enum { enum {
AI_NORMAL = 1, AI_NORMAL = 1,
AI_DEFENSIVE, AI_DEFENSIVE,
AI_OFFENSIVE, AI_OFFENSIVE,
@ -117,7 +132,6 @@ enum {
// These are for Alien *indexes* NOT classdefs!! // These are for Alien *indexes* NOT classdefs!!
enum { enum {
ALIEN_BOSS_PART4 = 10, ALIEN_BOSS_PART4 = 10,
ALIEN_BOSS_PART3 = 11, ALIEN_BOSS_PART3 = 11,
ALIEN_BOSS_PART2 = 12, ALIEN_BOSS_PART2 = 12,
@ -133,7 +147,6 @@ enum {
// Droppables // Droppables
enum { enum {
P_ANYTHING = 1, P_ANYTHING = 1,
P_WEAPONS, P_WEAPONS,
P_CASH, P_CASH,
@ -154,7 +167,6 @@ enum {
// Jobs // Jobs
enum { enum {
WT_PLASMA = 1, WT_PLASMA = 1,
WT_ROCKET, WT_ROCKET,
WT_ENERGYRAY, WT_ENERGYRAY,
@ -167,7 +179,6 @@ enum {
// Weapons // Weapons
enum { enum {
W_NONE = -1, W_NONE = -1,
W_PLAYER_WEAPON, W_PLAYER_WEAPON,
W_PLAYER_WEAPON2, W_PLAYER_WEAPON2,
@ -191,7 +202,6 @@ enum {
// Mission types // Mission types
enum { enum {
M_DESTROY_ALL_TARGETS = 1, M_DESTROY_ALL_TARGETS = 1,
M_DESTROY_TARGET_TYPE, M_DESTROY_TARGET_TYPE,
M_COLLECT, M_COLLECT,
@ -202,7 +212,6 @@ enum {
}; };
enum { enum {
OB_JUST_FAILED = -2, OB_JUST_FAILED = -2,
OB_FAILED, OB_FAILED,
OB_INCOMPLETE, OB_INCOMPLETE,
@ -214,7 +223,6 @@ enum {
// Class Defs - Some of these are just place holders // Class Defs - Some of these are just place holders
enum { enum {
CD_DUALFIGHTER, // 0 CD_DUALFIGHTER, // 0
CD_MISSILEBOAT, CD_MISSILEBOAT,
CD_PROTOFIGHTER, CD_PROTOFIGHTER,
@ -265,7 +273,6 @@ enum {
// Text shapes (main menu) // Text shapes (main menu)
enum { enum {
TS_PRESENTS, TS_PRESENTS,
TS_AN_SDL_GAME, TS_AN_SDL_GAME,
TS_START_NEW_GAME, TS_START_NEW_GAME,
@ -299,7 +306,6 @@ enum {
// Text shapes (mission) // Text shapes (mission)
enum { enum {
TS_RADIO = MAX_INFOLINES, TS_RADIO = MAX_INFOLINES,
TS_SHIELD, TS_SHIELD,
TS_PLASMA_T, TS_PLASMA_T,
@ -321,7 +327,6 @@ enum {
// Menu types // Menu types
enum { enum {
MENU_MAIN, MENU_MAIN,
MENU_DIFFICULTY, MENU_DIFFICULTY,
MENU_LOAD, MENU_LOAD,
@ -331,7 +336,6 @@ enum {
// Shop items // Shop items
enum { enum {
SHOP_PLASMA_MAX_OUTPUT, SHOP_PLASMA_MAX_OUTPUT,
SHOP_PLASMA_MAX_DAMAGE, SHOP_PLASMA_MAX_DAMAGE,
SHOP_PLASMA_MAX_RATE, SHOP_PLASMA_MAX_RATE,
@ -354,7 +358,6 @@ enum {
// Font Colors // Font Colors
enum { enum {
FONT_WHITE, FONT_WHITE,
FONT_RED, FONT_RED,
FONT_YELLOW, FONT_YELLOW,
@ -365,7 +368,6 @@ enum {
// Sounds // Sounds
enum { enum {
SFX_EXPLOSION, SFX_EXPLOSION,
SFX_HIT, SFX_HIT,
SFX_DEATH, SFX_DEATH,
@ -387,7 +389,6 @@ enum {
// Sections // Sections
enum { enum {
SECTION_TITLE, SECTION_TITLE,
SECTION_INTERMISSION, SECTION_INTERMISSION,
SECTION_GAME SECTION_GAME
@ -395,7 +396,6 @@ enum {
// Faces // Faces
enum { enum {
FACE_CHRIS = 90, FACE_CHRIS = 90,
FACE_SID, FACE_SID,
FACE_KRASS, FACE_KRASS,
@ -407,7 +407,6 @@ enum {
// Missions // Missions
enum { enum {
MISN_START, MISN_START,
MISN_HAIL, MISN_HAIL,
MISN_CERADSE, MISN_CERADSE,

View File

@ -20,8 +20,89 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef GLOBALS_H #ifndef GLOBALS_H
#define GLOBALS_H #define GLOBALS_H
#include "SDL.h"
#include "defs.h"
#include "structs.h" #include "structs.h"
typedef struct Engine_ {
SDL_Event event;
int done;
SDL_RWops *sdlrw;
float musicVolume;
int maxAliens;
float ssx;
float ssy;
float smx;
float smy;
object *bulletHead;
object *bulletTail;
object *explosionHead;
object *explosionTail;
collectables *collectableHead;
collectables *collectableTail;
object *debrisHead;
object *debrisTail;
int cursor_x, cursor_y;
int commsSection;
int eventTimer;
int lowShield;
int averageShield;
float targetShield;
int targetIndex;
// Mission completion timer (allows for 4 seconds before leaving sector)
long missionCompleteTimer;
// Times the mission normally
Uint32 counter2;
long int timeTaken; // In seconds
// For missions with a time limit
int timeMission;
Uint32 counter;
int seconds;
int minutes;
// Mission Related stuff
int allAliensDead;
int addAliens;
bool paused;
int gameSection;
bool useAudio;
bool useSound;
bool useMusic;
bool fullScreen;
bool autoPause;
char configDirectory[1024];
char keyState[KEY_LAST];
bool cheat; // overall cheat
bool cheatShield;
bool cheatCash;
bool cheatAmmo;
bool cheatTime;
bool cheatCredits;
} Engine;
extern Engine engine; extern Engine engine;
void engine_init(); void engine_init();

View File

@ -200,6 +200,7 @@ typedef struct ShopItem_ {
char name[50]; char name[50];
char description[255]; char description[255];
int image; int image;
} ShopItem; } ShopItem;
typedef struct bRect_ { typedef struct bRect_ {
@ -223,98 +224,9 @@ typedef struct Planet_ {
int faceImage; int faceImage;
char from[50]; char from[50];
char subject[100]; char subject[100];
} Planet; } Planet;
enum keys {
KEY_UP,
KEY_DOWN,
KEY_LEFT,
KEY_RIGHT,
KEY_FIRE,
KEY_ALTFIRE,
KEY_SWITCH,
KEY_PAUSE,
KEY_ESCAPE,
KEY_FULLSCREEN,
KEY_DUMMY,
KEY_LAST
};
typedef struct Engine_ {
SDL_Event event;
int done;
SDL_RWops *sdlrw;
float musicVolume;
int maxAliens;
float ssx;
float ssy;
float smx;
float smy;
object *bulletHead;
object *bulletTail;
object *explosionHead;
object *explosionTail;
collectables *collectableHead;
collectables *collectableTail;
object *debrisHead;
object *debrisTail;
int cursor_x, cursor_y;
int commsSection;
int eventTimer;
int lowShield;
int averageShield;
float targetShield;
int targetIndex;
// Mission completion timer (allows for 4 seconds before leaving sector)
long missionCompleteTimer;
// Times the mission normally
Uint32 counter2;
long int timeTaken; // In seconds
// For missions with a time limit
int timeMission;
Uint32 counter;
int seconds;
int minutes;
// Mission Related stuff
int allAliensDead;
int addAliens;
bool paused;
int gameSection;
bool useAudio;
bool useSound;
bool useMusic;
bool fullScreen;
bool autoPause;
char configDirectory[1024];
char keyState[KEY_LAST];
bool cheat; // overall cheat
bool cheatShield;
bool cheatCash;
bool cheatAmmo;
bool cheatTime;
bool cheatCredits;
} Engine;
typedef struct event_ { typedef struct event_ {
int time; int time;
@ -322,6 +234,7 @@ typedef struct event_ {
int face; int face;
int entity; int entity;
int flag; int flag;
} event; } event;
typedef struct cutMsg_ { typedef struct cutMsg_ {