chore: add .clangd configuration

This commit is contained in:
2026-04-21 22:53:34 +08:00
parent c2321a0a6e
commit c7a0aff0c1
8 changed files with 24 additions and 23 deletions

View File

@@ -13,8 +13,8 @@
namespace Cubed {
Chunk::Chunk(World& world, ChunkPos chunk_pos) :
m_world(world),
m_chunk_pos(chunk_pos)
m_chunk_pos(chunk_pos),
m_world(world)
{
}
@@ -27,16 +27,16 @@ Chunk::~Chunk() {
}
Chunk::Chunk(Chunk&& other) noexcept :
m_vbo(other.m_vbo),
m_dirty(other.is_dirty()),
m_need_upload(other.m_need_upload.load()),
m_is_on_gen_vertex_data(other.m_is_on_gen_vertex_data.load()),
m_vertex_sum(other.m_vertex_sum.load()),
m_biome(other.m_biome),
m_chunk_pos(std::move(other.m_chunk_pos)),
m_world(other.m_world),
m_blocks(std::move(other.m_blocks)),
m_dirty(other.is_dirty()),
m_vertexs_data(std::move(other.m_vertexs_data)),
m_biome(other.m_biome),
m_is_on_gen_vertex_data(other.m_is_on_gen_vertex_data.load()),
m_need_upload(other.m_need_upload.load()),
m_vertex_sum(other.m_vertex_sum.load())
m_vbo(other.m_vbo),
m_vertexs_data(std::move(other.m_vertexs_data))
{
other.m_vbo = 0;
}
@@ -128,7 +128,7 @@ void Chunk::gen_vertex_data(const std::array<const std::vector<uint8_t>*, 4>& ne
int idx = Chunk::get_index(x, y, z);
// not init
if (idx >= chunk_blocks->size()) {
if (static_cast<size_t>(idx) >= chunk_blocks->size()) {
Logger::warn("not init");
return false;
}

View File

@@ -10,8 +10,8 @@
namespace Cubed {
Player::Player(World& world, const std::string& name) :
m_world(world),
m_name(name)
m_name(name),
m_world(world)
{
}
@@ -61,7 +61,7 @@ const MoveState& Player::get_move_state() const {
bool Player::ray_cast(const glm::vec3& start, const glm::vec3& front, glm::ivec3& block_pos, glm::vec3& normal, float distance) {
glm::vec3 dir = glm::normalize(front);
float step = 0.1f;
//float step = 0.1f;
glm::ivec3 cur = glm::floor(start);
int ix = cur.x;
int iy = cur.y;