本文整理汇总了C++中InitTop函数的典型用法代码示例。如果您正苦于以下问题:C++ InitTop函数的具体用法?C++ InitTop怎么用?C++ InitTop使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了InitTop函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ASSERT
void MotionMaster::UpdateMotion(uint32 diff) {
if (i_owner->HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) // what about UNIT_STAT_DISTRACTED? Why is this not included?
return;
ASSERT(!empty());
m_cleanFlag |= MMCF_UPDATE;
if (!top()->Update(*i_owner, diff)) {
m_cleanFlag &= ~MMCF_UPDATE;
MovementExpired();
} else
m_cleanFlag &= ~MMCF_UPDATE;
if (m_expList) {
for (size_t i = 0; i < m_expList->size(); ++i) {
MovementGenerator* mg = (*m_expList)[i];
DirectDelete(mg);
}
delete m_expList;
m_expList = NULL;
if (empty())
Initialize();
else if (needInitTop())
InitTop();
else if (m_cleanFlag & MMCF_RESET)
top()->Reset(*i_owner);
m_cleanFlag &= ~MMCF_RESET;
}
}
示例2: VP8IteratorReset
void VP8IteratorReset(VP8EncIterator* const it) {
VP8Encoder* const enc = it->enc_;
VP8IteratorSetRow(it, 0);
VP8IteratorSetCountDown(it, enc->mb_w_ * enc->mb_h_); // default
InitTop(it);
memset(it->bit_count_, 0, sizeof(it->bit_count_));
it->do_trellis_ = 0;
}
示例3: QDialog
FramelessWin2::FramelessWin2(QWidget *parent,QString s) :
QDialog(parent),m_info(s)
{
setWindowFlags(Qt::FramelessWindowHint);
m_movePoint = QPoint(0,0);
m_pressed = false;
setAttribute(Qt::WA_TranslucentBackground);
m_padding = 5;
m_direct = UNKOWN;
setMouseTracking(true);
InitTop();
resize(310,450);
}
示例4: while
void MotionMaster::DirectClean(bool reset)
{
while (size() > 1)
{
MovementGenerator *curr = top();
pop();
if (curr) DirectDelete(curr);
}
if (needInitTop())
InitTop();
else if (reset)
top()->Reset(*_owner);
}
示例5: DirectDelete
void MotionMaster::ClearExpireList()
{
for (auto itr : _expireList)
DirectDelete(itr);
_expireList.clear();
if (empty())
Initialize();
else if (NeedInitTop())
InitTop();
else if (_cleanFlag & MOTIONMMASTER_CLEANFLAG_RESET)
top()->Reset(_owner);
_cleanFlag &= ~MOTIONMMASTER_CLEANFLAG_RESET;
}
示例6: top
void MotionMaster::DirectExpire(bool reset) {
if (size() > 1) {
MovementGenerator *curr = top();
pop();
removeEmptyTops();
DirectDelete(curr);
}
while (!top())
--i_top;
if (empty())
Initialize();
else if (needInitTop())
InitTop();
else if (reset)
top()->Reset(*i_owner);
}
示例7: DirectDelete
void MotionMaster::ClearExpireList()
{
for (size_t i = 0; i < _expireList->size(); ++i)
{
MovementGenerator* mg = (*_expireList)[i];
DirectDelete(mg);
}
delete _expireList;
_expireList = nullptr;
if (empty())
Initialize();
else if (NeedInitTop())
InitTop();
else if (_cleanFlag & MMCF_RESET)
top()->Reset(_owner);
_cleanFlag &= ~MMCF_RESET;
}
示例8: ASSERT
void MotionMaster::UpdateMotion(uint32 diff)
{
if (!_owner)
return;
if (_owner->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED)) // what about UNIT_STATE_DISTRACTED? Why is this not included?
return;
ASSERT(!empty());
_cleanFlag |= MMCF_UPDATE;
if (!top()->Update(_owner, diff))
{
_cleanFlag &= ~MMCF_UPDATE;
MovementExpired();
}
else
_cleanFlag &= ~MMCF_UPDATE;
if (!_expList.empty())
{
for (ExpireList::iterator i = _expList.begin(); i != _expList.end(); ++i)
DirectDelete(*i);
_expList.clear();
if (empty())
Initialize();
else if (needInitTop())
InitTop();
else if (_cleanFlag & MMCF_RESET)
top()->Reset(_owner);
_cleanFlag &= ~MMCF_RESET;
}
#if 0
// probably not the best place to pu this but im not really sure where else to put it.
_owner->UpdateUnderwaterState(_owner->GetMap(), _owner->GetPositionX(), _owner->GetPositionY(), _owner->GetPositionZ());
#endif
}
示例9: assert
void
MotionMaster::UpdateMotion(uint32 diff)
{
if( i_owner->hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED) )
return;
assert( !empty() );
m_cleanFlag |= MMCF_UPDATE;
if (!top()->Update(*i_owner, diff))
{
m_cleanFlag &= ~MMCF_UPDATE;
MovementExpired();
}
else
m_cleanFlag &= ~MMCF_UPDATE;
if (m_expList)
{
for (int i = 0; i < m_expList->size(); ++i)
{
MovementGenerator* mg = (*m_expList)[i];
DirectDelete(mg);
}
delete m_expList;
m_expList = NULL;
if(empty())
Initialize();
else if(needInitTop())
InitTop();
else if (m_cleanFlag & MMCF_RESET)
top()->Reset(*i_owner);
m_cleanFlag &= ~MMCF_RESET;
}
}
示例10: while
void
MotionMaster::Initialize()
{
// clear ALL movement generators (including default)
while(!empty())
{
MovementGenerator *curr = top();
pop();
if(curr) DirectDelete(curr);
}
// set new default movement generator
if(i_owner->GetTypeId() == TYPEID_UNIT)
{
MovementGenerator* movement = FactorySelector::selectMovementGenerator((Creature*)i_owner);
push( movement == NULL ? &si_idleMovement : movement );
InitTop();
}
else
{
push(&si_idleMovement);
needInit[MOTION_SLOT_IDLE] = false;
}
}