Add release build script, fix build flags

- Fixes web lag from glGetError on web build
main
Cameron Murphy Reikes 2 years ago
parent 7d7a0f24cb
commit 245b7d05b0

5
.gitignore vendored

@ -1,5 +1,6 @@
# web build # web builds
build_web build_web_release/
build_web/
# copyrighted assets which must be bought # copyrighted assets which must be bought
assets/copyrighted/ assets/copyrighted/

@ -5,7 +5,7 @@ mkdir build_web
call run_codegen.bat || goto :error 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 goto :EOF

@ -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%

@ -723,7 +723,6 @@ bool has_point(AABB aabb, Vec2 point)
int num_draw_calls = 0; int num_draw_calls = 0;
float cur_batch_data[1024*10] = {0}; float cur_batch_data[1024*10] = {0};
int cur_batch_data_index = 0; int cur_batch_data_index = 0;
// @TODO check last tint as well, do this when factor into drawing parameters // @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_begin_default_pass(&state.pass_action, sapp_width(), sapp_height());
sg_apply_pipeline(state.pip); sg_apply_pipeline(state.pip);
// tilemap // tilemap
#if 1 #if 1
Level * cur_level = &level_level0; Level * cur_level = &level_level0;
@ -1537,6 +1535,7 @@ void frame(void)
reset(&scratch); reset(&scratch);
} }
void cleanup(void) void cleanup(void)
{ {
sg_shutdown(); sg_shutdown();

Loading…
Cancel
Save