From 399bd16ab1175e6b816bc6cec26d650cfcb7cad0 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Mon, 4 Jul 2005 07:46:48 +0000 Subject: Apparently some masks are bigger than the image they are supposed to be masking, and therefore need to be clipped. This fixes a slight glitch in the ITE intro where an actor is drawn partly in the status text field. svn-id: r18490 --- saga/scene.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'saga') diff --git a/saga/scene.cpp b/saga/scene.cpp index 778bb6873d..a4244a6b5f 100644 --- a/saga/scene.cpp +++ b/saga/scene.cpp @@ -772,6 +772,12 @@ int Scene::processSceneResources() { _bgMask.loaded = 1; _vm->decodeBGImage(_bgMask.res_buf, _bgMask.res_len, &_bgMask.buf, &_bgMask.buf_len, &_bgMask.w, &_bgMask.h); + + // At least in ITE the mask needs to be clipped. + + _bgMask.w = MIN(_bgMask.w, _vm->getDisplayWidth()); + _bgMask.h = MIN(_bgMask.h, _vm->getClippedSceneHeight()); + debug(0, "BACKGROUND MASK width=%d height=%d length=%d", _bgMask.w, _bgMask.h, _bgMask.buf_len); break; case SAGA_STRINGS: -- cgit v1.2.3