diff options
author | Torbjörn Andersson | 2004-06-10 06:48:50 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2004-06-10 06:48:50 +0000 |
commit | 3c70f5a85c6619d60d1f58b821c5cc3fd866ce74 (patch) | |
tree | 34c29418ef0a4aebd59b2c89e75d83de705de890 /sword2/controls.cpp | |
parent | dabb32ce1ac3ffd961c2cb222d6f48e4e29f6356 (diff) | |
download | scummvm-rg350-3c70f5a85c6619d60d1f58b821c5cc3fd866ce74.tar.gz scummvm-rg350-3c70f5a85c6619d60d1f58b821c5cc3fd866ce74.tar.bz2 scummvm-rg350-3c70f5a85c6619d60d1f58b821c5cc3fd866ce74.zip |
If the 'time' parameter to displayMsg() is 0, wait until the user clicks
or presses a button. This is how displayMsg() was always used, so the only
difference is that the code to check for events is no longer outside the
function.
In the process, it turned out that removeMsg() was probably unnecessary so
I have removed it. May cause regressions, but we can deal with them later.
svn-id: r13953
Diffstat (limited to 'sword2/controls.cpp')
-rw-r--r-- | sword2/controls.cpp | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/sword2/controls.cpp b/sword2/controls.cpp index b628648115..e710813247 100644 --- a/sword2/controls.cpp +++ b/sword2/controls.cpp @@ -1164,8 +1164,6 @@ private: Button *_okButton; Button *_cancelButton; - void saveLoadError(byte *text); - public: SaveLoadDialog(Gui *gui, int mode) : Dialog(gui), _mode(mode), _selectedSlot(-1) { @@ -1433,7 +1431,7 @@ public: break; } - saveLoadError(_gui->_vm->fetchTextLine(_gui->_vm->_resman->openResource(textId / SIZE), textId & 0xffff) + 2); + _gui->_vm->displayMsg(_gui->_vm->fetchTextLine(_gui->_vm->_resman->openResource(textId / SIZE), textId & 0xffff) + 2, 0); result = 0; } } else { @@ -1454,7 +1452,7 @@ public: break; } - saveLoadError(_gui->_vm->fetchTextLine(_gui->_vm->_resman->openResource(textId / SIZE), textId & 0xffff) + 2); + _gui->_vm->displayMsg(_gui->_vm->fetchTextLine(_gui->_vm->_resman->openResource(textId / SIZE), textId & 0xffff) + 2, 0); result = 0; } else { // Prime system with a game cycle @@ -1476,29 +1474,6 @@ public: } }; -void SaveLoadDialog::saveLoadError(byte* text) { - // Print a message on screen. Second parameter is duration. - _gui->_vm->displayMsg((byte *) text, 0); - - // Wait for ESC or mouse click - while (1) { - _gui->_vm->_graphics->updateDisplay(); - - KeyboardEvent *ke = _gui->_vm->keyboardEvent(); - if (ke && ke->keycode == 27) - break; - - MouseEvent *me = _gui->_vm->mouseEvent(); - if (me && (me->buttons & RD_LEFTBUTTONDOWN)) - break; - - _gui->_vm->_system->delay_msecs(20); - } - - // Remove the message. - _gui->_vm->removeMsg(); -} - Gui::Gui(Sword2Engine *vm) : _vm(vm), _baseSlot(0) { int i; |