mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-27 14:33:52 +00:00
# Updated unit animation code.
Added UnitAnimation class, to act as the interface between the entity and actor. (Currently doesn't work very well, but it does make animations loop smoothly and sometimes kind of makes them stay synchronised.) Fixed corpse animation - it now plays the final frame of the death animation before turning static. Fixed update/interpolate timings. Added JS function saveProfileData. Updated ffmpeg library. This was SVN commit r4880.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "ps/XML/Xeromyces.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "lib/timer.h"
|
||||
#include "maths/MathUtil.h"
|
||||
|
||||
#define LOG_CATEGORY "graphics"
|
||||
|
||||
@@ -153,17 +154,13 @@ bool CObjectBase::Load(const char* filename)
|
||||
}
|
||||
else if (ae.Name == at_event)
|
||||
{
|
||||
anim.m_ActionPos = CStr(ae.Value).ToDouble();
|
||||
if (anim.m_ActionPos < 0.0) anim.m_ActionPos = 0.0;
|
||||
else if (anim.m_ActionPos > 100.0) anim.m_ActionPos = 1.0;
|
||||
else if (anim.m_ActionPos > 1.0) anim.m_ActionPos /= 100.0;
|
||||
float pos = CStr(ae.Value).ToFloat();
|
||||
anim.m_ActionPos = clamp(pos, 0.f, 1.f);
|
||||
}
|
||||
else if (ae.Name == at_load)
|
||||
{
|
||||
anim.m_ActionPos2 = CStr(ae.Value).ToDouble();
|
||||
if (anim.m_ActionPos2 < 0.0) anim.m_ActionPos2 = 0.0;
|
||||
else if (anim.m_ActionPos2 > 100.0) anim.m_ActionPos2 = 1.0;
|
||||
else if (anim.m_ActionPos2 > 1.0) anim.m_ActionPos2 /= 100.0;
|
||||
float pos = CStr(ae.Value).ToFloat();
|
||||
anim.m_ActionPos2 = clamp(pos, 0.f, 1.f);
|
||||
}
|
||||
else
|
||||
; // unrecognised element
|
||||
|
||||
Reference in New Issue
Block a user