diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2024-02-26 18:46:21 +0100 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-02-26 20:06:25 +0100 |
| commit | bde5939b2f1eb5c04c1ab429a79fa799c3bfee28 (patch) | |
| tree | b1c49902c88746d9b2facaf20f4f52d9197c6dd9 /src | |
| parent | 8a380af2b8f28400f29a5468a3a1a5629a665867 (diff) | |
implement printing fractions for corrade's Debug{}
Diffstat (limited to 'src')
| -rw-r--r-- | src/chunk-region.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/chunk-region.cpp b/src/chunk-region.cpp index 0006285d..5b15b7e2 100644 --- a/src/chunk-region.cpp +++ b/src/chunk-region.cpp @@ -3,6 +3,7 @@ #include "world.hpp" #include "collision.hpp" #include "object.hpp" +#include "compat/debug.hpp" #include "compat/function2.hpp" #include <bit> #include <array> @@ -183,9 +184,7 @@ auto chunk::make_pass_region(const pred& f, bool debug) -> pass_region if (debug) [[unlikely]] { const auto time = timeline.currentFrameTime(); - char buf[32]; - std::snprintf(buf, sizeof buf, "%.3f", 1e3*(double)time); - DBG_nospace << "region: generating for " << _coord << " took " << buf << " ms"; + DBG_nospace << "region: generating for " << _coord << " took " << fraction(1e3f*time, 3) << " ms"; } return ret; |
