summaryrefslogtreecommitdiffstats
path: root/examples/embedded/raycasting/raycasting.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/embedded/raycasting/raycasting.cpp')
-rw-r--r--examples/embedded/raycasting/raycasting.cpp8
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;