aboutsummaryrefslogtreecommitdiff
path: root/src/courtroom.cpp
diff options
context:
space:
mode:
authorCrystalwarrior <varsash@gmail.com>2019-09-28 22:00:16 +0300
committerCrystalwarrior <varsash@gmail.com>2019-09-28 22:00:16 +0300
commitb0f11e53dff7187a147f01da2d8da5bf392cd38d (patch)
treef69e2fc1aa480672112f7891b041c3bac5b453e6 /src/courtroom.cpp
parent709ebb7e1872394731c2edb282a1ce73fdc353f9 (diff)
Strip out QRandomGenerator because it's "too new" of a module (linux build does not compile with it)
Add QPluginLoader checks for qapng and qwebp
Diffstat (limited to 'src/courtroom.cpp')
-rw-r--r--src/courtroom.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/courtroom.cpp b/src/courtroom.cpp
index 6ea98f12..20f7daec 100644
--- a/src/courtroom.cpp
+++ b/src/courtroom.cpp
@@ -44,6 +44,8 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow()
}
#endif
+ qsrand(static_cast<uint>(QDateTime::currentMSecsSinceEpoch() / 1000));
+
keepalive_timer = new QTimer(this);
keepalive_timer->start(60000);
@@ -1933,7 +1935,7 @@ void Courtroom::do_screenshake()
for (int frame=0; frame < maxframes; frame++)
{
double fraction = double(frame*frequency)/duration;
- quint32 rng = QRandomGenerator::global()->generate();
+ int rng = qrand();//QRandomGenerator::global()->generate();
int rand_x = int(rng) % max_x;
int rand_y = int(rng+100) % max_y;
screenshake_animation->setKeyValueAt(fraction, QPoint(pos_default.x() + rand_x, pos_default.y() + rand_y));