changed range from GF_OLD256 to GF_AFTER_V3

svn-id: r6940
This commit is contained in:
Paweł Kołodziejski 2003-04-08 19:05:41 +00:00
parent b93b9dc6a0
commit 7189347adb
7 changed files with 28 additions and 28 deletions

View file

@ -822,7 +822,7 @@ void Scumm::walkActors() {
for (i = 1; i < NUM_ACTORS; i++) { for (i = 1; i < NUM_ACTORS; i++) {
a = derefActor(i); a = derefActor(i);
if (a->isInCurrentRoom()) if (a->isInCurrentRoom())
if (_features & GF_OLD256) if (_features & GF_AFTER_V3)
a->walkActorOld(); a->walkActorOld();
else else
a->walkActor(); a->walkActor();

View file

@ -209,7 +209,7 @@ Box *Scumm::getBoxBaseAddr(int box) {
return NULL; return NULL;
checkRange(ptr[0] - 1, 0, box, "Illegal box %d"); checkRange(ptr[0] - 1, 0, box, "Illegal box %d");
if (_features & GF_SMALL_HEADER) { if (_features & GF_SMALL_HEADER) {
if (_features & GF_OLD256) if (_features & GF_AFTER_V3) // GF_OLD256 or GF_AFTER_V3 ?
return (Box *)(ptr + box * (SIZEOF_BOX - 2) + 1); return (Box *)(ptr + box * (SIZEOF_BOX - 2) + 1);
else else
return (Box *)(ptr + box * SIZEOF_BOX + 1); return (Box *)(ptr + box * SIZEOF_BOX + 1);

View file

@ -1226,7 +1226,7 @@ byte CostumeRenderer::drawLimb(const CostumeData &cost, int limb) {
_srcptr = _loaded._ptr + READ_LE_UINT16(_frameptr + code * 2); _srcptr = _loaded._ptr + READ_LE_UINT16(_frameptr + code * 2);
if (code != 0x7B) { if (code != 0x7B) {
if (!(_vm->_features & GF_OLD256) || code < 0x79) if (!(_vm->_features & GF_OLD256) || code < 0x79) // GF_OLD256 or GF_AFTER_V3 ?
return mainRoutine(limb, code); return mainRoutine(limb, code);
} }
@ -1261,7 +1261,7 @@ void Scumm::cost_decodeData(Actor *a, int frame, uint usemask) {
return; return;
} }
if (_features & GF_OLD256) if (_features & GF_AFTER_V3)
dataptr = p + *(p + lc._numColors + 8); dataptr = p + *(p + lc._numColors + 8);
else else
dataptr = p + READ_LE_UINT16(p + lc._numColors + 8); dataptr = p + READ_LE_UINT16(p + lc._numColors + 8);
@ -1271,7 +1271,7 @@ void Scumm::cost_decodeData(Actor *a, int frame, uint usemask) {
i = 0; i = 0;
do { do {
if (mask & 0x8000) { if (mask & 0x8000) {
if (_features & GF_OLD256) { if (_features & GF_AFTER_V3) {
j = 0; j = 0;
j = *(r); j = *(r);
r++; r++;

View file

@ -366,7 +366,7 @@ void Scumm::drawDirtyScreenParts() {
byte *src; byte *src;
updateDirtyScreen(2); updateDirtyScreen(2);
if (_features & GF_OLD256) if (_features & GF_AFTER_V3)
updateDirtyScreen(1); updateDirtyScreen(1);
if (camera._last.x == camera._cur.x && (camera._last.y == camera._cur.y || !(_features & GF_AFTER_V7))) { if (camera._last.x == camera._cur.x && (camera._last.y == camera._cur.y || !(_features & GF_AFTER_V7))) {
@ -522,7 +522,7 @@ void Scumm::initBGBuffers(int height) {
} }
room = getResourceAddress(rtRoom, _roomResource); room = getResourceAddress(rtRoom, _roomResource);
if (_features & GF_OLD256) { if (_features & GF_AFTER_V3) {
// FIXME - maybe this should check for multiple planes like we do // FIXME - maybe this should check for multiple planes like we do
// for GF_SMALL_HEADER already. // for GF_SMALL_HEADER already.
gdi._numZBuffer = 2; gdi._numZBuffer = 2;
@ -854,7 +854,7 @@ void Gdi::drawBitmap(byte *ptr, VirtScreen *vs, int x, int y, const int h,
(ptr[-4] == 'O' && ptr[-3] == 'I' && READ_LE_UINT32(ptr - 8) > READ_LE_UINT32(ptr) + 12)) { (ptr[-4] == 'O' && ptr[-3] == 'I' && READ_LE_UINT32(ptr - 8) > READ_LE_UINT32(ptr) + 12)) {
zplane_list[1] = smap_ptr + READ_LE_UINT32(ptr); zplane_list[1] = smap_ptr + READ_LE_UINT32(ptr);
// FIXME - how does GF_OLD256 encode the multiple zplanes? // FIXME - how does GF_OLD256 encode the multiple zplanes?
if (!(_vm->_features & GF_OLD256)) if (!(_vm->_features & GF_AFTER_V3))
for (i = 2; i < numzbuf; i++) { for (i = 2; i < numzbuf; i++) {
zplane_list[i] = zplane_list[i-1] + READ_LE_UINT16(zplane_list[i-1]); zplane_list[i] = zplane_list[i-1] + READ_LE_UINT16(zplane_list[i-1]);
} }
@ -984,7 +984,7 @@ void Gdi::drawBitmap(byte *ptr, VirtScreen *vs, int x, int y, const int h,
if (!zplane_list[i]) if (!zplane_list[i])
continue; continue;
if (_vm->_features & GF_OLD256) if (_vm->_features & GF_AFTER_V3) // GF_OLD256 or GF_AFTER_V3 ?
offs = READ_LE_UINT16(zplane_list[i] + stripnr * 2 + 4); offs = READ_LE_UINT16(zplane_list[i] + stripnr * 2 + 4);
else if (_vm->_features & GF_SMALL_HEADER) else if (_vm->_features & GF_SMALL_HEADER)
offs = READ_LE_UINT16(zplane_list[i] + stripnr * 2 + 2); offs = READ_LE_UINT16(zplane_list[i] + stripnr * 2 + 2);

View file

@ -183,7 +183,7 @@ void Scumm_v5::setupOpcodes() {
OPCODE(o5_walkActorToObject), OPCODE(o5_walkActorToObject),
OPCODE(o5_startObject), OPCODE(o5_startObject),
/* 78 */ /* 78 */
OPCODE(o5_isGreater), /* less? */ OPCODE(o5_isGreater),
OPCODE(o5_doSentence), OPCODE(o5_doSentence),
OPCODE(o5_verbOps), OPCODE(o5_verbOps),
OPCODE(o5_getActorWalkBox), OPCODE(o5_getActorWalkBox),
@ -198,7 +198,7 @@ void Scumm_v5::setupOpcodes() {
OPCODE(o5_startMusic), OPCODE(o5_startMusic),
OPCODE(o5_getActorRoom), OPCODE(o5_getActorRoom),
/* 84 */ /* 84 */
OPCODE(o5_isGreaterEqual), /* less equal? */ OPCODE(o5_isGreaterEqual),
OPCODE(o5_drawObject), OPCODE(o5_drawObject),
OPCODE(o5_getActorElevation), OPCODE(o5_getActorElevation),
OPCODE(o5_setState), OPCODE(o5_setState),
@ -1318,7 +1318,7 @@ void Scumm_v5::o5_loadRoomWithEgo() {
void Scumm_v5::o5_matrixOps() { void Scumm_v5::o5_matrixOps() {
int a, b; int a, b;
if (_features & GF_OLD256) { if (_features & GF_AFTER_V3) {
a = getVarOrDirectByte(0x80); a = getVarOrDirectByte(0x80);
b = fetchScriptByte(); b = fetchScriptByte();
setBoxFlags(a, b); setBoxFlags(a, b);
@ -1492,7 +1492,7 @@ void Scumm_v5::o5_resourceRoutines() {
ensureResourceLoaded(resType[_opcode-1], resid); ensureResourceLoaded(resType[_opcode-1], resid);
break; break;
case 4: // load room case 4: // load room
if (_gameId == GID_ZAK256) { if (_features == GF_AFTER_V3) {
ensureResourceLoaded(rtRoom, resid); ensureResourceLoaded(rtRoom, resid);
if (resid > 0x7F) if (resid > 0x7F)
resid = _resourceMapper[resid & 0x7F]; resid = _resourceMapper[resid & 0x7F];
@ -1596,7 +1596,7 @@ void Scumm_v5::o5_resourceRoutines() {
void Scumm_v5::o5_roomOps() { void Scumm_v5::o5_roomOps() {
int a = 0, b = 0, c, d, e; int a = 0, b = 0, c, d, e;
if (_features & GF_OLD256) { if (_features & GF_AFTER_V3) {
a = getVarOrDirectWord(0x80); a = getVarOrDirectWord(0x80);
b = getVarOrDirectWord(0x40); b = getVarOrDirectWord(0x40);
} }
@ -1604,7 +1604,7 @@ void Scumm_v5::o5_roomOps() {
_opcode = fetchScriptByte(); _opcode = fetchScriptByte();
switch (_opcode & 0x1F) { switch (_opcode & 0x1F) {
case 1: /* room scroll */ case 1: /* room scroll */
if (!(_features & GF_OLD256)) { if (!(_features & GF_AFTER_V3)) {
a = getVarOrDirectWord(0x80); a = getVarOrDirectWord(0x80);
b = getVarOrDirectWord(0x40); b = getVarOrDirectWord(0x40);
} }
@ -1621,7 +1621,7 @@ void Scumm_v5::o5_roomOps() {
break; break;
case 2: /* room color */ case 2: /* room color */
if (_features & GF_SMALL_HEADER) { if (_features & GF_SMALL_HEADER) {
if (!(_features & GF_OLD256)) { if (!(_features & GF_AFTER_V2)) {
a = getVarOrDirectWord(0x80); a = getVarOrDirectWord(0x80);
b = getVarOrDirectWord(0x40); b = getVarOrDirectWord(0x40);
} }
@ -1639,7 +1639,7 @@ void Scumm_v5::o5_roomOps() {
break; break;
case 3: /* set screen */ case 3: /* set screen */
if (!(_features & GF_OLD256)) { if (!(_features & GF_AFTER_V3)) {
a = getVarOrDirectWord(0x80); a = getVarOrDirectWord(0x80);
b = getVarOrDirectWord(0x40); b = getVarOrDirectWord(0x40);
} }
@ -1647,7 +1647,7 @@ void Scumm_v5::o5_roomOps() {
break; break;
case 4: /* set palette color */ case 4: /* set palette color */
if (_features & GF_SMALL_HEADER) { if (_features & GF_SMALL_HEADER) {
if (!(_features & GF_OLD256)) { if (!(_features & GF_AFTER_V3)) {
a = getVarOrDirectWord(0x80); a = getVarOrDirectWord(0x80);
b = getVarOrDirectWord(0x40); b = getVarOrDirectWord(0x40);
} }
@ -1681,7 +1681,7 @@ void Scumm_v5::o5_roomOps() {
break; break;
case 8: /* room scale? */ case 8: /* room scale? */
if (_features & GF_SMALL_HEADER) { if (_features & GF_SMALL_HEADER) {
if (!(_features & GF_OLD256)) { if (!(_features & GF_AFTER_V3)) {
a = getVarOrDirectWord(0x80); a = getVarOrDirectWord(0x80);
b = getVarOrDirectWord(0x40); b = getVarOrDirectWord(0x40);
} }

View file

@ -414,7 +414,7 @@ void Scumm::scummInit() {
clearDrawObjectQueue(); clearDrawObjectQueue();
for (i = 0; i < 6; i++) { for (i = 0; i < 6; i++) {
if (_features & GF_OLD256) { if (_features & GF_AFTER_V3) { // GF_OLD256 or GF_AFTER_V3 ?
_string[i].t_xpos = 0; _string[i].t_xpos = 0;
_string[i].t_ypos = 0; _string[i].t_ypos = 0;
} else { } else {
@ -911,7 +911,7 @@ void Scumm::initRoomSubBlocks() {
if (ptr) { if (ptr) {
byte numOfBoxes = *(ptr); byte numOfBoxes = *(ptr);
int size; int size;
if (_features & GF_OLD256) if (_features & GF_AFTER_V3) // GF_OLD256 or GF_AFTER_V3 ?
size = numOfBoxes * (SIZEOF_BOX - 2) + 1; size = numOfBoxes * (SIZEOF_BOX - 2) + 1;
else else
size = numOfBoxes * SIZEOF_BOX + 1; size = numOfBoxes * SIZEOF_BOX + 1;
@ -1229,7 +1229,7 @@ void Scumm::processKbd() {
else else
_virtual_mouse_y = mouse.y; _virtual_mouse_y = mouse.y;
if (!(_features & GF_OLD256)) if (!(_features & GF_AFTER_V3))
_virtual_mouse_y += virtscr[0].topline; _virtual_mouse_y += virtscr[0].topline;
else else
_virtual_mouse_y -= 16; _virtual_mouse_y -= 16;
@ -1237,7 +1237,7 @@ void Scumm::processKbd() {
if (_virtual_mouse_y < 0) if (_virtual_mouse_y < 0)
_virtual_mouse_y = -1; _virtual_mouse_y = -1;
if (_features & GF_OLD256) { if (_features & GF_AFTER_V3) {
if (_virtual_mouse_y >= virtscr[0].height + virtscr[0].topline) if (_virtual_mouse_y >= virtscr[0].height + virtscr[0].topline)
_virtual_mouse_y = -1; _virtual_mouse_y = -1;
} else { } else {

View file

@ -144,7 +144,7 @@ void Scumm::CHARSET_1() {
_charset->_right = _string[0].right; _charset->_right = _string[0].right;
_charset->_color = _charsetColor; _charset->_color = _charsetColor;
if (!(_features & GF_OLD256)) // FIXME if (!(_features & GF_AFTER_V3)) // FIXME
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
_charsetColorMap[i] = _charsetData[_charset->getCurID()][i]; _charsetColorMap[i] = _charsetData[_charset->getCurID()][i];
@ -187,7 +187,7 @@ void Scumm::CHARSET_1() {
_talkDelay = _defaultTalkDelay; _talkDelay = _defaultTalkDelay;
if (!_keepText) { if (!_keepText) {
if (_features & GF_OLD256) { if (_features & GF_AFTER_V3) {
gdi._mask_left = _string[0].xpos; gdi._mask_left = _string[0].xpos;
gdi._mask_top = _string[0].ypos; gdi._mask_top = _string[0].ypos;
gdi._mask_bottom = _string[0].ypos + 8; gdi._mask_bottom = _string[0].ypos + 8;
@ -227,7 +227,7 @@ void Scumm::CHARSET_1() {
} }
if (c == 13) { if (c == 13) {
newLine:; newLine:;
if (_features & GF_OLD256) { if (_features & GF_AFTER_V3) {
_charset->_nextTop = 8; _charset->_nextTop = 8;
_charset->_nextLeft = 0; _charset->_nextLeft = 0;
continue; continue;
@ -248,7 +248,7 @@ void Scumm::CHARSET_1() {
if (c != 0xFF) { if (c != 0xFF) {
_charset->_left = _charset->_nextLeft; _charset->_left = _charset->_nextLeft;
_charset->_top = _charset->_nextTop; _charset->_top = _charset->_nextTop;
if (_features & GF_OLD256) { if (_features & GF_AFTER_V3) {
_charset->printChar(c); _charset->printChar(c);
} else if (_features & GF_AFTER_V6) { } else if (_features & GF_AFTER_V6) {
if (!_noSubtitles || (_haveMsg != 0xFE && _haveMsg != 0xFF)) if (!_noSubtitles || (_haveMsg != 0xFE && _haveMsg != 0xFF))
@ -410,7 +410,7 @@ void Scumm::drawString(int a) {
_charset->_disableOffsX = _charset->_firstChar = true; _charset->_disableOffsX = _charset->_firstChar = true;
_charset->setCurID(_string[a].charset); _charset->setCurID(_string[a].charset);
if (!(_features & GF_OLD256)) { if (!(_features & GF_AFTER_V3)) {
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
_charsetColorMap[i] = _charsetData[_charset->getCurID()][i]; _charsetColorMap[i] = _charsetData[_charset->getCurID()][i];