• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetElapsedTime函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetElapsedTime函数的典型用法代码示例。如果您正苦于以下问题:C++ GetElapsedTime函数的具体用法?C++ GetElapsedTime怎么用?C++ GetElapsedTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetElapsedTime函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ManageObjectsAfterEvents

void RuntimeScene::ManageObjectsAfterEvents()
{
    //Delete objects that were removed.
    RuntimeObjList allObjects = objectsInstances.GetAllObjects();
    for (unsigned int id = 0;id<allObjects.size();++id)
    {
    	if ( allObjects[id]->GetName().empty() )
        {
            for (unsigned int i = 0;i<extensionsToBeNotifiedOnObjectDeletion.size();++i)
                extensionsToBeNotifiedOnObjectDeletion[i]->ObjectDeletedFromScene(*this, allObjects[id].get());

            objectsInstances.RemoveObject(allObjects[id]); //Remove from objects instances, not from the temporary list!
        }
    }

    //Update objects positions, forces and automatisms
    allObjects = objectsInstances.GetAllObjects();
    for (unsigned int id = 0;id<allObjects.size();++id)
    {
        allObjects[id]->SetX( allObjects[id]->GetX() + ( allObjects[id]->TotalForceX() * static_cast<double>(GetElapsedTime())/1000000.0 ));
        allObjects[id]->SetY( allObjects[id]->GetY() + ( allObjects[id]->TotalForceY() * static_cast<double>(GetElapsedTime())/1000000.0 ));
        allObjects[id]->UpdateTime( static_cast<double>(GetElapsedTime())/1000000.0 );
        allObjects[id]->UpdateForce( static_cast<double>(GetElapsedTime())/1000000.0 );
        allObjects[id]->DoAutomatismsPostEvents(*this);
    }
}
开发者ID:AntonioModer,项目名称:GD,代码行数:26,代码来源:RuntimeScene.cpp


示例2: while

// 指定距離移動
void ExtraStageLookUp::MoveDist(
		char	cLRsw,			// ライントレース位置 'L':左、'R':右、'N':トレースなし
		int		nDist,			// 移動距離 mm単位
		float	fTailAngle,
		int		nForward
		)
{
	//-----ログ出力-----
	char*	cLogBuff	= m_pUIGet->GetBlueT()->pcLogBuff;
	//------------------

	DV	dv;

	int32_t		nLmotorCountS = m_pDeviceInterface->m_pCLeftMotor->getCount();
	int32_t		nRmotorCountS = m_pDeviceInterface->m_pCRightMotor->getCount();
	int32_t		nMotorCountS  = ( nLmotorCountS + nRmotorCountS ) / 2;
	while(1){
		int32_t		nLmotorCountN = m_pDeviceInterface->m_pCLeftMotor->getCount();
		int32_t		nRmotorCountN = m_pDeviceInterface->m_pCRightMotor->getCount();
		int32_t		nMotorCountN  = ( nLmotorCountN + nRmotorCountN ) / 2;

		int32_t		nRunCount	= nMotorCountN - nMotorCountS;
		double		dRunDist	= GetRunDistance(nRunCount);	//オフセット付き角位置から距離mmに変換

		if( dRunDist >= (double)nDist ){
			//-----ログ出力-----
			sprintf(cLogBuff,"MoveDist  %lu, nDist=%d, nRunCount=%ld, dRunDist=%f\n", GetElapsedTime(),
					nDist, nRunCount, dRunDist);
			m_pUIGet->WriteLog(cLogBuff);
			//------------------
			break;
		}

		// ライントレース制御
		dv	= CalcuTraceMoterPower( cLRsw, nForward );

		// モータードライブ
		m_pMotorDrive->TailMotorDrive(fTailAngle);
		m_pMotorDrive->LRMotorDrive( dv.Lmotor_pwm, dv.Rmotor_pwm );

		//ログ出力
		sprintf(cLogBuff,"ExtraRun MoveDist %lu, cLRsw=[%c], nDist=%d,  fTailAngle=%f, nForward=%d, color=%d, Lmotor_pwm=%d, Rmotor_pwm=%d\n",
				GetElapsedTime(),
				cLRsw,
				nDist,
				fTailAngle,
				nForward,
				dv.color,
				dv.Lmotor_pwm, dv.Rmotor_pwm
		);

		m_pDeviceInterface->m_pCClock->sleep(4); // 4msec周期起動

		if( IsKeyBreak(fTailAngle) )	break;
	}
}
开发者ID:MaedaSumire,项目名称:2016eitnreotb,代码行数:57,代码来源:ExtraStageLookUp.cpp


