aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/res_ami.cpp
diff options
context:
space:
mode:
authorTravis Howell2007-02-12 03:59:29 +0000
committerTravis Howell2007-02-12 03:59:29 +0000
commit189b4abb33fd13b29f7641c29c9950fe39fcd1fe (patch)
tree40cf08006e7993bdabeb2b54a8060d430006a943 /engines/agos/res_ami.cpp
parent8ba35537223eecc128c3ec0fca725680674aa510 (diff)
downloadscummvm-rg350-189b4abb33fd13b29f7641c29c9950fe39fcd1fe.tar.gz
scummvm-rg350-189b4abb33fd13b29f7641c29c9950fe39fcd1fe.tar.bz2
scummvm-rg350-189b4abb33fd13b29f7641c29c9950fe39fcd1fe.zip
Pass VC10_state directly to convertclip, to reduce arguments.
svn-id: r25505
Diffstat (limited to 'engines/agos/res_ami.cpp')
-rw-r--r--engines/agos/res_ami.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/engines/agos/res_ami.cpp b/engines/agos/res_ami.cpp
index 7024726e2b..714c4fc727 100644
--- a/engines/agos/res_ami.cpp
+++ b/engines/agos/res_ami.cpp
@@ -115,9 +115,19 @@ static void convertcompressedclip(const byte *src, byte *dst, uint8 colorDepth,
}
}
-byte *AGOSEngine::convertclip(const byte *src, bool is32Colors, uint height, uint width, byte flags) {
+byte *AGOSEngine::convertclip(VC10_state *state, byte flags) {
int length, i, j;
- uint8 colorDepth = is32Colors ? 5 : 4;
+
+ uint8 colorDepth = 4;
+ if (getGameType() == GType_SIMON1) {
+ if (((_lockWord & 0x20) && !state->palette) || (getFeatures() & GF_32COLOR)) {
+ colorDepth = 5;
+ }
+ }
+
+ const byte *src = state->depack_src;
+ int width = state->width * 16;
+ int height = state->height;
free(_planarBuf);
_planarBuf = (byte *)malloc(width * height);
@@ -129,7 +139,7 @@ byte *AGOSEngine::convertclip(const byte *src, bool is32Colors, uint height, uin
length = (width + 15) / 16 * height;
for (i = 0; i < length; i++) {
uint16 w[kMaxColorDepth];
- if (getGameType() == GType_SIMON1 && !is32Colors) {
+ if (getGameType() == GType_SIMON1 && colorDepth == 4) {
for (j = 0; j < colorDepth; ++j) {
w[j] = READ_BE_UINT16(src + j * length * 2);
}