diff --git a/.gitignore b/.gitignore index 9210454..272a074 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ -# web build -build_web +# web builds +build_web_release/ +build_web/ # copyrighted assets which must be bought assets/copyrighted/ diff --git a/build_web_debug.bat b/build_web_debug.bat index 6715b64..b7a6f85 100644 --- a/build_web_debug.bat +++ b/build_web_debug.bat @@ -5,7 +5,7 @@ mkdir build_web call run_codegen.bat || goto :error -emcc -s ALLOW_MEMORY_GROWTH -DDEVTOOLS -Ithirdparty -Igen main.c -o build_web\index.html --preload-file assets --shell-file web_template.html || goto :error +emcc -O2 -s ALLOW_MEMORY_GROWTH --source-map-base . -gsource-map -DDEVTOOLS -Ithirdparty -Igen main.c -o build_web\index.html --preload-file assets --shell-file web_template.html || goto :error goto :EOF diff --git a/build_web_release.bat b/build_web_release.bat new file mode 100644 index 0000000..84f245d --- /dev/null +++ b/build_web_release.bat @@ -0,0 +1,17 @@ +@echo off + +rmdir /S /q build_web_release +mkdir build_web_release + +call run_codegen.bat || goto :error + +echo Building release +emcc -DNDEBUG -O2 -DDEVTOOLS -s ALLOW_MEMORY_GROWTH -Ithirdparty -Igen main.c -o build_web_release\index.html --preload-file assets --shell-file web_template.html || goto :error + +goto :EOF + +:error +echo Failed to build +exit /B %ERRORLEVEL% + + diff --git a/main.c b/main.c index 350643d..964e2a5 100644 --- a/main.c +++ b/main.c @@ -723,7 +723,6 @@ bool has_point(AABB aabb, Vec2 point) int num_draw_calls = 0; - float cur_batch_data[1024*10] = {0}; int cur_batch_data_index = 0; // @TODO check last tint as well, do this when factor into drawing parameters @@ -1224,7 +1223,6 @@ void frame(void) sg_begin_default_pass(&state.pass_action, sapp_width(), sapp_height()); sg_apply_pipeline(state.pip); - // tilemap #if 1 Level * cur_level = &level_level0; @@ -1537,6 +1535,7 @@ void frame(void) reset(&scratch); } + void cleanup(void) { sg_shutdown();