示例3: sprintf

// ゲートに行く
void ExtraStageLookUp::GoGate(
			char	cLRsw,			// ライントレース位置 'L':左、'R':右、'N':トレースなし
			float	fTailAngle
		)
{
	//-----ログ出力-----
	char*	cLogBuff	= m_pUIGet->GetBlueT()->pcLogBuff;
	//------------------
	DV	dv;
	int		nForward	= 10;	// 走行速度

//	int16_t	nDistanceMin = 5;	// ソナーセンサー距離cm
	int16_t	nDistanceMin = 7;	// ソナーセンサー距離cm

	int16_t nDistance	= m_pDeviceInterface->m_pCSonarSensor->getDistance();

	for(int i=0 ; ; i++ ){
		if( i % 10 == 9 ){
			// 40ミリ秒毎にソナー検出
			nDistance	=  m_pDeviceInterface->m_pCSonarSensor->getDistance();
		}

		if( nDistance <= nDistanceMin ){
			// ゲート前に到着
			//ログ出力
			sprintf(cLogBuff,"ExtraRun GoGate %lu, nDistance=%d\n", GetElapsedTime(), nDistance);
			m_pUIGet->WriteLog(cLogBuff);
			break;
		}

		// ライントレース制御
		dv	= CalcuTraceMoterPower( cLRsw, nForward );

		// モータードライブ
		m_pMotorDrive->TailMotorDrive(fTailAngle);
		m_pMotorDrive->LRMotorDrive(dv.Lmotor_pwm, dv.Rmotor_pwm);

		//ログ出力
		sprintf(cLogBuff,"ExtraRun GoGate %lu, cLRsw=[%c], nDistance=%d,  fTailAngle=%f, nForward=%d, color=%d, Lmotor_pwm=%d, Rmotor_pwm=%d\n",
				GetElapsedTime(),
				cLRsw,
				nDistance,
				fTailAngle,
				nForward,
				dv.color,
				dv.Lmotor_pwm, dv.Rmotor_pwm
		);
		m_pUIGet->WriteLog(cLogBuff);

		m_pDeviceInterface->m_pCClock->sleep(4); // 4msec周期起動
		if( IsKeyBreak(fTailAngle) )	break;

	}

}
开发者ID:MaedaSumire,项目名称:2016eitnreotb,代码行数:56,代码来源:ExtraStageLookUp.cpp


示例4: Vector2

void Body::UpdateBody(void)
{
	if(IsUnmovable())
	{
		m_linearVelocity = Vector2(0.0f,0.0f);
		m_angularVelocity = 0.0f;
		return;
	}

	float elapsedTime = GetElapsedTime();

	// Apply damping
	m_linearVelocity -= m_linearVelocity * m_linearDamping * elapsedTime;
	m_angularVelocity -= m_angularVelocity * m_angularDamping * elapsedTime;

	// Apply damping forces
	//m_force -= m_linearVelocity * m_linearDamping * elapsedTime;
	//m_torque -= m_angularVelocity * m_angularDamping * elapsedTime;

	// Euler (First Order Taylor Expansion)
	// Integrate position
	//m_position += m_linearVelocity * elapsedTime;
	//m_orientation += m_angularVelocity * elapsedTime;

	// Integrate velocity
	//m_linearVelocity += m_force * (m_inverseMass * elapsedTime);
	//m_angularVelocity += m_torque * (m_inverseInertia * elapsedTime);

	// Second Order Taylor Expansion
	// Integrate position
	m_position += m_linearVelocity * GetElapsedTime() + 0.5f * m_force * m_inverseMass * elapsedTime * elapsedTime;
	m_orientation += m_angularVelocity * GetElapsedTime() + 0.5f * m_torque * m_inverseInertia * elapsedTime * elapsedTime;

	// Remove accumulated rotation
	while(m_orientation > M_PI*2)
		m_orientation -= M_PI*2;

	// Integrate velocity
	m_linearVelocity += m_force * m_inverseMass * elapsedTime;
	m_angularVelocity += m_torque * m_inverseInertia * elapsedTime;

	// Clear forces
	m_force.SetEmpty();
	m_torque = 0.0f;

	// Integrator stability test
	//Sleep(rand() % 40);
}
开发者ID:m1h4,项目名称:Xetrix,代码行数:48,代码来源:Game.cpp


