diff options
author | Robert Špalek | 2009-10-03 22:07:18 +0000 |
---|---|---|
committer | Robert Špalek | 2009-10-03 22:07:18 +0000 |
commit | 3035ca2fd3e5457aedb30dfc002c6bb1303fbbf4 (patch) | |
tree | 141fec42cbfc4a0446d48e3091afc0d945dd8916 /engines/draci/draci.cpp | |
parent | c0773975f54dd862fa7d68df900236ea63a6b509 (diff) | |
download | scummvm-rg350-3035ca2fd3e5457aedb30dfc002c6bb1303fbbf4.tar.gz scummvm-rg350-3035ca2fd3e5457aedb30dfc002c6bb1303fbbf4.tar.bz2 scummvm-rg350-3035ca2fd3e5457aedb30dfc002c6bb1303fbbf4.zip |
Let Ctrl-Left click behave like Right lick in Dragon History.
Also, started implementing Advanced Engine Features:
- pause support
- RTL support
svn-id: r44575
Diffstat (limited to 'engines/draci/draci.cpp')
-rw-r--r-- | engines/draci/draci.cpp | 66 |
1 files changed, 56 insertions, 10 deletions
diff --git a/engines/draci/draci.cpp b/engines/draci/draci.cpp index aaf24430ff..14deb60603 100644 --- a/engines/draci/draci.cpp +++ b/engines/draci/draci.cpp @@ -173,21 +173,24 @@ int DraciEngine::init() { return Common::kNoError; } -bool DraciEngine::handleEvents() { +void DraciEngine::handleEvents() { Common::Event event; - bool quit = false; while (_eventMan->pollEvent(event)) { switch (event.type) { case Common::EVENT_QUIT: + case Common::EVENT_RTL: _game->setQuit(true); break; case Common::EVENT_KEYDOWN: - if (event.kbd.keycode == Common::KEYCODE_RIGHT) { + switch (event.kbd.keycode) { + case Common::KEYCODE_RIGHT: _game->scheduleEnteringRoomUsingGate(_game->nextRoomNum(), 0); - } else if (event.kbd.keycode == Common::KEYCODE_LEFT) { + break; + case Common::KEYCODE_LEFT: _game->scheduleEnteringRoomUsingGate(_game->prevRoomNum(), 0); - } else if (event.kbd.keycode == Common::KEYCODE_ESCAPE) { + break; + case Common::KEYCODE_ESCAPE: { const int escRoom = _game->getRoomNum() != _game->getMapRoom() ? _game->getEscRoom() : _game->getPreviousRoomNum(); @@ -202,16 +205,20 @@ bool DraciEngine::handleEvents() { // End any currently running GPL programs _script->endCurrentProgram(); } - } else if (event.kbd.keycode == Common::KEYCODE_m) { + break; + } + case Common::KEYCODE_m: if (_game->getLoopStatus() == kStatusOrdinary) { const int new_room = _game->getRoomNum() != _game->getMapRoom() ? _game->getMapRoom() : _game->getPreviousRoomNum(); _game->scheduleEnteringRoomUsingGate(new_room, 0); } - } else if (event.kbd.keycode == Common::KEYCODE_w) { + break; + case Common::KEYCODE_w: // Show walking map toggle _showWalkingMap = !_showWalkingMap; - } else if (event.kbd.keycode == Common::KEYCODE_i) { + break; + case Common::KEYCODE_i: if (_game->getLoopStatus() == kStatusInventory && _game->getLoopSubstatus() == kSubstatusOrdinary) { _game->inventoryDone(); @@ -219,6 +226,31 @@ bool DraciEngine::handleEvents() { _game->getLoopSubstatus() == kSubstatusOrdinary) { _game->inventoryInit(); } + break; + case Common::KEYCODE_LCTRL: + debugC(6, kDraciGeneralDebugLevel, "Left Ctrl down"); + _mouse->downModifier(0); + break; + case Common::KEYCODE_RCTRL: + debugC(6, kDraciGeneralDebugLevel, "Right Ctrl down"); + _mouse->downModifier(1); + break; + default: + break; + } + break; + case Common::EVENT_KEYUP: + switch (event.kbd.keycode) { + case Common::KEYCODE_LCTRL: + debugC(6, kDraciGeneralDebugLevel, "Left Ctrl up"); + _mouse->upModifier(0); + break; + case Common::KEYCODE_RCTRL: + debugC(6, kDraciGeneralDebugLevel, "Right Ctrl up"); + _mouse->upModifier(1); + break; + default: + break; } break; default: @@ -234,9 +266,8 @@ bool DraciEngine::handleEvents() { } else if (!_showWalkingMap && _anims->getAnimation(kWalkingMapOverlay)->isPlaying()) { _anims->stop(kWalkingMapOverlay); } - - return quit; } + DraciEngine::~DraciEngine() { // Dispose your resources here @@ -275,4 +306,19 @@ Common::Error DraciEngine::run() { return Common::kNoError; } +void DraciEngine::pauseEngineIntern(bool pause) { + Engine::pauseEngineIntern(pause); + if (pause) { + _anims->pauseAnimations(); + } else { + _anims->unpauseAnimations(); + } +} + +void DraciEngine::syncSoundSettings() { + Engine::syncSoundSettings(); + + // TODO: update our volumes +} + } // End of namespace Draci |