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
This commit is contained in:
Jordan Woyak
2010-07-10 06:48:24 +00:00
parent 2bcdf4f5a4
commit a0aa506453
26 changed files with 359 additions and 222 deletions

View File

@ -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);
}