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


C++ CRY_ASSERT_MESSAGE函数代码示例

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


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

示例1: CRY_ASSERT_MESSAGE

void CEntityAudioProxy::OnMove()
{
	CRY_ASSERT_MESSAGE(!(((m_nFlags & eEAPF_CAN_MOVE_WITH_ENTITY) > 0) && ((m_pEntity->GetFlagsExtended() & ENTITY_FLAG_EXTENDED_AUDIO_LISTENER) > 0)), "An CEntityAudioProxy cannot have both flags (eEAPF_CAN_MOVE_WITH_ENTITY & ENTITY_FLAG_EXTENDED_AUDIO_LISTENER) set simultaneously!");

	Matrix34 const& tm = m_pEntity->GetWorldTM();
	CRY_ASSERT_MESSAGE(tm.IsValid(), "Invalid Matrix34 during CEntityAudioProxy::OnMove");

	if ((m_nFlags & eEAPF_CAN_MOVE_WITH_ENTITY) > 0)
	{
		std::for_each(m_mapAuxAudioProxies.begin(), m_mapAuxAudioProxies.end(), SRepositionAudioProxy(tm));
	}
	else if ((m_pEntity->GetFlagsExtended() & ENTITY_FLAG_EXTENDED_AUDIO_LISTENER) > 0)
	{
		Matrix34 position = tm;
		position += CVar::audioListenerOffset;

		if (!s_audioListenerLastTransformation.IsEquivalent(position, 0.01f))
		{
			s_audioListenerLastTransformation = position;

			SAudioRequest oRequest;
			oRequest.nFlags = eARF_PRIORITY_NORMAL;
			oRequest.pOwner = this;

			SAudioListenerRequestData<eALRT_SET_POSITION> oRequestData(s_audioListenerLastTransformation);

			oRequest.pData = &oRequestData;

			gEnv->pAudioSystem->PushRequest(oRequest);

			// As this is an audio listener add its entity to the AreaManager for raising audio relevant events.
			gEnv->pEntitySystem->GetAreaManager()->MarkEntityForUpdate(m_pEntity->GetId());
		}
	}
}
开发者ID:amrhead,项目名称:eaascode,代码行数:35,代码来源:EntityAudioProxy.cpp

示例2: CRY_ASSERT_MESSAGE

/* static */
bool CGameBrowser::CreatePresenceString(CryFixedStringT<MAX_PRESENCE_STRING_SIZE> &out, SCryLobbyUserData *pData, uint32 numData)
{
	bool result = true;

	if(numData > 0)
	{
		CRY_ASSERT_MESSAGE(pData[CGame::eRPT_String].m_id == RICHPRESENCE_ID, "");

		// pData[0] indicates the type of rich presence we setting, i.e. frontend, lobby, in-game
		// additional pData's are parameters that can be passed into the rich presence string, only used for gameplay at the moment
		switch(pData[CGame::eRPT_String].m_int32)
		{
		case RICHPRESENCE_FRONTEND:
			LocalisePresenceString(out, "@mp_rp_frontend");
			break;

		case RICHPRESENCE_LOBBY:
			LocalisePresenceString(out, "@mp_rp_lobby");
			break;

		case RICHPRESENCE_GAMEPLAY:
#ifdef GAME_IS_CRYSIS2
			if(numData == 3)
			{
				const int gameModeId = pData[CGame::eRPT_Param1].m_int32;
				const int mapId = pData[CGame::eRPT_Param2].m_int32;
				LocaliseInGamePresenceString( out, "@mp_rp_gameplay", gameModeId, mapId );
			}
#if !defined(_RELEASE)
			else
			{
				CRY_ASSERT_MESSAGE(numData == 3, "Invalid data passed for gameplay rich presence state");
				result = false;
			}
#endif
#endif
			break;

		case RICHPRESENCE_SINGLEPLAYER:
			LocalisePresenceString(out, "@mp_rp_singleplayer");
			break;

		case RICHPRESENCE_IDLE:
			LocalisePresenceString(out, "@mp_rp_idle");
			break;

		default:
			CRY_ASSERT_MESSAGE(false, "[RichPresence] unknown rich presence type given");
			result = false;
			break;
		}
	}
	else
	{
		CryLog("[RichPresence] Failed to set richpresence because numData was 0 or there was no hud");
		result = false;
	}

	return result;
}
开发者ID:Aytunes,项目名称:Tanks,代码行数:61,代码来源:GameBrowser.cpp

