* Check whether the addition of two slope's GetPartialPixelZ values results in * the GetPartialPixelZ values of the expected slope. * This iterates over all sub-pixel locations within a single tile. * @param slope_expected The slope that is expected. * @param slope_a The first slope of the addition. * @param slope_b The second slope of the addition. * @return True iff at all GetPartialPixelZ
| 26 | * @return True iff at all GetPartialPixelZ results are the same for each sub-tile position. |
| 27 | */ |
| 28 | bool CheckPartialPixelZSlopeAddition(Slope slope_expected, Slope slope_a, Slope slope_b) |
| 29 | { |
| 30 | for (uint x = 0; x < TILE_SIZE; x++) { |
| 31 | for (uint y = 0; y < TILE_SIZE; y++) { |
| 32 | int z_a = GetPartialPixelZ(x, y, slope_a); |
| 33 | int z_b = GetPartialPixelZ(x, y, slope_b); |
| 34 | int z_result = GetPartialPixelZ(x, y, slope_expected); |
| 35 | if (z_result != z_a + z_b) return false; |
| 36 | } |
| 37 | } |
| 38 | return true; |
| 39 | } |
| 40 | |
| 41 | TEST_CASE("PartialPixelSlopeAdditionTest - A one corner slope, plus the opposite three corner slope results in a flat but elevated slope") |
| 42 | { |
no test coverage detected