add a splash screen to Noggit just for fun and more pricy look. Probably needs a better picture.

This commit is contained in:
Skarn
2020-10-22 03:53:26 +03:00
parent f21705ff9e
commit f4e762a0c9
3 changed files with 9 additions and 0 deletions

BIN
media/splash.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

View File

@@ -6,6 +6,7 @@
</qresource>
<qresource prefix="/">
<file alias="icon">../media/noggit_icon.png</file>
<file alias="splash">../media/splash.png</file>
</qresource>
<qresource prefix="/shader">
<file alias="m2_vs">../src/glsl/m2_vert.glsl</file>

View File

@@ -35,6 +35,7 @@
#include <QtWidgets/QFileDialog>
#include <QtWidgets/QLabel>
#include <QtWidgets/QMessageBox>
#include <QSplashScreen>
#include "revision.h"
@@ -207,6 +208,10 @@ Noggit::Noggit(int argc, char *argv[])
: fullscreen(false)
, doAntiAliasing(true)
{
QPixmap pixmap = QPixmap(":splash");
QSplashScreen splash(pixmap);
splash.show();
InitLogging();
assert (argc >= 1); (void) argc;
initPath(argv);
@@ -246,7 +251,10 @@ Noggit::Noggit(int argc, char *argv[])
settings.setValue ("project/game_path", path.absolutePath());
settings.setValue ("project/path", QString::fromStdString(project_path));
splash.showMessage("Loading game files...");
loadMPQs(); // listfiles are not available straight away! They are async! Do not rely on anything at this point!
splash.showMessage("Reading databases...");
OpenDBs();
if (!QGLFormat::hasOpenGL())