]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - zone.c
make precache_sound return the sound index (for using WriteStuff to send a sound...
[xonotic/darkplaces.git] / zone.c
diff --git a/zone.c b/zone.c
index 3cbde6c9f64e7d68d738c1aa2eabd56e45473307..2ab390bd8ae8e0bba09ad3f564d139c55b288b74 100644 (file)
--- a/zone.c
+++ b/zone.c
@@ -393,7 +393,7 @@ void Mem_ExpandableArray_FreeArray(memexpandablearray_t *l)
        size_t i;
        if (l->maxarrays)
        {
-               for (i = 0;i != l->numarrays;l++)
+               for (i = 0;i != l->numarrays;i++)
                        Mem_Free(l->arrays[i].data);
                Mem_Free(l->arrays);
        }
@@ -477,7 +477,7 @@ void *Mem_ExpandableArray_RecordAtIndex(memexpandablearray_t *l, size_t index)
        j = index % l->numrecordsperarray;
        if (i >= l->numarrays || !l->arrays[i].allocflags[j])
                return NULL;
-       return (void *)l->arrays[i].data + j * l->recordsize;
+       return (void *)(l->arrays[i].data + j * l->recordsize);
 }
 
 
@@ -553,10 +553,21 @@ void MemStats_f(void)
 {
        Mem_CheckSentinelsGlobal();
        R_TextureStats_Print(false, false, true);
+       GL_Mesh_ListVBOs(false);
        Mem_PrintStats();
 }
 
 
+char* Mem_strdup (mempool_t *pool, const char* s)
+{
+       char* p;
+       size_t sz = strlen (s) + 1;
+       if (s == NULL) return NULL;
+       p = (char*)Mem_Alloc (pool, sz);
+       strlcpy (p, s, sz);
+       return p;
+}
+
 /*
 ========================
 Memory_Init