Small adjustments to appease the android build
This commit is contained in:
BIN
assets/sprites/little_plane.png
Normal file
BIN
assets/sprites/little_plane.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
@@ -25,7 +25,7 @@ Engine engine;
|
|||||||
|
|
||||||
//errors here should be fatal
|
//errors here should be fatal
|
||||||
static void fatalError(char* message) {
|
static void fatalError(char* message) {
|
||||||
fprintf(stderr, message);
|
fprintf(stderr, "%s", message);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ void initEngine() {
|
|||||||
engine.renderer = NULL;
|
engine.renderer = NULL;
|
||||||
|
|
||||||
//init SDL
|
//init SDL
|
||||||
if (SDL_Init(0) != 0) {
|
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
|
||||||
fatalError("Failed to initialize SDL2");
|
fatalError("Failed to initialize SDL2");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
|
||||||
STATIC_ASSERT(sizeof(EngineNode) == 72);
|
|
||||||
|
|
||||||
static void freeMemory(void* ptr) {
|
static void freeMemory(void* ptr) {
|
||||||
EngineNode* node = (EngineNode*)ptr;
|
EngineNode* node = (EngineNode*)ptr;
|
||||||
//SDL stuff
|
//SDL stuff
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
//errors here should be fatal
|
//errors here should be fatal
|
||||||
static void fatalError(char* message) {
|
static void fatalError(char* message) {
|
||||||
fprintf(stderr, message);
|
fprintf(stderr, "%s", message);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
CC=gcc
|
CC=gcc
|
||||||
|
|
||||||
IDIR+=. ../Toy/source
|
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
|
LIBS+=-lSDL2 -lSDL2_image -ltoy
|
||||||
|
|
||||||
ODIR = obj
|
ODIR = obj
|
||||||
|
|||||||
21
makefile
21
makefile
@@ -55,3 +55,24 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
rebuild: clean all
|
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)
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
//moved here for android shenanigans
|
||||||
|
#define SDL_MAIN_HANDLED
|
||||||
|
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
CC=gcc
|
CC=gcc
|
||||||
|
|
||||||
IDIR+=. ../Toy/source ../core
|
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
|
LIBS+=-lSDL2 -ltoy -lcore
|
||||||
|
|
||||||
ODIR = obj
|
ODIR = obj
|
||||||
|
|||||||
Reference in New Issue
Block a user