[Scummvm-cvs-logs] SF.net SVN: scummvm:[39255] scummvm/trunk

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Mon Mar 9 04:45:23 CET 2009


Revision: 39255
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39255&view=rev
Author:   fingolfin
Date:     2009-03-09 03:45:23 +0000 (Mon, 09 Mar 2009)

Log Message:
-----------
Renamed SMKPlayer -> SmackerDecoder and DXAPlayer -> DXADecoder, as well as some other tweaks

Modified Paths:
--------------
    scummvm/trunk/engines/agos/animation.cpp
    scummvm/trunk/engines/agos/animation.h
    scummvm/trunk/engines/saga/introproc_saga2.cpp
    scummvm/trunk/engines/scumm/he/animation_he.cpp
    scummvm/trunk/engines/scumm/he/animation_he.h
    scummvm/trunk/engines/sword1/animation.cpp
    scummvm/trunk/engines/sword1/animation.h
    scummvm/trunk/engines/sword2/animation.cpp
    scummvm/trunk/engines/sword2/animation.h
    scummvm/trunk/graphics/video/dxa_player.cpp
    scummvm/trunk/graphics/video/dxa_player.h
    scummvm/trunk/graphics/video/flic_player.h
    scummvm/trunk/graphics/video/smk_player.cpp
    scummvm/trunk/graphics/video/smk_player.h
    scummvm/trunk/graphics/video/video_player.cpp
    scummvm/trunk/graphics/video/video_player.h

Modified: scummvm/trunk/engines/agos/animation.cpp
===================================================================
--- scummvm/trunk/engines/agos/animation.cpp	2009-03-09 02:50:25 UTC (rev 39254)
+++ scummvm/trunk/engines/agos/animation.cpp	2009-03-09 03:45:23 UTC (rev 39255)
@@ -390,7 +390,7 @@
 
 
 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));

Modified: scummvm/trunk/engines/agos/animation.h
===================================================================
--- scummvm/trunk/engines/agos/animation.h	2009-03-09 02:50:25 UTC (rev 39254)
+++ scummvm/trunk/engines/agos/animation.h	2009-03-09 03:45:23 UTC (rev 39255)
@@ -61,9 +61,9 @@
 
 	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 @@
 	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 @@
 	void startSound();
 };
 
-class MoviePlayerSMK : public MoviePlayer, ::Graphics::SMKPlayer {
+class MoviePlayerSMK : public MoviePlayer, ::Graphics::SmackerDecoder {
 public:
 	MoviePlayerSMK(AGOSEngine *vm, const char *name);
 

Modified: scummvm/trunk/engines/saga/introproc_saga2.cpp
===================================================================
--- scummvm/trunk/engines/saga/introproc_saga2.cpp	2009-03-09 02:50:25 UTC (rev 39254)
+++ scummvm/trunk/engines/saga/introproc_saga2.cpp	2009-03-09 03:45:23 UTC (rev 39255)
@@ -52,10 +52,10 @@
 	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 @@
 	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 @@
 	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;

Modified: scummvm/trunk/engines/scumm/he/animation_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/animation_he.cpp	2009-03-09 02:50:25 UTC (rev 39254)
+++ scummvm/trunk/engines/scumm/he/animation_he.cpp	2009-03-09 03:45:23 UTC (rev 39255)
@@ -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;

Modified: scummvm/trunk/engines/scumm/he/animation_he.h
===================================================================
--- scummvm/trunk/engines/scumm/he/animation_he.h	2009-03-09 02:50:25 UTC (rev 39254)
+++ scummvm/trunk/engines/scumm/he/animation_he.h	2009-03-09 03:45:23 UTC (rev 39255)
@@ -36,7 +36,7 @@
 
 class ScummEngine_v90he;
 
-class MoviePlayer : public Graphics::SMKPlayer {
+class MoviePlayer : public Graphics::SmackerDecoder {
 	ScummEngine_v90he *_vm;
 
 	Audio::Mixer *_mixer;

Modified: scummvm/trunk/engines/sword1/animation.cpp
===================================================================
--- scummvm/trunk/engines/sword1/animation.cpp	2009-03-09 02:50:25 UTC (rev 39254)
+++ scummvm/trunk/engines/sword1/animation.cpp	2009-03-09 03:45:23 UTC (rev 39255)
@@ -168,7 +168,7 @@
 	stopEvent.kbd = Common::KEYCODE_ESCAPE;
 	stopEvents.push_back(stopEvent);
 
-	terminated = !playVideo(&stopEvents);
+	terminated = !playVideo(stopEvents);
 
 	if (terminated)
 		_snd->stopHandle(*_bgSoundHandle);
@@ -229,11 +229,11 @@
 	}
 }
 
-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 @@
 	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 @@
 
 	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");

Modified: scummvm/trunk/engines/sword1/animation.h
===================================================================
--- scummvm/trunk/engines/sword1/animation.h	2009-03-09 02:50:25 UTC (rev 39254)
+++ scummvm/trunk/engines/sword1/animation.h	2009-03-09 03:45:23 UTC (rev 39255)
@@ -56,10 +56,10 @@
 	}
 };
 
