aboutsummaryrefslogtreecommitdiff
path: root/saga
diff options
context:
space:
mode:
authorAndrew Kurushin2005-01-07 21:24:26 +0000
committerAndrew Kurushin2005-01-07 21:24:26 +0000
commit12b5c5f85515b3f2f837992f63040373aba167ba (patch)
treecf1f3dc506d587e76d2782018db068b7dbe41422 /saga
parenteb76ac619fdb9cccf0e3ba97115894d046a8f563 (diff)
downloadscummvm-rg350-12b5c5f85515b3f2f837992f63040373aba167ba.tar.gz
scummvm-rg350-12b5c5f85515b3f2f837992f63040373aba167ba.tar.bz2
scummvm-rg350-12b5c5f85515b3f2f837992f63040373aba167ba.zip
fixing scene transition
svn-id: r16480
Diffstat (limited to 'saga')
-rw-r--r--saga/actionmap.cpp1
-rw-r--r--saga/actor.cpp10
-rw-r--r--saga/scene.cpp18
3 files changed, 17 insertions, 12 deletions
diff --git a/saga/actionmap.cpp b/saga/actionmap.cpp
index ddc7aa4633..1dfb654e20 100644
--- a/saga/actionmap.cpp
+++ b/saga/actionmap.cpp
@@ -69,6 +69,7 @@ void ActionMap::freeMem() {
}
free(_stepZoneList);
+ _stepZoneList = NULL;
}
}
diff --git a/saga/actor.cpp b/saga/actor.cpp
index e7611ebd8a..3e491ca0d0 100644
--- a/saga/actor.cpp
+++ b/saga/actor.cpp
@@ -370,11 +370,11 @@ ActorData *Actor::getActor(uint16 actorId) {
}
bool Actor::validFollowerLocation(const ActorLocation &location) {
- Point point;
+ Point point;
location.toScreenPointXY(point);
if ((point.x < 5) || (point.x >= _vm->getDisplayWidth() - 5) ||
- (point.y < 0) || (point.y >= _vm->getStatusYOffset())) {
+ (point.y < 0) || (point.y > _vm->getStatusYOffset())) {
return false;
}
@@ -1379,7 +1379,11 @@ void Actor::findActorPath(ActorData *actor, const Point &fromPoint, const Point
for (iteratorPoint.y = 0; iteratorPoint.y < _yCellCount; iteratorPoint.y++) {
for (iteratorPoint.x = 0; iteratorPoint.x < _xCellCount; iteratorPoint.x++) {
- maskType = _vm->_scene->getBGMaskType(iteratorPoint);
+ if (_vm->_scene->validBGMaskPoint(iteratorPoint)) {
+ maskType = _vm->_scene->getBGMaskType(iteratorPoint);
+ } else {
+ maskType = 1;
+ }
setPathCell(iteratorPoint, maskType ? kPathCellBarrier : kPathCellEmpty);
}
}
diff --git a/saga/scene.cpp b/saga/scene.cpp
index c4d8102c5a..d11f953952 100644
--- a/saga/scene.cpp
+++ b/saga/scene.cpp
@@ -409,15 +409,14 @@ bool Scene::offscreenPath(Point &testPoint) {
return false;
}
-
- first.x = clamp( 0, testPoint.x, _vm->getDisplayWidth() - 1 );
- first.y = clamp( 0, testPoint.y, _vm->getDisplayHeight() - 1 );
+ first.x = clamp( 0, testPoint.x, _bgMask.w - 1 );
+ first.y = clamp( 0, testPoint.y, _bgMask.h - 1 );
if (first == testPoint) {
return false;
}
- if (first.y >= _vm->getDisplayHeight() - 1) {
- first.y = 200 -1 - 1;
+ if (first.y >= _bgMask.h - 1) {
+ first.y = _bgMask.h - 2;
}
testPoint = first;
@@ -432,12 +431,12 @@ bool Scene::offscreenPath(Point &testPoint) {
break;
}
} else {
- if (third.x >= _vm->getDisplayWidth()) {
+ if (third.x >= _bgMask.w) {
return false;
}
}
- if (third.x < _vm->getDisplayWidth()) {
+ if (third.x < _bgMask.w) {
maskType = getBGMaskType(third);
if (getDoorState(maskType) == 0) {
testPoint.x = third.x + 1;
@@ -458,12 +457,12 @@ bool Scene::offscreenPath(Point &testPoint) {
break;
}
} else {
- if (third.y > _vm->getDisplayHeight() - 1) {
+ if (third.y >= _bgMask.h) {
return false;
}
}
- if (third.y <= _vm->getDisplayHeight() - 1) {
+ if (third.y < _bgMask.h) {
maskType = getBGMaskType(third);
if (getDoorState(maskType) == 0) {
testPoint.y = third.y + 1;
@@ -809,6 +808,7 @@ int Scene::processSceneResources() {
_bgMask.loaded = 1;
_vm->decodeBGImage(_bgMask.res_buf, _bgMask.res_len, &_bgMask.buf,
&_bgMask.buf_len, &_bgMask.w, &_bgMask.h);
+ debug(0, "BACKGROUND MASK width=%d height=%d length=%d", _bgMask.w, _bgMask.h, _bgMask.buf_len);
break;
case SAGA_OBJECT_NAME_LIST:
debug(0, "Loading object name list resource...");