mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-27 07:20:49 +00:00
Reduce memory allocations during controller processing
This commit is contained in:
parent
9a276c6f97
commit
144ed7a3ab
@ -268,6 +268,7 @@ bool ControlMapper::UpdatePSPState(const InputMapping &changedMapping, double no
|
||||
// For the PSP's button inputs, we just go through and put the flags together.
|
||||
uint32_t buttonMask = 0;
|
||||
uint32_t changedButtonMask = 0;
|
||||
std::vector<MultiInputMapping> inputMappings;
|
||||
for (int i = 0; i < 32; i++) {
|
||||
uint32_t mask = 1 << i;
|
||||
if (!(mask & CTRL_MASK_USER)) {
|
||||
@ -281,8 +282,6 @@ bool ControlMapper::UpdatePSPState(const InputMapping &changedMapping, double no
|
||||
}
|
||||
|
||||
SwapMappingIfEnabled(&mappingBit);
|
||||
|
||||
std::vector<MultiInputMapping> inputMappings;
|
||||
if (!KeyMap::InputMappingsFromPspButton(mappingBit, &inputMappings, false))
|
||||
continue;
|
||||
|
||||
@ -316,7 +315,6 @@ bool ControlMapper::UpdatePSPState(const InputMapping &changedMapping, double no
|
||||
// Note that virtual keys include the analog directions, as they are driven by them.
|
||||
for (int i = 0; i < VIRTKEY_COUNT; i++) {
|
||||
int vkId = i + VIRTKEY_FIRST;
|
||||
std::vector<MultiInputMapping> inputMappings;
|
||||
|
||||
uint32_t idForMapping = vkId;
|
||||
SwapMappingIfEnabled(&idForMapping);
|
||||
|
@ -534,6 +534,7 @@ bool InputMappingsFromPspButton(int btn, std::vector<MultiInputMapping> *mapping
|
||||
return false;
|
||||
}
|
||||
bool mapped = false;
|
||||
mappings->clear();
|
||||
for (auto &iter2 : iter->second) {
|
||||
bool ignore = ignoreMouse && iter2.HasMouse();
|
||||
if (mappings && !ignore) {
|
||||
|
Loading…
Reference in New Issue
Block a user