summaryrefslogtreecommitdiffstats
path: root/src/game/client/world
diff options
context:
space:
mode:
authoruntodesu <kirill@untode.su>2025-12-26 23:17:56 +0500
committeruntodesu <kirill@untode.su>2025-12-26 23:17:56 +0500
commit0f111cf51b00c4e884b7e53b4fd7ff6e38d8af5e (patch)
tree90ddefa28b40b6384dd9618bb7573704de2733a9 /src/game/client/world
parent6bb4233d5b2a1688e63c947542e92ec5d5a857a6 (diff)
downloadvoxelius-0f111cf51b00c4e884b7e53b4fd7ff6e38d8af5e.tar.bz2
voxelius-0f111cf51b00c4e884b7e53b4fd7ff6e38d8af5e.zip
Add include guards and header comments to sources
Diffstat (limited to 'src/game/client/world')
-rw-r--r--src/game/client/world/chunk_mesher.cc5
-rw-r--r--src/game/client/world/chunk_mesher.hh9
-rw-r--r--src/game/client/world/chunk_quad.hh9
-rw-r--r--src/game/client/world/chunk_renderer.cc5
-rw-r--r--src/game/client/world/chunk_renderer.hh9
-rw-r--r--src/game/client/world/chunk_vbo.hh9
-rw-r--r--src/game/client/world/chunk_visibility.cc5
-rw-r--r--src/game/client/world/chunk_visibility.hh9
-rw-r--r--src/game/client/world/outline.cc5
-rw-r--r--src/game/client/world/outline.hh9
-rw-r--r--src/game/client/world/player_target.cc5
-rw-r--r--src/game/client/world/player_target.hh9
-rw-r--r--src/game/client/world/skybox.cc5
-rw-r--r--src/game/client/world/skybox.hh9
-rw-r--r--src/game/client/world/voxel_anims.cc5
-rw-r--r--src/game/client/world/voxel_anims.hh9
-rw-r--r--src/game/client/world/voxel_atlas.cc7
-rw-r--r--src/game/client/world/voxel_atlas.hh9
-rw-r--r--src/game/client/world/voxel_sounds.cc5
-rw-r--r--src/game/client/world/voxel_sounds.hh9
20 files changed, 145 insertions, 1 deletions
diff --git a/src/game/client/world/chunk_mesher.cc b/src/game/client/world/chunk_mesher.cc
index 47ef4cb..a7cf4ee 100644
--- a/src/game/client/world/chunk_mesher.cc
+++ b/src/game/client/world/chunk_mesher.cc
@@ -1,3 +1,8 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: chunk_mesher.cc
+// Description: Threaded voxel mesh generation
+
#include "client/pch.hh"
#include "client/world/chunk_mesher.hh"
diff --git a/src/game/client/world/chunk_mesher.hh b/src/game/client/world/chunk_mesher.hh
index d3ead5c..0a4639d 100644
--- a/src/game/client/world/chunk_mesher.hh
+++ b/src/game/client/world/chunk_mesher.hh
@@ -1,3 +1,10 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: chunk_mesher.hh
+// Description: Threaded voxel mesh generation
+
+#ifndef CLIENT_WORLD_CHUNK_MESHER_HH
+#define CLIENT_WORLD_CHUNK_MESHER_HH
#pragma once
#include "client/world/chunk_vbo.hh"
@@ -13,3 +20,5 @@ void init(void);
void shutdown(void);
void update(void);
} // namespace chunk_mesher
+
+#endif
diff --git a/src/game/client/world/chunk_quad.hh b/src/game/client/world/chunk_quad.hh
index a28193a..3fc3750 100644
--- a/src/game/client/world/chunk_quad.hh
+++ b/src/game/client/world/chunk_quad.hh
@@ -1,3 +1,10 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: chunk_quad.hh
+// Description: Packed quad vertex format
+
+#ifndef CLIENT_WORLD_CHUNK_QUAD_HH
+#define CLIENT_WORLD_CHUNK_QUAD_HH
#pragma once
#include "core/math/constexpr.hh"
@@ -33,3 +40,5 @@ constexpr inline static ChunkQuad make_chunk_quad(const glm::fvec3& position, co
return result;
}
+
+#endif
diff --git a/src/game/client/world/chunk_renderer.cc b/src/game/client/world/chunk_renderer.cc
index ea85eee..9ea6799 100644
--- a/src/game/client/world/chunk_renderer.cc
+++ b/src/game/client/world/chunk_renderer.cc
@@ -1,3 +1,8 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: chunk_renderer.cc
+// Description: Chunk mesh rendering
+
#include "client/pch.hh"
#include "client/world/chunk_renderer.hh"
diff --git a/src/game/client/world/chunk_renderer.hh b/src/game/client/world/chunk_renderer.hh
index 53272a4..ce077cd 100644
--- a/src/game/client/world/chunk_renderer.hh
+++ b/src/game/client/world/chunk_renderer.hh
@@ -1,3 +1,10 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: chunk_renderer.hh
+// Description: Chunk mesh rendering
+
+#ifndef CLIENT_WORLD_CHUNK_RENDERER_HH
+#define CLIENT_WORLD_CHUNK_RENDERER_HH
#pragma once
namespace chunk_renderer
@@ -6,3 +13,5 @@ void init(void);
void shutdown(void);
void render(void);
} // namespace chunk_renderer
+
+#endif
diff --git a/src/game/client/world/chunk_vbo.hh b/src/game/client/world/chunk_vbo.hh
index da8270e..e9061d8 100644
--- a/src/game/client/world/chunk_vbo.hh
+++ b/src/game/client/world/chunk_vbo.hh
@@ -1,3 +1,10 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: chunk_vbo.hh
+// Description: Utility wrapper for OpenGL VBOs
+
+#ifndef CLIENT_WORLD_CHUNK_VBO_HH
+#define CLIENT_WORLD_CHUNK_VBO_HH
#pragma once
class ChunkVBO final {
@@ -17,3 +24,5 @@ public:
}
}
};
+
+#endif
diff --git a/src/game/client/world/chunk_visibility.cc b/src/game/client/world/chunk_visibility.cc
index 5af2901..407ee69 100644
--- a/src/game/client/world/chunk_visibility.cc
+++ b/src/game/client/world/chunk_visibility.cc
@@ -1,3 +1,8 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: chunk_visibility.cc
+// Description: Discard chunks out of view
+
#include "client/pch.hh"
#include "client/world/chunk_visibility.hh"
diff --git a/src/game/client/world/chunk_visibility.hh b/src/game/client/world/chunk_visibility.hh
index d0b4487..a8fcc20 100644
--- a/src/game/client/world/chunk_visibility.hh
+++ b/src/game/client/world/chunk_visibility.hh
@@ -1,6 +1,15 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: chunk_visibility.hh
+// Description: Discard chunks out of view
+
+#ifndef CLIENT_WORLD_CHUNK_VISIBILITY_HH
+#define CLIENT_WORLD_CHUNK_VISIBILITY_HH
#pragma once
namespace chunk_visibility
{
void update_late(void);
} // namespace chunk_visibility
+
+#endif
diff --git a/src/game/client/world/outline.cc b/src/game/client/world/outline.cc
index d4980c2..5e2a7cb 100644
--- a/src/game/client/world/outline.cc
+++ b/src/game/client/world/outline.cc
@@ -1,3 +1,8 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: outline.cc
+// Description: Debug-esque line rendering
+
#include "client/pch.hh"
#include "client/world/outline.hh"
diff --git a/src/game/client/world/outline.hh b/src/game/client/world/outline.hh
index 8fdfdeb..e2e2dfb 100644
--- a/src/game/client/world/outline.hh
+++ b/src/game/client/world/outline.hh
@@ -1,3 +1,10 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: outline.hh
+// Description: Debug-esque line rendering
+
+#ifndef CLIENT_WORLD_OUTLINE_HH
+#define CLIENT_WORLD_OUTLINE_HH
#pragma once
#include "shared/types.hh"
@@ -14,3 +21,5 @@ namespace outline
void cube(const chunk_pos& cpos, const glm::fvec3& fpos, const glm::fvec3& size, float thickness, const glm::fvec4& color);
void line(const chunk_pos& cpos, const glm::fvec3& fpos, const glm::fvec3& size, float thickness, const glm::fvec4& color);
} // namespace outline
+
+#endif
diff --git a/src/game/client/world/player_target.cc b/src/game/client/world/player_target.cc
index c8a7583..b1be8e7 100644
--- a/src/game/client/world/player_target.cc
+++ b/src/game/client/world/player_target.cc
@@ -1,3 +1,8 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: player_target.cc
+// Description: Handle logic for targeting voxels
+
#include "client/pch.hh"
#include "client/world/player_target.hh"
diff --git a/src/game/client/world/player_target.hh b/src/game/client/world/player_target.hh
index 2c8bd22..f160bb3 100644
--- a/src/game/client/world/player_target.hh
+++ b/src/game/client/world/player_target.hh
@@ -1,3 +1,10 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: player_target.hh
+// Description: Handle logic for targeting voxels
+
+#ifndef CLIENT_WORLD_PLAYER_TARGET_HH
+#define CLIENT_WORLD_PLAYER_TARGET_HH
#pragma once
#include "shared/world/voxel_registry.hh"
@@ -15,3 +22,5 @@ void init(void);
void update(void);
void render(void);
} // namespace player_target
+
+#endif
diff --git a/src/game/client/world/skybox.cc b/src/game/client/world/skybox.cc
index 393c260..8c97dc6 100644
--- a/src/game/client/world/skybox.cc
+++ b/src/game/client/world/skybox.cc
@@ -1,3 +1,8 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: skybox.cc
+// Description: Skybox rendering
+
#include "client/pch.hh"
#include "client/world/skybox.hh"
diff --git a/src/game/client/world/skybox.hh b/src/game/client/world/skybox.hh
index d90336a..421b891 100644
--- a/src/game/client/world/skybox.hh
+++ b/src/game/client/world/skybox.hh
@@ -1,3 +1,10 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: skybox.hh
+// Description: Skybox rendering
+
+#ifndef CLIENT_WORLD_SKYBOX_HH
+#define CLIENT_WORLD_SKYBOX_HH
#pragma once
namespace skybox
@@ -9,3 +16,5 @@ namespace skybox
{
void init(void);
} // namespace skybox
+
+#endif
diff --git a/src/game/client/world/voxel_anims.cc b/src/game/client/world/voxel_anims.cc
index 2286027..6af5eaa 100644
--- a/src/game/client/world/voxel_anims.cc
+++ b/src/game/client/world/voxel_anims.cc
@@ -1,3 +1,8 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: voxel_anims.cc
+// Description: Voxel texture animations framerate control
+
#include "client/pch.hh"
#include "client/world/voxel_anims.hh"
diff --git a/src/game/client/world/voxel_anims.hh b/src/game/client/world/voxel_anims.hh
index 63a4fc1..76df53d 100644
--- a/src/game/client/world/voxel_anims.hh
+++ b/src/game/client/world/voxel_anims.hh
@@ -1,3 +1,10 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: voxel_anims.hh
+// Description: Voxel texture animations framerate control
+
+#ifndef CLIENT_WORLD_VOXEL_ANIMS_HH
+#define CLIENT_WORLD_VOXEL_ANIMS_HH
#pragma once
namespace voxel_anims
@@ -11,3 +18,5 @@ namespace voxel_anims
void init(void);
void update(void);
} // namespace voxel_anims
+
+#endif
diff --git a/src/game/client/world/voxel_atlas.cc b/src/game/client/world/voxel_atlas.cc
index 9762998..ee3bca7 100644
--- a/src/game/client/world/voxel_atlas.cc
+++ b/src/game/client/world/voxel_atlas.cc
@@ -1,3 +1,8 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: voxel_atlas.cc
+// Description: Multi-array-texture that acts like a spritesheet
+
#include "client/pch.hh"
#include "client/world/voxel_atlas.hh"
@@ -66,7 +71,7 @@ static AtlasStrip* plane_new_strip(AtlasPlane& plane, const std::vector<std::str
glBindTexture(GL_TEXTURE_2D_ARRAY, plane.gl_texture);
for(std::size_t i = 0; i < paths.size(); ++i) {
- if(auto image = resource::load<Image>(paths[i].c_str(), IMAGE_LOAD_FLIP)) {
+ if(auto image = resource::load<Image>(paths[i].c_str(), IMGFLAG_FLIP)) {
if((image->size.x != atlas_width) || (image->size.y != atlas_height)) {
spdlog::warn("atlas: {}: size mismatch", paths[i]);
continue;
diff --git a/src/game/client/world/voxel_atlas.hh b/src/game/client/world/voxel_atlas.hh
index acfcfbd..ae04d7b 100644
--- a/src/game/client/world/voxel_atlas.hh
+++ b/src/game/client/world/voxel_atlas.hh
@@ -1,3 +1,10 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: voxel_atlas.hh
+// Description: Multi-array-texture that acts like a spritesheet
+
+#ifndef CLIENT_WORLD_VOXEL_ATLAS_HH
+#define CLIENT_WORLD_VOXEL_ATLAS_HH
#pragma once
struct AtlasStrip final {
@@ -23,3 +30,5 @@ namespace voxel_atlas
AtlasStrip* find_or_load(const std::vector<std::string>& paths);
AtlasStrip* find(const std::vector<std::string>& paths);
} // namespace voxel_atlas
+
+#endif
diff --git a/src/game/client/world/voxel_sounds.cc b/src/game/client/world/voxel_sounds.cc
index b60df94..86aa8ee 100644
--- a/src/game/client/world/voxel_sounds.cc
+++ b/src/game/client/world/voxel_sounds.cc
@@ -1,3 +1,8 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: voxel_sounds.cc
+// Description: Handle voxel sounds
+
#include "client/pch.hh"
#include "client/world/voxel_sounds.hh"
diff --git a/src/game/client/world/voxel_sounds.hh b/src/game/client/world/voxel_sounds.hh
index 1b14698..1ed57e2 100644
--- a/src/game/client/world/voxel_sounds.hh
+++ b/src/game/client/world/voxel_sounds.hh
@@ -1,3 +1,10 @@
+// SPDX-License-Identifier: BSD-2-Clause
+// Copyright (c) 2025 Kirill Dmitrievich
+// File: voxel_sounds.hh
+// Description: Handle voxel sounds
+
+#ifndef CLIENT_WORLD_VOXEL_SOUNDS_HH
+#define CLIENT_WORLD_VOXEL_SOUNDS_HH
#pragma once
#include "core/resource/resource.hh"
@@ -17,3 +24,5 @@ namespace voxel_sounds
resource_ptr<SoundEffect> get_footsteps(VoxelMaterial material);
resource_ptr<SoundEffect> get_placebreak(VoxelMaterial material);
} // namespace voxel_sounds
+
+#endif