- changed model data to store models and textures by index instead of by pointer.

The indices are needed for efficient precaching and actual changes to the logic are minor so that this was the best option overall.
This commit is contained in:
Christoph Oelckers 2016-05-03 15:45:21 +02:00
commit f7fda94ec9
5 changed files with 73 additions and 65 deletions

View file

@ -159,7 +159,7 @@ bool FDMDModel::Load(const char * path, int lumpnum, const char * buffer, int le
}
// Allocate and load in the data.
skins = new FTexture *[info.numSkins];
skins = new FTextureID[info.numSkins];
for (i = 0; i < info.numSkins; i++)
{
@ -364,8 +364,8 @@ void FDMDModel::RenderFrame(FTexture * skin, int frameno, int frameno2, double i
if (!skin)
{
if (info.numSkins == 0) return;
skin = skins[0];
if (info.numSkins == 0 || !skins[0].isValid()) return;
skin = TexMan(skins[0]);
if (!skin) return;
}
@ -469,7 +469,7 @@ bool FMD2Model::Load(const char * path, int lumpnum, const char * buffer, int le
return false;
}
skins = new FTexture *[info.numSkins];
skins = new FTextureID[info.numSkins];
for (i = 0; i < info.numSkins; i++)
{