| 9 | { |
| 10 | |
| 11 | void ViewerCursorOverlay::Draw(Engine* engine) |
| 12 | { |
| 13 | if (!engine || !engine->TextBank()) |
| 14 | return; |
| 15 | |
| 16 | MipInfo white = engine->TextBank()->UseMipmap(nullptr, 0, 0); |
| 17 | |
| 18 | auto& input = InputSubsystem::Instance(); |
| 19 | float ndcX = input.GetCursorX(); |
| 20 | float ndcY = input.GetCursorY(); |
| 21 | int cx = (int)((ndcX * 0.5f + 0.5f) * engine->Width2D()); |
| 22 | int cy = (int)((ndcY * 0.5f + 0.5f) * engine->Height2D()); |
| 23 | |
| 24 | // Compact rectangle cursor — 9×9 white square with 1-px black halo |
| 25 | // and a single-pixel hot point. Reads cleanly against any |
| 26 | // background (the halo gives contrast on light terrain, the |
| 27 | // hot-point dot gives a precise focus). Square shape was the |
| 28 | // explicit ask — rings looked busy, the rect is closer to a |
| 29 | // standard pointer. |
| 30 | const PackedColor fg(Color(1.0f, 1.0f, 1.0f, 1.0f)); |
| 31 | const PackedColor halo(Color(0.0f, 0.0f, 0.0f, 0.85f)); |
| 32 | |
| 33 | // Halo (11×11) underneath |
| 34 | engine->Draw2D(white, halo, Rect2DPixel(cx - 5, cy - 5, 11, 11)); |
| 35 | // White rect on top with a 1-px halo gap on each side (so the |
| 36 | // halo reads as an outline). |
| 37 | engine->Draw2D(white, fg, Rect2DPixel(cx - 4, cy - 4, 9, 9)); |
| 38 | // Central hot-point pixel — black against the white square so |
| 39 | // the user can see exactly where the click would land. |
| 40 | engine->Draw2D(white, halo, Rect2DPixel(cx, cy, 1, 1)); |
| 41 | } |
| 42 | |
| 43 | void ViewerCursorOverlay::ToggleLock(Engine* engine) |
| 44 | { |
nothing calls this directly
no test coverage detected