qmlfrontend/hwengine.cpp
changeset 14394 4409344db447
parent 14393 b6824a53d4b1
child 15919 d52f5d8e75e6
--- a/qmlfrontend/hwengine.cpp	Fri Dec 07 13:56:45 2018 +0100
+++ b/qmlfrontend/hwengine.cpp	Fri Dec 07 14:30:35 2018 +0100
@@ -2,8 +2,6 @@
 
 #include <QDebug>
 #include <QImage>
-#include <QLibrary>
-#include <QQmlEngine>
 #include <QUuid>
 
 #include "engine_instance.h"
@@ -27,17 +25,7 @@
 
   engine.sendConfig(m_gameConfig);
 
-  Engine::PreviewInfo preview = engine.generatePreview();
-
-  QVector<QRgb> colorTable;
-  colorTable.resize(256);
-  for (int i = 0; i < 256; ++i) colorTable[i] = qRgba(255, 255, 0, i);
-
-  QImage previewImage(preview.land, static_cast<int>(preview.width),
-                      static_cast<int>(preview.height),
-                      QImage::Format_Indexed8);
-  previewImage.setColorTable(colorTable);
-  previewImage.detach();
+  QImage previewImage = engine.generatePreview();
 
   if (m_previewAcceptor) m_previewAcceptor->setImage(previewImage);