mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-02-17 01:31:47 +00:00
small improvement for handling up to 8 mouse buttons
as we do int buttonIndex = ev.button.button - SDL_BUTTON_LEFT; it's only consistent to do if(ev.button.button < SDL_BUTTON_LEFT + 8) it doesn't really make any difference as long as SDL_BUTTON_LEFT is 1, but this way it's safe for SDL3 or whatever future version might break the ABI.
This commit is contained in:
parent
32feff2be1
commit
df90fce6a5
1 changed files with 1 additions and 1 deletions
|
@ -631,7 +631,7 @@ sysEvent_t Sys_GetEvent() {
|
|||
default:
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
// handle X1 button and above
|
||||
if( ev.button.button <= 8 ) // doesn't support more than 8 mouse buttons
|
||||
if( ev.button.button < SDL_BUTTON_LEFT + 8 ) // doesn't support more than 8 mouse buttons
|
||||
{
|
||||
int buttonIndex = ev.button.button - SDL_BUTTON_LEFT;
|
||||
res.evValue = K_MOUSE1 + buttonIndex;
|
||||
|
|
Loading…
Reference in a new issue