aboutsummaryrefslogtreecommitdiff
path: root/saga/scene.cpp
diff options
context:
space:
mode:
authorAndrew Kurushin2005-07-08 16:56:03 +0000
committerAndrew Kurushin2005-07-08 16:56:03 +0000
commitd944bd7793d1e366bf3555cea3c11a488b9eecaf (patch)
treed60c38c67d9341749021e838fd698378ca6b71a1 /saga/scene.cpp
parent7e0033983fef78e6d1597fc601a700aa2aafe27e (diff)
downloadscummvm-rg350-d944bd7793d1e366bf3555cea3c11a488b9eecaf.tar.gz
scummvm-rg350-d944bd7793d1e366bf3555cea3c11a488b9eecaf.tar.bz2
scummvm-rg350-d944bd7793d1e366bf3555cea3c11a488b9eecaf.zip
implemented per scene actors clipping
so last sequence should look much better (not perfect) svn-id: r18516
Diffstat (limited to 'saga/scene.cpp')
-rw-r--r--saga/scene.cpp37
1 files changed, 18 insertions, 19 deletions
diff --git a/saga/scene.cpp b/saga/scene.cpp
index a050d76d87..3cf3bf5db6 100644
--- a/saga/scene.cpp
+++ b/saga/scene.cpp
@@ -267,32 +267,22 @@ void Scene::getSlopes(int &beginSlope, int &endSlope) {
endSlope = _vm->getSceneHeight() - _sceneDescription.endSlope;
}
-int Scene::getBGInfo(SCENE_BGINFO *bginfo) {
- int x, y;
-
- assert(_initialized);
-
- bginfo->bg_buf = _bg.buf;
- bginfo->bg_buflen = _bg.buf_len;
- bginfo->bg_w = _bg.w;
- bginfo->bg_h = _bg.h;
- bginfo->bg_p = _bg.p;
-
- x = 0;
- y = 0;
+void Scene::getBGInfo(BGInfo &bgInfo) {
+ bgInfo.buffer = _bg.buf;
+ bgInfo.bufferLength = _bg.buf_len;
+ bgInfo.bounds.left = 0;
+ bgInfo.bounds.top = 0;
if (_bg.w < _vm->getDisplayWidth()) {
- x = (_vm->getDisplayWidth() - _bg.w) / 2;
+ bgInfo.bounds.left = (_vm->getDisplayWidth() - _bg.w) / 2;
}
if (_bg.h < _vm->getSceneHeight()) {
- y = (_vm->getSceneHeight() - _bg.h) / 2;
+ bgInfo.bounds.top = (_vm->getClippedSceneHeight() - _bg.h) / 2;
}
- bginfo->bg_x = x;
- bginfo->bg_y = y;
-
- return SUCCESS;
+ bgInfo.bounds.setWidth(_bg.w);
+ bgInfo.bounds.setHeight(_bg.h);
}
int Scene::getBGPal(PALENTRY **pal) {
@@ -456,7 +446,16 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) {
if (_sceneDescription.flags & kSceneFlagISO) {
_outsetSceneNumber = _sceneNumber;
+
+ _sceneClip.left = 0;
+ _sceneClip.top = 0;
+ _sceneClip.right = _vm->getDisplayWidth();
+ _sceneClip.bottom = _vm->getClippedSceneHeight();
} else {
+ BGInfo backGroundInfo;
+ getBGInfo(backGroundInfo);
+ _sceneClip = backGroundInfo.bounds;
+
if (!(_bg.w < _vm->getDisplayWidth() || _bg.h < _vm->getSceneHeight()))
_outsetSceneNumber = _sceneNumber;
}