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


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

本文整理汇总了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();
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:31,代码来源:global_slots_data.cpp

示例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				();
}
开发者ID:2asoft,项目名称:xray-16,代码行数:68,代码来源:ResourceManager_Loader.cpp


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