/* * @brief An updated configuration string has just been received from the server. * Refresh related variables and media that aren't managed by the engine. */ static void Cg_UpdateConfigString(uint16_t i) { const char *s = cgi.ConfigString(i); if (i == CS_WEATHER) { Cg_ResolveWeather(s); } if (i >= CS_CLIENTS && i < CS_CLIENTS + MAX_CLIENTS) { cl_client_info_t *ci = &cgi.client->client_info[i - CS_CLIENTS]; Cg_LoadClient(ci, s); } }
/** * @see View::updateBindings(View *) */ static void updateBindings(View *self) { super(View, self, updateBindings); PlayerModelView *this = (PlayerModelView *) self; char string[MAX_STRING_CHARS]; g_snprintf(string, sizeof(string), "newbie\\%s", cg_skin->string); Cg_LoadClient(&this->client, string); this->legs.model = this->client.legs; this->legs.scale = 1.0; this->legs.effects = EF_NO_LIGHTING; Vector4Set(this->legs.color, 1.0, 1.0, 1.0, 1.0); this->torso.model = this->client.torso; this->torso.parent = &this->legs; this->torso.scale = 1.0; this->torso.tag_name = "tag_torso"; this->torso.effects = EF_NO_LIGHTING; Vector4Set(this->torso.color, 1.0, 1.0, 1.0, 1.0); this->head.model = this->client.head; this->head.parent = &this->torso; this->head.scale = 1.0; this->head.tag_name = "tag_head"; this->head.effects = EF_NO_LIGHTING; Vector4Set(this->head.color, 1.0, 1.0, 1.0, 1.0); this->weapon.model = cgi.LoadModel("models/weapons/rocketlauncher/tris"); this->weapon.parent = &this->torso; this->weapon.scale = 1.0; this->weapon.tag_name = "tag_weapon"; this->weapon.effects = EF_NO_LIGHTING; Vector4Set(this->weapon.color, 1.0, 1.0, 1.0, 1.0); memcpy(this->legs.skins, this->client.legs_skins, sizeof(this->legs.skins)); memcpy(this->torso.skins, this->client.torso_skins, sizeof(this->torso.skins)); memcpy(this->head.skins, this->client.head_skins, sizeof(this->head.skins)); this->iconView->texture = this->client.icon->texnum; }