示例3: CRY_ASSERT_MESSAGE

//-------------------------------------------------
void CHandGrenades::InitFireModes()
{
	inherited::InitFireModes();

	int firemodeCount = m_firemodes.size();

	m_pThrow = NULL;
	int throwId = -1;

	for(int i = 0; i < firemodeCount; i++)
	{
		if (crygti_isof<CThrow>(m_firemodes[i]))
		{
			CRY_ASSERT_MESSAGE(!m_pThrow, "Multiple Throw firemodes assigned to weapon");
			m_pThrow = crygti_cast<CThrow*>(m_firemodes[i]);
			throwId = i;
		}
	}

	CRY_ASSERT_MESSAGE(m_pThrow, "No Throw firemode assigned to weapon");

	if(m_pThrow)
	{
		SetCurrentFireMode(throwId);
	}
}
开发者ID:Xydrel,项目名称:Infected,代码行数:27,代码来源:HandGrenades.cpp

示例4: CRY_ASSERT_MESSAGE

//------------------------------------------------------------------------
void CVehicleViewSteer::UpdateView(SViewParams &viewParams, EntityId playerId)
{
	static bool doUpdate = true;

	if (!doUpdate) return;

	if (m_position.IsValid())
	{
		viewParams.position = m_position;
	}
	else
	{
		CRY_ASSERT_MESSAGE(0, "camera position invalid");
	}

	Vec3 dir = (m_lookAt - m_position).GetNormalizedSafe();
	if (dir.IsValid() && dir.GetLengthSquared() > 0.01f)
	{
		viewParams.rotation = Quat::CreateRotationVDir(dir);
	}
	else
	{
		CRY_ASSERT_MESSAGE(0, "camera rotation invalid");
	}

	// set view direction on actor
	IActor* pActor = m_pSeat->GetPassengerActor(true);
	if (pActor && pActor->IsClient())
	{
		pActor->SetViewInVehicle(viewParams.rotation);
	}
}
开发者ID:joewan,项目名称:pycmake,代码行数:33,代码来源:VehicleViewSteer.cpp

示例5: CRY_ASSERT_MESSAGE

//-----------------------------------------------------------------------------------------------------
void ScreenLayoutManager::SetState( ScreenLayoutStates flags )
{
	CRY_ASSERT_MESSAGE( !((flags&eSLO_ScaleMethod_None) && (flags&eSLO_ScaleMethod_WithY)), "HUD: Conflicting scale methods" );
	CRY_ASSERT_MESSAGE( !((flags&eSLO_ScaleMethod_None) && (flags&eSLO_ScaleMethod_WithX)), "HUD: Conflicting scale methods" );
	CRY_ASSERT_MESSAGE( !((flags&eSLO_ScaleMethod_WithY) && (flags&eSLO_ScaleMethod_WithX)), "HUD: Conflicting scale methods" );
	m_flags = flags; // |=  /?
}
开发者ID:PiratesAhoy,项目名称:HeartsOfOak-Core,代码行数:8,代码来源:ScreenLayoutManager.cpp

示例6: switch

void CFlowNode_AISequenceAction_WeaponHolster::HandleSequenceEvent(AIActionSequence::SequenceEvent sequenceEvent)
{
	switch(sequenceEvent)
	{
	case AIActionSequence::StartAction:
		{
			CRY_ASSERT_MESSAGE(m_actInfo.pEntity, "entity has magically gone");
			if (!m_actInfo.pEntity)
			{
				// the entity has gone for some reason, at least make sure the action gets finished properly and the FG continues
				CancelSequenceAndActivateOutputPort(OutputPort_Done);
				return;
			}

			assert(gEnv && gEnv->pGame && gEnv->pGame->GetIGameFramework() && gEnv->pGame->GetIGameFramework()->GetIActorSystem());
			IActor* pActor = gEnv->pGame->GetIGameFramework()->GetIActorSystem()->GetActor(m_actInfo.pEntity->GetId());
			if (!pActor)
			{
				CRY_ASSERT_MESSAGE(0, "Provided entity must be an IActor");
				CryWarning(VALIDATOR_MODULE_AI, VALIDATOR_WARNING, "Provided entity %s must be an IActor", m_actInfo.pEntity->GetName());
				CancelSequenceAndActivateOutputPort(OutputPort_Done);
				return;
			}

			const bool skipHolsterAnimation = GetPortBool(&m_actInfo, InputPort_SkipHolsterAnimation);
			pActor->HolsterItem(true, !skipHolsterAnimation);
			FinishSequenceActionAndActivateOutputPort(OutputPort_Done);
		}
		break;
	}
}
开发者ID:danielasun,项目名称:dbho-GameSDK,代码行数:31,代码来源:FlowNodesAIActionSequence.cpp

