aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/script_lol.cpp
diff options
context:
space:
mode:
authorFlorian Kagerer2009-12-13 15:19:56 +0000
committerFlorian Kagerer2009-12-13 15:19:56 +0000
commitadba314fc679be40f6341764ca9f45d0a027b865 (patch)
tree91aee558553cffb8977e665968c0aa1daf87cbc5 /engines/kyra/script_lol.cpp
parent35c695929a65529f710735d2f5d79f1e24952ddf (diff)
downloadscummvm-rg350-adba314fc679be40f6341764ca9f45d0a027b865.tar.gz
scummvm-rg350-adba314fc679be40f6341764ca9f45d0a027b865.tar.bz2
scummvm-rg350-adba314fc679be40f6341764ca9f45d0a027b865.zip
LOL: some cleanup for recent code changes
svn-id: r46358
Diffstat (limited to 'engines/kyra/script_lol.cpp')
-rw-r--r--engines/kyra/script_lol.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp
index c49cc9d8d5..6e515f4959 100644
--- a/engines/kyra/script_lol.cpp
+++ b/engines/kyra/script_lol.cpp
@@ -2393,21 +2393,23 @@ int LoLEngine::tlol_setupPaletteFadeEx(const TIM *tim, const uint16 *param) {
int LoLEngine::tlol_processWsaFrame(const TIM *tim, const uint16 *param) {
debugC(3, kDebugLevelScriptFuncs, "LoLEngine::tlol_processWsaFrame(%p, %p) (%d, %d, %d, %d, %d)",
(const void *)tim, (const void *)param, param[0], param[1], param[2], param[3], param[4]);
- TimAnimator::Animation *anim = (TimAnimator::Animation *) tim->wsa[param[0]].anim;
+
+ const int animIndex = tim->wsa[param[0]].anim - 1;
const int frame = param[1];
const int x2 = param[2];
const int y2 = param[3];
const int factor = MAX<int>(0, (int16)param[4]);
- const int x1 = anim->x;
- const int y1 = anim->y;
+ const int x1 = _animator->getAnimX(animIndex);
+ const int y1 = _animator->getAnimY(animIndex);
+ const Movie *wsa = _animator->getWsaCPtr(animIndex);
- int w1 = anim->wsa->width();
- int h1 = anim->wsa->height();
+ int w1 = wsa->width();
+ int h1 = wsa->height();
int w2 = (w1 * factor) / 100;
int h2 = (h1 * factor) / 100;
- anim->wsa->displayFrame(frame, 2, x1, y1, anim->wsaCopyParams & 0xF0FF, 0, 0);
+ _animator->displayFrame(animIndex, 2, frame);
_screen->wsaFrameAnimationStep(x1, y1, x2, y2, w1, h1, w2, h2, 2, _flags.isDemo && _flags.platform != Common::kPlatformPC98 ? 0 : 8, 0);
if (!_flags.isDemo && _flags.platform != Common::kPlatformPC98)
_screen->checkedPageUpdate(8, 4);
@@ -2665,12 +2667,14 @@ int LoLEngine::tlol_fadeOutSound(const TIM *tim, const uint16 *param) {
int LoLEngine::tlol_displayAnimFrame(const TIM *tim, const uint16 *param) {
debugC(3, kDebugLevelScriptFuncs, "LoLEngine::tlol_displayAnimFrame(%p, %p) (%d, %d)", (const void *)tim, (const void *)param, param[0], param[1]);
- TimAnimator::Animation *anim = (TimAnimator::Animation *)tim->wsa[param[0]].anim;
+ const int animIndex = tim->wsa[param[0]].anim - 1;
+ const Movie *wsa = _animator->getWsaCPtr(animIndex);
+
if (param[1] == 0xFFFF) {
_screen->copyRegion(0, 0, 0, 0, 320, 200, 0, 2, Screen::CR_NO_P_CHECK);
} else {
- anim->wsa->displayFrame(param[1], 2, anim->x, anim->y, 0, 0, 0);
- _screen->copyRegion(anim->wsa->xAdd(), anim->wsa->yAdd(), anim->wsa->xAdd(), anim->wsa->yAdd(), anim->wsa->width(), anim->wsa->height(), 2, 0);
+ _animator->displayFrame(animIndex, 2, param[1], 0);
+ _screen->copyRegion(wsa->xAdd(), wsa->yAdd(), wsa->xAdd(), wsa->yAdd(), wsa->width(), wsa->height(), 2, 0);
}
return 1;