MFC: Fix to use the new link API

git-svn-id: https://svn.code.sf.net/p/vbam/code/branches/bgk-link@1136 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
bgk 2012-09-21 19:03:20 +00:00
parent 98d3dd5df7
commit 567d9bec6c
3 changed files with 10 additions and 6 deletions

View File

@ -74,7 +74,7 @@ BOOL LinkOptions::OnInitDialog(){
AddMode("GameCube - Dolphin", LINK_GAMECUBE_DOLPHIN);
AddMode("Wireless adapter - Single Computer", LINK_RFU_IPC);
sprintf(timeout, "%d", linktimeout);
sprintf(timeout, "%d", theApp.linkTimeout);
m_timeout.LimitText(5);
m_timeout.SetWindowText(timeout);
@ -115,7 +115,8 @@ void LinkOptions::AddMode(LPCTSTR name, int value) {
void LinkOptions::OnOk()
{
static const int length = 256;
CString timeout;
int timeout;
CString timeoutStr;
CString host;
CString title;
CString addressMessage;
@ -126,8 +127,9 @@ void LinkOptions::OnOk()
CloseLink();
m_serverip.GetWindowText(host);
m_timeout.GetWindowText(timeout);
sscanf(timeout, "%d", &linktimeout);
m_timeout.GetWindowText(timeoutStr);
sscanf(timeoutStr, "%d", &timeout);
SetLinkTimeout(timeout);
LinkMode newMode = (LinkMode) m_type;
bool needsServerHost = newMode == LINK_GAMECUBE_DOLPHIN || (newMode == LINK_CABLE_SOCKET && !m_server);
@ -206,6 +208,7 @@ void LinkOptions::OnOk()
return;
}
theApp.linkTimeout = timeout;
theApp.linkMode = GetLinkMode();
theApp.linkHost = host;

View File

@ -1621,7 +1621,7 @@ void VBA::loadSettings()
updateThrottle( (unsigned short)regQueryDwordValue( "throttle", 0 ) );
#ifndef NO_LINK
linktimeout = regQueryDwordValue("LinkTimeout", 1000);
linkTimeout = regQueryDwordValue("LinkTimeout", 1000);
linkMode = regQueryDwordValue("LinkMode", LINK_DISCONNECTED);
@ -2553,7 +2553,7 @@ void VBA::saveSettings()
regSetDwordValue("saveMoreCPU", Sm60FPS::bSaveMoreCPU);
#ifndef NO_LINK
regSetDwordValue("LinkTimeout", linktimeout);
regSetDwordValue("LinkTimeout", linkTimeout);
regSetDwordValue("LinkMode", linkMode);
regSetStringValue("LinkHostAddr", linkHost);
#endif

View File

@ -203,6 +203,7 @@ class VBA : public CWinApp
CString wndClass;
int linkTimeout;
int linkMode;
CString linkHost;