mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
Fix fps calculation error for linux and QNX (#10141)
This commit is contained in:
@@ -189,7 +189,7 @@ int32_t LinuxPlatform::loop() {
|
||||
onResume();
|
||||
while (!_quit) {
|
||||
curTime = getCurrentMillSecond();
|
||||
desiredInterval = (long)(1.0 / getFps());
|
||||
desiredInterval = static_cast<long>(1000.0 / getFps());
|
||||
pollEvent();
|
||||
actualInterval = curTime - lastTime;
|
||||
if (actualInterval >= desiredInterval) {
|
||||
|
||||
@@ -189,9 +189,9 @@ int32_t QnxPlatform::loop() {
|
||||
onResume();
|
||||
while (!_quit) {
|
||||
curTime = getCurrentMillSecond();
|
||||
desiredInterval = (long)(1.0 / getFps());
|
||||
|
||||
//pollEvent();
|
||||
desiredInterval = static_cast<long>(1000.0 / getFps());
|
||||
|
||||
// pollEvent();
|
||||
actualInterval = curTime - lastTime;
|
||||
if (actualInterval >= desiredInterval) {
|
||||
lastTime = getCurrentMillSecond();
|
||||
|
||||
Reference in New Issue
Block a user