[Scummvm-cvs-logs] SF.net SVN: scummvm:[51895] scummvm/trunk/engines/gob

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Sun Aug 8 02:55:28 CEST 2010


Revision: 51895
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51895&view=rev
Author:   drmccoy
Date:     2010-08-08 00:55:27 +0000 (Sun, 08 Aug 2010)

Log Message:
-----------
GOB: Adapt the remaining bits to the new VideoPlayer interface

Modified Paths:
--------------
    scummvm/trunk/engines/gob/inter_v2.cpp
    scummvm/trunk/engines/gob/mult.cpp
    scummvm/trunk/engines/gob/mult_v2.cpp
    scummvm/trunk/engines/gob/scenery.cpp
    scummvm/trunk/engines/gob/videoplayer.cpp
    scummvm/trunk/engines/gob/videoplayer.h

Modified: scummvm/trunk/engines/gob/inter_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v2.cpp	2010-08-08 00:54:52 UTC (rev 51894)
+++ scummvm/trunk/engines/gob/inter_v2.cpp	2010-08-08 00:55:27 UTC (rev 51895)
@@ -481,7 +481,7 @@
 		if ((((int32) *(obj.pPosX)) == -1234) && (((int32) *(obj.pPosY)) == -4321)) {
 
 			if (obj.videoSlot > 0)
-				_vm->_vidPlayer->slotClose(obj.videoSlot - 1);
+				_vm->_vidPlayer->closeVideo(obj.videoSlot - 1);
 
 			obj.videoSlot = 0;
 			obj.lastLeft = -1;

Modified: scummvm/trunk/engines/gob/mult.cpp
===================================================================
--- scummvm/trunk/engines/gob/mult.cpp	2010-08-08 00:54:52 UTC (rev 51894)
+++ scummvm/trunk/engines/gob/mult.cpp	2010-08-08 00:55:27 UTC (rev 51895)
@@ -452,7 +452,7 @@
 
 	for (int i = 0; i < _objCount; i++)
 		if (_objects[i].videoSlot > 0)
-			_vm->_vidPlayer->slotClose(_objects[i].videoSlot - 1);
+			_vm->_vidPlayer->closeVideo(_objects[i].videoSlot - 1);
 }
 
 } // End of namespace Gob

Modified: scummvm/trunk/engines/gob/mult_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/mult_v2.cpp	2010-08-08 00:54:52 UTC (rev 51894)
+++ scummvm/trunk/engines/gob/mult_v2.cpp	2010-08-08 00:55:27 UTC (rev 51895)
@@ -710,7 +710,7 @@
 	} else {
 		if (animObj.videoSlot > 0) {
 			_vm->_video->retrace();
-			_vm->_vidPlayer->slotWaitEndFrame(animObj.videoSlot - 1, true);
+			_vm->_vidPlayer->waitEndFrame(animObj.videoSlot - 1, true);
 		}
 	}
 
@@ -775,7 +775,7 @@
 		animData.isStatic = 1;
 		animData.frame = 0;
 		if ((animData.animation < 0) && (animObj.videoSlot > 0)) {
-			_vm->_vidPlayer->slotClose(animObj.videoSlot - 1);
+			_vm->_vidPlayer->closeVideo(animObj.videoSlot - 1);
 			animObj.videoSlot = 0;
 		}
 
