mirror of https://github.com/OpenRCT2/OpenRCT2.git
Clang tidy Part 2: Ui Project Class Names (#15976)
* Apply clang-tidy on class names in the ui project * Rename classes to more appropriate names * Adjust name again
This commit is contained in:
parent
6e839bdf49
commit
fccd298d2f
|
@ -17,7 +17,7 @@
|
|||
|
||||
namespace detail
|
||||
{
|
||||
template<typename T_> struct vec2
|
||||
template<typename T_> struct Vec2
|
||||
{
|
||||
using ValueType = T_;
|
||||
|
||||
|
@ -35,10 +35,10 @@ namespace detail
|
|||
};
|
||||
};
|
||||
|
||||
template struct vec2<GLfloat>;
|
||||
template struct vec2<GLint>;
|
||||
template struct Vec2<GLfloat>;
|
||||
template struct Vec2<GLint>;
|
||||
|
||||
template<typename T_> struct vec3
|
||||
template<typename T_> struct Vec3
|
||||
{
|
||||
using ValueType = T_;
|
||||
|
||||
|
@ -62,10 +62,10 @@ namespace detail
|
|||
};
|
||||
};
|
||||
|
||||
template struct vec3<GLfloat>;
|
||||
template struct vec3<GLint>;
|
||||
template struct Vec3<GLfloat>;
|
||||
template struct Vec3<GLint>;
|
||||
|
||||
template<typename T_> struct vec4
|
||||
template<typename T_> struct Vec4
|
||||
{
|
||||
using ValueType = T_;
|
||||
|
||||
|
@ -95,18 +95,18 @@ namespace detail
|
|||
};
|
||||
};
|
||||
|
||||
template struct vec4<GLfloat>;
|
||||
template struct vec4<GLint>;
|
||||
template struct Vec4<GLfloat>;
|
||||
template struct Vec4<GLint>;
|
||||
|
||||
} // namespace detail
|
||||
|
||||
using vec2 = detail::vec2<GLfloat>;
|
||||
using ivec2 = detail::vec2<GLint>;
|
||||
using vec2 = detail::Vec2<GLfloat>;
|
||||
using ivec2 = detail::Vec2<GLint>;
|
||||
|
||||
using vec3 = detail::vec3<GLfloat>;
|
||||
using ivec3 = detail::vec3<GLint>;
|
||||
using vec3 = detail::Vec3<GLfloat>;
|
||||
using ivec3 = detail::Vec3<GLint>;
|
||||
|
||||
using vec4 = detail::vec4<GLfloat>;
|
||||
using ivec4 = detail::vec4<GLint>;
|
||||
using vec4 = detail::Vec4<GLfloat>;
|
||||
using ivec4 = detail::Vec4<GLint>;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
|
|
@ -257,7 +257,7 @@ enum
|
|||
DDIX_FILTER_NONSELECTED,
|
||||
};
|
||||
|
||||
struct list_item
|
||||
struct ObjectListItem
|
||||
{
|
||||
const ObjectRepositoryItem* repositoryItem;
|
||||
std::unique_ptr<rct_object_filters> filter;
|
||||
|
@ -266,9 +266,9 @@ struct list_item
|
|||
|
||||
static rct_string_id GetRideTypeStringId(const ObjectRepositoryItem* item);
|
||||
|
||||
using sortFunc_t = bool (*)(const list_item&, const list_item&);
|
||||
using sortFunc_t = bool (*)(const ObjectListItem&, const ObjectListItem&);
|
||||
|
||||
static std::vector<list_item> _listItems;
|
||||
static std::vector<ObjectListItem> _listItems;
|
||||
static int32_t _listSortType = RIDE_SORT_TYPE;
|
||||
static bool _listSortDescending = false;
|
||||
static std::unique_ptr<Object> _loadedObject;
|
||||
|
@ -279,14 +279,14 @@ static void VisibleListDispose()
|
|||
_listItems.shrink_to_fit();
|
||||
}
|
||||
|
||||
static bool VisibleListSortRideName(const list_item& a, const list_item& b)
|
||||
static bool VisibleListSortRideName(const ObjectListItem& a, const ObjectListItem& b)
|
||||
{
|
||||
auto nameA = a.repositoryItem->Name.c_str();
|
||||
auto nameB = b.repositoryItem->Name.c_str();
|
||||
return strcmp(nameA, nameB) < 0;
|
||||
}
|
||||
|
||||
static bool VisibleListSortRideType(const list_item& a, const list_item& b)
|
||||
static bool VisibleListSortRideType(const ObjectListItem& a, const ObjectListItem& b)
|
||||
{
|
||||
auto rideTypeA = language_get_string(GetRideTypeStringId(a.repositoryItem));
|
||||
auto rideTypeB = language_get_string(GetRideTypeStringId(b.repositoryItem));
|
||||
|
@ -314,7 +314,7 @@ static void VisibleListRefresh(rct_window* w)
|
|||
filter->ride.category[1] = 0;
|
||||
filter->ride.ride_type = 0;
|
||||
|
||||
list_item currentListItem;
|
||||
ObjectListItem currentListItem;
|
||||
currentListItem.repositoryItem = item;
|
||||
currentListItem.filter = std::move(filter);
|
||||
currentListItem.flags = &_objectSelectionFlags[i];
|
||||
|
@ -681,7 +681,7 @@ static void WindowEditorObjectSelectionScrollMousedown(rct_window* w, int32_t sc
|
|||
if (selected_object == -1)
|
||||
return;
|
||||
|
||||
list_item* listItem = &_listItems[selected_object];
|
||||
ObjectListItem* listItem = &_listItems[selected_object];
|
||||
uint8_t object_selection_flags = *listItem->flags;
|
||||
if (object_selection_flags & OBJECT_SELECTION_FLAG_6)
|
||||
return;
|
||||
|
@ -743,7 +743,7 @@ static void WindowEditorObjectSelectionScrollMouseover(rct_window* w, int32_t sc
|
|||
int32_t selectedObject = GetObjectFromObjectSelection(GetSelectedObjectType(w), screenCoords.y);
|
||||
if (selectedObject != -1)
|
||||
{
|
||||
list_item* listItem = &_listItems[selectedObject];
|
||||
ObjectListItem* listItem = &_listItems[selectedObject];
|
||||
uint8_t objectSelectionFlags = *listItem->flags;
|
||||
if (objectSelectionFlags & OBJECT_SELECTION_FLAG_6)
|
||||
{
|
||||
|
@ -1018,7 +1018,7 @@ static void WindowEditorObjectSelectionPaintDescriptions(rct_window* w, rct_draw
|
|||
|
||||
static void WindowEditorObjectSelectionPaintDebugData(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
{
|
||||
list_item* listItem = &_listItems[w->selected_list_item];
|
||||
ObjectListItem* listItem = &_listItems[w->selected_list_item];
|
||||
auto screenPos = w->windowPos + ScreenCoordsXY{ w->width - 5, w->height - (LIST_ROW_HEIGHT * 5) };
|
||||
// Draw ride type.
|
||||
if (GetSelectedObjectType(w) == ObjectType::Ride)
|
||||
|
@ -1167,7 +1167,7 @@ static void WindowEditorObjectSelectionPaint(rct_window* w, rct_drawpixelinfo* d
|
|||
if (w->selected_list_item == -1 || _loadedObject == nullptr)
|
||||
return;
|
||||
|
||||
list_item* listItem = &_listItems[w->selected_list_item];
|
||||
ObjectListItem* listItem = &_listItems[w->selected_list_item];
|
||||
|
||||
// Draw preview
|
||||
{
|
||||
|
|
|
@ -27,13 +27,13 @@ enum {
|
|||
NOTIFICATION_CATEGORY_GUEST
|
||||
};
|
||||
|
||||
struct notification_def {
|
||||
struct NotificationDef {
|
||||
uint8_t category;
|
||||
rct_string_id caption;
|
||||
size_t config_offset;
|
||||
};
|
||||
|
||||
static constexpr const notification_def NewsItemOptionDefinitions[] = {
|
||||
static constexpr const NotificationDef NewsItemOptionDefinitions[] = {
|
||||
{ NOTIFICATION_CATEGORY_PARK, STR_NOTIFICATION_PARK_AWARD, offsetof(NotificationConfiguration, park_award) },
|
||||
{ NOTIFICATION_CATEGORY_PARK, STR_NOTIFICATION_PARK_MARKETING_CAMPAIGN_FINISHED, offsetof(NotificationConfiguration, park_marketing_campaign_finished) },
|
||||
{ NOTIFICATION_CATEGORY_PARK, STR_NOTIFICATION_PARK_WARNINGS, offsetof(NotificationConfiguration, park_warnings) },
|
||||
|
@ -99,7 +99,7 @@ static rct_window_event_list window_news_options_events([](auto& events)
|
|||
|
||||
static void WindowNewsOptionsSetPage(rct_window* w, int32_t page);
|
||||
static void WindowNewsOptionsDrawTabImages(rct_window* w, rct_drawpixelinfo* dpi);
|
||||
static bool* GetNotificationValuePtr(const notification_def* ndef);
|
||||
static bool* GetNotificationValuePtr(const NotificationDef* ndef);
|
||||
|
||||
rct_window* WindowNewsOptionsOpen()
|
||||
{
|
||||
|
@ -142,7 +142,7 @@ static void WindowNewsOptionsMouseup(rct_window* w, rct_widgetindex widgetIndex)
|
|||
int32_t matchIndex = 0;
|
||||
for (size_t i = 0; i < std::size(NewsItemOptionDefinitions); i++)
|
||||
{
|
||||
const notification_def* ndef = &NewsItemOptionDefinitions[i];
|
||||
const NotificationDef* ndef = &NewsItemOptionDefinitions[i];
|
||||
if (ndef->category != w->page)
|
||||
continue;
|
||||
|
||||
|
@ -187,7 +187,7 @@ static void WindowNewsOptionsInvalidate(rct_window* w)
|
|||
rct_widget* checkboxWidget = &w->widgets[checkboxWidgetIndex];
|
||||
for (size_t i = 0; i < std::size(NewsItemOptionDefinitions); i++)
|
||||
{
|
||||
const notification_def* ndef = &NewsItemOptionDefinitions[i];
|
||||
const NotificationDef* ndef = &NewsItemOptionDefinitions[i];
|
||||
if (ndef->category != w->page)
|
||||
continue;
|
||||
|
||||
|
@ -286,7 +286,7 @@ static void WindowNewsOptionsDrawTabImages(rct_window* w, rct_drawpixelinfo* dpi
|
|||
WindowNewsOptionsDrawTabImage(w, dpi, NOTIFICATION_CATEGORY_GUEST, SPR_TAB_GUESTS_0);
|
||||
}
|
||||
|
||||
static bool* GetNotificationValuePtr(const notification_def* ndef)
|
||||
static bool* GetNotificationValuePtr(const NotificationDef* ndef)
|
||||
{
|
||||
bool* configValue = reinterpret_cast<bool*>(reinterpret_cast<size_t>(&gConfigNotifications) + ndef->config_offset);
|
||||
return configValue;
|
||||
|
|
|
@ -369,12 +369,12 @@ static uint32_t window_park_page_hold_down_widgets[] = {
|
|||
|
||||
#pragma endregion
|
||||
|
||||
struct window_park_award {
|
||||
struct WindowParkAward {
|
||||
rct_string_id text;
|
||||
uint32_t sprite;
|
||||
};
|
||||
|
||||
static constexpr const window_park_award ParkAwards[] = {
|
||||
static constexpr const WindowParkAward ParkAwards[] = {
|
||||
{ STR_AWARD_MOST_UNTIDY, SPR_AWARD_MOST_UNTIDY },
|
||||
{ STR_AWARD_MOST_TIDY, SPR_AWARD_MOST_TIDY },
|
||||
{ STR_AWARD_BEST_ROLLERCOASTERS, SPR_AWARD_BEST_ROLLERCOASTERS },
|
||||
|
|
|
@ -775,13 +775,13 @@ static std::unique_ptr<TrackDesign> _trackDesign;
|
|||
|
||||
// Cached overall view for each ride
|
||||
// (Re)calculated when the ride window is opened
|
||||
struct ride_overall_view
|
||||
struct RideOverallView
|
||||
{
|
||||
CoordsXYZ loc;
|
||||
uint8_t zoom;
|
||||
};
|
||||
|
||||
static std::vector<ride_overall_view> ride_overall_views = {};
|
||||
static std::vector<RideOverallView> ride_overall_views = {};
|
||||
|
||||
static constexpr const int32_t window_ride_tab_animation_divisor[] = {
|
||||
0, 0, 2, 2, 4, 2, 8, 8, 2, 0,
|
||||
|
@ -877,20 +877,20 @@ static constexpr const rct_string_id SingleSessionVehicleStatusNames[] = {
|
|||
};
|
||||
// clang-format on
|
||||
|
||||
struct window_ride_maze_design_option
|
||||
struct WindowRideMazeDesignOption
|
||||
{
|
||||
rct_string_id text;
|
||||
uint32_t sprite;
|
||||
};
|
||||
|
||||
static constexpr const window_ride_maze_design_option MazeOptions[] = {
|
||||
static constexpr const WindowRideMazeDesignOption MazeOptions[] = {
|
||||
{ STR_RIDE_DESIGN_MAZE_BRICK_WALLS, SPR_RIDE_DESIGN_PREVIEW_MAZE_BRICK_WALLS },
|
||||
{ STR_RIDE_DESIGN_MAZE_HEDGES, SPR_RIDE_DESIGN_PREVIEW_MAZE_HEDGES },
|
||||
{ STR_RIDE_DESIGN_MAZE_ICE_BLOCKS, SPR_RIDE_DESIGN_PREVIEW_MAZE_ICE_BLOCKS },
|
||||
{ STR_RIDE_DESIGN_MAZE_WOODEN_FENCES, SPR_RIDE_DESIGN_PREVIEW_MAZE_WOODEN_FENCES },
|
||||
};
|
||||
|
||||
struct rct_window_graphs_y_axis
|
||||
struct GraphsYAxis
|
||||
{
|
||||
uint8_t interval;
|
||||
int8_t unit;
|
||||
|
@ -899,7 +899,7 @@ struct rct_window_graphs_y_axis
|
|||
};
|
||||
|
||||
/** rct2: 0x0098DD98 */
|
||||
static constexpr const rct_window_graphs_y_axis window_graphs_y_axi[] = {
|
||||
static constexpr const GraphsYAxis window_graphs_y_axi[] = {
|
||||
{ 11, 0, 10, STR_RIDE_STATS_VELOCITY_FORMAT }, // GRAPH_VELOCITY
|
||||
{ 10, 0, 15, STR_RIDE_STATS_ALTITUDE_FORMAT }, // GRAPH_ALTITUDE
|
||||
{ 13, -3, 1, STR_RIDE_STATS_G_FORCE_FORMAT }, // GRAPH_VERTICAL
|
||||
|
@ -3008,7 +3008,7 @@ static void WindowRideVehiclePaint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
}
|
||||
}
|
||||
|
||||
struct rct_vehicle_paintinfo
|
||||
struct VehicleDrawInfo
|
||||
{
|
||||
int16_t x;
|
||||
int16_t y;
|
||||
|
@ -3016,7 +3016,7 @@ struct rct_vehicle_paintinfo
|
|||
int32_t tertiary_colour;
|
||||
};
|
||||
|
||||
static rct_vehicle_paintinfo _sprites_to_draw[144];
|
||||
static VehicleDrawInfo _sprites_to_draw[144];
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -3044,7 +3044,7 @@ static void WindowRideVehicleScrollpaint(rct_window* w, rct_drawpixelinfo* dpi,
|
|||
// For each train
|
||||
for (int32_t i = 0; i < ride->num_vehicles; i++)
|
||||
{
|
||||
rct_vehicle_paintinfo* nextSpriteToDraw = _sprites_to_draw;
|
||||
VehicleDrawInfo* nextSpriteToDraw = _sprites_to_draw;
|
||||
int32_t x = startX;
|
||||
int32_t y = startY;
|
||||
|
||||
|
@ -3094,12 +3094,12 @@ static void WindowRideVehicleScrollpaint(rct_window* w, rct_drawpixelinfo* dpi,
|
|||
|
||||
if (ride->type == RIDE_TYPE_REVERSER_ROLLER_COASTER)
|
||||
{
|
||||
rct_vehicle_paintinfo tmp = *(nextSpriteToDraw - 1);
|
||||
VehicleDrawInfo tmp = *(nextSpriteToDraw - 1);
|
||||
*(nextSpriteToDraw - 1) = *(nextSpriteToDraw - 2);
|
||||
*(nextSpriteToDraw - 2) = tmp;
|
||||
}
|
||||
|
||||
rct_vehicle_paintinfo* current = nextSpriteToDraw;
|
||||
VehicleDrawInfo* current = nextSpriteToDraw;
|
||||
while (--current >= _sprites_to_draw)
|
||||
gfx_draw_sprite(dpi, current->sprite_index, { current->x, current->y }, current->tertiary_colour);
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ enum class LIST_ITEM_TYPE : uint8_t
|
|||
SCENARIO,
|
||||
};
|
||||
|
||||
struct sc_list_item
|
||||
struct ScenarioListItem
|
||||
{
|
||||
LIST_ITEM_TYPE type;
|
||||
union
|
||||
|
@ -56,7 +56,7 @@ struct sc_list_item
|
|||
};
|
||||
};
|
||||
|
||||
static std::vector<sc_list_item> _listItems;
|
||||
static std::vector<ScenarioListItem> _listItems;
|
||||
|
||||
enum {
|
||||
WIDX_BACKGROUND,
|
||||
|
@ -744,14 +744,14 @@ static void InitialiseListItems(rct_window* w)
|
|||
|
||||
if (headingStringId != STR_NONE)
|
||||
{
|
||||
sc_list_item headerItem;
|
||||
ScenarioListItem headerItem;
|
||||
headerItem.type = LIST_ITEM_TYPE::HEADING;
|
||||
headerItem.heading.string_id = headingStringId;
|
||||
_listItems.push_back(std::move(headerItem));
|
||||
}
|
||||
|
||||
// Scenario
|
||||
sc_list_item scenarioItem;
|
||||
ScenarioListItem scenarioItem;
|
||||
scenarioItem.type = LIST_ITEM_TYPE::SCENARIO;
|
||||
scenarioItem.scenario.scenario = scenario;
|
||||
if (IsLockingEnabled(w))
|
||||
|
|
|
@ -498,16 +498,16 @@ static size_t WindowSceneryCountRows(const rct_window* w)
|
|||
return rows;
|
||||
}
|
||||
|
||||
struct scenery_item
|
||||
struct SceneryItem
|
||||
{
|
||||
int32_t allRows;
|
||||
int32_t selected_item;
|
||||
ScenerySelection scenerySelection;
|
||||
};
|
||||
|
||||
static scenery_item WindowSceneryCountRowsWithSelectedItem(rct_window* w, const size_t tabIndex)
|
||||
static SceneryItem WindowSceneryCountRowsWithSelectedItem(rct_window* w, const size_t tabIndex)
|
||||
{
|
||||
scenery_item sceneryItem = { 0, 0, ScenerySelection() };
|
||||
SceneryItem sceneryItem = { 0, 0, ScenerySelection() };
|
||||
const auto scenerySelection = GetSelectedScenery(tabIndex);
|
||||
const auto& tabInfo = _tabEntries[tabIndex];
|
||||
for (size_t i = 0; i < tabInfo.Entries.size(); i++)
|
||||
|
|
|
@ -32,13 +32,13 @@
|
|||
#include <openrct2/world/Entity.h>
|
||||
|
||||
// clang-format off
|
||||
struct TITLE_COMMAND_ORDER {
|
||||
struct TitleCommandOrder {
|
||||
TitleScript command;
|
||||
rct_string_id nameStringId;
|
||||
rct_string_id descStringId;
|
||||
};
|
||||
|
||||
static TITLE_COMMAND_ORDER _window_title_command_editor_orders[] = {
|
||||
static TitleCommandOrder _window_title_command_editor_orders[] = {
|
||||
{ TitleScript::Load, STR_TITLE_EDITOR_ACTION_LOAD_SAVE, STR_TITLE_EDITOR_ARGUMENT_SAVEFILE },
|
||||
{ TitleScript::LoadSc, STR_TITLE_EDITOR_ACTION_LOAD_SCENARIO, STR_TITLE_EDITOR_ARGUMENT_SCENARIO },
|
||||
{ TitleScript::Location, STR_TITLE_EDITOR_COMMAND_TYPE_LOCATION, STR_TITLE_EDITOR_ARGUMENT_COORDINATES },
|
||||
|
@ -121,7 +121,7 @@ static void WindowTitleCommandEditorPaint(rct_window * w, rct_drawpixelinfo * dp
|
|||
static void WindowTitleCommandEditorTextinput(rct_window * w, rct_widgetindex widgetIndex, char * text);
|
||||
static void ScenarioSelectCallback(const utf8 * path);
|
||||
static int32_t GetCommandInfoIndex(TitleScript commandType);
|
||||
static TITLE_COMMAND_ORDER GetCommandInfo(TitleScript commandType);
|
||||
static TitleCommandOrder GetCommandInfo(TitleScript commandType);
|
||||
static TileCoordsXY GetLocation();
|
||||
static uint8_t GetZoom();
|
||||
|
||||
|
@ -159,7 +159,7 @@ static int32_t GetCommandInfoIndex(TitleScript commandType)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static TITLE_COMMAND_ORDER GetCommandInfo(TitleScript commandType)
|
||||
static TitleCommandOrder GetCommandInfo(TitleScript commandType)
|
||||
{
|
||||
for (int32_t i = 0; i < static_cast<int32_t>(NUM_COMMANDS); i++)
|
||||
{
|
||||
|
@ -767,7 +767,7 @@ static void WindowTitleCommandEditorPaint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
{
|
||||
WindowDrawWidgets(w, dpi);
|
||||
|
||||
TITLE_COMMAND_ORDER command_info = GetCommandInfo(_command.Type);
|
||||
TitleCommandOrder command_info = GetCommandInfo(_command.Type);
|
||||
|
||||
// "Command:" label
|
||||
DrawTextBasic(
|
||||
|
|
Loading…
Reference in New Issue