本文整理汇总了C++中IReader::r_fvector2方法的典型用法代码示例。如果您正苦于以下问题:C++ IReader::r_fvector2方法的具体用法?C++ IReader::r_fvector2怎么用?C++ IReader::r_fvector2使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IReader
的用法示例。
在下文中一共展示了IReader::r_fvector2方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Load
bool ESceneLightTools::Load(IReader& F)
{
u16 version = 0;
if(F.r_chunk(CHUNK_VERSION,&version))
if( version!=LIGHT_TOOLS_VERSION ){
ELog.DlgMsg( mtError, "%s tools: Unsupported version.",ClassDesc());
return false;
}
if (!inherited::Load(F)) return false;
if (F.find_chunk(CHUNK_FLAGS))
m_Flags.assign (F.r_u32());
if (F.find_chunk(CHUNK_SUN_SHADOW)){
F.r_u8 ();
F.r_fvector2 (m_SunShadowDir);
}
if (F.find_chunk(CHUNK_LCONTROLS_LAST))
lcontrol_last_idx = F.r_u32();
IReader* R = F.open_chunk(CHUNK_LCONTROLS);
if (R){
while (!R->eof()){
shared_str l_name;
R->r_stringZ(l_name);
u32 l_idx = R->r_u32();
AppendLightControl(l_name.c_str(),&l_idx);
}
R->close ();
}
return true;
}
示例2: Load
bool ESoundSource::Load(IReader& F)
{
u32 version = 0;
if(F.r_chunk(SOUND_CHUNK_VERSION,&version)){
if(version!=SOUND_SOURCE_VERSION){
ELog.Msg( mtError, "ESoundSource: Unsupported version.");
return false;
}
}else return false;
inherited::Load (F);
R_ASSERT(F.find_chunk(SOUND_CHUNK_TYPE));
m_Type = ESoundType(F.r_u32());
R_ASSERT(F.find_chunk(SOUND_CHUNK_SOURCE_NAME));
F.r_stringZ (m_WAVName);
if (F.find_chunk(SOUND_CHUNK_SOURCE_PARAMS3)){
m_Params.base_volume = 1.f;
F.r_fvector3 (m_Params.position);
m_Params.volume = F.r_float();
m_Params.freq = F.r_float();
m_Params.min_distance = F.r_float();
m_Params.max_distance = F.r_float();
m_Params.max_ai_distance= F.r_float();
}else if (F.find_chunk(SOUND_CHUNK_SOURCE_PARAMS2)){
m_Params.base_volume = 1.f;
F.r_fvector3 (m_Params.position);
m_Params.volume = F.r_float();
m_Params.freq = F.r_float();
m_Params.min_distance = F.r_float();
m_Params.max_distance = F.r_float();
m_Params.max_ai_distance= F.r_float();
}else{
if (!F.find_chunk(SOUND_CHUNK_SOURCE_PARAMS)){
ELog.DlgMsg( mtError, "ESoundSource: Can't load Sound Source '%s'. Unsupported version.",*m_WAVName);
return false;
}
m_Params.base_volume = 1.f;
F.r_fvector3 (m_Params.position);
m_Params.volume = F.r_float();
m_Params.freq = F.r_float();
m_Params.min_distance = F.r_float();
m_Params.max_distance = F.r_float();
m_Params.max_ai_distance= m_Params.max_distance;
}
if(F.find_chunk(SOUND_CHUNK_SOURCE_FLAGS))
F.r (&m_Flags,sizeof(m_Flags));
if(F.find_chunk(SOUND_CHUNK_GAME_PARAMS)){
F.r_fvector2 (m_RandomPause);
F.r_fvector2 (m_ActiveTime);
F.r_fvector2 (m_PlayTime);
}
ResetSource ();
switch (m_Type){
case stStaticSource:
if (m_Flags.is(flPlaying)) Play();
if (m_Flags.is(flSimulating)) Simulate();
break;
default: THROW;
}
return true;
}