当前位置: 首页>>代码示例>>C++>>正文


C++ IReader::r_float方法代码示例

本文整理汇总了C++中IReader::r_float方法的典型用法代码示例。如果您正苦于以下问题:C++ IReader::r_float方法的具体用法?C++ IReader::r_float怎么用?C++ IReader::r_float使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IReader的用法示例。


在下文中一共展示了IReader::r_float方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: load

void CActorCondition::load(IReader &input_packet)
{
	inherited::load		(input_packet);
	load_data			(m_fAlcohol, input_packet);
	load_data			(m_condition_flags, input_packet);
	load_data			(m_fSatiety, input_packet);

	load_data			(m_curr_medicine_influence.fHealth, input_packet);
	load_data			(m_curr_medicine_influence.fPower, input_packet);
	load_data			(m_curr_medicine_influence.fSatiety, input_packet);
	load_data			(m_curr_medicine_influence.fRadiation, input_packet);
	load_data			(m_curr_medicine_influence.fWoundsHeal, input_packet);
	load_data			(m_curr_medicine_influence.fMaxPowerUp, input_packet);
	load_data			(m_curr_medicine_influence.fAlcohol, input_packet);
	load_data			(m_curr_medicine_influence.fTimeTotal, input_packet);
	load_data			(m_curr_medicine_influence.fTimeCurrent, input_packet);

	u8 cntr = input_packet.r_u8();
	for(; cntr>0; cntr--)
	{
		SBooster B;
		B.m_type = (EBoostParams)input_packet.r_u8();
		B.fBoostValue = input_packet.r_float();
		B.fBoostTime = input_packet.r_float();
		m_booster_influences[B.m_type] = B;
		BoostParameters(B);
	}
}
开发者ID:zcaliptium,项目名称:xray-16,代码行数:28,代码来源:ActorCondition.cpp

示例2: LoadData

void CBone::LoadData(IReader& F)
{
	R_ASSERT(F.find_chunk(BONE_CHUNK_DEF));
	F.r_stringZ		(name); xr_strlwr(name);

	R_ASSERT(F.find_chunk(BONE_CHUNK_MATERIAL));
    F.r_stringZ		(game_mtl);

	R_ASSERT(F.find_chunk(BONE_CHUNK_SHAPE));
    F.r				(&shape,sizeof(SBoneShape));
    
    if (F.find_chunk(BONE_CHUNK_FLAGS))
	    IK_data.ik_flags.assign(F.r_u32());

	R_ASSERT(F.find_chunk(BONE_CHUNK_IK_JOINT));
	IK_data.type			= (EJointType)F.r_u32();
    F.r						(IK_data.limits,sizeof(SJointLimit)*3);
    IK_data.spring_factor	= F.r_float();
    IK_data.damping_factor	= F.r_float();

    if (F.find_chunk(BONE_CHUNK_IK_JOINT_BREAK)){
	    IK_data.break_force	= F.r_float();
    	IK_data.break_torque= F.r_float();
    }

    if (F.find_chunk(BONE_CHUNK_IK_JOINT_FRICTION)){
	    IK_data.friction	= F.r_float();
    }

    if (F.find_chunk(BONE_CHUNK_MASS)){
	    mass		= F.r_float();
		F.r_fvector3(center_of_mass);
    }
}
开发者ID:BeaconDev,项目名称:xray-16,代码行数:34,代码来源:bone.cpp

示例3: Load

bool EDetail::Load(IReader& F)
{
	// check version
    R_ASSERT			(F.find_chunk(DETOBJ_CHUNK_VERSION));
    u32 version		= F.r_u32();
    if (version!=DETOBJ_VERSION){
    	ELog.Msg(mtError,"EDetail: unsupported version.");
        return false;
    }

	// references
	string256 buf;
    R_ASSERT			(F.find_chunk(DETOBJ_CHUNK_REFERENCE));
    F.r_stringZ			(buf,sizeof(buf));

    // scale
    R_ASSERT			(F.find_chunk(DETOBJ_CHUNK_SCALE_LIMITS));
    m_fMinScale			= F.r_float(); if (fis_zero(m_fMinScale))	m_fMinScale = 0.1f;
	m_fMaxScale			= F.r_float(); if (m_fMaxScale<m_fMinScale)	m_fMaxScale = m_fMinScale;

	// density factor
    if (F.find_chunk(DETOBJ_CHUNK_DENSITY_FACTOR))
	    m_fDensityFactor= F.r_float();

    if (F.find_chunk(DETOBJ_CHUNK_FLAGS))
    	m_Flags.assign	(F.r_u32());

    // update object
    return 				Update(buf);
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:30,代码来源:EDetailModel.cpp

示例4: load

void SHeliBodyState::load(IReader &input_packet)
{
	type				= (EHeliBodyState)input_packet.r_s16();
	b_looking_at_point	= !!input_packet.r_u8();
	currBodyHPB.x			= input_packet.r_float();
	currBodyHPB.y			= input_packet.r_float();
	currBodyHPB.z			= input_packet.r_float();
}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:8,代码来源:Helicopter2.cpp

示例5: LoadStream

bool ESceneAIMapTool::LoadStream(IReader& F)
{
	inherited::LoadStream	(F);

	u16 version = 0;

    R_ASSERT(F.r_chunk(AIMAP_CHUNK_VERSION,&version));
    if( version!=AIMAP_VERSION ){
        ELog.DlgMsg( mtError, "AIMap: Unsupported version.");
        return false;
    }

    R_ASSERT(F.find_chunk(AIMAP_CHUNK_FLAGS));
    F.r				(&m_Flags,sizeof(m_Flags));

    R_ASSERT(F.find_chunk(AIMAP_CHUNK_BOX));
    F.r				(&m_AIBBox,sizeof(m_AIBBox));

    R_ASSERT(F.find_chunk(AIMAP_CHUNK_PARAMS));
    F.r				(&m_Params,sizeof(m_Params));

    R_ASSERT(F.find_chunk(AIMAP_CHUNK_NODES));
    m_Nodes.resize	(F.r_u32());
	for (AINodeIt it=m_Nodes.begin(); it!=m_Nodes.end(); it++){
    	*it			= xr_new<SAINode>();
    	(*it)->LoadStream	(F,this);
    }
	DenumerateNodes	();

    if (F.find_chunk(AIMAP_CHUNK_INTERNAL_DATA)){
    	m_VisRadius	= F.r_float();
    	m_BrushSize	= F.r_u32();
    }
    if (F.find_chunk(AIMAP_CHUNK_INTERNAL_DATA2)){
    	m_SmoothHeight	= F.r_float();
    }

	// snap objects
    if (F.find_chunk(AIMAP_CHUNK_SNAP_OBJECTS)){
    	shared_str 	buf;
		int cnt 	= F.r_u32();
        if (cnt){
	        for (int i=0; i<cnt; i++){
    	    	F.r_stringZ	(buf);
        	    CCustomObject* O = Scene->FindObjectByName(buf.c_str(),OBJCLASS_SCENEOBJECT);
            	if (!O)		ELog.Msg(mtError,"AIMap: Can't find snap object '%s'.",buf.c_str());
	            else		m_SnapObjects.push_back(O);
    	    }
        }
    }

    hash_FillFromNodes		();

    return true;
}
开发者ID:2asoft,项目名称:xray,代码行数:55,代码来源:ESceneAIMapTools.cpp

示例6: Load

//------------------------------------------------------------------------------
// I/O part
//------------------------------------------------------------------------------
BOOL CPGDef::Load(IReader& F)
{
	R_ASSERT		(F.find_chunk(PGD_CHUNK_VERSION));
	u16 version		= F.r_u16();

    if (version!=PGD_VERSION){
		Log			("!Unsupported PG version. Load failed.");
    	return FALSE;
    }

	R_ASSERT		(F.find_chunk(PGD_CHUNK_NAME));
	F.r_stringZ		(m_Name);

	F.r_chunk		(PGD_CHUNK_FLAGS,&m_Flags);

    if (F.find_chunk(PGD_CHUNK_EFFECTS)){
        m_Effects.resize(F.r_u32());
        for (EffectIt it=m_Effects.begin(); it!=m_Effects.end(); it++){
        	*it				= xr_new<SEffect>();
            F.r_stringZ		((*it)->m_EffectName);
            F.r_stringZ		((*it)->m_OnPlayChildName);
        	F.r_stringZ		((*it)->m_OnBirthChildName);
        	F.r_stringZ		((*it)->m_OnDeadChildName);
            (*it)->m_Time0 	= F.r_float();
            (*it)->m_Time1 	= F.r_float();
            (*it)->m_Flags.assign	(F.r_u32());
        }
    }else{  //.??? убрать через некоторое время
        R_ASSERT		(F.find_chunk(PGD_CHUNK_EFFECTS2));
        m_Effects.resize(F.r_u32());
        for (EffectIt it=m_Effects.begin(); it!=m_Effects.end(); it++){
        	*it				= xr_new<SEffect>();
            F.r_stringZ		((*it)->m_EffectName);
            F.r_stringZ		((*it)->m_OnPlayChildName);
            (*it)->m_Time0 	= F.r_float();
            (*it)->m_Time1 	= F.r_float();
            (*it)->m_Flags.assign	(F.r_u32());
        }
    }
    
    if (F.find_chunk(PGD_CHUNK_TIME_LIMIT)){
   		m_fTimeLimit= F.r_float();
    }

#ifdef _EDITOR
    if (F.find_chunk(PGD_CHUNK_OWNER)){
	    F.r_stringZ	(m_OwnerName);
	    F.r_stringZ	(m_ModifName);
        F.r			(&m_CreateTime,sizeof(m_CreateTime));
        F.r			(&m_ModifTime,sizeof(m_ModifTime));
    }
#endif
    
    return TRUE;
}                   
开发者ID:,项目名称:,代码行数:58,代码来源:

示例7: load

// postprocess color LOAD method implementation
void CPostProcessColor::load (IReader &pReader)
{
    m_fBase = pReader.r_float	();
    m_Red.Load_2				(pReader);
    m_Green.Load_2				(pReader);
    m_Blue.Load_2				(pReader);
}
开发者ID:2asoft,项目名称:xray,代码行数:8,代码来源:PostprocessAnimator.cpp

示例8: LoadClips

void TClipMaker::LoadClips()
{
    bool bRes=true;
	if (EFS.GetOpenName("$clips$",m_ClipFName)){
    	Clear		();
    	IReader* F	= FS.r_open(m_ClipFName.c_str()); VERIFY(F);
        m_ClipFName	= EFS.ExcludeBasePath(m_ClipFName.c_str(),FS.get_path("$clips$")->m_Path);
        if (F->find_chunk(CHUNK_ZOOM)){
        	m_Zoom	= F->r_float();
        }
        IReader* C 	= F->open_chunk(CHUNK_CLIPS);
        if(C){
            IReader* M   = C->open_chunk(0);
            for (int count=1; M; count++) {
                CUIClip* clip	= xr_new<CUIClip>(this,count);
                if (!clip->Load(*M)){
                    ELog.Msg(mtError,"Unsupported clip version. Load failed.");
                    xr_delete(clip);
                    bRes = false;
                }
                M->close();
                if (!bRes)	break;
                clips.push_back(clip);
                M = C->open_chunk(count);
            }
            C->close	();
            UpdateClips	();
        }
        FS.r_close(F);
    }
}
开发者ID:2asoft,项目名称:xray,代码行数:31,代码来源:ClipEditor.cpp

示例9: Load

bool CGlow::Load(IReader& F)
{
	u32 version = 0;

    R_ASSERT(F.r_chunk(GLOW_CHUNK_VERSION,&version));
    if((version!=0x0011)&&(version!=GLOW_VERSION)){
        ELog.DlgMsg( mtError, "CGlow: Unsupported version.");
        return false;
    }

	CCustomObject::Load(F);

    if (F.find_chunk(GLOW_CHUNK_SHADER)){
    	F.r_stringZ (m_ShaderName);
    }

    R_ASSERT(F.find_chunk(GLOW_CHUNK_TEXTURE));
	F.r_stringZ	(m_TexName);

    R_ASSERT(F.find_chunk(GLOW_CHUNK_PARAMS));
	m_fRadius  		= F.r_float();
	if (version==0x0011){
		F.r_fvector3	(FPosition);
        UpdateTransform();
    }

    if (F.find_chunk(GLOW_CHUNK_FLAGS))
    	m_Flags.assign	(F.r_u16());

    return true;
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:31,代码来源:glow.cpp

示例10: Load

bool CClip::Load(IReader& F)
{
	R_ASSERT		(F.find_chunk(EOBJ_CLIP_VERSION_CHUNK));
    u16 ver			= F.r_u16();
    if (ver!=EOBJ_CLIP_VERSION) return false;
	R_ASSERT(F.find_chunk(EOBJ_CLIP_DATA_CHUNK));
    F.r_stringZ		(name);
    for (int k=0; k<4; k++){ 
    	F.r_stringZ		(cycles[k].name); 
    	cycles[k].slot 	= F.r_u16(); 
    }
    F.r_stringZ		(fx.name);
    fx.slot			= F.r_u16();
    fx_power		= F.r_float();
    length			= F.r_float();
    return true;
}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:17,代码来源:motion.cpp

示例11:

void CBone::Load_0(IReader& F)
{
	F.r_stringZ		(name);        	xr_strlwr(name);
	F.r_stringZ		(parent_name);	xr_strlwr(parent_name);
	F.r_stringZ		(wmap);
	F.r_fvector3	(rest_offset);
	F.r_fvector3	(rest_rotate);
	rest_length		= F.r_float();
   	std::swap		(rest_rotate.x,rest_rotate.y);
    Reset			();
}
开发者ID:BeaconDev,项目名称:xray-16,代码行数:11,代码来源:bone.cpp

示例12: Load

void STextureParams::Load(IReader& F)
{
    R_ASSERT(F.find_chunk(THM_CHUNK_TEXTUREPARAM));
    F.r					(&fmt,sizeof(ETFormat));
    flags.assign(F.r_u32());
    border_color= F.r_u32();
    fade_color	= F.r_u32();
    fade_amount	= F.r_u32();
    mip_filter	= F.r_u32();
    width		= F.r_u32();
    height		= F.r_u32();

    if (F.find_chunk(THM_CHUNK_TEXTURE_TYPE)){
        type	= (ETType)F.r_u32();
    }

    if (F.find_chunk(THM_CHUNK_DETAIL_EXT)){
        F.r_stringZ(detail_name);
        detail_scale = F.r_float();
    }

    if (F.find_chunk(THM_CHUNK_MATERIAL)){
    	material		= (ETMaterial)F.r_u32		();
	    material_weight = F.r_float	();
    }

    if (F.find_chunk(THM_CHUNK_BUMP)){
	    bump_virtual_height	= F.r_float				();
	    bump_mode			= (ETBumpMode)F.r_u32	();
        if (bump_mode<STextureParams::tbmNone){
        	bump_mode		= STextureParams::tbmNone; //.. временно (до полного убирания Autogen)
        }
    	F.r_stringZ			(bump_name);
    }

    if (F.find_chunk(THM_CHUNK_EXT_NORMALMAP))
	    F.r_stringZ			(ext_normal_map_name);

	if (F.find_chunk(THM_CHUNK_FADE_DELAY))
		fade_delay			= F.r_u8();
}
开发者ID:NeoAnomaly,项目名称:xray,代码行数:41,代码来源:ETextureParams.cpp

示例13: Load

void CLAItem::Load(IReader& F)
{
	R_ASSERT(F.find_chunk(CHUNK_ITEM_COMMON));
    F.r_stringZ		(cName);
    fFPS			= F.r_float();
    iFrameCount		= F.r_u32();

    int key_cnt,key;
	R_ASSERT(F.find_chunk(CHUNK_ITEM_KEYS));
	key_cnt			= F.r_u32();
    for (int i=0; i<key_cnt; i++){
    	key			= F.r_u32	();
        Keys[key]	= F.r_u32();
    }
}
开发者ID:NeoAnomaly,项目名称:xray,代码行数:15,代码来源:LightAnimLibrary.cpp

示例14: load

void CHelicopter::load(IReader &input_packet)
{
    m_movement.load				(input_packet);
    m_body.load					(input_packet);
    m_enemy.load				(input_packet);
    input_packet.r_fvector3		(XFORM().c);
    m_barrel_dir_tolerance		= input_packet.r_float();
    UseFireTrail				(m_enemy.bUseFireTrail);//force reloar disp params


    load_data		(m_use_rocket_on_attack, input_packet);
    load_data		(m_use_mgun_on_attack, input_packet);
    load_data		(m_min_rocket_dist, input_packet);
    load_data		(m_max_rocket_dist, input_packet);
    load_data		(m_min_mgun_dist, input_packet);
    load_data		(m_max_mgun_dist, input_packet);
    load_data		(m_time_between_rocket_attack, input_packet);
    load_data		(m_syncronize_rocket, input_packet);
}
开发者ID:Zen13L,项目名称:xray-16,代码行数:19,代码来源:Helicopter.cpp

示例15: load

void CInventoryItem::load(IReader &packet)
{
	m_ItemCurrPlace.value	= packet.r_u16();
	m_fCondition			= packet.r_float();

//--	load_data( m_upgrades, packet );
//--	install_loaded_upgrades();

	u8						tmp = packet.r_u8();
	if (!tmp)
		return;
	
	if (!object().PPhysicsShell()) {
		object().setup_physic_shell	();
		object().PPhysicsShell()->Disable();
	}
	
	object().PHLoadState(packet);
	object().PPhysicsShell()->Disable();
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:20,代码来源:inventory_item.cpp


注:本文中的IReader::r_float方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。