HE70+ games use flags in drawBox().
Fixes glitches in farmdemo (Old version), freddi2, lost/smaller. svn-id: r18216
This commit is contained in:
parent
76f8021a28
commit
7dc115be6f
5 changed files with 14 additions and 20 deletions
|
@ -1049,18 +1049,27 @@ void ScummEngine::drawBox(int x, int y, int x2, int y2, int color) {
|
|||
markRectAsDirty(vs->number, x, x2, y, y2);
|
||||
|
||||
backbuff = vs->getPixels(x, y);
|
||||
bgbuff = vs->getBackPixels(x, y);
|
||||
|
||||
if (color == -1) {
|
||||
if (vs->number != kMainVirtScreen)
|
||||
error("can only copy bg to main window");
|
||||
bgbuff = vs->getBackPixels(x, y);
|
||||
blit(backbuff, vs->pitch, bgbuff, vs->pitch, width, height);
|
||||
if (_charset->_hasMask) {
|
||||
byte *mask = (byte *)_charset->_textSurface.pixels + _charset->_textSurface.pitch * (y - _screenTop) + x;
|
||||
fill(mask, _charset->_textSurface.pitch, CHARSET_MASK_TRANSPARENCY, width, height);
|
||||
}
|
||||
} else {
|
||||
fill(backbuff, vs->pitch, color, width, height);
|
||||
// Flags are used for different methods in HE70+ games
|
||||
if ((color & 0x2000) || (color & 0x4000)) {
|
||||
error("drawBox: unsupported flag 0x%x", color);
|
||||
} else if (color & 0x8000) {
|
||||
color &= 0x7FFF;
|
||||
fill(backbuff, vs->pitch, color, width, height);
|
||||
fill(bgbuff, vs->pitch, color, width, height);
|
||||
} else {
|
||||
fill(backbuff, vs->pitch, color, width, height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1068,7 +1068,6 @@ protected:
|
|||
void o80_writeConfigFile();
|
||||
void o80_cursorCommand();
|
||||
void o80_setState();
|
||||
void o80_drawBox();
|
||||
void o80_drawWizPolygon();
|
||||
void o80_drawLine();
|
||||
void o80_pickVarRandom();
|
||||
|
|
|
@ -85,7 +85,7 @@ void ScummEngine_v100he::setupOpcodes() {
|
|||
OPCODE(o6_div),
|
||||
OPCODE(o6_animateActor),
|
||||
OPCODE(o6_doSentence),
|
||||
OPCODE(o80_drawBox),
|
||||
OPCODE(o6_drawBox),
|
||||
/* 24 */
|
||||
OPCODE(o72_drawWizImage),
|
||||
OPCODE(o80_drawWizPolygon),
|
||||
|
|
|
@ -251,7 +251,7 @@ void ScummEngine_v80he::setupOpcodes() {
|
|||
/* A4 */
|
||||
OPCODE(o72_arrayOps),
|
||||
OPCODE(o6_invalid),
|
||||
OPCODE(o80_drawBox),
|
||||
OPCODE(o6_drawBox),
|
||||
OPCODE(o6_pop),
|
||||
/* A8 */
|
||||
OPCODE(o6_getActorWidth),
|
||||
|
@ -590,20 +590,6 @@ void ScummEngine_v80he::o80_setState() {
|
|||
removeObjectFromDrawQue(obj);
|
||||
}
|
||||
|
||||
void ScummEngine_v80he::o80_drawBox() {
|
||||
int x, y, x2, y2, color;
|
||||
color = pop();
|
||||
y2 = pop();
|
||||
x2 = pop();
|
||||
y = pop();
|
||||
x = pop();
|
||||
|
||||
if (color & 0x8000)
|
||||
color &= 0x7FFF;
|
||||
|
||||
drawBox(x, y, x2, y2, color);
|
||||
}
|
||||
|
||||
void ScummEngine_v80he::o80_drawWizPolygon() {
|
||||
WizImage wi;
|
||||
wi.x1 = wi.y1 = pop();
|
||||
|
|
|
@ -250,7 +250,7 @@ void ScummEngine_v90he::setupOpcodes() {
|
|||
/* A4 */
|
||||
OPCODE(o72_arrayOps),
|
||||
OPCODE(o90_fontUnk),
|
||||
OPCODE(o80_drawBox),
|
||||
OPCODE(o6_drawBox),
|
||||
OPCODE(o6_pop),
|
||||
/* A8 */
|
||||
OPCODE(o6_getActorWidth),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue