diff options
| author | untodesu <kirill@untode.su> | 2025-12-26 23:17:56 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-12-26 23:17:56 +0500 |
| commit | 0f111cf51b00c4e884b7e53b4fd7ff6e38d8af5e (patch) | |
| tree | 90ddefa28b40b6384dd9618bb7573704de2733a9 /src/game/shared/world | |
| parent | 6bb4233d5b2a1688e63c947542e92ec5d5a857a6 (diff) | |
| download | voxelius-0f111cf51b00c4e884b7e53b4fd7ff6e38d8af5e.tar.bz2 voxelius-0f111cf51b00c4e884b7e53b4fd7ff6e38d8af5e.zip | |
Add include guards and header comments to sources
Diffstat (limited to 'src/game/shared/world')
| -rw-r--r-- | src/game/shared/world/chunk.cc | 5 | ||||
| -rw-r--r-- | src/game/shared/world/chunk.hh | 9 | ||||
| -rw-r--r-- | src/game/shared/world/chunk_aabb.hh | 9 | ||||
| -rw-r--r-- | src/game/shared/world/dimension.cc | 5 | ||||
| -rw-r--r-- | src/game/shared/world/dimension.hh | 9 | ||||
| -rw-r--r-- | src/game/shared/world/feature.cc | 5 | ||||
| -rw-r--r-- | src/game/shared/world/feature.hh | 9 | ||||
| -rw-r--r-- | src/game/shared/world/item.cc | 5 | ||||
| -rw-r--r-- | src/game/shared/world/item.hh | 9 | ||||
| -rw-r--r-- | src/game/shared/world/item_registry.cc | 5 | ||||
| -rw-r--r-- | src/game/shared/world/item_registry.hh | 9 | ||||
| -rw-r--r-- | src/game/shared/world/ray_aabb.cc | 5 | ||||
| -rw-r--r-- | src/game/shared/world/ray_aabb.hh | 9 | ||||
| -rw-r--r-- | src/game/shared/world/ray_dda.cc | 5 | ||||
| -rw-r--r-- | src/game/shared/world/ray_dda.hh | 9 | ||||
| -rw-r--r-- | src/game/shared/world/voxel.cc | 5 | ||||
| -rw-r--r-- | src/game/shared/world/voxel.hh | 9 | ||||
| -rw-r--r-- | src/game/shared/world/voxel_registry.cc | 5 | ||||
| -rw-r--r-- | src/game/shared/world/voxel_registry.hh | 9 | ||||
| -rw-r--r-- | src/game/shared/world/voxel_storage.cc | 5 | ||||
| -rw-r--r-- | src/game/shared/world/voxel_storage.hh | 9 |
21 files changed, 149 insertions, 0 deletions
diff --git a/src/game/shared/world/chunk.cc b/src/game/shared/world/chunk.cc index 10da80e..2840fc1 100644 --- a/src/game/shared/world/chunk.cc +++ b/src/game/shared/world/chunk.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: chunk.cc +// Description: A single chunk of voxels + #include "shared/pch.hh" #include "shared/world/chunk.hh" diff --git a/src/game/shared/world/chunk.hh b/src/game/shared/world/chunk.hh index f8e38b4..b0b0604 100644 --- a/src/game/shared/world/chunk.hh +++ b/src/game/shared/world/chunk.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: chunk.hh +// Description: A single chunk of voxels + +#ifndef SHARED_WORLD_CHUNK_HH +#define SHARED_WORLD_CHUNK_HH #pragma once #include "shared/world/voxel_storage.hh" @@ -35,3 +42,5 @@ private: VoxelStorage m_voxels; unsigned int m_biome; }; + +#endif diff --git a/src/game/shared/world/chunk_aabb.hh b/src/game/shared/world/chunk_aabb.hh index 0f8851c..7cf042c 100644 --- a/src/game/shared/world/chunk_aabb.hh +++ b/src/game/shared/world/chunk_aabb.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: chunk_aabb.hh +// Description: Axis-aligned bounding box for chunk-domain coordinates + +#ifndef SHARED_WORLD_CHUNK_AABB_HH +#define SHARED_WORLD_CHUNK_AABB_HH #pragma once #include "core/math/aabb.hh" @@ -5,3 +12,5 @@ #include "shared/types.hh" using ChunkAABB = math::AABB<chunk_pos::value_type>; + +#endif diff --git a/src/game/shared/world/dimension.cc b/src/game/shared/world/dimension.cc index 84ca539..393aa0c 100644 --- a/src/game/shared/world/dimension.cc +++ b/src/game/shared/world/dimension.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: dimension.cc +// Description: A single world + #include "shared/pch.hh" #include "shared/world/dimension.hh" diff --git a/src/game/shared/world/dimension.hh b/src/game/shared/world/dimension.hh index b57640a..9845c5a 100644 --- a/src/game/shared/world/dimension.hh +++ b/src/game/shared/world/dimension.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: dimension.hh +// Description: A single world + +#ifndef SHARED_WORLD_DIMENSION_HH +#define SHARED_WORLD_DIMENSION_HH #pragma once #include "shared/const.hh" @@ -81,3 +88,5 @@ struct VoxelSetEvent final { local_pos lpos; Chunk* chunk; }; + +#endif diff --git a/src/game/shared/world/feature.cc b/src/game/shared/world/feature.cc index 3974082..1226b1f 100644 --- a/src/game/shared/world/feature.cc +++ b/src/game/shared/world/feature.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: feature.cc +// Description: A world generation feature + #include "shared/pch.hh" #include "shared/world/feature.hh" diff --git a/src/game/shared/world/feature.hh b/src/game/shared/world/feature.hh index b80869d..820ddc7 100644 --- a/src/game/shared/world/feature.hh +++ b/src/game/shared/world/feature.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: feature.hh +// Description: A world generation feature + +#ifndef SHARED_WORLD_FEATURE_HH +#define SHARED_WORLD_FEATURE_HH #pragma once #include "shared/types.hh" @@ -17,3 +24,5 @@ public: void place(const voxel_pos& vpos, const chunk_pos& cpos, Chunk& chunk) const; void place(const voxel_pos& vpos, const chunk_pos& cpos, VoxelStorage& voxels) const; }; + +#endif diff --git a/src/game/shared/world/item.cc b/src/game/shared/world/item.cc index bc1546a..207e9da 100644 --- a/src/game/shared/world/item.cc +++ b/src/game/shared/world/item.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: item.cc +// Description: Item metadata + #include "shared/pch.hh" #include "shared/world/item.hh" diff --git a/src/game/shared/world/item.hh b/src/game/shared/world/item.hh index bcec37a..3786b19 100644 --- a/src/game/shared/world/item.hh +++ b/src/game/shared/world/item.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: item.hh +// Description: Item metadata + +#ifndef SHARED_WORLD_ITEM_HH +#define SHARED_WORLD_ITEM_HH #pragma once #include "core/resource/resource.hh" @@ -73,3 +80,5 @@ constexpr resource_ptr<TextureGUI>& Item::get_cached_texture(void) const noexcep { return m_cached_texture; } + +#endif diff --git a/src/game/shared/world/item_registry.cc b/src/game/shared/world/item_registry.cc index c7d8d9b..6f5a8a0 100644 --- a/src/game/shared/world/item_registry.cc +++ b/src/game/shared/world/item_registry.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: item_registry.cc +// Description: Registry for all the items in the game + #include "shared/pch.hh" #include "shared/world/item_registry.hh" diff --git a/src/game/shared/world/item_registry.hh b/src/game/shared/world/item_registry.hh index f8fe641..588211d 100644 --- a/src/game/shared/world/item_registry.hh +++ b/src/game/shared/world/item_registry.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: item_registry.hh +// Description: Registry for all the items in the game + +#ifndef SHARED_WORLD_ITEM_REGISTRY_HH +#define SHARED_WORLD_ITEM_REGISTRY_HH #pragma once #include "shared/world/item.hh" @@ -24,3 +31,5 @@ namespace item_registry { std::uint64_t get_checksum(void); } // namespace item_registry + +#endif diff --git a/src/game/shared/world/ray_aabb.cc b/src/game/shared/world/ray_aabb.cc index f6f2638..9bc2ee0 100644 --- a/src/game/shared/world/ray_aabb.cc +++ b/src/game/shared/world/ray_aabb.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: ray_aabb.cc +// Description: Check ray intersections against an AABB + #include "shared/pch.hh" #include "shared/world/ray_aabb.hh" diff --git a/src/game/shared/world/ray_aabb.hh b/src/game/shared/world/ray_aabb.hh index 49c0846..640a02c 100644 --- a/src/game/shared/world/ray_aabb.hh +++ b/src/game/shared/world/ray_aabb.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: ray_aabb.hh +// Description: Check ray intersections against an AABB + +#ifndef SHARED_WORLD_RAY_AABB_HH +#define SHARED_WORLD_RAY_AABB_HH #pragma once #include "core/math/aabb.hh" @@ -28,3 +35,5 @@ constexpr const glm::fvec3& RayAABB::direction(void) const noexcept { return m_direction; } + +#endif diff --git a/src/game/shared/world/ray_dda.cc b/src/game/shared/world/ray_dda.cc index 5dbf82e..45480b8 100644 --- a/src/game/shared/world/ray_dda.cc +++ b/src/game/shared/world/ray_dda.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: ray_dda.cc +// Description: Fast voxel grid traversal with an arbitrary starting position + #include "shared/pch.hh" #include "shared/world/ray_dda.hh" diff --git a/src/game/shared/world/ray_dda.hh b/src/game/shared/world/ray_dda.hh index 72f746e..c3cbb09 100644 --- a/src/game/shared/world/ray_dda.hh +++ b/src/game/shared/world/ray_dda.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: ray_dda.hh +// Description: Fast voxel grid traversal with an arbitrary starting position + +#ifndef SHARED_WORLD_RAY_DDA_HH +#define SHARED_WORLD_RAY_DDA_HH #pragma once #include "shared/types.hh" @@ -30,3 +37,5 @@ public: voxel_pos vnormal; voxel_pos vpos; }; + +#endif diff --git a/src/game/shared/world/voxel.cc b/src/game/shared/world/voxel.cc index 4f47c2d..71ef7b8 100644 --- a/src/game/shared/world/voxel.cc +++ b/src/game/shared/world/voxel.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: voxel.cc +// Description: Voxel metadata... A metavoxel! + #include "shared/pch.hh" #include "shared/world/voxel.hh" diff --git a/src/game/shared/world/voxel.hh b/src/game/shared/world/voxel.hh index 0a8c4a3..8f6e344 100644 --- a/src/game/shared/world/voxel.hh +++ b/src/game/shared/world/voxel.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: voxel.hh +// Description: Voxel metadata... A metavoxel! + +#ifndef SHARED_WORLD_VOXEL_HH +#define SHARED_WORLD_VOXEL_HH #pragma once #include "core/math/aabb.hh" @@ -269,3 +276,5 @@ constexpr bool Voxel::is_surface_material(void) const noexcept { return m_surface_material == Material; } + +#endif diff --git a/src/game/shared/world/voxel_registry.cc b/src/game/shared/world/voxel_registry.cc index f950a4d..530b100 100644 --- a/src/game/shared/world/voxel_registry.cc +++ b/src/game/shared/world/voxel_registry.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: voxel_registry.cc +// Description: Registry for all the voxels in the game + #include "shared/pch.hh" #include "shared/world/voxel_registry.hh" diff --git a/src/game/shared/world/voxel_registry.hh b/src/game/shared/world/voxel_registry.hh index 5dbaf50..4e60808 100644 --- a/src/game/shared/world/voxel_registry.hh +++ b/src/game/shared/world/voxel_registry.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: voxel_registry.hh +// Description: Registry for all the voxels in the game + +#ifndef SHARED_WORLD_VOXEL_REGISTRY_HH +#define SHARED_WORLD_VOXEL_REGISTRY_HH #pragma once #include "shared/world/voxel.hh" @@ -24,3 +31,5 @@ namespace voxel_registry { std::uint64_t get_checksum(void); } // namespace voxel_registry + +#endif diff --git a/src/game/shared/world/voxel_storage.cc b/src/game/shared/world/voxel_storage.cc index 43ca116..7890894 100644 --- a/src/game/shared/world/voxel_storage.cc +++ b/src/game/shared/world/voxel_storage.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: voxel_storage.cc +// Description: Storage for voxels in a chunk + #include "shared/pch.hh" #include "shared/world/voxel_storage.hh" diff --git a/src/game/shared/world/voxel_storage.hh b/src/game/shared/world/voxel_storage.hh index ef427b3..e3d149a 100644 --- a/src/game/shared/world/voxel_storage.hh +++ b/src/game/shared/world/voxel_storage.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: voxel_storage.hh +// Description: Storage for voxels in a chunk + +#ifndef SHARED_WORLD_VOXEL_STORAGE_HH +#define SHARED_WORLD_VOXEL_STORAGE_HH #pragma once #include "shared/const.hh" @@ -12,3 +19,5 @@ public: void serialize(WriteBuffer& buffer) const; void deserialize(ReadBuffer& buffer); }; + +#endif |
