diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2010-07-10 06:48:24 +0000 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2010-07-10 06:48:24 +0000 |
| commit | a0aa506453195d99d8b7e1c0297bb1e285428d0c (patch) | |
| tree | 21a19ab26075bb5bbcb5a630fc6fc87e9a162265 /Source/Core/InputCommon/Src/UDPWrapper.cpp | |
| parent | 2bcdf4f5a476decb416a4947acc5472f9c011223 (diff) | |
GCPad/Wiimote New: Added a set defaults button to the config dialog. (gave new wiimote plugin a few default buttons, not done) Moved MSWindows cursor position code to ControllerInterface/DInput (plan on moving Linux's cursor code to Xlib as well). IR Up,Down,L,R now must have Cursor X/Y/-+ mapped for regular mouse control on Windows. (hopefully this isn't too confusing, the reset to default button automatically sets this up). Renamed One,Two,Minus,Plus to 12-+ (you will have to reconfigure these buttons, sorry). Added text labels for the button and trigger preview bitmaps. -other minor stuff.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5865 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/InputCommon/Src/UDPWrapper.cpp')
| -rw-r--r-- | Source/Core/InputCommon/Src/UDPWrapper.cpp | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/Source/Core/InputCommon/Src/UDPWrapper.cpp b/Source/Core/InputCommon/Src/UDPWrapper.cpp index b92ec79070..e214e03b92 100644 --- a/Source/Core/InputCommon/Src/UDPWrapper.cpp +++ b/Source/Core/InputCommon/Src/UDPWrapper.cpp @@ -3,19 +3,24 @@ #include <stdlib.h> #include <string.h> +const char* DefaultPort(const int index) +{ + static std::string s; + s = "443"; + s += (char)('2' + index); + return s.c_str(); +} + UDPWrapper::UDPWrapper(int indx, const char* const _name) : ControllerEmu::ControlGroup(_name,GROUP_TYPE_UDPWII), inst(NULL), index(indx), updIR(false),updAccel(false), updButt(false),udpEn(false) + , port(DefaultPort(indx)) { - char s[5]; - sprintf(s,"%d",4432+index); - port=s; //PanicAlert("UDPWrapper #%d ctor",index); } - void UDPWrapper::LoadConfig(IniFile::Section *sec, const std::string& defdev, const std::string& base ) { ControlGroup::LoadConfig(sec,defdev,base); @@ -23,15 +28,11 @@ void UDPWrapper::LoadConfig(IniFile::Section *sec, const std::string& defdev, co std::string group( base + name ); group += "/"; int _updAccel,_updIR,_updButt,_udpEn; - sec->Get((group + "Enable").c_str(),&_udpEn,0); - - char s[5]; - sprintf(s,"%d",4432+index); - sec->Get((group + "Port").c_str(),&port,s); - - sec->Get((group + "Update_Accel").c_str(),&_updAccel,1); - sec->Get((group + "Update_IR").c_str(),&_updIR,1); - sec->Get((group + "Update_Butt").c_str(),&_updButt,1); + sec->Get((group + "Enable").c_str(),&_udpEn, 0); + sec->Get((group + "Port").c_str(), &port, DefaultPort(index)); + sec->Get((group + "Update_Accel").c_str(), &_updAccel, 1); + sec->Get((group + "Update_IR").c_str(), &_updIR, 1); + sec->Get((group + "Update_Butt").c_str(), &_updButt, 1); udpEn=(_udpEn>0); updAccel=(_updAccel>0); @@ -46,11 +47,11 @@ void UDPWrapper::SaveConfig(IniFile::Section *sec, const std::string& defdev, co { ControlGroup::SaveConfig(sec,defdev,base); std::string group( base + name ); group += "/"; - sec->Set((group + "Enable").c_str(),(int)udpEn); - sec->Set((group + "Port").c_str(),port.c_str()); - sec->Set((group + "Update_Accel").c_str(),(int)updAccel); - sec->Set((group + "Update_IR").c_str(),(int)updIR); - sec->Set((group + "Update_Butt").c_str(),(int)updButt); + sec->Set((group + "Enable").c_str(), (int)udpEn, 0); + sec->Set((group + "Port").c_str(), port, DefaultPort(index)); + sec->Set((group + "Update_Accel").c_str(), (int)updAccel, 1); + sec->Set((group + "Update_IR").c_str(), (int)updIR, 1); + sec->Set((group + "Update_Butt").c_str(), (int)updButt, 1); } |
