// Known-answer test for the isometric tile→screen projection (the renderer's core transform). #include "sc2k/render/iso_projection.hpp" #include #include #include #include "test_harness.hpp" int main() { using sc2k::render::tile_to_screen; auto eq = [](sc2k::render::ScreenPos p, int x, int y) { return p.x == x && p.y == y; }; // The iso diamond at zoom 0, origin (0,0): row+ moves down-right, col+ moves down-left. CHECK(eq(tile_to_screen(0, 0, 0, 0, 0, 0), 0, 0)); // origin tile CHECK(eq(tile_to_screen(1, 0, 0, 0, 0, 0), 4, 2)); // +row → +x, +y CHECK(eq(tile_to_screen(0, 1, 0, 0, 0, 0), -4, 2)); // +col → −x, +y CHECK(eq(tile_to_screen(1, 1, 0, 0, 0, 0), 0, 4)); // diagonal → straight down // Altitude lifts the tile up the screen (smaller y) by 3<