aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Kurushin2005-07-08 18:39:53 +0000
committerAndrew Kurushin2005-07-08 18:39:53 +0000
commit376738bb038bbbd1ace27706fad7e3ff7ce45c5b (patch)
treea1313c2ed799fafc840dcc73784d84cffdbe1e93
parent1a54a5e0e2def277877e9ec691d26bb493daebae (diff)
downloadscummvm-rg350-376738bb038bbbd1ace27706fad7e3ff7ce45c5b.tar.gz
scummvm-rg350-376738bb038bbbd1ace27706fad7e3ff7ce45c5b.tar.bz2
scummvm-rg350-376738bb038bbbd1ace27706fad7e3ff7ce45c5b.zip
fix final sequence scene height
svn-id: r18518
-rw-r--r--saga/events.cpp2
-rw-r--r--saga/ite_introproc.cpp4
-rw-r--r--saga/scene.cpp36
-rw-r--r--saga/scene.h8
4 files changed, 17 insertions, 33 deletions
diff --git a/saga/events.cpp b/saga/events.cpp
index ec23f8f12e..05ea6563e7 100644
--- a/saga/events.cpp
+++ b/saga/events.cpp
@@ -178,7 +178,7 @@ int Events::handleContinuous(EVENT *event) {
_vm->_scene->getBGMaskInfo(w, h, mask_buf, len);
_vm->transitionDissolve(buf_info.bg_buf, buf_info.bg_buf_w,
buf_info.bg_buf_h, buf_info.bg_buf_w, mask_buf, w, h, 1,
- (320 - w) / 2, (200 - h) / 2, event_pc);
+ (_vm->getDisplayWidth() - w) / 2, (_vm->getDisplayHeight() - h) / 2, event_pc);
break;
default:
break;
diff --git a/saga/ite_introproc.cpp b/saga/ite_introproc.cpp
index 00c2d7cb77..322a88e4a5 100644
--- a/saga/ite_introproc.cpp
+++ b/saga/ite_introproc.cpp
@@ -46,11 +46,11 @@ using Common::DE_DEU;
LoadSceneParams ITE_IntroList[] = {
{RID_ITE_INTRO_ANIM_SCENE, kLoadByResourceId, NULL, Scene::SC_ITEIntroAnimProc, false, kTransitionNoFade, 0},
- {RID_ITE_CAVE_SCENE_1, kLoadByResourceId, NULL, Scene::SC_ITEIntroCave1Proc, false, kTransitionFadeNoInterface, 0},
+ {RID_ITE_CAVE_SCENE_1, kLoadByResourceId, NULL, Scene::SC_ITEIntroCave1Proc, false, kTransitionFade, 0},
{RID_ITE_CAVE_SCENE_2, kLoadByResourceId, NULL, Scene::SC_ITEIntroCave2Proc, false, kTransitionNoFade, 0},
{RID_ITE_CAVE_SCENE_3, kLoadByResourceId, NULL, Scene::SC_ITEIntroCave3Proc, false, kTransitionNoFade, 0},
{RID_ITE_CAVE_SCENE_4, kLoadByResourceId, NULL, Scene::SC_ITEIntroCave4Proc, false, kTransitionNoFade, 0},
- {RID_ITE_VALLEY_SCENE, kLoadByResourceId, NULL, Scene::SC_ITEIntroValleyProc, false, kTransitionFadeNoInterface, 0},
+ {RID_ITE_VALLEY_SCENE, kLoadByResourceId, NULL, Scene::SC_ITEIntroValleyProc, false, kTransitionFade, 0},
{RID_ITE_TREEHOUSE_SCENE, kLoadByResourceId, NULL, Scene::SC_ITEIntroTreeHouseProc, false, kTransitionNoFade, 0},
{RID_ITE_FAIREPATH_SCENE, kLoadByResourceId, NULL, Scene::SC_ITEIntroFairePathProc, false, kTransitionNoFade, 0},
{RID_ITE_FAIRETENT_SCENE, kLoadByResourceId, NULL, Scene::SC_ITEIntroFaireTentProc, false, kTransitionNoFade, 0}
diff --git a/saga/scene.cpp b/saga/scene.cpp
index 3cf3bf5db6..163c7a7448 100644
--- a/saga/scene.cpp
+++ b/saga/scene.cpp
@@ -77,15 +77,14 @@ Scene::Scene(SagaEngine *vm) : _vm(vm), _initialized(false) {
return;
}
_sceneCount = scene_lut_len / 2;
- _sceneMax = _sceneCount - 1;
- _sceneLUT = (int *)malloc(_sceneMax * sizeof(*_sceneLUT));
+ _sceneLUT = (int *)malloc(_sceneCount * sizeof(*_sceneLUT));
if (_sceneLUT == NULL) {
memoryError("Scene::Scene()");
}
MemoryReadStreamEndian readS(scene_lut_p, scene_lut_len, IS_BIG_ENDIAN);
- for (i = 0; i < _sceneMax; i++) {
+ for (i = 0; i < _sceneCount; i++) {
_sceneLUT[i] = readS.readUint16();
debug(8, "sceneNumber %i has resourceId %i", i, _sceneLUT[i]);
}
@@ -96,7 +95,7 @@ Scene::Scene(SagaEngine *vm) : _vm(vm), _initialized(false) {
debug(3, "First scene set to %d.", _firstScene);
- debug(3, "LUT has %d entries.", _sceneMax);
+ debug(3, "LUT has %d entries.", _sceneCount);
// Create scene module text list
_textList = _vm->textCreateList();
@@ -455,7 +454,9 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) {
BGInfo backGroundInfo;
getBGInfo(backGroundInfo);
_sceneClip = backGroundInfo.bounds;
-
+ if (_sceneClip.bottom == _vm->getSceneHeight()) {
+ _sceneClip.bottom = _vm->getClippedSceneHeight();
+ }
if (!(_bg.w < _vm->getDisplayWidth() || _bg.h < _vm->getSceneHeight()))
_outsetSceneNumber = _sceneNumber;
}
@@ -473,8 +474,7 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) {
q_event = _vm->_events->chain(q_event, &event);
- if (loadSceneParams->transitionType == kTransitionFade ||
- loadSceneParams->transitionType == kTransitionFadeNoInterface) {
+ if (loadSceneParams->transitionType == kTransitionFade ) {
_vm->_interface->setFadeMode(kFadeOut);
@@ -488,19 +488,6 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) {
event.data = current_pal;
q_event = _vm->_events->queue(&event);
- //FIXME: do we really need two interface activation on load scene?
- // i guess kTransitionFadeNoInterface should gone
- /*
- if (loadSceneParams->transitionType != kTransitionFadeNoInterface) {
- // Activate user interface
- event.type = IMMEDIATE_EVENT;
- event.code = INTERFACE_EVENT;
- event.op = EVENT_ACTIVATE;
- event.time = 0;
- event.duration = 0;
- q_event = _vm->_events->chain(q_event, &event);
- }*/
-
// set fade mode
event.type = IMMEDIATE_EVENT;
event.code = INTERFACE_EVENT;
@@ -537,8 +524,7 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) {
q_event = _vm->_events->chain(q_event, &event);
}
- if (loadSceneParams->transitionType == kTransitionFade ||
- loadSceneParams->transitionType == kTransitionFadeNoInterface) {
+ if (loadSceneParams->transitionType == kTransitionFade) {
// set fade mode
event.type = IMMEDIATE_EVENT;
@@ -907,8 +893,8 @@ void Scene::draw() {
_vm->_isoMap->draw(backBuffer);
} else {
- bufToSurface(backBuffer, buf_info.bg_buf, _vm->getDisplayWidth(),
- _inGame ? _vm->getClippedSceneHeight() : buf_info.bg_buf_h, NULL, &bgPoint);
+ bufToSurface(backBuffer, buf_info.bg_buf, buf_info.bg_buf_w,
+ _sceneClip.bottom < buf_info.bg_buf_h ? _vm->getClippedSceneHeight() : buf_info.bg_buf_h, NULL, &bgPoint);
}
}
@@ -978,7 +964,7 @@ void Scene::cmdSceneChange(int argc, const char **argv) {
scene_num = atoi(argv[1]);
- if ((scene_num < 1) || (scene_num > _sceneMax)) {
+ if ((scene_num < 1) || (scene_num >= _sceneCount)) {
_vm->_console->DebugPrintf("Invalid scene number.\n");
return;
}
diff --git a/saga/scene.h b/saga/scene.h
index 7b6767f062..7ca0e488be 100644
--- a/saga/scene.h
+++ b/saga/scene.h
@@ -148,8 +148,7 @@ struct SCENE_IMAGE {
enum SceneTransitionType {
kTransitionNoFade,
- kTransitionFade,
- kTransitionFadeNoInterface
+ kTransitionFade
};
enum SceneLoadFlags {
@@ -255,8 +254,8 @@ class Scene {
int getSceneResourceId(int sceneNumber) {
- if ((sceneNumber < 0) || (sceneNumber >= _sceneMax)) {
- error("getSceneResourceId: wrong sceneNumber");
+ if ((sceneNumber < 0) || (sceneNumber >= _sceneCount)) {
+ error("getSceneResourceId: wrong sceneNumber %i", sceneNumber);
}
return _sceneLUT[sceneNumber];
}
@@ -278,7 +277,6 @@ class Scene {
RSCFILE_CONTEXT *_sceneContext;
int *_sceneLUT;
int _sceneCount;
- int _sceneMax;
SceneQueueList _sceneQueue;
int _firstScene;
bool _sceneLoaded;