Finally abstracted constants properly. Changed how the event module works; wasn't really abstract before. Removed libs we're not going to use: native, signal.

This commit is contained in:
rude
2009-10-10 11:11:04 +02:00
parent 0a2ae705dd
commit 87e3c4131c
101 changed files with 3225 additions and 33496 deletions
+23 -4
View File
@@ -202,15 +202,19 @@ namespace sdl
return (SDL_JoystickGetButton(joysticks[index], button) == 1);
}
int Joystick::getHat(int index, int hat)
Joystick::Hat Joystick::getHat(int index, int hat)
{
Hat h = HAT_INVALID;
if(!verifyJoystick(index))
return 0;
return h;
if(hat >= getNumHats(index))
return 0;
return h;
return SDL_JoystickGetHat(joysticks[index], hat);
hats.find(SDL_JoystickGetHat(joysticks[index], hat), h);
return h;
}
void Joystick::close(int index)
@@ -225,6 +229,21 @@ namespace sdl
}
}
EnumMap<Joystick::Hat, Uint8, Joystick::HAT_MAX_ENUM>::Entry Joystick::hatEntries[] =
{
{Joystick::HAT_CENTERED, SDL_HAT_CENTERED},
{Joystick::HAT_UP, SDL_HAT_UP},
{Joystick::HAT_RIGHT, SDL_HAT_RIGHT},
{Joystick::HAT_DOWN, SDL_HAT_DOWN},
{Joystick::HAT_LEFT, SDL_HAT_LEFT},
{Joystick::HAT_RIGHTUP, SDL_HAT_RIGHTUP},
{Joystick::HAT_RIGHTDOWN, SDL_HAT_RIGHTDOWN},
{Joystick::HAT_LEFTUP, SDL_HAT_LEFTUP},
{Joystick::HAT_LEFTDOWN, SDL_HAT_LEFTDOWN},
};
EnumMap<Joystick::Hat, Uint8, Joystick::HAT_MAX_ENUM> Joystick::hats(Joystick::hatEntries, sizeof(Joystick::hatEntries));
} // sdl
} // joystick
} // love