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


C++ CRY_ASSERT函数代码示例

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


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

示例1: GetEntity

void CBoundingContainer::SetupEntity()
{
	IEntity* pEntity = GetEntity();
	CRY_ASSERT(pEntity != NULL);

	IScriptTable* pScriptTable = pEntity->GetScriptTable();
	if (pScriptTable != NULL)
	{
		SmartScriptTable propertiesTable;
		if (pScriptTable->GetValue("Properties", propertiesTable))
		{
			Vec3 boundingDimensions(0.0f,0.0f,0.0f);
			propertiesTable->GetValue("DimX", boundingDimensions.x);
			propertiesTable->GetValue("DimY", boundingDimensions.y);
			propertiesTable->GetValue("DimZ", boundingDimensions.z);

			m_vBoundingMin = -boundingDimensions/2.0f;
			m_vBoundingMax = boundingDimensions/2.0f;
		}
	}
}
开发者ID:eBunny,项目名称:EmberProject,代码行数:21,代码来源:BoundingContainer.cpp

示例2: CRY_ASSERT

void CBodyDestrutibilityInstance::ResetMaterials( IEntity& characterEntity, ICharacterInstance& characterInstance )
{
	characterEntity.SetSlotMaterial(0, NULL);

	IAttachmentManager *pAttachmentManager = characterInstance.GetIAttachmentManager();
	CRY_ASSERT(pAttachmentManager);
	
	const uint32 attachmentCount = (uint32)pAttachmentManager->GetAttachmentCount();

	for(TOriginalMaterials::iterator it = m_originalMaterials.begin(); it != m_originalMaterials.end(); ++it)
	{
		IAttachmentObject *pAttachmentObject = (it->first < attachmentCount) ? pAttachmentManager->GetInterfaceByIndex(it->first)->GetIAttachmentObject() : NULL;
		if (pAttachmentObject)
		{
			pAttachmentObject->SetReplacementMaterial(it->second);
			it->second->Release();
		}
	}

	m_originalMaterials.clear();
}
开发者ID:Xydrel,项目名称:Infected,代码行数:21,代码来源:BodyDefinitions.cpp

示例3: CRY_ASSERT

void CLedgeManagerEdit::EnableLedge( const EntityId entityId, bool enable )
{
	TLedgeObjectsEditorContainer::iterator ledgeIt = std::find(m_ledgeObjects.begin(), m_ledgeObjects.end(), entityId);

	if (ledgeIt != m_ledgeObjects.end())
	{
		SLedgeObjectEditor& ledgeObject = *ledgeIt;
		CRY_ASSERT( (ledgeObject.m_ledgeFlags[LedgeSide_In] & kLedgeFlag_static) == 0 );

		if (enable)
		{
			ledgeObject.m_ledgeFlags[LedgeSide_In] |= kLedgeFlag_enabled;
			ledgeObject.m_ledgeFlags[LedgeSide_Out] |= kLedgeFlag_enabled;
		}
		else
		{
			ledgeObject.m_ledgeFlags[LedgeSide_In] &= ~kLedgeFlag_enabled;
			ledgeObject.m_ledgeFlags[LedgeSide_Out] &= ~kLedgeFlag_enabled;
		}
	}
}
开发者ID:danielasun,项目名称:dbho-GameSDK,代码行数:21,代码来源:LedgeManager.cpp

示例4: CRY_ASSERT

//------------------------------------------------------------------------
void CGameRules::HostMigrationRemoveDuplicateDynamicEntities()
{
	CRY_ASSERT(!m_hostMigrationCachedEntities.empty());

	TEntityIdVec dynamicEntities;
	HostMigrationFindDynamicEntities(dynamicEntities);

	CryLog("CGameRules::HostMigrationRemoveDuplicateDynamicEntities(), found %i entities, already know about %i", (uint32)dynamicEntities.size(), (uint32)m_hostMigrationCachedEntities.size());
	// Any entities in the dynamicEntities vector that aren't in the m_hostMigrationCachedEntities vector have been added during a previous migration attempt, need to remove them now
	// Note: entities in the m_hostMigrationCachedEntities vector are removed in OnFinalise
	const int numEntities = dynamicEntities.size();
	for (int i = 0; i < numEntities; ++ i)
	{
		EntityId entityId = dynamicEntities[i];
	
		if (!stl::find(m_hostMigrationCachedEntities, entityId))
		{
			gEnv->pEntitySystem->RemoveEntity(entityId, true);
		}
	}
}
开发者ID:MrHankey,项目名称:Tanks,代码行数:22,代码来源:GameRulesHostMigration.cpp

