MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / SetDefaultControllerConfig

Method SetDefaultControllerConfig

pcsx2/SIO/Pad/Pad.cpp:157–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157void Pad::SetDefaultControllerConfig(SettingsInterface& si)
158{
159 si.ClearSection("InputSources");
160 si.ClearSection("Hotkeys");
161 si.ClearSection("Pad");
162
163 // PCSX2 Controller Settings - Global Settings
164 for (u32 i = 0; i < static_cast<u32>(InputSourceType::Count); i++)
165 {
166 si.SetBoolValue("InputSources",
167 InputManager::InputSourceToString(static_cast<InputSourceType>(i)),
168 InputManager::GetInputSourceDefaultEnabled(static_cast<InputSourceType>(i)));
169 }
170 si.SetBoolValue("InputSources", "SDLControllerEnhancedMode", true);
171 si.SetBoolValue("InputSources", "SDLPS5PlayerLED", true);
172 si.SetBoolValue("Pad", "MultitapPort1", false);
173 si.SetBoolValue("Pad", "MultitapPort2", false);
174 si.SetFloatValue("Pad", "PointerXScale", 8.0f);
175 si.SetFloatValue("Pad", "PointerYScale", 8.0f);
176 SDLInputSource::ResetRGBForAllPlayers(si);
177
178 // PCSX2 Controller Settings - Default pad types and parameters.
179 for (u32 i = 0; i < Pad::NUM_CONTROLLER_PORTS; i++)
180 {
181 const std::string section = GetConfigSection(i);
182 const ControllerInfo* ci = GetControllerInfo(GetDefaultPadType(i));
183 si.ClearSection(section.c_str());
184 si.SetStringValue(section.c_str(), "Type", ci->name);
185
186 for (const SettingInfo& csi : ci->settings)
187 {
188 switch (csi.type)
189 {
190 case SettingInfo::Type::Boolean:
191 si.SetBoolValue(section.c_str(), csi.name, csi.BooleanDefaultValue());
192 break;
193 case SettingInfo::Type::Integer:
194 case SettingInfo::Type::IntegerList:
195 si.SetIntValue(section.c_str(), csi.name, csi.IntegerDefaultValue());
196 break;
197 case SettingInfo::Type::Float:
198 si.SetFloatValue(section.c_str(), csi.name, csi.FloatDefaultValue());
199 break;
200 case SettingInfo::Type::String:
201 case SettingInfo::Type::StringList:
202 case SettingInfo::Type::Path:
203 si.SetStringValue(section.c_str(), csi.name, csi.StringDefaultValue());
204 break;
205 default:
206 break;
207 }
208 }
209 }
210
211 // PCSX2 Controller Settings - Controller 1 / Controller 2 / ...
212 // Use the automapper to set this up.
213 MapController(si, 0, InputManager::GetGenericBindingMapping("Keyboard"));
214}

Callers

nothing calls this directly

Calls 10

BooleanDefaultValueMethod · 0.80
IntegerDefaultValueMethod · 0.80
FloatDefaultValueMethod · 0.80
StringDefaultValueMethod · 0.80
ClearSectionMethod · 0.45
SetBoolValueMethod · 0.45
SetFloatValueMethod · 0.45
c_strMethod · 0.45
SetStringValueMethod · 0.45
SetIntValueMethod · 0.45

Tested by

no test coverage detected