view.c: Whitespace changes.

*/menu.c: Sliders update the string versions of cvars again. Also, UQ now
has config menu entries for the HUD.
This commit is contained in:
Jeff Teunissen 2000-03-20 14:24:20 +00:00
parent 93bd2a180c
commit 7167c5a749
3 changed files with 127 additions and 160 deletions

View File

@ -442,20 +442,17 @@ V_SetContentsColor (int contents)
return;
}
switch (contents)
{
case CONTENTS_SOLID:
#ifdef QUAKEWORLD
cl.cshifts[CSHIFT_CONTENTS] = cshift_slime;
#else
cl.cshifts[CSHIFT_CONTENTS] = cshift_empty;
#endif
switch (contents) {
case CONTENTS_EMPTY:
cl.cshifts[CSHIFT_CONTENTS] = cshift_empty;
break;
case CONTENTS_LAVA:
cl.cshifts[CSHIFT_CONTENTS] = cshift_lava;
break;
case CONTENTS_SOLID:
#ifdef UQUAKE
cl.cshifts[CSHIFT_CONTENTS] = cshift_empty;
#endif
case CONTENTS_SLIME:
cl.cshifts[CSHIFT_CONTENTS] = cshift_slime;
break;
@ -617,8 +614,6 @@ V_BoundOffsets ( void )
ent = &cl_entities[cl.playernum + 1];
#endif
// absolutely bound refresh reletive to entity clipping hull
// so the view can never be inside a solid wall
#ifdef QUAKEWORLD
if (r_refdef.vieworg[0] < cl.simorg[0] - 14)
@ -967,13 +962,15 @@ DropPunchAngle (void)
*/
extern vrect_t scr_vrect;
void V_RenderView (void)
void
V_RenderView (void)
{
#ifdef QUAKEWORLD
// if (cl.simangles[ROLL])
// Sys_Error ("cl.simangles[ROLL]"); // DEBUG
cl.simangles[ROLL] = 0; // FIXME
#endif
if (cls.state != ca_active)
return;
@ -982,8 +979,7 @@ cl.simangles[ROLL] = 0; // FIXME
view_message = &view_frame->playerstate[cl.playernum];
#else
// don't allow cheats in multiplayer
if (cl.maxclients > 1)
{
if (cl.maxclients > 1) {
Cvar_Set ("scr_ofsx", "0");
Cvar_Set ("scr_ofsy", "0");
Cvar_Set ("scr_ofsz", "0");

View File

@ -401,93 +401,69 @@ void M_Menu_Options_f (void)
}
void M_AdjustSliders (int dir)
void
M_AdjustSliders ( int dir )
{
S_LocalSound ("misc/menu3.wav");
switch (options_cursor)
{
switch (options_cursor) {
case 3: // screen size
scr_viewsize->value += dir * 10;
if (scr_viewsize->value < 30)
scr_viewsize->value = 30;
if (scr_viewsize->value > 120)
scr_viewsize->value = 120;
Cvar_Set("scr_viewsize", va("%d",
bound(30, scr_viewsize->value + (dir * 10), 120)));
break;
case 4: // gamma
v_gamma->value -= dir * 0.05;
if (v_gamma->value < 0.5)
v_gamma->value = 0.5;
if (v_gamma->value > 1)
v_gamma->value = 1;
Cvar_Set("v_gamma", va("%f",
bound(0.5, v_gamma->value - (dir * 0.05), 1)));
break;
case 5: // mouse speed
sensitivity->value += dir * 0.5;
if (sensitivity->value < 1)
sensitivity->value = 1;
if (sensitivity->value > 11)
sensitivity->value = 11;
Cvar_Set("sensitivity", va("%f",
bound(1, sensitivity->value + (dir * 0.05), 11)));
break;
case 6: // music volume
Cvar_Set("bgmvolume", va("%f",
#ifdef _WIN32
bgmvolume->value += dir * 1.0;
bound(0, bgmvolume->value + dir, 1)));
#else
bgmvolume->value += dir * 0.1;
bound(0, bgmvolume->value + (dir * 0.1), 1)));
#endif
if (bgmvolume->value < 0)
bgmvolume->value = 0;
if (bgmvolume->value > 1)
bgmvolume->value = 1;
break;
case 7: // sfx volume
volume->value += dir * 0.1;
if (volume->value < 0)
volume->value = 0;
if (volume->value > 1)
volume->value = 1;
Cvar_Set("volume", va("%f", bound(0, volume->value + (dir * 0.1), 1)));
break;
case 8: // allways run
if (cl_forwardspeed->value > 200)
{
cl_forwardspeed->value = 200;
cl_backspeed->value = 200;
}
else
{
cl_forwardspeed->value = 400;
cl_backspeed->value = 400;
if (cl_forwardspeed->value > 200) {
Cvar_Set("cl_forwardspeed", va("%d", 200));
Cvar_Set("cl_backspeed", va("%d", 200));
} else {
Cvar_Set("cl_forwardspeed", va("%d", 400));
Cvar_Set("cl_backspeed", va("%d", 400));
}
break;
case 9: // invert mouse
m_pitch->value = -m_pitch->value;
Cvar_Set("m_pitch", va("%d", -m_pitch->value));
break;
case 10: // lookspring
lookspring->value = !lookspring->value;
Cvar_Set("lookspring", va("%d", !lookspring->value));
break;
case 11: // lookstrafe
lookstrafe->value = !lookstrafe->value;
Cvar_Set("lookstrafe", va("%d", !lookstrafe->value));
break;
case 12:
cl_sbar->value = !cl_sbar->value;
case 12: // Use old-style sbar
Cvar_Set("cl_sbar", va("%d", !cl_sbar->value));
break;
case 13:
cl_hudswap->value = !cl_hudswap->value;
case 13: // HUD on left side
Cvar_Set("cl_hudswap", va("%d", !cl_hudswap->value));
break;
/*
default:
VID_ExtraOptionCmd(options_cursor + 2 - L_OPTIONS_ITEMS);
*/
//VID_ExtraOptionCmd(options_cursor + 2 - L_OPTIONS_ITEMS);
;
}
}

View File

@ -1111,75 +1111,64 @@ void M_Menu_Options_f (void)
}
void M_AdjustSliders (int dir)
void
M_AdjustSliders ( int dir )
{
S_LocalSound ("misc/menu3.wav");
switch (options_cursor)
{
switch (options_cursor) {
case 3: // screen size
scr_viewsize->value += dir * 10;
if (scr_viewsize->value < 30)
scr_viewsize->value = 30;
if (scr_viewsize->value > 120)
scr_viewsize->value = 120;
Cvar_Set("scr_viewsize", va("%d",
bound(30, scr_viewsize->value + (dir * 10), 120)));
break;
case 4: // gamma
v_gamma->value -= dir * 0.05;
if (v_gamma->value < 0.5)
v_gamma->value = 0.5;
if (v_gamma->value > 1)
v_gamma->value = 1;
Cvar_Set("v_gamma", va("%f",
bound(0.5, v_gamma->value - (dir * 0.05), 1)));
break;
case 5: // mouse speed
sensitivity->value += dir * 0.5;
if (sensitivity->value < 1)
sensitivity->value = 1;
if (sensitivity->value > 11)
sensitivity->value = 11;
Cvar_Set("sensitivity", va("%f",
bound(1, sensitivity->value + (dir * 0.05), 11)));
break;
case 6: // music volume
Cvar_Set("bgmvolume", va("%f",
#ifdef _WIN32
bgmvolume->value += dir * 1.0;
bound(0, bgmvolume->value + dir, 1)));
#else
bgmvolume->value += dir * 0.1;
bound(0, bgmvolume->value + (dir * 0.1), 1)));
#endif
if (bgmvolume->value < 0)
bgmvolume->value = 0;
if (bgmvolume->value > 1)
bgmvolume->value = 1;
break;
case 7: // sfx volume
volume->value += dir * 0.1;
if (volume->value < 0)
volume->value = 0;
if (volume->value > 1)
volume->value = 1;
Cvar_Set("volume", va("%f", bound(0, volume->value + (dir * 0.1), 1)));
break;
case 8: // allways run
if (cl_forwardspeed->value > 200)
{
cl_forwardspeed->value = 200;
cl_backspeed->value = 200;
}
else
{
cl_forwardspeed->value = 400;
cl_backspeed->value = 400;
if (cl_forwardspeed->value > 200) {
Cvar_Set("cl_forwardspeed", va("%d", 200));
Cvar_Set("cl_backspeed", va("%d", 200));
} else {
Cvar_Set("cl_forwardspeed", va("%d", 400));
Cvar_Set("cl_backspeed", va("%d", 400));
}
break;
case 9: // invert mouse
m_pitch->value = -m_pitch->value;
Cvar_Set("m_pitch", va("%d", -m_pitch->value));
break;
case 10: // lookspring
lookspring->value = !lookspring->value;
Cvar_Set("lookspring", va("%d", !lookspring->value));
break;
case 11: // lookstrafe
lookstrafe->value = !lookstrafe->value;
Cvar_Set("lookstrafe", va("%d", !lookstrafe->value));
break;
case 12: // Use old-style sbar
Cvar_Set("cl_sbar", va("%d", !cl_sbar->value));
break;
case 13: // HUD on left side
Cvar_Set("cl_hudswap", va("%d", !cl_hudswap->value));
break;
default:
@ -1259,6 +1248,12 @@ void M_Options_Draw (void)
M_Print (16, options_draw_cursor+=8, " Lookstrafe");
M_DrawCheckbox (220, options_draw_cursor, lookstrafe->value);
M_Print (16, options_draw_cursor+=8, " Use old status bar");
M_DrawCheckbox (220, options_draw_cursor, cl_sbar->value);
M_Print (16, options_draw_cursor+=8, " HUD on left side");
M_DrawCheckbox (220, options_draw_cursor, cl_hudswap->value);
//VID_ExtraOptionDraw(options_draw_cursor);
options_draw_cursor+=VID_options_items*8;