-#ifndef ANIMDECIDE_H
-#define ANIMDECIDE_H
+#pragma once
// must be called at least once to initialize, or when modelindex is changed
void animdecide_load_if_needed(entity e);
void animdecide_setframes(entity e, bool support_blending, .int fld_frame, .int fld_frame1time, .int fld_frame2, .int fld_frame2time);
CLASS(Animation, Object)
- ATTRIB(Animation, m_framenames, string, string_null)
+ ATTRIB(Animation, m_framenames, string);
STATIC_METHOD(Animation, getframe, int(Animation this, int mdlidx))
{
FOREACH_WORD(this.m_framenames, true, {
if (f != -1) return f;
});
#ifdef CSQC
- LOG_DEBUGF("Missing animation for %s: %s\n", modelnameforindex(mdlidx), this.registered_id);
+ LOG_DEBUGF("Missing animation for %s: %s", modelnameforindex(mdlidx), this.registered_id);
#endif
return -1;
}
REGISTRY(Animations, BITS(8))
REGISTER_REGISTRY(Animations)
#define Animations_from(id) _Animations_from(id, NULL)
-#define WriteAnimation(to, it) WriteRegistry(Animations, to, it)
-#define ReadAnimation() ReadRegistry(Animations)
+#define WriteAnimation(to, it) WriteRegistered(Animations, to, it)
+#define ReadAnimation() ReadRegistered(Animations)
#define REGISTER_ANIMATION(id, framenames) \
.vector anim_##id; \
REGISTER(Animations, ANIM_##id, m_id, NEW(Animation)) { \
const int ANIMACTION_SHOOT = 4; // shoot
const int ANIMACTION_TAUNT = 5; // taunt
const int ANIMACTION_MELEE = 6; // melee
-#endif