From 9ecd29a7c3ed9b51062f30e9c3933a1ced94a18a Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Mon, 26 Nov 2018 01:25:56 +0100 Subject: [PATCH] include allegro_color and platform specific headers already in libsuperderpy.h, clean up --- src/CMakeLists.txt | 12 ++++++------ src/character.c | 6 ------ src/character.h | 2 -- src/config.c | 3 +-- src/emscripten-audio-stream.c | 1 - src/emscripten-audio-stream.h | 2 +- src/gamestate.c | 2 -- src/gamestate.h | 1 - src/internal.c | 4 ---- src/internal.h | 2 -- src/libsuperderpy.c | 4 ---- src/libsuperderpy.h | 26 ++++++++++++++++++++------ src/mainloop.c | 1 - src/maths.c | 7 ------- src/maths.h | 2 -- src/shader.c | 4 +--- src/timeline.c | 4 +--- src/tween.c | 4 +--- src/utils.c | 7 ------- src/utils.h | 2 -- 20 files changed, 31 insertions(+), 65 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4c18104..7850e6d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,15 +1,15 @@ SET(SRC_LIST - utils.c - maths.c + character.c config.c - timeline.c gamestate.c + internal.c libsuperderpy.c mainloop.c - character.c - internal.c - tween.c + maths.c shader.c + timeline.c + tween.c + utils.c ) if (EMSCRIPTEN) list(APPEND SRC_LIST emscripten-audio-stream.c) diff --git a/src/character.c b/src/character.c index 7233328..d958ba9 100644 --- a/src/character.c +++ b/src/character.c @@ -19,12 +19,6 @@ */ #include "internal.h" -#include "utils.h" -#include -#include -#include -#include -#include SYMBOL_EXPORT void SelectSpritesheet(struct Game* game, struct Character* character, char* name) { struct Spritesheet* tmp = character->spritesheets; diff --git a/src/character.h b/src/character.h index b38f4a0..762dd16 100644 --- a/src/character.h +++ b/src/character.h @@ -22,8 +22,6 @@ #define LIBSUPERDERPY_CHARACTER_H #include "libsuperderpy.h" -#include -#include struct SpritesheetFrame { char* file; diff --git a/src/config.c b/src/config.c index 456ceee..3e165cb 100644 --- a/src/config.c +++ b/src/config.c @@ -17,9 +17,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "config.h" + #include "internal.h" -#include SYMBOL_EXPORT void InitConfig(struct Game* game) { const ALLEGRO_FILE_INTERFACE* iface = al_get_new_file_interface(); diff --git a/src/emscripten-audio-stream.c b/src/emscripten-audio-stream.c index 99809d0..acff20c 100644 --- a/src/emscripten-audio-stream.c +++ b/src/emscripten-audio-stream.c @@ -19,7 +19,6 @@ */ #include "internal.h" -#include "emscripten.h" #undef al_create_audio_stream #undef al_load_audio_stream diff --git a/src/emscripten-audio-stream.h b/src/emscripten-audio-stream.h index e93b8f7..3611d05 100644 --- a/src/emscripten-audio-stream.h +++ b/src/emscripten-audio-stream.h @@ -23,7 +23,7 @@ #ifndef LIBSUPERDERPY_EMSCRIPTEN_H #define LIBSUPERDERPY_EMSCRIPTEN_H -#include +#include "libsuperderpy.h" typedef struct { ALLEGRO_SAMPLE* sample; diff --git a/src/gamestate.c b/src/gamestate.c index 87e10c0..f976ac7 100644 --- a/src/gamestate.c +++ b/src/gamestate.c @@ -18,9 +18,7 @@ * along with this program. If not, see . */ -#include "gamestate.h" #include "internal.h" -#include "utils.h" static struct Gamestate* AddNewGamestate(struct Game* game, const char* name) { struct Gamestate* tmp = game->_priv.gamestates; diff --git a/src/gamestate.h b/src/gamestate.h index 065e824..d1452a1 100644 --- a/src/gamestate.h +++ b/src/gamestate.h @@ -21,7 +21,6 @@ #define LIBSUPERDERPY_GAMESTATE_H #include "libsuperderpy.h" -#include struct Gamestate_API { void (*Gamestate_Draw)(struct Game* game, void* data); diff --git a/src/internal.c b/src/internal.c index 494b7fb..91a52db 100644 --- a/src/internal.c +++ b/src/internal.c @@ -19,11 +19,7 @@ #include "internal.h" #include "3rdparty/valgrind.h" -#include "libsuperderpy.h" -#include #include -#include -#include SYMBOL_INTERNAL void SimpleCompositor(struct Game* game, struct Gamestate* gamestates) { struct Gamestate* tmp = gamestates; diff --git a/src/internal.h b/src/internal.h index 4bb6785..5ca1570 100644 --- a/src/internal.h +++ b/src/internal.h @@ -19,8 +19,6 @@ #define LIBSUPERDERPY_INTERNAL_H #include "libsuperderpy.h" -#include -#include #if defined(_WIN32) || defined(__CYGWIN__) #define SYMBOL_INTERNAL diff --git a/src/libsuperderpy.c b/src/libsuperderpy.c index 80976ba..9d6ff2c 100644 --- a/src/libsuperderpy.c +++ b/src/libsuperderpy.c @@ -25,14 +25,10 @@ #define ALLEGRO_UNSTABLE #endif -#include "libsuperderpy.h" #include "internal.h" #include #include #include -#include -#include -#include #include #ifdef ALLEGRO_MACOSX #include diff --git a/src/libsuperderpy.h b/src/libsuperderpy.h index 2e49f43..fa367a1 100644 --- a/src/libsuperderpy.h +++ b/src/libsuperderpy.h @@ -32,20 +32,33 @@ struct GamestateResources; #include #include #include +#include #include #include #include #include #include #include -#ifdef ALLEGRO_ANDROID +#include +#include +#include +#include + +#if defined(ALLEGRO_ANDROID) #define ALLEGRO_UNSTABLE #include -#endif -#ifdef __EMSCRIPTEN__ -#include "emscripten-audio-stream.h" +#elif defined(ALLEGRO_WINDOWS) +#include +#elif defined(ALLEGRO_WITH_XWINDOWS) +#include +#elif defined(ALLEGRO_MACOS) +#include +#elif defined(ALLEGRO_IPHONE) +#include +#elif defined(__EMSCRIPTEN__) #include #endif + #include "character.h" #include "config.h" #include "gamestate.h" @@ -55,8 +68,9 @@ struct GamestateResources; #include "timeline.h" #include "tween.h" #include "utils.h" -#include -#include +#ifdef __EMSCRIPTEN__ +#include "emscripten-audio-stream.h" +#endif #define LIBSUPERDERPY_BITMAP_HASHMAP_BUCKETS 16 diff --git a/src/mainloop.c b/src/mainloop.c index e3ba307..ae75973 100644 --- a/src/mainloop.c +++ b/src/mainloop.c @@ -21,7 +21,6 @@ */ #include "internal.h" -#include "libsuperderpy.h" static inline void HandleEvent(struct Game* game, ALLEGRO_EVENT* ev) { switch (ev->type) { diff --git a/src/maths.c b/src/maths.c index f3de624..ab51adc 100644 --- a/src/maths.c +++ b/src/maths.c @@ -18,14 +18,7 @@ * along with this program. If not, see . */ -#include "maths.h" -#include "config.h" #include "internal.h" -#include -#include -#include -#include -#include SYMBOL_EXPORT double DotProduct(const double v[], const double u[], int n) { float result = 0.0; diff --git a/src/maths.h b/src/maths.h index afafa5e..8de4405 100644 --- a/src/maths.h +++ b/src/maths.h @@ -22,8 +22,6 @@ #define LIBSUPERDERPY_MATHS_H #include "libsuperderpy.h" -#include -#include double DotProduct(const double v[], const double u[], int n); double VectorLength(double x, double y, double z); diff --git a/src/shader.c b/src/shader.c index 742cca9..cf2b6cc 100644 --- a/src/shader.c +++ b/src/shader.c @@ -17,10 +17,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "shader.h" + #include "internal.h" -#include -#include static ALLEGRO_USTR* GetShaderSource(struct Game* game, const char* filename) { ALLEGRO_FILE* fp = al_fopen(filename, "r"); diff --git a/src/timeline.c b/src/timeline.c index 0ac1867..bb2d273 100644 --- a/src/timeline.c +++ b/src/timeline.c @@ -17,10 +17,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "timeline.h" + #include "internal.h" -#include "utils.h" -#include static void DestroyArgs(struct TM_Arguments* args) { struct TM_Arguments* pom; diff --git a/src/tween.c b/src/tween.c index 1a1725d..88f954e 100644 --- a/src/tween.c +++ b/src/tween.c @@ -17,10 +17,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "tween.h" + #include "internal.h" -#include -#include // Easing formulas (c) 2011, Auerhaus Development, LLC // Originally licensed under WTFPL 2.0 diff --git a/src/utils.c b/src/utils.c index ef93a38..646d9d1 100644 --- a/src/utils.c +++ b/src/utils.c @@ -18,14 +18,7 @@ * along with this program. If not, see . */ -#include "utils.h" -#include "config.h" #include "internal.h" -#include -#include -#include -#include -#include #ifdef ALLEGRO_ANDROID #include #endif diff --git a/src/utils.h b/src/utils.h index 1e399bc..497c836 100644 --- a/src/utils.h +++ b/src/utils.h @@ -22,8 +22,6 @@ #define LIBSUPERDERPY_UTILS_H #include "libsuperderpy.h" -#include -#include #ifdef ALLEGRO_WINDOWS #define LIBRARY_EXTENSION ".dll"