mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-21 22:13:07 +01:00
Merge pull request #13084 from vjavs/PVS-Studio/Fixes
Make some PVS-Studio fixes
This commit is contained in:
@@ -1089,8 +1089,6 @@ void process_mouse_over(const ScreenCoordsXY& screenCoords)
|
||||
|
||||
if (window != nullptr)
|
||||
{
|
||||
int32_t ebx, edi;
|
||||
rct_window* subWindow;
|
||||
rct_widgetindex widgetId = window_find_widget_from_point(window, screenCoords);
|
||||
if (widgetId != -1)
|
||||
{
|
||||
@@ -1107,21 +1105,6 @@ void process_mouse_over(const ScreenCoordsXY& screenCoords)
|
||||
break;
|
||||
}
|
||||
cursorId = gCurrentToolId;
|
||||
subWindow = window_find_by_number(
|
||||
gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number);
|
||||
if (subWindow == nullptr)
|
||||
break;
|
||||
|
||||
ebx = 0;
|
||||
edi = cursorId;
|
||||
// Window event WE_UNKNOWN_0E was called here, but no windows actually implemented a handler and
|
||||
// it's not known what it was for
|
||||
cursorId = edi;
|
||||
if ((ebx & 0xFF) != 0)
|
||||
{
|
||||
set_cursor(cursorId);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case WWT_FRAME:
|
||||
|
||||
@@ -527,7 +527,6 @@ void CustomListView::MouseUp(const ScreenCoordsXY& pos)
|
||||
if (!ColumnHeaderPressedCurrentState)
|
||||
{
|
||||
ColumnHeaderPressed = std::nullopt;
|
||||
ColumnHeaderPressedCurrentState = false;
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -400,7 +400,6 @@ static uint64_t window_cheats_page_enabled_widgets[] = {
|
||||
(1ULL << WIDX_DAY_BOX) |
|
||||
(1ULL << WIDX_DAY_UP) |
|
||||
(1ULL << WIDX_DAY_DOWN) |
|
||||
(1ULL << WIDX_MONTH_BOX) |
|
||||
(1ULL << WIDX_DATE_GROUP) |
|
||||
(1ULL << WIDX_DATE_RESET),
|
||||
|
||||
|
||||
@@ -1852,9 +1852,8 @@ void NetworkBase::ProcessPlayerList()
|
||||
{
|
||||
_serverConnection->Player = player;
|
||||
}
|
||||
newPlayers.push_back(player->Id);
|
||||
}
|
||||
|
||||
newPlayers.push_back(player->Id);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -472,6 +472,7 @@ namespace ObjectFactory
|
||||
result->ReadJson(&readContext, jRoot);
|
||||
if (readContext.WasError())
|
||||
{
|
||||
delete result;
|
||||
throw std::runtime_error("Object has errors");
|
||||
}
|
||||
|
||||
|
||||
@@ -473,7 +473,7 @@ uint8_t RCT12BannerElement::GetPosition() const
|
||||
|
||||
uint8_t RCT12BannerElement::GetAllowedEdges() const
|
||||
{
|
||||
return flags & 0b00001111;
|
||||
return AllowedEdges & 0b00001111;
|
||||
}
|
||||
|
||||
bool is_user_string_id(rct_string_id stringId)
|
||||
@@ -990,8 +990,8 @@ void RCT12BannerElement::SetPosition(uint8_t newPosition)
|
||||
|
||||
void RCT12BannerElement::SetAllowedEdges(uint8_t newEdges)
|
||||
{
|
||||
flags &= ~0b00001111;
|
||||
flags |= (newEdges & 0b00001111);
|
||||
AllowedEdges &= ~0b00001111;
|
||||
AllowedEdges |= (newEdges & 0b00001111);
|
||||
}
|
||||
|
||||
bool RCT12ResearchItem::IsInventedEndMarker() const
|
||||
|
||||
@@ -589,9 +589,9 @@ assert_struct_size(RCT12EntranceElement, 8);
|
||||
struct RCT12BannerElement : RCT12TileElementBase
|
||||
{
|
||||
private:
|
||||
uint8_t index; // 4
|
||||
uint8_t position; // 5
|
||||
uint8_t flags; // 6
|
||||
uint8_t index; // 4
|
||||
uint8_t position; // 5
|
||||
uint8_t AllowedEdges; // 6
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunused-private-field"
|
||||
uint8_t unused; // 7
|
||||
|
||||
@@ -35,18 +35,23 @@ void vehicle_visual_observation_tower(
|
||||
int32_t baseImage_id = (vehicle->restraints_position / 64);
|
||||
if (vehicle->restraints_position >= 64)
|
||||
{
|
||||
if ((imageDirection / 8) && (imageDirection / 8) != 3)
|
||||
auto directionOffset = imageDirection / 8;
|
||||
if ((directionOffset == 0) || (directionOffset == 3))
|
||||
{
|
||||
baseImage_id *= 2;
|
||||
baseImage_id += vehicleEntry->base_image_id + 28;
|
||||
if ((imageDirection / 8) != 1)
|
||||
{
|
||||
baseImage_id -= 6;
|
||||
}
|
||||
baseImage_id = vehicleEntry->base_image_id + 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
baseImage_id = vehicleEntry->base_image_id + 8;
|
||||
baseImage_id *= 2;
|
||||
baseImage_id += vehicleEntry->base_image_id;
|
||||
if (directionOffset == 1)
|
||||
{
|
||||
baseImage_id += 28;
|
||||
}
|
||||
else
|
||||
{
|
||||
baseImage_id += 22;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -379,18 +379,18 @@ void BannerElement::SetPosition(uint8_t newPosition)
|
||||
|
||||
uint8_t BannerElement::GetAllowedEdges() const
|
||||
{
|
||||
return flags & 0b00001111;
|
||||
return AllowedEdges & 0b00001111;
|
||||
}
|
||||
|
||||
void BannerElement::SetAllowedEdges(uint8_t newEdges)
|
||||
{
|
||||
flags &= ~0b00001111;
|
||||
flags |= (newEdges & 0b00001111);
|
||||
AllowedEdges &= ~0b00001111;
|
||||
AllowedEdges |= (newEdges & 0b00001111);
|
||||
}
|
||||
|
||||
void BannerElement::ResetAllowedEdges()
|
||||
{
|
||||
flags |= 0b00001111;
|
||||
AllowedEdges |= 0b00001111;
|
||||
}
|
||||
|
||||
Banner* GetBanner(BannerIndex id)
|
||||
|
||||
@@ -532,8 +532,8 @@ private:
|
||||
uint8_t position; // 5
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunused-private-field"
|
||||
uint8_t flags; // 6
|
||||
uint8_t unused; // 7
|
||||
uint8_t AllowedEdges; // 6
|
||||
uint8_t unused; // 7
|
||||
uint8_t pad_09[7];
|
||||
#pragma clang diagnostic pop
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user