mirror of https://github.com/axmolengine/axmol.git
reserve animation size
This commit is contained in:
parent
2f0e666ac1
commit
c7f7623320
|
@ -1202,6 +1202,10 @@ bool Bundle3D::loadAnimationDataJson(Animation3DData* animationdata)
|
|||
{
|
||||
const rapidjson::Value& bone_keyframes = bone[KEYFRAMES];
|
||||
rapidjson::SizeType keyframe_size = bone_keyframes.Size();
|
||||
animationdata->_rotationKeys[bone_name].reserve(keyframe_size);
|
||||
animationdata->_scaleKeys[bone_name].reserve(keyframe_size);
|
||||
animationdata->_translationKeys[bone_name].reserve(keyframe_size);
|
||||
|
||||
for (rapidjson::SizeType j = 0; j < keyframe_size; j++)
|
||||
{
|
||||
const rapidjson::Value& bone_keyframe = bone_keyframes[j];
|
||||
|
@ -1628,6 +1632,10 @@ bool Bundle3D::loadAnimationDataBinary(Animation3DData* animationdata)
|
|||
return false;
|
||||
}
|
||||
|
||||
animationdata->_rotationKeys[boneName].reserve(keyframeNum);
|
||||
animationdata->_scaleKeys[boneName].reserve(keyframeNum);
|
||||
animationdata->_translationKeys[boneName].reserve(keyframeNum);
|
||||
|
||||
for (unsigned int j = 0; j < keyframeNum; ++j)
|
||||
{
|
||||
float keytime;
|
||||
|
|
Loading…
Reference in New Issue