| 474 | } |
| 475 | |
| 476 | static int16_t getValleyLandHeight(int8_t xl, int8_t yl, uint8_t slope) |
| 477 | { |
| 478 | int16_t quad = 0; |
| 479 | switch (slope) |
| 480 | { |
| 481 | case SurfaceSlope::Valley::westeast: |
| 482 | if (xl + yl > kTileSize + 1) |
| 483 | { |
| 484 | quad = kTileSize - xl - yl; |
| 485 | } |
| 486 | break; |
| 487 | case SurfaceSlope::Valley::northsouth: |
| 488 | quad = xl - yl; |
| 489 | break; |
| 490 | } |
| 491 | |
| 492 | if (quad > 0) |
| 493 | { |
| 494 | return quad / 2; |
| 495 | } |
| 496 | return 0; |
| 497 | } |
| 498 | |
| 499 | /** |
| 500 | * Return the absolute height of an element, given its (x, y) coordinates |