本文整理汇总了C++中IReader::advance方法的典型用法代码示例。如果您正苦于以下问题:C++ IReader::advance方法的具体用法?C++ IReader::advance怎么用?C++ IReader::advance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IReader
的用法示例。
在下文中一共展示了IReader::advance方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sizeof
//.........这里部分代码省略.........
VERIFY3(part_bone_cnt==(u16)bones->size(),"Different bone count '%s'",N);
#endif
if (bRes)
{
// motion defs (cycle&fx)
u16 mot_count = MP->r_u16();
m_mdefs.resize (mot_count);
for (u16 mot_i=0; mot_i<mot_count; mot_i++)
{
MP->r_stringZ (buf,sizeof(buf));
shared_str nm = _strlwr (buf);
u32 dwFlags = MP->r_u32 ();
CMotionDef& D = m_mdefs[mot_i];
D.Load (MP,dwFlags,vers);
//. m_mdefs.push_back (D);
if (dwFlags&esmFX)
m_fx.insert (mk_pair(nm,mot_i));
else
m_cycle.insert (mk_pair(nm,mot_i));
m_motion_map.insert (mk_pair(nm,mot_i));
}
}
MP->close();
}else
{
xrDebug::Fatal (DEBUG_INFO,"Old skinned model version unsupported! (%s)",N);
}
if (!bRes) return false;
// Load animation
IReader* MS = data->open_chunk(OGF_S_MOTIONS);
if (!MS) return false;
u32 dwCNT = 0;
MS->r_chunk_safe (0,&dwCNT,sizeof(dwCNT));
VERIFY (dwCNT<0x3FFF); // MotionID 2 bit - slot, 14 bit - motion index
// set per bone motion size
for (u32 i=0; i<bones->size(); i++)
m_motions[bones->at(i)->name].resize(dwCNT);
// load motions
for (u16 m_idx=0; m_idx<(u16)dwCNT; m_idx++){
string128 mname;
R_ASSERT (MS->find_chunk(m_idx+1));
MS->r_stringZ (mname,sizeof(mname));
#ifdef _DEBUG
// sanity check
xr_strlwr (mname);
accel_map::iterator I= m_motion_map.find(mname);
VERIFY3 (I!=m_motion_map.end(),"Can't find motion:",mname);
VERIFY3 (I->second==m_idx,"Invalid motion index:",mname);
#endif
u32 dwLen = MS->r_u32();
for (u32 i=0; i<bones->size(); i++){
u16 bone_id = rm_bones[i];
VERIFY2 (bone_id!=BI_NONE,"Invalid remap index.");
CMotion& M = m_motions[bones->at(bone_id)->name][m_idx];
M.set_count (dwLen);
M.set_flags (MS->r_u8());
if (M.test_flag(flRKeyAbsent)) {
CKeyQR* r = (CKeyQR*)MS->pointer();
u32 crc_q = crc32(r,sizeof(CKeyQR));
M._keysR.create (crc_q,1,r);
MS->advance (1 * sizeof(CKeyQR));
}else{
u32 crc_q = MS->r_u32 ();
M._keysR.create (crc_q,dwLen,(CKeyQR*)MS->pointer());
MS->advance (dwLen * sizeof(CKeyQR));
}
if (M.test_flag(flTKeyPresent))
{
u32 crc_t = MS->r_u32 ();
if(M.test_flag(flTKey16IsBit))
{
M._keysT16.create (crc_t,dwLen,(CKeyQT16*)MS->pointer());
MS->advance (dwLen * sizeof(CKeyQT16));
}else
{
M._keysT8.create (crc_t,dwLen,(CKeyQT8*)MS->pointer());
MS->advance (dwLen * sizeof(CKeyQT8));
};
MS->r_fvector3 (M._sizeT);
MS->r_fvector3 (M._initT);
}else
{
MS->r_fvector3 (M._initT);
}
}
}
// Msg("Motions %d/%d %4d/%4d/%d, %s",p_cnt,m_cnt, m_load,m_total,m_r,N);
MS->close();
return bRes;
}