Skip to content
Snippets Groups Projects
Commit 7f346120 authored by MaxED's avatar MaxED
Browse files

MD3: Vertex indices were incorrectly assigned when a model had several surfaces with same skin.

parent 0a137991
No related branches found
No related tags found
No related merge requests found
......@@ -202,12 +202,15 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
//create a mesh for each surface texture
foreach(KeyValuePair<string, List<List<int>>> group in polyIndecesListsPerTexture) {
polyIndecesList = new List<int>();
int offset = 0;
//collect indices, fix vertex offsets
for(int i = 0; i < group.Value.Count; i++) {
if(i > 0) {
for(int c = 0; c < group.Value[i].Count; c++ )
group.Value[i][c] += vertexOffsets[group.Key][i-1];
offset += vertexOffsets[group.Key][i - 1]; //Damn I need to rewrite all of this stuff from scratch...
for(int c = 0; c < group.Value[i].Count; c++)
group.Value[i][c] += offset;
}
polyIndecesList.AddRange(group.Value[i].ToArray());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment