AM2R-Community-Developers / AM2R-Community-Updates

Source code for AM2R 1.5.2+, free of copyrighted assets and trademarks.
https://www.reddit.com/r/AM2R/
Other
137 stars 25 forks source link

Analog inputs can cause invalid values for Display Options #125

Open Jesright73 opened 10 months ago

Jesright73 commented 10 months ago

Describe the bug Analog inputs are read as floats instead of integers in the Display Options step event, which can result in non-boolean settings having invalid values.

To Reproduce

  1. Get analog input device (joystick, touch screen)
  2. go to display settings in game
  3. Change the setting of any non-boolean (e.g. Window Size, Metroid Counter, and Controller Tips) using the analog input.
  4. Sometimes [!] appears. Doing this with Window Size can also result in bad screen scaling.

Expected behavior Changing settings with analog should never cause invalid values.

Media image

Platform (please complete the following information):

Game Version: 1.5.5

Additional context Simple fix: round the analog input values in the step event of oOptionsDisplay

- input = (oControl.kRight - oControl.kLeft)
+ input = (ceil(oControl.kRight) - ceil(oControl.kLeft))