mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Postshader: Work around a play-reported race condition (haven't figured out how to hit it, though).
This commit is contained in:
parent
9333a252ab
commit
f86b55c481
1 changed files with 11 additions and 3 deletions
|
@ -378,14 +378,22 @@ void DisplayLayoutScreen::CreateViews() {
|
||||||
|
|
||||||
auto removeButton = shaderRow->Add(new Choice(ImageID("I_TRASHCAN"), new LinearLayoutParams(0.0f)));
|
auto removeButton = shaderRow->Add(new Choice(ImageID("I_TRASHCAN"), new LinearLayoutParams(0.0f)));
|
||||||
removeButton->OnClick.Add([=](EventParams &e) -> UI::EventReturn {
|
removeButton->OnClick.Add([=](EventParams &e) -> UI::EventReturn {
|
||||||
g_Config.vPostShaderNames.erase(g_Config.vPostShaderNames.begin() + i);
|
if (i < g_Config.vPostShaderNames.size()) {
|
||||||
System_PostUIMessage(UIMessage::GPU_CONFIG_CHANGED);
|
// Protect against possible race conditions.
|
||||||
RecreateViews();
|
g_Config.vPostShaderNames.erase(g_Config.vPostShaderNames.begin() + i);
|
||||||
|
System_PostUIMessage(UIMessage::GPU_CONFIG_CHANGED);
|
||||||
|
RecreateViews();
|
||||||
|
}
|
||||||
return UI::EVENT_DONE;
|
return UI::EVENT_DONE;
|
||||||
});
|
});
|
||||||
|
|
||||||
auto moreButton = shaderRow->Add(new Choice(ImageID("I_THREE_DOTS"), new LinearLayoutParams(0.0f)));
|
auto moreButton = shaderRow->Add(new Choice(ImageID("I_THREE_DOTS"), new LinearLayoutParams(0.0f)));
|
||||||
moreButton->OnClick.Add([=](EventParams &e) -> UI::EventReturn {
|
moreButton->OnClick.Add([=](EventParams &e) -> UI::EventReturn {
|
||||||
|
if (i >= g_Config.vPostShaderNames.size()) {
|
||||||
|
// Protect against possible race conditions.
|
||||||
|
return UI::EVENT_DONE;
|
||||||
|
}
|
||||||
|
|
||||||
PopupContextMenuScreen *contextMenu = new UI::PopupContextMenuScreen(postShaderContextMenu, ARRAY_SIZE(postShaderContextMenu), I18NCat::DIALOG, moreButton);
|
PopupContextMenuScreen *contextMenu = new UI::PopupContextMenuScreen(postShaderContextMenu, ARRAY_SIZE(postShaderContextMenu), I18NCat::DIALOG, moreButton);
|
||||||
screenManager()->push(contextMenu);
|
screenManager()->push(contextMenu);
|
||||||
const ShaderInfo *info = GetPostShaderInfo(g_Config.vPostShaderNames[i]);
|
const ShaderInfo *info = GetPostShaderInfo(g_Config.vPostShaderNames[i]);
|
||||||
|
|
Loading…
Add table
Reference in a new issue