示例5: GetElapsedTime

void StarSystem::Update( float priority )
{
    Unit *unit;
    bool  firstframe = true;
    //No time compression here
    float normal_simulation_atom = SIMULATION_ATOM;
    time += GetElapsedTime();
    _Universe->pushActiveStarSystem( this );
    if ( time/SIMULATION_ATOM >= (1./PHY_NUM) ) {
        while ( time/SIMULATION_ATOM >= (1.) ) {
            //Chew up all SIMULATION_ATOMs that have elapsed since last update
            ExecuteDirector();
            TerrainCollide();
            Unit::ProcessDeleteQueue();
            current_stage = MISSION_SIMULATION;
            collidetable->Update();
            for (un_iter iter = drawList.createIterator(); (unit = *iter); ++iter)
                unit->SetNebula( NULL );
            UpdateMissiles();                    //do explosions
            UpdateUnitPhysics( firstframe );

            firstframe = false;
        }
        time -= SIMULATION_ATOM;
    }
    SIMULATION_ATOM = normal_simulation_atom;
    _Universe->popActiveStarSystem();
}
开发者ID:Ezeer,项目名称:VegaStrike_win32FR,代码行数:28,代码来源:star_system_generic.cpp


示例6: GetElapsedTime

void Emitter::UpdateParticles(void)
{
	static const float linearDamping = 0.2f;

	for(unsigned long i = 0; i < _countof(m_particles); ++i)
	{
		if(m_particles[i].m_velocity.GetLength() < 0.0001f)
			continue;

		// Linear Taylor Expansion
		m_particles[i].m_position += m_particles[i].m_velocity * GetElapsedTime();

		// Simple velocity damping
		m_particles[i].m_velocity -= m_particles[i].m_velocity * linearDamping * GetElapsedTime();
	}
}
开发者ID:m1h4,项目名称:Xetrix,代码行数:16,代码来源:Game.cpp


示例7: GetElapsedTime

void CNetGame::Process()
{
	float fElapsedTime = GetElapsedTime();

	UpdateNetwork();

	if(this->gameState == 1) 
	{	
		if(this->playerPool) this->playerPool->Process(fElapsedTime);
		if(this->vehiclePool) this->vehiclePool->Process(fElapsedTime);
		if(this->objectPool) this->objectPool->Process(fElapsedTime);
		if(this->gamemodeManager) this->gamemodeManager->Frame(fElapsedTime);
		if(this->scriptTimerManager) this->scriptTimerManager->Process((uint32_t)(fElapsedTime * 1000.0f));
		if(this->scriptHttpManager) this->scriptHttpManager->Process();

		if ( __ElementFactory ) __ElementFactory->Process ( fElapsedTime );
	} 
	else if(this->gameState == 2) 
	{
		fRestartWaitTime += fElapsedTime;
		if(fRestartWaitTime > 12.0f)
		{
			ReInitWhenRestarting();
		}
	}

	if (__Console->GetBoolVar("announce"))
		MasterServerAnnounce(fElapsedTime);

	__Plugins->DoProcessTick();

	#ifndef WIN32
		this->elapsedTime += (double)fElapsedTime;
	#endif
}
开发者ID:trisz404,项目名称:OpenSAMP-WIP,代码行数:35,代码来源:CNetGame.cpp


示例8: GetElapsedTime

	void MenuElement::DrawTooltip( void ) {
	#if 0
		//FIXME: re-implement after redesigning menu elements
		if ( common.hidden ) {
			return;
		}

		const real64_t currentTime = GetElapsedTime();
		if ( tooltip.mouseHovering ) {
			tooltip.lastMouseTime = currentTime;
		}
		const real64_t fadeTime = 333.0;
		if ( /*!updatingValue &&*/ tooltip.lastMouseTime > currentTime - fadeTime ) {
			const real32_t alpha = static_cast<real32_t>(
				1.0 - ((currentTime - tooltip.lastMouseTime) / fadeTime)
			);
			static const vector4 colour = { 1.0f, 1.0f, 1.0f, alpha };
			const vector2 pos = {
				(tooltip.lastMousePos[0] + 0.03333f) * Renderer::rdState.window.width,
				tooltip.lastMousePos[1] * Renderer::rdState.window.height
			};
			tooltip.font->Draw(
				pos,
				tooltip.text,
				tooltip.pointSize,
				&colour
			);
		}
	#endif
	}
