mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 19:13:07 +01:00
Use type bit 1 on surface element to store more surface styles
This commit is contained in:
@@ -79,8 +79,7 @@ uint8_t RCT12SurfaceElement::GetSlope() const
|
||||
uint32_t RCT12SurfaceElement::GetSurfaceStyle() const
|
||||
{
|
||||
uint32_t retVal = (terrain >> 5) & 7;
|
||||
if (type & 1)
|
||||
retVal |= (1 << 3);
|
||||
retVal |= (type & RCT12_SURFACE_ELEMENT_TYPE_SURFACE_MASK) << 3;
|
||||
return retVal;
|
||||
}
|
||||
|
||||
@@ -557,11 +556,9 @@ void RCT12LargeSceneryElement::SetBannerIndex(uint8_t newIndex)
|
||||
|
||||
void RCT12SurfaceElement::SetSurfaceStyle(uint32_t newStyle)
|
||||
{
|
||||
// Bit 3 for terrain is stored in element.type bit 0
|
||||
if (newStyle & 8)
|
||||
type |= 1;
|
||||
else
|
||||
type &= ~1;
|
||||
// Bits 3, 4 for terrain are stored in element.type bit 0, 1
|
||||
type &= ~RCT12_SURFACE_ELEMENT_TYPE_SURFACE_MASK;
|
||||
type |= (newStyle >> 3) & RCT12_SURFACE_ELEMENT_TYPE_SURFACE_MASK;
|
||||
|
||||
// Bits 0, 1, 2 for terrain are stored in element.terrain bit 5, 6, 7
|
||||
terrain &= ~0xE0;
|
||||
|
||||
@@ -89,6 +89,12 @@ enum class RCT12TrackDesignVersion : uint8_t
|
||||
unknown
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
RCT12_SURFACE_ELEMENT_TYPE_SURFACE_MASK = 0b00000011,
|
||||
RCT12_SURFACE_ELEMENT_TYPE_EDGE_MASK = 0b01000000,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
RCT12_TILE_ELEMENT_FLAG_GHOST = (1 << 4),
|
||||
|
||||
Reference in New Issue
Block a user