mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-19 15:58:43 +00:00
Eliminate some trampoline functions.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7015 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
67a4ac0bf6
commit
1de40588ac
20 changed files with 38 additions and 73 deletions
|
@ -38,11 +38,6 @@ extern CFrame* main_frame;
|
|||
|
||||
DEFINE_EVENT_TYPE(wxEVT_THREAD)
|
||||
|
||||
void NetPlayThreadFunc(NetPlay* np)
|
||||
{
|
||||
np->Entry();
|
||||
}
|
||||
|
||||
// called from ---GUI--- thread
|
||||
NetPlay::NetPlay()
|
||||
: m_is_running(false), m_do_loop(true)
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include "GCPadStatus.h"
|
||||
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <queue>
|
||||
#include <sstream>
|
||||
|
@ -94,7 +95,7 @@ class NetPlay
|
|||
public:
|
||||
NetPlay();
|
||||
virtual ~NetPlay();
|
||||
virtual void Entry() = 0;
|
||||
//virtual void ThreadFunc() = 0;
|
||||
|
||||
bool is_connected;
|
||||
|
||||
|
@ -163,15 +164,13 @@ private:
|
|||
|
||||
};
|
||||
|
||||
void NetPlayThreadFunc(NetPlay* arg);
|
||||
|
||||
void NetPlay_Enable(NetPlay* const np);
|
||||
void NetPlay_Disable();
|
||||
|
||||
class NetPlayServer : public NetPlay
|
||||
{
|
||||
public:
|
||||
void Entry();
|
||||
void ThreadFunc();
|
||||
|
||||
NetPlayServer(const u16 port, const std::string& name, NetPlayDiag* const npd = NULL, const std::string& game = "");
|
||||
~NetPlayServer();
|
||||
|
@ -220,7 +219,7 @@ private:
|
|||
class NetPlayClient : public NetPlay
|
||||
{
|
||||
public:
|
||||
void Entry();
|
||||
void ThreadFunc();
|
||||
|
||||
NetPlayClient(const std::string& address, const u16 port, const std::string& name, NetPlayDiag* const npd = NULL);
|
||||
~NetPlayClient();
|
||||
|
|
|
@ -72,7 +72,7 @@ NetPlayClient::NetPlayClient(const std::string& address, const u16 port, const s
|
|||
is_connected = true;
|
||||
|
||||
m_selector.Add(m_socket);
|
||||
m_thread = std::thread(NetPlayThreadFunc, this);
|
||||
m_thread = std::thread(std::mem_fun(&NetPlayClient::ThreadFunc), this);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -237,7 +237,7 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
|||
}
|
||||
|
||||
// called from ---NETPLAY--- thread
|
||||
void NetPlayClient::Entry()
|
||||
void NetPlayClient::ThreadFunc()
|
||||
{
|
||||
while (m_do_loop)
|
||||
{
|
||||
|
|
|
@ -40,14 +40,14 @@ NetPlayServer::NetPlayServer(const u16 port, const std::string& name, NetPlayDia
|
|||
is_connected = true;
|
||||
|
||||
m_selector.Add(m_socket);
|
||||
m_thread = std::thread(NetPlayThreadFunc, this);
|
||||
m_thread = std::thread(std::mem_fun(&NetPlayServer::ThreadFunc), this);
|
||||
}
|
||||
else
|
||||
is_connected = false;
|
||||
}
|
||||
|
||||
// called from ---NETPLAY--- thread
|
||||
void NetPlayServer::Entry()
|
||||
void NetPlayServer::ThreadFunc()
|
||||
{
|
||||
while (m_do_loop)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue