71 | case 0: DrawWaterSprite(base, offset + 7, feature, tile); break;
| 71 | case 0: DrawWaterSprite(base, offset + 7, feature, tile); break;
|
---|
72 | case 9: if (!IsWateredTile(TILE_ADDXY(tile, -1, -1), DIR_S)) DrawWaterSprite(base, offset + 11, feature, tile); break;
| 72 | case 9: if (!IsWateredTile(TILE_ADDXY(tile, -1, -1), DIR_S)) DrawWaterSprite(base, offset + 11, feature, tile); break;
|
---|
73 | }
| 73 | }
|
---|
| | 74 | }
|
---|
| | 75 |
|
---|
| | 76 |
|
---|
| | 77 | static void DrawRiverWater(const TileInfo *ti)
|
---|
| | 78 | {
|
---|
| | 79 | SpriteID image = SPR_FLAT_WATER_TILE;
|
---|
| | 80 | uint offset = 0;
|
---|
| | 81 | uint edges_offset = 0;
|
---|
| | 82 |
|
---|
| | 83 | if (ti->tileh != SLOPE_FLAT || HasBit(_water_feature[CF_RIVER_SLOPE].flags, CFF_HAS_FLAT_SPRITE)) {
|
---|
| | 84 | image = GetCanalSprite(CF_RIVER_SLOPE, ti->tile);
|
---|
| | 85 | if (image == 0) {
|
---|
| | 86 | switch (ti->tileh) {
|
---|
| | 87 | case SLOPE_NW: image = SPR_WATER_SLOPE_Y_DOWN; break;
|
---|
| | 88 | case SLOPE_SW: image = SPR_WATER_SLOPE_X_UP; break;
|
---|
| | 89 | case SLOPE_SE: image = SPR_WATER_SLOPE_Y_UP; break;
|
---|
| | 90 | case SLOPE_NE: image = SPR_WATER_SLOPE_X_DOWN; break;
|
---|
| | 91 | default: image = SPR_FLAT_WATER_TILE; break;
|
---|
| | 92 | }
|
---|
| | 93 | } else {
|
---|
| | 94 | /* Flag bit 0 indicates that the first sprite is flat water. */
|
---|
| | 95 | offset = HasBit(_water_feature[CF_RIVER_SLOPE].flags, CFF_HAS_FLAT_SPRITE) ? 1 : 0;
|
---|
| | 96 |
|
---|
| | 97 | switch (ti->tileh) {
|
---|
| | 98 | case SLOPE_SE: edges_offset += 12; break;
|
---|
| | 99 | case SLOPE_NE: offset += 1; edges_offset += 24; break;
|
---|
| | 100 | case SLOPE_SW: offset += 2; edges_offset += 36; break;
|
---|
| | 101 | case SLOPE_NW: offset += 3; edges_offset += 48; break;
|
---|
| | 102 | case SLOPE_E: offset = 0; edges_offset = 0; break;
|
---|
| | 103 | case SLOPE_S: offset = 0; edges_offset = 0; break;
|
---|
| | 104 | case SLOPE_W: offset = 0; edges_offset = 0; break;
|
---|
| | 105 | case SLOPE_N: offset = 0; edges_offset = 0; break;
|
---|
| | 106 | default: offset = 0; break;
|
---|
| | 107 | }
|
---|
| | 108 |
|
---|
| | 109 | offset = GetCanalSpriteOffset(CF_RIVER_SLOPE, ti->tile, offset);
|
---|
| | 110 | }
|
---|
| | 111 | }
|
---|
| | 112 |
|
---|
| | 113 | DrawGroundSprite(image + offset, PAL_NONE);
|
---|
| | 114 |
|
---|
| | 115 | /* Draw river edges if available. */
|
---|
| | 116 | DrawWaterEdges(false, edges_offset, ti->tile);
|
---|