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


C++ CryLog函数代码示例

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


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

示例1: PredictTargetPos

//------------------------------------------------------------------------
void CGunTurret::UpdateGoal(IEntity *pTarget, float deltaTime)
{
	Vec3 shootPos = PredictTargetPos(pTarget,false);

	if(m_turretparams.sweep_time != 0.f && !m_fireparams.hints.empty())
		shootPos = GetSweepPos(pTarget, shootPos);

	if(m_fireparams.deviation_amount != 0.f)
		UpdateDeviation(deltaTime, shootPos);

	float goalYaw(0.f), goalPitch(0.f);

	if(!GetTargetAngles(shootPos, goalYaw, goalPitch))
		return;

	if(!IsTargetAimable(goalYaw,goalPitch))
	{
		if(DebugTurret()) CryLog("UpdateGoal: %s IsTargetAimable failed (yaw: %.2f, pitch: %.2f)", pTarget->GetName(), goalYaw, goalPitch);

		return;
	}

	// if (cry_fabsf(m_goalYaw-goalYaw)<0.0001f && cry_fabsf(m_goalPitch-m_goalPitch)<0.0001f )
	//     return;
	m_goalPitch = goalPitch;
	m_goalYaw = goalYaw;
	GetGameObject()->ChangedNetworkState(ASPECT_GOALORIENTATION);
}
开发者ID:super-nova,项目名称:NovaRepo,代码行数:29,代码来源:GunTurret.cpp

示例2: min

//------------------------------------------------------------------------
float CGameRulesCommonDamageHandling::GetVehicleForeignCollisionMultiplier( const IVehicle& vehicle, const SCollisionEntityInfo& colliderInfo, const CGameRules::SCollisionHitInfo& colHitInfo ) const
{
	float result = 1.0f;
	
	//Vehicle to vehicle collision
	if (colliderInfo.pEntityVehicle)
	{
		const float vehicleMass = vehicle.GetMass();
		const float vehicleColliderMass = colliderInfo.pEntityVehicle->GetMass();

		const float targetSpeedSqr = colHitInfo.target_velocity.len2();

		if ((vehicleMass > vehicleColliderMass * 1.5f) && (targetSpeedSqr > 0.01f))
		{
			//Reduce damage for collisions with large mass ratios, to avoid instant-killing
			const float ratio = 1.0f + (0.35f * min(10.0f, vehicleMass * __fres(vehicleColliderMass))) * min(1.0f, targetSpeedSqr * 0.31623f);
			result = __fres(ratio);

			if (DebugCollisions())
			{
				CryLog("Vehicle/Vehicle (%s <- %s), collision mult: %.2f", vehicle.GetEntity()->GetName(), colliderInfo.pEntity->GetName(), result);
			}
		}
	}

	return result;
}
开发者ID:Xydrel,项目名称:Infected,代码行数:28,代码来源:GameRulesCommonDamageHandling.cpp

示例3: switch

void CMelee::GenerateAndQueueMeleeAction() const
{
	const SMeleeTags& tags = m_pMeleeParams->meleetags;
	const CWeaponMelee::EMeleeStatus meleeStatus = static_cast<CWeaponMelee*> (m_pWeapon)->GetMeleeAttackAction();

	const char* pActionName = NULL;

	switch( meleeStatus )
	{
	case CWeaponMelee::EMeleeStatus_Left:
		GenerateAndQueueMeleeActionForStatus( tags.tag_params_combo_left );
		pActionName = "MeleeCombo";
		break;
	case CWeaponMelee::EMeleeStatus_Right:
		GenerateAndQueueMeleeActionForStatus( tags.tag_params_combo_right );
		pActionName = "MeleeCombo";
		break;
	case CWeaponMelee::EMeleeStatus_KillingBlow:
		GenerateAndQueueMeleeActionForStatus( tags.tag_params_combo_killingblow );
		pActionName = "MeleeKillingBlow";
		break;
	default:
		CryLog( "[Melee] Attempted to run a melee action when the status was unknown" );
		break;
	}
}
开发者ID:Kufusonic,项目名称:Work-in-Progress-Sonic-Fangame,代码行数:26,代码来源:Melee.cpp

示例4: CryLog

