aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/psp
diff options
context:
space:
mode:
authorYotam Barnoy2010-11-10 16:22:00 +0000
committerYotam Barnoy2010-11-10 16:22:00 +0000
commit2e9b304d763d620198b797901fe4ff7a2aca054f (patch)
tree7688adea38e64f73a359926102412424f8f25d38 /backends/platform/psp
parentdc02bd2b4e9aeb1b51e2c7c636b26d8bfdfc9ed9 (diff)
downloadscummvm-rg350-2e9b304d763d620198b797901fe4ff7a2aca054f.tar.gz
scummvm-rg350-2e9b304d763d620198b797901fe4ff7a2aca054f.tar.bz2
scummvm-rg350-2e9b304d763d620198b797901fe4ff7a2aca054f.zip
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. svn-id: r54190
Diffstat (limited to 'backends/platform/psp')
-rw-r--r--backends/platform/psp/display_client.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/backends/platform/psp/display_client.cpp b/backends/platform/psp/display_client.cpp
index 9d4f573e28..630b486988 100644
--- a/backends/platform/psp/display_client.cpp
+++ b/backends/platform/psp/display_client.cpp
@@ -690,10 +690,15 @@ void GuRenderer::fillVertices(Vertex *vertices) {
// 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 @@ void GuRenderer::fillVertices(Vertex *vertices) {
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;