void M_Background(int width, int height)
{
- menu_width = width;
- menu_height = height;
+ menu_width = bound(1, width, vid.conwidth);
+ menu_height = bound(1, height, vid.conheight);
menu_x = (vid.conwidth - menu_width) * 0.5;
menu_y = (vid.conheight - menu_height) * 0.5;
//DrawQ_Fill(menu_x, menu_y, menu_width, menu_height, 0, 0, 0, 0.5, 0);
Cbuf_AddText ("maxplayers 1\n");
Cbuf_AddText ("deathmatch 0\n");
Cbuf_AddText ("coop 0\n");
- if (gamemode == GAME_NEHAHRA)
- Cbuf_AddText ("map nehstart\n");
- else if (gamemode == GAME_TRANSFUSION)
- Cbuf_AddText ("map e1m1\n");
- else
- Cbuf_AddText ("map start\n");
+ Cbuf_AddText ("startmap_sp\n");
break;
case 1:
void M_ScanSaves (void)
{
- int i, j;
+ int i, j, len;
char name[MAX_OSPATH];
- char *str;
+ char buf[SAVEGAME_COMMENT_LENGTH + 256];
+ const char *t;
qfile_t *f;
int version;
strcpy (m_filenames[i], "--- UNUSED SLOT ---");
loadable[i] = false;
sprintf (name, "s%i.sav", i);
- f = FS_Open (name, "r", false);
+ f = FS_Open (name, "rb", false);
if (!f)
continue;
- str = FS_Getline (f);
- sscanf (str, "%i\n", &version);
- str = FS_Getline (f);
- strlcpy (m_filenames[i], str, sizeof (m_filenames[i]));
+ // read enough to get the comment
+ len = FS_Read(f, buf, sizeof(buf) - 1);
+ buf[sizeof(buf) - 1] = 0;
+ t = buf;
+ // version
+ COM_ParseToken(&t, false);
+ version = atoi(com_token);
+ // description
+ COM_ParseToken(&t, false);
+ strlcpy (m_filenames[i], com_token, sizeof (m_filenames[i]));
// change _ back to space
for (j=0 ; j<SAVEGAME_COMMENT_LENGTH ; j++)
int visible;
cachepic_t *p;
- M_Background(320, 240);
+ M_Background(320, bound(200, 32 + OPTIONS_ITEMS * 8, vid.conheight));
M_DrawPic(16, 4, "gfx/qplaque.lmp");
p = Draw_CachePic("gfx/p_option.lmp");
optnum = 0;
optcursor = options_cursor;
- visible = (vid.conheight - 32) / 8;
+ visible = (menu_height - 32) / 8;
opty = 32 - bound(0, optcursor - (visible >> 1), max(0, OPTIONS_ITEMS - visible)) * 8;
M_Options_PrintCommand( "Customize controls", true);
extern cvar_t r_detailtextures;
-extern cvar_t cl_particles;
extern cvar_t cl_stainmaps;
-extern cvar_t cl_stainmapsclearonload;
-extern cvar_t cl_decals;
+extern cvar_t cl_stainmaps_clearonload;
extern cvar_t r_explosionclip;
extern cvar_t r_modellights;
extern cvar_t r_coronas;
extern cvar_t gl_flashblend;
-extern cvar_t cl_particles_quality;
-extern cvar_t cl_particles_bulletimpacts;
-extern cvar_t cl_particles_smoke;
-extern cvar_t cl_particles_sparks;
-extern cvar_t cl_particles_bubbles;
-extern cvar_t cl_particles_blood;
-extern cvar_t cl_particles_blood_alpha;
-extern cvar_t cl_particles_blood_bloodhack;
-extern cvar_t cl_particles_explosions_shell;
extern cvar_t cl_beams_polygon;
extern cvar_t cl_beams_relative;
extern cvar_t cl_beams_lightatend;
else if (options_effects_cursor == optnum++) Cvar_SetValueQuick (&cl_particles_explosions_shell, !cl_particles_explosions_shell.integer);
else if (options_effects_cursor == optnum++) Cvar_SetValueQuick (&r_explosionclip, !r_explosionclip.integer);
else if (options_effects_cursor == optnum++) Cvar_SetValueQuick (&cl_stainmaps, !cl_stainmaps.integer);
- else if (options_effects_cursor == optnum++) Cvar_SetValueQuick (&cl_stainmapsclearonload, !cl_stainmapsclearonload.integer);
+ else if (options_effects_cursor == optnum++) Cvar_SetValueQuick (&cl_stainmaps_clearonload, !cl_stainmaps_clearonload.integer);
else if (options_effects_cursor == optnum++) Cvar_SetValueQuick (&cl_decals, !cl_decals.integer);
else if (options_effects_cursor == optnum++) Cvar_SetValueQuick (&r_detailtextures, !r_detailtextures.integer);
else if (options_effects_cursor == optnum++) Cvar_SetValueQuick (&cl_particles_bulletimpacts, !cl_particles_bulletimpacts.integer);
int visible;
cachepic_t *p;
- M_Background(320, 200);
+ M_Background(320, bound(200, 32 + OPTIONS_EFFECTS_ITEMS * 8, vid.conheight));
M_DrawPic(16, 4, "gfx/qplaque.lmp");
p = Draw_CachePic("gfx/p_option.lmp");
optcursor = options_effects_cursor;
optnum = 0;
- visible = (vid.conheight - 32) / 8;
+ visible = (menu_height - 32) / 8;
opty = 32 - bound(0, optcursor - (visible >> 1), max(0, OPTIONS_EFFECTS_ITEMS - visible)) * 8;
M_Options_PrintSlider( " Lights Per Model", true, r_modellights.value, 0, 8);
M_Options_PrintCheckbox(" Explosion Shell", true, cl_particles_explosions_shell.integer);
M_Options_PrintCheckbox(" Explosion Shell Clip", true, r_explosionclip.integer);
M_Options_PrintCheckbox(" Stainmaps", true, cl_stainmaps.integer);
- M_Options_PrintCheckbox("Onload Clear Stainmaps", true, cl_stainmapsclearonload.integer);
+ M_Options_PrintCheckbox("Onload Clear Stainmaps", true, cl_stainmaps_clearonload.integer);
M_Options_PrintCheckbox(" Decals", true, cl_decals.integer);
M_Options_PrintCheckbox(" Detail Texturing", true, r_detailtextures.integer);
M_Options_PrintCheckbox(" Bullet Impacts", true, cl_particles_bulletimpacts.integer);
}
-#define OPTIONS_GRAPHICS_ITEMS 7
+#define OPTIONS_GRAPHICS_ITEMS 12
int options_graphics_cursor;
extern cvar_t r_shadow_realtime_world_dlightshadows;
extern cvar_t r_shadow_realtime_world_lightmaps;
extern cvar_t r_shadow_realtime_world_shadows;
+extern cvar_t r_bloom;
+extern cvar_t r_bloom_intensity;
+extern cvar_t r_bloom_power;
+extern cvar_t r_bloom_blur;
+extern cvar_t r_bloom_resolution;
void M_Menu_Options_Graphics_AdjustSliders (int dir)
{
int optnum;
S_LocalSound ("sound/misc/menu3.wav");
-
+
optnum = 0;
if (options_graphics_cursor == optnum++) Cvar_SetValueQuick (&r_shadow_gloss, bound(0, r_shadow_gloss.integer + dir, 2));
else if (options_graphics_cursor == optnum++) Cvar_SetValueQuick (&r_shadow_realtime_world_dlightshadows, !r_shadow_realtime_world_dlightshadows.integer);
else if (options_graphics_cursor == optnum++) Cvar_SetValueQuick (&r_shadow_realtime_world_lightmaps, bound(0, r_shadow_realtime_world_lightmaps.value + dir * 0.1, 1));
else if (options_graphics_cursor == optnum++) Cvar_SetValueQuick (&r_shadow_realtime_world_shadows, !r_shadow_realtime_world_shadows.integer);
+ else if (options_graphics_cursor == optnum++) Cvar_SetValueQuick (&r_bloom, !r_bloom.integer);
+ else if (options_graphics_cursor == optnum++) Cvar_SetValueQuick (&r_bloom_intensity, bound(1, r_bloom_intensity.value + dir * 1, 16));
+ else if (options_graphics_cursor == optnum++) Cvar_SetValueQuick (&r_bloom_power, bound(1, r_bloom_power.value + dir * 1, 16));
+ else if (options_graphics_cursor == optnum++) Cvar_SetValueQuick (&r_bloom_blur, bound(1, r_bloom_blur.value + dir * 1, 16));
+ else if (options_graphics_cursor == optnum++) Cvar_SetValueQuick (&r_bloom_resolution, bound(64, r_bloom_resolution.value + dir * 64, 2048));
}
int visible;
cachepic_t *p;
- M_Background(320, 200);
+ M_Background(320, bound(200, 32 + OPTIONS_GRAPHICS_ITEMS * 8, vid.conheight));
M_DrawPic(16, 4, "gfx/qplaque.lmp");
p = Draw_CachePic("gfx/p_option.lmp");
optcursor = options_graphics_cursor;
optnum = 0;
- visible = (vid.conheight - 32) / 8;
+ visible = (menu_height - 32) / 8;
opty = 32 - bound(0, optcursor - (visible >> 1), max(0, OPTIONS_GRAPHICS_ITEMS - visible)) * 8;
M_Options_PrintSlider( " Gloss Mode", true, r_shadow_gloss.integer, 0, 2);
M_Options_PrintCheckbox("RT World DLight Shadows", true, r_shadow_realtime_world_dlightshadows.integer);
M_Options_PrintSlider( " RT World Lightmaps", true, r_shadow_realtime_world_lightmaps.value, 0, 1);
M_Options_PrintCheckbox(" RT World Shadow", true, r_shadow_realtime_world_shadows.integer);
+ M_Options_PrintCheckbox(" Bloom Effect", true, r_bloom.integer);
+ M_Options_PrintSlider( " Bloom Intensity", true, r_bloom_intensity.value, 1, 16);
+ M_Options_PrintSlider( " Bloom Power", true, r_bloom_power.value, 1, 16);
+ M_Options_PrintSlider( " Bloom Blur", true, r_bloom_blur.value, 1, 16);
+ M_Options_PrintSlider( " Bloom Resolution", true, r_bloom_resolution.value, 64, 2048);
}
optcursor = options_colorcontrol_cursor;
optnum = 0;
- visible = (vid.conheight - 32) / 8;
+ visible = (menu_height - 32) / 8;
opty = 32 - bound(0, optcursor - (visible >> 1), max(0, OPTIONS_COLORCONTROL_ITEMS - visible)) * 8;
M_Options_PrintCommand( " Reset to defaults", true);
{"cpbb04", "Deadly Inspirations"},
{"b2a15", "Area 15 (B2)"},
+ {"b2power", "BB_Power"},
{"barena", "Blood Arena"},
{"bkeep", "Blood Keep"},
{"bstar", "Brown Star"},
{"Post Mortem", 45, 9},
{"Cryptic Passage", 54, 10},
{"Cryptic BloodBath", 64, 4},
- {"Blood 2", 68, 5},
- {"Transfusion", 73, 9},
- {"Conversions", 82, 6}
+ {"Blood 2", 68, 6},
+ {"Transfusion", 74, 9},
+ {"Conversions", 83, 6}
};
level_t goodvsbad2levels[] =
if (gamemode == GAME_GOODVSBAD2)
break;
Cvar_SetValueQuick (&skill, skill.integer + dir);
- if (skill.integer > 3)
- Cvar_SetValueQuick (&skill, 0);
- if (skill.integer < 0)
- Cvar_SetValueQuick (&skill, 3);
+ if (gamemode == GAME_TRANSFUSION)
+ {
+ if (skill.integer > 4)
+ Cvar_SetValueQuick (&skill, 0);
+ if (skill.integer < 0)
+ Cvar_SetValueQuick (&skill, 4);
+ }
+ else
+ {
+ if (skill.integer > 3)
+ Cvar_SetValueQuick (&skill, 0);
+ if (skill.integer < 0)
+ Cvar_SetValueQuick (&skill, 3);
+ }
break;
case 5:
s = va("%i/%i masters %i/%i servers", masterreplycount, masterquerycount, serverreplycount, serverquerycount);
M_PrintRed((640 - strlen(s) * 8) / 2, 32, s);
if (*m_return_reason)
- M_Print(16, vid.conheight - 8, m_return_reason);
+ M_Print(16, menu_height - 8, m_return_reason);
y = 48;
- visible = (vid.conheight - 16 - y) / 8;
- start = bound(0, slist_cursor - (visible >> 1), hostCacheCount - visible);
- end = min(start + visible, hostCacheCount);
+ visible = (menu_height - 16 - y) / 8 / 2;
+ start = bound(0, slist_cursor - (visible >> 1), hostcache_viewcount - visible);
+ end = min(start + visible, hostcache_viewcount);
p = Draw_CachePic("gfx/p_multi.lmp");
M_DrawPic((640 - p->width) / 2, 4, "gfx/p_multi.lmp");
for (n = start;n < end;n++)
{
DrawQ_Fill(menu_x, menu_y + y, 640, 16, n == slist_cursor ? (0.5 + 0.2 * sin(realtime * M_PI)) : 0, 0, 0, 0.5, 0);
- M_Print(0, y, hostcache[n].line1);y += 8;
- M_Print(0, y, hostcache[n].line2);y += 8;
+ M_Print(0, y, hostcache_viewset[n]->line1);y += 8;
+ M_Print(0, y, hostcache_viewset[n]->line2);y += 8;
}
}
else if (realtime - masterquerytime < 3)
S_LocalSound ("sound/misc/menu1.wav");
slist_cursor--;
if (slist_cursor < 0)
- slist_cursor = hostCacheCount - 1;
+ slist_cursor = hostcache_viewcount - 1;
break;
case K_DOWNARROW:
case K_RIGHTARROW:
S_LocalSound ("sound/misc/menu1.wav");
slist_cursor++;
- if (slist_cursor >= hostCacheCount)
+ if (slist_cursor >= hostcache_viewcount)
slist_cursor = 0;
break;
case K_ENTER:
S_LocalSound ("sound/misc/menu2.wav");
- Cbuf_AddText(va("connect \"%s\"\n", hostcache[slist_cursor].cname));
+ if (hostcache_viewcount)
+ Cbuf_AddText(va("connect \"%s\"\n", hostcache_viewset[slist_cursor]->info.cname));
break;
default:
{
// reset key_dest
key_dest = key_game;
+
+ Mem_FreePool (&menu_mempool);
}
void M_Restart(void)
#define M_F_INIT "m_init"
#define M_F_KEYDOWN "m_keydown"
#define M_F_DRAW "m_draw"
-// ng_menu function names
-#define M_F_DISPLAY "m_display"
-#define M_F_HIDE "m_hide"
// normal menu names (rest)
#define M_F_TOGGLE "m_toggle"
#define M_F_SHUTDOWN "m_shutdown"
-#undef NG_MENU
+
static char *m_required_func[] = {
M_F_INIT,
M_F_KEYDOWN,
M_F_DRAW,
-#ifdef NG_MENU
-M_F_DISPLAY,
-M_F_HIDE,
-#else
M_F_TOGGLE,
-#endif
M_F_SHUTDOWN,
};
void MP_Restart(void)
{
-
MP_Init();
}
// COMMANDLINEOPTION: Client: -useqmenu causes the first time you open the menu to use the quake menu, then reverts to menu.dat (if forceqmenu is 0)
if(COM_CheckParm("-useqmenu"))
MR_SetRouting (TRUE);
- else
+ else
MR_SetRouting (FALSE);
}