mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-09-10 12:02:53 +02:00
Fix mouse position in hires mode
This commit is contained in:
parent
3376730416
commit
de4740d973
1 changed files with 18 additions and 4 deletions
|
@ -1440,15 +1440,29 @@ int Input::dir8Value()
|
||||||
int Input::mouseX()
|
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