From d6982e80ca65dbbbb7c3f9eef217884b4554a44e Mon Sep 17 00:00:00 2001 From: Steve Date: Sat, 5 Dec 2015 08:15:58 +0000 Subject: [PATCH] Created common.h to aid with cross compiling. --- build/linux/control | 11 +++++++++++ src/battle/ai.h | 5 +---- src/battle/battle.h | 4 +--- src/battle/bullets.h | 4 +--- src/battle/challenges.h | 5 +---- src/battle/effects.h | 5 +---- src/battle/entities.h | 5 +---- src/battle/extractionPoint.h | 5 +---- src/battle/fighters.h | 4 +--- src/battle/grid.h | 5 +---- src/battle/hud.h | 5 +---- src/battle/items.h | 4 +--- src/battle/messageBox.h | 5 +---- src/battle/missionInfo.h | 5 +---- src/battle/objectives.h | 5 +---- src/battle/player.h | 5 +---- src/battle/radar.h | 5 +---- src/battle/rope.h | 5 +---- src/battle/script.h | 4 +--- src/battle/starfield.h | 5 +---- src/battle/waypoints.h | 5 +---- src/common.h | 9 +++++++++ src/draw/draw.h | 5 +---- src/draw/text.h | 6 ++---- src/galaxy/galacticMap.h | 5 +---- src/galaxy/mission.h | 5 ++--- src/galaxy/starSystems.h | 4 +--- src/galaxy/stats.h | 5 +---- src/game/game.h | 5 +---- src/game/title.h | 5 +---- src/plat/unix/unixInit.h | 5 +---- src/system/init.h | 9 ++++----- src/system/input.h | 5 +---- src/system/io.h | 6 ++---- src/system/load.h | 4 +--- src/system/lookup.h | 5 +---- src/system/options.h | 6 ++---- src/system/save.h | 4 +--- src/system/sound.h | 7 ++----- src/system/textures.h | 5 ++--- src/system/transition.h | 5 +---- src/system/util.h | 4 +--- src/system/widgets.h | 4 +--- src/test/testMission.h | 4 +--- 44 files changed, 71 insertions(+), 157 deletions(-) create mode 100644 build/linux/control create mode 100644 src/common.h diff --git a/build/linux/control b/build/linux/control new file mode 100644 index 0000000..56e9fb9 --- /dev/null +++ b/build/linux/control @@ -0,0 +1,11 @@ +Source: tbftss +Package: tbftss +Version: ${version} +Section: games +Priority: optional +Installed-Size: ${size} +Architecture: i386 +Depends: libsdl2-2.0-0, libsdl2-image-2.0-0, libsdl2-mixer-2.0-0, libsdl2-ttf-2.0-0 +Maintainer: stephenjsweeney@battleforthesolarsystem.com +Description: 2D mission-based space shooter, based on the Battle for the Solar System space opera novel trilogy. +Homepage: www.battleforthesolarsystem.com/games/pw diff --git a/src/battle/ai.h b/src/battle/ai.h index 1d1d068..991957a 100644 --- a/src/battle/ai.h +++ b/src/battle/ai.h @@ -18,10 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" - -#include "../defs.h" -#include "../structs.h" +#include "../common.h" #define AI_EVADE 0 #define AI_FALLBACK 1 diff --git a/src/battle/battle.h b/src/battle/battle.h index 68415ac..3b26ef1 100644 --- a/src/battle/battle.h +++ b/src/battle/battle.h @@ -18,10 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" +#include "../common.h" -#include "../defs.h" -#include "../structs.h" #include "../json/cJSON.h" #define SHOW_BATTLE 0 diff --git a/src/battle/bullets.h b/src/battle/bullets.h index 7e960dd..5a2841a 100644 --- a/src/battle/bullets.h +++ b/src/battle/bullets.h @@ -18,10 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" +#include "../common.h" -#include "../defs.h" -#include "../structs.h" #include "../json/cJSON.h" #define TURN_SPEED 2 diff --git a/src/battle/challenges.h b/src/battle/challenges.h index 470ce08..03997f8 100644 --- a/src/battle/challenges.h +++ b/src/battle/challenges.h @@ -18,10 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" - -#include "../defs.h" -#include "../structs.h" +#include "../common.h" extern Battle battle; extern Entity *player; diff --git a/src/battle/effects.h b/src/battle/effects.h index 3f22f17..ce9b6b8 100644 --- a/src/battle/effects.h +++ b/src/battle/effects.h @@ -18,10 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" - -#include "../defs.h" -#include "../structs.h" +#include "../common.h" extern void blitScaled(SDL_Texture *texture, int x, int y, int w, int h); extern SDL_Texture *getTexture(char *name); diff --git a/src/battle/entities.h b/src/battle/entities.h index ca7582e..cd4c5c2 100644 --- a/src/battle/entities.h +++ b/src/battle/entities.h @@ -18,10 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" - -#include "../defs.h" -#include "../structs.h" +#include "../common.h" extern void blitRotated(SDL_Texture *t, int x, int y, int angle); extern void drawFighter(Entity *e); diff --git a/src/battle/extractionPoint.h b/src/battle/extractionPoint.h index b24b9dd..73c3b05 100644 --- a/src/battle/extractionPoint.h +++ b/src/battle/extractionPoint.h @@ -18,10 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" - -#include "../defs.h" -#include "../structs.h" +#include "../common.h" extern SDL_Texture *getTexture(char *filename); extern Entity *spawnEntity(void); diff --git a/src/battle/fighters.h b/src/battle/fighters.h index cd5e8f8..872cb33 100644 --- a/src/battle/fighters.h +++ b/src/battle/fighters.h @@ -18,10 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" +#include "../common.h" -#include "../defs.h" -#include "../structs.h" #include "../json/cJSON.h" extern SDL_Texture *getTexture(char *filename); diff --git a/src/battle/grid.h b/src/battle/grid.h index 68f4da4..b817670 100644 --- a/src/battle/grid.h +++ b/src/battle/grid.h @@ -18,9 +18,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" - -#include "../defs.h" -#include "../structs.h" +#include "../common.h" extern Battle battle; diff --git a/src/battle/hud.h b/src/battle/hud.h index 5ada754..185738b 100644 --- a/src/battle/hud.h +++ b/src/battle/hud.h @@ -18,10 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" - -#include "../defs.h" -#include "../structs.h" +#include "../common.h" #define MAX_HUD_MESSAGES 6 diff --git a/src/battle/items.h b/src/battle/items.h index b1ed312..591c304 100644 --- a/src/battle/items.h +++ b/src/battle/items.h @@ -18,10 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" +#include "../common.h" -#include "../defs.h" -#include "../structs.h" #include "../json/cJSON.h" extern char *readFile(char *filename); diff --git a/src/battle/messageBox.h b/src/battle/messageBox.h index 9bcd593..08b0e4d 100644 --- a/src/battle/messageBox.h +++ b/src/battle/messageBox.h @@ -18,10 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" - -#include "../defs.h" -#include "../structs.h" +#include "../common.h" extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...); extern void limitTextWidth(int width); diff --git a/src/battle/missionInfo.h b/src/battle/missionInfo.h index 042ec34..aac3331 100644 --- a/src/battle/missionInfo.h +++ b/src/battle/missionInfo.h @@ -18,10 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" - -#include "../defs.h" -#include "../structs.h" +#include "../common.h" extern void blit(SDL_Texture *texture, int x, int y, int center); extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...); diff --git a/src/battle/objectives.h b/src/battle/objectives.h index 1d9eb75..c1a8d81 100644 --- a/src/battle/objectives.h +++ b/src/battle/objectives.h @@ -18,10 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" - -#include "../defs.h" -#include "../structs.h" +#include "../common.h" extern void updateChallenges(void); extern void addHudMessage(SDL_Color c, char *format, ...); diff --git a/src/battle/player.h b/src/battle/player.h index 1d0ece8..6478364 100644 --- a/src/battle/player.h +++ b/src/battle/player.h @@ -18,10 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" - -#include "../defs.h" -#include "../structs.h" +#include "../common.h" #define MAX_SELECTABLE_PLAYERS 8 #define MAX_SELECTABLE_TARGETS 8 diff --git a/src/battle/radar.h b/src/battle/radar.h index fa67306..4a5998e 100644 --- a/src/battle/radar.h +++ b/src/battle/radar.h @@ -18,10 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" - -#include "../defs.h" -#include "../structs.h" +#include "../common.h" extern int getDistance(int x1, int y1, int x2, int y2); extern void blit(SDL_Texture *texture, int x, int y, int center); diff --git a/src/battle/rope.h b/src/battle/rope.h index 93a77dc..0e72f94 100644 --- a/src/battle/rope.h +++ b/src/battle/rope.h @@ -18,10 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" - -#include "../defs.h" -#include "../structs.h" +#include "../common.h" #define ROPE_DISTANCE 128 diff --git a/src/battle/script.h b/src/battle/script.h index 2c62e35..87fdaec 100644 --- a/src/battle/script.h +++ b/src/battle/script.h @@ -18,10 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" +#include "../common.h" -#include "../defs.h" -#include "../structs.h" #include "../json/cJSON.h" extern void completeMission(void); diff --git a/src/battle/starfield.h b/src/battle/starfield.h index ce53166..d23d5be 100644 --- a/src/battle/starfield.h +++ b/src/battle/starfield.h @@ -18,9 +18,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" - -#include "../defs.h" -#include "../structs.h" +#include "../common.h" extern App app; diff --git a/src/battle/waypoints.h b/src/battle/waypoints.h index 4dc3b4b..836e114 100644 --- a/src/battle/waypoints.h +++ b/src/battle/waypoints.h @@ -18,10 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" - -#include "../defs.h" -#include "../structs.h" +#include "../common.h" extern SDL_Texture *getTexture(char *filename); extern int getDistance(int x1, int y1, int x2, int y2); diff --git a/src/common.h b/src/common.h new file mode 100644 index 0000000..a613e83 --- /dev/null +++ b/src/common.h @@ -0,0 +1,9 @@ +#include "stdlib.h" +#include "stdio.h" +#include "string.h" +#include "math.h" + +#include "SDL2/SDL.h" + +#include "defs.h" +#include "structs.h" diff --git a/src/draw/draw.h b/src/draw/draw.h index 41d33cd..0938b44 100644 --- a/src/draw/draw.h +++ b/src/draw/draw.h @@ -18,10 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" - -#include "../defs.h" -#include "../structs.h" +#include "../common.h" extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...); extern void drawMouse(void); diff --git a/src/draw/text.h b/src/draw/text.h index 0841622..3dd4b70 100644 --- a/src/draw/text.h +++ b/src/draw/text.h @@ -18,11 +18,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" -#include "SDL2/SDL_ttf.h" +#include "../common.h" -#include "../defs.h" -#include "../structs.h" +#include "SDL2/SDL_ttf.h" extern void blit(SDL_Texture *texture, int x, int y, int centered); extern char *getFileLocation(char *filename); diff --git a/src/galaxy/galacticMap.h b/src/galaxy/galacticMap.h index 51e2cd5..9446948 100644 --- a/src/galaxy/galacticMap.h +++ b/src/galaxy/galacticMap.h @@ -18,10 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" - -#include "../defs.h" -#include "../structs.h" +#include "../common.h" #define SHOW_GALAXY 0 #define SHOW_STAR_SYSTEM 1 diff --git a/src/galaxy/mission.h b/src/galaxy/mission.h index 710f19e..0142960 100644 --- a/src/galaxy/mission.h +++ b/src/galaxy/mission.h @@ -18,11 +18,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" +#include "../common.h" + #include "time.h" -#include "../defs.h" -#include "../structs.h" #include "../json/cJSON.h" extern long lookup(char *name); diff --git a/src/galaxy/starSystems.h b/src/galaxy/starSystems.h index 7872b06..fd762c3 100644 --- a/src/galaxy/starSystems.h +++ b/src/galaxy/starSystems.h @@ -18,10 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" +#include "../common.h" -#include "../defs.h" -#include "../structs.h" #include "../json/cJSON.h" extern char *readFile(char *filename); diff --git a/src/galaxy/stats.h b/src/galaxy/stats.h index e277f5c..ec40b8d 100644 --- a/src/galaxy/stats.h +++ b/src/galaxy/stats.h @@ -18,10 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" - -#include "../defs.h" -#include "../structs.h" +#include "../common.h" #define MAX_STAT_ITEMS 9 diff --git a/src/game/game.h b/src/game/game.h index 56aae6b..aa9c66f 100644 --- a/src/game/game.h +++ b/src/game/game.h @@ -18,9 +18,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" - -#include "../defs.h" -#include "../structs.h" +#include "../common.h" extern Game game; diff --git a/src/game/title.h b/src/game/title.h index e2ebb3a..f61da86 100644 --- a/src/game/title.h +++ b/src/game/title.h @@ -18,10 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" - -#include "../defs.h" -#include "../structs.h" +#include "../common.h" #define NUM_FIGHTERS 12 diff --git a/src/plat/unix/unixInit.h b/src/plat/unix/unixInit.h index 08a6559..ef47643 100644 --- a/src/plat/unix/unixInit.h +++ b/src/plat/unix/unixInit.h @@ -23,9 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include -#include "SDL2/SDL.h" - -#include "../../defs.h" -#include "../../structs.h" +#include "../../common.h" extern App app; diff --git a/src/system/init.h b/src/system/init.h index 9db7edb..4ab9fff 100644 --- a/src/system/init.h +++ b/src/system/init.h @@ -18,15 +18,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" +#include "../common.h" + +#include "../json/cJSON.h" + #include "SDL2/SDL_image.h" #include "SDL2/SDL_mixer.h" #include "SDL2/SDL_ttf.h" -#include "../defs.h" -#include "../structs.h" -#include "../json/cJSON.h" - extern int fileExists(char *filename); extern char *readFile(char *filename); extern int writeFile(char *filename, char *data); diff --git a/src/system/input.h b/src/system/input.h index 977e4a3..38dcee7 100644 --- a/src/system/input.h +++ b/src/system/input.h @@ -18,10 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" - -#include "../defs.h" -#include "../structs.h" +#include "../common.h" extern SDL_Texture *getTexture(char *filename); extern void blit(SDL_Texture *texture, int x, int y, int centered); diff --git a/src/system/io.h b/src/system/io.h index 99aaeb9..7672fd2 100644 --- a/src/system/io.h +++ b/src/system/io.h @@ -18,10 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" +#include "../common.h" + #include "sys/stat.h" -#include "../defs.h" -#include "../structs.h" - extern App app; diff --git a/src/system/load.h b/src/system/load.h index 91963c4..58c8bbb 100644 --- a/src/system/load.h +++ b/src/system/load.h @@ -18,10 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" +#include "../common.h" -#include "../defs.h" -#include "../structs.h" #include "../json/cJSON.h" extern char *readFile(char *filename); diff --git a/src/system/lookup.h b/src/system/lookup.h index bc5e47d..ffd9495 100644 --- a/src/system/lookup.h +++ b/src/system/lookup.h @@ -18,7 +18,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" - -#include "../defs.h" -#include "../structs.h" +#include "../common.h" diff --git a/src/system/options.h b/src/system/options.h index df93865..eb739e6 100644 --- a/src/system/options.h +++ b/src/system/options.h @@ -18,11 +18,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" -#include "SDL2/SDL_mixer.h" +#include "../common.h" -#include "../defs.h" -#include "../structs.h" +#include "SDL2/SDL_mixer.h" extern void selectWidget(const char *name, const char *group); extern Widget *getWidget(const char *name, const char *group); diff --git a/src/system/save.h b/src/system/save.h index ea9c63d..7fc90dd 100644 --- a/src/system/save.h +++ b/src/system/save.h @@ -18,10 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" +#include "../common.h" -#include "../defs.h" -#include "../structs.h" #include "../json/cJSON.h" extern int writeFile(char *filename, char *data); diff --git a/src/system/sound.h b/src/system/sound.h index 92f92c4..cfe7339 100644 --- a/src/system/sound.h +++ b/src/system/sound.h @@ -18,12 +18,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" -#include "SDL2/SDL_mixer.h" +#include "../common.h" -#include "../defs.h" -#include "../structs.h" -#include "../json/cJSON.h" +#include "SDL2/SDL_mixer.h" #define MAX_BATTLE_SOUND_DISTANCE 1500 diff --git a/src/system/textures.h b/src/system/textures.h index 66e64c4..162b7e7 100644 --- a/src/system/textures.h +++ b/src/system/textures.h @@ -18,10 +18,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL_image.h" +#include "../common.h" -#include "../defs.h" -#include "../structs.h" +#include "SDL2/SDL_image.h" extern char *getFileLocation(char *filename); diff --git a/src/system/transition.h b/src/system/transition.h index 6ef2cbd..df46a42 100644 --- a/src/system/transition.h +++ b/src/system/transition.h @@ -18,10 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" - -#include "../defs.h" -#include "../structs.h" +#include "../common.h" extern void prepareScene(void); extern void presentScene(void); diff --git a/src/system/util.h b/src/system/util.h index 3ed4016..ffd9495 100644 --- a/src/system/util.h +++ b/src/system/util.h @@ -18,6 +18,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" - -#include "../defs.h" +#include "../common.h" diff --git a/src/system/widgets.h b/src/system/widgets.h index 1aa715f..b889086 100644 --- a/src/system/widgets.h +++ b/src/system/widgets.h @@ -18,10 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" +#include "../common.h" -#include "../defs.h" -#include "../structs.h" #include "../json/cJSON.h" extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...); diff --git a/src/test/testMission.h b/src/test/testMission.h index 98992c5..c4834a0 100644 --- a/src/test/testMission.h +++ b/src/test/testMission.h @@ -18,10 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SDL2/SDL.h" +#include "../common.h" -#include "../defs.h" -#include "../structs.h" #include "../json/cJSON.h" extern void initBattle(void);