diff options
Diffstat (limited to 'engines/agos/gfx.cpp')
-rw-r--r-- | engines/agos/gfx.cpp | 155 |
1 files changed, 65 insertions, 90 deletions
diff --git a/engines/agos/gfx.cpp b/engines/agos/gfx.cpp index 2a6b5e2cab..e6b1a01950 100644 --- a/engines/agos/gfx.cpp +++ b/engines/agos/gfx.cpp @@ -224,7 +224,7 @@ bool AGOSEngine::drawImage_clip(VC10_state *state) { return 1; } -void AGOSEngine::drawImage_Feeble(VC10_state *state) { +void AGOSEngine_Feeble::drawImage(VC10_state *state) { if (state->flags & kDFCompressed) { if (state->flags & kDFScaled) { state->surf_addr = getScaleBuf(); @@ -387,12 +387,15 @@ void AGOSEngine::drawImage_Feeble(VC10_state *state) { } } -void AGOSEngine::drawImage_Simon(VC10_state *state) { +void AGOSEngine_Simon1::drawImage(VC10_state *state) { const uint16 *vlut = &_videoWindows[_windowNum * 4]; if (drawImage_clip(state) == 0) return; + if (getFeatures() & GF_32COLOR) + state->palette = 0xC0; + uint xoffs, yoffs; if (getGameType() == GType_SIMON1 && (_subroutine == 2923 || _subroutine == 2926)) { // Allow one section of Simon the Sorcerer 1 introduction to be displayed @@ -408,46 +411,73 @@ void AGOSEngine::drawImage_Simon(VC10_state *state) { state->surf_addr += xoffs + yoffs * state->surf2_pitch; if (state->flags & kDFMasked) { - byte *mask, *src, *dst; - byte h; - uint w; - - state->x_skip *= 4; - state->dl = state->width; - state->dh = state->height; - - vc10_skip_cols(state); + if (getFeatures() & GF_32COLOR) { + const byte *mask = state->srcPtr + (state->width * state->y_skip * 16) + (state->x_skip * 8); + byte *src = state->surf2_addr; + byte *dst = state->surf_addr; - w = 0; - do { - mask = vc10_depackColumn(state); /* esi */ - src = state->surf2_addr + w * 2; /* ebx */ - dst = state->surf_addr + w * 2; /* edi */ + state->draw_width *= 2; - h = state->draw_height; + uint h = state->draw_height; 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) - dst[1] = src[1]; + 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]; + } } - mask++; dst += state->surf_pitch; src += state->surf2_pitch; + mask += state->width * 16; } while (--h); - } while (++w != state->draw_width); + + } else { + byte *mask, *src, *dst; + byte h; + uint w; + + state->x_skip *= 4; + state->dl = state->width; + state->dh = state->height; + + vc10_skip_cols(state); + + w = 0; + do { + mask = vc10_depackColumn(state); /* esi */ + src = state->surf2_addr + w * 2; /* ebx */ + dst = state->surf_addr + w * 2; /* edi */ + + h = state->draw_height; + 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) + dst[1] = src[1]; + } + 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)) { const byte *src; byte *dst; @@ -583,61 +613,6 @@ void AGOSEngine::drawImage_Simon(VC10_state *state) { } } -void AGOSEngine::drawImage_Amiga(VC10_state *state) { - uint8 *dst; - const byte *src; - const uint16 *vlut = &_videoWindows[_windowNum * 4]; - - if (drawImage_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->srcPtr + (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->srcPtr + (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::drawImage(VC10_state *state) { const uint16 *vlut = &_videoWindows[_windowNum * 4]; |