История изменений
Исправление EXL, (текущая версия) :
http://sdl.beuc.net/sdl.wiki/Handling_Joysticks
case SDL_JOYAXISMOTION: /* Handle Joystick Motion */
if ( ( event.jaxis.value < -3200 ) || (event.jaxis.value > 3200 ) )
{
if( event.jaxis.axis == 0)
{
/* Left-right movement code goes here */
}
if( event.jaxis.axis == 1)
{
/* Up-Down movement code goes here */
}
}
break;
https://github.com/zear/TripleTrapled/blob/a8b7fecbab436127bea32728d9fb13dd53...
https://github.com/trideceth12/GCWFodder/blob/bf5a4be2b729f8929463331655850d5...
Учимся пользоваться Github и Google.
case SDL_JOYAXISMOTION: // Analog joystick movement
switch(event.jaxis.axis)
{
case 0: // axis 0 (left-right)
if(event.jaxis.value < -JOY_DEADZONE)
{
// left movement
keys[SDLK_LEFT] = 1;
keys[SDLK_RIGHT] = 0;
}
else if(event.jaxis.value > JOY_DEADZONE)
{
// right movement
keys[SDLK_LEFT] = 0;
keys[SDLK_RIGHT] = 1;
}
else
{
keys[SDLK_LEFT] = 0;
keys[SDLK_RIGHT] = 0;
}
break;
case 1: // axis 1 (up-down)
if(event.jaxis.value < -JOY_DEADZONE)
{
// up movement
keys[SDLK_UP] = 1;
keys[SDLK_DOWN] = 0;
}
else if(event.jaxis.value > JOY_DEADZONE)
{
// down movement
keys[SDLK_UP] = 0;
keys[SDLK_DOWN] = 1;
}
else
{
keys[SDLK_UP] = 0;
keys[SDLK_DOWN] = 0;
}
break;
default:
break;
}
Исходная версия EXL, :
http://sdl.beuc.net/sdl.wiki/Handling_Joysticks
case SDL_JOYAXISMOTION: /* Handle Joystick Motion */
if ( ( event.jaxis.value < -3200 ) || (event.jaxis.value > 3200 ) )
{
if( event.jaxis.axis == 0)
{
/* Left-right movement code goes here */
}
if( event.jaxis.axis == 1)
{
/* Up-Down movement code goes here */
}
}
break;
https://github.com/zear/TripleTrapled/blob/a8b7fecbab436127bea32728d9fb13dd53...
https://github.com/trideceth12/GCWFodder/blob/bf5a4be2b729f8929463331655850d5...
Учимся пользоваться Github и Google.