MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / DrawShoreTile

Function DrawShoreTile

src/water_cmd.cpp:923–938  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

921}
922
923void DrawShoreTile(Slope tileh)
924{
925 /* Converts the enum Slope into an offset based on SPR_SHORE_BASE.
926 * This allows to calculate the proper sprite to display for this Slope */
927 static const uint8_t tileh_to_shoresprite[32] = {
928 0, 1, 2, 3, 4, 16, 6, 7, 8, 9, 17, 11, 12, 13, 14, 0,
929 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 10, 15, 0,
930 };
931
932 assert(!IsHalftileSlope(tileh)); // Halftile slopes need to get handled earlier.
933 assert(tileh != SLOPE_FLAT); // Shore is never flat
934
935 assert((tileh != SLOPE_EW) && (tileh != SLOPE_NS)); // No suitable sprites for current flooding behaviour
936
937 DrawGroundSprite(SPR_SHORE_BASE + tileh_to_shoresprite[tileh], PAL_NONE);
938}
939
940void DrawWaterClassGround(const TileInfo *ti)
941{

Callers 6

DrawTile_WaterFunction · 0.85
DrawTrackBitsOverlayFunction · 0.85
DrawTrackBitsFunction · 0.85
DrawTile_TunnelBridgeFunction · 0.85
DrawTile_StationFunction · 0.85
DrawTile_TreesFunction · 0.85

Calls 2

IsHalftileSlopeFunction · 0.85
DrawGroundSpriteFunction · 0.85

Tested by

no test coverage detected