aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Page2008-07-11 01:22:37 +0000
committerChristopher Page2008-07-11 01:22:37 +0000
commite9c6b03fc73ad5d556eb56afed6e55ef1b0bef67 (patch)
treef048b01ac7a0ec7d4ec754ef567feaa798c86a66
parentcbadb51ce75f2ec599203433b50c9d4bf5f51728 (diff)
downloadscummvm-rg350-e9c6b03fc73ad5d556eb56afed6e55ef1b0bef67.tar.gz
scummvm-rg350-e9c6b03fc73ad5d556eb56afed6e55ef1b0bef67.tar.bz2
scummvm-rg350-e9c6b03fc73ad5d556eb56afed6e55ef1b0bef67.zip
SCUMM works with new GMM implementation
svn-id: r33001
-rw-r--r--engines/scumm/dialogs.cpp2
-rw-r--r--engines/scumm/he/cup_player_he.cpp6
-rw-r--r--engines/scumm/he/script_v100he.cpp4
-rw-r--r--engines/scumm/he/script_v70he.cpp4
-rw-r--r--engines/scumm/he/script_v72he.cpp4
-rw-r--r--engines/scumm/input.cpp4
-rw-r--r--engines/scumm/resource.cpp2
-rw-r--r--engines/scumm/script_v5.cpp2
-rw-r--r--engines/scumm/script_v6.cpp2
-rw-r--r--engines/scumm/script_v8.cpp4
-rw-r--r--engines/scumm/scumm.cpp21
-rw-r--r--engines/scumm/scumm.h1
-rw-r--r--engines/scumm/smush/smush_player.cpp2
13 files changed, 22 insertions, 36 deletions
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index 07195f5a66..310cfc50a6 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -496,7 +496,7 @@ void ScummMenuDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 da
break;
#endif
case kQuitCmd:
- _vm->_quit = true;
+ _vm->quitGame();
close();
break;
default:
diff --git a/engines/scumm/he/cup_player_he.cpp b/engines/scumm/he/cup_player_he.cpp
index e611c85e9d..685bd00065 100644
--- a/engines/scumm/he/cup_player_he.cpp
+++ b/engines/scumm/he/cup_player_he.cpp
@@ -99,7 +99,7 @@ void CUP_Player::play() {
debug(1, "rate %d width %d height %d", _playbackRate, _width, _height);
int ticks = _system->getMillis();
- while (_dataSize != 0 && !_vm->_quit) {
+ while (_dataSize != 0 && !_vm->quit()) {
while (parseNextBlockTag(_fileStream)) {
if (_fileStream.ioFailed()) {
return;
@@ -190,7 +190,7 @@ void CUP_Player::waitForSfxChannel(int channel) {
CUP_SfxChannel *sfxChannel = &_sfxChannels[channel];
debug(1, "waitForSfxChannel %d", channel);
if ((sfxChannel->flags & kSfxFlagLoop) == 0) {
- while (_mixer->isSoundHandleActive(sfxChannel->handle) && !_vm->_quit) {
+ while (_mixer->isSoundHandleActive(sfxChannel->handle) && !_vm->quit()) {
_vm->parseEvents();
_system->delayMillis(10);
}
@@ -496,7 +496,7 @@ void CUP_Player::handleTOIL(Common::SeekableReadStream &dataStream, uint32 dataS
for (int i = 0; i < kSfxChannels; ++i) {
waitForSfxChannel(i);
}
- _vm->_quit = true;
+ _vm->quitGame();
break;
case 7: {
int channelSync = dataStream.readUint32LE();
diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp
index f72701c229..5f907d7f04 100644
--- a/engines/scumm/he/script_v100he.cpp
+++ b/engines/scumm/he/script_v100he.cpp
@@ -2147,10 +2147,10 @@ void ScummEngine_v100he::o100_systemOps() {
break;
case 71:
// Confirm shutdown
- shutDown();
+ quitGame();
break;
case 72:
- shutDown();
+ quitGame();
break;
case 73:
copyScriptString(string, sizeof(string));
diff --git a/engines/scumm/he/script_v70he.cpp b/engines/scumm/he/script_v70he.cpp
index 3f22c16648..c7256835eb 100644
--- a/engines/scumm/he/script_v70he.cpp
+++ b/engines/scumm/he/script_v70he.cpp
@@ -634,10 +634,10 @@ void ScummEngine_v70he::o70_systemOps() {
break;
case 160:
// Confirm shutdown
- shutDown();
+ quitGame();
break;
case 244:
- shutDown();
+ quitGame();
break;
case 250:
id = pop();
diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp
index df3d857642..6f68d56693 100644
--- a/engines/scumm/he/script_v72he.cpp
+++ b/engines/scumm/he/script_v72he.cpp
@@ -1485,10 +1485,10 @@ void ScummEngine_v72he::o72_systemOps() {
break;
case 160:
// Confirm shutdown
- shutDown();
+ quitGame();
break;
case 244:
- shutDown();
+ quitGame();
break;
case 251:
copyScriptString(string, sizeof(string));
diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp
index 1ccdd3bf94..cc98cc00ae 100644
--- a/engines/scumm/input.cpp
+++ b/engines/scumm/input.cpp
@@ -192,10 +192,6 @@ void ScummEngine::parseEvents() {
_keyPressed = Common::KeyState(Common::KEYCODE_6, 54); // '6'
break;
- case Common::EVENT_QUIT:
- _quit = true;
- break;
-
default:
break;
}
diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp
index acdc2bc222..8f7617885a 100644
--- a/engines/scumm/resource.cpp
+++ b/engines/scumm/resource.cpp
@@ -291,7 +291,7 @@ void ScummEngine::readIndexFile() {
if (checkTryMedia(_fileHandle)) {
displayMessage(NULL, "You're trying to run game encrypted by ActiveMark. This is not supported.");
- _quit = true;
+ quitGame();
return;
}
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index 431321f459..1d90b5e4af 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -1769,7 +1769,7 @@ void ScummEngine_v5::o5_systemOps() {
pauseGame();
break;
case 3: // SO_QUIT
- shutDown();
+ quitGame();
break;
default:
error("o5_systemOps: unknown subopcode %d", subOp);
diff --git a/engines/scumm/script_v6.cpp b/engines/scumm/script_v6.cpp
index 04ea53137b..f8502cbbe7 100644
--- a/engines/scumm/script_v6.cpp
+++ b/engines/scumm/script_v6.cpp
@@ -2310,7 +2310,7 @@ void ScummEngine_v6::o6_systemOps() {
pauseGame();
break;
case 160: // SO_QUIT
- shutDown();
+ quitGame();
break;
default:
error("o6_systemOps invalid case %d", subOp);
diff --git a/engines/scumm/script_v8.cpp b/engines/scumm/script_v8.cpp
index 08629afb07..63e54417a9 100644
--- a/engines/scumm/script_v8.cpp
+++ b/engines/scumm/script_v8.cpp
@@ -1170,7 +1170,7 @@ void ScummEngine_v8::o8_systemOps() {
restart();
break;
case 0x29: // SO_SYSTEM_QUIT Quit game
- shutDown();
+ quitGame();
break;
default:
error("o8_systemOps: invalid case 0x%x", subOp);
@@ -1289,7 +1289,7 @@ void ScummEngine_v8::o8_kernelSetFunctions() {
if (ConfMan.getBool("confirm_exit"))
confirmExitDialog();
else
- _quit = true;
+ quitGame();
break;
case 108: // buildPaletteShadow
setShadowPalette(args[1], args[2], args[3], args[4], args[5], args[6]);
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 0e62ef4b19..37e1fa862a 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -143,7 +143,6 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
_objs = NULL;
_sound = NULL;
memset(&vm, 0, sizeof(vm));
- _quit = false;
_pauseDialog = NULL;
_scummMenuDialog = NULL;
_versionDialog = NULL;
@@ -815,7 +814,6 @@ ScummEngine_vCUPhe::ScummEngine_vCUPhe(OSystem *syst, const DetectorResult &dr)
_syst = syst;
_game = dr.game;
_filenamePattern = dr.fp,
- _quit = false;
_cupPlayer = new CUP_Player(syst, this, _mixer);
}
@@ -846,9 +844,6 @@ void ScummEngine_vCUPhe::parseEvents() {
while (_eventMan->pollEvent(event)) {
switch (event.type) {
- case Common::EVENT_QUIT:
- _quit = true;
- break;
default:
break;
@@ -1722,7 +1717,7 @@ int ScummEngine::go() {
int diff = 0; // Duration of one loop iteration
- while (!_quit) {
+ while (!quit()) {
if (_debugger->isAttached())
_debugger->onFrame();
@@ -1755,12 +1750,12 @@ int ScummEngine::go() {
diff = _system->getMillis() - diff;
- if (_quit) {
+ if (quit()) {
// TODO: Maybe perform an autosave on exit?
}
}
- return _rtl;
+ return _eventMan->shouldRTL();
}
void ScummEngine::waitForTimer(int msec_delay) {
@@ -1773,7 +1768,7 @@ void ScummEngine::waitForTimer(int msec_delay) {
start_time = _system->getMillis();
- while (!_quit) {
+ while (!quit()) {
_sound->updateCD(); // Loop CD Audio if needed
parseEvents();
_system->updateScreen();
@@ -1896,7 +1891,7 @@ load_game:
checkExecVerbs();
checkAndRunSentenceScript();
- if (_quit)
+ if (quit())
return;
// HACK: If a load was requested, immediately perform it. This avoids
@@ -2161,10 +2156,6 @@ void ScummEngine::pauseGame() {
pauseDialog();
}
-void ScummEngine::shutDown() {
- _quit = true;
-}
-
void ScummEngine::restart() {
// TODO: Check this function - we should probably be reinitting a lot more stuff, and I suspect
// this leaks memory like a sieve
@@ -2317,7 +2308,7 @@ void ScummEngine::confirmExitDialog() {
ConfirmDialog d(this, 6);
if (runDialog(d)) {
- _quit = true;
+ quitGame();
}
}
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index fb7f3e6845..b1ab9f7386 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -496,7 +496,6 @@ protected:
public:
void pauseGame();
void restart();
- void shutDown();
protected:
Dialog *_pauseDialog;
diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp
index 494357a90c..850b547021 100644
--- a/engines/scumm/smush/smush_player.cpp
+++ b/engines/scumm/smush/smush_player.cpp
@@ -1333,7 +1333,7 @@ void SmushPlayer::play(const char *filename, int32 speed, int32 offset, int32 st
}
if (_endOfFile)
break;
- if (_vm->_quit || _vm->_saveLoadFlag || _vm->_smushVideoShouldFinish) {
+ if (_vm->quit() || _vm->_saveLoadFlag || _vm->_smushVideoShouldFinish) {
_smixer->stop();
_vm->_mixer->stopHandle(_compressedFileSoundHandle);
_vm->_mixer->stopHandle(_IACTchannel);