mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-23 06:44:38 +01:00
Park Window to class (#17364)
* Start base of class * Start moving things into class * Finish porting over * Refactor to conform more with style * Add no discard to imageid * Fix objective window position * Fix audio on viewport * Make further fixes * Move nodiscard again
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -74,7 +74,7 @@ private:
|
||||
uint8_t _flags = 0;
|
||||
|
||||
public:
|
||||
static ImageId FromUInt32(uint32_t value)
|
||||
[[nodiscard]] static ImageId FromUInt32(uint32_t value)
|
||||
{
|
||||
ImageId result;
|
||||
result._index = value & MASK_INDEX;
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
static ImageId FromUInt32(uint32_t value, uint32_t tertiary)
|
||||
[[nodiscard]] static ImageId FromUInt32(uint32_t value, uint32_t tertiary)
|
||||
{
|
||||
if (!(value & FLAG_PRIMARY) && (value & FLAG_SECONDARY))
|
||||
{
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
uint32_t ToUInt32() const
|
||||
[[nodiscard]] uint32_t ToUInt32() const
|
||||
{
|
||||
auto result = (_index & MASK_INDEX);
|
||||
result |= (_primary << SHIFT_REMAP) & MASK_REMAP;
|
||||
@@ -208,26 +208,26 @@ public:
|
||||
|
||||
ImageCatalogue GetCatalogue() const;
|
||||
|
||||
constexpr ImageId WithIndex(ImageIndex index) const
|
||||
[[nodiscard]] constexpr ImageId WithIndex(ImageIndex index) const
|
||||
{
|
||||
ImageId result = *this;
|
||||
result._index = index;
|
||||
return result;
|
||||
}
|
||||
|
||||
constexpr ImageId WithIndexOffset(ImageIndex offset) const
|
||||
[[nodiscard]] constexpr ImageId WithIndexOffset(ImageIndex offset) const
|
||||
{
|
||||
ImageId result = *this;
|
||||
result._index += offset;
|
||||
return result;
|
||||
}
|
||||
|
||||
constexpr ImageId WithRemap(FilterPaletteID paletteId) const
|
||||
[[nodiscard]] constexpr ImageId WithRemap(FilterPaletteID paletteId) const
|
||||
{
|
||||
return WithRemap(static_cast<uint8_t>(paletteId));
|
||||
}
|
||||
|
||||
constexpr ImageId WithRemap(uint8_t paletteId) const
|
||||
[[nodiscard]] constexpr ImageId WithRemap(uint8_t paletteId) const
|
||||
{
|
||||
ImageId result = *this;
|
||||
result._primary = paletteId;
|
||||
@@ -238,7 +238,7 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
constexpr ImageId WithPrimary(colour_t colour) const
|
||||
[[nodiscard]] constexpr ImageId WithPrimary(colour_t colour) const
|
||||
{
|
||||
ImageId result = *this;
|
||||
result._primary = colour & 31;
|
||||
@@ -246,7 +246,7 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
constexpr ImageId WithSecondary(colour_t colour) const
|
||||
[[nodiscard]] constexpr ImageId WithSecondary(colour_t colour) const
|
||||
{
|
||||
ImageId result = *this;
|
||||
result._secondary = colour & 31;
|
||||
@@ -254,7 +254,7 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
constexpr ImageId WithTertiary(colour_t tertiary) const
|
||||
[[nodiscard]] constexpr ImageId WithTertiary(colour_t tertiary) const
|
||||
{
|
||||
ImageId result = *this;
|
||||
result._tertiary = tertiary & 31;
|
||||
@@ -269,12 +269,12 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
ImageId WithTransparancy(colour_t colour) const
|
||||
[[nodiscard]] ImageId WithTransparancy(colour_t colour) const
|
||||
{
|
||||
return WithTransparancy(GetGlassPaletteId(colour & 31));
|
||||
}
|
||||
|
||||
ImageId WithTransparancy(FilterPaletteID palette) const
|
||||
[[nodiscard]] ImageId WithTransparancy(FilterPaletteID palette) const
|
||||
{
|
||||
ImageId result = *this;
|
||||
result._primary = static_cast<uint8_t>(palette);
|
||||
@@ -284,7 +284,7 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
constexpr ImageId WithBlended(bool value) const
|
||||
[[nodiscard]] constexpr ImageId WithBlended(bool value) const
|
||||
{
|
||||
ImageId result = *this;
|
||||
if (value)
|
||||
|
||||
@@ -73,7 +73,6 @@ struct rct_window
|
||||
{
|
||||
int16_t picked_peep_old_x; // staff/guest window: peep x gets set to 0x8000 on pickup, this is the old value
|
||||
int16_t vehicleIndex; // Ride window: selected car when setting vehicle colours
|
||||
int16_t numberOfStaff; // Used in park window.
|
||||
int16_t var_48C;
|
||||
};
|
||||
uint16_t frame_no{}; // updated every tic for motion in windows sprites
|
||||
|
||||
Reference in New Issue
Block a user