* Get the sprite offset within a spritegroup. * @param slope Slope * @param bits Roadbits * @return Offset for the sprite within the spritegroup. */
| 1321 | * @return Offset for the sprite within the spritegroup. |
| 1322 | */ |
| 1323 | static uint GetRoadSpriteOffset(Slope slope, RoadBits bits) |
| 1324 | { |
| 1325 | if (slope != SLOPE_FLAT) { |
| 1326 | switch (slope) { |
| 1327 | case SLOPE_NE: return 11; |
| 1328 | case SLOPE_SE: return 12; |
| 1329 | case SLOPE_SW: return 13; |
| 1330 | case SLOPE_NW: return 14; |
| 1331 | default: NOT_REACHED(); |
| 1332 | } |
| 1333 | } else { |
| 1334 | static const uint offsets[] = { |
| 1335 | 0, 18, 17, 7, |
| 1336 | 16, 0, 10, 5, |
| 1337 | 15, 8, 1, 4, |
| 1338 | 9, 3, 6, 2 |
| 1339 | }; |
| 1340 | return offsets[bits]; |
| 1341 | } |
| 1342 | } |
| 1343 | |
| 1344 | /** |
| 1345 | * Should the road be drawn as a unpaved snow/desert road? |
no test coverage detected