From 67139b771ae3081637f521f7672ef9b75d311319 Mon Sep 17 00:00:00 2001 From: TimeServ Date: Tue, 7 Jun 2011 23:54:58 +0000 Subject: [PATCH] menu overhaul (unfinished, still need more tips, tp/cheats/other entries still need readd) fixes to menu system, removed/corrected some cvars git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3814 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/m_items.c | 159 ++- engine/client/m_multi.c | 2 - engine/client/m_options.c | 2285 ++++++++++++++++++++----------------- engine/client/m_single.c | 28 - engine/client/menu.c | 21 +- engine/client/menu.h | 47 +- engine/client/r_part.c | 4 +- engine/client/renderer.c | 479 +------- engine/client/snd_dma.c | 27 +- engine/client/zqtp.c | 2 +- engine/gl/gl_rmain.c | 1 - engine/gl/gl_shader.c | 2 +- engine/gl/gl_vidnt.c | 1 - 13 files changed, 1465 insertions(+), 1593 deletions(-) diff --git a/engine/client/m_items.c b/engine/client/m_items.c index 3752d659..501923eb 100644 --- a/engine/client/m_items.c +++ b/engine/client/m_items.c @@ -343,7 +343,7 @@ void MenuDrawItems(int xpos, int ypos, menuoption_t *option, menu_t *menu) while (option) { - if (mousemoved && !bindingactive) + if (mousemoved && !bindingactive && !option->common.ishidden) { if (omousex > xpos+option->common.posx && omousex < xpos+option->common.posx+option->common.width) { @@ -518,7 +518,10 @@ void MenuDrawItems(int xpos, int ypos, menuoption_t *option, menu_t *menu) else Draw_FunString(x, y, option->edit.caption); x+=strlen(option->edit.caption)*8+8; - Draw_TextBox(x-8, y-8, 16, 1); + if (option->edit.slim) + x += 8; // more space for cursor + else + Draw_TextBox(x-8, y-8, 16, 1); Draw_FunString(x, y, option->edit.text); if (menu->selecteditem == option && (int)(realtime*4) & 1) @@ -832,7 +835,7 @@ menuedit_t *MC_AddEdit(menu_t *menu, int x, int y, char *text, char *def) return n; } -menuedit_t *MC_AddEditCvar(menu_t *menu, int x, int y, char *text, char *name) +menuedit_t *MC_AddEditCvar_Full(menu_t *menu, int x, int y, char *text, char *name, qboolean isslim) { menuedit_t *n = Z_Malloc(sizeof(menuedit_t)+strlen(text)+1); cvar_t *cvar; @@ -853,10 +856,21 @@ menuedit_t *MC_AddEditCvar(menu_t *menu, int x, int y, char *text, char *name) Q_strncpyz(n->text, cvar->string, sizeof(n->text)); n->common.next = menu->options; + n->slim = isslim; menu->options = (menuoption_t *)n; return n; } +menuedit_t *MC_AddEditCvarSlim(menu_t *menu, int x, int y, char *text, char *name) +{ + return MC_AddEditCvar_Full(menu, x, y, text, name, true); +} + +menuedit_t *MC_AddEditCvar(menu_t *menu, int x, int y, char *text, char *name) +{ + return MC_AddEditCvar_Full(menu, x, y, text, name, false); +} + menubox_t *MC_AddBox(menu_t *menu, int x, int y, int width, int height) { menubox_t *n = Z_Malloc(sizeof(menubox_t)); @@ -2034,3 +2048,142 @@ void M_Menu_Main_f (void) } } +int MC_AddBulk(struct menu_s *menu, menubulk_t *bulk, int xstart, int xtextend, int y) +{ + int x; + int selectedy = y; + menuoption_t *selected = NULL; + + while (bulk) + { + switch (bulk->type) + { + case mt_text: + switch (bulk->variant) + { + case -1: // end of menu + bulk = NULL; + continue; + case 0: // white text + x = xtextend - strlen(bulk->text) * 8; + MC_AddWhiteText(menu, x, y, bulk->text, bulk->rightalign); + y += 8; + break; + case 1: // red text + x = xtextend - strlen(bulk->text) * 8; + MC_AddRedText(menu, x, y, bulk->text, bulk->rightalign); + y += 8; + break; + case 2: // spacing + y += bulk->spacing; + break; + } + break; + case mt_button: + { + menubutton_t *button; + x = xtextend - strlen(bulk->text) * 8; + switch (bulk->variant) + { + default: + case 0: // console command + button = MC_AddConsoleCommand(menu, x, y, bulk->text, bulk->consolecmd); + break; + case 1: // function command + button = MC_AddCommand(menu, x, y, bulk->text, bulk->command); + break; + } + if (!selected) + selected = (union menuoption_s *)button; + if (bulk->tooltip) + button->common.tooltip = bulk->tooltip; + y += 8; + } + break; + case mt_checkbox: + x = xtextend - strlen(bulk->text) * 8; + { + menucheck_t *check = MC_AddCheckBox(menu, x, y, bulk->text, bulk->cvar, bulk->flags); + check->func = bulk->func; + if (bulk->ret) + *bulk->ret = (union menuoption_s *)check; + if (!selected) + selected = (union menuoption_s *)check; + if (bulk->tooltip) + check->common.tooltip = bulk->tooltip; + } + y += 8; + break; + case mt_slider: + x = xtextend - strlen(bulk->text) * 8; + { + menuslider_t *slider = MC_AddSlider(menu, x, y, bulk->text, bulk->cvar, bulk->min, bulk->max, bulk->delta); + if (!selected) + selected = (union menuoption_s *)slider; + if (bulk->tooltip) + slider->common.tooltip = bulk->tooltip; + } + y += 8; + break; + case mt_combo: + { + menucombo_t *combo; + x = xtextend - strlen(bulk->text) * 8; + switch (bulk->variant) + { + default: + case 0: // cvar combo + combo = MC_AddCvarCombo(menu, x, y, bulk->text, bulk->cvar, bulk->options, bulk->values); + break; + case 1: // combo with return value + combo = MC_AddCombo(menu, x, y, bulk->text, bulk->options, bulk->selectedoption); + break; + } + if (bulk->ret) + *bulk->ret = (union menuoption_s *)combo; + if (!selected) + selected = (union menuoption_s *)combo; + if (bulk->tooltip) + combo->common.tooltip = bulk->tooltip; + y += 8; + } + break; + case mt_edit: + { + menuedit_t *edit; + x = xtextend - strlen(bulk->text) * 8; + switch (bulk->variant) + { + default: + case 0: + y += 4; + edit = MC_AddEditCvar(menu, x, y, bulk->text, bulk->cvarname); + y += 4; + break; + case 1: + edit = MC_AddEditCvarSlim(menu, x, y, bulk->text, bulk->cvarname); + break; + } + if (bulk->ret) + *bulk->ret = (union menuoption_s *)edit; + if (!selected) + selected = (union menuoption_s *)edit; + if (bulk->tooltip) + edit->common.tooltip = bulk->tooltip; + y += 8; + } + break; + default: + Con_Printf(CON_ERROR "Invalid type in bulk menu!\n"); + bulk = NULL; + continue; + } + bulk++; + } + + menu->selecteditem = selected; + if (selected) + selectedy = selected->common.posy; + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, xtextend + 8, selectedy, NULL, false); + return y; +} diff --git a/engine/client/m_multi.c b/engine/client/m_multi.c index 54fc8901..7fbfc971 100644 --- a/engine/client/m_multi.c +++ b/engine/client/m_multi.c @@ -45,7 +45,6 @@ void M_Menu_MultiPlayer_f (void) mgt=64; menu->selecteditem = (menuoption_t*) MC_AddConsoleCommandHexen2BigFont (menu, 80, mgt, "Join A Game ", "menu_slist\n");mgt+=20; - MC_AddConsoleCommandHexen2BigFont (menu, 80, mgt, "Old Browser ", "menu_serversold\n");mgt+=20; MC_AddConsoleCommandHexen2BigFont (menu, 80, mgt, "New Server ", "menu_newmulti\n");mgt+=20; MC_AddConsoleCommandHexen2BigFont (menu, 80, mgt, "Player Setup", "menu_setup\n");mgt+=20; MC_AddConsoleCommandHexen2BigFont (menu, 80, mgt, "Demos ", "menu_demo\n");mgt+=20; @@ -62,7 +61,6 @@ void M_Menu_MultiPlayer_f (void) menu->selecteditem = (menuoption_t*) MC_AddConsoleCommandQBigFont (menu, 72, mgt, "Join A Game ", "menu_slist\n");mgt+=20; MC_AddConsoleCommandQBigFont (menu, 72, mgt, "Quick Connect", "quickconnect qw\n");mgt+=20; - MC_AddConsoleCommandQBigFont (menu, 72, mgt, "Old Browser ", "menu_serversold\n");mgt+=20; MC_AddConsoleCommandQBigFont (menu, 72, mgt, "New Server ", "menu_newmulti\n");mgt+=20; MC_AddConsoleCommandQBigFont (menu, 72, mgt, "Player Setup", "menu_setup\n");mgt+=20; MC_AddConsoleCommandQBigFont (menu, 72, mgt, "Demos ", "menu_demo\n");mgt+=20; diff --git a/engine/client/m_options.c b/engine/client/m_options.c index 18c82d42..cb9a4c3e 100644 --- a/engine/client/m_options.c +++ b/engine/client/m_options.c @@ -70,65 +70,42 @@ void M_Menu_Options_f (void) extern qboolean vid_isfullscreen; #endif int y; - menu_t *menu = M_Options_Title(&y, 0); - int mgt = M_GameType(); - menu->selecteditem = (union menuoption_s *) - MC_AddConsoleCommand(menu, 16, y, " Customize controls", "menu_keys\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " Go to console", "toggleconsole\nplay misc/menu2.wav\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " Reset to defaults", "exec default.cfg\nplay misc/menu2.wav\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " Save all settings", "cfg_save\n"); y+=8; - - MC_AddSlider(menu, 16, y, " Mouse Speed", &sensitivity, 1, 10, 0.5); y+=8; - MC_AddSlider(menu, 16, y, " Crosshair", &crosshair, 0, 22, 1); y+=8; - - MC_AddCheckBox(menu, 16, y, " Always Run", NULL,0)->func = M_Options_AlwaysRun; y+=8; - MC_AddCheckBox(menu, 16, y, " Invert Mouse", NULL,0)->func = M_Options_InvertMouse; y+=8; - MC_AddCheckBox(menu, 16, y, " Lookspring", &lookspring,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Lookstrafe", &lookstrafe,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Splitscreen", &cl_splitscreen,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Use old status bar", &cl_sbar,0); y+=8; - MC_AddCheckBox(menu, 16, y, " HUD on left side", &cl_hudswap,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Old-style chatting", &cl_standardchat,0);y+=8; - MC_AddCheckBox(menu, 16, y, " Old-style messages", &cl_standardmsg,0);y+=8; - y+=4;MC_AddEditCvar(menu, 16, y, " Imitate FPS", "cl_netfps"); y+=8+4; - - MC_AddConsoleCommand(menu, 16, y, " Video Options", "menu_video\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " Shadow & Lighting Options", "menu_shadow_lighting\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " 3D Rendering Options", "menu_3d\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " Texture Options", "menu_textures\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " Particle Options", "menu_particles\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " FPS Options", "menu_fps\n"); y+=8; - - if ((mgt != MGT_QUAKE2) && (mgt != MGT_HEXEN2)) - { - MC_AddConsoleCommand(menu, 16, y, " Teamplay Options", "menu_teamplay\n"); y+=8; - } - - if (mgt == MGT_QUAKE2) - { - MC_AddConsoleCommand(menu, 16, y, "Singleplayer Cheat Options", "menu_quake2_spcheats\n"); y+=8; - } - else if (mgt == MGT_HEXEN2) - { - MC_AddConsoleCommand(menu, 16, y, "Singleplayer Cheat Options", "menu_hexen2_spcheats\n"); y+=8; - } - else - { - MC_AddConsoleCommand(menu, 16, y, "Singleplayer Cheat Options", "menu_spcheats\n"); y+=8; - } - - MC_AddConsoleCommand(menu, 16, y, " Audio Options", "menu_audio\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " Downloads", "menu_download\n"); y+=8; - -#ifdef _WIN32 - if (!vid_isfullscreen) + menubulk_t bulk[] = { + MB_CONSOLECMD("Customize controls", "menu_keys\n", "Modify keyboard and mouse inputs."), + MB_CONSOLECMD("Go to console", "toggleconsole\nplay misc/menu2.wav\n", "Open up the engine console."), + MB_CONSOLECMD("Reset to defaults", "exec default.cfg\nplay misc/menu2.wav\n", "Reloads the default configuration."), + MB_CONSOLECMD("Save all settings", "cfg_save\n", "Writes changed settings out to a config file."), + MB_SPACING(4), + MB_SLIDER("Mouse Speed", sensitivity, 1, 10, 0.2, NULL), + MB_SLIDER("Crosshair", crosshair, 0, 22, 1, NULL), // move this to hud setup? + MB_CHECKBOXFUNC("Always Run", M_Options_AlwaysRun, 0, "Set movement to run at fastest speed by default."), + MB_CHECKBOXFUNC("Invert Mouse", M_Options_InvertMouse, 0, "Invert vertical mouse movement."), + MB_CHECKBOXCVAR("Lookspring", lookspring, 0), + 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), + MB_CONSOLECMD("FPS Options", "menu_fps\n", "Set model filtering and graphical profile options."), + MB_CONSOLECMD("Rendering Options", "menu_render\n", "Set rendering options such as water warp and tinting effects."), + MB_CONSOLECMD("Lighting Options", "menu_lighting\n", "Set options for level lighting and dynamic lights."), + MB_CONSOLECMD("Texture Options", "menu_textures\n", "Set options for texture detail and effects."), +#ifndef MINIMAL + MB_CONSOLECMD("Particle Options", "menu_particles\n", "Set particle effect options."), #endif - { - MC_AddCheckBox(menu, 16, y, " Use Mouse", &_windowed_mouse,0); y+=8; - } + // removed downloads (is this still appropriate?) + // removed teamplay + // removed singleplayer cheats (move this to single player menu) + MB_END() + }; + menu_t *menu = M_Options_Title(&y, 0); - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 225, menu->selecteditem->common.posy, NULL, false); + MC_AddBulk(menu, bulk, 16, 216, y); } #ifndef __CYGWIN__ @@ -259,21 +236,22 @@ menucombo_t *MC_AddCvarCombo(menu_t *menu, int x, int y, const char *caption, cv void M_Menu_Audio_f (void) { menu_t *menu; - int cursorpositionY; - extern cvar_t nosound, precache, snd_leftisright, snd_khz, snd_eax, snd_speakers, ambient_level, bgmvolume, snd_playersoundvolume, ambient_fade, cl_staticsounds, snd_inactive, _snd_mixahead, snd_usemultipledevices, snd_noextraupdate, bgmbuffer; + extern cvar_t nosound, precache, snd_leftisright, snd_khz, snd_eax, snd_speakers, ambient_level, bgmvolume, snd_playersoundvolume, ambient_fade, cl_staticsounds, snd_inactive, _snd_mixahead, snd_usemultipledevices, snd_noextraupdate; extern cvar_t cl_voip_play, cl_voip_send; static const char *soundqualityoptions[] = { "11025 Hz", "22050 Hz", "44100 Hz", + "48000 Hz", NULL }; static const char *soundqualityvalues[] = { - "11.025", - "22.050", - "44.100", + "11", + "22", + "44", + "48", NULL }; @@ -281,7 +259,7 @@ void M_Menu_Audio_f (void) "Mono", "Stereo", "Quad", - "5.1 surround", + "5.1", NULL }; @@ -294,43 +272,42 @@ void M_Menu_Audio_f (void) }; int y; + menubulk_t bulk[] = { + MB_REDTEXT("Sound Options", false), + MB_TEXT("\x80\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x82", false), + MB_SPACING(8), + MB_SLIDER("Volume", volume, 0, 1, 0.1, NULL), + MB_COMBOCVAR("Speaker Setup", snd_speakers, speakeroptions, speakervalues, NULL), + MB_COMBOCVAR("Frequency", snd_khz, soundqualityoptions, soundqualityvalues, NULL), + MB_CHECKBOXCVAR("Low Quality (8-bit)", loadas8bit, 0), + MB_CHECKBOXCVAR("Flip Speakers", snd_leftisright, 0), + MB_SLIDER("Mixahead", _snd_mixahead, 0, 1, 0.05, NULL), + MB_CHECKBOXCVAR("Disable All Sounds", nosound, 0), + MB_SPACING(4), +#ifdef VOICECHAT + MB_CHECKBOXCVAR("Voice Chat", cl_voip_play, 0), + MB_CHECKBOXCVAR("Voice Activation", cl_voip_send, 0), +#endif + MB_SLIDER("Player Sound Volume", snd_playersoundvolume, 0, 1, 0.1, NULL), + MB_SLIDER("Ambient Volume", ambient_level, 0, 1, 0.1, NULL), + MB_SLIDER("Ambient Fade", ambient_fade, 0, 1000, 1, NULL), + MB_CHECKBOXCVAR("Static Sounds", cl_staticsounds, 0), + MB_SLIDER("CD Music Volume", bgmvolume, 0, 1, 0.1, NULL), + // removed music buffer + // removed precache + // removed eax2 + MB_CHECKBOXCVAR("Multiple Devices", snd_usemultipledevices, 0), + // remove no extra update + MB_CHECKBOXCVAR("Sound While Inactive", snd_inactive, 0), + MB_SPACING(4), + //MB_CONSOLECMD("Speaker Test", "menu_speakers\n", "Test speaker setup output."), + MB_CONSOLECMD("Restart Sound", "snd_restart\n", "Restart audio systems and apply set options."), + MB_END() + }; + menu = M_Options_Title(&y, 0); - cursorpositionY = (y + 24); - - menu->selecteditem = (union menuoption_s *) - - MC_AddRedText(menu, 16, y, " Sound Options", false); y+=8; - MC_AddWhiteText(menu, 16, y, " ", false); y+=8; - y+=8; - -#ifdef VOICECHAT - MC_AddCheckBox(menu, 16, y, " Voice Chat", &cl_voip_play,0);y+=8; - MC_AddCheckBox(menu, 16, y, " VOIP Voice Activation", &cl_voip_send,0);y+=8; -#endif - MC_AddSlider(menu, 16, y, " CD Music Volume", &bgmvolume, 0, 1, 0.1);y+=8; - MC_AddSlider(menu, 16, y, " CD Music Buffer", &bgmbuffer, 0, 10240, 1024);y+=8; - MC_AddSlider(menu, 16, y, " Sound Volume", &volume, 0, 1, 0.1);y+=8; - MC_AddSlider(menu, 16, y, " Player Sound Volume", &snd_playersoundvolume,0,1,0.1);y+=8; - MC_AddSlider(menu, 16, y, " Ambient Volume", &ambient_level, 0, 1, 0.1);y+=8; - MC_AddSlider(menu, 16, y, " Ambient Fade", &ambient_fade, 0, 1000, 1);y+=8; - MC_AddCheckBox(menu, 16, y, " No Sound", &nosound,0);y+=8; - MC_AddCheckBox(menu, 16, y, " Static Sounds", &cl_staticsounds,0);y+=8; - MC_AddCheckBox(menu, 16, y, " Precache", &precache,0);y+=8; - MC_AddCheckBox(menu, 16, y, " Experimental EAX 2", &snd_eax,0);y+=8; - MC_AddCvarCombo(menu, 16, y, " Speaker Setup", &snd_speakers, speakeroptions, speakervalues);y+=8; - MC_AddCvarCombo(menu, 16, y, " Sound Speed", &snd_khz, soundqualityoptions, soundqualityvalues);y+=8; - MC_AddSlider(menu, 16, y, " Sound Mixahead", &_snd_mixahead,0,1,0.05);y+=8; - MC_AddCheckBox(menu, 16, y, " Multiple Devices", &snd_usemultipledevices,0);y+=8; - MC_AddCheckBox(menu, 16, y, " No Extra Sound Update", &snd_noextraupdate,0);y+=8; - MC_AddCheckBox(menu, 16, y, " Low Quality Sound (8bit)", &loadas8bit,0);y+=8; - MC_AddCheckBox(menu, 16, y, " Flip Sound", &snd_leftisright,0);y+=8; - MC_AddCheckBox(menu, 16, y, "Play Sound While Inactive", &snd_inactive,0);y+=8; - //MC_AddCombo(menu, 16, y, " Show Sounds Playing", &snd_show,0);y+=8; - y+=8; - MC_AddConsoleCommand(menu, 16, y, " = Restart Sound =", "snd_restart\n");y+=8; - - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 225, cursorpositionY, NULL, false); + MC_AddBulk(menu, bulk, 16, 216, y); } #else @@ -345,102 +322,173 @@ void M_Menu_Audio_f (void) void M_Menu_Particles_f (void) { menu_t *menu; - int cursorpositionY; - extern cvar_t r_bouncysparks, r_part_rain, gl_part_flame, r_particlesystem, r_grenadetrail, r_rockettrail, r_part_sparks_textured, r_part_sparks_trifan, r_part_rain_quantity, r_part_beams, r_particle_tracelimit; + extern cvar_t r_bouncysparks, r_part_rain, gl_part_flame, r_particlesystem, r_grenadetrail, r_rockettrail, r_part_sparks_textured, r_part_sparks_trifan, r_part_rain_quantity, r_particledesc, r_particle_tracelimit, r_part_contentswitch, r_bloodstains; - char *psystemopts[] = + static const char *psystemopts[] = { - "fixed/classic(faster)", - "scripted", + "Classic", + "Script", + "None", NULL }; - char *psystemvals[] = + static const char *psystemvals[] = { "classic", "script", + "null", NULL }; + static const char *pdescopts[] = + { + "Faithful", + "High FPS", + "Fancy", + "Fancy+LG", + "Bare bones", + NULL + }; + static const char *pdescvals[] = + { + "faithful", + "highfps", + "spikeset", + "spikeset tsshaft", + "minimal", + NULL + }; + + static const char *trailopts[] = + { + "Disable", + "Default", + "Swap", + "Alternate", + "Blood", + "Zombie", + "Scrag", + "Knight", + "Vore", + "Rail", + NULL + }; + static const char *trailvals[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL }; + int y; + menubulk_t bulk[] = { + MB_REDTEXT("Particle Options", false), + MB_TEXT("\x80\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x82", false), + MB_COMBOCVAR("Particle System", r_particlesystem, psystemopts, psystemvals, "Selects particle system to use. Classic is standard Quake particles, script is FTE style scripted particles, and none disables particles entirely."), + MB_COMBOCVAR("Script Set", r_particledesc, pdescopts, pdescvals, "Selects particle set to use with script system."), + MB_SPACING(4), + MB_COMBOCVAR("Rocket Trail", r_rockettrail, trailopts, trailvals, "Chooses effect to replace rocket trails."), + MB_COMBOCVAR("Grenade Trail", r_grenadetrail, trailopts, trailvals, "Chooses effect to replace grenade trails."), + MB_SPACING(4), + // removed texture sparks + // removed trifan sparks + MB_CHECKBOXCVAR("Particle Physics", r_bouncysparks, 0), + MB_CHECKBOXCVAR("Particle Stains", r_bloodstains, 0), + MB_CHECKBOXCVAR("Content Switching", r_part_contentswitch, 0), + MB_CHECKBOXCVAR("Surface Emitting", r_part_rain, 0), + MB_SLIDER("Surface Quantity", r_part_rain_quantity, 0, 10, 1, NULL), + MB_CHECKBOXCVAR("Model Emitting", gl_part_flame, 0), + MB_SLIDER("Trace Limit", r_particle_tracelimit, 0, 2000, 100, NULL), + // removed particle beams + MB_END() + }; + menu = M_Options_Title(&y, 0); - cursorpositionY = (y + 24); - - menu->selecteditem = (union menuoption_s *) - - MC_AddRedText(menu, 16, y, " Particle Options", false); y+=8; - MC_AddWhiteText(menu, 16, y, " ", false); y+=8; - y+=8; - - MC_AddCvarCombo(menu, 16, y, " particle system", &r_particlesystem, (const char **)psystemopts, (const char **)psystemvals);y+=8; - //fixme: hide the rest of the options if r_particlesystem==classic - MC_AddConsoleCommand(menu, 16, y, " Choose particle set", "menu_particlesets");y+=8; -// MC_AddSlider(menu, 16, y, " exp spark count", &r_particles_in_explosion, 16, 1024);y+=8; - - MC_AddSlider(menu, 16, y, " Grenade Trail", &r_grenadetrail,0,10,1); y+=8; - MC_AddSlider(menu, 16, y, " Rocket Trail", &r_rockettrail,0,10,1); y+=8; - MC_AddCheckBox(menu, 16, y, " Bouncy Sparks", &r_bouncysparks,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Textured Sparks", &r_part_sparks_textured,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Trifan Sparks", &r_part_sparks_trifan,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Rain", &r_part_rain,0); y+=8; - MC_AddSlider(menu, 16, y, " Rain Quantity", &r_part_rain_quantity,0,10,1); y+=8; - MC_AddCheckBox(menu, 16, y, " Torch Flame", &gl_part_flame,0); y+=8; - MC_AddSlider(menu, 16, y, " Particle Tracelimit", &r_particle_tracelimit,0,2000,50); y+=8; - MC_AddCheckBox(menu, 16, y, " Particle Beams", &r_part_beams,0); y+=8; - - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, cursorpositionY, NULL, false); + MC_AddBulk(menu, bulk, 16, 200, y); } -enum { - PRESET_286, - PRESET_FAST, - PRESET_DEFAULT, - PRESET_NICE, - PRESET_REALTIME, - PRESET_MAX -}; -typedef struct { - char *cvarname; - char *value[PRESET_MAX]; -} presetinfo_t; -presetinfo_t preset[] = +const char *presetname[] = { - //default is a reasonable nice look for single player - //fast is for competetive deathmatch games (equivelent to the default settings of other quakrworld engines) - //286 is an attempt to get the very vest fps possible, if you're crazy - {"r_presetname", {"286", "fast", "default", "nice", "realtime"}}, - {"gl_texturemode", {"nn", "ln", "ln", "ll", "ll"}}, - {"r_particlesdesc", {"none", "highfps", "spikeset tsshaft", "spikeset tsshaft", "spikeset tsshaft"}}, - {"r_particlesystem", {"none", "classic", "script", "script", "script"}}, - {"r_stains", {"0", "0", "0.75", "0.75", "0.75"}}, - {"r_drawflat", {"1", "0", "0", "0", "0"}}, - {"r_nolerp", {"1", "0", "0", "0", "0"}}, - {"r_nolightdir", {"1", "1", "0", "0", "0"}}, - {"r_dynamic", {"0", "0", "1", "1", "1"}}, - {"r_bloom", {"0", "0", "0", "0", "1"}}, - {"gl_flashblend", {"0", "1", "0", "1", "2"}}, - {"gl_bump", {"0", "0", "0", "1", "1"}}, - {"gl_specular", {"0", "0", "0", "1", "1"}}, - {"r_loadlit", {"0", "1", "1", "2", "2"}}, - {"r_fastsky", {"1", "0", "0", "-1", "-1"}}, -{"r_shadow_realtime_dlight",{"0", "0", "0", "1", "1"}}, -{"r_shadow_realtime_world", {"0", "0", "0", "0", "1"}}, - {"gl_detail", {"0", "0", "0", "1", "1"}}, - {"gl_load24bit", {"0", "0", "1", "1", "1"}}, - {"r_replacemodels", {"", "", "md3 md2", "md3 md2", "md3 md2"}}, - {"r_waterwarp", {"0", "-1", "1", "1", "1"}}, - {"r_lightstylesmooth", {"0", "0", "0", "1", "1"}}, - {NULL} + "286", + "Fast", + "Normal", + "Nice", + "Realtime", + NULL }; +#define PRESET_NUM 5 + +// this is structured like this for a possible future feature +// also don't include cvars that need a restart here +const char *presetexec[] = +{ + // 286 options (also the first commands to be execed in the chain) + "gl_texturemode nn;" + "r_particlesystem null;" + "r_stains 0;" + "r_drawflat 1;" + "r_nolerp 1;" + "r_nolightdir 1;" + "r_dynamic 0;" + "gl_flashblend 0;" + "gl_bump 0;" + "gl_specular 0;" + "r_loadlit 0;" + "r_fastsky 1;" + "r_shadow_realtime_dlight 0;" + "r_shadow_realtime_world 0;" + "gl_detail 0;" + "gl_load24bit 0;" + "r_replacemodels \"\";" + "r_waterwarp 0;" + "r_lightstylesmooth 0;" + , // fast options + "gl_texturemode ln;" +#ifdef MINIMAL + "r_particlesystem classic;" +#else + "r_particlesystem script;" + "r_particledesc highfps;" +#endif + "r_drawflat 0;" + "r_nolerp 0;" + "gl_flashblend 1;" + "r_loadlit 1;" + "r_fastsky 0;" + "r_waterwarp -1;" + , // normal options + "r_particlesystem classic;" + "r_stains 0.75;" + "r_nolightdir 0;" + "r_dynamic 1;" + "gl_flashblend 0;" + "gl_load24bit 1;" + "r_replacemodels \"md3 md2\";" + "r_waterwarp 1;" + , // nice options + "gl_texturemode ll;" +#ifndef MINIMAL + "r_particlesystem script;" + "r_particledesc \"spikeset tsshaft\";" +#endif +// "gl_bump 1;" // requires restart + "gl_specular 1;" + "r_loadlit 2;" +// "r_fastsky -1;" + "r_shadow_realtime_dlight 1;" + "gl_detail 1;" + "r_lightstylesmooth 1;" + "gl_texture_anisotropic_filtering 4;" + , // realtime options +// "r_bloom 1;" + "r_shadow_realtime_world 1;" + "gl_texture_anisotropic_filtering 16;" +}; + static void ApplyPreset (int presetnum) { int i; - for (i = 1; preset[i].cvarname; i++) + // TODO: work backwards and only set cvars once + for (i = 0; i <= presetnum; i++) { - Cbuf_AddText(preset[i].cvarname, Cmd_ExecLevel); - Cbuf_AddText(" ", Cmd_ExecLevel); - Cbuf_AddText(preset[i].value[presetnum], Cmd_ExecLevel); + Cbuf_AddText(presetexec[i], Cmd_ExecLevel); Cbuf_AddText("\n", Cmd_ExecLevel); + Cbuf_Execute(); // hack } } @@ -448,9 +496,10 @@ void FPS_Preset_f (void) { char *arg = Cmd_Argv(1); int i; - for (i = 0; i < PRESET_MAX; i++) + + for (i = 0; i < PRESET_NUM; i++) { - if (!strcmp(preset[0].value[i], arg)) + if (!stricmp(presetname[i], arg)) { ApplyPreset(i); return; @@ -459,8 +508,8 @@ void FPS_Preset_f (void) Con_Printf("Preset %s not recognised\n", arg); Con_Printf("Valid presests:\n"); - for (i = 0; i < PRESET_MAX; i++) - Con_Printf("%s\n", preset[0].value[i]); + for (i = 0; i < PRESET_NUM; i++) + Con_Printf("%s\n", presetname[i]); } @@ -483,10 +532,12 @@ void M_Menu_FPS_f (void) MC_AddWhiteText(menu, 16, y, " ", false); y+=8; y+=8; - for (i = 0; i < PRESET_MAX; i++) + // add vsync? + // maxfps? + for (i = 0; i < PRESET_NUM; i++) { - len = strlen(preset[0].value[i]); - MC_AddConsoleCommand(menu, 116, y, va("(preset) %s", preset[0].value[i]), va("fps_preset %s\n", preset[0].value[i])); y+=8; + len = strlen(presetname[i]); + MC_AddConsoleCommand(menu, 116, y, va("(preset) %s", presetname[i]), va("fps_preset %s\n", presetname[i])); y+=8; } MC_AddCheckBox(menu, 16, y, " Show FPS", &show_fps,0);y+=8; @@ -500,352 +551,46 @@ void M_Menu_FPS_f (void) menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 188, cursorpositionY, NULL, false); } -//copy and pasted from renderer.c -qboolean M_VideoApply2 (union menuoption_s *op,struct menu_s *menu,int key) +void M_Menu_Render_f (void) { - if (key != K_ENTER) - return false; - - // r_shadows too - - - Cbuf_AddText("vid_restart\n", RESTRICT_LOCAL); - - M_RemoveMenu(menu); - Cbuf_AddText("menu_options\n", RESTRICT_LOCAL); - return true; -} - -typedef struct { - menucombo_t *multisamplingcombo; -} threeDmenuinfo_t; - -qboolean M_VideoApply3D (union menuoption_s *op,struct menu_s *menu,int key) -{ - threeDmenuinfo_t *info = menu->data; - int currentmsaalevel; - extern cvar_t vid_multisample; - - if (key != K_ENTER) - return false; - - if (vid_multisample.value == 8) - currentmsaalevel = 4; - else if (vid_multisample.value == 6) - currentmsaalevel = 3; - else if (vid_multisample.value == 4) - currentmsaalevel = 2; - else if (vid_multisample.value == 2) - currentmsaalevel = 1; - else if (vid_multisample.value <= 1) - currentmsaalevel = 0; - else - currentmsaalevel = 0; - - if (info->multisamplingcombo->selectedoption != currentmsaalevel) // if MSAA doesn't change, don't bother applying it when the video system is restarted + static const char *warpopts[] = { - switch(info->multisamplingcombo->selectedoption) - { - case 0: - Cbuf_AddText("vid_multisample 0\n", RESTRICT_LOCAL); - break; - case 1: - Cbuf_AddText("vid_multisample 2\n", RESTRICT_LOCAL); - break; - case 2: - Cbuf_AddText("vid_multisample 4\n", RESTRICT_LOCAL); - break; - case 3: - Cbuf_AddText("vid_multisample 6\n", RESTRICT_LOCAL); - break; - case 4: - Cbuf_AddText("vid_multisample 8\n", RESTRICT_LOCAL); - break; - } - } - #ifdef _DEBUG - else + "Disabled", + "FOV Warp", + "Shader", + NULL + }; + static const char *warpvalues[] = { - Con_Printf("MSAA: Selected option matches current CVAR value (%d & %d), no change made.\n",info->multisamplingcombo->selectedoption, currentmsaalevel); - } - #endif - - Cbuf_AddText("vid_restart\n", RESTRICT_LOCAL); - - M_RemoveMenu(menu); - Cbuf_AddText("menu_3d\n", RESTRICT_LOCAL); - return true; -} - -void M_Menu_3D_f (void) -{ - static const char *msaalevels[] = - { - "Off", - "2x", - "4x", - "6x", - "8x", - NULL + "0", + "-1", + "1", + NULL }; - threeDmenuinfo_t *info; menu_t *menu; - int cursorpositionY; - int currentmsaalevel; -#ifndef MINIMAL - extern cvar_t r_xflip; -#endif - extern cvar_t r_novis, gl_dither, cl_item_bobbing, r_waterwarp, r_nolerp, r_fastsky, gl_nocolors, gl_lerpimages, gl_lateswap, r_mirroralpha, r_wateralpha, r_drawviewmodel, gl_motionblur, gl_motionblurscale, gl_blend2d, gl_blendsprites, r_flashblend, gl_cshiftenabled, vid_multisample; + extern cvar_t r_novis, cl_item_bobbing, r_waterwarp, r_nolerp, r_fastsky, gl_nocolors, gl_lerpimages, r_wateralpha, r_drawviewmodel, gl_cshiftenabled, r_bloom; int y; - menu = M_Options_Title(&y, sizeof(threeDmenuinfo_t)); - info = menu->data; - - cursorpositionY = (y + 24); - - if (vid_multisample.value == 8) - currentmsaalevel = 4; - else if (vid_multisample.value == 6) - currentmsaalevel = 3; - else if (vid_multisample.value == 4) - currentmsaalevel = 2; - else if (vid_multisample.value == 2) - currentmsaalevel = 1; - else if (vid_multisample.value <= 1) - currentmsaalevel = 0; - else - currentmsaalevel = 0; - - menu->selecteditem = (union menuoption_s *) - - MC_AddRedText(menu, 16, y, " 3D Renderering Options", false); y+=8; - MC_AddWhiteText(menu, 16, y, " ", false); y+=8; - y+=8; - - MC_AddCheckBox(menu, 16, y, " Calculate VIS", &r_novis,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Water Warp", &r_waterwarp,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Model Interpollation", &r_nolerp,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Toggle Sky", &r_fastsky,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Lerp Images", &gl_lerpimages,0); y+=8; - MC_AddSlider(menu, 16, y, " Maximum Distance", &gl_maxdist,1,8192,128); y+=8; - MC_AddCheckBox(menu, 16, y, " GL Swapbuffer Delay", &gl_lateswap,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Mirror Reflections", &r_mirroralpha,0); y+=8; - #if !defined(MINIMAL) && defined(GLQUAKE) - MC_AddCheckBox(menu, 16, y, " Flip Horizontal View", &r_xflip,0); y+=8; - #endif - MC_AddCheckBox(menu, 16, y, " Water Transparency", &r_wateralpha,0); y+=8; - MC_AddSlider(menu, 16, y, " View Model Transparency", &r_drawviewmodel,0,1,0.1); y+=8; - MC_AddCheckBox(menu, 16, y, "Ignore Player Model Colors", &gl_nocolors,0); y+=8; - MC_AddSlider(menu, 16, y, " Motion Blur", &gl_motionblur,0,1,0.5); y+=8; - MC_AddSlider(menu, 16, y, " Motion Blur Scale", &gl_motionblurscale,0,1,0.5); y+=8; - MC_AddCheckBox(menu, 16, y, " 2D Blending", &gl_blend2d,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Sprite Blending", &gl_blendsprites,0); y+=8; - MC_AddSlider(menu, 16, y, " Flash Blending", &r_flashblend,0,2,1); y+=8; - MC_AddCheckBox(menu, 16, y, " Poly Blending", &gl_cshiftenabled,0); y+=8; - #ifdef GLQUAKE - MC_AddCheckBox(menu, 16, y, " 16bit Color Dithering", &gl_dither,0); y+=8; - #endif - MC_AddCheckBox(menu, 16, y, " Model Bobbing", &cl_item_bobbing,0); y+=8; - info->multisamplingcombo = MC_AddCombo(menu, 16, y, " Multisample Anti-Aliasing", msaalevels, currentmsaalevel); y+=8; - y+=8; - MC_AddCommand(menu, 16, y, " Apply", M_VideoApply3D); y+=8; - - //menu->selecteditem = (union menuoption_s *)info->multisamplingcombo; - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 225, cursorpositionY, NULL, false); -} - -typedef struct { - menucombo_t *texturefiltercombo; - menucombo_t *anisotropycombo; - menucombo_t *maxtexturesizecombo; - menucombo_t *bloomsamplesizecombo; - menucombo_t *bloomdiamondcombo; -} texturemenuinfo_t; - -qboolean M_VideoApplyTextures (union menuoption_s *op,struct menu_s *menu,int key) -{ - texturemenuinfo_t *info = menu->data; -#if !defined(MINIMAL) && defined(GLQUAKE) - int currentbloomdiamond; - int currentbloomsamplesize; - - extern cvar_t r_bloom_sample_size, r_bloom_diamond_size; -#endif - - if (key != K_ENTER) - return false; - - switch(info->texturefiltercombo->selectedoption) + menubulk_t bulk[] = { - case 0: - Cbuf_AddText("gl_texturemode gl_nearest_mipmap_nearest\n", RESTRICT_LOCAL); - break; - case 1: - Cbuf_AddText("gl_texturemode gl_linear_mipmap_nearest\n", RESTRICT_LOCAL); - break; - case 2: - Cbuf_AddText("gl_texturemode gl_linear_mipmap_linear\n", RESTRICT_LOCAL); - break; - } - - switch(info->anisotropycombo->selectedoption) - { - case 0: - Cbuf_AddText("gl_texture_anisotropic_filtering 0\n", RESTRICT_LOCAL); - break; - case 1: - Cbuf_AddText("gl_texture_anisotropic_filtering 2\n", RESTRICT_LOCAL); - break; - case 2: - Cbuf_AddText("gl_texture_anisotropic_filtering 4\n", RESTRICT_LOCAL); - break; - case 3: - Cbuf_AddText("gl_texture_anisotropic_filtering 8\n", RESTRICT_LOCAL); - break; - case 4: - Cbuf_AddText("gl_texture_anisotropic_filtering 16\n", RESTRICT_LOCAL); - break; - } - - switch(info->maxtexturesizecombo->selectedoption) - { - case 0: - Cbuf_AddText("gl_max_size 128\n", RESTRICT_LOCAL); - break; - case 1: - Cbuf_AddText("gl_max_size 196\n", RESTRICT_LOCAL); - break; - case 2: - Cbuf_AddText("gl_max_size 256\n", RESTRICT_LOCAL); - break; - case 3: - Cbuf_AddText("gl_max_size 384\n", RESTRICT_LOCAL); - break; - case 4: - Cbuf_AddText("gl_max_size 512\n", RESTRICT_LOCAL); - break; - case 5: - Cbuf_AddText("gl_max_size 768\n", RESTRICT_LOCAL); - break; - case 6: - Cbuf_AddText("gl_max_size 1024\n", RESTRICT_LOCAL); - break; - case 7: - Cbuf_AddText("gl_max_size 2048\n", RESTRICT_LOCAL); - break; - case 8: - Cbuf_AddText("gl_max_size 4096\n", RESTRICT_LOCAL); - break; - case 9: - Cbuf_AddText("gl_max_size 8192\n", RESTRICT_LOCAL); - break; - } - -#if !defined(MINIMAL) && defined(GLQUAKE) - if (r_bloom_sample_size.value >= 512) - currentbloomsamplesize = 7; - else if (r_bloom_sample_size.value == 384) - currentbloomsamplesize = 6; - else if (r_bloom_sample_size.value == 256) - currentbloomsamplesize = 5; - else if (r_bloom_sample_size.value == 192) - currentbloomsamplesize = 4; - else if (r_bloom_sample_size.value == 128) - currentbloomsamplesize = 3; - else if (r_bloom_sample_size.value == 96) - currentbloomsamplesize = 2; - else if (r_bloom_sample_size.value == 64) - currentbloomsamplesize = 1; - else if (r_bloom_sample_size.value <= 32) - currentbloomsamplesize = 0; - else - currentbloomsamplesize = 0; - - if (info->bloomsamplesizecombo->selectedoption != currentbloomsamplesize) - { - switch(info->bloomsamplesizecombo->selectedoption) - { - case 0: - Cbuf_AddText("r_bloom_sample_size 32\n", RESTRICT_LOCAL); - break; - case 1: - Cbuf_AddText("r_bloom_sample_size 64\n", RESTRICT_LOCAL); - break; - case 2: - Cbuf_AddText("r_bloom_sample_size 96\n", RESTRICT_LOCAL); - break; - case 3: - Cbuf_AddText("r_bloom_sample_size 128\n", RESTRICT_LOCAL); - break; - case 4: - Cbuf_AddText("r_bloom_sample_size 192\n", RESTRICT_LOCAL); - break; - case 5: - Cbuf_AddText("r_bloom_sample_size 256\n", RESTRICT_LOCAL); - break; - case 6: - Cbuf_AddText("r_bloom_sample_size 384\n", RESTRICT_LOCAL); - break; - case 7: - Cbuf_AddText("r_bloom_sample_size 512\n", RESTRICT_LOCAL); - break; - } - } - #ifdef _DEBUG - else - { - Con_Printf("Bloom Sample Size: Selected option matches current CVAR value (%d & %d), no change made.\n",info->bloomsamplesizecombo->selectedoption, currentbloomsamplesize); - } - #endif - - if (r_bloom_diamond_size.value >= 10) - currentbloomdiamond = 4; - else if (r_bloom_diamond_size.value >= 8) - currentbloomdiamond = 3; - else if (r_bloom_diamond_size.value >= 6) - currentbloomdiamond = 2; - else if (r_bloom_diamond_size.value >= 4) - currentbloomdiamond = 1; - else if (r_bloom_diamond_size.value <= 2) - currentbloomdiamond = 0; - else - currentbloomdiamond = 0; - - if (info->bloomdiamondcombo->selectedoption != currentbloomdiamond) - { - switch(info->bloomdiamondcombo->selectedoption) - { - case 0: - Cbuf_AddText("r_bloom_diamond_size 2\n", RESTRICT_LOCAL); - break; - case 1: - Cbuf_AddText("r_bloom_diamond_size 4\n", RESTRICT_LOCAL); - break; - case 2: - Cbuf_AddText("r_bloom_diamond_size 6\n", RESTRICT_LOCAL); - break; - case 3: - Cbuf_AddText("r_bloom_diamond_size 8\n", RESTRICT_LOCAL); - break; - case 4: - Cbuf_AddText("r_bloom_diamond_size 10\n", RESTRICT_LOCAL); - break; - } - } - #ifdef _DEBUG - else - { - Con_Printf("Bloom Diamond Size: Selected option matches current CVAR value (%d & %d), no change made.\n",info->bloomdiamondcombo->selectedoption, currentbloomdiamond); - } - #endif -#endif - - Cbuf_AddText("vid_restart\n", RESTRICT_LOCAL); - - M_RemoveMenu(menu); - Cbuf_AddText("menu_textures\n", RESTRICT_LOCAL); - return true; + MB_REDTEXT("Rendering Options", false), + MB_TEXT("\x80\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x82", false), + MB_CHECKBOXCVAR("Calculate VIS", r_novis, 0), + MB_CHECKBOXCVAR("Fast Sky", r_fastsky, 0), + MB_CHECKBOXCVAR("Disable Model Lerp", r_nolerp, 0), + MB_CHECKBOXCVAR("Lerp Images", gl_lerpimages, 0), + MB_COMBOCVAR("Water Warp", r_waterwarp, warpopts, warpvalues, NULL), + MB_SLIDER("Water Alpha", r_wateralpha, 0, 1, 0.1, NULL), + MB_SLIDER("Viewmodel Alpha", r_drawviewmodel, 0, 1, 0.1, NULL), + MB_CHECKBOXCVAR("Poly Blending", gl_cshiftenabled, 0), + MB_CHECKBOXCVAR("Disable Colormap", gl_nocolors, 0), + MB_CHECKBOXCVAR("Bloom", r_bloom, 0), + MB_CHECKBOXCVAR("Model Bobbing", cl_item_bobbing, 0), + MB_END() + }; + menu = M_Options_Title(&y, 0); + MC_AddBulk(menu, bulk, 16, 216, y); } void M_Menu_Textures_f (void) @@ -857,6 +602,27 @@ void M_Menu_Textures_f (void) "Trilinear", NULL }; + static const char *texturefiltervalues[] = + { + "GL_NEAREST_MIPMAP_NEAREST", + "GL_LINEAR_MIPMAP_NEAREST", + "GL_LINEAR_MIPMAP_LINEAR", + NULL + }; + + static const char *texture2dfilternames[] = + { + "Nearest", + "Linear", + NULL + }; + static const char *texture2dfiltervalues[] = + { + "GL_NEAREST", + "GL_LINEAR", + NULL + }; + static const char *anisotropylevels[] = { @@ -867,226 +633,125 @@ void M_Menu_Textures_f (void) "16x", NULL }; + static const char *anisotropyvalues[] = + { + "1", + "2", + "4", + "8", + "16", + NULL + }; static const char *texturesizeoptions[] = { - // uncommented out the unreadable console text ones - //"1x1", - //"2x2", - //"4x4", - //"8x8", - //"16x16", - //"32x32", - //"64x64", - "128x128", - "196x196", - "256x256", - "384x384", - "512x512", - "768x768", - "1024x1024", - "2048x2048", - "4096x4096", - "8192x8192", + "128", + "196", + "256", + "384", + "512", + "768", + "1024", + "2048", + "4096", + "8192", NULL }; -#ifndef MINIMAL - static const char *bloomsamplesizeoptions[] = - { - "32x32", - "64x64", - "96x96", - "128x128", - "192x192", - "256x256", - "384x384", - "512x512", - NULL - }; - - static const char *bloomdiamondoptions[] = - { - "2x", - "4x", - "6x", - "8x", - "10x", - NULL - }; -#endif - - texturemenuinfo_t *info; - int cursorpositionY; - int currenttexturefilter; - int currentanisotropylevel; - int currentmaxtexturesize; -#if !defined(MINIMAL) && defined(GLQUAKE) - int currentbloomsamplesize; - int currentbloomdiamond; - - extern cvar_t r_bloom, r_bloom_sample_size, r_bloom_darken, r_bloom_intensity, r_bloom_diamond_size, r_bloom_alpha, r_bloom_fast_sample; -#endif - extern cvar_t gl_load24bit, gl_specular, gl_bump, gl_detail, gl_detailscale, gl_compress, gl_savecompressedtex, gl_triplebuffer, gl_picmip, gl_picmip2d, gl_max_size, r_stains, r_bloodstains, r_stainfadetime, r_stainfadeammount, gl_skyboxdist, r_drawflat, gl_schematics; -#if defined(GLQUAKE) - extern cvar_t gl_texture_anisotropic_filtering, gl_texturemode, gl_playermip; + extern cvar_t gl_load24bit, gl_specular, gl_bump, gl_detail, gl_compress, gl_picmip, gl_picmip2d, gl_max_size, r_drawflat; +#ifdef GLQUAKE + extern cvar_t gl_texture_anisotropic_filtering, gl_texturemode, gl_texturemode2d; #endif int y; - menu_t *menu = M_Options_Title(&y, sizeof(*info)); - info = menu->data; - - cursorpositionY = (y + 24); - -#if !defined(MINIMAL) && defined(GLQUAKE) - - if (r_bloom_sample_size.value >= 512) - currentbloomsamplesize = 7; - else if (r_bloom_sample_size.value == 384) - currentbloomsamplesize = 6; - else if (r_bloom_sample_size.value == 256) - currentbloomsamplesize = 5; - else if (r_bloom_sample_size.value == 192) - currentbloomsamplesize = 4; - else if (r_bloom_sample_size.value == 128) - currentbloomsamplesize = 3; - else if (r_bloom_sample_size.value == 96) - currentbloomsamplesize = 2; - else if (r_bloom_sample_size.value == 64) - currentbloomsamplesize = 1; - else if (r_bloom_sample_size.value <= 32) - currentbloomsamplesize = 0; - else - currentbloomsamplesize = 0; - - if (r_bloom_diamond_size.value >= 10) - currentbloomdiamond = 4; - else if (r_bloom_diamond_size.value >= 8) - currentbloomdiamond = 3; - else if (r_bloom_diamond_size.value >= 6) - currentbloomdiamond = 2; - else if (r_bloom_diamond_size.value >= 4) - currentbloomdiamond = 1; - else if (r_bloom_diamond_size.value <= 2) - currentbloomdiamond = 0; - else - currentbloomdiamond = 0; -#endif - -#if defined(GLQUAKE) - if (!Q_strcasecmp(gl_texturemode.string, "gl_nearest_mipmap_nearest")) - currenttexturefilter = 0; - else if (!Q_strcasecmp(gl_texturemode.string, "gl_linear_mipmap_linear")) - currenttexturefilter = 2; - else if (!Q_strcasecmp(gl_texturemode.string, "gl_linear_mipmap_nearest")) - currenttexturefilter = 1; - else - currenttexturefilter = 1; - - if (gl_texture_anisotropic_filtering.value >= 16) - currentanisotropylevel = 4; - else if (gl_texture_anisotropic_filtering.value == 8) - currentanisotropylevel = 3; - else if (gl_texture_anisotropic_filtering.value == 4) - currentanisotropylevel = 2; - else if (gl_texture_anisotropic_filtering.value == 2) - currentanisotropylevel = 1; - else if (gl_texture_anisotropic_filtering.value <= 1) - currentanisotropylevel = 0; - else - currentanisotropylevel = 0; -#else - currenttexturefilter = 0; - currentanisotropylevel = 0; -#endif - - if (gl_max_size.value >= 8192) - currentmaxtexturesize = 9; - else if (gl_max_size.value == 4096) - currentmaxtexturesize = 8; - else if (gl_max_size.value == 2048) - currentmaxtexturesize = 7; - else if (gl_max_size.value == 1024) - currentmaxtexturesize = 6; - else if (gl_max_size.value == 768) - currentmaxtexturesize = 5; - else if (gl_max_size.value == 512) - currentmaxtexturesize = 4; - else if (gl_max_size.value == 384) - currentmaxtexturesize = 3; - else if (gl_max_size.value == 256) - currentmaxtexturesize = 2; - else if (gl_max_size.value == 196) - currentmaxtexturesize = 1; - else if (gl_max_size.value <= 128) - currentmaxtexturesize = 0; - else - currentmaxtexturesize = 0; - - MC_AddRedText(menu, 16, y, " Texturing Options", false); y+=8; - MC_AddWhiteText(menu, 16, y, " ", false); y+=8; - y+=8; - - info->texturefiltercombo = MC_AddCombo(menu, 16, y, " Texture Filter", texturefilternames, currenttexturefilter); y+=8; - info->anisotropycombo = MC_AddCombo(menu, 16, y, " Anisotropy Level", anisotropylevels, currentanisotropylevel); y+=8; - MC_AddCheckBox(menu, 16, y, " 32bit Textures", &gl_load24bit,0); y+=8; -#if !defined(MINIMAL) && defined(GLQUAKE) - MC_AddCheckBox(menu, 16, y, " Bloom", &r_bloom,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Bloom Fast Sample", &r_bloom_fast_sample,0); y+=8; - info->bloomsamplesizecombo = MC_AddCombo(menu,16, y," Bloom Sample Size", bloomsamplesizeoptions, currentbloomsamplesize); y+=8; - MC_AddSlider(menu, 16, y, " Bloom Darken", &r_bloom_darken,0,5,0.25); y+=8; - MC_AddSlider(menu, 16, y, " Bloom Intensity", &r_bloom_intensity,0,20,1); y+=8; - info->bloomdiamondcombo = MC_AddCombo(menu,16, y, " Bloom Diamond Size", bloomdiamondoptions, currentbloomdiamond); y+=8; - MC_AddSlider(menu, 16, y, " Bloom Alpha", &r_bloom_alpha,0,1,0.1); y+=8; -#endif - MC_AddCheckBox(menu, 16, y, " Bumpmapping", &gl_bump,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Specular Highlights", &gl_specular,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Texture Detail", &gl_detail,0); y+=8; - MC_AddSlider(menu, 16, y, " Texture Detail Scale", &gl_detailscale,0,10,1); y+=8; - MC_AddCheckBox(menu, 16, y, " Texture Compression", &gl_compress,0); y+=8; - MC_AddCheckBox(menu, 16, y, "Save Compressed Textures", &gl_savecompressedtex,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Triple Buffering", &gl_triplebuffer,0); y+=8; - MC_AddSlider(menu, 16, y, " 3D Texture Picmip", &gl_picmip,0,16,1); y+=8; - MC_AddSlider(menu, 16, y, " 2D Texture Picmip", &gl_picmip2d,0,16,1); y+=8; + menubulk_t bulk[] = + { + MB_REDTEXT("Texture Options", false), + MB_TEXT("\x80\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x82", false), + MB_CHECKBOXCVAR("Load Replacements", gl_load24bit, 0), + MB_CHECKBOXCVAR("Simple Texturing", r_drawflat, 0), #ifdef GLQUAKE - MC_AddSlider(menu, 16, y, " Model Texture Picmip", &gl_playermip,0,16,1); y+=8; + MB_COMBOCVAR("3D Filter Mode", gl_texturemode, texturefilternames, texturefiltervalues, NULL), + MB_COMBOCVAR("2D Filter Mode", gl_texturemode2d, texture2dfilternames, texture2dfiltervalues, NULL), + MB_COMBOCVAR("Anisotropy", gl_texture_anisotropic_filtering, anisotropylevels, anisotropyvalues, NULL), #endif - info->maxtexturesizecombo = MC_AddCombo(menu,16, y, " Maximum Texture Size", texturesizeoptions, currentmaxtexturesize); y+=8; - MC_AddCheckBox(menu, 16, y, " Stain Maps", &r_stains,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Blood Stains", &r_bloodstains,0); y+=8; - MC_AddSlider(menu, 16, y, " Stain Fade Time (secs)", &r_stainfadetime,0,30,0.5); y+=8; - MC_AddSlider(menu, 16, y, " Stain Fade Ammount", &r_stainfadeammount,0,30,1); y+=8; - MC_AddSlider(menu, 16, y, " Skybox Distance", &gl_skyboxdist,0,10000,100); y+=8; - MC_AddSlider(menu, 16, y, " Draw Flat Surfaces", &r_drawflat,0,2,1); y+=8; - MC_AddCheckBox(menu, 16, y, " Map Schematics", &gl_schematics,0); y+=8; - y+=8; - MC_AddCommand(menu, 16, y, " Apply", M_VideoApplyTextures); y+=8; - - menu->selecteditem = (union menuoption_s *)info->texturefiltercombo; - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 220, cursorpositionY, NULL, false); + MB_SPACING(4), + MB_CHECKBOXCVAR("Bumpmapping", gl_bump, 0), + MB_CHECKBOXCVAR("Specular Highlights", gl_specular, 0), + MB_CHECKBOXCVAR("Detail Textures", gl_detail, 0), + MB_SPACING(4), + MB_CHECKBOXCVAR("Texture Compression", gl_compress, 0), // merge the save compressed tex options into here? + MB_SLIDER("3D Picmip", gl_picmip, 0, 16, 1, NULL), + MB_SLIDER("2D Picmip", gl_picmip2d, 0, 16, 1, NULL), + MB_COMBOCVAR("Max Texture Size", gl_max_size, texturesizeoptions, texturesizeoptions, NULL), + MB_END() + }; + menu_t *menu = M_Options_Title(&y, 0); + MC_AddBulk(menu, bulk, 16, 216, y); } typedef struct { - menucombo_t *loadlitcombo; -} shadowlightingmenuinfo_t; + menucombo_t *lightcombo; + menucombo_t *dlightcombo; +} lightingmenuinfo_t; qboolean M_VideoApplyShadowLighting (union menuoption_s *op,struct menu_s *menu,int key) { - shadowlightingmenuinfo_t *info = menu->data; + lightingmenuinfo_t *info = (lightingmenuinfo_t*)menu->data; - if (key != K_ENTER) + if (key != K_ENTER && key != K_MOUSE1) return false; - switch(info->loadlitcombo->selectedoption) { - case 0: - Cbuf_AddText("r_loadlit 0\n", RESTRICT_LOCAL); - break; - case 1: - Cbuf_AddText("r_loadlit 1\n", RESTRICT_LOCAL); - break; - case 2: - Cbuf_AddText("r_loadlit 2\n", RESTRICT_LOCAL); - break; + char *cvarsrw = "0"; + char *cvarsrws = "0"; + char *cvarv = "0"; + switch (info->lightcombo->selectedoption) + { + case 1: + cvarsrw = "1"; + break; + case 2: + cvarsrw = "1"; + cvarsrws = "1"; + break; + case 3: + cvarv = "1"; + break; + } +#ifdef MINIMAL + Cbuf_AddText(va("r_shadow_realtime_world %s;r_shadow_realtime_world_shadows %s\n", cvarsrw, cvarsrws), RESTRICT_LOCAL); +#else + Cbuf_AddText(va("r_vertexlight %s;r_shadow_realtime_world %s;r_shadow_realtime_world_shadows %s\n", cvarv, cvarsrw, cvarsrws), RESTRICT_LOCAL); +#endif + } + + { + char *cvard = "0"; + char *cvarvd = "0"; + char *cvarsrd = "0"; + char *cvarsrds = "0"; + switch (info->lightcombo->selectedoption) + { + case 1: + cvard = "1"; + break; + case 2: + cvarsrd = "1"; + break; + case 3: + cvarsrd = "1"; + cvarsrds = "1"; + break; + case 4: + cvard = "1"; + cvarvd = "1"; + break; + } +#ifdef MINIMAL + Cbuf_AddText(va("r_shadow_realtime_dlight %s;rr_shadow_realtime_dlight_shadows %s;r_dynamic %s\n", cvarsrd, cvarsrds, cvard), RESTRICT_LOCAL); +#else + Cbuf_AddText(va("r_shadow_realtime_dlight %s;rr_shadow_realtime_dlight_shadows %s;r_dynamic %s;r_vertexdlight %s\n", cvarsrd, cvarsrds, cvard, cvarvd), RESTRICT_LOCAL); +#endif } Cbuf_AddText("vid_restart\n", RESTRICT_LOCAL); @@ -1096,432 +761,407 @@ qboolean M_VideoApplyShadowLighting (union menuoption_s *op,struct menu_s *menu, return true; } -void M_Menu_Shadow_Lighting_f (void) +void M_Menu_Lighting_f (void) { - shadowlightingmenuinfo_t *info; - int cursorpositionY; - int currentloadlit; #ifndef MINIMAL - extern cvar_t r_vertexlight; + extern cvar_t r_vertexlight, r_vertexdlights; #endif - extern cvar_t r_noaliasshadows, r_shadows, r_shadow_realtime_world, r_loadlits, gl_maxshadowlights, r_lightmap_saturation, r_dynamic, r_vertexdlights, r_lightstylesmooth, r_lightstylespeed, r_nolightdir, r_shadow_realtime_world_lightmaps, r_glsl_offsetmapping, r_glsl_offsetmapping_scale, r_shadow_bumpscale_basetexture, r_shadow_bumpscale_bumpmap, r_fb_bmodels, r_fb_models, gl_overbright, r_rocketlight, r_powerupglow, v_powerupshell, r_lightflicker, r_explosionlight; + extern cvar_t r_stains, r_shadows, r_shadow_realtime_world, r_loadlits, r_dynamic; + extern cvar_t r_lightstylesmooth, r_lightstylespeed, r_nolightdir; + extern cvar_t r_shadow_realtime_world_lightmaps, r_shadow_realtime_dlight, r_shadow_realtime_dlight_shadows; + extern cvar_t r_fb_bmodels, r_fb_models, r_rocketlight, r_powerupglow; + extern cvar_t v_powerupshell, r_explosionlight; - static const char *loadlitoptions[] = + static const char *lightingopts[] = { - "Off", - "On", - "On (Regenerate Lighting)", - NULL + "Standard", + "Realtime", + "RT+Shadows", +#ifndef MINIMAL + "Vertex", +#endif + NULL + }; + static const char *dlightopts[] = + { + "None", + "Standard", + "Realtime", + "RT+Shadows", +#ifndef MINIMAL + "Vertex", +#endif + NULL + }; + + static const char *loadlitopts[] = + { + "Disabled", + "Enabled", + "Generated", + NULL + }; + static const char *loadlitvalues[] = + { + "0", + "1", + "2", + NULL + }; + + static const char *fbopts[] = + { + "Disabled", + "Enabled", + "Traced", + NULL + }; + static const char *fbvalues[] = + { + "0", + "1", + "2", + NULL + }; + + static const char *powerupopts[] = + { + "Disabled", + "Enabled", + "Non-Self", + NULL + }; + static const char *powerupvalues[] = + { + "0", + "1", + "2", + NULL }; int y; - menu_t *menu = M_Options_Title(&y, sizeof(*info)); - info = menu->data; + menu_t *menu = M_Options_Title(&y, sizeof(lightingmenuinfo_t)); + int lightselect, dlightselect; - cursorpositionY = (y + 24); - - currentloadlit = r_loadlits.value; - - menu->selecteditem = (union menuoption_s *) - - MC_AddRedText(menu, 16, y, " Shadow & Lighting Options", false); y+=8; - MC_AddWhiteText(menu, 16, y, " ", false); y+=8; - y+=8; - - MC_AddSlider(menu, 16, y, " Shadows", &r_shadows,0,2,1); y+=8; - //MC_AddSlider(menu, 16, y, " Light Map Mode", &gl_lightmapmode,0,2,1); y+=8; - MC_AddSlider(menu, 16, y, " Light Map Saturation", &r_lightmap_saturation,0,1,0.1); y+=8; - MC_AddCheckBox(menu, 16, y, " Dynamic Lighting", &r_dynamic,0); y+=8; - #ifndef MINIMAL - MC_AddCheckBox(menu, 16, y, " Vertex Lighting", &r_vertexlight,0); y+=8; - #endif - MC_AddCheckBox(menu, 16, y, " Dynamic Vertex Lights", &r_vertexdlights,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Lightstyle Smoothing", &r_lightstylesmooth,0); y+=8; - MC_AddSlider(menu, 16, y, " Lightstyle Animation Speed", &r_lightstylespeed,0,50,1); y+=8; - MC_AddCheckBox(menu, 16, y, " Fullbright BSP Models", &r_fb_bmodels,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Fullbright Alias Models", &r_fb_models,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Overbright Bits", &gl_overbright,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Rocket Dynamic Lighting", &r_rocketlight,0); y+=8; - MC_AddSlider(menu, 16, y, " Powerup Glow", &r_powerupglow,0,2,1); y+=8; - MC_AddCheckBox(menu, 16, y, " Powerup Shell", &v_powerupshell,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Light Flickering", &r_lightflicker,0); y+=8; - MC_AddSlider(menu, 16, y, " Explosion Light", &r_explosionlight,0,1,0.1); y+=8; - MC_AddCheckBox(menu, 16, y, " Surface Direction Model Lighting", &r_nolightdir,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Alias Model Shadows", &r_noaliasshadows,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Realtime World Lighting", &r_shadow_realtime_world,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Realtime World Shadows", &r_shadow_realtime_world_shadows,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Realtime World Lightmaps", &r_shadow_realtime_world_lightmaps,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Realtime Dynamic Lights", &r_shadow_realtime_dlight,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Realtime Dynamic Light Shadows", &r_shadow_realtime_dlight_shadows,0); y+=8; - MC_AddCheckBox(menu, 16, y, " GLSL Offsetmapping", &r_glsl_offsetmapping,0); y+=8; - MC_AddSlider(menu, 16, y, " GLSL Offsetmapping Scale", &r_glsl_offsetmapping_scale,0,-1,0.01); y+=8; - MC_AddSlider(menu, 16, y, " Shadow Bumpscale Basetexture", &r_shadow_bumpscale_basetexture,0,10,1); y+=8; - MC_AddSlider(menu, 16, y, " Shadow Bumpscale Bumpmap", &r_shadow_bumpscale_bumpmap,0,50,1); y+=8; - info->loadlitcombo = MC_AddCombo(menu,16, y, " LIT Loading", loadlitoptions, currentloadlit); y+=8; - MC_AddSlider(menu, 16, y, " Maximum Shadow Lights", &gl_maxshadowlights,0,1000,2); y+=8; - y+=8; - MC_AddCommand(menu, 16, y, " Apply", M_VideoApplyShadowLighting); y+=8; - - menu->selecteditem = (union menuoption_s *)info->loadlitcombo; - - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 285, cursorpositionY, NULL, false); -} - -typedef struct { -menucombo_t *noskinscombo; -} teamplaymenuinfo_t; - -qboolean M_Apply_Teamplay (union menuoption_s *op,struct menu_s *menu,int key) -{ - teamplaymenuinfo_t *info = menu->data; - - if (key != K_ENTER) - return false; - - switch(info->noskinscombo->selectedoption) + if (r_shadow_realtime_world.ival) { - case 0: - Cbuf_AddText("noskins 0\n", RESTRICT_LOCAL); - break; - case 1: - Cbuf_AddText("noskins 1\n", RESTRICT_LOCAL); - break; - case 2: - Cbuf_AddText("noskins 2\n", RESTRICT_LOCAL); - break; + if (r_shadow_realtime_world_shadows.ival) + lightselect = 2; + else + lightselect = 1; } +#ifndef MINIMAL + else if (r_vertexlight.ival) + lightselect = 3; +#endif + else + lightselect = 0; - M_RemoveMenu(menu); - Cbuf_AddText("menu_teamplay\n", RESTRICT_LOCAL); - return true; + if (r_shadow_realtime_dlight.ival) + { + if (r_shadow_realtime_dlight_shadows.ival) + dlightselect = 3; + else + dlightselect = 2; + } +#ifndef MINIMAL + else if (r_vertexdlights.ival) + dlightselect = 4; +#endif + else if (r_dynamic.ival) + dlightselect = 1; + else + dlightselect = 0; + + { + lightingmenuinfo_t *info = menu->data; + menubulk_t bulk[] = + { + MB_REDTEXT("Lighting Options", false), + MB_TEXT("\x80\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x82", false), + MB_COMBORETURN("Lighting Mode", lightingopts, lightselect, info->lightcombo, "Selects method used for world lighting. Realtime lighting requires appropriate realtime lighting files for maps."), + MB_COMBORETURN("Dynamic Lighting Mode", dlightopts, dlightselect, info->dlightcombo, "Selects method used for dynamic lighting such as explosion lights and muzzle flashes."), + MB_CMD("Apply Lighting", M_VideoApplyShadowLighting, "Applies set lighting modes and restarts video."), + MB_SPACING(4), + MB_COMBOCVAR("LIT Loading", r_loadlits, loadlitopts, loadlitvalues, "Determines if the engine should use external colored lighting for maps. The generated setting will cause the engine to generate colored lighting for maps that don't have the associated data."), + MB_CHECKBOXCVAR("Lightstyle Lerp", r_lightstylesmooth, 0), + MB_SPACING(4), + 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_CHECKBOXCVAR("Powerup Shell", v_powerupshell, 0), + MB_SPACING(4), + MB_SLIDER("Stains", r_stains, 0, 1, 0.05, NULL), + MB_CHECKBOXCVAR("No Light Direction", r_nolightdir, 0), + MB_END() + }; + MC_AddBulk(menu, bulk, 16, 216, y); + } } void M_Menu_Teamplay_f (void) { static const char *noskinsoptions[] = { - "Enable Skins (Download)", - "Disable Skins", - "Enable Skins (No Download))", + "Enabled", + "Disabled", + "No Download", + NULL + }; + static const char *noskinsvalues[] = + { + "0", + "1", + "2", NULL }; - teamplaymenuinfo_t *info; - int cursorpositionY; - int currentnoskins; extern cvar_t cl_parseSay, cl_triggers, tp_forceTriggers, tp_loadlocs, cl_parseFunChars, cl_noblink, noskins; - int y; - menu_t *menu = M_Options_Title(&y, sizeof(*info)); - info = menu->data; - - cursorpositionY = (y + 24); - - currentnoskins = noskins.value; - - MC_AddRedText(menu, 16, y, " Teamplay Options", false); y+=8; - MC_AddWhiteText(menu, 16, y, " ", false); y+=8; - y+=8; - - info->noskinscombo = MC_AddCombo(menu, 16, y, " Skins", noskinsoptions, currentnoskins); y+=8; - y+=4;MC_AddEditCvar(menu, 16, y, " Enemy Skin", "cl_enemyskin"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Team Skin", "cl_teamskin"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Base Skin", "baseskin"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Fake Name", "cl_fakename"); y+=8+4; - MC_AddCheckBox(menu, 16, y, " Parse Fun Chars", &cl_parseFunChars,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Parse Macros", &cl_parseSay,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Load Locs", &tp_loadlocs,0); y+=8; - MC_AddCheckBox(menu, 16, y, " No Blink", &cl_noblink,0); y+=8; - y+=4;MC_AddEditCvar(menu, 16, y, " Sound Trigger", "tp_soundtrigger"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Fake Name", "cl_fakename"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Weapon Order", "tp_weapon_order"); y+=8+4; - MC_AddCheckBox(menu, 16, y, " Teamplay Triggers", &cl_triggers,0); y+=8; - MC_AddCheckBox(menu, 16, y, "Force Teamplay Triggers", &tp_forceTriggers,0); y+=8; - - MC_AddCommand(menu, 16, y, " Apply", M_Apply_Teamplay); y+=8; - - y+=8; - MC_AddConsoleCommand(menu, 16, y, "Teamplay Location Names", "menu_teamplay_locations\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " Teamplay Item Needs", "menu_teamplay_needs\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " Teamplay Item Names", "menu_teamplay_items\n"); y+=8; - - menu->selecteditem = (union menuoption_s *)info->noskinscombo; - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, cursorpositionY, NULL, false); + menubulk_t bulk[] = + { + MB_REDTEXT("Teamplay Options", false), + MB_TEXT("\x80\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x82", false), + MB_COMBOCVAR("Skins", noskins, noskinsoptions, noskinsvalues, "Enable or disable player skin usage. No download will use skins but will not download them from the server."), + MB_EDITCVAR("Enemy Skin", "cl_enemyskin"), + MB_EDITCVAR("Team Skin", "cl_teamskin"), + MB_EDITCVAR("Fake Name", "cl_fakename"), + MB_CHECKBOXCVAR("Parse Fun Chars", cl_parseFunChars, 0), + MB_CHECKBOXCVAR("Parse Macros", cl_parseSay, 0), + MB_CHECKBOXCVAR("Load Locs", tp_loadlocs, 0), + MB_CHECKBOXCVAR("No Blink", cl_noblink, 0), + MB_EDITCVAR("Sound Trigger", "tp_soundtrigger"), + MB_EDITCVAR("Weapon Order", "tp_weapon_order"), + MB_CHECKBOXCVAR("Teamplay Triggers", cl_triggers, 0), + MB_CHECKBOXCVAR("Force Triggers", tp_forceTriggers, 0), + MB_SPACING(4), + MB_CONSOLECMD("Location Names", "menu_teamplay_locations\n", "Modify team play location settings."), + MB_CONSOLECMD("Item Needs", "menu_teamplay_needs\n", "Modify messages for item needs in team play macros."), + MB_CONSOLECMD("Item Names", "menu_teamplay_items\n", "Modify messages for items in team play macros."), + MB_END() + }; + menu_t *menu = M_Options_Title(&y, 0); + MC_AddBulk(menu, bulk, 16, 200, y); } void M_Menu_Teamplay_Locations_f (void) { menu_t *menu; - int cursorpositionY; - - int y; + menubulk_t bulk[] = + { + MB_REDTEXT("Teamplay Location Names", false), + MB_TEXT("\x80\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x82", false), + MB_EDITCVARSLIM("Separator", "loc_name_separator"), + MB_SPACING(4), + MB_EDITCVARSLIM("Super Shotgun", "loc_name_ssg"), + MB_EDITCVARSLIM("Nailgun", "loc_name_ng"), + MB_EDITCVARSLIM("Super Nailgun", "loc_name_sng"), + MB_EDITCVARSLIM("Grenade Launcher", "loc_name_gl"), + MB_EDITCVARSLIM("Rocket Launcher", "loc_name_rl"), + MB_EDITCVARSLIM("Lightning Gun", "loc_name_lg"), + MB_SPACING(4), + MB_EDITCVARSLIM("Quad Damage", "loc_name_quad"), + MB_EDITCVARSLIM("Pentagram", "loc_name_pent"), + MB_EDITCVARSLIM("Ring of Invis", "loc_name_ring"), + MB_EDITCVARSLIM("Suit", "loc_name_suit"), + MB_SPACING(4), + MB_EDITCVARSLIM("Green Armor", "loc_name_ga"), + MB_EDITCVARSLIM("Yellow Armor", "loc_name_ya"), + MB_EDITCVARSLIM("Red Armor", "loc_name_ra"), + // TODO: we probably need an actual back button or some such + //MB_SPACING(4), + //MB_CONSOLECMD("\x7f Teamplay", "menu_teamplay\n", "Return to the teamplay menu."), + MB_END() + }; menu = M_Options_Title(&y, 0); - - cursorpositionY = (y + 24); - - //menu->selecteditem = (union menuoption_s *) - - MC_AddRedText(menu, 16, y, " Teamplay Location Names", false); y+=8; - MC_AddWhiteText(menu, 16, y, " ", false); y+=8; - y+=8; - y+=4;MC_AddEditCvar(menu, 16, y, " Green Armor ", "loc_name_ga"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Grenade Launcher", "loc_name_gl"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Lightning Gun", "loc_name_lg"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Nailgun", "loc_name_ng"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Pentagram", "loc_name_pent"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Quad", "loc_name_quad"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Red Armor", "loc_name_ra"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Ring", "loc_name_ring"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Rocket Launcher", "loc_name_rl"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Seperator", "loc_name_seperator"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Super Nailgun", "loc_name_sng"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Super Shotgun", "loc_name_ssg"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Suit", "loc_name_suit"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Yellow Armor", "loc_name_ya"); y+=8+4; - - y+=8; - MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Options", "menu_teamplay\n"); y+=8; - - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 232, cursorpositionY, NULL, false); + MC_AddBulk(menu, bulk, 16, 200, y); } void M_Menu_Teamplay_Needs_f (void) { menu_t *menu; - int cursorpositionY; - int y; + menubulk_t bulk[] = + { + MB_REDTEXT("Teamplay Needed Items", false), + MB_TEXT("\x80\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x82", false), + MB_EDITCVARSLIM("Shells", "tp_need_shells"), + MB_EDITCVARSLIM("Nails", "tp_need_nails"), + MB_EDITCVARSLIM("Rockets", "tp_need_rockets"), + MB_EDITCVARSLIM("Cells", "tp_need_cells"), + MB_EDITCVARSLIM("Rocket Launcher", "tp_need_rl"), + MB_SPACING(4), + MB_EDITCVARSLIM("Green Armor", "tp_need_ga"), + MB_EDITCVARSLIM("Yellow Armor", "tp_need_ya"), + MB_EDITCVARSLIM("Red Armor", "tp_need_ra"), + MB_SPACING(4), + MB_EDITCVARSLIM("Health", "tp_need_health"), + MB_EDITCVARSLIM("Weapon", "tp_need_weapon"), + MB_END() + }; menu = M_Options_Title(&y, 0); - - cursorpositionY = (y + 24); - - //menu->selecteditem = (union menuoption_s *) - - MC_AddRedText(menu, 16, y, " Teamplay Needed Items", false); y+=8; - MC_AddWhiteText(menu, 16, y, " ", false); y+=8; - y+=8; - y+=4;MC_AddEditCvar(menu, 16, y, " Cells", "tp_need_cells"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Green Armor", "tp_need_ga"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Health", "tp_need_health"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Nails", "tp_need_nails"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Red Armor", "tp_need_ra"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Rocket Launcher", "tp_need_rl"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Rockets", "tp_need_rockets"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Shells", "tp_need_shells"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Weapon", "tp_need_weapon"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Yellow Armor", "tp_need_ya"); y+=8+4; - - y+=8; - MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Options", "menu_teamplay\n"); y+=8; - - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, cursorpositionY, NULL, false); + MC_AddBulk(menu, bulk, 16, 200, y); } void M_Menu_Teamplay_Items_f (void) { menu_t *menu; - int cursorpositionY; - int y; + menubulk_t bulk[] = + { + MB_REDTEXT("Teamplay Item Names", false), + MB_TEXT("\x80\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x82", false), + MB_CONSOLECMD("Armor", "menu_teamplay_armor\n", "Modify team play macro armor names."), + MB_CONSOLECMD("Weapon", "menu_teamplay_weapons\n", "Modify team play macro weapon names."), + MB_CONSOLECMD("Powerups", "menu_teamplay_powerups\n", "Modify team play macro powerup names."), + MB_CONSOLECMD("Ammo/Health", "menu_teamplay_ammo_health\n", "Modify team play macro ammo and health names."), + MB_CONSOLECMD("Team Fortress", "menu_teamplay_team_fortress\n", "Modify Team Fortress exclusive team play macro names."), + MB_CONSOLECMD("Status/Location/Misc", "menu_teamplay_status_location_misc\n", "Modify status, location, and miscellaneous team play macro names."), + MB_END() + }; menu = M_Options_Title(&y, 0); - - cursorpositionY = (y + 24); - - //menu->selecteditem = (union menuoption_s *) - - MC_AddRedText(menu, 16, y, " Teamplay Item Names", false); y+=8; - MC_AddWhiteText(menu, 16, y, " ", false); y+=8; - y+=8; - MC_AddConsoleCommand(menu, 16, y, " -> Teamplay Armor Names", "menu_teamplay_armor\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " -> Teamplay Weapon Names", "menu_teamplay_weapons\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " -> Teamplay Powerup Names", "menu_teamplay_powerups\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " -> Teamplay Ammo & Health Names", "menu_teamplay_ammo_health\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " -> Teamplay Team Fortress Item Names", "menu_teamplay_team_fortress\n"); y+=8; - MC_AddConsoleCommand(menu, 16, y, " -> Teamplay Status, Location & Misc Names", "menu_teamplay_status_location_misc\n"); y+=8; - - y+=8; - MC_AddConsoleCommand(menu, 16, y, " <- Teamplay Options", "menu_teamplay\n"); y+=8; - - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 64, cursorpositionY, NULL, false); + MC_AddBulk(menu, bulk, 16, 224, y); } void M_Menu_Teamplay_Items_Armor_f (void) { menu_t *menu; - int cursorpositionY; - int y; + menubulk_t bulk[] = + { + MB_REDTEXT("Teamplay Armor Names", false), + MB_TEXT("\x80\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x82", false), + MB_EDITCVARSLIM("Armor", "tp_name_armor"), + MB_EDITCVARSLIM("Green Type -", "tp_name_armortype_ga"), + MB_EDITCVARSLIM("Yellow Type -", "tp_name_armortype_ya"), + MB_EDITCVARSLIM("Red Type -", "tp_name_armortype_ra"), + MB_SPACING(4), + MB_EDITCVARSLIM("Green Armor", "tp_name_ga"), + MB_EDITCVARSLIM("Yellow Armor", "tp_name_ya"), + MB_EDITCVARSLIM("Red Armor", "tp_name_ra"), + MB_END() + }; menu = M_Options_Title(&y, 0); - - cursorpositionY = (y + 24); - - //menu->selecteditem = (union menuoption_s *) - - MC_AddRedText(menu, 16, y, " Teamplay Armor Names", false); y+=8; - MC_AddWhiteText(menu, 16, y, " ", false); y+=8; - y+=8; - y+=4;MC_AddEditCvar(menu, 16, y, " Armor", "tp_name_armor"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Armor Type - Green", "tp_name_armortype_ga"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Armor Type - Red", "tp_name_armortype_ra"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Armor Type - Yellow", "tp_name_armortype_ya"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Green Armor", "tp_name_ga"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Red Armor", "tp_name_ra"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Yellow Armor", "tp_name_ya"); y+=8+4; - - y+=8; - MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Item Names", "menu_teamplay_items\n"); y+=8; - - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 232, cursorpositionY, NULL, false); + MC_AddBulk(menu, bulk, 16, 200, y); } void M_Menu_Teamplay_Items_Weapons_f (void) { menu_t *menu; - int cursorpositionY; int y; + menubulk_t bulk[] = + { + MB_REDTEXT("Teamplay Weapon Names", false), + MB_TEXT("\x80\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x82", false), + MB_EDITCVARSLIM("Weapon", "tp_name_weapon"), + MB_SPACING(4), + MB_EDITCVARSLIM("Axe", "tp_name_axe"), + MB_EDITCVARSLIM("Shotgun", "tp_name_sg"), + MB_EDITCVARSLIM("Super Shotgun", "tp_name_ssg"), + MB_EDITCVARSLIM("Nailgun", "tp_name_ng"), + MB_EDITCVARSLIM("Super Nailgun", "tp_name_sng"), + MB_EDITCVARSLIM("Grenade Launcher", "tp_name_gl"), + MB_EDITCVARSLIM("Rocket Launcher", "tp_name_rl"), + MB_EDITCVARSLIM("Lightning Gun", "tp_name_lg"), + MB_END() + }; menu = M_Options_Title(&y, 0); - - cursorpositionY = (y + 24); - - //menu->selecteditem = (union menuoption_s *) - - MC_AddRedText(menu, 16, y, " Teamplay Weapon Names", false); y+=8; - MC_AddWhiteText(menu, 16, y, " ", false); y+=8; - y+=8; - y+=4;MC_AddEditCvar(menu, 16, y, " Axe", "tp_name_axe"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Grenade Launcher", "tp_name_gl"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Lightning Gun", "tp_name_lg"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Nailgun", "tp_name_ng"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Rocket Launcher", "tp_name_rl"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Shotgun", "tp_name_sg"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Super Nailgun", "tp_name_sng"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Super Shotgun", "tp_name_ssg"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Weapon", "tp_name_weapon"); y+=8+4; - - y+=8; - MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Item Names", "menu_teamplay_items\n"); y+=8; - - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, cursorpositionY, NULL, false); + MC_AddBulk(menu, bulk, 16, 200, y); } void M_Menu_Teamplay_Items_Powerups_f (void) { menu_t *menu; - int cursorpositionY; int y; + menubulk_t bulk[] = + { + MB_REDTEXT("Teamplay Powerup Names", false), + MB_TEXT("\x80\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x82", false), + MB_EDITCVARSLIM("Quad Damage", "tp_name_quad"), + MB_EDITCVARSLIM("Pentagram", "tp_name_pent"), + MB_EDITCVARSLIM("Ring of Invis", "tp_name_ring"), + MB_EDITCVARSLIM("Suit", "tp_name_suit"), + MB_SPACING(4), + MB_EDITCVARSLIM("Quaded", "tp_name_quaded"), + MB_EDITCVARSLIM("Pented", "tp_name_pented"), + MB_EDITCVARSLIM("Eyes (Ringed)", "tp_name_eyes"), + MB_SPACING(4), + MB_EDITCVARSLIM("Resistance Rune", "tp_name_rune_1"), + MB_EDITCVARSLIM("Strength Rune", "tp_name_rune_2"), + MB_EDITCVARSLIM("Haste Rune", "tp_name_rune_3"), + MB_EDITCVARSLIM("Regen Rune", "tp_name_rune_4"), + MB_END() + }; menu = M_Options_Title(&y, 0); - - cursorpositionY = (y + 24); - - //menu->selecteditem = (union menuoption_s *) - - MC_AddRedText(menu, 16, y, " Teamplay Powerup Names", false); y+=8; - MC_AddWhiteText(menu, 16, y, " ", false); y+=8; - y+=8; - y+=4;MC_AddEditCvar(menu, 16, y, " Pentagram", "tp_name_pent"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Pented", "tp_name_pented"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Quad", "tp_name_quad"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Quaded", "tp_name_quaded"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Ring", "tp_name_ring"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Eyes (Ring)", "tp_name_eyes"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Resistance Rune", "tp_name_rune_1"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Strength Rune", "tp_name_rune_2"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Haste Rune", "tp_name_rune_3"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Regeneration Rune", "tp_name_rune_4"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Suit", "tp_name_suit"); y+=8+4; - - y+=8; - MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Item Names", "menu_teamplay_items\n"); y+=8; - - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, cursorpositionY, NULL, false); + MC_AddBulk(menu, bulk, 16, 200, y); } void M_Menu_Teamplay_Items_Ammo_Health_f (void) { menu_t *menu; - int cursorpositionY; - int y; + menubulk_t bulk[] = + { + MB_REDTEXT("Teamplay Ammo/Health", false), + MB_TEXT("\x80\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x82", false), + MB_EDITCVARSLIM("Shells", "tp_name_shells"), + MB_EDITCVARSLIM("Nails", "tp_name_nails"), + MB_EDITCVARSLIM("Rockets", "tp_name_rockets"), + MB_EDITCVARSLIM("Cells", "tp_name_cells"), + MB_SPACING(4), + MB_EDITCVARSLIM("Backpack", "tp_name_backpack"), + MB_EDITCVARSLIM("Health", "tp_name_health"), + MB_EDITCVARSLIM("Mega Health", "tp_name_mh"), + MB_END() + }; menu = M_Options_Title(&y, 0); - - cursorpositionY = (y + 24); - - //menu->selecteditem = (union menuoption_s *) - - MC_AddRedText(menu, 16, y, " Teamplay Ammo & Health Names", false); y+=8; - MC_AddWhiteText(menu, 16, y, " ", false); y+=8; - y+=8; - y+=4;MC_AddEditCvar(menu, 16, y, " Backpack", "tp_name_backpack"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Cells", "tp_name_cells"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Nails", "tp_name_nails"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Rockets", "tp_name_rockets"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Shells", "tp_name_shells"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Health", "tp_name_health"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Mega Health", "tp_name_mh"); y+=8+4; - - y+=8; - MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Item Names", "menu_teamplay_items\n"); y+=8; - - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, cursorpositionY, NULL, false); + MC_AddBulk(menu, bulk, 16, 200, y); } void M_Menu_Teamplay_Items_Team_Fortress_f (void) { menu_t *menu; - int cursorpositionY; - int y; + menubulk_t bulk[] = + { + MB_REDTEXT("Teamplay Team Fortress", false), + MB_TEXT("\x80\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x82", false), + MB_EDITCVARSLIM("Sentry Gun", "tp_name_sentry"), + MB_EDITCVARSLIM("Dispenser", "tp_name_disp"), + MB_EDITCVARSLIM("Flag", "tp_name_flag"), + MB_END() + }; menu = M_Options_Title(&y, 0); - - cursorpositionY = (y + 24); - - //menu->selecteditem = (union menuoption_s *) - - MC_AddRedText(menu, 16, y, " Teamplay Team Fortress Item Names", false); y+=8; - MC_AddWhiteText(menu, 16, y, " ", false); y+=8; - y+=8; - y+=4;MC_AddEditCvar(menu, 16, y, " Sentry Gun", "tp_name_sentry"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Dispenser", "tp_name_disp"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Flag", "tp_name_flag"); y+=8+4; - - y+=8; - MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Item Names", "menu_teamplay_items\n"); y+=8; - - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, cursorpositionY, NULL, false); + MC_AddBulk(menu, bulk, 16, 200, y); } void M_Menu_Teamplay_Items_Status_Location_Misc_f (void) { menu_t *menu; - int cursorpositionY; - int y; + menubulk_t bulk[] = + { + MB_REDTEXT("Teamplay Misc", false), + MB_TEXT("\x80\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x82", false), + MB_EDITCVARSLIM("Enemy", "tp_name_enemy"), + MB_EDITCVARSLIM("Teammate", "tp_name_teammate"), + MB_SPACING(4), + MB_EDITCVARSLIM("At (Location)", "tp_name_at"), + MB_EDITCVARSLIM("None", "tp_name_none"), + MB_EDITCVARSLIM("Nothing", "tp_name_nothing"), + MB_EDITCVARSLIM("Separator", "tp_name_separator"), + MB_EDITCVARSLIM("Some place", "tp_name_someplace"), + MB_SPACING(4), + MB_EDITCVARSLIM("Red Status", "tp_name_status_red"), + MB_EDITCVARSLIM("Green Status", "tp_name_status_green"), + MB_EDITCVARSLIM("Blue Status", "tp_name_status_blue"), + MB_EDITCVARSLIM("Yellow Status", "tp_name_status_yellow"), + MB_END() + }; menu = M_Options_Title(&y, 0); - - cursorpositionY = (y + 24); - - //menu->selecteditem = (union menuoption_s *) - - MC_AddRedText(menu, 16, y, " Teamplay Status, Location & Misc. Names", false); y+=8; - MC_AddWhiteText(menu, 16, y, " ", false); y+=8; - y+=8; - y+=4;MC_AddEditCvar(menu, 16, y, " At (Location)", "tp_name_at"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Enemy", "tp_name_enemy"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " None", "tp_name_none"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Nothing", "tp_name_nothing"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Seperator", "tp_name_seperator"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Someplace", "tp_name_someplace"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Status Blue", "tp_name_status_blue"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Status Green", "tp_name_status_green"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Status Red", "tp_name_status_red"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Status Yellow", "tp_name_status_yellow"); y+=8+4; - y+=4;MC_AddEditCvar(menu, 16, y, " Teammate", "tp_name_teammate"); y+=8+4; - - y+=8; - MC_AddConsoleCommand(menu, 16, y, "<- Teamplay Item Names", "menu_teamplay_items\n"); y+=8; - - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 200, cursorpositionY, NULL, false); + MC_AddBulk(menu, bulk, 16, 200, y); } typedef struct { @@ -1720,7 +1360,7 @@ qboolean M_Apply_SP_Cheats (union menuoption_s *op,struct menu_s *menu,int key) } -void M_Menu_Singleplayer_Cheats_f (void) +void M_Menu_Singleplayer_Cheats_Quake (void) { static const char *skilloptions[] = { @@ -1831,12 +1471,12 @@ qboolean M_Apply_SP_Cheats_Q2 (union menuoption_s *op,struct menu_s *menu,int ke Cbuf_AddText(va("map %s\n", maplist_q2[info->mapcombo->selectedoption]), RESTRICT_LOCAL); M_RemoveMenu(menu); - Cbuf_AddText("menu_quake2_spcheats\n", RESTRICT_LOCAL); + Cbuf_AddText("menu_spcheats\n", RESTRICT_LOCAL); return true; } -void M_Menu_Singleplayer_Cheats_Quake2_f (void) +void M_Menu_Singleplayer_Cheats_Quake2 (void) { static const char *skilloptions[] = @@ -2072,12 +1712,12 @@ qboolean M_Apply_SP_Cheats_H2 (union menuoption_s *op,struct menu_s *menu,int ke } M_RemoveMenu(menu); - Cbuf_AddText("menu_hexen2_spcheats\n", RESTRICT_LOCAL); + Cbuf_AddText("menu_spcheats\n", RESTRICT_LOCAL); return true; } -void M_Menu_Singleplayer_Cheats_Hexen2_f (void) +void M_Menu_Singleplayer_Cheats_Hexen2 (void) { static const char *skilloptions[] = @@ -2278,3 +1918,528 @@ void M_Menu_Singleplayer_Cheats_Hexen2_f (void) menu->selecteditem = (union menuoption_s *)info->skillcombo; menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 250, cursorpositionY, NULL, false); } + +void M_Menu_Singleplayer_Cheats_f (void) +{ + switch(M_GameType()) + { + case MGT_QUAKE1: + M_Menu_Singleplayer_Cheats_Quake(); + break; + case MGT_QUAKE2: + M_Menu_Singleplayer_Cheats_Quake2(); + break; + case MGT_HEXEN2: + M_Menu_Singleplayer_Cheats_Hexen2(); + break; + } +} + +// video mode options +#if defined(D3DQUAKE) && defined(GLQUAKE) +#define MULTIRENDERER // allow options for selecting renderer +#endif + +static const char *res4x3[] = +{ + "640x480", + "800x600", + "960x720", + "1024x768", + "1152x864", + "1280x960", + "1440x1080", + "1600x1200", +// "1792x1344", +// "1856x1392", + "1920x1440", + "2048x1536", + NULL +}; +static const char *res5x4[] = +{ + "1280x1024", + "1800x1440", + "2560x2048", + NULL +}; +static const char *res16x9[] = +{ + "856x480", + "1024x576", + "1280x720", + "1366x768", + "1600x900", + "1920x1080", + "2048x1152", + NULL +}; +static const char *res16x10[] = +{ + "1024x640", + "1152x720", + "1280x800", + "1440x900", + "1680x1050", + "1920x1200", + "2304x1440", + "2560x1600", + NULL +}; +#define ASPECT_RATIOS 4 +static const char **resaspects[ASPECT_RATIOS] = +{ + res4x3, + res5x4, + res16x9, + res16x10 +}; +#define ASPECT_LIST "4:3", "5:4", "16:9", "16:10", + +qboolean M_Vid_GetMode(int num, int *w, int *h) +{ + int i; + + for (i = 0; i < 4; i++) + { + const char **v = resaspects[i]; + while (*v && num) + { + v++; + num--; + } + if (v) + { + const char *c = *v; + const char *s = strchr(c, 'x'); + if (s) + { + *w = atoi(c); + *h = atoi(s + 1); + return true; + } + return false; + } + } + return false; +} + +typedef struct { + menucombo_t *resmode; + menuedit_t *width; + menuedit_t *height; + menuedit_t *bpp; + menuedit_t *hz; + menucombo_t *bppfixed; + menucombo_t *hzfixed; + menucombo_t *res2dmode; + menucombo_t *scale; + menuedit_t *width2d; + menuedit_t *height2d; + menucombo_t *ressize[ASPECT_RATIOS]; + menucombo_t *res2dsize[ASPECT_RATIOS]; +} videomenuinfo_t; + +void CheckCustomMode(struct menu_s *menu) +{ + int i, sel; + videomenuinfo_t *info = (videomenuinfo_t*)menu->data; + + // hide all display controls + info->width->common.ishidden = true; + info->height->common.ishidden = true; + info->bpp->common.ishidden = true; + info->hz->common.ishidden = true; + info->bppfixed->common.ishidden = true; + info->hzfixed->common.ishidden = true; + for (i = 0; i < ASPECT_RATIOS; i++) + info->ressize[i]->common.ishidden = true; + sel = info->resmode->selectedoption; + if (sel < ASPECT_RATIOS) + { + // unhide appropriate aspect ratio combo and restricted bpp/hz combos + info->bppfixed->common.ishidden = false; + info->hzfixed->common.ishidden = false; + info->ressize[sel]->common.ishidden = false; + } + else if (sel == (ASPECT_RATIOS + 1)) + { // unhide custom entries for custom option + info->width->common.ishidden = false; + info->height->common.ishidden = false; + info->bpp->common.ishidden = false; + info->hz->common.ishidden = false; + } + // hide all 2d display controls + info->width2d->common.ishidden = true; + info->height2d->common.ishidden = true; + info->scale->common.ishidden = true; + for (i = 0; i < ASPECT_RATIOS; i++) + info->res2dsize[i]->common.ishidden = true; + sel = info->res2dmode->selectedoption; + if (sel < ASPECT_RATIOS) // unhide appropriate aspect ratio combo + info->res2dsize[sel]->common.ishidden = false; + else if (sel == (ASPECT_RATIOS + 1)) // unhide scale option + info->scale->common.ishidden = false; + else if (sel == (ASPECT_RATIOS + 2)) // unhide custom entries for custom option + { + info->width2d->common.ishidden = false; + info->height2d->common.ishidden = false; + } +} + +int M_MatchModes(int width, int height, int *outres) +{ + int i; + int ratio = -1; + + // find closest resolution for each ratio + for (i = 0; i < ASPECT_RATIOS; i++) + { + const char **v = resaspects[i]; + outres[i] = 0; + // search through each string in ratio array + while (*v) + { + const char *c = *v; + int w = atoi(c); + if (width <= w) + { + if (width == w) + { + // if we match height as well we have a direct resolution match + // so record ratio index + const char *s = strchr(c, 'x'); + if (s) + { + int h = atoi(s + 1); + if (height == h) + ratio = i; + } + } + break; + } + outres[i]++; + v++; + } + } + + return ratio; +} + +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; + + if (key != K_ENTER && key != K_MOUSE1) + return false; + + // force update display options + { + int w = 0, h = 0; + const char *wc = NULL; + const char *hc = NULL; + const char *bc = "32"; + const char *fc = "0"; + const char *dc = "0"; + + switch (info->resmode->selectedoption) + { + case ASPECT_RATIOS: // Desktop + dc = "1"; + break; + case ASPECT_RATIOS + 1: // Custom + wc = info->width->text; + hc = info->height->text; + bc = info->bpp->text; + fc = info->hz->text; + break; + default: // Aspects + { + menucombo_t *c = info->ressize[info->resmode->selectedoption]; + const char *res = c->options[c->selectedoption]; + const char *x = strchr(res, 'x'); + + w = atoi(res); + h = atoi(x + 1); + + bc = info->bppfixed->values[info->bppfixed->selectedoption]; + fc = info->hzfixed->values[info->hzfixed->selectedoption]; + } + } + + if (!wc) + Cvar_SetValue(info->width->cvar, w); + else + Cvar_Set(info->width->cvar, wc); + if (!hc) + Cvar_SetValue(info->height->cvar, h); + else + Cvar_Set(info->height->cvar, hc); + Cvar_Set(info->bpp->cvar, bc); + Cvar_Set(info->hz->cvar, fc); + Cvar_Set(&vid_desktopsettings, dc); + } + + // force update 2d options + { + int w = 0, h = 0; + const char *wc = NULL; + const char *hc = NULL; + const char *sc = "0"; + + switch (info->res2dmode->selectedoption) + { + case ASPECT_RATIOS: // Default + break; + case ASPECT_RATIOS + 1: // Scale + sc = info->scale->values[info->scale->selectedoption]; + break; + case ASPECT_RATIOS + 2: // Custom + wc = info->width2d->text; + hc = info->height2d->text; + break; + default: // Aspects + { + menucombo_t *c = info->res2dsize[info->res2dmode->selectedoption]; + const char *res = c->options[c->selectedoption]; + const char *x = strchr(res, 'x'); + + w = atoi(res); + h = atoi(x + 1); + } + } + + if (!wc) + Cvar_SetValue(info->width2d->cvar, w); + else + Cvar_Set(info->width2d->cvar, wc); + if (!hc) + Cvar_SetValue(info->height2d->cvar, h); + else + Cvar_Set(info->height2d->cvar, hc); + Cvar_Set(info->scale->cvar, sc); + } + + // restart video to apply latched cvars + M_RemoveMenu(menu); + Cbuf_AddText("vid_restart\nmenu_video\n", RESTRICT_LOCAL); + return true; +} + +void M_Menu_Video_f (void) +{ + extern cvar_t v_contrast, vid_width, vid_height, vid_conwidth, vid_conheight; + extern cvar_t vid_fullscreen, vid_desktopsettings, vid_conautoscale; + extern cvar_t vid_desktopgamma, vid_hardwaregamma, vid_preservegamma; + extern cvar_t vid_bpp, vid_refreshrate, vid_renderer, vid_multisample; + + static const char *rendererops[] = + { +#ifdef GLQUAKE + "OpenGL", +#endif +#ifdef D3DQUAKE + "Direct3D", +#endif + NULL + }; + static const char *renderervalues[] = + { +#ifdef GLQUAKE + "gl", +#endif +#ifdef D3DQUAKE + "d3d", +#endif + NULL + }; + + static const char *aaopts[] = { + "1x", + "2x", + "4x", + "6x", + "8x", + NULL + }; + static const char *aavalues[] = {"0", "2", "4", "6", "8", NULL}; + + static const char *resmodeopts[] = { + ASPECT_LIST + "Desktop", + "Custom", + NULL + }; + + static const char *bppopts[] = + { + "16-bit", + "32-bit", + NULL + }; + static const char *bppvalues[] = {"16", "32", NULL}; + + static const char *refreshopts[] = + { + "Default", + "59Hz", + "60Hz", + "70Hz", + "72Hz", + "75Hz", + "85Hz", + "100Hz", + "120Hz", + NULL + }; + static const char *refreshvalues[] = {"", "59", "60", "70", "72", "75", "85", "100", "120", NULL}; + + static const char *res2dmodeopts[] = { + ASPECT_LIST + "Default", + "Scale", + "Custom", + NULL + }; + + static const char *scaleopts[] = { + "1x", + "1.5x", + "2x", + "2.5x", + "3x", + "4x", + "5x", + "6x", + NULL + }; + static const char *scalevalues[] = { "1", "1.5", "2", "2.5", "3", "4", "5", "6", NULL}; + + static const char *vsyncoptions[] = + { + "Off", + "Wait for Vertical Sync", + "Wait for Display Enable", + NULL + }; + + videomenuinfo_t *info; + static char current3dres[32]; // enough to fit 1920x1200 + + extern cvar_t _vid_wait_override; + + int y; + int resmodechoice, res2dmodechoice; + int reschoices[ASPECT_RATIOS], res2dchoices[ASPECT_RATIOS]; + menu_t *menu = M_Options_Title(&y, sizeof(videomenuinfo_t)); + info = (videomenuinfo_t*)menu->data; + + snprintf(current3dres, sizeof(current3dres), "Current: %ix%i", vid.pixelwidth, vid.pixelheight); + resmodechoice = M_MatchModes(vid.pixelwidth, vid.pixelheight, reschoices); + if (vid_desktopsettings.ival) + resmodechoice = ASPECT_RATIOS; + else if (resmodechoice < 0) + resmodechoice = ASPECT_RATIOS + 1; + res2dmodechoice = M_MatchModes(vid.pixelwidth, vid.pixelheight, res2dchoices); + if (vid_conautoscale.ival >= 1) + res2dmodechoice = ASPECT_RATIOS + 1; + else if (!vid_conwidth.ival && !vid_conheight.ival) + res2dmodechoice = ASPECT_RATIOS; + else if (res2dmodechoice < 0) + res2dmodechoice = ASPECT_RATIOS + 2; + + { + menubulk_t bulk[] = + { + MB_REDTEXT("Video Options", false), + MB_TEXT("\x80\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x81\x82", false), +#ifdef MULTIRENDERER + MB_COMBOCVAR("Renderer", vid_renderer, rendererops, renderervalues, NULL), +#endif + 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), + // aspect entries + MB_COMBORETURN("Size", resaspects[0], reschoices[0], info->ressize[0], NULL), + MB_SPACING(-8), + MB_COMBORETURN("Size", resaspects[1], reschoices[1], info->ressize[1], NULL), + MB_SPACING(-8), + MB_COMBORETURN("Size", resaspects[2], reschoices[2], info->ressize[2], NULL), + 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_SPACING(-24), // really hacky... + // custom enteries + MB_EDITCVARSLIMRETURN("Width", "vid_width", info->width), + MB_EDITCVARSLIMRETURN("Height", "vid_height", info->height), + 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), + // 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_SPACING(-8), + MB_COMBORETURN("Size", resaspects[1], res2dchoices[1], info->res2dsize[1], NULL), + MB_SPACING(-8), + MB_COMBORETURN("Size", resaspects[2], res2dchoices[2], info->res2dsize[2], NULL), + MB_SPACING(-8), + MB_COMBORETURN("Size", resaspects[3], res2dchoices[3], info->res2dsize[3], NULL), + 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_SPACING(4), + MB_SLIDER("View Size", scr_viewsize, 30, 120, 10, NULL), + MB_SLIDER("Gamma", v_gamma, 0.25, 1.5, 0.05, NULL), + MB_SLIDER("Contrast", v_contrast, 0.8, 3, 0.05, NULL), + MB_END() + }; + MC_AddBulk(menu, bulk, 16, 200, y); + } + + /* + y += 8; + MC_AddRedText(menu, 200, y, current3dres, false); y+=8; + + y+=8; + MC_AddRedText(menu, 0, y, " ", false); y+=8; + y+=8; + info->renderer = MC_AddCombo(menu, 16, y, " Renderer", rendererops, i); y+=8; + info->bppcombo = MC_AddCombo(menu, 16, y, " Color Depth", bppnames, currentbpp); y+=8; + info->refreshratecombo = MC_AddCombo(menu, 16, y, " Refresh Rate", refreshrates, currentrefreshrate); y+=8; + info->modecombo = MC_AddCombo(menu, 16, y, " Video Size", modenames, prefabmode+1); y+=8; + MC_AddWhiteText(menu, 16, y, " 3D Aspect Ratio", false); y+=8; + info->conscalecombo = MC_AddCombo(menu, 16, y, " 2D Size", modenames, prefab2dmode+1); y+=8; + MC_AddWhiteText(menu, 16, y, " 2D Aspect Ratio", false); y+=8; + MC_AddCheckBox(menu, 16, y, " Fullscreen", &vid_fullscreen,0); y+=8; + y+=4;info->customwidth = MC_AddEdit(menu, 16, y, " Custom width", vid_width.string); y+=8; + y+=4;info->customheight = MC_AddEdit(menu, 16, y, " Custom height", vid_height.string); y+=12; + info->vsynccombo = MC_AddCombo(menu, 16, y, " VSync", vsyncoptions, currentvsync); y+=8; + //MC_AddCheckBox(menu, 16, y, " Override VSync", &_vid_wait_override,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Desktop Settings", &vid_desktopsettings,0); y+=8; + y+=8; + MC_AddCommand(menu, 16, y, "= Apply Changes =", M_VideoApply); y+=8; + y+=8; + MC_AddSlider(menu, 16, y, " Screen size", &scr_viewsize, 30, 120, 1);y+=8; + MC_AddSlider(menu, 16, y, "Console Autoscale",&vid_conautoscale, 0, 6, 0.25); y+=8; + MC_AddSlider(menu, 16, y, " Gamma", &v_gamma, 0.3, 1, 0.05); y+=8; + MC_AddCheckBox(menu, 16, y, " Desktop Gamma", &vid_desktopgamma,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Hardware Gamma", &vid_hardwaregamma,0); y+=8; + MC_AddCheckBox(menu, 16, y, " Preserve Gamma", &vid_preservegamma,0); y+=8; + MC_AddSlider(menu, 16, y, " Contrast", &v_contrast, 1, 3, 0.05); y+=8; + y+=8; + MC_AddCheckBox(menu, 16, y, " Windowed Mouse", &_windowed_mouse,0); y+=8; + + menu->selecteditem = (union menuoption_s *)info->renderer; + menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 152, menu->selecteditem->common.posy, NULL, false); + */ + menu->event = CheckCustomMode; +} diff --git a/engine/client/m_single.c b/engine/client/m_single.c index a33da9b2..61af2b26 100644 --- a/engine/client/m_single.c +++ b/engine/client/m_single.c @@ -711,34 +711,6 @@ void M_Menu_Demos_f (void) ShowDemoMenu(menu, ""); } -void M_Menu_ParticleSets_f (void) -{ - demomenu_t *info; - menu_t *menu; - - key_dest = key_menu; - m_state = m_complex; - - menu = M_CreateMenu(sizeof(demomenu_t)); - menu->remove = M_Demo_Remove; - info = menu->data; - - info->command[0] = "r_particlesystem script; r_particlesdesc"; - info->ext[0] = ".cfg"; - info->numext = 1; - - MC_AddWhiteText(menu, 24, 8, "Choose a Particle Set", false); - MC_AddWhiteText(menu, 16, 24, "\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\37", false); - - info->list = MC_AddCustom(menu, 0, 32, NULL); - info->list->draw = M_DemoDraw; - info->list->key = M_DemoKey; - - menu->selecteditem = (menuoption_t*)info->list; - - ShowDemoMenu(menu, "particles/"); -} - void M_Menu_MediaFiles_f (void) { demomenu_t *info; diff --git a/engine/client/menu.c b/engine/client/menu.c index b3c54b31..a4bc1bfc 100644 --- a/engine/client/menu.c +++ b/engine/client/menu.c @@ -776,8 +776,8 @@ void M_QuickConnect_f(void); void M_Menu_MediaFiles_f (void); void M_Menu_FPS_f (void); -void M_Menu_Shadow_Lighting_f (void); -void M_Menu_3D_f (void); +void M_Menu_Lighting_f (void); +void M_Menu_Render_f (void); void M_Menu_Textures_f (void); void M_Menu_Teamplay_f (void); void M_Menu_Teamplay_Locations_f (void); @@ -790,10 +790,7 @@ 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_Singleplayer_Cheats_f (void); -void M_Menu_Singleplayer_Cheats_Quake2_f (void); -void M_Menu_Singleplayer_Cheats_Hexen2_f (void); void M_Menu_Particles_f (void); -void M_Menu_ParticleSets_f (void); void M_Menu_Audio_Speakers_f (void); void Menu_DownloadStuff_f (void); static qboolean internalmenusregistered; @@ -840,11 +837,9 @@ void M_Init_Internal (void) Cmd_AddRemCommand ("menu_speakers", M_Menu_Audio_Speakers_f); #endif Cmd_AddRemCommand ("menu_spcheats", M_Menu_Singleplayer_Cheats_f); - Cmd_AddRemCommand ("menu_quake2_spcheats", M_Menu_Singleplayer_Cheats_Quake2_f); - Cmd_AddRemCommand ("menu_hexen2_spcheats", M_Menu_Singleplayer_Cheats_Hexen2_f); Cmd_AddRemCommand ("menu_fps", M_Menu_FPS_f); - Cmd_AddRemCommand ("menu_3d" , M_Menu_3D_f); - Cmd_AddRemCommand ("menu_shadow_lighting", M_Menu_Shadow_Lighting_f); + Cmd_AddRemCommand ("menu_render" , M_Menu_Render_f); + Cmd_AddRemCommand ("menu_lighting", M_Menu_Lighting_f); Cmd_AddRemCommand ("menu_textures", M_Menu_Textures_f); Cmd_AddRemCommand ("menu_teamplay", M_Menu_Teamplay_f); Cmd_AddRemCommand ("menu_teamplay_locations", M_Menu_Teamplay_Locations_f); @@ -857,7 +852,6 @@ 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_particlesets", M_Menu_ParticleSets_f); #ifdef WEBCLIENT Cmd_AddRemCommand ("menu_download", Menu_DownloadStuff_f); @@ -912,14 +906,11 @@ void M_DeInit_Internal (void) Cmd_RemoveCommand ("menu_teamplay_team_fortress"); Cmd_RemoveCommand ("menu_teamplay_status_location_misc"); Cmd_RemoveCommand ("menu_spcheats"); - Cmd_RemoveCommand ("menu_hexen2_spcheats"); - Cmd_RemoveCommand ("menu_quake2_spcheats"); Cmd_RemoveCommand ("menu_fps"); - Cmd_RemoveCommand ("menu_3d"); - Cmd_RemoveCommand ("menu_shadow_lighting"); + Cmd_RemoveCommand ("menu_render"); + Cmd_RemoveCommand ("menu_lighting"); Cmd_RemoveCommand ("menu_textures"); Cmd_RemoveCommand ("menu_particles"); - Cmd_RemoveCommand ("menu_particlesets"); Cmd_RemoveCommand ("menu_download"); diff --git a/engine/client/menu.h b/engine/client/menu.h index ef77b9c0..cd64b453 100644 --- a/engine/client/menu.h +++ b/engine/client/menu.h @@ -134,7 +134,7 @@ typedef enum { mt_checkbox, mt_picture, mt_picturesel, - mt_menudot, + mt_menudot, mt_custom } menutype_t; @@ -167,6 +167,7 @@ typedef struct { char text[MAX_EDIT_LENGTH]; int cursorpos; qboolean modified; + qboolean slim; } menuedit_t; typedef struct { menucommon_t common; @@ -302,9 +303,53 @@ menucombo_t *MC_AddCombo(menu_t *menu, int x, int y, const char *caption, const menubutton_t *MC_AddCommand(menu_t *menu, int x, int y, char *text, qboolean (*command) (union menuoption_s *,struct menu_s *,int)); menuedit_t *MC_AddEdit(menu_t *menu, int x, int y, char *text, char *def); menuedit_t *MC_AddEditCvar(menu_t *menu, int x, int y, char *text, char *name); +menuedit_t *MC_AddEditCvarSlim(menu_t *menu, int x, int y, char *text, char *name); menucustom_t *MC_AddCustom(menu_t *menu, int x, int y, void *data); menucombo_t *MC_AddCvarCombo(menu_t *menu, int x, int y, const char *caption, cvar_t *cvar, const char **ops, const char **values); +typedef struct menubulk_s { + menutype_t type; + int variant; + char *text; + char *tooltip; + char *consolecmd; // console command + cvar_t *cvar; // check box, slider + int flags; // check box + qboolean (*func) (struct menucheck_s *option, struct menu_s *menu, chk_set_t set); // check box + float min; // slider + float max; // slider + float delta; // slider + qboolean rightalign; // text + qboolean (*command) (union menuoption_s *, struct menu_s *, int); // command + char *cvarname; // edit cvar + const char **options; // combo + const char **values; // cvar combo + int selectedoption; // other combo + union menuoption_s **ret; // other combo + int spacing; // spacing +} menubulk_t; + +#define MB_CONSOLECMD(text, cmd, tip) {mt_button, 0, text, tip, cmd} +#define MB_CHECKBOXCVAR(text, cvar, flags) {mt_checkbox, 0, text, NULL, NULL, &cvar, flags} +#define MB_CHECKBOXCVARRETURN(text, cvar, flags, ret) {mt_checkbox, 0, text, NULL, NULL, &cvar, flags, NULL, 0, 0, 0, false, NULL, NULL, NULL, NULL, 0, (union menuoption_s **)&ret} +#define MB_CHECKBOXFUNC(text, func, flags, tip) {mt_checkbox, 0, text, tip, NULL, NULL, flags, func} +#define MB_SLIDER(text, cvar, min, max, delta, tip) {mt_slider, 0, text, tip, NULL, &cvar, 0, NULL, min, max, delta} +#define MB_TEXT(text, align) {mt_text, 0, text, NULL, NULL, NULL, 0, NULL, 0, 0, 0, align} +#define MB_REDTEXT(text, align) {mt_text, 1, text, NULL, NULL, NULL, 0, NULL, 0, 0, 0, align} +#define MB_CMD(text, cmdfunc, tip) {mt_button, 1, text, tip, NULL, NULL, 0, NULL, 0, 0, 0, false, cmdfunc} +#define MB_EDITCVAR(text, cvarname) {mt_edit, 0, text, NULL, NULL, NULL, 0, NULL, 0, 0, 0, false, NULL, cvarname} +#define MB_EDITCVARSLIM(text, cvarname) {mt_edit, 1, text, NULL, NULL, NULL, 0, NULL, 0, 0, 0, false, NULL, cvarname} +#define MB_EDITCVARSLIMRETURN(text, cvarname, ret) {mt_edit, 1, text, NULL, NULL, NULL, 0, NULL, 0, 0, 0, false, NULL, cvarname, NULL, NULL, 0, (union menuoption_s **)&ret} +#define MB_COMBOCVAR(text, cvar, options, values, tip) {mt_combo, 0, text, tip, NULL, &cvar, 0, NULL, 0, 0, 0, false, NULL, NULL, options, values} +#define MB_COMBORETURN(text, options, selected, ret, tip) {mt_combo, 1, text, tip, NULL, NULL, 0, NULL, 0, 0, 0, false, NULL, NULL, options, NULL, selected, (union menuoption_s **)&ret} +#define MB_COMBOCVARRETURN(text, cvar, options, values, ret, tip) {mt_combo, 0, text, tip, NULL, &cvar, 0, NULL, 0, 0, 0, false, NULL, NULL, options, values, 0, (union menuoption_s **)&ret} +#define MB_SPACING(space) {mt_text, 2, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, false, NULL, NULL, NULL, NULL, 0, NULL, space} +#define MB_END() {mt_text, -1} + +int MC_AddBulk(struct menu_s *menu, menubulk_t *bulk, int xstart, int xtextend, int y); + + + menu_t *M_Options_Title(int *y, int infosize); /*Create a menu with the default options titlebar*/ menu_t *M_CreateMenu (int extrasize); void M_AddMenu (menu_t *menu); diff --git a/engine/client/r_part.c b/engine/client/r_part.c index 15c63565..05b00b73 100644 --- a/engine/client/r_part.c +++ b/engine/client/r_part.c @@ -128,12 +128,12 @@ extern cvar_t r_bloodstains; extern cvar_t gl_part_flame; cvar_t r_part_rain_quantity = CVAR("r_part_rain_quantity", "1"); -cvar_t r_particle_tracelimit = CVAR("r_particle_tracelimit", "250"); +cvar_t r_particle_tracelimit = CVARD("r_particle_tracelimit", "200", "Number of traces to allow per frame for particle physics."); cvar_t r_part_sparks = CVAR("r_part_sparks", "1"); cvar_t r_part_sparks_trifan = CVAR("r_part_sparks_trifan", "1"); cvar_t r_part_sparks_textured = CVAR("r_part_sparks_textured", "1"); cvar_t r_part_beams = CVAR("r_part_beams", "1"); -cvar_t r_part_contentswitch = CVAR("r_part_contentswitch", "1"); +cvar_t r_part_contentswitch = CVARD("r_part_contentswitch", "1", "Enable particle effects to change based on content (ex. water)."); particleengine_t *pe; diff --git a/engine/client/renderer.c b/engine/client/renderer.c index d8f9671b..130e5f2c 100644 --- a/engine/client/renderer.c +++ b/engine/client/renderer.c @@ -50,7 +50,7 @@ cvar_t cl_cursorsize = CVAR ("cl_cursorsize", "32"); cvar_t cl_cursorbias = CVAR ("cl_cursorbias", "4"); cvar_t gl_nocolors = CVAR ("gl_nocolors", "0"); -cvar_t gl_part_flame = CVAR ("gl_part_flame", "1"); +cvar_t gl_part_flame = CVARD ("gl_part_flame", "1", "Enable particle emitting from models. Mainly used for torch and flame effects."); //opengl library, blank means try default. static cvar_t gl_driver = CVARF ("gl_driver", "", @@ -63,8 +63,9 @@ cvar_t mod_md3flags = CVAR ("mod_md3flags", "1"); cvar_t r_ambient = CVARF ("r_ambient", "0", CVAR_CHEAT); cvar_t r_bloodstains = CVAR ("r_bloodstains", "1"); -cvar_t r_bouncysparks = CVARF ("r_bouncysparks", "0", - CVAR_ARCHIVE); +cvar_t r_bouncysparks = CVARFD ("r_bouncysparks", "0", + CVAR_ARCHIVE, + "Enables particle interaction with world surfaces, allowing for bouncy particles."); cvar_t r_drawentities = CVAR ("r_drawentities", "1"); cvar_t r_drawflat = CVARF ("r_drawflat", "0", CVAR_SEMICHEAT | CVAR_RENDERERCALLBACK | CVAR_SHADERSYSTEM); @@ -106,8 +107,9 @@ cvar_t r_netgraph = SCVAR ("r_netgraph", "0"); cvar_t r_nolerp = SCVAR ("r_nolerp", "0"); cvar_t r_nolightdir = SCVAR ("r_nolightdir", "0"); cvar_t r_novis = SCVAR ("r_novis", "0"); -cvar_t r_part_rain = SCVARF ("r_part_rain", "0", - CVAR_ARCHIVE); +cvar_t r_part_rain = CVARFD ("r_part_rain", "0", + CVAR_ARCHIVE, + "Enable particle effects to emit off of surfaces. Mainly used for weather or lava/slime effects."); cvar_t r_skyboxname = SCVARF ("r_skybox", "", CVAR_RENDERERCALLBACK | CVAR_SHADERSYSTEM); cvar_t r_speeds = SCVAR ("r_speeds", "0"); @@ -162,26 +164,24 @@ cvar_t vid_conwidth = CVARF ("vid_conwidth", "0", cvar_t vid_renderer = CVARF ("vid_renderer", "", CVAR_ARCHIVE | CVAR_RENDERERLATCH); -static cvar_t vid_allow_modex = CVARF ("vid_allow_modex", "1", - CVAR_ARCHIVE | CVAR_RENDERERLATCH); //FIXME: remove -static cvar_t vid_bpp = CVARF ("vid_bpp", "32", +cvar_t vid_bpp = CVARF ("vid_bpp", "32", CVAR_ARCHIVE | CVAR_RENDERERLATCH); -static cvar_t vid_desktopsettings = CVARF ("vid_desktopsettings", "0", +cvar_t vid_desktopsettings = CVARF ("vid_desktopsettings", "0", CVAR_ARCHIVE | CVAR_RENDERERLATCH); #ifdef NPQTV -static cvar_t vid_fullscreen_npqtv = CVARF ("vid_fullscreen", "1", +cvar_t vid_fullscreen_npqtv = CVARF ("vid_fullscreen", "1", CVAR_ARCHIVE | CVAR_RENDERERLATCH); cvar_t vid_fullscreen = CVARF ("vid_fullscreen_embedded", "0", CVAR_ARCHIVE | CVAR_RENDERERLATCH); #else -static cvar_t vid_fullscreen = CVARF ("vid_fullscreen", "1", +cvar_t vid_fullscreen = CVARF ("vid_fullscreen", "1", CVAR_ARCHIVE | CVAR_RENDERERLATCH); #endif cvar_t vid_height = CVARF ("vid_height", "0", CVAR_ARCHIVE | CVAR_RENDERERLATCH); cvar_t vid_multisample = CVARF ("vid_multisample", "0", CVAR_ARCHIVE | CVAR_RENDERERLATCH); -static cvar_t vid_refreshrate = CVARF ("vid_displayfrequency", "0", +cvar_t vid_refreshrate = CVARF ("vid_displayfrequency", "0", CVAR_ARCHIVE | CVAR_RENDERERLATCH); cvar_t vid_wndalpha = CVAR ("vid_wndalpha", "1"); //more readable defaults to match conwidth/conheight. @@ -353,7 +353,6 @@ void GLRenderer_Init(void) Cvar_Register (&gl_affinemodels, GLRENDEREROPTIONS); Cvar_Register (&gl_nohwblend, GLRENDEREROPTIONS); Cvar_Register (&r_flashblend, GLRENDEREROPTIONS); - Cvar_Register (&gl_playermip, GLRENDEREROPTIONS); Cvar_Register (&gl_nocolors, GLRENDEREROPTIONS); Cvar_Register (&gl_finish, GLRENDEREROPTIONS); Cvar_Register (&gl_lateswap, GLRENDEREROPTIONS); @@ -511,8 +510,6 @@ void Renderer_Init(void) Cvar_Register (&vid_conheight, VIDCOMMANDGROUP); Cvar_Register (&vid_conautoscale, VIDCOMMANDGROUP); - Cvar_Register (&vid_allow_modex, VIDCOMMANDGROUP); - Cvar_Register (&vid_width, VIDCOMMANDGROUP); Cvar_Register (&vid_height, VIDCOMMANDGROUP); Cvar_Register (&vid_refreshrate, VIDCOMMANDGROUP); @@ -791,458 +788,6 @@ rendererinfo_t *rendererinfo[] = }; - - -typedef struct vidmode_s -{ - const char *description; - int width, height; -} vidmode_t; - -vidmode_t vid_modes[] = -{ - { "320x200 (16:10)", 320, 200}, // CGA, MCGA - { "320x240 (4:3)", 320, 240}, // QVGA - { "400x300 (4:3)", 400, 300}, // Quarter SVGA - { "512x384 (4:3)", 512, 384}, // Mac LC - { "640x400 (16:10)", 640, 400}, // Atari ST mono, Amiga OCS NTSC Hires interlace - { "640x480 (4:3)", 640, 480}, // VGA, MCGA - { "800x600 (4:3)", 800, 600}, // SVGA - { "856x480 (16:9)", 856, 480}, // WVGA - { "960x720 (4:3)", 960, 720}, // unnamed - { "1024x576 (16:9)", 1024, 576}, // WSVGA - { "1024x640 (16:10)", 1024, 640}, // unnamed - { "1024x768 (4:3)", 1024, 768}, // XGA - { "1152x720 (16:10)", 1152, 720}, // XGA+ - { "1152x864 (4:3)", 1152, 864}, // XGA+ - { "1280x720 (16:9)", 1280, 720}, // WXGA min. - { "1280x800 (16:10)", 1280, 800}, // WXGA avg (native resolution of 17" widescreen LCDs) - { "1280x960 (4:3)", 1280, 960}, //SXGA- - { "1280x1024 (5:4)", 1280, 1024}, // SXGA (native resolution of 17-19" LCDs) - { "1366x768 (16:9)", 1366, 768}, // WXGA - { "1400x1050 (4:3)", 1400, 1050}, // SXGA+ - { "1440x900 (16:10)", 1440, 900}, // WXGA+ (native resolution of 19" widescreen LCDs) - { "1440x1080 (4:3)", 1440, 1080}, // unnamed - { "1600x900 (16:9)", 1600, 900}, // 900p - { "1600x1200 (4:3)", 1600, 1200}, // UXGA (native resolution of 20"+ LCDs) //sw height is bound to 200 to 1024 - { "1680x1050 (16:10)", 1680, 1050}, // WSXGA+ (native resolution of 22" widescreen LCDs) - { "1792x1344 (4:3)", 1792, 1344}, // unnamed - { "1800x1440 (5:4)", 1800, 1440}, // unnamed - { "1856x1392 (4:3)", 1856, 1392}, //unnamed - { "1920x1080 (16:9)", 1920, 1080}, // 1080p (native resolution of cheap 24" LCDs, which really are 23.6") - { "1920x1200 (16:10)", 1920, 1200}, // WUXGA (native resolution of good 24" widescreen LCDs) - { "1920x1440 (4:3)", 1920, 1440}, // TXGA - { "2048x1152 (16:9)", 2048, 1152}, // QWXGA (native resolution of 23" ultra-widescreen LCDs) - { "2048x1536 (4:3)", 2048, 1536}, // QXGA //too much width will disable water warping (>1280) (but at that resolution, it's almost unnoticable) - { "2304x1440 (16:10)", 2304, 1440}, // (unnamed; maximum resolution of the Sony GDM-FW900 and Hewlett Packard A7217A) - { "2560x1600 (16:10)", 2560, 1600}, // WQXGA (maximum resolution of 30" widescreen LCDs, Dell for example) - { "2560x2048 (5:4)", 2560, 2048} // QSXGA -}; -#define NUMVIDMODES sizeof(vid_modes)/sizeof(vid_modes[0]) - -qboolean M_Vid_GetMode(int num, int *w, int *h) -{ - if ((unsigned)num >= NUMVIDMODES) - return false; - - *w = vid_modes[num].width; - *h = vid_modes[num].height; - return true; -} - -typedef struct { - menucombo_t *renderer; - menucombo_t *modecombo; - menucombo_t *conscalecombo; - menucombo_t *bppcombo; - menucombo_t *refreshratecombo; - menucombo_t *vsynccombo; - menuedit_t *customwidth; - menuedit_t *customheight; -} videomenuinfo_t; - -menuedit_t *MC_AddEdit(menu_t *menu, int x, int y, char *text, char *def); -void CheckCustomMode(struct menu_s *menu) -{ - videomenuinfo_t *info = menu->data; - if (info->modecombo->selectedoption && info->conscalecombo->selectedoption) - { //hide the custom options - info->customwidth->common.ishidden = true; - info->customheight->common.ishidden = true; - } - else - { - info->customwidth->common.ishidden = false; - info->customheight->common.ishidden = false; - } - - if (!info->bppcombo->selectedoption) - info->bppcombo->selectedoption = 1; - - info->conscalecombo->common.ishidden = false; -} -qboolean M_VideoApply (union menuoption_s *op,struct menu_s *menu,int key) -{ - videomenuinfo_t *info = menu->data; - int selectedbpp; - - if (key != K_ENTER) - return false; - - if (info->modecombo->selectedoption) - { //set a prefab - Cbuf_AddText(va("vid_width %i\n", vid_modes[info->modecombo->selectedoption-1].width), RESTRICT_LOCAL); - Cbuf_AddText(va("vid_height %i\n", vid_modes[info->modecombo->selectedoption-1].height), RESTRICT_LOCAL); - } - else - { //use the custom one - Cbuf_AddText(va("vid_width %s\n", info->customwidth->text), RESTRICT_LOCAL); - Cbuf_AddText(va("vid_height %s\n", info->customheight->text), RESTRICT_LOCAL); - } - - if (info->conscalecombo->selectedoption) //I am aware that this handicaps the menu a bit, but it should be easier for n00bs. - { //set a prefab - Cbuf_AddText(va("vid_conwidth %i\n", vid_modes[info->conscalecombo->selectedoption-1].width), RESTRICT_LOCAL); - Cbuf_AddText(va("vid_conheight %i\n", vid_modes[info->conscalecombo->selectedoption-1].height), RESTRICT_LOCAL); - } - else - { //use the custom one - Cbuf_AddText(va("vid_conwidth %s\n", info->customwidth->text), RESTRICT_LOCAL); - Cbuf_AddText(va("vid_conheight %s\n", info->customheight->text), RESTRICT_LOCAL); - } - - selectedbpp = 16; - switch(info->bppcombo->selectedoption) - { - case 0: - if (info->renderer->selectedoption) - selectedbpp = 16; - else - selectedbpp = 8; - break; - case 1: - selectedbpp = 16; - break; - case 2: - selectedbpp = 32; - break; - } - - switch(info->vsynccombo->selectedoption) - { - case 0: - Cbuf_AddText(va("vid_wait %i\n", 0), RESTRICT_LOCAL); - break; - case 1: - Cbuf_AddText(va("vid_wait %i\n", 1), RESTRICT_LOCAL); - break; - case 2: - Cbuf_AddText(va("vid_wait %i\n", 2), RESTRICT_LOCAL); - break; - } - - - Cbuf_AddText(va("vid_bpp %i\n", selectedbpp), RESTRICT_LOCAL); - - switch(info->refreshratecombo->selectedoption) - { - case 0: - Cbuf_AddText(va("vid_displayfrequency %i\n", 0), RESTRICT_LOCAL); - break; - case 1: - Cbuf_AddText(va("vid_displayfrequency %i\n", 59), RESTRICT_LOCAL); - break; - case 2: - Cbuf_AddText(va("vid_displayfrequency %i\n", 60), RESTRICT_LOCAL); - break; - case 3: - Cbuf_AddText(va("vid_displayfrequency %i\n", 70), RESTRICT_LOCAL); - break; - case 4: - Cbuf_AddText(va("vid_displayfrequency %i\n", 72), RESTRICT_LOCAL); - break; - case 5: - Cbuf_AddText(va("vid_displayfrequency %i\n", 75), RESTRICT_LOCAL); - break; - case 6: - Cbuf_AddText(va("vid_displayfrequency %i\n", 85), RESTRICT_LOCAL); - break; - case 7: - Cbuf_AddText(va("vid_displayfrequency %i\n", 100), RESTRICT_LOCAL); - break; - } - - switch(info->renderer->selectedoption) - { -#if defined(GLQUAKE) && !defined(D3DQUAKE) // Just OpenGL client - case 0: - Cbuf_AddText("setrenderer gl\n", RESTRICT_LOCAL); - break; -#endif - -#if defined(D3DQUAKE) && !defined(GLQUAKE) // Just Direct3D client - case 0: - Cbuf_AddText("setrenderer d3d\n", RESTRICT_LOCAL); - break; -#endif - -#if defined(GLQUAKE) && defined(D3DQUAKE) // OpenGL + Direct3D = Merged - case 0: - Cbuf_AddText("setrenderer gl\n", RESTRICT_LOCAL); - break; - case 1: - Cbuf_AddText("setrenderer d3d\n", RESTRICT_LOCAL); - break; -#endif - } - - M_RemoveMenu(menu); - Cbuf_AddText("menu_video\n", RESTRICT_LOCAL); - return true; -} -void M_Menu_Video_f (void) -{ - extern cvar_t v_contrast; -#if defined(GLQUAKE) -#endif - static const char *modenames[128] = {"Custom"}; - static const char *rendererops[] = { -#ifdef GLQUAKE - "OpenGL", -#endif -#ifdef D3DQUAKE - "DirectX9", -#endif - NULL - }; - static const char *bppnames[] = - { - "8", - "16", - "32", - NULL - }; - //unused - /*static const char *texturefilternames[] = - { - "Nearest", - "Bilinear", - "Trilinear", - NULL - };*/ - - static const char *refreshrates[] = - { - "0Hz (OS Driver refresh rate)", - "59Hz (NTSC is 59.94i)", - "60Hz", - "70Hz", - "72Hz", // VESA minimum setting to avoid eye damage on CRT monitors - "75Hz", - "85Hz", - "100Hz", - NULL - }; - - static const char *vsyncoptions[] = - { - "Off", - "Wait for Vertical Sync", - "Wait for Display Enable", - NULL - }; - - videomenuinfo_t *info; - int prefabmode; - int prefab2dmode; - int currentbpp; - int currentrefreshrate; - int currentvsync; - int aspectratio3d; - int aspectratio2d; - char *aspectratio23d; - char *aspectratio22d; - char *rendererstring; - static char current3dres[10]; // enough to fit 1920x1200 - static char current2dres[10]; // same as above - static char currenthz[6]; // enough to fit 120hz - static char currentcolordepth[6]; - - extern cvar_t _vid_wait_override; - float vidwidth = vid.pixelwidth; - float vidheight = vid.pixelheight; - - int i, y; - menu_t *menu = M_Options_Title(&y, sizeof(videomenuinfo_t)); - info = menu->data; - - prefabmode = -1; - prefab2dmode = -1; - for (i = 0; i < sizeof(vid_modes)/sizeof(vidmode_t); i++) - { - if (vid_modes[i].width == vid_width.value && vid_modes[i].height == vid_height.value) - prefabmode = i; - if (vid_modes[i].width == vid_conwidth.value && vid_modes[i].height == vid_conheight.value) - prefab2dmode = i; - modenames[i+1] = vid_modes[i].description; - } - modenames[i+1] = NULL; - -#if defined(GLQUAKE) && defined(D3DQUAKE) - if (!strcmp(vid_renderer.string, "d3d9")) - i = 1; - else -#endif - i = 0; - - if (vid_bpp.value >= 32) - { - currentbpp = 2; - strcpy(currentcolordepth, va("%sbit (16.7m colors)",vid_bpp.string) ); - } - else if (vid_bpp.value >= 16) - { - currentbpp = 1; - strcpy(currentcolordepth, va("%sbit (65.5k colors)",vid_bpp.string) ); - } - else - currentbpp = 0; - - if (vid_refreshrate.value >= 100) - currentrefreshrate = 7; - else if (vid_refreshrate.value >= 85) - currentrefreshrate = 6; - else if (vid_refreshrate.value >= 75) - currentrefreshrate = 5; - else if (vid_refreshrate.value >= 72) - currentrefreshrate = 4; - else if (vid_refreshrate.value >= 70) - currentrefreshrate = 3; - else if (vid_refreshrate.value >= 60) - currentrefreshrate = 2; - else if (vid_refreshrate.value >= 59) - currentrefreshrate = 1; - else if (vid_refreshrate.value >= 0) - currentrefreshrate = 0; - else - currentrefreshrate = 0; - - strcpy(currenthz, va("%sHz",vid_refreshrate.string) ); - - aspectratio3d = (vidwidth / vidheight * 100); // times by 100 so don't have to deal with floats - - if (aspectratio3d == 125) // 1.25 - aspectratio23d = "5:4"; - else if (aspectratio3d == 160) // 1.6 - aspectratio23d = "16:10"; - else if (aspectratio3d == 133) // 1.333333 - aspectratio23d = "4:3"; - else if (aspectratio3d == 177) // 1.777778 - aspectratio23d = "16:9"; - else - { - aspectratio23d = "Non-standard Ratio"; - Con_Printf("Ratio: %i, width: %i, height: %i\n", aspectratio3d, vid.pixelwidth, vid.pixelheight); - } - - aspectratio2d = (vid_conwidth.value / vid_conheight.value * 100); // times by 100 so don't have to deal with floats - - if (aspectratio2d == 125) // 1.25 - aspectratio22d = "5:4"; - else if (aspectratio2d == 160) // 1.6 - aspectratio22d = "16:10"; - else if (aspectratio2d == 133) // 1.333333 - aspectratio22d = "4:3"; - else if (aspectratio2d == 177) // 1.777778 - aspectratio22d = "16:9"; - else - aspectratio22d = "Non-standard Ratio"; - - currentvsync = _vid_wait_override.value; - - if ( stricmp(vid_renderer.string,"gl" ) == 0 ) - rendererstring = "OpenGL"; - else if ( stricmp(vid_renderer.string,"d3d7") == 0 ) - rendererstring = "DirectX 7"; - else if ( stricmp(vid_renderer.string,"d3d9") == 0 ) - rendererstring = "DirectX 9"; - else if ( stricmp(vid_renderer.string,"d3d") == 0) - rendererstring = "DirectX"; - else if ( stricmp(vid_renderer.string,"sw") == 0) - rendererstring = "Software"; - else - rendererstring = "Unknown Renderer?"; - - strcpy(current3dres, va("%ix%i", vid.pixelwidth, vid.pixelheight) ); - strcpy(current2dres, va("%sx%s", vid_conwidth.string, vid_conheight.string) ); - - y += 40; - MC_AddRedText(menu, 0, y, " Current Renderer", false); - MC_AddRedText(menu, 225, y, rendererstring, false); y+=8; - MC_AddRedText(menu, 0, y, " Current Color Depth", false); - MC_AddRedText(menu, 225, y, currentcolordepth, false); y+=8; - if ( ( vidwidth == 0) || ( vidheight == 0) ) - y+=16; - else - { - MC_AddRedText(menu, 0, y, " Current 3D Res", false); - MC_AddRedText(menu, 225, y, current3dres, false); y+=8; - MC_AddRedText(menu, 0, y, " Current 3D A/R", false); - MC_AddRedText(menu, 225, y, aspectratio23d, false); y+=8; - } - - if ( ( vid_conwidth.value == 0) || ( vid_conheight.value == 0) ) // same as 3d resolution - { - MC_AddRedText(menu, 0, y, " Current 2D Res", false); - MC_AddRedText(menu, 225, y, current3dres, false); y+=8; - MC_AddRedText(menu, 0, y, " Current 2D A/R", false); - MC_AddRedText(menu, 225, y, aspectratio23d, false); y+=8; - } - else - { - MC_AddRedText(menu, 0, y, " Current 2D Res", false); - MC_AddRedText(menu, 225, y, current2dres, false); y+=8; - MC_AddRedText(menu, 0, y, " Current 2D A/R", false); - MC_AddRedText(menu, 225, y, aspectratio22d, false); y+=8; - } - - MC_AddRedText(menu, 0, y, " Current Refresh Rate", false); - MC_AddRedText(menu, 225, y, currenthz, false); y+=8; - y+=8; - MC_AddRedText(menu, 0, y, " ", false); y+=8; - y+=8; - info->renderer = MC_AddCombo(menu, 16, y, " Renderer", rendererops, i); y+=8; - info->bppcombo = MC_AddCombo(menu, 16, y, " Color Depth", bppnames, currentbpp); y+=8; - info->refreshratecombo = MC_AddCombo(menu, 16, y, " Refresh Rate", refreshrates, currentrefreshrate); y+=8; - info->modecombo = MC_AddCombo(menu, 16, y, " Video Size", modenames, prefabmode+1); y+=8; - MC_AddWhiteText(menu, 16, y, " 3D Aspect Ratio", false); y+=8; - info->conscalecombo = MC_AddCombo(menu, 16, y, " 2D Size", modenames, prefab2dmode+1); y+=8; - MC_AddWhiteText(menu, 16, y, " 2D Aspect Ratio", false); y+=8; - MC_AddCheckBox(menu, 16, y, " Fullscreen", &vid_fullscreen,0); y+=8; - y+=4;info->customwidth = MC_AddEdit(menu, 16, y, " Custom width", vid_width.string); y+=8; - y+=4;info->customheight = MC_AddEdit(menu, 16, y, " Custom height", vid_height.string); y+=12; - info->vsynccombo = MC_AddCombo(menu, 16, y, " VSync", vsyncoptions, currentvsync); y+=8; - //MC_AddCheckBox(menu, 16, y, " Override VSync", &_vid_wait_override,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Desktop Settings", &vid_desktopsettings,0); y+=8; - y+=8; - MC_AddCommand(menu, 16, y, "= Apply Changes =", M_VideoApply); y+=8; - y+=8; - MC_AddSlider(menu, 16, y, " Screen size", &scr_viewsize, 30, 120, 1);y+=8; - MC_AddSlider(menu, 16, y, "Console Autoscale",&vid_conautoscale, 0, 6, 0.25); y+=8; - MC_AddSlider(menu, 16, y, " Gamma", &v_gamma, 0.3, 1, 0.05); y+=8; - MC_AddCheckBox(menu, 16, y, " Desktop Gamma", &vid_desktopgamma,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Hardware Gamma", &vid_hardwaregamma,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Preserve Gamma", &vid_preservegamma,0); y+=8; - MC_AddSlider(menu, 16, y, " Contrast", &v_contrast, 1, 3, 0.05); y+=8; - y+=8; - MC_AddCheckBox(menu, 16, y, " Allow ModeX", &vid_allow_modex,0); y+=8; - MC_AddCheckBox(menu, 16, y, " Windowed Mouse", &_windowed_mouse,0); y+=8; - - menu->selecteditem = (union menuoption_s *)info->renderer; - menu->cursoritem = (menuoption_t*)MC_AddWhiteText(menu, 152, menu->selecteditem->common.posy, NULL, false); - menu->event = CheckCustomMode; -} - void R_SetRenderer(rendererinfo_t *ri) { currentrendererstate.renderer = ri; diff --git a/engine/client/snd_dma.c b/engine/client/snd_dma.c index 439dd16e..efd017f6 100644 --- a/engine/client/snd_dma.c +++ b/engine/client/snd_dma.c @@ -59,15 +59,18 @@ int desired_bits = 16; int sound_started=0; -cvar_t bgmvolume = CVARF( "musicvolume", "0", CVAR_ARCHIVE); -cvar_t volume = CVARF( "volume", "0.7", CVAR_ARCHIVE); +cvar_t bgmvolume = CVARFD( "musicvolume", "0", CVAR_ARCHIVE, + "Volume level for background music."); +cvar_t volume = CVARFD( "volume", "0.7", CVAR_ARCHIVE, + "Main volume level for all engine sound."); -cvar_t nosound = CVAR( "nosound", "0"); +cvar_t nosound = CVARD( "nosound", "0", + "Disable all sound from the engine."); cvar_t precache = CVARAF( "s_precache", "1", "precache", 0); -cvar_t loadas8bit = CVARAF( "s_loadas8bit", "0", - "loadas8bit", 0); -cvar_t bgmbuffer = CVAR( "bgmbuffer", "4096"); +cvar_t loadas8bit = CVARAFD( "s_loadas8bit", "0", + "loadas8bit", 0, + "Downsample sounds on load as lower quality 8-bit sound."); cvar_t ambient_level = CVARAF( "s_ambientlevel", "0.3", "ambient_level", 0); cvar_t ambient_fade = CVARAF( "s_ambientfade", "100", @@ -78,8 +81,10 @@ cvar_t snd_show = CVARAF( "s_show", "0", "snd_show", 0); cvar_t snd_khz = CVARAF( "s_khz", "44", "snd_khz", CVAR_ARCHIVE); -cvar_t snd_inactive = CVARAF( "s_inactive", "0", - "snd_inactive", 0); //set if you want sound even when tabbed out. +cvar_t snd_inactive = CVARAFD( "s_inactive", "0", + "snd_inactive", 0, + "Play sound while application is inactive (ex. tabbed out)." + ); //set if you want sound even when tabbed out. cvar_t _snd_mixahead = CVARAF( "s_mixahead", "0.08", "_snd_mixahead", CVAR_ARCHIVE); cvar_t snd_leftisright = CVARAF( "s_swapstereo", "0", @@ -92,8 +97,9 @@ cvar_t snd_buffersize = CVARAF( "s_buffersize", "0", "snd_buffersize", 0); cvar_t snd_samplebits = CVARAF( "s_bits", "16", "snd_samplebits", CVAR_ARCHIVE); -cvar_t snd_playersoundvolume = CVARAF( "s_localvolume", "1", - "snd_localvolume", 0); //sugested by crunch +cvar_t snd_playersoundvolume = CVARAFD( "s_localvolume", "1", + "snd_localvolume", 0, + "Sound level for sounds local or originating from the player such as firing and pain sounds."); //sugested by crunch cvar_t snd_linearresample = CVARAF( "s_linearresample", "1", "snd_linearresample", 0); @@ -992,7 +998,6 @@ void S_Init (void) Cvar_Register(&precache, "Sound controls"); Cvar_Register(&loadas8bit, "Sound controls"); Cvar_Register(&bgmvolume, "Sound controls"); - Cvar_Register(&bgmbuffer, "Sound controls"); Cvar_Register(&ambient_level, "Sound controls"); Cvar_Register(&ambient_fade, "Sound controls"); Cvar_Register(&snd_noextraupdate, "Sound controls"); diff --git a/engine/client/zqtp.c b/engine/client/zqtp.c index 5e2bf02e..d6d0c904 100644 --- a/engine/client/zqtp.c +++ b/engine/client/zqtp.c @@ -147,7 +147,7 @@ void TP_SkinCvar_Callback(struct cvar_s *var, char *oldvalue); TP_CVAR(tp_name_teammate, ""); \ TP_CVAR(tp_name_eyes, "eyes"); \ \ - TP_CVAR(loc_name_seperator, "-"); \ + TP_CVAR(loc_name_separator, "-"); \ TP_CVAR(loc_name_ssg, "ssg"); \ TP_CVAR(loc_name_ng, "ng"); \ TP_CVAR(loc_name_sng, "sng"); \ diff --git a/engine/gl/gl_rmain.c b/engine/gl/gl_rmain.c index 3c8c1e1e..365c14e7 100644 --- a/engine/gl/gl_rmain.c +++ b/engine/gl/gl_rmain.c @@ -75,7 +75,6 @@ extern cvar_t gl_part_flame; extern cvar_t r_bloom; cvar_t gl_affinemodels = SCVAR("gl_affinemodels","0"); -cvar_t gl_playermip = SCVAR("gl_playermip","0"); cvar_t gl_reporttjunctions = SCVAR("gl_reporttjunctions","0"); cvar_t gl_finish = SCVAR("gl_finish","0"); cvar_t gl_dither = SCVAR("gl_dither", "1"); diff --git a/engine/gl/gl_shader.c b/engine/gl/gl_shader.c index 1b9655bd..efae7e4c 100644 --- a/engine/gl/gl_shader.c +++ b/engine/gl/gl_shader.c @@ -902,7 +902,7 @@ struct sbuiltin_s "#endif\n" "#ifdef FRAGMENT_SHADER\n" - "varying vec4 vc;\n" + "varying lowp vec4 vc;\n" "void main (void)\n" "{\n" " gl_FragColor = vc;\n" diff --git a/engine/gl/gl_vidnt.c b/engine/gl/gl_vidnt.c index 68122320..33b62181 100644 --- a/engine/gl/gl_vidnt.c +++ b/engine/gl/gl_vidnt.c @@ -143,7 +143,6 @@ modestate_t modestate = MS_UNINIT; LONG WINAPI GLMainWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); qboolean GLAppActivate(BOOL fActive, BOOL minimize); -char *VID_GetModeDescription (int mode); void ClearAllStates (void); void VID_UpdateWindowStatus (HWND hWnd); void GL_Init(void *(*getglfunction) (char *name));