diff options
Diffstat (limited to 'engines/groovie')
-rw-r--r-- | engines/groovie/groovie.cpp | 10 | ||||
-rw-r--r-- | engines/groovie/groovie.h | 8 | ||||
-rw-r--r-- | engines/groovie/player.cpp | 21 | ||||
-rw-r--r-- | engines/groovie/player.h | 8 | ||||
-rw-r--r-- | engines/groovie/script.cpp | 6 | ||||
-rw-r--r-- | engines/groovie/script.h | 1 | ||||
-rw-r--r-- | engines/groovie/vdx.cpp | 10 |
7 files changed, 58 insertions, 6 deletions
diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp index 67c8f3dbc7..ea9c0a9fb7 100644 --- a/engines/groovie/groovie.cpp +++ b/engines/groovie/groovie.cpp @@ -55,6 +55,16 @@ GroovieEngine::GroovieEngine(OSystem *syst, const GroovieGameDescription *gd) : SearchMan.addSubDirectoryMatching(gameDataDir, "media"); SearchMan.addSubDirectoryMatching(gameDataDir, "system"); + _modeSpeed = kGroovieSpeedNormal; + if (ConfMan.hasKey("t7g_speed")) + { + Common::String speed = ConfMan.get("t7g_speed"); + if (speed.equals("im_an_ios")) + _modeSpeed = kGroovieSpeediOS; + else if (speed.equals("tweaked")) + _modeSpeed = kGroovieSpeedTweaked; + } + // Initialize the custom debug levels DebugMan.addDebugChannel(kGroovieDebugAll, "All", "Debug everything"); DebugMan.addDebugChannel(kGroovieDebugVideo, "Video", "Debug video and audio playback"); diff --git a/engines/groovie/groovie.h b/engines/groovie/groovie.h index f8fad8d91f..bd376db0d2 100644 --- a/engines/groovie/groovie.h +++ b/engines/groovie/groovie.h @@ -75,6 +75,12 @@ enum DebugLevels { // the current limitation is 32 debug levels (1 << 31 is the last one) }; +enum GameSpeed { + kGroovieSpeedNormal, + kGroovieSpeediOS, + kGroovieSpeedTweaked +}; + struct GroovieGameDescription; class GroovieEngine : public Engine { @@ -113,6 +119,8 @@ public: Common::MacResManager *_macResFork; + GameSpeed _modeSpeed; + private: const GroovieGameDescription *_gameDescription; Debugger *_debugger; diff --git a/engines/groovie/player.cpp b/engines/groovie/player.cpp index 8badd90012..4b8ae0083f 100644 --- a/engines/groovie/player.cpp +++ b/engines/groovie/player.cpp @@ -29,18 +29,19 @@ namespace Groovie { VideoPlayer::VideoPlayer(GroovieEngine *vm) : - _vm(vm), _syst(vm->_system), _file(NULL), _audioStream(NULL) { + _vm(vm), _syst(vm->_system), _file(NULL), _audioStream(NULL), _fps(0), _overrideSpeed(false) { } bool VideoPlayer::load(Common::SeekableReadStream *file, uint16 flags) { _file = file; _flags = flags; + _overrideSpeed = false; _audioStream = NULL; - uint16 fps = loadInternal(); + _fps = loadInternal(); - if (fps != 0) { - _millisBetweenFrames = 1000 / fps; + if (_fps != 0) { + setOverrideSpeed(_overrideSpeed); _begunPlaying = false; return true; } else { @@ -49,6 +50,18 @@ bool VideoPlayer::load(Common::SeekableReadStream *file, uint16 flags) { } } +void VideoPlayer::setOverrideSpeed(bool isOverride) +{ + _overrideSpeed = isOverride; + if (_fps != 0) + { + if (isOverride) + _millisBetweenFrames = 1000 / 26; + else + _millisBetweenFrames = 1000 / _fps; + } +} + bool VideoPlayer::playFrame() { bool end = true; diff --git a/engines/groovie/player.h b/engines/groovie/player.h index c9f47b8100..e75a5fc3c0 100644 --- a/engines/groovie/player.h +++ b/engines/groovie/player.h @@ -48,15 +48,21 @@ protected: virtual uint16 loadInternal() = 0; virtual bool playFrameInternal() = 0; + void setOverrideSpeed(bool isOverride); + bool getOverrideSpeed() const { return _overrideSpeed; } + GroovieEngine *_vm; OSystem *_syst; Common::SeekableReadStream *_file; uint16 _flags; Audio::QueuingAudioStream *_audioStream; - + + private: // Synchronization stuff bool _begunPlaying; + bool _overrideSpeed; + uint16 _fps; uint16 _millisBetweenFrames; uint32 _lastFrameTime; diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp index 4abfff74f2..782391dd78 100644 --- a/engines/groovie/script.cpp +++ b/engines/groovie/script.cpp @@ -65,7 +65,7 @@ static void debugScript(int level, bool nl, const char *s, ...) { Script::Script(GroovieEngine *vm, EngineVersion version) : _code(NULL), _savedCode(NULL), _stacktop(0), _debugger(NULL), _vm(vm), - _videoFile(NULL), _videoRef(0), _staufsMove(NULL) { + _videoFile(NULL), _videoRef(0), _staufsMove(NULL), _lastCursor(0xff) { // Initialize the opcode set depending on the engine version switch (version) { case kGroovieT7G: @@ -387,6 +387,7 @@ bool Script::hotspot(Common::Rect rect, uint16 address, uint8 cursor) { // If clicked with the mouse, jump to the specified address if (_mouseClicked) { + _lastCursor = cursor; _inputAction = address; } } @@ -579,11 +580,14 @@ bool Script::playvideofromref(uint32 fileref) { if (_videoFile) { _videoRef = fileref; + if (_lastCursor == 7) + _bitflags |= (1 << 15); _vm->_videoPlayer->load(_videoFile, _bitflags); } else { error("Couldn't open file"); return true; } + _lastCursor = 0xff; _bitflags = 0; diff --git a/engines/groovie/script.h b/engines/groovie/script.h index cda87a8917..2360d45744 100644 --- a/engines/groovie/script.h +++ b/engines/groovie/script.h @@ -75,6 +75,7 @@ private: Common::RandomSource _random; bool _firstbit; + uint8 _lastCursor; // Script filename (for debugging purposes) Common::String _scriptFile; diff --git a/engines/groovie/vdx.cpp b/engines/groovie/vdx.cpp index 1b4a2b7800..5569ae92ca 100644 --- a/engines/groovie/vdx.cpp +++ b/engines/groovie/vdx.cpp @@ -86,6 +86,11 @@ uint16 VDXPlayer::loadInternal() { _flagEight = ((_flags & (1 << 8)) != 0); _flagNine = ((_flags & (1 << 9)) != 0); + // Enable highspeed if we're not obeying fps, and not marked as special + // This will be disabled in chunk audio if we're actually an audio vdx + if ( _vm->_modeSpeed == kGroovieSpeediOS || (_vm->_modeSpeed == kGroovieSpeedTweaked && ((_flags & (1 << 15)) == 0))) + setOverrideSpeed(true); + if (_flagOnePrev && !_flagOne && !_flagEight) { _flagSeven = true; } @@ -522,6 +527,11 @@ void VDXPlayer::decodeBlockDelta(uint32 offset, byte *colours, uint16 imageWidth } void VDXPlayer::chunkSound(Common::ReadStream *in) { + if (getOverrideSpeed()) + { + setOverrideSpeed(false); + } + if (!_audioStream) { _audioStream = Audio::makeQueuingAudioStream(22050, false); Audio::SoundHandle sound_handle; |