From: havoc Date: Sun, 14 Aug 2005 16:36:55 +0000 (+0000) Subject: added cl_deathnoviewmodel, cl_deathscoreboard and cl_deathtilt cvars so that games... X-Git-Tag: xonotic-v0.1.0preview~4651 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=868e31d920af94a1a825dbbe24aa530f9927aceb;p=xonotic%2Fdarkplaces.git added cl_deathnoviewmodel, cl_deathscoreboard and cl_deathtilt cvars so that games can decide whether they want these behaviors git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5575 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_main.c b/cl_main.c index 632e1850..75ec3260 100644 --- a/cl_main.c +++ b/cl_main.c @@ -63,6 +63,8 @@ cvar_t cl_noplayershadow = {CVAR_SAVE, "cl_noplayershadow", "0"}; cvar_t cl_prydoncursor = {0, "cl_prydoncursor", "0"}; +cvar_t cl_deathnoviewmodel = {0, "cl_deathnoviewmodel", "1"}; + vec3_t cl_playerstandmins; vec3_t cl_playerstandmaxs; vec3_t cl_playercrouchmins; @@ -1010,7 +1012,7 @@ static void CL_RelinkNetworkEntities(void) ent->state_current.modelindex = cl.stats[STAT_WEAPON]; ent->state_current.frame = cl.stats[STAT_WEAPONFRAME]; ent->state_current.flags = RENDER_VIEWMODEL; - if (cl.stats[STAT_HEALTH] <= 0 || cl.intermission) + if ((cl.stats[STAT_HEALTH] <= 0 && cl_deathnoviewmodel.integer) || cl.intermission) ent->state_current.modelindex = 0; else if (cl.stats[STAT_ITEMS] & IT_INVISIBILITY) { @@ -1465,6 +1467,8 @@ void CL_Init (void) Cvar_RegisterVariable(&cl_prydoncursor); + Cvar_RegisterVariable(&cl_deathnoviewmodel); + Cmd_AddCommand("timerefresh", CL_TimeRefresh_f); CL_Parse_Init(); diff --git a/sbar.c b/sbar.c index 6c2c680d..fd544d8f 100644 --- a/sbar.c +++ b/sbar.c @@ -97,6 +97,8 @@ cvar_t showdate_format = {CVAR_SAVE, "showdate_format", "%Y-%m-%d"}; cvar_t sbar_alpha_bg = {CVAR_SAVE, "sbar_alpha_bg", "0.4"}; cvar_t sbar_alpha_fg = {CVAR_SAVE, "sbar_alpha_fg", "1"}; +cvar_t cl_deathscoreboard = {0, "cl_deathscoreboard", "1"}; + void Sbar_MiniDeathmatchOverlay (int x, int y); void Sbar_DeathmatchOverlay (void); void Sbar_IntermissionOverlay (void); @@ -329,6 +331,7 @@ void Sbar_Init (void) Cvar_RegisterVariable (&showdate_format); Cvar_RegisterVariable (&sbar_alpha_bg); Cvar_RegisterVariable (&sbar_alpha_fg); + Cvar_RegisterVariable (&cl_deathscoreboard); R_RegisterModule("sbar", sbar_start, sbar_shutdown, sbar_newmap); } @@ -913,7 +916,7 @@ void Sbar_Draw (void) if (gamemode == GAME_SOM) { - if (sb_showscores || cl.stats[STAT_HEALTH] <= 0) + if (sb_showscores || (cl.stats[STAT_HEALTH] <= 0 && cl_deathscoreboard.integer)) Sbar_DrawScoreboard (); else if (sb_lines) { @@ -956,7 +959,7 @@ void Sbar_Draw (void) sbar_y = vid_conheight.integer - 47; sbar_x = (vid_conwidth.integer - 640)/2; - if (sb_showscores || cl.stats[STAT_HEALTH] <= 0) + if (sb_showscores || (cl.stats[STAT_HEALTH] <= 0 && cl_deathscoreboard.integer)) { Sbar_DrawAlphaPic (0, 0, sb_scorebar, sbar_alpha_bg.value); Sbar_DrawScoreboard (); @@ -1050,7 +1053,7 @@ void Sbar_Draw (void) Sbar_DrawFrags (); } - if (sb_showscores || cl.stats[STAT_HEALTH] <= 0) + if (sb_showscores || (cl.stats[STAT_HEALTH] <= 0 && cl_deathscoreboard.integer)) { if (gamemode != GAME_GOODVSBAD2) Sbar_DrawAlphaPic (0, 0, sb_scorebar, sbar_alpha_bg.value); diff --git a/view.c b/view.c index 7b1ca6dd..c02459de 100644 --- a/view.c +++ b/view.c @@ -64,6 +64,8 @@ cvar_t chase_active = {CVAR_SAVE, "chase_active", "0"}; // GAME_GOODVSBAD2 cvar_t chase_stevie = {0, "chase_stevie", "0"}; +cvar_t cl_deathtilt = {0, "cl_deathtilt", "1"}; + float v_dmg_time, v_dmg_roll, v_dmg_pitch; @@ -385,7 +387,7 @@ void V_CalcRefdef (void) { // first person view from entity // angles - if (cl.stats[STAT_HEALTH] <= 0 && gamemode != GAME_FNIGGIUM) + if (cl.stats[STAT_HEALTH] <= 0 && cl_deathtilt.integer) viewangles[ROLL] = 80; // dead view angle VectorAdd(viewangles, cl.punchangle, viewangles); viewangles[ROLL] += V_CalcRoll(cl.viewangles, cl.movement_velocity); @@ -596,5 +598,7 @@ void V_Init (void) Cvar_RegisterVariable (&chase_active); if (gamemode == GAME_GOODVSBAD2) Cvar_RegisterVariable (&chase_stevie); + + Cvar_RegisterVariable (&cl_deathtilt.integer); }