1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-23 15:52:55 +01:00

Avoid unnecessary calculations when the passed DPI is the active DPI

This commit is contained in:
Matt
2020-12-31 20:36:17 +02:00
parent ac2057775e
commit 114be0e62b

View File

@@ -1010,6 +1010,12 @@ void OpenGLDrawingContext::HandleTransparency()
void OpenGLDrawingContext::SetDPI(rct_drawpixelinfo* dpi)
{
if (dpi == _dpi)
{
// Don't need to recalculate anything if identical.
return;
}
auto screenDPI = _engine->GetDPI();
auto bytesPerRow = screenDPI->GetBytesPerRow();
auto bitsOffset = static_cast<size_t>(dpi->bits - screenDPI->bits);