Compare commits

...

17 Commits

Author SHA1 Message Date
Steve 118b99ccf6 Format with clang. 2022-07-31 10:43:20 +01:00
Steve 5e82c957cd Moved #includes, #defines, enums into c files, from h files. 2022-07-30 16:10:02 +01:00
Steve fc09a7d598 Set trophyId array size to MAX_NAME_LENGTH * 2. 2021-12-06 21:44:12 +00:00
Stephen J Sweeney 7023a48723
Merge pull request #55 from oglinuk/develop-trophyId-fix
`tophyId` fix
2021-12-06 21:41:23 +00:00
oglinuk 793b1b95a8 `trophyId` fix
When compiling, it would throw `src/game/trophies.c:455:32: error: ‘%s’
directive writing up to 31 bytes into a region of size 23`. Fixed by
adding 9 to `MAX_NAME_LENGTH` to account for "CAMPAIGN_".
2021-12-06 12:25:54 -08:00
Stephen J Sweeney 40cb97049c
Merge pull request #54 from smcameron/develop
Prevent readFile from returning uninitialized pointer on fopen() failure.
2021-10-01 07:36:26 +01:00
Stephen M. Cameron 2d3856d3ad Prevent readFile from returning uninitialized pointer on fopen() failure.
Signed-off-by: Stephen M. Cameron <stephenmcameron@gmail.com>
2021-10-01 02:24:07 -04:00
Steve ef46a97a67 Minor text rendering code tweaks. 2021-05-01 16:00:35 +01:00
Steve 786df47e09 Misc. tidying. 2021-05-01 13:35:52 +01:00
Steve 732a86aefd Use indexed array for text glyphs, instead of hashmap. 2021-05-01 13:35:33 +01:00
Steve 69c2fdf680 Source tidying. 2021-05-01 13:32:57 +01:00
Steve b145541ed4 Only use mags against Pandoran tugs. 2021-03-06 07:59:57 +00:00
Steve 6b89d7e8e7 Tidy #defines 2020-03-28 13:56:49 +00:00
Steve 7e14550cc1 Revert to while loop for nextCharacter() 2020-03-28 13:52:17 +00:00
Steve f3bb77ca81 Use Arial as default font. 2020-03-28 13:51:53 +00:00
Steve 10eca1eb60 Releases are now stable. 2020-01-22 07:27:46 +00:00
Steve a7a3cdb567 Small unicode optimization. 2020-01-22 07:27:35 +00:00
133 changed files with 3753 additions and 4105 deletions

230
.clang-format Normal file
View File

@ -0,0 +1,230 @@
---
Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignArrayOfStructures: None
AlignConsecutiveMacros: Consecutive
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: Consecutive
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
AttributeMacros:
- __capability
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: true
BreakBeforeBraces: Allman
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 1024
CommentPragmas: '^ IWYU pragma:'
QualifierAlignment: Leave
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: true
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
PackConstructorInitializers: NextLine
BasedOnStyle: ''
ConstructorInitializerAllOnOneLineOrOnePerLine: false
AllowAllConstructorInitializersOnNextLine: true
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<ext/.*\.h>'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^<.*\.h>'
Priority: 1
SortPriority: 0
CaseSensitive: false
- Regex: '^<.*'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '.*common.h'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 3
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: 'common.h'
IncludeIsMainSourceRegex: 'common.h'
IndentAccessModifiers: false
IndentCaseLabels: true
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentExternBlock: AfterExternBlock
IndentRequires: false
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: Signature
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Never
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PenaltyIndentedWhitespace: 0
PointerAlignment: Left
PPIndentWidth: -1
RawStringFormats:
- Language: Cpp
Delimiters:
- cc
- CC
- cpp
- Cpp
- CPP
- 'c++'
- 'C++'
CanonicalDelimiter: ''
BasedOnStyle: google
- Language: TextProto
Delimiters:
- pb
- PB
- proto
- PROTO
EnclosingFunctions:
- EqualsProto
- EquivToProto
- PARSE_PARTIAL_TEXT_PROTO
- PARSE_TEST_PROTO
- PARSE_TEXT_PROTO
- ParseTextOrDie
- ParseTextProtoOrDie
- ParseTestProto
- ParsePartialTestProto
CanonicalDelimiter: pb
BasedOnStyle: google
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: false
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1
SortIncludes: CaseInsensitive
SortJavaStaticImport: Before
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
AfterOverloadedOperator: false
BeforeNonEmptyParentheses: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: Never
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
BitFieldColonSpacing: Both
Standard: Auto
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 4
UseCRLF: false
UseTab: Always
WhitespaceSensitiveMacros:
- STRINGIZE
- PP_STRINGIZE
- BOOST_PP_STRINGIZE
- NS_SWIFT_NAME
- CF_SWIFT_NAME
...

2
.gitignore vendored
View File

