mirror of
https://gitlab.com/drummyfish/anarch.git
synced 2024-11-24 01:42:19 -05:00
Handle csfml wheel
This commit is contained in:
parent
4ca5ea4420
commit
1c3dde5190
21
main_csfml.c
21
main_csfml.c
@ -43,6 +43,7 @@ sfClock *clock;
|
||||
sfRenderWindow* window;
|
||||
|
||||
uint8_t musicOn = 0;
|
||||
int8_t mouseWheelState = 0;
|
||||
|
||||
int8_t SFG_keyPressed(uint8_t key)
|
||||
{
|
||||
@ -71,33 +72,29 @@ int8_t SFG_keyPressed(uint8_t key)
|
||||
break;
|
||||
|
||||
case SFG_KEY_NEXT_WEAPON:
|
||||
/* TODO
|
||||
if (sdlKeyboardState[SDL_SCANCODE_P] || sdlKeyboardState[SDL_SCANCODE_X])
|
||||
if (k(P) || k(X))
|
||||
return 1;
|
||||
|
||||
if (sdlMouseWheelState > 0)
|
||||
if (mouseWheelState > 0)
|
||||
{
|
||||
sdlMouseWheelState--;
|
||||
mouseWheelState--;
|
||||
return 1;
|
||||
}
|
||||
*/
|
||||
|
||||
return 0;
|
||||
break;
|
||||
|
||||
case SFG_KEY_PREVIOUS_WEAPON:
|
||||
/* TODO
|
||||
if (sdlKeyboardState[SDL_SCANCODE_O] || sdlKeyboardState[SDL_SCANCODE_Y]
|
||||
|| sdlKeyboardState[SDL_SCANCODE_Z])
|
||||
if (k(O) || k(Y) || k(Z))
|
||||
return 1;
|
||||
|
||||
if (sdlMouseWheelState < 0)
|
||||
if (mouseWheelState < 0)
|
||||
{
|
||||
sdlMouseWheelState++;
|
||||
mouseWheelState++;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
*/
|
||||
break;
|
||||
|
||||
case SFG_KEY_MENU: return sfKeyboard_isKeyPressed(sfKeyEscape); break;
|
||||
@ -296,6 +293,8 @@ int main()
|
||||
while (sfRenderWindow_pollEvent(window,&event))
|
||||
if (event.type == sfEvtClosed)
|
||||
sfRenderWindow_close(window);
|
||||
else if (event.type == sfEvtMouseWheelMoved)
|
||||
mouseWheelState = event.mouseWheel.delta;
|
||||
|
||||
if (!SFG_mainLoopBody())
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user