From 8b9ca5cc3a6d6505183d48216a7c22572592663f Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 4 Feb 2024 17:29:46 +0100 Subject: wip --- bench/raycast.cpp | 20 ++++++++++++++++++++ test/raycast.cpp | 15 +++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 bench/raycast.cpp diff --git a/bench/raycast.cpp b/bench/raycast.cpp new file mode 100644 index 00000000..21b1643d --- /dev/null +++ b/bench/raycast.cpp @@ -0,0 +1,20 @@ +#include "src/raycast.hpp" +#include + +namespace floormat { + +namespace { + +#warning TODO! + +[[maybe_unused]] void Raycast(benchmark::State& state) +{ + for (auto _ : state) + (void)0; +} + +BENCHMARK(Raycast)->Unit(benchmark::kMicrosecond); + +} // namespace + +} // namespace floormat diff --git a/test/raycast.cpp b/test/raycast.cpp index 672dc407..1793f5b6 100644 --- a/test/raycast.cpp +++ b/test/raycast.cpp @@ -1,8 +1,23 @@ #include "app.hpp" #include "src/raycast.hpp" +#include "src/world.hpp" namespace floormat { +namespace { + +#warning TODO! + +void test1() +{ + // try reproducing the evil bug in src/raycast.cpp:285: + // c = w.at({last_ch + Vector2i{i - 1, j - 1}}); + // was incorrectly: + // c = w.at({last_ch - Vector2i{i - 1, j - 1}}); +} + +} // namespace + void test_app::test_raycast() { -- cgit v1.2.3