diff options
author | Arnaud Boutonné | 2011-02-08 20:52:26 +0000 |
---|---|---|
committer | Arnaud Boutonné | 2011-02-08 20:52:26 +0000 |
commit | 4917740b44da8d7bac8b689febe98b183f1a8278 (patch) | |
tree | 8bd26966e27b994ea933640f164a9771c44708ea /engines/hugo/parser.cpp | |
parent | 72a9706950675cc3fd04e39d0f842193d66a5f9e (diff) | |
download | scummvm-rg350-4917740b44da8d7bac8b689febe98b183f1a8278.tar.gz scummvm-rg350-4917740b44da8d7bac8b689febe98b183f1a8278.tar.bz2 scummvm-rg350-4917740b44da8d7bac8b689febe98b183f1a8278.zip |
HUGO: Cleanup : some refactoring and encapsulation (thanks fuzzie for the help)
svn-id: r55831
Diffstat (limited to 'engines/hugo/parser.cpp')
-rw-r--r-- | engines/hugo/parser.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/engines/hugo/parser.cpp b/engines/hugo/parser.cpp index c354329d93..3a5f73e48b 100644 --- a/engines/hugo/parser.cpp +++ b/engines/hugo/parser.cpp @@ -47,6 +47,7 @@ #include "hugo/sound.h" #include "hugo/object.h" #include "hugo/text.h" +#include "hugo/inventory.h" namespace Hugo { @@ -88,8 +89,8 @@ void Parser::charHandler() { case Common::KEYCODE_RETURN: // EOL, pass line to line handler if (_cmdLineIndex && (_vm->_hero->pathType != kPathQuiet)) { // Remove inventory bar if active - if (gameStatus.inventoryState == kInventoryActive) - gameStatus.inventoryState = kInventoryUp; + if (_vm->_inventory->getInventoryState() == kInventoryActive) + _vm->_inventory->setInventoryState(kInventoryUp); // Call Line handler and reset line command(_cmdLine); _cmdLine[_cmdLineIndex = 0] = '\0'; @@ -172,8 +173,8 @@ void Parser::keyHandler(Common::Event event) { if (gameStatus.viewState == kViewIntro) gameStatus.skipIntroFl = true; else { - if (gameStatus.inventoryState == kInventoryActive) // Remove inventory, if displayed - gameStatus.inventoryState = kInventoryUp; + if (_vm->_inventory->getInventoryState() == kInventoryActive) // Remove inventory, if displayed + _vm->_inventory->setInventoryState(kInventoryUp); _vm->_screen->resetInventoryObjId(); } break; @@ -193,7 +194,7 @@ void Parser::keyHandler(Common::Event event) { case Common::KEYCODE_KP6: case Common::KEYCODE_KP8: case Common::KEYCODE_KP2: - gameStatus.routeIndex = -1; // Stop any automatic route + _vm->_route->resetRoute(); // Stop any automatic route _vm->_route->setWalk(nChar); // Direction of hero travel break; case Common::KEYCODE_F1: // User Help (DOS) |