Пример #1
0
void PlatformEventController::startUpdating() {
  if (m_isActive)
    return;

  if (hasLastData() && !m_timer.isActive()) {
    // Make sure to fire the data as soon as possible.
    m_timer.startOneShot(0, BLINK_FROM_HERE);
  }

  registerWithDispatcher();
  m_isActive = true;
}
Пример #2
0
inline void _DelayedReleaser::releaseAfterFrames(cocos2d::Ref *ref, uint64_t f, const std::string &name) {
	auto it = _frames.find(ref);
	if (it == _frames.end()) {
		ref->retain();
		_frames.insert(std::make_pair(ref, f));
		if (!name.empty()) {
			storeRef(ref, name);
		}
		registerWithDispatcher();
	} else {
		it->second = f;
	}
}