コード例 #1
0
ファイル: WorldRouter.cpp プロジェクト: anthonypesce/cyphesis
/// \brief Update the in-game time.
///
/// Reads the system time, and applies the necessary offsets to calculate
/// the in-game time. This is the stored, and can be accessed using getTime().
void WorldRouter::updateTime(const SystemTime & time)
{
    double tmp_time = (double)(time.seconds() + timeoffset - m_initTime) + (double)time.microseconds()/1000000;
    m_realTime = tmp_time;
}
コード例 #2
0
ファイル: BaseWorld.cpp プロジェクト: Arsakes/cyphesis
double BaseWorld::getTime() const {
    SystemTime time;
    time.update();
    return (double)(time.seconds() + timeoffset - m_initTime) + (double)time.microseconds()/1000000.;
}