2013-04-18 03:29:41 +00:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2014-02-17 10:18:15 +00:00
|
|
|
#include "Common/FileUtil.h"
|
|
|
|
#include "Common/IniFile.h"
|
|
|
|
#include "VideoBackends/Software/SWVideoConfig.h"
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2011-01-29 04:52:19 +00:00
|
|
|
SWVideoConfig g_SWVideoConfig;
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2011-01-28 18:39:30 +00:00
|
|
|
SWVideoConfig::SWVideoConfig()
|
2010-06-09 01:37:08 +00:00
|
|
|
{
|
2013-03-18 07:49:46 +00:00
|
|
|
bFullscreen = false;
|
|
|
|
bHideCursor = false;
|
2013-10-29 05:23:17 +00:00
|
|
|
renderToMainframe = false;
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2010-12-02 05:38:48 +00:00
|
|
|
bHwRasterizer = false;
|
2013-11-23 07:04:37 +00:00
|
|
|
bBypassXFB = false;
|
2010-12-02 05:38:48 +00:00
|
|
|
|
2013-03-18 07:49:46 +00:00
|
|
|
bShowStats = false;
|
2010-12-02 05:38:48 +00:00
|
|
|
|
2013-03-18 07:49:46 +00:00
|
|
|
bDumpTextures = false;
|
|
|
|
bDumpObjects = false;
|
|
|
|
bDumpFrames = false;
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2013-02-15 16:44:56 +00:00
|
|
|
bZComploc = true;
|
|
|
|
bZFreeze = true;
|
|
|
|
|
2013-03-18 07:49:46 +00:00
|
|
|
bDumpTevStages = false;
|
2010-12-02 05:38:48 +00:00
|
|
|
bDumpTevTextureFetches = false;
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2013-03-18 07:49:46 +00:00
|
|
|
drawStart = 0;
|
|
|
|
drawEnd = 100000;
|
2010-06-09 01:37:08 +00:00
|
|
|
}
|
|
|
|
|
2011-01-28 18:39:30 +00:00
|
|
|
void SWVideoConfig::Load(const char* ini_file)
|
2010-06-09 01:37:08 +00:00
|
|
|
{
|
2013-03-18 07:49:46 +00:00
|
|
|
IniFile iniFile;
|
|
|
|
iniFile.Load(ini_file);
|
|
|
|
|
|
|
|
iniFile.Get("Hardware", "Fullscreen", &bFullscreen, 0); // Hardware
|
|
|
|
iniFile.Get("Hardware", "RenderToMainframe", &renderToMainframe, false);
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2013-01-19 06:51:00 +00:00
|
|
|
iniFile.Get("Rendering", "HwRasterizer", &bHwRasterizer, false);
|
2013-11-23 07:04:37 +00:00
|
|
|
iniFile.Get("Rendering", "BypassXFB", &bBypassXFB, false);
|
2013-02-15 16:44:56 +00:00
|
|
|
iniFile.Get("Rendering", "ZComploc", &bZComploc, true);
|
|
|
|
iniFile.Get("Rendering", "ZFreeze", &bZFreeze, true);
|
2010-12-02 05:38:48 +00:00
|
|
|
|
|
|
|
iniFile.Get("Info", "ShowStats", &bShowStats, false);
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2010-12-02 05:38:48 +00:00
|
|
|
iniFile.Get("Utility", "DumpTexture", &bDumpTextures, false);
|
|
|
|
iniFile.Get("Utility", "DumpObjects", &bDumpObjects, false);
|
|
|
|
iniFile.Get("Utility", "DumpFrames", &bDumpFrames, false);
|
|
|
|
iniFile.Get("Utility", "DumpTevStages", &bDumpTevStages, false);
|
|
|
|
iniFile.Get("Utility", "DumpTevTexFetches", &bDumpTevTextureFetches, false);
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2010-12-02 05:38:48 +00:00
|
|
|
iniFile.Get("Misc", "DrawStart", &drawStart, 0);
|
|
|
|
iniFile.Get("Misc", "DrawEnd", &drawEnd, 100000);
|
|
|
|
}
|
|
|
|
|
2011-01-28 18:39:30 +00:00
|
|
|
void SWVideoConfig::Save(const char* ini_file)
|
2010-06-09 01:37:08 +00:00
|
|
|
{
|
2013-03-18 07:49:46 +00:00
|
|
|
IniFile iniFile;
|
|
|
|
iniFile.Load(ini_file);
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2013-03-18 07:49:46 +00:00
|
|
|
iniFile.Set("Hardware", "Fullscreen", bFullscreen);
|
|
|
|
iniFile.Set("Hardware", "RenderToMainframe", renderToMainframe);
|
2010-12-02 05:38:48 +00:00
|
|
|
|
|
|
|
iniFile.Set("Rendering", "HwRasterizer", bHwRasterizer);
|
2013-11-23 07:04:37 +00:00
|
|
|
iniFile.Set("Rendering", "BypassXFB", bBypassXFB);
|
2013-11-14 08:15:03 +00:00
|
|
|
iniFile.Set("Rendering", "ZComploc", bZComploc);
|
|
|
|
iniFile.Set("Rendering", "ZFreeze", bZFreeze);
|
2010-12-02 05:38:48 +00:00
|
|
|
|
|
|
|
iniFile.Set("Info", "ShowStats", bShowStats);
|
|
|
|
|
|
|
|
iniFile.Set("Utility", "DumpTexture", bDumpTextures);
|
|
|
|
iniFile.Set("Utility", "DumpObjects", bDumpObjects);
|
|
|
|
iniFile.Set("Utility", "DumpFrames", bDumpFrames);
|
|
|
|
iniFile.Set("Utility", "DumpTevStages", bDumpTevStages);
|
|
|
|
iniFile.Set("Utility", "DumpTevTexFetches", bDumpTevTextureFetches);
|
|
|
|
|
|
|
|
iniFile.Set("Misc", "DrawStart", drawStart);
|
|
|
|
iniFile.Set("Misc", "DrawEnd", drawEnd);
|
2013-03-18 07:49:46 +00:00
|
|
|
|
|
|
|
iniFile.Save(ini_file);
|
2010-06-09 01:37:08 +00:00
|
|
|
}
|
|
|
|
|