mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-13 13:21:31 +00:00
Attempt loading of an MD2 only once; if we failed then don't bother again
This keeps my new error messages from flooding the console and log.txt
This commit is contained in:
parent
2ec972af54
commit
561a0fe768
2 changed files with 6 additions and 0 deletions
|
@ -782,6 +782,7 @@ void HWR_InitMD2(void)
|
||||||
md2_playermodels[s].grpatch = NULL;
|
md2_playermodels[s].grpatch = NULL;
|
||||||
md2_playermodels[s].skin = -1;
|
md2_playermodels[s].skin = -1;
|
||||||
md2_playermodels[s].notfound = true;
|
md2_playermodels[s].notfound = true;
|
||||||
|
md2_playermodels[s].error = false;
|
||||||
}
|
}
|
||||||
for (i = 0; i < NUMSPRITES; i++)
|
for (i = 0; i < NUMSPRITES; i++)
|
||||||
{
|
{
|
||||||
|
@ -790,6 +791,7 @@ void HWR_InitMD2(void)
|
||||||
md2_models[i].grpatch = NULL;
|
md2_models[i].grpatch = NULL;
|
||||||
md2_models[i].skin = -1;
|
md2_models[i].skin = -1;
|
||||||
md2_models[i].notfound = true;
|
md2_models[i].notfound = true;
|
||||||
|
md2_models[s].error = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// read the md2.dat file
|
// read the md2.dat file
|
||||||
|
@ -1282,6 +1284,8 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||||
else
|
else
|
||||||
md2 = &md2_models[spr->mobj->sprite];
|
md2 = &md2_models[spr->mobj->sprite];
|
||||||
|
|
||||||
|
if (md2->error)
|
||||||
|
return; // we already failed loading this before :(
|
||||||
if (!md2->model)
|
if (!md2->model)
|
||||||
{
|
{
|
||||||
//CONS_Debug(DBG_RENDER, "Loading MD2... (%s)", sprnames[spr->mobj->sprite]);
|
//CONS_Debug(DBG_RENDER, "Loading MD2... (%s)", sprnames[spr->mobj->sprite]);
|
||||||
|
@ -1295,6 +1299,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//CONS_Debug(DBG_RENDER, " FAILED\n");
|
//CONS_Debug(DBG_RENDER, " FAILED\n");
|
||||||
|
md2->error = true; // prevent endless fail
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,6 +123,7 @@ typedef struct
|
||||||
void *blendgrpatch;
|
void *blendgrpatch;
|
||||||
boolean notfound;
|
boolean notfound;
|
||||||
INT32 skin;
|
INT32 skin;
|
||||||
|
boolean error;
|
||||||
} md2_t;
|
} md2_t;
|
||||||
|
|
||||||
extern md2_t md2_models[NUMSPRITES];
|
extern md2_t md2_models[NUMSPRITES];
|
||||||
|
|
Loading…
Reference in a new issue