MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / MapInit

Function MapInit

src/openrct2/world/Map.cpp:456–471  ·  view source on GitHub ↗

* * rct2: 0x0068AB4C */

Source from the content-addressed store, hash-verified

454 * rct2: 0x0068AB4C
455 */
456 void MapInit(const TileCoordsXY& size)
457 {
458 auto numTiles = kMaximumMapSizeTechnical * kMaximumMapSizeTechnical;
459
460 auto& gameState = getGameState();
461 SetTileElements(gameState, std::vector<TileElement>(numTiles, GetDefaultSurfaceElement()));
462
463 gameState.grassSceneryTileLoopPosition = 0;
464 gameState.widePathTileLoopPosition = {};
465 gameState.mapSize = size;
466 MapRemoveOutOfRangeElements();
467 MapAnimations::ClearAll();
468
469 auto intent = Intent(INTENT_ACTION_MAP);
470 ContextBroadcastIntent(&intent);
471 }
472
473 /**
474 * Counts the number of surface tiles that offer land ownership rights for sale,

Callers 3

gameStateInitAllFunction · 0.85
resetSurfacesFunction · 0.85

Calls 5

SetTileElementsFunction · 0.85
GetDefaultSurfaceElementFunction · 0.85
ContextBroadcastIntentFunction · 0.85
IntentClass · 0.50

Tested by

no test coverage detected