mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-26 12:21:19 +00:00
sdl2: fix tabbing on last few commits
This commit is contained in:
parent
080f8e4008
commit
1882cf9233
1 changed files with 55 additions and 55 deletions
|
@ -920,59 +920,59 @@ static void Impl_HandleMouseWheelEvent(SDL_MouseWheelEvent evt)
|
||||||
|
|
||||||
static void Impl_HandleJoystickAxisEvent(SDL_JoyAxisEvent evt)
|
static void Impl_HandleJoystickAxisEvent(SDL_JoyAxisEvent evt)
|
||||||
{
|
{
|
||||||
event_t event;
|
event_t event;
|
||||||
|
|
||||||
evt.which++;
|
evt.which++;
|
||||||
evt.axis++;
|
evt.axis++;
|
||||||
event.data1 = event.data2 = event.data3 = INT32_MAX;
|
event.data1 = event.data2 = event.data3 = INT32_MAX;
|
||||||
if (cv_usejoystick.value == evt.which)
|
if (cv_usejoystick.value == evt.which)
|
||||||
{
|
{
|
||||||
event.type = ev_joystick;
|
event.type = ev_joystick;
|
||||||
}
|
}
|
||||||
else if (cv_usejoystick.value == evt.which)
|
else if (cv_usejoystick.value == evt.which)
|
||||||
{
|
{
|
||||||
event.type = ev_joystick2;
|
event.type = ev_joystick2;
|
||||||
}
|
}
|
||||||
else return;
|
else return;
|
||||||
//axis
|
//axis
|
||||||
if (evt.axis > JOYAXISSET*2)
|
if (evt.axis > JOYAXISSET*2)
|
||||||
return;
|
return;
|
||||||
//vaule
|
//vaule
|
||||||
if (evt.axis%2)
|
if (evt.axis%2)
|
||||||
{
|
{
|
||||||
event.data1 = evt.axis / 2;
|
event.data1 = evt.axis / 2;
|
||||||
event.data2 = SDLJoyAxis(evt.value, event.type);
|
event.data2 = SDLJoyAxis(evt.value, event.type);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
evt.axis--;
|
evt.axis--;
|
||||||
event.data1 = evt.axis / 2;
|
event.data1 = evt.axis / 2;
|
||||||
event.data3 = SDLJoyAxis(evt.value, event.type);
|
event.data3 = SDLJoyAxis(evt.value, event.type);
|
||||||
}
|
}
|
||||||
D_PostEvent(&event);
|
D_PostEvent(&event);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Impl_HandleJoystickButtonEvent(SDL_JoyButtonEvent evt, Uint32 type)
|
static void Impl_HandleJoystickButtonEvent(SDL_JoyButtonEvent evt, Uint32 type)
|
||||||
{
|
{
|
||||||
event_t event;
|
event_t event;
|
||||||
|
|
||||||
evt.which++;
|
evt.which++;
|
||||||
if (cv_usejoystick.value == evt.which)
|
if (cv_usejoystick.value == evt.which)
|
||||||
event.data1 = KEY_JOY1;
|
event.data1 = KEY_JOY1;
|
||||||
else if (cv_usejoystick.value == evt.which)
|
else if (cv_usejoystick.value == evt.which)
|
||||||
event.data1 = KEY_2JOY1;
|
event.data1 = KEY_2JOY1;
|
||||||
else return;
|
else return;
|
||||||
if (type == SDL_JOYBUTTONUP)
|
if (type == SDL_JOYBUTTONUP)
|
||||||
event.type = ev_keyup;
|
event.type = ev_keyup;
|
||||||
else if (type == SDL_JOYBUTTONDOWN)
|
else if (type == SDL_JOYBUTTONDOWN)
|
||||||
event.type = ev_keydown;
|
event.type = ev_keydown;
|
||||||
else return;
|
else return;
|
||||||
if (evt.button < JOYBUTTONS)
|
if (evt.button < JOYBUTTONS)
|
||||||
event.data1 += evt.button;
|
event.data1 += evt.button;
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
SDLJoyRemap(&event);
|
SDLJoyRemap(&event);
|
||||||
if (event.type != ev_console) D_PostEvent(&event);
|
if (event.type != ev_console) D_PostEvent(&event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void I_GetEvent(void)
|
void I_GetEvent(void)
|
||||||
|
@ -1005,13 +1005,13 @@ void I_GetEvent(void)
|
||||||
case SDL_MOUSEWHEEL:
|
case SDL_MOUSEWHEEL:
|
||||||
Impl_HandleMouseWheelEvent(evt.wheel);
|
Impl_HandleMouseWheelEvent(evt.wheel);
|
||||||
break;
|
break;
|
||||||
case SDL_JOYAXISMOTION:
|
case SDL_JOYAXISMOTION:
|
||||||
Impl_HandleJoystickAxisEvent(evt.jaxis);
|
Impl_HandleJoystickAxisEvent(evt.jaxis);
|
||||||
break;
|
break;
|
||||||
case SDL_JOYBUTTONUP:
|
case SDL_JOYBUTTONUP:
|
||||||
case SDL_JOYBUTTONDOWN:
|
case SDL_JOYBUTTONDOWN:
|
||||||
Impl_HandleJoystickButtonEvent(evt.jbutton, evt.type);
|
Impl_HandleJoystickButtonEvent(evt.jbutton, evt.type);
|
||||||
break;
|
break;
|
||||||
case SDL_QUIT:
|
case SDL_QUIT:
|
||||||
I_Quit();
|
I_Quit();
|
||||||
M_QuitResponse('y');
|
M_QuitResponse('y');
|
||||||
|
@ -1961,7 +1961,7 @@ void I_StartupGraphics(void)
|
||||||
if (!I_GetEnv("SDL_VIDEO_CENTERED"))
|
if (!I_GetEnv("SDL_VIDEO_CENTERED"))
|
||||||
I_PutEnv(SDLVIDEOMID);
|
I_PutEnv(SDLVIDEOMID);
|
||||||
*/
|
*/
|
||||||
disable_fullscreen = M_CheckParm("-win") ? 1 : 0;
|
disable_fullscreen = M_CheckParm("-win") ? 1 : 0;
|
||||||
|
|
||||||
keyboard_started = true;
|
keyboard_started = true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue