From 36c1d9cfe309f22a29e58203219d480f4105d43e Mon Sep 17 00:00:00 2001 From: Steve Date: Fri, 16 Mar 2018 08:30:37 +0000 Subject: [PATCH] Code tidy. --- src/game/credits.h | 6 +++--- src/game/ending.c | 2 ++ src/world/objectives.h | 1 + tools/tidyHeaders.sh | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/game/credits.h b/src/game/credits.h index 048140d..276f8fc 100644 --- a/src/game/credits.h +++ b/src/game/credits.h @@ -22,20 +22,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define CREDIT_LINE_LIMIT 500 +extern void blitRect(SDL_Texture *texture, int x, int y, SDL_Rect *srcRect, int center); extern void blitRectScaled(SDL_Texture *texture, int x, int y, int w, int h, SDL_Rect *srcRect, int center); extern void drawRect(int x, int y, int w, int h, int r, int g, int b, int a); -extern void blitRect(SDL_Texture *texture, int x, int y, SDL_Rect *srcRect, int center); extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...); extern void endSectionTransition(void); extern Atlas *getImageFromAtlas(char *filename); extern Texture *getTexture(const char *filename); extern int getWrappedTextHeight(const char *text, int size); extern void limitTextWidth(int width); +extern void loadMusic(char *filename); +extern void playMusic(int loop); extern char *readFile(const char *filename); extern void startSectionTransition(void); extern void stopMusic(void); -extern void loadMusic(char *filename); -extern void playMusic(int loop); extern App app; extern Colors colors; diff --git a/src/game/ending.c b/src/game/ending.c index 0c81de3..c10e359 100644 --- a/src/game/ending.c +++ b/src/game/ending.c @@ -108,4 +108,6 @@ static void loadEndingText(void) line = strtok(NULL, "\n"); } + + free(text); } diff --git a/src/world/objectives.h b/src/world/objectives.h index 9beef1b..6228d00 100644 --- a/src/world/objectives.h +++ b/src/world/objectives.h @@ -26,3 +26,4 @@ extern void setGameplayMessage(int type, char *format, ...); extern Game game; extern World world; + diff --git a/tools/tidyHeaders.sh b/tools/tidyHeaders.sh index d9eced2..cc88a52 100755 --- a/tools/tidyHeaders.sh +++ b/tools/tidyHeaders.sh @@ -230,7 +230,7 @@ function recurseDir($dir) { recurseDir("$dir/$file"); } - else if (strstr($file, ".h") !== FALSE && strstr($file, "main.h") === FALSE) + else if (strstr($file, ".h") !== FALSE && strstr($file, "main.h") === FALSE && && strstr($file, "savepng") === FALSE) { cleanHeader("$dir/$file"); }