void MarqueeManager::updateMarquee(float delta) { int count=m_pRichContentDataGroupsArray->count(); if (count==0) { stopMarquee(); return; } struct timeval now; gettimeofday(&now, nullptr); long curMilliSecond=now.tv_sec%259200*1000+ (long)now.tv_usec/1000; if (_lastMilliSecond+_delayInterval+_actionInterval>curMilliSecond) { return; } _lastMilliSecond=curMilliSecond; Ref* pObject=m_pRichContentDataGroupsArray->getObjectAtIndex(0); pObject->retain(); pObject->autorelease(); m_pRichContentDataGroupsArray->removeObject(pObject); __Array* curRichContentDatasArray=dynamic_cast<__Array*>(pObject); if (curRichContentDatasArray==nullptr) { return; } showMarquee(curRichContentDatasArray); }
void ReflowDisplay::display(int n) { stopMarquee(); char neg = 0; if (n < 0) { n = n*-1; neg = 1; } displayedDigits[2] = numerals[n % 10] | (neg?0b10000000:0); //TODO fix the way we handle negative numbers displayedDigits[1] = n < 10 ? 0 : numerals[(n/10) % 10]; displayedDigits[0] = n < 100 ? 0 : numerals[(n/100) % 10]; }
void ReflowDisplay::display(char * s) { stopMarquee(); byte len = strlen(s); if (len > 3) len = 3; displayChars(s,len); }