mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-31 08:41:11 +00:00
fix nq's skin code so it doesn't upload skins every frame
This commit is contained in:
parent
792aac270c
commit
04d4df1e19
3 changed files with 23 additions and 4 deletions
|
@ -126,6 +126,7 @@ CL_NewTranslation (int slot, skin_t *skin)
|
|||
int top, bottom;
|
||||
byte *dest;
|
||||
model_t *model;
|
||||
entity_t *entity;
|
||||
int skinnum;
|
||||
|
||||
if (slot > cl.maxclients)
|
||||
|
@ -135,12 +136,27 @@ CL_NewTranslation (int slot, skin_t *skin)
|
|||
dest = player->translations;
|
||||
top = (player->colors & 0xf0) >> 4;
|
||||
bottom = player->colors & 15;
|
||||
model = cl_entities[1 + slot].model;
|
||||
skinnum = cl_entities[1 + slot].skinnum;
|
||||
entity = &cl_entities[1 + slot];
|
||||
model = entity->model;
|
||||
skinnum = entity->skinnum;
|
||||
|
||||
memset (skin, 0, sizeof (*skin)); //XXX external skins not yet supported
|
||||
|
||||
if (!model)
|
||||
return;
|
||||
|
||||
Skin_Set_Translate (top, bottom, dest);
|
||||
memset (skin, 0, sizeof (*skin));
|
||||
skin->texture = skin_textures + slot; //FIXME
|
||||
skin->data.texels = 0; //FIXME
|
||||
|
||||
if (player->colors == player->_colors
|
||||
&& entity->model == entity->_model
|
||||
&& entity->skinnum == entity->_skinnum)
|
||||
return;
|
||||
|
||||
player->_colors = player->colors;
|
||||
entity->_model = entity->model;
|
||||
entity->_skinnum = entity->skinnum;
|
||||
|
||||
Skin_Set_Translate (top, bottom, dest);
|
||||
Skin_Do_Translation_Model (model, skinnum, slot, skin);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue