Permalink
Browse files

SUPERNOVA: Implements Return To Launcher

  • Loading branch information...
Joefish committed Aug 27, 2017
1 parent ed61ba3 commit c58864bb69cb014acc663e67fdd7cbe45ace4e93
Showing with 11 additions and 10 deletions.
  1. +1 −1 engines/supernova/state.cpp
  2. +10 −8 engines/supernova/supernova.cpp
  3. +0 −1 engines/supernova/supernova.h
@@ -351,7 +351,7 @@ void GameManager::processInput(Common::KeyState &state) {
case Common::KEYCODE_x:
if (state.flags & Common::KBD_ALT) {
// quit game
_vm->_gameRunning = false;
_vm->quitGame();
}
break;
default:
@@ -104,7 +104,6 @@ SupernovaEngine::SupernovaEngine(OSystem *syst)
, _imageIndex(0)
, _sectionIndex(0)
, _delay(33)
, _gameRunning(true)
, _screenWidth(320)
, _screenHeight(200)
, _messageDisplayed(false)
@@ -143,7 +142,7 @@ Common::Error SupernovaEngine::run() {
CursorMan.replaceCursorPalette(initVGAPalette, 0, 16);
CursorMan.showMouse(true);
while (_gameRunning) {
while (!shouldQuit()) {
uint32 start = _system->getMillis();
updateEvents();
_gm->executeRoom();
@@ -169,11 +168,6 @@ void SupernovaEngine::updateEvents() {
_gm->_keyPressed = false;
while (g_system->getEventManager()->pollEvent(_event)) {
switch (_event.type) {
case Common::EVENT_QUIT:
case Common::EVENT_RTL:
_gameRunning = false;
break;
case Common::EVENT_KEYDOWN:
_gm->_keyPressed = true;
if (_event.kbd.keycode == Common::KEYCODE_d &&
@@ -183,7 +177,6 @@ void SupernovaEngine::updateEvents() {
if (_event.kbd.keycode == Common::KEYCODE_x &&
(_event.kbd.flags & Common::KBD_CTRL)) {
// TODO: Draw exit box
_gameRunning = false;
}
_gm->processInput(_event.kbd);
@@ -208,6 +201,15 @@ void SupernovaEngine::updateEvents() {
}
}
bool SupernovaEngine::hasFeature(EngineFeature f) const {
switch (f) {
case kSupportsRTL:
return true;
default:
return false;
}
}
void SupernovaEngine::initData() {
// Images
for (int i = 0; i < 44; ++i)
@@ -93,7 +93,6 @@ class SupernovaEngine : public Engine {
} _soundSamples[kAudioNumSamples];
Common::MemoryReadStream *_soundMusic[2];
Common::Event _event;
bool _gameRunning;
int _screenWidth;
int _screenHeight;

0 comments on commit c58864b

Please sign in to comment.