Example #1
0
u32 STextureParams::MemoryUsage(LPCSTR base_name)
{
	u32 mem_usage	= width*height*4;
	if (flags.test(flGenerateMipMaps))	{ mem_usage*=3ul; mem_usage/=2ul; }
    switch (fmt){
    case STextureParams::tfDXT1:
    case STextureParams::tfADXT1: 	mem_usage/=6; break;
    case STextureParams::tfDXT3:
    case STextureParams::tfDXT5: 	mem_usage/=4; break;
    case STextureParams::tf4444:
    case STextureParams::tf1555:
    case STextureParams::tf565: 	mem_usage/=2; break;
    case STextureParams::tfRGBA:	break;
    }
    xr_string fn;
    FS.update_path	(fn,_game_textures_,EFS.ChangeFileExt(base_name,".seq").c_str());
    if (FS.exist(fn.c_str())){
        string128		buffer;
        IReader* F		= FS.r_open(0,fn.c_str());
        F->r_string		(buffer,sizeof(buffer));
        int cnt = 0;
        while (!F->eof()){
            F->r_string(buffer,sizeof(buffer));
            cnt++;
        }
        FS.r_close		(F);
        mem_usage *= cnt?cnt:1;
    }
    return mem_usage;
}
Example #2
0
void PDomain::Load(IReader& F)
{
	type		= PDomainEnum(F.r_u32());
	F.r_fvector3(v[0]);
	F.r_fvector3(v[1]);
	F.r_fvector3(v[2]);
}
Example #3
0
void CObjectAnimator::LoadMotions(LPCSTR fname)
{
	string_path			full_path;
	if (!FS.exist( full_path, "$level$", fname ))
		if (!FS.exist( full_path, "$game_anims$", fname ))
			Debug.fatal(DEBUG_INFO,"Can't find motion file '%s'.",fname);
            
    LPCSTR  ext			= strext(full_path);
    if (ext){
		Clear			();
    	if (0==xr_strcmp(ext,".anm")){
            COMotion* M	= xr_new<COMotion> ();
            if (M->LoadMotion(full_path)) m_Motions.push_back(M);
            else				FATAL("ERROR: Can't load motion. Incorrect file version.");
        }else if (0==xr_strcmp(ext,".anms")){
            IReader* F			= FS.r_open(full_path);
            u32 dwMCnt			= F->r_u32(); VERIFY(dwMCnt);
            for (u32 i=0; i<dwMCnt; i++){
                COMotion* M		= xr_new<COMotion> ();
                bool bRes		= M->Load(*F);
                if (!bRes)		FATAL("ERROR: Can't load motion. Incorrect file version.");
                m_Motions.push_back(M);
            }
            FS.r_close		(F);
        }
        std::sort(m_Motions.begin(),m_Motions.end(),motion_sort_pred);
    }
}
Example #4
0
void TClipMaker::LoadClips()
{
    bool bRes=true;
	if (EFS.GetOpenName("$clips$",m_ClipFName)){
    	Clear		();
    	IReader* F	= FS.r_open(m_ClipFName.c_str()); VERIFY(F);
        m_ClipFName	= EFS.ExcludeBasePath(m_ClipFName.c_str(),FS.get_path("$clips$")->m_Path);
        if (F->find_chunk(CHUNK_ZOOM)){
        	m_Zoom	= F->r_float();
        }
        IReader* C 	= F->open_chunk(CHUNK_CLIPS);
        if(C){
            IReader* M   = C->open_chunk(0);
            for (int count=1; M; count++) {
                CUIClip* clip	= xr_new<CUIClip>(this,count);
                if (!clip->Load(*M)){
                    ELog.Msg(mtError,"Unsupported clip version. Load failed.");
                    xr_delete(clip);
                    bRes = false;
                }
                M->close();
                if (!bRes)	break;
                clips.push_back(clip);
                M = C->open_chunk(count);
            }
            C->close	();
            UpdateClips	();
        }
        FS.r_close(F);
    }
}
Example #5
0
bool CGlow::Load(IReader& F)
{
	u32 version = 0;

    R_ASSERT(F.r_chunk(GLOW_CHUNK_VERSION,&version));
    if((version!=0x0011)&&(version!=GLOW_VERSION)){
        ELog.DlgMsg( mtError, "CGlow: Unsupported version.");
        return false;
    }

	CCustomObject::Load(F);

    if (F.find_chunk(GLOW_CHUNK_SHADER)){
    	F.r_stringZ (m_ShaderName);
    }

    R_ASSERT(F.find_chunk(GLOW_CHUNK_TEXTURE));
	F.r_stringZ	(m_TexName);

    R_ASSERT(F.find_chunk(GLOW_CHUNK_PARAMS));
	m_fRadius  		= F.r_float();
	if (version==0x0011){
		F.r_fvector3	(FPosition);
        UpdateTransform();
    }

    if (F.find_chunk(GLOW_CHUNK_FLAGS))
    	m_Flags.assign	(F.r_u16());

    return true;
}
Example #6
0
int ETextureThumbnail::MemoryUsage()
{
	int mem_usage = _Width()*_Height()*4;
    switch (m_TexParams.fmt){
    case STextureParams::tfDXT1:
    case STextureParams::tfADXT1: 	mem_usage/=6; break;
    case STextureParams::tfDXT3:
    case STextureParams::tfDXT5: 	mem_usage/=4; break;
    case STextureParams::tf4444:
    case STextureParams::tf1555:
    case STextureParams::tf565: 	mem_usage/=2; break;
    case STextureParams::tfRGBA:	break;
    }
    string_path fn;
    FS.update_path	(fn,_game_textures_,EFS.ChangeFileExt(m_Name.c_str(),".seq").c_str());
    if (FS.exist(fn))
    {
        string128		buffer;
        IReader* F		= FS.r_open(0,fn);
        F->r_string		(buffer,sizeof(buffer));
        int cnt = 0;
        while (!F->eof()){
            F->r_string(buffer,sizeof(buffer));
            cnt++;
        }
        FS.r_close		(F);
        mem_usage *= cnt?cnt:1;
    }
    return mem_usage;
}
Example #7
0
bool EParticlesObject::Load(IReader& F)
{
	u32 version = 0;

    R_ASSERT(F.r_chunk(CPSOBJECT_CHUNK_VERSION,&version));
    if( version!=CPSOBJECT_VERSION ){
        ELog.DlgMsg( mtError, "PSObject: Unsupported version.");
        return false;
    }

	inherited::Load(F);

    R_ASSERT(F.find_chunk(CPSOBJECT_CHUNK_REFERENCE));
    F.r_stringZ(m_RefName);
    if (!Compile(*m_RefName)){
        ELog.DlgMsg( mtError, "EParticlesObject: '%s' not found in library", *m_RefName );
        return false;
    }

    if (F.find_chunk(CPSOBJECT_CHUNK_PARAMS)){
//.    	if (m_Particles) m_Particles->m_RT_Flags.set(F.r_u32());
    }

    return true;
}
Example #8
0
/*
void dump	(CDetailManager::vis_list& lst)
{
	for (int i=0; i<lst.size(); i++)
	{
		Msg("%8x / %8x / %8x",	lst[i]._M_start, lst[i]._M_finish, lst[i]._M_end_of_storage._M_data);
	}
}
*/
void CDetailManager::Load		()
{
	// Open file stream
	if (!FS.exist("$level$","level.details"))
	{
		dtFS	= NULL;
		return;
	}

	string256			fn;
	FS.update_path		(fn,"$level$","level.details");
	dtFS				= FS.r_open(fn);

	// Header
	dtFS->r_chunk_safe	(0,&dtH,sizeof(dtH));
	R_ASSERT			(dtH.version == DETAIL_VERSION);
	u32 m_count			= dtH.object_count;

	// Models
	IReader* m_fs		= dtFS->open_chunk(1);
	for (u32 m_id = 0; m_id < m_count; m_id++)
	{
		CDetail*		dt	= xr_new<CDetail> ();
		IReader* S			= m_fs->open_chunk(m_id);
		dt->Load			(S);
		objects.push_back	(dt);
		S->close			();
	}
	m_fs->close		();

	// Get pointer to database (slots)
	IReader* m_slots	= dtFS->open_chunk(2);
	dtSlots				= (DetailSlot*)m_slots->pointer();
	m_slots->close		();

	// Initialize 'vis' and 'cache'
	for (u32 i=0; i<3; ++i)	visible[i].resize(objects.size());
	cache_Initialize	();

	// Make dither matrix
	bwdithermap		(2,dither);

	// Hardware specific optimizations
	if (UseVS())	hw_Load		();
	else			soft_Load	();

	// swing desc
	// normal
	swing_desc[0].amp1	= pSettings->r_float("details","swing_normal_amp1");
	swing_desc[0].amp2	= pSettings->r_float("details","swing_normal_amp2");
	swing_desc[0].rot1	= pSettings->r_float("details","swing_normal_rot1");
	swing_desc[0].rot2	= pSettings->r_float("details","swing_normal_rot2");
	swing_desc[0].speed	= pSettings->r_float("details","swing_normal_speed");
	// fast
	swing_desc[1].amp1	= pSettings->r_float("details","swing_fast_amp1");
	swing_desc[1].amp2	= pSettings->r_float("details","swing_fast_amp2");
	swing_desc[1].rot1	= pSettings->r_float("details","swing_fast_rot1");
	swing_desc[1].rot2	= pSettings->r_float("details","swing_fast_rot2");
	swing_desc[1].speed	= pSettings->r_float("details","swing_fast_speed");
}
Example #9
0
void CEnvironment::mods_load()
{
    Modifiers.clear_and_free();
    string_path path;
    if (FS.exist(path, "$level$", "level.env_mod"))
    {
        IReader* fs = FS.r_open(path);
        u32 id = 0;
        u32 ver = 0x0015;
        u32 sz;

        while (0 != (sz = fs->find_chunk(id)))
        {
            if (id == 0 && sz == sizeof(u32))
            {
                ver = fs->r_u32();
            }
            else
            {
                CEnvModifier E;
                E.load(fs, ver);
                Modifiers.push_back(E);
            }
            id++;
        }
        FS.r_close(fs);
    }

    load_level_specific_ambients();
}
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);
}
Example #11
0
void CActorCondition::load(IReader &input_packet)
{
	inherited::load		(input_packet);
	load_data			(m_fAlcohol, input_packet);
	load_data			(m_condition_flags, input_packet);
	load_data			(m_fSatiety, input_packet);

	load_data			(m_curr_medicine_influence.fHealth, input_packet);
	load_data			(m_curr_medicine_influence.fPower, input_packet);
	load_data			(m_curr_medicine_influence.fSatiety, input_packet);
	load_data			(m_curr_medicine_influence.fRadiation, input_packet);
	load_data			(m_curr_medicine_influence.fWoundsHeal, input_packet);
	load_data			(m_curr_medicine_influence.fMaxPowerUp, input_packet);
	load_data			(m_curr_medicine_influence.fAlcohol, input_packet);
	load_data			(m_curr_medicine_influence.fTimeTotal, input_packet);
	load_data			(m_curr_medicine_influence.fTimeCurrent, input_packet);

	u8 cntr = input_packet.r_u8();
	for(; cntr>0; cntr--)
	{
		SBooster B;
		B.m_type = (EBoostParams)input_packet.r_u8();
		B.fBoostValue = input_packet.r_float();
		B.fBoostTime = input_packet.r_float();
		m_booster_influences[B.m_type] = B;
		BoostParameters(B);
	}
}
Example #12
0
void CPatrolPathStorage::load_raw			(const CLevelGraph *level_graph, const CGameLevelCrossTable *cross, const CGameGraph *game_graph, IReader &stream)
{
	IReader						*chunk = stream.open_chunk(WAY_PATROLPATH_CHUNK);

	if (!chunk)
		return;
		
	u32							chunk_iterator;
	for (IReader *sub_chunk = chunk->open_chunk_iterator(chunk_iterator); sub_chunk; sub_chunk = chunk->open_chunk_iterator(chunk_iterator,sub_chunk)) {
		R_ASSERT				(sub_chunk->find_chunk(WAYOBJECT_CHUNK_VERSION));
		R_ASSERT				(sub_chunk->r_u16() == WAYOBJECT_VERSION);
		R_ASSERT				(sub_chunk->find_chunk(WAYOBJECT_CHUNK_NAME));

		shared_str				patrol_name;
		sub_chunk->r_stringZ	(patrol_name);
		const_iterator			I = m_registry.find(patrol_name);
		VERIFY3					(I == m_registry.end(),"Duplicated patrol path found",*patrol_name);
		m_registry.insert		(
			std::make_pair(
				patrol_name,
				&xr_new<CPatrolPath>(
					patrol_name
				)->load_raw(
					level_graph,
					cross,
					game_graph,
					*sub_chunk
				)
			)
		);
	}
	
	chunk->close				();
}
Example #13
0
	Image ImageFormat_JPEG::decode(IReader& reader) const
	{
		const int64 size = reader.size();
		
		uint8* buffer = static_cast<uint8*>(::malloc(static_cast<size_t>(size)));
		
		reader.read(buffer, size);

		int width, height;

		tjhandle tj = ::tjInitDecompress();

		::tjDecompressHeader(tj, buffer, static_cast<unsigned long>(size), &width, &height);

		Image image(width, height);

		::tjDecompress(
			tj,
			buffer,
			static_cast<unsigned long>(size),
			image.dataAsUint8(),
			image.width(),
			image.stride(),
			image.height(),
			sizeof(Color),
			0);

		::tjDestroy(tj);

		::free(buffer);

		return image;
	}
