[Scummvm-cvs-logs] SF.net SVN: scummvm:[54190] scummvm/trunk/backends/platform/psp/ display_client.cpp

Bluddy at users.sourceforge.net Bluddy at users.sourceforge.net
Wed Nov 10 17:22:00 CET 2010


Revision: 54190
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54190&view=rev
Author:   Bluddy
Date:     2010-11-10 16:22:00 +0000 (Wed, 10 Nov 2010)

Log Message:
-----------
PSP: changed renderer to render huge images properly

The PSP HW wasn't able to calculate the proper stretching when given the whole image size on a huge image. This is also a better way to do it because we're not overwriting tiles of the texture.

Modified Paths:
--------------
    scummvm/trunk/backends/platform/psp/display_client.cpp

Modified: scummvm/trunk/backends/platform/psp/display_client.cpp
===================================================================
--- scummvm/trunk/backends/platform/psp/display_client.cpp	2010-11-10 14:40:23 UTC (rev 54189)
+++ scummvm/trunk/backends/platform/psp/display_client.cpp	2010-11-10 16:22:00 UTC (rev 54190)
@@ -690,10 +690,15 @@
 	// now the coordinates within it are 0 to the edge of the area of the texture we want to draw
 	float textureStartX = textureFix + _offsetInBuffer.x;
 	float textureStartY = textureFix + _offsetInBuffer.y;	
-	// even when we draw one of several textures, we use the whole drawsize of the image. The GU 
-	// will draw what it can with the texture it has and scale it properly for us.
-	float textureEndX = -textureFix +  _offsetInBuffer.x + _drawSize.width  - _textureLoadOffset.x;
-	float textureEndY = -textureFix +  _offsetInBuffer.y + _drawSize.height - _textureLoadOffset.y;
+
+	int textureLeftX = _drawSize.width - _textureLoadOffset.x;
+	if (textureLeftX > 512)
+		textureLeftX = 512;
+	int textureLeftY = _drawSize.height - _textureLoadOffset.y;
+	if (textureLeftY > 512)
+		textureLeftY = 512;
+	float textureEndX = -textureFix + _offsetInBuffer.x + textureLeftX;
+	float textureEndY = -textureFix + _offsetInBuffer.y + textureLeftY;
 	// For scaling to the final image size, calculate the gaps on both sides
 	uint32 gapX = _useGlobalScaler ? (PSP_SCREEN_WIDTH - outputWidth) >> 1 : 0;
 	uint32 gapY = _useGlobalScaler ? (PSP_SCREEN_HEIGHT - outputHeight) >> 1 : 0;
@@ -707,13 +712,8 @@
 
 	float imageEndX, imageEndY;
 	
-	if (_fullScreen) { // shortcut
-		imageEndX = PSP_SCREEN_WIDTH - gapX + scaledOffsetOnScreenX;
-		imageEndY = PSP_SCREEN_HEIGHT - gapY + scaledOffsetOnScreenY; // needed for screen shake
-	} else { /* !fullScreen */
-		imageEndX = gapX + scaledOffsetOnScreenX + scaleSourceToOutput(true, stretch(true, _drawSize.width));
-		imageEndY = gapY + scaledOffsetOnScreenY + scaleSourceToOutput(false, stretch(false, _drawSize.height));
-	}
+	imageEndX = imageStartX + scaleSourceToOutput(true, stretch(true, textureLeftX));
+	imageEndY = imageStartY + scaleSourceToOutput(false, stretch(false, textureLeftY));
 
 	vertices[0].u = textureStartX;
 	vertices[0].v = textureStartY;


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