//----------------------------------------------------------------------------
bool EngineLoop::LoadBoost(const std::string &filename)
{
	XMLData data;

	int bufferSize = 0;
	char *buffer = 0;
	ResourceManager::GetSingleton().LoadBuffer(filename, bufferSize, buffer);
	if (!buffer || bufferSize == 0) return false;

	if (data.LoadBuffer(buffer, bufferSize))
	{
		mBoostSize.Width = data.GetNodeByPath("config.var").AttributeToFloat("width");
		mBoostSize.Height = data.GetNodeByPath("config.var").AttributeToFloat("height");
		mProjectName = data.GetNodeByPath("play.var").AttributeToString("projectname");
		mPlayLogicMode = _StrToPlayLogicMode(data.GetNodeByPath("play.var").AttributeToString("playlogicmode"));

		return true;
	}

	return false;
}
Example #2
0
//----------------------------------------------------------------------------
bool GameManager::LoadBoost (const char *filename)
{
	XMLData data;

	int bufferSize = 0;
	char *buffer = 0;
	ResourceManager::GetSingleton().GetBuffer(filename, bufferSize, buffer);

	if (!buffer || bufferSize==0)
		return false;

	if (data.LoadBuffer(buffer, bufferSize))
	{
		delete1<char>(buffer);

		data.GetNodeByPath("Config.var").AttribToInt("width", mBoostWidth);
		data.GetNodeByPath("Config.var").AttribToInt("height", mBoostHeight);
		mProjectPath = data.GetNodeByPath("Play.var").AttributeToString("projectPath");

		return true;
	}

	return false;
}