diff --git a/html5/build_release.bat b/html5/build_release.bat index 5b5e7a6..c5d7825 100644 --- a/html5/build_release.bat +++ b/html5/build_release.bat @@ -121,13 +121,16 @@ REM **************************************** END SOURCE :unused so far: -s USE_GLFW=3 -s NO_EXIT_RUNTIME=1 -s FORCE_ALIGNED_MEMORY=1 -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1 -DRT_EMTERPRETER_ENABLED -s TOTAL_MEMORY=16MB -s PRECISE_F32=2 :To skip font loading so it needs no resource files or zlib, add -DC_NO_ZLIB -SET CUSTOM_FLAGS= -DHAS_SOCKLEN_T -DBOOST_ALL_NO_LIB -DPLATFORM_HTML5 -DRT_USE_SDL_AUDIO -DRT_JPG_SUPPORT -DRT_PNG_SUPPORT -DC_GL_MODE -s LEGACY_GL_EMULATION=1 -DPLATFORM_HTML5 -s ALLOW_MEMORY_GROWTH=1 -Wno-c++11-compat-deprecated-writable-strings --ignore-dynamic-linking --memory-init-file 0 -Wno-switch -Wno-writable-strings -Wno-shift-negative-value +SET CUSTOM_FLAGS= -DHAS_SOCKLEN_T -DBOOST_ALL_NO_LIB -DPLATFORM_HTML5 -DRT_USE_SDL_AUDIO -DRT_JPG_SUPPORT ^ +-DRT_PNG_SUPPORT -DC_GL_MODE -s LEGACY_GL_EMULATION=1 -DPLATFORM_HTML5 -s ALLOW_MEMORY_GROWTH=1 ^ +-Wno-c++11-compat-deprecated-writable-strings --ignore-dynamic-linking --memory-init-file 0 ^ +-Wno-switch -Wno-writable-strings -Wno-shift-negative-value -s EXTRA_EXPORTED_RUNTIME_METHODS=['ccall','cwrap'] :unused: -s FULL_ES2=1 --emrun IF %USE_HTML5_CUSTOM_MAIN% EQU 1 ( :add this define so we'll manually call mainf from the html later instead of it being auto -SET CUSTOM_FLAGS=%CUSTOM_FLAGS% -DRT_HTML5_USE_CUSTOM_MAIN -s EXPORTED_FUNCTIONS=['_mainf','_PROTON_SystemMessage','_PROTON_GUIMessage'] -s EXTRA_EXPORTED_RUNTIME_METHODS=['ccall','cwrap'] +SET CUSTOM_FLAGS=%CUSTOM_FLAGS% -DRT_HTML5_USE_CUSTOM_MAIN -s EXPORTED_FUNCTIONS=['_mainf','_PROTON_SystemMessage','_PROTON_GUIMessage'] SET FINAL_EXTENSION=js ) else ( SET FINAL_EXTENSION=html @@ -139,8 +142,9 @@ echo Compiling in release mode SET CUSTOM_FLAGS=%CUSTOM_FLAGS% -O2 -DNDEBUG ) else ( echo Compiling in debug mode -:removed -s SAFE_HEAP=1 , causes alignment error with FMOD -SET CUSTOM_FLAGS=%CUSTOM_FLAGS% -D_DEBUG -s GL_UNSAFE_OPTS=0 -s WARN_ON_UNDEFINED_SYMBOLS=1 -s EXCEPTION_DEBUG=1 -s ASSERTIONS=2 -s DEMANGLE_SUPPORT=1 -s ALIASING_FUNCTION_POINTERS=0 --emrun +:removed -s SAFE_HEAP=1 , causes alignment error with FMOD -g4 +set EMCC_DEBUG=1 +SET CUSTOM_FLAGS=%CUSTOM_FLAGS% -D_DEBUG -s GL_UNSAFE_OPTS=0 -s SAFE_HEAP=1 -s WARN_ON_UNDEFINED_SYMBOLS=1 -s EXCEPTION_DEBUG=1 -s STACK_OVERFLOW_CHECK=2 -s ASSERTIONS=1 -s DEMANGLE_SUPPORT=1 -s ALIASING_FUNCTION_POINTERS=0 --emrun ) SET INCLUDE_DIRS=-I%SHARED% -I%APP% -I../../shared/util/boost -I../../shared/ClanLib-2.0/Sources -I../../shared/Network/enet/include ^ diff --git a/source/App.cpp b/source/App.cpp index bde5fa9..1ef74f9 100644 --- a/source/App.cpp +++ b/source/App.cpp @@ -105,9 +105,10 @@ GamepadManager * GetGamepadManager() {return &g_gamepadManager;} AudioManagerBBX g_audioManager; #elif defined PLATFORM_HTML5 #include "Audio/AudioManagerFMODStudio.h" -//AudioManager g_audioManager; //to disable sound AudioManagerFMOD g_audioManager; +//AudioManager g_audioManager; //to disable sound + #elif defined PLATFORM_FLASH //AudioManager g_audioManager; //to disable sound #include "Audio/AudioManagerFlash.h" diff --git a/source/dink/dink.cpp b/source/dink/dink.cpp index 7ecbd72..2d9e12f 100644 --- a/source/dink/dink.cpp +++ b/source/dink/dink.cpp @@ -4418,6 +4418,9 @@ int say_text_xy(char text[512], int mx, int my, int script) g_sprite[crap2].owner = 1000; g_sprite[crap2].hard = 1; g_sprite[crap2].script = script; +#ifdef _DEBUG + LogMsg("Setting say_xy script to %d, returning sprite %d", script, crap2); +#endif return(crap2); } @@ -5085,14 +5088,16 @@ bool PlayMidi(const char *sFileName) } - string tempName; + string tempName = fName; + /* if (GetEmulatedPlatformID() == PLATFORM_ID_HTML5) { //ios browsers don't support ogg?! Fine, let's assume we have MP3 versions tempName = ModifyFileExtension(fName, "mp3"); } else + */ { tempName = ModifyFileExtension(fName, "ogg"); } @@ -5122,9 +5127,28 @@ bool PlayMidi(const char *sFileName) } + string finalPath = GetFileLocationString(fName); + if (FileExists(finalPath)) + { + GetAudioManager()->Play(GetFileLocationString(fName), true, true, false); + } + else + { + + return false; + } + g_dglo.m_lastMusicPath = sFileName; - GetAudioManager()->Play(GetFileLocationString(fName), true, true, false); + /* + if (!FileExists(fName) && !g_dglo.m_dmodGameDir.empty()) + { + //asking for a mid that doesn't exist in the DMOD dir probably, let's use the original Dink one + fName = g_dglo.m_gamePathWithDir+ + } + */ + + //LogMsg("Playing music %s", sFileName); return true; } @@ -7778,6 +7802,12 @@ pass: // Msg("Wait called for %d.", nlist[0]); strcpy(pLineIn, h); kill_returning_stuff(script); + + +#ifdef _DEBUG + //seth's hack so glittering's crazy long intro goes faster + //g_nlist[0] = 100; +#endif int cb1 = add_callback("",g_nlist[0],0,script); return(2); @@ -11130,13 +11160,11 @@ void text_draw(int h) // SetTextColor(hdc,RGB(8,14,21)); if (g_sprite[h].owner == 1200) { - - - GetApp()->GetFont(FONT_SMALL)->DrawWrapped(rTemp, cr, false, false, rgbColor, g_dglo.m_fontSize, false, bgColor); } else { - if ( (cr[0] == ' ' && cr[1] == 0) || (cr[0] == ' ' && cr[1] == ' ' && cr[2] == 0) || (cr[0] == ' ' && cr[1] == ' ' && cr[2] == ' ' && cr[3] == 0) ) + + if (StripWhiteSpace(cr) == "") { //skip it, it's just blank, otherwise it will draw the bg which looks dumb } else