ScummVM API documentation
costume.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef SCUMM_COSTUME_H
23 #define SCUMM_COSTUME_H
24 
25 #include "scumm/base-costume.h"
26 
27 namespace Scumm {
29 public:
30  int _id;
31  const byte *_baseptr;
32  const byte *_animCmds;
33  const byte *_dataOffsets;
34  const byte *_palette;
35  const byte *_frameOffsets;
36  byte _numColors;
37  byte _numAnim;
38  byte _format;
39  bool _mirror;
40 
43  _id(-1), _baseptr(0), _animCmds(0), _dataOffsets(0), _palette(0),
44  _frameOffsets(0), _numColors(0), _numAnim(0), _format(0), _mirror(false) {}
45 
46  void loadCostume(int id) override;
47  void costumeDecodeData(Actor *a, int frame, uint usemask) override;
48  bool increaseAnims(Actor *a) override;
49 
50 protected:
51  bool increaseAnim(Actor *a, int slot);
52 };
53 
55 public:
56  int _id;
57  const byte *_baseptr;
58  const byte *_dataOffsets;
59  byte _numAnim;
60 
61  NESCostumeLoader(ScummEngine *vm) : BaseCostumeLoader(vm), _id(0), _baseptr(nullptr), _dataOffsets(nullptr), _numAnim(0) {}
62  void loadCostume(int id) override;
63  void costumeDecodeData(Actor *a, int frame, uint usemask) override;
64  bool increaseAnims(Actor *a) override;
65 
66 protected:
67  bool increaseAnim(Actor *a, int slot);
68 };
69 
71 public:
73  void loadCostume(int id) override;
74  void costumeDecodeData(Actor *a, int frame, uint usemask) override;
75  bool increaseAnims(Actor *a) override;
76  byte getFrame(Actor *a, int limb);
77 
78 protected:
79  bool increaseAnim(Actor *a, int limb);
80 };
81 
83 protected:
84  ClassicCostumeLoader _loaded;
85 
86 public:
87  ClassicCostumeRenderer(ScummEngine *vm) : BaseCostumeRenderer(vm), _loaded(vm) {}
88 
89  void setPalette(uint16 *palette) override;
90  void setFacing(const Actor *a) override;
91  void setCostume(int costume, int shadow) override;
92 
93 protected:
94  byte drawLimb(const Actor *a, int limb) override;
95 
96  byte paintCelByleRLE(int xMoveCur, int yMoveCur);
97 
98  void byleRLEDecode_C64(ByleRLEData &compData, int actor);
99  void byleRLEDecode_ami(ByleRLEData &compData);
100  void byleRLEDecode_PCEngine(ByleRLEData &compData);
101 
102 private:
103  void markAsDirty(const Common::Rect &rect, ByleRLEData &compData, bool &decode) override;
104 };
105 
107 protected:
108  NESCostumeLoader _loaded;
109 
110 public:
111  NESCostumeRenderer(ScummEngine *vm) : BaseCostumeRenderer(vm), _loaded(vm) {}
112 
113  void setPalette(uint16 *palette) override;
114  void setFacing(const Actor *a) override;
115  void setCostume(int costume, int shadow) override;
116 
117 protected:
118  byte drawLimb(const Actor *a, int limb) override;
119 };
120 
121 #ifdef USE_RGB_COLOR
122 class PCEngineCostumeRenderer : public ClassicCostumeRenderer {
123 public:
124  PCEngineCostumeRenderer(ScummEngine *vm) : ClassicCostumeRenderer(vm) {}
125 
126  void setPalette(uint16 *palette) override;
127 };
128 #endif
129 
131 protected:
132  V0CostumeLoader _loaded;
133 
134 public:
135  V0CostumeRenderer(ScummEngine *vm) : BaseCostumeRenderer(vm), _loaded(vm) {}
136 
137  void setPalette(uint16 *palette) override {}
138  void setFacing(const Actor *a) override {}
139  void setCostume(int costume, int shadow) override;
140 
141 protected:
142  byte drawLimb(const Actor *a, int limb) override;
143 };
144 
145 } // End of namespace Scumm
146 
147 #endif
Definition: costume.h:70
Definition: base-costume.h:114
Definition: rect.h:524
Definition: costume.h:82
Definition: costume.h:28
Definition: scumm.h:511
Definition: costume.h:106
Definition: actor.h:100
Definition: costume.h:130
Definition: costume.h:54
Definition: base-costume.h:68
Definition: base-costume.h:49
Definition: actor.h:30