mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
other optimizations
This commit is contained in:
parent
8c918ff136
commit
b399679c31
6 changed files with 21 additions and 21 deletions
|
|
@ -121,8 +121,8 @@ void WorldRenderer::drawChunks(Chunks* chunks, Camera* camera, Shader* shader) {
|
|||
continue;
|
||||
indices.push_back(i);
|
||||
}
|
||||
int px = camera->position.x / (float)CHUNK_W - 0.5f;
|
||||
int pz = camera->position.z / (float)CHUNK_D - 0.5f;
|
||||
float px = camera->position.x / (float)CHUNK_W - 0.5f;
|
||||
float pz = camera->position.z / (float)CHUNK_D - 0.5f;
|
||||
std::sort(indices.begin(), indices.end(), [chunks, px, pz](auto i, auto j) {
|
||||
const auto& a = chunks->chunks[i];
|
||||
const auto& b = chunks->chunks[j];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue