aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Montoir2003-12-05 20:16:32 +0000
committerGregory Montoir2003-12-05 20:16:32 +0000
commit472045d578bdd4488da0aec54516881f8616ec7b (patch)
tree8e1683157782fd353dd93a23914b75ee0e81abec
parente19909d3e394682b1610a9b0326b449a7f288099 (diff)
downloadscummvm-rg350-472045d578bdd4488da0aec54516881f8616ec7b.tar.gz
scummvm-rg350-472045d578bdd4488da0aec54516881f8616ec7b.tar.bz2
scummvm-rg350-472045d578bdd4488da0aec54516881f8616ec7b.zip
- fix Joe scaling issue when switching from room 51 to 47 (temple)
- add remaining fadein() call in cutaway, pinnacle room is ok now - add 2 macros to 'clarify' some room tests - some cleanup svn-id: r11502
-rw-r--r--queen/cutaway.cpp26
-rw-r--r--queen/defs.h3
-rw-r--r--queen/display.cpp12
-rw-r--r--queen/logic.cpp39
-rw-r--r--queen/xref.txt2
5 files changed, 38 insertions, 44 deletions
diff --git a/queen/cutaway.cpp b/queen/cutaway.cpp
index b3983b0163..3cd211559f 100644
--- a/queen/cutaway.cpp
+++ b/queen/cutaway.cpp
@@ -990,7 +990,7 @@ void Cutaway::changeRooms(CutawayObject &object) {
}
else {
// We need to display Joe on screen
- if (_roomFade == 1)
+ if (_roomFade)
mode = RDM_NOFADE_JOE;
else
mode = RDM_FADE_JOE_XY;
@@ -1538,19 +1538,17 @@ void Cutaway::run(char *nextFilename) {
if (_input->cutawayQuit())
break;
- // XXX
-#if 0
- if(ROOMFADE==1)
- {
- update();
- //CR 2 - CD-Rom
- if(ROOM>=114)
- fadein(0,255);
- else
- fadein(0,223);
- ROOMFADE=0;
+ if (_roomFade) {
+ _logic->update();
+ int end = 223;
+ if (IS_CD_INTRO_ROOM(_logic->currentRoom())) {
+ end = 255;
+ }
+ BobSlot *j = _graphics->bob(0);
+ _logic->display()->palFadeIn(0, end, _logic->currentRoom(), j->active, j->x, j->y);
+ _roomFade = false;
}
-#endif
+
} // for()
stop();
@@ -1787,7 +1785,7 @@ void Cutaway::stop() {
joeBob->x = joeX;
joeBob->y = joeY;
- joeBob->scale = _logic->findScale(joeX, joeY);
+ _logic->joeScale(_logic->findScale(joeX, joeY));
_logic->joeFace();
}
}
diff --git a/queen/defs.h b/queen/defs.h
index 8ac0ebfe86..8f6e4394de 100644
--- a/queen/defs.h
+++ b/queen/defs.h
@@ -256,6 +256,9 @@ enum {
FRANK_HEAD = 107
};
+#define IS_ALT_INTRO_ROOM(x) ((x) >= 90 && (x) <= 94)
+#define IS_CD_INTRO_ROOM(x) ((x) >= 115 && (x) <= 125)
+
//! GameState vars
enum {
diff --git a/queen/display.cpp b/queen/display.cpp
index d4dbddb71b..eeaaef9540 100644
--- a/queen/display.cpp
+++ b/queen/display.cpp
@@ -146,8 +146,8 @@ void Display::dynalumInit(Resource *resource, const char *roomName, uint16 roomN
memset(_dynalum.msk, 0, sizeof(_dynalum.msk));
memset(_dynalum.lum, 0, sizeof(_dynalum.lum));
_dynalum.valid = false;
- // FIXME: are these tests really needed ?
- if (roomNum < 90 || ((roomNum > 94) && (roomNum < 114))) {
+
+ if (!(IS_ALT_INTRO_ROOM(roomNum) || IS_CD_INTRO_ROOM(roomNum))) {
char filename[20];
sprintf(filename, "%s.msk", roomName);
@@ -259,7 +259,7 @@ void Display::palFadeIn(int start, int end, uint16 roomNum, bool dynalum, int16
debug(9, "Display::palFadeIn(%d, %d)", start, end);
memcpy(_pal.screen, _pal.room, 256 * 3);
- if (roomNum < 90 || (roomNum > 94 && roomNum < 114)) {
+ if (!(IS_ALT_INTRO_ROOM(roomNum) || IS_CD_INTRO_ROOM(roomNum))) {
if (dynalum) {
dynalumUpdate(dynaX, dynaY);
}
@@ -279,7 +279,7 @@ void Display::palFadeIn(int start, int end, uint16 roomNum, bool dynalum, int16
}
}
_pal.dirtyMin = 0;
- _pal.dirtyMax = 255; // (roomNum >= 114) ? 255 : 223; // FIXME: only for tests
+ _pal.dirtyMax = IS_CD_INTRO_ROOM(roomNum) ? 255 : 223;
_pal.scrollable = true;
}
@@ -289,7 +289,7 @@ void Display::palFadeOut(int start, int end, uint16 roomNum) {
debug(9, "Display::palFadeOut(%d, %d)", start, end);
_pal.scrollable = false;
int n = end - start + 1;
- if (!(roomNum < 90 || (roomNum > 94 && roomNum < 114))) {
+ if (IS_ALT_INTRO_ROOM(roomNum) || IS_CD_INTRO_ROOM(roomNum)) {
memset(_pal.screen + start * 3, 0, n * 3);
palSet(_pal.screen, start, end, true);
}
@@ -308,7 +308,6 @@ void Display::palFadeOut(int start, int end, uint16 roomNum) {
}
palSet(_pal.screen, start, end, true);
}
-
}
}
@@ -337,7 +336,6 @@ void Display::palScroll(int start, int end) {
uint8 g = *palEnd++;
uint8 b = *palEnd;
- // scroll palette entries to the left
int n = (end - start) * 3;
while (n--) {
*palEnd = *(palEnd - 3);
diff --git a/queen/logic.cpp b/queen/logic.cpp
index 6ee6bf0eb0..52ec46aea1 100644
--- a/queen/logic.cpp
+++ b/queen/logic.cpp
@@ -1236,21 +1236,16 @@ void Logic::roomDisplay(uint16 room, RoomDisplayMode mode, uint16 scale, int com
if (mode != RDM_FADE_NOJOE) {
pod = joeSetupInRoom(mode != RDM_FADE_JOE_XY, scale);
}
- // FIXME: for now, always display room even if mode tells us
- // to not do so. This is necessary as actual Cutaway code
- // doesn't do any of the needed palFadeIn() calls. The only
- // noticeable problem is the initial display of the pinnacle
- // room which is faded 2 times.
-// if (mode != RDM_NOFADE_JOE) {
+ if (mode != RDM_NOFADE_JOE) {
update();
BobSlot *joe = _graphics->bob(0);
- if (_currentRoom >= 114) {
+ if (IS_CD_INTRO_ROOM(_currentRoom)) {
_display->palFadeIn(0, 255, _currentRoom, joe->active, joe->x, joe->y);
}
else {
_display->palFadeIn(0, 223, _currentRoom, joe->active, joe->x, joe->y);
}
-// }
+ }
if (pod != NULL) {
_walk->moveJoe(0, pod->x, pod->y, inCutaway);
}
@@ -1649,15 +1644,15 @@ ObjectData *Logic::joeSetupInRoom(bool autoPosition, uint16 scale) {
debug(0, "Logic::joeSetupInRoom() - oldx=%d, oldy=%d scale=%d", oldx, oldy, scale);
if (scale > 0 && scale < 100) {
- _joe.scale = scale;
+ joeScale(scale);
}
else {
uint16 a = zoneInArea(ZONE_ROOM, oldx, oldy);
if (a > 0) {
- _joe.scale = currentRoomArea(a)->calcScale(oldy);
+ joeScale(currentRoomArea(a)->calcScale(oldy));
}
else {
- _joe.scale = 100;
+ joeScale(100);
}
}
@@ -1685,7 +1680,7 @@ ObjectData *Logic::joeSetupInRoom(bool autoPosition, uint16 scale) {
joePrevFacing(joeFacing());
BobSlot *pbs = _graphics->bob(0);
- pbs->scale = _joe.scale;
+ pbs->scale = joeScale();
if (_currentRoom == 108) {
_graphics->cameraBob(-1);
@@ -1745,7 +1740,7 @@ uint16 Logic::joeFace() {
update();
}
pbs->frameNum = frame + FRAMES_JOE_XTRA;
- pbs->scale = _joe.scale;
+ pbs->scale = joeScale();
pbs->xflip = (joeFacing() == DIR_LEFT);
update();
joePrevFacing(joeFacing());
@@ -1788,10 +1783,10 @@ void Logic::joeGrabDirection(StateGrab grab, uint16 speed) {
break;
case STATE_GRAB_MID:
- if (_joe.facing == DIR_BACK) {
+ if (joeFacing() == DIR_BACK) {
frame = 6;
}
- else if (_joe.facing == DIR_FRONT) {
+ else if (joeFacing() == DIR_FRONT) {
frame = 4;
}
else {
@@ -1800,7 +1795,7 @@ void Logic::joeGrabDirection(StateGrab grab, uint16 speed) {
break;
case STATE_GRAB_DOWN:
- if (_joe.facing == DIR_BACK) {
+ if (joeFacing() == DIR_BACK) {
frame = 9;
}
else {
@@ -1811,13 +1806,13 @@ void Logic::joeGrabDirection(StateGrab grab, uint16 speed) {
case STATE_GRAB_UP:
// turn back
_graphics->bankUnpack(5, 29 + FRAMES_JOE_XTRA, 7);
- bobJoe->xflip = (_joe.facing == DIR_LEFT);
- bobJoe->scale = _joe.scale;
+ bobJoe->xflip = (joeFacing() == DIR_LEFT);
+ bobJoe->scale = joeScale();
update();
// grab up
_graphics->bankUnpack(7, 29 + FRAMES_JOE_XTRA, 7);
- bobJoe->xflip = (_joe.facing == DIR_LEFT);
- bobJoe->scale = _joe.scale;
+ bobJoe->xflip = (joeFacing() == DIR_LEFT);
+ bobJoe->scale = joeScale();
update();
// turn back
if (speed == 0) {
@@ -1831,8 +1826,8 @@ void Logic::joeGrabDirection(StateGrab grab, uint16 speed) {
if (frame != 0) {
_graphics->bankUnpack(frame, 29 + FRAMES_JOE_XTRA, 7);
- bobJoe->xflip = (_joe.facing == DIR_LEFT);
- bobJoe->scale = _joe.scale;
+ bobJoe->xflip = (joeFacing() == DIR_LEFT);
+ bobJoe->scale = joeScale();
update();
// extra delay for grab down
diff --git a/queen/xref.txt b/queen/xref.txt
index b8f599f67d..19ed749b39 100644
--- a/queen/xref.txt
+++ b/queen/xref.txt
@@ -263,6 +263,7 @@ OLDROOM,ROOM,NEW_ROOM Logic::_*oom
ROOMTOT Logic::_numRooms
ROOM_DATA Logic::_roomData
ROOM_NAMEstr Logic::_roomName
+SFACTOR Logic::_joe.scale
VERB_NAMEstr Verb::_verbName
WALK_OFF_DATA Logic::_walkOffData
WALK_OFF_MAX Logic::_numWalkOffs
@@ -471,7 +472,6 @@ AREAMAXv
CURRY
OMAX,OMAXA
TEMPA
-SFACTOR, // shrink factor, used to scale (down) the bobs
BANK,BNUM
DIFF // LOOK local var
RET // P1_SET_CONDITIONS local var