mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 17:17:58 +02:00
coding standards
This commit is contained in:
parent
acb43e18d0
commit
3b372fd897
1 changed files with 6 additions and 7 deletions
|
@ -83,17 +83,16 @@ void Basic2DWindowOpenGLDisplayPlugin::internalPresent() {
|
||||||
}
|
}
|
||||||
WindowOpenGLDisplayPlugin::internalPresent();
|
WindowOpenGLDisplayPlugin::internalPresent();
|
||||||
}
|
}
|
||||||
#define THROTTLED_FRAMERATE 15
|
const uint32_t THROTTLED_FRAMERATE = 15;
|
||||||
int Basic2DWindowOpenGLDisplayPlugin::getDesiredInterval() const {
|
int Basic2DWindowOpenGLDisplayPlugin::getDesiredInterval() const {
|
||||||
static const int ULIMIITED_PAINT_TIMER_DELAY_MS = 1;
|
static const int ULIMIITED_PAINT_TIMER_DELAY_MS = 1;
|
||||||
int result = ULIMIITED_PAINT_TIMER_DELAY_MS;
|
int result = ULIMIITED_PAINT_TIMER_DELAY_MS;
|
||||||
// This test wouldn't be necessary if we could depend on updateFramerate setting _framerateTarget.
|
|
||||||
// Alas, that gets complicated: isThrottled() is const and other stuff depends on it.
|
|
||||||
if (_isThrottled) {
|
|
||||||
result = MSECS_PER_SECOND / THROTTLED_FRAMERATE;
|
|
||||||
}
|
|
||||||
if (0 != _framerateTarget) {
|
if (0 != _framerateTarget) {
|
||||||
result = MSECS_PER_SECOND / _framerateTarget;
|
result = MSECS_PER_SECOND / _framerateTarget;
|
||||||
|
} else if (_isThrottled) {
|
||||||
|
// This test wouldn't be necessary if we could depend on updateFramerate setting _framerateTarget.
|
||||||
|
// Alas, that gets complicated: isThrottled() is const and other stuff depends on it.
|
||||||
|
result = MSECS_PER_SECOND / THROTTLED_FRAMERATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug() << "New interval " << result;
|
qDebug() << "New interval " << result;
|
||||||
|
@ -135,7 +134,7 @@ void Basic2DWindowOpenGLDisplayPlugin::updateFramerate() {
|
||||||
_framerateTarget = 30;
|
_framerateTarget = 30;
|
||||||
}
|
}
|
||||||
} else if (_isThrottled) {
|
} else if (_isThrottled) {
|
||||||
_framerateTarget = (float) THROTTLED_FRAMERATE;
|
_framerateTarget = THROTTLED_FRAMERATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int newInterval = getDesiredInterval();
|
int newInterval = getDesiredInterval();
|
||||||
|
|
Loading…
Reference in a new issue