GTK : Reenabled joypad switching.
git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@694 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
parent
f49aed599a
commit
1c55e89f7c
|
@ -712,22 +712,22 @@ Window::Window(GtkWindow * _pstWindow, const Glib::RefPtr<Xml> & _poXml) :
|
|||
poMI->signal_activate().connect(sigc::bind(
|
||||
sigc::mem_fun(*this, &Window::vOnJoypadConfigure), 4));
|
||||
|
||||
/*int iDefaultJoypad = m_poInputConfig->oGetKey<int>("active_joypad");
|
||||
int iDefaultJoypad = m_poInputConfig->oGetKey<int>("active_joypad");
|
||||
for (int i = m_iJoypadMin; i <= m_iJoypadMax; i++)
|
||||
{
|
||||
char csName[20];
|
||||
snprintf(csName, sizeof(csName), "Joypad%d", i);
|
||||
snprintf(csName, sizeof(csName), "Joypad%d", i + 1);
|
||||
|
||||
poCMI = dynamic_cast<Gtk::CheckMenuItem *>(_poXml->get_widget(csName));
|
||||
if (i == iDefaultJoypad)
|
||||
{
|
||||
poCMI->set_active();
|
||||
vOnJoypadToggled(poCMI, iDefaultJoypad);
|
||||
vOnJoypadToggled(poCMI, (EPad)iDefaultJoypad);
|
||||
}
|
||||
poCMI->signal_toggled().connect(sigc::bind(
|
||||
sigc::mem_fun(*this, &Window::vOnJoypadToggled),
|
||||
poCMI, i));
|
||||
}*/
|
||||
poCMI, (EPad)i));
|
||||
}
|
||||
|
||||
// Autofire menu
|
||||
//
|
||||
|
|
|
@ -165,7 +165,7 @@ protected:
|
|||
virtual void vOnFilter2xToggled(Gtk::CheckMenuItem * _poCMI, int _iFilter2x);
|
||||
virtual void vOnFilterIBToggled(Gtk::CheckMenuItem * _poCMI, int _iFilterIB);
|
||||
virtual void vOnJoypadConfigure(int _iJoypad);
|
||||
virtual void vOnJoypadToggled(Gtk::CheckMenuItem * _poCMI, int _iJoypad);
|
||||
virtual void vOnJoypadToggled(Gtk::CheckMenuItem * _poCMI, EPad _eJoypad);
|
||||
virtual void vOnAutofireToggled(Gtk::CheckMenuItem * _poCMI, u32 _uiKeyFlag);
|
||||
#ifndef NO_DEBUGGER
|
||||
virtual void vOnGDBWait();
|
||||
|
|
|
@ -881,16 +881,16 @@ void Window::vOnJoypadConfigure(int _iJoypad)
|
|||
delete poDialog;
|
||||
}
|
||||
|
||||
void Window::vOnJoypadToggled(Gtk::CheckMenuItem * _poCMI, int _iJoypad)
|
||||
void Window::vOnJoypadToggled(Gtk::CheckMenuItem * _poCMI, EPad _eJoypad)
|
||||
{
|
||||
/* if (! _poCMI->get_active())
|
||||
if (! _poCMI->get_active())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_oKeymap = m_oJoypads[_iJoypad - 1].oCreateKeymap();
|
||||
inputSetDefaultJoypad(_eJoypad);
|
||||
|
||||
m_poInputConfig->vSetKey("active_joypad", _iJoypad);*/
|
||||
m_poInputConfig->vSetKey("active_joypad", _eJoypad);
|
||||
}
|
||||
|
||||
void Window::vOnAutofireToggled(Gtk::CheckMenuItem * _poCMI, u32 _uiKeyFlag)
|
||||
|
|
|
@ -47,7 +47,7 @@ static bool sdlMotionButtons[4] = { false, false, false, false };
|
|||
static int sdlNumDevices = 0;
|
||||
static SDL_Joystick **sdlDevices = NULL;
|
||||
|
||||
static int sdlDefaultJoypad = 0;
|
||||
static EPad sdlDefaultJoypad = PAD_MAIN;
|
||||
|
||||
static int autoFire = 0;
|
||||
static bool autoFireToggle = false;
|
||||
|
@ -568,3 +568,8 @@ int inputGetSensorY()
|
|||
{
|
||||
return sensorY;
|
||||
}
|
||||
|
||||
void inputSetDefaultJoypad(EPad pad)
|
||||
{
|
||||
sdlDefaultJoypad = pad;
|
||||
}
|
||||
|
|
|
@ -121,4 +121,10 @@ int inputGetSensorX();
|
|||
*/
|
||||
int inputGetSensorY();
|
||||
|
||||
/**
|
||||
* Set which joypad configuration use when the core doesn't ask for a specific
|
||||
* pad
|
||||
*/
|
||||
void inputSetDefaultJoypad(EPad pad);
|
||||
|
||||
#endif // VBAM_SDL_INPUT_H
|
||||
|
|
Loading…
Reference in New Issue