-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:

Modified: scummvm/trunk/engines/sword2/animation.cpp
===================================================================
--- scummvm/trunk/engines/sword2/animation.cpp	2009-03-09 02:50:25 UTC (rev 39254)
+++ scummvm/trunk/engines/sword2/animation.cpp	2009-03-09 03:45:23 UTC (rev 39255)
@@ -158,7 +158,7 @@
 	stopEvent.kbd = Common::KEYCODE_ESCAPE;
 	stopEvents.push_back(stopEvent);
 
-	terminated = !playVideo(&stopEvents);
+	terminated = !playVideo(stopEvents);
 
 	closeTextObject(_currentMovieText);
 
@@ -291,11 +291,11 @@
 	}
 }
 
-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 @@
 	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 @@
 
 	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");

Modified: scummvm/trunk/engines/sword2/animation.h
===================================================================
--- scummvm/trunk/engines/sword2/animation.h	2009-03-09 02:50:25 UTC (rev 39254)
+++ scummvm/trunk/engines/sword2/animation.h	2009-03-09 03:45:23 UTC (rev 39255)
@@ -64,10 +64,10 @@
 	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:

Modified: scummvm/trunk/graphics/video/dxa_player.cpp
===================================================================
--- scummvm/trunk/graphics/video/dxa_player.cpp	2009-03-09 02:50:25 UTC (rev 39254)
+++ scummvm/trunk/graphics/video/dxa_player.cpp	2009-03-09 03:45:23 UTC (rev 39255)
@@ -37,7 +37,7 @@
 
 namespace Graphics {
 
-DXAPlayer::DXAPlayer() {
+DXADecoder::DXADecoder() {
 	_fileStream = 0;
 
 	_frameBuffer1 = 0;
@@ -63,11 +63,11 @@
 	_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 @@
 	_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 @@
 	return true;
 }
 
-void DXAPlayer::closeFile() {
+void DXADecoder::closeFile() {
 	if (!_fileStream)
 		return;
 
@@ -177,7 +177,7 @@
 	_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 @@
 #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 @@
 #endif
 }
 
-void DXAPlayer::decode13(int size) {
+void DXADecoder::decode13(int size) {
 #ifdef USE_ZLIB
 	uint8 *codeBuf, *dataBuf, *motBuf, *maskBuf;
 
@@ -475,7 +475,7 @@
 #endif
 }
 
-bool DXAPlayer::decodeNextFrame() {
+bool DXADecoder::decodeNextFrame() {
 	uint32 tag;
 
 	if (_videoInfo.currentFrame == 0)

Modified: scummvm/trunk/graphics/video/dxa_player.h
===================================================================
--- scummvm/trunk/graphics/video/dxa_player.h	2009-03-09 02:50:25 UTC (rev 39254)
+++ scummvm/trunk/graphics/video/dxa_player.h	2009-03-09 03:45:23 UTC (rev 39255)
@@ -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

Modified: scummvm/trunk/graphics/video/flic_player.h
===================================================================
--- scummvm/trunk/graphics/video/flic_player.h	2009-03-09 02:50:25 UTC (rev 39254)
+++ scummvm/trunk/graphics/video/flic_player.h	2009-03-09 03:45:23 UTC (rev 39255)
@@ -55,6 +55,8 @@
 	uint16 heightOverride;
 };
 
+// TOD: rewrite this based on VideoDecoder & VideoPlayer (this may
+// require improvements to these two classes).
 class FlicPlayer {
 public:
 	FlicPlayer();

Modified: scummvm/trunk/graphics/video/smk_player.cpp
===================================================================
--- scummvm/trunk/graphics/video/smk_player.cpp	2009-03-09 02:50:25 UTC (rev 39254)
+++ scummvm/trunk/graphics/video/smk_player.cpp	2009-03-09 03:45:23 UTC (rev 39255)
@@ -316,21 +316,21 @@
 	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 @@
 	return videoTime - audioTime;
 }
 
-bool SMKPlayer::loadFile(const char *fileName) {
+bool SmackerDecoder::loadFile(const char *fileName) {
 	int32 frameRate;
 
 	closeFile();
@@ -476,7 +476,7 @@
 	return true;
 }
 
-void SMKPlayer::closeFile() {
+void SmackerDecoder::closeFile() {
 	if (!_fileStream)
 		return;
 
@@ -500,7 +500,7 @@
 	free(_palette);
 }
 
-bool SMKPlayer::decodeNextFrame() {
+bool SmackerDecoder::decodeNextFrame() {
 	uint i;
 	uint32 chunkSize = 0;
 	uint32 dataSizeUnpacked = 0;
@@ -722,7 +722,7 @@
 	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 @@
 	// unpackedBuffer will be deleted by AppendableAudioStream
 }
 
-void SMKPlayer::unpackPalette() {
+void SmackerDecoder::unpackPalette() {
 	uint startPos = _fileStream->pos();
 	uint32 len = 4 * _fileStream->readByte();
 

Modified: scummvm/trunk/graphics/video/smk_player.h
===================================================================
--- scummvm/trunk/graphics/video/smk_player.h	2009-03-09 02:50:25 UTC (rev 39254)
+++ scummvm/trunk/graphics/video/smk_player.h	2009-03-09 03:45:23 UTC (rev 39255)
@@ -53,10 +53,10 @@
 /**
  * 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();

Modified: scummvm/trunk/graphics/video/video_player.cpp
===================================================================
--- scummvm/trunk/graphics/video/video_player.cpp	2009-03-09 02:50:25 UTC (rev 39254)
+++ scummvm/trunk/graphics/video/video_player.cpp	2009-03-09 03:45:23 UTC (rev 39255)
@@ -157,7 +157,7 @@
  *  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 @@
 			_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 @@
 	}
 }
 
-bool VideoPlayer::playVideo(Common::List<Common::Event> *stopEvents) {
+bool VideoPlayer::playVideo(Common::List<Common::Event> &stopEvents) {
 	_skipVideo = false;
 	debug(0, "Playing video");
 

Modified: scummvm/trunk/graphics/video/video_player.h
===================================================================
--- scummvm/trunk/graphics/video/video_player.h	2009-03-09 02:50:25 UTC (rev 39254)
+++ scummvm/trunk/graphics/video/video_player.h	2009-03-09 03:45:23 UTC (rev 39255)
@@ -103,7 +103,7 @@
 	/**
 	 * 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 @@
 	 *
 	 * 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 @@
 	bool _skipVideo;
 	VideoDecoder* _decoder;
 
-	void processVideoEvents(Common::List<Common::Event> *stopEvents);
+	void processVideoEvents(Common::List<Common::Event> &stopEvents);
 };
 
 } // End of namespace Graphics


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