aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/gfx.cpp
diff options
context:
space:
mode:
authorTravis Howell2007-02-09 00:35:57 +0000
committerTravis Howell2007-02-09 00:35:57 +0000
commiteaeada78acef36750c89a653df4a38b7f4aaf4cc (patch)
treeeed052f34f85f8154a2b48e9f2ad411378cdedc7 /engines/agos/gfx.cpp
parentdda1431e7c6b223a5686fe6d06d5268adbbb5e33 (diff)
downloadscummvm-rg350-eaeada78acef36750c89a653df4a38b7f4aaf4cc.tar.gz
scummvm-rg350-eaeada78acef36750c89a653df4a38b7f4aaf4cc.tar.bz2
scummvm-rg350-eaeada78acef36750c89a653df4a38b7f4aaf4cc.zip
Add cyx's patch for cleanup for planar conversion code, and support for 32 color planar graphics of Amiga ECS version of Simon the Sorcerer 1.
svn-id: r25436
Diffstat (limited to 'engines/agos/gfx.cpp')
-rw-r--r--engines/agos/gfx.cpp103
1 files changed, 76 insertions, 27 deletions
diff --git a/engines/agos/gfx.cpp b/engines/agos/gfx.cpp
index 644747012a..f5727b5b90 100644
--- a/engines/agos/gfx.cpp
+++ b/engines/agos/gfx.cpp
@@ -425,36 +425,30 @@ void AGOSEngine::drawImages_Simon(VC10_state *state) {
dst = state->surf_addr + w * 2; /* edi */
h = state->draw_height;
- if ((getGameType() == GType_SIMON1) && getBitFlag(88)) {
- /* transparency */
- do {
- if (mask[0] & 0xF0) {
- if ((dst[0] & 0x0F0) == 0x20)
+ do {
+ if ((getGameType() == GType_SIMON1) && getBitFlag(88)) {
+ /* transparency */
+ if (mask[0] & 0xF0) {
+ if ((dst[0] & 0x0F0) == 0x20)
+ dst[0] = src[0];
+ }
+ if (mask[0] & 0x0F) {
+ if ((dst[1] & 0x0F0) == 0x20)
+ dst[1] = src[1];
+ }
+ } else {
+ /* no transparency */
+ if (mask[0] & 0xF0)
dst[0] = src[0];
- }
- if (mask[0] & 0x0F) {
- if ((dst[1] & 0x0F0) == 0x20)
+ if (mask[0] & 0x0F)
dst[1] = src[1];
- }
- mask++;
- dst += state->surf_pitch;
- src += state->surf2_pitch;
- } while (--h);
- } else {
- /* no transparency */
- do {
- if (mask[0] & 0xF0)
- dst[0] = src[0];
- if (mask[0] & 0x0F)
- dst[1] = src[1];
- mask++;
- dst += state->surf_pitch;
- src += state->surf2_pitch;
- } while (--h);
- }
+ }
+ mask++;
+ dst += state->surf_pitch;
+ src += state->surf2_pitch;
+ } while (--h);
} while (++w != state->draw_width);
- } else if ((((_lockWord & 0x20) && state->palette == 0) || state->palette == 0xC0) &&
- getPlatform() != Common::kPlatformAmiga) {
+ } else if ((((_lockWord & 0x20) && state->palette == 0) || state->palette == 0xC0)) {
const byte *src;
byte *dst;
uint h, i;
@@ -589,6 +583,61 @@ void AGOSEngine::drawImages_Simon(VC10_state *state) {
}
}
+void AGOSEngine::drawImages_Amiga(VC10_state *state) {
+ uint8 *dst;
+ const byte *src;
+ const uint16 *vlut = &_videoWindows[_windowNum * 4];
+
+ if (drawImages_clip(state) == 0)
+ return;
+
+ uint xoffs = ((vlut[0] - _videoWindows[16]) * 2 + state->x) * 8;
+ uint yoffs = (vlut[1] - _videoWindows[17] + state->y);
+
+ state->surf2_addr += xoffs + yoffs * state->surf_pitch;
+ state->surf_addr += xoffs + yoffs * state->surf2_pitch;
+
+ if (state->flags & kDFMasked) {
+ const byte *mask = state->depack_src + (state->width * state->y_skip * 16) + (state->x_skip * 8);
+ src = state->surf2_addr;
+ dst = state->surf_addr;
+
+ state->draw_width *= 2;
+
+ uint h = state->draw_height;
+ do {
+ for (uint i = 0; i != state->draw_width; i++) {
+ if ((getGameType() == GType_SIMON1) && getBitFlag(88)) {
+ /* transparency */
+ if (mask[i] & 1 && (dst[i] & 1) == 0x20)
+ dst[i] = src[i];
+ } else {
+ /* no transparency */
+ if (mask[i] & 1)
+ dst[i] = src[i];
+ }
+ }
+ dst += state->surf_pitch;
+ src += state->surf2_pitch;
+ mask += state->width * 16;
+ } while (--h);
+ } else {
+ src = state->depack_src + (state->width * state->y_skip * 16) + (state->x_skip * 8);
+ dst = state->surf_addr;
+
+ state->draw_width *= 2;
+
+ uint h = state->draw_height;
+ do {
+ for (uint i = 0; i != state->draw_width; i++)
+ if ((state->flags & kDFNonTrans) || src[i])
+ dst[i] = src[i];
+ dst += _screenWidth;
+ src += state->width * 16;
+ } while (--h);
+ }
+}
+
void AGOSEngine::drawImages(VC10_state *state) {
const uint16 *vlut = &_videoWindows[_windowNum * 4];