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

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Sun Aug 8 02:41:23 CEST 2010


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

Log Message:
-----------
GOB: Make o2_playImd use the new VideoPlayer interface

Modified Paths:
--------------
    scummvm/trunk/engines/gob/inter_v2.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:40:52 UTC (rev 51863)
+++ scummvm/trunk/engines/gob/inter_v2.cpp	2010-08-08 00:41:22 UTC (rev 51864)
@@ -959,50 +959,49 @@
 
 void Inter_v2::o2_playImd() {
 	char imd[128];
-	int16 x, y;
-	int16 startFrame;
-	int16 lastFrame;
-	int16 breakKey;
-	int16 flags;
-	int16 palStart;
-	int16 palEnd;
-	uint16 palCmd;
 	bool close;
 
 	_vm->_game->_script->evalExpr(0);
 	_vm->_game->_script->getResultStr()[8] = 0;
 	strncpy0(imd, _vm->_game->_script->getResultStr(), 127);
 
-	x = _vm->_game->_script->readValExpr();
-	y = _vm->_game->_script->readValExpr();
-	startFrame = _vm->_game->_script->readValExpr();
-	lastFrame = _vm->_game->_script->readValExpr();
-	breakKey = _vm->_game->_script->readValExpr();
-	flags = _vm->_game->_script->readValExpr();
-	palStart = _vm->_game->_script->readValExpr();
-	palEnd = _vm->_game->_script->readValExpr();
-	palCmd = 1 << (flags & 0x3F);
+	VideoPlayer::Properties props;
 
+	props.x          = _vm->_game->_script->readValExpr();
+	props.y          = _vm->_game->_script->readValExpr();
+	props.startFrame = _vm->_game->_script->readValExpr();
+	props.lastFrame  = _vm->_game->_script->readValExpr();
+	props.breakKey   = _vm->_game->_script->readValExpr();
+	props.flags      = _vm->_game->_script->readValExpr();
+	props.palStart   = _vm->_game->_script->readValExpr();
+	props.palEnd     = _vm->_game->_script->readValExpr();
+	props.palCmd     = 1 << (props.flags & 0x3F);
+
 	debugC(1, kDebugVideo, "Playing video \"%s\" @ %d+%d, frames %d - %d, "
-			"paletteCmd %d (%d - %d), flags %X", _vm->_game->_script->getResultStr(), x, y,
-			startFrame, lastFrame, palCmd, palStart, palEnd, flags);
+			"paletteCmd %d (%d - %d), flags %X", imd,
+			props.x, props.y, props.startFrame, props.lastFrame,
+			props.palCmd, props.palStart, props.palEnd, props.flags);
 
-	if ((imd[0] != 0) && !_vm->_vidPlayer->primaryOpen(imd, x, y, flags)) {
+	_vm->_vidPlayer->evaluateFlags(props);
+
+	int slot;
+	if ((imd[0] != 0) && ((slot = _vm->_vidPlayer->openVideo(true, imd, props)) < 0)) {
 		WRITE_VAR(11, (uint32) -1);
 		return;
 	}
 
-	close = (lastFrame == -1);
-	if (startFrame == -2) {
-		startFrame = lastFrame = 0;
+	close = (props.lastFrame == -1);
+	if (props.startFrame == -2) {
+		props.startFrame = 0;
+		props.lastFrame  = 0;
 		close = false;
 	}
 
-	if (startFrame >= 0)
-		_vm->_vidPlayer->primaryPlay(startFrame, lastFrame, breakKey, palCmd, palStart, palEnd, 0);
+	if (props.startFrame >= 0)
+		_vm->_vidPlayer->play(slot, props);
 
 	if (close)
-		_vm->_vidPlayer->primaryClose();
+		_vm->_vidPlayer->closeVideo(slot);
 }
 
 void Inter_v2::o2_getImdInfo() {
@@ -1011,10 +1010,10 @@
 	int16 varWidth, varHeight;
 
 	_vm->_game->_script->evalExpr(0);
-	varX = _vm->_game->_script->readVarIndex();
-	varY = _vm->_game->_script->readVarIndex();
+	varX      = _vm->_game->_script->readVarIndex();
+	varY      = _vm->_game->_script->readVarIndex();
 	varFrames = _vm->_game->_script->readVarIndex();
-	varWidth = _vm->_game->_script->readVarIndex();
+	varWidth  = _vm->_game->_script->readVarIndex();
 	varHeight = _vm->_game->_script->readVarIndex();
 
 	// WORKAROUND: The nut rolling animation in the administration center

Modified: scummvm/trunk/engines/gob/videoplayer.cpp
===================================================================
--- scummvm/trunk/engines/gob/videoplayer.cpp	2010-08-08 00:40:52 UTC (rev 51863)
+++ scummvm/trunk/engines/gob/videoplayer.cpp	2010-08-08 00:41:22 UTC (rev 51864)
@@ -72,6 +72,19 @@
 		_videoSlots[i].close();
 }
 
+void VideoPlayer::evaluateFlags(Properties &properties) {
+	if        (properties.flags & kFlagFrontSurface) {
+		properties.sprite = Draw::kFrontSurface;
+	} else if (properties.flags & kFlagOtherSurface) {
+		properties.sprite = properties.x;
+		properties.x      = 0;
+	} else if (properties.flags & kFlagScreenSurface) {
+		properties.sprite = 0;
+	} else {
+		properties.sprite = Draw::kBackSurface;
+	}
+}
+
 int VideoPlayer::openVideo(bool primary, const Common::String &file, Properties &properties) {
 	int slot = 0;
 

Modified: scummvm/trunk/engines/gob/videoplayer.h
===================================================================
--- scummvm/trunk/engines/gob/videoplayer.h	2010-08-08 00:40:52 UTC (rev 51863)
+++ scummvm/trunk/engines/gob/videoplayer.h	2010-08-08 00:41:22 UTC (rev 51864)
@@ -93,6 +93,8 @@
 	VideoPlayer(GobEngine *vm);
 	~VideoPlayer();
 
+	void evaluateFlags(Properties &properties);
+
 	int  openVideo(bool primary, const Common::String &file, Properties &properties);
 	bool closeVideo(int slot);
 


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