Refactor and fixes

This commit is contained in:
MihailRis
2023-11-12 02:44:02 +03:00
parent b4a3608302
commit 63b5f4bc6b
25 changed files with 394 additions and 278 deletions
+1 -26
View File
@@ -5,6 +5,7 @@
#include <memory>
#include <stdexcept>
#include "typedefs.h"
#include "settings.h"
class Assets;
class Level;
@@ -13,32 +14,6 @@ namespace gui {
class GUI;
}
struct EngineSettings {
/* Window width (pixels) */
int displayWidth;
/* Window height (pixels) */
int displayHeight;
/* Anti-aliasing samples */
int displaySamples;
/* GLFW swap interval value, 0 - unlimited fps, 1 - vsync*/
int displaySwapInterval;
/* Window title */
const char* displayTitle;
/* Max milliseconds that engine uses for chunks loading only */
uint chunksLoadSpeed;
/* Radius of chunks loading zone (chunk is unit) */
uint chunksLoadDistance;
/* Buffer zone where chunks are not unloading (chunk is unit)*/
uint chunksPadding;
/* Fog opacity is calculated as `pow(depth*k, fogCurve)` where k depends on chunksLoadDistance.
Use values in range [1.0 - 2.0] where 1.0 is linear, 2.0 is quadratic
*/
float fogCurve;
};
void load_settings(EngineSettings& settings, std::string filename);
void save_settings(EngineSettings& settings, std::string filename);
class initialize_error : public std::runtime_error {
public:
initialize_error(const std::string& message) : std::runtime_error(message) {}