Created common.h to aid with cross compiling.

This commit is contained in:
Steve 2015-12-05 08:15:58 +00:00
parent ea5ac8af30
commit d6982e80ca
44 changed files with 71 additions and 157 deletions

11
build/linux/control Normal file
View File

@ -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

View File

@ -18,10 +18,7 @@ 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"
#define AI_EVADE 0 #define AI_EVADE 0
#define AI_FALLBACK 1 #define AI_FALLBACK 1

View File

@ -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" #include "../json/cJSON.h"
#define SHOW_BATTLE 0 #define SHOW_BATTLE 0

View File

@ -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" #include "../json/cJSON.h"
#define TURN_SPEED 2 #define TURN_SPEED 2

View File

@ -18,10 +18,7 @@ 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"
extern Battle battle; extern Battle battle;
extern Entity *player; extern Entity *player;

View File

@ -18,10 +18,7 @@ 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"
extern void blitScaled(SDL_Texture *texture, int x, int y, int w, int h); extern void blitScaled(SDL_Texture *texture, int x, int y, int w, int h);
extern SDL_Texture *getTexture(char *name); extern SDL_Texture *getTexture(char *name);

View File

@ -18,10 +18,7 @@ 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"
extern void blitRotated(SDL_Texture *t, int x, int y, int angle); extern void blitRotated(SDL_Texture *t, int x, int y, int angle);
extern void drawFighter(Entity *e); extern void drawFighter(Entity *e);

View File

@ -18,10 +18,7 @@ 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"
extern SDL_Texture *getTexture(char *filename); extern SDL_Texture *getTexture(char *filename);
extern Entity *spawnEntity(void); extern Entity *spawnEntity(void);

View File

@ -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" #include "../json/cJSON.h"
extern SDL_Texture *getTexture(char *filename); extern SDL_Texture *getTexture(char *filename);

View File

@ -18,9 +18,6 @@ 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"
extern Battle battle; extern Battle battle;

View File

@ -18,10 +18,7 @@ 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"
#define MAX_HUD_MESSAGES 6 #define MAX_HUD_MESSAGES 6

View File

@ -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" #include "../json/cJSON.h"
extern char *readFile(char *filename); extern char *readFile(char *filename);

View File

@ -18,10 +18,7 @@ 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"
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...); extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);
extern void limitTextWidth(int width); extern void limitTextWidth(int width);

View File

@ -18,10 +18,7 @@ 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"
extern void blit(SDL_Texture *texture, int x, int y, int center); 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, ...); extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);

View File

@ -18,10 +18,7 @@ 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"
extern void updateChallenges(void); extern void updateChallenges(void);
extern void addHudMessage(SDL_Color c, char *format, ...); extern void addHudMessage(SDL_Color c, char *format, ...);

View File

@ -18,10 +18,7 @@ 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"
#define MAX_SELECTABLE_PLAYERS 8 #define MAX_SELECTABLE_PLAYERS 8
#define MAX_SELECTABLE_TARGETS 8 #define MAX_SELECTABLE_TARGETS 8

View File

@ -18,10 +18,7 @@ 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"
extern int getDistance(int x1, int y1, int x2, int y2); extern int getDistance(int x1, int y1, int x2, int y2);
extern void blit(SDL_Texture *texture, int x, int y, int center); extern void blit(SDL_Texture *texture, int x, int y, int center);

View File

@ -18,10 +18,7 @@ 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"
#define ROPE_DISTANCE 128 #define ROPE_DISTANCE 128

View File

@ -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" #include "../json/cJSON.h"
extern void completeMission(void); extern void completeMission(void);

View File

@ -18,9 +18,6 @@ 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"
extern App app; extern App app;

View File

@ -18,10 +18,7 @@ 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"
extern SDL_Texture *getTexture(char *filename); extern SDL_Texture *getTexture(char *filename);
extern int getDistance(int x1, int y1, int x2, int y2); extern int getDistance(int x1, int y1, int x2, int y2);

9
src/common.h Normal file
View File

@ -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"

View File

@ -18,10 +18,7 @@ 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"
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...); extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);
extern void drawMouse(void); extern void drawMouse(void);

View File

