Suppress framerate while splash screen active
Don't irritate the fps-geeks while the sim isn't ready yet. And a minor pointer safety issue.
This commit is contained in:
parent
f8c94c7729
commit
dec020cd64
1 changed files with 9 additions and 2 deletions
|
@ -84,7 +84,7 @@ void TimeManager::init()
|
|||
|
||||
// frame/update-rate counters
|
||||
_frameRate = fgGetNode("/sim/frame-rate", true);
|
||||
_lastFrameTime = _impl->get_cur_time();
|
||||
_lastFrameTime = 0;
|
||||
_frameCount = 0;
|
||||
}
|
||||
|
||||
|
@ -97,6 +97,7 @@ void TimeManager::reinit()
|
|||
{
|
||||
globals->set_time_params(NULL);
|
||||
delete _impl;
|
||||
_impl = NULL;
|
||||
_inited = false;
|
||||
globals->get_event_mgr()->removeTask("updateLocalTime");
|
||||
|
||||
|
@ -119,6 +120,12 @@ void TimeManager::computeTimeDeltas(double& simDt, double& realDt)
|
|||
if (!wait_for_scenery) {
|
||||
throttleUpdateRate();
|
||||
}
|
||||
else
|
||||
{
|
||||
// suppress framerate while initial scenery isn't loaded yet (splash screen still active)
|
||||
_lastFrameTime=0;
|
||||
_frameCount = 0;
|
||||
}
|
||||
|
||||
SGTimeStamp currentStamp;
|
||||
currentStamp.stamp();
|
||||
|
@ -205,7 +212,7 @@ void TimeManager::update(double dt)
|
|||
void TimeManager::computeFrameRate()
|
||||
{
|
||||
// Calculate frame rate average
|
||||
if ((_impl->get_cur_time() != _lastFrameTime) && (_lastFrameTime > 0)) {
|
||||
if ((_impl->get_cur_time() != _lastFrameTime)) {
|
||||
_frameRate->setIntValue(_frameCount);
|
||||
_frameCount = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue