1
0
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:
Ted John
2019-07-26 17:24:19 +01:00
parent 3bff25ab22
commit 0b4d989a67
23 changed files with 45 additions and 45 deletions

View File

@@ -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;

View File

@@ -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);

View File

@@ -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;

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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");

View File

@@ -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;

View File

@@ -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;

View File

@@ -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 };

View File

@@ -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");

View File

@@ -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++;

View File

@@ -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)
{

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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

View File

@@ -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))
{

View File

@@ -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);

View File

@@ -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

View File

@@ -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;

View File

@@ -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;
}
}

View File

@@ -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