fix 24bit skins to work again

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5751 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2020-08-24 07:52:55 +00:00
parent 244b0681ed
commit 8651ff62d8
2 changed files with 9 additions and 4 deletions

View File

@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakedef.h"
#ifdef QWSKINS
cvar_t baseskin = CVAR("baseskin", "");
cvar_t baseskin = CVARD("baseskin", "", "The name of the player skin to use as a fallback.");
cvar_t noskins = CVAR("noskins", "0");
extern cvar_t cl_teamskin;

View File

@ -694,7 +694,12 @@ static shader_t *GL_ChooseSkin(galiasinfo_t *inf, model_t *model, int surfnum, e
if (plskin && plskin->loadstate < SKIN_LOADED)
{
Skin_TryCache8(plskin); //we're not going to use it, but make sure its status is updated when it is finally loaded..
plskin = cl.players[e->playerindex].lastskin;
if (plskin->loadstate < SKIN_LOADED)
{
plskin = cl.players[e->playerindex].lastskin;
if (!plskin || plskin->loadstate < SKIN_LOADED)
return NULL; //just wait for it to finish loading so we don't generate pointless skins.
}
}
else
cl.players[e->playerindex].lastskin = plskin;
@ -838,9 +843,9 @@ static shader_t *GL_ChooseSkin(galiasinfo_t *inf, model_t *model, int surfnum, e
shader = R_RegisterSkin(skinname, NULL);
cm->texnum.bump = shader->defaulttextures->bump; //can't colour bumpmapping
if (original)
if (plskin)
{
if (!original && TEXLOADED(plskin->textures.base))
if (TEXLOADED(plskin->textures.base))
{
cm->texnum.loweroverlay = plskin->textures.loweroverlay;
cm->texnum.upperoverlay = plskin->textures.upperoverlay;