aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25/gfx/image/renderedimage.cpp
diff options
context:
space:
mode:
authorjohndoe1232013-04-20 00:34:32 +0200
committerjohndoe1232013-04-20 00:34:32 +0200
commit4fc57dac8fd6865494d21acfddeb69ab7fb1ad5c (patch)
treeb94c1c72f00b06a44a78751f9a13a8528df2fb84 /engines/sword25/gfx/image/renderedimage.cpp
parent176a3babc553d1d6eb2a57fddb0a9665fc4aaa71 (diff)
downloadscummvm-rg350-4fc57dac8fd6865494d21acfddeb69ab7fb1ad5c.tar.gz
scummvm-rg350-4fc57dac8fd6865494d21acfddeb69ab7fb1ad5c.tar.bz2
scummvm-rg350-4fc57dac8fd6865494d21acfddeb69ab7fb1ad5c.zip
SWORD25: Fix blitting code
- Rename collectRenderQueue to preRender - Only do forceRefresh() in Panel::setColor() and Text::setText() if the new values are different - Move child object resorting from RenderObject::render() into RenderObject::preRender()
Diffstat (limited to 'engines/sword25/gfx/image/renderedimage.cpp')
-rw-r--r--engines/sword25/gfx/image/renderedimage.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/engines/sword25/gfx/image/renderedimage.cpp b/engines/sword25/gfx/image/renderedimage.cpp
index 1de7a04471..c8a6666046 100644
--- a/engines/sword25/gfx/image/renderedimage.cpp
+++ b/engines/sword25/gfx/image/renderedimage.cpp
@@ -145,7 +145,10 @@ RenderedImage::RenderedImage(const Common::String &filename, bool &result) :
_doCleanup = true;
+#if defined(SCUMM_LITTLE_ENDIAN)
+ // Makes sense for LE only at the moment
checkForTransparency();
+#endif
return;
}
@@ -295,20 +298,20 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe
int drawX = posX, drawY = posY;
int drawWidth = img->w;
int drawHeight = img->h;
-
+
// Handle clipping
- if (drawY < clipRect.top) {
- skipTop = clipRect.top - drawY;
- drawHeight = MAX(0, (int)drawHeight - (clipRect.top - drawY));
- drawY = clipRect.top;
- }
-
if (drawX < clipRect.left) {
skipLeft = clipRect.left - drawX;
- drawWidth = MAX(0, (int)drawWidth - skipLeft);
+ drawWidth -= skipLeft;
drawX = clipRect.left;
}
+ if (drawY < clipRect.top) {
+ skipTop = clipRect.top - drawY;
+ drawHeight -= skipTop;
+ drawY = clipRect.top;
+ }
+
if (drawX + drawWidth >= clipRect.right)
drawWidth = clipRect.right - drawX;
@@ -358,16 +361,16 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe
int a = (pix >> 24) & 0xff;
in += inStep;
+ if (ca != 255) {
+ a = a * ca >> 8;
+ }
+
if (a == 0) {
// Full transparency
out += 4;
continue;
}
- if (ca != 255) {
- a = a * ca >> 8;
- }
-
int b = (pix >> 0) & 0xff;
int g = (pix >> 8) & 0xff;
int r = (pix >> 16) & 0xff;