optimize it even more

This commit is contained in:
MihailRis
2024-11-13 04:46:21 +03:00
parent a21d87717e
commit fc3d5c5484
3 changed files with 33 additions and 21 deletions
+10 -1
View File
@@ -34,6 +34,15 @@ namespace model {
struct Model;
}
struct ChunksSortEntry {
int index;
int d;
inline bool operator<(const ChunksSortEntry& o) const noexcept {
return d > o.d;
}
};
class WorldRenderer {
Engine* engine;
Level* level;
@@ -45,7 +54,7 @@ class WorldRenderer {
std::unique_ptr<Batch3D> batch3d;
std::unique_ptr<ModelBatch> modelBatch;
std::vector<size_t> indices;
std::vector<ChunksSortEntry> indices;
float timer = 0.0f;