remove cl_predict_players2, slightly more menu work

git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3817 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2011-06-15 23:01:07 +00:00
parent 4264bb8d48
commit b0124c7df5
5 changed files with 131 additions and 61 deletions

View File

@ -24,7 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "shader.h"
extern cvar_t cl_predict_players;
extern cvar_t cl_predict_players2;
extern cvar_t cl_solid_players;
extern cvar_t cl_item_bobbing;
@ -2859,7 +2858,7 @@ void CL_LinkPlayers (void)
frame = &cl.frames[cl.validsequence&UPDATE_MASK];
fromf = &cl.frames[cl.oldvalidsequence&UPDATE_MASK];
predictplayers = cl_predict_players.ival || cl_predict_players2.ival;
predictplayers = cl_predict_players.ival;
if (cls.demoplayback == DPB_MVD || cls.demoplayback == DPB_EZTV)
predictplayers = false;
@ -3346,7 +3345,7 @@ void CL_SetUpPlayerPrediction(qboolean dopred)
// only predict half the move to minimize overruns
msec = 500*(playertime - state->state_time);
if (msec <= 0 ||
(!cl_predict_players.ival && !cl_predict_players2.ival) ||
!cl_predict_players.ival ||
!dopred)
{
VectorCopy (state->origin, pplayer->origin);

View File

@ -71,7 +71,6 @@ cvar_t m_side = CVARF("m_side","0.8", CVAR_ARCHIVE);
cvar_t entlatency = CVAR("entlatency", "20");
cvar_t cl_predict_players = CVAR("cl_predict_players", "1");
cvar_t cl_predict_players2 = CVAR("cl_predict_players2", "1");
cvar_t cl_solid_players = CVAR("cl_solid_players", "1");
cvar_t cl_noblink = CVAR("cl_noblink", "0");
cvar_t cl_servername = CVAR("cl_servername", "none");
@ -2999,7 +2998,6 @@ void CL_Init (void)
Cvar_Register (&rcon_address, cl_controlgroup);
Cvar_Register (&entlatency, cl_predictiongroup);
Cvar_Register (&cl_predict_players2, cl_predictiongroup);
Cvar_Register (&cl_predict_players, cl_predictiongroup);
Cvar_Register (&cl_solid_players, cl_predictiongroup);

View File

@ -324,7 +324,8 @@ void M_Menu_Setup_f (void)
setupmenu_t *info;
menu_t *menu;
menucustom_t *ci;
char *classnames[] =
menubutton_t *b;
static const char *classnames[] =
{
"Paladin",
"Crusader",
@ -339,7 +340,7 @@ void M_Menu_Setup_f (void)
{
if (R2D_SafeCachePic("pics/m_banner_plauer_setup"))
{
char *modeloptions[] =
static const char *modeloptions[] =
{
"male",
"female",
@ -427,8 +428,10 @@ void M_Menu_Setup_f (void)
MC_AddCommand(menu, 64, 120, "Lower colour", SetupMenuColour);
MC_AddCommand(menu, 64, 152, "Accept changes", ApplySetupMenu);
MC_AddConsoleCommand(menu, 64, 168, "Teamplay Settings", "menu_teamplay\n");
b = MC_AddConsoleCommand(menu, 64, 168, "Network Settings", "menu_network\n");
b->common.tooltip = "Change network and client prediction settings.";
b = MC_AddConsoleCommand(menu, 64, 176, "Teamplay Settings", "menu_teamplay\n");
b->common.tooltip = "Change teamplay macro settings.";
menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 54, 32, NULL, false);
@ -490,7 +493,7 @@ typedef struct {
int lowercolour;
} newmultimenu_t;
static char *numplayeroptions[] = {
static const char *numplayeroptions[] = {
"2",
"3",
"4",
@ -539,7 +542,7 @@ qboolean MultiBeginGame (union menuoption_s *option,struct menu_s *menu, int key
void M_Menu_GameOptions_f (void)
{
extern cvar_t pr_maxedicts;
static char *deathmatchoptions[] = {
static const char *deathmatchoptions[] = {
"Cooperative",
"Deathmatch 1",
"Deathmatch 2",
@ -548,20 +551,20 @@ void M_Menu_GameOptions_f (void)
"Deathmatch 5",
NULL
};
static char *teamplayoptions[] = {
static const char *teamplayoptions[] = {
"off",
"friendly fire",
"no friendly fire",
NULL
};
static char *skilloptions[] = {
static const char *skilloptions[] = {
"Easy",
"Medium",
"Hard",
"NIGHTMARE",
NULL
};
static char *timelimitoptions[] = {
static const char *timelimitoptions[] = {
"no limit",
"5 minutes",
"10 minutes",
@ -577,7 +580,7 @@ void M_Menu_GameOptions_f (void)
"1 hour",
NULL
};
static char *fraglimitoptions[] = {
static const char *fraglimitoptions[] = {
"no limit",
"10 frags",
"20 frags",
@ -921,3 +924,38 @@ void M_Menu_Teamplay_Items_Status_Location_Misc_f (void)
menu = M_Options_Title(&y, 0);
MC_AddBulk(menu, bulk, 16, 200, y);
}
void M_Menu_Network_f (void)
{
static const char *splitopts[] = {
"Disabled",
"2 Screens",
"3 Screens",
"4 Screens",
NULL
};
static const char *splitvalues[] = {"0", "1", "2", "3", NULL};
extern cvar_t allow_download_csprogs, allow_download_redirection, requiredownloads, cl_solid_players;
extern cvar_t cl_splitscreen, cl_predict_players;
menu_t *menu;
int y;
menubulk_t bulk[] =
{
MB_REDTEXT("Network Settings", false),
MB_TEXT("\x80\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x82", false),
MB_EDITCVARSLIM("Network FPS", "cl_netfps"),
MB_EDITCVARSLIM("Rate", "rate"),
MB_EDITCVARSLIM("Download Rate", "drate"),
MB_SPACING(4),
MB_CHECKBOXCVAR("Require Download", requiredownloads, 0),
MB_CHECKBOXCVAR("Redirect Download", allow_download_redirection, 0),
MB_CHECKBOXCVAR("Download CSQC", allow_download_redirection, 0),
MB_SPACING(4),
MB_CHECKBOXCVAR("Predict Players", cl_predict_players, 0),
MB_CHECKBOXCVAR("Solid Players", cl_solid_players, 0),
MB_COMBOCVAR("Split-screen", cl_splitscreen, splitopts, splitvalues, "Enables split screen with a number of clients. This feature requires server support."),
MB_END()
};
menu = M_Options_Title(&y, 0);
MC_AddBulk(menu, bulk, 16, 200, y);
}

View File

@ -64,7 +64,7 @@ qboolean M_Options_InvertMouse (menucheck_t *option, struct menu_s *menu, chk_se
//options menu.
void M_Menu_Options_f (void)
{
extern cvar_t cl_standardchat, cl_splitscreen;
extern cvar_t cl_standardchat;
extern cvar_t cl_standardmsg, crosshair;
#ifdef _WIN32
extern qboolean vid_isfullscreen;
@ -85,9 +85,7 @@ void M_Menu_Options_f (void)
MB_CHECKBOXCVAR("Lookstrafe", lookstrafe, 0),
MB_CHECKBOXCVAR("Windowed Mouse", _windowed_mouse, 0),
MB_SPACING(4),
// removed splitscreen (move this option somewhere else, multiplayer settings?)
// removed hud options (cl_sbar, cl_hudswap, old-style chat, old-style msg)
// removed cl_netfps (move this to multiplayer network settings)
MB_CONSOLECMD("Video Options", "menu_video\n", "Set video resolution, color depth, refresh rate, and anti-aliasing options."),
MB_CONSOLECMD("Audio Options", "menu_audio\n", "Set audio quality and speaker setup options."),
MB_SPACING(4),
@ -480,6 +478,11 @@ const char *presetexec[] =
"gl_texture_anisotropic_filtering 16;"
};
typedef struct fpsmenuinfo_s
{
menucombo_t *preset;
} fpsmenuinfo_t;
static void ApplyPreset (int presetnum)
{
int i;
@ -512,43 +515,73 @@ void FPS_Preset_f (void)
Con_Printf("%s\n", presetname[i]);
}
qboolean M_PresetApply (union menuoption_s *op, struct menu_s *menu, int key)
{
fpsmenuinfo_t *info = (fpsmenuinfo_t*)menu->data;
if (key != K_ENTER && key != K_MOUSE1)
return false;
Cbuf_AddText("fps_preset ", RESTRICT_LOCAL);
Cbuf_AddText(info->preset->options[info->preset->selectedoption], RESTRICT_LOCAL);
Cbuf_AddText("\n", RESTRICT_LOCAL);
return true;
}
void M_Menu_FPS_f (void)
{
static const char *fpsopts[] =
{
"Disabled",
"Average FPS",
"Worst FPS",
"Best FPS",
"Immediate FPS",
"Average MSEC",
"Worst MSEC",
"Best MSEC",
"Immediate MSEC",
NULL
};
static const char *fpsvalues[] = {"0", "1", "2", "3", "4", "-1", "-2", "-3", "-4", NULL};
static const char *bodyopts[] =
{
"Disabled",
"Ground",
"All",
NULL
};
static const char *bodyvalues[] = {"0", "1", "2", NULL};
menu_t *menu;
int cursorpositionY;
int i, len;
fpsmenuinfo_t *info;
extern cvar_t v_contentblend, show_fps, cl_r2g, cl_gibfilter, cl_expsprite, cl_deadbodyfilter;
int y;
menu = M_Options_Title(&y, 0);
menu = M_Options_Title(&y, sizeof(fpsmenuinfo_t));
info = (fpsmenuinfo_t *)menu->data;
cursorpositionY = (y + 24);
menu->selecteditem = (union menuoption_s *)
MC_AddRedText(menu, 16, y, " FPS Options", false); y+=8;
MC_AddWhiteText(menu, 16, y, "<><E282AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ", false); y+=8;
y+=8;
// add vsync?
// maxfps?
for (i = 0; i < PRESET_NUM; i++)
{
len = strlen(presetname[i]);
MC_AddConsoleCommand(menu, 116, y, va("(preset) %s", presetname[i]), va("fps_preset %s\n", presetname[i])); y+=8;
menubulk_t bulk[] =
{
MB_REDTEXT("FPS Options", false),
MB_TEXT("\x80\x81\x81\x81\x81\x81\x81\x81\x81\x81\x82", false),
MB_COMBORETURN("Preset", presetname, 2, info->preset, "Select a builtin configuration of graphical settings."),
MB_CMD("Apply", M_PresetApply, "Applies selected preset."),
MB_SPACING(4),
MB_COMBOCVAR("Show FPS", show_fps, fpsopts, fpsvalues, "Display FPS or frame millisecond values on screen. Settings except immediate are for values across 1 second."),
MB_CHECKBOXCVAR("Content Blend", v_contentblend, 0),
MB_CHECKBOXCVAR("Gib Filter", cl_gibfilter, 0),
MB_COMBOCVAR("Dead Body Filter", cl_deadbodyfilter, bodyopts, bodyvalues, "Selects which dead player frames to filter out in rendering. Ground frames are those of the player lying on the ground, and all frames include all used in the player dying animation."),
MB_CHECKBOXCVAR("Explosion Sprite", cl_expsprite, 0),
MB_CHECKBOXCVAR("Rockets to Grenades", cl_r2g, 0),
MB_EDITCVAR("Skybox", "r_skybox"),
MB_END()
};
MC_AddBulk(menu, bulk, 16, 216, y);
}
MC_AddCheckBox(menu, 16, y, " Show FPS", &show_fps,0);y+=8;
MC_AddCheckBox(menu, 16, y, " Content blend", &v_contentblend,0);y+=8;
MC_AddCheckBox(menu, 16, y, " Gib Filter", &cl_gibfilter,0); y+=8;
MC_AddSlider(menu, 16, y, " Dead Body Filter", &cl_deadbodyfilter,0,2,1); y+=8;
MC_AddCheckBox(menu, 16, y, " Explosion Sprite", &cl_expsprite,0); y+=8;
y+=4;MC_AddEditCvar(menu, 16, y, " Skybox", "r_skybox");y+=8;y+=4;
MC_AddCheckBox(menu, 16, y, " Rockets to Grenades", &cl_r2g,0); y+=8;
menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 188, cursorpositionY, NULL, false);
}
void M_Menu_Render_f (void)
@ -675,8 +708,8 @@ void M_Menu_Textures_f (void)
MB_CHECKBOXCVAR("Load Replacements", gl_load24bit, 0),
MB_CHECKBOXCVAR("Simple Texturing", r_drawflat, 0),
#ifdef GLQUAKE
MB_COMBOCVAR("3D Filter Mode", gl_texturemode, texturefilternames, texturefiltervalues, NULL),
MB_COMBOCVAR("2D Filter Mode", gl_texturemode2d, texture2dfilternames, texture2dfiltervalues, NULL),
MB_COMBOCVAR("3D Filter Mode", gl_texturemode, texturefilternames, texturefiltervalues, "Chooses the texture filtering method used for 3D objects."),
MB_COMBOCVAR("2D Filter Mode", gl_texturemode2d, texture2dfilternames, texture2dfiltervalues, "Chooses the texture filtering method used for HUD, menus, and other 2D assets."),
MB_COMBOCVAR("Anisotropy", gl_texture_anisotropic_filtering, anisotropylevels, anisotropyvalues, NULL),
#endif
MB_SPACING(4),
@ -894,7 +927,7 @@ void M_Menu_Lighting_f (void)
MB_COMBOCVAR("Flash Blend", r_flashblend, fbopts, fbvalues, "Disables or enables the spherical light effect for dynamic lights. Traced means the sphere effect will be line of sight checked before displaying the effect."),
MB_SLIDER("Explosion Light", r_explosionlight, 0, 1, 0.1, NULL),
MB_SLIDER("Rocket Light", r_rocketlight, 0, 1, 0.1, NULL),
MB_COMBOCVAR("Powerup Glow", r_powerupglow, powerupopts, powerupvalues, ""),
MB_COMBOCVAR("Powerup Glow", r_powerupglow, powerupopts, powerupvalues, "Disables or enables the dynamic light effect for powerups. Non-self will disable the light only for the current player."),
MB_CHECKBOXCVAR("Powerup Shell", v_powerupshell, 0),
MB_SPACING(4),
MB_SLIDER("Stains", r_stains, 0, 1, 0.05, NULL),
@ -1868,7 +1901,7 @@ int M_MatchModes(int width, int height, int *outres)
return ratio;
}
qboolean M_VideoApply (union menuoption_s *op,struct menu_s *menu,int key)
qboolean M_VideoApply (union menuoption_s *op, struct menu_s *menu, int key)
{
extern cvar_t vid_desktopsettings;
videomenuinfo_t *info = (videomenuinfo_t*)menu->data;
@ -2102,17 +2135,17 @@ void M_Menu_Video_f (void)
MB_CHECKBOXCVAR("Fullscreen", vid_fullscreen, 0),
MB_COMBOCVAR("Anti-aliasing", vid_multisample, aaopts, aavalues, NULL),
MB_REDTEXT(current3dres, false),
MB_COMBORETURN("Display Mode", resmodeopts, resmodechoice, info->resmode, NULL),
MB_COMBORETURN("Display Mode", resmodeopts, resmodechoice, info->resmode, "Select method for determining or configuring display options. The desktop option will attempt to use the width, height, color depth, and refresh from your operating system's desktop environment."),
// aspect entries
MB_COMBORETURN("Size", resaspects[0], reschoices[0], info->ressize[0], NULL),
MB_COMBORETURN("Size", resaspects[0], reschoices[0], info->ressize[0], "Select resolution for display."),
MB_SPACING(-8),
MB_COMBORETURN("Size", resaspects[1], reschoices[1], info->ressize[1], NULL),
MB_COMBORETURN("Size", resaspects[1], reschoices[1], info->ressize[1], "Select resolution for display."),
MB_SPACING(-8),
MB_COMBORETURN("Size", resaspects[2], reschoices[2], info->ressize[2], NULL),
MB_COMBORETURN("Size", resaspects[2], reschoices[2], info->ressize[2], "Select resolution for display."),
MB_SPACING(-8),
MB_COMBORETURN("Size", resaspects[3], reschoices[3], info->ressize[3], NULL),
MB_COMBOCVARRETURN("Color Depth", vid_bpp, bppopts, bppvalues, info->bppfixed, NULL),
MB_COMBOCVARRETURN("Refresh Rate", vid_refreshrate, refreshopts, refreshvalues, info->hzfixed, NULL),
MB_COMBORETURN("Size", resaspects[3], reschoices[3], info->ressize[3], "Select resolution for display."),
MB_COMBOCVARRETURN("Color Depth", vid_bpp, bppopts, bppvalues, info->bppfixed, vid_bpp.description),
MB_COMBOCVARRETURN("Refresh Rate", vid_refreshrate, refreshopts, refreshvalues, info->hzfixed, vid_refreshrate.description),
MB_SPACING(-24), // really hacky...
// custom enteries
MB_EDITCVARSLIMRETURN("Width", "vid_width", info->width),
@ -2120,24 +2153,24 @@ void M_Menu_Video_f (void)
MB_EDITCVARSLIMRETURN("Color Depth", "vid_bpp", info->bpp),
MB_EDITCVARSLIMRETURN("Refresh Rate", "vid_refreshrate", info->hz),
MB_SPACING(4),
MB_COMBORETURN("2D Mode", res2dmodeopts, res2dmodechoice, info->res2dmode, NULL),
MB_COMBORETURN("2D Mode", res2dmodeopts, res2dmodechoice, info->res2dmode, "Select method for determining or configuring 2D resolution and scaling. The default option matches the current display resolution, and the scale option scales by a factor of the display resolution."),
// scale entry
MB_COMBOCVARRETURN("Amount", vid_conautoscale, scaleopts, scalevalues, info->scale, NULL),
MB_SPACING(-8),
// 2d aspect entries
MB_COMBORETURN("Size", resaspects[0], res2dchoices[0], info->res2dsize[0], NULL),
MB_COMBORETURN("Size", resaspects[0], res2dchoices[0], info->res2dsize[0], "Select resolution for 2D rendering."),
MB_SPACING(-8),
MB_COMBORETURN("Size", resaspects[1], res2dchoices[1], info->res2dsize[1], NULL),
MB_COMBORETURN("Size", resaspects[1], res2dchoices[1], info->res2dsize[1], "Select resolution for 2D rendering."),
MB_SPACING(-8),
MB_COMBORETURN("Size", resaspects[2], res2dchoices[2], info->res2dsize[2], NULL),
MB_COMBORETURN("Size", resaspects[2], res2dchoices[2], info->res2dsize[2], "Select resolution for 2D rendering."),
MB_SPACING(-8),
MB_COMBORETURN("Size", resaspects[3], res2dchoices[3], info->res2dsize[3], NULL),
MB_COMBORETURN("Size", resaspects[3], res2dchoices[3], info->res2dsize[3], "Select resolution for 2D rendering."),
MB_SPACING(-8),
// 2d custom entries
MB_EDITCVARSLIMRETURN("Width", "vid_conwidth", info->width2d),
MB_EDITCVARSLIMRETURN("Height", "vid_conheight", info->height2d),
MB_SPACING(4),
MB_CMD("Apply Settings", M_VideoApply, NULL),
MB_CMD("Apply Settings", M_VideoApply, "Restart video and apply renderer, display, and 2D resolution options."),
MB_SPACING(4),
MB_SLIDER("View Size", scr_viewsize, 30, 120, 10, NULL),
MB_SLIDER("Gamma", v_gamma, 0.25, 1.5, 0.05, NULL),

View File

@ -789,6 +789,7 @@ void M_Menu_Teamplay_Items_Powerups_f (void);
void M_Menu_Teamplay_Items_Ammo_Health_f (void);
void M_Menu_Teamplay_Items_Team_Fortress_f (void);
void M_Menu_Teamplay_Items_Status_Location_Misc_f (void);
void M_Menu_Network_f(void);
void M_Menu_Singleplayer_Cheats_f (void);
void M_Menu_Particles_f (void);
void M_Menu_Audio_Speakers_f (void);
@ -852,6 +853,7 @@ void M_Init_Internal (void)
Cmd_AddRemCommand ("menu_teamplay_team_fortress", M_Menu_Teamplay_Items_Team_Fortress_f);
Cmd_AddRemCommand ("menu_teamplay_status_location_misc", M_Menu_Teamplay_Items_Status_Location_Misc_f);
Cmd_AddRemCommand ("menu_particles", M_Menu_Particles_f);
Cmd_AddRemCommand ("menu_network", M_Menu_Network_f);
#ifdef WEBCLIENT
Cmd_AddRemCommand ("menu_download", Menu_DownloadStuff_f);