]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Allow MENUQC to draw on top of the loading screen
authorTimePath <andrew.hardaker1995@gmail.com>
Fri, 19 Dec 2014 07:59:45 +0000 (18:59 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Fri, 19 Dec 2014 07:59:45 +0000 (18:59 +1100)
cl_screen.c
menu.c
prvm_offsets.h

index 7e15123c133df5b2f088ab58ed836057818ee428..08b6c9188a722cc3035aaf7b6e2f51249ef401b5 100644 (file)
@@ -2115,6 +2115,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) (void);
+static void SCR_DrawCSQCLoadingScreen ()
+{
+       if (MR_Loading)
+               MR_Loading();
+}
+
 int r_stereo_side;
 
 static void SCR_DrawScreen (void)
@@ -2256,6 +2263,10 @@ static void SCR_DrawScreen (void)
                SHOWLMP_drawall();
                SCR_CheckDrawCenterString();
        }
+       else
+       {
+               SCR_DrawCSQCLoadingScreen();
+       }
        SCR_DrawNetGraph ();
 #ifdef CONFIG_MENU
        MR_Draw();
@@ -2577,6 +2588,7 @@ static void SCR_DrawLoadingScreen (qboolean clear)
        R_SetupShader_Generic(Draw_GetPicTexture(loadingscreenpic), NULL, GL_MODULATE, 1, true, true, false);
        R_Mesh_Draw(0, 4, 0, 2, polygonelement3i, NULL, 0, polygonelement3s, NULL, 0);
        SCR_DrawLoadingStack();
+       SCR_DrawCSQCLoadingScreen();
 }
 
 static void SCR_DrawLoadingScreen_SharedFinish (qboolean clear)
diff --git a/menu.c b/menu.c
index d3e2b8dbd4d4ccfc03aa200c0d48d92c983c0f29..8ea31ed115c957444bfe2672e3184b6f1bcdf40b 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -5020,6 +5020,10 @@ static void M_NewMap(void)
 {
 }
 
+static void M_Loading(void)
+{
+}
+
 static int M_GetServerListEntryCategory(const serverlist_entry_t *entry)
 {
        return 0;
@@ -5339,6 +5343,13 @@ static void MP_NewMap(void)
                prog->ExecuteProgram(prog, PRVM_menufunction(m_newmap),"m_newmap() required");
 }
 
+static void MP_Loading(void)
+{
+       prvm_prog_t *prog = MVM_prog;
+       if (PRVM_menufunction(m_loading))
+               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 +5428,7 @@ void (*MR_Draw) (void);
 void (*MR_ToggleMenu) (int mode);
 void (*MR_Shutdown) (void);
 void (*MR_NewMap) (void);
+void (*MR_Loading) (void);
 int (*MR_GetServerListEntryCategory) (const serverlist_entry_t *entry);
 
 void MR_SetRouting(qboolean forceold)
@@ -5430,6 +5442,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 +5454,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 fcb57ad0c3d63b21d5c14c7e6312e688d2cca5a1..842bf71b59accc230b12d5978dc51e0e2b3df4f1 100644 (file)
@@ -442,6 +442,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)