void manager::load()
{
    string_path file_name;
    CInifile* config =
        xr_new<CInifile>(
            FS.update_path(
                file_name,
                "$game_config$",
                "environment\\sound_channels.ltx"
            ),
            TRUE,
            TRUE,
            FALSE
        );

    VERIFY(m_channels.empty());

    typedef CInifile::Root sections_type;
    sections_type& sections = config->sections();
    m_channels.reserve(sections.size());
    sections_type::const_iterator i = sections.begin();
    sections_type::const_iterator e = sections.end();
    for (; i != e; ++i)
    {
        channel* object = xr_new<channel>(*this, (*i)->Name);
        object->load(*config);
        object->fill(m_collection);
        m_channels.push_back(object);
    }

    xr_delete(config);
}
Пример #2
0
LPCSTR configs_verifyer::get_diff(CInifile & received,
								  CInifile & active_params,
								  string256 & dst_diff)
{
	LPCSTR diff_str = NULL;
	for (CInifile::RootIt sit = received.sections().begin(),
		siet = received.sections().end(); sit != siet; ++sit)
	{
		CInifile::Sect*	tmp_sect = *sit;
		if (tmp_sect->Name == cd_info_secion)
			continue;
		if (tmp_sect->Name == active_params_section)
			continue;

		diff_str = get_section_diff(tmp_sect, active_params, dst_diff);
		if (diff_str)
		{
			return diff_str;
		}
	}
	strcpy_s(dst_diff, "unknown diff or currepted config dump");
	return dst_diff;
}
void weather::load			()
{
	string_path			file_name;
	FS.update_path		(file_name, "$game_weathers$", m_id.c_str());
	strcat_s			(file_name, ".ltx");
	CInifile*			config = CInifile::Create(file_name);

	m_manager.WeatherCycles[m_id].clear	();

	typedef CInifile::Root	sections_type;
	sections_type&			sections = config->sections();
	m_times.reserve			(sections.size());
	sections_type::const_iterator	i = sections.begin();
	sections_type::const_iterator	e = sections.end();
	for ( ; i != e; ++i) {
		time*				object = new time(&m_manager, this, (*i)->Name);
		object->load		(*config);
		object->fill		(m_collection);
		m_times.push_back	(object);
		m_manager.WeatherCycles[m_id].push_back	(object);
	}

	CInifile::Destroy	(config);
}