示例7: CRY_ASSERT_MESSAGE

	void CEffectsController::InitWithEntity(IEntity *pEntity)
	{
		CRY_ASSERT_MESSAGE(pEntity, "Init Effect controller with NULL entity, this will crash!");
		CRY_ASSERT_MESSAGE((m_pOwnerEntity == NULL), "Effect controller had already an entity assigned");

		m_pOwnerEntity = pEntity;
	}
开发者ID:PiratesAhoy,项目名称:HeartsOfOak-Core,代码行数:7,代码来源:EntityEffects.cpp

示例8: CRY_ASSERT_MESSAGE

void CActionScope::QueueAnimFromSequence(uint32 layer, uint32 pos, bool isPersistent)
{
    CRY_ASSERT_MESSAGE(layer < m_numLayers, "Invalid layer idx");
    SSequencer &sequencer = m_layerSequencers[layer];

    if (pos < sequencer.sequence.size())
    {
        const SAnimClip &animClip = sequencer.sequence[pos];
        const SAnimBlend &fragmentBlend = animClip.blend;

        sequencer.blend = fragmentBlend;
        sequencer.installTime   = sequencer.blend.exitTime;
        if (pos > 0)
        {
            sequencer.referenceTime = sequencer.sequence[pos-1].referenceLength;
        }
        sequencer.flags |= eSF_Queued;

        CRY_ASSERT_MESSAGE(sequencer.installTime >= 0.0f, "Invalid exit time!");
    }
    else if (!isPersistent)
    {
        if (pos > 0)
        {
            sequencer.referenceTime = sequencer.sequence[pos-1].referenceLength;
        }
        sequencer.installTime = sequencer.referenceTime;
        sequencer.flags |= eSF_Queued;
    }
}
开发者ID:souxiaosou,项目名称:FireNET,代码行数:30,代码来源:ActionScope.cpp

示例9: CRY_ASSERT_MESSAGE

void CTacticalPointLanguageExtender::UnregisterFromTacticalPointSystem()
{
	CRY_ASSERT_MESSAGE(gEnv->pAISystem->GetTacticalPointSystem() != NULL, "Expecting tactical point system to exist, but it doesn't.");
	ITacticalPointSystem& tacticalPointSystem = *gEnv->pAISystem->GetTacticalPointSystem();

	bool successfullyRemovedLanguageExtender = tacticalPointSystem.RemoveLanguageExtender(this);
	CRY_ASSERT_MESSAGE(successfullyRemovedLanguageExtender, "Failed to remove tactical point language extender.");
}
开发者ID:Kufusonic,项目名称:Work-in-Progress-Sonic-Fangame,代码行数:8,代码来源:TacticalPointLanguageExtender.cpp

示例10: CRY_ASSERT_MESSAGE

CPlayerPlugin::~CPlayerPlugin()
{
	if (m_ownerPlayer)
	{
		CRY_ASSERT_MESSAGE(!m_entered, ("[PLAYER PLUG-IN] <%s %s \"%s\"> %s", m_ownerPlayer->IsClient() ? "Local" : "Remote", m_ownerPlayer->GetEntity()->GetClass()->GetName(), m_ownerPlayer->GetEntity()->GetName(), string().Format("Player plug-in is being destroyed without having been shut down cleanly!").c_str()));
	}
	else
	{
		CRY_ASSERT_MESSAGE(!m_entered, ("[PLAYER PLUG-IN] <NULL> %s", string().Format("Player plug-in is being destroyed without having been shut down cleanly!").c_str()));
	}
}
开发者ID:aronarts,项目名称:FireNET,代码行数:11,代码来源:PlayerPlugin.cpp

示例11: switch