//------------------------------------------------------------------------
void CGameRulesHoldObjectiveBase::Init( XmlNodeRef xml )
{
	const int numChildren = xml->getChildCount();
	for (int childIdx = 0; childIdx < numChildren; ++ childIdx)
	{
		XmlNodeRef xmlChild = xml->getChild(childIdx);
		if (!stricmp(xmlChild->getTag(), "SpawnParams"))
		{
			const char *pType = 0;
			if (xmlChild->getAttr("type", &pType))
			{
				if (!stricmp(pType, "avoid"))
				{
					m_spawnPOIType = eSPT_Avoid;
				}
				else
				{
					CryLog("CGameRulesHoldObjectiveBase::Init: ERROR: Unknown spawn point of interest type ('%s')", pType);
				}
				xmlChild->getAttr("distance", m_spawnPOIDistance);
			}
		}
		else if (!stricmp(xmlChild->getTag(), "EffectData"))
		{
			InitEffectData(xmlChild);
		}
	}

	for (int i = 0; i < HOLD_OBJECTIVE_MAX_ENTITIES; ++ i)
	{
		m_entities[i].Reset();
	}
}
开发者ID:aronarts,项目名称:FireNET,代码行数:34,代码来源:GameRulesHoldObjectiveBase.cpp

示例5: AutoEnum_GetBitfieldFromString

TBitfield AutoEnum_GetBitfieldFromString(const char * inString, const char ** inArray, int arraySize)
{
	unsigned int reply = 0;

	if (inString && inString[0] != '\0') // Avoid a load of work if the string's NULL or empty
	{
		const char * startFrom = inString;

		assert (arraySize > 0);

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

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

		do
		{
			char gotToken[32];
			foundAtIndex = cry_copyStringUntilFindChar(gotToken, startFrom, sizeof(gotToken), '|');
			startFrom += foundAtIndex;

			bool done = false;
			for (int i = 0; i < arraySize; ++ i)
			{
				if (0 == stricmp(inArray[i] + skipChars, gotToken))
				{
					CRY_ASSERT_MESSAGE((reply & BIT(i)) == 0, string().Format("Bit '%s' already turned on! Does it feature more than once in string '%s'?", gotToken, inString));

#if DO_PARSE_BITFIELD_STRING_LOGS
					CryLog("AutoEnum_GetBitfieldFromString: Token = '%s' = BIT(%d) = %d, remaining string = '%s'", gotToken, i, BIT(i), foundAtIndex ? startFrom : "");
#endif

					reply |= BIT(i);
					done = true;
					break;
				}
			}
			CRY_ASSERT_MESSAGE(done, string().Format("No flag called '%s' in list", gotToken));
		}
		while (foundAtIndex);
	}

	return reply;
}
开发者ID:Adi0927,项目名称:alecmercer-origins,代码行数:47,代码来源:AutoEnum.cpp

示例6: CryLog

//-------------------------------------------------------------------------
bool CGameBrowser::DoFavouriteIdSearch()
{
	CryLog("[UI] DoFavouriteIdSearch");

	bool bResult = false;

	return bResult;
}
开发者ID:hybridsix,项目名称:Code,代码行数:9,代码来源:GameBrowser.cpp

示例7: IMPLEMENT_RMI

//------------------------------------------------------------------------
IMPLEMENT_RMI(CGameRules, ClMidMigrationJoin)
{
	CryLog("CGameRules::ClMidMigrationJoin() state=%i, timeSinceChange=%f", params.m_state, params.m_timeSinceStateChanged);
	CGame::EHostMigrationState newState = CGame::EHostMigrationState(params.m_state);
	float timeOfChange = gEnv->pTimer->GetAsyncCurTime() - params.m_timeSinceStateChanged;
	g_pGame->SetHostMigrationStateAndTime(newState, timeOfChange);
	return true;
}
开发者ID:richmondx,项目名称:bare-minimum-cryengine3,代码行数:9,代码来源:GameRulesHostMigration.cpp

示例8: m_pGameRules

//------------------------------------------------------------------------
CGameRulesCommonDamageHandling::CGameRulesCommonDamageHandling()
: m_pGameRules(NULL)
{
	CryLog("GameRulesCommonDamageHandling::GameRulesCommonDamageHandling()");
	
	IEntityClassRegistry * pClassReg = gEnv->pEntitySystem->GetClassRegistry();
	m_pEnvironmentalWeaponClass = pClassReg->FindClass("EnvironmentalWeapon");
}
开发者ID:aronarts,项目名称:FireNET,代码行数:9,代码来源:GameRulesCommonDamageHandling.cpp

示例9: CRY_ASSERT

