mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
Refactor and fixes
This commit is contained in:
parent
b4a3608302
commit
63b5f4bc6b
25 changed files with 394 additions and 278 deletions
27
src/engine.h
27
src/engine.h
|
|
@ -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) {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue