+#define expandaliasvert(newmax) if ((newmax) > aliasvertmax) gl_models_allocarrays(newmax)
+
+void gl_models_allocarrays(int newmax)
+{
+ qbyte *data;
+ aliasvertmax = newmax;
+ if (aliasvertarrays != NULL)
+ Mem_Free(aliasvertarrays);
+ aliasvertarrays = Mem_Alloc(gl_models_mempool, aliasvertmax * (sizeof(float[4+4+3+3+3]) + sizeof(int[3])));
+ data = aliasvertarrays;
+ aliasvertcolor4f = aliasvertcolor4fbuf = (void *)data;data += aliasvertmax * sizeof(float[4]);
+ aliasvertcolor2_4f = (void *)data;data += aliasvertmax * sizeof(float[4]); // used temporarily for tinted coloring
+ aliasvert_svector3f = (void *)data;data += aliasvertmax * sizeof(float[3]);
+ aliasvert_tvector3f = (void *)data;data += aliasvertmax * sizeof(float[3]);
+ aliasvert_normal3f = (void *)data;data += aliasvertmax * sizeof(float[3]);
+ aliasvertusage = (void *)data;data += aliasvertmax * sizeof(int[3]);
+}
+
+void gl_models_freearrays(void)
+{
+ aliasvertmax = 0;
+ if (aliasvertarrays != NULL)
+ Mem_Free(aliasvertarrays);
+ aliasvertarrays = NULL;
+ aliasvertcolor4f = aliasvertcolor4fbuf = NULL;
+ aliasvertcolor2_4f = NULL;
+ aliasvert_svector3f = NULL;
+ aliasvert_tvector3f = NULL;
+ aliasvert_normal3f = NULL;
+ aliasvertusage = NULL;
+}
+