Browse Source

Keep track of and display total polycount

tess_experiment
Nico de Poel 3 years ago
parent
commit
d3efa8e590
  1. 3
      display.c
  2. 2
      display.h
  3. 1
      main.c
  4. 1
      world.c

3
display.c

@ -43,6 +43,8 @@ u_long *curOT;
// Scale X coordinates to correct the aspect ratio for the chosen resolution // Scale X coordinates to correct the aspect ratio for the chosen resolution
VECTOR aspect_scale = { SCREENWIDTH * ONE / 320, ONE, ONE }; VECTOR aspect_scale = { SCREENWIDTH * ONE / 320, ONE, ONE };
u_short polyCount;
void display_init() void display_init()
{ {
// This not only resets the GPU but it also installs the library's // This not only resets the GPU but it also installs the library's
@ -146,6 +148,7 @@ void display_start()
ClearOTagR(curOT, OTLEN); ClearOTagR(curOT, OTLEN);
mem_prim_reset(db); mem_prim_reset(db);
polyCount = 0;
gte_SetBackColor(48, 48, 48); // Ambient light color gte_SetBackColor(48, 48, 48); // Ambient light color
gte_SetColorMatrix(&light_cols); // Light color (up to three different lights) gte_SetColorMatrix(&light_cols); // Light color (up to three different lights)

2
display.h

@ -10,6 +10,8 @@
extern MATRIX vp_matrix; extern MATRIX vp_matrix;
extern u_long *curOT; extern u_long *curOT;
extern u_short polyCount;
void display_init(); void display_init();
void display_reset(int mode, u_char interlaced, int *outScreenHeight); void display_reset(int mode, u_char interlaced, int *outScreenHeight);
void display_start(); void display_start();

1
main.c

@ -52,6 +52,7 @@ int main(int argc, const char *argv[])
// Draw stuff // Draw stuff
world_draw(&world); // Doesn't work >:( world_draw(&world); // Doesn't work >:(
FntPrint(-1, "Polygon count: %d\n", polyCount);
FntFlush(-1); FntFlush(-1);
display_finish(); // Works display_finish(); // Works

1
world.c

@ -120,6 +120,7 @@ void world_draw(const world_t *world)
poly->r3 = poly->g3 = poly->b3 = (uint8_t)v3->pad; poly->r3 = poly->g3 = poly->b3 = (uint8_t)v3->pad;
addPrim(curOT + depth, poly); addPrim(curOT + depth, poly);
++polyCount;
} }
} }
} }
Loading…
Cancel
Save