Ejemplo n.º 1
0
bool InputHook::ReadGameDatabase()
{
	IniFile ini;
	std::string inipath("x360ce.gdb");
	if (!ini.Load(inipath))
		CheckCommonDirectory(&inipath, "x360ce");
	if (!ini.Load(inipath)) return false;

	PrintLog("Using game database file:");
	PrintLog(ini.GetIniPath().c_str());

	std::string processName;
	ModuleFileName(&processName);
	if (ini.Get(processName, "HookMask", &m_hookmask))
	{
		ini.Get(processName, "Timeout", &m_timeout);

		std::string gameName;
		ini.Get(processName, "Name", &gameName);

		if (!gameName.empty())
			PrintLog("InputHook found \"%s\" in database", gameName.c_str());

		return true;
	}

	return false;
}
Ejemplo n.º 2
0
VOID InitInstance()
{
	IniFile ini;
	std::string inipath("x360ce.ini");
	if (!ini.Load(inipath))
		CheckCommonDirectory(&inipath, "x360ce");
	if (!ini.Load(inipath)) return;

	bool filelog;
	bool systemlog;

	ini.Get("Options", "FileLog", &filelog);
	ini.Get("Options", "SystemLog", &systemlog);

	if (systemlog)
		LogSystem();

	if (filelog)
	{
		SYSTEMTIME systime;
		GetLocalTime(&systime);
		std::string processName;
		ModuleFileName(&processName);

		std::string logfile = StringFormat("x360ce_%s_%02u-%02u-%02u_%08u.log", processName.c_str(), systime.wYear,
			systime.wMonth, systime.wDay, GetTickCount());

		LogFile(logfile);
	}

	// Get will initalize static InputHookManager object and we want to initialize it ASAP
	InputHookManager::Get();
}
Ejemplo n.º 3
0
void CMemoryWindow::Load(IniFile& _IniFile)
{
	int x, y, w, h;
	_IniFile.Get("MemoryWindow", "x", &x, GetPosition().x);
	_IniFile.Get("MemoryWindow", "y", &y, GetPosition().y);
	_IniFile.Get("MemoryWindow", "w", &w, GetSize().GetWidth());
	_IniFile.Get("MemoryWindow", "h", &h, GetSize().GetHeight());
	SetSize(x, y, w, h);
}
Ejemplo n.º 4
0
void GFXDebuggerPanel::LoadSettings()
{
	IniFile file;
	file.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));

	int x = 100, y = 100, w = 100, h = 100;
	file.Get("VideoWindow", "x", &x, GetPosition().x);
	file.Get("VideoWindow", "y", &y, GetPosition().y);
	file.Get("VideoWindow", "w", &w, GetSize().GetWidth());
	file.Get("VideoWindow", "h", &h, GetSize().GetHeight());
	SetSize(x, y, w, h);
}
Ejemplo n.º 5
0
// Update the local perspectives array
void CFrame::LoadIniPerspectives()
{
	Perspectives.clear();
	std::vector<std::string> VPerspectives;
	std::string _Perspectives;

	IniFile ini;
	ini.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
	ini.Get("Perspectives", "Perspectives", &_Perspectives, "Perspective 1");
	ini.Get("Perspectives", "Active", &ActivePerspective, 0);
	SplitString(_Perspectives, ',', VPerspectives);

	for (auto& VPerspective : VPerspectives)
	{
		SPerspectives Tmp;
		std::string _Section, _Perspective, _Widths, _Heights;
		std::vector<std::string> _SWidth, _SHeight;
		Tmp.Name = VPerspective;

		// Don't save a blank perspective
		if (Tmp.Name.empty())
			continue;

		_Section = StringFromFormat("P - %s", Tmp.Name.c_str());
		ini.Get(_Section, "Perspective", &_Perspective,
				"layout2|"
				"name=Pane 0;caption=Pane 0;state=768;dir=5;prop=100000;|"
				"name=Pane 1;caption=Pane 1;state=31458108;dir=4;prop=100000;|"
				"dock_size(5,0,0)=22|dock_size(4,0,0)=333|");
		ini.Get(_Section, "Width", &_Widths, "70,25");
		ini.Get(_Section, "Height", &_Heights, "80,80");

		Tmp.Perspective = StrToWxStr(_Perspective);

		SplitString(_Widths, ',', _SWidth);
		SplitString(_Heights, ',', _SHeight);
		for (auto& Width : _SWidth)
		{
			int _Tmp;
			if (TryParse(Width.c_str(), &_Tmp)) Tmp.Width.push_back(_Tmp);
		}
		for (auto& Height : _SHeight)
		{
			int _Tmp;
			if (TryParse(Height.c_str(), &_Tmp)) Tmp.Height.push_back(_Tmp);
		}
		Perspectives.push_back(Tmp);
	}
}
Ejemplo n.º 6
0
void SConfig::LoadSettingsWii()
{
    IniFile ini;
    //Wiimote configs
    ini.Load((File::GetUserPath(D_CONFIG_IDX) + "Dolphin.ini"));
    for (int i = 0; i < 4; i++)
    {
        char SectionName[32];
        sprintf(SectionName, "Wiimote%i", i + 1);
        ini.Get(SectionName, "AutoReconnectRealWiimote", &m_WiiAutoReconnect[i], false);
    }
    ini.Load((File::GetUserPath(D_CONFIG_IDX) + "wiimote.ini"));
    ini.Get("Real", "Unpair", &m_WiiAutoUnpair, false);

}
Ejemplo n.º 7
0
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv *env, jobject obj, jobject _surf)
{
	surf = ANativeWindow_fromSurface(env, _surf);
	// Install our callbacks
	OSD::AddCallback(OSD::OSD_INIT, ButtonManager::Init);
	OSD::AddCallback(OSD::OSD_SHUTDOWN, ButtonManager::Shutdown);

	LogManager::Init();
	SConfig::Init();
	VideoBackend::PopulateList();
	VideoBackend::ActivateBackend(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoBackend);
	WiimoteReal::LoadSettings();

	// Load our Android specific settings
	IniFile ini;
	bool onscreencontrols = true;
	ini.Load(File::GetUserPath(D_CONFIG_IDX) + std::string("Dolphin.ini"));
	ini.Get("Android", "ScreenControls", &onscreencontrols, true);

	if (onscreencontrols)
		OSD::AddCallback(OSD::OSD_ONFRAME, ButtonManager::DrawButtons);

	// No use running the loop when booting fails
	if ( BootManager::BootCore( g_filename.c_str() ) )
		while (PowerPC::GetState() != PowerPC::CPU_POWERDOWN)
			updateMainFrameEvent.Wait();

	WiimoteReal::Shutdown();
	VideoBackend::ClearList();
	SConfig::Shutdown();
	LogManager::Shutdown();
}
Ejemplo n.º 8
0
void DolphinApp::InitLanguageSupport()
{
	unsigned int language = 0;

	IniFile ini;
	ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
	ini.Get("Interface", "Language", &language, wxLANGUAGE_DEFAULT);

	// Load language if possible, fall back to system default otherwise
	if(wxLocale::IsAvailable(language))
	{
		m_locale = new wxLocale(language);

#ifdef _WIN32
		m_locale->AddCatalogLookupPathPrefix(wxT("Languages"));
#endif

		m_locale->AddCatalog(wxT("dolphin-emu"));

		if(!m_locale->IsOk())
		{
			PanicAlertT("Error loading selected language. Falling back to system default.");
			delete m_locale;
			m_locale = new wxLocale(wxLANGUAGE_DEFAULT);
		}
	}
	else
	{
		PanicAlertT("The selected language is not supported by your system. Falling back to system default.");
		m_locale = new wxLocale(wxLANGUAGE_DEFAULT);
	}
}
bool CWII_IPC_HLE_Device_usb_kbd::Open(u32 _CommandAddress, u32 _Mode)
{
	INFO_LOG(WII_IPC_STM, "CWII_IPC_HLE_Device_usb_kbd: Open");
	IniFile ini;
	ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
	ini.Get("USB Keyboard", "Layout", &m_KeyboardLayout, KBD_LAYOUT_QWERTY);

	for(int i = 0; i < 256; i++)
		m_OldKeyBuffer[i] = false;

	m_OldModifiers = 0x00;

	//m_MessageQueue.push(SMessageData(MSG_KBD_CONNECT, 0, NULL));
	Memory::Write_U32(m_DeviceID, _CommandAddress+4);
	m_Active = true;
	return true;
}
Ejemplo n.º 10
0
void LogConfigWindow::LoadSettings()
{
	IniFile ini;
	ini.Load(File::GetUserPath(F_LOGGERCONFIG_IDX));

	// Retrieve the verbosity value from the config ini file.
	int verbosity;
	ini.Get("Options", "Verbosity", &verbosity, 0);

	// Ensure the verbosity level is valid.
	if (verbosity < 1)
		verbosity = 1;
	if (verbosity > MAX_LOGLEVEL)
		verbosity = MAX_LOGLEVEL;

	// Actually set the logging verbosity.
	m_verbosity->SetSelection(verbosity - 1);

	// Get the logger output settings from the config ini file.
	ini.Get("Options", "WriteToFile", &m_writeFile, false);
	m_writeFileCB->SetValue(m_writeFile);
	ini.Get("Options", "WriteToConsole", &m_writeConsole, true);
	m_writeConsoleCB->SetValue(m_writeConsole);
	ini.Get("Options", "WriteToWindow", &m_writeWindow, true);
	m_writeWindowCB->SetValue(m_writeWindow);
#ifdef _MSC_VER
	if (IsDebuggerPresent())
	{
		ini.Get("Options", "WriteToDebugger", &m_writeDebugger, true);
		m_writeDebuggerCB->SetValue(m_writeDebugger);
	}
	else
#endif
	{
		m_writeDebugger = false;
	}

	// Run through all of the log types and check each checkbox for each logging type
	// depending on its set value within the config ini.
	for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
	{
		bool log_enabled;
		ini.Get("Logs", m_LogManager->GetShortName((LogTypes::LOG_TYPE)i), &log_enabled, true);

		if (log_enabled)
			enableAll = false;

		m_checks->Check(i, log_enabled);
	}
}
Ejemplo n.º 11
0
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetConfig(JNIEnv *env, jobject obj, jstring jFile, jstring jKey, jstring jValue, jstring jDefault)
{
	IniFile ini;
	const char *File = env->GetStringUTFChars(jFile, NULL);
	const char *Key = env->GetStringUTFChars(jKey, NULL);
	const char *Value = env->GetStringUTFChars(jValue, NULL);
	const char *Default = env->GetStringUTFChars(jDefault, NULL);
	
	ini.Load(File::GetUserPath(D_CONFIG_IDX) + std::string(File));
	std::string value;
	
	ini.Get(Key, Value, &value, Default);
	
	env->ReleaseStringUTFChars(jFile, File);
	env->ReleaseStringUTFChars(jKey, Key);
	env->ReleaseStringUTFChars(jValue, Value);
	env->ReleaseStringUTFChars(jDefault, Default);

	return env->NewStringUTF(value.c_str());
}
Ejemplo n.º 12
0
static void LoadSpeedhacks(const char *section, std::map<u32, int> &hacks, IniFile &ini) {
	std::vector<std::string> keys;
	ini.GetKeys(section, keys);
	for (std::vector<std::string>::const_iterator iter = keys.begin(); iter != keys.end(); ++iter)
	{
		std::string key = *iter;
		std::string value;
		ini.Get(section, key.c_str(), &value, "BOGUS");
		if (value != "BOGUS")
		{
			u32 address;
			u32 cycles;
			bool success = true;
			success &= TryParse(key, &address);
			success &= TryParse(value, &cycles);
			if (success) {
				speedHacks[address] = (int)cycles;
			}
		}
	}
}
Ejemplo n.º 13
0
// This is called from the GUI thread. See the booting call schedule in
// BootManager.cpp
bool Init()
{
	const SCoreStartupParameter& _CoreParameter =
		SConfig::GetInstance().m_LocalCoreStartupParameter;

	if (g_EmuThread.joinable())
	{
		PanicAlertT("Emu Thread already running");
		return false;
	}

	g_CoreStartupParameter = _CoreParameter;

	INFO_LOG(OSREPORT, "Starting core = %s mode",
		g_CoreStartupParameter.bWii ? "Wii" : "Gamecube");
	INFO_LOG(OSREPORT, "CPU Thread separate = %s",
		g_CoreStartupParameter.bCPUThread ? "Yes" : "No");

	Host_UpdateMainFrame(); // Disable any menus or buttons at boot

	g_aspect_wide = _CoreParameter.bWii;
	if (g_aspect_wide) 
	{
		IniFile gameIni;
		gameIni.Load(_CoreParameter.m_strGameIni.c_str());
		gameIni.Get("Wii", "Widescreen", &g_aspect_wide,
			!!SConfig::GetInstance().m_SYSCONF->
				GetData<u8>("IPL.AR"));
	}

	// g_pWindowHandle is first the m_Panel handle,
	// then it is updated to the render window handle,
	// within g_video_backend->Initialize()
	g_pWindowHandle = Host_GetRenderHandle();

	// Start the emu thread 
	g_EmuThread = std::thread(EmuThread);

	return true;
}
Ejemplo n.º 14
0
void Compatibility::CheckSetting(IniFile &iniFile, const std::string &gameID, const char *option, bool *flag) {
	iniFile.Get(option, gameID.c_str(), flag, *flag);
}
Ejemplo n.º 15
0
void VideoConfig::Load(const char *ini_file)
{
	std::string temp;
	IniFile iniFile;
	iniFile.Load(ini_file);
	
	iniFile.Get("Hardware", "VSync", &bVSync, 0); // Hardware
	iniFile.Get("Settings", "wideScreenHack", &bWidescreenHack, false);
	iniFile.Get("Settings", "AspectRatio", &iAspectRatio, (int)ASPECT_AUTO);
	iniFile.Get("Settings", "Crop", &bCrop, false);
	iniFile.Get("Settings", "UseXFB", &bUseXFB, 0);
	iniFile.Get("Settings", "UseRealXFB", &bUseRealXFB, 0);

	iniFile.Get("Settings", "ShowFPS", &bShowFPS, false); // Settings
	iniFile.Get("Settings", "ShowInputDisplay", &bShowInputDisplay, false);
	iniFile.Get("Settings", "OverlayStats", &bOverlayStats, 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", "HiresTextures", &bHiresTextures, 0);
	iniFile.Get("Settings", "DumpEFBTarget", &bDumpEFBTarget, 0);
	iniFile.Get("Settings", "DumpFrames", &bDumpFrames, 0);
	iniFile.Get("Settings", "FreeLook", &bFreeLook, 0);
	iniFile.Get("Settings", "UseFFV1", &bUseFFV1, 0);
	iniFile.Get("Settings", "AnaglyphStereo", &bAnaglyphStereo, false);
	iniFile.Get("Settings", "AnaglyphStereoSeparation", &iAnaglyphStereoSeparation, 200);
	iniFile.Get("Settings", "AnaglyphFocalAngle", &iAnaglyphFocalAngle, 0);
	iniFile.Get("Settings", "EnablePixelLighting", &bEnablePixelLighting, 0);
	iniFile.Get("Settings", "EnablePerPixelDepth", &bEnablePerPixelDepth, 0);
	
	iniFile.Get("Settings", "ShowShaderErrors", &bShowShaderErrors, 1);
	iniFile.Get("Settings", "MSAA", &iMultisampleMode, 0);
	iniFile.Get("Settings", "EFBScale", &iEFBScale, 2); // native
	
	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("Settings", "EnableOpenCL", &bEnableOpenCL, false);
	iniFile.Get("Settings", "OMPDecoder", &bOMPDecoder, false);

	iniFile.Get("Enhancements", "ForceFiltering", &bForceFiltering, 0);
	iniFile.Get("Enhancements", "MaxAnisotropy", &iMaxAnisotropy, 0);  // NOTE - this is x in (1 << x)
	iniFile.Get("Enhancements", "PostProcessingShader", &sPostProcessingShader, "");
	iniFile.Get("Enhancements", "Enable3dVision", &b3DVision, false);
	
	iniFile.Get("Hacks", "EFBAccessEnable", &bEFBAccessEnable, true);
	iniFile.Get("Hacks", "DlistCachingEnable", &bDlistCachingEnable,false);
	iniFile.Get("Hacks", "EFBCopyEnable", &bEFBCopyEnable, true);
	iniFile.Get("Hacks", "EFBCopyDisableHotKey", &bOSDHotKey, 0);
	iniFile.Get("Hacks", "EFBCopyRAMEnable", &bEFBCopyRAMEnable, true);
	iniFile.Get("Hacks", "EFBCopyVirtualEnable", &bEFBCopyVirtualEnable, true);
	iniFile.Get("Hacks", "EFBEmulateFormatChanges", &bEFBEmulateFormatChanges, false);

	iniFile.Get("Hardware", "Adapter", &iAdapter, 0);

	// Load common settings
	iniFile.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
	bool bTmp;
	iniFile.Get("Interface", "UsePanicHandlers", &bTmp, true);
	SetEnableAlert(bTmp);
}
Ejemplo n.º 16
0
InputHook::InputHook() :
m_hookmask(HOOK_COM),
m_fakepidvid(MAKELONG(0x045E, 0x028E)),
m_timeout(0),
m_timeout_thread(INVALID_HANDLE_VALUE)
{
	IniFile ini;
	std::string inipath("x360ce.ini");
	if (!ini.Load(inipath))
		CheckCommonDirectory(&inipath, "x360ce");
	if (!ini.Load(inipath)) return;

	bool read_from_database = ReadGameDatabase();

	if (!read_from_database)
	{
		if (!ini.Get("InputHook", "HookMask", &m_hookmask, HOOK_COM))
		{
			bool check = false;
			ini.Get("InputHook", "HookLL", &check);
			if (check) m_hookmask |= HOOK_LL;

			ini.Get("InputHook", "HookCOM", &check);
			if (check) m_hookmask |= HOOK_COM;

			ini.Get("InputHook", "HookDI", &check);
			if (check) m_hookmask |= HOOK_DI;

			ini.Get("InputHook", "HookPIDVID", &check);
			if (check) m_hookmask |= HOOK_PIDVID;

			ini.Get("InputHook", "HookSA", &check);
			if (check) m_hookmask |= HOOK_SA;

			ini.Get("InputHook", "HookNAME", &check);
			if (check) m_hookmask |= HOOK_NAME;

			ini.Get("InputHook", "HookSTOP", &check);
			if (check) m_hookmask |= HOOK_STOP;

			ini.Get("InputHook", "HookWT", &check);
			if (check) m_hookmask |= HOOK_WT;
		}

		if (GetState(HOOK_PIDVID))
		{
			u32 vid;
			u32 pid;
			ini.Get<u32>("InputHook", "FakeVID", &vid, 0x045E);
			ini.Get<u32>("InputHook", "FakePID", &pid, 0x028E);

			if (vid != 0x045E || pid != 0x28E)
				m_fakepidvid = MAKELONG(vid, pid);
		}
	}

	if (m_hookmask)
	{
		PrintLog("InputHook starting...");

		// Initalize InputHook Devices
		for (u32 i = 0; i < XUSER_MAX_COUNT; ++i)
		{
			std::string section;
			std::string key = StringFormat("PAD%u", i + 1);
			if (!ini.Get("Mappings", key, &section))
				continue;

			u32 index = 0;
			if (!ini.Get(section, "UserIndex", &index))
				index = i;

			std::string buffer;
			GUID productid = GUID_NULL;
			GUID instanceid = GUID_NULL;

			if (ini.Get(section, "ProductGUID", &buffer))
				StringToGUID(&productid, buffer);

			if (ini.Get(section, "InstanceGUID", &buffer))
				StringToGUID(&instanceid, buffer);

			if (!IsEqualGUID(productid, GUID_NULL) && !IsEqualGUID(instanceid, GUID_NULL))
			{
				m_devices.push_back(InputHookDevice(index, productid, instanceid));
			}
		}
	}

	if (!m_devices.empty())
	{
		if (!read_from_database)
			ini.Get<u32>("InputHook", "Timeout", &m_timeout, 45);

		std::string maskname;
		if (MaskToName(&maskname, m_hookmask))
			PrintLog("HookMask 0x%08X: %s", m_hookmask, maskname.c_str());

		MH_Initialize();

		if (GetState(HOOK_LL))
			HookLL();

		if (GetState(HOOK_COM))
			HookCOM();

		if (GetState(HOOK_DI))
			HookDI();

		if (GetState(HOOK_SA))
			HookSA();

		if (GetState(HOOK_WT))
			HookWT();

		MH_EnableHook(MH_ALL_HOOKS);
	}
}
Ejemplo n.º 17
0
	void Init()
	{
		// Initialize our touchscreen buttons
		for (int a = 0; a < 4; ++a)
		{
			m_buttons[std::make_pair(a, BUTTON_A)] = new Button();
			m_buttons[std::make_pair(a, BUTTON_B)] = new Button();
			m_buttons[std::make_pair(a, BUTTON_START)] = new Button();
			m_buttons[std::make_pair(a, BUTTON_X)] = new Button();
			m_buttons[std::make_pair(a, BUTTON_Y)] = new Button();
			m_buttons[std::make_pair(a, BUTTON_Z)] = new Button();
			m_buttons[std::make_pair(a, BUTTON_UP)] = new Button();
			m_buttons[std::make_pair(a, BUTTON_DOWN)] = new Button();
			m_buttons[std::make_pair(a, BUTTON_LEFT)] = new Button();
			m_buttons[std::make_pair(a, BUTTON_RIGHT)] = new Button();

			m_axises[std::make_pair(a, STICK_MAIN_UP)] = new Axis();
			m_axises[std::make_pair(a, STICK_MAIN_DOWN)] = new Axis();
			m_axises[std::make_pair(a, STICK_MAIN_LEFT)] = new Axis();
			m_axises[std::make_pair(a, STICK_MAIN_RIGHT)] = new Axis();
			m_axises[std::make_pair(a, STICK_C_UP)] = new Axis();
			m_axises[std::make_pair(a, STICK_C_DOWN)] = new Axis();
			m_axises[std::make_pair(a, STICK_C_LEFT)] = new Axis();
			m_axises[std::make_pair(a, STICK_C_RIGHT)] = new Axis();
			m_buttons[std::make_pair(a, TRIGGER_L)] = new Button();
			m_buttons[std::make_pair(a, TRIGGER_R)] = new Button();
		}
		// Init our controller bindings
		IniFile ini;
		ini.Load(File::GetUserPath(D_CONFIG_IDX) + std::string("Dolphin.ini"));
		for (int a = 0; a < configStringNum; ++a)
		{
			for (int padID = 0; padID < 4; ++padID)
			{
				std::ostringstream config;
				config << configStrings[a] << "_" << padID;
				BindType type;
				int bindnum;
				char dev[128];
				bool hasbind = false;
				char modifier = 0;
				std::string value;
				ini.Get("Android", config.str(), &value, "None");
				if (value == "None")
					continue;
				if (std::string::npos != value.find("Axis"))
				{
					hasbind = true;
					type = BIND_AXIS;
					sscanf(value.c_str(), "Device '%[^\']'-Axis %d%c", dev, &bindnum, &modifier);
				}
				else if (std::string::npos != value.find("Button"))
				{
					hasbind = true;
					type = BIND_BUTTON;
					sscanf(value.c_str(), "Device '%[^\']'-Button %d", dev, &bindnum);
				}
				if (hasbind)
					AddBind(std::string(dev), new sBind(padID, (ButtonType)a, type, bindnum, modifier == '-' ? -1.0f : 1.0f));
			}
		}

	}
Ejemplo n.º 18
0
void VideoConfig::Load(const char *ini_file)
{
	IniFile iniFile;
	iniFile.Load(ini_file);

	iniFile.Get("Hardware", "VSync", &bVSync, 0); // Hardware
	iniFile.Get("Settings", "wideScreenHack", &bWidescreenHack, false);
	iniFile.Get("Settings", "AspectRatio", &iAspectRatio, (int)ASPECT_AUTO);
	iniFile.Get("Settings", "Crop", &bCrop, false);
	iniFile.Get("Settings", "UseXFB", &bUseXFB, 0);
	iniFile.Get("Settings", "UseRealXFB", &bUseRealXFB, 0);
	iniFile.Get("Settings", "SafeTextureCacheColorSamples", &iSafeTextureCache_ColorSamples,128);
	iniFile.Get("Settings", "ShowFPS", &bShowFPS, false); // Settings
	iniFile.Get("Settings", "LogFPSToFile", &bLogFPSToFile, false);
	iniFile.Get("Settings", "ShowInputDisplay", &bShowInputDisplay, false);
	iniFile.Get("Settings", "OverlayStats", &bOverlayStats, 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", "HiresTextures", &bHiresTextures, 0);
	iniFile.Get("Settings", "DumpEFBTarget", &bDumpEFBTarget, 0);
	iniFile.Get("Settings", "DumpFrames", &bDumpFrames, 0);
	iniFile.Get("Settings", "FreeLook", &bFreeLook, 0);
	iniFile.Get("Settings", "UseFFV1", &bUseFFV1, 0);
	iniFile.Get("Settings", "AnaglyphStereo", &bAnaglyphStereo, false);
	iniFile.Get("Settings", "AnaglyphStereoSeparation", &iAnaglyphStereoSeparation, 200);
	iniFile.Get("Settings", "AnaglyphFocalAngle", &iAnaglyphFocalAngle, 0);
	iniFile.Get("Settings", "EnablePixelLighting", &bEnablePixelLighting, 0);
	iniFile.Get("Settings", "FastDepthCalc", &bFastDepthCalc, true);

	iniFile.Get("Settings", "MSAA", &iMultisampleMode, 0);
	iniFile.Get("Settings", "EFBScale", &iEFBScale, (int) SCALE_1X); // native

	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", "DisableFog", &bDisableFog, 0);

	iniFile.Get("Settings", "OMPDecoder", &bOMPDecoder, false);

	iniFile.Get("Settings", "EnableShaderDebugging", &bEnableShaderDebugging, false);

	iniFile.Get("Enhancements", "ForceFiltering", &bForceFiltering, 0);
	iniFile.Get("Enhancements", "MaxAnisotropy", &iMaxAnisotropy, 0);  // NOTE - this is x in (1 << x)
	iniFile.Get("Enhancements", "PostProcessingShader", &sPostProcessingShader, "");
	iniFile.Get("Enhancements", "Enable3dVision", &b3DVision, false);

	iniFile.Get("Hacks", "EFBAccessEnable", &bEFBAccessEnable, true);
	iniFile.Get("Hacks", "DlistCachingEnable", &bDlistCachingEnable,false);
	iniFile.Get("Hacks", "EFBCopyEnable", &bEFBCopyEnable, true);
	iniFile.Get("Hacks", "EFBToTextureEnable", &bCopyEFBToTexture, true);
	iniFile.Get("Hacks", "EFBScaledCopy", &bCopyEFBScaled, true);
	iniFile.Get("Hacks", "EFBCopyCacheEnable", &bEFBCopyCacheEnable, false);
	iniFile.Get("Hacks", "EFBEmulateFormatChanges", &bEFBEmulateFormatChanges, false);

	iniFile.Get("Hardware", "Adapter", &iAdapter, 0);

	// Load common settings
	iniFile.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
	bool bTmp;
	iniFile.Get("Interface", "UsePanicHandlers", &bTmp, true);
	SetEnableAlert(bTmp);

	// Shader Debugging causes a huge slowdown and it's easy to forget about it
	// since it's not exposed in the settings dialog. It's only used by
	// developers, so displaying an obnoxious message avoids some confusion and
	// is not too annoying/confusing for users.
	//
	// XXX(delroth): This is kind of a bad place to put this, but the current
	// VideoCommon is a mess and we don't have a central initialization
	// function to do these kind of checks. Instead, the init code is
	// triplicated for each video backend.
	if (bEnableShaderDebugging)
		OSD::AddMessage("Warning: Shader Debugging is enabled, performance will suffer heavily", 15000);
}
Ejemplo n.º 19
0
void SConfig::SaveSettings()
{
    NOTICE_LOG(BOOT, "Saving settings to %s", File::GetUserPath(F_DOLPHINCONFIG_IDX).c_str());
    IniFile ini;
    ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX)); // load first to not kill unknown stuff

    // General
    ini.Set("General", "LastFilename",	m_LastFilename);

    // ISO folders
    // clear removed folders
    int oldPaths,
        numPaths = (int)m_ISOFolder.size();
    ini.Get("General", "GCMPathes", &oldPaths, 0);
    for (int i = numPaths; i < oldPaths; i++)
    {
        TCHAR tmp[16];
        sprintf(tmp, "GCMPath%i", i);
        ini.DeleteKey("General", tmp);
    }

    ini.Set("General", "GCMPathes",		numPaths);

    for (int i = 0; i < numPaths; i++)
    {
        TCHAR tmp[16];
        sprintf(tmp, "GCMPath%i", i);
        ini.Set("General", tmp, m_ISOFolder[i]);
    }

    ini.Set("General", "RecursiveGCMPaths", m_RecursiveISOFolder);
    ini.Set("General", "NANDRoot",			m_NANDPath);

    // Interface
    ini.Set("Interface", "ConfirmStop",			m_LocalCoreStartupParameter.bConfirmStop);
    ini.Set("Interface", "UsePanicHandlers",	m_LocalCoreStartupParameter.bUsePanicHandlers);
    ini.Set("Interface", "HideCursor",			m_LocalCoreStartupParameter.bHideCursor);
    ini.Set("Interface", "AutoHideCursor",		m_LocalCoreStartupParameter.bAutoHideCursor);
    ini.Set("Interface", "Theme",				m_LocalCoreStartupParameter.iTheme);
    ini.Set("Interface", "MainWindowPosX",		(m_LocalCoreStartupParameter.iPosX == -32000) ? 0 : m_LocalCoreStartupParameter.iPosX); // TODO - HAX
    ini.Set("Interface", "MainWindowPosY",		(m_LocalCoreStartupParameter.iPosY == -32000) ? 0 : m_LocalCoreStartupParameter.iPosY); // TODO - HAX
    ini.Set("Interface", "MainWindowWidth",		m_LocalCoreStartupParameter.iWidth);
    ini.Set("Interface", "MainWindowHeight",	m_LocalCoreStartupParameter.iHeight);
    ini.Set("Interface", "Language",			m_InterfaceLanguage);
    ini.Set("Interface", "ShowToolbar",			m_InterfaceToolbar);
    ini.Set("Interface", "ShowStatusbar",		m_InterfaceStatusbar);
    ini.Set("Interface", "ShowLogWindow",		m_InterfaceLogWindow);
    ini.Set("Interface", "ShowLogConfigWindow",	m_InterfaceLogConfigWindow);
    ini.Set("Interface", "ShowConsole",			m_InterfaceConsole);

    // Hotkeys
    for (int i = 0; i < NUM_HOTKEYS; i++)
    {
        ini.Set("Hotkeys", g_HKData[i].IniText, m_LocalCoreStartupParameter.iHotkey[i]);
        ini.Set("Hotkeys", (std::string(g_HKData[i].IniText) + "Modifier").c_str(),
                m_LocalCoreStartupParameter.iHotkeyModifier[i]);
    }

    // Display
    ini.Set("Display", "FullscreenResolution",	m_LocalCoreStartupParameter.strFullscreenResolution);
    ini.Set("Display", "Fullscreen",			m_LocalCoreStartupParameter.bFullscreen);
    ini.Set("Display", "RenderToMain",			m_LocalCoreStartupParameter.bRenderToMain);
    ini.Set("Display", "RenderWindowXPos",		m_LocalCoreStartupParameter.iRenderWindowXPos);
    ini.Set("Display", "RenderWindowYPos",		m_LocalCoreStartupParameter.iRenderWindowYPos);
    ini.Set("Display", "RenderWindowWidth",		m_LocalCoreStartupParameter.iRenderWindowWidth);
    ini.Set("Display", "RenderWindowHeight",	m_LocalCoreStartupParameter.iRenderWindowHeight);
    ini.Set("Display", "RenderWindowAutoSize",	m_LocalCoreStartupParameter.bRenderWindowAutoSize);
    ini.Set("Display", "KeepWindowOnTop",		m_LocalCoreStartupParameter.bKeepWindowOnTop);
    ini.Set("Display", "ProgressiveScan",		m_LocalCoreStartupParameter.bProgressive);
    ini.Set("Display", "DisableScreenSaver",	m_LocalCoreStartupParameter.bDisableScreenSaver);
    ini.Set("Display", "ForceNTSCJ",			m_LocalCoreStartupParameter.bForceNTSCJ);

    // Game List Control
    ini.Set("GameList", "ListDrives",	m_ListDrives);
    ini.Set("GameList", "ListWad",		m_ListWad);
    ini.Set("GameList", "ListWii",		m_ListWii);
    ini.Set("GameList", "ListGC",		m_ListGC);
    ini.Set("GameList", "ListJap",		m_ListJap);
    ini.Set("GameList", "ListPal",		m_ListPal);
    ini.Set("GameList", "ListUsa",		m_ListUsa);
    ini.Set("GameList", "ListFrance",	m_ListFrance);
    ini.Set("GameList", "ListItaly",	m_ListItaly);
    ini.Set("GameList", "ListKorea",	m_ListKorea);
    ini.Set("GameList", "ListTaiwan",	m_ListTaiwan);
    ini.Set("GameList", "ListUnknown",	m_ListUnknown);

    // Core
    ini.Set("Core", "HLE_BS2",			m_LocalCoreStartupParameter.bHLE_BS2);
    ini.Set("Core", "CPUCore",			m_LocalCoreStartupParameter.iCPUCore);
    ini.Set("Core", "CPUThread",		m_LocalCoreStartupParameter.bCPUThread);
    ini.Set("Core", "DSPThread",		m_LocalCoreStartupParameter.bDSPThread);
    ini.Set("Core", "DSPHLE",			m_LocalCoreStartupParameter.bDSPHLE);
    ini.Set("Core", "SkipIdle",			m_LocalCoreStartupParameter.bSkipIdle);
    ini.Set("Core", "LockThreads",		m_LocalCoreStartupParameter.bLockThreads);
    ini.Set("Core", "DefaultGCM",		m_LocalCoreStartupParameter.m_strDefaultGCM);
    ini.Set("Core", "DVDRoot",			m_LocalCoreStartupParameter.m_strDVDRoot);
    ini.Set("Core", "Apploader",		m_LocalCoreStartupParameter.m_strApploader);
    ini.Set("Core", "EnableCheats",		m_LocalCoreStartupParameter.bEnableCheats);
    ini.Set("Core", "SelectedLanguage",	m_LocalCoreStartupParameter.SelectedLanguage);
    ini.Set("Core", "MemcardA",			m_strMemoryCardA);
    ini.Set("Core", "MemcardB",			m_strMemoryCardB);
    ini.Set("Core", "SlotA",			m_EXIDevice[0]);
    ini.Set("Core", "SlotB",			m_EXIDevice[1]);
    ini.Set("Core", "SerialPort1",		m_EXIDevice[2]);
    ini.Set("Core", "BBA_MAC",			m_bba_mac);
    char sidevicenum[16];
    for (int i = 0; i < 4; ++i)
    {
        sprintf(sidevicenum, "SIDevice%i", i);
        ini.Set("Core", sidevicenum, m_SIDevice[i]);
    }

    ini.Set("Core", "WiiSDCard", m_WiiSDCard);
    ini.Set("Core", "WiiKeyboard", m_WiiKeyboard);
    ini.Set("Core", "WiimoteReconnectOnLoad", m_WiimoteReconnectOnLoad);
    ini.Set("Core", "RunCompareServer",	m_LocalCoreStartupParameter.bRunCompareServer);
    ini.Set("Core", "RunCompareClient",	m_LocalCoreStartupParameter.bRunCompareClient);
    ini.Set("Core", "FrameLimit",		m_Framelimit);
    ini.Set("Core", "UseFPS",		b_UseFPS);

    // GFX Backend
    ini.Set("Core", "GFXBackend",	m_LocalCoreStartupParameter.m_strVideoBackend);

    ini.Save(File::GetUserPath(F_DOLPHINCONFIG_IDX));
    m_SYSCONF->Save();
}
Ejemplo n.º 20
0
void SConfig::LoadSettings()
{
    INFO_LOG(BOOT, "Loading Settings from %s", File::GetUserPath(F_DOLPHINCONFIG_IDX).c_str());
    IniFile ini;
    ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));

    // General
    {
        ini.Get("General", "LastFilename",	&m_LastFilename);

        m_ISOFolder.clear();
        int numGCMPaths;

        if (ini.Get("General", "GCMPathes", &numGCMPaths, 0))
        {
            for (int i = 0; i < numGCMPaths; i++)
            {
                TCHAR tmp[16];
                sprintf(tmp, "GCMPath%i", i);
                std::string tmpPath;
                ini.Get("General", tmp, &tmpPath, "");
                m_ISOFolder.push_back(tmpPath);
            }
        }

        ini.Get("General", "RecursiveGCMPaths",		&m_RecursiveISOFolder,							false);

        ini.Get("General", "NANDRoot",		&m_NANDPath);
        m_NANDPath = File::GetUserPath(D_WIIROOT_IDX, m_NANDPath);
        DiscIO::cUIDsys::AccessInstance().UpdateLocation();
        DiscIO::CSharedContent::AccessInstance().UpdateLocation();
    }

    {
        // Interface
        ini.Get("Interface", "ConfirmStop",			&m_LocalCoreStartupParameter.bConfirmStop,		false);
        ini.Get("Interface", "UsePanicHandlers",	&m_LocalCoreStartupParameter.bUsePanicHandlers,	true);
        ini.Get("Interface", "HideCursor",			&m_LocalCoreStartupParameter.bHideCursor,		false);
        ini.Get("Interface", "AutoHideCursor",		&m_LocalCoreStartupParameter.bAutoHideCursor,	false);
        ini.Get("Interface", "Theme",				&m_LocalCoreStartupParameter.iTheme,			0);
        ini.Get("Interface", "MainWindowPosX",		&m_LocalCoreStartupParameter.iPosX,				100);
        ini.Get("Interface", "MainWindowPosY",		&m_LocalCoreStartupParameter.iPosY,				100);
        ini.Get("Interface", "MainWindowWidth",		&m_LocalCoreStartupParameter.iWidth,			800);
        ini.Get("Interface", "MainWindowHeight",	&m_LocalCoreStartupParameter.iHeight,			600);
        ini.Get("Interface", "Language",			&m_InterfaceLanguage,							0);
        ini.Get("Interface", "ShowToolbar",			&m_InterfaceToolbar,							true);
        ini.Get("Interface", "ShowStatusbar",		&m_InterfaceStatusbar,							true);
        ini.Get("Interface", "ShowLogWindow",		&m_InterfaceLogWindow,							false);
        ini.Get("Interface", "ShowLogConfigWindow",	&m_InterfaceLogConfigWindow,					false);
        ini.Get("Interface", "ShowConsole",			&m_InterfaceConsole,							false);

        // Hotkeys
        for (int i = 0; i < NUM_HOTKEYS; i++)
        {
            ini.Get("Hotkeys", g_HKData[i].IniText,
                    &m_LocalCoreStartupParameter.iHotkey[i], g_HKData[i].DefaultKey);
            ini.Get("Hotkeys", (std::string(g_HKData[i].IniText) + "Modifier").c_str(),
                    &m_LocalCoreStartupParameter.iHotkeyModifier[i], g_HKData[i].DefaultModifier);
        }

        // Display
        ini.Get("Display", "Fullscreen",			&m_LocalCoreStartupParameter.bFullscreen,		false);
        ini.Get("Display", "FullscreenResolution",	&m_LocalCoreStartupParameter.strFullscreenResolution, "640x480");
        ini.Get("Display", "RenderToMain",			&m_LocalCoreStartupParameter.bRenderToMain,		false);
        ini.Get("Display", "RenderWindowXPos",		&m_LocalCoreStartupParameter.iRenderWindowXPos,	-1);
        ini.Get("Display", "RenderWindowYPos",		&m_LocalCoreStartupParameter.iRenderWindowYPos,	-1);
        ini.Get("Display", "RenderWindowWidth",		&m_LocalCoreStartupParameter.iRenderWindowWidth, 640);
        ini.Get("Display", "RenderWindowHeight",	&m_LocalCoreStartupParameter.iRenderWindowHeight, 480);
        ini.Get("Display", "RenderWindowAutoSize",	&m_LocalCoreStartupParameter.bRenderWindowAutoSize, false);
        ini.Get("Display", "KeepWindowOnTop",		&m_LocalCoreStartupParameter.bKeepWindowOnTop, false);
        ini.Get("Display", "ProgressiveScan",		&m_LocalCoreStartupParameter.bProgressive, false);
        ini.Get("Display", "DisableScreenSaver",	&m_LocalCoreStartupParameter.bDisableScreenSaver, true);
        ini.Get("Display", "ForceNTSCJ",			&m_LocalCoreStartupParameter.bForceNTSCJ, false);

        // Game List Control
        ini.Get("GameList", "ListDrives",	&m_ListDrives,	false);
        ini.Get("GameList", "ListWad",		&m_ListWad,		true);
        ini.Get("GameList", "ListWii",		&m_ListWii,		true);
        ini.Get("GameList", "ListGC",		&m_ListGC,		true);
        ini.Get("GameList", "ListJap",		&m_ListJap,		true);
        ini.Get("GameList", "ListPal",		&m_ListPal,		true);
        ini.Get("GameList", "ListUsa",		&m_ListUsa,		true);

        ini.Get("GameList", "ListFrance",		&m_ListFrance, true);
        ini.Get("GameList", "ListItaly",		&m_ListItaly, true);
        ini.Get("GameList", "ListKorea",		&m_ListKorea, true);
        ini.Get("GameList", "ListTaiwan",		&m_ListTaiwan, true);
        ini.Get("GameList", "ListUnknown",		&m_ListUnknown, true);

        // Core
        ini.Get("Core", "HLE_BS2",		&m_LocalCoreStartupParameter.bHLE_BS2,		false);
        ini.Get("Core", "CPUCore",		&m_LocalCoreStartupParameter.iCPUCore,		1);
        ini.Get("Core", "DSPThread",	&m_LocalCoreStartupParameter.bDSPThread,	false);
        ini.Get("Core", "DSPHLE",		&m_LocalCoreStartupParameter.bDSPHLE,		true);
        ini.Get("Core", "CPUThread",	&m_LocalCoreStartupParameter.bCPUThread,	true);
        ini.Get("Core", "SkipIdle",		&m_LocalCoreStartupParameter.bSkipIdle,		true);
        ini.Get("Core", "LockThreads",	&m_LocalCoreStartupParameter.bLockThreads,	false);
        ini.Get("Core", "DefaultGCM",	&m_LocalCoreStartupParameter.m_strDefaultGCM);
        ini.Get("Core", "DVDRoot",		&m_LocalCoreStartupParameter.m_strDVDRoot);
        ini.Get("Core", "Apploader",	&m_LocalCoreStartupParameter.m_strApploader);
        ini.Get("Core", "EnableCheats",	&m_LocalCoreStartupParameter.bEnableCheats,				false);
        ini.Get("Core", "SelectedLanguage", &m_LocalCoreStartupParameter.SelectedLanguage,		0);
        ini.Get("Core", "MemcardA",		&m_strMemoryCardA);
        ini.Get("Core", "MemcardB",		&m_strMemoryCardB);
        ini.Get("Core", "SlotA",		(int*)&m_EXIDevice[0], EXIDEVICE_MEMORYCARD);
        ini.Get("Core", "SlotB",		(int*)&m_EXIDevice[1], EXIDEVICE_NONE);
        ini.Get("Core", "SerialPort1",	(int*)&m_EXIDevice[2], EXIDEVICE_NONE);
        ini.Get("Core", "BBA_MAC",		&m_bba_mac);
        ini.Get("Core", "ProfiledReJIT",&m_LocalCoreStartupParameter.bJITProfiledReJIT,			false);
        ini.Get("Core", "TimeProfiling",&m_LocalCoreStartupParameter.bJITILTimeProfiling,		false);
        ini.Get("Core", "OutputIR",		&m_LocalCoreStartupParameter.bJITILOutputIR,			false);
        char sidevicenum[16];
        for (int i = 0; i < 4; ++i)
        {
            sprintf(sidevicenum, "SIDevice%i", i);
            ini.Get("Core", sidevicenum,	(u32*)&m_SIDevice[i], (i == 0) ? SIDEVICE_GC_CONTROLLER : SIDEVICE_NONE);
        }

        ini.Get("Core", "WiiSDCard",		&m_WiiSDCard,									false);
        ini.Get("Core", "WiiKeyboard",		&m_WiiKeyboard,									false);
        ini.Get("Core", "WiimoteReconnectOnLoad",	&m_WiimoteReconnectOnLoad,							true);
        ini.Get("Core", "RunCompareServer",	&m_LocalCoreStartupParameter.bRunCompareServer,	false);
        ini.Get("Core", "RunCompareClient",	&m_LocalCoreStartupParameter.bRunCompareClient,	false);
        ini.Get("Core", "MMU",				&m_LocalCoreStartupParameter.bMMU,				false);
        ini.Get("Core", "TLBHack",			&m_LocalCoreStartupParameter.iTLBHack,			0);
        ini.Get("Core", "VBeam",			&m_LocalCoreStartupParameter.bVBeam,			false);
        ini.Get("Core", "FastDiscSpeed",	&m_LocalCoreStartupParameter.bFastDiscSpeed,	false);
        ini.Get("Core", "BAT",				&m_LocalCoreStartupParameter.bMMUBAT,			false);
        ini.Get("Core", "FrameLimit",		&m_Framelimit,									1); // auto frame limit by default
        ini.Get("Core", "UseFPS",			&b_UseFPS,										false); // use vps as default

        // GFX Backend
        ini.Get("Core", "GFXBackend",  &m_LocalCoreStartupParameter.m_strVideoBackend, "");
    }

    m_SYSCONF = new SysConf();
}
Ejemplo n.º 21
0
void SConfig::LoadSettings()
{
	INFO_LOG(BOOT, "Loading Settings from %s", File::GetUserPath(F_DOLPHINCONFIG_IDX).c_str());
	IniFile ini;
	ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));

	// General
	{
		ini.Get("General", "LastFilename", &m_LastFilename);
		ini.Get("General", "ShowLag", &m_ShowLag, false);
		#ifdef USE_GDBSTUB
		ini.Get("General", "GDBPort", &(m_LocalCoreStartupParameter.iGDBPort), -1);
		#endif

		m_ISOFolder.clear();
		int numGCMPaths;

		if (ini.Get("General", "GCMPathes", &numGCMPaths, 0))
		{
			for (int i = 0; i < numGCMPaths; i++)
			{
				std::string tmpPath;
				ini.Get("General", StringFromFormat("GCMPath%i", i), &tmpPath, "");
				m_ISOFolder.push_back(std::move(tmpPath));
			}
		}

		ini.Get("General", "RecursiveGCMPaths", &m_RecursiveISOFolder, false);

		ini.Get("General", "NANDRootPath", &m_NANDPath);
		m_NANDPath = File::GetUserPath(D_WIIROOT_IDX, m_NANDPath);
		DiscIO::cUIDsys::AccessInstance().UpdateLocation();
		DiscIO::CSharedContent::AccessInstance().UpdateLocation();
		ini.Get("General", "WirelessMac", &m_WirelessMac);
	}

	{
		// Interface
		ini.Get("Interface", "ConfirmStop",             &m_LocalCoreStartupParameter.bConfirmStop,      true);
		ini.Get("Interface", "UsePanicHandlers",        &m_LocalCoreStartupParameter.bUsePanicHandlers, true);
		ini.Get("Interface", "OnScreenDisplayMessages", &m_LocalCoreStartupParameter.bOnScreenDisplayMessages, true);
		ini.Get("Interface", "HideCursor",              &m_LocalCoreStartupParameter.bHideCursor,       false);
		ini.Get("Interface", "AutoHideCursor",          &m_LocalCoreStartupParameter.bAutoHideCursor,   false);
		ini.Get("Interface", "MainWindowPosX",          &m_LocalCoreStartupParameter.iPosX,             100);
		ini.Get("Interface", "MainWindowPosY",          &m_LocalCoreStartupParameter.iPosY,             100);
		ini.Get("Interface", "MainWindowWidth",         &m_LocalCoreStartupParameter.iWidth,            800);
		ini.Get("Interface", "MainWindowHeight",        &m_LocalCoreStartupParameter.iHeight,           600);
		ini.Get("Interface", "Language",                &m_InterfaceLanguage,                           0);
		ini.Get("Interface", "ShowToolbar",             &m_InterfaceToolbar,                            true);
		ini.Get("Interface", "ShowStatusbar",           &m_InterfaceStatusbar,                          true);
		ini.Get("Interface", "ShowLogWindow",           &m_InterfaceLogWindow,                          false);
		ini.Get("Interface", "ShowLogConfigWindow",     &m_InterfaceLogConfigWindow,                    false);
		ini.Get("Interface", "ThemeName40",             &m_LocalCoreStartupParameter.theme_name,        "Clean");

		// Hotkeys
		for (int i = 0; i < NUM_HOTKEYS; i++)
		{
			ini.Get("Hotkeys", g_HKData[i].IniText,
			        &m_LocalCoreStartupParameter.iHotkey[i], g_HKData[i].DefaultKey);
			ini.Get("Hotkeys", std::string(g_HKData[i].IniText) + "Modifier",
			        &m_LocalCoreStartupParameter.iHotkeyModifier[i], g_HKData[i].DefaultModifier);
		}

		// Display
		ini.Get("Display", "Fullscreen",           &m_LocalCoreStartupParameter.bFullscreen, false);
		ini.Get("Display", "FullscreenResolution", &m_LocalCoreStartupParameter.strFullscreenResolution, "Auto");
		ini.Get("Display", "RenderToMain",         &m_LocalCoreStartupParameter.bRenderToMain, false);
		ini.Get("Display", "RenderWindowXPos",     &m_LocalCoreStartupParameter.iRenderWindowXPos, -1);
		ini.Get("Display", "RenderWindowYPos",     &m_LocalCoreStartupParameter.iRenderWindowYPos, -1);
		ini.Get("Display", "RenderWindowWidth",    &m_LocalCoreStartupParameter.iRenderWindowWidth, 640);
		ini.Get("Display", "RenderWindowHeight",   &m_LocalCoreStartupParameter.iRenderWindowHeight, 480);
		ini.Get("Display", "RenderWindowAutoSize", &m_LocalCoreStartupParameter.bRenderWindowAutoSize, false);
		ini.Get("Display", "KeepWindowOnTop",      &m_LocalCoreStartupParameter.bKeepWindowOnTop, false);
		ini.Get("Display", "ProgressiveScan",      &m_LocalCoreStartupParameter.bProgressive, false);
		ini.Get("Display", "DisableScreenSaver",   &m_LocalCoreStartupParameter.bDisableScreenSaver, true);
		ini.Get("Display", "ForceNTSCJ",           &m_LocalCoreStartupParameter.bForceNTSCJ, false);

		// Game List Control
		ini.Get("GameList", "ListDrives",       &m_ListDrives,  false);
		ini.Get("GameList", "ListWad",          &m_ListWad,     true);
		ini.Get("GameList", "ListWii",          &m_ListWii,     true);
		ini.Get("GameList", "ListGC",           &m_ListGC,      true);
		ini.Get("GameList", "ListJap",          &m_ListJap,     true);
		ini.Get("GameList", "ListPal",          &m_ListPal,     true);
		ini.Get("GameList", "ListUsa",          &m_ListUsa,     true);

		ini.Get("GameList", "ListFrance",       &m_ListFrance,  true);
		ini.Get("GameList", "ListItaly",        &m_ListItaly,   true);
		ini.Get("GameList", "ListKorea",        &m_ListKorea,   true);
		ini.Get("GameList", "ListTaiwan",       &m_ListTaiwan,  true);
		ini.Get("GameList", "ListUnknown",      &m_ListUnknown, true);
		ini.Get("GameList", "ListSort",         &m_ListSort,       3);
		ini.Get("GameList", "ListSortSecondary",&m_ListSort2,  0);

		// Core
		ini.Get("Core", "HLE_BS2",      &m_LocalCoreStartupParameter.bHLE_BS2, false);
#ifdef _M_X86
		ini.Get("Core", "CPUCore",      &m_LocalCoreStartupParameter.iCPUCore, 1);
#elif _M_ARM_32
		ini.Get("Core", "CPUCore",      &m_LocalCoreStartupParameter.iCPUCore, 3);
#else
		ini.Get("Core", "CPUCore",      &m_LocalCoreStartupParameter.iCPUCore, 0);
#endif
		ini.Get("Core", "Fastmem",           &m_LocalCoreStartupParameter.bFastmem,      true);
		ini.Get("Core", "DSPThread",         &m_LocalCoreStartupParameter.bDSPThread,    false);
		ini.Get("Core", "DSPHLE",            &m_LocalCoreStartupParameter.bDSPHLE,       true);
		ini.Get("Core", "CPUThread",         &m_LocalCoreStartupParameter.bCPUThread,    true);
		ini.Get("Core", "SkipIdle",          &m_LocalCoreStartupParameter.bSkipIdle,     true);
		ini.Get("Core", "DefaultGCM",        &m_LocalCoreStartupParameter.m_strDefaultGCM);
		ini.Get("Core", "DVDRoot",           &m_LocalCoreStartupParameter.m_strDVDRoot);
		ini.Get("Core", "Apploader",         &m_LocalCoreStartupParameter.m_strApploader);
		ini.Get("Core", "EnableCheats",      &m_LocalCoreStartupParameter.bEnableCheats, false);
		ini.Get("Core", "SelectedLanguage",  &m_LocalCoreStartupParameter.SelectedLanguage, 0);
		ini.Get("Core", "DPL2Decoder",       &m_LocalCoreStartupParameter.bDPL2Decoder, false);
		ini.Get("Core", "Latency",           &m_LocalCoreStartupParameter.iLatency, 2);
		ini.Get("Core", "MemcardAPath",      &m_strMemoryCardA);
		ini.Get("Core", "MemcardBPath",      &m_strMemoryCardB);
		ini.Get("Core", "SlotA",       (int*)&m_EXIDevice[0], EXIDEVICE_MEMORYCARD);
		ini.Get("Core", "SlotB",       (int*)&m_EXIDevice[1], EXIDEVICE_NONE);
		ini.Get("Core", "SerialPort1", (int*)&m_EXIDevice[2], EXIDEVICE_NONE);
		ini.Get("Core", "BBA_MAC",           &m_bba_mac);
		ini.Get("Core", "TimeProfiling",     &m_LocalCoreStartupParameter.bJITILTimeProfiling, false);
		ini.Get("Core", "OutputIR",          &m_LocalCoreStartupParameter.bJITILOutputIR,      false);
		for (int i = 0; i < MAX_SI_CHANNELS; ++i)
		{
			ini.Get("Core", StringFromFormat("SIDevice%i", i), (u32*)&m_SIDevice[i], (i == 0) ? SIDEVICE_GC_CONTROLLER : SIDEVICE_NONE);
		}
		ini.Get("Core", "WiiSDCard",                 &m_WiiSDCard,                                   false);
		ini.Get("Core", "WiiKeyboard",               &m_WiiKeyboard,                                 false);
		ini.Get("Core", "WiimoteContinuousScanning", &m_WiimoteContinuousScanning,                   false);
		ini.Get("Core", "WiimoteEnableSpeaker",      &m_WiimoteEnableSpeaker,                        true);
		ini.Get("Core", "RunCompareServer",          &m_LocalCoreStartupParameter.bRunCompareServer, false);
		ini.Get("Core", "RunCompareClient",          &m_LocalCoreStartupParameter.bRunCompareClient, false);
		ini.Get("Core", "MMU",                       &m_LocalCoreStartupParameter.bMMU,              false);
		ini.Get("Core", "TLBHack",                   &m_LocalCoreStartupParameter.bTLBHack,          false);
		ini.Get("Core", "BBDumpPort",                &m_LocalCoreStartupParameter.iBBDumpPort,       -1);
		ini.Get("Core", "VBeam",                     &m_LocalCoreStartupParameter.bVBeamSpeedHack,   false);
		ini.Get("Core", "SyncGPU",                   &m_LocalCoreStartupParameter.bSyncGPU,          false);
		ini.Get("Core", "FastDiscSpeed",             &m_LocalCoreStartupParameter.bFastDiscSpeed,    false);
		ini.Get("Core", "DCBZ",                      &m_LocalCoreStartupParameter.bDCBZOFF,          false);
		ini.Get("Core", "FrameLimit",                &m_Framelimit,                                  1); // auto frame limit by default
		ini.Get("Core", "FrameSkip",                 &m_FrameSkip,                                   0);

		// GFX Backend
		ini.Get("Core", "GFXBackend",  &m_LocalCoreStartupParameter.m_strVideoBackend, "");

		// Movie
		ini.Get("Movie", "PauseMovie", &m_PauseMovie, false);
		ini.Get("Movie", "Author", &m_strMovieAuthor, "");

		// DSP
		ini.Get("DSP", "EnableJIT", &m_DSPEnableJIT, true);
		ini.Get("DSP", "DumpAudio", &m_DumpAudio, false);
	#if defined __linux__ && HAVE_ALSA
		ini.Get("DSP", "Backend", &sBackend, BACKEND_ALSA);
	#elif defined __APPLE__
		ini.Get("DSP", "Backend", &sBackend, BACKEND_COREAUDIO);
	#elif defined _WIN32
		ini.Get("DSP", "Backend", &sBackend, BACKEND_XAUDIO2);
	#elif defined ANDROID
		ini.Get("DSP", "Backend", &sBackend, BACKEND_OPENSLES);
	#else
		ini.Get("DSP", "Backend", &sBackend, BACKEND_NULLSOUND);
	#endif
		ini.Get("DSP", "Volume", &m_Volume, 100);

		ini.Get("FifoPlayer", "LoopReplay", &m_LocalCoreStartupParameter.bLoopFifoReplay, true);
	}

	m_SYSCONF = new SysConf();
}
Ejemplo n.º 22
0
void SConfig::SaveSettings()
{
	NOTICE_LOG(BOOT, "Saving settings to %s", File::GetUserPath(F_DOLPHINCONFIG_IDX).c_str());
	IniFile ini;
	ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX)); // load first to not kill unknown stuff

	// General
	ini.Set("General", "LastFilename", m_LastFilename);
	ini.Set("General", "ShowLag", m_ShowLag);

	// ISO folders
	// clear removed folders
	int oldPaths,
		numPaths = (int)m_ISOFolder.size();
	ini.Get("General", "GCMPathes", &oldPaths, 0);
	for (int i = numPaths; i < oldPaths; i++)
	{
		ini.DeleteKey("General", StringFromFormat("GCMPath%i", i));
	}

	ini.Set("General", "GCMPathes", numPaths);

	for (int i = 0; i < numPaths; i++)
	{
		ini.Set("General", StringFromFormat("GCMPath%i", i), m_ISOFolder[i]);
	}

	ini.Set("General", "RecursiveGCMPaths", m_RecursiveISOFolder);
	ini.Set("General", "NANDRootPath",      m_NANDPath);
	ini.Set("General", "WirelessMac",       m_WirelessMac);
	#ifdef USE_GDBSTUB
	ini.Set("General", "GDBPort", m_LocalCoreStartupParameter.iGDBPort);
	#endif

	// Interface
	ini.Set("Interface", "ConfirmStop",         m_LocalCoreStartupParameter.bConfirmStop);
	ini.Set("Interface", "UsePanicHandlers",    m_LocalCoreStartupParameter.bUsePanicHandlers);
	ini.Set("Interface", "OnScreenDisplayMessages", m_LocalCoreStartupParameter.bOnScreenDisplayMessages);
	ini.Set("Interface", "HideCursor",          m_LocalCoreStartupParameter.bHideCursor);
	ini.Set("Interface", "AutoHideCursor",      m_LocalCoreStartupParameter.bAutoHideCursor);
	ini.Set("Interface", "MainWindowPosX",      (m_LocalCoreStartupParameter.iPosX == -32000) ? 0 : m_LocalCoreStartupParameter.iPosX); // TODO - HAX
	ini.Set("Interface", "MainWindowPosY",      (m_LocalCoreStartupParameter.iPosY == -32000) ? 0 : m_LocalCoreStartupParameter.iPosY); // TODO - HAX
	ini.Set("Interface", "MainWindowWidth",     m_LocalCoreStartupParameter.iWidth);
	ini.Set("Interface", "MainWindowHeight",    m_LocalCoreStartupParameter.iHeight);
	ini.Set("Interface", "Language",            m_InterfaceLanguage);
	ini.Set("Interface", "ShowToolbar",         m_InterfaceToolbar);
	ini.Set("Interface", "ShowStatusbar",       m_InterfaceStatusbar);
	ini.Set("Interface", "ShowLogWindow",       m_InterfaceLogWindow);
	ini.Set("Interface", "ShowLogConfigWindow", m_InterfaceLogConfigWindow);
	ini.Set("Interface", "ThemeName40",         m_LocalCoreStartupParameter.theme_name);

	// Hotkeys
	for (int i = 0; i < NUM_HOTKEYS; i++)
	{
		ini.Set("Hotkeys", g_HKData[i].IniText, m_LocalCoreStartupParameter.iHotkey[i]);
		ini.Set("Hotkeys", std::string(g_HKData[i].IniText) + "Modifier",
				m_LocalCoreStartupParameter.iHotkeyModifier[i]);
	}

	// Display
	ini.Set("Display", "FullscreenResolution", m_LocalCoreStartupParameter.strFullscreenResolution);
	ini.Set("Display", "Fullscreen",           m_LocalCoreStartupParameter.bFullscreen);
	ini.Set("Display", "RenderToMain",         m_LocalCoreStartupParameter.bRenderToMain);
	ini.Set("Display", "RenderWindowXPos",     m_LocalCoreStartupParameter.iRenderWindowXPos);
	ini.Set("Display", "RenderWindowYPos",     m_LocalCoreStartupParameter.iRenderWindowYPos);
	ini.Set("Display", "RenderWindowWidth",    m_LocalCoreStartupParameter.iRenderWindowWidth);
	ini.Set("Display", "RenderWindowHeight",   m_LocalCoreStartupParameter.iRenderWindowHeight);
	ini.Set("Display", "RenderWindowAutoSize", m_LocalCoreStartupParameter.bRenderWindowAutoSize);
	ini.Set("Display", "KeepWindowOnTop",      m_LocalCoreStartupParameter.bKeepWindowOnTop);
	ini.Set("Display", "ProgressiveScan",      m_LocalCoreStartupParameter.bProgressive);
	ini.Set("Display", "DisableScreenSaver",   m_LocalCoreStartupParameter.bDisableScreenSaver);
	ini.Set("Display", "ForceNTSCJ",           m_LocalCoreStartupParameter.bForceNTSCJ);

	// Game List Control
	ini.Set("GameList", "ListDrives",   m_ListDrives);
	ini.Set("GameList", "ListWad",      m_ListWad);
	ini.Set("GameList", "ListWii",      m_ListWii);
	ini.Set("GameList", "ListGC",       m_ListGC);
	ini.Set("GameList", "ListJap",      m_ListJap);
	ini.Set("GameList", "ListPal",      m_ListPal);
	ini.Set("GameList", "ListUsa",      m_ListUsa);
	ini.Set("GameList", "ListFrance",   m_ListFrance);
	ini.Set("GameList", "ListItaly",    m_ListItaly);
	ini.Set("GameList", "ListKorea",    m_ListKorea);
	ini.Set("GameList", "ListTaiwan",   m_ListTaiwan);
	ini.Set("GameList", "ListUnknown",  m_ListUnknown);
	ini.Set("GameList", "ListSort",     m_ListSort);
	ini.Set("GameList", "ListSortSecondary", m_ListSort2);

	// Core
	ini.Set("Core", "HLE_BS2",          m_LocalCoreStartupParameter.bHLE_BS2);
	ini.Set("Core", "CPUCore",          m_LocalCoreStartupParameter.iCPUCore);
	ini.Set("Core", "Fastmem",          m_LocalCoreStartupParameter.bFastmem);
	ini.Set("Core", "CPUThread",        m_LocalCoreStartupParameter.bCPUThread);
	ini.Set("Core", "DSPThread",        m_LocalCoreStartupParameter.bDSPThread);
	ini.Set("Core", "DSPHLE",           m_LocalCoreStartupParameter.bDSPHLE);
	ini.Set("Core", "SkipIdle",         m_LocalCoreStartupParameter.bSkipIdle);
	ini.Set("Core", "DefaultGCM",       m_LocalCoreStartupParameter.m_strDefaultGCM);
	ini.Set("Core", "DVDRoot",          m_LocalCoreStartupParameter.m_strDVDRoot);
	ini.Set("Core", "Apploader",        m_LocalCoreStartupParameter.m_strApploader);
	ini.Set("Core", "EnableCheats",     m_LocalCoreStartupParameter.bEnableCheats);
	ini.Set("Core", "SelectedLanguage", m_LocalCoreStartupParameter.SelectedLanguage);
	ini.Set("Core", "DPL2Decoder",      m_LocalCoreStartupParameter.bDPL2Decoder);
	ini.Set("Core", "Latency",          m_LocalCoreStartupParameter.iLatency);
	ini.Set("Core", "MemcardAPath",     m_strMemoryCardA);
	ini.Set("Core", "MemcardBPath",     m_strMemoryCardB);
	ini.Set("Core", "SlotA",            m_EXIDevice[0]);
	ini.Set("Core", "SlotB",            m_EXIDevice[1]);
	ini.Set("Core", "SerialPort1",      m_EXIDevice[2]);
	ini.Set("Core", "BBA_MAC",          m_bba_mac);
	for (int i = 0; i < MAX_SI_CHANNELS; ++i)
	{
		ini.Set("Core", StringFromFormat("SIDevice%i", i), m_SIDevice[i]);
	}
	ini.Set("Core", "WiiSDCard", m_WiiSDCard);
	ini.Set("Core", "WiiKeyboard", m_WiiKeyboard);
	ini.Set("Core", "WiimoteContinuousScanning", m_WiimoteContinuousScanning);
	ini.Set("Core", "WiimoteEnableSpeaker", m_WiimoteEnableSpeaker);
	ini.Set("Core", "RunCompareServer", m_LocalCoreStartupParameter.bRunCompareServer);
	ini.Set("Core", "RunCompareClient", m_LocalCoreStartupParameter.bRunCompareClient);
	ini.Set("Core", "FrameLimit",       m_Framelimit);
	ini.Set("Core", "FrameSkip",        m_FrameSkip);

	// GFX Backend
	ini.Set("Core", "GFXBackend", m_LocalCoreStartupParameter.m_strVideoBackend);

	// Movie
	ini.Set("Movie", "PauseMovie", m_PauseMovie);
	ini.Set("Movie", "Author", m_strMovieAuthor);

	// DSP
	ini.Set("DSP", "EnableJIT", m_DSPEnableJIT);
	ini.Set("DSP", "DumpAudio", m_DumpAudio);
	ini.Set("DSP", "Backend", sBackend);
	ini.Set("DSP", "Volume", m_Volume);

	// Fifo Player
	ini.Set("FifoPlayer", "LoopReplay", m_LocalCoreStartupParameter.bLoopFifoReplay);

	ini.Save(File::GetUserPath(F_DOLPHINCONFIG_IDX));
	m_SYSCONF->Save();
}
Ejemplo n.º 23
0
void CLogWindow::CreateGUIControls()
{
	IniFile ini;
	ini.Load(File::GetUserPath(F_LOGGERCONFIG_IDX));

	ini.Get("LogWindow", "x", &x, Parent->GetSize().GetX() / 2);
	ini.Get("LogWindow", "y", &y, Parent->GetSize().GetY());
	ini.Get("LogWindow", "pos", &winpos, wxAUI_DOCK_RIGHT);

	// Set up log listeners
	int verbosity;
	ini.Get("Options", "Verbosity", &verbosity, 0);

	// Ensure the verbosity level is valid
	if (verbosity < 1)
		verbosity = 1;
	if (verbosity > MAX_LOGLEVEL)
		verbosity = MAX_LOGLEVEL;

	// Get the logger output settings from the config ini file.
	ini.Get("Options", "WriteToFile", &m_writeFile, false);
	ini.Get("Options", "WriteToWindow", &m_writeWindow, true);
#ifdef _MSC_VER
	if (IsDebuggerPresent())
	{
		ini.Get("Options", "WriteToDebugger", &m_writeDebugger, true);
	}
	else
#endif
	{
		m_writeDebugger = false;
	}

	for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
	{
		bool enable;
		ini.Get("Logs", m_LogManager->GetShortName((LogTypes::LOG_TYPE)i), &enable, true);

		if (m_writeWindow && enable)
			m_LogManager->AddListener((LogTypes::LOG_TYPE)i, this);
		else
			m_LogManager->RemoveListener((LogTypes::LOG_TYPE)i, this);

		if (m_writeFile && enable)
			m_LogManager->AddListener((LogTypes::LOG_TYPE)i, m_LogManager->GetFileListener());
		else
			m_LogManager->RemoveListener((LogTypes::LOG_TYPE)i, m_LogManager->GetFileListener());

		if (m_writeDebugger && enable)
			m_LogManager->AddListener((LogTypes::LOG_TYPE)i, m_LogManager->GetDebuggerListener());
		else
			m_LogManager->RemoveListener((LogTypes::LOG_TYPE)i, m_LogManager->GetDebuggerListener());

		m_LogManager->SetLogLevel((LogTypes::LOG_TYPE)i, (LogTypes::LOG_LEVELS)(verbosity));
	}

	// Font
	m_FontChoice = new wxChoice(this, IDM_FONT);
	m_FontChoice->Append(_("Default font"));
	m_FontChoice->Append(_("Monospaced font"));
	m_FontChoice->Append(_("Selected font"));

	DefaultFont = GetFont();
	MonoSpaceFont.SetNativeFontInfoUserDesc("lucida console windows-1252");
	LogFont.push_back(DefaultFont);
	LogFont.push_back(MonoSpaceFont);
	LogFont.push_back(DebuggerFont);

	int font;
	ini.Get("Options", "Font", &font, 0);
	m_FontChoice->SetSelection(font);

	// Word wrap
	bool wrap_lines;
	ini.Get("Options", "WrapLines", &wrap_lines, false);
	m_WrapLine = new wxCheckBox(this, IDM_WRAPLINE, _("Word Wrap"));
	m_WrapLine->SetValue(wrap_lines);

	// Log viewer
	m_Log = CreateTextCtrl(this, IDM_LOG, wxTE_RICH | wxTE_MULTILINE | wxTE_READONLY |
			(wrap_lines ? wxTE_WORDWRAP : wxTE_DONTWRAP));

	// submit row
	m_cmdline = new wxTextCtrl(this, IDM_SUBMITCMD, wxEmptyString, wxDefaultPosition, wxDefaultSize,
			wxTE_PROCESS_ENTER | wxTE_PROCESS_TAB);

	// Sizers
	wxBoxSizer *sTop = new wxBoxSizer(wxHORIZONTAL);
	sTop->Add(new wxButton(this, IDM_CLEARLOG, _("Clear"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT));
	sTop->Add(m_FontChoice, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 3);
	sTop->Add(m_WrapLine, 0, wxALIGN_CENTER_VERTICAL);

	sBottom = new wxBoxSizer(wxVERTICAL);
	PopulateBottom();

	wxBoxSizer *sMain = new wxBoxSizer(wxVERTICAL);
	sMain->Add(sTop, 0, wxEXPAND);
	sMain->Add(sBottom, 1, wxEXPAND);
	SetSizer(sMain);

	m_cmdline->SetFocus();
}
Ejemplo n.º 24
0
void SWVideoConfig::Load(const char* ini_file)
{
    std::string temp;
    IniFile iniFile;
    iniFile.Load(ini_file);
    
    iniFile.Get("Hardware", "Fullscreen", &bFullscreen, 0); // Hardware
    iniFile.Get("Hardware", "RenderToMainframe", &renderToMainframe, false);

	iniFile.Get("Rendering", "HwRasterizer", &bHwRasterizer, false);
	iniFile.Get("Rendering", "ZComploc", &bZComploc, true);
	iniFile.Get("Rendering", "ZFreeze", &bZFreeze, true);

	iniFile.Get("Info", "ShowStats", &bShowStats, false);

	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);

	iniFile.Get("Misc", "DrawStart", &drawStart, 0);
	iniFile.Get("Misc", "DrawEnd", &drawEnd, 100000);
}