mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-21 17:51:38 +00:00
NetPlay: Return mapping arrays and player list vectors directly
Simplifies pad map dialog initialization
This commit is contained in:
parent
b1af2a6bbc
commit
11f3ded296
7 changed files with 55 additions and 53 deletions
|
@ -617,17 +617,15 @@ void NetPlayClient::GetPlayerList(std::string& list, std::vector<int>& pid_list)
|
|||
}
|
||||
|
||||
// called from ---GUI--- thread
|
||||
void NetPlayClient::GetPlayers(std::vector<const Player *> &player_list)
|
||||
std::vector<const Player*> NetPlayClient::GetPlayers()
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lkp(m_crit.players);
|
||||
std::map<PlayerId, Player>::const_iterator
|
||||
i = m_players.begin(),
|
||||
e = m_players.end();
|
||||
for (; i != e; ++i)
|
||||
{
|
||||
const Player *player = &(i->second);
|
||||
player_list.push_back(player);
|
||||
}
|
||||
std::vector<const Player*> players;
|
||||
|
||||
for (const auto& pair : m_players)
|
||||
players.push_back(&pair.second);
|
||||
|
||||
return players;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue