aboutsummaryrefslogtreecommitdiff
path: root/sword2
diff options
context:
space:
mode:
authorTorbjörn Andersson2004-01-08 13:03:50 +0000
committerTorbjörn Andersson2004-01-08 13:03:50 +0000
commit12cd552cab94537735aa6d89ce1ec1fd5dfa899e (patch)
tree027bbdd493a91e7e105c77fca4af1b721566beda /sword2
parentac801f9828133b04d078eea21bcd0323905ecddc (diff)
downloadscummvm-rg350-12cd552cab94537735aa6d89ce1ec1fd5dfa899e.tar.gz
scummvm-rg350-12cd552cab94537735aa6d89ce1ec1fd5dfa899e.tar.bz2
scummvm-rg350-12cd552cab94537735aa6d89ce1ec1fd5dfa899e.zip
Allow quitting during cutscenes and credits again. This is getting a bit
hackish... svn-id: r12247
Diffstat (limited to 'sword2')
-rw-r--r--sword2/driver/d_draw.cpp5
-rw-r--r--sword2/function.cpp10
-rw-r--r--sword2/sword2.cpp3
-rw-r--r--sword2/sword2.h4
4 files changed, 16 insertions, 6 deletions
diff --git a/sword2/driver/d_draw.cpp b/sword2/driver/d_draw.cpp
index 86e431af72..52226f794e 100644
--- a/sword2/driver/d_draw.cpp
+++ b/sword2/driver/d_draw.cpp
@@ -233,7 +233,7 @@ int32 MoviePlayer::play(char *filename, MovieTextObject *text[], uint8 *musicOut
KeyboardEvent ke;
- if (_vm->_input->readKey(&ke) == RD_OK && ke.keycode == 27) {
+ if ((_vm->_input->readKey(&ke) == RD_OK && ke.keycode == 27) || _vm->_quit) {
_vm->_mixer->stopHandle(handle);
skipCutscene = true;
break;
@@ -252,8 +252,9 @@ int32 MoviePlayer::play(char *filename, MovieTextObject *text[], uint8 *musicOut
// it's in use.
while (handle.isActive()) {
+ _vm->_graphics->updateDisplay(false);
_vm->_system->delay_msecs(100);
- };
+ }
closeTextObject(text[textCounter]);
diff --git a/sword2/function.cpp b/sword2/function.cpp
index e16a86d5ed..5166f23ad8 100644
--- a/sword2/function.cpp
+++ b/sword2/function.cpp
@@ -617,7 +617,7 @@ int32 Logic::fnPlayCredits(int32 *params) {
int startLine = 0;
int scrollPos = 0;
- while (scrollPos < lineTop + CREDITS_FONT_HEIGHT) {
+ while (scrollPos < lineTop + CREDITS_FONT_HEIGHT && !_vm->_quit) {
bool foundStartLine = false;
_vm->_graphics->clearScene();
@@ -685,6 +685,7 @@ int32 Logic::fnPlayCredits(int32 *params) {
fnStopMusic(NULL);
break;
}
+
_vm->_system->delay_msecs(30);
@@ -704,14 +705,19 @@ int32 Logic::fnPlayCredits(int32 *params) {
if (logoData)
free(logoData);
+ if (_vm->_quit)
+ return IR_CONT;
+
_vm->_graphics->fadeDown();
_vm->_graphics->waitForFade();
// The music should have stopped by now, but I suppose there is a
// slim chance it hasn't on a really, really fast computer.
- while (_vm->_sound->musicTimeRemaining())
+ while (_vm->_sound->musicTimeRemaining()) {
+ _vm->_graphics->updateDisplay(false);
_vm->_system->delay_msecs(100);
+ }
_vm->_sound->restoreMusicState();
_vm->_sound->muteFx(false);
diff --git a/sword2/sword2.cpp b/sword2/sword2.cpp
index a11d20dff9..0d69d6720d 100644
--- a/sword2/sword2.cpp
+++ b/sword2/sword2.cpp
@@ -293,6 +293,8 @@ void Sword2Engine::gameCycle(void) {
void Sword2Engine::go() {
KeyboardEvent ke;
+ _quit = false;
+
debug(5, "CALLING: readOptionSettings");
_gui->readOptionSettings();
@@ -318,7 +320,6 @@ void Sword2Engine::go() {
// 1 in 4 frames, to speed up game
_gameCycle = 0;
- _quit = false;
while (1) {
if (_debugger->isAttached())
diff --git a/sword2/sword2.h b/sword2/sword2.h
index 19335406aa..791fe56082 100644
--- a/sword2/sword2.h
+++ b/sword2/sword2.h
@@ -48,7 +48,6 @@ enum {
class Sword2Engine : public Engine {
private:
- bool _quit;
uint32 _bootParam;
int32 _saveSlot;
@@ -130,6 +129,9 @@ public:
~Sword2Engine();
void go(void);
int32 initialiseGame(void);
+
+ bool _quit;
+
uint32 _features;
char *_targetName; // target name for saves