void GameSingleStage::onUpdate( long time ) { int frame = time / getTickTime(); ActionProcessor& processor = getActionProcessor(); for( int i = 0 ; i < frame ; ++i ) { unsigned flag = 0; switch( getState() ) { case GS_RUN: ++mReplayFrame; break; default: flag |= CTF_FREEZE_FRAME; } getActionProcessor().beginAction( flag ); getSubStage()->tick(); getActionProcessor().endAction(); } getSubStage()->updateFrame( frame ); ::Global::getGUI().scanHotkey( getGame()->getController() ); }
void UpdateThreadContext::update() { lastTime = currentTime; currentTime = timeGetRaw(); lastTicks = currentTicks; currentTicks = static_cast<uint64_t>(getTotalTime() / getTickTime()); }
void logger::timerGet(struct timerStruct *timmer) { if (getTickTime(&(timmer->tickTime)) == 0) { timmer->initTickFlag = NONINIT ; //debug_printf("initTickFlag timmer->initTickFlag =NONINIT\n"); //PAUSE } else { timmer->initTickFlag=INITED; } timmer->clockTime = gettimeofday_ms(); timmer->initClockFlag = INITED; }