Skip to content

Commit

Permalink
UI: Allow postshaders on D3D9.
Browse files Browse the repository at this point in the history
Since they work now - at least, some of the shaders do.
  • Loading branch information
unknownbrackets committed May 14, 2020
1 parent cb94487 commit b6b0f11
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 22 deletions.
15 changes: 6 additions & 9 deletions UI/GameSettingsScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ void GameSettingsScreen::CreateViews() {
auto ms = GetI18NCategory("MainSettings");
auto dev = GetI18NCategory("Developer");
auto ri = GetI18NCategory("RemoteISO");
auto ps = GetI18NCategory("PostShaders");

root_ = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));

Expand Down Expand Up @@ -283,15 +284,11 @@ void GameSettingsScreen::CreateViews() {
altSpeed2->SetNegativeDisable(gr->T("Disabled"));

graphicsSettings->Add(new ItemHeader(gr->T("Features")));
// Hide postprocess option on unsupported backends to avoid confusion.
if (GetGPUBackend() != GPUBackend::DIRECT3D9) {
auto ps = GetI18NCategory("PostShaders");
postProcChoice_ = graphicsSettings->Add(new ChoiceWithValueDisplay(&g_Config.sPostShaderName, gr->T("Postprocessing Shader"), &PostShaderTranslateName));
postProcChoice_->OnClick.Handle(this, &GameSettingsScreen::OnPostProcShader);
postProcChoice_->SetEnabledFunc([] {
return !g_Config.bSoftwareRendering && g_Config.iRenderingMode != FB_NON_BUFFERED_MODE;
});
}
postProcChoice_ = graphicsSettings->Add(new ChoiceWithValueDisplay(&g_Config.sPostShaderName, gr->T("Postprocessing Shader"), &PostShaderTranslateName));
postProcChoice_->OnClick.Handle(this, &GameSettingsScreen::OnPostProcShader);
postProcChoice_->SetEnabledFunc([] {
return !g_Config.bSoftwareRendering && g_Config.iRenderingMode != FB_NON_BUFFERED_MODE;
});

#if !defined(MOBILE_DEVICE)
graphicsSettings->Add(new CheckBox(&g_Config.bFullScreen, gr->T("FullScreen", "Full Screen")))->OnClick.Handle(this, &GameSettingsScreen::OnFullscreenChange);
Expand Down
21 changes: 8 additions & 13 deletions Windows/MainWindowMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,21 +180,16 @@ namespace MainWindow {
const char *translatedShaderName = nullptr;

availableShaders.clear();
if (GetGPUBackend() == GPUBackend::DIRECT3D9) {
translatedShaderName = ps->T("Not available in Direct3D9 backend");
AppendMenu(shaderMenu, MF_STRING | MF_BYPOSITION | MF_GRAYED, item++, ConvertUTF8ToWString(translatedShaderName).c_str());
} else {
for (auto i = info.begin(); i != info.end(); ++i) {
int checkedStatus = MF_UNCHECKED;
availableShaders.push_back(i->section);
if (g_Config.sPostShaderName == i->section) {
checkedStatus = MF_CHECKED;
}
for (auto i = info.begin(); i != info.end(); ++i) {
int checkedStatus = MF_UNCHECKED;
availableShaders.push_back(i->section);
if (g_Config.sPostShaderName == i->section) {
checkedStatus = MF_CHECKED;
}

translatedShaderName = ps->T(i->section.c_str(), i->name.c_str());
translatedShaderName = ps->T(i->section.c_str(), i->name.c_str());

AppendMenu(shaderMenu, MF_STRING | MF_BYPOSITION | checkedStatus, item++, ConvertUTF8ToWString(translatedShaderName).c_str());
}
AppendMenu(shaderMenu, MF_STRING | MF_BYPOSITION | checkedStatus, item++, ConvertUTF8ToWString(translatedShaderName).c_str());
}

menuShaderInfo = info;
Expand Down

0 comments on commit b6b0f11

Please sign in to comment.