From d7a6bf58461ca4d780d354403fc40c9c91f66988 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 5 Apr 2011 11:36:38 +0200 Subject: SCUMM: Move ActorHE into its own header, move some HE specific stuff out of scumm.h --- engines/scumm/actor.cpp | 3 +- engines/scumm/actor.h | 41 -------------------- engines/scumm/actor_he.h | 92 ++++++++++++++++++++++++++++++++++++++++++++ engines/scumm/he/intern_he.h | 4 ++ engines/scumm/scumm.cpp | 11 +++--- engines/scumm/scumm.h | 18 --------- 6 files changed, 104 insertions(+), 65 deletions(-) create mode 100644 engines/scumm/actor_he.h (limited to 'engines') diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp index 2403d2aa40..39db47b102 100644 --- a/engines/scumm/actor.cpp +++ b/engines/scumm/actor.cpp @@ -26,6 +26,7 @@ #include "common/system.h" // for setFocusRectangle/clearFocusRectangle #include "scumm/scumm.h" #include "scumm/actor.h" +#include "scumm/actor_he.h" #include "scumm/akos.h" #include "scumm/boxes.h" #include "scumm/charset.h" @@ -75,7 +76,7 @@ void ActorHE::initActor(int mode) { if (_vm->_game.heversion >= 61) _flip = 0; - _clipOverride = _vm->_actorClipOverride; + _clipOverride = ((ScummEngine_v60he *)_vm)->_actorClipOverride; _auxBlock.reset(); } diff --git a/engines/scumm/actor.h b/engines/scumm/actor.h index 98854ec5ba..8e699b5a49 100644 --- a/engines/scumm/actor.h +++ b/engines/scumm/actor.h @@ -34,7 +34,6 @@ namespace Scumm { - enum { V12_X_MULTIPLIER = 8, V12_Y_MULTIPLIER = 2, @@ -315,46 +314,6 @@ protected: bool findPathTowards(byte box, byte box2, byte box3, Common::Point &foundPath); }; -class ActorHE : public Actor { -public: - ActorHE(ScummEngine *scumm, int id) : Actor(scumm, id) {} - - virtual void initActor(int mode); - - virtual void hideActor(); - - void drawActorToBackBuf(int x, int y); - - void setHEFlag(int bit, int set); - - void setUserCondition(int slot, int set); - bool isUserConditionSet(int slot) const; - - void setTalkCondition(int slot); - bool isTalkConditionSet(int slot) const; - -public: - /** This rect is used to clip actor drawing. */ - Common::Rect _clipOverride; - - bool _heNoTalkAnimation; - bool _heTalking; - byte _heFlags; - - AuxBlock _auxBlock; - - struct { - int16 posX; - int16 posY; - int16 color; - byte sentence[128]; - } _heTalkQueue[16]; - - - virtual void prepareDrawActorCostume(BaseCostumeRenderer *bcr); - virtual void setActorCostume(int c); -}; - class Actor_v3 : public Actor { public: Actor_v3(ScummEngine *scumm, int id) : Actor(scumm, id) {} diff --git a/engines/scumm/actor_he.h b/engines/scumm/actor_he.h new file mode 100644 index 0000000000..bb7bbb6487 --- /dev/null +++ b/engines/scumm/actor_he.h @@ -0,0 +1,92 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + + +#ifndef SCUMM_ACTOR_HE_H +#define SCUMM_ACTOR_HE_H + +#include "scumm/actor.h" + +namespace Scumm { + +struct AuxBlock { + bool visible; + Common::Rect r; + + void reset() { + visible = false; + r.left = r.top = 0; + r.right = r.bottom = -1; + } +}; + +struct AuxEntry { + int actorNum; + int subIndex; +}; + +class ActorHE : public Actor { +public: + ActorHE(ScummEngine *scumm, int id) : Actor(scumm, id) {} + + virtual void initActor(int mode); + + virtual void hideActor(); + + void drawActorToBackBuf(int x, int y); + + void setHEFlag(int bit, int set); + + void setUserCondition(int slot, int set); + bool isUserConditionSet(int slot) const; + + void setTalkCondition(int slot); + bool isTalkConditionSet(int slot) const; + +public: + /** This rect is used to clip actor drawing. */ + Common::Rect _clipOverride; + + bool _heNoTalkAnimation; + bool _heTalking; + byte _heFlags; + + AuxBlock _auxBlock; + + struct { + int16 posX; + int16 posY; + int16 color; + byte sentence[128]; + } _heTalkQueue[16]; + + + virtual void prepareDrawActorCostume(BaseCostumeRenderer *bcr); + virtual void setActorCostume(int c); +}; + +} // End of namespace Scumm + +#endif diff --git a/engines/scumm/he/intern_he.h b/engines/scumm/he/intern_he.h index 5b59558dd7..c0eaf7352b 100644 --- a/engines/scumm/he/intern_he.h +++ b/engines/scumm/he/intern_he.h @@ -31,6 +31,7 @@ #include "scumm/he/floodfill_he.h" #include "scumm/he/wiz_he.h" #endif +#include "scumm/actor_he.h" // For AuxBlock & AuxEntry namespace Common { class SeekableReadStream; @@ -55,7 +56,10 @@ public: Common::SeekableReadStream *_hInFileTable[17]; Common::WriteStream *_hOutFileTable[17]; + Common::Rect _actorClipOverride; // HE specific + int _heTimers[16]; + int getHETimer(int timer); void setHETimer(int timer); diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index d22b6ee3a2..7861807362 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -320,11 +320,6 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) _V1TalkingActor = 0; _NESStartStrip = 0; - _actorClipOverride.top = 0; - _actorClipOverride.bottom = 480; - _actorClipOverride.left = 0; - _actorClipOverride.right = 640; - _skipDrawObject = 0; #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE @@ -767,6 +762,12 @@ ScummEngine_v60he::ScummEngine_v60he(OSystem *syst, const DetectorResult &dr) : ScummEngine_v6(syst, dr) { memset(_hInFileTable, 0, sizeof(_hInFileTable)); memset(_hOutFileTable, 0, sizeof(_hOutFileTable)); + + _actorClipOverride.top = 0; + _actorClipOverride.bottom = 480; + _actorClipOverride.left = 0; + _actorClipOverride.right = 640; + memset(_heTimers, 0, sizeof(_heTimers)); if (_game.heversion >= 61) diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h index 587d1be776..86b8276fd0 100644 --- a/engines/scumm/scumm.h +++ b/engines/scumm/scumm.h @@ -308,22 +308,6 @@ enum WhereIsObject { WIO_FLOBJECT = 4 }; -struct AuxBlock { - bool visible; - Common::Rect r; - - void reset() { - visible = false; - r.left = r.top = 0; - r.right = r.bottom = -1; - } -}; - -struct AuxEntry { - int actorNum; - int subIndex; -}; - // TODO: Rename InfoStuff to something more descriptive struct InfoStuff { uint32 date; @@ -972,8 +956,6 @@ public: // Generic costume code bool isCostumeInUse(int i) const; - Common::Rect _actorClipOverride; // HE specific - protected: /* Should be in Graphics class? */ uint16 _screenB, _screenH; -- cgit v1.2.3