include allegro_color and platform specific headers already in libsuperderpy.h, clean up

This commit is contained in:
Sebastian Krzyszkowiak 2018-11-26 01:25:56 +01:00
parent de46cff0a4
commit 9ecd29a7c3
No known key found for this signature in database
GPG key ID: E8F235CF3BDBC3FF
20 changed files with 31 additions and 65 deletions

View file

@ -1,15 +1,15 @@
SET(SRC_LIST SET(SRC_LIST
utils.c character.c
maths.c
config.c config.c
timeline.c
gamestate.c gamestate.c
internal.c
libsuperderpy.c libsuperderpy.c
mainloop.c mainloop.c
character.c maths.c
internal.c
tween.c
shader.c shader.c
timeline.c
tween.c
utils.c
) )
if (EMSCRIPTEN) if (EMSCRIPTEN)
list(APPEND SRC_LIST emscripten-audio-stream.c) list(APPEND SRC_LIST emscripten-audio-stream.c)

View file

@ -19,12 +19,6 @@
*/ */
#include "internal.h" #include "internal.h"
#include "utils.h"
#include <allegro5/allegro_primitives.h>
#include <allegro5/allegro_ttf.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
SYMBOL_EXPORT void SelectSpritesheet(struct Game* game, struct Character* character, char* name) { SYMBOL_EXPORT void SelectSpritesheet(struct Game* game, struct Character* character, char* name) {
struct Spritesheet* tmp = character->spritesheets; struct Spritesheet* tmp = character->spritesheets;

View file

@ -22,8 +22,6 @@
#define LIBSUPERDERPY_CHARACTER_H #define LIBSUPERDERPY_CHARACTER_H
#include "libsuperderpy.h" #include "libsuperderpy.h"
#include <allegro5/allegro.h>
#include <allegro5/allegro_font.h>
struct SpritesheetFrame { struct SpritesheetFrame {
char* file; char* file;

View file

@ -17,9 +17,8 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "config.h"
#include "internal.h" #include "internal.h"
#include <allegro5/allegro.h>
SYMBOL_EXPORT void InitConfig(struct Game* game) { SYMBOL_EXPORT void InitConfig(struct Game* game) {
const ALLEGRO_FILE_INTERFACE* iface = al_get_new_file_interface(); const ALLEGRO_FILE_INTERFACE* iface = al_get_new_file_interface();

View file

@ -19,7 +19,6 @@
*/ */
#include "internal.h" #include "internal.h"
#include "emscripten.h"
#undef al_create_audio_stream #undef al_create_audio_stream
#undef al_load_audio_stream #undef al_load_audio_stream

View file

@ -23,7 +23,7 @@
#ifndef LIBSUPERDERPY_EMSCRIPTEN_H #ifndef LIBSUPERDERPY_EMSCRIPTEN_H
#define LIBSUPERDERPY_EMSCRIPTEN_H #define LIBSUPERDERPY_EMSCRIPTEN_H
#include <allegro5/allegro_audio.h> #include "libsuperderpy.h"
typedef struct { typedef struct {
ALLEGRO_SAMPLE* sample; ALLEGRO_SAMPLE* sample;

View file

@ -18,9 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "gamestate.h"
#include "internal.h" #include "internal.h"
#include "utils.h"
static struct Gamestate* AddNewGamestate(struct Game* game, const char* name) { static struct Gamestate* AddNewGamestate(struct Game* game, const char* name) {
struct Gamestate* tmp = game->_priv.gamestates; struct Gamestate* tmp = game->_priv.gamestates;

View file

@ -21,7 +21,6 @@
#define LIBSUPERDERPY_GAMESTATE_H #define LIBSUPERDERPY_GAMESTATE_H
#include "libsuperderpy.h" #include "libsuperderpy.h"
#include <allegro5/allegro.h>
struct Gamestate_API { struct Gamestate_API {
void (*Gamestate_Draw)(struct Game* game, void* data); void (*Gamestate_Draw)(struct Game* game, void* data);

View file

@ -19,11 +19,7 @@
#include "internal.h" #include "internal.h"
#include "3rdparty/valgrind.h" #include "3rdparty/valgrind.h"
#include "libsuperderpy.h"
#include <allegro5/allegro_ttf.h>
#include <dlfcn.h> #include <dlfcn.h>
#include <math.h>
#include <stdio.h>
SYMBOL_INTERNAL void SimpleCompositor(struct Game* game, struct Gamestate* gamestates) { SYMBOL_INTERNAL void SimpleCompositor(struct Game* game, struct Gamestate* gamestates) {
struct Gamestate* tmp = gamestates; struct Gamestate* tmp = gamestates;

View file

@ -19,8 +19,6 @@
#define LIBSUPERDERPY_INTERNAL_H #define LIBSUPERDERPY_INTERNAL_H
#include "libsuperderpy.h" #include "libsuperderpy.h"
#include <allegro5/allegro.h>
#include <allegro5/allegro_font.h>
#if defined(_WIN32) || defined(__CYGWIN__) #if defined(_WIN32) || defined(__CYGWIN__)
#define SYMBOL_INTERNAL #define SYMBOL_INTERNAL

View file

@ -25,14 +25,10 @@
#define ALLEGRO_UNSTABLE #define ALLEGRO_UNSTABLE
#endif #endif
#include "libsuperderpy.h"
#include "internal.h" #include "internal.h"
#include <dlfcn.h> #include <dlfcn.h>
#include <libgen.h> #include <libgen.h>
#include <locale.h> #include <locale.h>
#include <math.h>
#include <stdio.h>
#include <sys/param.h>
#include <unistd.h> #include <unistd.h>
#ifdef ALLEGRO_MACOSX #ifdef ALLEGRO_MACOSX
#include <mach-o/dyld.h> #include <mach-o/dyld.h>

View file

@ -32,20 +32,33 @@ struct GamestateResources;
#include <allegro5/allegro.h> #include <allegro5/allegro.h>
#include <allegro5/allegro_acodec.h> #include <allegro5/allegro_acodec.h>
#include <allegro5/allegro_audio.h> #include <allegro5/allegro_audio.h>
#include <allegro5/allegro_color.h>
#include <allegro5/allegro_font.h> #include <allegro5/allegro_font.h>
#include <allegro5/allegro_image.h> #include <allegro5/allegro_image.h>
#include <allegro5/allegro_opengl.h> #include <allegro5/allegro_opengl.h>
#include <allegro5/allegro_primitives.h> #include <allegro5/allegro_primitives.h>
#include <allegro5/allegro_ttf.h> #include <allegro5/allegro_ttf.h>
#include <allegro5/allegro_video.h> #include <allegro5/allegro_video.h>
#ifdef ALLEGRO_ANDROID #include <math.h>
#include <stdio.h>
#include <string.h>
#include <sys/param.h>
#if defined(ALLEGRO_ANDROID)
#define ALLEGRO_UNSTABLE #define ALLEGRO_UNSTABLE
#include <allegro5/allegro_android.h> #include <allegro5/allegro_android.h>
#endif #elif defined(ALLEGRO_WINDOWS)
#ifdef __EMSCRIPTEN__ #include <allegro5/allegro_windows.h>
#include "emscripten-audio-stream.h" #elif defined(ALLEGRO_WITH_XWINDOWS)
#include <allegro5/allegro_x.h>
#elif defined(ALLEGRO_MACOS)
#include <allegro5/allegro_osx.h>
#elif defined(ALLEGRO_IPHONE)
#include <allegro5/allegro_iphone.h>
#elif defined(__EMSCRIPTEN__)
#include <emscripten.h> #include <emscripten.h>
#endif #endif
#include "character.h" #include "character.h"
#include "config.h" #include "config.h"
#include "gamestate.h" #include "gamestate.h"
@ -55,8 +68,9 @@ struct GamestateResources;
#include "timeline.h" #include "timeline.h"
#include "tween.h" #include "tween.h"
#include "utils.h" #include "utils.h"
#include <math.h> #ifdef __EMSCRIPTEN__
#include <sys/param.h> #include "emscripten-audio-stream.h"
#endif
#define LIBSUPERDERPY_BITMAP_HASHMAP_BUCKETS 16 #define LIBSUPERDERPY_BITMAP_HASHMAP_BUCKETS 16

View file

@ -21,7 +21,6 @@
*/ */
#include "internal.h" #include "internal.h"
#include "libsuperderpy.h"
static inline void HandleEvent(struct Game* game, ALLEGRO_EVENT* ev) { static inline void HandleEvent(struct Game* game, ALLEGRO_EVENT* ev) {
switch (ev->type) { switch (ev->type) {

View file

@ -18,14 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "maths.h"
#include "config.h"
#include "internal.h" #include "internal.h"
#include <allegro5/allegro_primitives.h>
#include <allegro5/allegro_ttf.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
SYMBOL_EXPORT double DotProduct(const double v[], const double u[], int n) { SYMBOL_EXPORT double DotProduct(const double v[], const double u[], int n) {
float result = 0.0; float result = 0.0;

View file

@ -22,8 +22,6 @@
#define LIBSUPERDERPY_MATHS_H #define LIBSUPERDERPY_MATHS_H
#include "libsuperderpy.h" #include "libsuperderpy.h"
#include <allegro5/allegro.h>
#include <allegro5/allegro_font.h>
double DotProduct(const double v[], const double u[], int n); double DotProduct(const double v[], const double u[], int n);
double VectorLength(double x, double y, double z); double VectorLength(double x, double y, double z);

View file

@ -17,10 +17,8 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "shader.h"
#include "internal.h" #include "internal.h"
#include <allegro5/allegro.h>
#include <math.h>
static ALLEGRO_USTR* GetShaderSource(struct Game* game, const char* filename) { static ALLEGRO_USTR* GetShaderSource(struct Game* game, const char* filename) {
ALLEGRO_FILE* fp = al_fopen(filename, "r"); ALLEGRO_FILE* fp = al_fopen(filename, "r");

View file

@ -17,10 +17,8 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "timeline.h"
#include "internal.h" #include "internal.h"
#include "utils.h"
#include <allegro5/allegro.h>
static void DestroyArgs(struct TM_Arguments* args) { static void DestroyArgs(struct TM_Arguments* args) {
struct TM_Arguments* pom; struct TM_Arguments* pom;

View file

@ -17,10 +17,8 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "tween.h"
#include "internal.h" #include "internal.h"
#include <allegro5/allegro.h>
#include <math.h>
// Easing formulas (c) 2011, Auerhaus Development, LLC // Easing formulas (c) 2011, Auerhaus Development, LLC
// Originally licensed under WTFPL 2.0 // Originally licensed under WTFPL 2.0

View file

@ -18,14 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "utils.h"
#include "config.h"
#include "internal.h" #include "internal.h"
#include <allegro5/allegro_primitives.h>
#include <allegro5/allegro_ttf.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#ifdef ALLEGRO_ANDROID #ifdef ALLEGRO_ANDROID
#include <android/log.h> #include <android/log.h>
#endif #endif

View file

@ -22,8 +22,6 @@
#define LIBSUPERDERPY_UTILS_H #define LIBSUPERDERPY_UTILS_H
#include "libsuperderpy.h" #include "libsuperderpy.h"
#include <allegro5/allegro.h>
#include <allegro5/allegro_font.h>
#ifdef ALLEGRO_WINDOWS #ifdef ALLEGRO_WINDOWS
#define LIBRARY_EXTENSION ".dll" #define LIBRARY_EXTENSION ".dll"