Fixed skin remapping method

This commit is contained in:
ZZYZX 2018-05-27 23:25:17 +03:00
parent 85f00ab9d7
commit 260ffbe57b
3 changed files with 15 additions and 7 deletions

View file

@ -396,15 +396,23 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
vertices[i].nz = -nsum.z / total;
}
List<int> exGroups = new List<int>();
Dictionary<int, int> textureGroupRemap = new Dictionary<int, int>();
int topGrp = 0;
for (int i = 0; i < polys.Length; i++)
{
if (textureGroupRemap.ContainsKey(polys[i].TexNum))
if (exGroups.Contains(polys[i].TexNum))
continue;
textureGroupRemap[polys[i].TexNum] = topGrp++;
if (exGroups.Count == 0 ||
polys[i].TexNum <= exGroups[0])
exGroups.Insert(0, polys[i].TexNum);
else if (exGroups.Count == 0 ||
polys[i].TexNum >= exGroups[exGroups.Count - 1])
exGroups.Add(polys[i].TexNum);
}
for (int i = 0; i < exGroups.Count; i++)
textureGroupRemap[exGroups[i]] = i;
if (skins == null)
{
List<WorldVertex> out_verts = new List<WorldVertex>();
@ -427,7 +435,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
}
else
{
for (int k = 0; k < topGrp; k++)
for (int k = 0; k < exGroups.Count; k++)
{
List<WorldVertex> out_verts = new List<WorldVertex>();
List<int> out_polys = new List<int>();

View file

@ -30,6 +30,6 @@ using CodeImp.DoomBuilder;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.3.0.3022")]
[assembly: AssemblyVersion("2.3.0.3023")]
[assembly: NeutralResourcesLanguageAttribute("en")]
[assembly: AssemblyHash("634ba54")]
[assembly: AssemblyHash("85f00ab")]

View file

@ -29,5 +29,5 @@ using System.Resources;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.3.0.3022")]
[assembly: AssemblyVersion("2.3.0.3023")]
[assembly: NeutralResourcesLanguageAttribute("en")]