diff options
author | Andrew Kurushin | 2005-04-02 20:04:39 +0000 |
---|---|---|
committer | Andrew Kurushin | 2005-04-02 20:04:39 +0000 |
commit | 13e2492b93de53622665fd9e479c548bef96060f (patch) | |
tree | 85b9bf4ed893a59bd9a07aa00ef057cc89a91a6e /saga | |
parent | c5a48549459bf1302c2e6259a79b05ec195c045d (diff) | |
download | scummvm-rg350-13e2492b93de53622665fd9e479c548bef96060f.tar.gz scummvm-rg350-13e2492b93de53622665fd9e479c548bef96060f.tar.bz2 scummvm-rg350-13e2492b93de53622665fd9e479c548bef96060f.zip |
some world map fix:
-only riff shows as small point
-change scene from world map
todo: in original talk_to not shows for riff on world map
svn-id: r17340
Diffstat (limited to 'saga')
-rw-r--r-- | saga/actor.cpp | 16 | ||||
-rw-r--r-- | saga/isomap.cpp | 8 | ||||
-rw-r--r-- | saga/scene.cpp | 26 | ||||
-rw-r--r-- | saga/scene.h | 5 |
4 files changed, 28 insertions, 27 deletions
diff --git a/saga/actor.cpp b/saga/actor.cpp index ea0073bbd6..c7fd31ada0 100644 --- a/saga/actor.cpp +++ b/saga/actor.cpp @@ -568,11 +568,17 @@ void Actor::updateActorsScene(int actorsEntrance) { for (i = 0; i < _actorsCount; i++) { actor = _actors[i]; if (actor->flags & (kProtagonist | kFollower)) { - actor->sceneNumber = _vm->_scene->currentSceneNumber(); + if (actor->flags & kProtagonist) { actor->finalTarget = actor->location; _centerActor = _protagonist = actor; + } else { + if (_vm->_scene->currentSceneResourceId() == RID_ITE_OVERMAP_SCENE) { + continue; + } } + + actor->sceneNumber = _vm->_scene->currentSceneNumber(); } if (actor->sceneNumber == _vm->_scene->currentSceneNumber()) { actor->actionCycle = (_vm->_rnd.getRandomNumber(7) & 0x7) * 4; // 1/8th chance @@ -879,7 +885,7 @@ void Actor::handleActions(int msec, bool setup) { } } - if (_vm->_scene->currentSceneNumber() == RID_ITE_OVERMAP_SCENE) { + if (_vm->_scene->currentSceneResourceId() == RID_ITE_OVERMAP_SCENE) { speed = 2; } @@ -1219,7 +1225,7 @@ void Actor::createDrawOrderList() { } bool Actor::getSpriteParams(CommonObjectData *commonObjectData, int &frameNumber, SpriteList *&spriteList) { - if (_vm->_scene->currentSceneNumber() == RID_ITE_OVERMAP_SCENE) { + if (_vm->_scene->currentSceneResourceId() == RID_ITE_OVERMAP_SCENE) { if (!(commonObjectData->flags & kProtagonist)){ warning("not protagonist"); return false; @@ -1437,6 +1443,7 @@ bool Actor::actorEndWalk(uint16 actorId, bool recurse) { ActorData *actor; const HitZone *hitZone; int hitZoneIndex; + Point testPoint; actor = getActor(actorId); actor->actorFlags &= ~kActorBackwards; @@ -1459,7 +1466,8 @@ bool Actor::actorEndWalk(uint16 actorId, bool recurse) { if (actor == _protagonist) { _vm->_script->wakeUpActorThread(kWaitTypeWalk, actor); if (_vm->_script->_pendingVerb == kVerbWalkTo) { - hitZoneIndex = _vm->_scene->_actionMap->hitTest(actor->screenPosition); + actor->location.toScreenPointUV(testPoint); + hitZoneIndex = _vm->_scene->_actionMap->hitTest(testPoint); if (hitZoneIndex != -1) { hitZone = _vm->_scene->_actionMap->getHitZone(hitZoneIndex); stepZoneAction(actor, hitZone, false, true); diff --git a/saga/isomap.cpp b/saga/isomap.cpp index 179947d2db..63d77a7cbe 100644 --- a/saga/isomap.cpp +++ b/saga/isomap.cpp @@ -285,7 +285,7 @@ void IsoMap::adjustScroll(bool jump) { tileCoordsToScreenPoint(_vm->_actor->_centerActor->location, playerPoint); - if (_vm->_scene->currentSceneNumber() == RID_ITE_OVERMAP_SCENE) { + if (_vm->_scene->currentSceneResourceId() == RID_ITE_OVERMAP_SCENE) { _mapPosition.x = (playerPoint.x + _viewScroll.x) * 30 / 100 - (381); _mapPosition.y = (playerPoint.y + _viewScroll.y) * 30 / 100 - (342); } @@ -322,7 +322,7 @@ void IsoMap::adjustScroll(bool jump) { _viewScroll.x = smoothSlide( _viewScroll.x, minScrollPos.x, maxScrollPos.x ); } - if (_vm->_scene->currentSceneNumber() == RID_ITE_OVERMAP_SCENE) { + if (_vm->_scene->currentSceneResourceId() == RID_ITE_OVERMAP_SCENE) { ObjectData *obj; uint16 objectId; objectId = _vm->_actor->objIndexToId(ITE_OBJ_MAP); @@ -1247,7 +1247,7 @@ void IsoMap::findTilePath(ActorData* actor, const Location &start, const Locatio memset( &_searchArray, 0, sizeof(_searchArray)); if (!(actor->actorFlags & kActorNoCollide) && - (_vm->_scene->currentSceneNumber() != RID_ITE_OVERMAP_SCENE)) { + (_vm->_scene->currentSceneResourceId() != RID_ITE_OVERMAP_SCENE)) { for (i = 0; i < _vm->_actor->_actorsCount; i++) { other = _vm->_actor->_actors[i]; if (other->disabled) continue; @@ -1392,7 +1392,7 @@ void IsoMap::screenPointToTileCoords(const Point &position, Location &location) Point mPos(position); int x,y; - if (_vm->_scene->currentSceneNumber() == RID_ITE_OVERMAP_SCENE){ + if (_vm->_scene->currentSceneResourceId() == RID_ITE_OVERMAP_SCENE){ if (mPos.y < 16) { mPos.y = 16; } diff --git a/saga/scene.cpp b/saga/scene.cpp index 43ed0d95ad..46e2d6ee7e 100644 --- a/saga/scene.cpp +++ b/saga/scene.cpp @@ -106,7 +106,7 @@ Scene::Scene(SagaEngine *vm) : _vm(vm), _initialized(false) { _sceneLoaded = false; _sceneNumber = 0; - _sceneResNum = 0; + _sceneResourceId = 0; _inGame = false; _loadDesc = false; memset(&_desc, 0, sizeof(_desc)); @@ -505,7 +505,7 @@ int Scene::getSceneLUT(int scene_num) { int Scene::loadScene(int scene_num, int load_flag, SCENE_PROC scene_proc, SceneDescription *scene_desc_param, int fadeType, int actorsEntrance) { SCENE_INFO scene_info; - uint32 res_number = 0; + uint32 resourceId = 0; int result; int i; EVENT event; @@ -524,11 +524,11 @@ int Scene::loadScene(int scene_num, int load_flag, SCENE_PROC scene_proc, SceneD switch (load_flag) { case BY_RESOURCE: - res_number = scene_num; + resourceId = scene_num; break; case BY_SCENE: assert((scene_num > 0) && (scene_num < _sceneMax)); - res_number = _sceneLUT[scene_num]; + resourceId = _sceneLUT[scene_num]; _sceneNumber = scene_num; break; case BY_DESC: @@ -548,11 +548,11 @@ int Scene::loadScene(int scene_num, int load_flag, SCENE_PROC scene_proc, SceneD // Load scene descriptor and resource list resources if (_loadDesc) { - _sceneResNum = res_number; - assert(_sceneResNum != 0); - debug(0, "Loading scene resource %u:", res_number); + _sceneResourceId = resourceId; + assert(_sceneResourceId != 0); + debug(0, "Loading scene resource %u:", resourceId); - if (loadSceneDescriptor(res_number) != SUCCESS) { + if (loadSceneDescriptor(resourceId) != SUCCESS) { warning("Scene::loadScene(): Error reading scene descriptor"); return FAILURE; } @@ -581,14 +581,6 @@ int Scene::loadScene(int scene_num, int load_flag, SCENE_PROC scene_proc, SceneD return FAILURE; } -/* // Load scene script data - if (_desc.scriptModuleNumber > 0) { - if (_vm->_script->loadScript(_desc.scriptModuleNumber) != SUCCESS) { - warning("Scene::loadScene(): Error loading scene script"); - return FAILURE; - } - } -*/ _sceneLoaded = true; q_event = NULL; @@ -1078,7 +1070,7 @@ void Scene::cmdSceneInfo() { const char *fmt = "%-20s %d\n"; _vm->_console->DebugPrintf(fmt, "Scene number:", _sceneNumber); - _vm->_console->DebugPrintf(fmt, "Descriptor R#:", _sceneResNum); + _vm->_console->DebugPrintf(fmt, "Descriptor ResourceId:", _sceneResourceId); _vm->_console->DebugPrintf("-------------------------\n"); _vm->_console->DebugPrintf(fmt, "Flags:", _desc.flags); _vm->_console->DebugPrintf(fmt, "Resource list R#:", _desc.resListRN); diff --git a/saga/scene.h b/saga/scene.h index 65cba6b3b4..df0c1344e1 100644 --- a/saga/scene.h +++ b/saga/scene.h @@ -260,7 +260,8 @@ class Scene { int getSceneLUT(int num); - int currentSceneNumber() { return _sceneNumber; } + int currentSceneNumber() const { return _sceneNumber; } + int currentSceneResourceId() const { return _sceneResourceId; } private: int loadScene(int scene, int load_flag, SCENE_PROC scene_proc, SceneDescription *, int fadeIn, int actorsEntrance); @@ -281,7 +282,7 @@ class Scene { int _firstScene; bool _sceneLoaded; int _sceneNumber; - int _sceneResNum; + int _sceneResourceId; bool _inGame; bool _loadDesc; SceneDescription _desc; |