[Scummvm-cvs-logs] SF.net SVN: scummvm:[47211] scummvm/trunk/engines/sci/graphics

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Sat Jan 9 22:20:39 CET 2010


Revision: 47211
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47211&view=rev
Author:   m_kiewitz
Date:     2010-01-09 21:20:39 +0000 (Sat, 09 Jan 2010)

Log Message:
-----------
SCI: kPortrait - drawing base bitmap before drawing animation bitmap

Modified Paths:
--------------
    scummvm/trunk/engines/sci/graphics/portrait.cpp
    scummvm/trunk/engines/sci/graphics/portrait.h

Modified: scummvm/trunk/engines/sci/graphics/portrait.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/portrait.cpp	2010-01-09 21:12:08 UTC (rev 47210)
+++ scummvm/trunk/engines/sci/graphics/portrait.cpp	2010-01-09 21:20:39 UTC (rev 47211)
@@ -140,6 +140,7 @@
 	// Draw base bitmap
 	_palette->set(&_portraitPalette, 1);
 	drawBitmap(0);
+	bitsShow();
 
 	// Start playing audio...
 	_audio->stopAudio();
@@ -161,9 +162,11 @@
 
 		if (syncCue != 0xFFFF) {
 			// Display animation bitmap
-			syncCue++; // TODO: Not sure if 0 means main bitmap or animation-frame 0
 			if (syncCue < _bitmapCount) {
+				if (syncCue)
+					drawBitmap(0); // Draw base bitmap first to get valid animation frame
 				drawBitmap(syncCue);
+				bitsShow();
 			} else {
 				warning("kPortrait: sync information tried to draw non-existant %d", syncCue);
 			}
@@ -179,7 +182,6 @@
 	_resMan->unlockResource(syncResource);
 }
 
-// TODO: coordinate offset is missing...can't find it in the bitmap header nor in the main header
 void Portrait::drawBitmap(uint16 bitmapNr) {
 	byte *data = _bitmaps[bitmapNr].rawBitmap;
 	uint16 bitmapHeight = _bitmaps[bitmapNr].height;
@@ -195,9 +197,11 @@
 		}
 		data += _bitmaps[bitmapNr].extraBytesPerLine;
 	}
+}
 
-	Common::Rect bitmapRect = Common::Rect(bitmapWidth, bitmapHeight);
-	bitmapRect.moveTo(bitmapPosition.x, bitmapPosition.y);
+void Portrait::bitsShow() {
+	Common::Rect bitmapRect = Common::Rect(_width, _height);
+	bitmapRect.moveTo(_position.x, _position.y);
 	_screen->copyDisplayRectToScreen(bitmapRect);
 	g_system->updateScreen();
 }

Modified: scummvm/trunk/engines/sci/graphics/portrait.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/portrait.h	2010-01-09 21:12:08 UTC (rev 47210)
+++ scummvm/trunk/engines/sci/graphics/portrait.h	2010-01-09 21:20:39 UTC (rev 47211)
@@ -46,6 +46,7 @@
 private:
 	void init();
 	void drawBitmap(uint16 bitmapNr);
+	void bitsShow();
 
 	ResourceManager *_resMan;
 	Screen *_screen;


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