X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=menu.c;h=d3e2b8dbd4d4ccfc03aa200c0d48d92c983c0f29;hb=660001dce93be41b85d5d1e92d4a6afa5de2db33;hp=b5270e285096a52f2fa33db0ee9d6e7ee2258daf;hpb=ecfa97404a1e344f1617cca6a22863652cd9774e;p=xonotic%2Fdarkplaces.git diff --git a/menu.c b/menu.c index b5270e28..d3e2b8db 100644 --- a/menu.c +++ b/menu.c @@ -1624,7 +1624,9 @@ static void M_Menu_Options_AdjustSliders (int dir) 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; @@ -5018,6 +5020,11 @@ static void M_NewMap(void) { } +static int M_GetServerListEntryCategory(const serverlist_entry_t *entry) +{ + return 0; +} + void M_Shutdown(void) { // reset key_dest @@ -5332,6 +5339,24 @@ static void MP_NewMap(void) prog->ExecuteProgram(prog, PRVM_menufunction(m_newmap),"m_newmap() required"); } +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; + } +} + static void MP_Shutdown (void) { prvm_prog_t *prog = MVM_prog; @@ -5392,6 +5417,7 @@ void (*MR_Draw) (void); 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) { @@ -5404,6 +5430,7 @@ void MR_SetRouting(qboolean forceold) MR_ToggleMenu = M_ToggleMenu; MR_Shutdown = M_Shutdown; MR_NewMap = M_NewMap; + MR_GetServerListEntryCategory = M_GetServerListEntryCategory; M_Init(); } else @@ -5414,6 +5441,7 @@ void MR_SetRouting(qboolean forceold) MR_ToggleMenu = MP_ToggleMenu; MR_Shutdown = MP_Shutdown; MR_NewMap = MP_NewMap; + MR_GetServerListEntryCategory = MP_GetServerListEntryCategory; MP_Init(); } } @@ -5453,7 +5481,7 @@ void MR_Init(void) 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)