else if (options_cursor == optnum++) Cvar_SetValueQuick(&v_contrast, bound(1, v_contrast.value + dir * 0.0625, 4));
else if (options_cursor == optnum++) Cvar_SetValueQuick(&v_gamma, bound(0.5, v_gamma.value + dir * 0.0625, 3));
else if (options_cursor == optnum++) Cvar_SetValueQuick(&volume, bound(0, volume.value + dir * 0.0625, 1));
+#ifdef CONFIG_CD
else if (options_cursor == optnum++) Cvar_SetValueQuick(&bgmvolume, bound(0, bgmvolume.value + dir * 0.0625, 1));
+#endif
}
static int optnum;
{
}
+static int M_GetServerListEntryCategory(const serverlist_entry_t *entry)
+{
+ return 0;
+}
+
void M_Shutdown(void)
{
// reset key_dest
// 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;
+ PRVM_G_FLOAT(OFS_PARM1) = vid.height;
prog->ExecuteProgram(prog, PRVM_menufunction(m_draw),"m_draw() required");
// TODO: imo this should be moved into scene, too [1/27/2008 Andreas]
prog->ExecuteProgram(prog, PRVM_menufunction(m_newmap),"m_newmap() required");
}
-static void MP_Shutdown (void)
+const serverlist_entry_t *serverlist_callbackentry = NULL;
+static int MP_GetServerListEntryCategory(const serverlist_entry_t *entry)
{
prvm_prog_t *prog = MVM_prog;
+ serverlist_callbackentry = entry;
+ if (PRVM_menufunction(m_gethostcachecategory))
+ {
+ prog->globals.fp[OFS_PARM0] = (prvm_vec_t) -1;
+ prog->ExecuteProgram(prog, PRVM_menufunction(m_gethostcachecategory),"m_gethostcachecategory(float entry) required");
+ serverlist_callbackentry = NULL;
+ return prog->globals.fp[OFS_RETURN];
+ }
+ else
+ {
+ return 0;
+ }
+}
- prog->ExecuteProgram(prog, PRVM_menufunction(m_shutdown),"m_shutdown() required");
+static void MP_Shutdown (void)
+{
+ prvm_prog_t *prog = MVM_prog;
+ if (prog->loaded)
+ prog->ExecuteProgram(prog, PRVM_menufunction(m_shutdown),"m_shutdown() required");
// reset key_dest
key_dest = key_game;
// call the prog init
prog->ExecuteProgram(prog, PRVM_menufunction(m_init),"m_init() required");
+
+ // Once m_init was called, we consider menuqc code fully initialized.
+ prog->inittime = realtime;
}
//============================================================================
void (*MR_ToggleMenu) (int mode);
void (*MR_Shutdown) (void);
void (*MR_NewMap) (void);
+int (*MR_GetServerListEntryCategory) (const serverlist_entry_t *entry);
void MR_SetRouting(qboolean forceold)
{
MR_ToggleMenu = M_ToggleMenu;
MR_Shutdown = M_Shutdown;
MR_NewMap = M_NewMap;
+ MR_GetServerListEntryCategory = M_GetServerListEntryCategory;
M_Init();
}
else
MR_ToggleMenu = MP_ToggleMenu;
MR_Shutdown = MP_Shutdown;
MR_NewMap = MP_NewMap;
+ MR_GetServerListEntryCategory = MP_GetServerListEntryCategory;
MP_Init();
}
}
res_count = VID_SortModes(res, res_count, false, false, true);
if(res_count)
{
- video_resolutions_count = res_count;
+ video_resolutions_count = (int)res_count;
video_resolutions = (video_resolution_t *) Mem_Alloc(cls.permanentmempool, sizeof(*video_resolutions) * (video_resolutions_count + 1));
memset(&video_resolutions[video_resolutions_count], 0, sizeof(video_resolutions[video_resolutions_count]));
for(i = 0; i < res_count; ++i)