本文整理汇总了C++中Timers::size方法的典型用法代码示例。如果您正苦于以下问题:C++ Timers::size方法的具体用法?C++ Timers::size怎么用?C++ Timers::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timers
的用法示例。
在下文中一共展示了Timers::size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: callNextFrame
/**
* This function adds a script 'timer' to be called next tick
*
* It is used by routines which want to make script calls but can't
* because they're in the middle of something scripts might mess up
* (like iterating over the scene to tick or draw it)
*
* The optional age parameter specifies the age of the call,
* i.e. how far in the past it wanted to be made.
* Older calls are called back first.
*
* @note: This function steals the references to both fn and args
*/
void callNextFrame( PyObject * fn, PyObject * args,
const char * reason, double age )
{
TimerHandle handle;
if(!gFreeTimerHandles.empty())
{
handle = gFreeTimerHandles.top();
handle.issueCount++;
gFreeTimerHandles.pop();
}
else
{
if (gTimers.size() >= USHRT_MAX)
{
PyErr_SetString( PyExc_TypeError, "callNextFrame: Callback handle overflow." );
return;
}
handle.id = gTimers.size() + 1;
handle.issueCount = 1;
}
TimerRecord newTR = { getTotalGameTime() - age, fn, args, reason, { handle.i32 } };
gTimers.push_back( newTR );
}