PatchEngine: Add s_ prefix to file-scope variables

Brings the translation unit in line with the convention used elsewhere
in the codebase.
This commit is contained in:
Lioncash 2018-05-13 15:17:38 -04:00
parent 0995cfef6a
commit 5fd8cec7ea

View File

@ -34,8 +34,8 @@ constexpr std::array<const char*, 3> s_patch_type_strings{{
"dword", "dword",
}}; }};
static std::vector<Patch> onFrame; static std::vector<Patch> s_on_frame;
static std::map<u32, int> speedHacks; static std::map<u32, int> s_speed_hacks;
const char* PatchTypeAsString(PatchType type) const char* PatchTypeAsString(PatchType type)
{ {
@ -141,7 +141,7 @@ static void LoadSpeedhacks(const std::string& section, IniFile& ini)
success &= TryParse(value, &cycles); success &= TryParse(value, &cycles);
if (success) if (success)
{ {
speedHacks[address] = (int)cycles; s_speed_hacks[address] = static_cast<int>(cycles);
} }
} }
} }
@ -149,11 +149,11 @@ static void LoadSpeedhacks(const std::string& section, IniFile& ini)
int GetSpeedhackCycles(const u32 addr) int GetSpeedhackCycles(const u32 addr)
{ {
std::map<u32, int>::const_iterator iter = speedHacks.find(addr); const auto iter = s_speed_hacks.find(addr);
if (iter == speedHacks.end()) if (iter == s_speed_hacks.end())
return 0; return 0;
else
return iter->second; return iter->second;
} }
void LoadPatches() void LoadPatches()
@ -162,7 +162,7 @@ void LoadPatches()
IniFile globalIni = SConfig::GetInstance().LoadDefaultGameIni(); IniFile globalIni = SConfig::GetInstance().LoadDefaultGameIni();
IniFile localIni = SConfig::GetInstance().LoadLocalGameIni(); IniFile localIni = SConfig::GetInstance().LoadLocalGameIni();
LoadPatchSection("OnFrame", onFrame, globalIni, localIni); LoadPatchSection("OnFrame", s_on_frame, globalIni, localIni);
ActionReplay::LoadAndApplyCodes(globalIni, localIni); ActionReplay::LoadAndApplyCodes(globalIni, localIni);
Gecko::SetActiveCodes(Gecko::LoadCodes(globalIni, localIni)); Gecko::SetActiveCodes(Gecko::LoadCodes(globalIni, localIni));
@ -238,7 +238,7 @@ bool ApplyFramePatches()
return false; return false;
} }
ApplyPatches(onFrame); ApplyPatches(s_on_frame);
// Run the Gecko code handler // Run the Gecko code handler
Gecko::RunCodeHandler(); Gecko::RunCodeHandler();
@ -249,8 +249,8 @@ bool ApplyFramePatches()
void Shutdown() void Shutdown()
{ {
onFrame.clear(); s_on_frame.clear();
speedHacks.clear(); s_speed_hacks.clear();
ActionReplay::ApplyCodes({}); ActionReplay::ApplyCodes({});
Gecko::Shutdown(); Gecko::Shutdown();
} }