diff options
author | Cameron Cawley | 2019-04-03 18:15:07 +0100 |
---|---|---|
committer | David Turner | 2019-04-05 18:50:05 +0100 |
commit | 62660da0bc8bdbaa464f8b25ee993f6dfb90aa85 (patch) | |
tree | 06b7a2f99f58ea2b3ae8f50db7c9ea095b972c76 /backends/platform | |
parent | 03e99924c309d97709df477cac31e5f0df0002ad (diff) | |
download | scummvm-rg350-62660da0bc8bdbaa464f8b25ee993f6dfb90aa85.tar.gz scummvm-rg350-62660da0bc8bdbaa464f8b25ee993f6dfb90aa85.tar.bz2 scummvm-rg350-62660da0bc8bdbaa464f8b25ee993f6dfb90aa85.zip |
RISCOS: Log messages using !Reporter
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/sdl/riscos/riscos.cpp | 34 | ||||
-rw-r--r-- | backends/platform/sdl/riscos/riscos.h | 2 |
2 files changed, 36 insertions, 0 deletions
diff --git a/backends/platform/sdl/riscos/riscos.cpp b/backends/platform/sdl/riscos/riscos.cpp index 73c0fdae03..ac1cdadd43 100644 --- a/backends/platform/sdl/riscos/riscos.cpp +++ b/backends/platform/sdl/riscos/riscos.cpp @@ -36,6 +36,10 @@ #define URI_Dispatch 0x4e381 #endif +#ifndef Report_Text0 +#define Report_Text0 0x54c80 +#endif + void OSystem_RISCOS::init() { // Initialze File System Factory _fsFactory = new RISCOSFilesystemFactory(); @@ -45,6 +49,8 @@ void OSystem_RISCOS::init() { } void OSystem_RISCOS::initBackend() { + ConfMan.registerDefault("enable_reporter", false); + // Create the savefile manager if (_savefileManager == 0) { Common::String savePath = "/<Choices$Write>/ScummVM/Saves"; @@ -76,6 +82,34 @@ bool OSystem_RISCOS::openUrl(const Common::String &url) { return true; } +void OSystem_RISCOS::logMessage(LogMessageType::Type type, const char *message) { + OSystem_SDL::logMessage(type, message); + + // Log messages using !Reporter, available from http://www.avisoft.force9.co.uk/Reporter.htm + if (!ConfMan.getBool("enable_reporter")) + return; + + char colour; + switch (type) { + case LogMessageType::kError: + colour = 'r'; + break; + case LogMessageType::kWarning: + colour = 'o'; + break; + case LogMessageType::kInfo: + colour = 'l'; + break; + case LogMessageType::kDebug: + default: + colour = 'f'; + break; + } + + Common::String report = Common::String::format("\\%c %s", colour, message); + _swix(Report_Text0, _IN(0), report.c_str()); +} + Common::String OSystem_RISCOS::getDefaultConfigFileName() { return "/<Choices$Write>/ScummVM/scummvmrc"; } diff --git a/backends/platform/sdl/riscos/riscos.h b/backends/platform/sdl/riscos/riscos.h index fb23a3e6e3..49ac5a2264 100644 --- a/backends/platform/sdl/riscos/riscos.h +++ b/backends/platform/sdl/riscos/riscos.h @@ -34,6 +34,8 @@ public: virtual bool openUrl(const Common::String &url); + virtual void logMessage(LogMessageType::Type type, const char *message); + protected: /** * The path of the currently open log file, if any. |