diff options
author | Tobia Tesan | 2013-07-18 16:32:42 +0200 |
---|---|---|
committer | Tobia Tesan | 2013-08-01 02:17:31 +0200 |
commit | 1c25eb24900445ba704e759239572a86ea88c3e1 (patch) | |
tree | 9c1bc1afeef207ae622f7b8c2deecefc3052a2ce /engines/wintermute/graphics/transparent_surface.cpp | |
parent | b5adcda94719792c15a2cb72e9c0ad191f8fa224 (diff) | |
download | scummvm-rg350-1c25eb24900445ba704e759239572a86ea88c3e1.tar.gz scummvm-rg350-1c25eb24900445ba704e759239572a86ea88c3e1.tar.bz2 scummvm-rg350-1c25eb24900445ba704e759239572a86ea88c3e1.zip |
WINTERMUTE: Formatting
Diffstat (limited to 'engines/wintermute/graphics/transparent_surface.cpp')
-rw-r--r-- | engines/wintermute/graphics/transparent_surface.cpp | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/engines/wintermute/graphics/transparent_surface.cpp b/engines/wintermute/graphics/transparent_surface.cpp index 4eabc356b4..3c64930fcb 100644 --- a/engines/wintermute/graphics/transparent_surface.cpp +++ b/engines/wintermute/graphics/transparent_surface.cpp @@ -518,38 +518,24 @@ TransparentSurface *TransparentSurface::rotoscale(const TransformStruct &transfo float targX; float targY; -#ifdef ENABLE_BILINEAR for (int y = 0; y < dstH; y++) { for (int x = 0; x < dstW; x++) { int x1 = x - newHotspot.x; int y1 = y - newHotspot.y; - targX = ((x1 * invCos - y1 * invSin)) * 100.0 / transform._zoom.x + srcRect.left; - targY = ((x1 * invSin + y1 * invCos)) * 100.0 / transform._zoom.y + srcRect.top; + targX = ((x1 * invCos - y1 * invSin)) * kDefaultZoomX / transform._zoom.x + srcRect.left; + targY = ((x1 * invSin + y1 * invCos)) * kDefaultZoomY / transform._zoom.y + srcRect.top; targX += transform._hotspot.x; targY += transform._hotspot.y; +#ifdef ENABLE_BILINEAR copyPixelBilinear(targX, targY, x, y, srcRect, dstRect, this, target); - } - } #else - for (int y = 0; y < dstH; y++) { - for (int x = 0; x < dstW; x++) { - int x1 = x - newHotspot.x; - int y1 = y - newHotspot.y; - - targX = ((x1 * invCos - y1 * invSin)) * 100.0 / transform._zoom.x + srcRect.left; - targY = ((x1 * invSin + y1 * invCos)) * 100.0 / transform._zoom.y + srcRect.top; - - targX += transform._hotspot.x; - targY += transform._hotspot.y; - copyPixelNearestNeighbor(targX, targY, x, y, srcRect, dstRect, this, target); +#endif } } -#endif - return target; } @@ -568,27 +554,20 @@ TransparentSurface *TransparentSurface::scale(uint16 newWidth, uint16 newHeight) target->create((uint16)dstW, (uint16)dstH, this->format); -#ifdef ENABLE_BILINEAR + float projX; float projY; for (int y = 0; y < dstH; y++) { for (int x = 0; x < dstW; x++) { projX = x / (float)dstW * srcW; projY = y / (float)dstH * srcH; +#ifdef ENABLE_BILINEAR copyPixelBilinear(projX, projY, x, y, srcRect, dstRect, this, target); - } - } #else - int projX; - int projY; - for (int y = 0; y < dstH; y++) { - for (int x = 0; x < dstW; x++) { - projX = (int)(x / (float)dstW * srcW); - projY = (int)(y / (float)dstH * srcH); copyPixelNearestNeighbor(projX, projY, x, y, srcRect, dstRect, this, target); +#endif } } -#endif return target; } |