diff options
author | SmallJoker <SmallJoker@users.noreply.github.com> | 2019-08-13 19:56:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-13 19:56:55 +0200 |
commit | 539f016c1b1a706da2c113435ec60bb39c868f4b (patch) | |
tree | 691e212ec4017bb6744dc23f2bd1dce2cb18e92b /src/collision.cpp | |
parent | e9ceead81dd989936e2de3ff7cd7496aecd09d39 (diff) | |
download | minetest-539f016c1b1a706da2c113435ec60bb39c868f4b.tar.gz minetest-539f016c1b1a706da2c113435ec60bb39c868f4b.tar.bz2 minetest-539f016c1b1a706da2c113435ec60bb39c868f4b.zip |
Better F6 profiler (#8750)
Update the profiler names to make more sense of what they actually represent
Move the profiler code from header to its source file
Use monospace font to align lines
Format the statistics line to align better with surrounding values
Refresh the profiler each 3 seconds (roughly)
Diffstat (limited to 'src/collision.cpp')
-rw-r--r-- | src/collision.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/collision.cpp b/src/collision.cpp index e911e6f8c..a443be7ab 100644 --- a/src/collision.cpp +++ b/src/collision.cpp @@ -220,8 +220,8 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef, { static bool time_notification_done = false; Map *map = &env->getMap(); - //TimeTaker tt("collisionMoveSimple"); - ScopeProfiler sp(g_profiler, "collisionMoveSimple avg", SPT_AVG); + + ScopeProfiler sp(g_profiler, "collisionMoveSimple()", SPT_AVG); collisionMoveResult result; @@ -255,7 +255,7 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef, std::vector<NearbyCollisionInfo> cinfo; { //TimeTaker tt2("collisionMoveSimple collect boxes"); - ScopeProfiler sp2(g_profiler, "collisionMoveSimple collect boxes avg", SPT_AVG); + ScopeProfiler sp2(g_profiler, "collisionMoveSimple(): collect boxes", SPT_AVG); v3f newpos_f = *pos_f + *speed_f * dtime; v3f minpos_f( @@ -351,9 +351,6 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef, if(collideWithObjects) { - ScopeProfiler sp2(g_profiler, "collisionMoveSimple objects avg", SPT_AVG); - //TimeTaker tt3("collisionMoveSimple collect object boxes"); - /* add object boxes to cinfo */ std::vector<ActiveObject*> objects; @@ -428,9 +425,6 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef, int loopcount = 0; while(dtime > BS * 1e-10f) { - //TimeTaker tt3("collisionMoveSimple dtime loop"); - ScopeProfiler sp2(g_profiler, "collisionMoveSimple dtime loop avg", SPT_AVG); - // Avoid infinite loop loopcount++; if (loopcount >= 100) { |