MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / getValleyLandHeight

Function getValleyLandHeight

src/OpenLoco/src/Map/TileManager.cpp:476–497  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

getHeightFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected