ソースを参照

fix invalid index counter.

Signed-off-by: Kim Kulling <[email protected]>
Kim Kulling 10 年 前
コミット
65cb05f381
1 ファイル変更4 行追加3 行削除
  1. 4 3
      code/OpenGEXImporter.cpp

+ 4 - 3
code/OpenGEXImporter.cpp

@@ -655,10 +655,11 @@ void OpenGEXImporter::handleIndexArrayNode( ODDLParser::DDLNode *node, aiScene *
     for( size_t i = 0; i < numItems; i++ ) {
         aiFace *current( & ( m_currentMesh->mFaces[ i ] ) );
         current->mNumIndices = 3;
-        current->mIndices = new unsigned int[ 3 ];
+        current->mIndices = new unsigned int[ current->mNumIndices ];
         Value *next( vaList->m_dataList );
-        for( size_t i = 0; i < 3; i++ ) {
-            current->mIndices[ i ] = next->getInt32();
+        for( size_t indices = 0; indices < current->mNumIndices; indices++ ) {
+            const int idx = next->getInt32();
+            current->mIndices[ indices ] = next->getInt32();
             next = next->m_next;
         }
         vaList = vaList->m_next;