get larger player skins working in gl

This commit is contained in:
Bill Currie 2002-09-13 05:32:28 +00:00
parent e8baa18abd
commit f7b4dffcc0
6 changed files with 42 additions and 8 deletions

View file

@ -50,7 +50,7 @@ typedef struct skin_s
int numfb;
} skin_t;
extern byte player_8bit_texels[320 * 200];
extern byte player_8bit_texels[640 * 400];
extern skin_t skin_cache[MAX_CACHED_SKINS];
extern int skin_textures;
extern int skin_fb_textures;
@ -70,6 +70,7 @@ void Skin_Set_Translate (int top, int bottom, void *_dest);
void Skin_Do_Translation (skin_t *player_skin, int slot, skin_t *skin);
void Skin_Do_Translation_Model (struct model_s *model, int skinnum,
int slot, skin_t *skin);
void Skin_Player_Model (struct model_s *model);
void Skin_Process (skin_t *skin, struct tex_s *);
skin_t *Skin_NewTempSkin (void);

View file

@ -52,7 +52,7 @@ static const char rcsid[] =
#include "compat.h"
byte player_8bit_texels[320 * 200];
byte player_8bit_texels[640 * 400];
// a pose is a single set of vertexes. a frame may be

View file

@ -52,6 +52,8 @@ static const char rcsid[] =
static byte translate[256];
static unsigned int translate32[256];
static int player_width = 296;
static int player_height = 194;
void
Skin_Set_Translate (int top, int bottom, void *_dest)
@ -191,10 +193,11 @@ Skin_Do_Translation (skin_t *player_skin, int slot, skin_t *skin)
original = skin_texels->data;
} else {
original = player_8bit_texels;
inwidth = 296;
inheight = 194;
inwidth = player_width;
inheight = player_height;
}
build_skin (texnum, original, inwidth, inheight, 296, 194, false);
build_skin (texnum, original, inwidth, inheight,
player_width, player_height, false);
}
void
@ -231,6 +234,24 @@ Skin_Do_Translation_Model (model_t *model, int skinnum, int slot, skin_t *skin)
Cache_Release (&model->cache);
}
void
Skin_Player_Model (model_t *model)
{
aliashdr_t *paliashdr;
player_width = 296;
player_height = 194;
if (!model) // player doesn't have a model yet
return;
if (model->type != mod_alias) // only translate skins on alias models
return;
paliashdr = Cache_Get (&model->cache);
player_width = paliashdr->mdl.skinwidth;
player_height = paliashdr->mdl.skinheight;
Cache_Release (&model->cache);
}
void
Skin_Init_Translation (void)
{

View file

@ -88,6 +88,12 @@ Skin_Do_Translation_Model (model_t *model, int skinnum, int slot, skin_t *skin)
}
void
Skin_Player_Model (model_t *model)
{
}
void
Skin_Init_Translation (void)
{

View file

@ -181,7 +181,12 @@ Skin_Do_Translation (skin_t *player_skin, int slot, skin_t *skin)
void
Skin_Do_Translation_Model (model_t *model, int skinnum, int slot, skin_t *skin)
{
}
void
Skin_Player_Model (model_t *model)
{
}
void

View file

@ -308,15 +308,16 @@ Model_NextDownload (void)
}
if (strequal (cl.model_name[i], "progs/player.mdl")
&& cl.model_precache[i]->type == mod_alias)
&& cl.model_precache[i]->type == mod_alias) {
info_key = pmodel_name;
Skin_Player_Model (cl.model_precache[i]);
}
if (strequal (cl.model_name[i], "progs/eyes.mdl")
&& cl.model_precache[i]->type == mod_alias)
info_key = emodel_name;
if (info_key && cl_model_crcs->int_val) {
aliashdr_t *ahdr = Cache_Get
(&cl.model_precache[i]->cache);
aliashdr_t *ahdr = Cache_Get (&cl.model_precache[i]->cache);
Info_SetValueForKey (cls.userinfo, info_key, va ("%d", ahdr->crc),
0);
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);