Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
Stella
Commits
f3e1e559
Commit
f3e1e559
authored
Apr 06, 2021
by
thrust26
Browse files
fixed HiDPI mode
(note to myself: sometimes initialization is bad)
parent
e0585212
Pipeline
#19421
passed with stages
in 20 minutes and 22 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/emucore/FrameBuffer.cxx
View file @
f3e1e559
...
...
@@ -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
);
}
...
...
src/emucore/FrameBuffer.hxx
View file @
f3e1e559
...
...
@@ -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
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment