aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actor.cpp3
-rw-r--r--boxes.cpp27
-rw-r--r--scumm.h7
-rw-r--r--scummvm.cpp17
-rw-r--r--sdl.cpp8
5 files changed, 40 insertions, 22 deletions
diff --git a/actor.cpp b/actor.cpp
index 9bd7d0b69f..0acfb74498 100644
--- a/actor.cpp
+++ b/actor.cpp
@@ -628,8 +628,9 @@ void Scumm::clearMsgQueue() {
void Scumm::walkActors() {
int i;
Actor *a;
+
for (i=1; i<NUM_ACTORS; i++) {
- a = derefActor(i);
+ a = derefActor(i);
if (a->room==_currentRoom)
walkActor(a);
}
diff --git a/boxes.cpp b/boxes.cpp
index 2e053d1f28..79ca9e17fb 100644
--- a/boxes.cpp
+++ b/boxes.cpp
@@ -116,14 +116,25 @@ bool Scumm::checkXYInBoxBounds(int b, int x, int y) {
void Scumm::getBoxCoordinates(int boxnum, BoxCoords *box) {
Box *bp = getBoxBaseAddr(boxnum);
- box->ul.x = (int16)FROM_LE_16(bp->ulx);
- box->ul.y = (int16)FROM_LE_16(bp->uly);
- box->ur.x = (int16)FROM_LE_16(bp->urx);
- box->ur.y = (int16)FROM_LE_16(bp->ury);
- box->ll.x = (int16)FROM_LE_16(bp->llx);
- box->ll.y = (int16)FROM_LE_16(bp->lly);
- box->lr.x = (int16)FROM_LE_16(bp->lrx);
- box->lr.y = (int16)FROM_LE_16(bp->lry);
+ if(_features & GF_NO_SCALLING){
+ box->ul.x = (int16)FROM_LE_16(bp->ulx);
+ box->ul.y = (int16)FROM_LE_16(bp->uly);
+ box->ur.x = (int16)FROM_LE_16(bp->urx);
+ box->ur.y = (int16)FROM_LE_16(bp->ury);
+ box->lr.x = (int16)FROM_LE_16(bp->llx);
+ box->lr.y = (int16)FROM_LE_16(bp->lly);
+ box->ll.x = (int16)FROM_LE_16(bp->lrx);
+ box->ll.y = (int16)FROM_LE_16(bp->lry);
+ } else {
+ box->ul.x = (int16)FROM_LE_16(bp->ulx);
+ box->ul.y = (int16)FROM_LE_16(bp->uly);
+ box->ur.x = (int16)FROM_LE_16(bp->urx);
+ box->ur.y = (int16)FROM_LE_16(bp->ury);
+ box->ll.x = (int16)FROM_LE_16(bp->llx);
+ box->ll.y = (int16)FROM_LE_16(bp->lly);
+ box->lr.x = (int16)FROM_LE_16(bp->lrx);
+ box->lr.y = (int16)FROM_LE_16(bp->lry);
+ }
}
uint Scumm::distanceFromPt(int x, int y, int ptx, int pty) {
diff --git a/scumm.h b/scumm.h
index ccc68e919c..e18942c987 100644
--- a/scumm.h
+++ b/scumm.h
@@ -63,13 +63,8 @@ struct MemBlkHeader {
struct Box { /* file format */
int16 ulx,uly;
int16 urx,ury;
-#if 1 // Ender - set to 0 for indy3/zak256
int16 llx,lly;
int16 lrx,lry;
-#else
- int16 lrx,lry;
- int16 llx,lly;
-#endif
byte mask;
byte flags;
uint16 scale;
@@ -2269,4 +2264,4 @@ bool isSfxFinished();
void waitForTimer(Scumm *s, int msec_delay);
void setShakePos(Scumm *s, int shake_pos);
uint16 newTag2Old(uint32 oldTag);
-void cd_playtrack(int track, int offset, int delay); \ No newline at end of file
+void cd_playtrack(int track, int offset, int delay);
diff --git a/scummvm.cpp b/scummvm.cpp
index 67a51faa84..ab32fb9482 100644
--- a/scummvm.cpp
+++ b/scummvm.cpp
@@ -899,11 +899,22 @@ void Scumm::processKbd() {
getKeyInput(0);
_virtual_mouse_x = mouse.x + virtscr[0].xstart;
- _virtual_mouse_y = mouse.y + virtscr[0].topline;
+ _virtual_mouse_y = mouse.y;
+
+ if(!(_features & GF_OLD256))
+ _virtual_mouse_y+=virtscr[0].topline;
+ else
+ _virtual_mouse_y-=16;
+
if (_virtual_mouse_y < 0)
_virtual_mouse_y = -1;
- if (_virtual_mouse_y >= virtscr[0].height)
- _virtual_mouse_y = -1;
+ if (_features & GF_OLD256) {
+ if (_virtual_mouse_y >= virtscr[0].height + virtscr[0].topline)
+ _virtual_mouse_y = -1;
+ } else {
+ if (_virtual_mouse_y >= virtscr[0].height)
+ _virtual_mouse_y = -1;
+ }
if (!_lastKeyHit)
return;
diff --git a/sdl.cpp b/sdl.cpp
index 0913b1c000..ea86127d0e 100644
--- a/sdl.cpp
+++ b/sdl.cpp
@@ -776,10 +776,10 @@ void BoxTest(int num) {
Sint16 rx1[4], ry1[4];
scumm.getBoxCoordinates(num, &box);
- rx1[0] = box.ul.x*2; ry1[0] = box.ul.y*2;
- rx1[1] = box.ur.x*2; ry1[1] = box.ur.y*2;
- rx1[2] = box.lr.x*2; ry1[2] = box.lr.y*2;
- rx1[3] = box.ll.x*2; ry1[3] = box.ll.y*2;
+ rx1[0] = box.ul.x*2; ry1[0] = box.ul.y*2+32;
+ rx1[1] = box.ur.x*2; ry1[1] = box.ur.y*2+32;
+ rx1[2] = box.lr.x*2; ry1[2] = box.lr.y*2+32;
+ rx1[3] = box.ll.x*2; ry1[3] = box.ll.y*2+32;
filledPolygonColor(screen, &rx1[0], &ry1[0], 4, 255);
SDL_UpdateRect(screen, 0,0,0,0);