MCPcopy Create free account
hub / github.com/JACoders/OpenJK / UI_Update

Function UI_Update

code/ui/ui_main.cpp:3445–3580  ·  view source on GitHub ↗

================= UI_Update ================= */

Source from the content-addressed store, hash-verified

3443=================
3444*/
3445static void UI_Update(const char *name)
3446{
3447 int val = trap_Cvar_VariableValue(name);
3448
3449
3450 if (Q_stricmp(name, "s_khz") == 0)
3451 {
3452 ui.Cmd_ExecuteText( EXEC_APPEND, "snd_restart\n" );
3453 return;
3454 }
3455
3456 if (Q_stricmp(name, "ui_SetName") == 0)
3457 {
3458 Cvar_Set( "name", UI_Cvar_VariableString("ui_Name"));
3459 }
3460 else if (Q_stricmp(name, "ui_GetName") == 0)
3461 {
3462 Cvar_Set( "ui_Name", UI_Cvar_VariableString("name"));
3463 }
3464 else if (Q_stricmp(name, "ui_r_colorbits") == 0)
3465 {
3466 switch (val)
3467 {
3468 case 0:
3469 Cvar_SetValue( "ui_r_depthbits", 0 );
3470 break;
3471
3472 case 16:
3473 Cvar_SetValue( "ui_r_depthbits", 16 );
3474 break;
3475
3476 case 32:
3477 Cvar_SetValue( "ui_r_depthbits", 24 );
3478 break;
3479 }
3480 }
3481 else if (Q_stricmp(name, "ui_r_lodbias") == 0)
3482 {
3483 switch (val)
3484 {
3485 case 0:
3486 Cvar_SetValue( "ui_r_subdivisions", 4 );
3487 break;
3488 case 1:
3489 Cvar_SetValue( "ui_r_subdivisions", 12 );
3490 break;
3491
3492 case 2:
3493 Cvar_SetValue( "ui_r_subdivisions", 20 );
3494 break;
3495 }
3496 }
3497 else if (Q_stricmp(name, "ui_r_glCustom") == 0)
3498 {
3499 switch (val)
3500 {
3501 case 0: // high quality
3502

Callers 1

UI_RunMenuScriptFunction · 0.70

Calls 6

Q_stricmpFunction · 0.85
trap_Cvar_VariableValueFunction · 0.70
UI_Cvar_VariableStringFunction · 0.70
Cvar_SetFunction · 0.50
Cvar_SetValueFunction · 0.50
Com_PrintfFunction · 0.50

Tested by

no test coverage detected