mirror of
https://github.com/izzy2lost/ppsspp.git
synced 2026-03-10 12:43:04 -07:00
Sort post-shaders alphabetically in the list.
This commit is contained in:
+16
-12
@@ -50,18 +50,6 @@ void LoadPostShaderInfo(Draw::DrawContext *draw, const std::vector<Path> &direct
|
||||
}
|
||||
|
||||
shaderInfo.clear();
|
||||
ShaderInfo off{};
|
||||
off.visible = true;
|
||||
off.name = "Off";
|
||||
off.section = "Off";
|
||||
for (size_t i = 0; i < ARRAY_SIZE(off.settings); ++i) {
|
||||
off.settings[i].name.clear();
|
||||
off.settings[i].value = 0.0f;
|
||||
off.settings[i].minValue = -1.0f;
|
||||
off.settings[i].maxValue = 1.0f;
|
||||
off.settings[i].step = 0.01f;
|
||||
}
|
||||
shaderInfo.push_back(off);
|
||||
|
||||
textureShaderInfo.clear();
|
||||
TextureShaderInfo textureOff{};
|
||||
@@ -231,6 +219,22 @@ void LoadPostShaderInfo(Draw::DrawContext *draw, const std::vector<Path> &direct
|
||||
}
|
||||
}
|
||||
|
||||
// Sort shaders alphabetically.
|
||||
std::sort(shaderInfo.begin(), shaderInfo.end());
|
||||
|
||||
ShaderInfo off{};
|
||||
off.visible = true;
|
||||
off.name = "Off";
|
||||
off.section = "Off";
|
||||
for (size_t i = 0; i < ARRAY_SIZE(off.settings); ++i) {
|
||||
off.settings[i].name.clear();
|
||||
off.settings[i].value = 0.0f;
|
||||
off.settings[i].minValue = -1.0f;
|
||||
off.settings[i].maxValue = 1.0f;
|
||||
off.settings[i].step = 0.01f;
|
||||
}
|
||||
shaderInfo.insert(shaderInfo.begin(), off);
|
||||
|
||||
// We always want the not visible ones at the end. Makes menus easier.
|
||||
for (const auto &info : notVisible) {
|
||||
appendShader(info);
|
||||
|
||||
@@ -66,6 +66,12 @@ struct ShaderInfo {
|
||||
bool operator == (const ShaderInfo &other) {
|
||||
return name == other.name;
|
||||
}
|
||||
|
||||
bool operator < (const ShaderInfo &other) {
|
||||
if (name < other.name) return true;
|
||||
if (name > other.name) return false;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
struct TextureShaderInfo {
|
||||
|
||||
Reference in New Issue
Block a user