Advertisement
Guest User

VideoConfig.h

a guest
Dec 19th, 2012
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.74 KB | None | 0 0
  1. // Copyright (C) 2003 Dolphin Project.
  2.  
  3. // This program is free software: you can redistribute it and/or modify
  4. // it under the terms of the GNU General Public License as published by
  5. // the Free Software Foundation, version 2.0.
  6.  
  7. // This program is distributed in the hope that it will be useful,
  8. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. // GNU General Public License 2.0 for more details.
  11.  
  12. // A copy of the GPL 2.0 should have been included with the program.
  13. // If not, see http://www.gnu.org/licenses/
  14.  
  15. // Official SVN repository and contact information can be found at
  16. // http://code.google.com/p/dolphin-emu/
  17.  
  18.  
  19. // IMPORTANT: UI etc should modify g_Config. Graphics code should read g_ActiveConfig.
  20. // The reason for this is to get rid of race conditions etc when the configuration
  21. // changes in the middle of a frame. This is done by copying g_Config to g_ActiveConfig
  22. // at the start of every frame. Noone should ever change members of g_ActiveConfig
  23. // directly.
  24.  
  25. #ifndef _VIDEO_CONFIG_H_
  26. #define _VIDEO_CONFIG_H_
  27.  
  28. #include "Common.h"
  29. #include "VideoCommon.h"
  30.  
  31. #include <vector>
  32. #include <string>
  33.  
  34. // Log in two categories, and save three other options in the same byte
  35. #define CONF_LOG 1
  36. #define CONF_PRIMLOG 2
  37. #define CONF_SAVETARGETS 8
  38. #define CONF_SAVESHADERS 16
  39.  
  40. enum MultisampleMode {
  41. MULTISAMPLE_OFF,
  42. MULTISAMPLE_2X,
  43. MULTISAMPLE_4X,
  44. MULTISAMPLE_8X,
  45. MULTISAMPLE_CSAA_8X,
  46. MULTISAMPLE_CSAA_8XQ,
  47. MULTISAMPLE_CSAA_16X,
  48. MULTISAMPLE_CSAA_16XQ,
  49. };
  50.  
  51. enum AspectMode {
  52. ASPECT_AUTO = 0,
  53. ASPECT_FORCE_16_9 = 1,
  54. ASPECT_FORCE_4_3 = 2,
  55. ASPECT_STRETCH = 3,
  56. };
  57.  
  58. class IniFile;
  59.  
  60. // NEVER inherit from this class.
  61. struct VideoConfig
  62. {
  63. VideoConfig();
  64. void Load(const char *ini_file);
  65. void GameIniLoad(const char *ini_file);
  66. void VerifyValidity();
  67. void Save(const char *ini_file);
  68. void GameIniSave(const char* default_ini, const char* game_ini);
  69. void UpdateProjectionHack();
  70.  
  71. // General
  72. bool bVSync;
  73.  
  74. bool bRunning;
  75. bool bWidescreenHack;
  76. int iAspectRatio;
  77. bool bCrop; // Aspect ratio controls.
  78. bool bUseXFB;
  79. bool bUseRealXFB;
  80.  
  81. // OpenCL/OpenMP
  82. bool bEnableOpenCL;
  83. bool bOMPDecoder;
  84.  
  85. // Enhancements
  86. int iMultisampleMode;
  87. int iEFBScale;
  88. bool bForceFiltering;
  89. int iMaxAnisotropy;
  90. std::string sPostProcessingShader;
  91.  
  92. // Information
  93. bool bShowFPS;
  94. bool bShowInputDisplay;
  95. bool bOverlayStats;
  96. bool bOverlayProjStats;
  97. bool bTexFmtOverlayEnable;
  98. bool bTexFmtOverlayCenter;
  99. bool bShowEFBCopyRegions;
  100. bool bLogFPSToFile;
  101.  
  102. // Render
  103. bool bWireFrame;
  104. <<<<<<< HEAD
  105. =======
  106. bool bDisableLighting;
  107. bool bDisableTexturing;
  108. >>>>>>> parent of 1dd6b97... Remove "Disable Lighting".
  109. bool bDstAlphaPass;
  110. bool bDisableFog;
  111.  
  112. // Utility
  113. bool bDumpTextures;
  114. bool bHiresTextures;
  115. bool bDumpEFBTarget;
  116. bool bDumpFrames;
  117. bool bUseFFV1;
  118. bool bFreeLook;
  119. bool bAnaglyphStereo;
  120. int iAnaglyphStereoSeparation;
  121. int iAnaglyphFocalAngle;
  122. bool b3DVision;
  123.  
  124. // Hacks
  125. bool bEFBAccessEnable;
  126. bool bDlistCachingEnable;
  127.  
  128. bool bEFBCopyEnable;
  129. bool bEFBCopyCacheEnable;
  130. bool bEFBEmulateFormatChanges;
  131. bool bOSDHotKey;
  132. bool bCopyEFBToTexture;
  133. bool bCopyEFBScaled;
  134. int iSafeTextureCache_ColorSamples;
  135. int iPhackvalue[4];
  136. std::string sPhackvalue[2];
  137. float fAspectRatioHackW, fAspectRatioHackH;
  138. bool bZTPSpeedHack; // The Legend of Zelda: Twilight Princess
  139. bool bUseBBox;
  140. bool bEnablePixelLighting;
  141. bool bEnablePerPixelDepth;
  142.  
  143. int iLog; // CONF_ bits
  144. int iSaveTargetId; // TODO: Should be dropped
  145.  
  146. //currently unused:
  147. int iCompileDLsLevel;
  148.  
  149. // D3D only config, mostly to be merged into the above
  150. int iAdapter;
  151.  
  152. // Debugging
  153. bool bEnableShaderDebugging;
  154.  
  155. // Static config per API
  156. // TODO: Move this out of VideoConfig
  157. struct
  158. {
  159. API_TYPE APIType;
  160.  
  161. std::vector<std::string> Adapters; // for D3D9 and D3D11
  162. std::vector<std::string> AAModes;
  163. std::vector<std::string> PPShaders; // post-processing shaders
  164.  
  165. bool bUseRGBATextures; // used for D3D11 in TextureCache
  166. bool bSupports3DVision;
  167. bool bSupportsDualSourceBlend; // only supported by D3D11 and OpenGL
  168. bool bSupportsFormatReinterpretation;
  169. bool bSupportsPixelLighting;
  170. } backend_info;
  171.  
  172. // Utility
  173. bool RealXFBEnabled() const { return bUseXFB && bUseRealXFB; }
  174. bool VirtualXFBEnabled() const { return bUseXFB && !bUseRealXFB; }
  175. bool EFBCopiesToTextureEnabled() const { return bEFBCopyEnable && bCopyEFBToTexture; }
  176. bool EFBCopiesToRamEnabled() const { return bEFBCopyEnable && !bCopyEFBToTexture; }
  177. };
  178.  
  179. extern VideoConfig g_Config;
  180. extern VideoConfig g_ActiveConfig;
  181.  
  182. // Called every frame.
  183. void UpdateActiveConfig();
  184.  
  185. #endif // _VIDEO_CONFIG_H_
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement