icculus / Serious-Engine

An open source version of a game engine developed by Croteam for the classic Serious Sam games.
GNU General Public License v2.0
165 stars 23 forks source link

(Linux) Switching weapon with mousewheel doesn't work properly #32

Closed DanielGibson closed 8 years ago

DanielGibson commented 8 years ago

Only every 5th try or so.

Haven't debugged that at all yet, just want to mention it here so it's not forgotten.

icculus commented 8 years ago

This might be an SDL big we fixed around the time of 2.0.4 shipping.

icculus commented 8 years ago

Bug, not "big"

DanielGibson commented 8 years ago

nope, it also happens with SDL-hg from April 14th

icculus commented 8 years ago

Hmm, okay.

DrItanium commented 8 years ago

Yeah, I get this too. One "click" of the wheel doesn't trigger a weapon switch at all. Every 5th seems about right.

icculus commented 8 years ago

I don't have this in front of me, but it's likely I'm not converting from SDL to Win32 properly, I think SDL wants this to move by 1 on each wheel click, but Win32 wants it to move like by 120 or something, and we're trying (perhaps incorrectly) to emulate that...Win32 assumes you can move the mouse less than one click for higher-resolution wheels, so it's not surprising that the engine can build up to what it thinks is a "click" with multiple rolls of the wheel.

If you're bored, look for SDL_MOUSEWHEEL and see if I report the value incorrectly. I'll take a closer look if no one beats me to it.

DanielGibson commented 8 years ago

I think I'll look into it over the weekend

yamgent commented 8 years ago

I took some time to write what I found out about this issue in the PR #42.

I checked the other instances of SDL_MOUSEWHEEL and they seem to be reporting the values correctly.