91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

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

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

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

丰原市| 老河口市| 汕尾市| 九江县| 抚松县| 宁安市| 双江| 石首市| 北安市| 临湘市| 宁晋县| 威远县| 区。| 五大连池市| 乌兰县| 勃利县| 崇仁县| 龙门县| 清镇市| 康定县| 赤城县| 古田县| 平度市| 泰州市| 巴林右旗| 长宁区| 陈巴尔虎旗| 全椒县| 西贡区| 周至县| 芜湖市| 和顺县| 什邡市| 突泉县| 中卫市| 原阳县| 离岛区| 广昌县| 沙河市| 高唐县| 巧家县|