- [NEW] Afegit menu per a redefinir els botons del gamepad
This commit is contained in:
@@ -7,6 +7,7 @@ namespace config
|
||||
bool musicEnabled = true;
|
||||
int soundMode = SOUND_ALL;
|
||||
uint8_t keys[6] = {SDL_SCANCODE_UP, SDL_SCANCODE_DOWN, SDL_SCANCODE_LEFT, SDL_SCANCODE_RIGHT, SDL_SCANCODE_SPACE, SDL_SCANCODE_RETURN};
|
||||
int8_t pad_btns[6] = {0, 1, 2, 3, 4, 5};
|
||||
|
||||
void setMusic(const bool value)
|
||||
{
|
||||
@@ -55,4 +56,17 @@ namespace config
|
||||
{
|
||||
return keys[which];
|
||||
}
|
||||
|
||||
void definePadBtn(const int which, const int btn)
|
||||
{
|
||||
static const char* nomtecles[6] = {"btnup", "btndown", "btnleft", "btnright", "btnjump", "btnpick"};
|
||||
pad_btns[which] = btn;
|
||||
char tmp[5];
|
||||
file::setConfigValue(nomtecles[which], SDL_itoa(btn, tmp, 10));
|
||||
}
|
||||
|
||||
const int getPadBtn(const int which)
|
||||
{
|
||||
return keys[which];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user