diff options
author | Tobia Tesan | 2013-07-17 23:37:21 +0200 |
---|---|---|
committer | Tobia Tesan | 2013-08-01 02:17:25 +0200 |
commit | 14d151ab31d8163f3e7dc943be191c3a98bd4f6b (patch) | |
tree | 4678f401df1439a834097447f449d5f64c25ebfd /engines/wintermute/graphics/transparent_surface.cpp | |
parent | 1a8a9bab861402e81dd2e5407182f3c0a7cc479b (diff) | |
download | scummvm-rg350-14d151ab31d8163f3e7dc943be191c3a98bd4f6b.tar.gz scummvm-rg350-14d151ab31d8163f3e7dc943be191c3a98bd4f6b.tar.bz2 scummvm-rg350-14d151ab31d8163f3e7dc943be191c3a98bd4f6b.zip |
WINTERMUTE: Fix #ifdef in transparent_surface.[h|cpp]
Diffstat (limited to 'engines/wintermute/graphics/transparent_surface.cpp')
-rw-r--r-- | engines/wintermute/graphics/transparent_surface.cpp | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/engines/wintermute/graphics/transparent_surface.cpp b/engines/wintermute/graphics/transparent_surface.cpp index 534e51684e..4eabc356b4 100644 --- a/engines/wintermute/graphics/transparent_surface.cpp +++ b/engines/wintermute/graphics/transparent_surface.cpp @@ -32,28 +32,6 @@ namespace Wintermute { -#ifndef ENABLE_BILINEAR -void TransparentSurface::copyPixelNearestNeighbor(float projX, float projY, int dstX, int dstY, const Common::Rect &srcRect, const Common::Rect &dstRect, const TransparentSurface *src, TransparentSurface *dst) { - int srcW = srcRect.width(); - int srcH = srcRect.height(); - int dstW = dstRect.width(); - int dstH = dstRect.height(); - - assert(dstX >= 0 && dstX < dstW); - assert(dstY >= 0 && dstY < dstH); - - uint32 color; - - if (projX >= srcW || projX < 0 || projY >= srcH || projY < 0) { - color = 0; - } else { - color = READ_UINT32((const byte *)src->getBasePtr((int)projX, (int)projY)); - } - - WRITE_UINT32((byte *)dst->getBasePtr(dstX, dstY), color); -} -#endif - #ifdef ENABLE_BILINEAR void TransparentSurface::copyPixelBilinear(float projX, float projY, int dstX, int dstY, const Common::Rect &srcRect, const Common::Rect &dstRect, const TransparentSurface *src, TransparentSurface *dst) { @@ -141,6 +119,26 @@ void TransparentSurface::copyPixelBilinear(float projX, float projY, int dstX, i } WRITE_UINT32((byte *)dst->getBasePtr(dstX + dstRect.left, dstY + dstRect.top), color); } +#else +void TransparentSurface::copyPixelNearestNeighbor(float projX, float projY, int dstX, int dstY, const Common::Rect &srcRect, const Common::Rect &dstRect, const TransparentSurface *src, TransparentSurface *dst) { + int srcW = srcRect.width(); + int srcH = srcRect.height(); + int dstW = dstRect.width(); + int dstH = dstRect.height(); + + assert(dstX >= 0 && dstX < dstW); + assert(dstY >= 0 && dstY < dstH); + + uint32 color; + + if (projX >= srcW || projX < 0 || projY >= srcH || projY < 0) { + color = 0; + } else { + color = READ_UINT32((const byte *)src->getBasePtr((int)projX, (int)projY)); + } + + WRITE_UINT32((byte *)dst->getBasePtr(dstX, dstY), color); +} #endif byte *TransparentSurface::_lookup = nullptr; @@ -520,7 +518,7 @@ TransparentSurface *TransparentSurface::rotoscale(const TransformStruct &transfo float targX; float targY; -#if ENABLE_BILINEAR +#ifdef ENABLE_BILINEAR for (int y = 0; y < dstH; y++) { for (int x = 0; x < dstW; x++) { int x1 = x - newHotspot.x; @@ -570,7 +568,7 @@ TransparentSurface *TransparentSurface::scale(uint16 newWidth, uint16 newHeight) target->create((uint16)dstW, (uint16)dstH, this->format); -#if ENABLE_BILINEAR +#ifdef ENABLE_BILINEAR float projX; float projY; for (int y = 0; y < dstH; y++) { |