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
.DS_Store
/.errors
tools

View File

@ -4,7 +4,7 @@
![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
Email: stephenjsweeney@battleforthesolarsystem.com

View File

@ -99,7 +99,7 @@
"number" : 12,
"scatter" : 5000,
"aiFlags" : "+AIF_UNLIMITED_RANGE",
"flags" : "+EF_AI_LEADER"
"flags" : "+EF_AI_LEADER+EF_MUST_DISABLE"
},
{
"types" : "Sphinx;Thunderhead",
@ -158,7 +158,9 @@
"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 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 += -ansi -pedantic
CXXFLAGS += -g -lefence
ifneq ("$(wildcard .errors)","")
CXXFLAGS += -Wall -Wempty-body -Werror -Wstrict-prototypes -Werror=maybe-uninitialized -Warray-bounds
endif
LDFLAGS += `sdl2-config --libs` -lSDL2_mixer -lSDL2_image -lSDL2_ttf -lm

View File

@ -2,7 +2,7 @@
<html>
<head>
<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;}
h4 {background-color:#000; padding:0.25em; color:#fff; margin-top:3em; border: 1px solid #5ad;}
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
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"
#define AI_EVADE 0
#define AI_FALLBACK 1
#define AI_HUNT 2
#define TURN_SPEED 4
#define TURN_THRESHOLD 2
extern Battle battle;
extern Colors colors;
extern Dev dev;
extern Entity *player;
extern Entity *self;
static void faceTarget(Entity *e);
static int isInFOV(Entity *e, int fov);
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
modify it under the terms of the GNU General Public License
@ -18,29 +18,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#define AI_EVADE 0
#define AI_FALLBACK 1
#define AI_HUNT 2
#define TURN_SPEED 4
#define TURN_THRESHOLD 2
extern void addHudMessage(SDL_Color c, char *format, ...);
extern void applyFighterBrakes(void);
extern void applyFighterThrust(void);
extern void fireGuns(Entity *owner);
extern void fireMissile(Entity *owner);
extern void fireRocket(Entity *owner);
extern Entity **getAllEntsInRadius(int x, int y, int radius, Entity *ignore);
extern float getAngle(int x1, int y1, int x2, int y2);
extern int getDistance(int x1, int y1, int x2, int y2);
extern float mod(float n, float x);
extern void runScriptFunction(char *format, ...);
extern Entity *spawnMine(int type);
extern Battle battle;
extern Colors colors;
extern Dev dev;
extern Entity *player;
extern Entity *self;
void checkZackariaSuspicionLevel(void);
void checkSuspicionLevel(void);
void doAI(void);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,13 +18,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"
#define SHOW_BATTLE 0
#define SHOW_MENU 1
#define SHOW_OBJECTIVES 2
#define SHOW_OPTIONS 3
extern App app;
extern Battle battle;
extern Dev dev;
extern Entity *player;
extern Game game;
static void logic(void);
static void draw(void);
static void handleKeyboard(void);
static void postBattle(void);
void destroyBattle(void);
static void doBattle(void);
static void optQuitBattle(void);
static void quitBattle(void);

View File

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

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,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"
#define INITIAL_BULLET_DRAW_CAPACITY 32
#define MISSILE_LIFE (FPS * 30)
#define TURN_SPEED 2
#define TURN_THRESHOLD 3
extern App app;
extern Battle battle;
extern Entity *player;
static void huntTarget(Bullet *b);
static void checkCollisions(Bullet *b);
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)
{

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,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"
#define INITIAL_DEBRIS_DRAW_CAPACITY 32
#define MAX_DEBRIS_TEXTURES 6
extern Battle battle;
static void changeCourse(Debris *d);
static void resizeDrawList(void);

View File

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

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,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"
#define INITIAL_EFFECT_DRAW_CAPACITY 128
extern App app;
extern Battle battle;
extern Entity *self;
static void setRandomFlameHue(Effect *e);
static void setRandomShieldHue(Effect *e);
static void resizeDrawList(void);

View File

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

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,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"
#define DISABLED_GLOW_MAX 255
#define DISABLED_GLOW_MIN 128
#define DISABLED_GLOW_SPEED 3
extern App app;
extern Battle battle;
extern Dev dev;
extern Entity *player;
extern Entity *self;
static void drawEntity(Entity *e);
static void doEntity(void);
static void alignComponents(void);
@ -393,7 +414,9 @@ void drawEntities(void)
candidates = getAllEntsWithin(battle.camera.x, battle.camera.y, app.winWidth, app.winHeight, NULL);
/* 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);

View File

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

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,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"
extern Battle battle;
extern Colors colors;
extern Entity *player;
extern Entity *self;
extern Game game;
static void separate(void);
static void die(void);
static void immediateDie(void);
@ -172,7 +197,6 @@ static void randomizeDartGuns(Entity *dart)
dart->guns[2].y = -10;
break;
/* Plasma / Laser cannons */
case 3:
dart->guns[0].type = BT_PLASMA;

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,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"
extern Battle battle;
extern Colors colors;
extern Entity *player;
extern Entity *self;
static void action(void);
static Entity *getItemDef(char *name);

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,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"
extern Battle battle;
extern Entity *player;
void doLocations(void)
{
Location *l, *prev;
@ -131,7 +140,6 @@ void loadLocations(cJSON *node)
l->x += (SCREEN_WIDTH / 2);
l->y += (SCREEN_HEIGHT / 2);
node = node->next;
}
}

