From 446be21239727bcea559e201b77a48860fd5a34f Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 27 Mar 2005 00:23:38 +0000 Subject: Started to overhaul the costume infrastructure a bit, properly separating the NES costume code in the process (sorry if I broke stuff for the NES folks, but I figure it is better to get this done properly now before we have to untangle the mess later) svn-id: r17257 --- scumm/costume.h | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) (limited to 'scumm/costume.h') diff --git a/scumm/costume.h b/scumm/costume.h index 1b233e1c81..fb311608a4 100644 --- a/scumm/costume.h +++ b/scumm/costume.h @@ -25,7 +25,7 @@ namespace Scumm { -class LoadedCostume { +class ClassicCostume : public BaseCostume { protected: ScummEngine *_vm; @@ -41,29 +41,36 @@ public: byte _format; bool _mirror; - LoadedCostume(ScummEngine *vm) : + ClassicCostume(ScummEngine *vm) : _vm(vm), _id(-1), _baseptr(0), _animCmds(0), _dataOffsets(0), _palette(0), _frameOffsets(0), _numColors(0), _numAnim(0), _format(0), _mirror(false) {} void loadCostume(int id); byte increaseAnims(Actor *a); - void loadNEScostume(void); protected: byte increaseAnim(Actor *a, int slot); }; +class NESCostume : public ClassicCostume { +public: + NESCostume(ScummEngine *vm) : ClassicCostume(vm) {} + void loadCostume(int id); -class CostumeRenderer : public BaseCostumeRenderer { protected: - LoadedCostume _loaded; + byte increaseAnim(Actor *a, int slot); +}; + +class ClassicCostumeRenderer : public BaseCostumeRenderer { +protected: + ClassicCostume _loaded; byte _scaleIndexX; /* must wrap at 256 */ byte _scaleIndexY; byte _palette[32]; public: - CostumeRenderer(ScummEngine *vm) : BaseCostumeRenderer(vm), _loaded(vm) {} + ClassicCostumeRenderer(ScummEngine *vm) : BaseCostumeRenderer(vm), _loaded(vm) {} void setPalette(byte *palette); void setFacing(const Actor *a); @@ -71,7 +78,6 @@ public: protected: byte drawLimb(const Actor *a, int limb); - void drawNESCostume(const Actor *a, int limb); void proc3(Codec1 &v1); void proc3_ami(Codec1 &v1); @@ -81,6 +87,21 @@ protected: byte mainRoutine(int xmoveCur, int ymoveCur); }; +class NESCostumeRenderer : public BaseCostumeRenderer { +protected: + NESCostume _loaded; + +public: + NESCostumeRenderer(ScummEngine *vm) : BaseCostumeRenderer(vm), _loaded(vm) {} + + void setPalette(byte *palette); + void setFacing(const Actor *a); + void setCostume(int costume); + +protected: + byte drawLimb(const Actor *a, int limb); +}; + } // End of namespace Scumm #endif -- cgit v1.2.3