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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sat Jan 22 04:28:14 CET 2011


Revision: 55405
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55405&view=rev
Author:   thebluegr
Date:     2011-01-22 03:28:14 +0000 (Sat, 22 Jan 2011)

Log Message:
-----------
SCI: Changed the expensive and inaccurate floating-point divisions to integer divisions. Fixes asserting of 90.rbt in Phantasmagoria (the game's logo video)

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

Modified: scummvm/trunk/engines/sci/graphics/robot.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/robot.cpp	2011-01-22 02:51:39 UTC (rev 55404)
+++ scummvm/trunk/engines/sci/graphics/robot.cpp	2011-01-22 03:28:14 UTC (rev 55405)
@@ -159,7 +159,7 @@
 
 		byte *pixels = assembleVideoFrame(i);
 		getFrameDimensions(i, width, height);
-		g_system->copyRectToScreen(pixels, width, x, y, width, (int) (height * getFrameScaleFactor(i)));
+		g_system->copyRectToScreen(pixels, width, x, y, width, height * getFrameScale(i) / 100);
 		g_system->updateScreen();
 		g_system->delayMillis(100);
 		delete[] pixels;
@@ -222,7 +222,7 @@
 		videoData += 10 + fragmentCompressed;
 	}
 
-	assert(decompressedSize == (frameWidth * frameHeight) * getFrameScaleFactor(frame));
+	assert(decompressedSize == (frameWidth * frameHeight) * getFrameScale(frame) / 100);
 
 	byte *output = new byte[decompressedSize];
 	int assemblePtr = 0;
@@ -274,11 +274,11 @@
 	rect = Common::Rect(x, y, x + w, y + h); 
 }
 
-float GfxRobot::getFrameScaleFactor(int frame) {
+int GfxRobot::getFrameScale(int frame) {
 	byte *videoData = _resourceData + _imageStart[frame];
 	byte percentage = videoData[3];
 
-	return (float) percentage / 100.0;
+	return percentage;
 }
 	
 #endif

Modified: scummvm/trunk/engines/sci/graphics/robot.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/robot.h	2011-01-22 02:51:39 UTC (rev 55404)
+++ scummvm/trunk/engines/sci/graphics/robot.h	2011-01-22 03:28:14 UTC (rev 55405)
@@ -44,7 +44,7 @@
 	byte *assembleVideoFrame(int frame);
 	void getFrameDimensions(int frame, int &width, int &height);
 	void getFrameRect(int frame, Common::Rect &rect); // Not sure what to use this for yet
-	float getFrameScaleFactor(int frame); // Scale factor?? More like custom height, but why use a percentage for it?
+	int getFrameScale(int frame); // Scale factor (multiplied by 100). More like custom height, but why use a percentage for it?
 
 	ResourceManager *_resMan;
 	GfxScreen *_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