diff --git a/src/Starfighter.cpp b/src/Starfighter.cpp
index 92172c1..9607aa1 100644
--- a/src/Starfighter.cpp
+++ b/src/Starfighter.cpp
@@ -20,6 +20,9 @@ along with this program. If not, see .
#include "Starfighter.h"
+#include "defs.h"
+#include "structs.h"
+
#ifdef __APPLE__
#include "CoreFoundation/CoreFoundation.h"
#endif
diff --git a/src/Starfighter.h b/src/Starfighter.h
index 120c785..c226333 100644
--- a/src/Starfighter.h
+++ b/src/Starfighter.h
@@ -24,7 +24,6 @@ along with this program. If not, see .
#include
#include
#include
-#include
#include
#include
@@ -32,9 +31,6 @@ along with this program. If not, see .
#include "SDL_image.h"
#include "SDL_mixer.h"
-#include "defs.h"
-#include "structs.h"
-
#include "alien.h"
#include "audio.h"
#include "bullet.h"
diff --git a/src/alien.h b/src/alien.h
index 9194d14..194c727 100644
--- a/src/alien.h
+++ b/src/alien.h
@@ -20,6 +20,9 @@ along with this program. If not, see .
#ifndef ALIEN_H
#define ALIEN_H
+#include "defs.h"
+#include "structs.h"
+
extern Object alien_defs[CD_MAX];
extern Object aliens[ALIEN_MAX];
diff --git a/src/audio.h b/src/audio.h
index b0cc0f6..43f2104 100644
--- a/src/audio.h
+++ b/src/audio.h
@@ -20,6 +20,9 @@ along with this program. If not, see .
#ifndef AUDIO_H
#define AUDIO_H
+#include "defs.h"
+#include "structs.h"
+
void audio_loadSounds();
void audio_playSound(int sid, float x, float y);
void audio_haltMusic();
diff --git a/src/bullet.h b/src/bullet.h
index 237f773..7f26f3b 100644
--- a/src/bullet.h
+++ b/src/bullet.h
@@ -20,6 +20,9 @@ along with this program. If not, see .
#ifndef BULLETS_H
#define BULLETS_H
+#include "defs.h"
+#include "structs.h"
+
void bullet_add(Object *theWeapon, Object *attacker, int y, int dy);
Object *bullet_getTarget(Object *bullet);
int bullet_collision(Object *bullet, Object *ship);
diff --git a/src/cargo.cpp b/src/cargo.cpp
index 07e227f..dc59fa1 100644
--- a/src/cargo.cpp
+++ b/src/cargo.cpp
@@ -18,6 +18,10 @@ along with this program. If not, see .
*/
#include "Starfighter.h"
+
+#include "defs.h"
+#include "structs.h"
+
#include "radio.h"
Object cargo[MAX_CARGO];
diff --git a/src/cargo.h b/src/cargo.h
index 2c4b3e4..8721632 100644
--- a/src/cargo.h
+++ b/src/cargo.h
@@ -20,6 +20,9 @@ along with this program. If not, see .
#ifndef _CARGO_H_
#define _CARGO_H_
+#include "defs.h"
+#include "structs.h"
+
extern Object cargo[MAX_CARGO];
void cargo_init();
diff --git a/src/collectable.cpp b/src/collectable.cpp
index fc78a1d..8b9e3b7 100644
--- a/src/collectable.cpp
+++ b/src/collectable.cpp
@@ -19,6 +19,9 @@ along with this program. If not, see .
#include "Starfighter.h"
+#include "defs.h"
+#include "structs.h"
+
/*
Create a new collectable item based on supplied arguments.
*/
diff --git a/src/collectable.h b/src/collectable.h
index 5ff009e..05252a3 100644
--- a/src/collectable.h
+++ b/src/collectable.h
@@ -20,6 +20,9 @@ along with this program. If not, see .
#ifndef COLLECTABLE_H
#define COLLECTABLE_H
+#include "defs.h"
+#include "structs.h"
+
void collectable_add(float x, float y, int type, int value, int life);
int collectable_collision(Collectable *collectable, Object *ship);
void collectable_explode(Collectable *collectable);
diff --git a/src/colors.cpp b/src/colors.cpp
index 9f0b5ad..b42e0d0 100644
--- a/src/colors.cpp
+++ b/src/colors.cpp
@@ -21,6 +21,9 @@ along with this program. If not, see .
#include "Starfighter.h"
+#include "defs.h"
+#include "structs.h"
+
Uint32 red;
Uint32 darkRed;
Uint32 yellow;
diff --git a/src/colors.h b/src/colors.h
index 0137e1d..77df566 100644
--- a/src/colors.h
+++ b/src/colors.h
@@ -20,6 +20,11 @@ along with this program. If not, see .
#ifndef COLORS_H
#define COLORS_H
+#include "SDL.h"
+
+#include "defs.h"
+#include "structs.h"
+
extern Uint32 red;
extern Uint32 darkRed;
extern Uint32 yellow;
diff --git a/src/cutscene.cpp b/src/cutscene.cpp
index 223f26f..84f9c64 100644
--- a/src/cutscene.cpp
+++ b/src/cutscene.cpp
@@ -19,6 +19,9 @@ along with this program. If not, see .
#include "Starfighter.h"
+#include "defs.h"
+#include "structs.h"
+
typedef struct Message_ {
int face;
diff --git a/src/cutscene.h b/src/cutscene.h
index c926827..7d6ef7f 100644
--- a/src/cutscene.h
+++ b/src/cutscene.h
@@ -20,6 +20,9 @@ along with this program. If not, see .
#ifndef CUTSCENE_H
#define CUTSCENE_H
+#include "defs.h"
+#include "structs.h"
+
void cutscene_init(int scene);
#endif
diff --git a/src/defs.h b/src/defs.h
index 53fdd14..b8a9e5d 100644
--- a/src/defs.h
+++ b/src/defs.h
@@ -20,8 +20,6 @@ along with this program. If not, see .
#ifndef DEFS_H
#define DEFS_H
-#include
-
// Macros
#define MIN(a, b) ((a) < (b) ? (a) : (b))
diff --git a/src/engine.cpp b/src/engine.cpp
index bccb1b4..d07534b 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -19,11 +19,13 @@ along with this program. If not, see .
#include "Starfighter.h"
-#include
#include
#include
#include
+#include "defs.h"
+#include "structs.h"
+
Engine engine;
void engine_init()
diff --git a/src/event.cpp b/src/event.cpp
index 31fd081..f86708d 100644
--- a/src/event.cpp
+++ b/src/event.cpp
@@ -18,6 +18,10 @@ along with this program. If not, see .
*/
#include "Starfighter.h"
+
+#include "defs.h"
+#include "structs.h"
+
#include "radio.h"
static Event events[MAX_EVENTS];
diff --git a/src/event.h b/src/event.h
index 9ddfb3a..6297a2f 100644
--- a/src/event.h
+++ b/src/event.h
@@ -20,6 +20,9 @@ along with this program. If not, see .
#ifndef EVENT_H
#define EVENT_H
+#include "defs.h"
+#include "structs.h"
+
typedef struct Event_ {
int time;
diff --git a/src/explosion.cpp b/src/explosion.cpp
index 7bd9378..c35eb94 100644
--- a/src/explosion.cpp
+++ b/src/explosion.cpp
@@ -19,6 +19,9 @@ along with this program. If not, see .
#include "Starfighter.h"
+#include "defs.h"
+#include "structs.h"
+
/*
Create a new explosion based on supplied parameters.
The "type" will actually be used as an explosion frame check.
diff --git a/src/explosion.h b/src/explosion.h
index 6351155..950057d 100644
--- a/src/explosion.h
+++ b/src/explosion.h
@@ -17,8 +17,11 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
-#ifndef EXPLOSIONS_H
-#define EXPLOSIONS_H
+#ifndef EXPLOSION_H
+#define EXPLOSION_H
+
+#include "defs.h"
+#include "structs.h"
void explosion_add(float x, float y, int type);
void explosion_addEngine(Object *craft);
diff --git a/src/game.cpp b/src/game.cpp
index 970335f..21485ba 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -18,6 +18,10 @@ along with this program. If not, see .
*/
#include "Starfighter.h"
+
+#include "defs.h"
+#include "structs.h"
+
#include "radio.h"
Game game;
diff --git a/src/game.h b/src/game.h
index 28ac774..9e85855 100644
--- a/src/game.h
+++ b/src/game.h
@@ -20,6 +20,9 @@ along with this program. If not, see .
#ifndef GAME_H
#define GAME_H
+#include "defs.h"
+#include "structs.h"
+
extern Game game;
void game_init();
diff --git a/src/gfx.cpp b/src/gfx.cpp
index adc04b9..9d4dffb 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -21,6 +21,9 @@ along with this program. If not, see .
#include "Starfighter.h"
+#include "defs.h"
+#include "structs.h"
+
SDL_Surface *gfx_background;
SDL_Surface *gfx_sprites[SP_MAX];
SDL_Surface *gfx_faceSprites[FS_MAX];
diff --git a/src/gfx.h b/src/gfx.h
index 8fb64d6..ff240ac 100644
--- a/src/gfx.h
+++ b/src/gfx.h
@@ -20,7 +20,10 @@ along with this program. If not, see .
#ifndef GFX_H
#define GFX_H
-#include "Starfighter.h"
+#include "SDL.h"
+
+#include "defs.h"
+#include "structs.h"
extern SDL_Surface *gfx_background;
extern SDL_Surface *gfx_sprites[SP_MAX];
diff --git a/src/info.cpp b/src/info.cpp
index 0bbd156..3a93e12 100644
--- a/src/info.cpp
+++ b/src/info.cpp
@@ -19,6 +19,9 @@ along with this program. If not, see .
#include "Starfighter.h"
+#include "defs.h"
+#include "structs.h"
+
void info_clearLines()
{
for (int i = 0 ; i < MAX_INFOLINES ; i++)
diff --git a/src/info.h b/src/info.h
index 475bef7..3486eb4 100644
--- a/src/info.h
+++ b/src/info.h
@@ -20,6 +20,9 @@ along with this program. If not, see .
#ifndef INFO_H
#define INFO_H
+#include "defs.h"
+#include "structs.h"
+
void info_clearLines();
void info_copyLine(int a, int b);
void info_setLine(const char *in, int color);
diff --git a/src/intermission.cpp b/src/intermission.cpp
index 8e7042f..f7ee690 100644
--- a/src/intermission.cpp
+++ b/src/intermission.cpp
@@ -19,6 +19,9 @@ along with this program. If not, see .
#include "Starfighter.h"
+#include "defs.h"
+#include "structs.h"
+
// XXX: Magic number
Planet intermission_planets[10];
diff --git a/src/intermission.h b/src/intermission.h
index e4b2825..05648b5 100644
--- a/src/intermission.h
+++ b/src/intermission.h
@@ -20,6 +20,9 @@ along with this program. If not, see .
#ifndef INTERMISSION_H
#define INTERMISSION_H
+#include "defs.h"
+#include "structs.h"
+
extern Planet intermission_planets[10];
void intermission_initPlanets(int system);
diff --git a/src/mission.cpp b/src/mission.cpp
index 89f591d..4522c6b 100644
--- a/src/mission.cpp
+++ b/src/mission.cpp
@@ -18,6 +18,10 @@ along with this program. If not, see .
*/
#include "Starfighter.h"
+
+#include "defs.h"
+#include "structs.h"
+
#include "radio.h"
Mission mission;
diff --git a/src/mission.h b/src/mission.h
index f5deab1..2965ea1 100644
--- a/src/mission.h
+++ b/src/mission.h
@@ -20,6 +20,9 @@ along with this program. If not, see .
#ifndef MISSION_H
#define MISSION_H
+#include "defs.h"
+#include "structs.h"
+
extern Mission mission;
void mission_set(int mission);
diff --git a/src/player.cpp b/src/player.cpp
index aa188c4..831ffd4 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -19,6 +19,9 @@ along with this program. If not, see .
#include "Starfighter.h"
+#include "defs.h"
+#include "structs.h"
+
Object player;
int player_chargerFired = 0;
diff --git a/src/player.h b/src/player.h
index 47777aa..0548c44 100644
--- a/src/player.h
+++ b/src/player.h
@@ -20,6 +20,9 @@ along with this program. If not, see .
#ifndef PLAYER_H
#define PLAYER_H
+#include "defs.h"
+#include "structs.h"
+
extern Object player;
extern int player_chargerFired;
diff --git a/src/radio.cpp b/src/radio.cpp
index f30b15a..f65487e 100644
--- a/src/radio.cpp
+++ b/src/radio.cpp
@@ -19,6 +19,9 @@ along with this program. If not, see .
#include "Starfighter.h"
+#include "defs.h"
+#include "structs.h"
+
/*
Sets a radio message that appears at the top of the screen. Used for
script events, etc. We send a message priority too, since we don't want
diff --git a/src/radio.h b/src/radio.h
index 7131f1c..ac5b6ac 100644
--- a/src/radio.h
+++ b/src/radio.h
@@ -20,6 +20,9 @@ along with this program. If not, see .
#ifndef RADIO_H
#define RADIO_H
+#include "defs.h"
+#include "structs.h"
+
void radio_setMessage(int face, const char *in, int priority);
#endif
diff --git a/src/renderer.cpp b/src/renderer.cpp
index 34b674b..0d2fee9 100644
--- a/src/renderer.cpp
+++ b/src/renderer.cpp
@@ -19,6 +19,9 @@ along with this program. If not, see .
#include "SDL.h"
+#include "defs.h"
+#include "structs.h"
+
#include "screen.h"
SDL_Renderer *renderer;
diff --git a/src/renderer.h b/src/renderer.h
index 1171e7d..f06684e 100644
--- a/src/renderer.h
+++ b/src/renderer.h
@@ -20,6 +20,11 @@ along with this program. If not, see .
#ifndef RENDERER_H
#define RENDERER_H
+#include "SDL.h"
+
+#include "defs.h"
+#include "structs.h"
+
extern SDL_Renderer *renderer;
extern SDL_Texture *renderer_texture;
diff --git a/src/save.cpp b/src/save.cpp
index 20f2dff..42f1f4e 100644
--- a/src/save.cpp
+++ b/src/save.cpp
@@ -19,6 +19,9 @@ along with this program. If not, see .
#include "Starfighter.h"
+#include "defs.h"
+#include "structs.h"
+
static char saveSlot[10][25];
/*
diff --git a/src/save.h b/src/save.h
index 0e292e9..6b5d6c3 100644
--- a/src/save.h
+++ b/src/save.h
@@ -20,6 +20,11 @@ along with this program. If not, see .
#ifndef SAVE_H
#define SAVE_H
+#include "SDL.h"
+
+#include "defs.h"
+#include "structs.h"
+
int save_initSlots();
int save_load(int slot);
void save(int slot);
diff --git a/src/screen.cpp b/src/screen.cpp
index 27e571b..d9316a6 100644
--- a/src/screen.cpp
+++ b/src/screen.cpp
@@ -21,9 +21,11 @@ along with this program. If not, see .
#include "SDL.h"
+#include "defs.h"
+#include "structs.h"
+
#include "engine.h"
#include "gfx.h"
-#include "structs.h"
SDL_Surface *screen;
bRect *screen_bufferHead;
diff --git a/src/screen.h b/src/screen.h
index 11b220e..7411d2c 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -20,6 +20,9 @@ along with this program. If not, see .
#ifndef SCREEN_H
#define SCREEN_H
+#include "SDL.h"
+
+#include "defs.h"
#include "structs.h"
extern SDL_Surface *screen;
diff --git a/src/ship.cpp b/src/ship.cpp
index fd75759..8cd307a 100644
--- a/src/ship.cpp
+++ b/src/ship.cpp
@@ -19,6 +19,9 @@ along with this program. If not, see .
#include "Starfighter.h"
+#include "defs.h"
+#include "structs.h"
+
int ship_collision(Object *ship, Object *otherShip)
{
float x0 = ship->x;
diff --git a/src/ship.h b/src/ship.h
index 9d5dec5..9aed8ff 100644
--- a/src/ship.h
+++ b/src/ship.h
@@ -18,6 +18,9 @@ along with this program. If not, see .
#ifndef SHIP_H
#define SHIP_H
+#include "defs.h"
+#include "structs.h"
+
int ship_collision(Object *ship, Object *otherShip);
void ship_fireBullet(Object *ship, int weaponType);
void ship_fireRay(Object *ship);
diff --git a/src/shop.cpp b/src/shop.cpp
index 492b045..b339ca4 100644
--- a/src/shop.cpp
+++ b/src/shop.cpp
@@ -19,6 +19,9 @@ along with this program. If not, see .
#include "Starfighter.h"
+#include "defs.h"
+#include "structs.h"
+
static ShopItem shopItems[SHOP_MAX];
static int shopSelectedItem;
diff --git a/src/shop.h b/src/shop.h
index 66dfcf9..a381777 100644
--- a/src/shop.h
+++ b/src/shop.h
@@ -20,6 +20,9 @@ along with this program. If not, see .
#ifndef SHOP_H
#define SHOP_H
+#include "defs.h"
+#include "structs.h"
+
void shop_init();
void shop_show();
diff --git a/src/title.cpp b/src/title.cpp
index 32b5937..7b97668 100644
--- a/src/title.cpp
+++ b/src/title.cpp
@@ -19,6 +19,9 @@ along with this program. If not, see .
#include "Starfighter.h"
+#include "defs.h"
+#include "structs.h"
+
static int showGameMenu(int continueSaveSlot)
{
screen_blitText(TS_START_NEW_GAME);
diff --git a/src/title.h b/src/title.h
index 55a853f..78dbeb4 100644
--- a/src/title.h
+++ b/src/title.h
@@ -20,6 +20,9 @@ along with this program. If not, see .
#ifndef TITLE_H
#define TITLE_H
+#include "defs.h"
+#include "structs.h"
+
int title_show();
void title_showCredits();
diff --git a/src/weapons.cpp b/src/weapons.cpp
index d300bf2..0a6eb1f 100644
--- a/src/weapons.cpp
+++ b/src/weapons.cpp
@@ -19,6 +19,9 @@ along with this program. If not, see .
#include "Starfighter.h"
+#include "defs.h"
+#include "structs.h"
+
Object weapons[W_MAX];
/*
diff --git a/src/weapons.h b/src/weapons.h
index dd60fb7..187918a 100644
--- a/src/weapons.h
+++ b/src/weapons.h
@@ -20,6 +20,9 @@ along with this program. If not, see .
#ifndef WEAPONS_H
#define WEAPONS_H
+#include "defs.h"
+#include "structs.h"
+
extern Object weapons[W_MAX];
void weapons_init();
diff --git a/src/window.cpp b/src/window.cpp
index d52709c..4330650 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -20,4 +20,7 @@ along with this program. If not, see .
#include "SDL.h"
+#include "defs.h"
+#include "structs.h"
+
SDL_Window *window;
diff --git a/src/window.h b/src/window.h
index 435970c..abc3763 100644
--- a/src/window.h
+++ b/src/window.h
@@ -20,6 +20,11 @@ along with this program. If not, see .
#ifndef WINDOW_H
#define WINDOW_H
+#include "SDL.h"
+
+#include "defs.h"
+#include "structs.h"
+
extern SDL_Window *window;
#endif