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


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

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


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

示例1: transfer

void transfer(const char *name, xr_vector<T> &dest, IReader& F, u32 chunk)
{
	IReader*	O	= F.open_chunk(chunk);
	u32		count	= O?(O->length()/sizeof(T)):0;
	clMsg			("* %16s: %d",name,count);
	if (count)  
	{
		dest.reserve(count);
		dest.insert	(dest.begin(), (T*)O->pointer(), (T*)O->pointer() + count);
	}
	if (O)		O->close	();
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:12,代码来源:compiler_load.cpp

示例2: 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

示例3: sizeof

bool CALifeStorageManager::load	(LPCSTR save_name_no_check)
{
	LPCSTR game_saves_path		= FS.get_path("$game_saves$")->m_Path;

	string_path					save_name;
	strncpy_s					(save_name, sizeof(save_name), save_name_no_check, sizeof(save_name)-5-xr_strlen(SAVE_EXTENSION)-xr_strlen(game_saves_path));

	CTimer						timer;
	timer.Start					();

	string_path					save;
	xr_strcpy					(save,m_save_name);
	if (!save_name) {
		if (!xr_strlen(m_save_name))
			R_ASSERT2			(false,"There is no file name specified!");
	}
	else
	{
		strconcat				(sizeof(m_save_name), m_save_name, save_name, SAVE_EXTENSION);
	}
	string_path					file_name;
	FS.update_path				(file_name,"$game_saves$",m_save_name);

	xr_strcpy					(g_last_saved_game, save_name);
	xr_strcpy					(g_bug_report_file, file_name);

	IReader						*stream;
	stream						= FS.r_open(file_name);
	if (!stream) {
		Msg						("* Cannot find saved game %s",file_name);
		xr_strcpy				(m_save_name,save);
		return					(false);
	}

	CHECK_OR_EXIT				(CSavedGameWrapper::valid_saved_game(*stream),make_string("%s\nSaved game version mismatch or saved game is corrupted",file_name));
/*
	string512					temp;
	strconcat					(sizeof(temp),temp,CStringTable().translate("st_loading_saved_game").c_str()," \"",save_name,SAVE_EXTENSION,"\"");
	g_pGamePersistent->LoadTitle(temp);
*/
	g_pGamePersistent->LoadTitle();

	unload						();
	reload						(m_section);

	u32							source_count = stream->r_u32();
	void						*source_data = xr_malloc(source_count);
	rtc_decompress				(source_data,source_count,stream->pointer(),stream->length() - 3*sizeof(u32));
	FS.r_close					(stream);
	load						(source_data, source_count, file_name);
	xr_free						(source_data);

	groups().on_after_game_load	();

	VERIFY						(graph().actor());
	
	Msg							("* Game %s is successfully loaded from file '%s' (%.3fs)",save_name, file_name,timer.GetElapsed_sec());

	return						(true);
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:60,代码来源:alife_storage_manager.cpp

示例4:

BOOL	testEqual		(LPCSTR path, IReader* base)
{
	IReader*	test	= FS.r_open	(path);
	if (test->length() != base->length())
	{
		return FALSE;
	}
	return 0==memcmp(test->pointer(),base->pointer(),base->length());
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:9,代码来源:xrCompress.cpp

示例5: testEqual

bool xrCompressor::testEqual(LPCSTR path, IReader* base)
{
	bool res			= false;
	IReader*	test	= FS.r_open	(path);

	if(test->length() == base->length())
	{
		if( 0==memcmp(test->pointer(),base->pointer(),base->length()) )
			res			= TRUE;
	}
	FS.r_close			(test);
	return				res;
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:13,代码来源:xrCompress.cpp

示例6: CEffectorCam

CDemoPlay::CDemoPlay(const char *name, float ms, u32 cycles, float life_time) : CEffectorCam(cefDemo,life_time/*,FALSE*/)
{
	Msg					("*** Playing demo: %s",name);
	Console->Execute	("hud_weapon 0");
	if( g_bBenchmark || g_SASH.IsRunning() )
		Console->Execute	("hud_draw 0");

	fSpeed				= ms;
	dwCyclesLeft		= cycles?cycles:1;

	m_pMotion			= 0;
	m_MParam			= 0;
	string_path			nm, fn;
	xr_strcpy			(nm,sizeof(nm),name);	
	LPSTR extp			=strext(nm);
	if (extp)	
		xr_strcpy			( nm, sizeof( nm ) - ( extp - nm ), ".anm");

	if ( FS.exist(fn,"$level$",nm) || FS.exist(fn,"$game_anims$",nm) )
	{
		m_pMotion				= xr_new<COMotion>		();
		m_pMotion->LoadMotion	(fn);
		m_MParam				= xr_new<SAnimParams>	();
		m_MParam->Set			(m_pMotion);
		m_MParam->Play			();
	}else{
		if (!FS.exist(name))						{
			g_pGameLevel->Cameras().RemoveCamEffector	(cefDemo);
			return		;
		}
		IReader*	fs	= FS.r_open	(name);
		u32 sz			= fs->length();
		if				(sz%sizeof(Fmatrix) != 0)	{
			FS.r_close	(fs);
			g_pGameLevel->Cameras().RemoveCamEffector	(cefDemo);
			return		;
		}
		
		seq.resize		(sz/sizeof(Fmatrix));
		m_count			= seq.size();
		CopyMemory	(&*seq.begin(),fs->pointer(),sz);
		FS.r_close		(fs);
		Log				("~ Total key-frames: ",m_count);
	}
	stat_started		= FALSE;
	Device.PreCache		(50, true, false);
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:47,代码来源:FDemoPlay.cpp

示例7: ai

CSavedGameWrapper::CSavedGameWrapper		(LPCSTR saved_game_name)
{
	string_path					file_name;
	saved_game_full_name		(saved_game_name,file_name);
	R_ASSERT3					(FS.exist(file_name),"There is no saved game ",file_name);
	
	IReader						*stream = FS.r_open(file_name);
	if (!valid_saved_game(*stream)) {
		FS.r_close				(stream);
		CALifeTimeManager		time_manager(alife_section);
		m_game_time				= time_manager.game_time();
		m_actor_health			= 1.f;
		m_level_id				= ai().game_graph().header().levels().begin()->first;
		return;
	}

	u32							source_count = stream->r_u32();
	void						*source_data = xr_malloc(source_count);
	rtc_decompress				(source_data,source_count,stream->pointer(),stream->length() - 3*sizeof(u32));
	FS.r_close					(stream);

	IReader						reader(source_data,source_count);

	{
		CALifeTimeManager		time_manager(alife_section);
		time_manager.load		(reader);
		m_game_time				= time_manager.game_time();
	}

	{
		R_ASSERT2				(reader.find_chunk(OBJECT_CHUNK_DATA),"Can't find chunk OBJECT_CHUNK_DATA!");
		u32						count = reader.r_u32();
		VERIFY					(count > 0);
		CSE_ALifeDynamicObject	*object = CALifeObjectRegistry::get_object(reader);
		VERIFY					(object->ID == 0);
		CSE_ALifeCreatureActor	*actor = smart_cast<CSE_ALifeCreatureActor*>(object);
		VERIFY					(actor);

		m_actor_health			= actor->g_Health();
		m_level_id				= ai().game_graph().vertex(object->m_tGraphID)->level_id();

		F_entity_Destroy		(object);
	}

	xr_free						(source_data);
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:46,代码来源:saved_game_wrapper.cpp

示例8: operator

	bool operator ()(char* o){
		//compare file names
		int eq = xr_strcmp(m_full_name,o);
		if(0!=eq)
			return false;
		

		
		if( !m_flags.test(eDontCheckFileSize) ){
			//compare file size
			const CLocatorAPI::file* f = m_fs_old->exist("$target_folder$",o);
			u32 file_size = f->size_real;

			if ( (f->vfs==0xffffffff) && (file_size != m_file_size) )
				return false;
		};
		//compare file crc
		if( !m_crc32 && !m_flags.test(eDontCheckCRC) ){
			IReader* r	=	m_fs_new->r_open	("$target_folder$",m_full_name);
			m_crc32		=	crc32		(r->pointer(),r->length());
			m_fs_new->r_close(r);
		};

		if( !m_flags.test(eDontCheckCRC) ){
			IReader* r_	= m_fs_old->r_open("$target_folder$",o);
			u32 crc32_	=  crc32	(r_->pointer(),r_->length());
			m_fs_old->r_close(r_);
			if(m_crc32!=crc32_)
				return false;
		}

		if( !m_flags.test(eDontCheckBinary) ){
			//compare files binary content
			IReader* f1		=	m_fs_new->r_open	("$target_folder$",m_full_name);
			IReader* f2		=	m_fs_old->r_open	("$target_folder$",o);

			int res = memcmp(f1->pointer(),f2->pointer(),f1->length());
			m_fs_new->r_close(f1);
			m_fs_old->r_close(f2);

			if(0!=res)
				return false;
		}
		return true;
	}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:45,代码来源:xrCompressDifference.cpp

示例9:

void CObjectSpace::Load	()
{
	IReader *F					= FS.r_open	("$level$", "level.cform");
	R_ASSERT					(F);

	hdrCFORM					H;
	F->r						(&H,sizeof(hdrCFORM));
	Fvector*	verts			= (Fvector*)F->pointer();
	CDB::TRI*	tris			= (CDB::TRI*)(verts+H.vertcount);
	R_ASSERT					(CFORM_CURRENT_VERSION==H.version);
	Static.build				( verts, H.vertcount, tris, H.facecount, build_callback );

	m_BoundingVolume.set				(H.aabb);
	g_SpatialSpace->initialize			(H.aabb);
	g_SpatialSpacePhysic->initialize	(H.aabb);
	Sound->set_geometry_occ				( &Static );
	Sound->set_handler					( _sound_event );

	FS.r_close					(F);
}
开发者ID:2asoft,项目名称:xray,代码行数:20,代码来源:xr_area.cpp

示例10:

	HRESULT __stdcall	Open	(D3DXINCLUDE_TYPE IncludeType, LPCSTR pFileName, LPCVOID pParentData, LPCVOID *ppData, UINT *pBytes)
	{
		string_path				pname;
		strconcat				(sizeof(pname),pname,::Render->getShaderPath(),pFileName);
		IReader*		R		= FS.r_open	("$game_shaders$",pname);
		if (0==R)				{
			// possibly in shared directory or somewhere else - open directly
			R					= FS.r_open	("$game_shaders$",pFileName);
			if (0==R)			return			E_FAIL;
		}

		// duplicate and zero-terminate
		u32				size	= R->length();
		u8*				data	= xr_alloc<u8>	(size + 1);
		CopyMemory			(data,R->pointer(),size);
		data[size]				= 0;
		FS.r_close				(R);

		*ppData					= data;
		*pBytes					= size;
		return	D3D_OK;
	}
开发者ID:Karlan88,项目名称:xray,代码行数:22,代码来源:ResourceManager_Resources.cpp

示例11: ProcessDifference

int ProcessDifference()
{
	LPCSTR params = GetCommandLine();
	Flags32 _flags;
	_flags.zero();
	if(strstr(params,"-diff /?")){
		printf("HELP:\n");
		printf("xrCompress.exe -diff <new_data> <old_data> -out <diff_resulf> [options]\n");
		printf("<new_data>, <old_data> and <diff_resulf> values must be a folder name\n");
		printf("[options] are set of:\n");
		printf("-nofileage		do not perform file age checking\n");
		printf("-crc			do not perform crc32 checking\n");
		printf("-nobinary		do not perform binary content checking\n");
		printf("-nosize			do not perform file size checking\n");
		return 3;
	}

	CLocatorAPI* FS_new = NULL;
	CLocatorAPI* FS_old = NULL;
	

	xr_vector<char*>*	file_list_old		= NULL;
	xr_vector<char*>*	folder_list_old		= NULL;

	xr_vector<char*>*	file_list_new		= NULL;
	xr_vector<char*>*	folder_list_new		= NULL;

	sscanf					(strstr(params,"-diff ")+6,"%[^ ] ",new_folder);
	sscanf					(strstr(params,"-diff ")+6+xr_strlen(new_folder)+1,"%[^ ] ",old_folder);
	sscanf					(strstr(params,"-out ")+5,"%[^ ] ",target_folder);
	
	if(strstr(params,"-nofileage")){
		_flags.set(file_comparer::eDontCheckFileAge, TRUE);
	};
	if(strstr(params,"-nocrc")){
		_flags.set(file_comparer::eDontCheckCRC, TRUE);
	};
	if(strstr(params,"-nobinary")){
		_flags.set(file_comparer::eDontCheckBinary, TRUE);
	};
	if(strstr(params,"-nosize")){
		_flags.set(file_comparer::eDontCheckFileSize, TRUE);
	};

	FS_new = xr_new<CLocatorAPI>	();
	FS_new->_initialize(CLocatorAPI::flTargetFolderOnly,new_folder);
	file_list_new	= FS_new->file_list_open	("$target_folder$",FS_ListFiles);
	folder_list_new	= FS_new->file_list_open	("$target_folder$",FS_ListFolders);

	FS_old = xr_new<CLocatorAPI>	();
	FS_old->_initialize(CLocatorAPI::flTargetFolderOnly,old_folder);
	file_list_old	= FS_old->file_list_open	("$target_folder$",FS_ListFiles);
	folder_list_old	= FS_old->file_list_open	("$target_folder$",FS_ListFolders);

	xr_vector<LPCSTR> target_file_list;
	target_file_list.reserve(file_list_new->size());

	for(u32 i=0; i<file_list_new->size();++i){
		file_comparer fc(file_list_new->at(i),FS_new, FS_old,_flags);
		xr_vector<char*>::iterator it = std::find_if(file_list_old->begin(),file_list_old->end(),fc);
		if(it != file_list_old->end()){
			printf("skip file %s\n",file_list_new->at(i));
		}else
			target_file_list.push_back(file_list_new->at(i));
	}

	string_path out_path;
	for(u32 i=0; i<target_file_list.size();++i){
		LPCSTR fn = target_file_list[i];
		strconcat(out_path,target_folder,"\\",fn);
		VerifyPath(out_path);
		IReader* r = FS_new->r_open("$target_folder$",fn);
		IWriter* w = FS_old->w_open(out_path);
		w->w(r->pointer(),r->length());
		FS_new->r_close(r);
		FS_old->w_close(w);
	}


	FS_new->file_list_close(file_list_new);
	FS_new->file_list_close(folder_list_new);

	FS_old->file_list_close(file_list_old);
	FS_old->file_list_close(folder_list_old);

	xr_delete(FS_new);
	xr_delete(FS_old);

	return 0;
}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:90,代码来源:xrCompressDifference.cpp

示例12: CompressOne

void xrCompressor::CompressOne(LPCSTR path)
{
	filesTOTAL		++;

	if (testSKIP(path))	
	{
		filesSKIP	++;
		printf		(" - a SKIP");
		Msg			("%-80s   - SKIP",path);
		return;
	}

	string_path		fn;				
	strconcat		(sizeof(fn), fn, target_name.c_str(), "\\", path);

	if (::GetFileAttributes(fn)==u32(-1))
	{
		filesSKIP	++;
		printf		(" - CAN'T OPEN");
		Msg			("%-80s   - CAN'T OPEN",path);
		return;
	}

	IReader*		src				=	FS.r_open	(fn);
	if (0==src)
	{
		filesSKIP	++;
		printf		(" - CAN'T OPEN");
		Msg			("%-80s   - CAN'T OPEN",path);
		return;
	}

	bytesSRC						+=	src->length	();
	u32			c_crc32				=	crc32		(src->pointer(),src->length());
	u32			c_ptr				=	0;
	u32			c_size_real			=	0;
	u32			c_size_compressed	=	0;
	u32			a_tests				=	0;

	ALIAS*		A					=	testALIAS	(src,c_crc32,a_tests);
	printf							("%3da ",a_tests);
	if(A) 
	{
		filesALIAS			++;
		printf				("ALIAS");
		Msg					("%-80s   - ALIAS (%s)",path,A->path);

		// Alias found
		c_ptr				= A->c_ptr;
		c_size_real			= A->c_size_real;
		c_size_compressed	= A->c_size_compressed;
	} else 
	{
		if (testVFS(path))	
		{
			filesVFS			++;

			// Write into BaseFS
			c_ptr				= fs_pack_writer->tell	();
			c_size_real			= src->length();
			c_size_compressed	= src->length();
			fs_pack_writer->w	(src->pointer(),c_size_real);
			printf				("VFS");
			Msg					("%-80s   - VFS",path);
		} else 
		{ //if(testVFS(path))
			// Compress into BaseFS
			c_ptr				=	fs_pack_writer->tell();
			c_size_real			=	src->length();
			if (0!=c_size_real)
			{
				u32 c_size_max		=	rtc_csize		(src->length());
				u8*	c_data			=	xr_alloc<u8>	(c_size_max);

				t_compress.Begin	();

				c_size_compressed	= c_size_max;
				if (bFast)
				{		
					R_ASSERT(LZO_E_OK == lzo1x_1_compress	((u8*)src->pointer(),c_size_real,c_data,&c_size_compressed,c_heap));
				}else
				{
					R_ASSERT(LZO_E_OK == lzo1x_999_compress	((u8*)src->pointer(),c_size_real,c_data,&c_size_compressed,c_heap));
				}

				t_compress.End		();

				if ((c_size_compressed+16) >= c_size_real)
				{
					// Failed to compress - revert to VFS
					filesVFS			++;
					c_size_compressed	= c_size_real;
					fs_pack_writer->w	(src->pointer(),c_size_real);
					printf				("VFS (R)");
					Msg					("%-80s   - VFS (R)",path);
				} else 
				{
					// Compressed OK - optimize
					if (!bFast)
					{
//.........这里部分代码省略.........
开发者ID:AntonioModer,项目名称:xray-16,代码行数:101,代码来源:xrCompress.cpp

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

示例14:

////////////////////////////////////////////////////////////////////////////
// CSE_Abstract
////////////////////////////////////////////////////////////////////////////
CSE_Abstract::CSE_Abstract					(LPCSTR caSection)
{
	m_editor_flags.zero			();
	RespawnTime					= 0;
	net_Ready					= FALSE;
	ID							= 0xffff;
	ID_Parent					= 0xffff;
	ID_Phantom					= 0xffff;
	owner						= 0;
	s_gameid					= 0;
	s_RP						= 0xFE;			// Use supplied coords
	s_flags.assign				(0);
	s_name						= caSection;
	s_name_replace				= 0;			//xr_strdup("");
	o_Angle.set					(0.f,0.f,0.f);
	o_Position.set				(0.f,0.f,0.f);
	m_bALifeControl				= false;
	m_wVersion					= 0;
	m_script_version			= 0;
	m_tClassID					= TEXT2CLSID(pSettings->r_string(caSection,"class"));

//	m_spawn_probability			= 1.f;
	m_spawn_flags.zero			();
	m_spawn_flags.set			(flSpawnEnabled			,TRUE);
	m_spawn_flags.set			(flSpawnOnSurgeOnly		,TRUE);
	m_spawn_flags.set			(flSpawnSingleItemOnly	,TRUE);
	m_spawn_flags.set			(flSpawnIfDestroyedOnly	,TRUE);
	m_spawn_flags.set			(flSpawnInfiniteCount	,TRUE);
//	m_max_spawn_count			= 1;
//	m_spawn_control				= "";
//	m_spawn_count				= 0;
//	m_last_spawn_time			= 0;
//	m_next_spawn_time			= 0;
//	m_min_spawn_interval		= 0;
//	m_max_spawn_interval		= 0;
	m_ini_file					= 0;

	if (pSettings->line_exist(caSection,"custom_data")) {
		string_path				file_name;
		FS.update_path			(file_name,"$game_config$",pSettings->r_string(caSection,"custom_data"));
		if (!FS.exist(file_name)) {
			Msg					("! cannot open config file %s",file_name);
		}
		else {
			IReader				*reader = FS.r_open(file_name);
			VERIFY				(reader);
			{
				int				size = reader->length()*sizeof(char);
				LPSTR			temp = (LPSTR)_alloca(size + 1);
				CopyMemory		(temp,reader->pointer(),size);
				temp[size]		= 0;
				m_ini_string	= temp;
			}
			FS.r_close			(reader);
		}
	}

#ifndef AI_COMPILER
	m_script_clsid				= object_factory().script_clsid(m_tClassID);
#endif

	client_data.clear			();
}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:66,代码来源:xrServer_Object_Base.cpp

示例15: pred


//.........这里部分代码省略.........
	fix_texture_name		(fname);
	IReader* S				= NULL;
	if (!FS.exist(fn,"$game_textures$",	fname,	".dds")	&& strstr(fname,"_bump"))	goto _BUMP_from_base;
	if (FS.exist(fn,"$level$",			fname,	".dds"))							goto _DDS;
	if (FS.exist(fn,"$game_saves$",		fname,	".dds"))							goto _DDS;
	if (FS.exist(fn,"$game_textures$",	fname,	".dds"))							goto _DDS;


#ifdef _EDITOR
	ELog.Msg(mtError,"Can't find texture '%s'",fname);
	return 0;
#else

	Msg("! Can't find texture '%s'",fname);
	R_ASSERT(FS.exist(fn,"$game_textures$",	"ed\\ed_not_existing_texture",".dds"));
	goto _DDS;

	//	Debug.fatal(DEBUG_INFO,"Can't find texture '%s'",fname);

#endif

_DDS:
	{
		// Load and get header

		S						= FS.r_open	(fn);
#ifdef DEBUG
		Msg						("* Loaded: %s[%d]",fn,S->length());
#endif // DEBUG
		img_size				= S->length	();
		R_ASSERT				(S);
		//R_CHK2					(D3DXGetImageInfoFromFileInMemory	(S->pointer(),S->length(),&IMG), fn);
#ifdef USE_DX11
		R_CHK2 (D3DX11GetImageInfoFromMemory(S->pointer(),S->length(), 0, &IMG, 0), fn);
#else
		R_CHK2 (D3DX10GetImageInfoFromMemory(S->pointer(),S->length(), 0, &IMG, 0), fn);
#endif
		//if (IMG.ResourceType	== D3DRTYPE_CUBETEXTURE)			goto _DDS_CUBE;
		if (IMG.MiscFlags & D3D_RESOURCE_MISC_TEXTURECUBE)			goto _DDS_CUBE;
		else														goto _DDS_2D;

_DDS_CUBE:
		{
			//R_CHK(D3DXCreateCubeTextureFromFileInMemoryEx(
			//	HW.pDevice,
			//	S->pointer(),S->length(),
			//	D3DX_DEFAULT,
			//	IMG.MipLevels,0,
			//	IMG.Format,
			//	D3DPOOL_MANAGED,
			//	D3DX_DEFAULT,
			//	D3DX_DEFAULT,
			//	0,&IMG,0,
			//	&pTextureCUBE
			//	));

			//	Inited to default by provided default constructor
#ifdef USE_DX11
			D3DX11_IMAGE_LOAD_INFO LoadInfo;
#else
			D3DX10_IMAGE_LOAD_INFO LoadInfo;
#endif
			//LoadInfo.Usage = D3D_USAGE_IMMUTABLE;
			if (bStaging)
			{
				LoadInfo.Usage = D3D_USAGE_STAGING;
开发者ID:2asoft,项目名称:xray-16,代码行数:67,代码来源:dx10Texture.cpp


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