示例5: CCoherentHUDViewListener

    CCoherentViewListener* CCoherentUISystem::CreateHUDView( std::wstring path )
    {
        m_HudViewListener.reset( new CCoherentHUDViewListener() );

        CRY_ASSERT( m_pUISystem );

        Coherent::UI::ViewInfo info;
        info.Width = gEnv->pRenderer->GetWidth();
        info.Height = gEnv->pRenderer->GetHeight();
        info.UsesSharedMemory = true;
        info.IsTransparent = true;
        info.SupportClickThrough = true;

        if ( m_HudViewListener->GetView() == nullptr )
        {
            m_pUISystem->CreateView( info, path.c_str(), m_HudViewListener.get() );
        }

        m_PlayerEventListener.get()->AddViewListener( m_HudViewListener.get() );
        return m_HudViewListener.get();
    }
开发者ID:iherwig,项目名称:Plugin_CoherentUI,代码行数:21,代码来源:CoherentUISystem.cpp

示例6: CRY_ASSERT

void CCinematicInput::ReEnablePlayerAfterCutscenes()
{
	CActor* pClientActor = static_cast<CActor*>(g_pGame->GetIGameFramework()->GetClientActor());
	if (pClientActor)
	{
		CRY_ASSERT(pClientActor->GetActorClass() == CPlayer::GetActorClassType());
		CPlayer* pClientPlayer = static_cast<CPlayer*>(pClientActor);

		if (m_bMutedAudioForCutscene)
		{
			uint32 playerFlags = pClientPlayer->GetEntity()->GetFlagsExtended();
			pClientPlayer->GetEntity()->SetFlagsExtended(playerFlags & ~ENTITY_FLAG_EXTENDED_AUDIO_DISABLED);
		}

		pClientPlayer->StateMachineHandleEventMovement( SStateEventCutScene( false ) );
	}

	g_pGameActions->FilterCutsceneNoPlayer()->Enable(false);

	g_pGame->GetIGameFramework()->GetIActionMapManager()->EnableActionMap( "player_cine" , false );
}
开发者ID:amrhead,项目名称:eaascode,代码行数:21,代码来源:CinematicInput.cpp

示例7: CRY_ASSERT

bool CFlowGraphDebugger::HasBreakpoint(IFlowGraphPtr pFlowGraph, const SFlowAddress& addr) const
{
	CRY_ASSERT(NULL != pFlowGraph);

	if (!pFlowGraph)
		return false;

	const SBreakPointPortInfo* breakpointInfo = GetBreakpointInfo(pFlowGraph, addr);

	if (breakpointInfo)
	{
		return true;
	}
	else
	{
		// no breakpoints at all for this flownode
		return false;
	}

	return false;
}
开发者ID:aronarts,项目名称:FireNET,代码行数:21,代码来源:FlowGraphDebugger.cpp

示例8: LOGBREAK

void SDeclareExplosiveObjectState::SerializeWith( TSerialize ser )
{
	LOGBREAK("SDeclareExplosiveObjectState: %s", ser.IsReading() ? "Reading:" : "Writing");

	ser.Value("breakId", breakId, 'brId');
	ser.Value("isEnt", isEnt);
	if (isEnt)
	{
		if (ser.IsWriting())
			CRY_ASSERT(CCryAction::GetCryAction()->GetGameContext()->GetNetContext()->IsBound(entId));
		ser.Value("entid", entId, 'eid');
		ser.Value("entpos", entPos);
		ser.Value("entrot", entRot);
		ser.Value("entscale", entScale);
	}
	else
	{
		ser.Value("eventPos", eventPos);
		ser.Value("hash", hash);
	}
}
开发者ID:joewan,项目名称:pycmake,代码行数:21,代码来源:ExplosiveObjectState.cpp

示例9: GetAmmoCapacity

//------------------------------------------------------------------------
void CInventory::SetAmmoCount(IEntityClass* pAmmoType, int count)
{
	int capacity = GetAmmoCapacity(pAmmoType);
	CRY_ASSERT(pAmmoType);
	if (pAmmoType)
	{
		if (capacity > 0)
			m_stats.ammoInfo[pAmmoType].SetCount(min(count, capacity));
		else
			m_stats.ammoInfo[pAmmoType].SetCount(count);
	}

	TListenerVec::iterator iter = m_listeners.begin();
	m_iteratingListeners = true;
	while (iter != m_listeners.end())
	{
		(*iter)->OnSetAmmoCount(pAmmoType, count);
		++iter;
	}
	m_iteratingListeners = false;
}
开发者ID:joewan,项目名称:pycmake,代码行数:22,代码来源:Inventory.cpp

