]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_screen.c
Lots of speedups and cleanups in client code, dynamically allocated cl_entities ...
[xonotic/darkplaces.git] / cl_screen.c
index 9feb591a2f27d5b7452513721ca1e5d58b83d6de..bbe0883416bf13f8bf151c775922bce80cc7a84f 100644 (file)
@@ -480,7 +480,7 @@ void DrawQ_Pic(float x, float y, char *picname, float width, float height, float
        if (alpha < (1.0f / 255.0f))
                return;
        size = sizeof(*dq) + ((strlen(picname) + 1 + 3) & ~3);
-       if (r_refdef.drawqueuesize + size > MAX_DRAWQUEUE)
+       if (r_refdef.drawqueuesize + size > r_refdef.maxdrawqueuesize)
                return;
        red = bound(0, red, 1);
        green = bound(0, green, 1);
@@ -518,7 +518,7 @@ void DrawQ_String(float x, float y, char *string, int maxlen, float scalex, floa
        if (x >= vid.conwidth || y >= vid.conheight || x < (-scalex * maxlen) || y < (-scaley))
                return;
        size = sizeof(*dq) + ((len + 1 + 3) & ~3);
-       if (r_refdef.drawqueuesize + size > MAX_DRAWQUEUE)
+       if (r_refdef.drawqueuesize + size > r_refdef.maxdrawqueuesize)
                return;
        red = bound(0, red, 1);
        green = bound(0, green, 1);
@@ -546,7 +546,7 @@ void DrawQ_Fill (float x, float y, float w, float h, float red, float green, flo
        if (alpha < (1.0f / 255.0f))
                return;
        size = sizeof(*dq) + 4;
-       if (r_refdef.drawqueuesize + size > MAX_DRAWQUEUE)
+       if (r_refdef.drawqueuesize + size > r_refdef.maxdrawqueuesize)
                return;
        red = bound(0, red, 1);
        green = bound(0, green, 1);
@@ -578,7 +578,7 @@ void DrawQ_Mesh (drawqueuemesh_t *mesh, int flags)
        size += sizeof(float[3]) * mesh->numvertices;
        size += sizeof(float[2]) * mesh->numvertices;
        size += sizeof(float[4]) * mesh->numvertices;
-       if (r_refdef.drawqueuesize + size > MAX_DRAWQUEUE)
+       if (r_refdef.drawqueuesize + size > r_refdef.maxdrawqueuesize)
                return;
        dq = (void *)(r_refdef.drawqueue + r_refdef.drawqueuesize);
        dq->size = size;
@@ -590,14 +590,14 @@ void DrawQ_Mesh (drawqueuemesh_t *mesh, int flags)
        dq->scalex = 0;
        dq->scaley = 0;
        p = (void *)(dq + 1);
-       m = p;p += sizeof(drawqueuemesh_t);
+       m = p;(qbyte *)p += sizeof(drawqueuemesh_t);
        m->numindices = mesh->numindices;
        m->numvertices = mesh->numvertices;
        m->texture = mesh->texture;
-       m->indices   = p;memcpy(m->indices  , mesh->indices  , m->numindices  * sizeof(int     ));p += m->numindices  * sizeof(int     );
-       m->vertices  = p;memcpy(m->vertices , mesh->vertices , m->numvertices * sizeof(float[3]));p += m->numvertices * sizeof(float[3]);
-       m->texcoords = p;memcpy(m->texcoords, mesh->texcoords, m->numvertices * sizeof(float[2]));p += m->numvertices * sizeof(float[2]);
-       m->colors    = p;memcpy(m->colors   , mesh->colors   , m->numvertices * sizeof(float[4]));p += m->numvertices * sizeof(float[4]);
+       m->indices   = p;memcpy(m->indices  , mesh->indices  , m->numindices  * sizeof(int     ));(qbyte *)p += m->numindices  * sizeof(int     );
+       m->vertices  = p;memcpy(m->vertices , mesh->vertices , m->numvertices * sizeof(float[3]));(qbyte *)p += m->numvertices * sizeof(float[3]);
+       m->texcoords = p;memcpy(m->texcoords, mesh->texcoords, m->numvertices * sizeof(float[2]));(qbyte *)p += m->numvertices * sizeof(float[2]);
+       m->colors    = p;memcpy(m->colors   , mesh->colors   , m->numvertices * sizeof(float[4]));(qbyte *)p += m->numvertices * sizeof(float[4]);
        r_refdef.drawqueuesize += dq->size;
 }
 
@@ -930,7 +930,7 @@ void CL_SetupScreenSize(void)
 
 void CL_UpdateScreen(void)
 {
-       if (!scr_initialized || !con_initialized)
+       if (!scr_initialized || !con_initialized || vid_hidden)
                return;                         // not initialized yet
 
        if (cl_avidemo.integer)