cleanup: moved some things to gfx.cpp and changed o60_setState to match disassembly of version 72

svn-id: r15578
This commit is contained in:
Gregory Montoir 2004-10-17 05:04:49 +00:00
parent 3905129a97
commit 0765435c44
5 changed files with 33 additions and 43 deletions

View file

@ -23,6 +23,7 @@
#include "scumm/scumm.h" #include "scumm/scumm.h"
#include "scumm/actor.h" #include "scumm/actor.h"
#include "scumm/charset.h" #include "scumm/charset.h"
#include "scumm/intern.h"
#include "scumm/resource.h" #include "scumm/resource.h"
#include "scumm/usage_bits.h" #include "scumm/usage_bits.h"
@ -585,32 +586,11 @@ void ScummEngine::redrawBGAreas() {
int i; int i;
int diff; int diff;
int val = 0; int val = 0;
bool cont = true;
if (!(_features & GF_NEW_CAMERA)) if (!(_features & GF_NEW_CAMERA))
if (camera._cur.x != camera._last.x && _charset->_hasMask && (_version > 3 && _gameId != GID_PASS)) if (camera._cur.x != camera._last.x && _charset->_hasMask && (_version > 3 && _gameId != GID_PASS))
stopTalk(); 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. // Redraw parts of the background which are marked as dirty.
if (!_fullRedraw && _bgNeedsRedraw) { if (!_fullRedraw && _bgNeedsRedraw) {
for (i = 0; i != gdi._numStrips; i++) { for (i = 0; i != gdi._numStrips; i++) {
@ -650,6 +630,30 @@ void ScummEngine::redrawBGAreas() {
_bgNeedsRedraw = false; _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) { void ScummEngine::redrawBGStrip(int start, int num) {
byte *room; byte *room;

View file

@ -622,6 +622,8 @@ protected:
virtual void executeOpcode(byte i); virtual void executeOpcode(byte i);
virtual const char *getOpcodeDesc(byte i); virtual const char *getOpcodeDesc(byte i);
virtual void redrawBGAreas();
void arrrays_unk2(int dst, int src, int len2, int len); void arrrays_unk2(int dst, int src, int len2, int len);
void polygonErase(int fromId, int toId); void polygonErase(int fromId, int toId);

View file

@ -405,11 +405,15 @@ void ScummEngine_v60he::o60_setState() {
int state = pop(); int state = pop();
int obj = pop(); int obj = pop();
if (_heversion >= 72) {
putState(obj, state & 0x7FFF);
removeObjectFromDrawQue(obj);
return;
}
if (state & 0x8000) { if (state & 0x8000) {
state &= 0x7FFF; state &= 0x7FFF;
putState(obj, state); putState(obj, state);
if (_heversion >= 72)
removeObjectFromDrawQue(obj);
return; return;
} }

View file

@ -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() { void ScummEngine_v72he::flushWizBuffer() {
for (int i = 0; i < _wizImagesNum; ++i) { for (int i = 0; i < _wizImagesNum; ++i) {
WizImage *pwi = &_wizImages[i]; WizImage *pwi = &_wizImages[i];

View file

@ -632,21 +632,6 @@ void ScummEngine_v90he::processWizImage(const WizParameters *params) {
} }
break; break;
case 6: 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+ // HE 99+
case 7: case 7:
case 8: case 8: