++Performance;

This commit is contained in:
MarcEricMartel
2022-04-06 23:07:24 -04:00
parent 16a67035d0
commit 5c30cdf26d
20 changed files with 58 additions and 53 deletions

View File

@@ -304,9 +304,9 @@ void World::RenderWorld(int& rendercount, Player& player, Transformation& world,
void World::UpdateWorld(Player& player, BlockInfo* blockinfo[BTYPE_LAST]) {
int cx = player.GetPosition().x;
int cy = player.GetPosition().z;
static int frameGenerate = 0;
static int frameUpdate = 0;
static int frameDelete = 0;
static int frameGenerate = 1;
static int frameUpdate = 2;
static int frameDelete = 3;
int side = 0;
int threads = 0;
std::future<Chunk*> genThList[THREADS_GENERATE_CHUNKS];
@@ -316,7 +316,7 @@ void World::UpdateWorld(Player& player, BlockInfo* blockinfo[BTYPE_LAST]) {
if (frameGenerate > 0) --frameGenerate;
if (frameUpdate > 0) --frameUpdate;
if (frameDelete > 0) --frameDelete;
if (!frameGenerate)
while (side * CHUNK_SIZE_X <= VIEW_DISTANCE * 2 + CHUNK_SIZE_X) {
int tx = -side, ty = -side;