diff options
author | Yotam Barnoy | 2010-05-27 06:21:37 +0000 |
---|---|---|
committer | Yotam Barnoy | 2010-05-27 06:21:37 +0000 |
commit | 5f53683cab48becc1d790132cc46ff29a1a3ae26 (patch) | |
tree | b96cefe61307d7eeff071b23b4de8e4fc93e9ec5 | |
parent | f7ba7b4684c86546151928cf5de669af04d237c1 (diff) | |
download | scummvm-rg350-5f53683cab48becc1d790132cc46ff29a1a3ae26.tar.gz scummvm-rg350-5f53683cab48becc1d790132cc46ff29a1a3ae26.tar.bz2 scummvm-rg350-5f53683cab48becc1d790132cc46ff29a1a3ae26.zip |
PSP: fixed a screen shake bug
svn-id: r49258
-rw-r--r-- | backends/platform/psp/display_client.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/backends/platform/psp/display_client.cpp b/backends/platform/psp/display_client.cpp index 90c41e796d..c5a6250188 100644 --- a/backends/platform/psp/display_client.cpp +++ b/backends/platform/psp/display_client.cpp @@ -686,17 +686,18 @@ void GuRenderer::fillVertices(Vertex *vertices) { uint32 gapX = _useGlobalScaler ? (PSP_SCREEN_WIDTH - outputWidth) >> 1 : 0; uint32 gapY = _useGlobalScaler ? (PSP_SCREEN_HEIGHT - outputHeight) >> 1 : 0; + // Save scaled offset on screen + float scaledOffsetOnScreenX = scaleSourceToOutputX(_offsetOnScreen.x); + float scaledOffsetOnScreenY = scaleSourceToOutputY(_offsetOnScreen.y); + float imageStartX, imageStartY, imageEndX, imageEndY; - imageStartX = gapX + (scaleSourceToOutputX(_maxTextureOffset.x)); - imageStartY = gapY; - - imageStartX += scaleSourceToOutputX(_offsetOnScreen.x); - imageStartY += scaleSourceToOutputY(_offsetOnScreen.y); + imageStartX = gapX + scaledOffsetOnScreenX + (scaleSourceToOutputX(_maxTextureOffset.x)); + imageStartY = gapY + scaledOffsetOnScreenY; if (_fullScreen) { // shortcut - imageEndX = PSP_SCREEN_WIDTH - gapX; - imageEndY = PSP_SCREEN_HEIGHT - gapY; + imageEndX = PSP_SCREEN_WIDTH - gapX + scaledOffsetOnScreenX; + imageEndY = PSP_SCREEN_HEIGHT - gapY + scaledOffsetOnScreenY; // needed for screen shake } else { /* !fullScreen */ imageEndX = imageStartX + scaleSourceToOutputX(_drawSize.width); imageEndY = imageStartY + scaleSourceToOutputY(_drawSize.height); |