Cleanup.
svn-id: r26759
This commit is contained in:
parent
0da4791128
commit
6ddc79a9a8
3 changed files with 73 additions and 105 deletions
|
@ -1039,10 +1039,7 @@ protected:
|
||||||
|
|
||||||
void drawImage_init(int16 image, uint16 palette, uint16 x, uint16 y, uint16 flags);
|
void drawImage_init(int16 image, uint16 palette, uint16 x, uint16 y, uint16 flags);
|
||||||
|
|
||||||
void drawImage(VC10_state *state);
|
virtual void drawImage(VC10_state *state);
|
||||||
void drawImage_Amiga(VC10_state *state);
|
|
||||||
void drawImage_Simon(VC10_state *state);
|
|
||||||
void drawImage_Feeble(VC10_state *state);
|
|
||||||
|
|
||||||
void scaleClip(int16 h, int16 w, int16 y, int16 x, int16 scrollY);
|
void scaleClip(int16 h, int16 w, int16 y, int16 x, int16 scrollY);
|
||||||
void horizontalScroll(VC10_state *state);
|
void horizontalScroll(VC10_state *state);
|
||||||
|
@ -1407,6 +1404,8 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
const OpcodeEntrySimon1 *_opcodesSimon1;
|
const OpcodeEntrySimon1 *_opcodesSimon1;
|
||||||
|
|
||||||
|
virtual void drawImage(VC10_state *state);
|
||||||
};
|
};
|
||||||
|
|
||||||
class AGOSEngine_Simon2 : public AGOSEngine_Simon1 {
|
class AGOSEngine_Simon2 : public AGOSEngine_Simon1 {
|
||||||
|
@ -1494,6 +1493,8 @@ protected:
|
||||||
|
|
||||||
const OpcodeEntryFeeble *_opcodesFeeble;
|
const OpcodeEntryFeeble *_opcodesFeeble;
|
||||||
|
|
||||||
|
virtual void drawImage(VC10_state *state);
|
||||||
|
|
||||||
void drawMousePart(int image, byte x, byte y);
|
void drawMousePart(int image, byte x, byte y);
|
||||||
virtual void drawMousePointer();
|
virtual void drawMousePointer();
|
||||||
|
|
||||||
|
|
|
@ -224,7 +224,7 @@ bool AGOSEngine::drawImage_clip(VC10_state *state) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AGOSEngine::drawImage_Feeble(VC10_state *state) {
|
void AGOSEngine_Feeble::drawImage(VC10_state *state) {
|
||||||
if (state->flags & kDFCompressed) {
|
if (state->flags & kDFCompressed) {
|
||||||
if (state->flags & kDFScaled) {
|
if (state->flags & kDFScaled) {
|
||||||
state->surf_addr = getScaleBuf();
|
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];
|
const uint16 *vlut = &_videoWindows[_windowNum * 4];
|
||||||
|
|
||||||
if (drawImage_clip(state) == 0)
|
if (drawImage_clip(state) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (getFeatures() & GF_32COLOR)
|
||||||
|
state->palette = 0xC0;
|
||||||
|
|
||||||
uint xoffs, yoffs;
|
uint xoffs, yoffs;
|
||||||
if (getGameType() == GType_SIMON1 && (_subroutine == 2923 || _subroutine == 2926)) {
|
if (getGameType() == GType_SIMON1 && (_subroutine == 2923 || _subroutine == 2926)) {
|
||||||
// Allow one section of Simon the Sorcerer 1 introduction to be displayed
|
// 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;
|
state->surf_addr += xoffs + yoffs * state->surf2_pitch;
|
||||||
|
|
||||||
if (state->flags & kDFMasked) {
|
if (state->flags & kDFMasked) {
|
||||||
byte *mask, *src, *dst;
|
if (getFeatures() & GF_32COLOR) {
|
||||||
byte h;
|
const byte *mask = state->srcPtr + (state->width * state->y_skip * 16) + (state->x_skip * 8);
|
||||||
uint w;
|
byte *src = state->surf2_addr;
|
||||||
|
byte *dst = state->surf_addr;
|
||||||
|
|
||||||
state->x_skip *= 4;
|
state->draw_width *= 2;
|
||||||
state->dl = state->width;
|
|
||||||
state->dh = state->height;
|
|
||||||
|
|
||||||
vc10_skip_cols(state);
|
uint h = state->draw_height;
|
||||||
|
|
||||||
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 {
|
do {
|
||||||
if ((getGameType() == GType_SIMON1) && getBitFlag(88)) {
|
for (uint i = 0; i != state->draw_width; i++) {
|
||||||
/* transparency */
|
if ((getGameType() == GType_SIMON1) && getBitFlag(88)) {
|
||||||
if (mask[0] & 0xF0) {
|
/* transparency */
|
||||||
if ((dst[0] & 0x0F0) == 0x20)
|
if (mask[i] & 1 && (dst[i] & 1) == 0x20)
|
||||||
dst[0] = src[0];
|
dst[i] = src[i];
|
||||||
}
|
} else {
|
||||||
if (mask[0] & 0x0F) {
|
/* no transparency */
|
||||||
if ((dst[1] & 0x0F0) == 0x20)
|
if (mask[i] & 1)
|
||||||
dst[1] = src[1];
|
dst[i] = src[i];
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
/* no transparency */
|
|
||||||
if (mask[0] & 0xF0)
|
|
||||||
dst[0] = src[0];
|
|
||||||
if (mask[0] & 0x0F)
|
|
||||||
dst[1] = src[1];
|
|
||||||
}
|
}
|
||||||
mask++;
|
|
||||||
dst += state->surf_pitch;
|
dst += state->surf_pitch;
|
||||||
src += state->surf2_pitch;
|
src += state->surf2_pitch;
|
||||||
|
mask += state->width * 16;
|
||||||
} while (--h);
|
} 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)) {
|
} else if ((((_lockWord & 0x20) && state->palette == 0) || state->palette == 0xC0)) {
|
||||||
const byte *src;
|
const byte *src;
|
||||||
byte *dst;
|
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) {
|
void AGOSEngine::drawImage(VC10_state *state) {
|
||||||
const uint16 *vlut = &_videoWindows[_windowNum * 4];
|
const uint16 *vlut = &_videoWindows[_windowNum * 4];
|
||||||
|
|
||||||
|
|
|
@ -689,15 +689,7 @@ void AGOSEngine::drawImage_init(int16 image, uint16 palette, uint16 x, uint16 y,
|
||||||
state.surf_addr = getBackBuf();
|
state.surf_addr = getBackBuf();
|
||||||
state.surf_pitch = _dxSurfacePitch;
|
state.surf_pitch = _dxSurfacePitch;
|
||||||
|
|
||||||
if (getGameType() == GType_FF || getGameType() == GType_PP) {
|
drawImage(&state);
|
||||||
drawImage_Feeble(&state);
|
|
||||||
} else if (getFeatures() & GF_32COLOR) {
|
|
||||||
drawImage_Amiga(&state);
|
|
||||||
} else if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {
|
|
||||||
drawImage_Simon(&state);
|
|
||||||
} else {
|
|
||||||
drawImage(&state);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AGOSEngine::vc12_delay() {
|
void AGOSEngine::vc12_delay() {
|
||||||
|
@ -712,8 +704,8 @@ void AGOSEngine::vc12_delay() {
|
||||||
num = vcReadVarOrWord() * _frameRate;
|
num = vcReadVarOrWord() * _frameRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Work around to allow inventory arrows to be
|
// Work around to allow inventory arrows to be shown
|
||||||
// shown in some versions of Simon the Sorcerer 1
|
// in non-Windows versions of Simon the Sorcerer 1
|
||||||
if ((getGameType() == GType_SIMON1) && vsp->id == 128)
|
if ((getGameType() == GType_SIMON1) && vsp->id == 128)
|
||||||
num = 0;
|
num = 0;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue