aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2005-05-22 10:38:57 +0000
committerTravis Howell2005-05-22 10:38:57 +0000
commit7dc115be6f9182c7f82396cab576647bf9d63f5c (patch)
treed40362d6f6874d41b638ad46d9bc5cfb82ff6eaa
parent76f8021a2895cc4ae9edb9edbc3678ebaff25e7e (diff)
downloadscummvm-rg350-7dc115be6f9182c7f82396cab576647bf9d63f5c.tar.gz
scummvm-rg350-7dc115be6f9182c7f82396cab576647bf9d63f5c.tar.bz2
scummvm-rg350-7dc115be6f9182c7f82396cab576647bf9d63f5c.zip
HE70+ games use flags in drawBox().
Fixes glitches in farmdemo (Old version), freddi2, lost/smaller. svn-id: r18216
-rw-r--r--scumm/gfx.cpp13
-rw-r--r--scumm/intern.h1
-rw-r--r--scumm/script_v100he.cpp2
-rw-r--r--scumm/script_v80he.cpp16
-rw-r--r--scumm/script_v90he.cpp2
5 files changed, 14 insertions, 20 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index 7902031879..5af4705cf8 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -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);
+ }
}
}
diff --git a/scumm/intern.h b/scumm/intern.h
index 127758393b..052a54e43c 100644
--- a/scumm/intern.h
+++ b/scumm/intern.h
@@ -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();
diff --git a/scumm/script_v100he.cpp b/scumm/script_v100he.cpp
index cb3697ed15..c9a0b8c5fd 100644
--- a/scumm/script_v100he.cpp
+++ b/scumm/script_v100he.cpp
@@ -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),
diff --git a/scumm/script_v80he.cpp b/scumm/script_v80he.cpp
index df3a833c6a..01fe275f76 100644
--- a/scumm/script_v80he.cpp
+++ b/scumm/script_v80he.cpp
@@ -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();
diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp
index fd4d948de0..4e4031094e 100644
--- a/scumm/script_v90he.cpp
+++ b/scumm/script_v90he.cpp
@@ -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),