diff --git a/src/world/map.c b/src/world/map.c index 2721e1c6b2..764e549686 100644 --- a/src/world/map.c +++ b/src/world/map.c @@ -326,7 +326,7 @@ void map_init(int size) map_element_set_terrain_edge(map_element, TERRAIN_EDGE_ROCK); } - RCT2_GLOBAL(RCT2_ADDRESS_GRASS_SCENERY_TILEPOS, sint16) = 0; + gGrassSceneryTileLoopPosition = 0; gWidePathTileLoopX = 0; gWidePathTileLoopY = 0; gMapSizeUnits = size * 32 - 32; @@ -4232,7 +4232,7 @@ void map_update_tiles() int x = 0; int y = 0; - uint16 interleaved_xy = RCT2_GLOBAL(RCT2_ADDRESS_GRASS_SCENERY_TILEPOS, sint16); + uint16 interleaved_xy = gGrassSceneryTileLoopPosition; for (int i = 0; i < 8; i++) { x = (x << 1) | (interleaved_xy & 1); interleaved_xy >>= 1; @@ -4246,8 +4246,8 @@ void map_update_tiles() scenery_update_tile(x * 32, y * 32); } - RCT2_GLOBAL(RCT2_ADDRESS_GRASS_SCENERY_TILEPOS, sint16)++; - RCT2_GLOBAL(RCT2_ADDRESS_GRASS_SCENERY_TILEPOS, sint16) &= 0xFFFF; + gGrassSceneryTileLoopPosition++; + gGrassSceneryTileLoopPosition &= 0xFFFF; } } diff --git a/src/world/map.h b/src/world/map.h index 81388267ce..c865c26389 100644 --- a/src/world/map.h +++ b/src/world/map.h @@ -267,8 +267,9 @@ typedef struct { extern const rct_xy16 TileDirectionDelta[]; -#define gWidePathTileLoopX RCT2_GLOBAL(0x013CE774, uint16) -#define gWidePathTileLoopY RCT2_GLOBAL(0x013CE776, uint16) +#define gWidePathTileLoopX RCT2_GLOBAL(0x013CE774, uint16) +#define gWidePathTileLoopY RCT2_GLOBAL(0x013CE776, uint16) +#define gGrassSceneryTileLoopPosition RCT2_GLOBAL(RCT2_ADDRESS_GRASS_SCENERY_TILEPOS, uint16) #define gMapSizeUnits RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE_UNITS, sint16) #define gMapSizeMinus2 RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE_MINUS_2, sint16)