开发者ID:Razish,项目名称:xsngine,代码行数:30,代码来源:MenuElement.cpp


示例9: GetFrame

int GetFrame() {
	

	// Acquire frame
	
	printf("Acquiring from webcam frame number %d\n",frame_counter);
	gettimeofday(&step_start_time,NULL);
	
	if ( AcquisitionLoopV4L2(fg_v4l2,fr) != 0) {
		printf("Unexpexted error when acquiring frame v4l2 device \n");	
		return -1;
	}
	
	gettimeofday(&step_end_time,NULL);
    	GetElapsedTime("Frame acquisition", &step_start_time, &step_end_time, &acquisition_time );
	
	// If required, save one out of n_save_frame frames in a .ppm file
	
	if ( SAVE_FRAMES ) {
	
		if ( (frame_counter%n_save_frame) == 0){
			
			snprintf( frame_fname, sizeof(frame_fname), "frame_%d.ppm",frame_counter );
			SaveFrame(fr, frame_fname);	
			printf("Frame %d saved to file \n",frame_counter);
		
		}
	}	
		
	return 0;
}
开发者ID:clacarbone,项目名称:RosSaettaVision,代码行数:31,代码来源:v4l2_capture.c


示例10: SteamGameServer

/**
 * Give the async task time to do its work
 * Can only be called on the async task manager thread
 */
void FOnlineAsyncTaskSteamLogoffServer::Tick() 
{
	if (!bInit)
	{
		// @TODO ONLINE Listen Servers need to unset rich presence
		//SteamFriends()->SetRichPresence("connect", ""); for master server sessions
		SteamGameServer()->EnableHeartbeats(false);
		SteamGameServer()->LogOff();
		bInit = true;
	}

	// Wait for the disconnect
	FOnlineSessionSteamPtr SessionInt = StaticCastSharedPtr<FOnlineSessionSteam>(Subsystem->GetSessionInterface());
	if (!SessionInt->bSteamworksGameServerConnected && !SessionInt->GameServerSteamId.IsValid())
	{
		bIsComplete = true;
		bWasSuccessful = true;
	}
	else
	{
		// Fallback timeout in case we don't hear from Steam
		if (GetElapsedTime() >= ASYNC_TASK_TIMEOUT)
		{
			SessionInt->bSteamworksGameServerConnected = false;
			SessionInt->GameServerSteamId = NULL;
			bIsComplete = true;
			bWasSuccessful = false;
		}
	}
}
开发者ID:WasPedro,项目名称:UnrealEngine4.11-HairWorks,代码行数:34,代码来源:OnlineSessionAsyncServerSteam.cpp


示例11: IdleFunc

// IdleFunc()
// Idle function for between frames
void IdleFunc(void) 
{

   float deltaTime;

   // Mark time
   MarkTimeThisTick();
   deltaTime = GetElapsedTime() * GAME_SPEED;

   // Call the display routine next time through the main loop  

   glutPostRedisplay();

   HUDClearScreen();
   HUDPrintToScreen( "There is nothing to see but these text strings!!!\n\n" );
   HUDPrintToScreen( "This app shows a bare minimum AI engine implemented.\n" );
   HUDPrintToScreen( "Below you'll see the states of forty different game\n" );
   HUDPrintToScreen( "objects as they wander around in space. See if you\n" );
   HUDPrintToScreen( "can find a pattern. Then check the code to see if\n" );
   HUDPrintToScreen( "you're right. Hint: Great AI makes the player believe\n" );
   HUDPrintToScreen( "that the game is smarter than it really is.\n\n\n" );

   //Send any messages that have been waiting
   SendDelayedMessages();

   // Update all game objects in the AI engine
   GODBUpdate();

   GODBOutputStateInfoToHUD();

}
开发者ID:wrx-sam,项目名称:myai_engine,代码行数:33,代码来源:main.cpp


示例12: while

void System::gameLoop(){
    SDL_Event Event;
	bool running = true;
    while(running) {
        while(SDL_PollEvent(&Event)) {
			switch( Event.type ){
			case SDL_KEYDOWN:
			case SDL_KEYUP:
				mInputHandler->KeyDown( Event.key.keysym.sym , Event.key.state == SDL_PRESSED );
				break;
			case SDL_MOUSEMOTION:
				mInputHandler->MouseMoved( Event.motion.x, Event.motion.y );
				break;
			case SDL_MOUSEBUTTONDOWN:
			case SDL_MOUSEBUTTONUP:
				mInputHandler->MouseDown( Event.button.button, Event.button.state == SDL_PRESSED, Event.button.x, Event.button.y );
				break;
			case SDL_QUIT:
				running = false;
				break;
			default:
				break;
			}
        }
		mObjectMgr->Update(GetElapsedTime());
		mRenderer->drawScene();
    }
	return;
}
开发者ID:usewits,项目名称:TwinGame,代码行数:29,代码来源:System.cpp


示例13: GETCURRENTTIME

RetCode StmtHandler::Execute(ExecutedResult* exec_result) {
  GETCURRENTTIME(start_time);
  RetCode ret = rSuccess;
  sql_parser_ = new Parser(sql_stmt_);
  AstNode* raw_ast = sql_parser_->GetRawAST();
  if (NULL == raw_ast) {
    exec_result->error_info_ = "Parser Error";
    exec_result->status_ = false;
    exec_result->result_ = NULL;
    return rParserError;
  }
  raw_ast->Print();
  ret = GenerateStmtExec(raw_ast);
  if (rSuccess != ret) {
    return ret;
  }
  ret = stmt_exec_->Execute(exec_result);
  if (rSuccess != ret) {
    return ret;
  }
  double exec_time_ms = GetElapsedTime(start_time);
  if (NULL != exec_result->result_)
    exec_result->result_->query_time_ = exec_time_ms / 1000.0;
  cout << "execute time: " << exec_time_ms / 1000.0 << " sec" << endl;
  return rSuccess;
}
开发者ID:JolyZhang,项目名称:CLAIMS,代码行数:26,代码来源:stmt_handler.cpp


示例14: UpdateGraphics

bool PointStarVlist::BeginDrawState (const QVector &center, const Vector & velocity, const Vector & torque, bool roll, bool yawpitch, int whichTexture) {
    UpdateGraphics();
    static bool StarStreaks=XMLSupport::parse_bool(vs_config->getVariable("graphics","star_streaks","false"));
    GFXColorMaterial(AMBIENT|DIFFUSE);
    bool ret=false;
    if (StarStreaks) {
        Matrix rollMatrix;
        static float velstreakscale= XMLSupport::parse_float (vs_config->getVariable ("graphics","velocity_star_streak_scale","5"));
        static float minstreak= XMLSupport::parse_float (vs_config->getVariable ("graphics","velocity_star_streak_min","1"));
        static float fov_smoothing=XMLSupport::parse_float(vs_config->getVariable("graphics","warp.fovlink.smoothing",".4"));
        float fov_smoot = pow(double(fov_smoothing),GetElapsedTime());
        Vector vel (-velocity*velstreakscale);
        float speed = vel.Magnitude();

        if ((smoothstreak>=minstreak||vel.MagnitudeSquared()>=minstreak*minstreak)&&(speed>1.0e-7)) {
            ret=true;
            vel*=1./speed;
            speed = fov_smoot*speed + (1-fov_smoot)*smoothstreak;

            if (speed<minstreak) speed=minstreak;
            static float streakcap  = XMLSupport::parse_float (vs_config->getVariable ("graphics","velocity_star_streak_max","100"));
            if (speed>streakcap) {
                speed=streakcap;
            }
            vel=vel*speed;
            smoothstreak=speed;
            GFXColorVertex * v = vlist->BeginMutate(0)->colors;
            int numvertices = vlist->GetNumVertices();

            static float torquestreakscale= XMLSupport::parse_float (vs_config->getVariable ("graphics","torque_star_streak_scale","1"));
            for (int j=0; j<numvertices-1; j+=2) {
                int i=j;
//				if (SlowStarStreaks)
//					i=((rand()%numvertices)/2)*2;
                Vector vpoint (v[i+1].x,v[i+1].y,v[i+1].z);
                Vector recenter =(vpoint-center.Cast());
                if (roll) {
                    RotateAxisAngle(rollMatrix,torque,torque.Magnitude()*torquestreakscale*.003);
                    vpoint = Transform(rollMatrix,recenter)+center.Cast();
                }
                v[i].x=vpoint.i-vel.i;
                v[i].y=vpoint.j-vel.j;
                v[i].z=vpoint.k-vel.k;
//				static float NumSlowStarStreaks=XMLSupport::parse_float(vs_config->getVariable("graphics","num_star_streaks",".05"));
//				if (SlowStarStreaks&&j<NumSlowStarStreaks*numvertices)
//					break;
            }
            vlist->EndMutate();
        }
    }
    if (ret) {
        vlist->LoadDrawState();
        vlist->BeginDrawState();
    } else {
        nonstretchvlist->LoadDrawState();
        nonstretchvlist->BeginDrawState();
    }
    return ret;
}
开发者ID:bsmr-games,项目名称:Privateer-Gemini-Gold,代码行数:59,代码来源:star.cpp


