aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorGregory Montoir2004-10-17 05:04:49 +0000
committerGregory Montoir2004-10-17 05:04:49 +0000
commit0765435c444c364016b0647a530085939a037f57 (patch)
tree49e7182e8a74cd2666a8a79e00afda63bd4c9a22 /scumm
parent3905129a9702e8f6db9b345734a27133fb630882 (diff)
downloadscummvm-rg350-0765435c444c364016b0647a530085939a037f57.tar.gz
scummvm-rg350-0765435c444c364016b0647a530085939a037f57.tar.bz2
scummvm-rg350-0765435c444c364016b0647a530085939a037f57.zip
cleanup: moved some things to gfx.cpp and changed o60_setState to match disassembly of version 72
svn-id: r15578
Diffstat (limited to 'scumm')
-rw-r--r--scumm/gfx.cpp46
-rw-r--r--scumm/intern.h2
-rw-r--r--scumm/script_v6he.cpp8
-rw-r--r--scumm/script_v72he.cpp5
-rw-r--r--scumm/script_v90he.cpp15
5 files changed, 33 insertions, 43 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index 9fee74401d..779993a8f0 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -23,6 +23,7 @@
#include "scumm/scumm.h"
#include "scumm/actor.h"
#include "scumm/charset.h"
+#include "scumm/intern.h"
#include "scumm/resource.h"
#include "scumm/usage_bits.h"
@@ -585,32 +586,11 @@ void ScummEngine::redrawBGAreas() {
int i;
int diff;
int val = 0;
- bool cont = true;
if (!(_features & GF_NEW_CAMERA))
if (camera._cur.x != camera._last.x && _charset->_hasMask && (_version > 3 && _gameId != GID_PASS))
stopTalk();
- if (_heversion >= 70) {
- byte *room = getResourceAddress(rtRoomImage, _roomResource) + _IM00_offs;
- if (findResource(MKID('BMAP'), room) != NULL) {
- if (_fullRedraw) {
- _bgNeedsRedraw = false;
- gdi.drawBMAPBg(room, &virtscr[0], _screenStartStrip);
- }
- cont = false;
- } else if (findResource(MKID('SMAP'), room) == NULL) {
- warning("redrawBGAreas(): Both SMAP and BMAP are missing...");
- cont = false;
- }
-
- if (!cont) {
- drawRoomObjects(val);
- _bgNeedsRedraw = false;
- return;
- }
- }
-
// Redraw parts of the background which are marked as dirty.
if (!_fullRedraw && _bgNeedsRedraw) {
for (i = 0; i != gdi._numStrips; i++) {
@@ -650,6 +630,30 @@ void ScummEngine::redrawBGAreas() {
_bgNeedsRedraw = false;
}
+void ScummEngine_v70he::redrawBGAreas() {
+ int val = 0;
+ if (camera._cur.x != camera._last.x && _charset->_hasMask)
+ stopTalk();
+
+ byte *room = getResourceAddress(rtRoomImage, _roomResource) + _IM00_offs;
+ if (findResource(MKID('BMAP'), room) != NULL) {
+ if (_fullRedraw) {
+ _bgNeedsRedraw = false;
+ gdi.drawBMAPBg(room, &virtscr[0], _screenStartStrip);
+ }
+ } else if (findResource(MKID('SMAP'), room) == NULL) {
+ warning("redrawBGAreas(): Both SMAP and BMAP are missing...");
+ }
+
+ drawRoomObjects(val);
+ _bgNeedsRedraw = false;
+}
+
+void ScummEngine_v72he::redrawBGAreas() {
+ ScummEngine_v70he::redrawBGAreas();
+ flushWizBuffer();
+}
+
void ScummEngine::redrawBGStrip(int start, int num) {
byte *room;
diff --git a/scumm/intern.h b/scumm/intern.h
index 4682be2683..2d9d6dbd11 100644
--- a/scumm/intern.h
+++ b/scumm/intern.h
@@ -621,6 +621,8 @@ protected:
virtual void setupOpcodes();
virtual void executeOpcode(byte i);
virtual const char *getOpcodeDesc(byte i);
+
+ virtual void redrawBGAreas();
void arrrays_unk2(int dst, int src, int len2, int len);
diff --git a/scumm/script_v6he.cpp b/scumm/script_v6he.cpp
index a550e12219..6795f2560c 100644
--- a/scumm/script_v6he.cpp
+++ b/scumm/script_v6he.cpp
@@ -405,11 +405,15 @@ void ScummEngine_v60he::o60_setState() {
int state = pop();
int obj = pop();
+ if (_heversion >= 72) {
+ putState(obj, state & 0x7FFF);
+ removeObjectFromDrawQue(obj);
+ return;
+ }
+
if (state & 0x8000) {
state &= 0x7FFF;
putState(obj, state);
- if (_heversion >= 72)
- removeObjectFromDrawQue(obj);
return;
}
diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp
index 58e55a8f78..50426569b4 100644
--- a/scumm/script_v72he.cpp
+++ b/scumm/script_v72he.cpp
@@ -2043,11 +2043,6 @@ void ScummEngine_v72he::drawWizPolygon(int resnum, int state, int id, int flags)
}
}
-void ScummEngine_v72he::redrawBGAreas() {
- ScummEngine_v70he::redrawBGAreas();
- flushWizBuffer();
-}
-
void ScummEngine_v72he::flushWizBuffer() {
for (int i = 0; i < _wizImagesNum; ++i) {
WizImage *pwi = &_wizImages[i];
diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp
index 5c97e3e446..7a84fc7a81 100644
--- a/scumm/script_v90he.cpp
+++ b/scumm/script_v90he.cpp
@@ -632,21 +632,6 @@ void ScummEngine_v90he::processWizImage(const WizParameters *params) {
}
break;
case 6:
- if (params->processFlags & 0x40) {
- int state = (params->processFlags & 0x400) ? params->img.state : 0;
- int num = params->remapNum;
- const uint8 *index = params->remapIndex;
- uint8 *iwiz = getResourceAddress(rtImage, params->img.resNum);
- assert(iwiz);
- uint8 *rmap = findWrappedBlock(MKID('RMAP'), iwiz, state, 0) ;
- assert(rmap);
- *(uint32 *)(rmap + 8) = TO_BE_32(0x12345678);
- while (num--) {
- uint8 idx = *index++;
- rmap[0xC + idx] = params->remapColor[idx];
- }
- }
- break;
// HE 99+
case 7:
case 8: