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 | |
| parent | 6bb4233d5b2a1688e63c947542e92ec5d5a857a6 (diff) | |
| download | voxelius-0f111cf51b00c4e884b7e53b4fd7ff6e38d8af5e.tar.bz2 voxelius-0f111cf51b00c4e884b7e53b4fd7ff6e38d8af5e.zip | |
Add include guards and header comments to sources
Diffstat (limited to 'src')
222 files changed, 1641 insertions, 39 deletions
diff --git a/src/core/config/boolean.cc b/src/core/config/boolean.cc index 45d5a38..74c7b07 100644 --- a/src/core/config/boolean.cc +++ b/src/core/config/boolean.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: boolean.cc +// Description: Boolean config value + #include "core/pch.hh" #include "core/config/boolean.hh" diff --git a/src/core/config/boolean.hh b/src/core/config/boolean.hh index cfd8b0b..238b978 100644 --- a/src/core/config/boolean.hh +++ b/src/core/config/boolean.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: boolean.hh +// Description: Boolean config value + +#ifndef CORE_CONFIG_BOOLEAN_HH +#define CORE_CONFIG_BOOLEAN_HH #pragma once #include "core/config/ivalue.hh" @@ -23,3 +30,5 @@ public: static bool from_string(std::string_view value); }; } // namespace config + +#endif diff --git a/src/core/config/ivalue.hh b/src/core/config/ivalue.hh index 13e9a3a..088276a 100644 --- a/src/core/config/ivalue.hh +++ b/src/core/config/ivalue.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: ivalue.hh +// Description: Base config value interface + +#ifndef CORE_CONFIG_IVALUE_HH +#define CORE_CONFIG_IVALUE_HH #pragma once namespace config @@ -9,3 +16,5 @@ public: virtual std::string_view get(void) const = 0; }; } // namespace config + +#endif diff --git a/src/core/config/number.hh b/src/core/config/number.hh index 4f185e1..eb1f462 100644 --- a/src/core/config/number.hh +++ b/src/core/config/number.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: number.hh +// Description: Arithmetic config value + +#ifndef CORE_CONFIG_NUMBER_HH +#define CORE_CONFIG_NUMBER_HH #pragma once #include "core/config/ivalue.hh" @@ -128,3 +135,5 @@ inline void config::Number<T>::set_limits(T min_value, T max_value) m_value = std::clamp(m_value, m_min_value, m_max_value); m_string = std::to_string(m_value); } + +#endif diff --git a/src/core/config/string.cc b/src/core/config/string.cc index 198b448..e5820f6 100644 --- a/src/core/config/string.cc +++ b/src/core/config/string.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: string.cc +// Description: String config value + #include "core/pch.hh" #include "core/config/string.hh" diff --git a/src/core/config/string.hh b/src/core/config/string.hh index 8fd3901..faecb67 100644 --- a/src/core/config/string.hh +++ b/src/core/config/string.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: string.hh +// Description: String config value + +#ifndef CORE_CONFIG_STRING_HH +#define CORE_CONFIG_STRING_HH #pragma once #include "core/config/ivalue.hh" @@ -29,3 +36,5 @@ constexpr const char* config::String::c_str(void) const noexcept { return m_value.c_str(); } + +#endif diff --git a/src/core/io/buffer.cc b/src/core/io/buffer.cc index d0fda49..dffd9bc 100644 --- a/src/core/io/buffer.cc +++ b/src/core/io/buffer.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: buffer.cc +// Description: QDataStream-esque buffer + #include "core/pch.hh" #include "core/io/buffer.hh" diff --git a/src/core/io/buffer.hh b/src/core/io/buffer.hh index 450a86f..100a933 100644 --- a/src/core/io/buffer.hh +++ b/src/core/io/buffer.hh @@ -1,3 +1,12 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: buffer.hh +// Description: QDataStream-esque buffer + +#ifndef CORE_IO_BUFFER_HH +#define CORE_IO_BUFFER_HH +#pragma once + class ReadBuffer final { public: ReadBuffer(void) = default; @@ -80,3 +89,5 @@ WriteBuffer& WriteBuffer::operator<<(const T value) write<T>(value); return *this; } + +#endif diff --git a/src/core/io/cmdline.cc b/src/core/io/cmdline.cc index d206cb8..0d1206a 100644 --- a/src/core/io/cmdline.cc +++ b/src/core/io/cmdline.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: cmdline.cc +// Description: Command-line arguments parser + #include "core/pch.hh" #include "core/io/cmdline.hh" diff --git a/src/core/io/cmdline.hh b/src/core/io/cmdline.hh index c0d6db2..452072f 100644 --- a/src/core/io/cmdline.hh +++ b/src/core/io/cmdline.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: cmdline.hh +// Description: Command-line arguments parser + +#ifndef CORE_IO_CMDLINE_HH +#define CORE_IO_CMDLINE_HH #pragma once namespace cmdline @@ -9,3 +16,5 @@ std::string_view get(std::string_view option, std::string_view fallback = ""); const char* get_cstr(std::string_view option, const char* fallback = nullptr); bool contains(std::string_view option); } // namespace cmdline + +#endif diff --git a/src/core/io/config_map.cc b/src/core/io/config_map.cc index 8634fd6..93fab2b 100644 --- a/src/core/io/config_map.cc +++ b/src/core/io/config_map.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: config_map.cc +// Description: Config parser + #include "core/pch.hh" #include "core/io/config_map.hh" diff --git a/src/core/io/config_map.hh b/src/core/io/config_map.hh index 898103b..2e3f18f 100644 --- a/src/core/io/config_map.hh +++ b/src/core/io/config_map.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: config_map.hh +// Description: Config parser + +#ifndef CORE_IO_CONFIG_MAP_HH +#define CORE_IO_CONFIG_MAP_HH #pragma once namespace config @@ -24,3 +31,5 @@ public: private: std::unordered_map<std::string, config::IValue*> m_values; }; + +#endif diff --git a/src/core/io/physfs.cc b/src/core/io/physfs.cc index b9fe91e..04aaf64 100644 --- a/src/core/io/physfs.cc +++ b/src/core/io/physfs.cc @@ -1,13 +1,18 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: physfs.cc +// Description: PhysFS utilities + #include "core/pch.hh" #include "core/io/physfs.hh" -bool read_file(std::string_view path, std::vector<std::byte>& buffer) +bool physfs::read_file(std::string_view path, std::vector<std::byte>& buffer) { auto file = PHYSFS_openRead(std::string(path).c_str()); if(file == nullptr) { - spdlog::error("physfs: {}: {}", path, physfs_error()); + spdlog::error("physfs: {}: {}", path, physfs::last_error()); return false; } @@ -20,12 +25,12 @@ bool read_file(std::string_view path, std::vector<std::byte>& buffer) return true; } -bool read_file(std::string_view path, std::string& buffer) +bool physfs::read_file(std::string_view path, std::string& buffer) { auto file = PHYSFS_openRead(std::string(path).c_str()); if(file == nullptr) { - spdlog::error("physfs: {}: {}", path, physfs_error()); + spdlog::error("physfs: {}: {}", path, physfs::last_error()); return false; } @@ -38,12 +43,12 @@ bool read_file(std::string_view path, std::string& buffer) return true; } -bool write_file(std::string_view path, const std::vector<std::byte>& buffer) +bool physfs::write_file(std::string_view path, const std::vector<std::byte>& buffer) { auto file = PHYSFS_openWrite(std::string(path).c_str()); if(file == nullptr) { - spdlog::error("physfs: {}: {}", path, physfs_error()); + spdlog::error("physfs: {}: {}", path, physfs::last_error()); return false; } @@ -53,12 +58,12 @@ bool write_file(std::string_view path, const std::vector<std::byte>& buffer) return true; } -bool write_file(std::string_view path, const std::string& buffer) +bool physfs::write_file(std::string_view path, const std::string& buffer) { auto file = PHYSFS_openWrite(std::string(path).c_str()); if(file == nullptr) { - spdlog::error("physfs: {}: {}", path, physfs_error()); + spdlog::error("physfs: {}: {}", path, physfs::last_error()); return false; } @@ -68,7 +73,7 @@ bool write_file(std::string_view path, const std::string& buffer) return true; } -std::string_view physfs_error(void) +std::string_view physfs::last_error(void) { auto error_code = PHYSFS_getLastErrorCode(); auto error_string = PHYSFS_getErrorByCode(error_code); diff --git a/src/core/io/physfs.hh b/src/core/io/physfs.hh index 88f97de..8cf84be 100644 --- a/src/core/io/physfs.hh +++ b/src/core/io/physfs.hh @@ -1,8 +1,23 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: physfs.hh +// Description: PhysFS utilities + +#ifndef CORE_IO_PHYSFS_HH +#define CORE_IO_PHYSFS_HH #pragma once +namespace physfs +{ bool read_file(std::string_view path, std::vector<std::byte>& buffer); bool read_file(std::string_view path, std::string& buffer); bool write_file(std::string_view path, const std::vector<std::byte>& buffer); bool write_file(std::string_view path, const std::string& buffer); +} // namespace physfs + +namespace physfs +{ +std::string_view last_error(void); +} // namespace physfs -std::string_view physfs_error(void); +#endif diff --git a/src/core/math/aabb.hh b/src/core/math/aabb.hh index f3eb7bd..79f814a 100644 --- a/src/core/math/aabb.hh +++ b/src/core/math/aabb.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: aabb.hh +// Description: Axis-aligned bounding box + +#ifndef CORE_MATH_AABB_HH +#define CORE_MATH_AABB_HH #pragma once #include "core/math/concepts.hh" @@ -109,3 +116,5 @@ constexpr math::AABB<T> math::AABB<T>::push(const vector_type& vector) const result.max = max + vector; return result; } + +#endif diff --git a/src/core/math/angles.hh b/src/core/math/angles.hh index 174f320..b339323 100644 --- a/src/core/math/angles.hh +++ b/src/core/math/angles.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: angles.hh +// Description: Angle utilities + +#ifndef CORE_MATH_ANGLES_HH +#define CORE_MATH_ANGLES_HH #pragma once #include "core/math/constexpr.hh" @@ -101,3 +108,5 @@ inline void math::vectors(const glm::fvec3& angles, glm::fvec3* forward, glm::fv up->z = nsv.x * ncv.y * pcv.z + psv.y * psv.z; } } + +#endif diff --git a/src/core/math/concepts.hh b/src/core/math/concepts.hh index 6ad5cb7..5d1ef7d 100644 --- a/src/core/math/concepts.hh +++ b/src/core/math/concepts.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: concepts.hh +// Description: C++20 concepts that should be in standard library but are not + +#ifndef CORE_MATH_CONCEPTS_HH +#define CORE_MATH_CONCEPTS_HH #pragma once namespace math @@ -9,3 +16,5 @@ concept signed_arithmetic = std::is_arithmetic_v<type> && std::is_signed_v<type> template<typename type> concept unsigned_arithmetic = std::is_arithmetic_v<type> && std::is_unsigned_v<type>; } // namespace math + +#endif diff --git a/src/core/math/constexpr.hh b/src/core/math/constexpr.hh index 4158803..7aba4d2 100644 --- a/src/core/math/constexpr.hh +++ b/src/core/math/constexpr.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: constexpr.hh +// Description: Compile-time expressions + +#ifndef CORE_MATH_CONSTEXPR_HH +#define CORE_MATH_CONSTEXPR_HH #pragma once #include "core/math/concepts.hh" @@ -70,3 +77,5 @@ constexpr scalar math::radians(const scalar x) { return static_cast<scalar>(static_cast<double>(x) * M_PI / 180.0); } + +#endif diff --git a/src/core/math/crc64.cc b/src/core/math/crc64.cc index 99a4b20..ce1e1db 100644 --- a/src/core/math/crc64.cc +++ b/src/core/math/crc64.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: crc64.cc +// Description: Client-server synchronized CRC64 + #include "core/pch.hh" #include "core/math/crc64.hh" diff --git a/src/core/math/crc64.hh b/src/core/math/crc64.hh index 3ece0df..f593dc9 100644 --- a/src/core/math/crc64.hh +++ b/src/core/math/crc64.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: crc64.hh +// Description: Client-server synchronized CRC64 + +#ifndef CORE_MATH_CRC64_HH +#define CORE_MATH_CRC64_HH #pragma once namespace math @@ -7,3 +14,5 @@ std::uint64_t crc64(const std::vector<std::byte>& buffer, std::uint64_t combine std::uint64_t crc64(const std::string& buffer, std::uint64_t combine = UINT64_C(0)); std::uint64_t crc64(std::string_view buffer, std::uint64_t combine = UINT64_C(0)); } // namespace math + +#endif diff --git a/src/core/math/vectors.hh b/src/core/math/vectors.hh index bc11dd0..2934bb6 100644 --- a/src/core/math/vectors.hh +++ b/src/core/math/vectors.hh @@ -1,11 +1,14 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: vectors.hh +// Description: because NO ONE would POSSIBLY need integer-based distance calculations in a VOXEL game + +#ifndef CORE_MATH_VECTORS_HH +#define CORE_MATH_VECTORS_HH #pragma once #include "core/math/concepts.hh" -// core/vectors.hh - because NO ONE would POSSIBLY -// need integer-based distance calculations in a -// game about voxels. That would be INSANE! :D - namespace math { template<math::arithmetic T> @@ -41,3 +44,5 @@ constexpr static inline const T math::distance2(const glm::vec<3, T>& vector_a, { return math::length2(vector_a - vector_b); } + +#endif diff --git a/src/core/pch.hh b/src/core/pch.hh index 17417a5..9a99be7 100644 --- a/src/core/pch.hh +++ b/src/core/pch.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: pch.hh +// Description: Precompiled header + +#ifndef CORE_PCH_HH +#define CORE_PCH_HH #pragma once #include <cinttypes> @@ -47,3 +54,5 @@ #include <stb_image.h> #include <stb_image_write.h> + +#endif diff --git a/src/core/resource/image.cc b/src/core/resource/image.cc index 6a2109e..aded098 100644 --- a/src/core/resource/image.cc +++ b/src/core/resource/image.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: image.cc +// Description: Image resource + #include "core/pch.hh" #include "core/resource/image.hh" @@ -31,18 +36,18 @@ static const void* image_load_func(const char* name, std::uint32_t flags) callbacks.skip = &stbi_physfs_skip; callbacks.eof = &stbi_physfs_eof; - stbi_set_flip_vertically_on_load(bool(flags & IMAGE_LOAD_FLIP)); + stbi_set_flip_vertically_on_load(bool(flags & IMGFLAG_FLIP)); auto file = PHYSFS_openRead(name); if(file == nullptr) { - spdlog::error("image: {}: {}", name, physfs_error()); + spdlog::error("image: {}: {}", name, physfs::last_error()); return nullptr; } int desired_channels; - if(flags & IMAGE_LOAD_GRAY) { + if(flags & IMGFLAG_GRAY) { desired_channels = STBI_grey; } else { diff --git a/src/core/resource/image.hh b/src/core/resource/image.hh index 575591f..4f93da6 100644 --- a/src/core/resource/image.hh +++ b/src/core/resource/image.hh @@ -1,7 +1,14 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: image.hh +// Description: Image resource + +#ifndef CORE_RESOURCE_IMAGE_HH +#define CORE_RESOURCE_IMAGE_HH #pragma once -constexpr static unsigned int IMAGE_LOAD_GRAY = 0x0001U; -constexpr static unsigned int IMAGE_LOAD_FLIP = 0x0002U; +constexpr static unsigned int IMGFLAG_GRAY = 0x0001U; +constexpr static unsigned int IMGFLAG_FLIP = 0x0002U; struct Image final { static void register_resource(void); @@ -9,3 +16,5 @@ struct Image final { stbi_uc* pixels; glm::ivec2 size; }; + +#endif diff --git a/src/core/resource/resource.cc b/src/core/resource/resource.cc index 926dfc5..6a9539f 100644 --- a/src/core/resource/resource.cc +++ b/src/core/resource/resource.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: resource.cc +// Description: Resource management + #include "core/pch.hh" #include "core/resource/resource.hh" diff --git a/src/core/resource/resource.hh b/src/core/resource/resource.hh index 105c7ff..e2a5659 100644 --- a/src/core/resource/resource.hh +++ b/src/core/resource/resource.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: resource.hh +// Description: Resource management + +#ifndef CORE_RESOURCE_RESOURCE_HH +#define CORE_RESOURCE_RESOURCE_HH #pragma once template<typename T> @@ -51,3 +58,5 @@ resource_ptr<T> resource::find(std::string_view name) auto result = resource::detail::find_resource(typeid(T), name); return std::reinterpret_pointer_cast<const T>(result); } + +#endif diff --git a/src/core/threading.cc b/src/core/threading.cc index a1ae305..1e469ad 100644 --- a/src/core/threading.cc +++ b/src/core/threading.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: threading.cc +// Description: Thread pool wrapper + #include "core/pch.hh" #include "core/threading.hh" diff --git a/src/core/threading.hh b/src/core/threading.hh index 14f17f8..ea4e11b 100644 --- a/src/core/threading.hh +++ b/src/core/threading.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: threading.hh +// Description: Thread pool wrapper + +#ifndef CORE_THREADING_HH +#define CORE_THREADING_HH #pragma once enum class task_status : unsigned int { @@ -44,3 +51,5 @@ inline void threading::submit(AT&&... args) { threading::detail::submit_new(new T(args...)); } + +#endif diff --git a/src/core/utils/epoch.cc b/src/core/utils/epoch.cc index 36bdb79..9d66399 100644 --- a/src/core/utils/epoch.cc +++ b/src/core/utils/epoch.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: epoch.cc +// Description: UNIX time utilities + #include "core/pch.hh" #include "core/utils/epoch.hh" diff --git a/src/core/utils/epoch.hh b/src/core/utils/epoch.hh index 4bf5460..5210e22 100644 --- a/src/core/utils/epoch.hh +++ b/src/core/utils/epoch.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: epoch.hh +// Description: UNIX time utilities + +#ifndef CORE_UTILS_EPOCH_HH +#define CORE_UTILS_EPOCH_HH #pragma once namespace utils @@ -13,3 +20,5 @@ std::int64_t signed_unix_seconds(void); std::int64_t signed_unix_milliseconds(void); std::int64_t signed_unix_microseconds(void); } // namespace utils + +#endif diff --git a/src/core/utils/string.cc b/src/core/utils/string.cc index dd3d567..154b04b 100644 --- a/src/core/utils/string.cc +++ b/src/core/utils/string.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: string.cc +// Description: String utilities + #include "core/pch.hh" #include "core/utils/string.hh" diff --git a/src/core/utils/string.hh b/src/core/utils/string.hh index 827c3ca..36c83ce 100644 --- a/src/core/utils/string.hh +++ b/src/core/utils/string.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: string.hh +// Description: String utilities + +#ifndef CORE_UTILS_STRING_HH +#define CORE_UTILS_STRING_HH #pragma once namespace utils @@ -15,3 +22,5 @@ namespace utils { std::string trim_whitespace(const std::string& string); } // namespace utils + +#endif diff --git a/src/core/version.cc.in b/src/core/version.cc.in index 5424a73..d791149 100644 --- a/src/core/version.cc.in +++ b/src/core/version.cc.in @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: version.cc.in +// Description: Version template + #include "core/pch.hh" #include "core/version.hh" diff --git a/src/core/version.hh b/src/core/version.hh index c033a3e..d040fa5 100644 --- a/src/core/version.hh +++ b/src/core/version.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: version.hh +// Description: Version information + +#ifndef CORE_VERSION_HH +#define CORE_VERSION_HH #pragma once namespace version @@ -18,3 +25,5 @@ namespace version { extern const std::string_view full; } // namespace version + +#endif diff --git a/src/game/client/config/gamepad_axis.cc b/src/game/client/config/gamepad_axis.cc index 4eb36a9..db66fc0 100644 --- a/src/game/client/config/gamepad_axis.cc +++ b/src/game/client/config/gamepad_axis.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: gamepad_axis.cc +// Description: Gamepad axis config value + #include "client/pch.hh" #include "client/config/gamepad_axis.hh" diff --git a/src/game/client/config/gamepad_axis.hh b/src/game/client/config/gamepad_axis.hh index 9392a35..1ca7706 100644 --- a/src/game/client/config/gamepad_axis.hh +++ b/src/game/client/config/gamepad_axis.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: gamepad_axis.hh +// Description: Gamepad axis config value + +#ifndef CLIENT_CONFIG_GAMEPAD_AXIS_HH +#define CLIENT_CONFIG_GAMEPAD_AXIS_HH #pragma once #include "core/config/ivalue.hh" @@ -36,3 +43,5 @@ private: std::string_view m_name; }; } // namespace config + +#endif diff --git a/src/game/client/config/gamepad_button.cc b/src/game/client/config/gamepad_button.cc index d3f8a25..dce0fc2 100644 --- a/src/game/client/config/gamepad_button.cc +++ b/src/game/client/config/gamepad_button.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: gamepad_button.cc +// Description: Gamepad button config value + #include "client/pch.hh" #include "client/config/gamepad_button.hh" diff --git a/src/game/client/config/gamepad_button.hh b/src/game/client/config/gamepad_button.hh index 584c353..43a1f4b 100644 --- a/src/game/client/config/gamepad_button.hh +++ b/src/game/client/config/gamepad_button.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: gamepad_button.hh +// Description: Gamepad button config value + +#ifndef CLIENT_CONFIG_GAMEPAD_BUTTON_HH +#define CLIENT_CONFIG_GAMEPAD_BUTTON_HH #pragma once #include "core/config/ivalue.hh" @@ -26,3 +33,5 @@ private: std::string_view m_name; }; } // namespace config + +#endif diff --git a/src/game/client/config/keybind.cc b/src/game/client/config/keybind.cc index e254f7b..194bb87 100644 --- a/src/game/client/config/keybind.cc +++ b/src/game/client/config/keybind.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: keybind.cc +// Description: Key binding config value + #include "client/pch.hh" #include "client/config/keybind.hh" diff --git a/src/game/client/config/keybind.hh b/src/game/client/config/keybind.hh index dff6c18..af69865 100644 --- a/src/game/client/config/keybind.hh +++ b/src/game/client/config/keybind.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: keybind.hh +// Description: Key binding config value + +#ifndef CLIENT_CONFIG_KEYBIND_HH +#define CLIENT_CONFIG_KEYBIND_HH #pragma once #include "core/config/ivalue.hh" @@ -23,3 +30,5 @@ private: int m_glfw_keycode; }; } // namespace config + +#endif diff --git a/src/game/client/const.hh b/src/game/client/const.hh index 709c0a1..c6b1538 100644 --- a/src/game/client/const.hh +++ b/src/game/client/const.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: const.hh +// Description: Constants + +#ifndef CLIENT_CONST_HH +#define CLIENT_CONST_HH #pragma once #include "shared/const.hh" @@ -21,3 +28,5 @@ static_assert(DEFAULT_HEIGHT >= MIN_HEIGHT); constexpr static float MIN_PITCH = 0.0625f; constexpr static float MAX_PITCH = 10.0f; + +#endif diff --git a/src/game/client/entity/camera.cc b/src/game/client/entity/camera.cc index 27603cf..8cd08fd 100644 --- a/src/game/client/entity/camera.cc +++ b/src/game/client/entity/camera.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: camera.cc +// Description: Client view matrix calculations + #include "client/pch.hh" #include "client/entity/camera.hh" diff --git a/src/game/client/entity/camera.hh b/src/game/client/entity/camera.hh index 526bc91..133fedc 100644 --- a/src/game/client/entity/camera.hh +++ b/src/game/client/entity/camera.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: camera.hh +// Description: Client view matrix calculations + +#ifndef CLIENT_ENTITY_CAMERA_HH +#define CLIENT_ENTITY_CAMERA_HH #pragma once #include "shared/types.hh" @@ -29,3 +36,5 @@ namespace camera void init(void); void update(void); } // namespace camera + +#endif diff --git a/src/game/client/entity/factory.cc b/src/game/client/entity/factory.cc index 94a9698..019d855 100644 --- a/src/game/client/entity/factory.cc +++ b/src/game/client/entity/factory.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: factory.cc +// Description: Boilerplate entity creation + #include "client/pch.hh" #include "client/entity/factory.hh" diff --git a/src/game/client/entity/factory.hh b/src/game/client/entity/factory.hh index 776a0b8..20714ff 100644 --- a/src/game/client/entity/factory.hh +++ b/src/game/client/entity/factory.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: factory.hh +// Description: Boilerplate entity creation + +#ifndef CLIENT_ENTITY_FACTORY_HH +#define CLIENT_ENTITY_FACTORY_HH #pragma once class Dimension; @@ -6,3 +13,5 @@ namespace client { void create_player(Dimension* dimension, entt::entity entity); } // namespace client + +#endif diff --git a/src/game/client/entity/interpolation.cc b/src/game/client/entity/interpolation.cc index 86af971..b1318c9 100644 --- a/src/game/client/entity/interpolation.cc +++ b/src/game/client/entity/interpolation.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: interpolation.cc +// Description: Interpolate components between server frames + #include "client/pch.hh" #include "client/entity/interpolation.hh" diff --git a/src/game/client/entity/interpolation.hh b/src/game/client/entity/interpolation.hh index 8fb0db1..cc18b23 100644 --- a/src/game/client/entity/interpolation.hh +++ b/src/game/client/entity/interpolation.hh @@ -1,6 +1,15 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: interpolation.hh +// Description: Interpolate components between server frames + +#ifndef CLIENT_ENTITY_INTERPOLATION_HH +#define CLIENT_ENTITY_INTERPOLATION_HH #pragma once namespace interpolation { void update(void); } // namespace interpolation + +#endif diff --git a/src/game/client/entity/listener.cc b/src/game/client/entity/listener.cc index af574ae..e411f72 100644 --- a/src/game/client/entity/listener.cc +++ b/src/game/client/entity/listener.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: listener.cc +// Description: OpenAL listener + #include "client/pch.hh" #include "client/entity/listener.hh" diff --git a/src/game/client/entity/listener.hh b/src/game/client/entity/listener.hh index 07d750f..d4391e2 100644 --- a/src/game/client/entity/listener.hh +++ b/src/game/client/entity/listener.hh @@ -1,6 +1,15 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: listener.hh +// Description: OpenAL listener + +#ifndef CLIENT_ENTITY_LISTENER_HH +#define CLIENT_ENTITY_LISTENER_HH #pragma once namespace listener { void update(void); } // namespace listener + +#endif diff --git a/src/game/client/entity/player_look.cc b/src/game/client/entity/player_look.cc index ad0f40e..c3b7dbd 100644 --- a/src/game/client/entity/player_look.cc +++ b/src/game/client/entity/player_look.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: player_look.cc +// Description: Client camera rotations + #include "client/pch.hh" #include "client/entity/player_look.hh" diff --git a/src/game/client/entity/player_look.hh b/src/game/client/entity/player_look.hh index 9d0f1dd..1bb0190 100644 --- a/src/game/client/entity/player_look.hh +++ b/src/game/client/entity/player_look.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: player_look.hh +// Description: Client camera rotations + +#ifndef CLIENT_ENTITY_PLAYER_LOOK_HH +#define CLIENT_ENTITY_PLAYER_LOOK_HH #pragma once namespace player_look @@ -5,3 +12,5 @@ namespace player_look void init(void); void update_late(void); } // namespace player_look + +#endif diff --git a/src/game/client/entity/player_move.cc b/src/game/client/entity/player_move.cc index fe4e757..663258f 100644 --- a/src/game/client/entity/player_move.cc +++ b/src/game/client/entity/player_move.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: player_move.cc +// Description: Player movement + #include "client/pch.hh" #include "client/entity/player_move.hh" diff --git a/src/game/client/entity/player_move.hh b/src/game/client/entity/player_move.hh index 8516308..6e9fa44 100644 --- a/src/game/client/entity/player_move.hh +++ b/src/game/client/entity/player_move.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: player_move.hh +// Description: Player movement + +#ifndef CLIENT_ENTITY_PLAYER_MOVE_HH +#define CLIENT_ENTITY_PLAYER_MOVE_HH #pragma once constexpr static float PMOVE_MAX_SPEED_AIR = 16.0f; @@ -13,3 +20,5 @@ void init(void); void fixed_update(void); void update_late(void); } // namespace player_move + +#endif diff --git a/src/game/client/entity/sound_emitter.cc b/src/game/client/entity/sound_emitter.cc index b0dbc6d..313da0b 100644 --- a/src/game/client/entity/sound_emitter.cc +++ b/src/game/client/entity/sound_emitter.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: sound_emitter.cc +// Description: Component for entities that make sounds + #include "client/pch.hh" #include "client/entity/sound_emitter.hh" diff --git a/src/game/client/entity/sound_emitter.hh b/src/game/client/entity/sound_emitter.hh index 6bc0846..b89c651 100644 --- a/src/game/client/entity/sound_emitter.hh +++ b/src/game/client/entity/sound_emitter.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: sound_emitter.hh +// Description: Component for entities that make sounds + +#ifndef CLIENT_ENTITY_SOUND_EMITTER_HH +#define CLIENT_ENTITY_SOUND_EMITTER_HH #pragma once #include "core/resource/resource.hh" @@ -15,3 +22,5 @@ public: public: static void update(void); }; + +#endif diff --git a/src/game/client/experiments.cc b/src/game/client/experiments.cc index 4df6f1e..dcd3c7d 100644 --- a/src/game/client/experiments.cc +++ b/src/game/client/experiments.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: experiments.cc +// Description: Experimental things that are still haven't got their dedicated game system + #include "client/pch.hh" #include "client/experiments.hh" diff --git a/src/game/client/experiments.hh b/src/game/client/experiments.hh index ff2cbad..c3415ba 100644 --- a/src/game/client/experiments.hh +++ b/src/game/client/experiments.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: experiments.hh +// Description: Experimental things that are still haven't got their dedicated game system + +#ifndef CLIENT_EXPERIMENTS_HH +#define CLIENT_EXPERIMENTS_HH #pragma once namespace experiments @@ -14,3 +21,5 @@ namespace experiments void attack(void); void interact(void); } // namespace experiments + +#endif diff --git a/src/game/client/game.cc b/src/game/client/game.cc index 6219ff9..09445c4 100644 --- a/src/game/client/game.cc +++ b/src/game/client/game.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: game.cc +// Description: Main game logic + #include "client/pch.hh" #include "client/game.hh" @@ -104,8 +109,8 @@ static ImFont* load_font(std::string_view path, float size, ImFontConfig& font_c { std::vector<std::byte> font; - if(!read_file(path, font)) { - spdlog::error("{}: utils::read_file failed", path); + if(!physfs::read_file(path, font)) { + spdlog::error("{}: utils::physfs::read_file failed", path); std::terminate(); } diff --git a/src/game/client/game.hh b/src/game/client/game.hh index 395acc9..7ed663b 100644 --- a/src/game/client/game.hh +++ b/src/game/client/game.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: game.hh +// Description: Main game logic + +#ifndef CLIENT_GAME_HH +#define CLIENT_GAME_HH #pragma once namespace config @@ -33,3 +40,5 @@ void update_late(void); void render(void); void layout(void); } // namespace client_game + +#endif diff --git a/src/game/client/globals.cc b/src/game/client/globals.cc index 85e5cd6..4e16107 100644 --- a/src/game/client/globals.cc +++ b/src/game/client/globals.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: globals.cc +// Description: Global variables + #include "client/pch.hh" #include "client/globals.hh" diff --git a/src/game/client/globals.hh b/src/game/client/globals.hh index a6c2de6..a471097 100644 --- a/src/game/client/globals.hh +++ b/src/game/client/globals.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: globals.hh +// Description: Global variables + +#ifndef CLIENT_GLOBALS_HH +#define CLIENT_GLOBALS_HH #pragma once #include "shared/globals.hh" @@ -63,3 +70,5 @@ extern unsigned int gui_screen; extern ALCdevice* sound_dev; extern ALCcontext* sound_ctx; } // namespace globals + +#endif diff --git a/src/game/client/gui/background.cc b/src/game/client/gui/background.cc index 81fb764..e0e0684 100644 --- a/src/game/client/gui/background.cc +++ b/src/game/client/gui/background.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: background.cc +// Description: Background texture rendering when you're not in-game + #include "client/pch.hh" #include "client/gui/background.hh" diff --git a/src/game/client/gui/background.hh b/src/game/client/gui/background.hh index 51497d1..1f7fef9 100644 --- a/src/game/client/gui/background.hh +++ b/src/game/client/gui/background.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: background.hh +// Description: Background texture rendering when you're not in-game + +#ifndef CLIENT_GUI_BACKGROUND_HH +#define CLIENT_GUI_BACKGROUND_HH #pragma once namespace background @@ -6,3 +13,5 @@ void init(void); void shutdown(void); void layout(void); } // namespace background + +#endif diff --git a/src/game/client/gui/bother.cc b/src/game/client/gui/bother.cc index 7309bbc..2308b4a 100644 --- a/src/game/client/gui/bother.cc +++ b/src/game/client/gui/bother.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: bother.cc +// Description: Bother servers with a status request + #include "client/pch.hh" #include "client/gui/bother.hh" diff --git a/src/game/client/gui/bother.hh b/src/game/client/gui/bother.hh index ed4f84f..d702bde 100644 --- a/src/game/client/gui/bother.hh +++ b/src/game/client/gui/bother.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: bother.hh +// Description: Bother servers with a status request + +#ifndef CLIENT_GUI_BOTHER_HH +#define CLIENT_GUI_BOTHER_HH #pragma once struct BotherResponseEvent final { @@ -19,3 +26,5 @@ void update_late(void); void ping(unsigned int identity, std::string_view host, std::uint16_t port); void cancel(unsigned int identity); } // namespace bother + +#endif diff --git a/src/game/client/gui/chat.cc b/src/game/client/gui/chat.cc index f962e5d..9613aa5 100644 --- a/src/game/client/gui/chat.cc +++ b/src/game/client/gui/chat.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: chat.cc +// Description: Client chat handling + #include "client/pch.hh" #include "client/gui/chat.hh" diff --git a/src/game/client/gui/chat.hh b/src/game/client/gui/chat.hh index 91c3740..afe1965 100644 --- a/src/game/client/gui/chat.hh +++ b/src/game/client/gui/chat.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: chat.hh +// Description: Client chat handling + +#ifndef CLIENT_GUI_CHAT_HH +#define CLIENT_GUI_CHAT_HH #pragma once namespace client_chat @@ -15,3 +22,5 @@ void clear(void); void refresh_timings(void); void print(const std::string& string); } // namespace client_chat + +#endif diff --git a/src/game/client/gui/crosshair.cc b/src/game/client/gui/crosshair.cc index 088796d..29314b9 100644 --- a/src/game/client/gui/crosshair.cc +++ b/src/game/client/gui/crosshair.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: crosshair.cc +// Description: Crosshair rendering + #include "client/pch.hh" #include "client/gui/crosshair.hh" diff --git a/src/game/client/gui/crosshair.hh b/src/game/client/gui/crosshair.hh index 6789e1e..0775bb2 100644 --- a/src/game/client/gui/crosshair.hh +++ b/src/game/client/gui/crosshair.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: crosshair.hh +// Description: Crosshair rendering + +#ifndef CLIENT_GUI_CROSSHAIR_HH +#define CLIENT_GUI_CROSSHAIR_HH #pragma once namespace crosshair @@ -6,3 +13,5 @@ void init(void); void shutdown(void); void layout(void); } // namespace crosshair + +#endif diff --git a/src/game/client/gui/direct_connection.cc b/src/game/client/gui/direct_connection.cc index d7cea64..2b75a44 100644 --- a/src/game/client/gui/direct_connection.cc +++ b/src/game/client/gui/direct_connection.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: direct_connection.cc +// Description: Direct connection screen + #include "client/pch.hh" #include "client/gui/direct_connection.hh" diff --git a/src/game/client/gui/direct_connection.hh b/src/game/client/gui/direct_connection.hh index 0a09a3f..609e326 100644 --- a/src/game/client/gui/direct_connection.hh +++ b/src/game/client/gui/direct_connection.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: direct_connection.hh +// Description: Direct connection screen + +#ifndef CLIENT_GUI_DIRECT_CONNECTION_HH +#define CLIENT_GUI_DIRECT_CONNECTION_HH #pragma once namespace direct_connection @@ -5,3 +12,5 @@ namespace direct_connection void init(void); void layout(void); } // namespace direct_connection + +#endif diff --git a/src/game/client/gui/gui_screen.hh b/src/game/client/gui/gui_screen.hh index 2eae310..7a1da10 100644 --- a/src/game/client/gui/gui_screen.hh +++ b/src/game/client/gui/gui_screen.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: gui_screen.hh +// Description: GUI screen constants + +#ifndef CLIENT_GUI_GUI_SCREEN_HH +#define CLIENT_GUI_GUI_SCREEN_HH #pragma once constexpr static unsigned int GUI_SCREEN_NONE = 0x0000U; @@ -8,3 +15,5 @@ constexpr static unsigned int GUI_PROGRESS_BAR = 0x0004U; constexpr static unsigned int GUI_MESSAGE_BOX = 0x0005U; constexpr static unsigned int GUI_CHAT = 0x0006U; constexpr static unsigned int GUI_DIRECT_CONNECTION = 0x0007U; + +#endif diff --git a/src/game/client/gui/hotbar.cc b/src/game/client/gui/hotbar.cc index b38c368..edcf8a9 100644 --- a/src/game/client/gui/hotbar.cc +++ b/src/game/client/gui/hotbar.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: hotbar.cc +// Description: Hotbar rendering + #include "client/pch.hh" #include "client/gui/hotbar.hh" diff --git a/src/game/client/gui/hotbar.hh b/src/game/client/gui/hotbar.hh index bba5e63..54e53d5 100644 --- a/src/game/client/gui/hotbar.hh +++ b/src/game/client/gui/hotbar.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: hotbar.hh +// Description: Hotbar rendering + +#ifndef CLIENT_GUI_HOTBAR_HH +#define CLIENT_GUI_HOTBAR_HH #pragma once // TODO: design an inventory system and an item @@ -25,3 +32,5 @@ namespace hotbar void next_slot(void); void prev_slot(void); } // namespace hotbar + +#endif diff --git a/src/game/client/gui/imutils_button.cc b/src/game/client/gui/imutils_button.cc index 2017e33..05da90e 100644 --- a/src/game/client/gui/imutils_button.cc +++ b/src/game/client/gui/imutils_button.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: imutils_button.cc +// Description: Extended button layout + #include "client/pch.hh" #include "client/gui/imutils_button.hh" diff --git a/src/game/client/gui/imutils_button.hh b/src/game/client/gui/imutils_button.hh index 0c80694..602b723 100644 --- a/src/game/client/gui/imutils_button.hh +++ b/src/game/client/gui/imutils_button.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: imutils_button.hh +// Description: Extended button layout + +#ifndef CLIENT_GUI_IMUTILS_BUTTON_HH +#define CLIENT_GUI_IMUTILS_BUTTON_HH #pragma once namespace imutils @@ -12,3 +19,5 @@ bool selectable_button(const char* label, const ImVec2& size, bool value); bool toggle_button(const char* label, const ImVec2& size, bool& value); bool toggle_button(const char* label, bool& value); } // namespace imutils + +#endif diff --git a/src/game/client/gui/imutils_popup.cc b/src/game/client/gui/imutils_popup.cc index f97facb..ba997d5 100644 --- a/src/game/client/gui/imutils_popup.cc +++ b/src/game/client/gui/imutils_popup.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: imutils_popup.cc +// Description: Popup utilities + #include "client/pch.hh" #include "client/gui/imutils_popup.hh" diff --git a/src/game/client/gui/imutils_popup.hh b/src/game/client/gui/imutils_popup.hh index 1678f87..159503b 100644 --- a/src/game/client/gui/imutils_popup.hh +++ b/src/game/client/gui/imutils_popup.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: imutils_popup.hh +// Description: Popup utilities + +#ifndef CLIENT_GUI_IMUTILS_POPUP_HH +#define CLIENT_GUI_IMUTILS_POPUP_HH #pragma once /// Returned by popup::show whenever the popup is opened @@ -9,3 +16,5 @@ namespace imutils int popup(const std::string& title, const std::string& question, const std::string* choices, std::size_t num_choices, float font_scale = 1.75f); } // namespace imutils + +#endif diff --git a/src/game/client/gui/imutils_text.cc b/src/game/client/gui/imutils_text.cc index 1058c7f..1621c42 100644 --- a/src/game/client/gui/imutils_text.cc +++ b/src/game/client/gui/imutils_text.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: imutils_text.cc +// Description: Text with shadow + #include "client/pch.hh" #include "client/gui/imutils_text.hh" diff --git a/src/game/client/gui/imutils_text.hh b/src/game/client/gui/imutils_text.hh index 64d06a4..0d888d4 100644 --- a/src/game/client/gui/imutils_text.hh +++ b/src/game/client/gui/imutils_text.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: imutils_text.hh +// Description: Text with shadow + +#ifndef CLIENT_GUI_IMUTILS_TEXT_HH +#define CLIENT_GUI_IMUTILS_TEXT_HH #pragma once namespace imutils @@ -7,3 +14,5 @@ void text_nw(ImDrawList* list, std::string_view text, const ImVec2& pos, ImU32 c void text_wr(ImDrawList* list, std::string_view text, const ImVec2& pos, ImU32 color, ImU32 shadow, ImFont* font, float wrap); void text_wr(ImDrawList* list, std::string_view text, const ImVec2& pos, ImU32 color, ImU32 shadow, ImFont* font, float wrap, float size); } // namespace imutils + +#endif diff --git a/src/game/client/gui/language.cc b/src/game/client/gui/language.cc index 8a2d8d1..4ad1f68 100644 --- a/src/game/client/gui/language.cc +++ b/src/game/client/gui/language.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: language.cc +// Description: Translations API + #include "client/pch.hh" #include "client/gui/language.hh" @@ -41,7 +46,7 @@ void language::init(void) auto file = PHYSFS_openRead(std::string(MANIFEST_PATH).c_str()); if(file == nullptr) { - spdlog::critical("language: {}: {}", MANIFEST_PATH, physfs_error()); + spdlog::critical("language: {}: {}", MANIFEST_PATH, physfs::last_error()); std::terminate(); } @@ -114,7 +119,7 @@ void language::set(LanguageIterator new_language) auto file = PHYSFS_openRead(path.c_str()); if(file == nullptr) { - spdlog::warn("language: {}: {}", path, physfs_error()); + spdlog::warn("language: {}: {}", path, physfs::last_error()); send_language_event(new_language); return; } diff --git a/src/game/client/gui/language.hh b/src/game/client/gui/language.hh index 20c7520..015e787 100644 --- a/src/game/client/gui/language.hh +++ b/src/game/client/gui/language.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: language.hh +// Description: Translations API + +#ifndef CLIENT_GUI_LANGUAGE_HH +#define CLIENT_GUI_LANGUAGE_HH #pragma once struct LanguageInfo final { @@ -37,3 +44,5 @@ namespace language std::string_view resolve(std::string_view key); std::string resolve_gui(std::string_view key); } // namespace language + +#endif diff --git a/src/game/client/gui/main_menu.cc b/src/game/client/gui/main_menu.cc index d764449..6fa5cc9 100644 --- a/src/game/client/gui/main_menu.cc +++ b/src/game/client/gui/main_menu.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: main_menu.cc +// Description: Main menu screen + #include "client/pch.hh" #include "client/gui/main_menu.hh" diff --git a/src/game/client/gui/main_menu.hh b/src/game/client/gui/main_menu.hh index b5333d4..630a10e 100644 --- a/src/game/client/gui/main_menu.hh +++ b/src/game/client/gui/main_menu.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: main_menu.hh +// Description: Main menu screen + +#ifndef CLIENT_GUI_MAIN_MENU_HH +#define CLIENT_GUI_MAIN_MENU_HH #pragma once namespace main_menu @@ -6,3 +13,5 @@ void init(void); void shutdown(void); void layout(void); } // namespace main_menu + +#endif diff --git a/src/game/client/gui/message_box.cc b/src/game/client/gui/message_box.cc index d97267a..a97d4e3 100644 --- a/src/game/client/gui/message_box.cc +++ b/src/game/client/gui/message_box.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: message_box.cc +// Description: A single message screen + #include "client/pch.hh" #include "client/gui/message_box.hh" diff --git a/src/game/client/gui/message_box.hh b/src/game/client/gui/message_box.hh index 9da5358..430b4fb 100644 --- a/src/game/client/gui/message_box.hh +++ b/src/game/client/gui/message_box.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: message_box.hh +// Description: A single message screen + +#ifndef CLIENT_GUI_MESSAGE_BOX_HH +#define CLIENT_GUI_MESSAGE_BOX_HH #pragma once using message_box_action = void (*)(void); @@ -15,3 +22,5 @@ void set_title(std::string_view title); void set_subtitle(std::string_view subtitle); void add_button(std::string_view text, const message_box_action& action); } // namespace message_box + +#endif diff --git a/src/game/client/gui/metrics.cc b/src/game/client/gui/metrics.cc index f39434a..0c510d9 100644 --- a/src/game/client/gui/metrics.cc +++ b/src/game/client/gui/metrics.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: metrics.cc +// Description: Display debug information + #include "client/pch.hh" #include "client/gui/metrics.hh" diff --git a/src/game/client/gui/metrics.hh b/src/game/client/gui/metrics.hh index ab09c34..441a40d 100644 --- a/src/game/client/gui/metrics.hh +++ b/src/game/client/gui/metrics.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: metrics.hh +// Description: Display debug information + +#ifndef CLIENT_GUI_METRICS_HH +#define CLIENT_GUI_METRICS_HH #pragma once namespace metrics @@ -5,3 +12,5 @@ namespace metrics void init(void); void layout(void); } // namespace metrics + +#endif diff --git a/src/game/client/gui/play_menu.cc b/src/game/client/gui/play_menu.cc index ec263a7..61a99a4 100644 --- a/src/game/client/gui/play_menu.cc +++ b/src/game/client/gui/play_menu.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: play_menu.cc +// Description: Server and world list screen + #include "client/pch.hh" #include "client/gui/play_menu.hh" diff --git a/src/game/client/gui/play_menu.hh b/src/game/client/gui/play_menu.hh index 5069592..eeaeca8 100644 --- a/src/game/client/gui/play_menu.hh +++ b/src/game/client/gui/play_menu.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: play_menu.hh +// Description: Server and world list screen + +#ifndef CLIENT_GUI_PLAY_MENU_HH +#define CLIENT_GUI_PLAY_MENU_HH #pragma once namespace play_menu @@ -7,3 +14,5 @@ void shutdown(void); void layout(void); void update_late(void); } // namespace play_menu + +#endif diff --git a/src/game/client/gui/progress_bar.cc b/src/game/client/gui/progress_bar.cc index 6cc7fae..6b85efe 100644 --- a/src/game/client/gui/progress_bar.cc +++ b/src/game/client/gui/progress_bar.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: progress_bar.cc +// Description: Screen with a progress bar + #include "client/pch.hh" #include "client/gui/progress_bar.hh" diff --git a/src/game/client/gui/progress_bar.hh b/src/game/client/gui/progress_bar.hh index 931cad0..e4569e8 100644 --- a/src/game/client/gui/progress_bar.hh +++ b/src/game/client/gui/progress_bar.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: progress_bar.hh +// Description: Screen with a progress bar + +#ifndef CLIENT_GUI_PROGRESS_BAR_HH +#define CLIENT_GUI_PROGRESS_BAR_HH #pragma once using progress_bar_action = void (*)(void); @@ -14,3 +21,5 @@ void reset(void); void set_title(std::string_view title); void set_button(std::string_view text, const progress_bar_action& action); } // namespace progress_bar + +#endif diff --git a/src/game/client/gui/scoreboard.cc b/src/game/client/gui/scoreboard.cc index 23f3174..1405119 100644 --- a/src/game/client/gui/scoreboard.cc +++ b/src/game/client/gui/scoreboard.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: scoreboard.cc +// Description: Display player list + #include "client/pch.hh" #include "client/gui/scoreboard.hh" diff --git a/src/game/client/gui/scoreboard.hh b/src/game/client/gui/scoreboard.hh index 86f8088..fd4bf32 100644 --- a/src/game/client/gui/scoreboard.hh +++ b/src/game/client/gui/scoreboard.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: scoreboard.hh +// Description: Display player list + +#ifndef CLIENT_GUI_SCOREBOARD_HH +#define CLIENT_GUI_SCOREBOARD_HH #pragma once namespace scoreboard @@ -5,3 +12,5 @@ namespace scoreboard void init(void); void layout(void); } // namespace scoreboard + +#endif diff --git a/src/game/client/gui/settings.cc b/src/game/client/gui/settings.cc index b456909..65e91aa 100644 --- a/src/game/client/gui/settings.cc +++ b/src/game/client/gui/settings.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: settings.cc +// Description: Visual config value editing + #include "client/pch.hh" #include "client/gui/settings.hh" diff --git a/src/game/client/gui/settings.hh b/src/game/client/gui/settings.hh index efb8ca4..1a3a1f8 100644 --- a/src/game/client/gui/settings.hh +++ b/src/game/client/gui/settings.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: settings.hh +// Description: Visual config value editing + +#ifndef CLIENT_GUI_SETTINGS_HH +#define CLIENT_GUI_SETTINGS_HH #pragma once namespace config @@ -88,3 +95,5 @@ namespace settings { void add_language_select(int priority, settings_location location, std::string_view name); } // namespace settings + +#endif diff --git a/src/game/client/gui/splash.cc b/src/game/client/gui/splash.cc index 84ecb8b..7d7b86c 100644 --- a/src/game/client/gui/splash.cc +++ b/src/game/client/gui/splash.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: splash.cc +// Description: Startup splash screen + #include "client/pch.hh" #include "client/gui/splash.hh" diff --git a/src/game/client/gui/splash.hh b/src/game/client/gui/splash.hh index ca612fe..abdeb5a 100644 --- a/src/game/client/gui/splash.hh +++ b/src/game/client/gui/splash.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: splash.hh +// Description: Startup splash screen + +#ifndef CLIENT_GUI_SPLASH_HH +#define CLIENT_GUI_SPLASH_HH #pragma once namespace client_splash @@ -6,3 +13,5 @@ void init(void); void init_late(void); void render(void); } // namespace client_splash + +#endif diff --git a/src/game/client/gui/status_lines.cc b/src/game/client/gui/status_lines.cc index ce661a3..39421b2 100644 --- a/src/game/client/gui/status_lines.cc +++ b/src/game/client/gui/status_lines.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: status_lines.cc +// Description: Display lines of text in-game + #include "client/pch.hh" #include "client/gui/status_lines.hh" diff --git a/src/game/client/gui/status_lines.hh b/src/game/client/gui/status_lines.hh index b921947..706b4ad 100644 --- a/src/game/client/gui/status_lines.hh +++ b/src/game/client/gui/status_lines.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: status_lines.hh +// Description: Display lines of text in-game + +#ifndef CLIENT_GUI_STATUS_LINES_HH +#define CLIENT_GUI_STATUS_LINES_HH #pragma once constexpr static unsigned int STATUS_DEBUG = 0x0000; // generic debug line @@ -16,3 +23,5 @@ namespace status_lines void set(unsigned int line, std::string_view text, const ImVec4& color, float fadeout); void unset(unsigned int line); } // namespace status_lines + +#endif diff --git a/src/game/client/gui/window_title.cc b/src/game/client/gui/window_title.cc index b15f2c5..ea65b64 100644 --- a/src/game/client/gui/window_title.cc +++ b/src/game/client/gui/window_title.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: window_title.cc +// Description: Random MOTD in the window title + #include "client/pch.hh" #include "client/gui/window_title.hh" diff --git a/src/game/client/gui/window_title.hh b/src/game/client/gui/window_title.hh index 544ed44..78f7326 100644 --- a/src/game/client/gui/window_title.hh +++ b/src/game/client/gui/window_title.hh @@ -1,6 +1,15 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: window_title.hh +// Description: Random MOTD in the window title + +#ifndef CLIENT_GUI_WINDOW_TITLE_HH +#define CLIENT_GUI_WINDOW_TITLE_HH #pragma once namespace window_title { void update(void); } // namespace window_title + +#endif diff --git a/src/game/client/io/gamepad.cc b/src/game/client/io/gamepad.cc index 2c99107..768b18b 100644 --- a/src/game/client/io/gamepad.cc +++ b/src/game/client/io/gamepad.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: gamepad.cc +// Description: Gamepad support + #include "client/pch.hh" #include "client/io/gamepad.hh" diff --git a/src/game/client/io/gamepad.hh b/src/game/client/io/gamepad.hh index 5f76277..b506cc2 100644 --- a/src/game/client/io/gamepad.hh +++ b/src/game/client/io/gamepad.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: gamepad.hh +// Description: Gamepad support + +#ifndef CLIENT_IO_GAMEPAD_HH +#define CLIENT_IO_GAMEPAD_HH #pragma once constexpr static int INVALID_GAMEPAD_AXIS = INT_MAX; @@ -42,3 +49,5 @@ struct GamepadButtonEvent final { int action; int button; }; + +#endif diff --git a/src/game/client/io/glfw.hh b/src/game/client/io/glfw.hh index ad445f9..9da978b 100644 --- a/src/game/client/io/glfw.hh +++ b/src/game/client/io/glfw.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: glfw.hh +// Description: GLFW events passed through EnTT's signal system + +#ifndef CLIENT_IO_GLFW_HH +#define CLIENT_IO_GLFW_HH #pragma once struct GlfwCursorPosEvent final { @@ -31,3 +38,5 @@ struct GlfwScrollEvent final { float dx; float dy; }; + +#endif diff --git a/src/game/client/io/sound.cc b/src/game/client/io/sound.cc index e67c456..886da2c 100644 --- a/src/game/client/io/sound.cc +++ b/src/game/client/io/sound.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: sound.cc +// Description: Sound handling + #include "client/pch.hh" #include "client/io/sound.hh" diff --git a/src/game/client/io/sound.hh b/src/game/client/io/sound.hh index d96d0c4..f61410a 100644 --- a/src/game/client/io/sound.hh +++ b/src/game/client/io/sound.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: sound.hh +// Description: Sound handling + +#ifndef CLIENT_IO_SOUND_HH +#define CLIENT_IO_SOUND_HH #pragma once #include "core/resource/resource.hh" @@ -41,3 +48,5 @@ void play_entity(entt::entity entity, resource_ptr<SoundEffect> sound, bool loop void play_player(resource_ptr<SoundEffect> sound, bool looping, float pitch); void play_ui(resource_ptr<SoundEffect> sound, bool looping, float pitch); } // namespace sound + +#endif diff --git a/src/game/client/main.cc b/src/game/client/main.cc index 32333db..ab45db5 100644 --- a/src/game/client/main.cc +++ b/src/game/client/main.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: main.cc +// Description: Entry point + #include "client/pch.hh" #include "core/io/cmdline.hh" diff --git a/src/game/client/pch.hh b/src/game/client/pch.hh index 3832081..b09dce5 100644 --- a/src/game/client/pch.hh +++ b/src/game/client/pch.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: pch.hh +// Description: Precompiled header + +#ifndef CLIENT_PCH_HH +#define CLIENT_PCH_HH #pragma once #include <shared/pch.hh> @@ -26,3 +33,5 @@ #if defined(__unix__) #include <dlfcn.h> #endif + +#endif diff --git a/src/game/client/program.cc b/src/game/client/program.cc index 37cc964..5e7b5fb 100644 --- a/src/game/client/program.cc +++ b/src/game/client/program.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: program.cc +// Description: Varied OpenGL shader program + #include "client/pch.hh" #include "client/program.hh" @@ -78,7 +83,7 @@ bool GL_Program::setup(std::string_view vpath, std::string_view fpath) auto vfile = PHYSFS_openRead(vert_path.c_str()); if(vfile == nullptr) { - spdlog::warn("gl_program: {}: {}", vpath, physfs_error()); + spdlog::warn("gl_program: {}: {}", vpath, physfs::last_error()); return false; } @@ -89,7 +94,7 @@ bool GL_Program::setup(std::string_view vpath, std::string_view fpath) auto ffile = PHYSFS_openRead(frag_path.c_str()); if(ffile == nullptr) { - spdlog::warn("gl_program: {}: {}", fpath, physfs_error()); + spdlog::warn("gl_program: {}: {}", fpath, physfs::last_error()); return false; } diff --git a/src/game/client/program.hh b/src/game/client/program.hh index af78513..6bf69ca 100644 --- a/src/game/client/program.hh +++ b/src/game/client/program.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: program.hh +// Description: Varied OpenGL shader program + +#ifndef CLIENT_PROGRAM_HH +#define CLIENT_PROGRAM_HH #pragma once struct GL_VariedMacro final { @@ -32,3 +39,5 @@ public: bool needs_update; GLuint handle; }; + +#endif diff --git a/src/game/client/receive.cc b/src/game/client/receive.cc index bc7b92e..5331dc5 100644 --- a/src/game/client/receive.cc +++ b/src/game/client/receive.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: receive.cc +// Description: Handle incoming packets + #include "client/pch.hh" #include "client/receive.hh" diff --git a/src/game/client/receive.hh b/src/game/client/receive.hh index d675392..9f35488 100644 --- a/src/game/client/receive.hh +++ b/src/game/client/receive.hh @@ -1,6 +1,15 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: receive.hh +// Description: Handle incoming packets + +#ifndef CLIENT_RECEIVE_HH +#define CLIENT_RECEIVE_HH #pragma once namespace client_receive { void init(void); } // namespace client_receive + +#endif diff --git a/src/game/client/resource/sound_effect.cc b/src/game/client/resource/sound_effect.cc index 4cc5b70..6b87dcc 100644 --- a/src/game/client/resource/sound_effect.cc +++ b/src/game/client/resource/sound_effect.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: sound_effect.cc +// Description: Sound effect resource + #include "client/pch.hh" #include "client/resource/sound_effect.hh" @@ -35,7 +40,7 @@ static const void* sound_effect_load_func(const char* name, std::uint32_t flags) auto file = PHYSFS_openRead(name); if(file == nullptr) { - spdlog::warn("sfx: {}: {}", name, physfs_error()); + spdlog::warn("sfx: {}: {}", name, physfs::last_error()); return nullptr; } diff --git a/src/game/client/resource/sound_effect.hh b/src/game/client/resource/sound_effect.hh index f2db33b..602293c 100644 --- a/src/game/client/resource/sound_effect.hh +++ b/src/game/client/resource/sound_effect.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: sound_effect.hh +// Description: Sound effect resource + +#ifndef CLIENT_RESOURCE_SOUND_EFFECT_HH +#define CLIENT_RESOURCE_SOUND_EFFECT_HH #pragma once struct SoundEffect final { @@ -6,3 +13,5 @@ struct SoundEffect final { std::string name; ALuint buffer; }; + +#endif diff --git a/src/game/client/resource/texture_gui.cc b/src/game/client/resource/texture_gui.cc index beb2f54..b87a244 100644 --- a/src/game/client/resource/texture_gui.cc +++ b/src/game/client/resource/texture_gui.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: texture_gui.cc +// Description: GUI texture resource + #include "client/pch.hh" #include "client/resource/texture_gui.hh" @@ -12,11 +17,11 @@ static const void* texture_gui_load_func(const char* name, std::uint32_t flags) unsigned int image_load_flags = 0U; if(flags & TEXTURE_GUI_LOAD_VFLIP) { - image_load_flags |= IMAGE_LOAD_FLIP; + image_load_flags |= IMGFLAG_FLIP; } if(flags & TEXTURE_GUI_LOAD_GRAYSCALE) { - image_load_flags |= IMAGE_LOAD_GRAY; + image_load_flags |= IMGFLAG_GRAY; } if(auto image = resource::load<Image>(name, image_load_flags)) { diff --git a/src/game/client/resource/texture_gui.hh b/src/game/client/resource/texture_gui.hh index 2d42c83..2487a77 100644 --- a/src/game/client/resource/texture_gui.hh +++ b/src/game/client/resource/texture_gui.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: texture_gui.hh +// Description: GUI texture resource + +#ifndef CLIENT_RESOURCE_TEXTURE_GUI_HH +#define CLIENT_RESOURCE_TEXTURE_GUI_HH #pragma once constexpr static unsigned int TEXTURE_GUI_LOAD_CLAMP_S = 0x0001; @@ -13,3 +20,5 @@ struct TextureGUI final { ImTextureID handle; glm::ivec2 size; }; + +#endif diff --git a/src/game/client/screenshot.cc b/src/game/client/screenshot.cc index d704f47..a4c043e 100644 --- a/src/game/client/screenshot.cc +++ b/src/game/client/screenshot.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: screenshot.cc +// Description: Screenshot handling + #include "client/pch.hh" #include "client/screenshot.hh" diff --git a/src/game/client/screenshot.hh b/src/game/client/screenshot.hh index fecbd2f..17886f9 100644 --- a/src/game/client/screenshot.hh +++ b/src/game/client/screenshot.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: screenshot.hh +// Description: Screenshot handling + +#ifndef CLIENT_SCREENSHOT_HH +#define CLIENT_SCREENSHOT_HH #pragma once namespace screenshot @@ -5,3 +12,5 @@ namespace screenshot void init(void); void take(void); } // namespace screenshot + +#endif diff --git a/src/game/client/session.cc b/src/game/client/session.cc index 94af475..7c38b28 100644 --- a/src/game/client/session.cc +++ b/src/game/client/session.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: session.cc +// Description: Session handling + #include "client/pch.hh" #include "client/session.hh" diff --git a/src/game/client/session.hh b/src/game/client/session.hh index f61d62d..a513974 100644 --- a/src/game/client/session.hh +++ b/src/game/client/session.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: session.hh +// Description: Session handling + +#ifndef CLIENT_SESSION_HH +#define CLIENT_SESSION_HH #pragma once namespace session @@ -25,3 +32,5 @@ namespace session { bool is_ingame(void); } // namespace session + +#endif diff --git a/src/game/client/toggles.cc b/src/game/client/toggles.cc index 5381993..96f9dfd 100644 --- a/src/game/client/toggles.cc +++ b/src/game/client/toggles.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: toggles.cc +// Description: Debug and not-so-debug toggles + #include "client/pch.hh" #include "client/toggles.hh" diff --git a/src/game/client/toggles.hh b/src/game/client/toggles.hh index d051a92..b778ff7 100644 --- a/src/game/client/toggles.hh +++ b/src/game/client/toggles.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: toggles.hh +// Description: Debug and not-so-debug toggles + +#ifndef CLIENT_TOGGLES_HH +#define CLIENT_TOGGLES_HH #pragma once using toggle_type = unsigned int; @@ -33,3 +40,5 @@ void init_late(void); bool get(toggle_type type); void set(toggle_type type, bool value); } // namespace toggles + +#endif 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 diff --git a/src/game/server/chat.cc b/src/game/server/chat.cc index a0ceba8..5bb2258 100644 --- a/src/game/server/chat.cc +++ b/src/game/server/chat.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: chat.cc +// Description: Chat handling + #include "server/pch.hh" #include "server/chat.hh" diff --git a/src/game/server/chat.hh b/src/game/server/chat.hh index 1b3e11b..671fd22 100644 --- a/src/game/server/chat.hh +++ b/src/game/server/chat.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: chat.hh +// Description: Chat handling + +#ifndef SERVER_CHAT_HH +#define SERVER_CHAT_HH #pragma once struct Session; @@ -10,3 +17,5 @@ void broadcast(std::string_view message, std::string_view sender); void send(Session* session, std::string_view message); void send(Session* session, std::string_view message, std::string_view sender); } // namespace server_chat + +#endif diff --git a/src/game/server/game.cc b/src/game/server/game.cc index deb7d68..0aa976e 100644 --- a/src/game/server/game.cc +++ b/src/game/server/game.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: game.cc +// Description: Main game logic + #include "server/pch.hh" #include "server/game.hh" diff --git a/src/game/server/game.hh b/src/game/server/game.hh index 1dbe4b8..dccd2f5 100644 --- a/src/game/server/game.hh +++ b/src/game/server/game.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: game.hh +// Description: Main game logic + +#ifndef SERVER_GAME_HH +#define SERVER_GAME_HH #pragma once namespace config @@ -23,3 +30,5 @@ void shutdown(void); void fixed_update(void); void fixed_update_late(void); } // namespace server_game + +#endif diff --git a/src/game/server/globals.cc b/src/game/server/globals.cc index 12fce4a..796d9f2 100644 --- a/src/game/server/globals.cc +++ b/src/game/server/globals.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: globals.cc +// Description: Global variables + #include "server/pch.hh" #include "server/globals.hh" diff --git a/src/game/server/globals.hh b/src/game/server/globals.hh index 80e84bb..c44b03a 100644 --- a/src/game/server/globals.hh +++ b/src/game/server/globals.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: globals.hh +// Description: Global variables + +#ifndef SERVER_GLOBALS_HH +#define SERVER_GLOBALS_HH #pragma once #include "shared/globals.hh" @@ -19,3 +26,5 @@ extern std::uint64_t tickrate_dt; extern Dimension* spawn_dimension; extern std::unordered_map<std::string, Dimension*> dimensions; } // namespace globals + +#endif diff --git a/src/game/server/main.cc b/src/game/server/main.cc index 181145f..7c70ae1 100644 --- a/src/game/server/main.cc +++ b/src/game/server/main.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: main.cc +// Description: Entry point + #include "server/pch.hh" #include "core/config/number.hh" diff --git a/src/game/server/pch.hh b/src/game/server/pch.hh index 6f42c17..a7892d8 100644 --- a/src/game/server/pch.hh +++ b/src/game/server/pch.hh @@ -1,3 +1,12 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: pch.hh +// Description: Precompiled header + +#ifndef SERVER_PCH_HH +#define SERVER_PCH_HH #pragma once #include <shared/pch.hh> + +#endif diff --git a/src/game/server/receive.cc b/src/game/server/receive.cc index a3ce14b..b9a0da0 100644 --- a/src/game/server/receive.cc +++ b/src/game/server/receive.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: receive.cc +// Description: Handle incoming packets + #include "server/pch.hh" #include "server/receive.hh" diff --git a/src/game/server/receive.hh b/src/game/server/receive.hh index 4150226..99c5688 100644 --- a/src/game/server/receive.hh +++ b/src/game/server/receive.hh @@ -1,6 +1,15 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: receive.hh +// Description: Handle incoming packets + +#ifndef SERVER_RECEIVE_HH +#define SERVER_RECEIVE_HH #pragma once namespace server_recieve { void init(void); } // namespace server_recieve + +#endif diff --git a/src/game/server/sessions.cc b/src/game/server/sessions.cc index b161d55..f66dfa1 100644 --- a/src/game/server/sessions.cc +++ b/src/game/server/sessions.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: sessions.cc +// Description: Session handling + #include "server/pch.hh" #include "server/sessions.hh" diff --git a/src/game/server/sessions.hh b/src/game/server/sessions.hh index 4c64f80..7806d71 100644 --- a/src/game/server/sessions.hh +++ b/src/game/server/sessions.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: sessions.hh +// Description: Session handling + +#ifndef SERVER_SESSIONS_HH +#define SERVER_SESSIONS_HH #pragma once class Dimension; @@ -50,3 +57,5 @@ namespace sessions { void refresh_scoreboard(void); } // namespace sessions + +#endif diff --git a/src/game/server/status.cc b/src/game/server/status.cc index 9414a76..592c5ce 100644 --- a/src/game/server/status.cc +++ b/src/game/server/status.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: status.cc +// Description: Respond to client bothering + #include "server/pch.hh" #include "server/status.hh" diff --git a/src/game/server/status.hh b/src/game/server/status.hh index 35370a0..70eea40 100644 --- a/src/game/server/status.hh +++ b/src/game/server/status.hh @@ -1,6 +1,15 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: status.hh +// Description: Respond to client bothering + +#ifndef SERVER_STATUS_HH +#define SERVER_STATUS_HH #pragma once namespace status { void init(void); } // namespace status + +#endif diff --git a/src/game/server/whitelist.cc b/src/game/server/whitelist.cc index 555e5f3..2370c67 100644 --- a/src/game/server/whitelist.cc +++ b/src/game/server/whitelist.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: whitelist.cc +// Description: Player allow-list + #include "server/pch.hh" #include "server/whitelist.hh" @@ -48,7 +53,7 @@ void whitelist::init_late(void) PHYSFS_File* file = PHYSFS_openRead(whitelist::filename.c_str()); if(file == nullptr) { - spdlog::warn("whitelist: {}: {}", whitelist::filename.get(), physfs_error()); + spdlog::warn("whitelist: {}: {}", whitelist::filename.get(), physfs::last_error()); whitelist::enabled.set_value(false); return; } diff --git a/src/game/server/whitelist.hh b/src/game/server/whitelist.hh index 4695d16..e9dc3aa 100644 --- a/src/game/server/whitelist.hh +++ b/src/game/server/whitelist.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: whitelist.hh +// Description: Player allow-list + +#ifndef SERVER_WHITELIST_HH +#define SERVER_WHITELIST_HH #pragma once namespace config @@ -24,3 +31,5 @@ namespace whitelist bool contains(std::string_view username); bool matches(std::string_view username, std::uint64_t password_hash); } // namespace whitelist + +#endif diff --git a/src/game/server/world/inhabited.hh b/src/game/server/world/inhabited.hh index e4b2344..fa34eb2 100644 --- a/src/game/server/world/inhabited.hh +++ b/src/game/server/world/inhabited.hh @@ -1,3 +1,12 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: inhabited.hh +// Description: Flag component for chunks that should be saved on disk + +#ifndef SERVER_WORLD_INHABITED_HH +#define SERVER_WORLD_INHABITED_HH #pragma once struct Inhabited final {}; + +#endif diff --git a/src/game/server/world/overworld.cc b/src/game/server/world/overworld.cc index b03311d..3e9f15b 100644 --- a/src/game/server/world/overworld.cc +++ b/src/game/server/world/overworld.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: overworld.cc +// Description: Generic world dimension + #include "server/pch.hh" #include "server/world/overworld.hh" diff --git a/src/game/server/world/overworld.hh b/src/game/server/world/overworld.hh index ef4bb54..fd21089 100644 --- a/src/game/server/world/overworld.hh +++ b/src/game/server/world/overworld.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: overworld.hh +// Description: Generic world dimension + +#ifndef SERVER_WORLD_OVERWORLD_HH +#define SERVER_WORLD_OVERWORLD_HH #pragma once #include "core/config/number.hh" @@ -60,3 +67,5 @@ private: private: std::mutex m_mutex; }; + +#endif diff --git a/src/game/server/world/random_tick.cc b/src/game/server/world/random_tick.cc index 8fdcfeb..6e6c65a 100644 --- a/src/game/server/world/random_tick.cc +++ b/src/game/server/world/random_tick.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: random_tick.cc +// Description: Voxel random ticking + #include "server/pch.hh" #include "server/world/random_tick.hh" diff --git a/src/game/server/world/random_tick.hh b/src/game/server/world/random_tick.hh index 9c67dc4..0d01267 100644 --- a/src/game/server/world/random_tick.hh +++ b/src/game/server/world/random_tick.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: random_tick.hh +// Description: Voxel random ticking + +#ifndef SERVER_WORLD_RANDOM_TICK_HH +#define SERVER_WORLD_RANDOM_TICK_HH #pragma once #include "shared/types.hh" @@ -9,3 +16,5 @@ namespace random_tick void init(void); void tick(const chunk_pos& cpos, Chunk* chunk); } // namespace random_tick + +#endif diff --git a/src/game/server/world/universe.cc b/src/game/server/world/universe.cc index defefc6..0a8d956 100644 --- a/src/game/server/world/universe.cc +++ b/src/game/server/world/universe.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: universe.cc +// Description: Dimension handling + #include "server/pch.hh" #include "server/world/universe.hh" @@ -52,7 +57,7 @@ static void add_new_dimension(Dimension* dimension) auto dimension_dir = std::format("{}/{}", universe_name.get(), dimension->get_name()); if(!PHYSFS_mkdir(dimension_dir.c_str())) { - spdlog::critical("universe: {}: {}", dimension_dir, physfs_error()); + spdlog::critical("universe: {}: {}", dimension_dir, physfs::last_error()); std::terminate(); } @@ -61,7 +66,7 @@ static void add_new_dimension(Dimension* dimension) metadata->zvox_dir = std::format("{}/chunk", dimension_dir); if(!PHYSFS_mkdir(metadata->zvox_dir.c_str())) { - spdlog::critical("universe: {}: {}", metadata->zvox_dir, physfs_error()); + spdlog::critical("universe: {}: {}", metadata->zvox_dir, physfs::last_error()); std::terminate(); } @@ -109,7 +114,7 @@ void universe::init_late(void) const auto universe_dir = std::string(universe_name.get()); if(!PHYSFS_mkdir(universe_dir.c_str())) { - spdlog::critical("universe: {}: {}", universe_dir, physfs_error()); + spdlog::critical("universe: {}: {}", universe_dir, physfs::last_error()); std::terminate(); } diff --git a/src/game/server/world/universe.hh b/src/game/server/world/universe.hh index 31d3721..0901b9e 100644 --- a/src/game/server/world/universe.hh +++ b/src/game/server/world/universe.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: universe.hh +// Description: Dimension handling + +#ifndef SERVER_WORLD_UNIVERSE_HH +#define SERVER_WORLD_UNIVERSE_HH #pragma once #include "shared/types.hh" @@ -20,3 +27,5 @@ Chunk* load_chunk(Dimension* dimension, const chunk_pos& cpos); void save_chunk(Dimension* dimension, const chunk_pos& cpos); void save_all_chunks(Dimension* dimension); } // namespace universe + +#endif diff --git a/src/game/server/world/unloader.cc b/src/game/server/world/unloader.cc index 5842b14..bbb87d3 100644 --- a/src/game/server/world/unloader.cc +++ b/src/game/server/world/unloader.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: unloader.cc +// Description: Handle chunks that are out of view for all players + #include "server/pch.hh" #include "server/world/unloader.hh" diff --git a/src/game/server/world/unloader.hh b/src/game/server/world/unloader.hh index bf816bd..85e7d5e 100644 --- a/src/game/server/world/unloader.hh +++ b/src/game/server/world/unloader.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: unloader.hh +// Description: Handle chunks that are out of view for all players + +#ifndef SERVER_WORLD_UNLOADER_HH +#define SERVER_WORLD_UNLOADER_HH #pragma once class Dimension; @@ -8,3 +15,5 @@ void init(void); void init_late(void); void fixed_update_late(Dimension* dimension); } // namespace unloader + +#endif diff --git a/src/game/server/world/worldgen.cc b/src/game/server/world/worldgen.cc index c8c7ade..e543208 100644 --- a/src/game/server/world/worldgen.cc +++ b/src/game/server/world/worldgen.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: worldgen.cc +// Description: Threaded requests for dimensions to generate chunks + #include "server/pch.hh" #include "server/world/worldgen.hh" diff --git a/src/game/server/world/worldgen.hh b/src/game/server/world/worldgen.hh index f991744..ef0cc49 100644 --- a/src/game/server/world/worldgen.hh +++ b/src/game/server/world/worldgen.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: worldgen.hh +// Description: Threaded requests for dimensions to generate chunks + +#ifndef SERVER_WORLD_WORLDGEN_HH +#define SERVER_WORLD_WORLDGEN_HH #pragma once #include "shared/types.hh" @@ -16,3 +23,5 @@ namespace worldgen bool is_generating(Dimension* dimension, const chunk_pos& cpos); void request_chunk(Session* session, const chunk_pos& cpos); } // namespace worldgen + +#endif diff --git a/src/game/shared/const.hh b/src/game/shared/const.hh index 187962a..45e1731 100644 --- a/src/game/shared/const.hh +++ b/src/game/shared/const.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: const.hh +// Description: Constants + +#ifndef SHARED_CONST_HH +#define SHARED_CONST_HH #pragma once #include "core/math/constexpr.hh" @@ -41,3 +48,5 @@ constexpr static glm::vec<2, T> ZERO_VEC2 = glm::vec<2, T>(0, 0); template<typename T> constexpr static glm::vec<3, T> ZERO_VEC3 = glm::vec<3, T>(0, 0, 0); + +#endif diff --git a/src/game/shared/coord.hh b/src/game/shared/coord.hh index 9d9be18..bd66c9b 100644 --- a/src/game/shared/coord.hh +++ b/src/game/shared/coord.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: coord.hh +// Description: Coordinate domain change functions + +#ifndef SHARED_COORD_HH +#define SHARED_COORD_HH #pragma once #include "shared/const.hh" @@ -143,3 +150,5 @@ inline constexpr glm::fvec3 coord::to_fvec3(const chunk_pos& cpos, const glm::fv fpos.z + static_cast<float>(cpos.z << CHUNK_BITSHIFT), }; } + +#endif diff --git a/src/game/shared/entity/collision.cc b/src/game/shared/entity/collision.cc index 322bb91..6878958 100644 --- a/src/game/shared/entity/collision.cc +++ b/src/game/shared/entity/collision.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: collision.cc +// Description: Collision detection + #include "shared/pch.hh" #include "shared/entity/collision.hh" diff --git a/src/game/shared/entity/collision.hh b/src/game/shared/entity/collision.hh index 34a648c..89d9756 100644 --- a/src/game/shared/entity/collision.hh +++ b/src/game/shared/entity/collision.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: collision.hh +// Description: Collision detection + +#ifndef SHARED_ENTITY_COLLISION_HH +#define SHARED_ENTITY_COLLISION_HH #pragma once #include "core/math/aabb.hh" @@ -13,3 +20,5 @@ public: // because both transform and velocity may be updated internally static void fixed_update(Dimension* dimension); }; + +#endif diff --git a/src/game/shared/entity/factory.cc b/src/game/shared/entity/factory.cc index f2031df..223e593 100644 --- a/src/game/shared/entity/factory.cc +++ b/src/game/shared/entity/factory.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: factory.cc +// Description: Boilerplate entity creation + #include "shared/pch.hh" #include "shared/entity/factory.hh" diff --git a/src/game/shared/entity/factory.hh b/src/game/shared/entity/factory.hh index 7c94136..158b187 100644 --- a/src/game/shared/entity/factory.hh +++ b/src/game/shared/entity/factory.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: factory.hh +// Description: Boilerplate entity creation + +#ifndef SHARED_ENTITY_FACTORY_HH +#define SHARED_ENTITY_FACTORY_HH #pragma once class Dimension; @@ -6,3 +13,5 @@ namespace shared { void create_player(Dimension* dimension, entt::entity entity); } // namespace shared + +#endif diff --git a/src/game/shared/entity/gravity.cc b/src/game/shared/entity/gravity.cc index 6a5145f..893e819 100644 --- a/src/game/shared/entity/gravity.cc +++ b/src/game/shared/entity/gravity.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: gravity.cc +// Description: Gravity component + #include "shared/pch.hh" #include "shared/entity/gravity.hh" diff --git a/src/game/shared/entity/gravity.hh b/src/game/shared/entity/gravity.hh index 38b3c9b..c6ad701 100644 --- a/src/game/shared/entity/gravity.hh +++ b/src/game/shared/entity/gravity.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: gravity.hh +// Description: Gravity component + +#ifndef SHARED_ENTITY_GRAVITY_HH +#define SHARED_ENTITY_GRAVITY_HH #pragma once class Dimension; @@ -6,3 +13,5 @@ struct Gravity final { public: static void fixed_update(Dimension* dimension); }; + +#endif diff --git a/src/game/shared/entity/grounded.hh b/src/game/shared/entity/grounded.hh index 7307e79..38367ec 100644 --- a/src/game/shared/entity/grounded.hh +++ b/src/game/shared/entity/grounded.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: grounded.hh +// Description: Flag components for entites that rest on the ground + +#ifndef SHARED_ENTITY_GROUNDED_HH +#define SHARED_ENTITY_GROUNDED_HH #pragma once #include "shared/world/voxel.hh" @@ -7,3 +14,5 @@ struct Grounded final { VoxelMaterial surface; }; + +#endif diff --git a/src/game/shared/entity/head.hh b/src/game/shared/entity/head.hh index 9fa71d9..cec3be4 100644 --- a/src/game/shared/entity/head.hh +++ b/src/game/shared/entity/head.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: head.hh +// Description: Head component + +#ifndef SHARED_ENTITY_HEAD_HH +#define SHARED_ENTITY_HEAD_HH #pragma once struct Head { @@ -11,3 +18,5 @@ namespace client struct HeadIntr final : public Head {}; struct HeadPrev final : public Head {}; } // namespace client + +#endif diff --git a/src/game/shared/entity/player.hh b/src/game/shared/entity/player.hh index d7cd020..8edba5e 100644 --- a/src/game/shared/entity/player.hh +++ b/src/game/shared/entity/player.hh @@ -1,3 +1,12 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: player.hh +// Description: Flag components for entites that are players + +#ifndef SHARED_ENTITY_PLAYER_HH +#define SHARED_ENTITY_PLAYER_HH #pragma once struct Player final {}; + +#endif diff --git a/src/game/shared/entity/stasis.cc b/src/game/shared/entity/stasis.cc index 0b8a0c8..72f7592 100644 --- a/src/game/shared/entity/stasis.cc +++ b/src/game/shared/entity/stasis.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: stasis.cc +// Description: Freeze entites that are in an unloaded chunk + #include "shared/pch.hh" #include "shared/entity/stasis.hh" diff --git a/src/game/shared/entity/stasis.hh b/src/game/shared/entity/stasis.hh index 5adc592..dfb97b3 100644 --- a/src/game/shared/entity/stasis.hh +++ b/src/game/shared/entity/stasis.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: stasis.hh +// Description: Freeze entites that are in an unloaded chunk + +#ifndef SHARED_ENTITY_STASIS_HH +#define SHARED_ENTITY_STASIS_HH #pragma once class Dimension; @@ -8,3 +15,5 @@ struct Stasis final { public: static void fixed_update(Dimension* dimension); }; + +#endif diff --git a/src/game/shared/entity/transform.cc b/src/game/shared/entity/transform.cc index cf09e2f..2ceee0d 100644 --- a/src/game/shared/entity/transform.cc +++ b/src/game/shared/entity/transform.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: transform.cc +// Description: Transform component + #include "shared/pch.hh" #include "shared/entity/transform.hh" diff --git a/src/game/shared/entity/transform.hh b/src/game/shared/entity/transform.hh index afbe9fa..55a00ac 100644 --- a/src/game/shared/entity/transform.hh +++ b/src/game/shared/entity/transform.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: transform.hh +// Description: Transform component + +#ifndef SHARED_ENTITY_TRANSFORM_HH +#define SHARED_ENTITY_TRANSFORM_HH #pragma once #include "shared/types.hh" @@ -22,3 +29,5 @@ namespace client struct TransformIntr final : public Transform {}; struct TransformPrev final : public Transform {}; } // namespace client + +#endif diff --git a/src/game/shared/entity/velocity.cc b/src/game/shared/entity/velocity.cc index 6fb8c80..c08b749 100644 --- a/src/game/shared/entity/velocity.cc +++ b/src/game/shared/entity/velocity.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: velocity.cc +// Description: Velocity component + #include "shared/pch.hh" #include "shared/entity/velocity.hh" diff --git a/src/game/shared/entity/velocity.hh b/src/game/shared/entity/velocity.hh index 0266bd0..8dccf09 100644 --- a/src/game/shared/entity/velocity.hh +++ b/src/game/shared/entity/velocity.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: velocity.hh +// Description: Velocity component + +#ifndef SHARED_ENTITY_VELOCITY_HH +#define SHARED_ENTITY_VELOCITY_HH #pragma once class Dimension; @@ -18,3 +25,5 @@ namespace client struct VelocityIntr final : public Velocity {}; struct VelocityPrev final : public Velocity {}; } // namespace client + +#endif diff --git a/src/game/shared/game.cc b/src/game/shared/game.cc index e839e6a..bac92fb 100644 --- a/src/game/shared/game.cc +++ b/src/game/shared/game.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: game.cc +// Description: Shared initialization logic + #include "shared/pch.hh" #include "shared/game.hh" @@ -81,7 +86,7 @@ void shared_game::init(int argc, char** argv, std::string_view logfile) logger->flush(); if(!PHYSFS_init(argv[0])) { - spdlog::critical("physfs: init failed: {}", physfs_error()); + spdlog::critical("physfs: init failed: {}", physfs::last_error()); std::terminate(); } @@ -96,17 +101,17 @@ void shared_game::init(int argc, char** argv, std::string_view logfile) std::filesystem::create_directories(userpath, ignore_error); if(!PHYSFS_mount(gamepath.string().c_str(), nullptr, false)) { - spdlog::critical("physfs: mount {} failed: {}", gamepath.string(), physfs_error()); + spdlog::critical("physfs: mount {} failed: {}", gamepath.string(), physfs::last_error()); std::terminate(); } if(!PHYSFS_mount(userpath.string().c_str(), nullptr, false)) { - spdlog::critical("physfs: mount {} failed: {}", userpath.string(), physfs_error()); + spdlog::critical("physfs: mount {} failed: {}", userpath.string(), physfs::last_error()); std::terminate(); } if(!PHYSFS_setWriteDir(userpath.string().c_str())) { - spdlog::critical("physfs: setwritedir {} failed: {}", userpath.string(), physfs_error()); + spdlog::critical("physfs: setwritedir {} failed: {}", userpath.string(), physfs::last_error()); std::terminate(); } @@ -121,7 +126,7 @@ void shared_game::shutdown(void) enet_deinitialize(); if(!PHYSFS_deinit()) { - spdlog::critical("physfs: deinit failed: {}", physfs_error()); + spdlog::critical("physfs: deinit failed: {}", physfs::last_error()); std::terminate(); } } diff --git a/src/game/shared/game.hh b/src/game/shared/game.hh index 6e89a3c..8fe3c90 100644 --- a/src/game/shared/game.hh +++ b/src/game/shared/game.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: game.hh +// Description: Shared initialization logic + +#ifndef SHARED_GAME_HH +#define SHARED_GAME_HH #pragma once namespace shared_game @@ -5,3 +12,5 @@ namespace shared_game void init(int argc, char** argv, std::string_view logfile = {}); void shutdown(void); } // namespace shared_game + +#endif diff --git a/src/game/shared/game_items.cc b/src/game/shared/game_items.cc index 73f7cef..5fe8ba3 100644 --- a/src/game/shared/game_items.cc +++ b/src/game/shared/game_items.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: game_items.cc +// Description: All the items in the game + #include "shared/pch.hh" #include "shared/game_items.hh" diff --git a/src/game/shared/game_items.hh b/src/game/shared/game_items.hh index 1170543..9901e18 100644 --- a/src/game/shared/game_items.hh +++ b/src/game/shared/game_items.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: game_items.hh +// Description: All the items in the game + +#ifndef SHARED_GAME_ITEMS_HH +#define SHARED_GAME_ITEMS_HH #pragma once class Item; @@ -19,3 +26,5 @@ namespace game_items { void populate(void); } // namespace game_items + +#endif diff --git a/src/game/shared/game_voxels.cc b/src/game/shared/game_voxels.cc index 010053a..6682dd8 100644 --- a/src/game/shared/game_voxels.cc +++ b/src/game/shared/game_voxels.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: game_voxels.cc +// Description: All the voxels in the game + #include "shared/pch.hh" #include "shared/game_voxels.hh" diff --git a/src/game/shared/game_voxels.hh b/src/game/shared/game_voxels.hh index f46385c..403ee86 100644 --- a/src/game/shared/game_voxels.hh +++ b/src/game/shared/game_voxels.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: game_voxels.hh +// Description: All the voxels in the game + +#ifndef SHARED_GAME_VOXELS_HH +#define SHARED_GAME_VOXELS_HH #pragma once class Voxel; @@ -21,3 +28,5 @@ namespace game_voxels { void populate(void); } // namespace game_voxels + +#endif diff --git a/src/game/shared/globals.cc b/src/game/shared/globals.cc index 8552214..92da492 100644 --- a/src/game/shared/globals.cc +++ b/src/game/shared/globals.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: globals.cc +// Description: Global variables + #include "shared/pch.hh" #include "shared/globals.hh" diff --git a/src/game/shared/globals.hh b/src/game/shared/globals.hh index 39a12a7..4c02f43 100644 --- a/src/game/shared/globals.hh +++ b/src/game/shared/globals.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: globals.hh +// Description: Global variables + +#ifndef SHARED_GLOBALS_HH +#define SHARED_GLOBALS_HH #pragma once namespace globals @@ -17,3 +24,5 @@ namespace globals { extern std::uint64_t curtime; } // namespace globals + +#endif diff --git a/src/game/shared/pch.hh b/src/game/shared/pch.hh index e978e0f..13afb80 100644 --- a/src/game/shared/pch.hh +++ b/src/game/shared/pch.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: pch.hh +// Description: Precompiled header + +#ifndef SHARED_PCH_HH +#define SHARED_PCH_HH #pragma once #include <core/pch.hh> // inherit dependent includes from core.lib @@ -17,3 +24,5 @@ #include <spdlog/sinks/basic_file_sink.h> #include <spdlog/sinks/stdout_color_sinks.h> + +#endif diff --git a/src/game/shared/protocol.cc b/src/game/shared/protocol.cc index d274955..9b18f8a 100644 --- a/src/game/shared/protocol.cc +++ b/src/game/shared/protocol.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: protocol.cc +// Description: Network protocol on top of ENet + #include "shared/pch.hh" #include "shared/protocol.hh" diff --git a/src/game/shared/protocol.hh b/src/game/shared/protocol.hh index 2582406..46e0202 100644 --- a/src/game/shared/protocol.hh +++ b/src/game/shared/protocol.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: protocol.hh +// Description: Network protocol on top of ENet + +#ifndef SHARED_PROTOCOL_HH +#define SHARED_PROTOCOL_HH #pragma once #include "shared/world/chunk.hh" @@ -210,3 +217,5 @@ struct protocol::DimensionInfo final : public protocol::Base<0x0012> { std::string name; float gravity; }; + +#endif diff --git a/src/game/shared/splash.cc b/src/game/shared/splash.cc index 86ed0d0..86b71bc 100644 --- a/src/game/shared/splash.cc +++ b/src/game/shared/splash.cc @@ -1,3 +1,8 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: splash.cc +// Description: Randomized text messages + #include "shared/pch.hh" #include "shared/splash.hh" @@ -39,7 +44,7 @@ static void splash_init_filename(std::string_view filename) splash_random.seed(std::random_device()()); } else { - splash_lines.push_back(std::format("{}: {}", filename, physfs_error())); + splash_lines.push_back(std::format("{}: {}", filename, physfs::last_error())); splash_random.seed(std::random_device()()); } } diff --git a/src/game/shared/splash.hh b/src/game/shared/splash.hh index be80cd6..0acfe3b 100644 --- a/src/game/shared/splash.hh +++ b/src/game/shared/splash.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: splash.hh +// Description: Randomized text messages + +#ifndef SHARED_SPLASH_HH +#define SHARED_SPLASH_HH #pragma once namespace splash @@ -6,3 +13,5 @@ void init_client(void); void init_server(void); std::string_view get(void); } // namespace splash + +#endif diff --git a/src/game/shared/types.hh b/src/game/shared/types.hh index 792ed0f..801206c 100644 --- a/src/game/shared/types.hh +++ b/src/game/shared/types.hh @@ -1,3 +1,10 @@ +// SPDX-License-Identifier: BSD-2-Clause +// Copyright (c) 2025 Kirill Dmitrievich +// File: types.hh +// Description: Type definitions + +#ifndef SHARED_TYPES_HH +#define SHARED_TYPES_HH #pragma once using item_id = std::uint32_t; @@ -38,3 +45,5 @@ struct std::hash<chunk_pos_xz> final { return value; } }; + +#endif 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 |
