aboutsummaryrefslogtreecommitdiff
path: root/engines/sky/sky.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sky/sky.cpp')
-rw-r--r--engines/sky/sky.cpp40
1 files changed, 18 insertions, 22 deletions
diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp
index 4f803cb393..d87ed06fef 100644
--- a/engines/sky/sky.cpp
+++ b/engines/sky/sky.cpp
@@ -110,10 +110,9 @@ public:
virtual const char *getName() const;
virtual const char *getCopyright() const;
- virtual bool hasFeature(MetaEngineFeature f) const;
virtual GameList getSupportedGames() const;
virtual GameDescriptor findGame(const char *gameid) const;
- virtual GameList detectGames(const FSList &fslist) const;
+ virtual GameList detectGames(const FSList &fslist) const;
virtual PluginError createInstance(OSystem *syst, Engine **engine) const;
@@ -128,13 +127,6 @@ const char *SkyMetaEngine::getCopyright() const {
return "Beneath a Steel Sky (C) Revolution";
}
-bool SkyMetaEngine::hasFeature(MetaEngineFeature f) const {
- return
- (f == kSupportsRTL) ||
- (f == kSupportsListSaves) ||
- (f == kSupportsDirectLoad);
-}
-
GameList SkyMetaEngine::getSupportedGames() const {
GameList games;
games.push_back(skySetting);
@@ -265,7 +257,7 @@ namespace Sky {
void *SkyEngine::_itemList[300];
-SystemVars SkyEngine::_systemVars = {0, 0, 0, 0, 4316, 0, 0, false, false };
+SystemVars SkyEngine::_systemVars = {0, 0, 0, 0, 4316, 0, 0, false, false, false };
SkyEngine::SkyEngine(OSystem *syst)
: Engine(syst), _fastMode(0), _debugger(0) {
@@ -285,8 +277,6 @@ SkyEngine::~SkyEngine() {
delete _skyDisk;
delete _skyControl;
delete _skyCompact;
- if (_skyIntro)
- delete _skyIntro;
for (int i = 0; i < 300; i++)
if (_itemList[i])
@@ -298,6 +288,8 @@ GUI::Debugger *SkyEngine::getDebugger() {
}
void SkyEngine::initVirgin() {
+
+ _skyScreen->setPalette(60111);
_skyScreen->showScreen(60110);
}
@@ -348,23 +340,25 @@ void SkyEngine::handleKey(void) {
int SkyEngine::go() {
+ _systemVars.quitGame = false;
+
_keyPressed.reset();
uint16 result = 0;
- if (ConfMan.hasKey("save_slot")) {
- int saveSlot = ConfMan.getInt("save_slot");
- if (saveSlot >= 0 && saveSlot <= 999)
- result = _skyControl->quickXRestore(ConfMan.getInt("save_slot"));
- }
+ if (ConfMan.hasKey("save_slot") && ConfMan.getInt("save_slot") >= 0)
+ result = _skyControl->quickXRestore(ConfMan.getInt("save_slot"));
if (result != GAME_RESTORED) {
bool introSkipped = false;
if (_systemVars.gameVersion > 267) { // don't do intro for floppydemos
_skyIntro = new Intro(_skyDisk, _skyScreen, _skyMusic, _skySound, _skyText, _mixer, _system);
introSkipped = !_skyIntro->doIntro(_floppyIntro);
+ _systemVars.quitGame = _skyIntro->_quitProg;
+
+ delete _skyIntro;
}
- if (!quit()) {
+ if (!_systemVars.quitGame) {
_skyLogic->initScreen0();
if (introSkipped)
_skyControl->restartGame();
@@ -374,7 +368,7 @@ int SkyEngine::go() {
_lastSaveTime = _system->getMillis();
uint32 delayCount = _system->getMillis();
- while (!quit()) {
+ while (!_systemVars.quitGame) {
if (_debugger->isAttached())
_debugger->onFrame();
@@ -425,7 +419,7 @@ int SkyEngine::go() {
_skyMusic->stopMusic();
ConfMan.flushToDisk();
delay(1500);
- return _eventMan->shouldRTL();
+ return 0;
}
int SkyEngine::init() {
@@ -446,7 +440,7 @@ int SkyEngine::init() {
_floppyIntro = ConfMan.getBool("alt_intro");
_skyDisk = new Disk();
- _skySound = new Sound(_mixer, _skyDisk, Audio::Mixer::kMaxChannelVolume);
+ _skySound = new Sound(_mixer, _skyDisk, ConfMan.getInt("sfx_volume"));
_systemVars.gameVersion = _skyDisk->determineGameVersion();
@@ -481,7 +475,6 @@ int SkyEngine::init() {
_systemVars.systemFlags |= SF_PLAY_VOCS;
_systemVars.gameSpeed = 50;
- _skyIntro = 0;
_skyCompact = new SkyCompact();
_skyText = new Text(_skyDisk, _skyCompact);
_skyMouse = new Mouse(_system, _skyDisk, _skyCompact);
@@ -622,6 +615,9 @@ void SkyEngine::delay(int32 amount) {
_skyMouse->mouseMoved(event.mouse.x, event.mouse.y);
_skyMouse->buttonPressed(1);
break;
+ case Common::EVENT_QUIT:
+ _systemVars.quitGame = true;
+ break;
default:
break;
}