* Get the foundationtype of a RoadBits Slope combination * * @param tileh The Slope part * @param bits The RoadBits part * @return The resulting Foundation */
| 1286 | * @return The resulting Foundation |
| 1287 | */ |
| 1288 | static Foundation GetRoadFoundation(Slope tileh, RoadBits bits) |
| 1289 | { |
| 1290 | /* Flat land and land without a road doesn't require a foundation */ |
| 1291 | if (tileh == SLOPE_FLAT || bits == ROAD_NONE) return FOUNDATION_NONE; |
| 1292 | |
| 1293 | /* Steep slopes behave the same as slopes with one corner raised. */ |
| 1294 | if (IsSteepSlope(tileh)) { |
| 1295 | tileh = SlopeWithOneCornerRaised(GetHighestSlopeCorner(tileh)); |
| 1296 | } |
| 1297 | |
| 1298 | /* Leveled RoadBits on a slope */ |
| 1299 | if ((_invalid_tileh_slopes_road[0][tileh] & bits) == ROAD_NONE) return FOUNDATION_LEVELED; |
| 1300 | |
| 1301 | /* Straight roads without foundation on a slope */ |
| 1302 | if (!IsSlopeWithOneCornerRaised(tileh) && |
| 1303 | (_invalid_tileh_slopes_road[1][tileh] & bits) == ROAD_NONE) |
| 1304 | return FOUNDATION_NONE; |
| 1305 | |
| 1306 | /* Roads on steep Slopes or on Slopes with one corner raised */ |
| 1307 | return (bits == ROAD_X ? FOUNDATION_INCLINED_X : FOUNDATION_INCLINED_Y); |
| 1308 | } |
| 1309 | |
| 1310 | const uint8_t _road_sloped_sprites[14] = { |
| 1311 | 0, 0, 2, 0, |
no test coverage detected