mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
apply patch from ticket 1944 added sound attribute to animations to optionally differentiate sound starting point
This was SVN commit r13529.
This commit is contained in:
@@ -251,7 +251,7 @@ const CBoundingBoxAligned CModel::GetObjectSelectionBoundsRec()
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// BuildAnimation: load raw animation frame animation from given file, and build a
|
||||
// animation specific to this model
|
||||
CSkeletonAnim* CModel::BuildAnimation(const VfsPath& pathname, const CStr& name, float speed, float actionpos, float actionpos2)
|
||||
CSkeletonAnim* CModel::BuildAnimation(const VfsPath& pathname, const CStr& name, float speed, float actionpos, float actionpos2, float soundpos)
|
||||
{
|
||||
CSkeletonAnimDef* def = m_SkeletonAnimManager.GetAnimation(pathname);
|
||||
if (!def)
|
||||
@@ -272,6 +272,11 @@ CSkeletonAnim* CModel::BuildAnimation(const VfsPath& pathname, const CStr& name,
|
||||
else
|
||||
anim->m_ActionPos2 = actionpos2 * anim->m_AnimDef->GetDuration();
|
||||
|
||||
if (soundpos == -1.f)
|
||||
anim->m_SoundPos = -1.f;
|
||||
else
|
||||
anim->m_SoundPos = soundpos * anim->m_AnimDef->GetDuration();
|
||||
|
||||
anim->m_ObjectBounds.SetEmpty();
|
||||
InvalidateBounds();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user