]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - menu.c
Corrected two comments regarding IBSP version of the Q2 bsp format.
[xonotic/darkplaces.git] / menu.c
diff --git a/menu.c b/menu.c
index 184ae366dc96c75b2aff943c6841f85c5f8afab8..d3e2b8dbd4d4ccfc03aa200c0d48d92c983c0f29 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -18,7 +18,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 */
 #include "quakedef.h"
+#ifdef CONFIG_CD
 #include "cdaudio.h"
+#endif
 #include "image.h"
 #include "progsvm.h"
 
@@ -1622,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;
@@ -1699,7 +1703,9 @@ static void M_Options_Draw (void)
        M_Options_PrintSlider(  "            Brightness", true, v_contrast.value, 1, 2);
        M_Options_PrintSlider(  "                 Gamma", true, v_gamma.value, 0.5, 3);
        M_Options_PrintSlider(  "          Sound Volume", snd_initialized.integer, volume.value, 0, 1);
+#ifdef CONFIG_CD
        M_Options_PrintSlider(  "          Music Volume", cdaudioinitialized.integer, bgmvolume.value, 0, 1);
+#endif
        M_Options_PrintCommand( "     Customize Effects", true);
        M_Options_PrintCommand( "       Effects:  Quake", true);
        M_Options_PrintCommand( "       Effects: Normal", true);
@@ -5014,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
@@ -5303,6 +5314,8 @@ static void MP_Draw (void)
 
        // 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]
@@ -5326,11 +5339,29 @@ static void MP_NewMap(void)
                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;
@@ -5386,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)
 {
@@ -5398,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
@@ -5408,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();
        }
 }
@@ -5447,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)