diff options
author | Gregory Montoir | 2006-11-12 03:02:20 +0000 |
---|---|---|
committer | Gregory Montoir | 2006-11-12 03:02:20 +0000 |
commit | 196c8a37718052c3b465af53f0b3324d0ee77533 (patch) | |
tree | 61f0fa2d4f3c1381db4e81a9a4fc9b3e5bba2193 /engines/touche/graphics.cpp | |
parent | e61526555c7e1a6cca20d8824b0ae5c0fb12f184 (diff) | |
download | scummvm-rg350-196c8a37718052c3b465af53f0b3324d0ee77533.tar.gz scummvm-rg350-196c8a37718052c3b465af53f0b3324d0ee77533.tar.bz2 scummvm-rg350-196c8a37718052c3b465af53f0b3324d0ee77533.zip |
cleanup
svn-id: r24683
Diffstat (limited to 'engines/touche/graphics.cpp')
-rw-r--r-- | engines/touche/graphics.cpp | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/engines/touche/graphics.cpp b/engines/touche/graphics.cpp index 5f1e479d91..db3c687471 100644 --- a/engines/touche/graphics.cpp +++ b/engines/touche/graphics.cpp @@ -152,21 +152,12 @@ void Graphics::drawLine(uint8 *dst, int dstPitch, int x1, int y1, int x2, int y2 void Graphics::copyRect(uint8 *dst, int dstPitch, int dstX, int dstY, const uint8 *src, int srcPitch, int srcX, int srcY, int w, int h, int flags) { if (w != 0 && h != 0) { - if (flags & kHFlipped) { - srcY += h - 1; - srcPitch = -srcPitch; - } - int u = 1; - if (flags & kVFlipped) { - srcX += w - 1; - u = -1; - } dst += dstY * dstPitch + dstX; src += srcY * srcPitch + srcX; while (h--) { for (int i = 0; i < w; ++i) { - if ((flags & kTransparent) == 0 || src[u * i] != 0) { - dst[i] = src[u * i]; + if ((flags & kTransparent) == 0 || src[i] != 0) { + dst[i] = src[i]; } } dst += dstPitch; @@ -176,16 +167,18 @@ void Graphics::copyRect(uint8 *dst, int dstPitch, int dstX, int dstY, const uint } void Graphics::copyMask(uint8 *dst, int dstPitch, int dstX, int dstY, const uint8 *src, int srcPitch, int srcX, int srcY, int w, int h, uint8 fillColor) { - dst += dstY * dstPitch + dstX; - src += srcY * srcPitch + srcX; - while (h--) { - for (int i = 0; i < w; ++i) { - if (src[i] != 0) { - dst[i] = fillColor; + if (w != 0 && h != 0) { + dst += dstY * dstPitch + dstX; + src += srcY * srcPitch + srcX; + while (h--) { + for (int i = 0; i < w; ++i) { + if (src[i] != 0) { + dst[i] = fillColor; + } } + dst += dstPitch; + src += srcPitch; } - dst += dstPitch; - src += srcPitch; } } |