GPU: Stop using Off as terminator for postshaders.

There's really no need to have a dummy entry at the end of the array.
This commit is contained in:
Unknown W. Brackets committed 2021-04-10 18:35:23 -07:00
1 parent 28065c1bc4
commit ca1a936d56
7 files changed
+55 -43

No files matched your search

+7 -2
View File
@@ -430,10 +430,11 @@ PostProcScreen::PostProcScreen(const std::string &title, int id) : ListPopupScre
shaders_ = GetAllPostShaderInfo();
std::vector<std::string> items;
int selected = -1;
const std::string selectedName = id_ >= g_Config.vPostShaderNames.size() ? "Off" : g_Config.vPostShaderNames[id_];
for (int i = 0; i < (int)shaders_.size(); i++) {
if (!shaders_[i].visible)
continue;
if (shaders_[i].section == g_Config.vPostShaderNames[id_])
if (shaders_[i].section == selectedName)
selected = i;
items.push_back(ps->T(shaders_[i].section.c_str(), shaders_[i].name.c_str()));
}
@@ -443,7 +444,11 @@ PostProcScreen::PostProcScreen(const std::string &title, int id) : ListPopupScre
void PostProcScreen::OnCompleted(DialogResult result) {
if (result != DR_OK)
return;
g_Config.vPostShaderNames[id_] = shaders_[listView_->GetSelected()].section;
const std::string &value = shaders_[listView_->GetSelected()].section;
if (id_ < g_Config.vPostShaderNames.size())
g_Config.vPostShaderNames[id_] = value;
else
g_Config.vPostShaderNames.push_back(value);
}
TextureShaderScreen::TextureShaderScreen(const std::string &title) : ListPopupScreen(title) {