diff options
author | Filippos Karapetis | 2010-08-17 20:33:22 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-08-17 20:33:22 +0000 |
commit | 397df8f35090fd0b4815cec8809739de559882c4 (patch) | |
tree | d457228110c328a2ec73556de38600251b018f98 /engines/sci | |
parent | 0106a3785727ca7fe1116a8492847c86a55af7b0 (diff) | |
download | scummvm-rg350-397df8f35090fd0b4815cec8809739de559882c4.tar.gz scummvm-rg350-397df8f35090fd0b4815cec8809739de559882c4.tar.bz2 scummvm-rg350-397df8f35090fd0b4815cec8809739de559882c4.zip |
SCI: added a wrapper for GUI::MessageDialog
svn-id: r52171
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 11 | ||||
-rw-r--r-- | engines/sci/engine/savegame.cpp | 10 |
2 files changed, 11 insertions, 10 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index a3f7a90da3..a566ce0554 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -57,6 +57,11 @@ namespace Sci { +void showScummVMDialog(const Common::String &message) { + GUI::MessageDialog dialog(message, "OK"); + dialog.runModal(); +} + void _k_dirloop(reg_t object, uint16 angle, EngineState *s, int argc, reg_t *argv) { GuiResourceId viewId = readSelectorValue(s->_segMan, object, SELECTOR(view)); uint16 signal = readSelectorValue(s->_segMan, object, SELECTOR(signal)); @@ -922,14 +927,12 @@ reg_t kDrawControl(EngineState *s, int argc, reg_t *argv) { if (!changeDirButton.isNull()) { // check if checkDirButton is still enabled, in that case we are called the first time during that room if (!(readSelectorValue(s->_segMan, changeDirButton, SELECTOR(state)) & SCI_CONTROLS_STYLE_DISABLED)) { - GUI::MessageDialog dialog("Characters saved inside ScummVM are shown " + showScummVMDialog("Characters saved inside ScummVM are shown " "automatically. Character files saved in the original " "interpreter need to be put inside ScummVM's saved games " "directory and a prefix needs to be added depending on which " "game it was saved in: 'qfg1-' for Quest for Glory 1, 'qfg2-' " - "for Quest for Glory 2. Example: 'qfg2-thief.sav'.", - "OK"); - dialog.runModal(); + "for Quest for Glory 2. Example: 'qfg2-thief.sav'."); } } } diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index dfc41cc56a..79c4d6adf5 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -45,8 +45,6 @@ #include "sci/sound/audio.h" #include "sci/sound/music.h" -#include "gui/message.h" - namespace Sci { @@ -701,6 +699,8 @@ bool gamestate_save(EngineState *s, Common::WriteStream *fh, const char* savenam return true; } +extern void showScummVMDialog(const Common::String &message); + void gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) { SavegameMetadata meta; @@ -721,8 +721,7 @@ void gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) { warning("Savegame version is %d, maximum supported is %0d", meta.savegame_version, CURRENT_SAVEGAME_VERSION); */ - GUI::MessageDialog dialog("The format of this saved game is obsolete, unable to load it", "OK"); - dialog.runModal(); + showScummVMDialog("The format of this saved game is obsolete, unable to load it"); s->r_acc = make_reg(0, 1); // signal failure return; @@ -733,8 +732,7 @@ void gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) { if (script0->size != meta.script0_size || g_sci->getGameObject().offset != meta.game_object_offset) { //warning("This saved game was created with a different version of the game, unable to load it"); - GUI::MessageDialog dialog("This saved game was created with a different version of the game, unable to load it", "OK"); - dialog.runModal(); + showScummVMDialog("This saved game was created with a different version of the game, unable to load it"); s->r_acc = make_reg(0, 1); // signal failure return; |