]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_screen.c
lightning beams have been replaced with a polygon effect which renders faster than...
[xonotic/darkplaces.git] / cl_screen.c
index 9d5ca6289982a2c06715a2eb172683483d8c16eb..4c369fead832100dc444e4ed08017c105d19a0ce 100644 (file)
@@ -350,6 +350,10 @@ void R_TimeReport(char *desc)
        }
 }
 
+extern int c_rt_lights, c_rt_clears, c_rt_scissored;
+extern int c_rt_shadowmeshes, c_rt_shadowtris, c_rt_lightmeshes, c_rt_lighttris;
+extern int c_rtcached_shadowmeshes, c_rtcached_shadowtris;
+extern int r_shadow_lightingmode;
 void R_TimeReport_Start(void)
 {
        r_timereport_active = r_speeds.integer && cls.signon == SIGNONS && cls.state == ca_connected;
@@ -367,6 +371,16 @@ void R_TimeReport_Start(void)
                        c_faces, c_nodes, c_leafs, c_light_polys,
                        c_models, c_bmodels, c_sprites, c_particles, c_dlights,
                        c_alias_polys, c_meshs, c_meshelements / 3);
+               if (r_shadow_lightingmode)
+               {
+                       sprintf(r_speeds_string + strlen(r_speeds_string),
+                               "realtime lighting:%4i lights%4i clears%4i scissored\n"
+                               "dynamic: %6i shadowmeshes%6i shadowtris%6i lightmeshes%6i lighttris\n"
+                               "precomputed: %6i shadowmeshes%6i shadowtris\n",
+                               c_rt_lights, c_rt_clears, c_rt_scissored,
+                               c_rt_shadowmeshes, c_rt_shadowtris, c_rt_lightmeshes, c_rt_lighttris,
+                               c_rtcached_shadowmeshes, c_rtcached_shadowtris);
+               }
 
                c_alias_polys = 0;
                c_light_polys = 0;
@@ -506,7 +520,7 @@ void DrawQ_Pic(float x, float y, char *picname, float width, float height, float
        r_refdef.drawqueuesize += dq->size;
 }
 
-void DrawQ_String(float x, float y, char *string, int maxlen, float scalex, float scaley, float red, float green, float blue, float alpha, int flags)
+void DrawQ_String(float x, float y, const char *string, int maxlen, float scalex, float scaley, float red, float green, float blue, float alpha, int flags)
 {
        int size, len;
        drawqueue_t *dq;
@@ -580,7 +594,7 @@ void DrawQ_Mesh (drawqueuemesh_t *mesh, int flags)
        drawqueuemesh_t *m;
        size = sizeof(*dq);
        size += sizeof(drawqueuemesh_t);
-       size += sizeof(int) * mesh->numindices;
+       size += sizeof(int[3]) * mesh->numtriangles;
        size += sizeof(float[4]) * mesh->numvertices;
        size += sizeof(float[2]) * mesh->numvertices;
        size += sizeof(float[4]) * mesh->numvertices;
@@ -597,12 +611,12 @@ void DrawQ_Mesh (drawqueuemesh_t *mesh, int flags)
        dq->scaley = 0;
        p = (void *)(dq + 1);
        m = p;(qbyte *)p += sizeof(drawqueuemesh_t);
-       m->numindices = mesh->numindices;
+       m->numtriangles = mesh->numtriangles;
        m->numvertices = mesh->numvertices;
        m->texture = mesh->texture;
-       m->indices   = p;memcpy(m->indices  , mesh->indices  , m->numindices  * sizeof(int     ));(qbyte *)p += m->numindices  * sizeof(int     );
+       m->indices   = p;memcpy(m->indices  , mesh->indices  , m->numtriangles * sizeof(int[3]));(qbyte *)p += m->numtriangles * sizeof(int[3]);
        m->vertices  = p;memcpy(m->vertices , mesh->vertices , m->numvertices * sizeof(float[4]));(qbyte *)p += m->numvertices * sizeof(float[4]);
-       m->texcoords = p;memcpy(m->texcoords, mesh->texcoords, m->numvertices * sizeof(float[2]));(qbyte *)p += m->numvertices * sizeof(float[2]);
+       m->texcoords = p;memcpy(m->texcoords, mesh->texcoords, m->numvertices * sizeof(float[4]));(qbyte *)p += m->numvertices * sizeof(float[4]);
        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;
 }
@@ -933,6 +947,7 @@ void CL_SetupScreenSize(void)
        SCR_CalcRefdef();
 }
 
+extern void R_Shadow_EditLights_DrawSelectedLightProperties(void);
 void CL_UpdateScreen(void)
 {
        if (!scr_initialized || !con_initialized || vid_hidden)
@@ -984,6 +999,7 @@ void CL_UpdateScreen(void)
                        R_TimeReport_End();
                        R_TimeReport_Start();
                }
+               R_Shadow_EditLights_DrawSelectedLightProperties();
        }
        SCR_DrawConsole();