diff options
author | Eugene Sandulenko | 2005-01-07 22:18:53 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2005-01-07 22:18:53 +0000 |
commit | c316ab62cfb86ff5155d03bff53926a8e68c285a (patch) | |
tree | a7e9ae4fe2937c0b9ddce93fb47e6d4f4d2ccae0 | |
parent | f74fce354f4aece89b45a301d0519fc67f876f5d (diff) | |
download | scummvm-rg350-c316ab62cfb86ff5155d03bff53926a8e68c285a.tar.gz scummvm-rg350-c316ab62cfb86ff5155d03bff53926a8e68c285a.tar.bz2 scummvm-rg350-c316ab62cfb86ff5155d03bff53926a8e68c285a.zip |
Eliminate _scene->getMode() and use scene flags instead
svn-id: r16482
-rw-r--r-- | saga/actor.cpp | 22 | ||||
-rw-r--r-- | saga/events.cpp | 2 | ||||
-rw-r--r-- | saga/scene.cpp | 36 | ||||
-rw-r--r-- | saga/scene.h | 9 | ||||
-rw-r--r-- | saga/sfuncs.cpp | 6 |
5 files changed, 21 insertions, 54 deletions
diff --git a/saga/actor.cpp b/saga/actor.cpp index 3e491ca0d0..34ab300f4d 100644 --- a/saga/actor.cpp +++ b/saga/actor.cpp @@ -295,7 +295,7 @@ void Actor::realLocation(ActorLocation &location, uint16 objectId, uint16 walkFl ActorData *actor; if (walkFlags & kWalkUseAngle) { // tiled stuff - if (_vm->_scene->getMode() == SCENE_MODE_ISO) { + if (_vm->_scene->getFlags() & kSceneFlagISO) { //todo: it } else { angle = location.x & 15; @@ -324,7 +324,7 @@ void Actor::actorFaceTowardsPoint(uint16 actorId, const ActorLocation &toLocatio actor = getActor(actorId); // tiled stuff - if (_vm->_scene->getMode() == SCENE_MODE_ISO) { + if (_vm->_scene->getFlags() & kSceneFlagISO) { //todo: it } else { toLocation.delta(actor->location, delta); @@ -415,14 +415,14 @@ void Actor::updateActorsScene() { /* setup protagonist entry // tiled stuff - if (_vm->_scene->getMode() == SCENE_MODE_ISO) { + if (_vm->_scene->getFlags() & kSceneFlagISO) { //todo: it } else { } */ _protagonist->currentAction = kActionWait; - if (_vm->_scene->getMode() == SCENE_MODE_ISO) { + if (_vm->_scene->getFlags() & kSceneFlagISO) { //todo: it } else { _vm->_scene->initDoorsState(); @@ -440,7 +440,7 @@ void Actor::updateActorsScene() { actor->location.z = _protagonist->location.z; - if (_vm->_scene->getMode() == SCENE_MODE_ISO) { + if (_vm->_scene->getFlags() & kSceneFlagISO) { //todo: it } else { followerDirection &= 0x07; @@ -656,7 +656,7 @@ void Actor::handleActions(int msec, bool setup) { case kActionWalkToPoint: case kActionWalkToLink: // tiled stuff - if (_vm->_scene->getMode() == SCENE_MODE_ISO) { + if (_vm->_scene->getFlags() & kSceneFlagISO) { //todo: it } else { actor->partialTarget.delta(actor->location, delta); @@ -735,7 +735,7 @@ void Actor::handleActions(int msec, bool setup) { case kActionWalkDir: // tiled stuff - if (_vm->_scene->getMode() == SCENE_MODE_ISO) { + if (_vm->_scene->getFlags() & kSceneFlagISO) { //todo: it } else { actor->location.x += directionLUT[actor->actionDirection][0] * 2; @@ -859,7 +859,7 @@ int Actor::direct(int msec) { void Actor::calcActorScreenPosition(ActorData *actor) { int beginSlope, endSlope, middle; - if (_vm->_scene->getMode() == SCENE_MODE_ISO) { + if (_vm->_scene->getFlags() & kSceneFlagISO) { //todo: it } else { middle = _vm->getStatusYOffset() - actor->location.y / ACTOR_LMULT; @@ -935,7 +935,7 @@ int Actor::drawActors() { continue; } - if (_vm->_scene->getMode() == SCENE_MODE_ISO) { + if (_vm->_scene->getFlags() & kSceneFlagISO) { //todo: it } else { _vm->_sprite->drawOccluded(back_buf, spriteList, frameNumber, actor->screenPosition, actor->screenScale, actor->screenDepth); @@ -1003,7 +1003,7 @@ bool Actor::followProtagonist(ActorData *actor) { protagonistLocation = _protagonist->location; calcActorScreenPosition(_protagonist); - if (_vm->_scene->getMode() == SCENE_MODE_ISO) { + if (_vm->_scene->getFlags() & kSceneFlagISO) { //todo: it } else { prefer1.x = (100 * _protagonist->screenScale) >> 8; @@ -1136,7 +1136,7 @@ bool Actor::actorWalkTo(uint16 actorId, const ActorLocation &toLocation) { _vm->_scene->setDoorState(3, 0xff); } - if (_vm->_scene->getMode() == SCENE_MODE_ISO) { + if (_vm->_scene->getFlags() & kSceneFlagISO) { //todo: it } else { diff --git a/saga/events.cpp b/saga/events.cpp index 2c2c5683d5..a8e43139b7 100644 --- a/saga/events.cpp +++ b/saga/events.cpp @@ -305,7 +305,7 @@ int Events::handleOneShot(EVENT *event) { BUFFER_INFO rbuf_info; Point bg_pt; - if (_vm->_scene->getMode() == SCENE_MODE_NORMAL) { + if (!(_vm->_scene->getFlags() & kSceneFlagISO)) { back_buf = _vm->_gfx->getBackBuffer(); diff --git a/saga/scene.cpp b/saga/scene.cpp index d11f953952..5a9d6d0247 100644 --- a/saga/scene.cpp +++ b/saga/scene.cpp @@ -112,7 +112,6 @@ Scene::Scene(SagaEngine *vm) : _vm(vm), _initialized(false) { } _sceneLoaded = false; - _sceneMode = 0; _sceneNumber = 0; _sceneResNum = 0; _inGame = false; @@ -315,12 +314,6 @@ int Scene::changeScene(int scene_num) { return SUCCESS; } -int Scene::getMode() { - assert(_initialized); - - return _sceneMode; -} - void Scene::getSlopes(int &beginSlope, int &endSlope) { beginSlope = _vm->getStatusYOffset() - _desc.beginSlope; endSlope = _vm->getStatusYOffset() - _desc.endSlope; @@ -532,7 +525,6 @@ int Scene::loadScene(int scene_num, int load_flag, SCENE_PROC scene_proc, SCENE_ return FAILURE; } - _sceneMode = 0; _loadDesc = true; _sceneNumber = -1; @@ -796,7 +788,6 @@ int Scene::processSceneResources() { pal_p = _vm->getImagePal(_bg.res_buf, _bg.res_len); memcpy(_bg.pal, pal_p, sizeof(_bg.pal)); - _sceneMode = SCENE_MODE_NORMAL; break; case SAGA_BG_MASK: // Scene background mask resource if (_bgMask.loaded) { @@ -827,7 +818,7 @@ int Scene::processSceneResources() { _actionMap->load(res_data, res_data_len); break; case SAGA_ISO_TILESET: - if (_sceneMode == SCENE_MODE_NORMAL) { + if (!(_vm->_scene->getFlags() & kSceneFlagISO)) { warning("Scene::ProcessSceneResources(): Isometric tileset incompatible with normal scene mode"); return FAILURE; } @@ -838,11 +829,9 @@ int Scene::processSceneResources() { warning("Scene::ProcessSceneResources(): Error loading isometric tileset resource"); return FAILURE; } - - _sceneMode = SCENE_MODE_ISO; break; case SAGA_ISO_METAMAP: - if (_sceneMode == SCENE_MODE_NORMAL) { + if (!(_vm->_scene->getFlags() & kSceneFlagISO)) { warning("Scene::ProcessSceneResources(): Isometric metamap incompatible with normal scene mode"); return FAILURE; } @@ -853,11 +842,9 @@ int Scene::processSceneResources() { warning("Scene::ProcessSceneResources(): Error loading isometric metamap resource"); return FAILURE; } - - _sceneMode = SCENE_MODE_ISO; break; case SAGA_ISO_METATILESET: - if (_sceneMode == SCENE_MODE_NORMAL) { + if (!(_vm->_scene->getFlags() & kSceneFlagISO)) { warning("Scene::ProcessSceneResources(): Isometric metatileset incompatible with normal scene mode"); return FAILURE; } @@ -868,8 +855,6 @@ int Scene::processSceneResources() { warning("Scene::ProcessSceneResources(): Error loading isometric tileset resource"); return FAILURE; } - - _sceneMode = SCENE_MODE_ISO; break; case SAGA_ANIM_1: case SAGA_ANIM_2: @@ -929,20 +914,11 @@ int Scene::draw(SURFACE *dst_s) { bg_pt.x = 0; bg_pt.y = 0; - switch (_sceneMode) { - - case SCENE_MODE_NORMAL: + if (_vm->_scene->getFlags() & kSceneFlagISO) + _vm->_isoMap->draw(dst_s); + else bufToSurface(dst_s, buf_info.bg_buf, disp_info.logical_w, MAX(disp_info.scene_h, _bg.h), NULL, &bg_pt); - break; - case SCENE_MODE_ISO: - _vm->_isoMap->draw(dst_s); - break; - default: - // Unknown scene mode - return FAILURE; - break; - }; return SUCCESS; } diff --git a/saga/scene.h b/saga/scene.h index 4f6e302b10..de5c8031c5 100644 --- a/saga/scene.h +++ b/saga/scene.h @@ -36,13 +36,6 @@ namespace Saga { class ActionMap; class ObjectMap; -enum SCENE_MODES { - SCENE_MODE_INVALID, - SCENE_MODE_NORMAL, - SCENE_MODE_ISO -}; - - struct SCENE_BGINFO { int bg_x; int bg_y; @@ -232,7 +225,6 @@ class Scene { int endScene(); int queueScene(SCENE_QUEUE *scene_queue); int draw(SURFACE *); - int getMode(); int getFlags() { return _desc.flags; } bool isInDemo() { return !_inGame; } @@ -279,7 +271,6 @@ class Scene { SceneQueueList _sceneQueue; int _firstScene; bool _sceneLoaded; - int _sceneMode; int _sceneNumber; int _sceneResNum; bool _inGame; diff --git a/saga/sfuncs.cpp b/saga/sfuncs.cpp index 53fd78ee87..4b8c340154 100644 --- a/saga/sfuncs.cpp +++ b/saga/sfuncs.cpp @@ -494,7 +494,7 @@ int Script::sfScriptOpenDoor(SCRIPTFUNC_PARAMS) { int doorNumber; doorNumber = getUWord(thread->pop()); - if (_vm->_scene->getMode() == SCENE_MODE_ISO) { + if (_vm->_scene->getFlags() & kSceneFlagISO) { //todo: it } else { _vm->_scene->setDoorState(doorNumber, 0); @@ -508,7 +508,7 @@ int Script::sfScriptCloseDoor(SCRIPTFUNC_PARAMS) { int doorNumber; doorNumber = getUWord(thread->pop()); - if (_vm->_scene->getMode() == SCENE_MODE_ISO) { + if (_vm->_scene->getFlags() & kSceneFlagISO) { //todo: it } else { _vm->_scene->setDoorState(doorNumber, 0xff); @@ -1251,7 +1251,7 @@ int Script::sfSetDoorState(SCRIPTFUNC_PARAMS) { doorNumber = getUWord(thread->pop()); doorState = getUWord(thread->pop()); - if (_vm->_scene->getMode() == SCENE_MODE_ISO) { + if (_vm->_scene->getFlags() & kSceneFlagISO) { //todo: it } else { _vm->_scene->setDoorState(doorNumber, doorState); |