mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
move weather from WorldRenderer to LevelFrontend
This commit is contained in:
parent
22f09d3659
commit
ac00c561ee
7 changed files with 26 additions and 10 deletions
|
|
@ -24,6 +24,7 @@
|
|||
#include "voxels/Chunks.hpp"
|
||||
#include "window/Camera.hpp"
|
||||
#include "world/Level.hpp"
|
||||
#include "world/Weather.hpp"
|
||||
#include "WorldRenderer.hpp"
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@
|
|||
#include "window/Window.hpp"
|
||||
#include "world/Level.hpp"
|
||||
#include "world/LevelEvents.hpp"
|
||||
#include "world/Weather.hpp"
|
||||
#include "world/World.hpp"
|
||||
#include "debug/Logger.hpp"
|
||||
|
||||
|
|
@ -84,6 +85,7 @@ WorldRenderer::WorldRenderer(
|
|||
level(frontend.getLevel()),
|
||||
player(player),
|
||||
assets(*engine.getAssets()),
|
||||
weather(frontend.getWeather()),
|
||||
frustumCulling(std::make_unique<Frustum>()),
|
||||
lineBatch(std::make_unique<LineBatch>()),
|
||||
batch3d(std::make_unique<Batch3D>(BATCH3D_CAPACITY)),
|
||||
|
|
@ -590,7 +592,7 @@ void WorldRenderer::renderBlockOverlay(const DrawContext& wctx) {
|
|||
batch3d->flush();
|
||||
}
|
||||
|
||||
void WorldRenderer::clear() {
|
||||
void WorldRenderer::resetCache() {
|
||||
chunksRenderer->clear();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
#include "typedefs.hpp"
|
||||
|
||||
#include "presets/WeatherPreset.hpp"
|
||||
#include "world/Weather.hpp"
|
||||
#include "window/Camera.hpp"
|
||||
#include "util/ObjectsKeeper.hpp"
|
||||
|
||||
|
|
@ -36,6 +35,7 @@ class Skybox;
|
|||
class TextsRenderer;
|
||||
class CloudsRenderer;
|
||||
struct EngineSettings;
|
||||
struct Weather;
|
||||
|
||||
class WorldRenderer final : public util::ObjectsKeeper {
|
||||
public:
|
||||
|
|
@ -54,7 +54,7 @@ public:
|
|||
PostProcessing& postProcessing
|
||||
);
|
||||
|
||||
void clear();
|
||||
void resetCache();
|
||||
|
||||
void setDebug(bool flag);
|
||||
|
||||
|
|
@ -66,6 +66,7 @@ private:
|
|||
const Level& level;
|
||||
Player& player;
|
||||
const Assets& assets;
|
||||
Weather& weather;
|
||||
std::unique_ptr<Frustum> frustumCulling;
|
||||
std::unique_ptr<LineBatch> lineBatch;
|
||||
std::unique_ptr<Batch3D> batch3d;
|
||||
|
|
@ -77,13 +78,11 @@ private:
|
|||
std::unique_ptr<DebugLinesRenderer> debugLines;
|
||||
std::unique_ptr<PrecipitationRenderer> precipitation;
|
||||
std::unique_ptr<CloudsRenderer> cloudsRenderer;
|
||||
Weather weather {};
|
||||
|
||||
float timer = 0.0f;
|
||||
bool debug = false;
|
||||
bool lightsDebug = false;
|
||||
bool gbufferPipeline = false;
|
||||
|
||||
bool dirtySettings = false;
|
||||
|
||||
/// @brief Render block selection lines
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue