diff options
author | Max Horn | 2009-03-09 03:45:23 +0000 |
---|---|---|
committer | Max Horn | 2009-03-09 03:45:23 +0000 |
commit | e080a593378bcaf44a7b44c297dcb291a2b584a8 (patch) | |
tree | 6a565b0e712d7f6a8b2d8151d9701d17d9922f63 | |
parent | 93240b003adb08d83703b03e192bd5905aa61884 (diff) | |
download | scummvm-rg350-e080a593378bcaf44a7b44c297dcb291a2b584a8.tar.gz scummvm-rg350-e080a593378bcaf44a7b44c297dcb291a2b584a8.tar.bz2 scummvm-rg350-e080a593378bcaf44a7b44c297dcb291a2b584a8.zip |
Renamed SMKPlayer -> SmackerDecoder and DXAPlayer -> DXADecoder, as well as some other tweaks
svn-id: r39255
-rw-r--r-- | engines/agos/animation.cpp | 2 | ||||
-rw-r--r-- | engines/agos/animation.h | 10 | ||||
-rw-r--r-- | engines/saga/introproc_saga2.cpp | 14 | ||||
-rw-r--r-- | engines/scumm/he/animation_he.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/he/animation_he.h | 2 | ||||
-rw-r--r-- | engines/sword1/animation.cpp | 10 | ||||
-rw-r--r-- | engines/sword1/animation.h | 6 | ||||
-rw-r--r-- | engines/sword2/animation.cpp | 10 | ||||
-rw-r--r-- | engines/sword2/animation.h | 6 | ||||
-rw-r--r-- | graphics/video/dxa_player.cpp | 18 | ||||
-rw-r--r-- | graphics/video/dxa_player.h | 6 | ||||
-rw-r--r-- | graphics/video/flic_player.h | 2 | ||||
-rw-r--r-- | graphics/video/smk_player.cpp | 18 | ||||
-rw-r--r-- | graphics/video/smk_player.h | 6 | ||||
-rw-r--r-- | graphics/video/video_player.cpp | 6 | ||||
-rw-r--r-- | graphics/video/video_player.h | 6 |
16 files changed, 63 insertions, 61 deletions
diff --git a/engines/agos/animation.cpp b/engines/agos/animation.cpp index 9ba8320098..12d2dfb71a 100644 --- a/engines/agos/animation.cpp +++ b/engines/agos/animation.cpp @@ -390,7 +390,7 @@ bool MoviePlayerDXA::processFrame() { MoviePlayerSMK::MoviePlayerSMK(AGOSEngine *vm, const char *name) - : MoviePlayer(vm), SMKPlayer(vm->_mixer) { + : MoviePlayer(vm), SmackerDecoder(vm->_mixer) { debug(0, "Creating SMK cutscene player"); memset(baseName, 0, sizeof(baseName)); diff --git a/engines/agos/animation.h b/engines/agos/animation.h index a4fcbfc6d0..fcef94d4bf 100644 --- a/engines/agos/animation.h +++ b/engines/agos/animation.h @@ -61,9 +61,9 @@ public: virtual bool load() = 0; virtual void play(); - virtual void playVideo() {}; - virtual void nextFrame() {}; - virtual void stopVideo() {}; + virtual void playVideo() = 0; + virtual void nextFrame() = 0; + virtual void stopVideo() = 0; private: virtual void handleNextFrame(); @@ -71,7 +71,7 @@ private: virtual void startSound() {}; }; -class MoviePlayerDXA : public MoviePlayer, ::Graphics::DXAPlayer { +class MoviePlayerDXA : public MoviePlayer, ::Graphics::DXADecoder { static const char *_sequenceList[90]; uint8 _sequenceNum; public: @@ -90,7 +90,7 @@ private: void startSound(); }; -class MoviePlayerSMK : public MoviePlayer, ::Graphics::SMKPlayer { +class MoviePlayerSMK : public MoviePlayer, ::Graphics::SmackerDecoder { public: MoviePlayerSMK(AGOSEngine *vm, const char *name); diff --git a/engines/saga/introproc_saga2.cpp b/engines/saga/introproc_saga2.cpp index 99e0c2cddd..86b9d6de01 100644 --- a/engines/saga/introproc_saga2.cpp +++ b/engines/saga/introproc_saga2.cpp @@ -52,10 +52,10 @@ int Scene::DinoStartProc() { stopEvent.kbd = Common::KEYCODE_ESCAPE; stopEvents.push_back(stopEvent); - Graphics::SMKPlayer *smkDecoder = new Graphics::SMKPlayer(_vm->_mixer); + Graphics::SmackerDecoder *smkDecoder = new Graphics::SmackerDecoder(_vm->_mixer); Graphics::VideoPlayer *player = new Graphics::VideoPlayer(smkDecoder); if (smkDecoder->loadFile("testvid.smk")) - player->playVideo(&stopEvents); // Play introduction + player->playVideo(stopEvents); // Play introduction smkDecoder->closeFile(); delete player; delete smkDecoder; @@ -75,13 +75,13 @@ int Scene::FTA2StartProc() { stopEvent.kbd = Common::KEYCODE_ESCAPE; stopEvents.push_back(stopEvent); - Graphics::SMKPlayer *smkDecoder = new Graphics::SMKPlayer(_vm->_mixer); + Graphics::SmackerDecoder *smkDecoder = new Graphics::SmackerDecoder(_vm->_mixer); Graphics::VideoPlayer *player = new Graphics::VideoPlayer(smkDecoder); if (smkDecoder->loadFile("trimark.smk")) - player->playVideo(&stopEvents); // Show Ignite logo + player->playVideo(stopEvents); // Show Ignite logo smkDecoder->closeFile(); if (smkDecoder->loadFile("intro.smk")) - player->playVideo(&stopEvents); // Play introduction + player->playVideo(stopEvents); // Play introduction smkDecoder->closeFile(); delete player; delete smkDecoder; @@ -125,10 +125,10 @@ int Scene::FTA2EndProc(FTA2Endings whichEnding) { stopEvents.push_back(stopEvent); // Play ending - Graphics::SMKPlayer *smkDecoder = new Graphics::SMKPlayer(_vm->_mixer); + Graphics::SmackerDecoder *smkDecoder = new Graphics::SmackerDecoder(_vm->_mixer); Graphics::VideoPlayer *player = new Graphics::VideoPlayer(smkDecoder); if (smkDecoder->loadFile(videoName)) { - player->playVideo(&stopEvents); + player->playVideo(stopEvents); smkDecoder->closeFile(); } delete player; diff --git a/engines/scumm/he/animation_he.cpp b/engines/scumm/he/animation_he.cpp index 4a64f16f42..0cc4419778 100644 --- a/engines/scumm/he/animation_he.cpp +++ b/engines/scumm/he/animation_he.cpp @@ -33,7 +33,7 @@ namespace Scumm { MoviePlayer::MoviePlayer(ScummEngine_v90he *vm, Audio::Mixer *mixer) - : SMKPlayer(mixer), _vm(vm), _mixer(mixer) { + : SmackerDecoder(mixer), _vm(vm), _mixer(mixer) { _flags = 0; _wizResNum = 0; diff --git a/engines/scumm/he/animation_he.h b/engines/scumm/he/animation_he.h index 93acc2253c..966db0e3f7 100644 --- a/engines/scumm/he/animation_he.h +++ b/engines/scumm/he/animation_he.h @@ -36,7 +36,7 @@ namespace Scumm { class ScummEngine_v90he; -class MoviePlayer : public Graphics::SMKPlayer { +class MoviePlayer : public Graphics::SmackerDecoder { ScummEngine_v90he *_vm; Audio::Mixer *_mixer; diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp index 2b4a596f9a..032eb15fb9 100644 --- a/engines/sword1/animation.cpp +++ b/engines/sword1/animation.cpp @@ -168,7 +168,7 @@ void MoviePlayer::play(void) { stopEvent.kbd = Common::KEYCODE_ESCAPE; stopEvents.push_back(stopEvent); - terminated = !playVideo(&stopEvents); + terminated = !playVideo(stopEvents); if (terminated) _snd->stopHandle(*_bgSoundHandle); @@ -229,11 +229,11 @@ void MoviePlayer::performPostProcessing(byte *screen) { } } -DXAPlayerWithSound::DXAPlayerWithSound(Audio::Mixer *mixer, Audio::SoundHandle *bgSoundHandle) +DXADecoderWithSound::DXADecoderWithSound(Audio::Mixer *mixer, Audio::SoundHandle *bgSoundHandle) : _mixer(mixer), _bgSoundHandle(bgSoundHandle) { } -int32 DXAPlayerWithSound::getAudioLag() { +int32 DXADecoderWithSound::getAudioLag() { if (!_fileStream) return 0; @@ -261,7 +261,7 @@ MoviePlayer *makeMoviePlayer(uint32 id, SwordEngine *vm, Text *textMan, Audio::M snprintf(filename, sizeof(filename), "%s.smk", sequenceList[id]); if (Common::File::exists(filename)) { - Graphics::SMKPlayer *smkDecoder = new Graphics::SMKPlayer(snd); + Graphics::SmackerDecoder *smkDecoder = new Graphics::SmackerDecoder(snd); return new MoviePlayer(vm, textMan, snd, system, bgSoundHandle, smkDecoder, kVideoDecoderSMK); } @@ -269,7 +269,7 @@ MoviePlayer *makeMoviePlayer(uint32 id, SwordEngine *vm, Text *textMan, Audio::M if (Common::File::exists(filename)) { #ifdef USE_ZLIB - DXAPlayerWithSound *dxaDecoder = new DXAPlayerWithSound(snd, bgSoundHandle); + DXADecoderWithSound *dxaDecoder = new DXADecoderWithSound(snd, bgSoundHandle); return new MoviePlayer(vm, textMan, snd, system, bgSoundHandle, dxaDecoder, kVideoDecoderDXA); #else GUI::MessageDialog dialog("DXA cutscenes found but ScummVM has been built without zlib support", "OK"); diff --git a/engines/sword1/animation.h b/engines/sword1/animation.h index a221221546..85c9fc70d6 100644 --- a/engines/sword1/animation.h +++ b/engines/sword1/animation.h @@ -56,10 +56,10 @@ public: } }; -class DXAPlayerWithSound : public Graphics::DXAPlayer { +class DXADecoderWithSound : public Graphics::DXADecoder { public: - DXAPlayerWithSound(Audio::Mixer *mixer, Audio::SoundHandle *bgSoundHandle); - ~DXAPlayerWithSound() {} + DXADecoderWithSound(Audio::Mixer *mixer, Audio::SoundHandle *bgSoundHandle); + ~DXADecoderWithSound() {} int32 getAudioLag(); private: diff --git a/engines/sword2/animation.cpp b/engines/sword2/animation.cpp index c2d92a6b29..57b6235b0a 100644 --- a/engines/sword2/animation.cpp +++ b/engines/sword2/animation.cpp @@ -158,7 +158,7 @@ void MoviePlayer::play(MovieText *movieTexts, uint32 numMovieTexts, uint32 leadI stopEvent.kbd = Common::KEYCODE_ESCAPE; stopEvents.push_back(stopEvent); - terminated = !playVideo(&stopEvents); + terminated = !playVideo(stopEvents); closeTextObject(_currentMovieText); @@ -291,11 +291,11 @@ void MoviePlayer::performPostProcessing(byte *screen) { } } -DXAPlayerWithSound::DXAPlayerWithSound(Audio::Mixer *mixer, Audio::SoundHandle *bgSoundHandle) +DXADecoderWithSound::DXADecoderWithSound(Audio::Mixer *mixer, Audio::SoundHandle *bgSoundHandle) : _mixer(mixer), _bgSoundHandle(bgSoundHandle) { } -int32 DXAPlayerWithSound::getAudioLag() { +int32 DXADecoderWithSound::getAudioLag() { if (!_fileStream) return 0; @@ -323,7 +323,7 @@ MoviePlayer *makeMoviePlayer(const char *name, Sword2Engine *vm, Audio::Mixer *s snprintf(filename, sizeof(filename), "%s.smk", name); if (Common::File::exists(filename)) { - Graphics::SMKPlayer *smkDecoder = new Graphics::SMKPlayer(snd); + Graphics::SmackerDecoder *smkDecoder = new Graphics::SmackerDecoder(snd); return new MoviePlayer(vm, snd, system, bgSoundHandle, smkDecoder, kVideoDecoderSMK); } @@ -331,7 +331,7 @@ MoviePlayer *makeMoviePlayer(const char *name, Sword2Engine *vm, Audio::Mixer *s if (Common::File::exists(filename)) { #ifdef USE_ZLIB - DXAPlayerWithSound *dxaDecoder = new DXAPlayerWithSound(snd, bgSoundHandle); + DXADecoderWithSound *dxaDecoder = new DXADecoderWithSound(snd, bgSoundHandle); return new MoviePlayer(vm, snd, system, bgSoundHandle, dxaDecoder, kVideoDecoderDXA); #else GUI::MessageDialog dialog("DXA cutscenes found but ScummVM has been built without zlib support", "OK"); diff --git a/engines/sword2/animation.h b/engines/sword2/animation.h index dde1b75a8c..cfb1ecf1b1 100644 --- a/engines/sword2/animation.h +++ b/engines/sword2/animation.h @@ -64,10 +64,10 @@ struct MovieInfo { bool seamless; }; -class DXAPlayerWithSound : public Graphics::DXAPlayer { +class DXADecoderWithSound : public Graphics::DXADecoder { public: - DXAPlayerWithSound(Audio::Mixer *mixer, Audio::SoundHandle *bgSoundHandle); - ~DXAPlayerWithSound() {} + DXADecoderWithSound(Audio::Mixer *mixer, Audio::SoundHandle *bgSoundHandle); + ~DXADecoderWithSound() {} int32 getAudioLag(); private: diff --git a/graphics/video/dxa_player.cpp b/graphics/video/dxa_player.cpp index d91e902408..d297e58727 100644 --- a/graphics/video/dxa_player.cpp +++ b/graphics/video/dxa_player.cpp @@ -37,7 +37,7 @@ namespace Graphics { -DXAPlayer::DXAPlayer() { +DXADecoder::DXADecoder() { _fileStream = 0; _frameBuffer1 = 0; @@ -63,11 +63,11 @@ DXAPlayer::DXAPlayer() { _scaleMode = S_NONE; } -DXAPlayer::~DXAPlayer() { +DXADecoder::~DXADecoder() { closeFile(); } -bool DXAPlayer::loadFile(const char *fileName) { +bool DXADecoder::loadFile(const char *fileName) { uint32 tag; int32 frameRate; @@ -118,7 +118,7 @@ bool DXAPlayer::loadFile(const char *fileName) { _frameBuffer2 = (uint8 *)malloc(_frameSize); memset(_frameBuffer2, 0, _frameSize); if (!_frameBuffer1 || !_frameBuffer2) - error("DXAPlayer: Error allocating frame buffers (size %u)", _frameSize); + error("DXADecoder: Error allocating frame buffers (size %u)", _frameSize); _scaledBuffer = 0; if (_scaleMode != S_NONE) { @@ -160,7 +160,7 @@ bool DXAPlayer::loadFile(const char *fileName) { return true; } -void DXAPlayer::closeFile() { +void DXADecoder::closeFile() { if (!_fileStream) return; @@ -177,7 +177,7 @@ void DXAPlayer::closeFile() { _decompBuffer = 0; } -void DXAPlayer::decodeZlib(byte *data, int size, int totalSize) { +void DXADecoder::decodeZlib(byte *data, int size, int totalSize) { #ifdef USE_ZLIB unsigned long dstLen = totalSize; Common::uncompress(data, &dstLen, _inBuffer, size); @@ -187,7 +187,7 @@ void DXAPlayer::decodeZlib(byte *data, int size, int totalSize) { #define BLOCKW 4 #define BLOCKH 4 -void DXAPlayer::decode12(int size) { +void DXADecoder::decode12(int size) { #ifdef USE_ZLIB if (_decompBuffer == NULL) { _decompBuffer = (byte *)malloc(_decompBufferSize); @@ -287,7 +287,7 @@ void DXAPlayer::decode12(int size) { #endif } -void DXAPlayer::decode13(int size) { +void DXADecoder::decode13(int size) { #ifdef USE_ZLIB uint8 *codeBuf, *dataBuf, *motBuf, *maskBuf; @@ -475,7 +475,7 @@ void DXAPlayer::decode13(int size) { #endif } -bool DXAPlayer::decodeNextFrame() { +bool DXADecoder::decodeNextFrame() { uint32 tag; if (_videoInfo.currentFrame == 0) diff --git a/graphics/video/dxa_player.h b/graphics/video/dxa_player.h index 35ce86f181..15fb4aa168 100644 --- a/graphics/video/dxa_player.h +++ b/graphics/video/dxa_player.h @@ -37,10 +37,10 @@ namespace Graphics { -class DXAPlayer : public VideoDecoder { +class DXADecoder : public VideoDecoder { public: - DXAPlayer(); - virtual ~DXAPlayer(); + DXADecoder(); + virtual ~DXADecoder(); /** * Load a DXA encoded video file diff --git a/graphics/video/flic_player.h b/graphics/video/flic_player.h index f2a60811c9..de65e0c47b 100644 --- a/graphics/video/flic_player.h +++ b/graphics/video/flic_player.h @@ -55,6 +55,8 @@ struct FrameTypeChunkHeader { uint16 heightOverride; }; +// TOD: rewrite this based on VideoDecoder & VideoPlayer (this may +// require improvements to these two classes). class FlicPlayer { public: FlicPlayer(); diff --git a/graphics/video/smk_player.cpp b/graphics/video/smk_player.cpp index 909401a3a1..16d5c9f73d 100644 --- a/graphics/video/smk_player.cpp +++ b/graphics/video/smk_player.cpp @@ -316,21 +316,21 @@ uint32 BigHuffmanTree::getCode(BitStream &bs) { return v; } -SMKPlayer::SMKPlayer(Audio::Mixer *mixer) +SmackerDecoder::SmackerDecoder(Audio::Mixer *mixer) : _audioStarted(false), _audioStream(0), _mixer(mixer) { } -SMKPlayer::~SMKPlayer() { +SmackerDecoder::~SmackerDecoder() { closeFile(); } -int SMKPlayer::getHeight() { +int SmackerDecoder::getHeight() { if (!_fileStream) return 0; return (_header.flags ? 2 : 1) * _videoInfo.height; } -int32 SMKPlayer::getAudioLag() { +int32 SmackerDecoder::getAudioLag() { if (!_fileStream) return 0; @@ -351,7 +351,7 @@ int32 SMKPlayer::getAudioLag() { return videoTime - audioTime; } -bool SMKPlayer::loadFile(const char *fileName) { +bool SmackerDecoder::loadFile(const char *fileName) { int32 frameRate; closeFile(); @@ -476,7 +476,7 @@ bool SMKPlayer::loadFile(const char *fileName) { return true; } -void SMKPlayer::closeFile() { +void SmackerDecoder::closeFile() { if (!_fileStream) return; @@ -500,7 +500,7 @@ void SMKPlayer::closeFile() { free(_palette); } -bool SMKPlayer::decodeNextFrame() { +bool SmackerDecoder::decodeNextFrame() { uint i; uint32 chunkSize = 0; uint32 dataSizeUnpacked = 0; @@ -722,7 +722,7 @@ bool SMKPlayer::decodeNextFrame() { return ++_videoInfo.currentFrame < _videoInfo.frameCount; } -void SMKPlayer::queueCompressedBuffer(byte *buffer, uint32 bufferSize, +void SmackerDecoder::queueCompressedBuffer(byte *buffer, uint32 bufferSize, uint32 unpackedSize, int streamNum) { BitStream audioBS(buffer, bufferSize); @@ -802,7 +802,7 @@ void SMKPlayer::queueCompressedBuffer(byte *buffer, uint32 bufferSize, // unpackedBuffer will be deleted by AppendableAudioStream } -void SMKPlayer::unpackPalette() { +void SmackerDecoder::unpackPalette() { uint startPos = _fileStream->pos(); uint32 len = 4 * _fileStream->readByte(); diff --git a/graphics/video/smk_player.h b/graphics/video/smk_player.h index d4c6050a5d..aa2ee305fc 100644 --- a/graphics/video/smk_player.h +++ b/graphics/video/smk_player.h @@ -53,10 +53,10 @@ class BigHuffmanTree; /** * Implementation of a Smacker v2/v4 video decoder */ -class SMKPlayer : public Graphics::VideoDecoder { +class SmackerDecoder : public Graphics::VideoDecoder { public: - SMKPlayer(Audio::Mixer *mixer); - virtual ~SMKPlayer(); + SmackerDecoder(Audio::Mixer *mixer); + virtual ~SmackerDecoder(); int getHeight(); int32 getAudioLag(); diff --git a/graphics/video/video_player.cpp b/graphics/video/video_player.cpp index 817a9117dc..81c025d22f 100644 --- a/graphics/video/video_player.cpp +++ b/graphics/video/video_player.cpp @@ -157,7 +157,7 @@ void VideoDecoder::setPalette(byte *pal) { * VideoPlayer */ -void VideoPlayer::processVideoEvents(Common::List<Common::Event> *stopEvents) { +void VideoPlayer::processVideoEvents(Common::List<Common::Event> &stopEvents) { Common::Event curEvent; Common::EventManager *eventMan = g_system->getEventManager(); @@ -167,7 +167,7 @@ void VideoPlayer::processVideoEvents(Common::List<Common::Event> *stopEvents) { _skipVideo = true; } - for (Common::List<Common::Event>::const_iterator iter = stopEvents->begin(); iter != stopEvents->end(); iter++) { + for (Common::List<Common::Event>::const_iterator iter = stopEvents.begin(); iter != stopEvents.end(); iter++) { if (curEvent.type == iter->type) { if (iter->type == Common::EVENT_KEYDOWN || iter->type == Common::EVENT_KEYUP) { if (curEvent.kbd.keycode == iter->kbd.keycode) { @@ -183,7 +183,7 @@ void VideoPlayer::processVideoEvents(Common::List<Common::Event> *stopEvents) { } } -bool VideoPlayer::playVideo(Common::List<Common::Event> *stopEvents) { +bool VideoPlayer::playVideo(Common::List<Common::Event> &stopEvents) { _skipVideo = false; debug(0, "Playing video"); diff --git a/graphics/video/video_player.h b/graphics/video/video_player.h index 2fe90210cd..2ffce6f9a9 100644 --- a/graphics/video/video_player.h +++ b/graphics/video/video_player.h @@ -103,7 +103,7 @@ public: /** * Close a video file */ - virtual void closeFile()=0; + virtual void closeFile() = 0; /** * Returns if a video file is loaded or not @@ -178,7 +178,7 @@ public: * * Returns true if the video was played to the end, false if skipped */ - bool playVideo(Common::List<Common::Event> *stopEvents); + bool playVideo(Common::List<Common::Event> &stopEvents); protected: /** @@ -190,7 +190,7 @@ protected: bool _skipVideo; VideoDecoder* _decoder; - void processVideoEvents(Common::List<Common::Event> *stopEvents); + void processVideoEvents(Common::List<Common::Event> &stopEvents); }; } // End of namespace Graphics |