fixed HiDPI mode

(note to myself: sometimes initialization is bad)
This commit is contained in:
thrust26 2021-04-06 16:53:44 +02:00
parent e0585212b8
commit f3e1e559cf
2 changed files with 8 additions and 7 deletions

View File

@ -98,16 +98,16 @@ void FrameBuffer::initialize()
myAbsDesktopSize.push_back(size);
// Check for HiDPI mode (is it activated, and can we use it?)
myHiDPIAllowed.push_back(((myAbsDesktopSize[display].w / 2) >= FBMinimum::Width) &&
((myAbsDesktopSize[display].h / 2) >= FBMinimum::Height));
myHiDPIAllowed.push_back(((size.w / 2) >= FBMinimum::Width) &&
((size.h / 2) >= FBMinimum::Height));
myHiDPIEnabled.push_back(myHiDPIAllowed.back() && myOSystem.settings().getBool("hidpi"));
// In HiDPI mode, the desktop resolution is essentially halved
// Later, the output is scaled and rendered in 2x mode
if(myHiDPIEnabled.back())
{
size.w = myAbsDesktopSize[display].w / hidpiScaleFactor();
size.h = myAbsDesktopSize[display].h / hidpiScaleFactor();
size.w /= hidpiScaleFactor();
size.h /= hidpiScaleFactor();
}
myDesktopSize.push_back(size);
}
@ -133,7 +133,8 @@ const int FrameBuffer::displayId(BufferType bufferType) const
if(bufferType == myBufferType)
display = myBackend->getCurrentDisplayIndex();
else
display = myOSystem.settings().getInt(getDisplayKey(bufferType));
display = myOSystem.settings().getInt(getDisplayKey(bufferType != BufferType::None
? bufferType : myBufferType));
return std::min(std::max(0, display), maxDisplay);
}

View File

@ -534,8 +534,8 @@ class FrameBuffer
uInt32 myLastScanlines{0};
bool myGrabMouse{false};
vector<bool> myHiDPIAllowed{false};
vector<bool> myHiDPIEnabled{false};
vector<bool> myHiDPIAllowed;
vector<bool> myHiDPIEnabled;
// Minimum TIA zoom level that can be used for this framebuffer
float myTIAMinZoom{2.F};