* Return the slope of a given tile, also for tiles outside the map (virtual "black" tiles). * * @param x X coordinate of the tile to compute slope of, may be outside the map. * @param y Y coordinate of the tile to compute slope of, may be outside the map. * @param h If not \c nullptr, pointer to storage of z height. * @return Slope of the tile, except for the HALFTILE part, and the z height o
| 76 | * @return Slope of the tile, except for the HALFTILE part, and the z height of the tile. |
| 77 | */ |
| 78 | std::tuple<Slope, int> GetTilePixelSlopeOutsideMap(int x, int y) |
| 79 | { |
| 80 | int hnorth = TileHeightOutsideMap(x, y); // N corner. |
| 81 | int hwest = TileHeightOutsideMap(x + 1, y); // W corner. |
| 82 | int heast = TileHeightOutsideMap(x, y + 1); // E corner. |
| 83 | int hsouth = TileHeightOutsideMap(x + 1, y + 1); // S corner. |
| 84 | |
| 85 | auto [slope, h] = GetTileSlopeGivenHeight(hnorth, hwest, heast, hsouth); |
| 86 | return {slope, h * TILE_HEIGHT}; |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * Check if a given tile is flat |
no test coverage detected