mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-29 09:13:39 +01:00
Remove postprocessing option from desktop menu (doesn't support multi-shader)
This commit is contained in:
1 parent
509d04844b
commit
8bd6621c40
46 files changed
+3
-137
No files matched your search
@@ -154,68 +154,6 @@ namespace MainWindow {
|
||||
AppendMenu(helpMenu, MF_STRING | MF_BYCOMMAND, ID_HELP_ABOUT, aboutPPSSPP.c_str());
|
||||
}
|
||||
|
||||
void UpdateDynamicMenuCheckmarks(HMENU menu) {
|
||||
int item = ID_SHADERS_BASE + 1;
|
||||
|
||||
for (size_t i = 0; i < availableShaders.size(); i++) {
|
||||
bool checked = false;
|
||||
if (g_Config.vPostShaderNames.empty() && availableShaders[i] == "Off")
|
||||
checked = true;
|
||||
else if (g_Config.vPostShaderNames.size() == 1 && availableShaders[i] == g_Config.vPostShaderNames[0])
|
||||
checked = true;
|
||||
|
||||
CheckMenuItem(menu, item++, checked ? MF_CHECKED : MF_UNCHECKED);
|
||||
}
|
||||
}
|
||||
|
||||
bool CreateShadersSubmenu(HMENU menu) {
|
||||
// NOTE: We do not load this until translations are loaded!
|
||||
if (!I18NCategoryLoaded("PostShaders"))
|
||||
return false;
|
||||
|
||||
// We only reload this initially and when a menu is actually opened.
|
||||
if (!menuShaderInfoLoaded) {
|
||||
// This is on Windows where we don't currently blacklist any vendors, or similar.
|
||||
// TODO: Figure out how to have the GPU data while reloading the post shader info.
|
||||
ReloadAllPostShaderInfo(nullptr);
|
||||
menuShaderInfoLoaded = true;
|
||||
}
|
||||
|
||||
std::vector<ShaderInfo> info = GetAllPostShaderInfo();
|
||||
|
||||
if (menuShaderInfo.size() == info.size() && std::equal(info.begin(), info.end(), menuShaderInfo.begin())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto ps = GetI18NCategory("PostShaders");
|
||||
|
||||
HMENU shaderMenu = GetSubmenuById(menu, ID_OPTIONS_SHADER_MENU);
|
||||
EmptySubMenu(shaderMenu);
|
||||
|
||||
int item = ID_SHADERS_BASE + 1;
|
||||
const char *translatedShaderName = nullptr;
|
||||
|
||||
availableShaders.clear();
|
||||
for (auto i = info.begin(); i != info.end(); ++i) {
|
||||
if (!i->visible)
|
||||
continue;
|
||||
int checkedStatus = MF_UNCHECKED;
|
||||
availableShaders.push_back(i->section);
|
||||
if (g_Config.vPostShaderNames.empty() && i->section == "Off") {
|
||||
checkedStatus = MF_CHECKED;
|
||||
} else if (g_Config.vPostShaderNames.size() == 1 && g_Config.vPostShaderNames[0] == i->section) {
|
||||
checkedStatus = MF_CHECKED;
|
||||
}
|
||||
|
||||
translatedShaderName = ps->T(i->section.c_str(), i->name.c_str());
|
||||
|
||||
AppendMenu(shaderMenu, MF_STRING | MF_BYPOSITION | checkedStatus, item++, ConvertUTF8ToWString(translatedShaderName).c_str());
|
||||
}
|
||||
|
||||
menuShaderInfo = info;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void TranslateMenuItem(const HMENU hMenu, const int menuID, const std::wstring& accelerator = L"", const char *key = nullptr) {
|
||||
auto des = GetI18NCategory("DesktopUI");
|
||||
|
||||
@@ -302,7 +240,6 @@ namespace MainWindow {
|
||||
// Skip display multipliers x1-x10
|
||||
TranslateMenuItem(menu, ID_OPTIONS_FULLSCREEN, g_Config.bSystemControls ? L"\tAlt+Return, F11" : L"");
|
||||
TranslateMenuItem(menu, ID_OPTIONS_VSYNC);
|
||||
TranslateMenuItem(menu, ID_OPTIONS_SHADER_MENU);
|
||||
TranslateMenuItem(menu, ID_OPTIONS_SCREEN_MENU, g_Config.bSystemControls ? L"\tCtrl+1" : L"");
|
||||
TranslateMenuItem(menu, ID_OPTIONS_SCREENAUTO);
|
||||
// Skip rendering resolution 2x-5x..
|
||||
@@ -360,10 +297,6 @@ namespace MainWindow {
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (CreateShadersSubmenu(menu)) {
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
DrawMenuBar(hWnd);
|
||||
}
|
||||
@@ -1034,25 +967,8 @@ namespace MainWindow {
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
// Handle the dynamic shader switching here.
|
||||
// The Menu ID is contained in wParam, so subtract
|
||||
// ID_SHADERS_BASE and an additional 1 off it.
|
||||
u32 index = (wParam - ID_SHADERS_BASE - 1);
|
||||
if (index < availableShaders.size()) {
|
||||
g_Config.vPostShaderNames.clear();
|
||||
if (availableShaders[index] != "Off")
|
||||
g_Config.vPostShaderNames.push_back(availableShaders[index]);
|
||||
g_Config.bShaderChainRequires60FPS = PostShaderChainRequires60FPS(GetFullPostShadersChain(g_Config.vPostShaderNames));
|
||||
|
||||
NativeMessageReceived("gpu_renderResized", "");
|
||||
NativeMessageReceived("postshader_updated", "");
|
||||
break;
|
||||
}
|
||||
|
||||
MessageBox(hWnd, L"Unimplemented", L"Sorry", 0);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1329,7 +1245,6 @@ namespace MainWindow {
|
||||
EnableMenuItem(menu, ID_DEBUG_GEDEBUGGER, MF_GRAYED);
|
||||
#endif
|
||||
|
||||
UpdateDynamicMenuCheckmarks(menu);
|
||||
UpdateCommands();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user