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


C++ InitTop函数代码示例

本文整理汇总了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;
	}
}
开发者ID:FrenchCORE,项目名称:Server,代码行数:30,代码来源:MotionMaster.cpp

示例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;
}
开发者ID:peirick,项目名称:VS2015_Tesseract,代码行数:8,代码来源:iterator.c

示例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);
}
开发者ID:ycsoft,项目名称:SafeThrough,代码行数:13,代码来源:framelesswin2.cpp

示例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);
}
开发者ID:Bluedead,项目名称:SkyFireEMU,代码行数:14,代码来源:MotionMaster.cpp

示例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;
}
开发者ID:m-uu,项目名称:ElunaTrinityWotlk,代码行数:16,代码来源:MotionMaster.cpp

示例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);
}
开发者ID:FrenchCORE,项目名称:Server,代码行数:18,代码来源:MotionMaster.cpp

示例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;
}
开发者ID:martial69320,项目名称:cerberus,代码行数:20,代码来源:MotionMaster.cpp

示例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
}
开发者ID:Exodius,项目名称:chuspi,代码行数:41,代码来源:MotionMaster.cpp

示例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;
    }
}
开发者ID:pfchrono,项目名称:mangos-mods,代码行数:36,代码来源:MotionMaster.cpp

示例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;
    }
}
开发者ID:Bootz,项目名称:TC-One,代码行数:24,代码来源:MotionMaster.cpp


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