mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Coords fix: toFullscreenCoord should return float, not int.
This commit is contained in:
parent
64bdb5e21d
commit
e6f910ec27
1 changed files with 4 additions and 4 deletions
|
@ -30,12 +30,12 @@
|
|||
|
||||
static const int leftMargin = 140;
|
||||
|
||||
// convert from screen coordinates (leftMargin to dp_xres) to actual fullscreen coordinates (0 to dp_xres)
|
||||
static inline int toFullscreenCoord(int screenx) {
|
||||
return ((float)1.0 / (dp_xres - leftMargin)) * (screenx - leftMargin);
|
||||
// convert from screen coordinates (leftMargin to dp_xres) to actual fullscreen coordinates (0 to 1.0)
|
||||
static inline float toFullscreenCoord(int screenx) {
|
||||
return (float)(screenx - leftMargin) / (dp_xres - leftMargin);
|
||||
}
|
||||
|
||||
// convert from external fullscreen coordinates(0 to dp_xres) to the current partial coordinates (leftMargin to dp_xres)
|
||||
// convert from external fullscreen coordinates(0 to 1.0) to the current partial coordinates (leftMargin to dp_xres)
|
||||
static inline int fromFullscreenCoord(float controllerX) {
|
||||
return leftMargin + (dp_xres - leftMargin) * controllerX;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue