这篇教程C++ DevWarning函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中DevWarning函数的典型用法代码示例。如果您正苦于以下问题:C++ DevWarning函数的具体用法?C++ DevWarning怎么用?C++ DevWarning使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了DevWarning函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: GetOuterbool CAI_BehaviorBase::NotifyChangeBehaviorStatus( bool fCanFinishSchedule ){ bool fInterrupt = GetOuter()->OnBehaviorChangeStatus( this, fCanFinishSchedule ); if ( !GetOuter()->IsInterruptable()) return false; if ( fInterrupt ) { if ( GetOuter()->m_hCine ) { if( GetOuter()->m_hCine->PlayedSequence() ) { DevWarning( "NPC: %s canceled running script %s due to behavior change/n", GetOuter()->GetDebugName(), GetOuter()->m_hCine->GetDebugName() ); } else { DevWarning( "NPC: %s canceled script %s without playing, due to behavior change/n", GetOuter()->GetDebugName(), GetOuter()->m_hCine->GetDebugName() ); } GetOuter()->m_hCine->CancelScript(); } //!!!HACKHACK // this is dirty, but it forces NPC to pick a new schedule next time through. GetOuter()->ClearSchedule( "Changed behavior status" ); } return fInterrupt;}
开发者ID:Adidasman1,项目名称:source-sdk-2013,代码行数:30,
示例2: DevWarningint CAI_TacticalServices::FindBackAwayNode(const Vector &vecThreat ){ if ( !CAI_NetworkManager::NetworksLoaded() ) { DevWarning( 2, "Graph not ready for FindBackAwayNode!/n" ); return NO_NODE; } int iMyNode = GetPathfinder()->NearestNodeToNPC(); int iThreatNode = GetPathfinder()->NearestNodeToPoint( vecThreat ); if ( iMyNode == NO_NODE ) { DevWarning( 2, "FindBackAwayNode() - %s has no nearest node!/n", GetEntClassname()); return NO_NODE; } if ( iThreatNode == NO_NODE ) { // DevWarning( 2, "FindBackAwayNode() - Threat has no nearest node!/n" ); iThreatNode = iMyNode; // return false; } // A vector pointing to the threat. Vector vecToThreat; vecToThreat = vecThreat - GetLocalOrigin(); // Get my current distance from the threat float flCurDist = VectorNormalize( vecToThreat ); // Check my neighbors to find a node that's further away for (int link = 0; link < GetNetwork()->GetNode(iMyNode)->NumLinks(); link++) { CAI_Link *nodeLink = GetNetwork()->GetNode(iMyNode)->GetLinkByIndex(link); if ( !m_pPathfinder->IsLinkUsable( nodeLink, iMyNode ) ) continue; int destID = nodeLink->DestNodeID(iMyNode); float flTestDist = ( vecThreat - GetNetwork()->GetNode(destID)->GetPosition(GetHullType()) ).Length(); if ( flTestDist > flCurDist ) { // Make sure this node doesn't take me past the enemy's position. Vector vecToNode; vecToNode = GetNetwork()->GetNode(destID)->GetPosition(GetHullType()) - GetLocalOrigin(); VectorNormalize( vecToNode ); if( DotProduct( vecToNode, vecToThreat ) < 0.0 ) { return destID; } } } return NO_NODE;}
开发者ID:Au-heppa,项目名称:source-sdk-2013,代码行数:57,
示例3: DevWarning//-----------------------------------------------------------------------------// Purpose: //-----------------------------------------------------------------------------void CAI_Relationship::Spawn(){ m_bIsActive = false; if (m_iszSubject == NULL_STRING) { DevWarning("ai_relationship '%s' with no subject specified, removing./n", GetDebugName()); UTIL_Remove(this); } else if (m_target == NULL_STRING) { DevWarning("ai_relationship '%s' with no target specified, removing./n", GetDebugName()); UTIL_Remove(this); }}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:18,
示例4: DevWarning void CTriggerTeleportEnt::StartTouch(CBaseEntity *pOther){ if (pOther) { BaseClass::StartTouch(pOther); if (!pDestinationEnt) { if (m_target != NULL_STRING) pDestinationEnt = gEntList.FindEntityByName(NULL, m_target, NULL, pOther, pOther); else { DevWarning("CTriggerTeleport cannot teleport, pDestinationEnt and m_target are null!/n"); return; } } if (!PassesTriggerFilters(pOther)) return; if (pDestinationEnt)//ensuring not null { Vector tmp = pDestinationEnt->GetAbsOrigin(); // make origin adjustments. (origin in center, not at feet) tmp.z -= pOther->WorldAlignMins().z; pOther->Teleport(&tmp, m_bResetAngles ? &pDestinationEnt->GetAbsAngles() : NULL, m_bResetVelocity ? &vec3_origin : NULL); AfterTeleport(); } }}
开发者ID:Yosam02,项目名称:game,代码行数:30,
示例5: switchvoid CTriggerMomentumPush::OnSuccessfulTouch(CBaseEntity *pOther){ if (pOther) { Vector finalVel; if (HasSpawnFlags(SF_PUSH_DIRECTION_AS_FINAL_FORCE)) finalVel = m_vPushDir; else finalVel = m_vPushDir.Normalized() * m_fPushForce; switch (m_iIncrease) { case 0: break; case 1: finalVel += pOther->GetAbsVelocity(); break; case 2: if (finalVel.LengthSqr() < pOther->GetAbsVelocity().LengthSqr()) finalVel = pOther->GetAbsVelocity(); break; case 3: pOther->SetBaseVelocity(finalVel); break; default: DevWarning("CTriggerMomentumPush:: %i not recognised as valid for m_iIncrease", m_iIncrease); break; } pOther->SetAbsVelocity(finalVel); }}
开发者ID:Yosam02,项目名称:game,代码行数:31,
示例6: Templates_Add//-----------------------------------------------------------------------------// Purpose: Saves the given entity's keyvalue data for later use by a spawner.// Returns the index into the templates.//-----------------------------------------------------------------------------int Templates_Add(CBaseEntity *pEntity, const char *pszMapData, int nLen){ const char *pszName = STRING(pEntity->GetEntityName()); if ((!pszName) || (!strlen(pszName))) { DevWarning(1, "RegisterTemplateEntity: template entity with no name, class %s/n", pEntity->GetClassname()); return -1; } TemplateEntityData_t *pEntData = (TemplateEntityData_t *)malloc(sizeof(TemplateEntityData_t)); pEntData->pszName = strdup( pszName ); // We may modify the values of the keys in this mapdata chunk later on to fix Entity I/O // connections. For this reason, we need to ensure we have enough memory to do that. int iKeys = MapEntity_GetNumKeysInEntity( pszMapData ); int iExtraSpace = (strlen(ENTITYIO_FIXUP_STRING)+1) * iKeys; // Extra 1 because the mapdata passed in isn't null terminated pEntData->iMapDataLength = nLen + iExtraSpace + 1; pEntData->pszMapData = (char *)malloc( pEntData->iMapDataLength ); memcpy(pEntData->pszMapData, pszMapData, nLen + 1); pEntData->pszMapData[nLen] = '/0'; // We don't alloc these suckers right now because that gives us no time to // tweak them for Entity I/O purposes. pEntData->iszMapData = NULL_STRING; pEntData->bNeedsEntityIOFixup = false; pEntData->pszFixedMapData = NULL; return g_Templates.AddToTail(pEntData);}
开发者ID:SizzlingStats,项目名称:hl2sdk-ob-valve,代码行数:35,
示例7: UTIL_RemoveImmediate//=========================================================// Verifica las condiciones y devuelve si es// conveniente/posible crear un NPC en las coordenadas.//=========================================================bool CSurvivalZombieSpawn::CanMakeNPC(CAI_BaseNPC *pNPC, Vector *pResult){ // Desactivado if ( Disabled || !sv_spawn_zombies.GetBool() ) { UTIL_RemoveImmediate(pNPC); return false; } Vector origin; // Verificamos si es posible crear el NPC en el radio especificado. if ( !CAI_BaseNPC::FindSpotForNPCInRadius(&origin, GetAbsOrigin(), pNPC, SpawnRadius, true) ) { if ( !CAI_BaseNPC::FindSpotForNPCInRadius(&origin, GetAbsOrigin(), pNPC, SpawnRadius, false) ) { DevWarning("[SURVIVAL ZOMBIE MAKER] No se encontro un lugar valido para crear un zombie. /r/n"); UTIL_RemoveImmediate(pNPC); return false; } } // Crear en la misma altura que el spawn (Y así evitamos que se cree por debajo del suelo) origin.z = GetAbsOrigin().z; *pResult = origin; return true;}
开发者ID:InfoSmart,项目名称:InSource-Singleplayer,代码行数:33,
示例8: Assert//-----------------------------------------------------------------------------// Purpose: Add effect to effects list// Input : *effect - //-----------------------------------------------------------------------------void CEffectsList::AddEffect( CClientSideEffect *effect ){#if 0 if ( FXCreationAllowed() == false ) { //NOTENOTE: If you've hit this, you may not add a client effect where you have attempted to. // Most often this means that you have added it in an entity's DrawModel function. // Move this to the ClientThink function instead! Assert(0); return; }#endif if ( effect == NULL ) return; if ( m_nEffects >= MAX_EFFECTS ) { DevWarning( 1, "No room for effect %s/n", effect->GetName() ); return; } m_rgEffects[ m_nEffects++ ] = effect;}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:29,
示例9: DevWarning//-----------------------------------------------------------------------------// Purpose://-----------------------------------------------------------------------------void CMaterialSubRect::SetupMaterialVars( void ){ if ( !m_pMaterialPage ) { DevWarning( 1, "CMaterialSubRect::SetupMaterialVars: Invalid Material Page!/n" ); return; } // Ask the material page for its size. int nMaterialPageWidth = m_pMaterialPage->GetMappingWidth(); int nMaterialPageHeight = m_pMaterialPage->GetMappingHeight(); // Normalize the offset and scale. float flOOWidth = 1.0f / static_cast<float>( nMaterialPageWidth ); float flOOHeight = 1.0f / static_cast<float>( nMaterialPageHeight ); // Add 0.5f to push the image "in" by 1/2 a texel, and subtract 1.0f to push it // "in" by 1/2 a texel on the other side. m_vecOffset.x += 1.0f; m_vecOffset.y += 1.0f; m_vecOffset.x *= flOOWidth; m_vecOffset.y *= flOOHeight; m_vecScale.x = ( m_vecSize.x - 2.0f ) * flOOWidth; m_vecScale.y = ( m_vecSize.y - 2.0f ) * flOOHeight;}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:28,
示例10: GetEntInfoPtr//-----------------------------------------------------------------------------// Purpose: Used to iterate all the entities within a sphere.// Input : pStartEntity - // vecCenter - // flRadius - //-----------------------------------------------------------------------------CBaseEntity *CGlobalEntityList::FindEntityInSphere( CBaseEntity *pStartEntity, const Vector &vecCenter, float flRadius ){ const CEntInfo *pInfo = pStartEntity ? GetEntInfoPtr( pStartEntity->GetRefEHandle() )->m_pNext : FirstEntInfo(); for ( ;pInfo; pInfo = pInfo->m_pNext ) { CBaseEntity *ent = (CBaseEntity *)pInfo->m_pEntity; if ( !ent ) { DevWarning( "NULL entity in global entity list!/n" ); continue; } if ( !ent->edict() ) continue; Vector vecRelativeCenter; ent->CollisionProp()->WorldToCollisionSpace( vecCenter, &vecRelativeCenter ); if ( !IsBoxIntersectingSphere( ent->CollisionProp()->OBBMins(), ent->CollisionProp()->OBBMaxs(), vecRelativeCenter, flRadius ) ) continue; return ent; } // nothing found return NULL; }
开发者ID:Au-heppa,项目名称:source-sdk-2013,代码行数:33,
示例11: Q_strncpyvoid CScriptParser::SearchForFiles( const char *szWildcardPath ){ char filePath[FILE_PATH_MAX_LENGTH]; char basePath[FILE_PATH_MAX_LENGTH]; Q_strncpy( basePath, szWildcardPath, FILE_PATH_MAX_LENGTH ); V_StripFilename( basePath ); FileFindHandle_t findHandle; const char *fileName = filesystem->FindFirstEx( szWildcardPath, GetFSSearchPath(), &findHandle ); while ( fileName != NULL ) { Q_ComposeFileName( basePath, fileName, filePath, FILE_PATH_MAX_LENGTH ); if( !ParseFile( filePath ) ) { if ( m_bAlert ) DevWarning( "[script_parser] Unable to parse '%s'!/n", filePath ); } fileName = filesystem->FindNext( findHandle ); } filesystem->FindClose( findHandle );}
开发者ID:Entropy-Soldier,项目名称:ges-legacy-code,代码行数:25,
示例12: Uncache//-----------------------------------------------------------------------------// Purpose: Deconstructor//-----------------------------------------------------------------------------CMaterialSubRect::~CMaterialSubRect(){ Uncache( ); if( m_nRefCount != 0 ) { DevWarning( 1, "Reference Count for Material %s (%d) != 0/n", GetName(), m_nRefCount ); } if ( m_pMaterialPage ) { m_pMaterialPage->DecrementReferenceCount(); m_pMaterialPage = NULL; } if ( m_pVMTKeyValues ) { m_pVMTKeyValues->deleteThis(); m_pVMTKeyValues = NULL; } m_aMaterialVars.Purge();#ifdef _DEBUG if ( m_pDebugName ) { delete[] m_pDebugName; m_pDebugName = NULL; }#endif}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:33,
示例13: GetAbsOrigin//------------------------------------------------------------------------------// Purpose : Updates network link state if dynamic link state has changed// Input :// Output ://------------------------------------------------------------------------------void CAI_DynamicLink::SetLinkState(void){ if ( !gm_bInitialized ) { // Safe to quietly return. Consistency will be enforced when InitDynamicLinks() is called return; } if (m_nSrcID == NO_NODE || m_nDestID == NO_NODE) { Vector pos = GetAbsOrigin(); DevWarning("ERROR: Dynamic link at %f %f %f pointing to invalid node ID!!/n", pos.x, pos.y, pos.z); return; } // ------------------------------------------------------------------ // Now update the node links... // Nodes share links so we only have to find the node from the src // For now just using one big AINetwork so find src node on that network // ------------------------------------------------------------------ CAI_Node *pSrcNode = g_pBigAINet->GetNode( m_nSrcID, false ); if ( !pSrcNode ) return; CAI_Link* pLink = FindLink(); if ( !pLink ) { DevMsg("Dynamic Link Error: (%s) unable to form between nodes %d and %d/n", GetDebugName(), m_nSrcID, m_nDestID ); return; } pLink->m_pDynamicLink = this; if (m_nLinkState == LINK_OFF) { pLink->m_LinkInfo |= bits_LINK_OFF; } else { pLink->m_LinkInfo &= ~bits_LINK_OFF; } if ( m_bPreciseMovement ) { pLink->m_LinkInfo |= bits_LINK_PRECISE_MOVEMENT; } else { pLink->m_LinkInfo &= ~bits_LINK_PRECISE_MOVEMENT; } if ( m_nPriority == 0 ) { pLink->m_LinkInfo &= ~bits_PREFER_AVOID; } else { pLink->m_LinkInfo |= bits_PREFER_AVOID; }}
开发者ID:BenLubar,项目名称:riflemod,代码行数:64,
示例14: Find//-----------------------------------------------------------------------------// Purpose: Returns last known posiiton of given enemy//-----------------------------------------------------------------------------const Vector &CAI_Enemies::LastKnownPosition( CBaseEntity *pEnemy ){ static Vector defPos; AI_EnemyInfo_t *pMemory = Find( pEnemy, true ); if ( pMemory ) return pMemory->vLastKnownLocation; DevWarning( 2,"Asking LastKnownPosition for enemy that's not in my memory!!/n"); return defPos;}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:13,
示例15: DevWarning//=========================================================//=========================================================float CAnimating::SequenceDuration( CStudioHdr *pStudioHdr, int iSequence ){ if ( !pStudioHdr ) { DevWarning( 2, "CBaseAnimating::SequenceDuration( %d ) NULL pstudiohdr on %s!/n", iSequence, GetClassname() ); return 0.1; } if ( !pStudioHdr->SequencesAvailable() ) { return 0.1; } if (iSequence >= pStudioHdr->GetNumSeq() || iSequence < 0 ) { DevWarning( 2, "CBaseAnimating::SequenceDuration( %d ) out of range/n", iSequence ); return 0.1; } return Studio_Duration( pStudioHdr, iSequence, GetPoseParameterArray() );}
开发者ID:KissLick,项目名称:sourcemod-npc-in-css,代码行数:21,
示例16: goalvoid CNPC_Crow::StartTargetHandling( CBaseEntity *pTargetEnt ){ AI_NavGoal_t goal( GOALTYPE_PATHCORNER, pTargetEnt->GetAbsOrigin(), ACT_FLY, AIN_DEF_TOLERANCE, AIN_YAW_TO_DEST); if ( !GetNavigator()->SetGoal( goal ) ) { DevWarning( 2, "Can't Create Route!/n" ); }}
开发者ID:Bubbasacs,项目名称:FinalProj,代码行数:11,
示例17: DevWarning// Convenient way to delay removing oneselfvoid CBaseEntity::SUB_Remove( void ){ if (m_iHealth > 0) { // this situation can screw up NPCs who can't tell their entity pointers are invalid. m_iHealth = 0; DevWarning( 2, "SUB_Remove called on entity with health > 0/n"); } UTIL_Remove( this );}
开发者ID:FooGames,项目名称:SecobMod,代码行数:12,
示例18: MAKE_STRING//-----------------------------------------------------------------------------// Aim the next rocket at a specific target//-----------------------------------------------------------------------------void CPropAPC::InputFireMissileAt( inputdata_t &inputdata ){ string_t strMissileTarget = MAKE_STRING( inputdata.value.String() ); CBaseEntity *pTarget = gEntList.FindEntityByName( NULL, strMissileTarget, NULL, inputdata.pActivator, inputdata.pCaller ); if ( pTarget == NULL ) { DevWarning( "%s: Could not find target '%s'!/n", GetClassname(), STRING( strMissileTarget ) ); return; } m_hSpecificRocketTarget = pTarget;}
开发者ID:paralin,项目名称:hl2sdk,代码行数:15,
示例19: DevWarning//-----------------------------------------------------------------------------// Purpose: //-----------------------------------------------------------------------------CHudElement *CHud::FindElement(const char *pName){ for (int i = 0; i < m_HudList.Size(); i++) { if (V_stricmp(m_HudList[i]->GetName(), pName) == 0) return m_HudList[i]; } DevWarning(1, "Could not find Hud Element: %s/n", pName); Assert(0); return NULL;}
开发者ID:Yosam02,项目名称:game,代码行数:15,
示例20: GetHudList//-----------------------------------------------------------------------------// Purpose: //-----------------------------------------------------------------------------CHudElement *CHud::FindElement( const char *pName ){ for ( int i = 0; i < GetHudList().Count(); i++ ) { if ( stricmp( GetHudList()[ i ]->GetName(), pName ) == 0 ) return GetHudList()[i]; } DevWarning(1, "[%d] Could not find Hud Element: %s/n", m_nSplitScreenSlot, pName ); Assert(0); return NULL;}
开发者ID:Cre3per,项目名称:hl2sdk-csgo,代码行数:15,
示例21: Find//-----------------------------------------------------------------------------// Purpose: Returns the last position the enemy was SEEN at. This will always be// different than LastKnownPosition() when the enemy is out of sight, because// the last KNOWN position will be updated for a number of seconds after the // player disappears. //-----------------------------------------------------------------------------const Vector &CAI_Enemies::LastSeenPosition( CBaseEntity *pEnemy ){ AI_EnemyInfo_t *pMemory = Find( pEnemy, true ); if ( pMemory ) { m_vecDefaultLSP = pMemory->vLastSeenLocation; } else { DevWarning( 2,"Asking LastSeenPosition for enemy that's not in my memory!!/n"); } return m_vecDefaultLSP;}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:19,
示例22: cheatsRefvoid CTriggerTimerStop::StartTouch(CBaseEntity *pOther){ ConVarRef cheatsRef("sv_cheats"); BaseClass::StartTouch(pOther); // If timer is already stopped, there's nothing to stop (No run state effect to play) if (pOther->IsPlayer() && g_Timer.IsRunning()) { if (!cheatsRef.GetBool()) g_Timer.Stop(true); else DevWarning("You must turn off cheats to use the timer!/n"); }}
开发者ID:Yosam02,项目名称:game,代码行数:13,
示例23: DevWarning//-----------------------------------------------------------------------------// Purpose: The act has finished//-----------------------------------------------------------------------------void CInfoAct::FinishAct( ){ if ( g_hCurrentAct.Get() != this ) { DevWarning( 2, "Attempted to finish an act which wasn't started!/n" ); return; } ShutdownRespawnTimers(); switch( m_iWinners) { case 0: m_OnFinishedTeamNone.FireOutput( this, this ); break; case 1: m_OnFinishedTeam1.FireOutput( this, this ); break; case 2: m_OnFinishedTeam2.FireOutput( this, this ); break; default: Assert(0); break; } g_hCurrentAct = NULL; // Tell all the clients CRelieableBroadcastRecipientFilter filter; UserMessageBegin( filter, "ActEnd" ); WRITE_BYTE( m_iWinners ); MessageEnd(); // Am I an intermission? if ( HasSpawnFlags( SF_ACT_INTERMISSION ) ) { // Cycle through all players and end the intermission for them for ( int i = 1; i <= gpGlobals->maxClients; i++ ) { CBaseTFPlayer *pPlayer = (CBaseTFPlayer*)UTIL_PlayerByIndex( i ); if ( pPlayer ) { EndIntermission( pPlayer ); } } }}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:54,
示例24: Operator_ForceNPCFire//-----------------------------------------------------------------------------// Purpose: // Input : *pEvent - // *pOperator - //-----------------------------------------------------------------------------void CBaseCombatWeapon::Operator_HandleAnimEvent( animevent_t *pEvent, CBaseCombatCharacter *pOperator ){ if ( (pEvent->type & AE_TYPE_NEWEVENTSYSTEM) && (pEvent->type & AE_TYPE_SERVER) ) { if ( pEvent->event == AE_NPC_WEAPON_FIRE ) { bool bSecondary = (atoi( pEvent->options ) != 0); Operator_ForceNPCFire( pOperator, bSecondary ); return; } } DevWarning( 2, "Unhandled animation event %d from %s --> %s/n", pEvent->event, pOperator->GetClassname(), GetClassname() );}
开发者ID:Bubbasacs,项目名称:FinalProj,代码行数:19,
注:本文中的DevWarning函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ DeviceIoControl函数代码示例 C++ DevMsg函数代码示例 |