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:
stwf
2013-07-02 11:44:46 +00:00
parent 377cae15f8
commit 485bd75abe
8 changed files with 36 additions and 6 deletions
+6 -1
View File
@@ -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();