diff --git a/display.c b/display.c index 60d35fa..667ee74 100644 --- a/display.c +++ b/display.c @@ -43,6 +43,8 @@ u_long *curOT; // Scale X coordinates to correct the aspect ratio for the chosen resolution VECTOR aspect_scale = { SCREENWIDTH * ONE / 320, ONE, ONE }; +u_short polyCount; + void display_init() { // This not only resets the GPU but it also installs the library's @@ -146,6 +148,7 @@ void display_start() ClearOTagR(curOT, OTLEN); mem_prim_reset(db); + polyCount = 0; gte_SetBackColor(48, 48, 48); // Ambient light color gte_SetColorMatrix(&light_cols); // Light color (up to three different lights) diff --git a/display.h b/display.h index 8ccd9bb..a3f7f2d 100644 --- a/display.h +++ b/display.h @@ -10,6 +10,8 @@ extern MATRIX vp_matrix; extern u_long *curOT; +extern u_short polyCount; + void display_init(); void display_reset(int mode, u_char interlaced, int *outScreenHeight); void display_start(); diff --git a/main.c b/main.c index 8d3da54..c44ae2f 100644 --- a/main.c +++ b/main.c @@ -52,6 +52,7 @@ int main(int argc, const char *argv[]) // Draw stuff world_draw(&world); // Doesn't work >:( + FntPrint(-1, "Polygon count: %d\n", polyCount); FntFlush(-1); display_finish(); // Works diff --git a/world.c b/world.c index 25fc3f1..1f26f3b 100644 --- a/world.c +++ b/world.c @@ -120,6 +120,7 @@ void world_draw(const world_t *world) poly->r3 = poly->g3 = poly->b3 = (uint8_t)v3->pad; addPrim(curOT + depth, poly); + ++polyCount; } } }