diff --git a/assets/sprites/little_plane.png b/assets/sprites/little_plane.png new file mode 100644 index 0000000..1c8153c Binary files /dev/null and b/assets/sprites/little_plane.png differ diff --git a/core/engine.c b/core/engine.c index 183ff38..f7a6ccc 100644 --- a/core/engine.c +++ b/core/engine.c @@ -25,7 +25,7 @@ Engine engine; //errors here should be fatal static void fatalError(char* message) { - fprintf(stderr, message); + fprintf(stderr, "%s", message); exit(-1); } @@ -38,7 +38,7 @@ void initEngine() { engine.renderer = NULL; //init SDL - if (SDL_Init(0) != 0) { + if (SDL_Init(SDL_INIT_VIDEO) != 0) { fatalError("Failed to initialize SDL2"); } diff --git a/core/engine_node.c b/core/engine_node.c index ef462d7..af58953 100644 --- a/core/engine_node.c +++ b/core/engine_node.c @@ -4,8 +4,6 @@ #include "memory.h" -STATIC_ASSERT(sizeof(EngineNode) == 72); - static void freeMemory(void* ptr) { EngineNode* node = (EngineNode*)ptr; //SDL stuff diff --git a/core/lib_engine.c b/core/lib_engine.c index 89a7f1a..79047d2 100644 --- a/core/lib_engine.c +++ b/core/lib_engine.c @@ -8,7 +8,7 @@ //errors here should be fatal static void fatalError(char* message) { - fprintf(stderr, message); + fprintf(stderr, "%s", message); exit(-1); } diff --git a/core/makefile b/core/makefile index 713c9ce..838400f 100644 --- a/core/makefile +++ b/core/makefile @@ -1,7 +1,7 @@ CC=gcc IDIR+=. ../Toy/source -CFLAGS+=$(addprefix -I,$(IDIR)) -DSDL_MAIN_HANDLED -g -Wall -W -Wno-unused-parameter -Wno-unused-function -Wno-unused-variable +CFLAGS+=$(addprefix -I,$(IDIR)) -g -Wall -W -Wno-unused-parameter -Wno-unused-function -Wno-unused-variable LIBS+=-lSDL2 -lSDL2_image -ltoy ODIR = obj diff --git a/makefile b/makefile index bb8df21..376b607 100644 --- a/makefile +++ b/makefile @@ -55,3 +55,24 @@ else endif rebuild: clean all + + +#utils for the manual android build +INCLUDEDIR=include + +SOURCEDIR=bundle + +$(INCLUDEDIR): + mkdir $(INCLUDEDIR) + +$(SOURCEDIR): + mkdir $(SOURCEDIR) + +sourcelist: + @echo $(addprefix ../airport/,$(wildcard Toy/source/*.c) $(wildcard core/*.c) $(wildcard source/*.c)) > source.list + +bundleincludes: $(INCLUDEDIR) + cp $(addprefix ../airport/,$(wildcard Toy/source/*.h) $(wildcard core/*.h) $(wildcard source/*.h)) $(INCLUDEDIR) + +bundlesource: $(SOURCEDIR) + cp $(addprefix ../airport/,$(wildcard Toy/source/*.c) $(wildcard core/*.c) $(wildcard source/*.c)) $(SOURCEDIR) \ No newline at end of file diff --git a/source/main.c b/source/main.c index 0264f3f..c83c183 100644 --- a/source/main.c +++ b/source/main.c @@ -1,3 +1,6 @@ +//moved here for android shenanigans +#define SDL_MAIN_HANDLED + #include "engine.h" int main(int argc, char* argv[]) { diff --git a/source/makefile b/source/makefile index 0f6882d..2042533 100644 --- a/source/makefile +++ b/source/makefile @@ -1,7 +1,7 @@ CC=gcc IDIR+=. ../Toy/source ../core -CFLAGS+=$(addprefix -I,$(IDIR)) -DSDL_MAIN_HANDLED -g -Wall -W -Wno-unused-parameter -Wno-unused-function -Wno-unused-variable +CFLAGS+=$(addprefix -I,$(IDIR)) -g -Wall -W -Wno-unused-parameter -Wno-unused-function -Wno-unused-variable LIBS+=-lSDL2 -ltoy -lcore ODIR = obj