Moved #includes, #defines, enums into c files, from h files.

This commit is contained in:
Steve 2022-07-30 16:10:02 +01:00
parent fc09a7d598
commit 5e82c957cd
122 changed files with 1241 additions and 1341 deletions

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "ai.h"
#include "../battle/mine.h"
#include "../system/util.h"
#include "../battle/fighters.h"
#include "../battle/quadtree.h"
#include "../battle/bullets.h"
#include "../battle/hud.h"
#include "../battle/script.h"
#define AI_EVADE 0
#define AI_FALLBACK 1
#define AI_HUNT 2
#define TURN_SPEED 4
#define TURN_THRESHOLD 2
extern Battle battle;
extern Colors colors;
extern Dev dev;
extern Entity *player;
extern Entity *self;
static void faceTarget(Entity *e);
static int isInFOV(Entity *e, int fov);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,29 +18,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#define AI_EVADE 0
#define AI_FALLBACK 1
#define AI_HUNT 2
#define TURN_SPEED 4
#define TURN_THRESHOLD 2
extern void addHudMessage(SDL_Color c, char *format, ...);
extern void applyFighterBrakes(void);
extern void applyFighterThrust(void);
extern void fireGuns(Entity *owner);
extern void fireMissile(Entity *owner);
extern void fireRocket(Entity *owner);
extern Entity **getAllEntsInRadius(int x, int y, int radius, Entity *ignore);
extern float getAngle(int x1, int y1, int x2, int y2);
extern int getDistance(int x1, int y1, int x2, int y2);
extern float mod(float n, float x);
extern void runScriptFunction(char *format, ...);
extern Entity *spawnMine(int type);
extern Battle battle;
extern Colors colors;
extern Dev dev;
extern Entity *player;
extern Entity *self;
void checkZackariaSuspicionLevel(void);
void checkSuspicionLevel(void);
void doAI(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,13 +18,55 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "battle.h"
#include "../json/cJSON.h"
#include "../game/credits.h"
#include "../battle/locations.h"
#include "../system/widgets.h"
#include "../galaxy/mission.h"
#include "../battle/bullets.h"
#include "../galaxy/galacticMap.h"
#include "../battle/effects.h"
#include "../system/draw.h"
#include "../battle/starfield.h"
#include "../battle/player.h"
#include "../system/sound.h"
#include "../battle/messageBox.h"
#include "../battle/spawners.h"
#include "../battle/waypoints.h"
#include "../battle/radar.h"
#include "../battle/objectives.h"
#include "../battle/script.h"
#include "../battle/quadtree.h"
#include "../challenges/challenges.h"
#include "../challenges/challengeHome.h"
#include "../system/modalDialog.h"
#include "../game/options.h"
#include "../battle/hud.h"
#include "../battle/missionInfo.h"
#include "../system/atlas.h"
#include "../system/input.h"
#include "../game/stats.h"
#include "../battle/debris.h"
#include "../game/trophies.h"
#include "../battle/entities.h"
#define SHOW_BATTLE 0
#define SHOW_MENU 1
#define SHOW_OBJECTIVES 2
#define SHOW_OPTIONS 3
extern App app;
extern Battle battle;
extern Dev dev;
extern Entity *player;
extern Game game;
static void logic(void);
static void draw(void);
static void handleKeyboard(void);
static void postBattle(void);
void destroyBattle(void);
static void doBattle(void);
static void optQuitBattle(void);
static void quitBattle(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,80 +18,5 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "../json/cJSON.h"
#define SHOW_BATTLE 0
#define SHOW_MENU 1
#define SHOW_OBJECTIVES 2
#define SHOW_OPTIONS 3
extern void awardTrophy(char *id);
extern void blitScaled(AtlasImage *atlasImage, int x, int y, int w, int h, int center);
extern void cancelScript(void);
extern void clearInput(void);
extern void destroyBullets(void);
extern void destroyDebris(void);
extern void destroyEffects(void);
extern void destroyEntities(void);
extern void destroyQuadtree(void);
extern void destroyScript(void);
extern void doBullets(void);
extern void doChallenges(void);
extern void doDebris(void);
extern void doEffects(void);
extern void doEntities(void);
extern void doHud(void);
extern void doLocations(void);
extern void doMessageBox(void);
extern void doObjectives(void);
extern void doPlayer(void);
extern void doPlayerSelect(void);
extern void doScript(void);
extern void doSpawners(void);
extern void doStars(float dx, float dy);
extern void doWidgets(void);
extern void drawBackground(SDL_Texture *texture);
extern void drawBullets(void);
extern void drawDebris(void);
extern void drawEffects(void);
extern void drawEntities(void);
extern void drawHud(void);
extern void drawLocations(void);
extern void drawMessageBox(void);
extern void drawMissionInfo(void);
extern void drawOptions(void);
extern void drawStars(void);
extern void drawWidgets(char *groupName);
extern Widget *getWidget(const char *name, const char *group);
extern void initBullets(void);
extern void initChallengeHome(void);
extern void initCredits(void);
extern void initDebris(void);
extern void initEffects(void);
extern void initEntities(void);
extern void initGalacticMap(void);
extern void initHud(void);
extern void initMessageBox(void);
extern void initOptions(void (*returnFromOptions)(void));
extern void initQuadtree(Quadtree *root);
extern void initRadar(void);
extern void initStars(void);
extern void loadMission(char *filename);
extern void playSound(int id);
extern void resetHud(void);
extern void resetMessageBox(void);
extern void resetWaypoints(void);
extern void runScriptFunction(const char *format, ...);
extern void scrollBackground(float x, float y);
extern void selectWidget(const char *name, const char *group);
extern void setAtlasColor(int r, int g, int b, int a);
extern void showOKCancelDialog(void (*okCallback)(void), void (*cancelCallback)(void), const char *format, ...);
extern void updateAccuracyStats(unsigned int *stats);
extern App app;
extern Battle battle;
extern Dev dev;
extern Entity *player;
extern Game game;
void destroyBattle(void);
void initBattle(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,28 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "bullets.h"
#include "../json/cJSON.h"
#include "../system/lookup.h"
#include "../system/atlas.h"
#include "../system/util.h"
#include "../battle/fighters.h"
#include "../battle/quadtree.h"
#include "../game/trophies.h"
#include "../battle/effects.h"
#include "../system/draw.h"
#include "../system/io.h"
#include "../system/sound.h"
#define INITIAL_BULLET_DRAW_CAPACITY 32
#define MISSILE_LIFE (FPS * 30)
#define TURN_SPEED 2
#define TURN_THRESHOLD 3
extern App app;
extern Battle battle;
extern Entity *player;
static void huntTarget(Bullet *b);
static void checkCollisions(Bullet *b);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,37 +18,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "../json/cJSON.h"
#define INITIAL_BULLET_DRAW_CAPACITY 32
#define MISSILE_LIFE (FPS * 30)
#define TURN_SPEED 2
#define TURN_THRESHOLD 3
extern void addBulletHitEffect(int x, int y, int r, int g, int b);
extern void addMissileEngineEffect(Bullet *b);
extern void addMissileExplosion(Bullet *b);
extern void awardTrophy(char *id);
extern void blitRotated(AtlasImage *atlasImage, int x, int y, float angle);
extern int collision(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2);
extern void damageFighter(Entity *e, int damage, long flags);
extern long flagsToLong(char *flags, int *add);
extern Entity **getAllEntsInRadius(int x, int y, int radius, Entity *ignore);
extern Entity **getAllEntsWithin(int x, int y, int w, int h, Entity *ignore);
extern float getAngle(int x1, int y1, int x2, int y2);
extern AtlasImage *getAtlasImage(char *filename);
extern int getDistance(int x1, int y1, int x2, int y2);
extern int isOnBattleScreen(int x, int y, int w, int h);
extern long lookup(char *name);
extern float mod(float n, float x);
extern void playBattleSound(int id, int x, int y);
extern void playSound(int id);
extern char *readFile(char *filename);
extern void *resize(void *array, int oldSize, int newSize);
extern void setAtlasColor(int r, int g, int b, int a);
extern App app;
extern Battle battle;
extern Entity *player;
void destroyBullets(void);
void destroyBulletDefs(void);
void fireMissile(Entity *owner);
void fireRocket(Entity *owner);
void fireGuns(Entity *owner);
void drawBullets(void);
void doBullets(void);
void initBulletDefs(void);
void initBullets(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,30 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "capitalShips.h"
#include "../json/cJSON.h"
#include "../system/lookup.h"
#include "../system/sound.h"
#include "../system/util.h"
#include "../battle/ai.h"
#include "../battle/fighters.h"
#include "../battle/quadtree.h"
#include "../battle/debris.h"
#include "../battle/messageBox.h"
#include "../battle/script.h"
#include "../battle/effects.h"
#include "../battle/objectives.h"
#include "../system/atlas.h"
#include "../system/io.h"
#include "../battle/entities.h"
#define TURN_SPEED 0.1
#define TURN_THRESHOLD 2
extern Battle battle;
extern Entity *player;
extern Entity *self;
static int steer(void);
static void think(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,39 +18,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "../json/cJSON.h"
#define TURN_SPEED 0.1
#define TURN_THRESHOLD 2
extern void addDebris(int x, int y, int amount);
extern void addLargeEngineEffect(void);
extern void addLargeExplosion(void);
extern void addMessageBox(char *title, char *body, int type);
extern void addSmallExplosion(void);
extern void applyFighterThrust(void);
extern void doAI(void);
extern long flagsToLong(char *flags, int *add);
extern Entity **getAllEntsInRadius(int x, int y, int radius, Entity *ignore);
extern float getAngle(int x1, int y1, int x2, int y2);
extern AtlasImage *getAtlasImage(char *filename);
extern int getDistance(int x1, int y1, int x2, int y2);
extern char **getFileList(char *dir, int *count);
extern int getJSONValue(cJSON *node, char *name, int defValue);
extern char *getJSONValueStr(cJSON *node, char *name, char *defValue);
extern long lookup(char *name);
extern float mod(float n, float x);
extern void playBattleSound(int id, int x, int y);
extern char *readFile(char *filename);
extern void runScriptFunction(char *format, ...);
extern Entity *spawnEntity(void);
extern char **toTypeArray(char *types, int *numTypes);
extern void updateCondition(char *name, int type);
extern void updateObjective(char *name, int type);
extern Battle battle;
extern Entity *player;
extern Entity *self;
void destroyCapitalShipDefs(void);
void loadCapitalShips(struct cJSON *node);
void updateCapitalShipComponentProperties(Entity *parent, long flags);
void loadCapitalShipDefs(void);
void doCapitalShip(void);
Entity *spawnCapitalShip(char *name, int x, int y, int side);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "debris.h"
#include "../json/cJSON.h"
#include "../system/atlas.h"
#include "../system/draw.h"
#include "../system/util.h"
#include "../battle/effects.h"
#define INITIAL_DEBRIS_DRAW_CAPACITY 32
#define MAX_DEBRIS_TEXTURES 6
extern Battle battle;
static void changeCourse(Debris *d);
static void resizeDrawList(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,18 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "../json/cJSON.h"
#define INITIAL_DEBRIS_DRAW_CAPACITY 32
#define MAX_DEBRIS_TEXTURES 6
extern void addDebrisFire(int x, int y);
extern void blitRotated(AtlasImage *atlasImage, int x, int y, float angle);
extern AtlasImage *getAtlasImage(char *filename);
extern int isOnBattleScreen(int x, int y, int w, int h);
extern float mod(float n, float x);
extern void *resize(void *array, int oldSize, int newSize);
extern Battle battle;
void destroyDebris(void);
void drawDebris(void);
void doDebris(void);
void addDebris(int x, int y, int amount);
void initDebris(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "effects.h"
#include "../system/atlas.h"
#include "../system/draw.h"
#include "../system/util.h"
#define INITIAL_EFFECT_DRAW_CAPACITY 128
extern App app;
extern Battle battle;
extern Entity *self;
static void setRandomFlameHue(Effect *e);
static void setRandomShieldHue(Effect *e);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,17 +18,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#define INITIAL_EFFECT_DRAW_CAPACITY 128
extern void blitScaled(AtlasImage *atlasImage, int x, int y, int w, int h, int center);
extern int collision(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2);
extern AtlasImage *getAtlasImage(char *name);
extern int isOnBattleScreen(int x, int y, int w, int h);
extern void *resize(void *array, int oldSize, int newSize);
extern void setAtlasColor(int r, int g, int b, int a);
extern App app;
extern Battle battle;
extern Entity *self;
void destroyEffects(void);
void addECMEffect(Entity *ent);
void addShieldSplinterEffect(Entity *ent);
void addMissileEngineEffect(Bullet *b);
void addLargeEngineEffect(void);
void addEngineEffect(void);
void addMissileExplosion(Bullet *b);
void addLargeExplosion(void);
void addMineExplosion(void);
void addSmallExplosion(void);
void addDebrisFire(int x, int y);
void addSmallFighterExplosion(void);
void addBulletHitEffect(int x, int y, int r, int g, int b);
void drawShieldHitEffect(Entity *e);
void drawEffects(void);
void doEffects(void);
void initEffects(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "entities.h"
#include "../system/lookup.h"
#include "../battle/capitalShips.h"
#include "../battle/fighters.h"
#include "../battle/quadtree.h"
#include "../battle/rope.h"
#include "../system/atlas.h"
#include "../game/trophies.h"
#include "../battle/effects.h"
#include "../system/draw.h"
#define DISABLED_GLOW_MAX 255
#define DISABLED_GLOW_MIN 128
#define DISABLED_GLOW_SPEED 3
extern App app;
extern Battle battle;
extern Dev dev;
extern Entity *player;
extern Entity *self;
static void drawEntity(Entity *e);
static void doEntity(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,31 +18,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#define DISABLED_GLOW_MAX 255
#define DISABLED_GLOW_MIN 128
#define DISABLED_GLOW_SPEED 3
extern void addToQuadtree(Entity *e, Quadtree *root);
extern void awardTrophy(char *id);
extern void blitRotated(AtlasImage *atlasImage, int x, int y, float angle);
extern void cutRope(Entity *e);
extern void doCapitalShip(void);
extern void doFighter(void);
extern void doRope(Entity *e);
extern void drawRope(Entity *e);
extern void drawShieldHitEffect(Entity *e);
extern Entity **getAllEntsWithin(int x, int y, int w, int h, Entity *ignore);
extern int isOnBattleScreen(int x, int y, int w, int h);
extern long lookup(char *name);
extern void removeFromQuadtree(Entity *e, Quadtree *root);
extern void resetFighter(Entity *e);
extern void setAtlasColor(int r, int g, int b, int a);
extern void updateCapitalShipComponentProperties(Entity *parent, long flags);
extern App app;
extern Battle battle;
extern Dev dev;
extern Entity *player;
extern Entity *self;
void destroyEntities(void);
void awardPandoranCraftTrophy(void);
void updateEntitySide(char *sideStr, char *name);
void killEntity(char *name);
void addAllToQuadtree(void);
void countNumEnemies(void);
void activateEntityGroups(char *groupNames);
void activateEntities(char *names);
void drawEntities(void);
void doEntities(void);
Entity *spawnEntity(void);
void initEntities(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,31 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "fighters.h"
#include "../json/cJSON.h"
#include "../system/lookup.h"
#include "../system/atlas.h"
#include "../system/util.h"
#include "../battle/ai.h"
#include "../battle/quadtree.h"
#include "../battle/debris.h"
#include "../battle/rope.h"
#include "../galaxy/mission.h"
#include "../battle/hud.h"
#include "../battle/objectives.h"
#include "../battle/script.h"
#include "../battle/effects.h"
#include "../battle/items.h"
#include "../system/io.h"
#include "../system/sound.h"
#include "../battle/entities.h"
extern Battle battle;
extern Colors colors;
extern Entity *player;
extern Entity *self;
extern Game game;
static void separate(void);
static void die(void);
@ -172,7 +196,6 @@ static void randomizeDartGuns(Entity *dart)
dart->guns[2].y = -10;
break;
/* Plasma / Laser cannons */
case 3:
dart->guns[0].type = BT_PLASMA;

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,42 +18,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "../json/cJSON.h"
extern void addDebris(int x, int y, int amount);
extern void addEngineEffect(void);
extern void addHudMessage(SDL_Color c, char *format, ...);
extern void addRandomItem(int x, int y);
extern void addShieldSplinterEffect(Entity *ent);
extern void addSmallExplosion(void);
extern void addSmallFighterExplosion(void);
extern void adjustObjectiveTargetValue(char *name, int type, int amount);
extern void attachRope(void);
extern void checkSuspicionLevel(void);
extern void checkZackariaSuspicionLevel(void);
extern void completeMission(void);
extern void doAI(void);
extern long flagsToLong(char *flags, int *add);
extern Entity **getAllEntsInRadius(int x, int y, int radius, Entity *ignore);
extern float getAngle(int x1, int y1, int x2, int y2);
extern AtlasImage *getAtlasImage(char *filename);
extern int getDistance(int x1, int y1, int x2, int y2);
extern char **getFileList(char *dir, int *count);
extern int getJSONValue(cJSON *node, char *name, int defValue);
extern char *getJSONValueStr(cJSON *node, char *name, char *defValue);
extern long lookup(char *name);
extern void playBattleSound(int id, int x, int y);
extern char *readFile(char *filename);
extern void runScriptFunction(char *format, ...);
extern Entity *spawnEntity(void);
extern char **toTypeArray(char *types, int *numTypes);
extern void updateCondition(char *name, int type);
extern void updateObjective(char *name, int type);
extern Battle battle;
extern Colors colors;
extern Entity *player;
extern Entity *self;
extern Game game;
void destroyFighterStats(void);
void destroyFighterDefs(void);
void loadFighters(struct cJSON *node);
void loadFighterDefs(void);
Entity **getDBFighters(int *num);
void retreatAllies(void);
void retreatEnemies(void);
void damageFighter(Entity *e, int amount, long flags);
void applyFighterBrakes(void);
void applyFighterThrust(void);
void doFighter(void);
void resetFighter(Entity *fighter);
Entity *spawnFighter(char *name, int x, int y, int side);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "hud.h"
#include "../system/atlas.h"
#include "../system/util.h"
#include "../battle/player.h"
#include "../system/text.h"
#include "../battle/radar.h"
#include "../system/draw.h"
#include "../battle/jumpgate.h"
#define MAX_HUD_MESSAGES 6
extern App app;
extern Battle battle;
extern Colors colors;
extern Entity *player;
extern Game game;
static void drawPlayerTargeter(void);
static void drawNumFighters(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,26 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#define MAX_HUD_MESSAGES 6
extern void blit(AtlasImage *atlasImage, int x, int y, int center);
extern void blitRotated(AtlasImage *atlasImage, int x, int y, float angle);
extern void drawRadar(void);
extern void drawRadarRangeWarning(void);
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);
extern float getAngle(int x1, int y1, int x2, int y2);
extern AtlasImage *getAtlasImage(char *filename);
extern int getDistance(int x1, int y1, int x2, int y2);
extern int getPercent(float current, float total);
extern int jumpgateEnabled(void);
extern int playerHasGun(int type);
extern void setAtlasColor(int r, int g, int b, int a);
extern char *timeToString(long millis, int showHours);
extern App app;
extern Battle battle;
extern Colors colors;
extern Entity *player;
extern Game game;
void resetHud(void);
void drawHud(void);
void addHudMessage(SDL_Color c, char *format, ...);
void doHud(void);
void initHud(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "items.h"
#include "../json/cJSON.h"
#include "../system/lookup.h"
#include "../system/sound.h"
#include "../system/util.h"
#include "../battle/quadtree.h"
#include "../battle/hud.h"
#include "../battle/objectives.h"
#include "../system/io.h"
#include "../system/atlas.h"
#include "../battle/entities.h"
extern Battle battle;
extern Colors colors;
extern Entity *player;
extern Entity *self;
static void action(void);
static Entity *getItemDef(char *name);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,23 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "../json/cJSON.h"
extern void addHudMessage(SDL_Color c, char *format, ...);
extern int collision(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2);
extern long flagsToLong(char *flags, int *add);
extern Entity **getAllEntsInRadius(int x, int y, int radius, Entity *ignore);
extern AtlasImage *getAtlasImage(char *filename);
extern int getJSONValue(cJSON *node, char *name, int defValue);
extern char *getJSONValueStr(cJSON *node, char *name, char *defValue);
extern void playBattleSound(int id, int x, int y);
extern char *readFile(char *filename);
extern Entity *spawnEntity(void);
extern void updateObjective(char *name, int type);
extern Battle battle;
extern Colors colors;
extern Entity *player;
extern Entity *self;
void destroyItemDefs(void);
void loadItems(struct cJSON *node);
void addRandomItem(int x, int y);
Entity *spawnItem(char *name);
void loadItemDefs(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "jumpgate.h"
#include "../system/draw.h"
#include "../system/util.h"
#include "../battle/quadtree.h"
#include "../battle/debris.h"
#include "../battle/objectives.h"
#include "../battle/script.h"
#include "../battle/effects.h"
#include "../system/atlas.h"
#include "../system/sound.h"
#include "../battle/entities.h"
#define ESCAPE_DISTANCE 256
extern Battle battle;
extern Entity *self;
static void think(void);
static void draw(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,21 +18,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#define ESCAPE_DISTANCE 256
extern void addDebris(int x, int y, int amount);
extern void addSmallExplosion(void);
extern void blitRotated(AtlasImage *atlasImage, int x, int y, float angle);
extern Entity **getAllEntsInRadius(int x, int y, int radius, Entity *ignore);
extern AtlasImage *getAtlasImage(char *filename);
extern int getDistance(int x1, int y1, int x2, int y2);
extern void playBattleSound(int id, int x, int y);
extern void runScriptFunction(char *format, ...);
extern Entity *spawnEntity(void);
extern void updateCondition(char *name, int type);
extern void updateObjective(char *name, int type);
extern Battle battle;
extern Entity *self;
void activateJumpgate(int activate);
int jumpgateEnabled(void);
Entity *spawnJumpgate(int side, long flags);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "locations.h"
#include "../json/cJSON.h"
#include "../system/draw.h"
#include "../system/util.h"
#include "../battle/script.h"
extern Battle battle;
extern Entity *player;
void doLocations(void)
{
@ -131,7 +139,6 @@ void loadLocations(cJSON *node)
l->x += (SCREEN_WIDTH / 2);
l->y += (SCREEN_HEIGHT / 2);
node = node->next;
}
}

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,14 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "../json/cJSON.h"
extern void drawCircle(int cx, int cy, int radius, int r, int g, int b, int a);
extern int getDistance(int x1, int y1, int x2, int y2);
extern int getJSONValue(cJSON *node, char *name, int defValue);
extern void runScriptFunction(char *format, ...);
extern Battle battle;
extern Entity *player;
void loadLocations(struct cJSON *node);
void createChristabelLocation(void);
void activateLocations(char *locations);
void drawLocations(void);
void doLocations(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "messageBox.h"
#include "../system/text.h"
#include "../system/sound.h"
#define MSG_BOX_TEXT_WIDTH 600
extern App app;
extern Battle battle;
extern Colors colors;
extern Entity *player;
static void calculateMessageBoxHeight(MessageBox *msg);
static void nextMessage(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,16 +18,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#define MSG_BOX_TEXT_WIDTH 600
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);
extern int getWrappedTextHeight(char *text, int size);
extern void playSound(int sound);
extern void useFont(char *name);
extern App app;
extern Battle battle;
extern Colors colors;
extern Entity *player;
void resetMessageBox(void);
void drawMessageBox(void);
int showingMessageBoxes(void);
void doMessageBox(void);
void addMessageBox(char *title, char *body, int type);
void initMessageBox(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "mine.h"
#include "../system/sound.h"
#include "../system/util.h"
#include "../battle/fighters.h"
#include "../battle/quadtree.h"
#include "../game/trophies.h"
#include "../battle/objectives.h"
#include "../battle/script.h"
#include "../battle/effects.h"
#include "../system/atlas.h"
#include "../battle/entities.h"
#define DAMAGE_RANGE 250
#define SYSTEM_POWER 50
#define TRIGGER_RANGE 150
extern Battle battle;
extern Entity *player;
extern Entity *self;
static void think(void);
static void die(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,23 +18,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#define DAMAGE_RANGE 250
#define SYSTEM_POWER 50
#define TRIGGER_RANGE 150
extern void addMineExplosion(void);
extern void awardTrophy(char *id);
extern void damageFighter(Entity *e, int amount, long flags);
extern Entity **getAllEntsInRadius(int x, int y, int radius, Entity *ignore);
extern AtlasImage *getAtlasImage(char *filename);
extern int getDistance(int x1, int y1, int x2, int y2);
extern void playBattleSound(int id, int x, int y);
extern void runScriptFunction(const char *format, ...);
extern Entity *spawnEntity(void);
extern void updateObjective(char *name, int type);
extern Battle battle;
extern Entity *player;
extern Entity *self;
Entity *spawnMine(int type);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "missionInfo.h"
#include "../system/draw.h"
#include "../system/util.h"
#include "../challenges/challenges.h"
#include "../system/widgets.h"
#include "../system/text.h"
#include "../system/atlas.h"
extern App app;
extern Battle battle;
extern Colors colors;
extern Game game;
static void drawMissionSummary(AtlasImage *title);
static void drawObjectives(void);
@ -224,4 +236,3 @@ static void drawChallenges(void)
}
}
}

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,17 +18,5 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
extern void blit(AtlasImage *atlasImage, 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 drawWidgets(char *groupName);
extern AtlasImage *getAtlasImage(char *filename);
extern char *getChallengeDescription(Challenge *c);
extern void setAtlasColor(int r, int g, int b, int a);
extern char *timeToString(long millis, int showHours);
extern App app;
extern Battle battle;
extern Colors colors;
extern Game game;
void drawMissionInfo(void);
void initMissionInfo(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "objectives.h"
#include "../json/cJSON.h"
#include "../system/lookup.h"
#include "../system/util.h"
#include "../system/sound.h"
#include "../galaxy/mission.h"
#include "../battle/hud.h"
#include "../battle/script.h"
extern Battle battle;
extern Colors colors;
static int fireObjectivesComplete;
@ -238,7 +249,6 @@ void completeConditions(void)
}
}
void failIncompleteObjectives(void)
{
Objective *o;

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,16 +18,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "../json/cJSON.h"
extern void addHudMessage(SDL_Color c, char *format, ...);
extern void completeMission(void);
extern void failMission(void);
extern int getJSONValue(cJSON *node, char *name, int defValue);
extern long lookup(char *name);
extern void playSound(int id);
extern void runScriptFunction(char *format, ...);
extern Battle battle;
extern Colors colors;
void addEpicKillsObjective(void);
void addEpicLivesObjective(void);
void loadObjectives(struct cJSON *node);
void activateObjectives(char *objectives);
void failIncompleteObjectives(void);
void completeConditions(void);
void completeAllObjectives(void);
void updateCondition(char *name, int type);
void adjustObjectiveTargetValue(char *name, int type, int amount);
void updateObjective(char *name, int type);
void doObjectives(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,31 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "player.h"
#include "../json/cJSON.h"
#include "../system/lookup.h"
#include "../system/util.h"
#include "../system/controls.h"
#include "../battle/fighters.h"
#include "../system/sound.h"
#include "../galaxy/mission.h"
#include "../game/trophies.h"
#include "../battle/hud.h"
#include "../battle/objectives.h"
#include "../battle/bullets.h"
#include "../battle/effects.h"
#define MAX_SELECTABLE_PLAYERS 8
#define MAX_SELECTABLE_TARGETS 8
extern App app;
extern Battle battle;
extern Colors colors;
extern Dev dev;
extern Entity *player;
extern Entity *self;
extern Game game;
static void selectTarget(void);
static void switchGuns(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,39 +18,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "../json/cJSON.h"
#define MAX_SELECTABLE_PLAYERS 8
#define MAX_SELECTABLE_TARGETS 8
extern void addECMEffect(Entity *ent);
extern void addHudMessage(SDL_Color c, char *format, ...);
extern void applyFighterBrakes(void);
extern void applyFighterThrust(void);
extern void awardTrophy(char *id);
extern void clearControl(int type);
extern int collision(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2);
extern void failMission(void);
extern void fireGuns(Entity *owner);
extern void fireMissile(Entity *owner);
extern void fireRocket(Entity *owner);
extern long flagsToLong(char *flags, int *add);
extern float getAngle(int x1, int y1, int x2, int y2);
extern int getDistance(int x1, int y1, int x2, int y2);
extern int isAcceptControl(void);
extern int isControl(int type);
extern long lookup(char *name);
extern float mod(float n, float x);
extern void playSound(int id);
extern void resetAcceptControls(void);
extern Entity *spawnFighter(char *name, int x, int y, int side);
extern void updateCondition(char *name, int type);
extern App app;
extern Battle battle;
extern Colors colors;
extern Dev dev;
extern Entity *player;
extern Entity *self;
extern Game game;
void loadPlayer(struct cJSON *node);
int playerHasGun(int type);
void setInitialPlayerAngle(void);
void doPlayerSelect(void);
void doPlayer(void);
void initPlayer(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "quadtree.h"
#include "../system/util.h"
#define QT_INITIAL_CAPACITY 8
#define QT_MAX_DEPTH 5
extern Battle battle;
static Entity **candidates;
static int cIndex;

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,11 +18,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#define QT_INITIAL_CAPACITY 8
#define QT_MAX_DEPTH 5
extern void *resize(void *array, int oldSize, int newSize);
extern Battle battle;
void destroyQuadtree(void);
Entity **getAllEntsInRadius(int x, int y, int radius, Entity *ignore);
Entity **getAllEntsWithin(int x, int y, int w, int h, Entity *ignore);
void removeFromQuadtree(Entity *e, Quadtree *root);
void addToQuadtree(Entity *e, Quadtree *root);
void initQuadtree(Quadtree *root);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "radar.h"
#include "../system/text.h"
#include "../system/atlas.h"
#include "../system/draw.h"
#include "../system/util.h"
extern App app;
extern Battle battle;
extern Colors colors;
extern Entity *player;
static AtlasImage *radarTexture;
static AtlasImage *radarWarningTexture;

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,15 +18,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
extern void blit(AtlasImage *atlasImage, int x, int y, int center);
extern void blitRotated(AtlasImage *atlasImage, int x, int y, float angle);
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);
extern AtlasImage *getAtlasImage(char *filename);
extern int getDistance(int x1, int y1, int x2, int y2);
extern App app;
extern Battle battle;
extern Colors colors;
extern Entity *player;
void drawRadarRangeWarning(void);
void drawRadar(void);
void initRadar(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "rope.h"
#include "../battle/hud.h"
#include "../battle/quadtree.h"
#include "../system/util.h"
#include "../system/sound.h"
#include "../battle/script.h"
#define ROPE_DISTANCE 128
extern App app;
extern Battle battle;
extern Colors colors;
extern Entity *player;
extern Entity *self;
void attachRope(void)
{

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,19 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#define ROPE_DISTANCE 128
extern void addHudMessage(SDL_Color c, char *format, ...);
extern Entity **getAllEntsInRadius(int x, int y, int radius, Entity *ignore);
extern float getAngle(int x1, int y1, int x2, int y2);
extern int getDistance(int x1, int y1, int x2, int y2);
extern void playBattleSound(int id, int x, int y);
extern void runScriptFunction(char *format, ...);
extern App app;
extern Battle battle;
extern Colors colors;
extern Entity *player;
extern Entity *self;
void cutRope(Entity *e);
void drawRope(Entity *e);
void doRope(Entity *owner);
void attachRope(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,10 +18,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "script.h"
#include "../json/cJSON.h"
#include "../battle/locations.h"
#include "../battle/fighters.h"
#include "../galaxy/mission.h"
#include "../battle/hud.h"
#include "../battle/objectives.h"
#include "../battle/spawners.h"
#include "../battle/waypoints.h"
#include "../battle/messageBox.h"
#include "../battle/entities.h"
#include "../battle/jumpgate.h"
extern Battle battle;
extern Colors colors;
static void executeNextLine(ScriptRunner *runner);
void destroyScript(void);
static cJSON *scriptJSON, *rootJSON;
static ScriptRunner head;

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,29 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "../json/cJSON.h"
extern void activateEntities(char *name);
extern void activateEntityGroups(char *groupName);
extern void activateJumpgate(int activate);
extern void activateLocations(char *locations);
extern void activateNextWaypoint(void);
extern void activateObjectives(char *objectives);
extern void activateSpawner(char *name, int active);
extern void activateTrespasserSpawner(void);
extern void addHudMessage(SDL_Color c, char *format, ...);
extern void addMessageBox(char *title, char *body, int type);
extern void completeAllObjectives(void);
extern void completeMission(void);
extern void createChristabelLocation(void);
extern void failMission(void);
extern void killEntity(char *name);
extern void retreatAllies(void);
extern void retreatEnemies(void);
extern int showingMessageBoxes(void);
extern void updateEntitySide(char *side, char *entity);
extern Battle battle;
extern Colors colors;
void destroyScript(void);
void cancelScript(void);
void runScriptFunction(const char *format, ...);
void doScript(void);
void initScript(struct cJSON *root);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "spawners.h"
#include "../json/cJSON.h"
#include "../battle/fighters.h"
#include "../system/lookup.h"
#include "../system/util.h"
extern Battle battle;
extern Entity *player;
void doSpawners(void)
{

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,16 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "../json/cJSON.h"
extern long flagsToLong(char *flags, int *add);
extern int getJSONValue(cJSON *node, char *name, int defValue);
extern char *getJSONValueStr(cJSON *node, char *name, char *defValue);
extern long lookup(char *name);
extern Entity *spawnFighter(char *name, int x, int y, int side);
extern char **toTypeArray(char *types, int *numTypes);
extern Battle battle;
extern Entity *player;
void loadSpawners(struct cJSON *node);
void activateTrespasserSpawner(void);
void activateSpawner(char *name, int active);
void doSpawners(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "starfield.h"
#include "../system/util.h"
extern App app;
static Star stars[MAX_STARS];

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,8 +18,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
extern float mod(float n, float x);
extern App app;
void drawStars(void);
void doStars(float dx, float dy);
void initStars(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,12 +18,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "waypoints.h"
#include "../system/util.h"
#include "../system/sound.h"
#include "../battle/hud.h"
#include "../battle/objectives.h"
#include "../battle/script.h"
#include "../system/atlas.h"
#include "../battle/entities.h"
extern Battle battle;
extern Colors colors;
extern Entity *player;
extern Entity *self;
extern Game game;
static void think(void);
static int teamMatesClose(void);
static int isCurrentObjective(void);
void activateNextWaypoint(void);
static int waypointId;
static int currentWaypointId;

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,18 +18,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
extern void addHudMessage(SDL_Color c, char *format, ...);
extern AtlasImage *getAtlasImage(char *filename);
extern int getDistance(int x1, int y1, int x2, int y2);
extern void playSound(int id);
extern void runScriptFunction(char *format, ...);
extern Entity *spawnEntity(void);
extern void updateObjective(char *name, int type);
extern Battle battle;
extern Colors colors;
extern Entity *player;
extern Entity *self;
extern Game game;
void activateNextWaypoint(void);
Entity *spawnWaypoint(void);
void resetWaypoints(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,13 +18,47 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "challengeHome.h"
#include "../battle/starfield.h"
#include "../system/util.h"
#include "../system/input.h"
#include "../game/title.h"
#include "../game/stats.h"
#include "../system/sound.h"
#include "../system/widgets.h"
#include "../galaxy/mission.h"
#include "../game/trophies.h"
#include "../game/options.h"
#include "../system/atlas.h"
#include "../game/fighterDatabase.h"
#include "../system/transition.h"
#include "../challenges/challenges.h"
#include "../system/text.h"
#include "../system/draw.h"
#include "../battle/battle.h"
#include "../system/resources.h"
#include "../system/textures.h"
#define CHALLENGES_PER_PAGE 14
#define SHOW_CHALLENGES 0
#define SHOW_FIGHTER_DB 5
#define SHOW_MENU 1
#define SHOW_OPTIONS 2
#define SHOW_STATS 3
#define SHOW_TROPHIES 4
extern App app;
extern Battle battle;
extern Colors colors;
extern Dev dev;
extern Game game;
static void logic(void);
static void draw(void);
static void handleKeyboard(void);
static void drawChallenges(void);
static void doChallenges(void);
static void doChallengeList(void);
static void startChallengeMission(void);
static void drawMenu(void);
static void resume(void);
@ -209,7 +243,7 @@ static void logic(void)
switch (show)
{
case SHOW_CHALLENGES:
doChallenges();
doChallengeList();
break;
case SHOW_MENU:
@ -232,7 +266,7 @@ static void logic(void)
app.doTrophyAlerts = 1;
}
static void doChallenges(void)
static void doChallengeList(void)
{
Mission *c;
int i, startIndex, end;

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,58 +18,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#define CHALLENGES_PER_PAGE 14
#define SHOW_CHALLENGES 0
#define SHOW_FIGHTER_DB 5
#define SHOW_MENU 1
#define SHOW_OPTIONS 2
#define SHOW_STATS 3
#define SHOW_TROPHIES 4
extern void autoSizeWidgetButtons(char *group, int recenter);
extern void awardChallengeTrophies(void);
extern void awardStatsTrophies(void);
extern void blit(AtlasImage *atlasImage, int x, int y, int centered);
extern void clearInput(void);
extern int collision(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2);
extern void doFighterDatabase(void);
extern void doStars(float dx, float dy);
extern void doWidgets(void);
extern void drawBackground(SDL_Texture *texture);
extern void drawFighterDatabase(void);
extern void drawOptions(void);
extern void drawStars(void);
extern void drawStats(void);
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);
extern void drawTrophies(void);
extern void drawWidgets(char *groupName);
extern void endSectionTransition(void);
extern AtlasImage *getAtlasImage(const char *filename);
extern char *getBackgroundTextureName(int n);
extern char *getChallengeDescription(Challenge *c);
extern char *getPlanetTextureName(int n);
extern SDL_Texture *getTexture(char *filename);
extern Widget *getWidget(const char *name, const char *group);
extern void initBattle(void);
extern void initFighterDatabaseDisplay(void);
extern void initOptions(void (*returnFromOptions)(void));
extern void initStatsDisplay(void);
extern void initTitle(void);
extern void initTrophiesDisplay(void);
extern void loadMission(char *filename);
extern void playMusic(char *filename, int loop);
extern void playSound(int sound);
extern void scrollBackground(float x, float y);
extern void selectWidget(const char *name, const char *group);
extern void startSectionTransition(void);
extern void stopMusic(void);
extern char *timeToString(long millis, int showHours);
extern void updateAllMissions(void);
extern App app;
extern Battle battle;
extern Colors colors;
extern Dev dev;
extern Game game;
void initChallengeHome(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "challenges.h"
#include "../json/cJSON.h"
#include "../system/lookup.h"
#include "../system/util.h"
#include "../battle/fighters.h"
#include "../system/widgets.h"
#include "../galaxy/mission.h"
#include "../game/trophies.h"
#include "../game/stats.h"
#include "../system/io.h"
extern Battle battle;
extern Dev dev;
extern Entity *player;
extern Game game;
static void updateTimeChallenge(Challenge *c);
static void updateSurvivalChallenge(Challenge *c);
@ -35,7 +50,6 @@ static void completeChallenge(void);
static void failChallenge(void);
static int updateChallenges(void);
static char *getFormattedChallengeDescription(const char *format, ...);
char *getChallengeDescription(Challenge *c);
static int challengeFinished(void);
static int alreadyPassed(void);
static void printStats(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,23 +18,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "../json/cJSON.h"
extern void awardCraftTrophy(void);
extern void awardStatsTrophies(void);
extern char **getFileList(char *dir, int *count);
extern int getJSONValue(cJSON *node, char *name, int defValue);
extern char *getLookupName(char *prefix, long num);
extern Mission *loadMissionMeta(char *filename);
extern long lookup(char *name);
extern void retreatAllies(void);
extern void retreatEnemies(void);
extern void selectWidget(const char *name, const char *group);
extern char *timeToString(long millis, int showHours);
extern void updateAccuracyStats(unsigned int *stats);
extern Battle battle;
extern Dev dev;
extern Entity *player;
extern Game game;
void updateChallengeMissions(void);
Challenge *getChallenge(Mission *mission, int type, int value);
char *getChallengeDescription(Challenge *c);
void doChallenges(void);
void loadChallenge(Mission *mission, struct cJSON *node);
void initChallenges(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,40 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "galacticMap.h"
#include "../battle/starfield.h"
#include "../system/util.h"
#include "../system/input.h"
#include "../game/title.h"
#include "../game/stats.h"
#include "../system/widgets.h"
#include "../galaxy/mission.h"
#include "../game/trophies.h"
#include "../system/modalDialog.h"
#include "../game/options.h"
#include "../system/atlas.h"
#include "../game/fighterDatabase.h"
#include "../system/transition.h"
#include "../system/text.h"
#include "../galaxy/starSystems.h"
#include "../system/draw.h"
#include "../battle/battle.h"
#include "../system/sound.h"
#include "../system/textures.h"
#define MAX_LISTED_MISSIONS 9
#define SHOW_FIGHTER_DB 6
#define SHOW_GALAXY 0
#define SHOW_MENU 2
#define SHOW_OPTIONS 3
#define SHOW_STAR_SYSTEM 1
#define SHOW_STATS 4
#define SHOW_TROPHIES 5
extern App app;
extern Colors colors;
extern Game game;
static void logic(void);
static void draw(void);
@ -30,7 +63,6 @@ static void selectStarSystem(void);
static void drawGalaxy(void);
static void centerOnSelectedStarSystem(void);
static void doStarSystems(void);
void destroyGalacticMap(void);
static void drawPulses(void);
static void drawInfoBars(void);
static void doPulses(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,59 +18,5 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#define MAX_LISTED_MISSIONS 9
#define SHOW_FIGHTER_DB 6
#define SHOW_GALAXY 0
#define SHOW_MENU 2
#define SHOW_OPTIONS 3
#define SHOW_STAR_SYSTEM 1
#define SHOW_STATS 4
#define SHOW_TROPHIES 5
extern void autoSizeWidgetButtons(char *group, int recenter);
extern void awardCampaignTrophies(void);
extern void awardStatsTrophies(void);
extern void blit(AtlasImage *atlasImage, int x, int y, int centered);
extern void blitRotated(AtlasImage *atlasImage, int x, int y, float angle);
extern void clearInput(void);
extern int collision(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2);
extern void doFighterDatabase(void);
extern void doStars(float dx, float dy);
extern void doWidgets(void);
extern void drawBackground(SDL_Texture *texture);
extern void drawCircle(int cx, int cy, int radius, int r, int g, int b, int a);
extern void drawFighterDatabase(void);
extern void drawOptions(void);
extern void drawStars(void);
extern void drawStats(void);
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);
extern void drawTrophies(void);
extern void drawWidgets(char *groupName);
extern void endSectionTransition(void);
extern AtlasImage *getAtlasImage(char *filename);
extern StarSystem *getStarSystem(char *name);
extern SDL_Texture *getTexture(char *filename);
extern Widget *getWidget(const char *name, const char *group);
extern void initBattle(void);
extern void initFighterDatabaseDisplay(void);
extern void initOptions(void (*returnFromOptions)(void));
extern void initStatsDisplay(void);
extern void initTitle(void);
extern void initTrophiesDisplay(void);
extern void loadMission(char *filename);
extern void playMusic(char *filename, int loop);
extern void playSound(int id);
extern void scrollBackground(float x, float y);
extern void selectWidget(const char *name, const char *group);
extern void setAtlasColor(int r, int g, int b, int a);
extern void setMouseCursor(int isDrag);
extern void showOKDialog(void (*callback)(void), const char *format, ...);
extern void startSectionTransition(void);
extern void stopMusic(void);
extern void updateAllMissions(void);
extern App app;
extern Colors colors;
extern Game game;
void destroyGalacticMap(void);
void initGalacticMap(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,10 +18,43 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "mission.h"
#include <time.h>
#include "../json/cJSON.h"
#include "../battle/locations.h"
#include "../system/widgets.h"
#include "../system/io.h"
#include "../galaxy/starSystems.h"
#include "../battle/jumpgate.h"
#include "../battle/missionInfo.h"
#include "../system/util.h"
#include "../battle/player.h"
#include "../system/sound.h"
#include "../system/transition.h"
#include "../battle/objectives.h"
#include "../battle/script.h"
#include "../battle/waypoints.h"
#include "../battle/spawners.h"
#include "../system/lookup.h"
#include "../battle/mine.h"
#include "../challenges/challenges.h"
#include "../battle/fighters.h"
#include "../system/atlas.h"
#include "../system/resources.h"
#include "../battle/capitalShips.h"
#include "../game/trophies.h"
#include "../system/textures.h"
#include "../battle/items.h"
#include "../battle/entities.h"
extern App app;
extern Battle battle;
extern Dev dev;
extern Entity *player;
extern Game game;
static void loadEntities(cJSON *node);
static unsigned long hashcode(const char *str);
static void loadEpicData(cJSON *node);
static char *getAutoBackground(char *filename);
static char *getAutoPlanet(char *filename);
@ -496,20 +529,3 @@ int isMissionAvailable(Mission *mission, Mission *prev)
) || dev.debug;
}
}
static unsigned long hashcode(const char *str)
{
unsigned long hash = 5381;
int c;
c = *str;
while (c)
{
hash = ((hash << 5) + hash) + c;
c = *str++;
}
return hash;
}

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,57 +18,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "../json/cJSON.h"
#include "time.h"
extern void activateNextWaypoint(void);
extern void addAllToQuadtree(void);
extern void addEpicKillsObjective(void);
extern void addEpicLivesObjective(void);
extern void awardCraftTrophy(void);
extern void awardPostMissionTrophies(void);
extern void awardStatsTrophies(void);
extern void completeConditions(void);
extern void countNumEnemies(void);
extern void endSectionTransition(void);
extern void failIncompleteObjectives(void);
extern long flagsToLong(char *flags, int *add);
extern AtlasImage *getAtlasImage(char *filename);
extern char *getBackgroundTextureName(unsigned long n);
extern int getJSONValue(cJSON *node, char *name, int defValue);
extern char *getJSONValueStr(cJSON *node, char *name, char *defValue);
extern char *getMusicFilename(unsigned long n);
extern char *getPlanetTextureName(unsigned long n);
extern SDL_Texture *getTexture(char *filename);
extern void initMissionInfo(void);
extern void initPlayer(void);
extern void initScript(cJSON *missionJSON);
extern void loadCapitalShips(cJSON *node);
extern void loadChallenge(Mission *mission, cJSON *node);
extern void loadFighters(cJSON *node);
extern void loadItems(cJSON *node);
extern void loadLocations(cJSON *node);
extern void loadObjectives(cJSON *node);
extern void loadPlayer(cJSON *node);
extern void loadSpawners(cJSON *node);
extern long lookup(char *name);
extern void playMusic(char *filename, int loop);
extern char *readFile(char *filename);
extern void retreatEnemies(void);
extern void selectWidget(const char *name, const char *group);
extern void setInitialPlayerAngle(void);
extern Entity *spawnJumpgate(int side, long flags);
extern Entity *spawnMine(int type);
extern Entity *spawnWaypoint(void);
extern void startSectionTransition(void);
extern void stopMusic(void);
extern void updateChallengeMissions(void);
extern void updateStarSystemMissions(void);
extern App app;
extern Battle battle;
extern Dev dev;
extern Entity *player;
extern Game game;
int isMissionAvailable(Mission *mission, Mission *prev);
void updateAllMissions(void);
Mission *getMission(char *filename);
void failMission(void);
void completeMission(void);
void loadMission(char *filename);
Mission *loadMissionMeta(char *filename);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "starSystems.h"
#include "../json/cJSON.h"
#include "../galaxy/mission.h"
#include "../system/lookup.h"
#include "../system/util.h"
#include "../system/io.h"
extern Game game;
static void loadMissions(StarSystem *starSystem);
static StarSystem *loadStarSystem(cJSON *starSystemJSON);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,15 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "../json/cJSON.h"
extern char **getFileList(char *dir, int *count);
extern int getJSONValue(cJSON *node, char *name, int defValue);
extern int isMissionAvailable(Mission *mission, Mission *prev);
extern Mission *loadMissionMeta(char *filename);
extern long lookup(char *name);
extern char *readFile(char *filename);
extern Game game;
void destroyStarSystems(void);
void updateStarSystemMissions(void);
StarSystem *getStarSystem(char *name);
void initStarSystems(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,13 +18,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "credits.h"
#include "../json/cJSON.h"
#include "../system/draw.h"
#include "../game/title.h"
#include "../system/sound.h"
#include "../system/transition.h"
#include "../system/textures.h"
#include "../system/io.h"
#include "../system/text.h"
#include "../system/atlas.h"
#define CREDIT_LINE_LIMIT (UI_WIDTH - 300)
extern App app;
extern Colors colors;
static void loadCredits(void);
static void logic(void);
static void draw(void);
static void handleKeyboard(void);
void destroyCredits(void);
static SDL_Texture *background;
static AtlasImage *earthTexture;

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,23 +18,5 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "../json/cJSON.h"
#define CREDIT_LINE_LIMIT (UI_WIDTH - 300)
extern void blit(AtlasImage *atlasImage, int x, int y, int centered);
extern void drawBackground(SDL_Texture *texture);
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);
extern void endSectionTransition(void);
extern AtlasImage *getAtlasImage(const char *filename);
extern SDL_Texture *getTexture(const char *filename);
extern int getWrappedTextHeight(char *text, int size);
extern void initTitle(void);
extern void playMusic(char *filename, int loop);
extern char *readFile(char *filename);
extern void startSectionTransition(void);
extern void stopMusic(void);
extern App app;
extern Colors colors;
void destroyCredits(void);
void initCredits(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "fighterDatabase.h"
#include "../system/text.h"
#include "../battle/fighters.h"
#include "../system/draw.h"
#include "../system/widgets.h"
#include "../system/util.h"
extern App app;
extern Colors colors;
extern Game game;
static void prevFighter(void);
static void nextFighter(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,15 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
extern void blitRotated(AtlasImage *atlasImage, int x, int y, float angle);
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);
extern void drawWidgets(char *groupName);
extern Entity **getDBFighters(int *num);
extern Widget *getWidget(const char *name, const char *group);
extern float mod(float n, float x);
extern App app;
extern Colors colors;
extern Game game;
void drawFighterDatabase(void);
void doFighterDatabase(void);
void initFighterDatabaseDisplay(void);
void destroyFighterDatabase(void);
void initFighterDatabase(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,8 +18,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "game.h"
extern Game game;
void initGame(void)
{
memset(&game, 0, sizeof(Game));

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,6 +18,5 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
extern Game game;
void destroyGame(void);
void initGame(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "load.h"
#include "../json/cJSON.h"
#include "../system/lookup.h"
#include "../challenges/challenges.h"
#include "../battle/fighters.h"
#include "../galaxy/mission.h"
#include "../game/trophies.h"
#include "../system/io.h"
#include "../galaxy/starSystems.h"
extern Game game;
static void loadStats(cJSON *statsJSON);
static void loadStarSystems(cJSON *starSystemsJSON);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,18 +18,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "../json/cJSON.h"
extern void destroyFighterStats(void);
extern Challenge *getChallenge(Mission *mission, int type, int value);
extern char *getLookupName(char *prefix, long num);
extern Mission *getMission(char *filename);
extern char *getSaveFilePath(char *filename);
extern StarSystem *getStarSystem(char *name);
extern Trophy *getTrophy(char *id);
extern int lookup(char *lookup);
extern char *readFile(char *filename);
extern Game game;
void loadGame(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "options.h"
#include <SDL2/SDL_mixer.h>
#include "../battle/starfield.h"
#include "../system/controls.h"
#include "../system/widgets.h"
#include "../system/init.h"
#include "../system/text.h"
#include "../system/draw.h"
#define SHOW_CONTROLS 1
#define SHOW_MAIN 0
extern App app;
extern Colors colors;
static void changeWindowSize(char *value);
static void changeSoundVolume(char *value);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,23 +18,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "SDL2/SDL_mixer.h"
#define SHOW_CONTROLS 1
#define SHOW_MAIN 0
extern void drawControls(void);
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);
extern void drawWidgets(char *groupName);
extern Widget *getWidget(const char *name, const char *group);
extern void initControlsDisplay(void);
extern void initGraphics(void);
extern void initStars(void);
extern void saveConfig(void);
extern void selectWidget(const char *name, const char *group);
extern void setWidgetOption(const char *name, const char *group, const char *value);
extern App app;
extern Colors colors;
void updateCustomResolutionOption(void);
void drawOptions(void);
void initOptions(void (*rtn)(void));

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "save.h"
#include "../json/cJSON.h"
#include "../system/lookup.h"
#include "../system/io.h"
extern Game game;
static void saveStarSystems(cJSON *gameJSON);
static void saveChallenges(cJSON *gameJSON);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,12 +18,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "../json/cJSON.h"
extern char *getLookupName(char *prefix, long num);
extern char *getSaveFilePath(char *filename);
extern int writeFile(char *filename, char *data);
extern Game game;
void saveGame(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,12 +18,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "stats.h"
#include "../system/text.h"
#include "../system/widgets.h"
#include "../system/util.h"
#define STATS_PER_PAGE 9
extern App app;
extern Colors colors;
extern Game game;
static void prevPage(void);
static void nextPage(void);
static void calculatePercentComplete(void);
void updateAccuracyStats(unsigned int *stats);
static char *statDescription[STAT_MAX];
static int page;

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,16 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#define STATS_PER_PAGE 9
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);
extern void drawWidgets(char *groupName);
extern int getPercent(float current, float total);
extern Widget *getWidget(const char *name, const char *group);
extern char *timeToString(long millis, int showHours);
extern App app;
extern Colors colors;
extern Game game;
void updateAccuracyStats(unsigned int *stats);
void drawStats(void);
void initStatsDisplay(void);
void initStats(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,40 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "title.h"
#include "../galaxy/mission.h"
#include "../system/transition.h"
#include "../battle/starfield.h"
#include "../game/credits.h"
#include "../system/input.h"
#include "../game/stats.h"
#include "../system/widgets.h"
#include "../challenges/challengeHome.h"
#include "../battle/battle.h"
#include "../galaxy/galacticMap.h"
#include "../game/options.h"
#include "../system/atlas.h"
#include "../game/fighterDatabase.h"
#include "../game/trophies.h"
#include "../battle/effects.h"
#include "../system/text.h"
#include "../system/draw.h"
#include "../system/sound.h"
#include "../system/textures.h"
#define NUM_FIGHTERS 12
#define SHOW_FIGHTER_DB 4
#define SHOW_OPTIONS 2
#define SHOW_STATS 1
#define SHOW_TITLE 0
#define SHOW_TROPHIES 3
extern App app;
extern Battle battle;
extern Colors colors;
extern Entity *self;
extern Game game;
static void logic(void);
static void draw(void);
@ -195,7 +228,7 @@ static void draw(void)
blit(pandoranWar, app.winWidth / 2, 110, 1);
drawText(10, app.winHeight - 25, 14, TA_LEFT, colors.white, "Copyright Parallel Realities, 2015-2019");
drawText(10, app.winHeight - 25, 14, TA_LEFT, colors.white, "Copyright,2022 Parallel Realities, 2015-2019,2022");
drawText(app.winWidth - 10, app.winHeight - 25, 14, TA_RIGHT, colors.white, "Version %.2f.%d", VERSION, REVISION);
switch (show)

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,56 +18,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#define NUM_FIGHTERS 12
#define SHOW_FIGHTER_DB 4
#define SHOW_OPTIONS 2
#define SHOW_STATS 1
#define SHOW_TITLE 0
#define SHOW_TROPHIES 3
extern void addEngineEffect(void);
extern void autoSizeWidgetButtons(char *group, int recenter);
extern void blit(AtlasImage *atlasImage, int x, int y, int centered);
extern void clearInput(void);
extern void destroyBattle(void);
extern void doEffects(void);
extern void doFighterDatabase(void);
extern void doStars(float dx, float dy);
extern void doWidgets(void);
extern void drawBackground(SDL_Texture *texture);
extern void drawEffects(void);
extern void drawFighterDatabase(void);
extern void drawOptions(void);
extern void drawStars(void);
extern void drawStats(void);
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);
extern void drawTrophies(void);
extern void drawWidgets(char *groupName);
extern void endSectionTransition(void);
extern AtlasImage *getAtlasImage(const char *filename);
extern SDL_Texture *getTexture(const char *filename);
extern Widget *getWidget(const char *name, const char *group);
extern void initChallengeHome(void);
extern void initCredits(void);
extern void initEffects(void);
extern void initFighterDatabaseDisplay(void);
extern void initGalacticMap(void);
extern void initOptions(void (*returnFromOptions)(void));
extern void initStatsDisplay(void);
extern void initTrophiesDisplay(void);
extern void playMusic(char *filename, int loop);
extern void playSound(int id);
extern void scrollBackground(float x, float y);
extern void selectWidget(const char *name, const char *group);
extern void setAtlasColor(int r, int g, int b, int a);
extern void startSectionTransition(void);
extern void stopMusic(void);
extern void updateAllMissions(void);
extern App app;
extern Battle battle;
extern Colors colors;
extern Entity *self;
extern Game game;
void initTitle(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "trophies.h"
#include <time.h>
#include "../json/cJSON.h"
#include "../system/lookup.h"
#include "../system/draw.h"
#include "../system/util.h"
#include "../system/widgets.h"
#include "../system/io.h"
#include "../system/text.h"
#include "../system/atlas.h"
#include "../system/sound.h"
#include "../battle/entities.h"
#define TROPHIES_PER_PAGE 4
extern App app;
extern Battle battle;
extern Colors colors;
extern Entity *player;
extern Game game;
static void prevPage(void);
static void nextPage(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,34 +18,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "../json/cJSON.h"
#include "time.h"
#define TROPHIES_PER_PAGE 4
extern void awardPandoranCraftTrophy(void);
extern void blit(AtlasImage *atlasImage, int x, int y, int centered);
extern void blitRotated(AtlasImage *atlasImage, int x, int y, float angle);
extern void blitScaled(AtlasImage *atlasImage, int x, int y, int w, int h, int center);
extern void calcTextDimensions(char *text, int size, int *w, int *h);
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);
extern void drawWidgets(char *groupName);
extern AtlasImage *getAtlasImage(char *filename);
extern int getJSONValue(cJSON *node, char *name, int defValue);
extern int getPercent(float current, float total);
extern Widget *getWidget(const char *name, const char *group);
extern long lookup(char *name);
extern float mod(float n, float x);
extern void playSound(int id);
extern char *readFile(char *filename);
extern void setAtlasColor(int r, int g, int b, int a);
extern char *timeToDate(long millis);
extern App app;
extern Battle battle;
extern Colors colors;
extern Entity *player;
extern Game game;
void awardCraftTrophy(void);
void awardPostMissionTrophies(void);
void awardChallengeTrophies(void);
void awardCampaignTrophies(void);
void awardStatsTrophies(void);
Trophy *getTrophy(char *id);
void drawTrophyAlert(void);
void doTrophyAlerts(void);
void awardTrophy(char *id);
void drawTrophies(void);
void initTrophiesDisplay(void);
void initTrophies(void);

View File

@ -62,7 +62,6 @@ typedef struct cJSON_Hooks {
/* Supply malloc, realloc and free functions to cJSON */
extern void cJSON_InitHooks(cJSON_Hooks* hooks);
/* Supply a block of JSON, and this returns a cJSON object you can interrogate. Call cJSON_Delete when finished. */
extern cJSON *cJSON_Parse(const char *value);
/* Render a cJSON entity to text for transfer/storage. Free the char* when finished. */

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,32 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "common.h"
#include "main.h"
#include <time.h>
#include "game/load.h"
#include "system/lookup.h"
#include "system/draw.h"
#include "game/credits.h"
#include "system/input.h"
#include "system/controls.h"
#include "game/title.h"
#include "game/trophies.h"
#include "system/modalDialog.h"
#include "test/testMission.h"
#include "game/save.h"
#include "system/io.h"
#include "system/dev.h"
#include "system/init.h"
#include "plat/win32/win32Init.h"
App app;
Battle battle;
Colors colors;
Dev dev;
Entity *player;
Entity *self;
Game game;
static void handleMissionArgs(int argc, char *argv[]);
static void handleLoggingArgs(int argc, char *argv[]);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,41 +18,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "SDL2/SDL.h"
#include "time.h"
#include "defs.h"
#include "structs.h"
extern void cleanup(void);
extern void clearControl(int type);
extern void createScreenshotFolder(void);
extern void doDevKeys(void);
extern void doInput(void);
extern void doModalDialog(void);
extern void doTrophyAlerts(void);
extern void drawModalDialog(void);
extern void drawTrophyAlert(void);
extern int fileExists(char *filename);
extern char *getSaveFilePath(char *filename);
extern void init18N(int argc, char *argv[]);
extern void initCredits(void);
extern void initGameSystem(void);
extern void initLookups(void);
extern void initSDL(int argc, char *argv[]);
extern void initTitle(void);
extern int isControl(int type);
extern void loadGame(void);
extern void loadTestMission(char *filename);
extern void prepareScene(void);
extern void presentScene(void);
extern void saveGame(void);
extern void saveScreenshot(void);
App app;
Battle battle;
Colors colors;
Dev dev;
Entity *player;
Entity *self;
Game game;
int main(int argc, char *argv[]);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../../common.h"
#include "unixInit.h"
#include <sys/stat.h>
#include <pwd.h>
#include <unistd.h>
#include <errno.h>
extern App app;
extern Dev dev;
void createSaveFolder(void)
{

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,12 +18,5 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <sys/stat.h>
#include <pwd.h>
#include <unistd.h>
#include <errno.h>
#include "../../common.h"
extern App app;
extern Dev dev;
void createScreenshotFolder(void);
void createSaveFolder(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../../common.h"
#include "win32Init.h"
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
extern App app;
extern Dev dev;
void createSaveFolder(void)
{

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,11 +18,5 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
#include "../../common.h"
extern App app;
extern Dev dev;
void createScreenshotFolder(void);
void createSaveFolder(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2018-2019 Parallel Realities
Copyright (C) 2018-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "atlas.h"
#include "../json/cJSON.h"
#include "../system/io.h"
#include "../system/textures.h"
#include "../system/util.h"
static void loadAtlasData(void);
@ -40,7 +45,7 @@ void setAtlasColor(int r, int g, int b, int a)
SDL_SetTextureAlphaMod(atlasTexture, a);
}
AtlasImage *getAtlasImage(char *filename)
AtlasImage *getAtlasImage(const char *filename)
{
AtlasImage *a;
unsigned long i;

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2018-2019 Parallel Realities
Copyright (C) 2018-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,10 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "../json/cJSON.h"
extern SDL_Texture *getTexture(const char *filename);
extern unsigned long hashcode(const char *str);
extern char *readFile(const char *filename);
extern int stringComparator(const void *a, const void *b);
char **getAtlasFileList(char *dir, int *count);
AtlasImage *getAtlasImage(const char *filename);
void setAtlasColor(int r, int g, int b, int a);
void initAtlas(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "controls.h"
#include "../json/cJSON.h"
#include "../system/text.h"
#include "../system/lookup.h"
#include "../system/widgets.h"
#include "../system/io.h"
extern App app;
extern Colors colors;
static void restoreDefaults(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,15 +18,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "../json/cJSON.h"
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);
extern void drawWidgets(char *groupName);
extern char *getLookupName(char *prefix, long num);
extern Widget *getWidget(const char *name, const char *group);
extern long lookup(char *name);
extern char *readFile(char *filename);
extern App app;
extern Colors colors;
void drawControls(void);
void clearControlConfig(char *name);
void updateControlButton(char *name);
void updateControlKey(char *name);
void resetAcceptControls(void);
void clearControl(int type);
int isAcceptControl(void);
int isControl(int type);
void initControlsDisplay(void);
void initControls(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "dev.h"
#include "../galaxy/mission.h"
extern App app;
extern Battle battle;
extern Dev dev;
void doDevKeys(void)
{

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,10 +18,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
extern void completeMission(void);
extern App app;
extern Battle battle;
extern Dev dev;
void doDevKeys(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "draw.h"
#include "../system/text.h"
#include "../system/util.h"
#include "../system/input.h"
extern App app;
extern Battle battle;
extern Colors colors;
extern Dev dev;
static void initColor(SDL_Color *c, int r, int g, int b);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,13 +18,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
extern int collision(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2);
extern void drawMouse(void);
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);
extern App app;
extern Battle battle;
extern Colors colors;
extern Dev dev;
void saveScreenshot(void);
int isOnBattleScreen(int x, int y, int w, int h);
void drawBackground(SDL_Texture *texture);
void scrollBackground(float x, float y);
void drawCircle(int cx, int cy, int radius, int r, int g, int b, int a);
void blitRotated(AtlasImage *atlasImage, int x, int y, float angle);
void blitScaled(AtlasImage *atlasImage, int x, int y, int w, int h, int center);
void blit(AtlasImage *atlasImage, int x, int y, int center);
void presentScene(void);
void prepareScene(void);
void initGraphics(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2009-2016 Parallel Realities
Copyright (C) 2009-2016,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -17,11 +17,15 @@ along with this program; if not, write to the Free Software
Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/
#include "../common.h"
#include "i18n.h"
#include "../system/io.h"
#ifdef _WIN32
#include <windows.h>
#endif
#define TABLE_SIZE 255
char *getTranslatedString(char *);
void setLanguage(char *, char *);
void cleanupLanguage(void);
static int hashCode(char *);
static void put(char *, char *);
static void initTable(void);
@ -363,7 +367,7 @@ char *getTranslatedString(char *key)
return key;
}
void cleanupLanguage()
void cleanupLanguage(void)
{
int i;
Bucket *bucket, *p, *q;

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2009-2016 Parallel Realities
Copyright (C) 2009-2016,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -17,15 +17,6 @@ along with this program; if not, write to the Free Software
Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/
#include "../common.h"
#ifdef _WIN32
#include <windows.h>
#endif
#define TABLE_SIZE 255
char *getTranslatedString(char *);
void setLanguage(char *, char *);
void cleanupLanguage(void);
extern int fileExists(char *filename);
char *getTranslatedString(char *key);
void setLanguage(char *applicationName, char *languageCode);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,11 +18,48 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "init.h"
#include <SDL2/SDL_image.h>
#include "../json/cJSON.h"
#include <SDL2/SDL_mixer.h>
#include <SDL2/SDL_ttf.h>
#include "../game/credits.h"
#include "../system/widgets.h"
#include "../battle/bullets.h"
#include "../system/modalDialog.h"
#include "../system/io.h"
#include "../galaxy/starSystems.h"
#include "../system/draw.h"
#include "../battle/starfield.h"
#include "../system/util.h"
#include "../system/sound.h"
#include "../system/lookup.h"
#include "../challenges/challenges.h"
#include "../system/controls.h"
#include "../battle/fighters.h"
#include "../game/game.h"
#include "../battle/battle.h"
#include "../game/options.h"
#include "../system/text.h"
#include "../system/i18n.h"
#include "../system/atlas.h"
#include "../system/resources.h"
#include "../battle/capitalShips.h"
#include "../system/input.h"
#include "../game/stats.h"
#include "../galaxy/galacticMap.h"
#include "../game/trophies.h"
#include "../game/fighterDatabase.h"
#include "../system/textures.h"
#include "../battle/items.h"
#include "../plat/win32/win32Init.h"
#include "locale.h"
extern App app;
static void loadConfig(int argc, char *argv[]);
static void loadConfigFile(char *filename);
void saveConfig(void);
static void showLoadingStep(float step, float maxSteps);
static void handleCommandLineConfig(int argc, char *argv[]);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,63 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "../json/cJSON.h"
#include "locale.h"
#include "SDL2/SDL_image.h"
#include "SDL2/SDL_mixer.h"
#include "SDL2/SDL_ttf.h"
extern void createSaveFolder(void);
extern void destroyBattle(void);
extern void destroyBulletDefs(void);
extern void destroyCapitalShipDefs(void);
extern void destroyCredits(void);
extern void destroyFighterDatabase(void);
extern void destroyFighterDefs(void);
extern void destroyFighterStats(void);
extern void destroyGalacticMap(void);
extern void destroyGame(void);
extern void destroyItemDefs(void);
extern void destroyLookups(void);
extern void destroyResources(void);
extern void destroySounds(void);
extern void destroyStarSystems(void);
extern void destroyTextures(void);
extern void destroyWidgets(void);
extern int fileExists(char *filename);
extern int getJSONValue(cJSON *node, char *name, int defValue);
extern char *getLookupName(char *prefix, long num);
extern char *getSaveFilePath(char *filename);
extern void initAtlas(void);
extern void initBulletDefs(void);
extern void initChallenges(void);
extern void initControls(void);
extern void initFighterDatabase(void);
extern void initFonts(void);
extern void initGame(void);
extern void initGraphics(void);
extern void initInput(void);
extern void initModalDialog(void);
extern void initResources(void);
extern void initSounds(void);
extern void initStarSystems(void);
extern void initStars(void);
extern void initStats(void);
extern void initTrophies(void);
extern void initWidgets(void);
extern void loadCapitalShipDefs(void);
extern void loadFighterDefs(void);
extern void loadItemDefs(void);
extern long lookup(char *name);
extern void prepareScene(void);
extern void presentScene(void);
extern char *readFile(char *filename);
extern void setLanguage(char *applicationName, char *languageCode);
extern void updateCustomResolutionOption(void);
extern int writeFile(char *filename, char *data);
extern App app;
void cleanup(void);
void saveConfig(void);
void initGameSystem(void);
void initSDL(int argc, char *argv[]);
void init18N(int argc, char *argv[]);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "input.h"
#include "../system/atlas.h"
#include "../system/draw.h"
#include "../system/sound.h"
extern App app;
static AtlasImage *mousePointer;
static AtlasImage *mousePointerNormal;

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,11 +18,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
extern void blit(AtlasImage *atlasImage, int x, int y, int centered);
extern AtlasImage *getAtlasImage(char *filename);
extern void musicSetPlaying(int playing);
extern void setAtlasColor(int r, int g, int b, int a);
extern App app;
void clearInput(void);
void doInput(void);
void drawMouse(void);
void setMouseCursor(int isDrag);
void doMouseMotion(SDL_MouseMotionEvent *event);
void doMouseWheel(SDL_MouseWheelEvent *event);
void doMouseUp(SDL_MouseButtonEvent *event);
void doMouseDown(SDL_MouseButtonEvent *event);
void doKeyUp(SDL_KeyboardEvent *event);
void doKeyDown(SDL_KeyboardEvent *event);
void initInput(void);

Some files were not shown because too many files have changed in this diff Show More