From 0f9202a39b71d9beecd30f46bd975bb80b8b7ac1 Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Tue, 17 Aug 2021 20:53:59 +0100 Subject: [PATCH] Puppyprint now benchmarks raycasts as collision title --- src/game/puppycam2.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/game/puppycam2.c b/src/game/puppycam2.c index 2f04b9cc..2df809e9 100644 --- a/src/game/puppycam2.c +++ b/src/game/puppycam2.c @@ -996,6 +996,9 @@ void find_surface_on_ray_list(struct SurfaceNode *list, Vec3f orig, Vec3f dir, f f32 length; Vec3f chk_hit_pos; f32 top, bottom; + #ifdef PUPPYPRINT + OSTime first = osGetTime(); + #endif // Get upper and lower bounds of ray if (dir[1] >= 0.0f) @@ -1027,6 +1030,9 @@ void find_surface_on_ray_list(struct SurfaceNode *list, Vec3f orig, Vec3f dir, f } } } + #ifdef PUPPYPRINT + collisionTime[perfIteration] += osGetTime()-first; + #endif } void find_surface_on_ray_cell(s16 cellX, s16 cellZ, Vec3f orig, Vec3f normalized_dir, f32 dir_length, struct Surface **hit_surface, Vec3f hit_pos, f32 *max_length, s32 flags)