From f02aea9a6da1435bffcffd83f5f396eeffdb70d4 Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Wed, 27 Sep 2017 13:51:57 +0200 Subject: tuning build system and dirs --- Makefile | 7 ++++--- android/app/src/main/assets | 1 + main.cpp | 20 ++++++++++---------- 3 files changed, 15 insertions(+), 13 deletions(-) create mode 120000 android/app/src/main/assets diff --git a/Makefile b/Makefile index 5f4ab76..4e59e53 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,13 @@ CPPFLAGS = $(shell sdl2-config --cflags --libs) -CPPFLAGS = -I/Library/Fraemework/SDL2.framework/Headers --std=c++11 -LINKFLAGS = -framework SDL2 --std=c++11 +#MAC-CPPFLAGS = -I/Library/Fraemework/SDL2.framework/Headers --std=c++11 +#MAC-LINKFLAGS = -framework SDL2 --std=c++11 run: game ./game game: World.o main.o PerlinNoise.o - $(CXX) -o $@ $(LINKFLAGS) $^ + $(CXX) -o $@ $(CPPFLAGS) $^ +#MAC $(CXX) -o $@ $(LINKFLAGS) $^ clean: rm -f game diff --git a/android/app/src/main/assets b/android/app/src/main/assets new file mode 120000 index 0000000..e88c345 --- /dev/null +++ b/android/app/src/main/assets @@ -0,0 +1 @@ +../../../../assets/ \ No newline at end of file diff --git a/main.cpp b/main.cpp index 59e1e4a..31bca71 100644 --- a/main.cpp +++ b/main.cpp @@ -129,10 +129,10 @@ void sdl_play_sound() if (first) { - SDL_LoadWAV("music.wav", &wavSpec, &wavBuffer2, &wavLength2); + SDL_LoadWAV("assets/music.wav", &wavSpec, &wavBuffer2, &wavLength2); std::cout << "---music.wav---" << std::endl; show_AudioSpec(&wavSpec); - SDL_LoadWAV("coin.wav", &wavSpec, &wavBuffer, &wavLength); + SDL_LoadWAV("assets/coin.wav", &wavSpec, &wavBuffer, &wavLength); std::cout << "---coin.wav---" << std::endl; show_AudioSpec(&wavSpec); sample=wavLength; @@ -499,14 +499,14 @@ int main(int, char**){ ctx->ren=ctx->sdl_init.second.second; // init Textures - ctx->textures.push_back(sdl_load_texture("guy01.bmp",0,0,255,ctx->ren)); - ctx->textures.push_back(sdl_load_texture("guy02.bmp",0,0,255,ctx->ren)); - ctx->textures.push_back(sdl_load_texture("coin.bmp",255,255,255,ctx->ren)); - ctx->textures.push_back(sdl_load_texture("fonts.bmp",0,0,0,ctx->ren)); - ctx->textures.push_back(sdl_load_texture("earth01.bmp",0,0,0,ctx->ren)); - ctx->textures.push_back(sdl_load_texture("gridder01.bmp",255,255,255,ctx->ren)); - ctx->textures.push_back(sdl_load_texture("gridder02.bmp",255,255,255,ctx->ren)); - ctx->textures.push_back(sdl_load_texture("gridder03.bmp",255,255,255,ctx->ren)); + ctx->textures.push_back(sdl_load_texture("assets/guy01.bmp",0,0,255,ctx->ren)); + ctx->textures.push_back(sdl_load_texture("assets/guy02.bmp",0,0,255,ctx->ren)); + ctx->textures.push_back(sdl_load_texture("assets/coin.bmp",255,255,255,ctx->ren)); + ctx->textures.push_back(sdl_load_texture("assets/fonts.bmp",0,0,0,ctx->ren)); + ctx->textures.push_back(sdl_load_texture("assets/earth01.bmp",0,0,0,ctx->ren)); + ctx->textures.push_back(sdl_load_texture("assets/gridder01.bmp",255,255,255,ctx->ren)); + ctx->textures.push_back(sdl_load_texture("assets/gridder02.bmp",255,255,255,ctx->ren)); + ctx->textures.push_back(sdl_load_texture("assets/gridder03.bmp",255,255,255,ctx->ren)); // PERLIN GENEARTED MAP #ifndef __EMSCRIPTEN__ ctx->textures.push_back(SDL_CreateTexture(ctx->ren, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, 1024, 768)); -- cgit v1.2.3