Dynamic number of models per frame instead of a hard limit of four. (#1298)
* Changed model-related arrays to TArrays. * Update models.cpp Used TArray.Alloc to make TArrays have the correct size depending on the number of models. surfaceSkinIDs was two-dimensional and is now a one-dimensional TArray as well, it's size is now (models * MD3_MAX_SURFACES) surfaceSkinIDs was two-dimensional and is now a one-dimensional TArray as well, elements are accessed via [Row + Column * NumRows], in this case sSurfaceIndex + modelIndex * MD3_MAX_SURFACES] * Edited skinSurfaceIDs access for one-dimensional TArray * Edited skinSurfaceIDs access for one-dimensional TArray * Edited skinSurfaceIDs access for one-dimensional TArray * Changed model-related arrays to TArrays. Also removed MAX_MODELS_PER_FRAME. * Used TArray.Alloc to make TArrays have the correct size depending on the number of models. surfaceSkinIDs was two-dimensional and is now a one-dimensional TArray as well, elements are accessed via [Row + Column * NumRows], in this case surfaceIndex + modelIndex * MD3_MAX_SURFACES] * Used TArray.Alloc to make TArrays have the correct size depending on the number of models. surfaceSkinIDs was two-dimensional and is now a one-dimensional TArray as well, elements are accessed via [Row + Column * NumRows], in this case surfaceIndex + modelIndex * MD3_MAX_SURFACES] * Update models.h * Edited MAX_MODELS_MD3 * Update models_obj.cpp
This commit is contained in:
parent
4d56754171
commit
769d60a64f
6 changed files with 77 additions and 31 deletions
|
|
@ -242,8 +242,9 @@ void FUE1Model::RenderFrame( FModelRenderer *renderer, FGameTexture *skin, int f
|
|||
FGameTexture *sskin = skin;
|
||||
if ( !sskin )
|
||||
{
|
||||
if ( curSpriteMDLFrame->surfaceskinIDs[curMDLIndex][groups[i].texNum].isValid() )
|
||||
sskin = TexMan.GetGameTexture(curSpriteMDLFrame->surfaceskinIDs[curMDLIndex][groups[i].texNum], true);
|
||||
int ssIndex = groups[i].texNum + curMDLIndex * MD3_MAX_SURFACES;
|
||||
if (curSpriteMDLFrame->surfaceskinIDs[ssIndex].isValid())
|
||||
sskin = TexMan.GetGameTexture(curSpriteMDLFrame->surfaceskinIDs[ssIndex], true);
|
||||
if ( !sskin )
|
||||
{
|
||||
vofs += vsize;
|
||||
|
|
@ -302,9 +303,13 @@ void FUE1Model::BuildVertexBuffer( FModelRenderer *renderer )
|
|||
|
||||
void FUE1Model::AddSkins( uint8_t *hitlist )
|
||||
{
|
||||
for ( int i=0; i<numGroups; i++ )
|
||||
if ( curSpriteMDLFrame->surfaceskinIDs[curMDLIndex][groups[i].texNum].isValid() )
|
||||
hitlist[curSpriteMDLFrame->surfaceskinIDs[curMDLIndex][groups[i].texNum].GetIndex()] |= FTextureManager::HIT_Flat;
|
||||
for (int i = 0; i < numGroups; i++)
|
||||
{
|
||||
int ssIndex = groups[i].texNum + curMDLIndex * MD3_MAX_SURFACES;
|
||||
if (curSpriteMDLFrame->surfaceskinIDs[ssIndex].isValid())
|
||||
hitlist[curSpriteMDLFrame->surfaceskinIDs[ssIndex].GetIndex()] |= FTextureManager::HIT_Flat;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
FUE1Model::~FUE1Model()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue