aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/courtroom.h2
-rw-r--r--src/courtroom.cpp4
-rw-r--r--src/main.cpp8
3 files changed, 12 insertions, 2 deletions
diff --git a/include/courtroom.h b/include/courtroom.h
index 0fc56fe9..866a75f0 100644
--- a/include/courtroom.h
+++ b/include/courtroom.h
@@ -55,7 +55,7 @@
#include <QPropertyAnimation>
#include <QParallelAnimationGroup>
#include <QMessageBox>
-#include <QRandomGenerator>
+//#include <QRandomGenerator>
#include <stack>
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));
diff --git a/src/main.cpp b/src/main.cpp
index 6c7b1513..04b9df55 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -22,6 +22,14 @@ int main(int argc, char *argv[])
QSettings *configini = main_app.configini;
+ QPluginLoader apngPlugin("imageformats/qapng");
+ if (!apngPlugin.load())
+ qCritical() << "QApng plugin could not be loaded";
+
+ QPluginLoader webpPlugin("imageformats/qwebp");
+ if (!webpPlugin.load())
+ qCritical() << "QWebp plugin could not be loaded";
+
QString p_language = configini->value("language", QLocale::system().name()).toString();
if (p_language == " " || p_language == "")
p_language = QLocale::system().name();