亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

cocos2d-x CCScheduler

發布時間:2020-05-30 05:21:11 來源:網絡 閱讀:1332 作者:cgw0827 欄目:游戲開發


CCNode::CCNode(void){

   m_pScheduler = director->getScheduler();

   m_pScheduler->retain();

}


void CCNode::schedule(SEL_SCHEDULE selector)

{

this->schedule(selector, 0.0f, kCCRepeatForever, 0.0f);

}


void CCNode::schedule(SEL_SCHEDULE selector, float interval, unsignedint repeat, float delay)

{

CCAssert( selector, "Argument must be non-nil");

CCAssert( interval >=0, "Argument must be positive");


m_pScheduler->scheduleSelector(selector, this, interval , repeat, delay, !m_bRunning);

}


void CCScheduler::scheduleSelector(SEL_SCHEDULE pfnSelector, CCObject *pTarget, float fInterval, unsignedint repeat, float delay, bool bPaused)

{

CCAssert(pfnSelector, "Argument selector must be non-NULL");

CCAssert(pTarget, "Argument target must be non-NULL");


tHashTimerEntry *pElement = NULL;

HASH_FIND_INT(m_pHashForTimers, &pTarget, pElement);


if (! pElement)

   {

       pElement = (tHashTimerEntry *)calloc(sizeof(*pElement), 1);

       pElement->target = pTarget;

if (pTarget)

       {

           pTarget->retain();

       }

HASH_ADD_INT(m_pHashForTimers, target, pElement);


// Is this the 1st element ? Then set the pause level to all the selectors of this target

       pElement->paused = bPaused;

   }

else

   {

CCAssert(pElement->paused == bPaused, "");

   }


if (pElement->timers == NULL)

   {

       pElement->timers = ccArrayNew(10);

   }

else

   {

for (unsignedint i = 0; i < pElement->timers->num; ++i)

       {

CCTimer *timer = (CCTimer*)pElement->timers->arr[i];


if (pfnSelector == timer->getSelector())

           {

CCLOG("CCScheduler#scheduleSelector. Selector already scheduled. Updating interval from: %.4f to %.4f", timer->getInterval(), fInterval);

               timer->setInterval(fInterval);

return;

           }        

       }

ccArrayEnsureExtraCapacity(pElement->timers, 1);

   }


CCTimer *pTimer = newCCTimer();

   pTimer->initWithTarget(pTarget, pfnSelector, fInterval, repeat, delay);

ccArrayAppendObject(pElement->timers, pTimer);

   pTimer->release();    

}






bool CCDirector::init(void)

{

   

// scheduler

m_pScheduler = newCCScheduler();

// action manager

m_pActionManager = newCCActionManager();

m_pScheduler->scheduleUpdateForTarget(m_pActionManager, kCCPrioritySystem, false);

}


// Draw the Scene

voidCCDirector::drawScene(void)

{


//tick before glClear: issue #533

if (! m_bPaused)

   {

m_pScheduler->update(m_fDeltaTime);

   }

}


void CCDisplayLinkDirector::mainLoop(void)

{

if (m_bPurgeDirecotorInNextLoop)

   {

m_bPurgeDirecotorInNextLoop = false;

purgeDirector();

   }

elseif (! m_bInvalid)

    {

drawScene();


// release the objects

CCPoolManager::sharedPoolManager()->pop();        

    }

}


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

阳朔县| 永登县| 涞水县| 安溪县| 湄潭县| 喀喇| 黄山市| 郎溪县| 积石山| 游戏| 南通市| 石泉县| 霍州市| 上思县| 文水县| 静安区| 汉寿县| 富平县| 岐山县| 呈贡县| 安宁市| 桃江县| 景德镇市| 通城县| 亳州市| 平乡县| 岚皋县| 民丰县| 井研县| 阳江市| 潞城市| 惠水县| 屏南县| 辽宁省| 乐亭县| 云安县| 怀来县| 南丰县| 都江堰市| 郓城县| 安多县|