Adds warning and error messages on loading screen (#2941)

Fixes task 1 of (#494)

* Removed loading screen progress bar

It was removed because it does not show an accurate estimation of load times and is rarely used (off by default)

* Add status info to the loading screen on warnings and errors 

Add: Warning logs and above to loading screen, fixes task 1 of (#494)
Removed code duplication in openspanceengine.cpp
Fixed some bugs where completed assets would not disappear from the screen

* Update the design & address PR comments

* Address PR comments & add bool to show/hide log msg

* Delete test_configuration.cpp

* Update Ghoul submodule

* Renders number of warnings and errors to screen

* Update renderengine.cpp

* Adapt new function to the coding style

---------

Co-authored-by: Alexander Bock <mail@alexanderbock.eu>
This commit is contained in:
Andreas Engberg
2023-11-14 15:40:30 +01:00
committed by GitHub
parent c54e72136d
commit 9343c6315d
9 changed files with 192 additions and 192 deletions

View File

@@ -88,7 +88,7 @@ struct Configuration {
struct LoadingScreen {
bool isShowingMessages = true;
bool isShowingNodeNames = true;
bool isShowingProgressbar = true;
bool isShowingLogMessages = true;
};
LoadingScreen loadingScreen;

View File

@@ -25,6 +25,7 @@
#ifndef __OPENSPACE_CORE___LOADINGSCREEN___H__
#define __OPENSPACE_CORE___LOADINGSCREEN___H__
#include <openspace/util/screenlog.h>
#include <ghoul/glm.h>
#include <ghoul/misc/boolean.h>
#include <ghoul/opengl/ghoul_gl.h>
@@ -49,11 +50,11 @@ class LoadingScreen {
public:
BooleanType(ShowMessage);
BooleanType(ShowNodeNames);
BooleanType(ShowProgressbar);
BooleanType(ShowLogMessages);
BooleanType(CatastrophicError);
LoadingScreen(ShowMessage showMessage, ShowNodeNames showNodeNames,
ShowProgressbar showProgressbar);
ShowLogMessages showLogMessages);
~LoadingScreen();
void render();
@@ -63,10 +64,6 @@ public:
void finalize();
void setItemNumber(int nItems);
int itemNumber();
void tickItem();
enum class Phase {
PreStart,
Construction,
@@ -94,19 +91,21 @@ public:
ItemStatus newStatus, ProgressInfo progressInfo);
private:
bool _showMessage;
bool _showNodeNames;
bool _showProgressbar;
void renderLogMessages() const;
bool _showMessage = true;
bool _showNodeNames = true;
bool _showLog = true;
Phase _phase = Phase::PreStart;
std::atomic_int _iProgress = 0;
std::atomic_int _nItems = 0;
std::unique_ptr<ghoul::opengl::Texture> _logoTexture;
std::shared_ptr<ghoul::fontrendering::Font> _loadingFont;
std::shared_ptr<ghoul::fontrendering::Font> _messageFont;
std::shared_ptr<ghoul::fontrendering::Font> _itemFont;
std::shared_ptr<ghoul::fontrendering::Font> _logFont;
bool _hasCatastrophicErrorOccurred = false;
std::string _message;
@@ -130,6 +129,9 @@ private:
std::random_device _randomDevice;
std::default_random_engine _randomEngine;
// Non owning but we remove the log from LogManager on destruction
ScreenLog* _log = nullptr;
};
} // namespace openspace