2010-06-09 01:37:08 +00:00
|
|
|
// 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 "FileUtil.h"
|
|
|
|
#include "IniFile.h"
|
2011-01-29 06:26:03 +00:00
|
|
|
#include "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
|
|
|
{
|
|
|
|
bFullscreen = false;
|
|
|
|
bHideCursor = false;
|
|
|
|
renderToMainframe = false;
|
|
|
|
|
2010-12-02 05:38:48 +00:00
|
|
|
bHwRasterizer = false;
|
|
|
|
|
2010-06-09 01:37:08 +00:00
|
|
|
bShowStats = false;
|
2010-12-02 05:38:48 +00:00
|
|
|
|
2010-06-09 01:37:08 +00:00
|
|
|
bDumpTextures = false;
|
|
|
|
bDumpObjects = false;
|
|
|
|
bDumpFrames = false;
|
|
|
|
|
2013-02-15 16:44:56 +00:00
|
|
|
bZComploc = true;
|
|
|
|
bZFreeze = true;
|
|
|
|
|
2010-12-02 05:38:48 +00:00
|
|
|
bDumpTevStages = false;
|
|
|
|
bDumpTevTextureFetches = false;
|
2010-06-09 01:37:08 +00:00
|
|
|
|
|
|
|
drawStart = 0;
|
|
|
|
drawEnd = 100000;
|
|
|
|
}
|
|
|
|
|
2011-01-28 18:39:30 +00:00
|
|
|
void SWVideoConfig::Load(const char* ini_file)
|
2010-06-09 01:37:08 +00:00
|
|
|
{
|
|
|
|
std::string temp;
|
|
|
|
IniFile iniFile;
|
2010-12-02 05:38:48 +00:00
|
|
|
iniFile.Load(ini_file);
|
2010-06-09 01:37:08 +00:00
|
|
|
|
|
|
|
iniFile.Get("Hardware", "Fullscreen", &bFullscreen, 0); // Hardware
|
|
|
|
iniFile.Get("Hardware", "RenderToMainframe", &renderToMainframe, false);
|
|
|
|
|
2013-01-19 06:51:00 +00:00
|
|
|
iniFile.Get("Rendering", "HwRasterizer", &bHwRasterizer, 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
|
|
|
{
|
|
|
|
IniFile iniFile;
|
2010-12-02 05:38:48 +00:00
|
|
|
iniFile.Load(ini_file);
|
2010-06-09 01:37:08 +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-02-15 16:44:56 +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);
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2010-12-02 05:38:48 +00:00
|
|
|
iniFile.Save(ini_file);
|
2010-06-09 01:37:08 +00:00
|
|
|
}
|
|
|
|
|