From 4783a9a745b11ddb69a0c28a43a19fefc82a17e6 Mon Sep 17 00:00:00 2001 From: Ilya Shurumov Date: Mon, 21 Jun 2021 19:42:14 +0600 Subject: [PATCH] - [Psy-X] PrintMessageToOutput makes pretty output for emscripten - fix runtime warning - fix build errors, bump version --- appveyor.yml | 2 +- src_rebuild/Game/C/state.c | 2 +- src_rebuild/PsyCross/src/PsyX_main.cpp | 25 +++++++++++++++++++++++++ src_rebuild/premake5.lua | 6 ++---- 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 52845d3d..2922a31f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 7.0.{build} +version: 7.2.{build} branches: only: diff --git a/src_rebuild/Game/C/state.c b/src_rebuild/Game/C/state.c index 2219a56e..11862b82 100644 --- a/src_rebuild/Game/C/state.c +++ b/src_rebuild/Game/C/state.c @@ -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 { diff --git a/src_rebuild/PsyCross/src/PsyX_main.cpp b/src_rebuild/PsyCross/src/PsyX_main.cpp index d827066a..13cbc0cf 100644 --- a/src_rebuild/PsyCross/src/PsyX_main.cpp +++ b/src_rebuild/PsyCross/src/PsyX_main.cpp @@ -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 diff --git a/src_rebuild/premake5.lua b/src_rebuild/premake5.lua index ba3f15ec..6b297a99 100644 --- a/src_rebuild/premake5.lua +++ b/src_rebuild/premake5.lua @@ -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"