mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Expand WallElement
This commit is contained in:
@@ -418,22 +418,20 @@ assert_struct_size(LargeSceneryElement, 16);
|
||||
struct WallElement : TileElementBase
|
||||
{
|
||||
private:
|
||||
uint8_t entryIndex; // 4
|
||||
union
|
||||
{
|
||||
uint8_t colour_3; // 5
|
||||
BannerIndex banner_index; // 5
|
||||
};
|
||||
uint8_t colour_1; // 6 0b_2221_1111 2 = colour_2 (uses flags for rest of colour2), 1 = colour_1
|
||||
uint8_t animation; // 7 0b_dfff_ft00 d = direction, f = frame num, t = across track flag (not used)
|
||||
uint16_t entryIndex; // 04
|
||||
colour_t colour_1; // 06
|
||||
colour_t colour_2; // 07
|
||||
colour_t colour_3; // 08
|
||||
BannerIndex banner_index; // 09
|
||||
uint8_t animation; // 0A 0b_dfff_ft00 d = direction, f = frame num, t = across track flag (not used)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunused-private-field"
|
||||
uint8_t pad_08[8];
|
||||
uint8_t pad_0B[5];
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
public:
|
||||
uint8_t GetEntryIndex() const;
|
||||
void SetEntryIndex(uint8_t newIndex);
|
||||
uint16_t GetEntryIndex() const;
|
||||
void SetEntryIndex(uint16_t newIndex);
|
||||
rct_scenery_entry* GetEntry() const;
|
||||
|
||||
uint8_t GetSlope() const;
|
||||
|
||||
@@ -108,41 +108,32 @@ void WallElement::SetSlope(uint8_t newSlope)
|
||||
|
||||
colour_t WallElement::GetPrimaryColour() const
|
||||
{
|
||||
return colour_1 & TILE_ELEMENT_COLOUR_MASK;
|
||||
return colour_1;
|
||||
}
|
||||
|
||||
colour_t WallElement::GetSecondaryColour() const
|
||||
{
|
||||
uint8_t secondaryColour = (colour_1 & ~TILE_ELEMENT_COLOUR_MASK) >> 5;
|
||||
secondaryColour |= (flags & 0x60) >> 2;
|
||||
return secondaryColour;
|
||||
return colour_2;
|
||||
}
|
||||
|
||||
colour_t WallElement::GetTertiaryColour() const
|
||||
{
|
||||
return colour_3 & TILE_ELEMENT_COLOUR_MASK;
|
||||
return colour_3;
|
||||
}
|
||||
|
||||
void WallElement::SetPrimaryColour(colour_t newColour)
|
||||
{
|
||||
assert(newColour <= 31);
|
||||
colour_1 &= ~TILE_ELEMENT_COLOUR_MASK;
|
||||
colour_1 |= newColour;
|
||||
colour_1 = newColour;
|
||||
}
|
||||
|
||||
void WallElement::SetSecondaryColour(colour_t newColour)
|
||||
{
|
||||
colour_1 &= TILE_ELEMENT_COLOUR_MASK;
|
||||
colour_1 |= (newColour & 0x7) << 5;
|
||||
flags &= ~0x60;
|
||||
flags |= (newColour & 0x18) << 2;
|
||||
colour_2 = newColour;
|
||||
}
|
||||
|
||||
void WallElement::SetTertiaryColour(colour_t newColour)
|
||||
{
|
||||
assert(newColour <= 31);
|
||||
colour_3 &= ~TILE_ELEMENT_COLOUR_MASK;
|
||||
colour_3 |= newColour;
|
||||
colour_3 = newColour;
|
||||
}
|
||||
|
||||
uint8_t WallElement::GetAnimationFrame() const
|
||||
@@ -156,7 +147,7 @@ void WallElement::SetAnimationFrame(uint8_t frameNum)
|
||||
animation |= (frameNum & 0xF) << 3;
|
||||
}
|
||||
|
||||
uint8_t WallElement::GetEntryIndex() const
|
||||
uint16_t WallElement::GetEntryIndex() const
|
||||
{
|
||||
return entryIndex;
|
||||
}
|
||||
@@ -166,7 +157,7 @@ rct_scenery_entry* WallElement::GetEntry() const
|
||||
return get_wall_entry(entryIndex);
|
||||
}
|
||||
|
||||
void WallElement::SetEntryIndex(uint8_t newIndex)
|
||||
void WallElement::SetEntryIndex(uint16_t newIndex)
|
||||
{
|
||||
entryIndex = newIndex;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user