mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-18 15:15:37 +00:00
Added screen resolution modifiers to get proper high resolution scaling.
This commit is contained in:
parent
88b9a76062
commit
11bf8046d8
|
@ -31,6 +31,9 @@ namespace Renderer
|
|||
static int screenOffsetY = 0;
|
||||
static int screenRotate = 0;
|
||||
static bool initialCursorState = 1;
|
||||
// Screen resolution modifiers relative to the 1920x1080 reference.
|
||||
static float screenHeightModifier;
|
||||
static float screenWidthModifier;
|
||||
|
||||
static void setIcon()
|
||||
{
|
||||
|
@ -97,6 +100,9 @@ namespace Renderer
|
|||
screenRotate = Settings::getInstance()->getInt("ScreenRotate") ?
|
||||
Settings::getInstance()->getInt("ScreenRotate") : 0;
|
||||
|
||||
screenHeightModifier = static_cast<float>(screenHeight) / 1080.0f;
|
||||
screenWidthModifier = static_cast<float>(screenWidth) / 1920.0f;
|
||||
|
||||
// Prevent ES window from minimizing when switching windows (when launching
|
||||
// games or when manually switching windows using task switcher).
|
||||
SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0");
|
||||
|
@ -427,5 +433,7 @@ namespace Renderer
|
|||
int getScreenOffsetX() { return screenOffsetX; }
|
||||
int getScreenOffsetY() { return screenOffsetY; }
|
||||
int getScreenRotate() { return screenRotate; }
|
||||
float getScreenWidthModifier() { return screenWidthModifier; }
|
||||
float getScreenHeightModifier() { return screenHeightModifier; }
|
||||
|
||||
} // Renderer::
|
||||
|
|
|
@ -156,6 +156,8 @@ namespace Renderer
|
|||
int getScreenOffsetX();
|
||||
int getScreenOffsetY();
|
||||
int getScreenRotate();
|
||||
float getScreenWidthModifier();
|
||||
float getScreenHeightModifier();
|
||||
|
||||
unsigned int convertRGBAToABGR(unsigned int color);
|
||||
unsigned int convertABGRToRGBA(unsigned int color);
|
||||
|
|
Loading…
Reference in a new issue