浏览代码

Now I understand the origin of this deform2 and awkward memset function, haha

Stephen Gowen 7 年之前
父节点
当前提交
e20382a304
共有 1 个文件被更改,包括 8 次插入8 次删除
  1. 8 8
      spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp

+ 8 - 8
spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp

@@ -1201,35 +1201,35 @@ namespace Spine
                     for (valueMap = timelineMap->_child, frameIndex = 0; valueMap; valueMap = valueMap->_next, ++frameIndex)
                     for (valueMap = timelineMap->_child, frameIndex = 0; valueMap; valueMap = valueMap->_next, ++frameIndex)
                     {
                     {
                         Json* vertices = Json::getItem(valueMap, "vertices");
                         Json* vertices = Json::getItem(valueMap, "vertices");
-                        Vector<float> deform2;
+                        Vector<float> deform;
                         if (!vertices)
                         if (!vertices)
                         {
                         {
                             if (weighted)
                             if (weighted)
                             {
                             {
-                                deform2 = tempDeform;
+                                deform = tempDeform;
                             }
                             }
                             else
                             else
                             {
                             {
-                                deform2 = attachment->_vertices;
+                                deform = attachment->_vertices;
                             }
                             }
                         }
                         }
                         else
                         else
                         {
                         {
                             int v, start = Json::getInt(valueMap, "offset", 0);
                             int v, start = Json::getInt(valueMap, "offset", 0);
                             Json* vertex;
                             Json* vertex;
-                            deform2 = tempDeform;
+                            deform = tempDeform;
                             if (_scale == 1)
                             if (_scale == 1)
                             {
                             {
                                 for (vertex = vertices->_child, v = start; vertex; vertex = vertex->_next, ++v)
                                 for (vertex = vertices->_child, v = start; vertex; vertex = vertex->_next, ++v)
                                 {
                                 {
-                                    deform2[v] = vertex->_valueFloat;
+                                    deform[v] = vertex->_valueFloat;
                                 }
                                 }
                             }
                             }
                             else
                             else
                             {
                             {
                                 for (vertex = vertices->_child, v = start; vertex; vertex = vertex->_next, ++v)
                                 for (vertex = vertices->_child, v = start; vertex; vertex = vertex->_next, ++v)
                                 {
                                 {
-                                    deform2[v] = vertex->_valueFloat * _scale;
+                                    deform[v] = vertex->_valueFloat * _scale;
                                 }
                                 }
                             }
                             }
                             if (!weighted)
                             if (!weighted)
@@ -1237,11 +1237,11 @@ namespace Spine
                                 Vector<float>& verticesAttachment = attachment->_vertices;
                                 Vector<float>& verticesAttachment = attachment->_vertices;
                                 for (v = 0; v < deformLength; ++v)
                                 for (v = 0; v < deformLength; ++v)
                                 {
                                 {
-                                    deform2[v] += verticesAttachment[v];
+                                    deform[v] += verticesAttachment[v];
                                 }
                                 }
                             }
                             }
                         }
                         }
-                        timeline->setFrame(frameIndex, Json::getFloat(valueMap, "time", 0), deform2);
+                        timeline->setFrame(frameIndex, Json::getFloat(valueMap, "time", 0), deform);
                         readCurve(valueMap, timeline, frameIndex);
                         readCurve(valueMap, timeline, frameIndex);
                     }
                     }