Skip to content
Snippets Groups Projects
Commit 561a0fe7 authored by Monster Iestyn's avatar Monster Iestyn
Browse files

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
parent 2ec972af
No related branches found
No related tags found
No related merge requests found
...@@ -782,6 +782,7 @@ void HWR_InitMD2(void) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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 ...@@ -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];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment