diff options
author | Travis Howell | 2004-09-04 00:18:55 +0000 |
---|---|---|
committer | Travis Howell | 2004-09-04 00:18:55 +0000 |
commit | 6dd0ab939732489760f04da3aed7dfefe46c9c3f (patch) | |
tree | b75f853ca5368bc93d95cd6a2e79cb627ea62664 | |
parent | cc3a255c5482ba28c627e366842b5e2b9722b3ac (diff) | |
download | scummvm-rg350-6dd0ab939732489760f04da3aed7dfefe46c9c3f.tar.gz scummvm-rg350-6dd0ab939732489760f04da3aed7dfefe46c9c3f.tar.bz2 scummvm-rg350-6dd0ab939732489760f04da3aed7dfefe46c9c3f.zip |
Add actor cliping override for HE games.
svn-id: r14879
-rw-r--r-- | scumm/actor.cpp | 7 | ||||
-rw-r--r-- | scumm/actor.h | 1 | ||||
-rw-r--r-- | scumm/akos.cpp | 6 | ||||
-rw-r--r-- | scumm/base-costume.h | 6 | ||||
-rw-r--r-- | scumm/script_v7he.cpp | 5 |
5 files changed, 23 insertions, 2 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp index 54c847099c..7154a615fa 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -65,6 +65,11 @@ Actor::Actor() { memset(&walkdata, 0, sizeof(ActorWalkData)); walkdata.point3.x = 32000; + clipOverride.right = 0; + clipOverride.left = 0; + clipOverride.top = 0; + clipOverride.bottom = 0; + walkScript = 0; initActor(1); @@ -1016,6 +1021,8 @@ void Actor::drawActorCostume(bool hitTestMode) { bcr->_actorX += 8; } + bcr->_clipOverride = clipOverride; + if (_vm->_version == 4 && boxscale & 0x8000) { bcr->_scaleX = bcr->_scaleY = _vm->getScale(walkbox, _pos.x, _pos.y); } else { diff --git a/scumm/actor.h b/scumm/actor.h index 58bf6505cd..18d287b277 100644 --- a/scumm/actor.h +++ b/scumm/actor.h @@ -83,6 +83,7 @@ public: public: Common::Point _pos; + Common::Rect clipOverride; int offs_x, offs_y; int top, bottom; uint width; diff --git a/scumm/akos.cpp b/scumm/akos.cpp index 768af0d6d7..b103a840c0 100644 --- a/scumm/akos.cpp +++ b/scumm/akos.cpp @@ -739,6 +739,9 @@ byte AkosRenderer::codec1(int xmoveCur, int ymoveCur) { v1.skip_width = _width; v1.scaleXstep = _mirror ? 1 : -1; + if (_clipOverride.bottom < rect.bottom) + rect.bottom = _clipOverride.bottom; + if (_actorHitMode) { if (_actorHitX < rect.left || _actorHitX >= rect.right || _actorHitY < rect.top || _actorHitY >= rect.bottom) return 0; @@ -1009,6 +1012,9 @@ byte AkosRenderer::codec16(int xmoveCur, int ymoveCur) { maxw = _outwidth; maxh = _outheight; + if (_clipOverride.bottom < clip.bottom) + clip.bottom = _clipOverride.bottom; + _vm->markRectAsDirty(kMainVirtScreen, clip, _actorID); skip_x = 0; diff --git a/scumm/base-costume.h b/scumm/base-costume.h index 3545e4c90c..82f2e14648 100644 --- a/scumm/base-costume.h +++ b/scumm/base-costume.h @@ -51,6 +51,7 @@ struct VirtScreen; */ class BaseCostumeRenderer { public: + Common::Rect _clipOverride; byte _actorID; byte _shadow_mode; @@ -117,6 +118,11 @@ public: _width = _height = 0; _skipLimb = 0; + _clipOverride.right = 0; + _clipOverride.left = 0; + _clipOverride.top = 0; + _clipOverride.bottom = 0; + _outptr = 0; _outwidth = _outheight = 0; } diff --git a/scumm/script_v7he.cpp b/scumm/script_v7he.cpp index 3e7d5ab116..cbb6bddb2a 100644 --- a/scumm/script_v7he.cpp +++ b/scumm/script_v7he.cpp @@ -763,6 +763,7 @@ void ScummEngine_v7he::o7_unknownED() { void ScummEngine_v7he::o7_kernelSetFunctions() { int args[29]; int num; + Actor *a; num = getStackList(args, ARRAYSIZE(args)); @@ -794,8 +795,8 @@ void ScummEngine_v7he::o7_kernelSetFunctions() { _fullRedraw = 1; break; case 30: - // Y clip of Actor - debug(1, "Actor %d Y Clip %d", args[1], args[2]); + a = derefActor(args[1], "o7_kernelSetFunctions: 30"); + a->clipOverride.bottom = args[2]; break; default: error("o6_kernelSetFunctions: default case %d (param count %d)", args[0], num); |