示例10: CRY_ASSERT

	ILightSource* CEffectsController::GetLightSource(const TAttachedEffectId effectId) const
	{
		CRY_ASSERT(m_pOwnerEntity);

		TAttachedEffects::const_iterator effectCit = std::find(m_attachedEffects.begin(), m_attachedEffects.end(), effectId);

		if (effectCit != m_attachedEffects.end()) 
		{
			const SEffectInfo &effectInfo = *effectCit;

			if (effectInfo.entityEffectSlot >= 0)
			{
				SEntitySlotInfo slotInfo;
				if(m_pOwnerEntity->GetSlotInfo(effectInfo.entityEffectSlot, slotInfo) && slotInfo.pLight)
				{
					return slotInfo.pLight;
				}
			}

			if (effectInfo.characterEffectSlot >= 0)
			{
				SEntitySlotInfo slotInfo;
				if (m_pOwnerEntity->GetSlotInfo(effectInfo.characterEffectSlot, slotInfo) && slotInfo.pCharacter)
				{
					IAttachmentManager *pAttachmentManager = slotInfo.pCharacter->GetIAttachmentManager();
					IAttachment *pAttachment = pAttachmentManager->GetInterfaceByName(effectInfo.helperName.c_str());
					if (pAttachment)
					{
						IAttachmentObject *pAttachmentObject = pAttachment->GetIAttachmentObject();
						if (pAttachmentObject != NULL && (pAttachmentObject->GetAttachmentType() == IAttachmentObject::eAttachment_Light))
						{
							return static_cast<CLightAttachment *>(pAttachmentObject)->GetLightSource();
						}
					}
				}
			}
		}

		return NULL;
	}
开发者ID:PiratesAhoy,项目名称:HeartsOfOak-Core,代码行数:40,代码来源:EntityEffects.cpp

示例11: CryLog

void CGameLobbyManager::EthernetStateCallback(UCryLobbyEventData eventData, void *arg)
{
	if(eventData.pEthernetStateData)
	{
		CryLog("[GameLobbyManager] EthernetStateCallback state %d", eventData.pEthernetStateData->m_curState);

		CGameLobbyManager *pGameLobbyManager = (CGameLobbyManager*)arg;
		CRY_ASSERT(pGameLobbyManager);

		if(g_pGame->HasExclusiveControllerIndex())
		{
			ECableState newState = eventData.pEthernetStateData->m_curState;







			// cable has been removed, clear dialog
			if ((newState == eCS_Unplugged) || (newState == eCS_Disconnected))
			{
				CErrorHandling *pErrorHandling = CErrorHandling::GetInstance();
				if (pErrorHandling)
				{
					pErrorHandling->OnFatalError(CErrorHandling::eFE_EthernetCablePulled);
				}







			}
		}

		pGameLobbyManager->m_isCableConnected = (eventData.pEthernetStateData->m_curState == eCS_Connected) ? true : false;
	}
}
开发者ID:PiratesAhoy,项目名称:HeartsOfOak-Core,代码行数:40,代码来源:GameLobbyManager.cpp

示例12: AutoEnum_GetEnumValFromString

bool AutoEnum_GetEnumValFromString(const char *inString, const char **inArray, int arraySize, int *outVal)
{
	bool  done = false;

	if(inString && (inString[0] != '\0'))   // avoid a load of work if the string's NULL or empty
	{
		CRY_ASSERT(arraySize > 0);

		char  skipThisString[32];
		size_t  skipChars = cry_copyStringUntilFindChar(skipThisString, inArray[0], sizeof(skipThisString), '_');

#if DO_PARSE_BITFIELD_STRING_LOGS
		CryLog("AutoEnum_GetEnumValFromString: Parsing '%s' (skipping first %d chars '%s%s' of each string in array)", inString, skipChars, skipThisString, skipChars ? "_" : "");
#endif

		for(int i=0; i<arraySize; i++)
		{
#if DO_PARSE_BITFIELD_STRING_LOGS
			CryLog("AutoEnum_GetEnumValFromString: Searching... Enum val %d = '%s'", i, (inArray[i] + skipChars));
#endif

			if(0 == stricmp((inArray[i] + skipChars), inString))
			{
#if DO_PARSE_BITFIELD_STRING_LOGS
				CryLog("AutoEnum_GetEnumValFromString: Flag '%s' found in enum list as value %d", inString, i);
#endif

				if(outVal)
					(*outVal) = i;

				done = true;
				break;
			}
		}

		CRY_ASSERT_MESSAGE(done, string().Format("No flag called '%s' in enum list", inString));
	}

	return done;
}
开发者ID:super-nova,项目名称:NovaRepo,代码行数:40,代码来源:AutoEnum.cpp

