mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
Merge pull request #15578
This commit is contained in:
@@ -291,58 +291,58 @@ void window_research_development_page_paint(rct_window* w, rct_drawpixelinfo* dp
|
||||
|
||||
if (gResearchProgressStage == RESEARCH_STAGE_FINISHED_ALL)
|
||||
{
|
||||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<rct_string_id>(STR_RESEARCH_UNKNOWN);
|
||||
DrawTextWrapped(dpi, screenCoords, 296, STR_RESEARCH_TYPE_LABEL, ft);
|
||||
screenCoords.y += 25;
|
||||
}
|
||||
// Progress
|
||||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<rct_string_id>(STR_RESEARCH_COMPLETED_AL);
|
||||
DrawTextWrapped(dpi, screenCoords, 296, STR_RESEARCH_PROGRESS_LABEL, ft);
|
||||
screenCoords.y += 15;
|
||||
}
|
||||
// Research type
|
||||
auto ft = Formatter();
|
||||
ft.Add<rct_string_id>(STR_RESEARCH_UNKNOWN);
|
||||
DrawTextWrapped(dpi, screenCoords, 296, STR_RESEARCH_TYPE_LABEL, ft);
|
||||
screenCoords.y += 25;
|
||||
|
||||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<rct_string_id>(STR_RESEARCH_STAGE_UNKNOWN);
|
||||
DrawTextBasic(dpi, screenCoords, STR_RESEARCH_EXPECTED_LABEL, ft);
|
||||
}
|
||||
// Progress
|
||||
ft = Formatter();
|
||||
ft.Add<rct_string_id>(STR_RESEARCH_COMPLETED_AL);
|
||||
DrawTextWrapped(dpi, screenCoords, 296, STR_RESEARCH_PROGRESS_LABEL, ft);
|
||||
screenCoords.y += 15;
|
||||
|
||||
// Expected
|
||||
ft = Formatter();
|
||||
ft.Add<rct_string_id>(STR_RESEARCH_STAGE_UNKNOWN);
|
||||
DrawTextBasic(dpi, screenCoords, STR_RESEARCH_EXPECTED_LABEL, ft);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Research type
|
||||
std::array<rct_string_id, 2> strings = { STR_RESEARCH_UNKNOWN, 0 };
|
||||
auto ft = Formatter();
|
||||
rct_string_id label = STR_RESEARCH_TYPE_LABEL;
|
||||
if (gResearchProgressStage != RESEARCH_STAGE_INITIAL_RESEARCH)
|
||||
if (gResearchProgressStage == RESEARCH_STAGE_INITIAL_RESEARCH)
|
||||
{
|
||||
strings[0] = gResearchNextItem->GetCategoryName();
|
||||
if (gResearchProgressStage != RESEARCH_STAGE_DESIGNING)
|
||||
ft.Add<rct_string_id>(STR_RESEARCH_UNKNOWN);
|
||||
}
|
||||
else if (gResearchProgressStage == RESEARCH_STAGE_DESIGNING)
|
||||
{
|
||||
ft.Add<rct_string_id>(gResearchNextItem->GetCategoryName());
|
||||
}
|
||||
else if (gResearchNextItem->type == Research::EntryType::Ride)
|
||||
{
|
||||
const auto& rtd = GetRideTypeDescriptor(gResearchNextItem->baseRideType);
|
||||
if (rtd.HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
strings[0] = gResearchNextItem->GetName();
|
||||
if (gResearchNextItem->type == Research::EntryType::Ride)
|
||||
{
|
||||
auto rtd = GetRideTypeDescriptor(gResearchNextItem->baseRideType);
|
||||
if (!rtd.HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
if (gResearchNextItem->flags & RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE)
|
||||
{
|
||||
strings[0] = rtd.Naming.Name;
|
||||
}
|
||||
else
|
||||
{
|
||||
strings[1] = rtd.Naming.Name;
|
||||
label = STR_RESEARCH_TYPE_LABEL_VEHICLE;
|
||||
}
|
||||
}
|
||||
}
|
||||
ft.Add<rct_string_id>(gResearchNextItem->GetName());
|
||||
}
|
||||
else if (gResearchNextItem->flags & RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE)
|
||||
{
|
||||
ft.Add<rct_string_id>(rtd.Naming.Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
ft.Add<rct_string_id>(gResearchNextItem->GetName());
|
||||
ft.Add<rct_string_id>(rtd.Naming.Name);
|
||||
label = STR_RESEARCH_TYPE_LABEL_VEHICLE;
|
||||
}
|
||||
}
|
||||
auto ft = Formatter();
|
||||
ft.Add<rct_string_id>(strings[0]);
|
||||
ft.Add<rct_string_id>(strings[1]);
|
||||
else
|
||||
{
|
||||
ft.Add<rct_string_id>(gResearchNextItem->GetName());
|
||||
}
|
||||
DrawTextWrapped(dpi, screenCoords, 296, label, ft);
|
||||
screenCoords.y += 25;
|
||||
|
||||
@@ -374,33 +374,32 @@ void window_research_development_page_paint(rct_window* w, rct_drawpixelinfo* dp
|
||||
if (gResearchLastItem.has_value())
|
||||
{
|
||||
rct_string_id lastDevelopmentFormat = STR_EMPTY;
|
||||
std::array<rct_string_id, 2> strings = { gResearchLastItem->GetName(), 0 };
|
||||
auto type = gResearchLastItem->type;
|
||||
if (type == Research::EntryType::Scenery)
|
||||
auto ft = Formatter();
|
||||
if (gResearchLastItem->type == Research::EntryType::Scenery)
|
||||
{
|
||||
lastDevelopmentFormat = STR_RESEARCH_SCENERY_LABEL;
|
||||
ft.Add<rct_string_id>(gResearchLastItem->GetName());
|
||||
}
|
||||
else
|
||||
{
|
||||
lastDevelopmentFormat = STR_RESEARCH_RIDE_LABEL;
|
||||
auto rtd = GetRideTypeDescriptor(gResearchLastItem->baseRideType);
|
||||
if (!rtd.HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
const auto& rtd = GetRideTypeDescriptor(gResearchLastItem->baseRideType);
|
||||
if (rtd.HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
if (gResearchLastItem->flags & RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE)
|
||||
{
|
||||
strings[0] = rtd.Naming.Name;
|
||||
}
|
||||
else
|
||||
{
|
||||
strings[1] = rtd.Naming.Name;
|
||||
lastDevelopmentFormat = STR_RESEARCH_VEHICLE_LABEL;
|
||||
}
|
||||
ft.Add<rct_string_id>(gResearchLastItem->GetName());
|
||||
}
|
||||
else if (gResearchLastItem->flags & RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE)
|
||||
{
|
||||
ft.Add<rct_string_id>(rtd.Naming.Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
ft.Add<rct_string_id>(gResearchLastItem->GetName());
|
||||
ft.Add<rct_string_id>(rtd.Naming.Name);
|
||||
lastDevelopmentFormat = STR_RESEARCH_VEHICLE_LABEL;
|
||||
}
|
||||
}
|
||||
|
||||
auto ft = Formatter();
|
||||
ft.Add<rct_string_id>(strings[0]);
|
||||
ft.Add<rct_string_id>(strings[1]);
|
||||
DrawTextWrapped(dpi, screenCoords, 266, lastDevelopmentFormat, ft);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,8 +122,14 @@ template<> void PaintEntity(paint_session* session, const JumpingFountain* jumpi
|
||||
uint32_t baseImageId = (jumpingFountain->FountainType == JumpingFountainType::Snow) ? JumpingFountainSnowBaseImage
|
||||
: JumpingFountainWaterBaseImage;
|
||||
uint32_t imageId = baseImageId + ebx * 16 + jumpingFountain->frame;
|
||||
constexpr std::array<CoordsXY, 2> antiClockWiseBoundingBoxes = { CoordsXY{ -COORDS_XY_STEP, -3 }, CoordsXY{ 0, -3 } };
|
||||
constexpr std::array<CoordsXY, 2> clockWiseBoundingBoxes = { CoordsXY{ -COORDS_XY_STEP, 3 }, CoordsXY{ 0, 3 } };
|
||||
constexpr std::array antiClockWiseBoundingBoxes = {
|
||||
CoordsXY{ -COORDS_XY_STEP, -3 },
|
||||
CoordsXY{ 0, -3 },
|
||||
};
|
||||
constexpr std::array clockWiseBoundingBoxes = {
|
||||
CoordsXY{ -COORDS_XY_STEP, 3 },
|
||||
CoordsXY{ 0, 3 },
|
||||
};
|
||||
|
||||
auto bb = isAntiClockwise ? antiClockWiseBoundingBoxes : clockWiseBoundingBoxes;
|
||||
|
||||
|
||||
@@ -237,7 +237,7 @@ CurrencyType platform_get_currency_value(const char* currCode)
|
||||
#ifndef _WIN32
|
||||
std::string platform_sanitise_filename(const std::string& path)
|
||||
{
|
||||
static const std::array<std::string::value_type, 1> prohibited = { '/' };
|
||||
static constexpr std::array prohibited = { '/' };
|
||||
auto sanitised = path;
|
||||
std::replace_if(
|
||||
sanitised.begin(), sanitised.end(),
|
||||
|
||||
@@ -196,7 +196,7 @@ std::string platform_get_rct2_steam_dir()
|
||||
|
||||
std::string platform_sanitise_filename(const std::string& path)
|
||||
{
|
||||
static const std::array<std::string::value_type, 9> prohibited = { '<', '>', '*', '\\', ':', '|', '?', '"', '/' };
|
||||
static constexpr std::array prohibited = { '<', '>', '*', '\\', ':', '|', '?', '"', '/' };
|
||||
auto sanitised = path;
|
||||
std::replace_if(
|
||||
sanitised.begin(), sanitised.end(),
|
||||
|
||||
@@ -7262,7 +7262,7 @@ void Vehicle::UpdateAnimationAnimalFlying()
|
||||
Invalidate();
|
||||
}
|
||||
// number of frames to skip before updating again
|
||||
constexpr std::array<uint8_t, 4> frameWaitTimes = { 5, 3, 5, 3 };
|
||||
constexpr std::array frameWaitTimes = { 5, 3, 5, 3 };
|
||||
animationState = frameWaitTimes[animation_frame];
|
||||
}
|
||||
|
||||
|
||||
@@ -361,7 +361,7 @@ static void paint_ghost_train_station(
|
||||
{
|
||||
uint32_t imageId;
|
||||
|
||||
static constexpr const std::array<uint32_t, 4> imageIds = {
|
||||
static constexpr const std::array imageIds = {
|
||||
SPR_STATION_BASE_B_SW_NE,
|
||||
SPR_STATION_BASE_B_NW_SE,
|
||||
SPR_STATION_BASE_B_SW_NE,
|
||||
|
||||
@@ -194,15 +194,17 @@ WallElement* banner_get_scrolling_wall_tile_element(BannerIndex bannerIndex)
|
||||
*/
|
||||
ride_id_t banner_get_closest_ride_index(const CoordsXYZ& mapPos)
|
||||
{
|
||||
static constexpr const std::array<CoordsXY, 9> NeighbourCheckOrder = { CoordsXY{ COORDS_XY_STEP, 0 },
|
||||
CoordsXY{ -COORDS_XY_STEP, 0 },
|
||||
{ 0, COORDS_XY_STEP },
|
||||
CoordsXY{ 0, -COORDS_XY_STEP },
|
||||
CoordsXY{ -COORDS_XY_STEP, +COORDS_XY_STEP },
|
||||
CoordsXY{ +COORDS_XY_STEP, -COORDS_XY_STEP },
|
||||
CoordsXY{ +COORDS_XY_STEP, +COORDS_XY_STEP },
|
||||
CoordsXY{ -COORDS_XY_STEP, +COORDS_XY_STEP },
|
||||
CoordsXY{ 0, 0 } };
|
||||
static constexpr const std::array NeighbourCheckOrder = {
|
||||
CoordsXY{ COORDS_XY_STEP, 0 },
|
||||
CoordsXY{ -COORDS_XY_STEP, 0 },
|
||||
CoordsXY{ 0, COORDS_XY_STEP },
|
||||
CoordsXY{ 0, -COORDS_XY_STEP },
|
||||
CoordsXY{ -COORDS_XY_STEP, +COORDS_XY_STEP },
|
||||
CoordsXY{ +COORDS_XY_STEP, -COORDS_XY_STEP },
|
||||
CoordsXY{ +COORDS_XY_STEP, +COORDS_XY_STEP },
|
||||
CoordsXY{ -COORDS_XY_STEP, +COORDS_XY_STEP },
|
||||
CoordsXY{ 0, 0 },
|
||||
};
|
||||
|
||||
for (const auto& neighhbourCoords : NeighbourCheckOrder)
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ enum class PATTERN
|
||||
FAST_RANDOM_CHASERS,
|
||||
};
|
||||
|
||||
static constexpr const std::array<CoordsXY, 8> _fountainDirectionsNegative = {
|
||||
static constexpr const std::array _fountainDirectionsNegative = {
|
||||
CoordsXY{ -COORDS_XY_STEP, 0 },
|
||||
CoordsXY{ -COORDS_XY_STEP, -COORDS_XY_STEP },
|
||||
CoordsXY{ 0, 0 },
|
||||
@@ -39,14 +39,16 @@ static constexpr const std::array<CoordsXY, 8> _fountainDirectionsNegative = {
|
||||
CoordsXY{ -COORDS_XY_STEP, -COORDS_XY_STEP },
|
||||
};
|
||||
|
||||
static constexpr const std::array<CoordsXY, 8> _fountainDirectionsPositive = { CoordsXY{ COORDS_XY_STEP, 0 },
|
||||
CoordsXY{ 0, 0 },
|
||||
CoordsXY{ 0, COORDS_XY_STEP },
|
||||
CoordsXY{ COORDS_XY_STEP, COORDS_XY_STEP },
|
||||
CoordsXY{ COORDS_XY_STEP, COORDS_XY_STEP },
|
||||
CoordsXY{ COORDS_XY_STEP, 0 },
|
||||
CoordsXY{ 0, 0 },
|
||||
CoordsXY{ 0, COORDS_XY_STEP } };
|
||||
static constexpr const std::array _fountainDirectionsPositive = {
|
||||
CoordsXY{ COORDS_XY_STEP, 0 },
|
||||
CoordsXY{ 0, 0 },
|
||||
CoordsXY{ 0, COORDS_XY_STEP },
|
||||
CoordsXY{ COORDS_XY_STEP, COORDS_XY_STEP },
|
||||
CoordsXY{ COORDS_XY_STEP, COORDS_XY_STEP },
|
||||
CoordsXY{ COORDS_XY_STEP, 0 },
|
||||
CoordsXY{ 0, 0 },
|
||||
CoordsXY{ 0, COORDS_XY_STEP },
|
||||
};
|
||||
constexpr auto _FountainChanceOfStoppingEdgeMode = 0x3333; // 0.200
|
||||
constexpr auto _FountainChanceOfStoppingRandomMode = 0x2000; // 0.125
|
||||
|
||||
|
||||
@@ -1077,10 +1077,12 @@ void map_invalidate_map_selection_tiles()
|
||||
static void map_get_bounding_box(const MapRange& _range, int32_t* left, int32_t* top, int32_t* right, int32_t* bottom)
|
||||
{
|
||||
uint32_t rotation = get_current_rotation();
|
||||
std::array<const CoordsXY, 4> corners{ CoordsXY{ _range.GetLeft(), _range.GetTop() },
|
||||
CoordsXY{ _range.GetRight(), _range.GetTop() },
|
||||
CoordsXY{ _range.GetRight(), _range.GetBottom() },
|
||||
CoordsXY{ _range.GetLeft(), _range.GetBottom() } };
|
||||
const std::array corners{
|
||||
CoordsXY{ _range.GetLeft(), _range.GetTop() },
|
||||
CoordsXY{ _range.GetRight(), _range.GetTop() },
|
||||
CoordsXY{ _range.GetRight(), _range.GetBottom() },
|
||||
CoordsXY{ _range.GetLeft(), _range.GetBottom() },
|
||||
};
|
||||
|
||||
*left = std::numeric_limits<int32_t>::max();
|
||||
*top = std::numeric_limits<int32_t>::max();
|
||||
|
||||
Reference in New Issue
Block a user