// message from server received on clients
void CVTOLVehicleManager::OnSingleEntityRMI(CGameRules::SModuleRMIEntityParams params)
{
	switch(params.m_data)
	{
		case eRMITypeSingleEntity_vtol_destroyed:
		{
			CryLog("CVTOLVehicleManager::OnSingleEntityRMI() eRMITypeSingleEntity_vtol_destroyed");
			IVehicle* pVehicle = m_pVehicleSystem->GetVehicle( params.m_entityId );
			CRY_ASSERT_MESSAGE(pVehicle, "have received destroyed VTOL RMI, but cannot find the vehicle for specified entity id");
			if (pVehicle)
			{
				DestroyVTOL(pVehicle->GetEntity(), m_vtolList[params.m_entityId]);
			}
			break;
		}
		case eRMITypeSingleEntity_vtol_hidden:				// for late joining clients only
		{

			CryLog("CVTOLVehicleManager::OnSingleEntityRMI() eRMITypeSingleEntity_vtol_hidden");
			IVehicle* pVehicle = m_pVehicleSystem->GetVehicle(params.m_entityId);
			CRY_ASSERT_MESSAGE(pVehicle, "have received hidden VTOL RMI, but cannot find the vehicle for specified entity id");
			if (pVehicle)
			{		
				//Hide existing vehicle
				IEntity* pVehicleEntity = pVehicle->GetEntity();
				pVehicleEntity->SetPos(Vec3(0.f,0.f,0.f));	// TODO - get Gary's fix for this if any
				pVehicleEntity->Hide(true);

				SVTOLInfo& info = m_vtolList[params.m_entityId];
				info.state = EVS_Invisible;
				info.stateTime = 0.f;		// this may allow clients to do their own respawn handling, stopping the need for respawned RMI below

				SHUDEvent hudEvent(eHUDEvent_RemoveEntity);
				hudEvent.AddData((int)params.m_entityId);
				CHUDEventDispatcher::CallEvent(hudEvent);
			}
			break;
		}
		case eRMITypeSingleEntity_vtol_respawned:
		{
			CryLog("CVTOLVehicleManager::OnSingleEntityRMI() eRMITypeSingleEntity_vtol_respawned");
			IVehicle* pVehicle = m_pVehicleSystem->GetVehicle(params.m_entityId);
			CRY_ASSERT_MESSAGE(pVehicle, "have received respawned VTOL RMI, but cannot find the vehicle for specified entity id");
			if (pVehicle)
			{
				RespawnVTOL(pVehicle, m_vtolList[params.m_entityId]);
			}
			break;
		}
		default:
			CRY_ASSERT_MESSAGE(0, string().Format("unhandled RMI data %d", params.m_data));
			break;
	}
}
开发者ID:souxiaosou,项目名称:FireNET,代码行数:55,代码来源:VTOLVehicleManager.cpp

示例12: FUNCTION_PROFILER

CEntity* CEntityPool::GetEntityFromPool(bool &outIsActive, EntityId forcedPoolId /*= 0*/)
{
	FUNCTION_PROFILER(GetISystem(), PROFILE_ENTITY);

	CEntity* pPoolEntity = NULL;

	if (forcedPoolId > 0)
	{
		pPoolEntity = GetPoolEntityWithPoolId(outIsActive, forcedPoolId);
	}

	if (!pPoolEntity)
	{
		pPoolEntity = GetPoolEntityFromInactiveSet();
		if (pPoolEntity)
			outIsActive = false;
	}

	if (!pPoolEntity)
	{
		pPoolEntity = GetPoolEntityFromActiveSet();
		if (pPoolEntity)
			outIsActive = true;
	}

	if (!pPoolEntity)
	{
		CRY_ASSERT_MESSAGE(false, "CEntityPool::GetEntityFromPool() Creating new entity for pool usage at run-time. Pool was too small!");
		EntityWarning("[Entity Pool] Pool \'%s\' was too small. A new entity had to be created at run-time. Consider increasing the pool size.", m_sName.c_str());

#ifdef ENTITY_POOL_DEBUGGING
		m_bDebug_HasExpanded = true;
#endif //ENTITY_POOL_DEBUGGING

		// Make sure not to go above the max size
		if (m_uMaxSize > 0 && m_InactivePoolIds.size() + m_ActivePoolIds.size() < m_uMaxSize)
		{
			// Make a new one
			if (!CreatePoolEntity(pPoolEntity, false))
			{
				CRY_ASSERT_MESSAGE(false, "CEntityPool::GetEntityFromPool() Failed when creating a new pool entity.");
			}
		}
		else
		{
			CRY_ASSERT_MESSAGE(false, "CEntityPool::GetEntityFromPool() Have to create a new pool entity but am already at max size!");
			EntityWarning("[Entity Pool] Pool \'%s\' has reached its max size and a new entity was requested. The new entity was not created!", m_sName.c_str());
		}

		outIsActive = false;
	}

	return pPoolEntity;
}
开发者ID:joewan,项目名称:pycmake,代码行数:54,代码来源:EntityPool.cpp

