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

Function getOneSideUpLandHeight

src/OpenLoco/src/Map/TileManager.cpp:417–436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

415 }
416
417 static int16_t getOneSideUpLandHeight(int8_t xl, int8_t yl, uint8_t slope)
418 {
419 int16_t edge = 0;
420 switch (slope)
421 {
422 case SurfaceSlope::SideUp::northeast:
423 edge = xl / 2 + 1;
424 break;
425 case SurfaceSlope::SideUp::southeast:
426 edge = (kTileSize - yl) / 2;
427 break;
428 case SurfaceSlope::SideUp::northwest:
429 edge = yl / 2 + 1;
430 break;
431 case SurfaceSlope::SideUp::southwest:
432 edge = (kTileSize - xl) / 2;
433 break;
434 }
435 return edge;
436 }
437
438 // This also takes care of the one corner down and one opposite corner up
439 static int16_t getOneCornerDownLandHeight(int8_t xl, int8_t yl, uint8_t slope, bool isDoubleHeight)

Callers 1

getHeightFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected