Génération de Chunks en multithreads

This commit is contained in:
MarcEricMartel
2021-12-12 23:31:38 -05:00
parent f4ec4816af
commit 7eb9f44d41
8 changed files with 223 additions and 115 deletions

View File

@@ -13,6 +13,8 @@
#include <fstream>
#include <string>
#include <vector>
#include <future>
#include <thread>
class Chunk;
class Player;
@@ -44,8 +46,7 @@ private:
int m_center[2] = { INT16_MAX / 2 - WORLD_SIZE_X / 2, INT16_MAX / 2 - WORLD_SIZE_Y / 2 };
bool GenerateChunk(int x, int y, Perlin& perlin);
void UpdateChunk(int& generates, int& updates, int chx, int chy, Perlin& perlin, BlockInfo* blockinfo[BTYPE_LAST]);
void UpdateChunk(int& updates, int chx, int chy, BlockInfo* blockinfo[BTYPE_LAST]);
void RenderWorld(int& rendercount, Player& player, Transformation& world, Shader& shader);
void UpdateWorld(Player& player, Perlin& perlin, BlockInfo* blockinfo[BTYPE_LAST]);
void TransposeWorld(Player& player, Bullet* bullets[MAX_BULLETS]);