0x0045FCE6 Input: regs.ax: x regs.bx: y regs.bp: z Output: {x: regs.ax, y: regs.bx}
| 127 | // Output: |
| 128 | // {x: regs.ax, y: regs.bx} |
| 129 | std::optional<World::Pos2> screenGetMapXyWithZ(const Point& mouse, const int16_t z) |
| 130 | { |
| 131 | Window* w = WindowManager::findAt(mouse.x, mouse.y); |
| 132 | if (w == nullptr) |
| 133 | { |
| 134 | return std::nullopt; |
| 135 | } |
| 136 | |
| 137 | Viewport* vp = w->viewports[0]; |
| 138 | if (vp == nullptr) |
| 139 | { |
| 140 | return std::nullopt; |
| 141 | } |
| 142 | |
| 143 | if (vp->containsUi(mouse)) |
| 144 | { |
| 145 | viewport_pos vpos = vp->screenToViewport(mouse); |
| 146 | World::Pos2 position = viewportCoordToMapCoord(vpos.x, vpos.y, z, WindowManager::getCurrentRotation()); |
| 147 | if (World::validCoords(position)) |
| 148 | { |
| 149 | return position; |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | return std::nullopt; |
| 154 | } |
| 155 | |
| 156 | // 0x0045FD41 |
| 157 | // Input: |
no test coverage detected