这篇教程C++ CRY_ASSERT函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CRY_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ CRY_ASSERT函数的具体用法?C++ CRY_ASSERT怎么用?C++ CRY_ASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CRY_ASSERT函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: GetEntityvoid 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,
示例2: CRY_ASSERTvoid 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,
示例3: CRY_ASSERTvoid 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,
示例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,
示例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,
示例6: CRY_ASSERTvoid 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,
示例7: CRY_ASSERTbool 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,
示例8: LOGBREAKvoid 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,
示例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,
示例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,
示例11: CryLogvoid 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,
示例12: AutoEnum_GetEnumValFromStringbool 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,
示例13: CryLogvoid 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,
示例14: CRY_ASSERTvoid 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,
示例15: GetEntityvoid 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,
示例16: switch// ----------------------------------------------------------------------------CExactPositioning::ETriggerState CExactPositioning::StatePreparing_HandleEvent( SStateMachineEvent& event ){ switch( event.type ) { case ESME_Enter: m_pExactPositioningTarget->preparing = true; CRY_ASSERT( !m_pExactPositioningTarget->activated ); // we're very close, start forcing the character to the right point // Adjust the positionWidth & positionDepth, replacing the prepareRadius by 0.1m in the calculation of positionWidth/Depth // so instead of going towards the big box of 3.1m width/depth, we now go to a small box of 0.1m width/depth? m_pExactPositioningTarget->positionWidth = 0.1f + m_actorTargetParams.startWidth; // NOTE: the positionWidth gets forced to 0.1f in SetTriggerState, should we do this too?? m_pExactPositioningTarget->positionDepth = 0.1f; // NOTE: the box size doesn't seem consistent with the positionWidth/positionDepth above. Just mimicking ExactPositioning here. Thankfully the values above are not used anywhere. *sigh* m_exactPositioningTrigger.ResetRadius( Vec3( m_pExactPositioningTarget->startWidth, 0.0f, 20.0f ), m_pExactPositioningTarget->orientationTolerance ); // note: for the orientationTolerance it would go back to the original request, which I don't store anymore, possibly because the animationTarget contained 0 tolerance until now. What does it mean????!!! break; case ESME_Update: if ( m_pPendingRequest.get() ) return eTS_Disabled; if ( m_pExactPositioningTarget->pAction->GetStatus() != IAction::None ) return eTS_Disabled; UpdateAnimationTrigger(); // NOTE: because Update() was already called in the ResetRadius during Enter, it will be called twice during one frame // [our first AnimationTrigger got reached, which is a box of 0.1m (sometimes +startWidth) around the adjusted trigger position] if ( m_exactPositioningTrigger.IsTriggered() ) return eTS_FinalPreparation; break; }; return m_state;}
开发者ID:aronarts,项目名称:FireNET,代码行数:40,
示例17: CRY_ASSERTbool CBoundingContainer::ShouldHide( const EntityId entityId, const IEntity* pEntity ){ CRY_ASSERT( pEntity != NULL ); // First check if is an item const IItem* pItem = g_pGame->GetIGameFramework()->GetIItemSystem()->GetItem( entityId ); if ( pItem != NULL) { return true; } // Try hardcoded entity types static IEntityClass* s_pInteractiveEntityClass = gEnv->pEntitySystem->GetClassRegistry()->FindClass("InteractiveEntity"); IEntityClass* pEntityClass = pEntity->GetClass(); if (pEntityClass != NULL && pEntityClass == s_pInteractiveEntityClass) { return true; } return false;}
开发者ID:eBunny,项目名称:EmberProject,代码行数:22,
示例18: CRY_ASSERTvoid CPlayerVisTable::RemoveNthEntity(const VisEntryIndex n){ CRY_ASSERT(m_numUsedVisTableEntries > 0); //NOTE: This does not have to be synched as the access will be on this thread. const VisEntryIndex swapIndex = m_numUsedVisTableEntries - 1; if(m_visTableEntries[n].flags & eVF_Pending) { RemovePendingDeferredLinetest(n); } if(m_visTableEntries[swapIndex].flags & eVF_Pending && n != swapIndex) { UpdatePendingDeferredLinetest(swapIndex, n); } m_visTableEntries[n] = m_visTableEntries[swapIndex]; m_visTableEntries[swapIndex].Reset(); m_numUsedVisTableEntries--;}
开发者ID:danielasun,项目名称:dbho-GameSDK,代码行数:22,
示例19: CRY_ASSERT//--------------------------------------------------------EntityId CMelee::GetNearestTarget(){ CActor* pOwnerActor = m_pWeapon->GetOwnerActor(); if(pOwnerActor == NULL || (gEnv->bMultiplayer && m_slideKick)) return 0; CRY_ASSERT(pOwnerActor->IsClient()); IMovementController* pMovementController = pOwnerActor->GetMovementController(); if (!pMovementController) return 0; SMovementState moveState; pMovementController->GetMovementState(moveState); const Vec3 playerDir = moveState.aimDirection; const Vec3 playerPos = moveState.eyePosition; const float range = g_pGameCVars->pl_melee.melee_snap_target_select_range; const float angleLimit = cos_tpl(DEG2RAD(g_pGameCVars->pl_melee.melee_snap_angle_limit)); return m_collisionHelper.GetBestAutoAimTargetForUser(pOwnerActor->GetEntityId(), playerPos, playerDir, range, angleLimit);}
开发者ID:Kufusonic,项目名称:Work-in-Progress-Sonic-Fangame,代码行数:23,
示例20: whilevoid CGameVolume_Water::AwakeAreaIfRequired( bool forceAwake ){ if (gEnv->IsEditing()) return; if ((m_segments[0].m_pWaterArea == NULL) || (m_awakeAreaWhenMoving == false)) return; const float thresholdSqr = (2.0f * 2.0f); const float movedDistanceSqr = (m_baseMatrix.GetTranslation() - m_lastAwakeCheckPosition).len2(); if ((forceAwake == false) && (movedDistanceSqr <= thresholdSqr)) return; m_lastAwakeCheckPosition = m_baseMatrix.GetTranslation(); WaterSegments::iterator iter = m_segments.begin(); WaterSegments::iterator end = m_segments.end(); while(iter != end) { CRY_ASSERT(iter->m_pWaterArea); pe_status_pos areaPos; iter->m_pWaterArea->GetStatus( &areaPos ); const Vec3 areaBoxCenter = areaPos.pos; IPhysicalEntity **pEntityList = NULL; const int numberOfEntities = gEnv->pPhysicalWorld->GetEntitiesInBox( areaBoxCenter + areaPos.BBox[0], areaBoxCenter + areaPos.BBox[1], pEntityList, ent_sleeping_rigid|ent_rigid ); pe_action_awake awake; awake.bAwake = true; for (int i = 0; i < numberOfEntities; ++i) { pEntityList[i]->Action( &awake ); } ++iter; }}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:39,
示例21: CRY_ASSERTfloat CCameraFlight::GetCourseLength() const{ if(m_fCourseLengthOverwrite > 0.0f) return m_fCourseLengthOverwrite; float fMoveDistance = 0.0f; Vec3 vTempPos = m_cameraCourse[0].m_vCamPos; CRY_ASSERT(!m_cameraCourse.empty()); std::vector<SCameraFlightPoint>::const_iterator iter = m_cameraCourse.begin(); // iterate to the second position ++iter; std::vector<SCameraFlightPoint>::const_iterator end = m_cameraCourse.end(); for(; iter != end; ++iter) { fMoveDistance += (iter->m_vCamPos - vTempPos).len(); vTempPos = iter->m_vCamPos; } return fMoveDistance;}
开发者ID:Arnm7890,项目名称:CryGame,代码行数:22,
示例22: CRY_ASSERT// Description://// Arguments://// Return://bool CPersonalRangeSignaling::Init( EntityId Id ){ CRY_ASSERT( m_bInit == false ); m_EntityId = Id; m_bInit = true; // Enabled state starts off matching proxy's state IAIActorProxy* pAIProxy = GetEntityAIProxy(m_EntityId); SetEnabled(pAIProxy && pAIProxy->IsEnabled()); if( GetActor() == NULL ) { m_bInit = false; } else { SetListener(true); } return( m_bInit );}
开发者ID:aronarts,项目名称:FireNET,代码行数:28,
示例23: CRY_ASSERT//--------------------------------------------------------------------------------------------------// Name: QueueMaterialEffect// Desc: Queues material effect and sets off a deferred linetest for later processing//--------------------------------------------------------------------------------------------------void CExplosionGameEffect::QueueMaterialEffect(SExplosionContainer &explosionContainer){ ExplosionInfo explosionInfo = explosionContainer.m_explosionInfo; // If an effect was already specified, don't use MFX if(explosionInfo.pParticleEffect) return; const int intersectionObjTypes = ent_all|ent_water; const unsigned int intersectionFlags = rwi_stop_at_pierceable|rwi_colltype_any; CRY_ASSERT(explosionContainer.m_mfxInfo.m_rayId == 0); if(explosionInfo.impact) { Vec3 explosionDir = explosionInfo.impact_velocity.normalized(); explosionContainer.m_mfxInfo.m_rayId = g_pGame->GetRayCaster().Queue( RayCastRequest::HighPriority, RayCastRequest(explosionInfo.pos-explosionDir*0.1f, explosionDir, intersectionObjTypes, intersectionFlags), functor(explosionContainer.m_mfxInfo, &SDeferredMfxExplosion::OnRayCastDataReceived)); } else { const Vec3 explosionDir(0.0f, 0.0f, -g_pGameCVars->g_explosion_materialFX_raycastLength); explosionContainer.m_mfxInfo.m_rayId = g_pGame->GetRayCaster().Queue( RayCastRequest::HighPriority, RayCastRequest(explosionInfo.pos, explosionDir, intersectionObjTypes, intersectionFlags), functor(explosionContainer.m_mfxInfo, &SDeferredMfxExplosion::OnRayCastDataReceived)); } explosionContainer.m_mfxInfo.m_state = eDeferredMfxExplosionState_Dispatched;}
开发者ID:amrhead,项目名称:eaascode,代码行数:42,
示例24: CRY_ASSERTvoid CBodyDestrutibilityInstance::ReplaceMaterial( IEntity& characterEntity, ICharacterInstance& characterInstance, IMaterial& replacementMaterial ){ IMaterial* pCurrentMaterial = characterInstance.GetIMaterial(); if ((pCurrentMaterial != NULL) && stricmp(pCurrentMaterial->GetName(), replacementMaterial.GetName())) { characterEntity.SetSlotMaterial(0, &replacementMaterial); } const bool storeOriginalReplacementMaterials = m_originalMaterials.empty(); IAttachmentManager *pAttachmentManager = characterInstance.GetIAttachmentManager(); CRY_ASSERT(pAttachmentManager); const int attachmentCount = pAttachmentManager->GetAttachmentCount(); for (int attachmentIdx = 0; attachmentIdx < attachmentCount; ++attachmentIdx) { IAttachmentObject *pAttachmentObject = pAttachmentManager->GetInterfaceByIndex(attachmentIdx)->GetIAttachmentObject(); if (pAttachmentObject) { IMaterial* pAttachMaterial = (IMaterial*)pAttachmentObject->GetBaseMaterial(); if ((pAttachMaterial != NULL) && stricmp(pAttachMaterial->GetName(), replacementMaterial.GetName())) { if (storeOriginalReplacementMaterials) { IMaterial* pOriginalReplacementMaterial = pAttachmentObject->GetReplacementMaterial(); if(pOriginalReplacementMaterial != NULL) { pOriginalReplacementMaterial->AddRef(); m_originalMaterials.push_back(TAttachmentMaterialPair((uint32)attachmentIdx, pOriginalReplacementMaterial)); } } pAttachmentObject->SetReplacementMaterial(&replacementMaterial); } } }}
开发者ID:PiratesAhoy,项目名称:HeartsOfOak-Core,代码行数:38,
示例25: m_accelSHomingMissileParams::SHomingMissileParams( const XmlNodeRef& paramsNode ): m_accel(10.0f), m_turnSpeed(2.0f), m_maxSpeed(20.0f), m_cruiseAltitude(100.0f), m_alignAltitude(50.0f), m_descendDistance(50.0f), m_lazyness(0.35f), m_bTracksChaff (false), m_cruise(true), m_controlled(false), m_autoControlled(false), m_detonationRadius(0.0f), m_lockedTimer(0.2f), m_maxTargetDistance(200.0f), m_cruiseActivationTime(0.0f){ CRY_ASSERT(paramsNode != NULL); CGameXmlParamReader reader(paramsNode); reader.ReadParamValue<float>("cruise_altitude", m_cruiseAltitude); reader.ReadParamValue<float>("accel", m_accel); reader.ReadParamValue<float>("turn_speed", m_turnSpeed); reader.ReadParamValue<float>("max_speed", m_maxSpeed); reader.ReadParamValue<float>("align_altitude", m_alignAltitude); reader.ReadParamValue<float>("descend_distance", m_descendDistance); reader.ReadParamValue<float>("max_target_distance", m_maxTargetDistance); reader.ReadParamValue<bool>("cruise", m_cruise); reader.ReadParamValue<bool>("controlled", m_controlled); reader.ReadParamValue<bool>("autoControlled",m_autoControlled); reader.ReadParamValue<float>("lazyness",m_lazyness); reader.ReadParamValue<float>("initial_delay",m_lockedTimer); reader.ReadParamValue<float>("detonation_radius",m_detonationRadius); reader.ReadParamValue<bool>("tracks_chaff", m_bTracksChaff); reader.ReadParamValue<float>("cruiseActivationTime", m_cruiseActivationTime); m_launchEffect = reader.ReadParamValue("launch_effect");}
开发者ID:danielasun,项目名称:dbho-GameSDK,代码行数:38,
示例26: CRY_TODOvoid CGameAchievements::GiveAchievement(int achievement){ if(AllowAchievement()) { CPersistantStats::GetInstance()->OnGiveAchievement(achievement); ICryLobby* pLobby = gEnv->pNetwork->GetLobby(); IPlatformOS* pOS = gEnv->pSystem->GetPlatformOS(); if(pLobby != NULL && pOS != NULL) { ICryReward* pReward = pLobby->GetReward(); if(pReward) { unsigned int user = g_pGame->GetExclusiveControllerDeviceIndex(); if(user != IPlatformOS::Unknown_User) { uint32 achievementId = achievement + ACHIEVEMENT_STARTINDEX; //-- Award() only puts awards into a queue to be awarded. //-- This code here only asserts that the award was added to the queue successfully, not if the award was successfully unlocked. //-- Function has been modified for a CryLobbyTaskId, callback and callback args parameters, similar to most other lobby functions, //-- to allow for callback to trigger when the award is successfully unlocked (eCLE_Success) or failed to unlock (eCLE_InternalError). //-- In the case of trying to unlock an award that has already been unlocked, the callback will return eCLE_Success. //-- Successful return value of the Award function has been changed from incorrect eCRE_Awarded to more sensible eCRE_Queued. CRY_TODO(3,9,2010, "Register a callback to inform game when queued award is processed successfully or failed."); ECryRewardError error = pReward->Award(user, achievementId, NULL, NULL, NULL); CryLog("Award error %d", error); CRY_ASSERT(error == eCRE_Queued); } } } } else { CryLog("Not Awarding achievement - have been disabled"); }}
开发者ID:PiratesAhoy,项目名称:HeartsOfOak-Core,代码行数:38,
示例27: CRY_ASSERT///Getline wrapper to break on newlines as adapted from the old AI Code Coverage Managerint CCodeCheckpointDebugMgr::GetLine( char * pBuff, FILE * fp ){ CRY_ASSERT(pBuff && fp); /// Wraps fgets to remove newlines and use correct buffer/string lengths /// Must use CryPak FGets on CryPak files /// Will retrieve up to the next newline character in the file buffer. if (!gEnv->pCryPak->FGets( pBuff, BUFF_SIZE, fp )) return 0; /// Convert newlines to /0 and discover length int i=0; int nLimit = LABEL_LENGTH + 1; for (; i < nLimit ; i++) { char c = pBuff[i]; if (c == '/n' || c == '/r' || c== '/0') break; } /// If i == LABEL_LENGTH, the string was of maximum length /// If i == LABEL_LENGTH + 1, the string was too long if (i == nLimit) { // Malformed - fail pBuff[--i] = '/0'; return 0; } /// Overwrite the last character (usually line terminator) with string delimiter pBuff[i] = '/0'; if ( i == 0 ) return 0; return i+1;}
开发者ID:PiratesAhoy,项目名称:HeartsOfOak-Core,代码行数:39,
注:本文中的CRY_ASSERT函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ CRY_ASSERT_MESSAGE函数代码示例 C++ CRYPT_MOD_CALL_CHECK函数代码示例 |