mirror of
https://gitlab.com/drummyfish/anarch.git
synced 2025-01-30 23:00:16 -05:00
Abandon mouse wheel
This commit is contained in:
parent
1b081bdefb
commit
6df3843749
2
main.c
2
main.c
@ -1089,7 +1089,7 @@ void SFG_init()
|
||||
SFG_backgroundScaleMap[i] =
|
||||
(i * SFG_TEXTURE_SIZE) / SFG_GAME_RESOLUTION_Y;
|
||||
|
||||
for (uint8_t i = 0; i < SFG_KEY_DOWN; ++i)
|
||||
for (uint8_t i = 0; i < SFG_KEY_COUNT; ++i)
|
||||
SFG_keyStates[i] = 0;
|
||||
|
||||
SFG_backgroundScroll = 0;
|
||||
|
@ -35,8 +35,6 @@
|
||||
|
||||
const uint8_t *sdlKeyboardState;
|
||||
|
||||
int8_t mouseWheel;
|
||||
|
||||
uint16_t screen[SFG_SCREEN_RESOLUTION_X * SFG_SCREEN_RESOLUTION_Y]; // RGB565 format
|
||||
|
||||
SDL_Window *window;
|
||||
@ -138,11 +136,11 @@ int8_t SFG_keyPressed(uint8_t key)
|
||||
break;
|
||||
|
||||
case SFG_KEY_NEXT_WEAPON:
|
||||
return sdlKeyboardState[SDL_SCANCODE_M] || (mouseWheel > 0);
|
||||
return sdlKeyboardState[SDL_SCANCODE_M];
|
||||
break;
|
||||
|
||||
case SFG_KEY_PREVIOUS_WEAPON:
|
||||
return sdlKeyboardState[SDL_SCANCODE_N] || (mouseWheel < 0);
|
||||
return sdlKeyboardState[SDL_SCANCODE_N];
|
||||
break;
|
||||
|
||||
default: return 0; break;
|
||||
@ -155,19 +153,6 @@ void mainLoopIteration()
|
||||
{
|
||||
SDL_PumpEvents(); // updates the keyboard state
|
||||
|
||||
mouseWheel = 0;
|
||||
|
||||
SDL_Event event;
|
||||
|
||||
while(SDL_PollEvent(&event))
|
||||
if(event.type == SDL_MOUSEWHEEL)
|
||||
{
|
||||
if(event.wheel.y > 0)
|
||||
mouseWheel = 1;
|
||||
else
|
||||
mouseWheel = -1;
|
||||
}
|
||||
|
||||
if (sdlKeyboardState[SDL_SCANCODE_ESCAPE])
|
||||
running = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user