]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
don't call Mem_CheckSentinelsGlobal in image loaders (wastes time)
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 13 Nov 2009 19:26:44 +0000 (19:26 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 13 Nov 2009 19:26:44 +0000 (19:26 +0000)
call Mem_CheckSentinelsGlobal every frame if developer_memorydebug cvar
is on (or MEMPARANOIA is on)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9482 d7cf8633-e32d-0410-b094-e92efae38249

host.c
image.c

diff --git a/host.c b/host.c
index a5bca7369eff93ef71fb0fe064bcd7b5cf290230..1f2ccaa4f49469dae384673bb29b3a662daf0ff2 100644 (file)
--- a/host.c
+++ b/host.c
@@ -935,6 +935,9 @@ void Host_Main(void)
 
 #if MEMPARANOIA
                Mem_CheckSentinelsGlobal();
+#else
+               if (developer_memorydebug.integer)
+                       Mem_CheckSentinelsGlobal();
 #endif
 
                // if there is some time remaining from this frame, reset the timers
diff --git a/image.c b/image.c
index 968fabf6381eedd52aa92d3f8c8ff3741ee8766c..2f805795b4c32f6e2da79f05e8e59a4e5f3a1528 100644 (file)
--- a/image.c
+++ b/image.c
@@ -852,8 +852,8 @@ unsigned char *loadimagepixelsbgra (const char *filename, qboolean complain, qbo
        imageformat_t *firstformat, *format;
        unsigned char *f, *data = NULL;
        char basename[MAX_QPATH], name[MAX_QPATH], *c;
-       if (developer_memorydebug.integer)
-               Mem_CheckSentinelsGlobal();
+       //if (developer_memorydebug.integer)
+       //      Mem_CheckSentinelsGlobal();
        if (developer_texturelogging.integer)
                Log_Printf("textures.log", "%s\n", filename);
        Image_StripImageExtension(filename, basename, sizeof(basename)); // strip filename extensions to allow replacement by other types
@@ -894,8 +894,8 @@ unsigned char *loadimagepixelsbgra (const char *filename, qboolean complain, qbo
                        {
                                if (developer.integer >= 10)
                                        Con_Printf("loaded image %s (%dx%d)\n", name, image_width, image_height);
-                               if (developer_memorydebug.integer)
-                                       Mem_CheckSentinelsGlobal();
+                               //if (developer_memorydebug.integer)
+                               //      Mem_CheckSentinelsGlobal();
                                if(allowFixtrans && r_fixtrans_auto.integer)
                                {
                                        int n = fixtransparentpixels(data, image_width, image_height);
@@ -931,8 +931,8 @@ unsigned char *loadimagepixelsbgra (const char *filename, qboolean complain, qbo
        // texture loading can take a while, so make sure we're sending keepalives
        CL_KeepaliveMessage(false);
 
-       if (developer_memorydebug.integer)
-               Mem_CheckSentinelsGlobal();
+       //if (developer_memorydebug.integer)
+       //      Mem_CheckSentinelsGlobal();
        return NULL;
 }