aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2013-11-19 09:02:41 -0500
committerPaul Gilbert2013-11-19 09:02:41 -0500
commit03e7fd3941204b10b74d92d3724899e8529775f1 (patch)
tree5319d30a64afd3249c519f358809eb6dd8e2641b
parent40a936dd112eb8ddd80bc08ffe2c89af23248153 (diff)
downloadscummvm-rg350-03e7fd3941204b10b74d92d3724899e8529775f1.tar.gz
scummvm-rg350-03e7fd3941204b10b74d92d3724899e8529775f1.tar.bz2
scummvm-rg350-03e7fd3941204b10b74d92d3724899e8529775f1.zip
TSAGE: Graphic fix for image flags affecting frame centroid location
-rw-r--r--engines/tsage/graphics.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp
index 595c43a0bf..446c56662a 100644
--- a/engines/tsage/graphics.cpp
+++ b/engines/tsage/graphics.cpp
@@ -68,11 +68,21 @@ GfxSurface surfaceFromRes(const byte *imgData) {
Rect r(0, 0, READ_LE_UINT16(imgData), READ_LE_UINT16(imgData + 2));
GfxSurface s;
s.create(r.width(), r.height());
+ s._transColor = *(imgData + 8);
+
+ byte flags = imgData[9];
+ bool rleEncoded = (flags & 2) != 0;
+
+ // Figure out the centroid
s._centroid.x = READ_LE_UINT16(imgData + 4);
s._centroid.y = READ_LE_UINT16(imgData + 6);
- s._transColor = *(imgData + 8);
- bool rleEncoded = (imgData[9] & 2) != 0;
+ if (g_vm->getGameID() != GType_Ringworld) {
+ if (flags & 4)
+ s._centroid.x = r.width() - (s._centroid.x + 1);
+ if (flags & 8)
+ s._centroid.y = r.height() - (s._centroid.y + 1);
+ }
const byte *srcP = imgData + 10;
Graphics::Surface destSurface = s.lockSurface();