diff options
| -rw-r--r-- | Makefile | 5 | ||||
| -rw-r--r-- | Makefile.emscripten | 5 | ||||
| -rw-r--r-- | main.cpp | 8 |
3 files changed, 10 insertions, 8 deletions
@@ -13,7 +13,4 @@ clean: rm -f lunatic_out.* browser-game: - emcc --std=c++11 -O2 World.cpp -o World.bc - emcc --std=c++11 -O2 main.cpp -o main.bc - emcc --std=c++11 -O2 PerlinNoise.cpp -o PerlinNoise.bc - emcc -O2 World.bc main.bc PerlinNoise.bc -o lunatic_out.html -s USE_SDL=2 --preload-file music.wav --preload-file coin.wav --preload-file coin.bmp --preload-file earth01.bmp --preload-file fonts.bmp --preload-file gridder01.bmp --preload-file guy01.bmp --preload-file guy02.bmp --preload-file gridder02.bmp --preload-file gridder03.bmp -s TOTAL_MEMORY=536870912 --shell-file shell_minimal.html + bash -c "source /home/retard/emsdk-portable/emsdk_env.sh && make -f Makefile.emscripten" diff --git a/Makefile.emscripten b/Makefile.emscripten new file mode 100644 index 0000000..f75faef --- /dev/null +++ b/Makefile.emscripten @@ -0,0 +1,5 @@ +browser-game: + emcc --std=c++11 -O2 World.cpp -o World.bc + emcc --std=c++11 -O2 main.cpp -o main.bc + emcc --std=c++11 -O2 PerlinNoise.cpp -o PerlinNoise.bc + emcc -O2 World.bc main.bc PerlinNoise.bc -o lunatic_out.html -s USE_SDL=2 --preload-file music.wav --preload-file coin.wav --preload-file coin.bmp --preload-file earth01.bmp --preload-file fonts.bmp --preload-file gridder01.bmp --preload-file guy01.bmp --preload-file guy02.bmp --preload-file gridder02.bmp --preload-file gridder03.bmp -s TOTAL_MEMORY=536870912 --shell-file shell_minimal.html @@ -447,9 +447,11 @@ void main_loop(void *arg) break; } //show map !? +#ifndef __EMSCRIPTEN__ rect={100,20,150,150}; SDL_RenderCopy(ctx->ren,ctx->textures[8],NULL,&rect); +#endif if(ctx->world.player.dead) { sdl_put_str(ctx->ren, ctx->textures[3],300, -1, 10,"LUNATIC LEMMY DIED!",250,100,100,19,ctx->win_width,ctx->win_height,1,2); @@ -506,6 +508,7 @@ int main(int, char**){ 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)); // PERLIN GENEARTED MAP +#ifndef __EMSCRIPTEN__ ctx->textures.push_back(SDL_CreateTexture(ctx->ren, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, 1024, 768)); double seed=22; @@ -576,12 +579,9 @@ int main(int, char**){ } } SDL_SetRenderTarget(ctx->ren, NULL); - +#endif // PERLIN GENEARTED MAP OVER - - - ctx->show_tiles_size=ctx->win_height/15; ctx->show_tiles_back=ctx->win_width/ctx->show_tiles_size*0.25; |
