diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-10-14 17:46:16 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-10-14 17:46:34 +0200 |
commit | 440286655e0ca271506cf7cc02ad0dbf4baef9ca (patch) | |
tree | 896fa81adb8b14a69355a3a6cf64d06ec8173c9a /examples/embedded/raycasting/raycasting.cpp | |
parent | 1e27ad1697187549151657ba187928e439300db7 (diff) | |
parent | e164d61ca8263fc4b46fdd916e1ea77c7dd2b735 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: I4a78428a8ea273b6960792e3b8043f816fa37fcf
Diffstat (limited to 'examples/embedded/raycasting/raycasting.cpp')
-rw-r--r-- | examples/embedded/raycasting/raycasting.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/embedded/raycasting/raycasting.cpp b/examples/embedded/raycasting/raycasting.cpp index 7213811213..c0a1e48fa6 100644 --- a/examples/embedded/raycasting/raycasting.cpp +++ b/examples/embedded/raycasting/raycasting.cpp @@ -92,7 +92,7 @@ public: } void updatePlayer() { - int interval = qBound(20, watch.elapsed(), 250); + int interval = qBound(20ll, watch.elapsed(), 250ll); watch.start(); angle += angleDelta * interval / 1000; qreal step = moveDelta * interval / 1000; @@ -106,10 +106,10 @@ public: } void showFps() { - static QTime frameTick; + static QElapsedTimer frameTick; static int totalFrame = 0; if (!(totalFrame & 31)) { - int elapsed = frameTick.elapsed(); + const qint64 elapsed = frameTick.elapsed(); frameTick.start(); int fps = 32 * 1000 / (1 + elapsed); setWindowTitle(QString("Raycasting (%1 FPS)").arg(fps)); @@ -355,7 +355,7 @@ protected: } private: - QTime watch; + QElapsedTimer watch; QBasicTimer ticker; QImage buffer; qreal angle; |