mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Merge large parts of nakeee's "Soap" branch into trunk, after fixing a few crash bugs in FileUtil.cpp.
Not really anything interesting, just some better comments, some slightly more portable/cleaner code in places. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2459 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -238,7 +238,7 @@
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\..\..\Externals\SDL\win32;..\..\..\Externals\WiiUse\win32"
|
||||
GenerateManifest="false"
|
||||
GenerateDebugInformation="false"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="0"
|
||||
OptimizeReferences="0"
|
||||
EnableCOMDATFolding="0"
|
||||
@ -321,7 +321,7 @@
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\..\..\Externals\SDL\x64;..\..\..\Externals\WiiUse\x64"
|
||||
GenerateManifest="false"
|
||||
GenerateDebugInformation="false"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="0"
|
||||
OptimizeReferences="0"
|
||||
EnableCOMDATFolding="0"
|
||||
|
@ -499,9 +499,9 @@ void ConfigDialog::CreateGUIControls()
|
||||
|
||||
// Search for devices and add them to the device list
|
||||
wxArrayString StrJoyname; // The string array
|
||||
if(WiiMoteEmu::NumGoodPads > 0)
|
||||
if (WiiMoteEmu::NumGoodPads > 0)
|
||||
{
|
||||
for(int x = 0; x < WiiMoteEmu::joyinfo.size(); x++)
|
||||
for (int x = 0; x < (int)WiiMoteEmu::joyinfo.size(); x++)
|
||||
StrJoyname.Add(wxString::FromAscii(WiiMoteEmu::joyinfo[x].Name.c_str()));
|
||||
}
|
||||
else
|
||||
@ -518,8 +518,10 @@ void ConfigDialog::CreateGUIControls()
|
||||
StrTilt.Add(wxString::FromAscii("Triggers"));
|
||||
// The range is in degrees and are set at even 5 degrees values
|
||||
wxArrayString StrTiltRangeRoll, StrTiltRangePitch;
|
||||
for (int i = 0; i < 37; i++) StrTiltRangeRoll.Add(wxString::Format(wxT("%i"), i*5));
|
||||
for (int i = 0; i < 37; i++) StrTiltRangePitch.Add(wxString::Format(wxT("%i"), i*5));
|
||||
for (int i = 0; i < 37; i++)
|
||||
StrTiltRangeRoll.Add(wxString::Format(wxT("%i"), i*5));
|
||||
for (int i = 0; i < 37; i++)
|
||||
StrTiltRangePitch.Add(wxString::Format(wxT("%i"), i*5));
|
||||
|
||||
// The Trigger type list
|
||||
wxArrayString StrTriggerType;
|
||||
|
@ -109,7 +109,7 @@ void ConfigDialog::SetButtonTextAll(int id, char text[128])
|
||||
for (int i = 0; i < 1; i++)
|
||||
{
|
||||
// Safety check to avoid crash
|
||||
if(WiiMoteEmu::joyinfo.size() > WiiMoteEmu::PadMapping[i].ID)
|
||||
if ((int)WiiMoteEmu::joyinfo.size() > WiiMoteEmu::PadMapping[i].ID)
|
||||
if (WiiMoteEmu::joyinfo[WiiMoteEmu::PadMapping[i].ID].Name == WiiMoteEmu::joyinfo[WiiMoteEmu::PadMapping[Page].ID].Name)
|
||||
SetButtonText(id, text, i);
|
||||
};
|
||||
@ -123,7 +123,7 @@ void ConfigDialog::SaveButtonMappingAll(int Slot)
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
// This can occur when no gamepad is detected
|
||||
if(WiiMoteEmu::joyinfo.size() > WiiMoteEmu::PadMapping[i].ID)
|
||||
if ((int)WiiMoteEmu::joyinfo.size() > WiiMoteEmu::PadMapping[i].ID)
|
||||
if (WiiMoteEmu::joyinfo[WiiMoteEmu::PadMapping[i].ID].Name == WiiMoteEmu::joyinfo[WiiMoteEmu::PadMapping[Slot].ID].Name)
|
||||
SaveButtonMapping(i, false, Slot);
|
||||
}
|
||||
@ -160,7 +160,7 @@ void ConfigDialog::UpdateGUIButtonMapping(int controller)
|
||||
m_TiltInvertPitch[controller]->SetValue(WiiMoteEmu::PadMapping[controller].bPitchInvert);
|
||||
|
||||
// Wiimote
|
||||
#ifdef _WIN32
|
||||
#ifdef _WIN32
|
||||
m_bWmA[controller]->SetLabel(wxString::FromAscii(InputCommon::VKToString(WiiMoteEmu::PadMapping[controller].Wm.A).c_str()));
|
||||
m_bWmB[controller]->SetLabel(wxString::FromAscii(InputCommon::VKToString(WiiMoteEmu::PadMapping[controller].Wm.B).c_str()));
|
||||
m_bWm1[controller]->SetLabel(wxString::FromAscii(InputCommon::VKToString(WiiMoteEmu::PadMapping[controller].Wm.One).c_str()));
|
||||
@ -209,7 +209,7 @@ void ConfigDialog::UpdateGUIButtonMapping(int controller)
|
||||
m_bCcRu[controller]->SetLabel(wxString::FromAscii(InputCommon::VKToString(WiiMoteEmu::PadMapping[controller].Cc.Ru).c_str()));
|
||||
m_bCcRr[controller]->SetLabel(wxString::FromAscii(InputCommon::VKToString(WiiMoteEmu::PadMapping[controller].Cc.Rr).c_str()));
|
||||
m_bCcRd[controller]->SetLabel(wxString::FromAscii(InputCommon::VKToString(WiiMoteEmu::PadMapping[controller].Cc.Rd).c_str()));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//Console::Print("m_bWmA[%i] = %i = %s\n", controller, WiiMoteEmu::PadMapping[controller].Wm.A, InputCommon::VKToString(WiiMoteEmu::PadMapping[controller].Wm.A).c_str());
|
||||
}
|
||||
@ -232,9 +232,11 @@ void ConfigDialog::SaveButtonMapping(int controller, bool DontChangeId, int From
|
||||
/* Set physical device Id. GetSelection() should never be -1 here so we don't check that it's zero or higher. If it's possible that it can be
|
||||
-1 that's a bug that should be fixed. Because the m_Joyname[] combo box should always show <No Gamepad Detected>, or a gamepad name, not a
|
||||
a blank selection. */
|
||||
if(!DontChangeId) WiiMoteEmu::PadMapping[controller].ID = m_Joyname[FromSlot]->GetSelection();
|
||||
if (!DontChangeId)
|
||||
WiiMoteEmu::PadMapping[controller].ID = m_Joyname[FromSlot]->GetSelection();
|
||||
// Set enabled or disable status
|
||||
if(FromSlot == controller) WiiMoteEmu::PadMapping[controller].enabled = true; //m_Joyattach[FromSlot]->GetValue(); // Only enable one
|
||||
if (FromSlot == controller)
|
||||
WiiMoteEmu::PadMapping[controller].enabled = true; //m_Joyattach[FromSlot]->GetValue(); // Only enable one
|
||||
// Set other settings
|
||||
//WiiMoteEmu::PadMapping[controller].controllertype = m_ControlType[FromSlot]->GetSelection();
|
||||
WiiMoteEmu::PadMapping[controller].triggertype = m_TriggerType[FromSlot]->GetSelection();
|
||||
|
@ -363,24 +363,24 @@ void ConfigDialog::ConvertToString()
|
||||
file.Load(FULL_CONFIG_DIR "WiimoteMovement.ini");
|
||||
std::string TmpStr = "", TmpIR = "", TmpTime = "";
|
||||
|
||||
for (int i = 0; i < m_vRecording.size(); i++)
|
||||
for (int i = 0; i < (int)m_vRecording.size(); i++)
|
||||
{
|
||||
// Write the movement data
|
||||
TmpStr += StringFromFormat("%s", m_vRecording.at(i).x >= 0 ? StringFromFormat("+%03i", m_vRecording.at(i).x).c_str() : StringFromFormat("%04i", m_vRecording.at(i).x).c_str());
|
||||
TmpStr += StringFromFormat("%s", m_vRecording.at(i).y >= 0 ? StringFromFormat("+%03i", m_vRecording.at(i).y).c_str() : StringFromFormat("%04i", m_vRecording.at(i).y).c_str());
|
||||
TmpStr += StringFromFormat("%s", m_vRecording.at(i).z >= 0 ? StringFromFormat("+%03i", m_vRecording.at(i).z).c_str() : StringFromFormat("%04i", m_vRecording.at(i).z).c_str());
|
||||
if(i < (m_vRecording.size() - 1)) TmpStr += ",";
|
||||
if (i < ((int)m_vRecording.size() - 1)) TmpStr += ",";
|
||||
|
||||
//Console::Print("%s\n", TmpStr.c_str());
|
||||
|
||||
// Write the IR data
|
||||
TmpIR += ArrayToString(m_vRecording.at(i).IR, IRBytes, 0, 30, false);
|
||||
if(i < (m_vRecording.size() - 1)) TmpIR += ",";
|
||||
if (i < ((int)m_vRecording.size() - 1)) TmpIR += ",";
|
||||
|
||||
// Write the timestamps. The upper limit is 99 seconds.
|
||||
int Time = (int)((m_vRecording.at(i).Time - m_vRecording.at(0).Time) * 1000);
|
||||
TmpTime += StringFromFormat("%05i", Time);
|
||||
if(i < (m_vRecording.size() - 1)) TmpTime += ",";
|
||||
if (i < ((int)m_vRecording.size() - 1)) TmpTime += ",";
|
||||
|
||||
/* Break just short of the IniFile.cpp byte limit so that we don't crash file.Load() the next time.
|
||||
This limit should never be hit because of the recording limit below. I keep it here just in case. */
|
||||
|
@ -171,7 +171,7 @@ bool RecordingPlayAccIR(u8 &_x, u8 &_y, u8 &_z, IRReportType &_IR, int Wm)
|
||||
g_RecordingCurrentTime[Wm] *= ((25.0 + (double)VRecording.at(g_RecordingPlaying[Wm]).PlaybackSpeed * 25.0) / 100.0);
|
||||
|
||||
// Select reading
|
||||
for (int i = 0; i < VRecording.at(g_RecordingPlaying[Wm]).Recording.size(); i++)
|
||||
for (int i = 0; i < (int)VRecording.at(g_RecordingPlaying[Wm]).Recording.size(); i++)
|
||||
if (VRecording.at(g_RecordingPlaying[Wm]).Recording.at(i).Time > g_RecordingCurrentTime[Wm])
|
||||
{
|
||||
g_RecordingPoint[Wm] = i;
|
||||
|
@ -1061,7 +1061,7 @@ int GetUpdateRate()
|
||||
//Console::Print("Time: %i %f\n", Time, GetDoubleTime());
|
||||
|
||||
int TotalTime = 0;
|
||||
for (int i = 0; i < g_UpdateTimeList.size(); i++)
|
||||
for (int i = 0; i < (int)g_UpdateTimeList.size(); i++)
|
||||
TotalTime += g_UpdateTimeList.at(i);
|
||||
g_UpdateRate = TotalTime / 5;
|
||||
|
||||
|
Reference in New Issue
Block a user