+void R_TimeReport_Start(void)
+{
+ r_timereport_active = r_speeds.integer && cl.worldmodel && cls.state == ca_connected;
+ r_speeds_string[0] = 0;
+ if (r_timereport_active)
+ {
+ speedstringcount = 0;
+ AngleVectors (r_refdef.viewangles, vpn, NULL, NULL);
+ //sprintf(r_speeds_string, "org:'%c%6.2f %c%6.2f %c%6.2f' ang:'%c%3.0f %c%3.0f %c%3.0f' dir:'%c%2.3f %c%2.3f %c%2.3f'\n%6i walls %6i dlitwalls %7i modeltris %7i meshtris\nBSP: %6i faces %6i nodes %6i leafs\n%4i models %4i bmodels %4i sprites %5i particles %3i dlights\n",
+ // r_refdef.vieworg[0] < 0 ? '-' : ' ', fabs(r_refdef.vieworg[0]), r_refdef.vieworg[1] < 0 ? '-' : ' ', fabs(r_refdef.vieworg[1]), r_refdef.vieworg[2] < 0 ? '-' : ' ', fabs(r_refdef.vieworg[2]),
+ // r_refdef.viewangles[0] < 0 ? '-' : ' ', fabs(r_refdef.viewangles[0]), r_refdef.viewangles[1] < 0 ? '-' : ' ', fabs(r_refdef.viewangles[1]), r_refdef.viewangles[2] < 0 ? '-' : ' ', fabs(r_refdef.viewangles[2]),
+ // vpn[0] < 0 ? '-' : ' ', fabs(vpn[0]), vpn[1] < 0 ? '-' : ' ', fabs(vpn[1]), vpn[2] < 0 ? '-' : ' ', fabs(vpn[2]),
+ sprintf(r_speeds_string,
+ "org:'%+8.2f %+8.2f %+8.2f' ang:'%+4.0f %+4.0f %+4.0f' dir:'%+2.3f %+2.3f %+2.3f'\n"
+ "world:%6i faces%6i nodes%6i leafs%6i walls%6i dlitwalls\n"
+ "%5i models%5i bmodels%5i sprites%6i particles%4i dlights\n"
+ "%6i modeltris%6i transmeshs%6i transtris%6i meshs%6i meshtris\n",
+ r_refdef.vieworg[0], r_refdef.vieworg[1], r_refdef.vieworg[2], r_refdef.viewangles[0], r_refdef.viewangles[1], r_refdef.viewangles[2], vpn[0], vpn[1], vpn[2],
+ c_faces, c_nodes, c_leafs, c_brush_polys, c_light_polys,
+ c_models, c_bmodels, c_sprites, c_particles, c_dlights,
+ c_alias_polys, c_transmeshs, c_transtris, c_meshs, c_meshtris);
+
+ c_brush_polys = 0;
+ c_alias_polys = 0;
+ c_light_polys = 0;
+ c_faces = 0;
+ c_nodes = 0;
+ c_leafs = 0;
+ c_models = 0;
+ c_bmodels = 0;
+ c_sprites = 0;
+ c_particles = 0;
+ // c_dlights = 0;
+
+ r_timereport_start = Sys_DoubleTime();
+ }
+}
+
+void R_TimeReport_End(void)
+{
+ r_timereport_current = r_timereport_start;
+ R_TimeReport("total");
+
+ if (r_timereport_active)
+ {
+ int i, j, lines, y;
+ lines = 1;
+ for (i = 0;r_speeds_string[i];i++)
+ if (r_speeds_string[i] == '\n')
+ lines++;
+ y = vid.conheight - sb_lines - lines * 8/* - 8*/;
+ i = j = 0;
+ DrawQ_Fill(0, y, vid.conwidth, lines * 8, 0, 0, 0, 0.5, 0);
+ while (r_speeds_string[i])
+ {
+ j = i;
+ while (r_speeds_string[i] && r_speeds_string[i] != '\n')
+ i++;
+ if (i - j > 0)
+ DrawQ_String(0, y, r_speeds_string + j, i - j, 8, 8, 1, 1, 1, 1, 0);
+ if (r_speeds_string[i] == '\n')
+ i++;
+ y += 8;
+ }
+ }