diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Config.cpp b/Source/Plugins/Plugin_VideoDX9/Src/Config.cpp index ae474b5a93..ac8b685d62 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/Config.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/Config.cpp @@ -17,6 +17,7 @@ #include "Config.h" #include "IniFile.h" +#include "globals.h" #include "../../../Core/Core/Src/ConfigManager.h" // FIXME Config g_Config; @@ -82,3 +83,41 @@ void Config::Save() iniFile.Set("Enhancements", "ForceMaxAniso", bForceMaxAniso); iniFile.Save(FULL_CONFIG_DIR "gfx_dx9.ini"); } + +void Config::GameIniLoad() +{ + // This function is copied from OGL plugin, slightly modified. + IniFile *iniFile = ((struct SConfig *)globals->config)->m_LocalCoreStartupParameter.gameIni; + if (! iniFile) + return; + + if (iniFile->Exists("Video", "ForceFiltering")) + iniFile->Get("Video", "ForceFiltering", &bForceFiltering, 0); + + //if (iniFile->Exists("Video", "MaxAnisotropy")) + // iniFile->Get("Video", "MaxAnisotropy", &iMaxAnisotropy, 3); // NOTE - this is x in (1 << x) + + if (iniFile->Exists("Video", "EFBCopyDisable")) + iniFile->Get("Video", "EFBCopyDisable", &bEFBCopyDisable, 0); + + //if (iniFile->Exists("Video", "EFBCopyDisableHotKey")) + // iniFile->Get("Video", "EFBCopyDisableHotKey", &bEFBCopyDisableHotKey, 0); + + if (iniFile->Exists("Video", "EFBToRAMEnable")) + iniFile->Get("Video", "EFBToRAMEnable", &bCopyEFBToRAM, 0); + + if (iniFile->Exists("Video", "SafeTextureCache")) + iniFile->Get("Video", "SafeTextureCache", &bSafeTextureCache, bSafeTextureCache); + + //if (iniFile->Exists("Video", "MSAA")) + // iniFile->Get("Video", "MSAA", &iMultisampleMode, 0); + + if (iniFile->Exists("Video", "DstAlphaPass")) + iniFile->Get("Video", "DstAlphaPass", &bDstAlphaPass, bDstAlphaPass); + + if (iniFile->Exists("Video", "UseXFB")) + iniFile->Get("Video", "UseXFB", &bUseXFB, 0); + + if (iniFile->Exists("Video", "ProjectionHack")) + iniFile->Get("Video", "ProjectionHack", &iPhackvalue, 0); +} diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Config.h b/Source/Plugins/Plugin_VideoDX9/Src/Config.h index 9612c0953d..3958fac0fa 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/Config.h +++ b/Source/Plugins/Plugin_VideoDX9/Src/Config.h @@ -25,6 +25,7 @@ struct Config Config(); void Load(); void Save(); + void GameIniLoad(); int iAdapter; int iFSResolution; @@ -60,6 +61,14 @@ struct Config bool bTexFmtOverlayEnable; bool bTexFmtOverlayCenter; + // from game INI file, import from OGL plugin + bool bSafeTextureCache; + bool bEFBCopyDisable; + bool bCopyEFBToRAM; + bool bDstAlphaPass; + bool bUseXFB; + int iPhackvalue; + std::string texDumpPath; }; diff --git a/Source/Plugins/Plugin_VideoDX9/Src/main.cpp b/Source/Plugins/Plugin_VideoDX9/Src/main.cpp index 43f5a249ad..a321c93b43 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/main.cpp @@ -182,6 +182,7 @@ void UpdateFPSDisplay(const char *text) bool Init() { g_Config.Load(); + g_Config.GameIniLoad(); if (initCount == 0) {