0x0045FD8E NOTE: Original call getSurfaceLocFromUi within this function instead OpenLoco has split it in two. Also note that result of original was a Pos2 start i.e. (& 0xFFE0) both components
| 218 | // instead OpenLoco has split it in two. Also note that result of original |
| 219 | // was a Pos2 start i.e. (& 0xFFE0) both components |
| 220 | MapSelectionType getQuadrantOrCentreFromPos(const Pos2& loc) |
| 221 | { |
| 222 | // Determine to which quadrants the cursor is closest 4 == all quadrants |
| 223 | const auto xNibbleCentre = std::abs((loc.x & 0xFFE0) + 16 - loc.x); |
| 224 | const auto yNibbleCentre = std::abs((loc.y & 0xFFE0) + 16 - loc.y); |
| 225 | if (std::max(xNibbleCentre, yNibbleCentre) <= 7) |
| 226 | { |
| 227 | // Is centre so all quadrants |
| 228 | return MapSelectionType::full; |
| 229 | } |
| 230 | |
| 231 | return getQuadrantFromPos(loc); |
| 232 | } |
| 233 | |
| 234 | // 0x0045FE05 |
| 235 | // NOTE: Original call getSurfaceLocFromUi within this function |
no test coverage detected