mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-16 19:43:06 +01:00
Rename get_banner to GetBanner
This commit is contained in:
@@ -132,7 +132,7 @@ rct_window* window_banner_open(rct_windownumber number)
|
||||
w->number = number;
|
||||
window_init_scroll_widgets(w);
|
||||
|
||||
auto banner = get_banner(w->number);
|
||||
auto banner = GetBanner(w->number);
|
||||
int32_t view_x = banner->position.x << 5;
|
||||
int32_t view_y = banner->position.y << 5;
|
||||
|
||||
@@ -171,7 +171,7 @@ rct_window* window_banner_open(rct_windownumber number)
|
||||
*/
|
||||
static void window_banner_mouseup(rct_window* w, rct_widgetindex widgetIndex)
|
||||
{
|
||||
auto banner = get_banner(w->number);
|
||||
auto banner = GetBanner(w->number);
|
||||
int32_t x = banner->position.x << 5;
|
||||
int32_t y = banner->position.y << 5;
|
||||
|
||||
@@ -216,7 +216,7 @@ static void window_banner_mouseup(rct_window* w, rct_widgetindex widgetIndex)
|
||||
*/
|
||||
static void window_banner_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget)
|
||||
{
|
||||
auto banner = get_banner(w->number);
|
||||
auto banner = GetBanner(w->number);
|
||||
|
||||
switch (widgetIndex)
|
||||
{
|
||||
@@ -290,7 +290,7 @@ static void window_banner_textinput(rct_window* w, rct_widgetindex widgetIndex,
|
||||
*/
|
||||
static void window_banner_invalidate(rct_window* w)
|
||||
{
|
||||
auto banner = get_banner(w->number);
|
||||
auto banner = GetBanner(w->number);
|
||||
rct_widget* colour_btn = &window_banner_widgets[WIDX_MAIN_COLOUR];
|
||||
colour_btn->type = WWT_EMPTY;
|
||||
|
||||
@@ -341,7 +341,7 @@ static void window_banner_viewport_rotate(rct_window* w)
|
||||
|
||||
view->width = 0;
|
||||
|
||||
auto banner = get_banner(w->number);
|
||||
auto banner = GetBanner(w->number);
|
||||
|
||||
int32_t view_x = (banner->position.x << 5) + 16;
|
||||
int32_t view_y = (banner->position.y << 5) + 16;
|
||||
|
||||
@@ -153,7 +153,7 @@ rct_window* window_sign_open(rct_windownumber number)
|
||||
w->number = number;
|
||||
window_init_scroll_widgets(w);
|
||||
|
||||
auto banner = get_banner(w->number);
|
||||
auto banner = GetBanner(w->number);
|
||||
int32_t view_x = banner->position.x << 5;
|
||||
int32_t view_y = banner->position.y << 5;
|
||||
|
||||
@@ -203,7 +203,7 @@ rct_window* window_sign_open(rct_windownumber number)
|
||||
*/
|
||||
static void window_sign_mouseup(rct_window* w, rct_widgetindex widgetIndex)
|
||||
{
|
||||
auto banner = get_banner(w->number);
|
||||
auto banner = GetBanner(w->number);
|
||||
int32_t x = banner->position.x << 5;
|
||||
int32_t y = banner->position.y << 5;
|
||||
auto tile_element = map_get_first_element_at(x / 32, y / 32);
|
||||
@@ -368,7 +368,7 @@ static void window_sign_viewport_rotate(rct_window* w)
|
||||
|
||||
view->width = 0;
|
||||
|
||||
auto banner = get_banner(w->number);
|
||||
auto banner = GetBanner(w->number);
|
||||
|
||||
int32_t view_x = (banner->position.x << 5) + 16;
|
||||
int32_t view_y = (banner->position.y << 5) + 16;
|
||||
@@ -409,7 +409,7 @@ rct_window* window_sign_small_open(rct_windownumber number)
|
||||
w->colours[1] = COLOUR_DARK_BROWN;
|
||||
w->colours[2] = COLOUR_DARK_BROWN;
|
||||
|
||||
auto banner = get_banner(w->number);
|
||||
auto banner = GetBanner(w->number);
|
||||
int32_t view_x = banner->position.x << 5;
|
||||
int32_t view_y = banner->position.y << 5;
|
||||
|
||||
@@ -458,7 +458,7 @@ rct_window* window_sign_small_open(rct_windownumber number)
|
||||
*/
|
||||
static void window_sign_small_mouseup(rct_window* w, rct_widgetindex widgetIndex)
|
||||
{
|
||||
auto banner = get_banner(w->number);
|
||||
auto banner = GetBanner(w->number);
|
||||
int32_t x = banner->position.x << 5;
|
||||
int32_t y = banner->position.y << 5;
|
||||
auto tile_element = map_get_first_element_at(x / 32, y / 32);
|
||||
|
||||
@@ -296,7 +296,7 @@ namespace Editor
|
||||
//
|
||||
for (BannerIndex i = 0; i < MAX_BANNERS; i++)
|
||||
{
|
||||
auto banner = get_banner(i);
|
||||
auto banner = GetBanner(i);
|
||||
if (banner->type == BANNER_NULL)
|
||||
{
|
||||
banner->flags &= ~BANNER_FLAG_LINKED_TO_RIDE;
|
||||
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_POSITION_THIS_HERE);
|
||||
}
|
||||
|
||||
auto banner = get_banner(_bannerIndex);
|
||||
auto banner = GetBanner(_bannerIndex);
|
||||
if (banner->type != BANNER_NULL)
|
||||
{
|
||||
log_error("Banner index in use, bannerIndex = %u", _bannerIndex);
|
||||
@@ -130,7 +130,7 @@ public:
|
||||
return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_POSITION_THIS_HERE);
|
||||
}
|
||||
|
||||
auto banner = get_banner(_bannerIndex);
|
||||
auto banner = GetBanner(_bannerIndex);
|
||||
if (banner->type != BANNER_NULL)
|
||||
{
|
||||
log_error("Banner index in use, bannerIndex = %u", _bannerIndex);
|
||||
|
||||
@@ -101,7 +101,7 @@ private:
|
||||
intent.putExtra(INTENT_EXTRA_BANNER_INDEX, index);
|
||||
context_broadcast_intent(&intent);
|
||||
|
||||
auto banner = get_banner(index);
|
||||
auto banner = GetBanner(index);
|
||||
banner->colour = _primaryColour;
|
||||
map_invalidate_tile_zoom1(_loc.x, _loc.y, _loc.z, _loc.z + 32);
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
|
||||
GameActionResult::Ptr Execute() const override
|
||||
{
|
||||
auto banner = get_banner(_bannerIndex);
|
||||
auto banner = GetBanner(_bannerIndex);
|
||||
|
||||
utf8* buffer = gCommonStringFormatBuffer;
|
||||
utf8* dst = buffer;
|
||||
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_INVALID_SELECTION_OF_OBJECTS);
|
||||
}
|
||||
|
||||
auto banner = get_banner(_bannerIndex);
|
||||
auto banner = GetBanner(_bannerIndex);
|
||||
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Position.x = banner->position.x * 32 + 16;
|
||||
@@ -113,7 +113,7 @@ public:
|
||||
{
|
||||
auto res = MakeResult();
|
||||
|
||||
auto banner = get_banner(_bannerIndex);
|
||||
auto banner = GetBanner(_bannerIndex);
|
||||
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Position.x = banner->position.x * 32 + 16;
|
||||
|
||||
@@ -136,7 +136,7 @@ public:
|
||||
return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_TOO_MANY_BANNERS_IN_GAME);
|
||||
}
|
||||
|
||||
auto banner = get_banner(_bannerId);
|
||||
auto banner = GetBanner(_bannerId);
|
||||
if (banner->type != BANNER_NULL)
|
||||
{
|
||||
log_error("No free banners available");
|
||||
@@ -253,7 +253,7 @@ public:
|
||||
return MakeResult(GA_ERROR::NO_FREE_ELEMENTS, STR_TOO_MANY_BANNERS_IN_GAME);
|
||||
}
|
||||
|
||||
auto banner = get_banner(_bannerId);
|
||||
auto banner = GetBanner(_bannerId);
|
||||
if (banner->type != BANNER_NULL)
|
||||
{
|
||||
log_error("No free banners available");
|
||||
|
||||
@@ -138,7 +138,7 @@ private:
|
||||
|
||||
for (BannerIndex i = 0; i < MAX_BANNERS; i++)
|
||||
{
|
||||
auto banner = get_banner(i);
|
||||
auto banner = GetBanner(i);
|
||||
if (banner->type != BANNER_NULL && banner->flags & BANNER_FLAG_LINKED_TO_RIDE && banner->ride_index == _rideIndex)
|
||||
{
|
||||
banner->flags &= ~BANNER_FLAG_LINKED_TO_RIDE;
|
||||
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
|
||||
GameActionResult::Ptr Execute() const override
|
||||
{
|
||||
auto banner = get_banner(_bannerIndex);
|
||||
auto banner = GetBanner(_bannerIndex);
|
||||
|
||||
int32_t x = banner->position.x << 5;
|
||||
int32_t y = banner->position.y << 5;
|
||||
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_NONE);
|
||||
}
|
||||
|
||||
auto banner = get_banner(_bannerIndex);
|
||||
auto banner = GetBanner(_bannerIndex);
|
||||
|
||||
CoordsXY coords{ banner->position.x * 32, banner->position.y * 32 };
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
|
||||
GameActionResult::Ptr Execute() const override
|
||||
{
|
||||
auto banner = get_banner(_bannerIndex);
|
||||
auto banner = GetBanner(_bannerIndex);
|
||||
|
||||
CoordsXY coords{ banner->position.x * 32, banner->position.y * 32 };
|
||||
|
||||
|
||||
@@ -259,7 +259,7 @@ public:
|
||||
return std::make_unique<WallPlaceActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_TOO_MANY_BANNERS_IN_GAME);
|
||||
}
|
||||
|
||||
auto banner = get_banner(_bannerId);
|
||||
auto banner = GetBanner(_bannerId);
|
||||
if (banner->type != BANNER_NULL)
|
||||
{
|
||||
log_error("No free banners available");
|
||||
@@ -349,7 +349,7 @@ public:
|
||||
return std::make_unique<WallPlaceActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_TOO_MANY_BANNERS_IN_GAME);
|
||||
}
|
||||
|
||||
auto banner = get_banner(_bannerId);
|
||||
auto banner = GetBanner(_bannerId);
|
||||
if (banner->type != BANNER_NULL)
|
||||
{
|
||||
log_error("No free banners available");
|
||||
|
||||
@@ -1262,7 +1262,7 @@ static int32_t cc_show_limits(InteractiveConsole& console, [[maybe_unused]] cons
|
||||
int32_t bannerCount = 0;
|
||||
for (BannerIndex i = 0; i < MAX_BANNERS; ++i)
|
||||
{
|
||||
auto banner = get_banner(i);
|
||||
auto banner = GetBanner(i);
|
||||
if (banner->type != BANNER_NULL)
|
||||
{
|
||||
bannerCount++;
|
||||
|
||||
@@ -432,7 +432,7 @@ void large_scenery_paint(paint_session* session, uint8_t direction, uint16_t hei
|
||||
set_format_arg(7, uint8_t, textColour);
|
||||
BannerIndex bannerIndex = tileElement->AsLargeScenery()->GetBannerIndex();
|
||||
uint16_t scrollMode = entry->large_scenery.scrolling_mode + ((direction + 1) & 0x3);
|
||||
auto banner = get_banner(bannerIndex);
|
||||
auto banner = GetBanner(bannerIndex);
|
||||
set_format_arg(0, rct_string_id, banner->string_idx);
|
||||
if (banner->flags & BANNER_FLAG_LINKED_TO_RIDE)
|
||||
{
|
||||
|
||||
@@ -2257,7 +2257,7 @@ private:
|
||||
if (index < std::size(_s4.banners))
|
||||
{
|
||||
auto srcBanner = &_s4.banners[index];
|
||||
auto dstBanner = get_banner(index);
|
||||
auto dstBanner = GetBanner(index);
|
||||
ImportBanner(dstBanner, srcBanner);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1177,7 +1177,7 @@ void S6Exporter::ExportBanners()
|
||||
{
|
||||
for (BannerIndex i = 0; i < RCT2_MAX_BANNERS_IN_PARK; i++)
|
||||
{
|
||||
auto src = get_banner(i);
|
||||
auto src = GetBanner(i);
|
||||
auto dst = &_s6.banners[i];
|
||||
ExportBanner(*dst, *src);
|
||||
}
|
||||
|
||||
@@ -1069,7 +1069,7 @@ public:
|
||||
if (bannerIndex < std::size(_s6.banners))
|
||||
{
|
||||
auto srcBanner = &_s6.banners[bannerIndex];
|
||||
auto dstBanner = get_banner(bannerIndex);
|
||||
auto dstBanner = GetBanner(bannerIndex);
|
||||
ImportBanner(dstBanner, srcBanner);
|
||||
}
|
||||
else
|
||||
@@ -1098,7 +1098,7 @@ public:
|
||||
if (bannerIndex < std::size(_s6.banners))
|
||||
{
|
||||
auto srcBanner = &_s6.banners[bannerIndex];
|
||||
auto dstBanner = get_banner(bannerIndex);
|
||||
auto dstBanner = GetBanner(bannerIndex);
|
||||
ImportBanner(dstBanner, srcBanner);
|
||||
}
|
||||
else
|
||||
@@ -1121,7 +1121,7 @@ public:
|
||||
if (bannerIndex < std::size(_s6.banners))
|
||||
{
|
||||
auto srcBanner = &_s6.banners[bannerIndex];
|
||||
auto dstBanner = get_banner(bannerIndex);
|
||||
auto dstBanner = GetBanner(bannerIndex);
|
||||
ImportBanner(dstBanner, srcBanner);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -116,7 +116,7 @@ BannerIndex create_new_banner(uint8_t flags)
|
||||
|
||||
TileElement* banner_get_tile_element(BannerIndex bannerIndex)
|
||||
{
|
||||
auto banner = get_banner(bannerIndex);
|
||||
auto banner = GetBanner(bannerIndex);
|
||||
if (banner != nullptr)
|
||||
{
|
||||
auto tileElement = map_get_first_element_at(banner->position.x, banner->position.y);
|
||||
@@ -136,7 +136,7 @@ TileElement* banner_get_tile_element(BannerIndex bannerIndex)
|
||||
|
||||
WallElement* banner_get_scrolling_wall_tile_element(BannerIndex bannerIndex)
|
||||
{
|
||||
auto banner = get_banner(bannerIndex);
|
||||
auto banner = GetBanner(bannerIndex);
|
||||
if (banner == nullptr)
|
||||
return nullptr;
|
||||
|
||||
@@ -254,8 +254,8 @@ void fix_duplicated_banners()
|
||||
Guard::Assert(!activeBanners[newBannerIndex]);
|
||||
|
||||
// Copy over the original banner, but update the location
|
||||
auto& newBanner = *get_banner(newBannerIndex);
|
||||
newBanner = *get_banner(bannerIndex);
|
||||
auto& newBanner = *GetBanner(newBannerIndex);
|
||||
newBanner = *GetBanner(bannerIndex);
|
||||
newBanner.position = { x, y };
|
||||
|
||||
// Duplicate user string too
|
||||
@@ -287,7 +287,7 @@ void fix_duplicated_banners()
|
||||
|
||||
Banner* BannerElement::GetBanner() const
|
||||
{
|
||||
return get_banner(GetIndex());
|
||||
return ::GetBanner(GetIndex());
|
||||
}
|
||||
|
||||
rct_scenery_entry* BannerElement::GetEntry() const
|
||||
@@ -336,7 +336,7 @@ void BannerElement::ResetAllowedEdges()
|
||||
flags |= 0b00001111;
|
||||
}
|
||||
|
||||
Banner* get_banner(BannerIndex id)
|
||||
Banner* GetBanner(BannerIndex id)
|
||||
{
|
||||
if (id < std::size(_banners))
|
||||
{
|
||||
|
||||
@@ -44,4 +44,4 @@ WallElement* banner_get_scrolling_wall_tile_element(BannerIndex bannerIndex);
|
||||
uint8_t banner_get_closest_ride_index(int32_t x, int32_t y, int32_t z);
|
||||
void banner_reset_broken_index();
|
||||
void fix_duplicated_banners();
|
||||
Banner* get_banner(BannerIndex id);
|
||||
Banner* GetBanner(BannerIndex id);
|
||||
|
||||
@@ -41,7 +41,7 @@ void LargeSceneryElement::SetSecondaryColour(colour_t newColour)
|
||||
|
||||
Banner* LargeSceneryElement::GetBanner() const
|
||||
{
|
||||
return get_banner(GetBannerIndex());
|
||||
return ::GetBanner(GetBannerIndex());
|
||||
}
|
||||
|
||||
BannerIndex LargeSceneryElement::GetBannerIndex() const
|
||||
|
||||
@@ -127,7 +127,7 @@ void tile_element_remove_banner_entry(TileElement* tileElement)
|
||||
if (bannerIndex == BANNER_INDEX_NULL)
|
||||
return;
|
||||
|
||||
auto banner = get_banner(bannerIndex);
|
||||
auto banner = GetBanner(bannerIndex);
|
||||
if (banner->type != BANNER_NULL)
|
||||
{
|
||||
rct_windownumber windowNumber = bannerIndex;
|
||||
|
||||
@@ -307,8 +307,8 @@ GameActionResult::Ptr tile_inspector_paste_element_at(CoordsXY loc, TileElement
|
||||
{
|
||||
return std::make_unique<GameActionResult>(GA_ERROR::UNKNOWN, STR_NONE);
|
||||
}
|
||||
auto& newBanner = *get_banner(newBannerIndex);
|
||||
newBanner = *get_banner(bannerIndex);
|
||||
auto& newBanner = *GetBanner(newBannerIndex);
|
||||
newBanner = *GetBanner(bannerIndex);
|
||||
newBanner.position = TileCoordsXY(loc);
|
||||
|
||||
// Use the new banner index
|
||||
@@ -325,7 +325,7 @@ GameActionResult::Ptr tile_inspector_paste_element_at(CoordsXY loc, TileElement
|
||||
{
|
||||
return std::make_unique<GameActionResult>(GA_ERROR::NO_FREE_ELEMENTS, STR_NONE);
|
||||
}
|
||||
get_banner(newBannerIndex)->string_idx = newStringIdx;
|
||||
GetBanner(newBannerIndex)->string_idx = newStringIdx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ void WallElement::SetEntryIndex(uint8_t newIndex)
|
||||
|
||||
Banner* WallElement::GetBanner() const
|
||||
{
|
||||
return get_banner(GetBannerIndex());
|
||||
return ::GetBanner(GetBannerIndex());
|
||||
}
|
||||
|
||||
BannerIndex WallElement::GetBannerIndex() const
|
||||
|
||||
Reference in New Issue
Block a user