mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-04 14:05:32 +02:00
Fix reported mouse coordinates when scaled for HiDPI
This commit is contained in:
parent
25eba1381e
commit
183cea7046
3 changed files with 12 additions and 5 deletions
|
@ -1 +1 @@
|
||||||
235900
|
1488200
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
// If this is set to anything but 0, steamshim will use RestartAppIfNecessary instead of requiring
|
// If this is set to anything but 0, steamshim will use RestartAppIfNecessary instead of requiring
|
||||||
// a steam_appid.txt
|
// a steam_appid.txt
|
||||||
|
//STEAM_APP_ID = 1488200
|
||||||
STEAM_APP_ID = 0
|
STEAM_APP_ID = 0
|
||||||
|
|
||||||
STEAMSHIM_DEFINES = "GAME_LAUNCH_NAME=\"Z-steam\"" STEAM_APPID=$(STEAM_APP_ID)
|
STEAMSHIM_DEFINES = "GAME_LAUNCH_NAME=\"Z-steam\"" STEAM_APPID=$(STEAM_APP_ID)
|
||||||
|
|
|
@ -748,6 +748,8 @@ struct GraphicsPrivate {
|
||||||
TEXFBO frozenScene;
|
TEXFBO frozenScene;
|
||||||
Quad screenQuad;
|
Quad screenQuad;
|
||||||
|
|
||||||
|
float backingScaleFactor;
|
||||||
|
|
||||||
Vec2i integerScaleFactor;
|
Vec2i integerScaleFactor;
|
||||||
TEXFBO integerScaleBuffer;
|
TEXFBO integerScaleBuffer;
|
||||||
bool integerScaleActive;
|
bool integerScaleActive;
|
||||||
|
@ -770,7 +772,7 @@ struct GraphicsPrivate {
|
||||||
glCtx(SDL_GL_GetCurrentContext()), frameRate(DEF_FRAMERATE),
|
glCtx(SDL_GL_GetCurrentContext()), frameRate(DEF_FRAMERATE),
|
||||||
frameCount(0), brightness(255), fpsLimiter(frameRate),
|
frameCount(0), brightness(255), fpsLimiter(frameRate),
|
||||||
useFrameSkip(rtData->config.frameSkip), frozen(false),
|
useFrameSkip(rtData->config.frameSkip), frozen(false),
|
||||||
last_update(0), last_avg_update(0), integerScaleFactor(0, 0),
|
last_update(0), last_avg_update(0), backingScaleFactor(1), integerScaleFactor(0, 0),
|
||||||
integerScaleActive(rtData->config.integerScaling.active),
|
integerScaleActive(rtData->config.integerScaling.active),
|
||||||
integerLastMileScaling(rtData->config.integerScaling.lastMileScaling) {
|
integerLastMileScaling(rtData->config.integerScaling.lastMileScaling) {
|
||||||
avgFPSData = std::vector<unsigned long long>();
|
avgFPSData = std::vector<unsigned long long>();
|
||||||
|
@ -803,8 +805,8 @@ struct GraphicsPrivate {
|
||||||
|
|
||||||
void updateScreenResoRatio(RGSSThreadData *rtData) {
|
void updateScreenResoRatio(RGSSThreadData *rtData) {
|
||||||
Vec2 &ratio = rtData->sizeResoRatio;
|
Vec2 &ratio = rtData->sizeResoRatio;
|
||||||
ratio.x = (float)scRes.x / scSize.x;
|
ratio.x = (float)scRes.x / scSize.x * backingScaleFactor;
|
||||||
ratio.y = (float)scRes.y / scSize.y;
|
ratio.y = (float)scRes.y / scSize.y * backingScaleFactor;
|
||||||
|
|
||||||
rtData->screenOffset = scOffset;
|
rtData->screenOffset = scOffset;
|
||||||
}
|
}
|
||||||
|
@ -889,7 +891,11 @@ struct GraphicsPrivate {
|
||||||
void checkResize() {
|
void checkResize() {
|
||||||
if (threadData->windowSizeMsg.poll(winSize)) {
|
if (threadData->windowSizeMsg.poll(winSize)) {
|
||||||
/* Query the actual size in pixels, not units */
|
/* Query the actual size in pixels, not units */
|
||||||
threadData->drawableSizeMsg.poll(winSize);
|
Vec2i drawableSize(winSize);
|
||||||
|
threadData->drawableSizeMsg.poll(drawableSize);
|
||||||
|
|
||||||
|
backingScaleFactor = drawableSize.x / winSize.x;
|
||||||
|
winSize = drawableSize;
|
||||||
|
|
||||||
/* Make sure integer buffers are rebuilt before screen offsets are
|
/* Make sure integer buffers are rebuilt before screen offsets are
|
||||||
* calculated so we have the final allocated buffer size ready */
|
* calculated so we have the final allocated buffer size ready */
|
||||||
|
|
Loading…
Add table
Reference in a new issue