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


C++ IsGameTypeSingle函数代码示例

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


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

示例1: R_ASSERT

bool CMapLocation::Update() //returns actual
{
	R_ASSERT(m_cached.m_updatedFrame!=Device.dwFrame);
		

	if(	m_flags.test(eTTL) )
	{
		if( m_actual_time < Device.dwTimeGlobal)
		{
			m_cached.m_Actuality		= false;
			m_cached.m_updatedFrame		= Device.dwFrame;
			return						m_cached.m_Actuality;
		}
	}

	CObject* pObject					= Level().Objects.net_Find(m_objectID);
	
	if (m_owner_se_object || (!IsGameTypeSingle() && pObject) )
	{
		m_cached.m_Actuality			= true;
		if(IsGameTypeSingle())
			CalcLevelName				();

		CalcPosition					();
	}else
		m_cached.m_Actuality			= false;

	m_cached.m_updatedFrame				= Device.dwFrame;
	return								m_cached.m_Actuality;
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:30,代码来源:map_location.cpp

示例2: UpdateHUDAddonsVisibility

void CWeapon::UpdateCL		()
{
	inherited::UpdateCL		();
	UpdateHUDAddonsVisibility();
	//подсветка от выстрела
	UpdateLight				();

	//нарисовать партиклы
	UpdateFlameParticles	();
	UpdateFlameParticles2	();

	if(!IsGameTypeSingle())
		make_Interpolation		();
	
	if( (GetNextState()==GetState()) && IsGameTypeSingle() && H_Parent()==Level().CurrentEntity())
	{
		CActor* pActor	= smart_cast<CActor*>(H_Parent());
		if(pActor && !pActor->AnyMove() && this==pActor->inventory().ActiveItem())
		{
			if (hud_adj_mode==0 && 
				GetState()==eIdle && 
				(Device.dwTimeGlobal-m_dw_curr_substate_time>20000) && 
				!IsZoomed()&&
				g_player_hud->attached_item(1)==NULL)
			{
				if(AllowBore())
					SwitchState		(eBore);

				ResetSubStateTime	();
			}
		}
	}

	if(m_zoom_params.m_pNight_vision && !need_renderable())
	{
		if(!m_zoom_params.m_pNight_vision->IsActive())
		{
			CActor *pA = smart_cast<CActor *>(H_Parent());
			R_ASSERT(pA);
			CTorch* pTorch = smart_cast<CTorch*>( pA->inventory().ItemFromSlot(TORCH_SLOT) );
			if ( pTorch && pTorch->GetNightVisionStatus() )
			{
				m_bRememberActorNVisnStatus = pTorch->GetNightVisionStatus();
				pTorch->SwitchNightVision(false, false);
			}
			m_zoom_params.m_pNight_vision->Start(m_zoom_params.m_sUseZoomPostprocess, pA, false);
		}

	}
	else if(m_bRememberActorNVisnStatus)
	{
		m_bRememberActorNVisnStatus = false;
		EnableActorNVisnAfterZoom();
	}

	if(m_zoom_params.m_pVision)
		m_zoom_params.m_pVision->Update();
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:58,代码来源:Weapon.cpp

示例3: Die

void CEntity::Die(CObject* who)
{
	if (!AlreadyDie()) set_death_time();
	set_ready_to_save	();
	SetfHealth			(-1.f);

	if(IsGameTypeSingle())
	{
		VERIFY				(m_registered_member);
	}
	m_registered_member	= false;
	if (IsGameTypeSingle())
		Level().seniority_holder().team(g_Team()).squad(g_Squad()).group(g_Group()).unregister_member(this);
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:14,代码来源:Entity.cpp

示例4: UpdateGrenadeVisibility

BOOL CWeaponMagazinedWGrenade::net_Spawn(CSE_Abstract* DC) 
{
	CSE_ALifeItemWeapon* const weapon		= smart_cast<CSE_ALifeItemWeapon*>(DC);
	R_ASSERT								(weapon);
	if ( IsGameTypeSingle() )
	{
		inherited::net_Spawn_install_upgrades	(weapon->m_upgrades);
	}

	BOOL l_res = inherited::net_Spawn(DC);
	 
	UpdateGrenadeVisibility(!!iAmmoElapsed);
	SetPending			(FALSE);

	iAmmoElapsed2	= weapon->a_elapsed_grenades.grenades_count;
	m_ammoType2		= weapon->a_elapsed_grenades.grenades_type;

	m_DefaultCartridge2.Load(*m_ammoTypes2[m_ammoType2], u8(m_ammoType2));
	
	if (!IsGameTypeSingle())
	{
		if (!m_bGrenadeMode && IsGrenadeLauncherAttached() && !getRocketCount() && iAmmoElapsed2)
		{
			m_magazine2.push_back(m_DefaultCartridge2);

			shared_str grenade_name = m_DefaultCartridge2.m_ammoSect;
			shared_str fake_grenade_name = pSettings->r_string(grenade_name, "fake_grenade_name");

			CRocketLauncher::SpawnRocket(*fake_grenade_name, this);
		}
	}else
	{
		xr_vector<CCartridge>* pM = NULL;
		bool b_if_grenade_mode	= (m_bGrenadeMode && iAmmoElapsed && !getRocketCount());
		if(b_if_grenade_mode)
			pM = &m_magazine;
			
		bool b_if_simple_mode	= (!m_bGrenadeMode && m_magazine2.size() && !getRocketCount());
		if(b_if_simple_mode)
			pM = &m_magazine2;

		if(b_if_grenade_mode || b_if_simple_mode) 
		{
			shared_str fake_grenade_name = pSettings->r_string(pM->back().m_ammoSect, "fake_grenade_name");
			
			CRocketLauncher::SpawnRocket(*fake_grenade_name, this);
		}
	}
	return l_res;
}
开发者ID:2asoft,项目名称:xray,代码行数:50,代码来源:WeaponMagazinedWGrenade.cpp

示例5: PickupModeUpdate

void CActor::PickupModeUpdate()
{
	if(!m_bPickupMode)				return; // kUSE key pressed
	if(!IsGameTypeSingle())			return;

	//подбирание объекта
	if(	m_pObjectWeLookingAt									&& 
		m_pObjectWeLookingAt->cast_inventory_item()				&& 
		m_pObjectWeLookingAt->cast_inventory_item()->Useful()	&&
		m_pUsableObject											&& 
		!m_pUsableObject->nonscript_usable()					&&
		!Level().m_feel_deny.is_object_denied(m_pObjectWeLookingAt) )
	{
		m_pUsableObject->use(this);
		Game().SendPickUpEvent(ID(), m_pObjectWeLookingAt->ID());
	}

	feel_touch_update	(Position(), m_fPickupInfoRadius);
	
	CFrustum frustum;
	frustum.CreateFromMatrix(Device.mFullTransform, FRUSTUM_P_LRTB|FRUSTUM_P_FAR);

	for(xr_vector<CObject*>::iterator it = feel_touch.begin(); it != feel_touch.end(); it++)
	{
		if (CanPickItem(frustum, Device.vCameraPosition, *it)) 
			PickupInfoDraw(*it);
	}
}
开发者ID:zcaliptium,项目名称:xray-16,代码行数:28,代码来源:Actor_Feel.cpp

示例6: activate_physic_shell

void CPhysicsShellHolder::activate_physic_shell()
{
	VERIFY						(!m_pPhysicsShell);
	create_physic_shell			();
	Fvector						l_fw, l_up;
	l_fw.set					(XFORM().k);
	l_up.set					(XFORM().j);
	l_fw.mul					(2.f);
	l_up.mul					(2.f);

	Fmatrix						l_p1, l_p2;
	l_p1.set					(XFORM());
	l_p2.set					(XFORM());
	l_fw.mul					(2.f);
	l_p2.c.add					(l_fw);

	m_pPhysicsShell->Activate	(l_p1, 0, l_p2);
	if(H_Parent()&&H_Parent()->Visual())
	{
		smart_cast<CKinematics*>(H_Parent()->Visual())->CalculateBones_Invalidate	();
		smart_cast<CKinematics*>(H_Parent()->Visual())->CalculateBones	();
	}
	smart_cast<CKinematics*>(Visual())->CalculateBones_Invalidate	();
	smart_cast<CKinematics*>(Visual())->CalculateBones();
	if(!IsGameTypeSingle())
	{
		if(!smart_cast<CCustomRocket*>(this)&&!smart_cast<CGrenade*>(this)) PPhysicsShell()->SetIgnoreDynamic();
	}
//	XFORM().set					(l_p1);
	correct_spawn_pos();

m_pPhysicsShell->set_LinearVel(l_fw);
	m_pPhysicsShell->GetGlobalTransformDynamic(&XFORM());
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:34,代码来源:PhysicsShellHolder.cpp

示例7: InitFromXml

void CUIWpnParams::InitFromXml(CUIXml& xml_doc)
{
	if (!xml_doc.NavigateToNode("wpn_params", 0))	return;
	CUIXmlInit::InitWindow			(xml_doc, "wpn_params", 0, this);
	CUIXmlInit::InitStatic			(xml_doc, "wpn_params:prop_line",			0, &m_Prop_line);

	CUIXmlInit::InitStatic			(xml_doc, "wpn_params:static_accuracy",		0, &m_icon_acc);
	CUIXmlInit::InitStatic			(xml_doc, "wpn_params:static_damage",		0, &m_icon_dam);
	CUIXmlInit::InitStatic			(xml_doc, "wpn_params:static_handling",		0, &m_icon_han);
	CUIXmlInit::InitStatic			(xml_doc, "wpn_params:static_rpm",			0, &m_icon_rpm);

	CUIXmlInit::InitTextWnd			(xml_doc, "wpn_params:cap_accuracy",		0, &m_textAccuracy);
	CUIXmlInit::InitTextWnd			(xml_doc, "wpn_params:cap_damage",			0, &m_textDamage);
	CUIXmlInit::InitTextWnd			(xml_doc, "wpn_params:cap_handling",		0, &m_textHandling);
	CUIXmlInit::InitTextWnd			(xml_doc, "wpn_params:cap_rpm",				0, &m_textRPM);

	m_progressAccuracy.InitFromXml	( xml_doc, "wpn_params:progress_accuracy" );
	m_progressDamage.InitFromXml	( xml_doc, "wpn_params:progress_damage" );
	m_progressHandling.InitFromXml	( xml_doc, "wpn_params:progress_handling" );
	m_progressRPM.InitFromXml		( xml_doc, "wpn_params:progress_rpm" );

	if(IsGameTypeSingle())
	{
		CUIXmlInit::InitStatic			(xml_doc, "wpn_params:static_ammo",			0, &m_stAmmo);
		CUIXmlInit::InitTextWnd			(xml_doc, "wpn_params:cap_ammo_count",		0, &m_textAmmoCount);
		CUIXmlInit::InitTextWnd			(xml_doc, "wpn_params:cap_ammo_count2",		0, &m_textAmmoCount2);
		CUIXmlInit::InitTextWnd			(xml_doc, "wpn_params:cap_ammo_types",		0, &m_textAmmoTypes);
		CUIXmlInit::InitTextWnd			(xml_doc, "wpn_params:cap_ammo_used_type",	0, &m_textAmmoUsedType);
		CUIXmlInit::InitStatic			(xml_doc, "wpn_params:static_ammo_type1",	0, &m_stAmmoType1);
		CUIXmlInit::InitStatic			(xml_doc, "wpn_params:static_ammo_type2",	0, &m_stAmmoType2);
	}

}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:33,代码来源:UIWpnParams.cpp

示例8: operator

void game_sv_GameState::Update		()
{
	struct ping_filler
	{
		void operator()(IClient* client)
		{
			xrClientData*	C			= static_cast<xrClientData*>(client);
			if (!C->ps)
				return;
			C->ps->ping					= u16(C->stats.getPing());
		}
	};
	ping_filler tmp_functor;
	m_server->ForEachClientDo(tmp_functor);
	
	if (!IsGameTypeSingle() && (Phase() == GAME_PHASE_INPROGRESS))
	{
		m_item_respawner.update(Level().timeServer());
	}
	
	if (!g_dedicated_server)
	{
		if (Level().game) {
			CScriptProcess				*script_process = ai().script_engine().script_process(ScriptEngine::eScriptProcessorGame);
			if (script_process)
				script_process->update	();
		}
	}
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:29,代码来源:game_sv_base.cpp

示例9: UpdateCL

void CPhysicObject::UpdateCL()
{
	inherited::UpdateCL();

	//Если наш физический объект анимированный, то 
	//двигаем объект за анимацией
	if (m_pPhysicsShell->PPhysicsShellAnimator())
	{
		m_pPhysicsShell->AnimatorOnFrame();
	}
	
	if (!IsGameTypeSingle())
	{
		Interpolate();
	}

	m_anim_script_callback.update( *this );
	PHObjectPositionUpdate();

#ifdef	DEBUG
if(dbg_draw_doors)
{
	Fvector c,o;
	get_door_vectors( c, o );
}
#endif

	if( !is_active( bones_snd_player ) )
		return;
	bones_snd_player->update( Device.fTimeDelta, *this );

}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:32,代码来源:PhysicObject.cpp

示例10: Destroy

void CPHDestroyable::Destroy(u16 source_id/*=u16(-1)*/,LPCSTR section/*="ph_skeleton_object"*/)
{
	
	if(!CanDestroy())return ;
	m_notificate_objects.clear();
	CPhysicsShellHolder	*obj	=PPhysicsShellHolder()		;
	CPHSkeleton *phs= obj->PHSkeleton();
	if(phs)phs->SetNotNeedSave();
	if(obj->PPhysicsShell())	obj->PPhysicsShell()->Enable()	;
	obj->processing_activate();
	if(source_id==obj->ID())
	{
		m_flags.set(fl_released,FALSE);
	}
	xr_vector<shared_str>::iterator i=m_destroyed_obj_visual_names.begin(),e=m_destroyed_obj_visual_names.end();

	if (IsGameTypeSingle())
	{
		for(;e!=i;i++)
			GenSpawnReplace(source_id,section,*i);
	};	
///////////////////////////////////////////////////////////////////////////
	m_flags.set(fl_destroyed,TRUE);
	return;
}
开发者ID:2asoft,项目名称:xray,代码行数:25,代码来源:PHDestroyable.cpp

示例11: Fvector

bool	CTeleWhirlwindObject::destroy_object		(const Fvector dir,float val) 
{
	CPHDestroyable* D=object->ph_destroyable();
	if(D)
	{
		D->PhysicallyRemoveSelf();
		D->Destroy(m_telekinesis->OwnerObject()->ID());
		
//.		m_telekinesis->add_impact(dir,val*10.f);

		xr_vector<shared_str>::iterator i = D->m_destroyed_obj_visual_names.begin();
		xr_vector<shared_str>::iterator e = D->m_destroyed_obj_visual_names.end();
		if (IsGameTypeSingle())
		{
			for(;e!=i;i++)
				m_telekinesis->add_impact(dir,val*10.f);
		};	


		CParticlesPlayer* PP = smart_cast<CParticlesPlayer*>(object);
		if(PP)
		{
			u16 root=(smart_cast<IKinematics*>(object->Visual()))->LL_GetBoneRoot();
			PP->StartParticles(m_telekinesis->destroing_particles(),root, Fvector().set(0,1,0),m_telekinesis->OwnerObject()->ID());
		}
		return true;
	}
	return false;
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:29,代码来源:TeleWhirlwind.cpp

示例12: ai

CMapLocation::CMapLocation(LPCSTR type, u16 object_id)
{
	m_flags.zero			();

	m_level_spot			= NULL;
	m_level_spot_pointer	= NULL;
	m_minimap_spot			= NULL;
	m_minimap_spot_pointer	= NULL;
	m_complex_spot			= NULL;
	m_complex_spot_pointer	= NULL;

	m_level_map_spot_border	= NULL;
	m_mini_map_spot_border	= NULL;
	m_complex_spot_border	= NULL;

	m_level_map_spot_border_na = NULL;
	m_mini_map_spot_border_na = NULL;
	m_complex_spot_border_na = NULL;

	m_objectID				= object_id;
	m_actual_time			= 0;
	m_owner_se_object		= (ai().get_alife()) ? ai().alife().objects().object(m_objectID,true) : NULL;
	m_flags.set				(eHintEnabled, TRUE);
	LoadSpot				(type, false);
	
	DisablePointer			();

	EnableSpot				();
	m_cached.m_Position.set	(10000,10000);
	m_cached.m_updatedFrame = u32(-1);
	m_cached.m_graphID		= GameGraph::_GRAPH_ID(-1);
	if(!IsGameTypeSingle())
		m_cached.m_LevelName = Level().name();
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:34,代码来源:map_location.cpp

示例13: AddDelayedEvent

void game_sv_GameState::AddDelayedEvent(NET_Packet &tNetPacket, u16 type, u32 time, ClientID sender )
{
//	OnEvent(tNetPacket,type,time,sender);
	if (IsGameTypeSingle())
	{
		m_event_queue->Create(tNetPacket,type,time,sender);
		return;
	}
	switch (type)
	{
	case GAME_EVENT_PLAYER_STARTED:
	case GAME_EVENT_PLAYER_READY:
	case GAME_EVENT_VOTE_START:
	case GAME_EVENT_VOTE_YES:
	case GAME_EVENT_VOTE_NO:
	case GAME_EVENT_PLAYER_AUTH:
	case GAME_EVENT_CREATE_PLAYER_STATE:
		{
			m_event_queue->Create(tNetPacket,type,time,sender);
		}break;
	default:
		{
			m_event_queue->CreateSafe(tNetPacket,type,time,sender);
		}break;
	}
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:26,代码来源:game_sv_base.cpp

示例14: object

void CInventoryItem::net_Export			(NET_Packet& P) 
{	
	P.w_float			(m_fCondition);
	P.w_u32				(Level().timeServer());	
	///////////////////////////////////////
	CPHSynchronize* pSyncObj				= NULL;
	SPHNetState	State;
	pSyncObj = object().PHGetSyncItem		(0);
	if (pSyncObj && !object().H_Parent()) 
		pSyncObj->get_State(State);
	else 	
		State.position.set(object().Position());
	///////////////////////////////////////	
	u16 NumItems = object().PHGetSyncItemsNumber();
	if (object().H_Parent())
		NumItems = CSE_ALifeInventoryItem::FLAG_NO_POSITION;
	else
		if (IsGameTypeSingle())
						NumItems = 0;

	P.w_u16					( NumItems		);
	if (NumItems != CSE_ALifeInventoryItem::FLAG_NO_POSITION)
		P.w_vec3			( State.position);

	if (!NumItems || (NumItems == CSE_ALifeInventoryItem::FLAG_NO_POSITION))
		return;
	position_Export(P,State);
};
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:28,代码来源:inventory_item.cpp

示例15: Level

void CUIZoneMap::Update()
{
	CActor* pActor = smart_cast<CActor*>( Level().CurrentViewEntity() );
	if ( !pActor ) return;

	if ( !( Device.dwFrame % 20 ) && IsGameTypeSingle() )
	{
		string16	text_str;
		xr_strcpy( text_str, sizeof(text_str), "" );

		CPda* pda = pActor->GetPDA();
		if ( pda )
		{
			u32 cn = pda->ActiveContactsNum();
			if ( cn > 0 )
			{
				xr_sprintf( text_str, sizeof(text_str), "%d", cn );
			}
		}
		m_Counter_text.SetText( text_str );
	}

	UpdateRadar( Device.vCameraPosition );
	float h, p;
	Device.vCameraDirection.getHP( h, p );
	SetHeading( -h );

	m_clock_wnd->TextItemControl()->SetText( InventoryUtilities::GetGameTimeAsString( InventoryUtilities::etpTimeToMinutes ).c_str() );
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:29,代码来源:UIZoneMap.cpp


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