1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Close #25244: Unify kImageIndexUndefined and kSpriteIdNull (#25683)

This commit is contained in:
Michael Steenbeek
2025-12-21 16:19:35 +01:00
committed by GitHub
parent fcd16cb00a
commit 13795ce082
7 changed files with 11 additions and 13 deletions

View File

@@ -857,7 +857,7 @@ namespace OpenRCT2::Ui
const auto& widget = w.widgets[widgetIndex];
// Get the image
if (widget.image.GetIndex() == kSpriteIdNull)
if (widget.image.GetIndex() == kImageIndexUndefined)
return;
auto image = widget.image;

View File

@@ -917,7 +917,7 @@ namespace OpenRCT2::Ui::Windows
for (size_t i = 0; i < std::size(ObjectSelectionPages); i++)
{
auto& widget = widgets[WIDX_TAB_1 + i];
if (ObjectSelectionPages[i].Image != kSpriteIdNull)
if (ObjectSelectionPages[i].Image != kImageIndexUndefined)
{
widget.type = WidgetType::tab;
widget.left = x;

View File

@@ -48,7 +48,7 @@ namespace OpenRCT2::Ui::Windows
{
ObjectEntryIndex entryIndex = kObjectEntryIndexNull;
StringId stringId = kStringIdNone;
ImageIndex imageId = kSpriteIdNull;
ImageIndex imageId = kImageIndexUndefined;
};
enum WindowEditorParkEntranceListWidgetIdx

View File

@@ -688,8 +688,8 @@ namespace OpenRCT2::Ui::Windows
if (gFootpathSelection.LegacyPath == kObjectEntryIndexNull)
{
// Set footpath and queue type button images
auto pathImage = kSpriteIdNull;
auto queueImage = kSpriteIdNull;
auto pathImage = kImageIndexUndefined;
auto queueImage = kImageIndexUndefined;
auto pathEntry = GetPathSurfaceEntry(gFootpathSelection.NormalSurface);
if (pathEntry != nullptr)
{
@@ -706,7 +706,7 @@ namespace OpenRCT2::Ui::Windows
WindowFootpathDrawDropdownButton(rt, WIDX_QUEUELINE_TYPE, queueImage);
// Set railing
auto railingsImage = kSpriteIdNull;
auto railingsImage = kImageIndexUndefined;
auto railingsEntry = GetPathRailingsEntry(gFootpathSelection.Railings);
if (railingsEntry != nullptr)
{
@@ -719,8 +719,8 @@ namespace OpenRCT2::Ui::Windows
auto& objManager = OpenRCT2::GetContext()->GetObjectManager();
// Set footpath and queue type button images
auto pathImage = kSpriteIdNull;
auto queueImage = kSpriteIdNull;
auto pathImage = kImageIndexUndefined;
auto queueImage = kImageIndexUndefined;
const auto* pathObj = objManager.GetLoadedObject<FootpathObject>(gFootpathSelection.LegacyPath);
if (pathObj != nullptr)
{

View File

@@ -18,8 +18,6 @@
using colour_t = uint8_t;
enum class FilterPaletteID : int32_t;
static constexpr ImageIndex kImageIndexUndefined = std::numeric_limits<ImageIndex>::max();
enum class ImageCatalogue
{
UNKNOWN,

View File

@@ -14,4 +14,4 @@
using ImageIndex = uint32_t;
constexpr ImageIndex kSpriteIdNull = std::numeric_limits<ImageIndex>::max();
constexpr ImageIndex kImageIndexUndefined = std::numeric_limits<ImageIndex>::max();

View File

@@ -296,7 +296,7 @@ struct TrackDrawerEntry
// or because they are not realistic for the ride type (e.g. LIM boosters in Mini Roller Coasters).
RideTrackGroups extraTrackGroups{};
ImageIndex icon = kSpriteIdNull;
ImageIndex icon = kImageIndexUndefined;
StringId tooltip = kStringIdNone;
void GetAvailableTrackGroups(RideTrackGroups& res) const;
@@ -642,7 +642,7 @@ constexpr RideTypeDescriptor kDummyRTD =
.PhotoItem = ShopItem::photo,
.BonusValue = 0,
.ColourPresets = kDefaultFlatRideColourPreset,
.ColourPreview = { kSpriteIdNull, kSpriteIdNull },
.ColourPreview = { kImageIndexUndefined, kImageIndexUndefined },
.ColourKey = RideColourKey::Ride,
.Name = "invalid",
.RatingsData =