From d3f6ce69901640b243496ffdd9ce545ce802aec9 Mon Sep 17 00:00:00 2001 From: Philip Rideout Date: Wed, 8 Jul 2020 12:43:58 -0700 Subject: [PATCH] Minor fixes for "matinfo --web-server" --- libs/matdbg/web/script.js | 4 ++++ tools/matinfo/src/main.cpp | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libs/matdbg/web/script.js b/libs/matdbg/web/script.js index 3f2b3e2f22..6adfa4415c 100644 --- a/libs/matdbg/web/script.js +++ b/libs/matdbg/web/script.js @@ -159,6 +159,10 @@ function queryActiveShaders() { } renderMaterialList(); renderMaterialDetail(); + }) + .catch((error) => { + // This is expected to fail when the server is hosted from matinfo instead of Engine, since + // there are no active shaders in that situation. }); } diff --git a/tools/matinfo/src/main.cpp b/tools/matinfo/src/main.cpp index 6696224345..73a192561d 100644 --- a/tools/matinfo/src/main.cpp +++ b/tools/matinfo/src/main.cpp @@ -171,7 +171,7 @@ static int handleArguments(int argc, char* argv[], Config* config) { config->shaderIndex = static_cast(std::stoi(arg)); break; case 'w': - config->serverPort = 8080; + config->serverPort = std::stoi(arg); break; case 'x': config->printDictionaryGLSL = true; @@ -386,6 +386,9 @@ static bool parseChunks(Config config, void* data, size_t size) { if (config.serverPort) { // Spin up a web server on a secondary thread. DebugServer server(Backend::DEFAULT, config.serverPort); + if (!server.isReady()) { + return false; + } // Notify the server that we have a filamat file. utils::CString name;