aboutsummaryrefslogtreecommitdiff
path: root/engines/sky
diff options
context:
space:
mode:
authorChristopher Page2008-06-25 03:17:01 +0000
committerChristopher Page2008-06-25 03:17:01 +0000
commit27c427add299399a71fe96f591690e589e35c031 (patch)
tree9282a0966c5ac5fb55158ed88a4582f6abf441ae /engines/sky
parent7d0eb4f4f069beea93f970b2918ad6cf65c2eaa7 (diff)
downloadscummvm-rg350-27c427add299399a71fe96f591690e589e35c031.tar.gz
scummvm-rg350-27c427add299399a71fe96f591690e589e35c031.tar.bz2
scummvm-rg350-27c427add299399a71fe96f591690e589e35c031.zip
Scumm and sky now use the new _quit flag
svn-id: r32775
Diffstat (limited to 'engines/sky')
-rw-r--r--engines/sky/control.cpp10
-rw-r--r--engines/sky/intro.cpp3
-rw-r--r--engines/sky/intro.h1
-rw-r--r--engines/sky/logic.cpp2
-rw-r--r--engines/sky/mouse.cpp2
-rw-r--r--engines/sky/sky.cpp15
-rw-r--r--engines/sky/sky.h1
7 files changed, 13 insertions, 21 deletions
diff --git a/engines/sky/control.cpp b/engines/sky/control.cpp
index 53169402e1..5955c851f6 100644
--- a/engines/sky/control.cpp
+++ b/engines/sky/control.cpp
@@ -492,7 +492,7 @@ void Control::doControlPanel(void) {
_curButtonText = 0;
uint16 clickRes = 0;
- while (!quitPanel && !SkyEngine::_systemVars.quitGame) {
+ while (!quitPanel && !g_engine->_quit) {
_text->drawToScreen(WITH_MASK);
_system->updateScreen();
_mouseClicked = false;
@@ -524,7 +524,7 @@ void Control::doControlPanel(void) {
}
memset(_screenBuf, 0, GAME_SCREEN_WIDTH * FULL_SCREEN_HEIGHT);
_system->copyRectToScreen(_screenBuf, GAME_SCREEN_WIDTH, 0, 0, GAME_SCREEN_WIDTH, FULL_SCREEN_HEIGHT);
- if (!SkyEngine::_systemVars.quitGame)
+ if (!g_engine->_quit)
_system->updateScreen();
_skyScreen->forceRefresh();
_skyScreen->setPaletteEndian((uint8 *)_skyCompact->fetchCpt(SkyEngine::_systemVars.currentPalette));
@@ -603,7 +603,7 @@ uint16 Control::handleClick(ConResource *pButton) {
case QUIT_TO_DOS:
animClick(pButton);
if (getYesNo(quitDos))
- SkyEngine::_systemVars.quitGame = true;
+ g_engine->_quit = true;
return 0;
default:
error("Control::handleClick: unknown routine: %X",pButton->_onClick);
@@ -875,7 +875,7 @@ uint16 Control::saveRestorePanel(bool allowSave) {
bool refreshNames = true;
bool refreshAll = true;
uint16 clickRes = 0;
- while (!quitPanel && !SkyEngine::_systemVars.quitGame) {
+ while (!quitPanel && !g_engine->_quit) {
clickRes = 0;
if (refreshNames || refreshAll) {
if (refreshAll) {
@@ -1547,7 +1547,7 @@ void Control::delay(unsigned int amount) {
_mouseWheel = 1;
break;
case Common::EVENT_QUIT:
- SkyEngine::_systemVars.quitGame = true;
+ g_engine->_quit = true;
break;
default:
break;
diff --git a/engines/sky/intro.cpp b/engines/sky/intro.cpp
index 024360561c..f5699eb2f1 100644
--- a/engines/sky/intro.cpp
+++ b/engines/sky/intro.cpp
@@ -636,7 +636,6 @@ Intro::Intro(Disk *disk, Screen *screen, MusicBase *music, Sound *sound, Text *t
_textBuf = (uint8*)malloc(10000);
_saveBuf = (uint8*)malloc(10000);
_bgBuf = NULL;
- _quitProg = false;
_relDelay = 0;
}
@@ -913,7 +912,7 @@ bool Intro::escDelay(uint32 msecs) {
if (event.kbd.keycode == Common::KEYCODE_ESCAPE)
return false;
} else if (event.type == Common::EVENT_QUIT) {
- _quitProg = true;
+ g_engine->_quit = true;
return false;
}
}
diff --git a/engines/sky/intro.h b/engines/sky/intro.h
index 4a54fb8dd3..796bcf7e36 100644
--- a/engines/sky/intro.h
+++ b/engines/sky/intro.h
@@ -43,7 +43,6 @@ public:
Intro(Disk *disk, Screen *screen, MusicBase *music, Sound *sound, Text *text, Audio::Mixer *mixer, OSystem *system);
~Intro(void);
bool doIntro(bool floppyIntro);
- bool _quitProg;
private:
static uint16 _mainIntroSeq[];
static uint16 _floppyIntroSeq[];
diff --git a/engines/sky/logic.cpp b/engines/sky/logic.cpp
index ed7e419f64..936efdacbe 100644
--- a/engines/sky/logic.cpp
+++ b/engines/sky/logic.cpp
@@ -2489,7 +2489,7 @@ bool Logic::fnFadeUp(uint32 a, uint32 b, uint32 c) {
}
bool Logic::fnQuitToDos(uint32 a, uint32 b, uint32 c) {
- SkyEngine::_systemVars.quitGame = true;
+ g_engine->_quit = true;
return false;
}
diff --git a/engines/sky/mouse.cpp b/engines/sky/mouse.cpp
index b3be8b4f36..38a3b6a8e9 100644
--- a/engines/sky/mouse.cpp
+++ b/engines/sky/mouse.cpp
@@ -180,7 +180,7 @@ void Mouse::waitMouseNotPressed(int minDelay) {
while (mousePressed || _system->getMillis() < now + minDelay) {
if (eventMan->shouldQuit()) {
- SkyEngine::_systemVars.quitGame = true;
+ g_engine->_quit = true;
minDelay = 0;
mousePressed = false;
}
diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp
index d87ed06fef..072d0c914e 100644
--- a/engines/sky/sky.cpp
+++ b/engines/sky/sky.cpp
@@ -257,7 +257,7 @@ namespace Sky {
void *SkyEngine::_itemList[300];
-SystemVars SkyEngine::_systemVars = {0, 0, 0, 0, 4316, 0, 0, false, false, false };
+SystemVars SkyEngine::_systemVars = {0, 0, 0, 0, 4316, 0, 0, false, false };
SkyEngine::SkyEngine(OSystem *syst)
: Engine(syst), _fastMode(0), _debugger(0) {
@@ -340,8 +340,6 @@ void SkyEngine::handleKey(void) {
int SkyEngine::go() {
- _systemVars.quitGame = false;
-
_keyPressed.reset();
uint16 result = 0;
@@ -353,12 +351,9 @@ int SkyEngine::go() {
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 (!_systemVars.quitGame) {
+ if (!_quit) {
_skyLogic->initScreen0();
if (introSkipped)
_skyControl->restartGame();
@@ -368,7 +363,7 @@ int SkyEngine::go() {
_lastSaveTime = _system->getMillis();
uint32 delayCount = _system->getMillis();
- while (!_systemVars.quitGame) {
+ while (!_quit) {
if (_debugger->isAttached())
_debugger->onFrame();
@@ -419,7 +414,7 @@ int SkyEngine::go() {
_skyMusic->stopMusic();
ConfMan.flushToDisk();
delay(1500);
- return 0;
+ return _rtl;
}
int SkyEngine::init() {
@@ -616,7 +611,7 @@ void SkyEngine::delay(int32 amount) {
_skyMouse->buttonPressed(1);
break;
case Common::EVENT_QUIT:
- _systemVars.quitGame = true;
+ _quit = true;
break;
default:
break;
diff --git a/engines/sky/sky.h b/engines/sky/sky.h
index b5d1701930..47aebaba77 100644
--- a/engines/sky/sky.h
+++ b/engines/sky/sky.h
@@ -41,7 +41,6 @@ struct SystemVars {
uint16 gameSpeed;
uint16 currentMusic;
bool pastIntro;
- bool quitGame;
bool paused;
};