]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
MENUQC loading screen support TimePath/loading
authorTimePath <andrew.hardaker1995@gmail.com>
Thu, 3 Sep 2015 01:53:31 +0000 (11:53 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Thu, 3 Sep 2015 02:07:07 +0000 (12:07 +1000)
cl_screen.c
menu.c
prvm_offsets.h

index 5bcce5f35ad79e00d8be0e336744d52216e5840c..27972c7489780f6bfbc02184f4563b5f6a769fb4 100644 (file)
@@ -2118,6 +2118,13 @@ void R_ClearScreen(qboolean fogcolor)
        GL_Clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | (vid.stencil ? GL_STENCIL_BUFFER_BIT : 0), clearcolor, 1.0f, 128);
 }
 
+void (*MR_Loading) (qboolean show);
+static void SCR_DrawMenuLoadingScreen (qboolean show)
+{
+       if (MR_Loading)
+               MR_Loading(show);
+}
+
 int r_stereo_side;
 
 static void SCR_DrawScreen (void)
@@ -2260,6 +2267,7 @@ static void SCR_DrawScreen (void)
                SCR_CheckDrawCenterString();
        }
        SCR_DrawNetGraph ();
+       SCR_DrawMenuLoadingScreen(cls.signon != SIGNONS);
 #ifdef CONFIG_MENU
        MR_Draw();
 #endif
@@ -2563,6 +2571,7 @@ static void SCR_DrawLoadingScreen_SharedSetup (qboolean clear)
 
 static void SCR_DrawLoadingScreen (qboolean clear)
 {
+       SCR_DrawMenuLoadingScreen(true);
        // we only need to draw the image if it isn't already there
        GL_BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
        GL_DepthRange(0, 1);
diff --git a/menu.c b/menu.c
index d3e2b8dbd4d4ccfc03aa200c0d48d92c983c0f29..e2c2365c03e820e668df4c66a02a68d2ef6077f1 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -5020,6 +5020,10 @@ static void M_NewMap(void)
 {
 }
 
+static void M_Loading(qboolean show)
+{
+}
+
 static int M_GetServerListEntryCategory(const serverlist_entry_t *entry)
 {
        return 0;
@@ -5339,6 +5343,16 @@ static void MP_NewMap(void)
                prog->ExecuteProgram(prog, PRVM_menufunction(m_newmap),"m_newmap() required");
 }
 
+static void MP_Loading(qboolean show)
+{
+       prvm_prog_t *prog = MVM_prog;
+       if (PRVM_menufunction(m_loading))
+       {
+               prog->globals.fp[OFS_PARM0] = (prvm_vec_t) show;
+               prog->ExecuteProgram(prog, PRVM_menufunction(m_loading),"m_loading() required");
+       }
+}
+
 const serverlist_entry_t *serverlist_callbackentry = NULL;
 static int MP_GetServerListEntryCategory(const serverlist_entry_t *entry)
 {
@@ -5417,6 +5431,7 @@ void (*MR_Draw) (void);
 void (*MR_ToggleMenu) (int mode);
 void (*MR_Shutdown) (void);
 void (*MR_NewMap) (void);
+void (*MR_Loading) (qboolean show);
 int (*MR_GetServerListEntryCategory) (const serverlist_entry_t *entry);
 
 void MR_SetRouting(qboolean forceold)
@@ -5430,6 +5445,7 @@ void MR_SetRouting(qboolean forceold)
                MR_ToggleMenu = M_ToggleMenu;
                MR_Shutdown = M_Shutdown;
                MR_NewMap = M_NewMap;
+               MR_Loading = M_Loading;
                MR_GetServerListEntryCategory = M_GetServerListEntryCategory;
                M_Init();
        }
@@ -5441,6 +5457,7 @@ void MR_SetRouting(qboolean forceold)
                MR_ToggleMenu = MP_ToggleMenu;
                MR_Shutdown = MP_Shutdown;
                MR_NewMap = MP_NewMap;
+               MR_Loading = MP_Loading;
                MR_GetServerListEntryCategory = MP_GetServerListEntryCategory;
                MP_Init();
        }
index 1563a0510f29264f475cfb436d0ec11b8395231f..b46915dea2c3d2c9eaef12823ddee252806599f2 100644 (file)
@@ -443,6 +443,7 @@ PRVM_DECLARE_function(m_newmap)
 PRVM_DECLARE_function(m_gethostcachecategory)
 PRVM_DECLARE_function(m_shutdown)
 PRVM_DECLARE_function(m_toggle)
+PRVM_DECLARE_function(m_loading)
 PRVM_DECLARE_function(main)
 PRVM_DECLARE_global(SV_InitCmd)
 PRVM_DECLARE_global(clientcommandframe)