mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Rename snake_case Class names (Remaining Bits) (#19237)
* Rename snake_case Class names * Clang format * Fix build issues
This commit is contained in:
@@ -200,8 +200,8 @@ static ScreenCoordsXY GetCentrePositionForNewWindow(int32_t width, int32_t heigh
|
||||
return ScreenCoordsXY{ (screenWidth - width) / 2, std::max(TOP_TOOLBAR_HEIGHT + 1, (screenHeight - height) / 2) };
|
||||
}
|
||||
|
||||
rct_window* WindowCreate(
|
||||
std::unique_ptr<rct_window>&& wp, WindowClass cls, ScreenCoordsXY pos, int32_t width, int32_t height, uint32_t flags)
|
||||
WindowBase* WindowCreate(
|
||||
std::unique_ptr<WindowBase>&& wp, WindowClass cls, ScreenCoordsXY pos, int32_t width, int32_t height, uint32_t flags)
|
||||
{
|
||||
if (flags & WF_AUTO_POSITION)
|
||||
{
|
||||
@@ -287,27 +287,27 @@ rct_window* WindowCreate(
|
||||
return w;
|
||||
}
|
||||
|
||||
rct_window* WindowCreate(
|
||||
WindowBase* WindowCreate(
|
||||
const ScreenCoordsXY& pos, int32_t width, int32_t height, WindowEventList* event_handlers, WindowClass cls, uint32_t flags)
|
||||
{
|
||||
auto w = std::make_unique<rct_window>();
|
||||
auto w = std::make_unique<WindowBase>();
|
||||
w->event_handlers = event_handlers;
|
||||
return WindowCreate(std::move(w), cls, pos, width, height, flags);
|
||||
}
|
||||
|
||||
rct_window* WindowCreateAutoPos(int32_t width, int32_t height, WindowEventList* event_handlers, WindowClass cls, uint32_t flags)
|
||||
WindowBase* WindowCreateAutoPos(int32_t width, int32_t height, WindowEventList* event_handlers, WindowClass cls, uint32_t flags)
|
||||
{
|
||||
auto pos = GetAutoPositionForNewWindow(width, height);
|
||||
return WindowCreate(pos, width, height, event_handlers, cls, flags);
|
||||
}
|
||||
|
||||
rct_window* WindowCreateCentred(int32_t width, int32_t height, WindowEventList* event_handlers, WindowClass cls, uint32_t flags)
|
||||
WindowBase* WindowCreateCentred(int32_t width, int32_t height, WindowEventList* event_handlers, WindowClass cls, uint32_t flags)
|
||||
{
|
||||
auto pos = GetCentrePositionForNewWindow(width, height);
|
||||
return WindowCreate(pos, width, height, event_handlers, cls, flags);
|
||||
}
|
||||
|
||||
static int32_t WindowGetWidgetIndex(const rct_window& w, Widget* widget)
|
||||
static int32_t WindowGetWidgetIndex(const WindowBase& w, Widget* widget)
|
||||
{
|
||||
int32_t i = 0;
|
||||
for (Widget* widget2 = w.widgets; widget2->type != WindowWidgetType::Last; widget2++, i++)
|
||||
@@ -316,7 +316,7 @@ static int32_t WindowGetWidgetIndex(const rct_window& w, Widget* widget)
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int32_t WindowGetScrollIndex(const rct_window& w, int32_t targetWidgetIndex)
|
||||
static int32_t WindowGetScrollIndex(const WindowBase& w, int32_t targetWidgetIndex)
|
||||
{
|
||||
if (w.widgets[targetWidgetIndex].type != WindowWidgetType::Scroll)
|
||||
return -1;
|
||||
@@ -334,7 +334,7 @@ static int32_t WindowGetScrollIndex(const rct_window& w, int32_t targetWidgetInd
|
||||
return scrollIndex;
|
||||
}
|
||||
|
||||
static Widget* WindowGetScrollWidget(const rct_window& w, int32_t scrollIndex)
|
||||
static Widget* WindowGetScrollWidget(const WindowBase& w, int32_t scrollIndex)
|
||||
{
|
||||
for (Widget* widget = w.widgets; widget->type != WindowWidgetType::Last; widget++)
|
||||
{
|
||||
@@ -353,7 +353,7 @@ static Widget* WindowGetScrollWidget(const rct_window& w, int32_t scrollIndex)
|
||||
*
|
||||
* rct2: 0x006E78E3
|
||||
*/
|
||||
static void WindowScrollWheelInput(rct_window& w, int32_t scrollIndex, int32_t wheel)
|
||||
static void WindowScrollWheelInput(WindowBase& w, int32_t scrollIndex, int32_t wheel)
|
||||
{
|
||||
auto& scroll = w.scrolls[scrollIndex];
|
||||
Widget* widget = WindowGetScrollWidget(w, scrollIndex);
|
||||
@@ -384,7 +384,7 @@ static void WindowScrollWheelInput(rct_window& w, int32_t scrollIndex, int32_t w
|
||||
*
|
||||
* rct2: 0x006E793B
|
||||
*/
|
||||
static int32_t WindowWheelInput(rct_window& w, int32_t wheel)
|
||||
static int32_t WindowWheelInput(WindowBase& w, int32_t wheel)
|
||||
{
|
||||
int32_t i = 0;
|
||||
for (Widget* widget = w.widgets; widget->type != WindowWidgetType::Last; widget++)
|
||||
@@ -409,7 +409,7 @@ static int32_t WindowWheelInput(rct_window& w, int32_t wheel)
|
||||
*
|
||||
* rct2: 0x006E79FB
|
||||
*/
|
||||
static void WindowViewportWheelInput(rct_window& w, int32_t wheel)
|
||||
static void WindowViewportWheelInput(WindowBase& w, int32_t wheel)
|
||||
{
|
||||
if (gScreenFlags & (SCREEN_FLAGS_TRACK_MANAGER | SCREEN_FLAGS_TITLE_DEMO))
|
||||
return;
|
||||
@@ -420,7 +420,7 @@ static void WindowViewportWheelInput(rct_window& w, int32_t wheel)
|
||||
WindowZoomOut(w, true);
|
||||
}
|
||||
|
||||
static bool WindowOtherWheelInput(rct_window& w, WidgetIndex widgetIndex, int32_t wheel)
|
||||
static bool WindowOtherWheelInput(WindowBase& w, WidgetIndex widgetIndex, int32_t wheel)
|
||||
{
|
||||
// HACK: Until we have a new window system that allows us to add new events like mouse wheel easily,
|
||||
// this selective approach will have to do.
|
||||
@@ -537,7 +537,7 @@ void WindowAllWheelInput()
|
||||
// Check window cursor is over
|
||||
if (!(InputTestFlag(INPUT_FLAG_5)))
|
||||
{
|
||||
rct_window* w = WindowFindFromPoint(cursorState->position);
|
||||
WindowBase* w = WindowFindFromPoint(cursorState->position);
|
||||
if (w != nullptr)
|
||||
{
|
||||
// Check if main window
|
||||
@@ -587,7 +587,7 @@ void ApplyScreenSaverLockSetting()
|
||||
* Initialises scroll widgets to their virtual size.
|
||||
* rct2: 0x006EAEB8
|
||||
*/
|
||||
void WindowInitScrollWidgets(rct_window& w)
|
||||
void WindowInitScrollWidgets(WindowBase& w)
|
||||
{
|
||||
Widget* widget;
|
||||
int32_t widget_index, scroll_index;
|
||||
@@ -629,7 +629,7 @@ void WindowInitScrollWidgets(rct_window& w)
|
||||
*
|
||||
* rct2: 0x006EB15C
|
||||
*/
|
||||
void WindowDrawWidgets(rct_window& w, DrawPixelInfo* dpi)
|
||||
void WindowDrawWidgets(WindowBase& w, DrawPixelInfo* dpi)
|
||||
{
|
||||
Widget* widget;
|
||||
WidgetIndex widgetIndex;
|
||||
@@ -674,7 +674,7 @@ void WindowDrawWidgets(rct_window& w, DrawPixelInfo* dpi)
|
||||
*
|
||||
* rct2: 0x006EA776
|
||||
*/
|
||||
static void WindowInvalidatePressedImageButton(const rct_window& w)
|
||||
static void WindowInvalidatePressedImageButton(const WindowBase& w)
|
||||
{
|
||||
WidgetIndex widgetIndex;
|
||||
Widget* widget;
|
||||
@@ -696,7 +696,7 @@ static void WindowInvalidatePressedImageButton(const rct_window& w)
|
||||
*/
|
||||
void InvalidateAllWindowsAfterInput()
|
||||
{
|
||||
WindowVisitEach([](rct_window* w) {
|
||||
WindowVisitEach([](WindowBase* w) {
|
||||
WindowUpdateScrollWidgets(*w);
|
||||
WindowInvalidatePressedImageButton(*w);
|
||||
WindowEventResizeCall(w);
|
||||
@@ -807,7 +807,7 @@ void Window::TextInputOpen(
|
||||
WindowTextInputOpen(this, callWidget, title, description, descriptionArgs, existingText, existingArgs, maxLength);
|
||||
}
|
||||
|
||||
void WindowAlignTabs(rct_window* w, WidgetIndex start_tab_id, WidgetIndex end_tab_id)
|
||||
void WindowAlignTabs(WindowBase* w, WidgetIndex start_tab_id, WidgetIndex end_tab_id)
|
||||
{
|
||||
int32_t i, x = w->widgets[start_tab_id].left;
|
||||
int32_t tab_width = w->widgets[start_tab_id].width();
|
||||
|
||||
Reference in New Issue
Block a user