本文整理汇总了C++中IReader::seek方法的典型用法代码示例。如果您正苦于以下问题:C++ IReader::seek方法的具体用法?C++ IReader::seek怎么用?C++ IReader::seek使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IReader
的用法示例。
在下文中一共展示了IReader::seek方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pointer
void global_slots_data:: Load ( )
{
// Load .details
// copy
//if()
IReader* R = FS.r_open ( "$level$", "build.details" );
R->r_chunk ( 0, &dtH );
R->seek ( 0 );
u32 check_sum = crc32( R-> pointer(), R->length());
recalculation_data.load( check_sum );
if( !recalculation_data.recalculating() )
{
IWriter* W = FS.w_open ( "$level$", "level.details" );
W->w ( R->pointer(), R->length() );
FS.w_close ( W );
}
FS.r_close ( R );
// re-open
string_path N;
FS.update_path ( N, "$level$", "level.details" );
dtFS = xr_new<CVirtualFileRW> ( N );
R_ASSERT ( dtH.version()==DETAIL_VERSION );
dtFS->find_chunk ( 2 );
dtS = (DetailSlot*)dtFS->pointer();
}
示例2:
void CResourceManager::OnDeviceCreate (IReader* F)
{
if (!RDEVICE.b_is_Ready) return;
string256 name;
#ifndef _EDITOR
// scripting
LS_Load ();
#endif
IReader* fs = 0;
// Load constants
fs = F->open_chunk (0);
if (fs){
while (!fs->eof()) {
fs->r_stringZ (name,sizeof(name));
CConstant* C = _CreateConstant (name);
C->Load (fs);
}
fs->close ();
}
// Load matrices
fs = F->open_chunk(1);
if (fs){
while (!fs->eof()) {
fs->r_stringZ (name,sizeof(name));
CMatrix* M = _CreateMatrix (name);
M->Load (fs);
}
fs->close ();
}
// Load blenders
fs = F->open_chunk (2);
if (fs){
IReader* chunk = NULL;
int chunk_id= 0;
while ((chunk=fs->open_chunk(chunk_id))!=NULL){
CBlender_DESC desc;
chunk->r (&desc,sizeof(desc));
IBlender* B = IBlender::Create(desc.CLS);
if (0==B)
{
Msg ("! Renderer doesn't support blender '%s'",desc.cName);
}
else
{
if (B->getDescription().version != desc.version)
{
Msg ("! Version conflict in shader '%s'",desc.cName);
}
chunk->seek (0);
B->Load (*chunk,desc.version);
std::pair<map_BlenderIt, bool> I = m_blenders.insert (mk_pair(xr_strdup(desc.cName),B));
R_ASSERT2 (I.second,"shader.xr - found duplicate name!!!");
}
chunk->close ();
chunk_id += 1;
}
fs->close();
}
m_textures_description.Load ();
}