diff --git a/OpenGL/CMakeLists.txt b/OpenGL/CMakeLists.txt index 308aeb1..a151a0f 100644 --- a/OpenGL/CMakeLists.txt +++ b/OpenGL/CMakeLists.txt @@ -99,6 +99,7 @@ if (EMSCRIPTEN) target_link_options(${PROJECT_NAME} PRIVATE -sASYNCIFY --preload-file "${CMAKE_CURRENT_SOURCE_DIR}/res" + -sALLOW_MEMORY_GROWTH=1 --shell-file ${CMAKE_CURRENT_SOURCE_DIR}/../web/template.html ) # TODO: It would be cool to add -fno-exceptions -fno-rtti diff --git a/OpenGL/src/Application.cpp b/OpenGL/src/Application.cpp index 6d40c9f..1642d12 100644 --- a/OpenGL/src/Application.cpp +++ b/OpenGL/src/Application.cpp @@ -430,6 +430,13 @@ ImFont* load_font(std::filesystem::path res_path, ImGuiIO* io, const std::string bool Application::initialized = false; +#ifdef __EMSCRIPTEN__ +EM_JS(void, print_memory_consumption, (), { + console.log('Current heap size:', HEAP8.length); + console.log('Memory used:', HEAPU8.buffer.byteLength); +}); +#endif + // Initialize everything and return true if it went all right Application::Application() : res_path(getResPath()) @@ -468,6 +475,9 @@ Application::Application() assert(false); } else { std::cout << "Application initialized" << std::endl; +#ifdef __EMSCRIPTEN__ + print_memory_consumption(); +#endif } initialized = true; diff --git a/OpenGL/src/AudioEngine.h b/OpenGL/src/AudioEngine.h index 3bb5859..eb15911 100644 --- a/OpenGL/src/AudioEngine.h +++ b/OpenGL/src/AudioEngine.h @@ -61,7 +61,7 @@ class AudioEngine { Sound Impact; Sound Scuff; Sound Song; - + // bunny dialogue Sound Rabbit1; Sound Rabbit2;