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

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Sat Jun 3 11:43:17 CEST 2006


Revision: 22859
Author:   eriktorbjorn
Date:     2006-06-03 02:43:10 -0700 (Sat, 03 Jun 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22859&view=rev

Log Message:
-----------
MPEG player fixes:

* Initialise _frameWidth and _frameHeight to prevent them from being undefined.
* Fix BS2 subtitle positioning. (Fixes bug #1499916)
* In BS2, copy the frame to the backend in 8-bit mode.
* Fix compilation in 8-bit mode.

BS2 subtitles aren't quite right in 8-bit mode, but I expect we want to
re-design things a bit if we ever add DXA cutscenes. We can fix minor details
then.

Modified Paths:
--------------
    scummvm/trunk/engines/sword2/animation.cpp
    scummvm/trunk/graphics/animation.cpp
Modified: scummvm/trunk/engines/sword2/animation.cpp
===================================================================
--- scummvm/trunk/engines/sword2/animation.cpp	2006-06-03 08:53:10 UTC (rev 22858)
+++ scummvm/trunk/engines/sword2/animation.cpp	2006-06-03 09:43:10 UTC (rev 22859)
@@ -53,8 +53,12 @@
 #else
 
 void AnimationState::drawTextObject(SpriteInfo *s, byte *src) {
-	OverlayColor *dst = _overlay + _movieScale * _movieWidth * _movieScale * s->y + _movieScale * s->x;
+	int moviePitch = _movieScale * _movieWidth;
+	int textX = _movieScale * s->x;
+	int textY = _movieScale * (_frameHeight - s->h - 12);
 
+	OverlayColor *dst = _overlay + textY * moviePitch + textX;
+
 	OverlayColor pen = _sys->RGBToColor(255, 255, 255);
 	OverlayColor border = _sys->RGBToColor(0, 0, 0);
 
@@ -88,12 +92,12 @@
 		}
 
 		if (_movieScale > 1) {
-			memcpy(dst + _movieScale * _movieWidth, dst, _movieScale * s->w * sizeof(OverlayColor));
+			memcpy(dst + moviePitch, dst, _movieScale * s->w * sizeof(OverlayColor));
 			if (_movieScale > 2)
-				memcpy(dst + 2 * _movieScale * _movieWidth, dst, _movieScale * s->w * sizeof(OverlayColor));
+				memcpy(dst + 2 * moviePitch, dst, _movieScale * s->w * sizeof(OverlayColor));
 		}
 
-		dst += _movieScale * _movieScale * _movieWidth;
+		dst += _movieScale * moviePitch;
 		src += s->w;
 	}
 }
@@ -101,9 +105,6 @@
 #endif
 
 void AnimationState::clearScreen() {
-	_frameWidth = _movieWidth;
-	_frameHeight = _movieHeight;
-
 #ifdef BACKEND_8BIT
 	memset(_vm->_screen->getScreen(), 0, _movieWidth * _movieHeight);
 #else
@@ -273,6 +274,7 @@
 
 	if (!anim->init(filename)) {
 		delete anim;
+		anim = NULL;
 		// Missing Files? Use the old 'Narration Only' hack
 		playDummy(filename, text, leadOut, leadOutLen);
 		return;
@@ -318,6 +320,10 @@
 				drawTextObject(anim, text[textCounter]);
 		}
 
+#ifdef BACKEND_8BIT
+		_sys->copyRectToScreen(_vm->_screen->getScreen(), 640, 0, 0, 640, 480);
+#endif
+
 		anim->updateScreen();
 		frameCounter++;
 
@@ -390,6 +396,7 @@
 	_vm->_screen->setPalette(0, 256, oldPal, RDPAL_INSTANT);
 
 	delete anim;
+	anim = NULL;
 }
 
 /**

Modified: scummvm/trunk/graphics/animation.cpp
===================================================================
--- scummvm/trunk/graphics/animation.cpp	2006-06-03 08:53:10 UTC (rev 22858)
+++ scummvm/trunk/graphics/animation.cpp	2006-06-03 09:43:10 UTC (rev 22859)
@@ -32,7 +32,7 @@
 namespace Graphics {
 
 BaseAnimationState::BaseAnimationState(Audio::Mixer *snd, OSystem *sys, int width, int height)
-	: _movieWidth(width), _movieHeight(height), _snd(snd), _sys(sys) {
+	: _movieWidth(width), _movieHeight(height), _frameWidth(width), _frameHeight(height), _snd(snd), _sys(sys) {
 #ifndef BACKEND_8BIT
 	const int screenW = _sys->getOverlayWidth();
 	const int screenH = _sys->getOverlayHeight();
@@ -661,6 +661,8 @@
 	}
 }
 
+#endif
+
 void BaseAnimationState::updateScreen() {
 #ifndef BACKEND_8BIT
 	int width = _movieScale * _frameWidth;
@@ -678,6 +680,4 @@
 	_sys->updateScreen();
 }
 
-#endif
-
 } // 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