From b0f11e53dff7187a147f01da2d8da5bf392cd38d Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sat, 28 Sep 2019 22:00:16 +0300 Subject: 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 --- src/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/main.cpp') 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(); -- cgit From 30c02221d282cb4d340aa38334f89e4825fa39d0 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sun, 29 Sep 2019 03:26:16 +0300 Subject: Make the client select a default font that resembles classic AA font the most (cleartype off, MS Sans) Create a better method to replace trailing whitespace with proper HTML representation Don't bother rendering the string character-by-character to prevent any latency happening with instant text speed --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 04b9df55..8d3f53b1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -22,11 +22,11 @@ int main(int argc, char *argv[]) QSettings *configini = main_app.configini; - QPluginLoader apngPlugin("imageformats/qapng"); + QPluginLoader apngPlugin("qapng"); if (!apngPlugin.load()) qCritical() << "QApng plugin could not be loaded"; - QPluginLoader webpPlugin("imageformats/qwebp"); + QPluginLoader webpPlugin("qwebp"); if (!webpPlugin.load()) qCritical() << "QWebp plugin could not be loaded"; -- cgit From c8e12558cdd3fd0769b81679ad09edf1f29b780f Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 22 May 2020 01:18:24 +0300 Subject: Clang-ify the code with this styling using Visual Studio Code: { BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Stroustrup, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All } (this is the Visual Studio preset with only "BreakBeforeBraces" changed from Allman to Stroustrup) --- src/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 8d3f53b1..9370bcea 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,13 +1,13 @@ #include "aoapplication.h" +#include "courtroom.h" #include "datatypes.h" -#include "networkmanager.h" #include "lobby.h" -#include "courtroom.h" -#include +#include "networkmanager.h" #include -#include #include +#include +#include int main(int argc, char *argv[]) { @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) QTranslator qtTranslator; qtTranslator.load("qt_" + p_language, - QLibraryInfo::location(QLibraryInfo::TranslationsPath)); + QLibraryInfo::location(QLibraryInfo::TranslationsPath)); main_app.installTranslator(&qtTranslator); QTranslator appTranslator; -- cgit From 88de4cde0433ef5e606f38a2f1e6041f0d24a87e Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 22 May 2020 02:14:54 +0300 Subject: clang 2 electric boogaloo { BasedOnStyle: LLVM, BreakBeforeBraces: Stroustrup} --- src/main.cpp | 55 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 27 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 9370bcea..ba5b5167 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -12,40 +12,41 @@ int main(int argc, char *argv[]) { #if QT_VERSION > QT_VERSION_CHECK(5, 6, 0) - // High-DPI support is for Qt version >=5.6. - // However, many Linux distros still haven't brought their stable/LTS - // packages up to Qt 5.6, so this is conditional. - AOApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + // High-DPI support is for Qt version >=5.6. + // However, many Linux distros still haven't brought their stable/LTS + // packages up to Qt 5.6, so this is conditional. + AOApplication::setAttribute(Qt::AA_EnableHighDpiScaling); #endif - AOApplication main_app(argc, argv); + AOApplication main_app(argc, argv); - QSettings *configini = main_app.configini; + QSettings *configini = main_app.configini; - QPluginLoader apngPlugin("qapng"); - if (!apngPlugin.load()) - qCritical() << "QApng plugin could not be loaded"; + QPluginLoader apngPlugin("qapng"); + if (!apngPlugin.load()) + qCritical() << "QApng plugin could not be loaded"; - QPluginLoader webpPlugin("qwebp"); - if (!webpPlugin.load()) - qCritical() << "QWebp plugin could not be loaded"; + QPluginLoader webpPlugin("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(); + QString p_language = + configini->value("language", QLocale::system().name()).toString(); + if (p_language == " " || p_language == "") + p_language = QLocale::system().name(); - QTranslator qtTranslator; - qtTranslator.load("qt_" + p_language, - QLibraryInfo::location(QLibraryInfo::TranslationsPath)); - main_app.installTranslator(&qtTranslator); + QTranslator qtTranslator; + qtTranslator.load("qt_" + p_language, + QLibraryInfo::location(QLibraryInfo::TranslationsPath)); + main_app.installTranslator(&qtTranslator); - QTranslator appTranslator; - qDebug() << ":/resource/translations/ao_" + p_language; - appTranslator.load("ao_" + p_language, ":/resource/translations/"); - main_app.installTranslator(&appTranslator); + QTranslator appTranslator; + qDebug() << ":/resource/translations/ao_" + p_language; + appTranslator.load("ao_" + p_language, ":/resource/translations/"); + main_app.installTranslator(&appTranslator); - main_app.construct_lobby(); - main_app.net_manager->connect_to_master(); - main_app.w_lobby->show(); - return main_app.exec(); + main_app.construct_lobby(); + main_app.net_manager->connect_to_master(); + main_app.w_lobby->show(); + return main_app.exec(); } -- cgit