| 673 | }; |
| 674 | |
| 675 | static WaterSurface getWaterSurface(const World::SurfaceElement& elSurface, uint8_t slope) |
| 676 | { |
| 677 | int16_t height = elSurface.baseHeight(); |
| 678 | if (elSurface.waterHeight() > height) |
| 679 | { |
| 680 | height += World::kMicroZStep; |
| 681 | if (elSurface.waterHeight() != height |
| 682 | || !elSurface.isSlopeDoubleHeight()) |
| 683 | { |
| 684 | // This is the simple case where the water is flat as no |
| 685 | // bits of surface breach the water |
| 686 | slope = 0; |
| 687 | height = elSurface.waterHeight(); |
| 688 | } |
| 689 | else |
| 690 | { |
| 691 | // Adjust the slope to handle surface breaches |
| 692 | slope = Numerics::rotl4bit((slope & 0xF) ^ 0xF, 2); |
| 693 | } |
| 694 | } |
| 695 | return WaterSurface{ .height = height, .slope = slope }; |
| 696 | } |
| 697 | |
| 698 | // 0x00465F99 |
| 699 | static void paintSurfaceFullWaterTileSelection(PaintSession& session, const World::SurfaceElement& elSurface, uint8_t slope) |
no test coverage detected