2010-04-25 00:31:27 +00:00
|
|
|
/*
|
2015-05-26 13:36:47 +00:00
|
|
|
* Copyright (C) 2007-2015 Gabest
|
2009-02-09 21:15:56 +00:00
|
|
|
* http://www.gabest.org
|
|
|
|
*
|
|
|
|
* This Program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
* any later version.
|
2010-04-25 00:31:27 +00:00
|
|
|
*
|
2009-02-09 21:15:56 +00:00
|
|
|
* This Program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2010-04-25 00:31:27 +00:00
|
|
|
*
|
2009-02-09 21:15:56 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with GNU Make; see the file COPYING. If not, write to
|
2012-09-09 18:16:11 +00:00
|
|
|
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA USA.
|
2009-02-09 21:15:56 +00:00
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
|
#include "GSdx.h"
|
|
|
|
#include "GSSettingsDlg.h"
|
|
|
|
#include "GSUtil.h"
|
2018-11-16 18:41:37 +00:00
|
|
|
#include "Renderers/DX11/GSDevice11.h"
|
2011-02-19 03:36:30 +00:00
|
|
|
#include "resource.h"
|
2015-04-16 17:20:17 +00:00
|
|
|
#include "GSSetting.h"
|
2018-08-22 16:53:15 +00:00
|
|
|
#include <algorithm>
|
2015-07-13 05:41:48 +00:00
|
|
|
|
|
|
|
GSSettingsDlg::GSSettingsDlg()
|
2016-05-01 23:00:00 +00:00
|
|
|
: GSDialog(IDD_CONFIG)
|
2018-08-22 16:53:15 +00:00
|
|
|
, m_renderers{theApp.m_gs_renderers}
|
|
|
|
, m_d3d11_adapters{EnumerateD3D11Adapters()}
|
|
|
|
, m_current_adapters{nullptr}
|
|
|
|
, m_last_selected_adapter_id{theApp.GetConfigS("Adapter")}
|
2009-02-09 21:15:56 +00:00
|
|
|
{
|
2018-08-22 16:53:15 +00:00
|
|
|
if (m_d3d11_adapters.empty())
|
|
|
|
{
|
|
|
|
auto is_d3d11_renderer = [](const auto &renderer) {
|
|
|
|
const GSRendererType type = static_cast<GSRendererType>(renderer.value);
|
|
|
|
return type == GSRendererType::DX1011_HW || type == GSRendererType::DX1011_SW || type == GSRendererType::DX1011_OpenCL;
|
|
|
|
};
|
|
|
|
m_renderers.erase(std::remove_if(m_renderers.begin(), m_renderers.end(), is_d3d11_renderer), m_renderers.end());
|
|
|
|
}
|
2018-08-22 16:53:03 +00:00
|
|
|
|
2014-12-22 18:02:35 +00:00
|
|
|
#ifdef ENABLE_OPENCL
|
2017-05-26 16:07:00 +00:00
|
|
|
std::list<OCLDeviceDesc> ocldevs;
|
2014-09-22 03:29:40 +00:00
|
|
|
|
2014-09-22 07:15:25 +00:00
|
|
|
GSUtil::GetDeviceDescs(ocldevs);
|
2014-09-22 03:29:40 +00:00
|
|
|
|
|
|
|
int index = 0;
|
|
|
|
|
|
|
|
for(auto dev : ocldevs)
|
|
|
|
{
|
|
|
|
m_ocl_devs.push_back(GSSetting(index++, dev.name.c_str(), ""));
|
|
|
|
}
|
2014-12-22 18:02:35 +00:00
|
|
|
#endif
|
2009-02-09 21:15:56 +00:00
|
|
|
}
|
2011-02-20 16:09:46 +00:00
|
|
|
|
2018-08-22 16:53:03 +00:00
|
|
|
std::vector<GSSettingsDlg::Adapter> GSSettingsDlg::EnumerateD3D11Adapters()
|
2009-02-09 21:15:56 +00:00
|
|
|
{
|
2018-08-22 16:53:03 +00:00
|
|
|
CComPtr<IDXGIFactory1> dxgi_factory;
|
|
|
|
CreateDXGIFactory1(IID_PPV_ARGS(&dxgi_factory));
|
|
|
|
if (dxgi_factory == nullptr)
|
|
|
|
return {};
|
2014-09-22 00:50:51 +00:00
|
|
|
|
2018-08-22 16:53:03 +00:00
|
|
|
std::vector<Adapter> adapters {
|
|
|
|
{"Default Hardware Device", "default", GSUtil::CheckDirect3D11Level(nullptr, D3D_DRIVER_TYPE_HARDWARE)},
|
2019-06-16 19:25:25 +00:00
|
|
|
#ifdef _DEBUG
|
2018-08-22 16:53:03 +00:00
|
|
|
{"Reference Device", "ref", GSUtil::CheckDirect3D11Level(nullptr, D3D_DRIVER_TYPE_REFERENCE)},
|
2019-06-16 19:25:25 +00:00
|
|
|
#endif
|
2018-08-22 16:53:03 +00:00
|
|
|
};
|
2012-08-06 05:26:44 +00:00
|
|
|
|
2018-08-22 16:53:03 +00:00
|
|
|
CComPtr<IDXGIAdapter1> adapter;
|
|
|
|
for (int i = 0; dxgi_factory->EnumAdapters1(i, &adapter) == S_OK; ++i, adapter = nullptr)
|
2014-09-22 00:50:51 +00:00
|
|
|
{
|
2018-08-22 16:53:03 +00:00
|
|
|
DXGI_ADAPTER_DESC1 desc;
|
|
|
|
if (adapter->GetDesc1(&desc) != S_OK)
|
|
|
|
continue;
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2018-08-22 16:53:03 +00:00
|
|
|
D3D_FEATURE_LEVEL level = GSUtil::CheckDirect3D11Level(adapter, D3D_DRIVER_TYPE_UNKNOWN);
|
2014-09-22 00:50:51 +00:00
|
|
|
|
2018-08-22 16:53:03 +00:00
|
|
|
int size = WideCharToMultiByte(CP_ACP, 0, desc.Description, sizeof(desc.Description), nullptr, 0, nullptr, nullptr);
|
|
|
|
std::vector<char> buf(size);
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, desc.Description, sizeof(desc.Description), buf.data(), size, nullptr, nullptr);
|
|
|
|
adapters.push_back({buf.data(), GSAdapter(desc), level});
|
|
|
|
}
|
2018-08-22 16:53:15 +00:00
|
|
|
|
|
|
|
auto unsupported_adapter = [](const auto &adapter) { return adapter.level < D3D_FEATURE_LEVEL_10_0; };
|
|
|
|
adapters.erase(std::remove_if(adapters.begin(), adapters.end(), unsupported_adapter), adapters.end());
|
|
|
|
|
2018-08-22 16:53:03 +00:00
|
|
|
return adapters;
|
|
|
|
}
|
2014-09-22 00:50:51 +00:00
|
|
|
|
2018-08-22 16:53:03 +00:00
|
|
|
void GSSettingsDlg::OnInit()
|
|
|
|
{
|
|
|
|
__super::OnInit();
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2018-08-22 16:53:15 +00:00
|
|
|
GSRendererType renderer = GSRendererType(theApp.GetConfigI("Renderer"));
|
|
|
|
const bool dx11 = renderer == GSRendererType::DX1011_HW || renderer == GSRendererType::DX1011_SW || renderer == GSRendererType::DX1011_OpenCL;
|
|
|
|
if (renderer == GSRendererType::Undefined || m_d3d11_adapters.empty() && dx11)
|
|
|
|
renderer = GSUtil::GetBestRenderer();
|
|
|
|
ComboBoxInit(IDC_RENDERER, m_renderers, static_cast<int32_t>(renderer));
|
|
|
|
UpdateAdapters();
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2016-05-24 19:52:06 +00:00
|
|
|
std::string ocldev = theApp.GetConfigS("ocldev");
|
2014-09-22 00:50:51 +00:00
|
|
|
|
|
|
|
unsigned int ocl_sel = 0;
|
|
|
|
|
2014-09-22 03:29:40 +00:00
|
|
|
for(unsigned int i = 0; i < m_ocl_devs.size(); i++)
|
2014-09-22 00:50:51 +00:00
|
|
|
{
|
2014-09-22 03:29:40 +00:00
|
|
|
if(ocldev == m_ocl_devs[i].name)
|
2014-09-22 00:50:51 +00:00
|
|
|
{
|
|
|
|
ocl_sel = i;
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-22 03:29:40 +00:00
|
|
|
ComboBoxInit(IDC_OPENCL_DEVICE, m_ocl_devs, ocl_sel);
|
2016-11-05 16:49:17 +00:00
|
|
|
ComboBoxInit(IDC_MIPMAP_HW, theApp.m_gs_hw_mipmapping, theApp.GetConfigI("mipmap_hw"));
|
2015-08-09 08:56:05 +00:00
|
|
|
|
2016-05-30 07:29:41 +00:00
|
|
|
ComboBoxInit(IDC_INTERLACE, theApp.m_gs_interlace, theApp.GetConfigI("interlace"));
|
2016-05-24 19:52:06 +00:00
|
|
|
ComboBoxInit(IDC_UPSCALE_MULTIPLIER, theApp.m_gs_upscale_multiplier, theApp.GetConfigI("upscale_multiplier"));
|
|
|
|
ComboBoxInit(IDC_AFCOMBO, theApp.m_gs_max_anisotropy, theApp.GetConfigI("MaxAnisotropy"));
|
2017-02-24 16:55:39 +00:00
|
|
|
ComboBoxInit(IDC_FILTER, theApp.m_gs_bifilter, theApp.GetConfigI("filter"));
|
2018-11-27 08:31:24 +00:00
|
|
|
ComboBoxInit(IDC_ACCURATE_DATE, theApp.m_gs_acc_date_level, theApp.GetConfigI("accurate_date"));
|
2016-05-24 19:52:06 +00:00
|
|
|
ComboBoxInit(IDC_ACCURATE_BLEND_UNIT, theApp.m_gs_acc_blend_level, theApp.GetConfigI("accurate_blending_unit"));
|
2019-04-22 21:23:32 +00:00
|
|
|
ComboBoxInit(IDC_ACCURATE_BLEND_UNIT_D3D11, theApp.m_gs_acc_blend_level_d3d11, theApp.GetConfigI("accurate_blending_unit_d3d11"));
|
2016-05-24 19:52:06 +00:00
|
|
|
ComboBoxInit(IDC_CRC_LEVEL, theApp.m_gs_crc_level, theApp.GetConfigI("crc_hack_level"));
|
|
|
|
|
|
|
|
CheckDlgButton(m_hWnd, IDC_PALTEX, theApp.GetConfigB("paltex"));
|
|
|
|
CheckDlgButton(m_hWnd, IDC_LARGE_FB, theApp.GetConfigB("large_framebuffer"));
|
2016-11-05 16:49:17 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_MIPMAP_SW, theApp.GetConfigB("mipmap"));
|
2016-05-24 19:52:06 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_AA1, theApp.GetConfigB("aa1"));
|
2019-04-30 23:28:28 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_AUTO_FLUSH_SW, theApp.GetConfigB("autoflush_sw"));
|
2016-05-24 19:52:06 +00:00
|
|
|
|
2012-03-06 19:39:05 +00:00
|
|
|
// Hacks
|
2016-05-24 19:52:06 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_HACKS_ENABLED, theApp.GetConfigB("UserHacks"));
|
2010-04-25 00:31:27 +00:00
|
|
|
|
2011-12-20 14:33:28 +00:00
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_SWTHREADS), UDM_SETRANGE, 0, MAKELPARAM(16, 0));
|
2016-05-24 19:52:06 +00:00
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_SWTHREADS), UDM_SETPOS, 0, MAKELPARAM(theApp.GetConfigI("extrathreads"), 0));
|
2009-06-04 08:32:31 +00:00
|
|
|
|
2015-08-08 18:16:13 +00:00
|
|
|
AddTooltip(IDC_FILTER);
|
|
|
|
AddTooltip(IDC_CRC_LEVEL);
|
|
|
|
AddTooltip(IDC_PALTEX);
|
|
|
|
AddTooltip(IDC_ACCURATE_DATE);
|
|
|
|
AddTooltip(IDC_ACCURATE_BLEND_UNIT);
|
2019-04-22 21:23:32 +00:00
|
|
|
AddTooltip(IDC_ACCURATE_BLEND_UNIT_D3D11);
|
gsdx: Add new tooltips and descriptions.
For Linux and Windows, add tooltip descriptions for AF, AA1, extra
rendering threads, Enable Shade Boost, FX Shader/External Shader, FXAA.
For Windows, also add Alpha Correction and Logarithmic Z tooltips.
For Linux, add software mipmap tooltip.
Thanks to tsunami2311, ssakash, gregory38 and whoever did the wiki for
helping with descriptions.
2015-08-26 22:22:36 +00:00
|
|
|
AddTooltip(IDC_AFCOMBO);
|
|
|
|
AddTooltip(IDC_AA1);
|
2016-11-05 16:49:17 +00:00
|
|
|
AddTooltip(IDC_MIPMAP_HW);
|
|
|
|
AddTooltip(IDC_MIPMAP_SW);
|
gsdx: Add new tooltips and descriptions.
For Linux and Windows, add tooltip descriptions for AF, AA1, extra
rendering threads, Enable Shade Boost, FX Shader/External Shader, FXAA.
For Windows, also add Alpha Correction and Logarithmic Z tooltips.
For Linux, add software mipmap tooltip.
Thanks to tsunami2311, ssakash, gregory38 and whoever did the wiki for
helping with descriptions.
2015-08-26 22:22:36 +00:00
|
|
|
AddTooltip(IDC_SWTHREADS);
|
|
|
|
AddTooltip(IDC_SWTHREADS_EDIT);
|
2019-04-30 23:28:28 +00:00
|
|
|
AddTooltip(IDC_AUTO_FLUSH_SW);
|
2016-05-25 16:33:32 +00:00
|
|
|
AddTooltip(IDC_LARGE_FB);
|
2015-08-08 18:16:13 +00:00
|
|
|
|
2009-06-04 08:32:31 +00:00
|
|
|
UpdateControls();
|
2009-02-09 21:15:56 +00:00
|
|
|
}
|
|
|
|
|
2009-06-03 12:09:04 +00:00
|
|
|
bool GSSettingsDlg::OnCommand(HWND hWnd, UINT id, UINT code)
|
2009-02-09 21:15:56 +00:00
|
|
|
{
|
2012-08-06 05:26:44 +00:00
|
|
|
switch (id)
|
2009-02-09 21:15:56 +00:00
|
|
|
{
|
2012-08-06 05:26:44 +00:00
|
|
|
case IDC_ADAPTER:
|
|
|
|
if (code == CBN_SELCHANGE)
|
|
|
|
{
|
2018-08-22 16:53:15 +00:00
|
|
|
INT_PTR data;
|
|
|
|
if (ComboBoxGetSelData(IDC_ADAPTER, data))
|
|
|
|
m_last_selected_adapter_id = (*m_current_adapters)[data].id;
|
2012-08-06 05:26:44 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case IDC_RENDERER:
|
2016-10-14 13:45:58 +00:00
|
|
|
if (code == CBN_SELCHANGE)
|
|
|
|
{
|
2018-08-22 16:53:15 +00:00
|
|
|
UpdateAdapters();
|
2016-10-14 13:45:58 +00:00
|
|
|
UpdateControls();
|
|
|
|
}
|
|
|
|
break;
|
2012-08-06 05:26:44 +00:00
|
|
|
case IDC_UPSCALE_MULTIPLIER:
|
2015-08-09 08:56:05 +00:00
|
|
|
case IDC_FILTER:
|
2012-08-06 05:26:44 +00:00
|
|
|
if (code == CBN_SELCHANGE)
|
|
|
|
UpdateControls();
|
|
|
|
break;
|
2015-08-13 07:12:12 +00:00
|
|
|
case IDC_PALTEX:
|
2012-08-06 05:26:44 +00:00
|
|
|
case IDC_HACKS_ENABLED:
|
|
|
|
if (code == BN_CLICKED)
|
|
|
|
UpdateControls();
|
|
|
|
break;
|
|
|
|
case IDC_SHADEBUTTON:
|
|
|
|
if (code == BN_CLICKED)
|
2018-08-22 23:26:59 +00:00
|
|
|
GSShaderDlg().DoModal();
|
2012-08-06 05:26:44 +00:00
|
|
|
break;
|
2017-01-06 15:40:31 +00:00
|
|
|
case IDC_OSDBUTTON:
|
|
|
|
if (code == BN_CLICKED)
|
2018-08-22 23:26:59 +00:00
|
|
|
GSOSDDlg().DoModal();
|
2017-01-06 15:40:31 +00:00
|
|
|
break;
|
2012-08-06 05:26:44 +00:00
|
|
|
case IDC_HACKSBUTTON:
|
|
|
|
if (code == BN_CLICKED)
|
2018-08-22 23:26:59 +00:00
|
|
|
{
|
|
|
|
INT_PTR data;
|
|
|
|
std::string adapter_id;
|
|
|
|
if (ComboBoxGetSelData(IDC_ADAPTER, data))
|
2018-08-22 16:53:15 +00:00
|
|
|
adapter_id = (*m_current_adapters)[data].id;
|
2019-06-17 07:31:16 +00:00
|
|
|
GSHacksDlg().DoModal();
|
2018-08-22 23:26:59 +00:00
|
|
|
}
|
2012-08-06 05:26:44 +00:00
|
|
|
break;
|
|
|
|
case IDOK:
|
2009-06-03 12:09:04 +00:00
|
|
|
{
|
2012-08-06 05:26:44 +00:00
|
|
|
INT_PTR data;
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
if(ComboBoxGetSelData(IDC_ADAPTER, data))
|
|
|
|
{
|
2018-08-22 16:53:15 +00:00
|
|
|
theApp.SetConfig("Adapter", (*m_current_adapters)[data].id.c_str());
|
2012-08-06 05:26:44 +00:00
|
|
|
}
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2014-09-22 00:50:51 +00:00
|
|
|
if(ComboBoxGetSelData(IDC_OPENCL_DEVICE, data))
|
|
|
|
{
|
2016-04-14 10:00:58 +00:00
|
|
|
if ((UINT)data < m_ocl_devs.size()) {
|
2015-01-16 08:38:23 +00:00
|
|
|
theApp.SetConfig("ocldev", m_ocl_devs[(int)data].name.c_str());
|
|
|
|
}
|
2014-09-22 00:50:51 +00:00
|
|
|
}
|
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
if(ComboBoxGetSelData(IDC_RENDERER, data))
|
|
|
|
{
|
|
|
|
theApp.SetConfig("Renderer", (int)data);
|
|
|
|
}
|
2010-04-25 00:31:27 +00:00
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
if(ComboBoxGetSelData(IDC_INTERLACE, data))
|
|
|
|
{
|
2016-05-30 07:29:41 +00:00
|
|
|
theApp.SetConfig("interlace", (int)data);
|
2012-08-06 05:26:44 +00:00
|
|
|
}
|
2010-04-25 00:31:27 +00:00
|
|
|
|
2016-11-05 16:49:17 +00:00
|
|
|
if (ComboBoxGetSelData(IDC_MIPMAP_HW, data))
|
|
|
|
{
|
|
|
|
theApp.SetConfig("mipmap_hw", (int)data);
|
|
|
|
}
|
|
|
|
|
2012-08-06 05:26:44 +00:00
|
|
|
if(ComboBoxGetSelData(IDC_UPSCALE_MULTIPLIER, data))
|
|
|
|
{
|
|
|
|
theApp.SetConfig("upscale_multiplier", (int)data);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
theApp.SetConfig("upscale_multiplier", 1);
|
|
|
|
}
|
2015-08-09 08:56:05 +00:00
|
|
|
|
|
|
|
if (ComboBoxGetSelData(IDC_FILTER, data))
|
|
|
|
{
|
|
|
|
theApp.SetConfig("filter", (int)data);
|
|
|
|
}
|
|
|
|
|
2018-11-27 08:31:24 +00:00
|
|
|
if(ComboBoxGetSelData(IDC_ACCURATE_DATE, data))
|
|
|
|
{
|
|
|
|
theApp.SetConfig("accurate_date", (int)data);
|
|
|
|
}
|
|
|
|
|
2015-08-08 18:01:02 +00:00
|
|
|
if(ComboBoxGetSelData(IDC_ACCURATE_BLEND_UNIT, data))
|
|
|
|
{
|
|
|
|
theApp.SetConfig("accurate_blending_unit", (int)data);
|
|
|
|
}
|
|
|
|
|
2019-04-22 21:23:32 +00:00
|
|
|
if(ComboBoxGetSelData(IDC_ACCURATE_BLEND_UNIT_D3D11, data))
|
|
|
|
{
|
|
|
|
theApp.SetConfig("accurate_blending_unit_d3d11", (int)data);
|
|
|
|
}
|
|
|
|
|
2015-08-08 18:01:02 +00:00
|
|
|
if (ComboBoxGetSelData(IDC_CRC_LEVEL, data))
|
|
|
|
{
|
|
|
|
theApp.SetConfig("crc_hack_level", (int)data);
|
|
|
|
}
|
|
|
|
|
2014-09-22 00:50:51 +00:00
|
|
|
if(ComboBoxGetSelData(IDC_AFCOMBO, data))
|
2014-02-03 16:58:11 +00:00
|
|
|
{
|
|
|
|
theApp.SetConfig("MaxAnisotropy", (int)data);
|
|
|
|
}
|
|
|
|
|
2016-11-05 16:49:17 +00:00
|
|
|
theApp.SetConfig("mipmap", (int)IsDlgButtonChecked(m_hWnd, IDC_MIPMAP_SW));
|
2012-08-06 05:26:44 +00:00
|
|
|
theApp.SetConfig("paltex", (int)IsDlgButtonChecked(m_hWnd, IDC_PALTEX));
|
2016-05-25 16:33:32 +00:00
|
|
|
theApp.SetConfig("large_framebuffer", (int)IsDlgButtonChecked(m_hWnd, IDC_LARGE_FB));
|
2012-08-06 05:26:44 +00:00
|
|
|
theApp.SetConfig("aa1", (int)IsDlgButtonChecked(m_hWnd, IDC_AA1));
|
2019-04-30 23:28:28 +00:00
|
|
|
theApp.SetConfig("autoflush_sw", (int)IsDlgButtonChecked(m_hWnd, IDC_AUTO_FLUSH_SW));
|
2012-08-06 05:26:44 +00:00
|
|
|
theApp.SetConfig("UserHacks", (int)IsDlgButtonChecked(m_hWnd, IDC_HACKS_ENABLED));
|
2016-07-03 21:04:16 +00:00
|
|
|
|
|
|
|
// The LOWORD returned by UDM_GETPOS automatically restricts the value to its input range.
|
|
|
|
theApp.SetConfig("extrathreads", LOWORD(SendMessage(GetDlgItem(m_hWnd, IDC_SWTHREADS), UDM_GETPOS, 0, 0)));
|
2012-08-06 05:26:44 +00:00
|
|
|
}
|
|
|
|
break;
|
2009-06-03 12:09:04 +00:00
|
|
|
}
|
2009-02-09 21:15:56 +00:00
|
|
|
|
2009-06-03 12:09:04 +00:00
|
|
|
return __super::OnCommand(hWnd, id, code);
|
2009-02-09 21:15:56 +00:00
|
|
|
}
|
|
|
|
|
2018-08-22 16:53:15 +00:00
|
|
|
void GSSettingsDlg::UpdateAdapters()
|
2012-08-06 05:26:44 +00:00
|
|
|
{
|
2018-08-22 16:53:15 +00:00
|
|
|
INT_PTR data;
|
|
|
|
if (!ComboBoxGetSelData(IDC_RENDERER, data))
|
2012-08-06 05:26:44 +00:00
|
|
|
return;
|
|
|
|
|
2018-08-22 16:53:15 +00:00
|
|
|
const GSRendererType renderer = static_cast<GSRendererType>(data);
|
|
|
|
const bool dx11 = renderer == GSRendererType::DX1011_HW || renderer == GSRendererType::DX1011_SW || renderer == GSRendererType::DX1011_OpenCL;
|
2012-08-06 05:26:44 +00:00
|
|
|
|
2019-01-02 02:11:47 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_ADAPTER), dx11);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_ADAPTER_TEXT), dx11);
|
2012-08-06 05:26:44 +00:00
|
|
|
|
2019-01-02 02:11:47 +00:00
|
|
|
if (!dx11)
|
2016-05-01 16:33:53 +00:00
|
|
|
{
|
2018-08-22 16:53:15 +00:00
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_ADAPTER), CB_RESETCONTENT, 0, 0);
|
|
|
|
return;
|
2016-05-01 16:33:53 +00:00
|
|
|
}
|
2016-01-02 22:20:30 +00:00
|
|
|
|
2018-12-21 14:23:38 +00:00
|
|
|
m_current_adapters = &m_d3d11_adapters;
|
2012-08-06 05:26:44 +00:00
|
|
|
|
2018-08-22 16:53:15 +00:00
|
|
|
std::vector<GSSetting> adapter_settings;
|
|
|
|
unsigned int adapter_sel = 0;
|
|
|
|
for (unsigned int i = 0; i < m_current_adapters->size(); i++)
|
2012-08-06 05:26:44 +00:00
|
|
|
{
|
2018-08-22 16:53:15 +00:00
|
|
|
if ((*m_current_adapters)[i].id == m_last_selected_adapter_id)
|
|
|
|
adapter_sel = i;
|
2014-09-15 13:49:16 +00:00
|
|
|
|
2018-08-22 16:53:15 +00:00
|
|
|
adapter_settings.push_back(GSSetting{i, (*m_current_adapters)[i].name.c_str(), ""});
|
2012-08-06 05:26:44 +00:00
|
|
|
}
|
|
|
|
|
2018-08-22 16:53:15 +00:00
|
|
|
ComboBoxInit(IDC_ADAPTER, adapter_settings, adapter_sel);
|
2012-08-06 05:26:44 +00:00
|
|
|
}
|
|
|
|
|
2009-06-04 08:32:31 +00:00
|
|
|
void GSSettingsDlg::UpdateControls()
|
|
|
|
{
|
|
|
|
INT_PTR i;
|
|
|
|
|
2015-09-21 20:26:00 +00:00
|
|
|
int integer_scaling = 0; // in case reading the combo doesn't work, enable the custom res control anyway
|
2011-02-12 21:45:16 +00:00
|
|
|
|
|
|
|
if(ComboBoxGetSelData(IDC_UPSCALE_MULTIPLIER, i))
|
|
|
|
{
|
2015-09-21 20:26:00 +00:00
|
|
|
integer_scaling = (int)i;
|
2011-01-02 10:24:36 +00:00
|
|
|
}
|
|
|
|
|
2009-06-19 00:11:56 +00:00
|
|
|
if(ComboBoxGetSelData(IDC_RENDERER, i))
|
2009-06-04 08:32:31 +00:00
|
|
|
{
|
2015-10-26 21:30:34 +00:00
|
|
|
GSRendererType renderer = static_cast<GSRendererType>(i);
|
|
|
|
|
2016-05-01 16:33:53 +00:00
|
|
|
bool dx11 = renderer == GSRendererType::DX1011_HW || renderer == GSRendererType::DX1011_SW || renderer == GSRendererType::DX1011_OpenCL;
|
2015-10-26 21:30:34 +00:00
|
|
|
bool ogl = renderer == GSRendererType::OGL_HW || renderer == GSRendererType::OGL_SW || renderer == GSRendererType::OGL_OpenCL;
|
2014-09-22 00:50:51 +00:00
|
|
|
|
2018-12-19 23:54:51 +00:00
|
|
|
bool hw = renderer == GSRendererType::DX1011_HW || renderer == GSRendererType::OGL_HW;
|
|
|
|
bool sw = renderer == GSRendererType::DX1011_SW || renderer == GSRendererType::OGL_SW;
|
|
|
|
bool ocl = renderer == GSRendererType::DX1011_OpenCL || renderer == GSRendererType::OGL_OpenCL;
|
2016-05-01 16:33:53 +00:00
|
|
|
bool null = renderer == GSRendererType::Null;
|
2009-06-04 08:32:31 +00:00
|
|
|
|
2018-08-22 16:53:09 +00:00
|
|
|
ShowWindow(GetDlgItem(m_hWnd, IDC_LOGO11), dx11 ? SW_SHOW : SW_HIDE);
|
2016-05-01 16:33:53 +00:00
|
|
|
ShowWindow(GetDlgItem(m_hWnd, IDC_NULL), null ? SW_SHOW : SW_HIDE);
|
2015-05-19 15:23:58 +00:00
|
|
|
ShowWindow(GetDlgItem(m_hWnd, IDC_LOGOGL), ogl ? SW_SHOW : SW_HIDE);
|
2019-03-12 00:49:48 +00:00
|
|
|
|
2015-12-21 20:28:44 +00:00
|
|
|
#ifndef ENABLE_OPENCL
|
|
|
|
ShowWindow(GetDlgItem(m_hWnd, IDC_OPENCL_TEXT), SW_HIDE);
|
2019-03-12 00:49:48 +00:00
|
|
|
ShowWindow(GetDlgItem(m_hWnd, IDC_OPENCL_DEVICE), SW_HIDE);
|
2015-12-21 20:28:44 +00:00
|
|
|
#endif
|
2019-03-12 00:49:48 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OPENCL_TEXT), ocl);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OPENCL_DEVICE), ocl);
|
2018-08-29 00:12:00 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_INTERLACE), !null);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_INTERLACE_TEXT), !null);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_FILTER), !null);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_FILTER_TEXT), !null);
|
2015-08-09 08:56:05 +00:00
|
|
|
|
|
|
|
|
2016-11-05 16:49:17 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_MIPMAP_HW), hw);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_MIPMAP_HW_TEXT), hw);
|
2015-08-09 08:56:05 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_CRC_LEVEL), hw);
|
2018-09-27 10:11:52 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_LARGE_FB), integer_scaling > 1 && hw);
|
2015-08-09 08:56:05 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_CRC_LEVEL_TEXT), hw);
|
2015-09-08 12:55:01 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_UPSCALE_MULTIPLIER), hw);
|
2015-09-27 22:12:52 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_UPSCALE_MULTIPLIER_TEXT), hw);
|
2009-07-06 16:35:06 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_PALTEX), hw);
|
2015-08-09 08:56:05 +00:00
|
|
|
|
|
|
|
INT_PTR filter;
|
|
|
|
if (ComboBoxGetSelData(IDC_FILTER, filter))
|
|
|
|
{
|
2018-08-24 11:12:26 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_AFCOMBO), hw && filter && (ogl || !IsDlgButtonChecked(m_hWnd, IDC_PALTEX)));
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_AFCOMBO_TEXT), hw && filter && (ogl || !IsDlgButtonChecked(m_hWnd, IDC_PALTEX)));
|
2015-08-09 08:56:05 +00:00
|
|
|
}
|
2018-11-28 19:33:15 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_ACCURATE_DATE), hw);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_ACCURATE_DATE_TEXT), hw);
|
2019-04-17 19:30:16 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_ACCURATE_BLEND_UNIT), hw);
|
2019-04-22 21:23:32 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_ACCURATE_BLEND_UNIT_D3D11), hw);
|
2019-04-17 19:30:16 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_ACCURATE_BLEND_UNIT_TEXT), hw);
|
2019-04-22 21:23:32 +00:00
|
|
|
ShowWindow(GetDlgItem(m_hWnd, IDC_ACCURATE_BLEND_UNIT), ogl ? SW_SHOW : SW_HIDE);
|
2019-07-14 23:49:10 +00:00
|
|
|
ShowWindow(GetDlgItem(m_hWnd, IDC_ACCURATE_BLEND_UNIT_D3D11), dx11 || null ? SW_SHOW : SW_HIDE);
|
2016-05-01 23:00:00 +00:00
|
|
|
|
2015-12-23 06:52:01 +00:00
|
|
|
// Software mode settings
|
2016-11-05 16:49:17 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_MIPMAP_SW), sw);
|
2015-12-23 06:52:01 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_AA1), sw);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_SWTHREADS_TEXT), sw);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_SWTHREADS_EDIT), sw);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_SWTHREADS), sw);
|
2019-04-30 23:28:28 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_AUTO_FLUSH_SW), sw);
|
2012-03-06 19:39:05 +00:00
|
|
|
|
|
|
|
// Hacks
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_HACKS_ENABLED), hw);
|
2019-03-05 22:05:06 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_HACKSBUTTON), hw && (ogl || IsDlgButtonChecked(m_hWnd, IDC_HACKS_ENABLED)));
|
2017-08-30 22:57:15 +00:00
|
|
|
|
|
|
|
// OSD Configuration
|
2018-12-12 06:00:00 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OSDBUTTON), !null);
|
2017-08-30 22:57:15 +00:00
|
|
|
|
|
|
|
// Shader Configuration
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_SHADEBUTTON), !null);
|
2009-06-04 08:32:31 +00:00
|
|
|
}
|
2015-09-21 21:32:11 +00:00
|
|
|
|
2009-06-16 01:42:08 +00:00
|
|
|
}
|
2012-02-29 00:29:29 +00:00
|
|
|
|
2015-11-21 15:51:09 +00:00
|
|
|
// Shader Configuration Dialog
|
2012-02-29 00:29:29 +00:00
|
|
|
|
2015-11-21 15:51:09 +00:00
|
|
|
GSShaderDlg::GSShaderDlg() :
|
|
|
|
GSDialog(IDD_SHADER)
|
2012-02-29 00:29:29 +00:00
|
|
|
{}
|
|
|
|
|
2015-11-21 15:51:09 +00:00
|
|
|
void GSShaderDlg::OnInit()
|
2012-02-29 00:29:29 +00:00
|
|
|
{
|
2015-11-21 15:51:09 +00:00
|
|
|
//TV Shader
|
2016-05-31 17:35:35 +00:00
|
|
|
ComboBoxInit(IDC_TVSHADER, theApp.m_gs_tv_shaders, theApp.GetConfigI("TVShader"));
|
2015-11-21 15:51:09 +00:00
|
|
|
|
|
|
|
//Shade Boost
|
2016-05-24 19:52:06 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_SHADEBOOST, theApp.GetConfigB("ShadeBoost"));
|
2017-01-06 15:43:08 +00:00
|
|
|
m_contrast = theApp.GetConfigI("ShadeBoost_Contrast");
|
|
|
|
m_brightness = theApp.GetConfigI("ShadeBoost_Brightness");
|
|
|
|
m_saturation = theApp.GetConfigI("ShadeBoost_Saturation");
|
2012-02-29 00:29:29 +00:00
|
|
|
|
2015-11-21 15:51:09 +00:00
|
|
|
// External FX shader
|
2016-05-24 19:52:06 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_SHADER_FX, theApp.GetConfigB("shaderfx"));
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_SHADER_FX_EDIT), WM_SETTEXT, 0, (LPARAM)theApp.GetConfigS("shaderfx_glsl").c_str());
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_SHADER_FX_CONF_EDIT), WM_SETTEXT, 0, (LPARAM)theApp.GetConfigS("shaderfx_conf").c_str());
|
2015-11-21 15:51:09 +00:00
|
|
|
|
|
|
|
// FXAA shader
|
2016-05-24 19:52:06 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_FXAA, theApp.GetConfigB("fxaa"));
|
2015-11-21 15:51:09 +00:00
|
|
|
|
2017-02-23 21:53:02 +00:00
|
|
|
// Texture Filtering Of Display
|
|
|
|
CheckDlgButton(m_hWnd, IDC_LINEAR_PRESENT, theApp.GetConfigB("linear_present"));
|
|
|
|
|
2015-11-21 15:51:09 +00:00
|
|
|
AddTooltip(IDC_SHADEBOOST);
|
|
|
|
AddTooltip(IDC_SHADER_FX);
|
|
|
|
AddTooltip(IDC_FXAA);
|
2017-02-23 21:53:02 +00:00
|
|
|
AddTooltip(IDC_LINEAR_PRESENT);
|
2015-11-21 15:51:09 +00:00
|
|
|
|
2012-02-29 00:29:29 +00:00
|
|
|
UpdateControls();
|
|
|
|
}
|
|
|
|
|
2015-11-21 15:51:09 +00:00
|
|
|
void GSShaderDlg::UpdateControls()
|
2012-02-29 00:29:29 +00:00
|
|
|
{
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_SATURATION_SLIDER), TBM_SETRANGE, TRUE, MAKELONG(0, 100));
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_BRIGHTNESS_SLIDER), TBM_SETRANGE, TRUE, MAKELONG(0, 100));
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_CONTRAST_SLIDER), TBM_SETRANGE, TRUE, MAKELONG(0, 100));
|
|
|
|
|
2017-01-06 15:43:08 +00:00
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_SATURATION_SLIDER), TBM_SETPOS, TRUE, m_saturation);
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_BRIGHTNESS_SLIDER), TBM_SETPOS, TRUE, m_brightness);
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_CONTRAST_SLIDER), TBM_SETPOS, TRUE, m_contrast);
|
2012-02-29 00:29:29 +00:00
|
|
|
|
|
|
|
char text[8] = {0};
|
|
|
|
|
2017-01-06 15:43:08 +00:00
|
|
|
sprintf(text, "%d", m_saturation);
|
2017-05-06 16:41:00 +00:00
|
|
|
SetDlgItemText(m_hWnd, IDC_SATURATION_VALUE, text);
|
2017-01-06 15:43:08 +00:00
|
|
|
sprintf(text, "%d", m_brightness);
|
2017-05-06 16:41:00 +00:00
|
|
|
SetDlgItemText(m_hWnd, IDC_BRIGHTNESS_VALUE, text);
|
2017-01-06 15:43:08 +00:00
|
|
|
sprintf(text, "%d", m_contrast);
|
2017-05-06 16:41:00 +00:00
|
|
|
SetDlgItemText(m_hWnd, IDC_CONTRAST_VALUE, text);
|
2015-11-21 15:51:09 +00:00
|
|
|
|
|
|
|
// Shader Settings
|
|
|
|
bool external_shader_selected = IsDlgButtonChecked(m_hWnd, IDC_SHADER_FX) == BST_CHECKED;
|
|
|
|
bool shadeboost_selected = IsDlgButtonChecked(m_hWnd, IDC_SHADEBOOST) == BST_CHECKED;
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_SATURATION_SLIDER), shadeboost_selected);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_BRIGHTNESS_SLIDER), shadeboost_selected);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_CONTRAST_SLIDER), shadeboost_selected);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_SATURATION_TEXT), shadeboost_selected);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_BRIGHTNESS_TEXT), shadeboost_selected);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_CONTRAST_TEXT), shadeboost_selected);
|
2017-05-06 16:41:00 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_SATURATION_VALUE), shadeboost_selected);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_BRIGHTNESS_VALUE), shadeboost_selected);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_CONTRAST_VALUE), shadeboost_selected);
|
2015-11-21 15:51:09 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_SHADER_FX_TEXT), external_shader_selected);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_SHADER_FX_EDIT), external_shader_selected);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_SHADER_FX_BUTTON), external_shader_selected);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_SHADER_FX_CONF_TEXT), external_shader_selected);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_SHADER_FX_CONF_EDIT), external_shader_selected);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_SHADER_FX_CONF_BUTTON), external_shader_selected);
|
2012-02-29 00:29:29 +00:00
|
|
|
}
|
|
|
|
|
2015-11-21 15:51:09 +00:00
|
|
|
bool GSShaderDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
|
2012-02-29 00:29:29 +00:00
|
|
|
{
|
|
|
|
switch(message)
|
|
|
|
{
|
2016-05-01 23:00:00 +00:00
|
|
|
case WM_HSCROLL:
|
|
|
|
{
|
2012-02-29 00:29:29 +00:00
|
|
|
if((HWND)lParam == GetDlgItem(m_hWnd, IDC_SATURATION_SLIDER))
|
2016-05-01 23:00:00 +00:00
|
|
|
{
|
2012-02-29 00:29:29 +00:00
|
|
|
char text[8] = {0};
|
|
|
|
|
2017-01-06 15:43:08 +00:00
|
|
|
m_saturation = SendMessage(GetDlgItem(m_hWnd, IDC_SATURATION_SLIDER),TBM_GETPOS,0,0);
|
2016-05-01 23:00:00 +00:00
|
|
|
|
2017-01-06 15:43:08 +00:00
|
|
|
sprintf(text, "%d", m_saturation);
|
2017-07-22 17:58:16 +00:00
|
|
|
SetDlgItemText(m_hWnd, IDC_SATURATION_VALUE, text);
|
2012-02-29 00:29:29 +00:00
|
|
|
}
|
|
|
|
else if((HWND)lParam == GetDlgItem(m_hWnd, IDC_BRIGHTNESS_SLIDER))
|
2016-05-01 23:00:00 +00:00
|
|
|
{
|
2012-02-29 00:29:29 +00:00
|
|
|
char text[8] = {0};
|
|
|
|
|
2017-01-06 15:43:08 +00:00
|
|
|
m_brightness = SendMessage(GetDlgItem(m_hWnd, IDC_BRIGHTNESS_SLIDER),TBM_GETPOS,0,0);
|
2016-05-01 23:00:00 +00:00
|
|
|
|
2017-01-06 15:43:08 +00:00
|
|
|
sprintf(text, "%d", m_brightness);
|
2017-07-22 17:58:16 +00:00
|
|
|
SetDlgItemText(m_hWnd, IDC_BRIGHTNESS_VALUE, text);
|
2012-02-29 00:29:29 +00:00
|
|
|
}
|
|
|
|
else if((HWND)lParam == GetDlgItem(m_hWnd, IDC_CONTRAST_SLIDER))
|
2016-05-01 23:00:00 +00:00
|
|
|
{
|
2012-02-29 00:29:29 +00:00
|
|
|
char text[8] = {0};
|
|
|
|
|
2017-01-06 15:43:08 +00:00
|
|
|
m_contrast = SendMessage(GetDlgItem(m_hWnd, IDC_CONTRAST_SLIDER),TBM_GETPOS,0,0);
|
2016-05-01 23:00:00 +00:00
|
|
|
|
2017-01-06 15:43:08 +00:00
|
|
|
sprintf(text, "%d", m_contrast);
|
2017-07-22 17:58:16 +00:00
|
|
|
SetDlgItemText(m_hWnd, IDC_CONTRAST_VALUE, text);
|
2012-02-29 00:29:29 +00:00
|
|
|
}
|
|
|
|
} break;
|
|
|
|
|
|
|
|
case WM_COMMAND:
|
|
|
|
{
|
|
|
|
int id = LOWORD(wParam);
|
|
|
|
|
|
|
|
switch(id)
|
|
|
|
{
|
2015-11-21 15:51:09 +00:00
|
|
|
case IDOK:
|
2012-02-29 00:29:29 +00:00
|
|
|
{
|
2015-11-21 15:51:09 +00:00
|
|
|
INT_PTR data;
|
|
|
|
//TV Shader
|
|
|
|
if (ComboBoxGetSelData(IDC_TVSHADER, data))
|
|
|
|
{
|
2016-05-31 17:35:35 +00:00
|
|
|
theApp.SetConfig("TVShader", (int)data);
|
2015-11-21 15:51:09 +00:00
|
|
|
}
|
|
|
|
// Shade Boost
|
|
|
|
theApp.SetConfig("ShadeBoost", (int)IsDlgButtonChecked(m_hWnd, IDC_SHADEBOOST));
|
2017-01-06 15:43:08 +00:00
|
|
|
theApp.SetConfig("ShadeBoost_Contrast", m_contrast);
|
|
|
|
theApp.SetConfig("ShadeBoost_Brightness", m_brightness);
|
|
|
|
theApp.SetConfig("ShadeBoost_Saturation", m_saturation);
|
2015-11-21 15:51:09 +00:00
|
|
|
|
|
|
|
// FXAA shader
|
2019-09-17 21:05:03 +00:00
|
|
|
theApp.SetConfig("fxaa", (int)IsDlgButtonChecked(m_hWnd, IDC_FXAA));
|
2015-11-21 15:51:09 +00:00
|
|
|
|
2017-02-23 21:53:02 +00:00
|
|
|
// Texture Filtering Of Display
|
|
|
|
theApp.SetConfig("linear_present", (int)IsDlgButtonChecked(m_hWnd, IDC_LINEAR_PRESENT));
|
|
|
|
|
2015-11-21 15:51:09 +00:00
|
|
|
// External FX Shader
|
|
|
|
theApp.SetConfig("shaderfx", (int)IsDlgButtonChecked(m_hWnd, IDC_SHADER_FX));
|
|
|
|
|
|
|
|
// External FX Shader(OpenGL)
|
|
|
|
int shader_fx_length = (int)SendMessage(GetDlgItem(m_hWnd, IDC_SHADER_FX_EDIT), WM_GETTEXTLENGTH, 0, 0);
|
|
|
|
int shader_fx_conf_length = (int)SendMessage(GetDlgItem(m_hWnd, IDC_SHADER_FX_CONF_EDIT), WM_GETTEXTLENGTH, 0, 0);
|
|
|
|
int length = std::max(shader_fx_length, shader_fx_conf_length) + 1;
|
2017-01-06 15:43:08 +00:00
|
|
|
std::unique_ptr<char[]> buffer(new char[length]);
|
2015-11-21 15:51:09 +00:00
|
|
|
|
2017-01-06 15:43:08 +00:00
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_SHADER_FX_EDIT), WM_GETTEXT, (WPARAM)length, (LPARAM)buffer.get());
|
|
|
|
theApp.SetConfig("shaderfx_glsl", buffer.get()); // Not really glsl only ;)
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_SHADER_FX_CONF_EDIT), WM_GETTEXT, (WPARAM)length, (LPARAM)buffer.get());
|
|
|
|
theApp.SetConfig("shaderfx_conf", buffer.get());
|
2015-11-21 15:51:09 +00:00
|
|
|
|
2016-05-01 23:00:00 +00:00
|
|
|
EndDialog(m_hWnd, id);
|
2012-02-29 00:29:29 +00:00
|
|
|
} break;
|
2015-11-21 15:51:09 +00:00
|
|
|
case IDC_SHADEBOOST:
|
|
|
|
UpdateControls();
|
|
|
|
case IDC_SHADER_FX:
|
|
|
|
if (HIWORD(wParam) == BN_CLICKED)
|
|
|
|
UpdateControls();
|
|
|
|
break;
|
|
|
|
case IDC_SHADER_FX_BUTTON:
|
|
|
|
if (HIWORD(wParam) == BN_CLICKED)
|
|
|
|
OpenFileDialog(IDC_SHADER_FX_EDIT, "Select External Shader");
|
|
|
|
break;
|
2012-02-29 00:29:29 +00:00
|
|
|
|
2015-11-21 15:51:09 +00:00
|
|
|
case IDC_SHADER_FX_CONF_BUTTON:
|
|
|
|
if (HIWORD(wParam) == BN_CLICKED)
|
|
|
|
OpenFileDialog(IDC_SHADER_FX_CONF_EDIT, "Select External Shader Config");
|
|
|
|
break;
|
2012-02-29 00:29:29 +00:00
|
|
|
|
2015-11-21 15:51:09 +00:00
|
|
|
case IDCANCEL:
|
|
|
|
{
|
|
|
|
EndDialog(m_hWnd, IDCANCEL);
|
2012-02-29 00:29:29 +00:00
|
|
|
} break;
|
|
|
|
}
|
|
|
|
|
|
|
|
} break;
|
|
|
|
|
|
|
|
case WM_CLOSE:EndDialog(m_hWnd, IDCANCEL); break;
|
|
|
|
|
|
|
|
default: return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
2012-03-06 19:39:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Hacks Dialog
|
|
|
|
|
2019-06-17 07:31:16 +00:00
|
|
|
GSHacksDlg::GSHacksDlg()
|
2018-08-22 23:26:59 +00:00
|
|
|
: GSDialog{IDD_HACKS}
|
2018-08-22 23:29:09 +00:00
|
|
|
, m_old_skipdraw_offset{0}
|
|
|
|
, m_old_skipdraw{0}
|
2012-03-06 19:39:05 +00:00
|
|
|
{
|
|
|
|
}
|
2015-08-09 15:20:05 +00:00
|
|
|
|
2012-03-06 19:39:05 +00:00
|
|
|
void GSHacksDlg::OnInit()
|
2015-08-08 18:17:26 +00:00
|
|
|
{
|
|
|
|
HWND hwnd_renderer = GetDlgItem(GetParent(m_hWnd), IDC_RENDERER);
|
2016-05-01 16:33:53 +00:00
|
|
|
HWND hwnd_upscaling = GetDlgItem(GetParent(m_hWnd), IDC_UPSCALE_MULTIPLIER);
|
2015-10-26 21:30:34 +00:00
|
|
|
GSRendererType renderer = static_cast<GSRendererType>(SendMessage(hwnd_renderer, CB_GETITEMDATA, SendMessage(hwnd_renderer, CB_GETCURSEL, 0, 0), 0));
|
2016-05-01 16:33:53 +00:00
|
|
|
unsigned short upscaling_multiplier = static_cast<unsigned short>(SendMessage(hwnd_upscaling, CB_GETITEMDATA, SendMessage(hwnd_upscaling, CB_GETCURSEL, 0, 0), 0));
|
|
|
|
|
2015-08-08 18:17:26 +00:00
|
|
|
// It can only be accessed with a HW renderer, so this is sufficient.
|
2019-03-05 22:05:06 +00:00
|
|
|
bool hwhacks = IsDlgButtonChecked(GetParent(m_hWnd), IDC_HACKS_ENABLED) == BST_CHECKED;
|
2015-10-26 21:30:34 +00:00
|
|
|
bool ogl = renderer == GSRendererType::OGL_HW;
|
2016-05-01 16:33:53 +00:00
|
|
|
bool native = upscaling_multiplier == 1;
|
2012-03-06 19:39:05 +00:00
|
|
|
|
2019-02-13 09:28:07 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_WILDHACK, theApp.GetConfigB("UserHacks_WildHack"));
|
2016-05-24 19:52:06 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_PRELOAD_GS, theApp.GetConfigB("preload_frame_with_gs_data"));
|
|
|
|
CheckDlgButton(m_hWnd, IDC_ALIGN_SPRITE, theApp.GetConfigB("UserHacks_align_sprite_X"));
|
|
|
|
CheckDlgButton(m_hWnd, IDC_TC_DEPTH, theApp.GetConfigB("UserHacks_DisableDepthSupport"));
|
2017-10-04 21:50:36 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_CPU_FB_CONVERSION, theApp.GetConfigB("UserHacks_CPU_FB_Conversion"));
|
2016-05-24 19:52:06 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_FAST_TC_INV, theApp.GetConfigB("UserHacks_DisablePartialInvalidation"));
|
2019-04-30 23:28:28 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_AUTO_FLUSH_HW, theApp.GetConfigB("UserHacks_AutoFlush"));
|
2018-12-31 00:20:16 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_SAFE_FEATURES, theApp.GetConfigB("UserHacks_Disable_Safe_Features"));
|
2017-02-04 13:50:36 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_MEMORY_WRAPPING, theApp.GetConfigB("wrap_gs_mem"));
|
2017-03-18 13:19:48 +00:00
|
|
|
CheckDlgButton(m_hWnd, IDC_MERGE_PP_SPRITE, theApp.GetConfigB("UserHacks_merge_pp_sprite"));
|
2017-02-17 09:59:21 +00:00
|
|
|
|
2020-01-16 23:52:17 +00:00
|
|
|
ComboBoxInit(IDC_HALF_SCREEN_TS, theApp.m_gs_generic_list, theApp.GetConfigI("UserHacks_Half_Bottom_Override"));
|
2017-03-03 21:12:23 +00:00
|
|
|
ComboBoxInit(IDC_TRI_FILTER, theApp.m_gs_trifilter, theApp.GetConfigI("UserHacks_TriFilter"));
|
2017-02-17 09:59:21 +00:00
|
|
|
ComboBoxInit(IDC_OFFSETHACK, theApp.m_gs_offset_hack, theApp.GetConfigI("UserHacks_HalfPixelOffset"));
|
2016-05-24 19:52:06 +00:00
|
|
|
ComboBoxInit(IDC_ROUND_SPRITE, theApp.m_gs_hack, theApp.GetConfigI("UserHacks_round_sprite_offset"));
|
2020-01-16 23:52:17 +00:00
|
|
|
ComboBoxInit(IDC_GEOMETRY_SHADER_OVERRIDE, theApp.m_gs_generic_list, theApp.GetConfigI("override_geometry_shader"));
|
|
|
|
ComboBoxInit(IDC_IMAGE_LOAD_STORE, theApp.m_gs_generic_list, theApp.GetConfigI("override_GL_ARB_shader_image_load_store"));
|
|
|
|
ComboBoxInit(IDC_SPARSE_TEXTURE, theApp.m_gs_generic_list, theApp.GetConfigI("override_GL_ARB_sparse_texture"));
|
2015-08-08 18:17:26 +00:00
|
|
|
|
2018-08-02 19:55:14 +00:00
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWOFFSET), UDM_SETRANGE, 0, MAKELPARAM(10000, 0));
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWOFFSET), UDM_SETPOS, 0, MAKELPARAM(theApp.GetConfigI("UserHacks_SkipDraw_Offset"), 0));
|
2018-01-30 03:24:34 +00:00
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), UDM_SETRANGE, 0, MAKELPARAM(10000, 0));
|
2016-05-24 19:52:06 +00:00
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), UDM_SETPOS, 0, MAKELPARAM(theApp.GetConfigI("UserHacks_SkipDraw"), 0));
|
2012-03-07 09:58:38 +00:00
|
|
|
|
2013-02-12 10:57:48 +00:00
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_TCOFFSETX), UDM_SETRANGE, 0, MAKELPARAM(10000, 0));
|
2018-09-10 20:13:34 +00:00
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_TCOFFSETX), UDM_SETPOS, 0, MAKELPARAM(theApp.GetConfigI("UserHacks_TCOffsetX"), 0));
|
2013-02-12 10:57:48 +00:00
|
|
|
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_TCOFFSETY), UDM_SETRANGE, 0, MAKELPARAM(10000, 0));
|
2018-09-10 20:13:34 +00:00
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_TCOFFSETY), UDM_SETPOS, 0, MAKELPARAM(theApp.GetConfigI("UserHacks_TCOffsetY"), 0));
|
2012-03-07 09:58:38 +00:00
|
|
|
|
2019-03-05 22:05:06 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_PRELOAD_GS), hwhacks);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_TC_DEPTH), hwhacks);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_CPU_FB_CONVERSION), hwhacks);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_FAST_TC_INV), hwhacks);
|
2019-04-30 23:28:28 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_AUTO_FLUSH_HW), hwhacks);
|
2019-03-05 22:05:06 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_SAFE_FEATURES), hwhacks);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_MEMORY_WRAPPING), hwhacks);
|
|
|
|
|
2020-01-16 23:52:17 +00:00
|
|
|
// Half-screen bottom hack:
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_HALF_SCREEN_TS), hwhacks);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_HALF_SCREEN_TS_TEXT), hwhacks);
|
|
|
|
|
2019-03-05 22:05:06 +00:00
|
|
|
// Skipdraw hack:
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK_TEXT), hwhacks);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_SKIPDRAWOFFSETEDIT), hwhacks);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_SKIPDRAWOFFSET), hwhacks);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACKEDIT), hwhacks);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), hwhacks);
|
|
|
|
|
|
|
|
// Texture offsets hack:
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_TCOFFSET_TEXT), hwhacks);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_TCOFFSETX_TEXT), hwhacks);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_TCOFFSETX), hwhacks);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_TCOFFSETX2), hwhacks);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_TCOFFSETY_TEXT), hwhacks);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_TCOFFSETY), hwhacks);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_TCOFFSETY2), hwhacks);
|
|
|
|
|
2017-02-23 21:51:10 +00:00
|
|
|
// OpenGL-only hacks:
|
2019-03-05 22:05:06 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_TRI_FILTER), hwhacks && ogl);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_TRI_FILTER_TEXT), hwhacks && ogl);
|
2017-02-23 21:51:10 +00:00
|
|
|
|
|
|
|
// Upscaling hacks:
|
2019-03-05 22:05:06 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_WILDHACK), hwhacks && !native);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_ALIGN_SPRITE), hwhacks && !native);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_ROUND_SPRITE), hwhacks && !native);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_ROUND_SPRITE_TEXT), hwhacks && !native);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OFFSETHACK_TEXT), hwhacks && !native);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OFFSETHACK), hwhacks && !native);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_MERGE_PP_SPRITE), hwhacks && !native);
|
2015-08-08 18:17:26 +00:00
|
|
|
|
2017-02-23 21:51:10 +00:00
|
|
|
// OpenGL Very Advanced Custom Settings:
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_GEOMETRY_SHADER_OVERRIDE), ogl);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_GEOMETRY_SHADER_TEXT), ogl);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_IMAGE_LOAD_STORE), ogl);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_IMAGE_LOAD_STORE_TEXT), ogl);
|
2019-02-07 14:47:13 +00:00
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_SPARSE_TEXTURE), ogl);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_SPARSE_TEXTURE_TEXT), ogl);
|
2017-02-23 21:51:10 +00:00
|
|
|
|
2015-08-08 18:17:26 +00:00
|
|
|
AddTooltip(IDC_SKIPDRAWHACKEDIT);
|
|
|
|
AddTooltip(IDC_SKIPDRAWHACK);
|
2018-08-02 19:55:14 +00:00
|
|
|
AddTooltip(IDC_SKIPDRAWOFFSETEDIT);
|
|
|
|
AddTooltip(IDC_SKIPDRAWOFFSET);
|
2015-08-08 18:17:26 +00:00
|
|
|
AddTooltip(IDC_OFFSETHACK);
|
|
|
|
AddTooltip(IDC_WILDHACK);
|
|
|
|
AddTooltip(IDC_ALIGN_SPRITE);
|
|
|
|
AddTooltip(IDC_ROUND_SPRITE);
|
|
|
|
AddTooltip(IDC_TCOFFSETX);
|
|
|
|
AddTooltip(IDC_TCOFFSETX2);
|
|
|
|
AddTooltip(IDC_TCOFFSETY);
|
|
|
|
AddTooltip(IDC_TCOFFSETY2);
|
2015-10-21 14:49:32 +00:00
|
|
|
AddTooltip(IDC_PRELOAD_GS);
|
2016-05-01 23:00:00 +00:00
|
|
|
AddTooltip(IDC_TC_DEPTH);
|
2017-10-04 21:50:36 +00:00
|
|
|
AddTooltip(IDC_CPU_FB_CONVERSION);
|
2016-05-01 23:00:00 +00:00
|
|
|
AddTooltip(IDC_FAST_TC_INV);
|
2019-04-30 23:28:28 +00:00
|
|
|
AddTooltip(IDC_AUTO_FLUSH_HW);
|
2018-12-31 00:20:16 +00:00
|
|
|
AddTooltip(IDC_SAFE_FEATURES);
|
2017-02-04 13:50:36 +00:00
|
|
|
AddTooltip(IDC_MEMORY_WRAPPING);
|
2020-01-16 23:52:17 +00:00
|
|
|
AddTooltip(IDC_HALF_SCREEN_TS);
|
2017-03-03 21:12:23 +00:00
|
|
|
AddTooltip(IDC_TRI_FILTER);
|
2017-03-18 13:19:48 +00:00
|
|
|
AddTooltip(IDC_MERGE_PP_SPRITE);
|
2017-02-23 21:51:10 +00:00
|
|
|
AddTooltip(IDC_GEOMETRY_SHADER_OVERRIDE);
|
|
|
|
AddTooltip(IDC_IMAGE_LOAD_STORE);
|
2019-02-07 16:10:46 +00:00
|
|
|
AddTooltip(IDC_SPARSE_TEXTURE);
|
2018-08-02 19:55:14 +00:00
|
|
|
|
|
|
|
UpdateControls();
|
2012-03-06 19:39:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void GSHacksDlg::UpdateControls()
|
2018-08-02 19:55:14 +00:00
|
|
|
{
|
|
|
|
int skipdraw_offset = SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWOFFSET), UDM_GETPOS, 0, 0);
|
|
|
|
int skipdraw = SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), UDM_GETPOS, 0, 0);
|
|
|
|
|
|
|
|
bool skipdraw_offset_changed = skipdraw_offset != m_old_skipdraw_offset;
|
|
|
|
bool skipdraw_changed = skipdraw != m_old_skipdraw;
|
|
|
|
|
|
|
|
if (skipdraw_offset == 0 && skipdraw_offset_changed || skipdraw == 0 && skipdraw_changed)
|
|
|
|
{
|
|
|
|
skipdraw_offset = 0;
|
|
|
|
skipdraw = 0;
|
|
|
|
}
|
|
|
|
else if (skipdraw_offset > skipdraw)
|
|
|
|
{
|
|
|
|
if (skipdraw_offset_changed)
|
|
|
|
skipdraw = skipdraw_offset;
|
|
|
|
}
|
|
|
|
else if (skipdraw > 0 && skipdraw_offset == 0)
|
|
|
|
{
|
|
|
|
skipdraw_offset = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWOFFSET), UDM_SETPOS, 0, MAKELPARAM(skipdraw_offset, 0));
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), UDM_SETPOS, 0, MAKELPARAM(skipdraw, 0));
|
|
|
|
m_old_skipdraw_offset = skipdraw_offset;
|
|
|
|
m_old_skipdraw = skipdraw;
|
|
|
|
}
|
2012-03-06 19:39:05 +00:00
|
|
|
|
2012-03-07 09:58:38 +00:00
|
|
|
bool GSHacksDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
|
2016-05-01 23:00:00 +00:00
|
|
|
{
|
2012-04-23 18:46:09 +00:00
|
|
|
switch(message)
|
2012-03-06 19:39:05 +00:00
|
|
|
{
|
|
|
|
case WM_COMMAND:
|
|
|
|
{
|
|
|
|
int id = LOWORD(wParam);
|
|
|
|
|
|
|
|
switch(id)
|
|
|
|
{
|
2018-08-02 19:55:14 +00:00
|
|
|
case IDC_SKIPDRAWHACKEDIT:
|
|
|
|
case IDC_SKIPDRAWOFFSETEDIT:
|
|
|
|
if (HIWORD(wParam) == EN_CHANGE)
|
|
|
|
UpdateControls();
|
|
|
|
break;
|
|
|
|
case IDOK:
|
2012-03-06 19:39:05 +00:00
|
|
|
{
|
2015-08-08 18:17:26 +00:00
|
|
|
INT_PTR data;
|
2020-01-16 23:52:17 +00:00
|
|
|
if (ComboBoxGetSelData(IDC_HALF_SCREEN_TS, data))
|
|
|
|
{
|
|
|
|
theApp.SetConfig("UserHacks_Half_Bottom_Override", (int)data);
|
|
|
|
}
|
2017-03-03 21:12:23 +00:00
|
|
|
if (ComboBoxGetSelData(IDC_TRI_FILTER, data))
|
|
|
|
{
|
|
|
|
theApp.SetConfig("UserHacks_TriFilter", (int)data);
|
|
|
|
}
|
2015-08-08 18:17:26 +00:00
|
|
|
if (ComboBoxGetSelData(IDC_ROUND_SPRITE, data))
|
|
|
|
{
|
|
|
|
theApp.SetConfig("UserHacks_round_sprite_offset", (int)data);
|
|
|
|
}
|
2017-02-25 14:35:32 +00:00
|
|
|
if (ComboBoxGetSelData(IDC_OFFSETHACK, data))
|
|
|
|
{
|
|
|
|
theApp.SetConfig("UserHacks_HalfPixelOffset", (int)data);
|
|
|
|
}
|
2017-02-23 21:51:10 +00:00
|
|
|
if (ComboBoxGetSelData(IDC_GEOMETRY_SHADER_OVERRIDE, data))
|
|
|
|
{
|
|
|
|
theApp.SetConfig("override_geometry_shader", (int)data);
|
|
|
|
}
|
|
|
|
if (ComboBoxGetSelData(IDC_IMAGE_LOAD_STORE, data))
|
|
|
|
{
|
|
|
|
theApp.SetConfig("override_GL_ARB_shader_image_load_store", (int)data);
|
|
|
|
}
|
2019-02-07 14:47:13 +00:00
|
|
|
if (ComboBoxGetSelData(IDC_SPARSE_TEXTURE, data))
|
|
|
|
{
|
|
|
|
theApp.SetConfig("override_GL_ARB_sparse_texture", (int)data);
|
|
|
|
}
|
2018-08-02 19:55:14 +00:00
|
|
|
|
|
|
|
// It's more user friendly to lower the skipdraw offset value here - it prevents the skipdraw offset
|
|
|
|
// value from decreasing unnecessarily if the user types a skipdraw value that is temporarily lower
|
|
|
|
// than the skipdraw offset value.
|
|
|
|
int skipdraw_offset = SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWOFFSET), UDM_GETPOS, 0, 0);
|
|
|
|
int skipdraw = SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), UDM_GETPOS, 0, 0);
|
|
|
|
theApp.SetConfig("UserHacks_SkipDraw_Offset", std::min(skipdraw_offset, skipdraw));
|
|
|
|
theApp.SetConfig("UserHacks_SkipDraw", skipdraw);
|
|
|
|
|
2012-03-06 21:36:59 +00:00
|
|
|
theApp.SetConfig("UserHacks_WildHack", (int)IsDlgButtonChecked(m_hWnd, IDC_WILDHACK));
|
2015-10-21 14:49:32 +00:00
|
|
|
theApp.SetConfig("preload_frame_with_gs_data", (int)IsDlgButtonChecked(m_hWnd, IDC_PRELOAD_GS));
|
2019-09-06 11:12:49 +00:00
|
|
|
theApp.SetConfig("UserHacks_align_sprite_X", (int)IsDlgButtonChecked(m_hWnd, IDC_ALIGN_SPRITE));
|
2016-05-01 23:00:00 +00:00
|
|
|
theApp.SetConfig("UserHacks_DisableDepthSupport", (int)IsDlgButtonChecked(m_hWnd, IDC_TC_DEPTH));
|
2017-10-04 21:50:36 +00:00
|
|
|
theApp.SetConfig("UserHacks_CPU_FB_Conversion", (int)IsDlgButtonChecked(m_hWnd, IDC_CPU_FB_CONVERSION));
|
2016-05-01 23:00:00 +00:00
|
|
|
theApp.SetConfig("UserHacks_DisablePartialInvalidation", (int)IsDlgButtonChecked(m_hWnd, IDC_FAST_TC_INV));
|
2019-04-30 23:28:28 +00:00
|
|
|
theApp.SetConfig("UserHacks_AutoFlush", (int)IsDlgButtonChecked(m_hWnd, IDC_AUTO_FLUSH_HW));
|
2018-12-31 00:20:16 +00:00
|
|
|
theApp.SetConfig("UserHacks_Disable_Safe_Features", (int)IsDlgButtonChecked(m_hWnd, IDC_SAFE_FEATURES));
|
2017-02-04 13:50:36 +00:00
|
|
|
theApp.SetConfig("wrap_gs_mem", (int)IsDlgButtonChecked(m_hWnd, IDC_MEMORY_WRAPPING));
|
2017-03-18 13:19:48 +00:00
|
|
|
theApp.SetConfig("UserHacks_merge_pp_sprite", (int)IsDlgButtonChecked(m_hWnd, IDC_MERGE_PP_SPRITE));
|
2018-09-10 20:13:34 +00:00
|
|
|
theApp.SetConfig("UserHacks_TCOffsetX", SendMessage(GetDlgItem(m_hWnd, IDC_TCOFFSETX), UDM_GETPOS, 0, 0));
|
|
|
|
theApp.SetConfig("UserHacks_TCOffsetY", SendMessage(GetDlgItem(m_hWnd, IDC_TCOFFSETY), UDM_GETPOS, 0, 0));
|
2013-02-12 10:57:48 +00:00
|
|
|
|
2012-03-06 19:39:05 +00:00
|
|
|
EndDialog(m_hWnd, id);
|
|
|
|
} break;
|
2016-09-16 21:22:13 +00:00
|
|
|
|
|
|
|
case IDCANCEL:
|
|
|
|
{
|
|
|
|
EndDialog(m_hWnd, IDCANCEL);
|
|
|
|
} break;
|
2012-03-06 19:39:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} break;
|
|
|
|
|
|
|
|
case WM_CLOSE:EndDialog(m_hWnd, IDCANCEL); break;
|
|
|
|
|
|
|
|
default: return false;
|
|
|
|
}
|
|
|
|
|
2017-01-06 15:40:31 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// OSD Configuration Dialog
|
|
|
|
|
|
|
|
GSOSDDlg::GSOSDDlg() :
|
|
|
|
GSDialog(IDD_OSD)
|
|
|
|
{}
|
|
|
|
|
|
|
|
void GSOSDDlg::OnInit()
|
|
|
|
{
|
|
|
|
CheckDlgButton(m_hWnd, IDC_OSD_LOG, theApp.GetConfigB("osd_log_enabled"));
|
|
|
|
CheckDlgButton(m_hWnd, IDC_OSD_MONITOR, theApp.GetConfigB("osd_monitor_enabled"));
|
|
|
|
|
2018-12-12 06:00:00 +00:00
|
|
|
m_color.a = theApp.GetConfigI("osd_color_opacity");
|
|
|
|
m_color.r = theApp.GetConfigI("osd_color_r");
|
|
|
|
m_color.g = theApp.GetConfigI("osd_color_g");
|
|
|
|
m_color.b = theApp.GetConfigI("osd_color_b");
|
|
|
|
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_OSD_OPACITY_SLIDER), TBM_SETRANGE, TRUE, MAKELONG(0, 100));
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_OSD_COLOR_RED_SLIDER), TBM_SETRANGE, TRUE, MAKELONG(0, 255));
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_OSD_COLOR_GREEN_SLIDER), TBM_SETRANGE, TRUE, MAKELONG(0, 255));
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_OSD_COLOR_BLUE_SLIDER), TBM_SETRANGE, TRUE, MAKELONG(0, 255));
|
2017-01-06 15:40:31 +00:00
|
|
|
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_OSD_SIZE), UDM_SETRANGE, 0, MAKELPARAM(100, 1));
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_OSD_SIZE), UDM_SETPOS, 0, MAKELPARAM(theApp.GetConfigI("osd_fontsize"), 0));
|
|
|
|
|
2018-12-12 06:00:00 +00:00
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_OSD_TIMEOUT), UDM_SETRANGE, 0, MAKELPARAM(10, 2));
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_OSD_TIMEOUT), UDM_SETPOS, 0, MAKELPARAM(theApp.GetConfigI("osd_log_timeout"), 0));
|
2017-01-06 15:40:31 +00:00
|
|
|
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_OSD_MAX_LOG), UDM_SETRANGE, 0, MAKELPARAM(20, 1));
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_OSD_MAX_LOG), UDM_SETPOS, 0, MAKELPARAM(theApp.GetConfigI("osd_max_log_messages"), 0));
|
|
|
|
|
|
|
|
AddTooltip(IDC_OSD_MAX_LOG);
|
|
|
|
AddTooltip(IDC_OSD_MAX_LOG_EDIT);
|
|
|
|
AddTooltip(IDC_OSD_MONITOR);
|
|
|
|
|
|
|
|
UpdateControls();
|
|
|
|
}
|
|
|
|
|
|
|
|
void GSOSDDlg::UpdateControls()
|
|
|
|
{
|
2018-12-12 06:00:00 +00:00
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_OSD_OPACITY_SLIDER), TBM_SETPOS, TRUE, m_color.a);
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_OSD_COLOR_RED_SLIDER), TBM_SETPOS, TRUE, m_color.r);
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_OSD_COLOR_GREEN_SLIDER), TBM_SETPOS, TRUE, m_color.g);
|
|
|
|
SendMessage(GetDlgItem(m_hWnd, IDC_OSD_COLOR_BLUE_SLIDER), TBM_SETPOS, TRUE, m_color.b);
|
2017-01-06 15:40:31 +00:00
|
|
|
|
|
|
|
char text[8] = { 0 };
|
2018-12-12 06:00:00 +00:00
|
|
|
sprintf(text, "%d", m_color.a);
|
|
|
|
SetDlgItemText(m_hWnd, IDC_OSD_OPACITY_AMOUNT, text);
|
|
|
|
|
|
|
|
sprintf(text, "%d", m_color.r);
|
|
|
|
SetDlgItemText(m_hWnd, IDC_OSD_COLOR_RED_AMOUNT, text);
|
|
|
|
|
|
|
|
sprintf(text, "%d", m_color.g);
|
|
|
|
SetDlgItemText(m_hWnd, IDC_OSD_COLOR_GREEN_AMOUNT, text);
|
|
|
|
|
|
|
|
sprintf(text, "%d", m_color.b);
|
|
|
|
SetDlgItemText(m_hWnd, IDC_OSD_COLOR_BLUE_AMOUNT, text);
|
|
|
|
|
2019-03-05 22:05:06 +00:00
|
|
|
bool monitor_enabled = IsDlgButtonChecked(m_hWnd, IDC_OSD_MONITOR) == BST_CHECKED;
|
|
|
|
bool log_enabled = IsDlgButtonChecked(m_hWnd, IDC_OSD_LOG) == BST_CHECKED;
|
2018-12-12 06:00:00 +00:00
|
|
|
|
|
|
|
// Font
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OSD_COLOR_RED_SLIDER), monitor_enabled || log_enabled);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OSD_COLOR_RED_TEXT), monitor_enabled || log_enabled);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OSD_COLOR_RED_AMOUNT), monitor_enabled || log_enabled);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OSD_COLOR_GREEN_SLIDER), monitor_enabled || log_enabled);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OSD_COLOR_GREEN_TEXT), monitor_enabled || log_enabled);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OSD_COLOR_GREEN_AMOUNT), monitor_enabled || log_enabled);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OSD_COLOR_BLUE_SLIDER), monitor_enabled || log_enabled);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OSD_COLOR_BLUE_TEXT), monitor_enabled || log_enabled);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OSD_COLOR_BLUE_AMOUNT), monitor_enabled || log_enabled);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OSD_SIZE_EDIT), monitor_enabled || log_enabled);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OSD_SIZE), monitor_enabled || log_enabled);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OSD_OPACITY_SLIDER), monitor_enabled || log_enabled);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OSD_OPACITY_AMOUNT), monitor_enabled || log_enabled);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OSD_SIZE_TEXT), monitor_enabled || log_enabled);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OSD_OPACITY_TEXT), monitor_enabled || log_enabled);
|
|
|
|
|
|
|
|
// Log
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OSD_TIMEOUT), log_enabled);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OSD_TIMEOUT_EDIT), log_enabled);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OSD_TIMEOUT_TEXT), log_enabled);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OSD_MAX_LOG), log_enabled);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OSD_MAX_LOG_EDIT), log_enabled);
|
|
|
|
EnableWindow(GetDlgItem(m_hWnd, IDC_OSD_MAX_LOG_TEXT), log_enabled);
|
2017-01-06 15:40:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool GSOSDDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
|
|
|
|
{
|
|
|
|
switch (message)
|
|
|
|
{
|
|
|
|
case WM_HSCROLL:
|
|
|
|
{
|
2018-12-12 06:00:00 +00:00
|
|
|
if ((HWND)lParam == GetDlgItem(m_hWnd, IDC_OSD_OPACITY_SLIDER))
|
|
|
|
{
|
|
|
|
char text[8] = { 0 };
|
|
|
|
|
|
|
|
m_color.a = SendMessage(GetDlgItem(m_hWnd, IDC_OSD_OPACITY_SLIDER), TBM_GETPOS, 0, 0);
|
|
|
|
|
|
|
|
sprintf(text, "%d", m_color.a);
|
|
|
|
SetDlgItemText(m_hWnd, IDC_OSD_OPACITY_AMOUNT, text);
|
|
|
|
}
|
|
|
|
else if ((HWND)lParam == GetDlgItem(m_hWnd, IDC_OSD_COLOR_RED_SLIDER))
|
|
|
|
{
|
|
|
|
char text[8] = { 0 };
|
|
|
|
|
|
|
|
m_color.r = SendMessage(GetDlgItem(m_hWnd, IDC_OSD_COLOR_RED_SLIDER), TBM_GETPOS, 0, 0);
|
|
|
|
|
|
|
|
sprintf(text, "%d", m_color.r);
|
|
|
|
SetDlgItemText(m_hWnd, IDC_OSD_COLOR_RED_AMOUNT, text);
|
|
|
|
}
|
|
|
|
else if ((HWND)lParam == GetDlgItem(m_hWnd, IDC_OSD_COLOR_GREEN_SLIDER))
|
2017-01-06 15:40:31 +00:00
|
|
|
{
|
|
|
|
char text[8] = { 0 };
|
|
|
|
|
2018-12-12 06:00:00 +00:00
|
|
|
m_color.g = SendMessage(GetDlgItem(m_hWnd, IDC_OSD_COLOR_GREEN_SLIDER), TBM_GETPOS, 0, 0);
|
2017-01-06 15:40:31 +00:00
|
|
|
|
2018-12-12 06:00:00 +00:00
|
|
|
sprintf(text, "%d", m_color.g);
|
|
|
|
SetDlgItemText(m_hWnd, IDC_OSD_COLOR_GREEN_AMOUNT, text);
|
|
|
|
}
|
|
|
|
else if ((HWND)lParam == GetDlgItem(m_hWnd, IDC_OSD_COLOR_BLUE_SLIDER))
|
|
|
|
{
|
|
|
|
char text[8] = { 0 };
|
|
|
|
|
|
|
|
m_color.b = SendMessage(GetDlgItem(m_hWnd, IDC_OSD_COLOR_BLUE_SLIDER), TBM_GETPOS, 0, 0);
|
|
|
|
|
|
|
|
sprintf(text, "%d", m_color.b);
|
|
|
|
SetDlgItemText(m_hWnd, IDC_OSD_COLOR_BLUE_AMOUNT, text);
|
2017-01-06 15:40:31 +00:00
|
|
|
}
|
|
|
|
} break;
|
|
|
|
|
|
|
|
case WM_COMMAND:
|
|
|
|
{
|
|
|
|
int id = LOWORD(wParam);
|
|
|
|
|
|
|
|
switch (id)
|
|
|
|
{
|
|
|
|
case IDOK:
|
|
|
|
{
|
2018-12-12 06:00:00 +00:00
|
|
|
theApp.SetConfig("osd_color_opacity", m_color.a);
|
|
|
|
theApp.SetConfig("osd_color_r", m_color.r);
|
|
|
|
theApp.SetConfig("osd_color_g", m_color.g);
|
|
|
|
theApp.SetConfig("osd_color_b", m_color.b);
|
2017-01-06 15:40:31 +00:00
|
|
|
|
|
|
|
theApp.SetConfig("osd_fontsize", (int)SendMessage(GetDlgItem(m_hWnd, IDC_OSD_SIZE), UDM_GETPOS, 0, 0));
|
2018-12-12 06:00:00 +00:00
|
|
|
theApp.SetConfig("osd_log_timeout", (int)SendMessage(GetDlgItem(m_hWnd, IDC_OSD_TIMEOUT), UDM_GETPOS, 0, 0));
|
2017-01-06 15:40:31 +00:00
|
|
|
theApp.SetConfig("osd_max_log_messages", (int)SendMessage(GetDlgItem(m_hWnd, IDC_OSD_MAX_LOG), UDM_GETPOS, 0, 0));
|
|
|
|
|
|
|
|
theApp.SetConfig("osd_log_enabled", (int)IsDlgButtonChecked(m_hWnd, IDC_OSD_LOG));
|
|
|
|
theApp.SetConfig("osd_monitor_enabled", (int)IsDlgButtonChecked(m_hWnd, IDC_OSD_MONITOR));
|
|
|
|
|
|
|
|
EndDialog(m_hWnd, id);
|
|
|
|
} break;
|
2018-09-12 11:00:20 +00:00
|
|
|
case IDC_OSD_LOG:
|
|
|
|
if (HIWORD(wParam) == BN_CLICKED)
|
|
|
|
UpdateControls();
|
|
|
|
break;
|
2018-12-12 06:00:00 +00:00
|
|
|
case IDC_OSD_MONITOR:
|
2017-01-06 15:40:31 +00:00
|
|
|
if (HIWORD(wParam) == BN_CLICKED)
|
2018-12-12 06:00:00 +00:00
|
|
|
UpdateControls();
|
2017-01-06 15:40:31 +00:00
|
|
|
break;
|
|
|
|
case IDCANCEL:
|
|
|
|
{
|
|
|
|
EndDialog(m_hWnd, IDCANCEL);
|
|
|
|
} break;
|
|
|
|
}
|
|
|
|
|
|
|
|
} break;
|
|
|
|
|
|
|
|
case WM_CLOSE:EndDialog(m_hWnd, IDCANCEL); break;
|
|
|
|
|
|
|
|
default: return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-03-06 19:39:05 +00:00
|
|
|
return true;
|
|
|
|
}
|