mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-29 07:22:07 +00:00
Fix for Unreal meshes that don't have sequential texture numbers
This commit is contained in:
parent
44dd48c7fa
commit
1bb00ed4f0
2 changed files with 9 additions and 3 deletions
|
@ -75,11 +75,16 @@ bool FUE1Model::Load( const char *filename, int lumpnum, const char *buffer, int
|
|||
numFrames = ahead->numframes;
|
||||
numPolys = dhead->numpolys;
|
||||
numGroups = 0;
|
||||
groupIndices.Reset();
|
||||
uint8_t used[256] = {0};
|
||||
for ( int i=0; i<numPolys; i++ )
|
||||
used[dpolys[i].texnum] = 1;
|
||||
for ( int i=0; i<256; i++ )
|
||||
if ( used[i] ) numGroups++;
|
||||
{
|
||||
if ( !used[i] ) continue;
|
||||
groupIndices.Push(i);
|
||||
numGroups++;
|
||||
}
|
||||
LoadGeometry();
|
||||
return true;
|
||||
}
|
||||
|
@ -166,7 +171,7 @@ void FUE1Model::LoadGeometry()
|
|||
Group.numPolys = 0;
|
||||
for ( int j=0; j<numPolys; j++ )
|
||||
{
|
||||
if ( polys[j].texNum != i )
|
||||
if ( polys[j].texNum != groupIndices[i] )
|
||||
continue;
|
||||
Group.P.Push(j);
|
||||
Group.numPolys++;
|
||||
|
@ -208,8 +213,8 @@ void FUE1Model::RenderFrame( FModelRenderer *renderer, FTexture *skin, int frame
|
|||
sskin = TexMan(curSpriteMDLFrame->surfaceskinIDs[curMDLIndex][i]);
|
||||
if ( !sskin )
|
||||
{
|
||||
continue;
|
||||
vofs += vsize;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
renderer->SetMaterial(sskin,false,translation);
|
||||
|
|
|
@ -88,4 +88,5 @@ private:
|
|||
TArray<UE1Vertex> verts;
|
||||
TArray<UE1Poly> polys;
|
||||
TArray<UE1Group> groups;
|
||||
TArray<int> groupIndices;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue