new system for debug logs

This commit is contained in:
Zeno Rogue
2025-10-19 15:47:01 +02:00
parent 94024dd5f1
commit 113e75d5e1
43 changed files with 601 additions and 447 deletions
+12 -10
View File
@@ -180,7 +180,7 @@ vector<glhr::colored_vertex> line_vertices;
#endif
EX void glflush() {
DEBBI(DF_GRAPH, ("glflush"));
DEBBI(debug_graph, ("glflush"));
#if MINIMIZE_GL_CALLS
if(isize(triangle_vertices)) {
// printf("%3d | %d shapes, %d/%d vertices\n", lprio, shapes_merged, isize(triangle_vertices), isize(line_vertices));
@@ -1817,10 +1817,12 @@ bool broken_projection(dqi_poly& p0) {
return false;
}
EX debugflag debug_vertex = {"vertex"};
void dqi_poly::draw() {
if(flags & POLY_DEBUG) debug_this();
if(debugflags & DF_VERTEX) {
if(debug_vertex) {
println(hlog, int(prio), ": V=", V, " o=", offset, " c=", cnt, " ot=", offset_texture, " ol=", outline, " lw=", linewidth, " f=", (color_t) flags, " i=", intester, " c=", cache, " ti=", (cell*) tinf);
for(int i=0; i<cnt; i++) print(hlog, (*tab)[offset+i]);
println(hlog);
@@ -2345,7 +2347,7 @@ void dqi_line::draw_back() {
}
EX void sort_drawqueue() {
DEBBI(DF_GRAPH, ("sort_drawqueue"));
DEBBI(debug_graph, ("sort_drawqueue"));
for(int a=0; a<PMAX; a++) qp[a] = 0;
@@ -2399,7 +2401,7 @@ EX void reverse_side_priorities() {
// on the sphere, parts on the back are drawn first
EX void draw_backside() {
DEBBI(DF_GRAPH, ("draw_backside"));
DEBBI(debug_graph, ("draw_backside"));
if(pmodel == mdHyperboloid && hyperbolic && pconf.show_hyperboloid_flat) {
dynamicval<eModel> dv (pmodel, mdHyperboloidFlat);
for(auto& ptd: ptds)
@@ -2457,7 +2459,7 @@ EX void set_vr_sphere() {
EX int hemi_side = 0;
EX void draw_main() {
DEBBI(DF_GRAPH, ("draw_main"));
DEBBI(debug_graph, ("draw_main"));
if(pconf.back_and_front == 1 && vid.consider_shader_projection) {
dynamicval<int> pa(pconf.back_and_front);
@@ -2546,20 +2548,20 @@ EX void draw_main() {
glflush();
}
else {
DEBB(DF_GRAPH, ("draw_main1"));
DEBB(debug_graph, ("draw_main1"));
if(ray::in_use && !ray::comparison_mode) {
ray::cast();
reset_projection();
}
DEBB(DF_GRAPH, ("outcircle"));
DEBB(debug_graph, ("outcircle"));
for(auto& ptd: ptds) if(ptd->prio == PPR::OUTCIRCLE)
ptd->draw();
if(two_sided_model()) draw_backside();
for(auto& ptd: ptds) if(ptd->prio != PPR::OUTCIRCLE) {
DEBBI(DF_VERTEX, ("prio: ", int(ptd->prio), " color ", ptd->color));
DEBBI(debug_vertex, ("prio: ", int(ptd->prio), " color ", ptd->color));
dynamicval<int> ss(spherespecial, among(ptd->prio, PPR::MOBILE_ARROW, PPR::OUTCIRCLE, PPR::CIRCLE) ? 0 : spherespecial);
ptd->draw();
}
@@ -2582,7 +2584,7 @@ EX void draw_main() {
EX void drawqueue() {
DEBBI(DF_GRAPH, ("drawqueue"));
DEBBI(debug_graph, ("drawqueue"));
#if CAP_WRL
if(wrl::in) { wrl::render(); return; }
@@ -2611,7 +2613,7 @@ EX void drawqueue() {
sort_drawqueue();
DEBB(DF_GRAPH, ("sort walls"));
DEBB(debug_graph, ("sort walls"));
if(GDIM == 2)
for(PPR p: all_side_prios) {