diff options
author | Joseph-Eugene Winzer | 2017-07-25 02:02:04 +0200 |
---|---|---|
committer | Thierry Crozat | 2018-01-23 00:28:29 +0000 |
commit | daf55369a9a454607ed649c8fd102ef3b7826dd4 (patch) | |
tree | 1f2a53f628764042f0312285c2b85c7bc7ca8541 /engines/supernova | |
parent | ffcd447a08ff55fbeb677ab9117c80ccf4b4bbbc (diff) | |
download | scummvm-rg350-daf55369a9a454607ed649c8fd102ef3b7826dd4.tar.gz scummvm-rg350-daf55369a9a454607ed649c8fd102ef3b7826dd4.tar.bz2 scummvm-rg350-daf55369a9a454607ed649c8fd102ef3b7826dd4.zip |
SUPERNOVA: Implements showing cockpit monitor
Diffstat (limited to 'engines/supernova')
-rw-r--r-- | engines/supernova/rooms.cpp | 54 | ||||
-rw-r--r-- | engines/supernova/state.h | 2 |
2 files changed, 31 insertions, 25 deletions
diff --git a/engines/supernova/rooms.cpp b/engines/supernova/rooms.cpp index e7ee6cf657..2a05471e3d 100644 --- a/engines/supernova/rooms.cpp +++ b/engines/supernova/rooms.cpp @@ -310,34 +310,38 @@ void ShipSleepCabin::onEntrance() { } bool ShipCockpit::interact(Action verb, Object &obj1, Object &obj2) { + // TODO: distance and remaining time not accurate char c[2] = {0}; if ((verb == ACTION_LOOK) && (obj1._id == MONITOR)) { - setSectionVisible(kMaxSection - 1, true); - _vm->renderBox(0, 0, 320, 200, kColorBlack); - _vm->renderText("Geschwindigkeit: ", 50, 50, kColorLightYellow); - if (_gm->_state.time) - _vm->renderText("8000 hpm"); - else - _vm->renderText("0 hpm"); - _vm->renderText("Ziel: Arsano 3", 50, 70, kColorLightYellow); - _vm->renderText("Entfernung: ", 50, 90, kColorLightYellow); - _vm->renderText(Common::String::format("%d", _gm->_state.time / 400).c_str()); - _vm->renderText(","); - c[0] = (_gm->_state.time / 40) % 10 + '0'; - _vm->renderText(c); - c[0] = (_gm->_state.time / 4) % 10 + '0'; - _vm->renderText(c); - _vm->renderText(" Lichtjahre"); - _vm->renderText("Dauer der Reise bei momentaner Geschwindigkeit:", 50, 110, 14); - _vm->renderText(Common::String::format("%d", _gm->_state.time).c_str(), 50, 120, kColorLightYellow); - _vm->renderText(" Tage"); - _gm->mouseInput2(); - setSectionVisible(kMaxSection - 1, false); - _vm->renderRoom(*this); - _gm->showMenu(); - _gm->drawMapExits(); - _vm->paletteBrightness(); + _gm->_guiEnabled = false; + _vm->renderBox(0, 0, 320, 200, kColorBlack); + _vm->renderText("Geschwindigkeit: ", 50, 50, kColorLightYellow); + if (_gm->_state.time) + _vm->renderText("8000 hpm"); + else + _vm->renderText("0 hpm"); + _vm->renderText("Ziel: Arsano 3", 50, 70, kColorLightYellow); + _vm->renderText("Entfernung: ", 50, 90, kColorLightYellow); + _vm->renderText(Common::String::format("%d", _gm->_state.timeStarting / 7200000).c_str()); + _vm->renderText(","); + c[0] = (_gm->_state.timeStarting / 720000) % 10 + '0'; + _vm->renderText(c); + c[0] = (_gm->_state.timeStarting / 72000) % 10 + '0'; + _vm->renderText(c); + _vm->renderText(" Lichtjahre"); + _vm->renderText("Dauer der Reise bei momentaner Geschwindigkeit:", 50, 110, kColorLightYellow); + _vm->renderText(Common::String::format("%d", _gm->_state.timeStarting / 18000).c_str(), 50, 120, kColorLightYellow); + _vm->renderText(" Tage"); + + while (!_gm->_guiEnabled) { + _vm->updateEvents(); + if (_gm->_key || _gm->_mouseClicked) { + _gm->_guiEnabled = true; + } + g_system->updateScreen(); + g_system->delayMillis(_vm->_delay); + } } else if ((verb == ACTION_USE) && (obj1._id == INSTRUMENTS)) _vm->renderMessage("VergiĆ” nicht, du bist nur der|Schiffskoch und hast keine Ahnung,|wie man ein Raumschiff fliegt."); else diff --git a/engines/supernova/state.h b/engines/supernova/state.h index 70015e4929..d37069efa8 100644 --- a/engines/supernova/state.h +++ b/engines/supernova/state.h @@ -105,6 +105,7 @@ public: SupernovaEngine *_vm; uint16 _key; Common::EventType _mouseClickType; + bool _mouseClicked; int _mouseX; int _mouseY; int _mouseField; @@ -114,6 +115,7 @@ public: GameState _state; int _status; bool _processInput; + bool _guiEnabled; Action _inputVerb; Object *_currentInputObject; Object *_inputObject[2]; |