View File

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

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,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"
#define MSG_BOX_TEXT_WIDTH 600
extern App app;
extern Battle battle;
extern Colors colors;
extern Entity *player;
static void calculateMessageBoxHeight(MessageBox *msg);
static void nextMessage(void);

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,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"
extern Battle battle;
extern Colors colors;
static int fireObjectivesComplete;
void doObjectives(void)
@ -238,7 +250,6 @@ void completeConditions(void)
}
}
void failIncompleteObjectives(void)
{
Objective *o;

View File

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

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,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"
#define MAX_SELECTABLE_PLAYERS 8
#define MAX_SELECTABLE_TARGETS 8
extern App app;
extern Battle battle;
extern Colors colors;
extern Dev dev;
extern Entity *player;
extern Entity *self;
extern Game game;
static void selectTarget(void);
static void switchGuns(void);
static void cycleRadarZoom(void);
@ -512,8 +537,7 @@ static void selectNewPlayer(int dir)
selectedPlayerIndex = mod(selectedPlayerIndex, MAX_SELECTABLE_PLAYERS);
player = availablePlayerUnits[selectedPlayerIndex];
}
while (player == NULL);
} while (player == NULL);
battle.camera.x = player->x - (app.winWidth / 2);
battle.camera.y = player->y - (app.winHeight / 2);
@ -572,8 +596,7 @@ static void switchGuns(void)
do
{
i = (i + 1) % BT_MAX;
}
while (!availableGuns[i]);
} while (!availableGuns[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
modify it under the terms of the GNU General Public License
@ -18,39 +18,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../common.h"
#include "../json/cJSON.h"
#define MAX_SELECTABLE_PLAYERS 8
#define MAX_SELECTABLE_TARGETS 8
extern void addECMEffect(Entity *ent);
extern void addHudMessage(SDL_Color c, char *format, ...);
extern void applyFighterBrakes(void);
extern void applyFighterThrust(void);
extern void awardTrophy(char *id);
extern void clearControl(int type);
extern int collision(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2);
extern void failMission(void);
extern void fireGuns(Entity *owner);
extern void fireMissile(Entity *owner);
extern void fireRocket(Entity *owner);
extern long flagsToLong(char *flags, int *add);
extern float getAngle(int x1, int y1, int x2, int y2);
extern int getDistance(int x1, int y1, int x2, int y2);
extern int isAcceptControl(void);
extern int isControl(int type);
extern long lookup(char *name);
extern float mod(float n, float x);
extern void playSound(int id);
extern void resetAcceptControls(void);
extern Entity *spawnFighter(char *name, int x, int y, int side);
extern void updateCondition(char *name, int type);
extern App app;
extern Battle battle;
extern Colors colors;
extern Dev dev;
extern Entity *player;
extern Entity *self;
extern Game game;
void loadPlayer(struct cJSON *node);
int playerHasGun(int type);
void setInitialPlayerAngle(void);
void doPlayerSelect(void);
void doPlayer(void);
void initPlayer(void);

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,10 +18,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"
extern Battle battle;
extern Colors colors;
static void executeNextLine(ScriptRunner *runner);
void destroyScript(void);
static cJSON *scriptJSON, *rootJSON;
static ScriptRunner head;

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,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"
extern App app;
static Star stars[MAX_STARS];
void initStars(void)

View File

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

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,12 +18,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"
extern Battle battle;
extern Colors colors;
extern Entity *player;
extern Entity *self;
extern Game game;
static void think(void);
static int teamMatesClose(void);
static int isCurrentObjective(void);
void activateNextWaypoint(void);
static int waypointId;
static int currentWaypointId;

View File

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

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,13 +18,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"
#define CHALLENGES_PER_PAGE 14
#define SHOW_CHALLENGES 0
#define SHOW_FIGHTER_DB 5
#define SHOW_MENU 1
#define SHOW_OPTIONS 2
#define SHOW_STATS 3
#define SHOW_TROPHIES 4
extern App app;
extern Battle battle;
extern Colors colors;
extern Dev dev;
extern Game game;
static void logic(void);
static void draw(void);
static void handleKeyboard(void);
static void drawChallenges(void);
static void doChallenges(void);
static void doChallengeList(void);
static void startChallengeMission(void);
static void drawMenu(void);
static void resume(void);
@ -209,7 +244,7 @@ static void logic(void)
switch (show)
{
case SHOW_CHALLENGES:
doChallenges();
doChallengeList();
break;
case SHOW_MENU:
@ -232,7 +267,7 @@ static void logic(void)
app.doTrophyAlerts = 1;
}
static void doChallenges(void)
static void doChallengeList(void)
{
Mission *c;
int i, startIndex, end;

View File

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

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,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"
extern Battle battle;
extern Dev dev;
extern Entity *player;
extern Game game;
static void updateTimeChallenge(Challenge *c);
static void updateSurvivalChallenge(Challenge *c);
static void updateAccuracyChallenge(Challenge *c);
@ -35,7 +51,6 @@ static void completeChallenge(void);
static void failChallenge(void);
static int updateChallenges(void);
static char *getFormattedChallengeDescription(const char *format, ...);
char *getChallengeDescription(Challenge *c);
static int challengeFinished(void);
static int alreadyPassed(void);
static void printStats(void);

View File

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

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -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 "SDL2/SDL.h"
#include "defs.h"
#include "math.h"
#include "SDL2/SDL.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "structs.h"
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
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 MAX(a, b) (((a) > (b)) ? (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_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_ATLAS_BUCKETS 64
#define NUM_GLYPH_BUCKETS 128
#define MAX_GLYPHS 400
#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
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"
#define MAX_LISTED_MISSIONS 9
#define SHOW_FIGHTER_DB 6
#define SHOW_GALAXY 0
#define SHOW_MENU 2
#define SHOW_OPTIONS 3
#define SHOW_STAR_SYSTEM 1
#define SHOW_STATS 4
#define SHOW_TROPHIES 5
extern App app;
extern Colors colors;
extern Game game;
static void logic(void);
static void draw(void);
static void handleKeyboard(void);
@ -30,7 +64,6 @@ static void selectStarSystem(void);
static void drawGalaxy(void);
static void centerOnSelectedStarSystem(void);
static void doStarSystems(void);
void destroyGalacticMap(void);
static void drawPulses(void);
static void drawInfoBars(void);
static void doPulses(void);

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,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"
extern Game game;
static void loadMissions(StarSystem *starSystem);
static StarSystem *loadStarSystem(cJSON *starSystemJSON);

View File

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

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,13 +18,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"
#define CREDIT_LINE_LIMIT (UI_WIDTH - 300)
extern App app;
extern Colors colors;
static void loadCredits(void);
static void logic(void);
static void draw(void);
static void handleKeyboard(void);
void destroyCredits(void);
static SDL_Texture *background;
static AtlasImage *earthTexture;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,12 +18,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"
#define STATS_PER_PAGE 9
extern App app;
extern Colors colors;
extern Game game;
static void prevPage(void);
static void nextPage(void);
static void calculatePercentComplete(void);
void updateAccuracyStats(unsigned int *stats);
static char *statDescription[STAT_MAX];
static int page;

View File

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

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,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"
#define NUM_FIGHTERS 12
#define SHOW_FIGHTER_DB 4
#define SHOW_OPTIONS 2
#define SHOW_STATS 1
#define SHOW_TITLE 0
#define SHOW_TROPHIES 3
extern App app;
extern Battle battle;
extern Colors colors;
extern Entity *self;
extern Game game;
static void logic(void);
static void draw(void);
static void handleKeyboard(void);
@ -195,7 +229,7 @@ static void draw(void)
blit(pandoranWar, app.winWidth / 2, 110, 1);
drawText(10, app.winHeight - 25, 14, TA_LEFT, colors.white, "Copyright Parallel Realities, 2015-2019");
drawText(10, app.winHeight - 25, 14, TA_LEFT, colors.white, "Copyright,2022 Parallel Realities, 2015-2019,2022");
drawText(app.winWidth - 10, app.winHeight - 25, 14, TA_RIGHT, colors.white, "Version %.2f.%d", VERSION, REVISION);
switch (show)

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -41,7 +41,8 @@ extern "C"
#define cJSON_StringIsConst 512
/* 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 *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. */
} cJSON;
typedef struct cJSON_Hooks {
typedef struct cJSON_Hooks
{
void *(*malloc_fn)(size_t sz);
void (*free_fn)(void *ptr);
} cJSON_Hooks;
@ -62,7 +64,6 @@ typedef struct cJSON_Hooks {
/* Supply malloc, realloc and free functions to cJSON */
extern void cJSON_InitHooks(cJSON_Hooks *hooks);
/* Supply a block of JSON, and this returns a cJSON object you can interrogate. Call cJSON_Delete when finished. */
extern cJSON *cJSON_Parse(const char *value);
/* Render a cJSON entity to text for transfer/storage. Free the char* when finished. */

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,7 +18,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 "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 handleLoggingArgs(int argc, char *argv[]);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2015-2019 Parallel Realities
Copyright (C) 2015-2019,2022 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -18,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"
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 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)
{
p[0].x = x + cx; p[0].y = y + cy;
p[1].x = y + cx; p[1].y = x + cy;
p[2].x = -x + cx; p[2].y = y + cy;
p[3].x = -y + cx; 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;
p[0].x = x + cx;
p[0].y = y + cy;
p[1].x = y + cx;
p[1].y = x + cy;
p[2].x = -x + cx;
p[2].y = y + cy;
p[3].x = -y + cx;
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);
y++;

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