示例15: GetElapsedTime

//Stop Timining
void CStopWatch::Stop()
{
	if(m_bIsRunning)
	{
		m_dElapsedTime += GetElapsedTime();
		m_bIsRunning = false;
	}
}
开发者ID:BGCX261,项目名称:zombie-maul-svn-to-git,代码行数:9,代码来源:CStopWatch.cpp


示例16: GetElapsedTime

void CInstance::CheckTime(uint32 tick)
{
	if (m_lastTimeCheck + 1000 <= tick && !Failed())
	{
		luautils::OnInstanceTimeUpdate(m_zone, this, GetElapsedTime(tick));
		m_lastTimeCheck = tick;
	}
}
开发者ID:Celyste,项目名称:darkstar,代码行数:8,代码来源:instance.cpp


示例17: GetElapsedTime

void StopWatch::Pause() {
    if (m_paused) {
        return;
    }

    m_elapsed += GetElapsedTime();
    m_paused = true;
}
开发者ID:vanxining,项目名称:M4Player,代码行数:8,代码来源:StopWatch.cpp


示例18: UpdateFixed

 void SplashState::UpdateFixed(void)
 {
   // Drop our state after 10 seconds have elapsed
   if(false == IsPaused() && GetElapsedTime() > mSplashDelay)
   {
     mApp.mStateManager.RemoveActiveState();
   }
 }
开发者ID:Moltov,项目名称:Time-Voyager,代码行数:8,代码来源:SplashState.cpp


示例19: GetElapsedTime

wxULongLong wxDownloadEvent::GetDownloadSpeed() const
{
    wxTimeSpan sec = GetElapsedTime();
    if (sec.GetSeconds() == 0)
        return 0;       // avoid division by zero

    // returned value is in bytes per second
    return (wxULongLong_t)(m_curr.ToDouble() / sec.GetSeconds().ToDouble());
}
开发者ID:stahta01,项目名称:wxCode_components,代码行数:9,代码来源:download.cpp


示例20: printf

		void MusicRenderer::RenderToSpeaker()
		{
			SoundEvent currentSoundEvent;

			unsigned int duration = m_header.Duration[m_difficulty] * 1000 + 1000;
			std::vector<SoundEvent>::size_type eventCtr = 0, totalEvents = m_soundEvents->size();
			unsigned int elapsed = 0;
			int percentage = 0;

			printf("0%%");

			BeginTimer();
			while(elapsed < duration)
			{
				if(eventCtr < totalEvents)
				{
					currentSoundEvent = m_soundEvents->at(eventCtr);

					if(currentSoundEvent.Time <= elapsed)
					{
						if(currentSoundEvent.NoteType != 3)
						{
							int sampleIndex = -1;
							if(currentSoundEvent.NoteType == 4)
								sampleIndex = GetSample(currentSoundEvent.RefID + 1000);
							else
								sampleIndex = GetSample(currentSoundEvent.RefID);

							if(sampleIndex >= 0)
							{
								Sample sample = m_samples->at(sampleIndex);
								FMOD_RESULT result = m_fmod->playSound(FMOD_CHANNEL_FREE, sample.Data, false, 0);
							}
						}

						eventCtr++;
					}
				}

				m_fmod->update();
				UpdateTimer();
				elapsed = GetElapsedTime();

				if(percentage < 10)
					printf("\b\b");
				else if(percentage < 100)
					printf("\b\b\b");
				else printf("\b\b\b\b");

				percentage = (int)((float)elapsed / (float)duration * 100.f);
				printf("%d%%", percentage);
			}

			StopTimer();
		}
开发者ID:XadillaX,项目名称:render-ojn,代码行数:55,代码来源:music_renderer.cpp



注:本文中的GetElapsedTime函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetElem函数代码示例发布时间:2022-05-30
下一篇:
C++ GetEffectValue函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap