mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-21 22:13:07 +01:00
Apply review suggestions
This commit is contained in:
@@ -947,10 +947,10 @@ void viewport_paint(
|
||||
const rct_viewport* viewport, rct_drawpixelinfo* dpi, const ScreenRect& screenRect,
|
||||
std::vector<RecordedPaintSession>* recorded_sessions)
|
||||
{
|
||||
uint32_t viewFlags = viewport->flags;
|
||||
const uint32_t viewFlags = viewport->flags;
|
||||
uint32_t width = screenRect.GetWidth();
|
||||
uint32_t height = screenRect.GetHeight();
|
||||
uint32_t bitmask = viewport->zoom >= ZoomLevel{ 0 } ? 0xFFFFFFFF & (0xFFFFFFFF * viewport->zoom) : 0xFFFFFFFF;
|
||||
const uint32_t bitmask = viewport->zoom >= ZoomLevel{ 0 } ? 0xFFFFFFFF & (0xFFFFFFFF * viewport->zoom) : 0xFFFFFFFF;
|
||||
ScreenCoordsXY topLeft = screenRect.Point1;
|
||||
|
||||
width &= bitmask;
|
||||
@@ -978,7 +978,7 @@ void viewport_paint(
|
||||
dpi1.remX = std::max(0, dpi->x - x);
|
||||
dpi1.remY = std::max(0, dpi->y - y);
|
||||
|
||||
// make sure, the compare operation is done in int32_t to avoid the loop becoming an infiniteloop.
|
||||
// make sure, the compare operation is done in int32_t to avoid the loop becoming an infinite loop.
|
||||
// this as well as the [x += 32] in the loop causes signed integer overflow -> undefined behaviour.
|
||||
auto rightBorder = dpi1.x + dpi1.width;
|
||||
auto alignedX = floor2(dpi1.x, 32);
|
||||
|
||||
Reference in New Issue
Block a user