@ -43,5 +43,5 @@ build/*
# Misc # Misc
.DS_Store .DS_Store
/.errors /.errors
tools

View File

@ -4,7 +4,7 @@
![Alt text](dev/screenshots/v0.6-06.png?raw=true "Screenshot") ![Alt text](dev/screenshots/v0.6-06.png?raw=true "Screenshot")
The develop branch on GitHub (https://github.com/stephenjsweeney/tbftss/tree/develop) is where all the dev work happens. Stable(ish) releases will go in to master (https://github.com/stephenjsweeney/tbftss/tree/master). The develop branch on GitHub (https://github.com/stephenjsweeney/tbftss/tree/develop) is where all the dev work happens. Stable releases will go in to master (https://github.com/stephenjsweeney/tbftss/tree/master).
Website: www.battleforthesolarsystem.com Website: www.battleforthesolarsystem.com
Email: stephenjsweeney@battleforthesolarsystem.com Email: stephenjsweeney@battleforthesolarsystem.com

View File

@ -99,7 +99,7 @@
"number" : 12, "number" : 12,
"scatter" : 5000, "scatter" : 5000,
"aiFlags" : "+AIF_UNLIMITED_RANGE", "aiFlags" : "+AIF_UNLIMITED_RANGE",
"flags" : "+EF_AI_LEADER" "flags" : "+EF_AI_LEADER+EF_MUST_DISABLE"
}, },
{ {
"types" : "Sphinx;Thunderhead", "types" : "Sphinx;Thunderhead",
@ -158,7 +158,9 @@
"lines" : [ "lines" : [
"MSG_BOX CSN Griffin;White Knights, the enemy tugs are already in position and are attaching tow ropes. They must not be allowed to get those fighters and pilots to the jumpgate.", "MSG_BOX CSN Griffin;White Knights, the enemy tugs are already in position and are attaching tow ropes. They must not be allowed to get those fighters and pilots to the jumpgate.",
"MSG_BOX de Winter;Can you disable the gate remotely?", "MSG_BOX de Winter;Can you disable the gate remotely?",
"MSG_BOX CSN Griffin;Negative, the Pandorans have control. We're working take back command functions. Stand by." "MSG_BOX CSN Griffin;Negative, the Pandorans have control. We're working take back command functions. Stand by.",
"MSG_BOX de Winter;Understood. Kelly, we should mag the tugs first and destroy them when its safe. Stray plasma fire could hit our pilots.",
"MSG_BOX Taylor;Agreed."
] ]
}, },
{ {

View File

@ -25,9 +25,7 @@ MAKEFLAGS += -j$(NPROCS)
CXXFLAGS += `sdl2-config --cflags` -DVERSION=$(VERSION) -DREVISION=$(REVISION) -DDATA_DIR=\"$(DATA_DIR)\" -DLOCALE_DIR=\"$(LOCALE_DIR)\" CXXFLAGS += `sdl2-config --cflags` -DVERSION=$(VERSION) -DREVISION=$(REVISION) -DDATA_DIR=\"$(DATA_DIR)\" -DLOCALE_DIR=\"$(LOCALE_DIR)\"
CXXFLAGS += -ansi -pedantic CXXFLAGS += -ansi -pedantic
CXXFLAGS += -g -lefence CXXFLAGS += -g -lefence
ifneq ("$(wildcard .errors)","")
CXXFLAGS += -Wall -Wempty-body -Werror -Wstrict-prototypes -Werror=maybe-uninitialized -Warray-bounds CXXFLAGS += -Wall -Wempty-body -Werror -Wstrict-prototypes -Werror=maybe-uninitialized -Warray-bounds
endif
LDFLAGS += `sdl2-config --libs` -lSDL2_mixer -lSDL2_image -lSDL2_ttf -lm LDFLAGS += `sdl2-config --libs` -lSDL2_mixer -lSDL2_image -lSDL2_ttf -lm

View File

@ -2,7 +2,7 @@
<html> <html>
<head> <head>
<style> <style>
body {background-color:#000; color: #fff; font-family: "sans"; background-image: url("background02.jpg");} body {background-color:#000; color: #fff; font-family: Arial; font-size: 18px; background-image: url("background02.jpg");}
h3 {background-color:#47c; padding:0.25em; color:#fff; margin-top:3em; border: 1px solid #fff;} h3 {background-color:#47c; padding:0.25em; color:#fff; margin-top:3em; border: 1px solid #fff;}
h4 {background-color:#000; padding:0.25em; color:#fff; margin-top:3em; border: 1px solid #5ad;} h4 {background-color:#000; padding:0.25em; color:#fff; margin-top:3em; border: 1px solid #5ad;}
h5 {border-bottom: 1px solid #5ad; width: 50%;} h5 {border-bottom: 1px solid #5ad; width: 50%;}

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,29 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../battle/bullets.h"
#include "../battle/fighters.h"
#include "../battle/hud.h"
#include "../battle/mine.h"
#include "../battle/quadtree.h"
#include "../battle/script.h"
#include "../system/util.h"
#include "ai.h" #include "ai.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 void faceTarget(Entity *e);
static int isInFOV(Entity *e, int fov); static int isInFOV(Entity *e, int fov);
static void preAttack(void); static void preAttack(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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void checkZackariaSuspicionLevel(void);
void checkSuspicionLevel(void);
#define AI_EVADE 0 void doAI(void);
#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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,13 +18,56 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../battle/bullets.h"
#include "../battle/debris.h"
#include "../battle/effects.h"
#include "../battle/entities.h"
#include "../battle/hud.h"
#include "../battle/locations.h"
#include "../battle/messageBox.h"
#include "../battle/missionInfo.h"
#include "../battle/objectives.h"
#include "../battle/player.h"
#include "../battle/quadtree.h"
#include "../battle/radar.h"
#include "../battle/script.h"
#include "../battle/spawners.h"
#include "../battle/starfield.h"
#include "../battle/waypoints.h"
#include "../challenges/challengeHome.h"
#include "../challenges/challenges.h"
#include "../galaxy/galacticMap.h"
#include "../galaxy/mission.h"
#include "../game/credits.h"
#include "../game/options.h"
#include "../game/stats.h"
#include "../game/trophies.h"
#include "../json/cJSON.h"
#include "../system/atlas.h"
#include "../system/draw.h"
#include "../system/input.h"
#include "../system/modalDialog.h"
#include "../system/sound.h"
#include "../system/widgets.h"
#include "battle.h" #include "battle.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 logic(void);
static void draw(void); static void draw(void);
static void handleKeyboard(void); static void handleKeyboard(void);
static void postBattle(void); static void postBattle(void);
void destroyBattle(void);
static void doBattle(void); static void doBattle(void);
static void optQuitBattle(void); static void optQuitBattle(void);
static void quitBattle(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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void destroyBattle(void);
void initBattle(void);
#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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,30 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../battle/effects.h"
#include "../battle/fighters.h"
#include "../battle/quadtree.h"
#include "../game/trophies.h"
#include "../json/cJSON.h"
#include "../system/atlas.h"
#include "../system/draw.h"
#include "../system/io.h"
#include "../system/lookup.h"
#include "../system/sound.h"
#include "../system/util.h"
#include "bullets.h" #include "bullets.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 huntTarget(Bullet *b);
static void checkCollisions(Bullet *b); static void checkCollisions(Bullet *b);
static void resizeDrawList(void); static void resizeDrawList(void);
@ -261,7 +283,7 @@ static void checkCollisions(Bullet *b)
} }
} }
void doBulletHitEffect(Bullet *b) static void doBulletHitEffect(Bullet *b)
{ {
switch (b->type) switch (b->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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void destroyBullets(void);
void destroyBulletDefs(void);
#include "../json/cJSON.h" void fireMissile(Entity *owner);
void fireRocket(Entity *owner);
#define INITIAL_BULLET_DRAW_CAPACITY 32 void fireGuns(Entity *owner);
#define MISSILE_LIFE (FPS * 30) void drawBullets(void);
#define TURN_SPEED 2 void doBullets(void);
#define TURN_THRESHOLD 3 void initBulletDefs(void);
void initBullets(void);
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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,32 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../battle/ai.h"
#include "../battle/debris.h"
#include "../battle/effects.h"
#include "../battle/entities.h"
#include "../battle/fighters.h"
#include "../battle/messageBox.h"
#include "../battle/objectives.h"
#include "../battle/quadtree.h"
#include "../battle/script.h"
#include "../json/cJSON.h"
#include "../system/atlas.h"
#include "../system/io.h"
#include "../system/lookup.h"
#include "../system/sound.h"
#include "../system/util.h"
#include "capitalShips.h" #include "capitalShips.h"
#define TURN_SPEED 0.1
#define TURN_THRESHOLD 2
extern Battle battle;
extern Entity *player;
extern Entity *self;
static int steer(void); static int steer(void);
static void think(void); static void think(void);
static void gunThink(void); static void gunThink(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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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.
*/ */
void destroyCapitalShipDefs(void);
#include "../common.h" void loadCapitalShips(struct cJSON *node);
void updateCapitalShipComponentProperties(Entity *parent, long flags);
#include "../json/cJSON.h" void loadCapitalShipDefs(void);
void doCapitalShip(void);
#define TURN_SPEED 0.1 Entity *spawnCapitalShip(char *name, int x, int y, int side);
#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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../battle/effects.h"
#include "../json/cJSON.h"
#include "../system/atlas.h"
#include "../system/draw.h"
#include "../system/util.h"
#include "debris.h" #include "debris.h"
#define INITIAL_DEBRIS_DRAW_CAPACITY 32
#define MAX_DEBRIS_TEXTURES 6
extern Battle battle;
static void changeCourse(Debris *d); static void changeCourse(Debris *d);
static void resizeDrawList(void); 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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void destroyDebris(void);
void drawDebris(void);
#include "../json/cJSON.h" void doDebris(void);
void addDebris(int x, int y, int amount);
#define INITIAL_DEBRIS_DRAW_CAPACITY 32 void initDebris(void);
#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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../system/atlas.h"
#include "../system/draw.h"
#include "../system/util.h"
#include "effects.h" #include "effects.h"
#define INITIAL_EFFECT_DRAW_CAPACITY 128
extern App app;
extern Battle battle;
extern Entity *self;
static void setRandomFlameHue(Effect *e); static void setRandomFlameHue(Effect *e);
static void setRandomShieldHue(Effect *e); static void setRandomShieldHue(Effect *e);
static void resizeDrawList(void); 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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void destroyEffects(void);
void addECMEffect(Entity *ent);
#define INITIAL_EFFECT_DRAW_CAPACITY 128 void addShieldSplinterEffect(Entity *ent);
void addMissileEngineEffect(Bullet *b);
extern void blitScaled(AtlasImage *atlasImage, int x, int y, int w, int h, int center); void addLargeEngineEffect(void);
extern int collision(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2); void addEngineEffect(void);
extern AtlasImage *getAtlasImage(char *name); void addMissileExplosion(Bullet *b);
extern int isOnBattleScreen(int x, int y, int w, int h); void addLargeExplosion(void);
extern void *resize(void *array, int oldSize, int newSize); void addMineExplosion(void);
extern void setAtlasColor(int r, int g, int b, int a); void addSmallExplosion(void);
void addDebrisFire(int x, int y);
extern App app; void addSmallFighterExplosion(void);
extern Battle battle; void addBulletHitEffect(int x, int y, int r, int g, int b);
extern Entity *self; 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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,29 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../battle/capitalShips.h"
#include "../battle/effects.h"
#include "../battle/fighters.h"
#include "../battle/quadtree.h"
#include "../battle/rope.h"
#include "../game/trophies.h"
#include "../system/atlas.h"
#include "../system/draw.h"
#include "../system/lookup.h"
#include "entities.h" #include "entities.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 drawEntity(Entity *e);
static void doEntity(void); static void doEntity(void);
static void alignComponents(void); static void alignComponents(void);
@ -393,7 +414,9 @@ void drawEntities(void)
candidates = getAllEntsWithin(battle.camera.x, battle.camera.y, app.winWidth, app.winHeight, NULL); candidates = getAllEntsWithin(battle.camera.x, battle.camera.y, app.winWidth, app.winHeight, NULL);
/* counting entities to draw */ /* counting entities to draw */
for (i = 0, e = candidates[i] ; e != NULL ; e = candidates[++i]) {}; for (i = 0, e = candidates[i]; e != NULL; e = candidates[++i])
{
};
qsort(candidates, i, sizeof(Entity *), drawComparator); qsort(candidates, i, sizeof(Entity *), drawComparator);

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void destroyEntities(void);
void awardPandoranCraftTrophy(void);
#define DISABLED_GLOW_MAX 255 void updateEntitySide(char *sideStr, char *name);
#define DISABLED_GLOW_MIN 128 void killEntity(char *name);
#define DISABLED_GLOW_SPEED 3 void addAllToQuadtree(void);
void countNumEnemies(void);
extern void addToQuadtree(Entity *e, Quadtree *root); void activateEntityGroups(char *groupNames);
extern void awardTrophy(char *id); void activateEntities(char *names);
extern void blitRotated(AtlasImage *atlasImage, int x, int y, float angle); void drawEntities(void);
extern void cutRope(Entity *e); void doEntities(void);
extern void doCapitalShip(void); Entity *spawnEntity(void);
extern void doFighter(void); void initEntities(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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,33 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../battle/ai.h"
#include "../battle/debris.h"
#include "../battle/effects.h"
#include "../battle/entities.h"
#include "../battle/hud.h"
#include "../battle/items.h"
#include "../battle/objectives.h"
#include "../battle/quadtree.h"
#include "../battle/rope.h"
#include "../battle/script.h"
#include "../galaxy/mission.h"
#include "../json/cJSON.h"
#include "../system/atlas.h"
#include "../system/io.h"
#include "../system/lookup.h"
#include "../system/sound.h"
#include "../system/util.h"
#include "fighters.h" #include "fighters.h"
extern Battle battle;
extern Colors colors;
extern Entity *player;
extern Entity *self;
extern Game game;
static void separate(void); static void separate(void);
static void die(void); static void die(void);
static void immediateDie(void); static void immediateDie(void);
@ -172,7 +197,6 @@ static void randomizeDartGuns(Entity *dart)
dart->guns[2].y = -10; dart->guns[2].y = -10;
break; break;
/* Plasma / Laser cannons */ /* Plasma / Laser cannons */
case 3: case 3:
dart->guns[0].type = BT_PLASMA; 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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void destroyFighterStats(void);
void destroyFighterDefs(void);
#include "../json/cJSON.h" void loadFighters(struct cJSON *node);
void loadFighterDefs(void);
extern void addDebris(int x, int y, int amount); Entity **getDBFighters(int *num);
extern void addEngineEffect(void); void retreatAllies(void);
extern void addHudMessage(SDL_Color c, char *format, ...); void retreatEnemies(void);
extern void addRandomItem(int x, int y); void damageFighter(Entity *e, int amount, long flags);
extern void addShieldSplinterEffect(Entity *ent); void applyFighterBrakes(void);
extern void addSmallExplosion(void); void applyFighterThrust(void);
extern void addSmallFighterExplosion(void); void doFighter(void);
extern void adjustObjectiveTargetValue(char *name, int type, int amount); void resetFighter(Entity *fighter);
extern void attachRope(void); Entity *spawnFighter(char *name, int x, int y, int side);
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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../battle/jumpgate.h"
#include "../battle/player.h"
#include "../battle/radar.h"
#include "../system/atlas.h"
#include "../system/draw.h"
#include "../system/text.h"
#include "../system/util.h"
#include "hud.h" #include "hud.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 drawPlayerTargeter(void);
static void drawNumFighters(void); static void drawNumFighters(void);
static void drawHealthBars(void); static void drawHealthBars(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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void resetHud(void);
void drawHud(void);
#define MAX_HUD_MESSAGES 6 void addHudMessage(SDL_Color c, char *format, ...);
void doHud(void);
extern void blit(AtlasImage *atlasImage, int x, int y, int center); void initHud(void);
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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../battle/entities.h"
#include "../battle/hud.h"
#include "../battle/objectives.h"
#include "../battle/quadtree.h"
#include "../json/cJSON.h"
#include "../system/atlas.h"
#include "../system/io.h"
#include "../system/lookup.h"
#include "../system/sound.h"
#include "../system/util.h"
#include "items.h" #include "items.h"
extern Battle battle;
extern Colors colors;
extern Entity *player;
extern Entity *self;
static void action(void); static void action(void);
static Entity *getItemDef(char *name); 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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void destroyItemDefs(void);
void loadItems(struct cJSON *node);
#include "../json/cJSON.h" void addRandomItem(int x, int y);
Entity *spawnItem(char *name);
extern void addHudMessage(SDL_Color c, char *format, ...); void loadItemDefs(void);
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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../battle/debris.h"
#include "../battle/effects.h"
#include "../battle/entities.h"
#include "../battle/objectives.h"
#include "../battle/quadtree.h"
#include "../battle/script.h"
#include "../system/atlas.h"
#include "../system/draw.h"
#include "../system/sound.h"
#include "../system/util.h"
#include "jumpgate.h" #include "jumpgate.h"
#define ESCAPE_DISTANCE 256
extern Battle battle;
extern Entity *self;
static void think(void); static void think(void);
static void draw(void); static void draw(void);
static void handleFleeingEntities(void); static void handleFleeingEntities(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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void activateJumpgate(int activate);
int jumpgateEnabled(void);
#define ESCAPE_DISTANCE 256 Entity *spawnJumpgate(int side, long flags);
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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../battle/script.h"
#include "../json/cJSON.h"
#include "../system/draw.h"
#include "../system/util.h"
#include "locations.h" #include "locations.h"
extern Battle battle;
extern Entity *player;
void doLocations(void) void doLocations(void)
{ {
Location *l, *prev; Location *l, *prev;
@ -131,7 +140,6 @@ void loadLocations(cJSON *node)
l->x += (SCREEN_WIDTH / 2); l->x += (SCREEN_WIDTH / 2);
l->y += (SCREEN_HEIGHT / 2); l->y += (SCREEN_HEIGHT / 2);
node = node->next; 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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void loadLocations(struct cJSON *node);
void createChristabelLocation(void);
#include "../json/cJSON.h" void activateLocations(char *locations);
void drawLocations(void);
extern void drawCircle(int cx, int cy, int radius, int r, int g, int b, int a); void doLocations(void);
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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../system/sound.h"
#include "../system/text.h"
#include "messageBox.h" #include "messageBox.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 calculateMessageBoxHeight(MessageBox *msg);
static void nextMessage(void); 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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void resetMessageBox(void);
void drawMessageBox(void);
#define MSG_BOX_TEXT_WIDTH 600 int showingMessageBoxes(void);
void doMessageBox(void);
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...); void addMessageBox(char *title, char *body, int type);
extern int getWrappedTextHeight(char *text, int size); void initMessageBox(void);
extern void playSound(int sound);
extern void useFont(char *name);
extern App app;
extern Battle battle;
extern Colors colors;
extern Entity *player;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,28 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../battle/effects.h"
#include "../battle/entities.h"
#include "../battle/fighters.h"
#include "../battle/objectives.h"
#include "../battle/quadtree.h"
#include "../battle/script.h"
#include "../game/trophies.h"
#include "../system/atlas.h"
#include "../system/sound.h"
#include "../system/util.h"
#include "mine.h" #include "mine.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 think(void);
static void die(void); static void die(void);
static void lookForFighters(void); static void lookForFighters(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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" Entity *spawnMine(int type);
#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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../challenges/challenges.h"
#include "../system/atlas.h"
#include "../system/draw.h"
#include "../system/text.h"
#include "../system/util.h"
#include "../system/widgets.h"
#include "missionInfo.h" #include "missionInfo.h"
extern App app;
extern Battle battle;
extern Colors colors;
extern Game game;
static void drawMissionSummary(AtlasImage *title); static void drawMissionSummary(AtlasImage *title);
static void drawObjectives(void); static void drawObjectives(void);
static void drawChallenges(void); static void drawChallenges(void);
@ -224,4 +237,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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void drawMissionInfo(void);
void initMissionInfo(void);
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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../battle/hud.h"
#include "../battle/script.h"
#include "../galaxy/mission.h"
#include "../json/cJSON.h"
#include "../system/lookup.h"
#include "../system/sound.h"
#include "../system/util.h"
#include "objectives.h" #include "objectives.h"
extern Battle battle;
extern Colors colors;
static int fireObjectivesComplete; static int fireObjectivesComplete;
void doObjectives(void) void doObjectives(void)
@ -238,7 +250,6 @@ void completeConditions(void)
} }
} }
void failIncompleteObjectives(void) void failIncompleteObjectives(void)
{ {
Objective *o; 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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void addEpicKillsObjective(void);
#include "../json/cJSON.h" void addEpicLivesObjective(void);
void loadObjectives(struct cJSON *node);
extern void addHudMessage(SDL_Color c, char *format, ...); void activateObjectives(char *objectives);
extern void completeMission(void); void failIncompleteObjectives(void);
extern void failMission(void); void completeConditions(void);
extern int getJSONValue(cJSON *node, char *name, int defValue); void completeAllObjectives(void);
extern long lookup(char *name); void updateCondition(char *name, int type);
extern void playSound(int id); void adjustObjectiveTargetValue(char *name, int type, int amount);
extern void runScriptFunction(char *format, ...); void updateObjective(char *name, int type);
void doObjectives(void);
extern Battle battle;
extern Colors colors;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,33 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../battle/bullets.h"
#include "../battle/effects.h"
#include "../battle/fighters.h"
#include "../battle/hud.h"
#include "../battle/objectives.h"
#include "../galaxy/mission.h"
#include "../game/trophies.h"
#include "../json/cJSON.h"
#include "../system/controls.h"
#include "../system/lookup.h"
#include "../system/sound.h"
#include "../system/util.h"
#include "player.h" #include "player.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 selectTarget(void);
static void switchGuns(void); static void switchGuns(void);
static void cycleRadarZoom(void); static void cycleRadarZoom(void);
@ -512,8 +537,7 @@ static void selectNewPlayer(int dir)
selectedPlayerIndex = mod(selectedPlayerIndex, MAX_SELECTABLE_PLAYERS); selectedPlayerIndex = mod(selectedPlayerIndex, MAX_SELECTABLE_PLAYERS);
player = availablePlayerUnits[selectedPlayerIndex]; player = availablePlayerUnits[selectedPlayerIndex];
} } while (player == NULL);
while (player == NULL);
battle.camera.x = player->x - (app.winWidth / 2); battle.camera.x = player->x - (app.winWidth / 2);
battle.camera.y = player->y - (app.winHeight / 2); battle.camera.y = player->y - (app.winHeight / 2);
@ -572,8 +596,7 @@ static void switchGuns(void)
do do
{ {
i = (i + 1) % BT_MAX; i = (i + 1) % BT_MAX;
} } while (!availableGuns[i]);
while (!availableGuns[i]);
} }
if (player->selectedGunType != i) if (player->selectedGunType != i)

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void loadPlayer(struct cJSON *node);
#include "../json/cJSON.h" int playerHasGun(int type);
void setInitialPlayerAngle(void);
#define MAX_SELECTABLE_PLAYERS 8 void doPlayerSelect(void);
#define MAX_SELECTABLE_TARGETS 8 void doPlayer(void);
void initPlayer(void);
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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../system/util.h"
#include "quadtree.h" #include "quadtree.h"
#define QT_INITIAL_CAPACITY 8
#define QT_MAX_DEPTH 5
extern Battle battle;
static Entity **candidates; static Entity **candidates;
static int cIndex; static int cIndex;
static int cCapacity; static int cCapacity;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void destroyQuadtree(void);
Entity **getAllEntsInRadius(int x, int y, int radius, Entity *ignore);
#define QT_INITIAL_CAPACITY 8 Entity **getAllEntsWithin(int x, int y, int w, int h, Entity *ignore);
#define QT_MAX_DEPTH 5 void removeFromQuadtree(Entity *e, Quadtree *root);
void addToQuadtree(Entity *e, Quadtree *root);
extern void *resize(void *array, int oldSize, int newSize); void initQuadtree(Quadtree *root);
extern Battle battle;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../system/atlas.h"
#include "../system/draw.h"
#include "../system/text.h"
#include "../system/util.h"
#include "radar.h" #include "radar.h"
extern App app;
extern Battle battle;
extern Colors colors;
extern Entity *player;
static AtlasImage *radarTexture; static AtlasImage *radarTexture;
static AtlasImage *radarWarningTexture; static AtlasImage *radarWarningTexture;
static int radarRanges[] = {20, 40, 60}; static int radarRanges[] = {20, 40, 60};

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void drawRadarRangeWarning(void);
void drawRadar(void);
extern void blit(AtlasImage *atlasImage, int x, int y, int center); void initRadar(void);
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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../battle/hud.h"
#include "../battle/quadtree.h"
#include "../battle/script.h"
#include "../system/sound.h"
#include "../system/util.h"
#include "rope.h" #include "rope.h"
#define ROPE_DISTANCE 128
extern App app;
extern Battle battle;
extern Colors colors;
extern Entity *player;
extern Entity *self;
void attachRope(void) void attachRope(void)
{ {
int i, distance; int i, distance;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void cutRope(Entity *e);
void drawRope(Entity *e);
#define ROPE_DISTANCE 128 void doRope(Entity *owner);
void attachRope(void);
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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,10 +18,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../battle/entities.h"
#include "../battle/fighters.h"
#include "../battle/hud.h"
#include "../battle/jumpgate.h"
#include "../battle/locations.h"
#include "../battle/messageBox.h"
#include "../battle/objectives.h"
#include "../battle/spawners.h"
#include "../battle/waypoints.h"
#include "../galaxy/mission.h"
#include "../json/cJSON.h"
#include "script.h" #include "script.h"
extern Battle battle;
extern Colors colors;
static void executeNextLine(ScriptRunner *runner); static void executeNextLine(ScriptRunner *runner);
void destroyScript(void);
static cJSON *scriptJSON, *rootJSON; static cJSON *scriptJSON, *rootJSON;
static ScriptRunner head; 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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void destroyScript(void);
void cancelScript(void);
#include "../json/cJSON.h" void runScriptFunction(const char *format, ...);
void doScript(void);
extern void activateEntities(char *name); void initScript(struct cJSON *root);
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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../battle/fighters.h"
#include "../json/cJSON.h"
#include "../system/lookup.h"
#include "../system/util.h"
#include "spawners.h" #include "spawners.h"
extern Battle battle;
extern Entity *player;
void doSpawners(void) void doSpawners(void)
{ {
Entity *e; Entity *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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void loadSpawners(struct cJSON *node);
void activateTrespasserSpawner(void);
#include "../json/cJSON.h" void activateSpawner(char *name, int active);
void doSpawners(void);
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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../system/util.h"
#include "starfield.h" #include "starfield.h"
extern App app;
static Star stars[MAX_STARS]; static Star stars[MAX_STARS];
void initStars(void) 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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void drawStars(void);
void doStars(float dx, float dy);
extern float mod(float n, float x); void initStars(void);
extern App app;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,12 +18,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../battle/entities.h"
#include "../battle/hud.h"
#include "../battle/objectives.h"
#include "../battle/script.h"
#include "../system/atlas.h"
#include "../system/sound.h"
#include "../system/util.h"
#include "waypoints.h" #include "waypoints.h"
extern Battle battle;
extern Colors colors;
extern Entity *player;
extern Entity *self;
extern Game game;
static void think(void); static void think(void);
static int teamMatesClose(void); static int teamMatesClose(void);
static int isCurrentObjective(void); static int isCurrentObjective(void);
void activateNextWaypoint(void);
static int waypointId; static int waypointId;
static int currentWaypointId; 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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void activateNextWaypoint(void);
Entity *spawnWaypoint(void);
extern void addHudMessage(SDL_Color c, char *format, ...); void resetWaypoints(void);
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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,13 +18,48 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../battle/battle.h"
#include "../battle/starfield.h"
#include "../challenges/challenges.h"
#include "../galaxy/mission.h"
#include "../game/fighterDatabase.h"
#include "../game/options.h"
#include "../game/stats.h"
#include "../game/title.h"
#include "../game/trophies.h"
#include "../system/atlas.h"
#include "../system/draw.h"
#include "../system/input.h"
#include "../system/resources.h"
#include "../system/sound.h"
#include "../system/text.h"
#include "../system/textures.h"
#include "../system/transition.h"
#include "../system/util.h"
#include "../system/widgets.h"
#include "challengeHome.h" #include "challengeHome.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 logic(void);
static void draw(void); static void draw(void);
static void handleKeyboard(void); static void handleKeyboard(void);
static void drawChallenges(void); static void drawChallenges(void);
static void doChallenges(void); static void doChallengeList(void);
static void startChallengeMission(void); static void startChallengeMission(void);
static void drawMenu(void); static void drawMenu(void);
static void resume(void); static void resume(void);
@ -209,7 +244,7 @@ static void logic(void)
switch (show) switch (show)
{ {
case SHOW_CHALLENGES: case SHOW_CHALLENGES:
doChallenges(); doChallengeList();
break; break;
case SHOW_MENU: case SHOW_MENU:
@ -232,7 +267,7 @@ static void logic(void)
app.doTrophyAlerts = 1; app.doTrophyAlerts = 1;
} }
static void doChallenges(void) static void doChallengeList(void)
{ {
Mission *c; Mission *c;
int i, startIndex, end; 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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void initChallengeHome(void);
#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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../battle/fighters.h"
#include "../galaxy/mission.h"
#include "../game/stats.h"
#include "../game/trophies.h"
#include "../json/cJSON.h"
#include "../system/io.h"
#include "../system/lookup.h"
#include "../system/util.h"
#include "../system/widgets.h"
#include "challenges.h" #include "challenges.h"
extern Battle battle;
extern Dev dev;
extern Entity *player;
extern Game game;
static void updateTimeChallenge(Challenge *c); static void updateTimeChallenge(Challenge *c);
static void updateSurvivalChallenge(Challenge *c); static void updateSurvivalChallenge(Challenge *c);
static void updateAccuracyChallenge(Challenge *c); static void updateAccuracyChallenge(Challenge *c);
@ -35,7 +51,6 @@ static void completeChallenge(void);
static void failChallenge(void); static void failChallenge(void);
static int updateChallenges(void); static int updateChallenges(void);
static char *getFormattedChallengeDescription(const char *format, ...); static char *getFormattedChallengeDescription(const char *format, ...);
char *getChallengeDescription(Challenge *c);
static int challengeFinished(void); static int challengeFinished(void);
static int alreadyPassed(void); static int alreadyPassed(void);
static void printStats(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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void updateChallengeMissions(void);
#include "../json/cJSON.h" Challenge *getChallenge(Mission *mission, int type, int value);
char *getChallengeDescription(Challenge *c);
extern void awardCraftTrophy(void); void doChallenges(void);
extern void awardStatsTrophies(void); void loadChallenge(Mission *mission, struct cJSON *node);
extern char **getFileList(char *dir, int *count); void initChallenges(void);
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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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 "stdlib.h"
#include "stdio.h"
#include "string.h"
#include "math.h"
#include "ctype.h" #include "ctype.h"
#include "SDL2/SDL.h"
#include "defs.h" #include "defs.h"
#include "math.h"
#include "SDL2/SDL.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "structs.h" #include "structs.h"
extern char *getTranslatedString(char *string); extern char *getTranslatedString(char *string);

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -52,7 +52,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MIN(a, b) (((a) < (b)) ? (a) : (b)) #define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define MAX(a, b) (((a) > (b)) ? (a) : (b)) #define MAX(a, b) (((a) > (b)) ? (a) : (b))
#define CAROLINE(a, b) MIN(a, b) #define CAROLINE(a, b) MIN(a, b)
#define STRNCPY(dest, src, n) strncpy(dest, src, n); dest[n - 1] = '\0' #define STRNCPY(dest, src, n) \
strncpy(dest, src, n); \
dest[n - 1] = '\0'
#define TO_RAIDANS(angleDegrees) (angleDegrees * PI / 180.0) #define TO_RAIDANS(angleDegrees) (angleDegrees * PI / 180.0)
#define TO_DEGREES(angleRadians) (angleRadians * 180.0 / PI) #define TO_DEGREES(angleRadians) (angleRadians * 180.0 / PI)
@ -78,7 +80,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define NUM_TEXTURE_BUCKETS 32 #define NUM_TEXTURE_BUCKETS 32
#define NUM_ATLAS_BUCKETS 64 #define NUM_ATLAS_BUCKETS 64
#define NUM_GLYPH_BUCKETS 128
#define MAX_GLYPHS 400
#define MAX_STARS 500 #define MAX_STARS 500

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,42 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../battle/battle.h"
#include "../battle/starfield.h"
#include "../galaxy/mission.h"
#include "../galaxy/starSystems.h"
#include "../game/fighterDatabase.h"
#include "../game/options.h"
#include "../game/stats.h"
#include "../game/title.h"
#include "../game/trophies.h"
#include "../system/atlas.h"
#include "../system/draw.h"
#include "../system/input.h"
#include "../system/modalDialog.h"
#include "../system/sound.h"
#include "../system/text.h"
#include "../system/textures.h"
#include "../system/transition.h"
#include "../system/util.h"
#include "../system/widgets.h"
#include "galacticMap.h" #include "galacticMap.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 logic(void);
static void draw(void); static void draw(void);
static void handleKeyboard(void); static void handleKeyboard(void);
@ -30,7 +64,6 @@ static void selectStarSystem(void);
static void drawGalaxy(void); static void drawGalaxy(void);
static void centerOnSelectedStarSystem(void); static void centerOnSelectedStarSystem(void);
static void doStarSystems(void); static void doStarSystems(void);
void destroyGalacticMap(void);
static void drawPulses(void); static void drawPulses(void);
static void drawInfoBars(void); static void drawInfoBars(void);
static void doPulses(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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void destroyGalacticMap(void);
void initGalacticMap(void);
#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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,10 +18,45 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include <time.h>
#include "../common.h"
#include "../battle/capitalShips.h"
#include "../battle/entities.h"
#include "../battle/fighters.h"
#include "../battle/items.h"
#include "../battle/jumpgate.h"
#include "../battle/locations.h"
#include "../battle/mine.h"
#include "../battle/missionInfo.h"
#include "../battle/objectives.h"
#include "../battle/player.h"
#include "../battle/script.h"
#include "../battle/spawners.h"
#include "../battle/waypoints.h"
#include "../challenges/challenges.h"
#include "../galaxy/starSystems.h"
#include "../game/trophies.h"
#include "../json/cJSON.h"
#include "../system/atlas.h"
#include "../system/io.h"
#include "../system/lookup.h"
#include "../system/resources.h"
#include "../system/sound.h"
#include "../system/textures.h"
#include "../system/transition.h"
#include "../system/util.h"
#include "../system/widgets.h"
#include "mission.h" #include "mission.h"
extern App app;
extern Battle battle;
extern Dev dev;
extern Entity *player;
extern Game game;
static void loadEntities(cJSON *node); static void loadEntities(cJSON *node);
static unsigned long hashcode(const char *str);
static void loadEpicData(cJSON *node); static void loadEpicData(cJSON *node);
static char *getAutoBackground(char *filename); static char *getAutoBackground(char *filename);
static char *getAutoPlanet(char *filename); static char *getAutoPlanet(char *filename);
@ -489,27 +524,6 @@ int isMissionAvailable(Mission *mission, Mission *prev)
} }
else else
{ {
return mission->completed || ( return mission->completed || (game.completedMissions >= mission->requires && game.stats[STAT_OPTIONAL_COMPLETED] >= mission->requiresOptional && game.completedMissions < mission->expires) || dev.debug;
game.completedMissions >= mission->requires &&
game.stats[STAT_OPTIONAL_COMPLETED] >= mission->requiresOptional &&
game.completedMissions < mission->expires
) || 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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" int isMissionAvailable(Mission *mission, Mission *prev);
#include "../json/cJSON.h" void updateAllMissions(void);
Mission *getMission(char *filename);
#include "time.h" void failMission(void);
void completeMission(void);
extern void activateNextWaypoint(void); void loadMission(char *filename);
extern void addAllToQuadtree(void); Mission *loadMissionMeta(char *filename);
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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../galaxy/mission.h"
#include "../json/cJSON.h"
#include "../system/io.h"
#include "../system/lookup.h"
#include "../system/util.h"
#include "starSystems.h" #include "starSystems.h"
extern Game game;
static void loadMissions(StarSystem *starSystem); static void loadMissions(StarSystem *starSystem);
static StarSystem *loadStarSystem(cJSON *starSystemJSON); 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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void destroyStarSystems(void);
void updateStarSystemMissions(void);
#include "../json/cJSON.h" StarSystem *getStarSystem(char *name);
void initStarSystems(void);
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;

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

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../battle/fighters.h"
#include "../system/draw.h"
#include "../system/text.h"
#include "../system/util.h"
#include "../system/widgets.h"
#include "fighterDatabase.h" #include "fighterDatabase.h"
extern App app;
extern Colors colors;
extern Game game;
static void prevFighter(void); static void prevFighter(void);
static void nextFighter(void); static void nextFighter(void);
static int countFighterGuns(Entity *fighter, int type); static int countFighterGuns(Entity *fighter, 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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void drawFighterDatabase(void);
void doFighterDatabase(void);
extern void blitRotated(AtlasImage *atlasImage, int x, int y, float angle); void initFighterDatabaseDisplay(void);
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...); void destroyFighterDatabase(void);
extern void drawWidgets(char *groupName); void initFighterDatabase(void);
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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "game.h" #include "game.h"
extern Game game;
void initGame(void) void initGame(void)
{ {
memset(&game, 0, sizeof(Game)); 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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void destroyGame(void);
void initGame(void);
extern Game 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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../battle/fighters.h"
#include "../challenges/challenges.h"
#include "../galaxy/mission.h"
#include "../galaxy/starSystems.h"
#include "../game/trophies.h"
#include "../json/cJSON.h"
#include "../system/io.h"
#include "../system/lookup.h"
#include "load.h" #include "load.h"
extern Game game;
static void loadStats(cJSON *statsJSON); static void loadStats(cJSON *statsJSON);
static void loadStarSystems(cJSON *starSystemsJSON); static void loadStarSystems(cJSON *starSystemsJSON);
static void loadMissions(cJSON *missionsCJSON); static void loadMissions(cJSON *missionsCJSON);

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void loadGame(void);
#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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include <SDL2/SDL_mixer.h>
#include "../common.h"
#include "../battle/starfield.h"
#include "../system/controls.h"
#include "../system/draw.h"
#include "../system/init.h"
#include "../system/text.h"
#include "../system/widgets.h"
#include "options.h" #include "options.h"
#define SHOW_CONTROLS 1
#define SHOW_MAIN 0
extern App app;
extern Colors colors;
static void changeWindowSize(char *value); static void changeWindowSize(char *value);
static void changeSoundVolume(char *value); static void changeSoundVolume(char *value);
static void changeMusicVolume(char *value); static void changeMusicVolume(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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void updateCustomResolutionOption(void);
void drawOptions(void);
#include "SDL2/SDL_mixer.h" void initOptions(void (*rtn)(void));
#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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../json/cJSON.h"
#include "../system/io.h"
#include "../system/lookup.h"
#include "save.h" #include "save.h"
extern Game game;
static void saveStarSystems(cJSON *gameJSON); static void saveStarSystems(cJSON *gameJSON);
static void saveChallenges(cJSON *gameJSON); static void saveChallenges(cJSON *gameJSON);
static cJSON *getMissionsJSON(StarSystem *starSystem); static cJSON *getMissionsJSON(StarSystem *starSystem);

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void saveGame(void);
#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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,12 +18,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../system/text.h"
#include "../system/util.h"
#include "../system/widgets.h"
#include "stats.h" #include "stats.h"
#define STATS_PER_PAGE 9
extern App app;
extern Colors colors;
extern Game game;
static void prevPage(void); static void prevPage(void);
static void nextPage(void); static void nextPage(void);
static void calculatePercentComplete(void); static void calculatePercentComplete(void);
void updateAccuracyStats(unsigned int *stats);
static char *statDescription[STAT_MAX]; static char *statDescription[STAT_MAX];
static int page; 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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void updateAccuracyStats(unsigned int *stats);
void drawStats(void);
#define STATS_PER_PAGE 9 void initStatsDisplay(void);
void initStats(void);
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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,42 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../battle/battle.h"
#include "../battle/effects.h"
#include "../battle/starfield.h"
#include "../challenges/challengeHome.h"
#include "../galaxy/galacticMap.h"
#include "../galaxy/mission.h"
#include "../game/credits.h"
#include "../game/fighterDatabase.h"
#include "../game/options.h"
#include "../game/stats.h"
#include "../game/trophies.h"
#include "../system/atlas.h"
#include "../system/draw.h"
#include "../system/input.h"
#include "../system/sound.h"
#include "../system/text.h"
#include "../system/textures.h"
#include "../system/transition.h"
#include "../system/widgets.h"
#include "title.h" #include "title.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 logic(void);
static void draw(void); static void draw(void);
static void handleKeyboard(void); static void handleKeyboard(void);
@ -195,7 +229,7 @@ static void draw(void)
blit(pandoranWar, app.winWidth / 2, 110, 1); 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); drawText(app.winWidth - 10, app.winHeight - 25, 14, TA_RIGHT, colors.white, "Version %.2f.%d", VERSION, REVISION);
switch (show) 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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void initTitle(void);
#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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,30 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include <time.h>
#include "../common.h"
#include "../battle/entities.h"
#include "../json/cJSON.h"
#include "../system/atlas.h"
#include "../system/draw.h"
#include "../system/io.h"
#include "../system/lookup.h"
#include "../system/sound.h"
#include "../system/text.h"
#include "../system/util.h"
#include "../system/widgets.h"
#include "trophies.h" #include "trophies.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 prevPage(void);
static void nextPage(void); static void nextPage(void);
static void loadTrophyData(char *filename); static void loadTrophyData(char *filename);
@ -426,7 +448,7 @@ void awardStatsTrophies(void)
void awardCampaignTrophies(void) void awardCampaignTrophies(void)
{ {
char trophyId[MAX_NAME_LENGTH]; char trophyId[MAX_NAME_LENGTH * 2];
char name[MAX_NAME_LENGTH]; char name[MAX_NAME_LENGTH];
int i, len; int i, len;
StarSystem *starSystem; StarSystem *starSystem;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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.
*/ */
void awardCraftTrophy(void);
#include "../common.h" void awardPostMissionTrophies(void);
#include "../json/cJSON.h" void awardChallengeTrophies(void);
void awardCampaignTrophies(void);
#include "time.h" void awardStatsTrophies(void);
Trophy *getTrophy(char *id);
#define TROPHIES_PER_PAGE 4 void drawTrophyAlert(void);
void doTrophyAlerts(void);
extern void awardPandoranCraftTrophy(void); void awardTrophy(char *id);
extern void blit(AtlasImage *atlasImage, int x, int y, int centered); void drawTrophies(void);
extern void blitRotated(AtlasImage *atlasImage, int x, int y, float angle); void initTrophiesDisplay(void);
extern void blitScaled(AtlasImage *atlasImage, int x, int y, int w, int h, int center); void initTrophies(void);
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;

File diff suppressed because it is too large Load Diff

View File

@ -41,7 +41,8 @@ extern "C"
#define cJSON_StringIsConst 512 #define cJSON_StringIsConst 512
/* The cJSON structure: */ /* The cJSON structure: */
typedef struct cJSON { typedef struct cJSON
{
struct cJSON *next, *prev; /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */ struct cJSON *next, *prev; /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */
struct cJSON *child; /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */ struct cJSON *child; /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */
@ -54,7 +55,8 @@ typedef struct cJSON {
char *string; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */ char *string; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */
} cJSON; } cJSON;
typedef struct cJSON_Hooks { typedef struct cJSON_Hooks
{
void *(*malloc_fn)(size_t sz); void *(*malloc_fn)(size_t sz);
void (*free_fn)(void *ptr); void (*free_fn)(void *ptr);
} cJSON_Hooks; } cJSON_Hooks;
@ -62,7 +64,6 @@ typedef struct cJSON_Hooks {
/* Supply malloc, realloc and free functions to cJSON */ /* Supply malloc, realloc and free functions to cJSON */
extern void cJSON_InitHooks(cJSON_Hooks *hooks); 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. */ /* 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); extern cJSON *cJSON_Parse(const char *value);
/* Render a cJSON entity to text for transfer/storage. Free the char* when finished. */ /* 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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,7 +18,34 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include <time.h>
#include "common.h"
#include "game/credits.h"
#include "game/load.h"
#include "game/save.h"
#include "game/title.h"
#include "game/trophies.h"
#include "main.h" #include "main.h"
#include "plat/win32/win32Init.h"
#include "system/controls.h"
#include "system/dev.h"
#include "system/draw.h"
#include "system/init.h"
#include "system/input.h"
#include "system/io.h"
#include "system/lookup.h"
#include "system/modalDialog.h"
#include "test/testMission.h"
App app;
Battle battle;
Colors colors;
Dev dev;
Entity *player;
Entity *self;
Game game;
static void handleMissionArgs(int argc, char *argv[]); static void handleMissionArgs(int argc, char *argv[]);
static void handleLoggingArgs(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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" int main(int argc, char *argv[]);
#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;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include <errno.h>
#include <pwd.h>
#include <sys/stat.h>
#include <unistd.h>
#include "../../common.h"
#include "unixInit.h" #include "unixInit.h"
extern App app;
extern Dev dev;
void createSaveFolder(void) void createSaveFolder(void)
{ {
char *userHome; char *userHome;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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> void createScreenshotFolder(void);
#include <pwd.h> void createSaveFolder(void);
#include <unistd.h>
#include <errno.h>
#include "../../common.h"
extern App app;
extern Dev dev;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include <errno.h>
#include <sys/stat.h>
#include <unistd.h>
#include "../../common.h"
#include "win32Init.h" #include "win32Init.h"
extern App app;
extern Dev dev;
void createSaveFolder(void) void createSaveFolder(void)
{ {
char *userHome; char *userHome;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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> void createScreenshotFolder(void);
#include <unistd.h> void createSaveFolder(void);
#include <errno.h>
#include "../../common.h"
extern App app;
extern Dev dev;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -43,9 +43,9 @@ typedef struct Tuple Tuple;
typedef struct Credit Credit; typedef struct Credit Credit;
typedef struct AtlasImage AtlasImage; typedef struct AtlasImage AtlasImage;
typedef struct Font Font; typedef struct Font Font;
typedef struct Glyph Glyph;
typedef struct { typedef struct
{
int debug; int debug;
int takeScreenshots; int takeScreenshots;
char *screenshotFolder; char *screenshotFolder;
@ -58,12 +58,14 @@ typedef struct {
int fps; int fps;
} Dev; } Dev;
typedef struct { typedef struct
{
float x; float x;
float y; float y;
} PointF; } PointF;
struct Texture { struct Texture
{
char name[MAX_DESCRIPTION_LENGTH]; char name[MAX_DESCRIPTION_LENGTH];
long hash; long hash;
long ttl; long ttl;
@ -71,14 +73,16 @@ struct Texture {
Texture *next; Texture *next;
}; };
struct AtlasImage { struct AtlasImage
{
char filename[MAX_FILENAME_LENGTH]; char filename[MAX_FILENAME_LENGTH];
SDL_Rect rect; SDL_Rect rect;
SDL_Texture *texture; SDL_Texture *texture;
AtlasImage *next; AtlasImage *next;
}; };
typedef struct { typedef struct
{
void (*logic)(void); void (*logic)(void);
void (*draw)(void); void (*draw)(void);
void (*handleClick)(int x, int y, int btn); void (*handleClick)(int x, int y, int btn);
@ -86,18 +90,21 @@ typedef struct {
void (*handleMouseUp)(int x, int y, int btn); void (*handleMouseUp)(int x, int y, int btn);
} Delegate; } Delegate;
typedef struct { typedef struct
{
int type; int type;
char message[MAX_DESCRIPTION_LENGTH]; char message[MAX_DESCRIPTION_LENGTH];
} ModalDialog; } ModalDialog;
struct Lookup { struct Lookup
{
char name[MAX_NAME_LENGTH]; char name[MAX_NAME_LENGTH];
long value; long value;
Lookup *next; Lookup *next;
}; };
struct Weapon { struct Weapon
{
int type; int type;
int ammo; int ammo;
int maxAmmo; int maxAmmo;
@ -105,7 +112,8 @@ struct Weapon {
int y; int y;
}; };
struct Entity { struct Entity
{
int type; int type;
char name[MAX_NAME_LENGTH]; char name[MAX_NAME_LENGTH];
char defName[MAX_NAME_LENGTH]; char defName[MAX_NAME_LENGTH];
@ -167,7 +175,8 @@ struct Entity {
Entity *next; Entity *next;
}; };
struct Bullet { struct Bullet
{
int type; int type;
float x; float x;
float y; float y;
@ -186,7 +195,8 @@ struct Bullet {
Bullet *next; Bullet *next;
}; };
struct Debris { struct Debris
{
float x; float x;
float y; float y;
float dx; float dx;
@ -198,13 +208,15 @@ struct Debris {
Debris *next; Debris *next;
}; };
typedef struct { typedef struct
{
float x; float x;
float y; float y;
float speed; float speed;
} Star; } Star;
struct Pulse { struct Pulse
{
int x; int x;
int y; int y;
float size; float size;
@ -213,7 +225,8 @@ struct Pulse {
Pulse *next; Pulse *next;
}; };
struct Effect { struct Effect
{
int type; int type;
float x; float x;
float y; float y;
@ -230,7 +243,8 @@ struct Effect {
Effect *next; Effect *next;
}; };
struct Location { struct Location
{
int active; int active;
char name[MAX_NAME_LENGTH]; char name[MAX_NAME_LENGTH];
int x; int x;
@ -239,7 +253,8 @@ struct Location {
Location *next; Location *next;
}; };
struct Objective { struct Objective
{
int active; int active;
char id[MAX_DESCRIPTION_LENGTH]; char id[MAX_DESCRIPTION_LENGTH];
char description[MAX_DESCRIPTION_LENGTH]; char description[MAX_DESCRIPTION_LENGTH];
@ -254,14 +269,16 @@ struct Objective {
Objective *next; Objective *next;
}; };
struct Challenge { struct Challenge
{
int type; int type;
int value; int value;
int passed; int passed;
Challenge *next; Challenge *next;
}; };
typedef struct { typedef struct
{
int isChallenge; int isChallenge;
int timeLimit; int timeLimit;
int killLimit; int killLimit;
@ -284,7 +301,8 @@ typedef struct {
Challenge *challenges[MAX_CHALLENGES]; Challenge *challenges[MAX_CHALLENGES];
} ChallengeData; } ChallengeData;
struct Mission { struct Mission
{
char name[MAX_NAME_LENGTH]; char name[MAX_NAME_LENGTH];
char description[MAX_DESCRIPTION_LENGTH]; char description[MAX_DESCRIPTION_LENGTH];
char filename[MAX_DESCRIPTION_LENGTH]; char filename[MAX_DESCRIPTION_LENGTH];
@ -305,7 +323,8 @@ struct Mission {
Mission *next; Mission *next;
}; };
struct StarSystem { struct StarSystem
{
char name[MAX_NAME_LENGTH]; char name[MAX_NAME_LENGTH];
char description[MAX_DESCRIPTION_LENGTH]; char description[MAX_DESCRIPTION_LENGTH];
int side; int side;
@ -321,7 +340,8 @@ struct StarSystem {
StarSystem *next; StarSystem *next;
}; };
struct Quadtree { struct Quadtree
{
int depth; int depth;
int x, y, w, h; int x, y, w, h;
Entity **ents; Entity **ents;
@ -331,7 +351,8 @@ struct Quadtree {
Quadtree *node[4]; Quadtree *node[4];
}; };
struct Spawner { struct Spawner
{
char name[MAX_NAME_LENGTH]; char name[MAX_NAME_LENGTH];
char **types; char **types;
int numTypes; int numTypes;
@ -347,7 +368,8 @@ struct Spawner {
Spawner *next; Spawner *next;
}; };
typedef struct { typedef struct
{
SDL_Point camera; SDL_Point camera;
int numAllies; int numAllies;
int numEnemies; int numEnemies;
@ -398,14 +420,16 @@ typedef struct {
Quadtree quadtree; Quadtree quadtree;
} Battle; } Battle;
struct ScriptRunner { struct ScriptRunner
{
struct cJSON *line; struct cJSON *line;
long delay; long delay;
int waitForMessageBox; int waitForMessageBox;
ScriptRunner *next; ScriptRunner *next;
}; };
struct Trophy { struct Trophy
{
char id[MAX_NAME_LENGTH]; char id[MAX_NAME_LENGTH];
char title[MAX_DESCRIPTION_LENGTH]; char title[MAX_DESCRIPTION_LENGTH];
char description[MAX_DESCRIPTION_LENGTH]; char description[MAX_DESCRIPTION_LENGTH];
@ -420,20 +444,23 @@ struct Trophy {
Trophy *next; Trophy *next;
}; };
typedef struct { typedef struct
{
int friendlyFire; int friendlyFire;
int autoSwitchPlayerTarget; int autoSwitchPlayerTarget;
int missileReTarget; int missileReTarget;
int healthBars; int healthBars;
} Gameplay; } Gameplay;
struct Tuple { struct Tuple
{
char key[MAX_NAME_LENGTH]; char key[MAX_NAME_LENGTH];
int value; int value;
Tuple *next; Tuple *next;
}; };
typedef struct { typedef struct
{
StarSystem starSystemHead; StarSystem starSystemHead;
Mission challengeMissionHead; Mission challengeMissionHead;
Mission *currentMission; Mission *currentMission;
@ -448,7 +475,8 @@ typedef struct {
Tuple fighterStatHead; Tuple fighterStatHead;
} Game; } Game;
struct Widget { struct Widget
{
char name[MAX_NAME_LENGTH]; char name[MAX_NAME_LENGTH];
char group[MAX_NAME_LENGTH]; char group[MAX_NAME_LENGTH];
int type; int type;
@ -467,14 +495,16 @@ struct Widget {
Widget *next; Widget *next;
}; };
struct HudMessage { struct HudMessage
{
char message[MAX_DESCRIPTION_LENGTH]; char message[MAX_DESCRIPTION_LENGTH];
SDL_Color color; SDL_Color color;
int life; int life;
HudMessage *next; HudMessage *next;
}; };
struct MessageBox { struct MessageBox
{
char title[MAX_NAME_LENGTH]; char title[MAX_NAME_LENGTH];
char body[MAX_DESCRIPTION_LENGTH]; char body[MAX_DESCRIPTION_LENGTH];
int time; int time;
@ -483,7 +513,8 @@ struct MessageBox {
MessageBox *next; MessageBox *next;
}; };
typedef struct { typedef struct
{
int x; int x;
int y; int y;
int w; int w;
@ -493,7 +524,8 @@ typedef struct {
int button[MAX_MOUSE_BUTTONS]; int button[MAX_MOUSE_BUTTONS];
} Mouse; } Mouse;
typedef struct { typedef struct
{
char saveDir[MAX_FILENAME_LENGTH]; char saveDir[MAX_FILENAME_LENGTH];
int saveGame; int saveGame;
int winWidth; int winWidth;
@ -523,7 +555,8 @@ typedef struct {
int textWidth; int textWidth;
} App; } App;
typedef struct { typedef struct
{
SDL_Color red; SDL_Color red;
SDL_Color orange; SDL_Color orange;
SDL_Color yellow; SDL_Color yellow;
@ -537,7 +570,8 @@ typedef struct {
SDL_Color darkGrey; SDL_Color darkGrey;
} Colors; } Colors;
struct Credit { struct Credit
{
char *text; char *text;
float y; float y;
int size; int size;
@ -545,34 +579,33 @@ struct Credit {
Credit *next; Credit *next;
}; };
struct Glyph { struct Font
char character[MAX_NAME_LENGTH]; {
SDL_Rect rect;
Glyph *next;
};
struct Font {
char name[MAX_NAME_LENGTH]; char name[MAX_NAME_LENGTH];
SDL_Texture *texture; SDL_Texture *texture;
Glyph glyphHead[NUM_GLYPH_BUCKETS]; SDL_Rect glyphs[MAX_GLYPHS];
Font *next; Font *next;
}; };
struct Bucket { struct Bucket
{
char *key, *value; char *key, *value;
Bucket *next; Bucket *next;
}; };
typedef struct { typedef struct
{
Bucket **bucket; Bucket **bucket;
int *bucketCount; int *bucketCount;
} HashTable; } HashTable;
typedef struct { typedef struct
{
int32_t magicNumber, version, stringCount; int32_t magicNumber, version, stringCount;
int32_t originalOffset, translationOffset; int32_t originalOffset, translationOffset;
} MOHeader; } MOHeader;
typedef struct { typedef struct
{
int32_t length, offset; int32_t length, offset;
} MOEntry; } MOEntry;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,6 +18,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../json/cJSON.h"
#include "../system/io.h"
#include "../system/textures.h"
#include "../system/util.h"
#include "atlas.h" #include "atlas.h"
static void loadAtlasData(void); static void loadAtlasData(void);
@ -40,7 +46,7 @@ void setAtlasColor(int r, int g, int b, int a)
SDL_SetTextureAlphaMod(atlasTexture, a); SDL_SetTextureAlphaMod(atlasTexture, a);
} }
AtlasImage *getAtlasImage(char *filename) AtlasImage *getAtlasImage(const char *filename)
{ {
AtlasImage *a; AtlasImage *a;
unsigned long i; 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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" char **getAtlasFileList(char *dir, int *count);
#include "../json/cJSON.h" AtlasImage *getAtlasImage(const char *filename);
void setAtlasColor(int r, int g, int b, int a);
extern SDL_Texture *getTexture(const char *filename); void initAtlas(void);
extern unsigned long hashcode(const char *str);
extern char *readFile(const char *filename);
extern int stringComparator(const void *a, const void *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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../json/cJSON.h"
#include "../system/io.h"
#include "../system/lookup.h"
#include "../system/text.h"
#include "../system/widgets.h"
#include "controls.h" #include "controls.h"
extern App app;
extern Colors colors;
static void restoreDefaults(void); static void restoreDefaults(void);
static const char *controlName[CONTROL_MAX]; static const char *controlName[CONTROL_MAX];

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void drawControls(void);
#include "../json/cJSON.h" void clearControlConfig(char *name);
void updateControlButton(char *name);
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...); void updateControlKey(char *name);
extern void drawWidgets(char *groupName); void resetAcceptControls(void);
extern char *getLookupName(char *prefix, long num); void clearControl(int type);
extern Widget *getWidget(const char *name, const char *group); int isAcceptControl(void);
extern long lookup(char *name); int isControl(int type);
extern char *readFile(char *filename); void initControlsDisplay(void);
void initControls(void);
extern App app;
extern Colors colors;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../galaxy/mission.h"
#include "dev.h" #include "dev.h"
extern App app;
extern Battle battle;
extern Dev dev;
void doDevKeys(void) void doDevKeys(void)
{ {
if (dev.debug) if (dev.debug)

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License 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" void doDevKeys(void);
extern void completeMission(void);
extern App app;
extern Battle battle;
extern Dev dev;

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 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,8 +18,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include "../common.h"
#include "../system/input.h"
#include "../system/text.h"
#include "../system/util.h"
#include "draw.h" #include "draw.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); static void initColor(SDL_Color *c, int r, int g, int b);
static PointF backgroundPoint[4]; static PointF backgroundPoint[4];
@ -163,14 +173,22 @@ void drawCircle(int cx, int cy, int radius, int r, int g, int b, int a)
while (x >= y) while (x >= y)
{ {
p[0].x = x + cx; p[0].y = y + cy; p[0].x = x + cx;
p[1].x = y + cx; p[1].y = x + cy; p[0].y = y + cy;
p[2].x = -x + cx; p[2].y = y + cy; p[1].x = y + cx;
p[3].x = -y + cx; p[3].y = x + cy; p[1].y = x + cy;
p[4].x = -x + cx; p[4].y = -y + cy; p[2].x = -x + cx;
p[5].x = -y + cx; p[5].y = -x + cy; p[2].y = y + cy;
p[6].x = x + cx; p[6].y = -y + cy; p[3].x = -y + cx;
p[7].x = y + cx; p[7].y = -x + cy; p[3].y = x + cy;
p[4].x = -x + cx;
p[4].y = -y + cy;
p[5].x = -y + cx;
p[5].y = -x + cy;
p[6].x = x + cx;
p[6].y = -y + cy;
p[7].x = y + cx;
p[7].y = -x + cy;
SDL_RenderDrawPoints(app.renderer, p, 8); SDL_RenderDrawPoints(app.renderer, p, 8);
y++; y++;

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