From caceebb7a38644b11e2b5abdfa821ddb6aef4b00 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Sun, 12 Nov 2017 22:16:34 +0000 Subject: [PATCH] r_alias.c: display skin 0 instead of checkerboard for invalid skin num metlslime says: > I was the one that at added the blue checkerboard feature. > I didn't realize at the time how many mods relied on the behavior of > vanilla quake to show skin 0 when the mod asks for an invalid skin. So > I now agree, the engine should replicate vanilla quake's permissive > behavior and maybe just put up a non-spamy console warning when the > bad skin is first set. TODO: The warning is currently spammy (but only if developer 1). Would be a bit of a pain to make non-spammy. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1532 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/r_alias.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Quake/r_alias.c b/Quake/r_alias.c index 604ee85b..5b3b9b56 100644 --- a/Quake/r_alias.c +++ b/Quake/r_alias.c @@ -622,7 +622,7 @@ R_DrawAliasModel -- johnfitz -- almost completely rewritten void R_DrawAliasModel (entity_t *e) { aliashdr_t *paliashdr; - int i, anim; + int i, anim, skinnum; gltexture_t *tx, *fb; lerpdata_t lerpdata; qboolean alphatest = !!(e->model->flags & MF_HOLEY); @@ -687,17 +687,15 @@ void R_DrawAliasModel (entity_t *e) // GL_DisableMultitexture(); anim = (int)(cl.time*10) & 3; - if ((e->skinnum >= paliashdr->numskins) || (e->skinnum < 0)) + skinnum = e->skinnum; + if ((skinnum >= paliashdr->numskins) || (skinnum < 0)) { - Con_DPrintf ("R_DrawAliasModel: no such skin # %d for '%s'\n", e->skinnum, e->model->name); - tx = NULL; // NULL will give the checkerboard texture - fb = NULL; + Con_DPrintf ("R_DrawAliasModel: no such skin # %d for '%s'\n", skinnum, e->model->name); + // ericw -- display skin 0 for winquake compatibility + skinnum = 0; } - else - { - tx = paliashdr->gltextures[e->skinnum][anim]; - fb = paliashdr->fbtextures[e->skinnum][anim]; - } + tx = paliashdr->gltextures[skinnum][anim]; + fb = paliashdr->fbtextures[skinnum][anim]; if (e->colormap != vid.colormap && !gl_nocolors.value) { i = e - cl_entities;