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
164 stars 21 forks source link

Fix mouse wheel for switching weapons #42

Closed yamgent closed 8 years ago

yamgent commented 8 years ago

This fixes #32. Strictly follows the Win32 version.

EDIT: On Win32, KID_MOUSEWHEELUP and KID_MOUSEWHEELDOWN reset only when bPreScan is false. However, in the SDL implementation, they reset on every frame, without checking the bPreScan variable. AFAIK weapon switch seems to only trigger once per 'bPreScan' flip, not per frame.

Of course, we can just surround the reset with a simple if check for bPreScan, but I wanted to restore the original scrolling code (which actually accumulates the scrolls rather than just having an on/off state), hence the changes.

DanielGibson commented 8 years ago

works for me, great work :)