diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/gui.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/gui_v1.cpp | 5 | ||||
-rw-r--r-- | engines/kyra/kyra.h | 7 | ||||
-rw-r--r-- | engines/kyra/kyra_v2.cpp | 4 | ||||
-rw-r--r-- | engines/kyra/kyra_v2.h | 2 | ||||
-rw-r--r-- | engines/kyra/kyra_v3.cpp | 8 | ||||
-rw-r--r-- | engines/kyra/kyra_v3.h | 1 | ||||
-rw-r--r-- | engines/kyra/saveload.cpp | 3 | ||||
-rw-r--r-- | engines/kyra/screen.h | 6 |
9 files changed, 13 insertions, 25 deletions
diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp index 5581f636b1..cb746f6f0c 100644 --- a/engines/kyra/gui.cpp +++ b/engines/kyra/gui.cpp @@ -309,7 +309,7 @@ void GUI::updateSaveList() { s1 = (*i)[i->size()-3] - '0'; s2 = (*i)[i->size()-2] - '0'; s3 = (*i)[i->size()-1] - '0'; - if (s1 < 0 || s2 < 0 || s3 < 0 || s1 > 9 || s2 > 9 || s3 > 9) + if (!isdigit(s1) || !isdigit(s2) || !isdigit(s3)) continue; _saveSlots.push_back(s1*100+s2*10+s3); } diff --git a/engines/kyra/gui_v1.cpp b/engines/kyra/gui_v1.cpp index 12c9648f10..e5800832cb 100644 --- a/engines/kyra/gui_v1.cpp +++ b/engines/kyra/gui_v1.cpp @@ -624,6 +624,8 @@ int GUI_v1::loadGameMenu(Button *button) { _displaySubMenu = true; _cancelSubMenu = false; + _vm->_gameToLoad = -1; + while (_displaySubMenu && !_vm->_quitFlag) { getInput(); Common::Point mouse = _vm->getMousePos(); @@ -639,7 +641,8 @@ int GUI_v1::loadGameMenu(Button *button) { updateAllMenuButtons(); } else { restorePalette(); - _vm->loadGame(_vm->getSavegameFilename(_vm->_gameToLoad)); + if (_vm->_gameToLoad != -1) + _vm->loadGame(_vm->getSavegameFilename(_vm->_gameToLoad)); _displayMenu = false; _menuRestoreScreen = false; } diff --git a/engines/kyra/kyra.h b/engines/kyra/kyra.h index 6c54a81953..a865bf2c3b 100644 --- a/engines/kyra/kyra.h +++ b/engines/kyra/kyra.h @@ -28,10 +28,8 @@ #include "engines/engine.h" -#include "common/rect.h" #include "common/array.h" #include "common/events.h" -#include "common/func.h" #include "kyra/script.h" @@ -57,11 +55,6 @@ struct GameFlags { byte gameID; }; -struct Rect { - int x, y; - int x2, y2; -}; - enum { GI_KYRA1 = 0, GI_KYRA2 = 1, diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index d9b3e896ff..2d1ab536bc 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -186,10 +186,6 @@ KyraEngine_v2::~KyraEngine_v2() { _timOpcodes.clear(); } -Movie *KyraEngine_v2::createWSAMovie() { - return new WSAMovieV2(this, _screen); -} - int KyraEngine_v2::init() { _screen = new Screen_v2(this, _system); assert(_screen); diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h index 50bd05666d..36ec1563ad 100644 --- a/engines/kyra/kyra_v2.h +++ b/engines/kyra/kyra_v2.h @@ -203,8 +203,6 @@ public: Screen_v2 *screen_v2() { return _screen; } virtual TextDisplayer *text() { return _text; } int language() const { return _lang; } - - virtual Movie *createWSAMovie(); protected: // intro/outro void seq_playSequences(int startSeq, int endSeq = -1); diff --git a/engines/kyra/kyra_v3.cpp b/engines/kyra/kyra_v3.cpp index 35a391a52e..9ca23d0a9d 100644 --- a/engines/kyra/kyra_v3.cpp +++ b/engines/kyra/kyra_v3.cpp @@ -1645,13 +1645,5 @@ void KyraEngine_v3::changeChapter(int newChapter, int sceneId, int malcolmShapes enterNewScene(sceneId, facing, 0, 0, 0); } -#pragma mark - - -Movie *KyraEngine_v3::createWSAMovie() { - WSAMovieV2 *movie = new WSAMovieV2(this, _screen); - assert(movie); - return movie; -} - } // end of namespace Kyra diff --git a/engines/kyra/kyra_v3.h b/engines/kyra/kyra_v3.h index 0fddbeb666..3ea2130ef9 100644 --- a/engines/kyra/kyra_v3.h +++ b/engines/kyra/kyra_v3.h @@ -60,7 +60,6 @@ public: void playVQA(const char *name); - virtual Movie *createWSAMovie(); private: Screen_v3 *_screen; SoundDigital *_soundDigital; diff --git a/engines/kyra/saveload.cpp b/engines/kyra/saveload.cpp index 358f61addf..c348c622a9 100644 --- a/engines/kyra/saveload.cpp +++ b/engines/kyra/saveload.cpp @@ -188,6 +188,9 @@ Common::OutSaveFile *KyraEngine::openSaveForWriting(const char *filename, const const char *KyraEngine::getSavegameFilename(int num) { static Common::String filename; + + assert(num >= 0 && num <= 999); + char extension[5]; sprintf(extension, "%.3d", num); diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h index 9eb2c835a4..5e806b36fc 100644 --- a/engines/kyra/screen.h +++ b/engines/kyra/screen.h @@ -36,7 +36,11 @@ namespace Kyra { typedef Common::Functor0<void> UpdateFunctor; class KyraEngine; -struct Rect; + +struct Rect { + int x, y; + int x2, y2; +}; struct ScreenDim { uint16 sx; |