- [Psy-X] PrintMessageToOutput makes pretty output for emscripten

- fix runtime warning
- fix build errors, bump version
This commit is contained in:
Ilya Shurumov 2021-06-21 19:42:14 +06:00 committed by InspirationByte
parent 9d1f80dc00
commit 4783a9a745
4 changed files with 29 additions and 6 deletions

View File

@ -1,4 +1,4 @@
version: 7.0.{build}
version: 7.2.{build}
branches:
only:

View File

@ -40,7 +40,7 @@ void emStateFunc()
void DoStateLoop()
{
#ifdef __EMSCRIPTEN__
emscripten_set_main_loop(emStateFunc, 120, 1);
emscripten_set_main_loop(emStateFunc, 0, 1);
#else
do
{

View File

@ -515,6 +515,31 @@ void PrintMessageToOutput(SpewType_t spewtype, char const* pMsgFormat, va_list a
#ifdef WIN32
Spew_ConDebugSpew(spewtype, pTempBuffer);
#elif defined(__EMSCRIPTEN__)
if (spewtype == SPEW_INFO)
{
EM_ASM({
console.info(UTF8ToString($0));
}, pTempBuffer);
}
else if (spewtype == SPEW_WARNING)
{
EM_ASM({
console.warn(UTF8ToString($0));
}, pTempBuffer);
}
else if (spewtype == SPEW_ERROR)
{
EM_ASM({
console.error(UTF8ToString($0));
}, pTempBuffer);
}
else
{
EM_ASM({
console.log(UTF8ToString($0));
}, pTempBuffer);
}
#else
printf(pTempBuffer);
#endif

View File

@ -19,8 +19,8 @@ SDL2_DIR = os.getenv("SDL2_DIR") or "dependencies/SDL2"
OPENAL_DIR = os.getenv("OPENAL_DIR") or "dependencies/openal-soft"
JPEG_DIR = os.getenv("JPEG_DIR") or "dependencies/jpeg"
WEBDEMO_DIR = os.getenv("WEBDEMO_DIR") or "../../content/web_demo@/" -- FIXME: make it better
WEBSHELL_PATH = "../.emscripten"
WEBDEMO_DIR = os.getenv("WEBDEMO_DIR") or "../../../content/web_demo@/" -- FIXME: make it better
WEBSHELL_PATH = "../../.emscripten"
GAME_REGION = os.getenv("GAME_REGION") or "NTSC_VERSION" -- or PAL_VERSION
GAME_VERSION = os.getenv("APPVEYOR_BUILD_VERSION") or nil
@ -81,8 +81,6 @@ workspace "REDRIVER2"
("--preload-file " .. WEBDEMO_DIR)
}
targetextension ".bc"
filter { "kind:*App" }
targetextension ".html"