summaryrefslogtreecommitdiff
path: root/Source/Core/Common
diff options
context:
space:
mode:
authorMarcus Wanners <marcus@wanners.net>2009-04-26 17:04:45 +0000
committerMarcus Wanners <marcus@wanners.net>2009-04-26 17:04:45 +0000
commit15580e1c31addb24fcbc6ee01076248adcec7d7d (patch)
tree5bfaa4eb217df7cbffb4e8ba0b361ec880bb38dd /Source/Core/Common
parent1181cda34e807dd007aaeb8626d0bb8a4ed38648 (diff)
Added d3d and ogl settings to InfoWindow.cpp
I guess it's about done, as the pad settings are really not needed. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3083 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common')
-rw-r--r--Source/Core/Common/Common.vcproj16
-rw-r--r--Source/Core/Common/Src/D3Dconfig.cpp57
-rw-r--r--Source/Core/Common/Src/D3Dconfig.h73
-rw-r--r--Source/Core/Common/Src/OGLconfig.cpp86
-rw-r--r--Source/Core/Common/Src/OGLconfig.h112
5 files changed, 344 insertions, 0 deletions
diff --git a/Source/Core/Common/Common.vcproj b/Source/Core/Common/Common.vcproj
index a1021c6aaa..ac70abbd00 100644
--- a/Source/Core/Common/Common.vcproj
+++ b/Source/Core/Common/Common.vcproj
@@ -605,6 +605,14 @@
>
</File>
<File
+ RelativePath=".\Src\D3Dconfig.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\Src\D3Dconfig.h"
+ >
+ </File>
+ <File
RelativePath=".\Src\DynamicLibrary.cpp"
>
</File>
@@ -709,6 +717,14 @@
>
</File>
<File
+ RelativePath=".\Src\OGLconfig.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\Src\OGLconfig.h"
+ >
+ </File>
+ <File
RelativePath=".\Src\SConscript"
>
</File>
diff --git a/Source/Core/Common/Src/D3Dconfig.cpp b/Source/Core/Common/Src/D3Dconfig.cpp
new file mode 100644
index 0000000000..a32e03d402
--- /dev/null
+++ b/Source/Core/Common/Src/D3Dconfig.cpp
@@ -0,0 +1,57 @@
+// Copyright (C) 2003-2008 Dolphin Project.
+
+// 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 "D3DConfig.h"
+#include "IniFile.h"
+
+D3DConfig d3d_Config;
+
+D3DConfig::D3DConfig()
+{
+ memset(this, 0, sizeof(D3DConfig));
+}
+
+void D3DConfig::Load()
+{
+ IniFile iniFile;
+ iniFile.Load(FULL_CONFIG_DIR "gfx_dx9.ini");
+ iniFile.Get("Hardware", "Adapter", &iAdapter, 0);
+ iniFile.Get("Hardware", "WindowedRes", &iWindowedRes, 0);
+ iniFile.Get("Hardware", "FullscreenRes", &iFSResolution, 0);
+ iniFile.Get("Hardware", "Fullscreen", &bFullscreen, 0);
+ iniFile.Get("Hardware", "RenderInMainframe", &renderToMainframe, false);
+ iniFile.Get("Hardware", "VSync", &bVsync, 0);
+ if (iAdapter == -1)
+ iAdapter = 0;
+
+ iniFile.Get("Settings", "OverlayStats", &bOverlayStats, false);
+ iniFile.Get("Settings", "OverlayProjection", &bOverlayProjStats, false);
+ iniFile.Get("Settings", "Postprocess", &iPostprocessEffect, 0);
+ iniFile.Get("Settings", "DumpTextures", &bDumpTextures, 0);
+ iniFile.Get("Settings", "DumpFrames", &bDumpFrames, 0);
+ iniFile.Get("Settings", "ShowShaderErrors", &bShowShaderErrors, 0);
+ iniFile.Get("Settings", "Multisample", &iMultisampleMode, 0);
+ iniFile.Get("Settings", "TexDumpPath", &texDumpPath, 0);
+
+ iniFile.Get("Settings", "TexFmtOverlayEnable", &bTexFmtOverlayEnable, 0);
+ iniFile.Get("Settings", "TexFmtOverlayCenter", &bTexFmtOverlayCenter, 0);
+
+ iniFile.Get("Enhancements", "ForceFiltering", &bForceFiltering, 0);
+ iniFile.Get("Enhancements", "ForceMaxAniso", &bForceMaxAniso, 0);
+
+}
+
diff --git a/Source/Core/Common/Src/D3Dconfig.h b/Source/Core/Common/Src/D3Dconfig.h
new file mode 100644
index 0000000000..6b8ebb8c5d
--- /dev/null
+++ b/Source/Core/Common/Src/D3Dconfig.h
@@ -0,0 +1,73 @@
+// Copyright (C) 2003-2008 Dolphin Project.
+
+// 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/
+
+#ifndef _PLUGIN_VIDEOD3D_CONFIG_H_
+#define _PLUGIN_VIDEOD3D_CONFIG_H_
+
+#include <string>
+#include "Common.h"
+
+struct D3DConfig
+{
+ D3DConfig();
+ void Load();
+ void Save();
+
+ int iAdapter;
+ int iFSResolution;
+ int iMultisampleMode;
+
+ int iPostprocessEffect;
+
+ bool renderToMainframe;
+ bool bFullscreen;
+ bool bVsync;
+ bool bWireFrame;
+ bool bOverlayStats;
+ bool bOverlayProjStats;
+ bool bDumpTextures;
+ bool bDumpFrames;
+ bool bOldCard;
+ bool bShowShaderErrors;
+ //enhancements
+ bool bForceFiltering;
+ bool bForceMaxAniso;
+
+ bool bPreUpscale;
+ int iPreUpscaleFilter;
+
+ bool bTruform;
+ int iTruformLevel;
+
+ int iWindowedRes;
+
+ char psProfile[16];
+ char vsProfile[16];
+
+ bool bTexFmtOverlayEnable;
+ bool bTexFmtOverlayCenter;
+
+ std::string texDumpPath;
+
+private:
+ DISALLOW_COPY_AND_ASSIGN(D3DConfig);
+
+};
+
+extern D3DConfig d3d_Config;
+
+#endif
diff --git a/Source/Core/Common/Src/OGLconfig.cpp b/Source/Core/Common/Src/OGLconfig.cpp
new file mode 100644
index 0000000000..48a9f9f410
--- /dev/null
+++ b/Source/Core/Common/Src/OGLconfig.cpp
@@ -0,0 +1,86 @@
+// Copyright (C) 2003-2009 Dolphin Project.
+
+// 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 "Common.h"
+#include "IniFile.h"
+#include "OGLconfig.h"
+#include "..\..\core\src\ConfigManager.h" // FIXME
+
+OGLConfig ogl_Config;
+
+OGLConfig::OGLConfig()
+{
+ memset(this, 0, sizeof(OGLConfig));
+}
+
+void OGLConfig::Load()
+{
+ std::string temp;
+ IniFile iniFile;
+ iniFile.Load(FULL_CONFIG_DIR "gfx_opengl.ini");
+
+ // get resolution
+ iniFile.Get("Hardware", "WindowedRes", &temp, "640x480");
+ strncpy(iWindowedRes, temp.c_str(), 16);
+
+ iniFile.Get("Hardware", "FullscreenRes", &temp, "640x480");
+ strncpy(iFSResolution, temp.c_str(), 16);
+
+ iniFile.Get("Hardware", "Fullscreen", &bFullscreen, 0); // Hardware
+ iniFile.Get("Hardware", "VSync", &bVSync, 0); // Hardware
+ iniFile.Get("Hardware", "RenderToMainframe", &renderToMainframe, false);
+ iniFile.Get("Settings", "StretchToFit", &bNativeResolution, true);
+ iniFile.Get("Settings", "KeepAR_4_3", &bKeepAR43, false);
+ iniFile.Get("Settings", "KeepAR_16_9", &bKeepAR169, false);
+ iniFile.Get("Settings", "Crop", &bCrop, false);
+ iniFile.Get("Settings", "HideCursor", &bHideCursor, false);
+ iniFile.Get("Settings", "UseXFB", &bUseXFB, 0);
+ iniFile.Get("Settings", "AutoScale", &bAutoScale, true);
+
+ iniFile.Get("Settings", "SafeTextureCache", &bSafeTextureCache, false); // Settings
+ iniFile.Get("Settings", "ShowFPS", &bShowFPS, false); // Settings
+ iniFile.Get("Settings", "OverlayStats", &bOverlayStats, false);
+ iniFile.Get("Settings", "OverlayBlendStats", &bOverlayBlendStats, false);
+ iniFile.Get("Settings", "OverlayProjStats", &bOverlayProjStats, false);
+ iniFile.Get("Settings", "ShowEFBCopyRegions", &bShowEFBCopyRegions, false);
+ iniFile.Get("Settings", "DLOptimize", &iCompileDLsLevel, 0);
+ iniFile.Get("Settings", "DumpTextures", &bDumpTextures, 0);
+ iniFile.Get("Settings", "DumpEFBTarget", &bDumpEFBTarget, 0);
+ iniFile.Get("Settings", "DumpFrames", &bDumpFrames, 0);
+ iniFile.Get("Settings", "FreeLook", &bFreeLook, 0);
+ iniFile.Get("Settings", "ShowShaderErrors", &bShowShaderErrors, 0);
+ iniFile.Get("Settings", "MSAA", &iMultisampleMode, 0);
+ iniFile.Get("Settings", "DstAlphaPass", &bDstAlphaPass, false);
+
+ iniFile.Get("Settings", "TexFmtOverlayEnable", &bTexFmtOverlayEnable, 0);
+ iniFile.Get("Settings", "TexFmtOverlayCenter", &bTexFmtOverlayCenter, 0);
+ iniFile.Get("Settings", "WireFrame", &bWireFrame, 0);
+ iniFile.Get("Settings", "DisableLighting", &bDisableLighting, 0);
+ iniFile.Get("Settings", "DisableTexturing", &bDisableTexturing, 0);
+ iniFile.Get("Settings", "DisableFog", &bDisableFog, 0);
+
+ iniFile.Get("Enhancements", "ForceFiltering", &bForceFiltering, 0);
+ iniFile.Get("Enhancements", "MaxAnisotropy", &iMaxAnisotropy, 3); // NOTE - this is x in (1 << x)
+
+ iniFile.Get("Hacks", "EFBCopyDisable", &bEFBCopyDisable, 0);
+ iniFile.Get("Hacks", "EFBCopyDisableHotKey", &bEFBCopyDisableHotKey, 0);
+ iniFile.Get("Hacks", "ProjectionHax1", &bProjectionHax1, 0);
+ iniFile.Get("Hacks", "EFBToTextureEnable", &bCopyEFBToRAM, 0);
+ iniFile.Get("Hacks", "SMGhack", &bSMGhack, false);
+}
+
+
diff --git a/Source/Core/Common/Src/OGLconfig.h b/Source/Core/Common/Src/OGLconfig.h
new file mode 100644
index 0000000000..3cfbd08ca3
--- /dev/null
+++ b/Source/Core/Common/Src/OGLconfig.h
@@ -0,0 +1,112 @@
+// Copyright (C) 2003-2009 Dolphin Project.
+
+// 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/
+
+#ifndef _PLUGIN_VIDEOOGL_CONFIG_H_
+#define _PLUGIN_VIDEOOGL_CONFIG_H_
+
+#include "Common.h"
+
+// Log in two categories, and save three other options in the same byte
+#define CONF_LOG 1
+#define CONF_PRIMLOG 2
+#define CONF_SAVETEXTURES 4
+#define CONF_SAVETARGETS 8
+#define CONF_SAVESHADERS 16
+
+enum MultisampleMode {
+ MULTISAMPLE_OFF,
+ MULTISAMPLE_2X,
+ MULTISAMPLE_4X,
+ MULTISAMPLE_8X,
+ MULTISAMPLE_CSAA_8X,
+ MULTISAMPLE_CSAA_8XQ,
+ MULTISAMPLE_CSAA_16X,
+ MULTISAMPLE_CSAA_16XQ,
+};
+
+// NEVER inherit from this class.
+struct OGLConfig
+{
+ OGLConfig();
+ void Load();
+ void GameIniLoad();
+ void Save();
+
+ // General
+ bool bFullscreen;
+ bool bHideCursor;
+ bool renderToMainframe;
+ bool bVSync;
+
+ // Resolution control
+ char iFSResolution[16];
+ char iWindowedRes[16];
+
+ bool bNativeResolution; // Should possibly be augmented with 2x, 4x native.
+ bool bKeepAR43, bKeepAR169, bCrop; // Aspect ratio controls.
+ bool bUseXFB;
+ bool bAutoScale; // Removes annoying borders without using XFB. Doesn't always work perfectly.
+
+ // Enhancements
+ int iMultisampleMode;
+ bool bForceFiltering;
+ int iMaxAnisotropy;
+
+ // Information
+ bool bShowFPS;
+ bool bOverlayStats;
+ bool bOverlayBlendStats;
+ bool bOverlayProjStats;
+ bool bTexFmtOverlayEnable;
+ bool bTexFmtOverlayCenter;
+ bool bShowEFBCopyRegions;
+
+ // Render
+ bool bWireFrame;
+ bool bDisableLighting;
+ bool bDisableTexturing;
+ bool bDstAlphaPass;
+ bool bDisableFog;
+
+ // Utility
+ bool bDumpTextures;
+ bool bDumpEFBTarget;
+ bool bDumpFrames;
+ bool bFreeLook;
+
+ // Hacks
+ bool bEFBCopyDisable;
+ bool bEFBCopyDisableHotKey;
+ bool bProjectionHax1;
+ bool bSMGhack;
+ bool bCopyEFBToRAM;
+ bool bSafeTextureCache;
+
+ int iLog; // CONF_ bits
+ int iSaveTargetId;
+
+ //currently unused:
+ int iCompileDLsLevel;
+ bool bShowShaderErrors;
+
+private:
+ DISALLOW_COPY_AND_ASSIGN(OGLConfig);
+};
+
+extern OGLConfig ogl_config;
+
+#endif // _PLUGIN_VIDEOOGL_CONFIG_H_