diff options
author | Max Horn | 2006-10-07 17:42:32 +0000 |
---|---|---|
committer | Max Horn | 2006-10-07 17:42:32 +0000 |
commit | ff6731e00a86d81bcc392c57586670a94497ded0 (patch) | |
tree | 0d1451fd45b06042c8d7999cb59807fe5e426cee | |
parent | 71bea97de7f4127cf45a4df5d824e9c7db32cc5c (diff) | |
download | scummvm-rg350-ff6731e00a86d81bcc392c57586670a94497ded0.tar.gz scummvm-rg350-ff6731e00a86d81bcc392c57586670a94497ded0.tar.bz2 scummvm-rg350-ff6731e00a86d81bcc392c57586670a94497ded0.zip |
Removed 'smushMode' param from processInput and processKeyboard in favor of a new member _smushActive of ScummEngine_v7
svn-id: r24175
-rw-r--r-- | engines/scumm/he/intern_he.h | 2 | ||||
-rw-r--r-- | engines/scumm/input.cpp | 36 | ||||
-rw-r--r-- | engines/scumm/intern.h | 15 | ||||
-rw-r--r-- | engines/scumm/scumm.cpp | 3 | ||||
-rw-r--r-- | engines/scumm/scumm.h | 6 | ||||
-rw-r--r-- | engines/scumm/smush/smush_player.cpp | 6 |
6 files changed, 38 insertions, 30 deletions
diff --git a/engines/scumm/he/intern_he.h b/engines/scumm/he/intern_he.h index 5c8009007a..bf5b7f47b4 100644 --- a/engines/scumm/he/intern_he.h +++ b/engines/scumm/he/intern_he.h @@ -467,7 +467,7 @@ protected: virtual void scummLoop_handleDrawing(); virtual void runBootscript(); - virtual void processInput(bool smushMode); + virtual void processInput(); virtual void clearClickedStatus(); virtual void saveOrLoad(Serializer *s); diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp index 2c07728308..3943553fbf 100644 --- a/engines/scumm/input.cpp +++ b/engines/scumm/input.cpp @@ -202,11 +202,11 @@ void ScummEngine_v90he::clearClickedStatus() { } } -void ScummEngine_v90he::processInput(bool smushMode) { +void ScummEngine_v90he::processInput() { if (_game.heversion >= 98) { _logicHE->processKeyStroke(_keyPressed); } - ScummEngine::processInput(smushMode); + ScummEngine::processInput(); } #endif @@ -218,7 +218,7 @@ void ScummEngine::clearClickedStatus() { _rightBtnPressed &= ~msClicked; } -void ScummEngine::processInput(bool smushMode) { +void ScummEngine::processInput() { _lastKeyHit = _keyPressed; _keyPressed = 0; @@ -296,7 +296,7 @@ void ScummEngine::processInput(bool smushMode) { #ifdef _WIN32_WCE if (_lastKeyHit == KEY_ALL_SKIP) { // Skip cutscene - if (smushMode || vm.cutScenePtr[vm.cutSceneStackPointer]) + if (_smushActive || vm.cutScenePtr[vm.cutSceneStackPointer]) _lastKeyHit = (VAR_CUTSCENEEXIT_KEY != 0xFF) ? (uint)VAR(VAR_CUTSCENEEXIT_KEY) : 27; else // Skip talk @@ -311,11 +311,11 @@ void ScummEngine::processInput(bool smushMode) { if (!_lastKeyHit) return; - processKeyboard(smushMode); + processKeyboard(); } #ifndef DISABLE_SCUMM_7_8 -void ScummEngine_v8::processKeyboard(bool smushMode) { +void ScummEngine_v8::processKeyboard() { // If a key script was specified (a V8 feature), and it's trigger // key was pressed, run it. if (_keyScriptNo && (_keyScriptKey == _lastKeyHit)) { @@ -324,10 +324,10 @@ void ScummEngine_v8::processKeyboard(bool smushMode) { } // Fall back to V7 behavior - ScummEngine_v7::processKeyboard(smushMode); + ScummEngine_v7::processKeyboard(); } -void ScummEngine_v7::processKeyboard(bool smushMode) { +void ScummEngine_v7::processKeyboard() { // COMI version string is hard coded in the engine, hence we don't // invoke versionDialog here (it would only show nonsense). @@ -339,13 +339,13 @@ void ScummEngine_v7::processKeyboard(bool smushMode) { if (VAR_CUTSCENEEXIT_KEY != 0xFF && _lastKeyHit == VAR(VAR_CUTSCENEEXIT_KEY)) { // Skip cutscene (or active SMUSH video). - if (smushMode) { + if (_smushActive) { if (_game.id == GID_FT) _insane->escapeKeyHandler(); else _smushVideoShouldFinish = true; } - if (!smushMode || _smushVideoShouldFinish) + if (!_smushActive || _smushVideoShouldFinish) abortCutscene(); _mouseAndKeyboardStat = _lastKeyHit; @@ -353,11 +353,11 @@ void ScummEngine_v7::processKeyboard(bool smushMode) { } // Fall back to V6 behavior - ScummEngine_v6::processKeyboard(smushMode); + ScummEngine_v6::processKeyboard(); } #endif -void ScummEngine_v6::processKeyboard(bool smushMode) { +void ScummEngine_v6::processKeyboard() { if (_lastKeyHit == 20) { // FIXME: What key is '20' supposed to indicate? I can't trigger // it with my keyboard, it seems... @@ -394,10 +394,10 @@ void ScummEngine_v6::processKeyboard(bool smushMode) { } // Fall back to default behavior - ScummEngine::processKeyboard(smushMode); + ScummEngine::processKeyboard(); } -void ScummEngine_v2::processKeyboard(bool smushMode) { +void ScummEngine_v2::processKeyboard() { if (_lastKeyHit == ' ') { // space pauseGame(); } else if (_lastKeyHit == 314+5) { // F5 @@ -411,7 +411,7 @@ void ScummEngine_v2::processKeyboard(bool smushMode) { abortCutscene(); } else { // Fall back to default behavior - ScummEngine::processKeyboard(smushMode); + ScummEngine::processKeyboard(); } // Store the input type. So far we can't distinguish @@ -429,16 +429,16 @@ void ScummEngine_v2::processKeyboard(bool smushMode) { } } -void ScummEngine_v3::processKeyboard(bool smushMode) { +void ScummEngine_v3::processKeyboard() { if (_game.platform == Common::kPlatformFMTowns && _lastKeyHit == 314+8) { // F8 confirmRestartDialog(); } else { // Fall back to default behavior - ScummEngine::processKeyboard(smushMode); + ScummEngine::processKeyboard(); } } -void ScummEngine::processKeyboard(bool smushMode) { +void ScummEngine::processKeyboard() { int saveloadkey; if ((_game.version <= 3) || (_game.id == GID_SAMNMAX) || (_game.id == GID_CMI) || (_game.heversion >= 72)) diff --git a/engines/scumm/intern.h b/engines/scumm/intern.h index bf90f315b5..3e091f7fbe 100644 --- a/engines/scumm/intern.h +++ b/engines/scumm/intern.h @@ -28,6 +28,9 @@ namespace Scumm { +class SmushMixer; + + // This is to help devices with small memory (PDA, smartphones, ...) // to save abit of memory used by opcode names in the Scumm engine. #ifndef REDUCE_MEMORY_USAGE @@ -230,7 +233,7 @@ protected: virtual void readRoomsOffsets(); virtual void loadCharset(int no); - virtual void processKeyboard(bool smushMode); + virtual void processKeyboard(); }; /** @@ -288,7 +291,7 @@ protected: virtual void resetScummVars(); virtual void decodeParseString(); - virtual void processKeyboard(bool smushMode); + virtual void processKeyboard(); virtual void readIndexFile(); void readClassicIndexFile(); // V1 @@ -586,6 +589,8 @@ protected: /** This flag is a hack to allow the pause dialog to pause SMUSH playback, too. */ bool _smushPaused; + bool _smushActive; + Insane *_insane; public: @@ -605,7 +610,7 @@ protected: virtual const char *getOpcodeDesc(byte i); virtual void scummLoop_handleActors(); - virtual void processKeyboard(bool smushMode); + virtual void processKeyboard(); virtual void setupScummVars(); virtual void decodeParseString(int a, int b); @@ -878,7 +883,7 @@ protected: virtual void scummLoop_handleSound(); virtual void scummLoop_handleDrawing(); - virtual void processKeyboard(bool smushMode); + virtual void processKeyboard(); virtual void setupScumm(); @@ -952,7 +957,7 @@ protected: virtual int getObjectIdFromOBIM(const byte *obim); - virtual void processKeyboard(bool smushMode); + virtual void processKeyboard(); void desaturatePalette(int hueScale, int satScale, int lightScale, int startColor, int endColor); diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index fafb9ca4bc..9f849facdd 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -777,6 +777,7 @@ ScummEngine_v7::ScummEngine_v7(OSystem *syst, const DetectorResult &dr) _smushFrameRate = 0; _smushVideoShouldFinish = false; _smushPaused = false; + _smushActive = false; _insaneRunning = false; _smixer = NULL; @@ -1636,7 +1637,7 @@ int ScummEngine::scummLoop(int delta) { if (_game.version <= 3) CHARSET_1(); - processInput(false); + processInput(); scummLoop_updateScummVars(); diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h index b03c217c0e..d29534a448 100644 --- a/engines/scumm/scumm.h +++ b/engines/scumm/scumm.h @@ -55,8 +55,6 @@ class BaseScummFile; class CharsetRenderer; class IMuse; class IMuseDigital; -class Insane; -class SmushMixer; class MusicEngine; class ScummEngine; class ScummDebugger; @@ -494,8 +492,8 @@ public: void parseEvents(); // Used by IMuseDigital::startSound protected: void waitForTimer(int msec_delay); - virtual void processInput(bool smushMode); - virtual void processKeyboard(bool smushMode); + virtual void processInput(); + virtual void processKeyboard(); virtual void clearClickedStatus(); // Cursor/palette diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp index d4f9164f83..7bdc70450d 100644 --- a/engines/scumm/smush/smush_player.cpp +++ b/engines/scumm/smush/smush_player.cpp @@ -284,7 +284,10 @@ SmushPlayer::~SmushPlayer() { void SmushPlayer::init() { _frame = 0; _alreadyInit = false; + _vm->_smushVideoShouldFinish = false; + _vm->_smushActive = true; + _vm->setDirtyColors(0, 255); _dst = _vm->virtscr[0].getPixels(0, 0); @@ -342,6 +345,7 @@ void SmushPlayer::release() { _vm->_mixer->stopHandle(_IACTchannel); _IACTstream = NULL; + _vm->_smushActive = false; _vm->_fullRedraw = true; // HACK HACK HACK: This is an *evil* trick, beware! See above for @@ -1320,7 +1324,7 @@ void SmushPlayer::play(const char *filename, int32 offset, int32 startFrame) { _warpNeeded = false; } _vm->parseEvents(); - _vm->processInput(true); + _vm->processInput(); if (_palDirtyMax >= _palDirtyMin) { byte palette_colors[1024]; byte *p = palette_colors; |