@@ -788,7 +788,7 @@
 /*
 		if ((animData.animation < 0) && (animObj.videoSlot > 0)) {
 			if (_vm->_vidPlayer->getFlags(animObj.videoSlot - 1) & 0x1000) {
-				_vm->_vidPlayer->slotClose(animObj.videoSlot - 1);
+				_vm->_vidPlayer->closeVideo(animObj.videoSlot - 1);
 				animObj.videoSlot = 0;
 			}
 		}

Modified: scummvm/trunk/engines/gob/scenery.cpp
===================================================================
--- scummvm/trunk/engines/gob/scenery.cpp	2010-08-08 00:54:52 UTC (rev 51894)
+++ scummvm/trunk/engines/gob/scenery.cpp	2010-08-08 00:55:27 UTC (rev 51895)
@@ -621,15 +621,21 @@
 
 		// Seek to frame
 		if (_vm->_vidPlayer->getCurrentFrame(obj.videoSlot - 1) < 256) {
-			while (((int32)_vm->_vidPlayer->getCurrentFrame(obj.videoSlot - 1)) <= frame)
-				_vm->_vidPlayer->slotPlay(obj.videoSlot - 1);
+			VideoPlayer::Properties props;
+
+			props.lastFrame = frame + 1;
+			_vm->_vidPlayer->play(obj.videoSlot - 1, props);
+
 		} else {
-			int16 curFrame  = _vm->_vidPlayer->getCurrentFrame(obj.videoSlot - 1);
+			int16 curFrame  = _vm->_vidPlayer->getCurrentFrame(obj.videoSlot - 1) + 1;
 			uint8 frameWrap = curFrame / 256;
 			frame = (frame + 1) % 256;
 
-			while (((int32)_vm->_vidPlayer->getCurrentFrame(obj.videoSlot - 1)) < (frameWrap * 256 + frame))
-				_vm->_vidPlayer->slotPlay(obj.videoSlot - 1);
+			VideoPlayer::Properties props;
+
+			props.lastFrame = frameWrap * 256 + frame;
+
+			_vm->_vidPlayer->play(obj.videoSlot - 1, props);
 		}
 
 		/*
@@ -718,7 +724,7 @@
 				_vm->_draw->_spriteLeft = _vm->_vidPlayer->getWidth(obj.videoSlot - 1)  -
 					(destX + _vm->_draw->_spriteRight);
 
-			_vm->_vidPlayer->slotCopyFrame(obj.videoSlot - 1, _vm->_draw->_backSurface->getVidMem(),
+			_vm->_vidPlayer->copyFrame(obj.videoSlot - 1, _vm->_draw->_backSurface->getVidMem(),
 					_vm->_draw->_spriteLeft,  _vm->_draw->_spriteTop,
 					_vm->_draw->_spriteRight, _vm->_draw->_spriteBottom,
 					_vm->_draw->_destSpriteX, _vm->_draw->_destSpriteY,

Modified: scummvm/trunk/engines/gob/videoplayer.cpp
===================================================================
--- scummvm/trunk/engines/gob/videoplayer.cpp	2010-08-08 00:54:52 UTC (rev 51894)
+++ scummvm/trunk/engines/gob/videoplayer.cpp	2010-08-08 00:55:27 UTC (rev 51895)
@@ -253,12 +253,13 @@
 	return true;
 }
 
-void VideoPlayer::waitEndFrame(int slot) {
+void VideoPlayer::waitEndFrame(int slot, bool onlySound) {
 	Video *video = getVideoBySlot(slot);
 	if (!video)
 		return;
 
-	_vm->_util->delay(video->decoder->getTimeToNextFrame());
+	if (!onlySound || video->decoder->hasSound())
+		_vm->_util->delay(video->decoder->getTimeToNextFrame());
 }
 
 bool VideoPlayer::playFrame(int slot, Properties &properties) {
@@ -702,71 +703,6 @@
 	return video;
 }
 
-
-
-
-// Obsolete, to be deleted
-
-bool VideoPlayer::primaryOpen(const char *videoFile, int16 x, int16 y,
-		int32 flags, Type which, int16 width, int16 height) {
-
-	return false;
-}
-
-bool VideoPlayer::primaryPlay(int16 startFrame, int16 lastFrame, int16 breakKey,
-		uint16 palCmd, int16 palStart, int16 palEnd,
-		int16 palFrame, int16 endFrame, bool fade, int16 reverseTo, bool forceSeek) {
-
-	return false;
-}
-
-void VideoPlayer::primaryClose() {
-}
-
-int VideoPlayer::slotOpen(const char *videoFile, Type which, int16 width, int16 height) {
-	return -1;
-}
-
-void VideoPlayer::slotPlay(int slot, int16 frame) {
-}
-
-void VideoPlayer::slotClose(int slot) {
-}
-
-void VideoPlayer::slotCopyFrame(int slot, byte *dest,
-		uint16 left, uint16 top, uint16 width, uint16 height,
-		uint16 x, uint16 y, uint16 pitch, int16 transp) {
-
-#if 0
-	if ((slot < 0) || (slot >= kVideoSlotCount) || !_videoSlots[slot])
-		return;
-
-	/*_videoSlots[slot]->getVideo()->copyCurrentFrame(dest,
-			left, top, width, height, x, y, pitch, transp);*/
-#endif
-}
-
-void VideoPlayer::slotCopyPalette(int slot, int16 palStart, int16 palEnd) {
-}
-
-void VideoPlayer::slotWaitEndFrame(int slot, bool onlySound) {
-#if 0
-	Graphics::CoktelDecoder *video = getVideoBySlot(slot);
-
-	if (video) {
-		/*
-		Graphics::CoktelDecoder &cVideo = *video->getVideo();
-
-		if (!onlySound || (cVideo.getFeatures() & Graphics::CoktelDecoder::kFeaturesSound))
-			cVideo.waitEndFrame();
-		*/
-	}
-#endif
-}
-
-void VideoPlayer::slotSetDoubleMode(int slot, bool doubleMode) {
-}
-
 void VideoPlayer::copyPalette(const Video &video, int16 palStart, int16 palEnd) {
 	if (!video.decoder->hasPalette())
 		return;

Modified: scummvm/trunk/engines/gob/videoplayer.h
===================================================================
--- scummvm/trunk/engines/gob/videoplayer.h	2010-08-08 00:54:52 UTC (rev 51894)
+++ scummvm/trunk/engines/gob/videoplayer.h	2010-08-08 00:55:27 UTC (rev 51895)
@@ -103,7 +103,7 @@
 	bool closeVideo(int slot = 0);
 
 	bool play(int slot, Properties &properties);
-	void waitEndFrame(int slot);
+	void waitEndFrame(int slot, bool onlySound = false);
 
 	bool slotIsOpen(int slot = 0) const;
 
@@ -128,32 +128,6 @@
 			uint16 left, uint16 top, uint16 width, uint16 height,
 			uint16 x, uint16 y, uint16 pitch, int16 transp = -1) const;
 