示例13: CryLog

void CGameLobbyManager::EthernetStateCallback(UCryLobbyEventData eventData, void *arg)
{
	if(eventData.pEthernetStateData)
	{
		CryLog("[GameLobbyManager] EthernetStateCallback state %d", eventData.pEthernetStateData->m_curState);

		CGameLobbyManager *pGameLobbyManager = (CGameLobbyManager*)arg;
		CRY_ASSERT(pGameLobbyManager);

		if(g_pGame->HasExclusiveControllerIndex())
		{
			ECableState newState = eventData.pEthernetStateData->m_curState;
#if 0 // old frontend
			if(pMPMenuHub)
			{
				pMPMenuHub->EthernetStateChanged(newState);
			}
#endif

			// cable has been removed, clear dialog
			if ((newState == eCS_Unplugged) || (newState == eCS_Disconnected))
			{
				CErrorHandling *pErrorHandling = CErrorHandling::GetInstance();
				if (pErrorHandling)
				{
					pErrorHandling->OnFatalError(CErrorHandling::eFE_EthernetCablePulled);
				}
#if 0 // old frontend
				CWarningsManager *pWM = g_pGame->GetWarnings();
				if(pWM)
				{
					pWM->RemoveWarning("ChatRestricted");
				}
#endif
			}
		}

		pGameLobbyManager->m_isCableConnected = (eventData.pEthernetStateData->m_curState == eCS_Connected) ? true : false;
	}
}
开发者ID:danielasun,项目名称:dbho-GameSDK,代码行数:40,代码来源:GameLobbyManager.cpp

示例14: CRY_ASSERT

void CWeaponStats::SetStatsFromFiremode(const SWeaponStatsData *pStats)
{
	const int numStats = eWeaponStat_NumStats;

	if (!pStats) // Valid, notifies clear
	{
		for (int i = 0; i < numStats; i++)
		{
			m_weaponStats[i].firemodeModifier = 0;
		}
	}
	else
	{
		CRY_ASSERT(m_weaponStats.size() == pStats->stats.size() && m_weaponStats.size() == eWeaponStat_NumStats);
		for (int i = 0; i < numStats; i++)
		{
			m_weaponStats[i].firemodeModifier = pStats->stats[i];
		}
	}

	UpdateTotalValue();
}
开发者ID:PiratesAhoy,项目名称:HeartsOfOak-Core,代码行数:22,代码来源:WeaponStats.cpp

示例15: GetEntity

void CAnimatedCharacter::SetBlendWeightParam(const EMotionParamID motionParamID, const float value, const uint8 targetFlags/* = eBWPT_All*/)
{
	if (motionParamID >= eMotionParamID_BlendWeight && motionParamID <= eMotionParamID_BlendWeight_Last)
	{ //only allowed on the generic blend weights params

		IEntity* pEntity = GetEntity();
		CRY_ASSERT(pEntity);

		if (targetFlags & eBWPT_FirstPersonSkeleton)
		{
			if (ICharacterInstance* pCharacterInstance = pEntity->GetCharacter(0))
			{
				if (ISkeletonAnim* pSkeletonAnim = pCharacterInstance->GetISkeletonAnim())
				{
					pSkeletonAnim->SetDesiredMotionParam(motionParamID, value, 0.0f);
				}
			}
		}

		if (targetFlags & eBWPT_ShadowSkeleton)
		{
			if (m_hasShadowCharacter)
			{
				if (ICharacterInstance* pShadowCharacter = pEntity->GetCharacter(m_shadowCharacterSlot))
				{
					if (ISkeletonAnim* pShadowSkeletonAnim = pShadowCharacter->GetISkeletonAnim())
					{
						pShadowSkeletonAnim->SetDesiredMotionParam(motionParamID, value, 0.0f);
					}
				}
			}
		}

	} 
	else
	{
		CryLogAlways("[CryAnimation] ERROR: motionParam that was sent: %d is not within allowed range of blendweights %d to %d", motionParamID, eMotionParamID_BlendWeight, eMotionParamID_BlendWeight_Last);
	}
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:39,代码来源:AnimatedCharacterPPS_ParamCalculation.cpp


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