2009-07-28 21:32:10 +00:00
|
|
|
// Copyright (C) 2003 Dolphin Project.
|
2008-12-08 05:25:12 +00:00
|
|
|
|
|
|
|
// 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, version 2.0.
|
|
|
|
|
|
|
|
// 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 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official SVN repository and contact information can be found at
|
|
|
|
// http://code.google.com/p/dolphin-emu/
|
|
|
|
|
|
|
|
#include <windowsx.h>
|
|
|
|
|
|
|
|
#include "resource.h"
|
|
|
|
#include "W32Util/PropertySheet.h"
|
|
|
|
#include "W32Util/ShellUtil.h"
|
2010-02-02 21:56:29 +00:00
|
|
|
#include "FileUtil.h"
|
2008-12-08 05:25:12 +00:00
|
|
|
|
|
|
|
#include "D3DBase.h"
|
|
|
|
|
2009-09-13 09:23:30 +00:00
|
|
|
#include "VideoConfig.h"
|
2008-12-08 05:25:12 +00:00
|
|
|
|
|
|
|
#include "TextureCache.h"
|
2009-09-15 08:13:45 +00:00
|
|
|
// TODO: remove if/when ini files use unicode
|
|
|
|
#define ComboBox_GetTextA(hwndCtl, lpch, cchMax) GetWindowTextA((hwndCtl), (lpch), (cchMax))
|
2008-12-08 05:25:12 +00:00
|
|
|
|
2010-01-13 21:11:02 +00:00
|
|
|
const char *aspect_ratio_names[4] = {
|
|
|
|
"Auto",
|
|
|
|
"Force 16:9 Widescreen",
|
|
|
|
"Force 4:3 Standard",
|
|
|
|
"Stretch to Window",
|
|
|
|
};
|
|
|
|
|
2008-12-08 05:25:12 +00:00
|
|
|
struct TabDirect3D : public W32Util::Tab
|
|
|
|
{
|
|
|
|
void Init(HWND hDlg)
|
|
|
|
{
|
2009-09-02 06:33:41 +00:00
|
|
|
WCHAR tempwstr[2000];
|
|
|
|
|
2009-09-13 08:21:35 +00:00
|
|
|
for (int i = 0; i < D3D::GetNumAdapters(); i++)
|
2008-12-08 05:25:12 +00:00
|
|
|
{
|
|
|
|
const D3D::Adapter &adapter = D3D::GetAdapter(i);
|
2009-09-02 06:33:41 +00:00
|
|
|
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, adapter.ident.Description, -1, tempwstr, 2000);
|
2010-01-13 21:11:02 +00:00
|
|
|
ComboBox_AddString(GetDlgItem(hDlg, IDC_ADAPTER),tempwstr);
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const D3D::Adapter &adapter = D3D::GetAdapter(g_Config.iAdapter);
|
2009-09-13 08:21:35 +00:00
|
|
|
ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_ADAPTER), g_Config.iAdapter);
|
2008-12-08 05:25:12 +00:00
|
|
|
|
|
|
|
for (int i = 0; i < (int)adapter.aa_levels.size(); i++)
|
|
|
|
{
|
2009-09-02 06:33:41 +00:00
|
|
|
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, adapter.aa_levels[i].name, -1, tempwstr, 2000);
|
|
|
|
ComboBox_AddString(GetDlgItem(hDlg, IDC_ANTIALIASMODE), tempwstr);
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_ANTIALIASMODE), g_Config.iMultisampleMode);
|
|
|
|
if (adapter.aa_levels.size() == 1)
|
|
|
|
{
|
2009-11-30 03:48:59 +00:00
|
|
|
ComboBox_Enable(GetDlgItem(hDlg, IDC_ANTIALIASMODE), FALSE);
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
|
|
|
|
2010-01-13 21:11:02 +00:00
|
|
|
for (int i = 0; i < 4; i++)
|
|
|
|
{
|
|
|
|
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, aspect_ratio_names[i], -1, tempwstr, 2000);
|
|
|
|
ComboBox_AddString(GetDlgItem(hDlg, IDC_ASPECTRATIO), tempwstr);
|
|
|
|
}
|
|
|
|
ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_ASPECTRATIO), g_Config.iAspectRatio);
|
|
|
|
|
2008-12-08 05:25:12 +00:00
|
|
|
for (int i = 0; i < (int)adapter.resolutions.size(); i++)
|
|
|
|
{
|
|
|
|
const D3D::Resolution &r = adapter.resolutions[i];
|
2009-09-02 06:33:41 +00:00
|
|
|
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, r.name, -1, tempwstr, 2000);
|
2010-01-13 21:11:02 +00:00
|
|
|
ComboBox_AddString(GetDlgItem(hDlg, IDC_RESOLUTION), tempwstr);
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
2009-09-15 08:13:45 +00:00
|
|
|
|
2010-01-13 21:11:02 +00:00
|
|
|
for (int i = 0; i < 16; i++) {
|
|
|
|
tempwstr[i] = g_Config.cFSResolution[i];
|
|
|
|
}
|
2009-09-15 08:13:45 +00:00
|
|
|
ComboBox_SelectString(GetDlgItem(hDlg,IDC_RESOLUTION), -1, tempwstr);
|
2009-10-19 12:13:35 +00:00
|
|
|
|
2009-11-30 03:48:59 +00:00
|
|
|
Button_SetCheck(GetDlgItem(hDlg, IDC_VSYNC), g_Config.bVSync);
|
|
|
|
Button_SetCheck(GetDlgItem(hDlg, IDC_WIDESCREEN_HACK), g_Config.bWidescreenHack);
|
|
|
|
Button_SetCheck(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE), g_Config.bSafeTextureCache);
|
2010-02-26 12:54:08 +00:00
|
|
|
|
2010-02-26 22:14:29 +00:00
|
|
|
if(g_Config.iSafeTextureCache_ColorSamples == 0)
|
2010-02-26 12:54:08 +00:00
|
|
|
{
|
|
|
|
Button_SetCheck(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE_SAFE), true);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-02-26 22:14:29 +00:00
|
|
|
if(g_Config.iSafeTextureCache_ColorSamples > 128)
|
2010-02-26 12:54:08 +00:00
|
|
|
{
|
|
|
|
Button_SetCheck(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE_NORMAL), true);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Button_SetCheck(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE_FAST), true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Button_Enable(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE_SAFE),g_Config.bSafeTextureCache);
|
|
|
|
Button_Enable(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE_NORMAL),g_Config.bSafeTextureCache);
|
|
|
|
Button_Enable(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE_FAST),g_Config.bSafeTextureCache);
|
2010-03-14 18:57:50 +00:00
|
|
|
|
2009-11-30 03:48:59 +00:00
|
|
|
Button_SetCheck(GetDlgItem(hDlg, IDC_EFB_ACCESS_ENABLE), g_Config.bEFBAccessEnable);
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Command(HWND hDlg,WPARAM wParam)
|
|
|
|
{
|
|
|
|
switch (LOWORD(wParam))
|
|
|
|
{
|
2010-01-13 21:11:02 +00:00
|
|
|
case IDC_ASPECTRATIO:
|
|
|
|
g_Config.iAspectRatio = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_ASPECTRATIO));
|
2009-09-13 17:46:33 +00:00
|
|
|
break;
|
|
|
|
case IDC_WIDESCREEN_HACK:
|
|
|
|
g_Config.bWidescreenHack = Button_GetCheck(GetDlgItem(hDlg, IDC_WIDESCREEN_HACK)) ? true : false;
|
|
|
|
break;
|
2009-09-19 13:14:55 +00:00
|
|
|
case IDC_SAFE_TEXTURE_CACHE:
|
2009-09-29 22:32:53 +00:00
|
|
|
g_Config.bSafeTextureCache = Button_GetCheck(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE)) == 0 ? false : true;
|
2010-02-26 12:54:08 +00:00
|
|
|
Button_Enable(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE_SAFE),g_Config.bSafeTextureCache);
|
|
|
|
Button_Enable(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE_NORMAL),g_Config.bSafeTextureCache);
|
|
|
|
Button_Enable(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE_FAST),g_Config.bSafeTextureCache);
|
2009-09-19 13:14:55 +00:00
|
|
|
break;
|
2009-10-07 19:54:56 +00:00
|
|
|
case IDC_EFB_ACCESS_ENABLE:
|
|
|
|
g_Config.bEFBAccessEnable = Button_GetCheck(GetDlgItem(hDlg, IDC_EFB_ACCESS_ENABLE)) == 0 ? false : true;
|
|
|
|
break;
|
2008-12-08 05:25:12 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Apply(HWND hDlg)
|
|
|
|
{
|
2009-09-15 08:13:45 +00:00
|
|
|
ComboBox_GetTextA(GetDlgItem(hDlg, IDC_RESOLUTION), g_Config.cFSResolution, 16);
|
|
|
|
|
2008-12-08 05:25:12 +00:00
|
|
|
g_Config.iAdapter = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_ADAPTER));
|
|
|
|
g_Config.iMultisampleMode = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_ANTIALIASMODE));
|
2009-09-15 08:13:45 +00:00
|
|
|
g_Config.bVSync = Button_GetCheck(GetDlgItem(hDlg, IDC_VSYNC)) ? true : false;
|
2010-02-26 12:54:08 +00:00
|
|
|
if(Button_GetCheck(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE_SAFE)))
|
|
|
|
{
|
2010-02-26 22:14:29 +00:00
|
|
|
g_Config.iSafeTextureCache_ColorSamples = 0;
|
2010-02-26 12:54:08 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if(Button_GetCheck(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE_NORMAL)))
|
|
|
|
{
|
2010-02-26 22:14:29 +00:00
|
|
|
if(g_Config.iSafeTextureCache_ColorSamples < 512)
|
2010-02-26 12:54:08 +00:00
|
|
|
{
|
2010-02-26 22:14:29 +00:00
|
|
|
g_Config.iSafeTextureCache_ColorSamples = 512;
|
|
|
|
}
|
2010-02-26 12:54:08 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-02-26 22:14:29 +00:00
|
|
|
if(g_Config.iSafeTextureCache_ColorSamples > 128 || g_Config.iSafeTextureCache_ColorSamples == 0)
|
2010-02-26 12:54:08 +00:00
|
|
|
{
|
2010-02-26 22:14:29 +00:00
|
|
|
g_Config.iSafeTextureCache_ColorSamples = 128;
|
|
|
|
}
|
2010-02-26 12:54:08 +00:00
|
|
|
}
|
|
|
|
}
|
2010-02-02 21:56:29 +00:00
|
|
|
g_Config.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx9.ini").c_str());
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct TabAdvanced : public W32Util::Tab
|
|
|
|
{
|
|
|
|
void Init(HWND hDlg)
|
|
|
|
{
|
2008-12-26 17:02:46 +00:00
|
|
|
// HWND opt = GetDlgItem(hDlg,IDC_DLOPTLEVEL);
|
|
|
|
// ComboBox_AddString(opt,"0: Interpret (slowest, most compatible)");
|
|
|
|
// ComboBox_AddString(opt,"1: Compile lists and decode vertex lists");
|
2008-12-08 05:25:12 +00:00
|
|
|
//ComboBox_AddString(opt,"2: Compile+decode to vbufs and use hw xform");
|
|
|
|
//ComboBox_AddString(opt,"Recompile to vbuffers and shaders");
|
2008-12-26 17:02:46 +00:00
|
|
|
// ComboBox_SetCurSel(opt,g_Config.iCompileDLsLevel);
|
2008-12-08 05:25:12 +00:00
|
|
|
|
2010-01-29 07:44:21 +00:00
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_OSDHOTKEY), g_Config.bOSDHotKey);
|
2009-11-28 05:59:46 +00:00
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_OVERLAYFPS), g_Config.bShowFPS);
|
2008-12-08 05:25:12 +00:00
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_OVERLAYSTATS), g_Config.bOverlayStats);
|
2009-03-08 23:46:47 +00:00
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_OVERLAYPROJSTATS), g_Config.bOverlayProjStats);
|
2008-12-08 05:25:12 +00:00
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_WIREFRAME), g_Config.bWireFrame);
|
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_TEXDUMP), g_Config.bDumpTextures);
|
2009-03-28 21:07:16 +00:00
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_DUMPFRAMES), g_Config.bDumpFrames);
|
2008-12-08 05:25:12 +00:00
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_SHOWSHADERERRORS), g_Config.bShowShaderErrors);
|
2009-11-28 05:59:46 +00:00
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_DISABLEFOG), g_Config.bDisableFog);
|
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_ENABLEEFBCOPY), !g_Config.bEFBCopyDisable);
|
2010-03-14 18:57:50 +00:00
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_ENABLEXFB),g_Config.bUseXFB);
|
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_ENABLEREALXFB),g_Config.bUseRealXFB);
|
|
|
|
|
2010-01-29 07:44:21 +00:00
|
|
|
if(g_Config.bCopyEFBToTexture)
|
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_EFBTOTEX), true);
|
2009-11-28 05:59:46 +00:00
|
|
|
else
|
2010-01-29 07:44:21 +00:00
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_EFBTORAM), true);
|
2008-12-08 05:25:12 +00:00
|
|
|
|
2009-12-22 06:47:42 +00:00
|
|
|
|
2008-12-08 05:25:12 +00:00
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_TEXFMT_OVERLAY), g_Config.bTexFmtOverlayEnable);
|
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_TEXFMT_CENTER), g_Config.bTexFmtOverlayCenter);
|
|
|
|
Button_GetCheck(GetDlgItem(hDlg,IDC_TEXFMT_OVERLAY)) ? Button_Enable(GetDlgItem(hDlg,IDC_TEXFMT_CENTER), true) : Button_Enable(GetDlgItem(hDlg,IDC_TEXFMT_CENTER), false);
|
2009-11-28 05:59:46 +00:00
|
|
|
Button_GetCheck(GetDlgItem(hDlg,IDC_ENABLEEFBCOPY)) ? Button_Enable(GetDlgItem(hDlg,IDC_EFBTORAM), true) : Button_Enable(GetDlgItem(hDlg,IDC_EFBTORAM), false);
|
|
|
|
Button_GetCheck(GetDlgItem(hDlg,IDC_ENABLEEFBCOPY)) ? Button_Enable(GetDlgItem(hDlg,IDC_EFBTOTEX), true) : Button_Enable(GetDlgItem(hDlg,IDC_EFBTOTEX), false);
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
|
|
|
void Command(HWND hDlg,WPARAM wParam)
|
|
|
|
{
|
|
|
|
switch (LOWORD(wParam))
|
|
|
|
{
|
2010-03-14 18:57:50 +00:00
|
|
|
case IDC_ENABLEXFB:
|
|
|
|
{
|
|
|
|
g_Config.bUseXFB = Button_GetCheck(GetDlgItem(hDlg, IDC_ENABLEXFB)) ? true : false;
|
|
|
|
}
|
|
|
|
break;
|
2009-11-28 05:59:46 +00:00
|
|
|
case IDC_ENABLEEFBCOPY:
|
|
|
|
{
|
|
|
|
Button_GetCheck(GetDlgItem(hDlg,IDC_ENABLEEFBCOPY)) ? Button_Enable(GetDlgItem(hDlg,IDC_EFBTORAM), true) : Button_Enable(GetDlgItem(hDlg,IDC_EFBTORAM), false);
|
|
|
|
Button_GetCheck(GetDlgItem(hDlg,IDC_ENABLEEFBCOPY)) ? Button_Enable(GetDlgItem(hDlg,IDC_EFBTOTEX), true) : Button_Enable(GetDlgItem(hDlg,IDC_EFBTOTEX), false);
|
|
|
|
}
|
|
|
|
break;
|
2008-12-08 05:25:12 +00:00
|
|
|
case IDC_TEXFMT_OVERLAY:
|
|
|
|
{
|
2009-09-13 17:46:33 +00:00
|
|
|
Button_GetCheck(GetDlgItem(hDlg, IDC_TEXFMT_OVERLAY)) ? Button_Enable(GetDlgItem(hDlg,IDC_TEXFMT_CENTER), true) : Button_Enable(GetDlgItem(hDlg,IDC_TEXFMT_CENTER), false);
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void Apply(HWND hDlg)
|
|
|
|
{
|
|
|
|
g_Config.bTexFmtOverlayEnable = Button_GetCheck(GetDlgItem(hDlg,IDC_TEXFMT_OVERLAY)) ? true : false;
|
|
|
|
g_Config.bTexFmtOverlayCenter = Button_GetCheck(GetDlgItem(hDlg,IDC_TEXFMT_CENTER)) ? true : false;
|
|
|
|
|
2010-01-29 07:44:21 +00:00
|
|
|
g_Config.bOSDHotKey = Button_GetCheck(GetDlgItem(hDlg,IDC_OSDHOTKEY)) ? true : false;
|
2009-11-28 05:59:46 +00:00
|
|
|
g_Config.bShowFPS = Button_GetCheck(GetDlgItem(hDlg,IDC_OVERLAYFPS)) ? true : false;
|
2008-12-08 05:25:12 +00:00
|
|
|
g_Config.bOverlayStats = Button_GetCheck(GetDlgItem(hDlg,IDC_OVERLAYSTATS)) ? true : false;
|
2009-03-08 23:46:47 +00:00
|
|
|
g_Config.bOverlayProjStats = Button_GetCheck(GetDlgItem(hDlg,IDC_OVERLAYPROJSTATS)) ? true : false;
|
2009-10-30 11:03:50 +00:00
|
|
|
g_Config.bWireFrame = Button_GetCheck(GetDlgItem(hDlg,IDC_WIREFRAME)) ? true : false;
|
2008-12-08 05:25:12 +00:00
|
|
|
g_Config.bDumpTextures = Button_GetCheck(GetDlgItem(hDlg,IDC_TEXDUMP)) ? true : false;
|
2009-03-28 21:07:16 +00:00
|
|
|
g_Config.bDumpFrames = Button_GetCheck(GetDlgItem(hDlg,IDC_DUMPFRAMES)) ? true : false;
|
2008-12-08 05:25:12 +00:00
|
|
|
g_Config.bShowShaderErrors = Button_GetCheck(GetDlgItem(hDlg,IDC_SHOWSHADERERRORS)) ? true : false;
|
2009-11-28 05:59:46 +00:00
|
|
|
g_Config.bDisableFog = Button_GetCheck(GetDlgItem(hDlg,IDC_DISABLEFOG)) ? true : false;
|
|
|
|
g_Config.bEFBCopyDisable = Button_GetCheck(GetDlgItem(hDlg,IDC_ENABLEEFBCOPY)) ? false : true;
|
2010-01-29 07:44:21 +00:00
|
|
|
g_Config.bCopyEFBToTexture = Button_GetCheck(GetDlgItem(hDlg,IDC_EFBTORAM)) ? false : true;
|
2010-03-14 18:57:50 +00:00
|
|
|
g_Config.bUseXFB = Button_GetCheck(GetDlgItem(hDlg, IDC_ENABLEXFB)) ? true : false;
|
|
|
|
g_Config.bUseRealXFB = Button_GetCheck(GetDlgItem(hDlg, IDC_ENABLEREALXFB)) ? true : false;
|
2010-02-02 21:56:29 +00:00
|
|
|
g_Config.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx9.ini").c_str());
|
2009-10-30 11:03:50 +00:00
|
|
|
|
2009-11-28 05:59:46 +00:00
|
|
|
if( D3D::dev != NULL ) {
|
ok big changes here:
in videocommon little fix for the alpha test values, return to the original values as they are more accurate.
in D3D:
huge change in state management, now all the state management is centralized and redundant state changes are eliminated.
Fixed the overlapped viewport error in non ati cards:
the error was caused by this: when a viewport is defined larger than the current rendertarget, an error is thrown and the last valid viewport is used, this is the reference behavior, in ati cards if a larger viewport is defined, no eror is returned, the rendering is valid and is rendered using the projection defined by the viewport but limited to the rendertarget are, exactly like opengl or the GC hardware.
to solve this in reference drivers defined a large rendertarget (2x the size of the original) and proceed to render in a centered quad insithe the larger rendertarget, in this way larger viewports always falls inside a valid rendertarget size, the drawback of this is the waste of resources. it can be dynamized, depending or games or changed at runtime when a oversized viewport is detected, but i live that to future commits.
please test this and let me know the results.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4841 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-01-15 15:52:08 +00:00
|
|
|
D3D::SetRenderState( D3DRS_FILLMODE, g_Config.bWireFrame ? D3DFILL_WIREFRAME : D3DFILL_SOLID );
|
2009-11-28 05:59:46 +00:00
|
|
|
}
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct TabEnhancements : public W32Util::Tab
|
|
|
|
{
|
|
|
|
void Init(HWND hDlg)
|
|
|
|
{
|
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_FORCEFILTERING),g_Config.bForceFiltering);
|
2009-09-13 08:21:35 +00:00
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_FORCEANISOTROPY),g_Config.iMaxAnisotropy > 1);
|
2009-12-22 06:47:42 +00:00
|
|
|
Button_SetCheck(GetDlgItem(hDlg, IDC_LOADHIRESTEXTURE), g_Config.bHiresTextures);
|
|
|
|
Button_SetCheck(GetDlgItem(hDlg,IDC_EFBSCALEDCOPY), g_Config.bCopyEFBScaled);
|
|
|
|
|
2009-09-03 19:24:16 +00:00
|
|
|
/*
|
|
|
|
Temporarily disabled the old postprocessing code since it wasn't working anyway.
|
|
|
|
New postprocessing code will come sooner or later, sharing shaders and framework with
|
|
|
|
the GL postprocessing.
|
|
|
|
|
|
|
|
HWND pp = GetDlgItem(hDlg, IDC_POSTPROCESSEFFECT);
|
2008-12-08 05:25:12 +00:00
|
|
|
const char **names = Postprocess::GetPostprocessingNames();
|
|
|
|
int i = 0;
|
|
|
|
while (true)
|
|
|
|
{
|
|
|
|
if (!names[i])
|
|
|
|
break;
|
|
|
|
|
2009-09-02 06:33:41 +00:00
|
|
|
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, names[i], -1, tempwstr, 2000);
|
|
|
|
ComboBox_AddString(pp, tempwstr);
|
2008-12-08 05:25:12 +00:00
|
|
|
i++;
|
|
|
|
}
|
|
|
|
ComboBox_SetCurSel(pp, g_Config.iPostprocessEffect);
|
2009-09-03 19:24:16 +00:00
|
|
|
*/
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
|
|
|
void Command(HWND hDlg,WPARAM wParam)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
switch (LOWORD(wParam))
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
void Apply(HWND hDlg)
|
|
|
|
{
|
2009-09-13 08:21:35 +00:00
|
|
|
g_Config.iMaxAnisotropy = Button_GetCheck(GetDlgItem(hDlg, IDC_FORCEANISOTROPY)) ? 8 : 1;
|
|
|
|
g_Config.bForceFiltering = Button_GetCheck(GetDlgItem(hDlg, IDC_FORCEFILTERING)) ? true : false;
|
2009-12-22 06:47:42 +00:00
|
|
|
g_Config.bHiresTextures = Button_GetCheck(GetDlgItem(hDlg, IDC_LOADHIRESTEXTURE)) ? true : false;
|
|
|
|
g_Config.bCopyEFBScaled = Button_GetCheck(GetDlgItem(hDlg,IDC_EFBSCALEDCOPY)) ? true : false;
|
2010-02-02 21:56:29 +00:00
|
|
|
g_Config.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx9.ini").c_str());
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
void DlgSettings_Show(HINSTANCE hInstance, HWND _hParent)
|
|
|
|
{
|
|
|
|
bool tfoe = g_Config.bTexFmtOverlayEnable;
|
|
|
|
bool tfoc = g_Config.bTexFmtOverlayCenter;
|
|
|
|
|
2010-02-02 21:56:29 +00:00
|
|
|
g_Config.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx9.ini").c_str());
|
2008-12-08 05:25:12 +00:00
|
|
|
W32Util::PropSheet sheet;
|
2009-09-13 08:21:35 +00:00
|
|
|
sheet.Add(new TabDirect3D, (LPCTSTR)IDD_SETTINGS,_T("Direct3D"));
|
|
|
|
sheet.Add(new TabEnhancements, (LPCTSTR)IDD_ENHANCEMENTS,_T("Enhancements"));
|
|
|
|
sheet.Add(new TabAdvanced, (LPCTSTR)IDD_ADVANCED,_T("Advanced"));
|
2009-09-06 02:55:14 +00:00
|
|
|
|
|
|
|
#ifdef DEBUGFAST
|
|
|
|
sheet.Show(hInstance,_hParent,_T("DX9 Graphics Plugin (DEBUGFAST)"));
|
|
|
|
#else
|
|
|
|
#ifndef _DEBUG
|
|
|
|
sheet.Show(hInstance,_hParent,_T("DX9 Graphics Plugin"));
|
|
|
|
#else
|
|
|
|
sheet.Show(hInstance,_hParent,_T("DX9 Graphics Plugin (DEBUG)"));
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2009-09-13 17:46:33 +00:00
|
|
|
if ((tfoe != g_Config.bTexFmtOverlayEnable) ||
|
2008-12-08 05:25:12 +00:00
|
|
|
((g_Config.bTexFmtOverlayEnable) && ( tfoc != g_Config.bTexFmtOverlayCenter)))
|
|
|
|
{
|
2009-03-06 16:47:04 +00:00
|
|
|
TextureCache::Invalidate(false);
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
2010-02-02 21:56:29 +00:00
|
|
|
}
|