Example #14
0
void recalculation::check_files( u32 check_sum )
{
	string_path						  N,L;
	FS.update_path					( L,	"$level$", "level.details" );
	FS.update_path					( N,	"$level$", "recalculation_data_slots.details" );
	if( ! FS.exist( L ) )
	{
		FS.file_delete( N );
		return;
	}

	IReader*		R	= FS.r_open	(		"$level$", "recalculation_data_slots.details" );
	if( R )
	{
		u32 check;
		R->r_chunk( 0, &check );
		if( check != check_sum )
			FS.file_delete( N );
		else
			recalculate = true;

		FS.r_close( R ) ;
	}
	
}
Example #15
0
void ppmd_initialize		()
{
	if (trained_model)
		trained_model->rewind	();

	static bool	initialized	= false;
	if (initialized)
		return;

	string_path			file_name;

	FS.update_path		(file_name,"$game_config$","mp\\!PPMd.mdl");
	if (FS.exist(file_name)) {
		IReader			*reader = FS.r_open(file_name);
		R_ASSERT		(reader);
		u32				buffer_size = reader->length();
		u8				*buffer = (u8*)xr_malloc(buffer_size);
		reader->r		(buffer,buffer_size);
		FS.r_close		(reader);
		trained_model	= new stream(buffer,buffer_size);
	}

	initialized		= true;
	if (StartSubAllocator(suballocator_size))
		return;
	
	exit			(-1);
}
Example #16
0
void CALifeSpawnRegistry::load				(IReader &file_stream, LPCSTR game_name)
{
	R_ASSERT					(FS.exist(game_name));

	IReader						*chunk, *chunk0;
	Msg							("* Loading spawn registry...");
	R_ASSERT2					(file_stream.find_chunk(SPAWN_CHUNK_DATA),"Cannot find chunk SPAWN_CHUNK_DATA!");
	chunk0						= file_stream.open_chunk(SPAWN_CHUNK_DATA);
	
	xrGUID						guid;
	chunk						= chunk0->open_chunk(0);
	VERIFY						(chunk);
	chunk->r_stringZ			(m_spawn_name);
	chunk->r					(&guid,sizeof(guid));
	chunk->close				();

	string_path					file_name;
	bool						file_exists = !!FS.exist(file_name, "$game_spawn$", *m_spawn_name, ".spawn");
	R_ASSERT3					(file_exists,"Can't find spawn file:",*m_spawn_name);
	
	VERIFY						(!m_file);
	m_file						= FS.r_open(file_name);
	load						(*m_file,&guid);

	chunk0->close				();
}
Example #17
0
void
CPhysicsShellHolder::PHLoadState(IReader &P)
{
	
//	Flags8 lflags;
	CKinematics* K=smart_cast<CKinematics*>(Visual());
//	P.r_u8 (lflags.flags);
	if(K)
	{
		K->LL_SetBonesVisible(P.r_u64());
		K->LL_SetBoneRoot(P.r_u16());
	}

	Fvector min=P.r_vec3();
	Fvector max=P.r_vec3();
	
	VERIFY(!min.similar(max));

	u16 bones_number=P.r_u16();
		
    R_ASSERT3(bones_number <= 64, "CPhysicsShellHolder::PHLoadState", cNameVisual().c_str());

	for(u16 i=0;i<bones_number;i++)
	{
		SPHNetState state;
		state.net_Load(P,min,max);
		PHGetSyncItem(i)->set_State(state);
	}
}
Example #18
0
void CALifeSimulatorHeader::load				(IReader	&file_stream)
{
	R_ASSERT2					(file_stream.find_chunk(ALIFE_CHUNK_DATA),"Can't find chunk ALIFE_CHUNK_DATA");
	m_version					= file_stream.r_u32();

	R_ASSERT2					(m_version>=0x0002,"ALife version mismatch! (Delete saved game and try again)");
};
Example #19
0
	Size ImageFormat_JPEG::getSize(const IReader& reader) const
	{
		uint8 buf[24];

		if (!reader.lookahead(buf))
		{
			return{ 0, 0 };
		}

		const auto len = reader.size();

		//
		//	http://www.wischik.com/lu/programmer/get-image-size.html
		//
		if ((buf[0] == 0xFF && buf[1] == 0xD8 && buf[2] == 0xFF && buf[3] == 0xE0 && buf[6] == 'J' && buf[7] == 'F' && buf[8] == 'I' && buf[9] == 'F')
			|| (buf[0] == 0xFF && buf[1] == 0xD8 && buf[2] == 0xFF && buf[3] == 0xE1 && buf[6] == 'E' && buf[7] == 'x' && buf[8] == 'i' && buf[9] == 'f'))
		{
			int64 pos = 2;

			while (buf[2] == 0xFF)
			{
				if (buf[3] == 0xC0
					|| buf[3] == 0xC1
					|| buf[3] == 0xC2
					|| buf[3] == 0xC3
					|| buf[3] == 0xC5
					|| buf[3] == 0xC6
					|| buf[3] == 0xC7
					|| buf[3] == 0xC9
					|| buf[3] == 0xCA
					|| buf[3] == 0xCB
					|| buf[3] == 0xCD
					|| buf[3] == 0xCE
					|| buf[3] == 0xCF)
				{
					break;
				}

				pos += 2 + (buf[4] << 8) + buf[5];

				if (pos + 12 > len)
				{
					break;
				}

				reader.lookahead(buf + 2, pos, 12);
			}
		}

		// JPEG: (first two bytes of buf are first two bytes of the jpeg file; rest of buf is the DCT frame
		if (buf[0] == 0xFF && buf[1] == 0xD8 && buf[2] == 0xFF)
		{
			const int32 width = (buf[9] << 8) + buf[10];
			const int32 height = (buf[7] << 8) + buf[8];

			return{ width, height };
		}

		return{ 0, 0 };
	}
