mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-03 11:15:20 +02:00
Custom buttons: sanitize image/shape on the one screen that didn't
CustomButtonMappingScreen indexes customKeyImages[36] and customKeyShapes[11] with values read straight from the ini, and it's reachable from the main menu - so neither GamepadEmu nor TouchControlLayoutScreen, which both sanitize first, need have run. Those two had the same fixup copy-pasted; hoisted it into a Sanitize() next to the tables and called it from all three.
This commit is contained in:
@@ -537,12 +537,7 @@ void ControlLayoutView::CreateViews() {
|
||||
|
||||
for (int i = 0; i < TouchControlConfig::CUSTOM_BUTTON_COUNT; i++) {
|
||||
// Similar to GamepadEmu, we sanitize the images for valid values.
|
||||
if (g_Config.CustomButton[i].shape >= ARRAY_SIZE(CustomKeyData::customKeyShapes)) {
|
||||
g_Config.CustomButton[i].shape = 0;
|
||||
}
|
||||
if (g_Config.CustomButton[i].image >= ARRAY_SIZE(CustomKeyData::customKeyImages)) {
|
||||
g_Config.CustomButton[i].image = 0;
|
||||
}
|
||||
CustomKeyData::Sanitize(g_Config.CustomButton[i]);
|
||||
|
||||
char temp[64];
|
||||
snprintf(temp, sizeof(temp), "Custom %d button", i);
|
||||
|
||||
Reference in New Issue
Block a user