Ejemplo n.º 1
0
void SThunderboltDesc::create_center_gradient	(CInifile& pIni, shared_str const& sect)
{
	m_GradientCenter			= new SFlare();
    m_GradientCenter->shader 	= pIni.r_string		( sect,"gradient_center_shader" );
    m_GradientCenter->texture	= pIni.r_string		( sect,"gradient_center_texture" );
    m_GradientCenter->fRadius	= pIni.r_fvector2	(sect,"gradient_center_radius"  );
    m_GradientCenter->fOpacity 	= pIni.r_float		( sect,"gradient_center_opacity" );
	m_GradientCenter->m_pFlare->CreateShader		(*m_GradientCenter->shader,*m_GradientCenter->texture);
}
Ejemplo n.º 2
0
//----------------------------------------------------
bool ESoundSource::LoadLTX(CInifile& ini, LPCSTR sect_name)
{
	u32 version =  ini.r_u32(sect_name, "version");

    if(version!=SOUND_SOURCE_VERSION)
    {
        ELog.Msg( mtError, "ESoundSource: Unsupported version.");
        return false;
    }

	inherited::LoadLTX	(ini, sect_name);

    m_Type				= ini.r_u32			(sect_name, "snd_type");

    m_WAVName			= ini.r_string		(sect_name, "snd_name");

    m_Flags.assign		(ini.r_u32			(sect_name, "flags"));

    m_Params.position	= ini.r_fvector3		(sect_name, "snd_position");
    m_Params.volume		= ini.r_float			(sect_name, "volume");
    m_Params.freq		= ini.r_float			(sect_name, "freq");
    m_Params.min_distance=ini.r_float			(sect_name, "min_dist");
    m_Params.max_distance= ini.r_float			(sect_name, "max_dist");
    m_Params.max_ai_distance=ini.r_float			(sect_name, "max_ai_dist");

    m_RandomPause		= ini.r_fvector2		(sect_name, "random_pause");
    m_ActiveTime		= ini.r_fvector2		(sect_name, "active_time");
    m_PlayTime			= ini.r_fvector2		(sect_name, "play_time");

    ResetSource		();

    switch (m_Type)
    {
    case stStaticSource:
    	if (m_Flags.is(flPlaying)) 		Play();
//.    	if (m_Flags.is(flSimulating)) 	Simulate();
    break;
    default: THROW;
    }
    return true;
}
Ejemplo n.º 3
0
BOOL CPEDef::Load2(CInifile& ini)
{
//.	u16 version		= ini.r_u16("_effect", "version");
	m_MaxParticles	= ini.r_u32("_effect", "max_particles");
	m_Flags.assign	(ini.r_u32("_effect", "flags"));

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

	if (m_Flags.is(dfFramed))
	{
		m_Frame.m_fTexSize		= ini.r_fvector2		("frame",	"tex_size");
		m_Frame.reserved		= ini.r_fvector2		("frame",	"reserved");
		m_Frame.m_iFrameDimX	= ini.r_s32				("frame",	"dim_x");
		m_Frame.m_iFrameCount	= ini.r_s32				("frame",	"frame_count");
		m_Frame.m_fSpeed		= ini.r_float			("frame",	"speed");
	}

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

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

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

	if (m_Flags.is(dfAlignToPath))
	{
		m_APDefaultRotation			= ini.r_fvector3	("align_to_path", "default_rotation");
	}
#ifdef _EDITOR
	if(pCreateEAction)
	{
		u32 count		= ini.r_u32("_effect", "action_count");
        m_EActionList.resize(count);
		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);
            PAPI::PActionEnum type		= (PAPI::PActionEnum)(ini.r_u32(sect,"action_type"));
            (*it)						= pCreateEAction(type);
            (*it)->Load2				(ini, sect);
        }
		Compile							(m_EActionList);
    }
#endif

	return TRUE;
}