From 8448a8f332665eaf4ea2fb04f680d2e81b8bc571 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 24 Jan 2012 11:59:49 +0900 Subject: [PATCH] Minimize the skin calls in nq. --- nq/source/cl_parse.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/nq/source/cl_parse.c b/nq/source/cl_parse.c index ad96e8a0c..a029fe21f 100644 --- a/nq/source/cl_parse.c +++ b/nq/source/cl_parse.c @@ -610,11 +610,8 @@ CL_ParseUpdate (int bits) ent->syncbase = 0.0; } else forcelink = true; // hack to make null model players work - if (num > 0 && num <= cl.maxclients) { + if (num >= 0 && num <= cl.maxclients) ent->skin = Skin_SetColormap (ent->skin, num); - Skin_SetTranslation (num, cl.scores[num].colors >> 4, - cl.scores[num].colors & 0xf); - } } if (forcelink) { // didn't have an update last message @@ -1020,10 +1017,11 @@ CL_ParseServerMessage (void) "MAX_SCOREBOARD"); } else { entity_t *ent = &cl_entities[i+1]; - cl.scores[i].colors = MSG_ReadByte (net_message); + byte col = MSG_ReadByte (net_message); + if (col != cl.scores[i].colors) + Skin_SetTranslation (i, col >> 4, col & 0xf); + cl.scores[i].colors = col; ent->skin = Skin_SetColormap (ent->skin, i); - Skin_SetTranslation (i, cl.scores[i].colors >> 4, - cl.scores[i].colors & 0xf); } break;