28 #ifndef WINTERMUTE_XMODEL_H 29 #define WINTERMUTE_XMODEL_H 31 #include "engines/wintermute/base/base_object.h" 32 #include "engines/wintermute/base/base_sprite.h" 33 #include "engines/wintermute/base/gfx/xmath.h" 34 #include "engines/wintermute/base/gfx/3deffect.h" 35 #include "engines/wintermute/base/gfx/3deffect_params.h" 36 #include "engines/wintermute/coll_templ.h" 37 #include "engines/wintermute/math/rect32.h" 38 #include "engines/wintermute/video/video_theora_player.h" 39 #include "engines/wintermute/utils/utils.h" 43 class AnimationChannel;
52 #define X_NUM_ANIMATION_CHANNELS 10 56 class XModelMatSprite {
70 _effectFile =
nullptr;
71 _effectParams =
nullptr;
74 XModelMatSprite(
const char *matName,
BaseSprite *sprite) {
78 BaseUtils::setString(&_matName, matName);
80 _effectFile =
nullptr;
81 _effectParams =
nullptr;
88 BaseUtils::setString(&_matName, matName);
90 _effectFile =
nullptr;
91 _effectParams =
nullptr;
94 XModelMatSprite(
const char *matName,
Effect3D *effect) {
98 BaseUtils::setString(&_matName, matName);
100 _effectFile =
nullptr;
108 _effectFile =
nullptr;
115 delete _effectParams;
116 _effectParams =
nullptr;
145 _effectParams->clear();
151 persistMgr->transferCharPtr(TMEMBER(_matName));
152 persistMgr->transferPtr(TMEMBER(_sprite));
154 persistMgr->transferPtr(TMEMBER(_theora));
156 if (persistMgr->getIsSaving()) {
157 char *effectFileName =
nullptr;
159 BaseUtils::setString(&effectFileName, _effect->getFileName());
161 effectFileName =
nullptr;
163 persistMgr->transferCharPtr(TMEMBER(effectFileName));
164 delete[] effectFileName;
166 persistMgr->transferCharPtr(TMEMBER(_effectFile));
169 if (persistMgr->getIsSaving()) {
170 bool hasParams = _effectParams !=
nullptr;
171 persistMgr->transferBool(TMEMBER(hasParams));
174 _effectParams->persist(persistMgr);
177 persistMgr->transferBool(TMEMBER(hasParams));
181 _effectParams->persist(persistMgr);
183 _effectParams =
nullptr;
192 const static int kDefaultTicksPerSecond = 4800;
207 bool update()
override;
209 bool renderFlatShadowModel();
214 bool playAnim(
int channel,
const Common::String &anim, uint32 transitionTime = 0,
bool forceReset =
false, uint32 stopTransitionTime = 0);
215 bool isAnimPending(
char *animName =
nullptr);
216 bool isAnimPending(
int channel,
const char *animName =
nullptr);
218 bool isTransparentAt(
int x,
int y);
226 bool parseAnim(byte *buffer);
230 bool stopAnim(
int channel, uint32 transitionTime);
231 bool stopAnim(uint32 transitionTime);
233 DXMatrix *getBoneMatrix(
const char *boneName);
236 bool setMaterialSprite(
const char *materialName,
const char *spriteFilename);
237 bool setMaterialTheora(
const char *materialName,
const char *theoraFilename);
238 bool setMaterialEffect(
const char *materialName,
const char *effectFilename);
239 bool removeMaterialEffect(
const char *materialName);
240 bool setMaterialEffectParam(
const char *materialName,
const char *paramName,
ScValue *val);
241 bool setMaterialEffectParam(
const char *materialName,
const char *paramName,
DXVector4 val);
242 bool initializeSimple();
244 bool invalidateDeviceObjects()
override;
245 bool restoreDeviceObjects()
override;
247 bool unloadAnimation(
const char *animName);
249 uint32 _ticksPerSecond{};
254 void cleanup(
bool complete =
true);
255 bool findBones(
bool animOnly =
false,
XModel *parentModel =
nullptr);
257 void updateBoundingRect();
263 int32 _lastOffsetX{};
264 int32 _lastOffsetY{};
Definition: base_game.h:76
Definition: script_value.h:42
Definition: base_persistence_manager.h:56
Definition: coll_templ.h:115
Definition: xanimation_set.h:42
Definition: video_theora_player.h:41
Definition: 3dshadow_volume.h:49
Definition: xanimation_channel.h:37
Definition: coll_templ.h:63
Definition: 3deffect_params.h:36
Definition: base_named_object.h:36
Definition: xframe_node.h:44
Definition: base_sprite.h:40
Definition: 3deffect.h:36
Definition: xfile_loader.h:459
Definition: base_object.h:49
Definition: achievements_tables.h:27