mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-23 04:12:12 +00:00
MD3: Vertex indices were incorrectly assigned when a model had several surfaces with same skin.
This commit is contained in:
parent
0a13799142
commit
7f3461209a
1 changed files with 5 additions and 2 deletions
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue