Example #1
0
void CPEDef::Save2(CInifile& ini)
{
	ini.w_u16		("_effect", "version",			PED_VERSION);
//.	ini.w_string	("_effect", "name",				m_Name.c_str());
	ini.w_u32		("_effect", "max_particles",	m_MaxParticles);
//.!!	F.w				(m_Actions.pointer(),m_Actions.size());
	ini.w_u32		("_effect", "flags",				m_Flags.get());

	if (m_Flags.is(dfSprite))
	{
		ini.w_string	("sprite", "shader", m_ShaderName.c_str());
		ini.w_string	("sprite", "texture", m_TextureName.c_str());
	}

	if (m_Flags.is(dfFramed))
	{
		ini.w_fvector2		("frame",	"tex_size", 	m_Frame.m_fTexSize);
		ini.w_fvector2		("frame",	"reserved", 	m_Frame.reserved);
		ini.w_s32			("frame",	"dim_x", 		m_Frame.m_iFrameDimX);
		ini.w_s32			("frame",	"frame_count",	m_Frame.m_iFrameCount);
		ini.w_float			("frame",	"speed",		m_Frame.m_fSpeed);
	}

	if (m_Flags.is(dfTimeLimit))
	{
		ini.w_float		("timelimit", "value", m_fTimeLimit);
	}

	if (m_Flags.is(dfCollision))
	{
		ini.w_float		("collision", "one_minus_friction", m_fCollideOneMinusFriction);	
		ini.w_float		("collision", "collide_resilence", m_fCollideResilience);
		ini.w_float		("collision", "collide_sqr_cutoff", m_fCollideSqrCutoff);
	}

	if (m_Flags.is(dfVelocityScale))
	{
		ini.w_fvector3	("velocity_scale", "value", m_VelocityScale);
	}

	if (m_Flags.is(dfAlignToPath))
	{
		ini.w_fvector3	("align_to_path", "default_rotation", m_APDefaultRotation);
	}
#ifdef _EDITOR
    ini.w_u32			("_effect", "action_count", m_EActionList.size());
    u32					action_id = 0;
	for (EPAVecIt it=m_EActionList.begin(); it!=m_EActionList.end(); ++it,++action_id)
	{
		string256		sect;
		xr_sprintf		(sect, sizeof(sect), "action_%04d", action_id);
		ini.w_u32		(sect, "action_type", (*it)->type);
    	(*it)->Save2	(ini, sect);
    }
#endif
}
Example #2
0
void ESoundSource::SaveLTX(CInifile& ini, LPCSTR sect_name)
{
	inherited::SaveLTX	(ini, sect_name);

	ini.w_u32			(sect_name, "version", SOUND_SOURCE_VERSION);

    ini.w_u32			(sect_name, "snd_type", m_Type);

    ini.w_string		(sect_name, "snd_name", m_WAVName.c_str());

    ini.w_u32			(sect_name, "flags", m_Flags.get());

    ini.w_fvector3		(sect_name, "snd_position", m_Params.position);
    ini.w_float			(sect_name, "volume", m_Params.volume);
    ini.w_float			(sect_name, "freq", m_Params.freq);
    ini.w_float			(sect_name, "min_dist", m_Params.min_distance);
    ini.w_float			(sect_name, "max_dist", m_Params.max_distance);
    ini.w_float			(sect_name, "max_ai_dist", m_Params.max_ai_distance);

    ini.w_fvector2		(sect_name, "random_pause", m_RandomPause);
    ini.w_fvector2		(sect_name, "active_time", m_ActiveTime);
    ini.w_fvector2		(sect_name, "play_time", m_PlayTime);
}