mirror of
https://github.com/wu736139669/SmallGame_Cocos2dx.git
synced 2026-08-05 06:23:09 +00:00
38 lines
605 B
C++
38 lines
605 B
C++
/***************************************************************
|
|
*
|
|
*
|
|
* 作者: 王少培
|
|
* 文件名: CGameTimer.cpp
|
|
* 创建时间:
|
|
*
|
|
***************************************************************/
|
|
|
|
#include "GameTimer.h"
|
|
|
|
IMPLEMENT_SINGLETON(CGameTimer, ms_instance)
|
|
|
|
CGameTimer::CGameTimer()
|
|
: mTimeCounter(0)
|
|
{
|
|
|
|
}
|
|
|
|
CGameTimer::~CGameTimer()
|
|
{
|
|
ResetTime();
|
|
}
|
|
|
|
unsigned int CGameTimer::GetNowTime() const
|
|
{
|
|
return mTimeCounter;
|
|
}
|
|
|
|
void CGameTimer::ResetTime()
|
|
{
|
|
mTimeCounter = 0;
|
|
}
|
|
|
|
void CGameTimer::Update( unsigned int deltaTime )
|
|
{
|
|
mTimeCounter += deltaTime;
|
|
} |