add SurroundMap intergration to world generator (WIP)
This commit is contained in:
@@ -35,7 +35,11 @@ ChunksController::ChunksController(Level* level, uint padding)
|
||||
|
||||
ChunksController::~ChunksController() = default;
|
||||
|
||||
void ChunksController::update(int64_t maxDuration) {
|
||||
void ChunksController::update(
|
||||
int64_t maxDuration, int loadDistance, int centerX, int centerY
|
||||
) {
|
||||
generator->update(centerX, centerY, loadDistance);
|
||||
|
||||
int64_t mcstotal = 0;
|
||||
|
||||
for (uint i = 0; i < MAX_WORK_PER_FRAME; i++) {
|
||||
|
||||
@@ -28,5 +28,9 @@ public:
|
||||
~ChunksController();
|
||||
|
||||
/// @param maxDuration milliseconds reserved for chunks loading
|
||||
void update(int64_t maxDuration);
|
||||
void update(
|
||||
int64_t maxDuration,
|
||||
int loadDistance,
|
||||
int centerX,
|
||||
int centerY);
|
||||
};
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "settings.hpp"
|
||||
#include "world/Level.hpp"
|
||||
#include "world/World.hpp"
|
||||
#include "maths/voxmaths.hpp"
|
||||
#include "scripting/scripting.hpp"
|
||||
|
||||
static debug::Logger logger("level-control");
|
||||
@@ -38,7 +39,10 @@ void LevelController::update(float delta, bool input, bool pause) {
|
||||
position.z,
|
||||
settings.chunks.loadDistance.get() + settings.chunks.padding.get() * 2
|
||||
);
|
||||
chunks->update(settings.chunks.loadSpeed.get());
|
||||
chunks->update(
|
||||
settings.chunks.loadSpeed.get(), settings.chunks.loadDistance.get(),
|
||||
floordiv(position.x, CHUNK_W), floordiv(position.z, CHUNK_D)
|
||||
);
|
||||
|
||||
if (!pause) {
|
||||
// update all objects that needed
|
||||
|
||||
Reference in New Issue
Block a user