mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-13 07:57:52 +00:00
Update models_md3.cpp
This commit is contained in:
parent
72787c2c4c
commit
4e583772d7
1 changed files with 11 additions and 8 deletions
|
@ -307,7 +307,7 @@ void FMD3Model::AddSkins(uint8_t *hitlist)
|
||||||
for (unsigned i = 0; i < Surfaces.Size(); i++)
|
for (unsigned i = 0; i < Surfaces.Size(); i++)
|
||||||
{
|
{
|
||||||
int ssIndex = i + curMDLIndex * MD3_MAX_SURFACES;
|
int ssIndex = i + curMDLIndex * MD3_MAX_SURFACES;
|
||||||
if (curSpriteMDLFrame->surfaceskinIDs[ssIndex].isValid())
|
if (curSpriteMDLFrame && curSpriteMDLFrame->surfaceskinIDs[ssIndex].isValid())
|
||||||
{
|
{
|
||||||
hitlist[curSpriteMDLFrame->surfaceskinIDs[ssIndex].GetIndex()] |= FTextureManager::HIT_Flat;
|
hitlist[curSpriteMDLFrame->surfaceskinIDs[ssIndex].GetIndex()] |= FTextureManager::HIT_Flat;
|
||||||
}
|
}
|
||||||
|
@ -358,14 +358,17 @@ void FMD3Model::RenderFrame(FModelRenderer *renderer, FGameTexture * skin, int f
|
||||||
FGameTexture *surfaceSkin = skin;
|
FGameTexture *surfaceSkin = skin;
|
||||||
if (!surfaceSkin)
|
if (!surfaceSkin)
|
||||||
{
|
{
|
||||||
int ssIndex = i + curMDLIndex * MD3_MAX_SURFACES;
|
if (curSpriteMDLFrame)
|
||||||
if (curSpriteMDLFrame->surfaceskinIDs[ssIndex].isValid())
|
|
||||||
{
|
{
|
||||||
surfaceSkin = TexMan.GetGameTexture(curSpriteMDLFrame->surfaceskinIDs[ssIndex], true);
|
int ssIndex = i + curMDLIndex * MD3_MAX_SURFACES;
|
||||||
}
|
if (curSpriteMDLFrame->surfaceskinIDs[ssIndex].isValid())
|
||||||
else if (surf->numSkins > 0 && surf->Skins[0].isValid())
|
{
|
||||||
{
|
surfaceSkin = TexMan.GetGameTexture(curSpriteMDLFrame->surfaceskinIDs[ssIndex], true);
|
||||||
surfaceSkin = TexMan.GetGameTexture(surf->Skins[0], true);
|
}
|
||||||
|
else if (surf->numSkins > 0 && surf->Skins[0].isValid())
|
||||||
|
{
|
||||||
|
surfaceSkin = TexMan.GetGameTexture(surf->Skins[0], true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!surfaceSkin)
|
if (!surfaceSkin)
|
||||||
|
|
Loading…
Reference in a new issue