diff options
| author | untodesu <kirill@untode.su> | 2025-06-28 01:59:49 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-06-28 01:59:49 +0500 |
| commit | 61e5bcef2629e2d68b805a956a96fff264d4f74d (patch) | |
| tree | bca3a94bac79d34e3c0db57c77604f5a823ecbda /game/client/voxel_atlas.cc | |
| parent | 88c01588aa0830e219eaa62588839e4d1e2883ce (diff) | |
| download | voxelius-61e5bcef2629e2d68b805a956a96fff264d4f74d.tar.bz2 voxelius-61e5bcef2629e2d68b805a956a96fff264d4f74d.zip | |
Restructure dependencies and update to C++20
- Nuked static_assert from almost everywhere in the project
- Nuked binary dependency support. Might add one later though
- Separated dependency headers into a separate include subdirectory
- Grafted a thirdpartylegalnotices.txt generator from RITEG
- Pushed development snapshot version to 2126 (26th week of 2025)
Diffstat (limited to 'game/client/voxel_atlas.cc')
| -rw-r--r-- | game/client/voxel_atlas.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/game/client/voxel_atlas.cc b/game/client/voxel_atlas.cc index 0ce872f..ef996e2 100644 --- a/game/client/voxel_atlas.cc +++ b/game/client/voxel_atlas.cc @@ -71,7 +71,8 @@ static AtlasStrip* plane_new_strip(AtlasPlane& plane, const std::vector<std::str } const std::size_t offset = strip.offset + i; - glTexSubImage3D(GL_TEXTURE_2D_ARRAY, 0, 0, 0, offset, image->size.x, image->size.y, 1, GL_RGBA, GL_UNSIGNED_BYTE, image->pixels); + glTexSubImage3D( + GL_TEXTURE_2D_ARRAY, 0, 0, 0, offset, image->size.x, image->size.y, 1, GL_RGBA, GL_UNSIGNED_BYTE, image->pixels); } } @@ -87,19 +88,19 @@ void voxel_atlas::create(int width, int height, std::size_t count) { GLint max_plane_layers; - atlas_width = 1 << cxpr::log2(width); - atlas_height = 1 << cxpr::log2(height); + atlas_width = 1 << vx::log2(width); + atlas_height = 1 << vx::log2(height); // Clipping this at OpenGL 4.5 limit of 2048 is important due to // how voxel quad meshes are packed in memory: each texture index is // confined in 11 bits so having bigger atlas planes makes no sense; glGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, &max_plane_layers); - max_plane_layers = cxpr::clamp(max_plane_layers, 256, 2048); + max_plane_layers = vx::clamp(max_plane_layers, 256, 2048); for(long i = count; i > 0L; i -= max_plane_layers) { AtlasPlane plane = {}; plane.plane_id = planes.size(); - plane.layer_count_max = cxpr::min<std::size_t>(max_plane_layers, i); + plane.layer_count_max = vx::min<std::size_t>(max_plane_layers, i); plane.layer_count = 0; const std::size_t save_id = plane.plane_id; |
