aboutsummaryrefslogtreecommitdiff
path: root/launcher/SkinUtils.cpp
diff options
context:
space:
mode:
authorTayou <31988415+TayouVR@users.noreply.github.com>2023-08-07 10:32:38 +0200
committerGitHub <noreply@github.com>2023-08-07 10:32:38 +0200
commit9afa7cc91fd889b146c609c6a59f7f7b3d995d9f (patch)
tree20ef3bd30beedca4995875485e468ee323d52096 /launcher/SkinUtils.cpp
parentb572f75dbaad61cf305f1fd4f60ba94d74bfa3fa (diff)
parent75c7df46a7022a46d447bb96fbde619e5d65db05 (diff)
downloadPrismLauncher-9afa7cc91fd889b146c609c6a59f7f7b3d995d9f.tar.gz
PrismLauncher-9afa7cc91fd889b146c609c6a59f7f7b3d995d9f.tar.bz2
PrismLauncher-9afa7cc91fd889b146c609c6a59f7f7b3d995d9f.zip
Merge branch 'develop' into icon-indexing
Signed-off-by: Tayou <31988415+TayouVR@users.noreply.github.com>
Diffstat (limited to 'launcher/SkinUtils.cpp')
-rw-r--r--launcher/SkinUtils.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/launcher/SkinUtils.cpp b/launcher/SkinUtils.cpp
index 1fe0c896..20d3b52e 100644
--- a/launcher/SkinUtils.cpp
+++ b/launcher/SkinUtils.cpp
@@ -14,17 +14,16 @@
*/
#include "SkinUtils.h"
-#include "net/HttpMetaCache.h"
#include "Application.h"
+#include "net/HttpMetaCache.h"
#include <QFile>
-#include <QPainter>
+#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
-#include <QJsonArray>
+#include <QPainter>
-namespace SkinUtils
-{
+namespace SkinUtils {
/*
* Given a username, return a pixmap of the cached skin (if it exists), QPixmap() otherwise
*/
@@ -32,11 +31,9 @@ QPixmap getFaceFromCache(QString username, int height, int width)
{
QFile fskin(APPLICATION->metacache()->resolveEntry("skins", username + ".png")->getFullPath());
- if (fskin.exists())
- {
+ if (fskin.exists()) {
QPixmap skinTexture(fskin.fileName());
- if(!skinTexture.isNull())
- {
+ if (!skinTexture.isNull()) {
QPixmap skin = QPixmap(8, 8);
QPainter painter(&skin);
painter.drawPixmap(0, 0, skinTexture.copy(8, 8, 8, 8));
@@ -47,4 +44,4 @@ QPixmap getFaceFromCache(QString username, int height, int width)
return QPixmap();
}
-}
+} // namespace SkinUtils