//------------------------------------------------------------------------
void CMatchMakingHandler::Search( int freeSlots, int maxResults, SCrySessionSearchData* searchParameters, int numSearchParameters )
{
	//might still want equivalents of these
	//m_findGameTimeout = GetFindGameTimeout();
	//m_findGameResults.clear();

	SCrySessionSearchParam param;

	param.m_type = FIND_GAME_SESSION_QUERY;

	param.m_data = searchParameters;
	param.m_numFreeSlots = freeSlots;
	CRY_ASSERT(param.m_numFreeSlots > 0);
	param.m_maxNumReturn = maxResults;
	param.m_ranked = false;

	int curData = 0;

	CRY_ASSERT_MESSAGE( numSearchParameters < FIND_GAMES_SEARCH_NUM_DATA, "Session search data buffer overrun" );
	searchParameters[ numSearchParameters ].m_operator = eCSSO_Equal;
	searchParameters[ numSearchParameters ].m_data.m_id = LID_MATCHDATA_VERSION;
	searchParameters[ numSearchParameters ].m_data.m_type = eCLUDT_Int32;
	searchParameters[ numSearchParameters ].m_data.m_int32 = GameLobbyData::GetVersion();
	numSearchParameters++;

	param.m_numData = numSearchParameters;

	++s_currentMMSearchID;
#if defined(TRACK_MATCHMAKING)
	if( CMatchmakingTelemetry* pMMTel = g_pGame->GetMatchMakingTelemetry() )
	{
		pMMTel->AddEvent( SMMStartSearchEvent( param, s_currentMMSearchID ) );
	}
#endif

	ECryLobbyError result = g_pGame->GetGameBrowser()->StartSearchingForServers(&param, CMatchMakingHandler::SearchCallback, this, false);
	if (result == eCLE_Success)
	{
		CryLog("MatchMakingHandler::Search() search successfully started, ");//setting s_bShouldBeSearching to FALSE to prevent another one starting");
	}
	else
	{
		CryLog("MatchMakingHandler::Search() search failed to start (error=%i)", result);// setting s_bShouldBeSearching to TRUE so we start another one when the timeout occurs", result);
	}
	
}
开发者ID:danielasun,项目名称:dbho-GameSDK,代码行数:47,代码来源:MatchmakingHandler.cpp

示例10: CryLog

void CMatchMakingHandler::MMLog( const char* message, bool isError )
{
	if( isError )
	{
		CryLog( "MMHandlerError: %s", message );
	}
	else
	{
		CryLog( "MMHandlerLog: %s", message );
	} 

	if( CMatchmakingTelemetry* pMMTel = g_pGame->GetMatchMakingTelemetry() )
	{
		pMMTel->AddEvent( SMMGenericLogEvent( message, isError ) );
	}

}
开发者ID:danielasun,项目名称:dbho-GameSDK,代码行数:17,代码来源:MatchmakingHandler.cpp

