本文整理汇总了C++中CTimeValue::GetMilliSecondsAsInt64方法的典型用法代码示例。如果您正苦于以下问题:C++ CTimeValue::GetMilliSecondsAsInt64方法的具体用法?C++ CTimeValue::GetMilliSecondsAsInt64怎么用?C++ CTimeValue::GetMilliSecondsAsInt64使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTimeValue
的用法示例。
在下文中一共展示了CTimeValue::GetMilliSecondsAsInt64方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ScriptTimer
//////////////////////////////////////////////////////////////////////////
// Create a new timer and put it in the list of managed timers.
int CScriptTimerMgr::AddTimer( ScriptTimer &timer )
{
CTimeValue nCurrTimeMillis = gEnv->pTimer->GetFrameStartTime();
timer.nStartTime = nCurrTimeMillis.GetMilliSecondsAsInt64();
timer.nEndTime = timer.nStartTime + timer.nMillis;
if (!timer.nTimerID)
{
m_nLastTimerID++;
timer.nTimerID = m_nLastTimerID;
}
else
{
if (timer.nTimerID > m_nLastTimerID)
m_nLastTimerID = timer.nTimerID+1;
}
m_mapTempTimers[timer.nTimerID] = new ScriptTimer(timer);
return timer.nTimerID;
}
示例2: AddEntityId
//------------------------------------------------------------------------
void CGameRulesHoldObjectiveBase::AddEntityId(int type, EntityId entityId, int index, bool isNewEntity, const CTimeValue &timeAdded)
{
if(index >= HOLD_OBJECTIVE_MAX_ENTITIES)
{
CryFatalError("Too Many Hold Objective Entities Active!");
}
CryLog("CGameRulesHoldObjectiveBase::AddEntityId() received objective, eid=%i, index=%i, isNewEntity=%s, fTimeAdded=%lld, adding to pending queue", entityId, index, isNewEntity ? "true" : "false", timeAdded.GetMilliSecondsAsInt64());
SHoldEntityDetails *pDetails = &m_entities[index];
if (pDetails->m_id)
{
// We're overwriting another entity, disable the old one
CleanUpEntity(pDetails);
}
// Can't actually activate the entity here since the entity may not be fully initialised yet (horrible ordering issue on game restart),
// instead set it as pending and do the actual add in the ::Update(...) method
pDetails->m_pendingId = entityId;
pDetails->m_isNewEntity = isNewEntity;
m_pendingTimeAdded = timeAdded;
}
示例3: SaveToXML
static void SaveToXML(const XmlNodeRef& n, const char* name, const CTimeValue& t)
{
n->setAttr(name, t.GetMilliSecondsAsInt64());
}