Files
dolphin/Source/Core/VideoCommon/VideoConfig.h
T

163 lines
3.9 KiB
C++
Raw Normal View History

// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
2008-12-08 04:46:09 +00:00
// IMPORTANT: UI etc should modify g_Config. Graphics code should read g_ActiveConfig.
// The reason for this is to get rid of race conditions etc when the configuration
// changes in the middle of a frame. This is done by copying g_Config to g_ActiveConfig
// at the start of every frame. Noone should ever change members of g_ActiveConfig
// directly.
#pragma once
2008-12-08 04:46:09 +00:00
#include <string>
2014-02-17 05:18:15 -05:00
#include <vector>
#include "Common/Common.h"
#include "VideoCommon/VideoCommon.h"
// Log in two categories, and save three other options in the same byte
2014-02-16 15:30:18 -05:00
#define CONF_LOG 1
#define CONF_PRIMLOG 2
#define CONF_SAVETARGETS 8
#define CONF_SAVESHADERS 16
2008-12-08 04:46:09 +00:00
2014-02-09 16:03:16 -05:00
enum AspectMode
{
ASPECT_AUTO = 0,
ASPECT_FORCE_16_9 = 1,
2014-02-09 16:03:16 -05:00
ASPECT_FORCE_4_3 = 2,
ASPECT_STRETCH = 3,
};
2014-02-09 16:03:16 -05:00
enum EFBScale
{
2013-04-06 01:48:00 -04:00
SCALE_FORCE_INTEGRAL = -1,
SCALE_AUTO,
SCALE_AUTO_INTEGRAL,
SCALE_1X,
SCALE_1_5X,
SCALE_2X,
SCALE_2_5X,
SCALE_3X,
SCALE_4X,
};
// NEVER inherit from this class.
2014-03-16 17:00:29 -04:00
struct VideoConfig final
2008-12-08 04:46:09 +00:00
{
2011-03-21 19:57:31 +00:00
VideoConfig();
2014-03-12 15:33:41 -04:00
void Load(const std::string& ini_file);
void GameIniLoad();
void VerifyValidity();
2014-03-12 15:33:41 -04:00
void Save(const std::string& ini_file);
2009-06-03 23:38:31 +00:00
void UpdateProjectionHack();
bool IsVSync();
2008-12-08 04:46:09 +00:00
// General
bool bVSync;
2014-06-18 15:04:23 +02:00
bool bFullscreen;
bool bRunning;
bool bWidescreenHack;
int iAspectRatio;
bool bCrop; // Aspect ratio controls.
bool bUseXFB;
2011-04-25 20:06:45 +00:00
bool bUseRealXFB;
// OpenMP
bool bOMPDecoder;
2008-12-08 04:46:09 +00:00
// Enhancements
int iMultisampleMode;
int iEFBScale;
bool bForceFiltering;
int iMaxAnisotropy;
std::string sPostProcessingShader;
2008-12-08 04:46:09 +00:00
// Information
bool bShowFPS;
bool bShowInputDisplay;
bool bOverlayStats;
2009-02-15 20:49:59 +00:00
bool bOverlayProjStats;
bool bTexFmtOverlayEnable;
bool bTexFmtOverlayCenter;
bool bShowEFBCopyRegions;
bool bLogRenderTimeToFile;
// Render
bool bWireFrame;
bool bDstAlphaPass;
bool bDisableFog;
// Utility
bool bDumpTextures;
2011-04-25 20:06:45 +00:00
bool bHiresTextures;
bool bDumpEFBTarget;
bool bDumpFrames;
bool bUseFFV1;
bool bFreeLook;
bool bAnaglyphStereo;
int iAnaglyphStereoSeparation;
int iAnaglyphFocalAngle;
bool bBorderlessFullscreen;
// Hacks
bool bEFBAccessEnable;
bool bPerfQueriesEnable;
bool bEFBCopyEnable;
bool bEFBCopyCacheEnable;
bool bEFBEmulateFormatChanges;
bool bCopyEFBToTexture;
bool bCopyEFBScaled;
int iSafeTextureCache_ColorSamples;
int iPhackvalue[3];
std::string sPhackvalue[2];
float fAspectRatioHackW, fAspectRatioHackH;
2011-10-26 01:19:10 +01:00
bool bUseBBox;
2011-03-19 00:50:34 +00:00
bool bEnablePixelLighting;
bool bFastDepthCalc;
int iLog; // CONF_ bits
int iSaveTargetId; // TODO: Should be dropped
// D3D only config, mostly to be merged into the above
int iAdapter;
// Debugging
bool bEnableShaderDebugging;
// Static config per API
// TODO: Move this out of VideoConfig
2011-03-21 19:57:31 +00:00
struct
{
API_TYPE APIType;
std::vector<std::string> Adapters; // for D3D
std::vector<std::string> AAModes;
std::vector<std::string> PPShaders; // post-processing shaders
bool bUseRGBATextures; // used for D3D in TextureCache
bool bUseMinimalMipCount;
bool bSupportsExclusiveFullscreen;
bool bSupportsDualSourceBlend;
bool bSupportsPrimitiveRestart;
bool bSupportsOversizedViewports;
2013-07-22 12:02:16 +02:00
bool bSupportsEarlyZ; // needed by PixelShaderGen, so must stay in VideoCommon
2014-03-30 13:58:05 -05:00
bool bSupportsBindingLayout; // Needed by ShaderGen, so must stay in VideoCommon
} backend_info;
2012-09-28 23:19:50 +02:00
// Utility
bool RealXFBEnabled() const { return bUseXFB && bUseRealXFB; }
bool VirtualXFBEnabled() const { return bUseXFB && !bUseRealXFB; }
bool EFBCopiesToTextureEnabled() const { return bEFBCopyEnable && bCopyEFBToTexture; }
bool EFBCopiesToRamEnabled() const { return bEFBCopyEnable && !bCopyEFBToTexture; }
bool BorderlessFullscreenEnabled() const { return !backend_info.bSupportsExclusiveFullscreen || bBorderlessFullscreen; }
2008-12-08 04:46:09 +00:00
};
extern VideoConfig g_Config;
extern VideoConfig g_ActiveConfig;
// Called every frame.
void UpdateActiveConfig();