Puppyprint

This commit is contained in:
Fazana committed 2021-08-15 11:30:19 +01:00
1 parent 4ae923aaa0
commit 30aeb6841c
18 files changed
+1329 -13

No files matched your search

+49
View File
@@ -7,6 +7,7 @@
#include "game/object_list_processor.h"
#include "surface_collision.h"
#include "surface_load.h"
#include "game/puppyprint.h"
/**************************************************
* WALLS *
@@ -187,6 +188,9 @@ s32 find_wall_collisions(struct WallCollisionData *colData) {
s32 numCollisions = 0;
s16 x = colData->x;
s16 z = colData->z;
#ifdef PUPPYPRINT
OSTime first = osGetTime();
#endif
colData->numWalls = 0;
@@ -213,6 +217,10 @@ s32 find_wall_collisions(struct WallCollisionData *colData) {
// Increment the debug tracker.
gNumCalls.wall += 1;
#ifdef PUPPYPRINT
collisionTime[perfIteration] += osGetTime()-first;
#endif
return numCollisions;
}
@@ -299,6 +307,9 @@ f32 find_ceil(f32 posX, f32 posY, f32 posZ, struct Surface **pceil) {
f32 height = CELL_HEIGHT_LIMIT;
f32 dynamicHeight = CELL_HEIGHT_LIMIT;
s16 x, y, z;
#ifdef PUPPYPRINT
OSTime first = osGetTime();
#endif
//! (Parallel Universes) Because position is casted to an s16, reaching higher
// float locations can return ceilings despite them not existing there.
@@ -337,6 +348,10 @@ f32 find_ceil(f32 posX, f32 posY, f32 posZ, struct Surface **pceil) {
// Increment the debug tracker.
gNumCalls.ceil += 1;
#ifdef PUPPYPRINT
collisionTime[perfIteration] += osGetTime()-first;
#endif
return height;
}
@@ -562,6 +577,9 @@ f32 unused_find_dynamic_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfl
*/
f32 find_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfloor) {
s16 cellZ, cellX;
#ifdef PUPPYPRINT
OSTime first = osGetTime();
#endif
struct Surface *floor, *dynamicFloor;
struct SurfaceNode *surfaceList;
@@ -579,9 +597,15 @@ f32 find_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfloor) {
*pfloor = NULL;
if (x <= -LEVEL_BOUNDARY_MAX || x >= LEVEL_BOUNDARY_MAX) {
#ifdef PUPPYPRINT
collisionTime[perfIteration] += osGetTime()-first;
#endif
return height;
}
if (z <= -LEVEL_BOUNDARY_MAX || z >= LEVEL_BOUNDARY_MAX) {
#ifdef PUPPYPRINT
collisionTime[perfIteration] += osGetTime()-first;
#endif
return height;
}
@@ -628,6 +652,10 @@ f32 find_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfloor) {
// Increment the debug tracker.
gNumCalls.floor += 1;
#ifdef PUPPYPRINT
collisionTime[perfIteration] += osGetTime()-first;
#endif
return height;
}
@@ -685,6 +713,9 @@ f32 find_water_level_and_floor(f32 x, f32 z, struct Surface **pfloor) {
f32 waterLevel = FLOOR_LOWER_LIMIT;
s16 *p = gEnvironmentRegions;
struct Surface *floor = NULL;
#ifdef PUPPYPRINT
OSTime first = osGetTime();
#endif
if (gCheckingSurfaceCollisionsForCamera) {
waterLevel = find_water_floor(x, gLakituState.pos[1], z, &floor);
@@ -715,6 +746,10 @@ f32 find_water_level_and_floor(f32 x, f32 z, struct Surface **pfloor) {
*pfloor = floor;
}
#ifdef PUPPYPRINT
collisionTime[perfIteration] += osGetTime()-first;
#endif
return waterLevel;
}
@@ -729,6 +764,9 @@ f32 find_water_level(f32 x, f32 z) {
f32 waterLevel = FLOOR_LOWER_LIMIT;
s16 *p = gEnvironmentRegions;
struct Surface *floor;
#ifdef PUPPYPRINT
OSTime first = osGetTime();
#endif
if (gCheckingSurfaceCollisionsForCamera) {
waterLevel = find_water_floor(x, gLakituState.pos[1], z, &floor);
@@ -757,6 +795,10 @@ f32 find_water_level(f32 x, f32 z) {
}
}
#ifdef PUPPYPRINT
collisionTime[perfIteration] += osGetTime()-first;
#endif
return waterLevel;
}
@@ -771,6 +813,9 @@ f32 find_poison_gas_level(f32 x, f32 z) {
f32 loX, hiX, loZ, hiZ;
f32 gasLevel = FLOOR_LOWER_LIMIT;
s16 *p = gEnvironmentRegions;
#ifdef PUPPYPRINT
OSTime first = osGetTime();
#endif
if (p != NULL) {
numRegions = *p++;
@@ -797,6 +842,10 @@ f32 find_poison_gas_level(f32 x, f32 z) {
}
}
#ifdef PUPPYPRINT
collisionTime[perfIteration] += osGetTime()-first;
#endif
return gasLevel;
}