Example #20
0
void CGameObject::net_Load		(IReader &ireader)
{
	load					(ireader);

	// Script Binder Load ---------------------------------------
#ifdef DEBUG	
	if (psAI_Flags.test(aiSerialize))	{
		Msg(">> **** Load script object [%s] *****", *cName());
		Msg(">> Before load :: reader position = [%i]", ireader.tell());
	}

#endif

	CScriptBinder::load		(ireader);


#ifdef DEBUG	

	if (psAI_Flags.test(aiSerialize))	{
		Msg(">> After load :: reader position = [%i]", ireader.tell());
	}
#endif
	// ----------------------------------------------------------
#ifdef DEBUG
	if(ph_dbg_draw_mask1.test(ph_m1_DbgTrackObject)&&stricmp(PH_DBG_ObjectTrackName(),*cName())==0)
	{
		Msg("CGameObject::net_Load obj %s (loaded) %f,%f,%f",PH_DBG_ObjectTrackName(),Position().x,Position().y,Position().z);
	}

#endif

}
Example #21
0
bool CCustomMotion::Load(IReader& F)
{
	F.r_stringZ	(name);
	iFrameStart	= F.r_u32();
	iFrameEnd	= F.r_u32();
	fFPS		= F.r_float();
	return true;
}
Example #22
0
void SHeliBodyState::load(IReader &input_packet)
{
	type				= (EHeliBodyState)input_packet.r_s16();
	b_looking_at_point	= !!input_packet.r_u8();
	currBodyHPB.x			= input_packet.r_float();
	currBodyHPB.y			= input_packet.r_float();
	currBodyHPB.z			= input_packet.r_float();
}
size_t ov_read_func(void *ptr, size_t size, size_t nmemb, void *datasource)
{ 
	IReader* F			= (IReader*)datasource; 
	size_t exist_block	= _max(0ul,iFloor(F->elapsed()/(float)size));
	size_t read_block	= _min(exist_block,nmemb);
	F->r				(ptr,(int)(read_block*size));	
	return read_block;
}
Example #24
0
void  CWound::load	(IReader &input_packet)
{
	m_iBoneNum = (u8)input_packet.r_u8();
	for(int i=0; i<ALife::eHitTypeMax; i++){
		m_Wounds[i] = input_packet.r_float_q8 (0.f, WOUND_MAX);
		VERIFY(m_Wounds[i]>=0.0f && m_Wounds[i]<=WOUND_MAX);	
	}
}
Example #25
0
void CMapLocation::load(IReader &stream)
{
	u16 c =			stream.r_u16();
	xr_string		hint;
	stream.r_stringZ(hint);
	SetHint			(hint.c_str());
	SetRefCount		(c);
	m_flags.flags	= stream.r_u32	();
}
Example #26
0
bool CALifeSimulatorHeader::valid				(IReader	&file_stream) const
{
	if (!file_stream.find_chunk(ALIFE_CHUNK_DATA))
		return					(false);

	u32							version;
	file_stream.r				(&version,	sizeof(version));
	return						(version>=2);
}
void CALifeSpawnHeader::load			(IReader	&file_stream)
{
	m_version				= file_stream.r_u32();
	R_ASSERT2				(XRAI_CURRENT_VERSION == m_version,"'game.spawn' version mismatch!");
	file_stream.r			(&m_guid,sizeof(m_guid));
	file_stream.r			(&m_graph_guid,sizeof(m_graph_guid));
	m_count					= file_stream.r_u32();
	m_level_count			= file_stream.r_u32();
}
Example #28
0
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());
}
Example #29
0
void SHeliEnemy::load(IReader &input_packet)
{
	type				= (EHeliHuntState)input_packet.r_s16();
	input_packet.r_fvector3	(destEnemyPos);
	destEnemyID			= input_packet.r_u32();

	fire_trail_length_des	= input_packet.r_float();
	bUseFireTrail		= !!input_packet.r_u8();
}
Example #30
0
void CALifeSpawnRegistry::load_updates		(IReader &stream)
{
	u32								vertex_id;
	for (IReader *chunk = stream.open_chunk_iterator(vertex_id); chunk; chunk = stream.open_chunk_iterator(vertex_id,chunk)) {
		VERIFY						(u32(ALife::_SPAWN_ID(-1)) > vertex_id);
		const SPAWN_GRAPH::CVertex	*vertex = m_spawns.vertex(ALife::_SPAWN_ID(vertex_id));
		VERIFY						(vertex);
		vertex->data()->load_update	(*chunk);
	}
}