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


C++ Flags32类代码示例

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


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

示例1: OnRender

void CTeamBaseZone::OnRender() 
{
	if(!bDebug) return;
	if (!(dbg_net_Draw_Flags.is_any((1<<3)))) return;
//	RCache.OnFrameEnd();
	Fvector l_half; l_half.set(.5f, .5f, .5f);
	Fmatrix l_ball, l_box;
	xr_vector<CCF_Shape::shape_def> &l_shapes = ((CCF_Shape*)CFORM())->Shapes();
	xr_vector<CCF_Shape::shape_def>::iterator l_pShape;
	
	for(l_pShape = l_shapes.begin(); l_shapes.end() != l_pShape; ++l_pShape) 
	{
		switch(l_pShape->type)
		{
		case 0:
			{
                Fsphere &l_sphere = l_pShape->data.sphere;
				l_ball.scale(l_sphere.R, l_sphere.R, l_sphere.R);
				Fvector l_p; XFORM().transform(l_p, l_sphere.P);
				l_ball.translate_add(l_p);
				Level().debug_renderer().draw_ellipse(l_ball, D3DCOLOR_XRGB(0,255,255));
			}
			break;
		case 1:
			{
				l_box.mul(XFORM(), l_pShape->data.box);
				Level().debug_renderer().draw_obb(l_box, l_half, D3DCOLOR_XRGB(0,255,255));
			}
			break;
		}
	}
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:32,代码来源:team_base_zone.cpp

示例2:

	inline debug_memory_guard	()	
	{
#ifdef  DEBUG
		mem_alloc_gather_stats				(!!psAI_Flags.test(aiDebugOnFrameAllocs));
#endif
		mem_alloc_gather_stats_frequency	(debug_on_frame_gather_stats_frequency);
	}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:7,代码来源:Level.cpp

示例3: Level

void CCustomMonster::shedule_Update	( u32 DT )
{
	VERIFY				(!g_Alive() || processing_enabled());
	// Queue shrink
	VERIFY				(_valid(Position()));
	u32	dwTimeCL		= Level().timeServer()-NET_Latency;
	VERIFY				(!NET.empty());
	while ((NET.size()>2) && (NET[1].dwTimeStamp<dwTimeCL)) NET.pop_front();

	float dt			= float(DT)/1000.f;
	// *** general stuff
	if (g_Alive()) {
		if ( false && g_mt_config.test(mtAiVision) )
#ifndef DEBUG
			Device.seqParallel.push_back	(fastdelegate::FastDelegate0<>(this,&CCustomMonster::Exec_Visibility));
#else // DEBUG
		{
			if (!psAI_Flags.test(aiStalker) || !!smart_cast<CActor*>(Level().CurrentEntity()))
				Device.seqParallel.push_back(fastdelegate::FastDelegate0<>(this,&CCustomMonster::Exec_Visibility));
			else
				Exec_Visibility				();
		}
#endif // DEBUG
		else
			Exec_Visibility					();
		memory().update						(dt);
	}
开发者ID:BubbaXXX,项目名称:xray-16,代码行数:27,代码来源:CustomMonster.cpp

示例4: process_file_if_exists

void CScriptEngine::process_file_if_exists(LPCSTR file_name, bool warn_if_not_exist)
{
    u32						string_length = xr_strlen(file_name);
    if (!warn_if_not_exist && no_file_exists(file_name, string_length))
        return;

    string_path				S, S1;
    if (m_reload_modules || (*file_name && !namespace_loaded(file_name)))
    {
        FS.update_path(S, "$game_scripts$", strconcat(sizeof(S1), S1, file_name, ".script"));
        if (!warn_if_not_exist && !FS.exist(S))
        {
#ifdef DEBUG
#	ifndef XRSE_FACTORY_EXPORTS
            if (psAI_Flags.test(aiNilObjectAccess))
#	endif
            {
                print_stack			();
                Msg					("* trying to access variable %s, which doesn't exist, or to load script %s, which doesn't exist too",file_name,S1);
                m_stack_is_ready	= true;
            }
#endif
            add_no_file(file_name, string_length);
            return;
        }
        //#ifndef MASTER_GOLD
        if (strstr(Core.Params, "-dbg"))
            Msg("* loading script %s", S1);
        //#endif // MASTER_GOLD
        m_reload_modules = false;
        load_file_into_namespace(S, *file_name ? file_name : "_G");
    }
}
开发者ID:denanden,项目名称:xray-16,代码行数:33,代码来源:script_engine.cpp

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

示例6: if

	virtual void	Execute	(LPCSTR args)
	{
		if (0==xr_strcmp(args,"on"))	{
			ps_r2_ls_flags.set	(R2FLAG_GLOBALMATERIAL,TRUE);
		} else if (0==xr_strcmp(args,"off"))	{
			ps_r2_ls_flags.set	(R2FLAG_GLOBALMATERIAL,FALSE);
		} else {
			CCC_Float::Execute	(args);
			if (ps_r2_ls_flags.test(R2FLAG_GLOBALMATERIAL))	{
				static LPCSTR	name[4]	=	{ "oren", "blin", "phong", "metal" };
				float	mid		= *value	;
				int		m0		= iFloor(mid)	% 4;
				int		m1		= (m0+1)		% 4;
				float	frc		= mid - float(iFloor(mid));
				Msg		("* material set to [%s]-[%s], with lerp of [%f]",name[m0],name[m1],frc);
			}
		}
	}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:18,代码来源:xrRender_console.cpp

示例7:

void CActor::OnRender	()
{
	if (!bDebug)				return;

	if ((dbg_net_Draw_Flags.is_any((1<<5))))
		character_physics_support()->movement()->dbg_Draw	();

	OnRender_Network();

	inherited::OnRender();
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:11,代码来源:ActorCameras.cpp

示例8:

    virtual void	Execute	(LPCSTR args)	{
        CCC_Token::Execute	(args);

        switch	(*value)
        {
        case 0:
        {
            ps_r_ssao = 0;
            ps_r2_ls_flags_ext.set(R2FLAGEXT_SSAO_HBAO, 0);
            ps_r2_ls_flags_ext.set(R2FLAGEXT_SSAO_HDAO, 0);
            break;
        }
        case 1:
        {
            if (ps_r_ssao==0)
            {
                ps_r_ssao = 1;
            }
            ps_r2_ls_flags_ext.set(R2FLAGEXT_SSAO_HBAO, 0);
            ps_r2_ls_flags_ext.set(R2FLAGEXT_SSAO_HDAO, 0);
            ps_r2_ls_flags_ext.set(R2FLAGEXT_SSAO_HALF_DATA, 0);
            break;
        }
        case 2:
        {
            if (ps_r_ssao==0)
            {
                ps_r_ssao = 1;
            }
            ps_r2_ls_flags_ext.set(R2FLAGEXT_SSAO_HBAO, 0);
            ps_r2_ls_flags_ext.set(R2FLAGEXT_SSAO_HDAO, 1);
            ps_r2_ls_flags_ext.set(R2FLAGEXT_SSAO_OPT_DATA, 0);
            ps_r2_ls_flags_ext.set(R2FLAGEXT_SSAO_HALF_DATA, 0);
            break;
        }
        case 3:
        {
            if (ps_r_ssao==0)
            {
                ps_r_ssao = 1;
            }
            ps_r2_ls_flags_ext.set(R2FLAGEXT_SSAO_HBAO, 1);
            ps_r2_ls_flags_ext.set(R2FLAGEXT_SSAO_HDAO, 0);
            ps_r2_ls_flags_ext.set(R2FLAGEXT_SSAO_OPT_DATA, 1);
            break;
        }
        }
    }
开发者ID:Zen13L,项目名称:xray-16,代码行数:48,代码来源:xrRender_console.cpp

示例9:

void CAI_Stalker::renderable_Render	()
{
	inherited::renderable_Render		();

	if (!already_dead())
		CInventoryOwner::renderable_Render	();

#ifdef DEBUG
	if (g_Alive()) {
		if (psAI_Flags.test(aiAnimationStats))
			animation().add_animation_stats	();
	}
#endif // DEBUG
}
开发者ID:2asoft,项目名称:xray,代码行数:14,代码来源:ai_stalker_feel.cpp

示例10: UpdateCL

void CInventoryItem::UpdateCL()
{
#ifdef DEBUG
	if(bDebug){
		if (dbg_net_Draw_Flags.test(1<<4) )
		{
			Device.seqRender.Remove(this);
			Device.seqRender.Add(this);
		}else
		{
			Device.seqRender.Remove(this);
		}
	}

#endif

}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:17,代码来源:inventory_item.cpp

示例11:

void CActor::OnRender	()
{
#ifdef DEBUG
	if (inventory().ActiveItem())
		inventory().ActiveItem()->OnRender();
#endif
	if (!bDebug)				return;

	if ((dbg_net_Draw_Flags.is_any(dbg_draw_actor_phys)))
		character_physics_support()->movement()->dbg_Draw	();

	

	OnRender_Network();

	inherited::OnRender();
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:17,代码来源:ActorCameras.cpp

示例12: UpdateCL

void CInventoryItem::UpdateCL()
{
#ifdef DEBUG
	if(bDebug){
		if (dbg_net_Draw_Flags.test(dbg_draw_invitem) )
		{
			Device.seqRender.Remove(this);
			Device.seqRender.Add(this);
		}else
		{
			Device.seqRender.Remove(this);
		}
	}

#endif
	if (!IsGameTypeSingle())
	{
		Interpolate();
	}
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:20,代码来源:inventory_item.cpp

示例13:

void CStats::OnRender				()
{
#ifdef DEBUG
	if (g_stats_flags.is(st_sound)){
		CSound_stats_ext				snd_stat_ext;
		::Sound->statistic				(0,&snd_stat_ext);
		CSound_stats_ext::item_vec_it	_I = snd_stat_ext.items.begin();
		CSound_stats_ext::item_vec_it	_E = snd_stat_ext.items.end();
		for (;_I!=_E;_I++){
			const CSound_stats_ext::SItem& item = *_I;
			if (item._3D)
			{
				m_pRender->SetDrawParams(&*Device.m_pRender);
				//RCache.set_xform_world(Fidentity);
				//RCache.set_Shader		(Device.m_SelectionShader);
				//RCache.set_c			("tfactor",1,1,1,1);
				DU->DrawCross			(item.params.position, 0.5f, 0xFF0000FF, true );
				if (g_stats_flags.is(st_sound_min_dist))
					DU->DrawSphere		(Fidentity, item.params.position, item.params.min_distance, 0x400000FF,	0xFF0000FF, true, true);
				if (g_stats_flags.is(st_sound_max_dist))
					DU->DrawSphere		(Fidentity, item.params.position, item.params.max_distance, 0x4000FF00,	0xFF008000, true, true);
				
				xr_string out_txt		= (out_txt.size() && g_stats_flags.is(st_sound_info_name)) ? item.name.c_str():"";

				if (item.game_object)
				{
					if (g_stats_flags.is(st_sound_ai_dist))
						DU->DrawSphere	(Fidentity, item.params.position, item.params.max_ai_distance, 0x80FF0000,0xFF800000,true,true);
					if (g_stats_flags.is(st_sound_info_object)){
						out_txt			+= "  (";
						out_txt			+= item.game_object->cNameSect().c_str();
						out_txt			+= ")";
					}
				}
				if (g_stats_flags.is_any(st_sound_info_name|st_sound_info_object) && item.name.size())
					DU->OutText			(item.params.position, out_txt.c_str(),0xFFFFFFFF,0xFF000000);
			}
		}
	}
#endif
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:41,代码来源:Stats.cpp

示例14:

void CClimableObject ::OnRender()
{
	if (!dbg_net_Draw_Flags.test(dbg_draw_climbable)&&!ph_dbg_draw_mask.test(phDbgLadder)) return;

	Fmatrix form;m_box.xform_get(form);
	//form.mulA(XFORM());
	Level().debug_renderer().draw_obb(XFORM(),m_box.m_halfsize,D3DCOLOR_XRGB(0,0,255));
	Fvector p1,p2,d;
	d.set(m_axis);
	p1.add(XFORM().c,d);
	p2.sub(XFORM().c,d);
	Level().debug_renderer().draw_line(Fidentity,p1,p2,D3DCOLOR_XRGB(255,0,0));

	d.set(m_side);
	p1.add(XFORM().c,d);
	p2.sub(XFORM().c,d);
	Level().debug_renderer().draw_line(Fidentity,p1,p2,D3DCOLOR_XRGB(255,0,0));

	d.set(m_norm);
	d.mul(10.f);
	p1.add(XFORM().c,d);
	p2.set(XFORM().c);
	Level().debug_renderer().draw_line(Fidentity,p1,p2,D3DCOLOR_XRGB(0,255,0));
}
开发者ID:2asoft,项目名称:xray,代码行数:24,代码来源:ClimableObject.cpp

示例15: OnRender

void CLevel::OnRender()
{
	inherited::OnRender	();

	if (!game)
		return;

	Game().OnRender();
	//отрисовать трассы пуль
	//Device.Statistic->TEST1.Begin();
	BulletManager().Render();
	//Device.Statistic->TEST1.End();
	//отрисовать интерфейc пользователя
	HUD().RenderUI();

#ifdef DEBUG
	draw_wnds_rects();
	ph_world->OnRender	();
#endif // DEBUG

#ifdef DEBUG
	if (ai().get_level_graph())
		ai().level_graph().render();

#ifdef DEBUG_PRECISE_PATH
	test_precise_path		();
#endif

	CAI_Stalker				*stalker = smart_cast<CAI_Stalker*>(Level().CurrentEntity());
	if (stalker)
		stalker->OnRender	();

	if (bDebug)	{
		for (u32 I=0; I < Level().Objects.o_count(); I++) {
			CObject*	_O		= Level().Objects.o_get_by_iterator(I);

			CAI_Stalker*		stalker = smart_cast<CAI_Stalker*>(_O);
			if (stalker)
				stalker->OnRender	();

			CPhysicObject		*physic_object = smart_cast<CPhysicObject*>(_O);
			if (physic_object)
				physic_object->OnRender();

			CSpaceRestrictor	*space_restrictor = smart_cast<CSpaceRestrictor*>	(_O);
			if (space_restrictor)
				space_restrictor->OnRender();
			CClimableObject		*climable		  = smart_cast<CClimableObject*>	(_O);
			if(climable)
				climable->OnRender();
			CTeamBaseZone	*team_base_zone = smart_cast<CTeamBaseZone*>(_O);
			if (team_base_zone)
				team_base_zone->OnRender();
			
			if (GameID() != eGameIDSingle)
			{
				CInventoryItem* pIItem = smart_cast<CInventoryItem*>(_O);
				if (pIItem) pIItem->OnRender();
			}

			
			if (dbg_net_Draw_Flags.test(dbg_draw_skeleton)) //draw skeleton
			{
				CGameObject* pGO = smart_cast<CGameObject*>	(_O);
				if (pGO && pGO != Level().CurrentViewEntity() && !pGO->H_Parent())
				{
					if (pGO->Position().distance_to_sqr(Device.vCameraPosition) < 400.0f)
					{
						pGO->dbg_DrawSkeleton();
					}
				}
			};
		}
		//  [7/5/2005]
		if (Server && Server->game) Server->game->OnRender();
		//  [7/5/2005]
		ObjectSpace.dbgRender	();

		//---------------------------------------------------------------------
		HUD().Font().pFontStat->OutSet		(170,630);
		HUD().Font().pFontStat->SetHeight	(16.0f);
		HUD().Font().pFontStat->SetColor	(0xffff0000);

		if(Server)HUD().Font().pFontStat->OutNext	("Client Objects:      [%d]",Server->GetEntitiesNum());
		HUD().Font().pFontStat->OutNext	("Server Objects:      [%d]",Objects.o_count());
		HUD().Font().pFontStat->OutNext	("Interpolation Steps: [%d]", Level().GetInterpolationSteps());
		HUD().Font().pFontStat->SetHeight	(8.0f);
		//---------------------------------------------------------------------
	}
#endif

#ifdef DEBUG
	if (bDebug) {
		DBG().draw_object_info				();
		DBG().draw_text						();
		DBG().draw_level_info				();
	}

	debug_renderer().render					();
	
//.........这里部分代码省略.........
开发者ID:Charsi82,项目名称:xray-1.5.10-2015-,代码行数:101,代码来源:Level.cpp


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