From 91a57ad8f5baa98ab72c2a5692d433b1cf6aadc3 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 4 Sep 2004 10:29:06 +0000 Subject: cleanup (this actor clip stuff is really evil -- I have to agree with Kirben, it's totally unclear why they didn't just use the good old virt screen system... svn-id: r14890 --- scumm/actor.cpp | 7 ++----- scumm/actor.h | 4 ++++ scumm/akos.cpp | 18 ++---------------- scumm/script_v6he.cpp | 16 ++++++++-------- scumm/scumm.cpp | 8 ++++---- scumm/scumm.h | 5 +---- 6 files changed, 21 insertions(+), 37 deletions(-) (limited to 'scumm') diff --git a/scumm/actor.cpp b/scumm/actor.cpp index bd387d3ad9..137a4553b1 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -133,11 +133,8 @@ void Actor::initActor(int mode) { walkScript = 0; talkScript = 0; - clipOverride.right = _vm->_actorClipRight; - clipOverride.left = _vm->_actorClipLeft; - clipOverride.top = _vm->_actorClipTop; - clipOverride.bottom = _vm->_actorClipBottom; - + clipOverride = _vm->_actorClipOverride; + _vm->_classData[number] = (_vm->_version >= 7) ? _vm->_classData[0] : 0; } diff --git a/scumm/actor.h b/scumm/actor.h index 18d287b277..68c2c9c055 100644 --- a/scumm/actor.h +++ b/scumm/actor.h @@ -82,8 +82,12 @@ public: static void initActorClass(ScummEngine *scumm); public: + /** The position of the actor inside the virtual screen. */ Common::Point _pos; + + /** HE specific: This rect is used to clip actor drawing. */ Common::Rect clipOverride; + int offs_x, offs_y; int top, bottom; uint width; diff --git a/scumm/akos.cpp b/scumm/akos.cpp index 8abd9ca1ec..f99181957a 100644 --- a/scumm/akos.cpp +++ b/scumm/akos.cpp @@ -740,14 +740,7 @@ byte AkosRenderer::codec1(int xmoveCur, int ymoveCur) { v1.scaleXstep = _mirror ? 1 : -1; if (_vm->_heversion >= 71) { - if (rect.top < _clipOverride.top) - rect.top = _clipOverride.top; - if (rect.bottom > _clipOverride.bottom) - rect.bottom = _clipOverride.bottom; - if (rect.left < _clipOverride.left) - rect.left = _clipOverride.left; - if (rect.right > _clipOverride.right) - rect.right = _clipOverride.right; + rect.clip(_clipOverride); } if (_actorHitMode) { @@ -1021,14 +1014,7 @@ byte AkosRenderer::codec16(int xmoveCur, int ymoveCur) { maxh = _outheight; if (_vm->_heversion >= 71) { - if (clip.top < _clipOverride.top) - clip.top = _clipOverride.top; - if (clip.bottom > _clipOverride.bottom) - clip.bottom = _clipOverride.bottom; - if (clip.left < _clipOverride.left) - clip.left = _clipOverride.left; - if (clip.right > _clipOverride.right) - clip.right = _clipOverride.right; + clip.clip(_clipOverride); } _vm->markRectAsDirty(kMainVirtScreen, clip, _actorID); diff --git a/scumm/script_v6he.cpp b/scumm/script_v6he.cpp index d6416d59f9..6fa0003bc3 100644 --- a/scumm/script_v6he.cpp +++ b/scumm/script_v6he.cpp @@ -571,18 +571,18 @@ void ScummEngine_v6he::o6_actorOps() { break; case 30: // _heversion >= 70 - _actorClipBottom = pop(); - _actorClipRight = pop(); - _actorClipTop = pop(); - _actorClipLeft = pop(); + _actorClipOverride.bottom = pop(); + _actorClipOverride.right = pop(); + _actorClipOverride.top = pop(); + _actorClipOverride.left = pop(); warning("o6_actorOps: stub case %d", b); break; case 64: // _heversion >= 72 - _actorClipBottom = pop(); - _actorClipRight = pop(); - _actorClipTop = pop(); - _actorClipLeft = pop(); + _actorClipOverride.bottom = pop(); + _actorClipOverride.right = pop(); + _actorClipOverride.top = pop(); + _actorClipOverride.left = pop(); warning("o6_actorOps: stub case %d", b); break; case 76: // SO_COSTUME diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp index 55727f75ed..e71a8f90be 100644 --- a/scumm/scumm.cpp +++ b/scumm/scumm.cpp @@ -654,10 +654,10 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS _2byteFontPtr = 0; _V1_talkingActor = 0; - _actorClipTop = 0; - _actorClipBottom = 479; - _actorClipLeft = 0; - _actorClipRight = 639; + _actorClipOverride.top = 0; + _actorClipOverride.bottom = 479; + _actorClipOverride.left = 0; + _actorClipOverride.right = 639; _skipDrawObject = 0; _skipProcessActors = 0; diff --git a/scumm/scumm.h b/scumm/scumm.h index 5c001fb84c..8af5594bf3 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -849,10 +849,7 @@ public: int16 _queueTalkColor[16]; byte _queueTalkString[16][128]; - int _actorClipTop; - int _actorClipBottom; - int _actorClipLeft; - int _actorClipRight; + Common::Rect _actorClipOverride; bool akos_increaseAnims(const byte *akos, Actor *a); bool akos_increaseAnim(Actor *a, int i, const byte *aksq, const uint16 *akfo, int numakfo); -- cgit v1.2.3