[Scummvm-cvs-logs] SF.net SVN: scummvm:[53997] scummvm/trunk/engines/sword2
eriktorbjorn at users.sourceforge.net
eriktorbjorn at users.sourceforge.net
Mon Nov 1 12:25:12 CET 2010
Revision: 53997
http://scummvm.svn.sourceforge.net/scummvm/?rev=53997&view=rev
Author: eriktorbjorn
Date: 2010-11-01 11:25:11 +0000 (Mon, 01 Nov 2010)
Log Message:
-----------
SWORD2: Cleanup pause handling
Removed a bunch of pause-related code which I either can't remember why
it's there, or which doesn't seem to serve any useful purpose. Most
things I've tried seem to work as well or better than before.
Modified Paths:
--------------
scummvm/trunk/engines/sword2/animation.cpp
scummvm/trunk/engines/sword2/animation.h
scummvm/trunk/engines/sword2/logic.cpp
scummvm/trunk/engines/sword2/logic.h
scummvm/trunk/engines/sword2/palette.cpp
scummvm/trunk/engines/sword2/sound.cpp
scummvm/trunk/engines/sword2/sound.h
scummvm/trunk/engines/sword2/sword2.cpp
scummvm/trunk/engines/sword2/sword2.h
Modified: scummvm/trunk/engines/sword2/animation.cpp
===================================================================
--- scummvm/trunk/engines/sword2/animation.cpp 2010-11-01 06:31:09 UTC (rev 53996)
+++ scummvm/trunk/engines/sword2/animation.cpp 2010-11-01 11:25:11 UTC (rev 53997)
@@ -398,10 +398,4 @@
return NULL;
}
-void MoviePlayer::pauseMovie(bool pause) {
- if (_bgSoundHandle) {
- _snd->pauseHandle(*_bgSoundHandle, pause);
- }
-}
-
} // End of namespace Sword2
Modified: scummvm/trunk/engines/sword2/animation.h
===================================================================
--- scummvm/trunk/engines/sword2/animation.h 2010-11-01 06:31:09 UTC (rev 53996)
+++ scummvm/trunk/engines/sword2/animation.h 2010-11-01 11:25:11 UTC (rev 53997)
@@ -76,7 +76,6 @@
bool load(const char *name);
void play(MovieText *movieTexts, uint32 numMovieTexts, uint32 leadIn, uint32 leadOut);
- void pauseMovie(bool pause);
protected:
Sword2Engine *_vm;
Modified: scummvm/trunk/engines/sword2/logic.cpp
===================================================================
--- scummvm/trunk/engines/sword2/logic.cpp 2010-11-01 06:31:09 UTC (rev 53996)
+++ scummvm/trunk/engines/sword2/logic.cpp 2010-11-01 11:25:11 UTC (rev 53997)
@@ -278,16 +278,6 @@
}
/**
- * Pause or unpause the currently playing cutscene movie, if any.
- * @param pause true if pausing, false if unpausing
- */
-
-void Logic::pauseMovie(bool pause) {
- if (_moviePlayer)
- _moviePlayer->pauseMovie(pause);
-}
-
-/**
* Read current location number from script vars
*/
Modified: scummvm/trunk/engines/sword2/logic.h
===================================================================
--- scummvm/trunk/engines/sword2/logic.h 2010-11-01 06:31:09 UTC (rev 53996)
+++ scummvm/trunk/engines/sword2/logic.h 2010-11-01 11:25:11 UTC (rev 53997)
@@ -317,8 +317,6 @@
void logicOne(uint32 new_script);
void resetKillList();
- void pauseMovie(bool pause);
-
// Read location number from script vars
uint32 getLocationNum();
};
Modified: scummvm/trunk/engines/sword2/palette.cpp
===================================================================
--- scummvm/trunk/engines/sword2/palette.cpp 2010-11-01 06:31:09 UTC (rev 53996)
+++ scummvm/trunk/engines/sword2/palette.cpp 2010-11-01 11:25:11 UTC (rev 53997)
@@ -171,6 +171,9 @@
}
void Screen::dimPalette(bool dim) {
+ if (getFadeStatus() != RDFADE_NONE)
+ return;
+
if (dim != _dimPalette) {
_dimPalette = dim;
setSystemPalette(_palette, 0, 256);
Modified: scummvm/trunk/engines/sword2/sound.cpp
===================================================================
--- scummvm/trunk/engines/sword2/sound.cpp 2010-11-01 06:31:09 UTC (rev 53996)
+++ scummvm/trunk/engines/sword2/sound.cpp 2010-11-01 11:25:11 UTC (rev 53997)
@@ -393,18 +393,6 @@
return RD_OK;
}
-void Sound::pauseAllSound() {
- pauseMusic();
- pauseSpeech();
- pauseFx();
-}
-
-void Sound::unpauseAllSound() {
- unpauseMusic();
- unpauseSpeech();
- unpauseFx();
-}
-
void Sound::printFxQueue() {
int freeSlots = 0;
Modified: scummvm/trunk/engines/sword2/sound.h
===================================================================
--- scummvm/trunk/engines/sword2/sound.h 2010-11-01 06:31:09 UTC (rev 53996)
+++ scummvm/trunk/engines/sword2/sound.h 2010-11-01 11:25:11 UTC (rev 53997)
@@ -262,9 +262,6 @@
void pauseMusic();
void unpauseMusic();
- void pauseAllSound();
- void unpauseAllSound();
-
void playMovieSound(int32 res, int type);
void stopMovieSounds();
Modified: scummvm/trunk/engines/sword2/sword2.cpp
===================================================================
--- scummvm/trunk/engines/sword2/sword2.cpp 2010-11-01 06:31:09 UTC (rev 53996)
+++ scummvm/trunk/engines/sword2/sword2.cpp 2010-11-01 11:25:11 UTC (rev 53997)
@@ -295,8 +295,6 @@
_renderSkip = false;
#endif
- _gamePaused = false;
-
_gameCycle = 0;
_gameSpeed = 1;
@@ -516,10 +514,18 @@
} else if (ke->kbd.hasFlags(0) || ke->kbd.hasFlags(Common::KBD_SHIFT)) {
switch (ke->kbd.keycode) {
case Common::KEYCODE_p:
- if (_gamePaused)
+ if (isPaused()) {
+ _screen->dimPalette(false);
pauseEngine(false);
- else
+ } else {
pauseEngine(true);
+#ifdef SWORD2_DEBUG
+ if (!_stepOneCycle)
+ _screen->dimPalette(true);
+#else
+ _screen->dimPalette(true);
+#endif
+ }
break;
#if 0
// Disabled because of strange rumors about the
@@ -551,7 +557,7 @@
}
// skip GameCycle if we're paused
- if (!_gamePaused) {
+ if (!isPaused()) {
_gameCycle++;
gameCycle();
}
@@ -798,49 +804,13 @@
}
}
-void Sword2Engine::pauseEngine(bool pause) {
- if (pause == _gamePaused)
- return;
-
- // We don't need to hide the cursor for outside pausing. Not as long
- // as it replaces the cursor with the GUI cursor, at least.
-
- _mouse->pauseEngine(pause);
- pauseEngineIntern(pause);
-
- if (pause) {
-#ifdef SWORD2_DEBUG
- // Don't dim it if we're single-stepping through frames
- // dim the palette during the pause
-
- if (!_stepOneCycle)
- _screen->dimPalette(true);
-#else
- _screen->dimPalette(true);
-#endif
- } else {
- _screen->dimPalette(false);
-
- // If mouse is about or we're in a chooser menu
- if (!_mouse->getMouseStatus() || _mouse->isChoosing())
- _mouse->setMouse(NORMAL_MOUSE_ID);
- }
-}
-
void Sword2Engine::pauseEngineIntern(bool pause) {
- if (pause == _gamePaused)
- return;
+ Engine::pauseEngineIntern(pause);
if (pause) {
- _sound->pauseAllSound();
- _logic->pauseMovie(true);
_screen->pauseScreen(true);
- _gamePaused = true;
} else {
- _logic->pauseMovie(false);
_screen->pauseScreen(false);
- _sound->unpauseAllSound();
- _gamePaused = false;
}
}
Modified: scummvm/trunk/engines/sword2/sword2.h
===================================================================
--- scummvm/trunk/engines/sword2/sword2.h 2010-11-01 06:31:09 UTC (rev 53996)
+++ scummvm/trunk/engines/sword2/sword2.h 2010-11-01 11:25:11 UTC (rev 53997)
@@ -155,8 +155,6 @@
Sword2Engine(OSystem *syst);
~Sword2Engine();
- void pauseEngine(bool pause);
-
int getFramesPerSecond();
void registerDefaultSettings();
@@ -237,8 +235,6 @@
char *getSaveFileName(uint16 slotNo);
uint32 findBufferSize();
- bool _gamePaused;
-
void startGame();
void gameCycle();
void restartGame();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list