Moved per-game graphics configuration to the game-list right click menu. It will be too difficult to make the "profiles" drop-down thing work with 3-state vs 2-state checkboxes. The per-game settings now have "undetermined" states, except for the radio buttons(I'll fix that later). It's super hacky right now. Video config (probably all config stuff) could be redone.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7386 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Jordan Woyak
2011-03-21 05:46:33 +00:00
parent 8eaed1c105
commit 068855bbd6
26 changed files with 462 additions and 522 deletions
+1 -2
View File
@@ -151,8 +151,7 @@ private:
enum HOST_COMM
{
// Begin at 10 in case there is already messages with wParam = 0, 1, 2 and so on
WM_USER_PAUSE = 10,
WM_USER_STOP,
WM_USER_STOP = 10,
WM_USER_CREATE,
WM_USER_SETCURSOR,
WM_USER_KEYDOWN,
@@ -16,6 +16,7 @@
// http://code.google.com/p/dolphin-emu/
#include "VideoBackendBase.h"
#include "../../VideoCommon/Src/VideoConfig.h"
// TODO: ugly
#ifdef _WIN32
@@ -73,3 +74,13 @@ void VideoBackend::ActivateBackend(const std::string& name)
if (name == (*it)->GetName())
g_video_backend = *it;
}
void VideoBackend::LoadConfig()
{
g_Config.Load(((File::GetUserPath(D_CONFIG_IDX) + ini_name) + ".ini").c_str());
}
void VideoBackend::SaveConfig()
{
g_Config.Save(((File::GetUserPath(D_CONFIG_IDX) + ini_name) + ".ini").c_str());
}
+10
View File
@@ -83,6 +83,10 @@ struct SCPFifoStruct
class VideoBackend
{
public:
const char* const ini_name;
VideoBackend(const char* _ini_name) : ini_name(_ini_name) {}
virtual ~VideoBackend() {}
virtual void EmuStateChange(EMUSTATE_CHANGE) = 0;
@@ -127,6 +131,9 @@ public:
virtual writeFn16 Video_PEWrite16() = 0;
virtual writeFn32 Video_PEWrite32() = 0;
void LoadConfig();
void SaveConfig();
static void PopulateList();
static void ClearList();
static void ActivateBackend(const std::string& name);
@@ -138,6 +145,9 @@ extern VideoBackend* g_video_backend;
// inherited by dx9/dx11/ogl backends
class VideoBackendHardware : public VideoBackend
{
protected:
VideoBackendHardware(const char* _ini_name) : VideoBackend(_ini_name) {}
void DoState(PointerWrap &p);
void RunLoop(bool enable);
+4
View File
@@ -1377,7 +1377,11 @@ void CConfigMain::OnSelectionChanged(wxCommandEvent& ev)
void CConfigMain::OnConfig(wxCommandEvent&)
{
if (g_video_backend)
{
g_video_backend->LoadConfig();
g_video_backend->ShowConfig(this);
g_video_backend->SaveConfig();
}
}
// Search for avaliable resolutions
+1 -9
View File
@@ -127,19 +127,10 @@ CPanel::CPanel(
case WM_USER:
switch(wParam)
{
// Pause
case WM_USER_PAUSE:
main_frame->DoPause();
break;
// Stop
case WM_USER_STOP:
main_frame->DoStop();
break;
case WM_USER_CREATE:
break;
case WM_USER_SETCURSOR:
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor &&
main_frame->RendererHasFocus() && Core::GetState() == Core::CORE_RUN)
@@ -180,6 +171,7 @@ CPanel::CPanel(
}
}
break;
default:
// By default let wxWidgets do what it normally does with this event
return wxPanel::MSWWindowProc(nMsg, wParam, lParam);
+4
View File
@@ -1161,7 +1161,11 @@ void CFrame::OnConfigMain(wxCommandEvent& WXUNUSED (event))
void CFrame::OnConfigGFX(wxCommandEvent& WXUNUSED (event))
{
if (g_video_backend)
{
g_video_backend->LoadConfig();
g_video_backend->ShowConfig(this);
g_video_backend->SaveConfig();
}
}
void CFrame::OnConfigDSP(wxCommandEvent& WXUNUSED (event))
@@ -29,6 +29,7 @@
#include "Blob.h"
#include "Core.h"
#include "ISOProperties.h"
#include "VideoConfigDiag.h"
#include "IniFile.h"
#include "FileUtil.h"
#include "CDUtils.h"
@@ -124,6 +125,7 @@ BEGIN_EVENT_TABLE(CGameListCtrl, wxListCtrl)
EVT_LIST_COL_BEGIN_DRAG(LIST_CTRL, CGameListCtrl::OnColBeginDrag)
EVT_LIST_COL_CLICK(LIST_CTRL, CGameListCtrl::OnColumnClick)
EVT_MENU(IDM_PROPERTIES, CGameListCtrl::OnProperties)
EVT_MENU(IDM_GAMEVIDEOCONFIG, CGameListCtrl::OnGameVideoConfig)
EVT_MENU(IDM_GAMEWIKI, CGameListCtrl::OnWiki)
EVT_MENU(IDM_OPENCONTAININGFOLDER, CGameListCtrl::OnOpenContainingFolder)
EVT_MENU(IDM_OPENSAVEFOLDER, CGameListCtrl::OnOpenSaveFolder)
@@ -999,6 +1001,7 @@ void CGameListCtrl::OnRightClick(wxMouseEvent& event)
{
wxMenu* popupMenu = new wxMenu;
popupMenu->Append(IDM_PROPERTIES, _("&Properties"));
popupMenu->Append(IDM_GAMEVIDEOCONFIG, _("&Graphics Configuration"));
popupMenu->Append(IDM_GAMEWIKI, _("&Wiki"));
popupMenu->AppendSeparator();
@@ -1167,6 +1170,31 @@ void CGameListCtrl::OnProperties(wxCommandEvent& WXUNUSED (event))
Update();
}
void CGameListCtrl::OnGameVideoConfig(wxCommandEvent&)
{
const GameListItem* const iso = GetSelectedISO();
if (!iso)
return;
VideoConfig const vc = g_Config;
g_Config.SetAllUndetermined();
// ugly
DiscIO::IVolume* const open_iso = DiscIO::CreateVolumeFromFilename(iso->GetFileName());
std::string const unique_id = open_iso->GetUniqueID();
std::string const ini_path = File::GetUserPath(D_GAMECONFIG_IDX) + unique_id + ".ini";
g_Config.GameIniLoad(ini_path.c_str());
delete open_iso;
VideoConfigDiag vcd(this, unique_id, true);
vcd.ShowModal();
g_Config.GameIniSave(ini_path.c_str());
g_Config = vc;
}
void CGameListCtrl::OnWiki(wxCommandEvent& WXUNUSED (event))
{
const GameListItem *iso = GetSelectedISO();
+1
View File
@@ -98,6 +98,7 @@ private:
void OnKeyPress(wxListEvent& event);
void OnSize(wxSizeEvent& event);
void OnProperties(wxCommandEvent& event);
void OnGameVideoConfig(wxCommandEvent&);
void OnWiki(wxCommandEvent& event);
void OnOpenContainingFolder(wxCommandEvent& event);
void OnOpenSaveFolder(wxCommandEvent& event);
+1
View File
@@ -92,6 +92,7 @@ enum
IDM_RESTART,
IDM_CHANGEDISC,
IDM_PROPERTIES,
IDM_GAMEVIDEOCONFIG,
IDM_GAMEWIKI,
IDM_LOAD_WII_MENU,
IDM_CONNECT_WIIMOTE1,
File diff suppressed because it is too large Load Diff
+27 -91
View File
@@ -17,25 +17,40 @@
#include <wx/panel.h>
#include <wx/spinctrl.h>
template <typename W>
class BoolSetting : public W
class SettingCheckBox : public wxCheckBox
{
public:
BoolSetting(wxWindow* parent, const wxString& label, const wxString& tooltip, bool &setting, bool reverse = false, long style = 0);
SettingCheckBox(wxWindow* parent, const wxString& label, const wxString& tooltip,
bool &setting, long style = 0);
void UpdateValue(wxCommandEvent& ev)
{
int const val = Get3StateValue();
*reinterpret_cast<u8*>(&m_setting) = (u8)val;
ev.Skip();
}
private:
bool &m_setting;
};
class SettingRadioButton : public wxRadioButton
{
public:
SettingRadioButton(wxWindow* parent, const wxString& label, const wxString& tooltip,
bool &setting, bool reverse = false, long style = 0);
void UpdateValue(wxCommandEvent& ev)
{
m_setting = (ev.GetInt() != 0) ^ m_reverse;
ev.Skip();
}
private:
bool &m_setting;
const bool m_reverse;
};
typedef BoolSetting<wxCheckBox> SettingCheckBox;
typedef BoolSetting<wxRadioButton> SettingRadioButton;
template <typename T>
class IntegerSetting : public wxSpinCtrl
{
@@ -47,6 +62,7 @@ public:
m_setting = ev.GetInt();
ev.Skip();
}
private:
T& m_setting;
};
@@ -57,7 +73,9 @@ class SettingChoice : public wxChoice
{
public:
SettingChoice(wxWindow* parent, int &setting, const wxString& tooltip, int num = 0, const wxString choices[] = NULL, long style = 0);
void UpdateValue(wxCommandEvent& ev);
private:
int &m_setting;
};
@@ -67,9 +85,9 @@ class CGameListCtrl;
class VideoConfigDiag : public wxDialog
{
public:
VideoConfigDiag(wxWindow* parent, const std::string &title, const std::string& ininame);
VideoConfigDiag(wxWindow* parent, const std::string &title, bool is_game_config = false);
protected:
private:
void Event_Backend(wxCommandEvent &ev) { ev.Skip(); } // TODO: Query list of supported AA modes
void Event_Adapter(wxCommandEvent &ev) { ev.Skip(); } // TODO
@@ -90,92 +108,10 @@ protected:
void Event_ClickClose(wxCommandEvent&);
void Event_Close(wxCloseEvent&);
void Event_OnProfileChange(wxCommandEvent& ev);
// Enables/disables UI elements depending on current config - if appropriate also updates g_Config
void OnUpdateUI(wxUpdateUIEvent& ev);
// Refresh UI values from current config (used when reloading config)
void SetUIValuesFromConfig();
// Don't mess with keeping two comboboxes in sync, use only one CB instead..
SettingChoice* profile_cb; // "General" tab
wxStaticText* profile_text; // "Advanced" tab
wxChoice* choice_adapter;
wxChoice* choice_aspect;
SettingCheckBox* widescreen_hack;
SettingCheckBox* vsync;
SettingChoice* anisotropic_filtering;
wxStaticText* text_aamode;
SettingChoice* choice_aamode;
SettingCheckBox* native_mips;
SettingCheckBox* efb_scaled_copy;
SettingCheckBox* pixel_lighting;
SettingCheckBox* pixel_depth;
SettingCheckBox* force_filtering;
SettingCheckBox* _3d_vision;
wxChoice* choice_efbscale;
SettingCheckBox* efbaccess_enable;
SettingCheckBox* emulate_efb_format_changes;
SettingCheckBox* efbcopy_enable;
SettingRadioButton* efbcopy_texture;
SettingRadioButton* efbcopy_ram;
SettingCheckBox* cache_efb_copies;
SettingCheckBox* stc_enable;
wxRadioButton* stc_safe;
wxRadioButton* stc_normal;
wxRadioButton* stc_fast;
SettingCheckBox* wireframe;
SettingCheckBox* disable_lighting;
SettingCheckBox* disable_textures;
SettingCheckBox* disable_fog;
SettingCheckBox* disable_dst_alpha;
SettingCheckBox* show_fps;
SettingCheckBox* overlay_stats;
SettingCheckBox* overlay_proj_stats;
SettingCheckBox* texfmt_overlay;
SettingCheckBox* efb_copy_regions;
SettingCheckBox* show_shader_errors;
SettingCheckBox* show_input_display;
SettingCheckBox* enable_xfb;
SettingRadioButton* virtual_xfb;
SettingRadioButton* real_xfb;
SettingCheckBox* dump_textures;
SettingCheckBox* hires_textures;
SettingCheckBox* dump_efb;
SettingCheckBox* dump_frames;
SettingCheckBox* free_look;
SettingCheckBox* frame_dumps_via_ffv1;
SettingCheckBox* crop;
SettingCheckBox* opencl;
SettingCheckBox* dlcache;
SettingCheckBox* hotkeys;
SettingCheckBox* ompdecoder;
wxChoice* choice_ppshader;
// TODO: Add options for
//vconfig.bTexFmtOverlayCenter
//vconfig.bAnaglyphStereo
//vconfig.iAnaglyphStereoSeparation
//vconfig.iAnaglyphFocalAngle
//vconfig.bShowEFBCopyRegions
//vconfig.iCompileDLsLevel
VideoConfig vconfig;
std::string ininame;
int cur_profile;
const CGameListCtrl *GameListCtrl;
VideoConfig& vconfig;
};
#endif
+22 -23
View File
@@ -685,17 +685,13 @@ PC_TexFormat GetPC_TexFormat(int texformat, int tlutfmt)
return PC_TEX_FMT_NONE;
}
//switch endianness, unswizzle
//TODO: to save memory, don't blindly convert everything to argb8888
//also ARGB order needs to be swapped later, to accommodate modern hardware better
//need to add DXT support too
PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int height, int texformat, int tlutaddr, int tlutfmt)
inline void SetOpenMPThreadCount(int width, int height)
{
#ifdef _OPENMP
//Dont use multithreading in small Textures
if ((width > 127 && height > 127) && g_ActiveConfig.bOMPDecoder)
// Dont use multithreading in small Textures
if (g_ActiveConfig.bOMPDecoder && width > 127 && height > 127)
{
//don't span to many threads they will kill the rest of the emu :)
// don't span to many threads they will kill the rest of the emu :)
omp_set_num_threads((cpu_info.num_cores + 2) / 3);
}
else
@@ -703,8 +699,19 @@ PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int heigh
omp_set_num_threads(1);
}
#endif
int Wsteps4 = (width + 3) / 4;
int Wsteps8 = (width + 7) / 8;
}
//switch endianness, unswizzle
//TODO: to save memory, don't blindly convert everything to argb8888
//also ARGB order needs to be swapped later, to accommodate modern hardware better
//need to add DXT support too
PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int height, int texformat, int tlutaddr, int tlutfmt)
{
SetOpenMPThreadCount(width, height);
const int Wsteps4 = (width + 3) / 4;
const int Wsteps8 = (width + 7) / 8;
switch (texformat)
{
case GX_TF_C4:
@@ -967,19 +974,11 @@ PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int heigh
PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int height, int texformat, int tlutaddr, int tlutfmt)
{
#ifdef _OPENMP
if ((width > 127 && height > 127) && g_ActiveConfig.bOMPDecoder)
{
//don't span to many threads they will kill the rest of the emu :)
omp_set_num_threads((cpu_info.num_cores + 2) / 3);
}
else
{
omp_set_num_threads(1);
}
#endif
int Wsteps4 = (width + 3) / 4;
int Wsteps8 = (width + 7) / 8;
SetOpenMPThreadCount(width, height);
const int Wsteps4 = (width + 3) / 4;
const int Wsteps8 = (width + 7) / 8;
switch (texformat)
{
case GX_TF_C4:
+8 -3
View File
@@ -296,9 +296,14 @@ void VertexLoader::CompileVertexTranslator()
// Normals
vtx_decl.num_normals = 0;
if (m_VtxDesc.Normal != NOT_PRESENT) {
m_VertexSize += VertexLoader_Normal::GetSize(m_VtxDesc.Normal, m_VtxAttr.NormalFormat, m_VtxAttr.NormalElements, m_VtxAttr.NormalIndex3);
TPipelineFunction pFunc = VertexLoader_Normal::GetFunction(m_VtxDesc.Normal, m_VtxAttr.NormalFormat, m_VtxAttr.NormalElements, m_VtxAttr.NormalIndex3, g_Config.backend_info.bAllowSignedBytes);
if (m_VtxDesc.Normal != NOT_PRESENT)
{
m_VertexSize += VertexLoader_Normal::GetSize(m_VtxDesc.Normal,
m_VtxAttr.NormalFormat, m_VtxAttr.NormalElements, m_VtxAttr.NormalIndex3);
TPipelineFunction pFunc = VertexLoader_Normal::GetFunction(m_VtxDesc.Normal,
m_VtxAttr.NormalFormat, m_VtxAttr.NormalElements, m_VtxAttr.NormalIndex3);
if (pFunc == 0)
{
char temp[256];
@@ -104,12 +104,14 @@ void VertexLoader_Normal::Init(void)
m_Table[NRM_INDEX16][NRM_INDICES3][NRM_NBT3][FORMAT_FLOAT] = Set(6, Normal_Index16_Float3_Indices3);
}
unsigned int VertexLoader_Normal::GetSize(unsigned int _type, unsigned int _format, unsigned int _elements, unsigned int _index3)
unsigned int VertexLoader_Normal::GetSize(unsigned int _type,
unsigned int _format, unsigned int _elements, unsigned int _index3)
{
return m_Table[_type][_index3][_elements][_format].gc_size;
}
TPipelineFunction VertexLoader_Normal::GetFunction(unsigned int _type, unsigned int _format, unsigned int _elements, unsigned int _index3, bool allow_signed_bytes)
TPipelineFunction VertexLoader_Normal::GetFunction(unsigned int _type,
unsigned int _format, unsigned int _elements, unsigned int _index3)
{
TPipelineFunction pFunc = m_Table[_type][_index3][_elements][_format].function;
return pFunc;
@@ -29,10 +29,12 @@ public:
static void Init(void);
// GetSize
static unsigned int GetSize(unsigned int _type, unsigned int _format, unsigned int _elements, unsigned int _index3);
static unsigned int GetSize(unsigned int _type, unsigned int _format,
unsigned int _elements, unsigned int _index3);
// GetFunction
static TPipelineFunction GetFunction(unsigned int _type, unsigned int _format, unsigned int _elements, unsigned int _index3, bool allow_signed_bytes);
static TPipelineFunction GetFunction(unsigned int _type,
unsigned int _format, unsigned int _elements, unsigned int _index3);
private:
enum ENormalType
+146 -65
View File
@@ -41,7 +41,6 @@ VideoConfig::VideoConfig()
// disable all features by default
backend_info.APIType = API_NONE;
backend_info.bAllowSignedBytes = false;
backend_info.bUseRGBATextures = false;
backend_info.bSupports3DVision = false;
}
@@ -301,86 +300,168 @@ void VideoConfig::Save(const char *ini_file)
iniFile.Save(ini_file);
}
void VideoConfig::GameIniSave(const char* default_ini, const char* game_ini)
// haxhaxhax
static void SetUndetermined(bool& val)
{
// wxWidgets doesn't provide us with a nice way to change 3-state checkboxes into 2-state ones
// This would allow us to make the "default config" dialog layout to be 2-state based, but the
// "game config" layout to be 3-state based (with the 3rd state being "use default")
// Since we can't do that, we instead just save anything which differs from the default config
// TODO: Make this less ugly
// lul, storing a u8 inside a bool
*reinterpret_cast<u8*>(&val) = 2;
}
VideoConfig defCfg;
defCfg.Load(default_ini);
static void SetUndetermined(int& val)
{
val = -1;
}
IniFile iniFile;
iniFile.Load(game_ini);
void VideoConfig::SetAllUndetermined()
{
// video hardware
SetUndetermined(bVSync);
SetUndetermined(iAdapter);
#define SET_IF_DIFFERS(section, key, member) { if ((member) != (defCfg.member)) iniFile.Set((section), (key), (member)); else iniFile.DeleteKey((section), (key)); }
// video settings
SetUndetermined(bWidescreenHack);
SetUndetermined(iAspectRatio);
SetUndetermined(bCrop);
SetUndetermined(bUseXFB);
SetUndetermined(bUseRealXFB);
SetUndetermined(bUseNativeMips);
SET_IF_DIFFERS("Video_Hardware", "VSync", bVSync);
SET_IF_DIFFERS("Video_Settings", "wideScreenHack", bWidescreenHack);
SET_IF_DIFFERS("Video_Settings", "AspectRatio", iAspectRatio);
SET_IF_DIFFERS("Video_Settings", "Crop", bCrop);
SET_IF_DIFFERS("Video_Settings", "UseXFB", bUseXFB);
SET_IF_DIFFERS("Video_Settings", "UseRealXFB", bUseRealXFB);
SET_IF_DIFFERS("Video_Settings", "UseNativeMips", bUseNativeMips);
SetUndetermined(bSafeTextureCache);
SetUndetermined(iSafeTextureCache_ColorSamples);
SET_IF_DIFFERS("Video_Settings", "SafeTextureCache", bSafeTextureCache);
SET_IF_DIFFERS("Video_Settings", "SafeTextureCacheColorSamples", iSafeTextureCache_ColorSamples);
SetUndetermined(bShowFPS);
SetUndetermined(bShowInputDisplay);
SetUndetermined(bOverlayStats);
SetUndetermined(bOverlayProjStats);
SetUndetermined(bShowEFBCopyRegions);
SetUndetermined(iCompileDLsLevel);
SetUndetermined(bDumpTextures);
SetUndetermined(bHiresTextures);
SetUndetermined(bDumpEFBTarget);
SetUndetermined(bDumpFrames);
SetUndetermined(bFreeLook);
SetUndetermined(bUseFFV1);
SetUndetermined(bAnaglyphStereo);
SetUndetermined(iAnaglyphStereoSeparation);
SetUndetermined(iAnaglyphFocalAngle);
SetUndetermined(bEnablePixelLighting);
SetUndetermined(bEnablePerPixelDepth);
SET_IF_DIFFERS("Video_Settings", "ShowFPS", bShowFPS);
SET_IF_DIFFERS("Video_Settings", "ShowInputDisplay", bShowInputDisplay);
SET_IF_DIFFERS("Video_Settings", "OverlayStats", bOverlayStats);
SET_IF_DIFFERS("Video_Settings", "OverlayProjStats", bOverlayProjStats);
SET_IF_DIFFERS("Video_Settings", "ShowEFBCopyRegions", bShowEFBCopyRegions);
SET_IF_DIFFERS("Video_Settings", "DLOptimize", iCompileDLsLevel);
SET_IF_DIFFERS("Video_Settings", "DumpTextures", bDumpTextures);
SET_IF_DIFFERS("Video_Settings", "HiresTextures", bHiresTextures);
SET_IF_DIFFERS("Video_Settings", "DumpEFBTarget", bDumpEFBTarget);
SET_IF_DIFFERS("Video_Settings", "DumpFrames", bDumpFrames);
SET_IF_DIFFERS("Video_Settings", "FreeLook", bFreeLook);
SET_IF_DIFFERS("Video_Settings", "UseFFV1", bUseFFV1);
SET_IF_DIFFERS("Video_Settings", "AnaglyphStereo", bAnaglyphStereo);
SET_IF_DIFFERS("Video_Settings", "AnaglyphStereoSeparation", iAnaglyphStereoSeparation);
SET_IF_DIFFERS("Video_Settings", "AnaglyphFocalAngle", iAnaglyphFocalAngle);
SET_IF_DIFFERS("Video_Settings", "EnablePixelLighting", bEnablePixelLighting);
SET_IF_DIFFERS("Video_Settings", "EnablePerPixelDepth", bEnablePerPixelDepth);
SetUndetermined(bShowShaderErrors);
SetUndetermined(iMultisampleMode);
SetUndetermined(iEFBScale);
SET_IF_DIFFERS("Video_Settings", "ShowShaderErrors", bShowShaderErrors);
SET_IF_DIFFERS("Video_Settings", "MSAA", iMultisampleMode);
SET_IF_DIFFERS("Video_Settings", "EFBScale", iEFBScale); // integral
SetUndetermined(bDstAlphaPass);
SET_IF_DIFFERS("Video_Settings", "DstAlphaPass", bDstAlphaPass);
SetUndetermined(bTexFmtOverlayEnable);
SetUndetermined(bTexFmtOverlayCenter);
SetUndetermined(bWireFrame);
SetUndetermined(bDisableLighting);
SetUndetermined(bDisableTexturing);
SetUndetermined(bDisableFog);
SET_IF_DIFFERS("Video_Settings", "TexFmtOverlayEnable", bTexFmtOverlayEnable);
SET_IF_DIFFERS("Video_Settings", "TexFmtOverlayCenter", bTexFmtOverlayCenter);
SET_IF_DIFFERS("Video_Settings", "WireFrame", bWireFrame);
SET_IF_DIFFERS("Video_Settings", "DisableLighting", bDisableLighting);
SET_IF_DIFFERS("Video_Settings", "DisableTexturing", bDisableTexturing);
SET_IF_DIFFERS("Video_Settings", "DisableFog", bDisableFog);
SET_IF_DIFFERS("Video_Settings", "EnableOpenCL", bEnableOpenCL);
SetUndetermined(bEnableOpenCL);
#ifdef _OPENMP
SET_IF_DIFFERS("Video_Settings", "OMPDecoder", bOMPDecoder);
SetUndetermined(bOMPDecoder);
#endif
SET_IF_DIFFERS("Video_Enhancements", "ForceFiltering", bForceFiltering);
SET_IF_DIFFERS("Video_Enhancements", "MaxAnisotropy", iMaxAnisotropy); // NOTE - this is x in (1 << x)
SET_IF_DIFFERS("Video_Enhancements", "PostProcessingShader", sPostProcessingShader);
SET_IF_DIFFERS("Video_Enhancements", "Enable3dVision", b3DVision);
// video enhancements
SetUndetermined(bForceFiltering);
SetUndetermined(iMaxAnisotropy);
//SetUndetermined(sPostProcessingShader);
SetUndetermined(b3DVision);
SET_IF_DIFFERS("Video_Hacks", "EFBAccessEnable", bEFBAccessEnable);
SET_IF_DIFFERS("Video_Hacks", "DlistCachingEnable", bDlistCachingEnable);
SET_IF_DIFFERS("Video_Hacks", "EFBCopyEnable", bEFBCopyEnable);
SET_IF_DIFFERS("Video_Hacks", "EFBCopyDisableHotKey", bOSDHotKey);
SET_IF_DIFFERS("Video_Hacks", "EFBToTextureEnable", bCopyEFBToTexture);
SET_IF_DIFFERS("Video_Hacks", "EFBScaledCopy", bCopyEFBScaled);
SET_IF_DIFFERS("Video_Hacks", "EFBCopyCacheEnable", bEFBCopyCacheEnable);
SET_IF_DIFFERS("Video_Hacks", "EFBEmulateFormatChanges", bEFBEmulateFormatChanges);
// video hacks
SetUndetermined(bEFBAccessEnable);
SetUndetermined(bDlistCachingEnable);
SetUndetermined(bEFBCopyEnable);
SetUndetermined(bOSDHotKey);
SetUndetermined(bCopyEFBToTexture);
SetUndetermined(bCopyEFBScaled);
SetUndetermined(bEFBCopyCacheEnable);
SetUndetermined(bEFBEmulateFormatChanges);
SET_IF_DIFFERS("Video_Hardware", "Adapter", iAdapter);
// this doesn't belong here, o well
backend_info = BackendInfo();
}
iniFile.Save(game_ini);
void VideoConfig::GameIniSave(const char* game_ini)
{
IniFile ini_file;
ini_file.Load(game_ini);
// video hardware
IniFile::Section& vid_hardware = *ini_file.GetOrCreateSection("Video_Hardware");
SetIfDetermined(vid_hardware, "VSync", bVSync);
SetIfDetermined(vid_hardware, "Adapter", iAdapter);
// video settings
IniFile::Section& vid_settings = *ini_file.GetOrCreateSection("Video_Settings");
SetIfDetermined(vid_settings, "wideScreenHack", bWidescreenHack);
SetIfDetermined(vid_settings, "AspectRatio", iAspectRatio);
SetIfDetermined(vid_settings, "Crop", bCrop);
SetIfDetermined(vid_settings, "UseXFB", bUseXFB);
SetIfDetermined(vid_settings, "UseRealXFB", bUseRealXFB);
SetIfDetermined(vid_settings, "UseNativeMips", bUseNativeMips);
SetIfDetermined(vid_settings, "SafeTextureCache", bSafeTextureCache);
SetIfDetermined(vid_settings, "SafeTextureCacheColorSamples", iSafeTextureCache_ColorSamples);
SetIfDetermined(vid_settings, "ShowFPS", bShowFPS);
SetIfDetermined(vid_settings, "ShowInputDisplay", bShowInputDisplay);
SetIfDetermined(vid_settings, "OverlayStats", bOverlayStats);
SetIfDetermined(vid_settings, "OverlayProjStats", bOverlayProjStats);
SetIfDetermined(vid_settings, "ShowEFBCopyRegions", bShowEFBCopyRegions);
SetIfDetermined(vid_settings, "DLOptimize", iCompileDLsLevel);
SetIfDetermined(vid_settings, "DumpTextures", bDumpTextures);
SetIfDetermined(vid_settings, "HiresTextures", bHiresTextures);
SetIfDetermined(vid_settings, "DumpEFBTarget", bDumpEFBTarget);
SetIfDetermined(vid_settings, "DumpFrames", bDumpFrames);
SetIfDetermined(vid_settings, "FreeLook", bFreeLook);
SetIfDetermined(vid_settings, "UseFFV1", bUseFFV1);
SetIfDetermined(vid_settings, "AnaglyphStereo", bAnaglyphStereo);
SetIfDetermined(vid_settings, "AnaglyphStereoSeparation", iAnaglyphStereoSeparation);
SetIfDetermined(vid_settings, "AnaglyphFocalAngle", iAnaglyphFocalAngle);
SetIfDetermined(vid_settings, "EnablePixelLighting", bEnablePixelLighting);
SetIfDetermined(vid_settings, "EnablePerPixelDepth", bEnablePerPixelDepth);
SetIfDetermined(vid_settings, "ShowShaderErrors", bShowShaderErrors);
SetIfDetermined(vid_settings, "MSAA", iMultisampleMode);
SetIfDetermined(vid_settings, "EFBScale", iEFBScale); // integral
SetIfDetermined(vid_settings, "DstAlphaPass", bDstAlphaPass);
SetIfDetermined(vid_settings, "TexFmtOverlayEnable", bTexFmtOverlayEnable);
SetIfDetermined(vid_settings, "TexFmtOverlayCenter", bTexFmtOverlayCenter);
SetIfDetermined(vid_settings, "WireFrame", bWireFrame);
SetIfDetermined(vid_settings, "DisableLighting", bDisableLighting);
SetIfDetermined(vid_settings, "DisableTexturing", bDisableTexturing);
SetIfDetermined(vid_settings, "DisableFog", bDisableFog);
SetIfDetermined(vid_settings, "EnableOpenCL", bEnableOpenCL);
#ifdef _OPENMP
SetIfDetermined(vid_settings, "OMPDecoder", bOMPDecoder);
#endif
// video enhancements
IniFile::Section& vid_enhancements = *ini_file.GetOrCreateSection("Video_Enhancements");
SetIfDetermined(vid_enhancements, "ForceFiltering", bForceFiltering);
SetIfDetermined(vid_enhancements, "MaxAnisotropy", iMaxAnisotropy); // NOTE - this is x in (1 << x)
//SetIfDetermined(vid_enhancements, "PostProcessingShader", sPostProcessingShader);
SetIfDetermined(vid_enhancements, "Enable3dVision", b3DVision);
// video hacks
IniFile::Section& vid_hacks = *ini_file.GetOrCreateSection("Video_Hacks");
SetIfDetermined(vid_hacks, "EFBAccessEnable", bEFBAccessEnable);
SetIfDetermined(vid_hacks, "DlistCachingEnable", bDlistCachingEnable);
SetIfDetermined(vid_hacks, "EFBCopyEnable", bEFBCopyEnable);
SetIfDetermined(vid_hacks, "EFBCopyDisableHotKey", bOSDHotKey);
SetIfDetermined(vid_hacks, "EFBToTextureEnable", bCopyEFBToTexture);
SetIfDetermined(vid_hacks, "EFBScaledCopy", bCopyEFBScaled);
SetIfDetermined(vid_hacks, "EFBCopyCacheEnable", bEFBCopyCacheEnable);
SetIfDetermined(vid_hacks, "EFBEmulateFormatChanges", bEFBEmulateFormatChanges);
ini_file.Save(game_ini);
}
+29 -3
View File
@@ -27,6 +27,7 @@
#include "Common.h"
#include "VideoCommon.h"
#include "IniFile.h"
#include <vector>
#include <string>
@@ -66,9 +67,12 @@ struct VideoConfig
void GameIniLoad(const char *ini_file);
void VerifyValidity();
void Save(const char *ini_file);
void GameIniSave(const char* default_ini, const char* game_ini);
void GameIniSave(const char* game_ini);
void UpdateProjectionHack();
// some hacks used for per-game config
void SetAllUndetermined();
// General
bool bVSync;
@@ -149,7 +153,7 @@ struct VideoConfig
int iAdapter;
// Static config per API
struct
struct BackendInfo
{
API_TYPE APIType;
@@ -159,11 +163,33 @@ struct VideoConfig
bool bUseRGBATextures; // used for D3D11 in TextureCache
bool bSupports3DVision;
bool bAllowSignedBytes; // D3D9 doesn't support signed bytes (?)
bool bSupportsDualSourceBlend; // only supported by D3D11 and OpenGL
bool bSupportsFormatReinterpretation;
bool bSupportsPixelLighting;
} backend_info;
// haxhaxhax
static bool IsUndetermined(const bool& val)
{
// lul, storing a u8 inside a bool
return (*reinterpret_cast<const u8*>(&val) > 1);
}
static bool IsUndetermined(int val)
{
return (val < 0);
}
private:
template <typename T>
void SetIfDetermined(IniFile::Section& sect, const char* key, const T& value)
{
if (IsUndetermined(value))
sect.Delete(key);
else
sect.Set(key, value);
}
};
extern VideoConfig g_Config;
@@ -9,6 +9,9 @@ namespace DX11
class VideoBackend : public VideoBackendHardware
{
public:
VideoBackend() : VideoBackendHardware("gfx_dx11") {}
bool Initialize(void *&);
void Shutdown();
+2 -3
View File
@@ -83,7 +83,6 @@ void InitBackendInfo()
g_Config.backend_info.APIType = API_D3D11;
g_Config.backend_info.bUseRGBATextures = true; // the GX formats barely match any D3D11 formats
g_Config.backend_info.bSupports3DVision = false;
g_Config.backend_info.bAllowSignedBytes = true;
g_Config.backend_info.bSupportsDualSourceBlend = true;
g_Config.backend_info.bSupportsFormatReinterpretation = true;
g_Config.backend_info.bSupportsPixelLighting = true;
@@ -142,7 +141,7 @@ void VideoBackend::ShowConfig(void *_hParent)
// Clear ppshaders string vector
g_Config.backend_info.PPShaders.clear();
VideoConfigDiag diag((wxWindow*)_hParent, _trans("Direct3D11"), "gfx_dx11");
VideoConfigDiag diag((wxWindow*)_hParent, _trans("Direct3D11"));
diag.ShowModal();
g_Config.backend_info.Adapters.clear();
@@ -157,7 +156,7 @@ bool VideoBackend::Initialize(void *&window_handle)
frameCount = 0;
g_Config.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_dx11.ini").c_str());
LoadConfig();
g_Config.GameIniLoad(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str());
UpdateProjectionHack(g_Config.iPhackvalue, g_Config.sPhackvalue);
UpdateActiveConfig();
@@ -9,6 +9,9 @@ namespace DX9
class VideoBackend : public VideoBackendHardware
{
public:
VideoBackend() : VideoBackendHardware("gfx_dx9") {}
bool Initialize(void *&);
void Shutdown();

Some files were not shown because too many files have changed in this diff Show More