1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 14:24:33 +01:00

Sink some arrays

This commit is contained in:
Michał Janiszewski
2018-02-28 11:48:13 +01:00
committed by Michał Janiszewski
parent 764520076f
commit afb0c48ebd
2 changed files with 18 additions and 19 deletions

View File

@@ -37,14 +37,6 @@ enum VirtualFloorFlags
VIRTUAL_FLOOR_FORCE_INVALIDATION = (1 << 2),
};
static constexpr const CoordsXY offsets[4] =
{
{ -32, 0 },
{ 0, 32 },
{ 32, 0 },
{ 0, -32 }
};
bool virtual_floor_is_enabled()
{
return (_virtualFloorFlags & VIRTUAL_FLOOR_FLAG_ENABLED) != 0;
@@ -304,6 +296,14 @@ static void virtual_floor_get_tile_properties(sint16 x, sint16 y, sint16 height,
void virtual_floor_paint(paint_session * session)
{
static constexpr const CoordsXY scenery_half_tile_offsets[4] =
{
{ -32, 0 },
{ 0, 32 },
{ 32, 0 },
{ 0, -32 }
};
uint8 direction = session->CurrentRotation;
// This is a virtual floor, so no interactions
@@ -330,8 +330,8 @@ void virtual_floor_paint(paint_session * session)
for (uint8 i = 0; i < 4; i++)
{
uint8 effectiveRotation = (4 + i - direction) % 4;
sint16 theirLocationX = session->MapPosition.x + offsets[effectiveRotation].x;
sint16 theirLocationY = session->MapPosition.y + offsets[effectiveRotation].y;
sint16 theirLocationX = session->MapPosition.x + scenery_half_tile_offsets[effectiveRotation].x;
sint16 theirLocationY = session->MapPosition.y + scenery_half_tile_offsets[effectiveRotation].y;
bool theyAreOccupied;
uint8 theirOccupiedEdges;

View File

@@ -25,13 +25,6 @@
#include "../../world/Scenery.h"
#include "../../world/SmallScenery.h"
static constexpr const LocationXY16 offsets[] = {
{ 3, 3 },
{ 3, 17 },
{ 17, 3 },
{ 3, 3 }
};
static constexpr const LocationXY16 lengths[] = {
{ 12, 26 },
{ 26, 12 },
@@ -85,8 +78,14 @@ void scenery_paint(paint_session * session, uint8 direction, sint32 height, cons
{
if (scenery_small_entry_has_flag(entry, SMALL_SCENERY_FLAG_HALF_SPACE)) {
// 6DFFE3:
boxoffset.x = offsets[direction].x;
boxoffset.y = offsets[direction].y;
static constexpr const LocationXY16 scenery_half_tile_offsets[] = {
{ 3, 3 },
{ 3, 17 },
{ 17, 3 },
{ 3, 3 }
};
boxoffset.x = scenery_half_tile_offsets[direction].x;
boxoffset.y = scenery_half_tile_offsets[direction].y;
boxlength.x = lengths[direction].x;
boxlength.y = lengths[direction].y;
x_offset = 3;