示例13: switch

/* static */
const char* CGameBrowser::GetGameModeStringFromId(int32 id)
{
	char *strGameMode = NULL;
	switch(id)
	{
#ifdef GAME_IS_CRYSIS2
	case RICHPRESENCE_GAMEMODES_INSTANTACTION:
		strGameMode = "@ui_rules_InstantAction";
		break;

	case RICHPRESENCE_GAMEMODES_TEAMINSTANTACTION:
		strGameMode = "@ui_rules_TeamInstantAction";
		break;

	case RICHPRESENCE_GAMEMODES_ASSAULT:
		strGameMode = "@ui_rules_Assault";
		break;

	case RICHPRESENCE_GAMEMODES_CAPTURETHEFLAG:
		strGameMode = "@ui_rules_CaptureTheFlag";
		break;

	case RICHPRESENCE_GAMEMODES_EXTRACTION:
		strGameMode = "@ui_rules_Extraction";
		break;

	case RICHPRESENCE_GAMEMODES_CRASHSITE:
		strGameMode = "@ui_rules_CrashSite";
		break;

	case RICHPRESENCE_GAMEMODES_ALLORNOTHING:
		strGameMode = "@ui_rules_AllOrNothing";
		break;

	case RICHPRESENCE_GAMEMODES_BOMBTHEBASE:
		strGameMode = "@ui_rules_BombTheBase";
		break;

	case RICHPRESENCE_GAMEMODES_POWERSTRUGGLE:
		strGameMode = "@ui_rules_PowerStruggleLite";
		break;

	default:
		CRY_ASSERT_MESSAGE(false, "Failed to find game rules rich presence string");
		break;	
#else
	case 0: //fallthrough to prevent warning
	default:
		CRY_ASSERT_MESSAGE(false, "Failed to find game rules rich presence string");
		break;	
	}
#endif
	return strGameMode;
}
开发者ID:Aytunes,项目名称:Tanks,代码行数:55,代码来源:GameBrowser.cpp

示例14: CRY_ASSERT_MESSAGE

void CFireMode::InitFireMode( IWeapon* pWeapon, const SParentFireModeParams* pParams)
{
	CRY_ASSERT_MESSAGE(pParams, "Fire Mode Params NULL! Have you set up the weapon xml correctly?");
	CRY_ASSERT_MESSAGE(pParams->pBaseFireMode, "Fire Mode Base Params NULL!");

	m_pWeapon = static_cast<CWeapon *>(pWeapon);
	m_fireParams = pParams->pBaseFireMode;
	m_parentFireParams = pParams;

	ResetParams();
}
开发者ID:aronarts,项目名称:FireNET,代码行数:11,代码来源:FireMode.cpp

示例15: CRY_ASSERT_MESSAGE

//----------------------------------------------------------
void CSingleAllocTextBlock::Lock()
{
	CRY_ASSERT_MESSAGE(m_numBytesUsed == m_sizeNeeded, string().Format("Didn't fill entire block of reserved memory: allocated %d bytes, used %d", m_sizeNeeded, m_numBytesUsed));

#if MORE_SINGLE_ALLOC_TEXT_BLOCK_CHECKS
	CRY_ASSERT_MESSAGE(m_mem[m_sizeNeeded] == '@', "Memory overwrite");
#endif

	m_reuseDuplicatedStringsArray = NULL;
	m_reuseDuplicatedStringsArraySize = 0;
	m_reuseDuplicatedStringsNumUsed = 0;
}
开发者ID:aronarts,项目名称:FireNET,代码行数:13,代码来源:SingleAllocTextBlock.cpp


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