#define TYPE_GAME 2
#define TYPE_BOTH 3
-static cvar_t forceqmenu = { 0, "forceqmenu", "0", "enables the quake menu instead of the quakec menu.dat (if present)" };
-static cvar_t menu_progs = { 0, "menu_progs", "menu.dat", "name of quakec menu.dat file" };
+static cvar_t forceqmenu = {CVAR_CLIENT, "forceqmenu", "0", "enables the quake menu instead of the quakec menu.dat (if present)"};
+static cvar_t menu_progs = {CVAR_CLIENT, "menu_progs", "menu.dat", "name of quakec menu.dat file"};
static int NehGameType;
static int options_colorcontrol_cursor;
// intensity value to match up to 50% dither to 'correct' quake
-static cvar_t menu_options_colorcontrol_correctionvalue = {0, "menu_options_colorcontrol_correctionvalue", "0.5", "intensity value that matches up to white/black dither pattern, should be 0.5 for linear color"};
+static cvar_t menu_options_colorcontrol_correctionvalue = {CVAR_CLIENT, "menu_options_colorcontrol_correctionvalue", "0.5", "intensity value that matches up to white/black dither pattern, should be 0.5 for linear color"};
void M_Menu_Options_ColorControl_f(cmd_state_t *cmd)
{
Cbuf_AddText(cmd, "stopdemo\n");
- Cvar_SetValue("port", lanConfig_port);
+ Cvar_SetValue(&cvars_all, "port", lanConfig_port);
if (lanConfig_cursor == 1 || lanConfig_cursor == 2)
{
if (gamemode == GAME_TRANSFUSION)
{
if (!coop.integer && !deathmatch.integer)
- Cvar_SetValue("deathmatch", 1);
+ Cvar_SetValue(&cvars_all, "deathmatch", 1);
if (deathmatch.integer == 0)
M_Print(160, 64, "Cooperative");
else if (deathmatch.integer == 2)
else if (gamemode == GAME_BATTLEMECH)
{
if (!deathmatch.integer)
- Cvar_SetValue("deathmatch", 1);
+ Cvar_SetValue(&cvars_all, "deathmatch", 1);
if (deathmatch.integer == 2)
M_Print(160, 64, "Rambo Match");
else
else
{
if (!coop.integer && !deathmatch.integer)
- Cvar_SetValue("deathmatch", 1);
+ Cvar_SetValue(&cvars_all, "deathmatch", 1);
if (coop.integer)
M_Print(160, 64, "Cooperative");
else
l = min(l - 1, 37);
memcpy(hostnamebuf, hostname.string, l);
hostnamebuf[l] = 0;
- Cvar_Set("hostname", hostnamebuf);
+ Cvar_Set(&cvars_all, "hostname", hostnamebuf);
}
}
break;
memcpy(hostnamebuf, hostname.string, l);
hostnamebuf[l] = ascii;
hostnamebuf[l+1] = 0;
- Cvar_Set("hostname", hostnamebuf);
+ Cvar_Set(&cvars_all, "hostname", hostnamebuf);
}
}
}
key_dest = key_game;
// init the normal menu now -> this will also correct the menu router pointers
- MR_SetRouting (TRUE);
+ MR_SetRouting (true);
// reset the active scene, too (to be on the safe side ;))
R_SelectScene( RST_CLIENT );
// TODO: this needs to be exposed to R_SetView (or something similar) ASAP [2/5/2008 Andreas]
r_refdef.scene.time = realtime;
+ // free memory for resources that are no longer referenced
+ PRVM_GarbageCollection(prog);
+
// FIXME: this really shouldnt error out lest we have a very broken refdef state...?
// or does it kill the server too?
PRVM_G_FLOAT(OFS_PARM0) = vid.width;
static void MP_Init (void)
{
prvm_prog_t *prog = MVM_prog;
- PRVM_Prog_Init(prog);
+ PRVM_Prog_Init(prog, &cmd_client);
prog->edictprivate_size = 0; // no private struct used
prog->name = "menu";
{
if(MR_Shutdown)
MR_Shutdown ();
- MR_SetRouting (FALSE);
+ MR_SetRouting (false);
}
static void MR_Restart_f(cmd_state_t *cmd)
// the normal quake menu only the first time
// 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);
+ MR_SetRouting (true);
else
- MR_SetRouting (FALSE);
+ MR_SetRouting (false);
}