mirror of https://github.com/stella-emu/stella.git
fixed HiDPI mode
(note to myself: sometimes initialization is bad)
This commit is contained in:
parent
e0585212b8
commit
f3e1e559cf
|
@ -98,16 +98,16 @@ void FrameBuffer::initialize()
|
||||||
myAbsDesktopSize.push_back(size);
|
myAbsDesktopSize.push_back(size);
|
||||||
|
|
||||||
// Check for HiDPI mode (is it activated, and can we use it?)
|
// Check for HiDPI mode (is it activated, and can we use it?)
|
||||||
myHiDPIAllowed.push_back(((myAbsDesktopSize[display].w / 2) >= FBMinimum::Width) &&
|
myHiDPIAllowed.push_back(((size.w / 2) >= FBMinimum::Width) &&
|
||||||
((myAbsDesktopSize[display].h / 2) >= FBMinimum::Height));
|
((size.h / 2) >= FBMinimum::Height));
|
||||||
myHiDPIEnabled.push_back(myHiDPIAllowed.back() && myOSystem.settings().getBool("hidpi"));
|
myHiDPIEnabled.push_back(myHiDPIAllowed.back() && myOSystem.settings().getBool("hidpi"));
|
||||||
|
|
||||||
// In HiDPI mode, the desktop resolution is essentially halved
|
// In HiDPI mode, the desktop resolution is essentially halved
|
||||||
// Later, the output is scaled and rendered in 2x mode
|
// Later, the output is scaled and rendered in 2x mode
|
||||||
if(myHiDPIEnabled.back())
|
if(myHiDPIEnabled.back())
|
||||||
{
|
{
|
||||||
size.w = myAbsDesktopSize[display].w / hidpiScaleFactor();
|
size.w /= hidpiScaleFactor();
|
||||||
size.h = myAbsDesktopSize[display].h / hidpiScaleFactor();
|
size.h /= hidpiScaleFactor();
|
||||||
}
|
}
|
||||||
myDesktopSize.push_back(size);
|
myDesktopSize.push_back(size);
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,8 @@ const int FrameBuffer::displayId(BufferType bufferType) const
|
||||||
if(bufferType == myBufferType)
|
if(bufferType == myBufferType)
|
||||||
display = myBackend->getCurrentDisplayIndex();
|
display = myBackend->getCurrentDisplayIndex();
|
||||||
else
|
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);
|
return std::min(std::max(0, display), maxDisplay);
|
||||||
}
|
}
|
||||||
|
|
|
@ -534,8 +534,8 @@ class FrameBuffer
|
||||||
uInt32 myLastScanlines{0};
|
uInt32 myLastScanlines{0};
|
||||||
|
|
||||||
bool myGrabMouse{false};
|
bool myGrabMouse{false};
|
||||||
vector<bool> myHiDPIAllowed{false};
|
vector<bool> myHiDPIAllowed;
|
||||||
vector<bool> myHiDPIEnabled{false};
|
vector<bool> myHiDPIEnabled;
|
||||||
|
|
||||||
// Minimum TIA zoom level that can be used for this framebuffer
|
// Minimum TIA zoom level that can be used for this framebuffer
|
||||||
float myTIAMinZoom{2.F};
|
float myTIAMinZoom{2.F};
|
||||||
|
|
Loading…
Reference in New Issue