mirror of
https://github.com/libretro/mgba.git
synced 2024-11-30 11:40:28 +00:00
Qt: Dropping multiplayer windows works more cleanly now
This commit is contained in:
parent
822df237a3
commit
4d24b16735
1
CHANGES
1
CHANGES
@ -27,6 +27,7 @@ Misc:
|
||||
- Qt: Add 'Apply' button to settings window
|
||||
- Qt: Prevent savestate window from opening while in multiplayer
|
||||
- Qt: Disable menu items in multiplayer that don't make sense to have enabled
|
||||
- Qt: Dropping multiplayer windows works more cleanly now
|
||||
|
||||
0.3.0: (2015-08-16)
|
||||
Features:
|
||||
|
@ -64,6 +64,20 @@ void MultiplayerController::detachGame(GameController* controller) {
|
||||
emit gameDetached();
|
||||
}
|
||||
|
||||
int MultiplayerController::playerId(GameController* controller) {
|
||||
MutexLock(&m_lockstep.mutex);
|
||||
int id = -1;
|
||||
for (int i = 0; i < m_lockstep.attached; ++i) {
|
||||
GBAThread* thread = controller->thread();
|
||||
if (thread->sioDrivers.multiplayer == &m_lockstep.players[i]->d) {
|
||||
id = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
MutexUnlock(&m_lockstep.mutex);
|
||||
return id;
|
||||
}
|
||||
|
||||
int MultiplayerController::attached() {
|
||||
int num;
|
||||
MutexLock(&m_lockstep.mutex);
|
||||
|
@ -27,6 +27,7 @@ public:
|
||||
void detachGame(GameController*);
|
||||
|
||||
int attached();
|
||||
int playerId(GameController*);
|
||||
|
||||
signals:
|
||||
void gameAttached();
|
||||
|
@ -279,6 +279,7 @@ void Window::multiplayerChanged() {
|
||||
attached = multiplayer->attached();
|
||||
connect(multiplayer, SIGNAL(gameAttached()), this, SLOT(multiplayerChanged()));
|
||||
connect(multiplayer, SIGNAL(gameDetached()), this, SLOT(multiplayerChanged()));
|
||||
m_playerId = multiplayer->playerId(m_controller);
|
||||
}
|
||||
if (m_controller->isLoaded()) {
|
||||
for (QAction* action : m_nonMpActions) {
|
||||
|
Loading…
Reference in New Issue
Block a user