예제 #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;
}