mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2024-11-10 14:42:06 +00:00
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:
parent
93bd2a180c
commit
7167c5a749
3 changed files with 127 additions and 160 deletions
|
@ -442,25 +442,22 @@ V_SetContentsColor (int contents)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (contents)
|
switch (contents) {
|
||||||
{
|
case CONTENTS_EMPTY:
|
||||||
case CONTENTS_SOLID:
|
cl.cshifts[CSHIFT_CONTENTS] = cshift_empty;
|
||||||
#ifdef QUAKEWORLD
|
break;
|
||||||
cl.cshifts[CSHIFT_CONTENTS] = cshift_slime;
|
case CONTENTS_LAVA:
|
||||||
#else
|
cl.cshifts[CSHIFT_CONTENTS] = cshift_lava;
|
||||||
cl.cshifts[CSHIFT_CONTENTS] = cshift_empty;
|
break;
|
||||||
|
case CONTENTS_SOLID:
|
||||||
|
#ifdef UQUAKE
|
||||||
|
cl.cshifts[CSHIFT_CONTENTS] = cshift_empty;
|
||||||
#endif
|
#endif
|
||||||
case CONTENTS_EMPTY:
|
case CONTENTS_SLIME:
|
||||||
cl.cshifts[CSHIFT_CONTENTS] = cshift_empty;
|
cl.cshifts[CSHIFT_CONTENTS] = cshift_slime;
|
||||||
break;
|
break;
|
||||||
case CONTENTS_LAVA:
|
default:
|
||||||
cl.cshifts[CSHIFT_CONTENTS] = cshift_lava;
|
cl.cshifts[CSHIFT_CONTENTS] = cshift_water;
|
||||||
break;
|
|
||||||
case CONTENTS_SLIME:
|
|
||||||
cl.cshifts[CSHIFT_CONTENTS] = cshift_slime;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
cl.cshifts[CSHIFT_CONTENTS] = cshift_water;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (v_contentblend->value > 0 && v_contentblend->value < 1)
|
if (v_contentblend->value > 0 && v_contentblend->value < 1)
|
||||||
|
@ -617,8 +614,6 @@ V_BoundOffsets ( void )
|
||||||
|
|
||||||
ent = &cl_entities[cl.playernum + 1];
|
ent = &cl_entities[cl.playernum + 1];
|
||||||
#endif
|
#endif
|
||||||
// absolutely bound refresh reletive to entity clipping hull
|
|
||||||
// so the view can never be inside a solid wall
|
|
||||||
|
|
||||||
#ifdef QUAKEWORLD
|
#ifdef QUAKEWORLD
|
||||||
if (r_refdef.vieworg[0] < cl.simorg[0] - 14)
|
if (r_refdef.vieworg[0] < cl.simorg[0] - 14)
|
||||||
|
@ -967,13 +962,15 @@ DropPunchAngle (void)
|
||||||
*/
|
*/
|
||||||
extern vrect_t scr_vrect;
|
extern vrect_t scr_vrect;
|
||||||
|
|
||||||
void V_RenderView (void)
|
void
|
||||||
|
V_RenderView (void)
|
||||||
{
|
{
|
||||||
#ifdef QUAKEWORLD
|
#ifdef QUAKEWORLD
|
||||||
// if (cl.simangles[ROLL])
|
// if (cl.simangles[ROLL])
|
||||||
// Sys_Error ("cl.simangles[ROLL]"); // DEBUG
|
// Sys_Error ("cl.simangles[ROLL]"); // DEBUG
|
||||||
cl.simangles[ROLL] = 0; // FIXME
|
cl.simangles[ROLL] = 0; // FIXME
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (cls.state != ca_active)
|
if (cls.state != ca_active)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -982,8 +979,7 @@ cl.simangles[ROLL] = 0; // FIXME
|
||||||
view_message = &view_frame->playerstate[cl.playernum];
|
view_message = &view_frame->playerstate[cl.playernum];
|
||||||
#else
|
#else
|
||||||
// don't allow cheats in multiplayer
|
// don't allow cheats in multiplayer
|
||||||
if (cl.maxclients > 1)
|
if (cl.maxclients > 1) {
|
||||||
{
|
|
||||||
Cvar_Set ("scr_ofsx", "0");
|
Cvar_Set ("scr_ofsx", "0");
|
||||||
Cvar_Set ("scr_ofsy", "0");
|
Cvar_Set ("scr_ofsy", "0");
|
||||||
Cvar_Set ("scr_ofsz", "0");
|
Cvar_Set ("scr_ofsz", "0");
|
||||||
|
|
124
qw_client/menu.c
124
qw_client/menu.c
|
@ -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");
|
S_LocalSound ("misc/menu3.wav");
|
||||||
|
|
||||||
switch (options_cursor)
|
switch (options_cursor) {
|
||||||
{
|
case 3: // screen size
|
||||||
case 3: // screen size
|
Cvar_Set("scr_viewsize", va("%d",
|
||||||
scr_viewsize->value += dir * 10;
|
bound(30, scr_viewsize->value + (dir * 10), 120)));
|
||||||
if (scr_viewsize->value < 30)
|
break;
|
||||||
scr_viewsize->value = 30;
|
case 4: // gamma
|
||||||
if (scr_viewsize->value > 120)
|
Cvar_Set("v_gamma", va("%f",
|
||||||
scr_viewsize->value = 120;
|
bound(0.5, v_gamma->value - (dir * 0.05), 1)));
|
||||||
|
break;
|
||||||
break;
|
case 5: // mouse speed
|
||||||
case 4: // gamma
|
Cvar_Set("sensitivity", va("%f",
|
||||||
v_gamma->value -= dir * 0.05;
|
bound(1, sensitivity->value + (dir * 0.05), 11)));
|
||||||
if (v_gamma->value < 0.5)
|
break;
|
||||||
v_gamma->value = 0.5;
|
case 6: // music volume
|
||||||
if (v_gamma->value > 1)
|
Cvar_Set("bgmvolume", va("%f",
|
||||||
v_gamma->value = 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;
|
|
||||||
|
|
||||||
break;
|
|
||||||
case 6: // music volume
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
bgmvolume->value += dir * 1.0;
|
bound(0, bgmvolume->value + dir, 1)));
|
||||||
#else
|
#else
|
||||||
bgmvolume->value += dir * 0.1;
|
bound(0, bgmvolume->value + (dir * 0.1), 1)));
|
||||||
#endif
|
#endif
|
||||||
if (bgmvolume->value < 0)
|
break;
|
||||||
bgmvolume->value = 0;
|
case 7: // sfx volume
|
||||||
if (bgmvolume->value > 1)
|
Cvar_Set("volume", va("%f", bound(0, volume->value + (dir * 0.1), 1)));
|
||||||
bgmvolume->value = 1;
|
break;
|
||||||
|
|
||||||
break;
|
case 8: // allways run
|
||||||
case 7: // sfx volume
|
if (cl_forwardspeed->value > 200) {
|
||||||
volume->value += dir * 0.1;
|
Cvar_Set("cl_forwardspeed", va("%d", 200));
|
||||||
if (volume->value < 0)
|
Cvar_Set("cl_backspeed", va("%d", 200));
|
||||||
volume->value = 0;
|
} else {
|
||||||
if (volume->value > 1)
|
Cvar_Set("cl_forwardspeed", va("%d", 400));
|
||||||
volume->value = 1;
|
Cvar_Set("cl_backspeed", va("%d", 400));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
break;
|
case 9: // invert mouse
|
||||||
|
Cvar_Set("m_pitch", va("%d", -m_pitch->value));
|
||||||
|
break;
|
||||||
|
|
||||||
case 8: // allways run
|
case 10: // lookspring
|
||||||
if (cl_forwardspeed->value > 200)
|
Cvar_Set("lookspring", va("%d", !lookspring->value));
|
||||||
{
|
break;
|
||||||
cl_forwardspeed->value = 200;
|
|
||||||
cl_backspeed->value = 200;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cl_forwardspeed->value = 400;
|
|
||||||
cl_backspeed->value = 400;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 9: // invert mouse
|
case 11: // lookstrafe
|
||||||
m_pitch->value = -m_pitch->value;
|
Cvar_Set("lookstrafe", va("%d", !lookstrafe->value));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 10: // lookspring
|
case 12: // Use old-style sbar
|
||||||
lookspring->value = !lookspring->value;
|
Cvar_Set("cl_sbar", va("%d", !cl_sbar->value));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 11: // lookstrafe
|
case 13: // HUD on left side
|
||||||
lookstrafe->value = !lookstrafe->value;
|
Cvar_Set("cl_hudswap", va("%d", !cl_hudswap->value));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 12:
|
|
||||||
cl_sbar->value = !cl_sbar->value;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 13:
|
|
||||||
cl_hudswap->value = !cl_hudswap->value;
|
|
||||||
|
|
||||||
/*
|
|
||||||
default:
|
|
||||||
VID_ExtraOptionCmd(options_cursor + 2 - L_OPTIONS_ITEMS);
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
default:
|
||||||
|
//VID_ExtraOptionCmd(options_cursor + 2 - L_OPTIONS_ITEMS);
|
||||||
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
121
uquake/menu.c
121
uquake/menu.c
|
@ -1111,80 +1111,69 @@ void M_Menu_Options_f (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void M_AdjustSliders (int dir)
|
void
|
||||||
|
M_AdjustSliders ( int dir )
|
||||||
{
|
{
|
||||||
S_LocalSound ("misc/menu3.wav");
|
S_LocalSound ("misc/menu3.wav");
|
||||||
|
|
||||||
switch (options_cursor)
|
switch (options_cursor) {
|
||||||
{
|
case 3: // screen size
|
||||||
case 3: // screen size
|
Cvar_Set("scr_viewsize", va("%d",
|
||||||
scr_viewsize->value += dir * 10;
|
bound(30, scr_viewsize->value + (dir * 10), 120)));
|
||||||
if (scr_viewsize->value < 30)
|
break;
|
||||||
scr_viewsize->value = 30;
|
case 4: // gamma
|
||||||
if (scr_viewsize->value > 120)
|
Cvar_Set("v_gamma", va("%f",
|
||||||
scr_viewsize->value = 120;
|
bound(0.5, v_gamma->value - (dir * 0.05), 1)));
|
||||||
break;
|
break;
|
||||||
case 4: // gamma
|
case 5: // mouse speed
|
||||||
v_gamma->value -= dir * 0.05;
|
Cvar_Set("sensitivity", va("%f",
|
||||||
if (v_gamma->value < 0.5)
|
bound(1, sensitivity->value + (dir * 0.05), 11)));
|
||||||
v_gamma->value = 0.5;
|
break;
|
||||||
if (v_gamma->value > 1)
|
case 6: // music volume
|
||||||
v_gamma->value = 1;
|
Cvar_Set("bgmvolume", va("%f",
|
||||||
break;
|
|
||||||
case 5: // mouse speed
|
|
||||||
sensitivity->value += dir * 0.5;
|
|
||||||
if (sensitivity->value < 1)
|
|
||||||
sensitivity->value = 1;
|
|
||||||
if (sensitivity->value > 11)
|
|
||||||
sensitivity->value = 11;
|
|
||||||
break;
|
|
||||||
case 6: // music volume
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
bgmvolume->value += dir * 1.0;
|
bound(0, bgmvolume->value + dir, 1)));
|
||||||
#else
|
#else
|
||||||
bgmvolume->value += dir * 0.1;
|
bound(0, bgmvolume->value + (dir * 0.1), 1)));
|
||||||
#endif
|
#endif
|
||||||
if (bgmvolume->value < 0)
|
break;
|
||||||
bgmvolume->value = 0;
|
case 7: // sfx volume
|
||||||
if (bgmvolume->value > 1)
|
Cvar_Set("volume", va("%f", bound(0, volume->value + (dir * 0.1), 1)));
|
||||||
bgmvolume->value = 1;
|
break;
|
||||||
break;
|
|
||||||
case 7: // sfx volume
|
|
||||||
volume->value += dir * 0.1;
|
|
||||||
if (volume->value < 0)
|
|
||||||
volume->value = 0;
|
|
||||||
if (volume->value > 1)
|
|
||||||
volume->value = 1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 8: // allways run
|
case 8: // allways run
|
||||||
if (cl_forwardspeed->value > 200)
|
if (cl_forwardspeed->value > 200) {
|
||||||
{
|
Cvar_Set("cl_forwardspeed", va("%d", 200));
|
||||||
cl_forwardspeed->value = 200;
|
Cvar_Set("cl_backspeed", va("%d", 200));
|
||||||
cl_backspeed->value = 200;
|
} else {
|
||||||
}
|
Cvar_Set("cl_forwardspeed", va("%d", 400));
|
||||||
else
|
Cvar_Set("cl_backspeed", va("%d", 400));
|
||||||
{
|
}
|
||||||
cl_forwardspeed->value = 400;
|
break;
|
||||||
cl_backspeed->value = 400;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 9: // invert mouse
|
case 9: // invert mouse
|
||||||
m_pitch->value = -m_pitch->value;
|
Cvar_Set("m_pitch", va("%d", -m_pitch->value));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 10: // lookspring
|
case 10: // lookspring
|
||||||
lookspring->value = !lookspring->value;
|
Cvar_Set("lookspring", va("%d", !lookspring->value));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 11: // lookstrafe
|
case 11: // lookstrafe
|
||||||
lookstrafe->value = !lookstrafe->value;
|
Cvar_Set("lookstrafe", va("%d", !lookstrafe->value));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
case 12: // Use old-style sbar
|
||||||
//VID_ExtraOptionCmd(options_cursor + 2 - L_OPTIONS_ITEMS);
|
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:
|
||||||
|
//VID_ExtraOptionCmd(options_cursor + 2 - L_OPTIONS_ITEMS);
|
||||||
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1259,6 +1248,12 @@ void M_Options_Draw (void)
|
||||||
M_Print (16, options_draw_cursor+=8, " Lookstrafe");
|
M_Print (16, options_draw_cursor+=8, " Lookstrafe");
|
||||||
M_DrawCheckbox (220, options_draw_cursor, lookstrafe->value);
|
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);
|
//VID_ExtraOptionDraw(options_draw_cursor);
|
||||||
options_draw_cursor+=VID_options_items*8;
|
options_draw_cursor+=VID_options_items*8;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue