mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-05 06:25:34 +02:00
Merge pull request #205 from Splendide-Imaginarius/mkxp-z-mouse-hires
Fix mouse position in hires mode
This commit is contained in:
commit
68a508b027
1 changed files with 18 additions and 4 deletions
|
@ -1441,14 +1441,28 @@ int Input::mouseX()
|
||||||
{
|
{
|
||||||
RGSSThreadData &rtData = shState->rtData();
|
RGSSThreadData &rtData = shState->rtData();
|
||||||
|
|
||||||
return (p->mousePos[0] - rtData.screenOffset.x) * rtData.sizeResoRatio.x;
|
int hiresResult = (p->mousePos[0] - rtData.screenOffset.x) * rtData.sizeResoRatio.x;
|
||||||
|
|
||||||
|
if (shState->config().enableHires) {
|
||||||
|
double framebufferScalingFactor = shState->config().framebufferScalingFactor;
|
||||||
|
return (int)lround(hiresResult / framebufferScalingFactor);
|
||||||
|
}
|
||||||
|
|
||||||
|
return hiresResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Input::mouseY()
|
int Input::mouseY()
|
||||||
{
|
{
|
||||||
RGSSThreadData &rtData = shState->rtData();
|
RGSSThreadData &rtData = shState->rtData();
|
||||||
|
|
||||||
return (p->mousePos[1] - rtData.screenOffset.y) * rtData.sizeResoRatio.y;
|
int hiresResult = (p->mousePos[1] - rtData.screenOffset.y) * rtData.sizeResoRatio.y;
|
||||||
|
|
||||||
|
if (shState->config().enableHires) {
|
||||||
|
double framebufferScalingFactor = shState->config().framebufferScalingFactor;
|
||||||
|
return (int)lround(hiresResult / framebufferScalingFactor);
|
||||||
|
}
|
||||||
|
|
||||||
|
return hiresResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Input::scrollV()
|
int Input::scrollV()
|
||||||
|
|
Loading…
Add table
Reference in a new issue