示例11: 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[CRichPresence::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[CRichPresence::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:
			if(numData == 3)
			{
				const int gameModeId = pData[CRichPresence::eRPT_Param1].m_int32;
				const int mapId = pData[CRichPresence::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
			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 rich presence because numData was 0 or there was no hud");
		result = false;
	}

	return result;
}
开发者ID:hybridsix,项目名称:Code,代码行数:59,代码来源:GameBrowser.cpp

示例12: AddCel

//------------------------------------------------------------------------
void CParachute::PhysicalizeCanvas(bool enable)
{
    IEntity* pCanvas = m_pEntitySystem->GetEntity(m_canvasId);
    if (!pCanvas)
        return;

    if (enable)
    {
        SEntityPhysicalizeParams params;
        params.type = PE_RIGID;
        params.mass = 0;
        pCanvas->Physicalize(params);

        IPhysicalEntity* pPhysics = pCanvas->GetPhysics();
        if (!pPhysics)
            return;

        // add parachute physics geometry
        m_paraPhysIds.clear();
        m_paraPhysIds.resize(8);

        for(int iCel=0; iCel<7; iCel++)
        {
            SWing *pCel = &m_aCels[iCel];

            m_paraPhysIds.push_back( AddCel(pPhysics, iCel+1, pCel) );

            pCel->fSurface = pCel->vSize.x * pCel->vSize.y;

            pCel->pLiftPointsMap = &m_LiftPointsMap;
            pCel->pDragPointsMap = &m_DragPointsMap;
        }
        Vec3 minExt(0.0f,0.0f,0.95f), maxExt(0.5f,0.3f,1.9f);
        m_paraPhysIds.push_back( AddBox(&minExt, &maxExt, 70.0f) );

        pe_params_part pp;
        pp.partid = m_paraPhysIds.back();
        pp.flagsAND = ~(geom_collides);
        pPhysics->SetParams(&pp);

        pe_status_dynamics stats;
        pPhysics->GetStatus(&stats);
        CryLog("Parachute mass: %f", stats.mass);
    }
    else
    {
        IPhysicalEntity* pPhysics = pCanvas->GetPhysics();
        if (pPhysics)
        {
            // remove parachute geometry
            for (std::vector<int>::iterator it = m_paraPhysIds.begin(); it != m_paraPhysIds.end(); ++it)
            {
                pPhysics->RemoveGeometry(*it);
            }
        }
        m_paraPhysIds.clear();
    }
}
开发者ID:RenEvo,项目名称:dead6,代码行数:59,代码来源:Parachute.cpp

示例13: GameWarning

//------------------------------------------------------------------------
void CGameRules::StoreMigratingPlayer(IActor* pActor)
{
	if (pActor == NULL)
	{
		GameWarning("Invalid data for migrating player");
		return;
	}

	IEntity* pEntity = pActor->GetEntity();
	EntityId id = pEntity->GetId();
	bool registered = false;

	uint16 channelId = pActor->GetChannelId();
	CRY_ASSERT(channelId);

	bool bShouldAdd = true;

	CGameLobby *pGameLobby = g_pGame->GetGameLobby();
	CRY_ASSERT(pGameLobby);
	if (pGameLobby)
	{
		SCryMatchMakingConnectionUID conId = pGameLobby->GetConnectionUIDFromChannelID((int) channelId);
		if (pGameLobby->GetSessionNames().Find(conId) == SSessionNames::k_unableToFind)
		{
			CryLog("CGameRules::StoreMigratingPlayer() player %s (channelId=%u) has already left the game, not storing", pEntity->GetName(), channelId);
			bShouldAdd = false;
		}
	}

	if (bShouldAdd && (!m_hostMigrationCachedEntities.empty()))
	{
		if (!stl::find(m_hostMigrationCachedEntities, pActor->GetEntityId()))
		{
			bShouldAdd = false;
		}
	}

	if (bShouldAdd)
	{
		for (uint32 index = 0; index < m_migratingPlayerMaxCount; ++index)
		{
			if (!m_pMigratingPlayerInfo[index].InUse())
			{
				m_pMigratingPlayerInfo[index].SetData(pEntity->GetName(), id, GetTeam(id), pEntity->GetWorldPos(), pEntity->GetWorldAngles(), pActor->GetHealth());
				m_pMigratingPlayerInfo[index].SetChannelID(channelId);
				registered = true;
				break;
			}
		}
	}

	pEntity->Hide(true);		// Hide the player, they will be unhidden when they rejoin

	if (!registered && bShouldAdd)
	{
		GameWarning("Too many migrating players!");
	}
}
开发者ID:MrHankey,项目名称:Tanks,代码行数:59,代码来源:GameRulesHostMigration.cpp

示例14: Packet

void CReadSendPacket::SendMsg(SOCKET Socket, SMessage message)
{
	//CryLog("[CryMasterServer] Send message packet...");

	SPacket SPacket;
	Packet* p = new Packet();
	p->create();

	/****************************Обязательный блок************************************/

	p->writeInt(PACKET_MESSAGE);                                 // Тип пакета
	p->writeString(gClientEnv->clientVersion);           // Версия пакета

	/*******************************Тело пакета****************************************/

	p->writeString(message.message);
	p->writeInt(message.area);                            

	p->writeString(EndBlock);                                    // Завершающий блок 

	p->padPacketTo8ByteLen();
	p->encodeBlowfish(gClientEnv->bBlowFish);
	p->appendChecksum(false);
	p->appendMore8Bytes();


	int size = p->getPacketSize();
	char* packet = (char*)p->getBytesPtr();

	SPacket.addr = Socket;
	SPacket.data = packet;
	SPacket.size = size;

	gClientEnv->pPacketQueue->InsertPacket(SPacket);


	if(gClientEnv->bDebugMode)
	{
		CryLog("[CryMasterServer] Message packet size = %d",size);
		CryLog("[CryMasterServer] Message packet data = %s",message.message);
		CryLog("[CryMasterServer] Message packet type = %d",message.area);

		PacketDebugger::Debug(packet, size, "SendPacketsDebugg.txt");
	}
}
开发者ID:aronarts,项目名称:FireNET,代码行数:45,代码来源:SendPacket.cpp

示例15: CryLog

//-------------------------------------------------------------------------
void CGameLobbyManager::MoveUsers(CGameLobby *pFromLobby)
{
	CryLog("[GameLobbyManager] MoveUsers pFromLobby %p pToLobby %p", pFromLobby, m_nextLobby);

	if(m_nextLobby)
	{
		m_nextLobby->MoveUsers(pFromLobby);
	}
}
开发者ID:AiYong,项目名称:CryGame,代码行数:10,代码来源:GameLobbyManager.cpp


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