-
-	// Obsolete, to be deleted
-
-	bool primaryOpen(const char *videoFile, int16 x = -1, int16 y = -1,
-			int32 flags = kFlagFrontSurface, Type which = kVideoTypeTry,
-			int16 width = -1, int16 height = -1);
-	bool primaryPlay(int16 startFrame = -1, int16 lastFrame = -1,
-			int16 breakKey = kShortKeyEscape,
-			uint16 palCmd = 8, int16 palStart = 0, int16 palEnd = 255,
-			int16 palFrame = -1, int16 endFrame = -1, bool fade = false,
-			int16 reverseTo = -1, bool forceSeek = false);
-	void primaryClose();
-
-	int slotOpen(const char *videoFile, Type which = kVideoTypeTry,
-			int16 width = -1, int16 height = -1);
-	void slotPlay(int slot, int16 frame = -1);
-	void slotClose(int slot);
-	void slotCopyFrame(int slot, byte *dest,
-			uint16 left, uint16 top, uint16 width, uint16 height,
-			uint16 x, uint16 y, uint16 pitch, int16 transp = -1);
-	void slotCopyPalette(int slot, int16 palStart = -1, int16 palEnd = -1);
-	void slotWaitEndFrame(int slot = -1, bool onlySound = false);
-
-	void slotSetDoubleMode(int slot, bool doubleMode);
-
-
 private:
 	struct Video {
 		Graphics::CoktelDecoder *decoder;


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