diff options
author | Cameron Cawley | 2018-12-19 06:31:26 +0000 |
---|---|---|
committer | Filippos Karapetis | 2018-12-19 08:31:26 +0200 |
commit | f6015086e18360659552ec4f7ca898f20fad1d16 (patch) | |
tree | 3f132ccbeb663e74d6b408c2ce2d608d3e2b27d8 /engines/glk | |
parent | e94ccdbe6b0d650e04872ee3cc68fe13272f81a4 (diff) | |
download | scummvm-rg350-f6015086e18360659552ec4f7ca898f20fad1d16.tar.gz scummvm-rg350-f6015086e18360659552ec4f7ca898f20fad1d16.tar.bz2 scummvm-rg350-f6015086e18360659552ec4f7ca898f20fad1d16.zip |
ENGINES: Add GUIErrorMessageFormat to replace duplicated functions (#1455)
Diffstat (limited to 'engines/glk')
-rw-r--r-- | engines/glk/glk.cpp | 12 | ||||
-rw-r--r-- | engines/glk/glk.h | 5 | ||||
-rw-r--r-- | engines/glk/glulxe/glulxe.cpp | 8 |
3 files changed, 4 insertions, 21 deletions
diff --git a/engines/glk/glk.cpp b/engines/glk/glk.cpp index d3e715a7fe..2525c0b1fa 100644 --- a/engines/glk/glk.cpp +++ b/engines/glk/glk.cpp @@ -145,18 +145,6 @@ Common::Error GlkEngine::run() { return Common::kNoError; } -void GlkEngine::GUIError(const char *msg, ...) { - char buffer[STRINGBUFLEN]; - va_list va; - - // Generate the full error message - va_start(va, msg); - vsnprintf(buffer, STRINGBUFLEN, msg, va); - va_end(va); - - GUIErrorMessage(buffer); -} - Common::Error GlkEngine::loadGame() { frefid_t ref = _streams->createByPrompt(fileusage_BinaryMode | fileusage_SavedGame, filemode_Read, 0); diff --git a/engines/glk/glk.h b/engines/glk/glk.h index 7460317fc0..55066e2cde 100644 --- a/engines/glk/glk.h +++ b/engines/glk/glk.h @@ -171,11 +171,6 @@ public: } /** - * Display a message in a GUI dialog - */ - void GUIError(const char *msg, ...); - - /** * Return the filename for a given save slot */ Common::String getSaveName(uint slot) const { diff --git a/engines/glk/glulxe/glulxe.cpp b/engines/glk/glulxe/glulxe.cpp index e2e1a477e5..aaa63b6141 100644 --- a/engines/glk/glulxe/glulxe.cpp +++ b/engines/glk/glulxe/glulxe.cpp @@ -52,23 +52,23 @@ Common::Error Glulxe::saveGameData(strid_t file, const Common::String &desc) { bool Glulxe::is_gamefile_valid() { if (_gameFile->size() < 8) { - GUIError(_("This is too short to be a valid Glulx file.")); + GUIErrorMessage(_("This is too short to be a valid Glulx file.")); return false; } if (_gameFile->readUint32BE() != MKTAG('G', 'l', 'u', 'l')) { - GUIError(_("This is not a valid Glulx file.")); + GUIErrorMessage(_("This is not a valid Glulx file.")); return false; } // We support version 2.0 through 3.1.* uint version = _gameFile->readUint32BE(); if (version < 0x20000) { - GUIError(_("This Glulx file is too old a version to execute.")); + GUIErrorMessage(_("This Glulx file is too old a version to execute.")); return false; } if (version >= 0x30200) { - GUIError(_("This Glulx file is too new a version to execute.")); + GUIErrorMessage(_("This Glulx file is too new a version to execute.")); return false; } |