@ -18,11 +18,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "SDL2/SDL.h" #include "../common.h"
#include "SDL2/SDL_ttf.h"
#include "../defs.h" #include "SDL2/SDL_ttf.h"
#include "../structs.h"
extern void blit(SDL_Texture *texture, int x, int y, int centered); extern void blit(SDL_Texture *texture, int x, int y, int centered);
extern char *getFileLocation(char *filename); extern char *getFileLocation(char *filename);

View File

@ -18,10 +18,7 @@ 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"
#define SHOW_GALAXY 0 #define SHOW_GALAXY 0
#define SHOW_STAR_SYSTEM 1 #define SHOW_STAR_SYSTEM 1

View File

@ -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 "time.h"
#include "../defs.h"
#include "../structs.h"
#include "../json/cJSON.h" #include "../json/cJSON.h"
extern long lookup(char *name); extern long lookup(char *name);

View File

@ -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" #include "../json/cJSON.h"
extern char *readFile(char *filename); extern char *readFile(char *filename);

View File

@ -18,10 +18,7 @@ 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"
#define MAX_STAT_ITEMS 9 #define MAX_STAT_ITEMS 9

View File

@ -18,9 +18,6 @@ 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"
extern Game game; extern Game game;

View File

@ -18,10 +18,7 @@ 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"
#define NUM_FIGHTERS 12 #define NUM_FIGHTERS 12

View File

@ -23,9 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include "SDL2/SDL.h" #include "../../common.h"
#include "../../defs.h"
#include "../../structs.h"
extern App app; extern App app;

View File

@ -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_image.h"
#include "SDL2/SDL_mixer.h" #include "SDL2/SDL_mixer.h"
#include "SDL2/SDL_ttf.h" #include "SDL2/SDL_ttf.h"
#include "../defs.h"
#include "../structs.h"
#include "../json/cJSON.h"
extern int fileExists(char *filename); extern int fileExists(char *filename);
extern char *readFile(char *filename); extern char *readFile(char *filename);
extern int writeFile(char *filename, char *data); extern int writeFile(char *filename, char *data);

View File

@ -18,10 +18,7 @@ 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"
extern SDL_Texture *getTexture(char *filename); extern SDL_Texture *getTexture(char *filename);
extern void blit(SDL_Texture *texture, int x, int y, int centered); extern void blit(SDL_Texture *texture, int x, int y, int centered);

View File

@ -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 "sys/stat.h"
#include "../defs.h"
#include "../structs.h"
extern App app; extern App app;

View File

@ -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" #include "../json/cJSON.h"
extern char *readFile(char *filename); extern char *readFile(char *filename);

View File

@ -18,7 +18,4 @@ 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"

View File

@ -18,11 +18,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "SDL2/SDL.h" #include "../common.h"
#include "SDL2/SDL_mixer.h"
#include "../defs.h" #include "SDL2/SDL_mixer.h"
#include "../structs.h"
extern void selectWidget(const char *name, const char *group); extern void selectWidget(const char *name, const char *group);
extern Widget *getWidget(const char *name, const char *group); extern Widget *getWidget(const char *name, const char *group);

View File

@ -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" #include "../json/cJSON.h"
extern int writeFile(char *filename, char *data); extern int writeFile(char *filename, char *data);

View File

@ -18,12 +18,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "SDL2/SDL.h" #include "../common.h"
#include "SDL2/SDL_mixer.h"
#include "../defs.h" #include "SDL2/SDL_mixer.h"
#include "../structs.h"
#include "../json/cJSON.h"
#define MAX_BATTLE_SOUND_DISTANCE 1500 #define MAX_BATTLE_SOUND_DISTANCE 1500

View File

@ -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 "SDL2/SDL_image.h"
#include "../structs.h"
extern char *getFileLocation(char *filename); extern char *getFileLocation(char *filename);

View File

@ -18,10 +18,7 @@ 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"
extern void prepareScene(void); extern void prepareScene(void);
extern void presentScene(void); extern void presentScene(void);

View File

@ -18,6 +18,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "SDL2/SDL.h" #include "../common.h"
#include "../defs.h"

View File

@ -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" #include "../json/cJSON.h"
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...); extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);

View File

@ -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" #include "../json/cJSON.h"
extern void initBattle(void); extern void initBattle(void);