Skip to content

Commit 4dccb5c

Browse files
committed
Minor fixes
1 parent d5f5d04 commit 4dccb5c

8 files changed

Lines changed: 19 additions & 14 deletions

File tree

include/CommonLib/BlockIndex.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
#ifndef TSOM_COMMONLIB_BLOCKINDEX_HPP
88
#define TSOM_COMMONLIB_BLOCKINDEX_HPP
99

10-
#include <NazaraUtils/Prerequisites.hpp>
1110
#include <NazaraUtils/Constants.hpp>
11+
#include <NazaraUtils/Prerequisites.hpp>
1212

1313
namespace tsom
1414
{

include/CommonLib/BlockIndex.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2025 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
1+
// Copyright (C) 2026 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
22
// This file is part of the "This Space Of Mine" project
33
// For conditions of distribution and use, see copyright notice in LICENSE
44

include/CommonLib/Direction.inl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ namespace tsom
2424

2525
constexpr NeighborChunk ToNeighborChunk(const Nz::Vector3i32& chunkIndices)
2626
{
27-
NazaraAssert(chunkIndices.x >= -1 && chunkIndices.x <= -1);
28-
NazaraAssert(chunkIndices.y >= -1 && chunkIndices.y <= -1);
29-
NazaraAssert(chunkIndices.z >= -1 && chunkIndices.z <= -1);
27+
NazaraAssert(chunkIndices.x >= -1 && chunkIndices.x <= 1);
28+
NazaraAssert(chunkIndices.y >= -1 && chunkIndices.y <= 1);
29+
NazaraAssert(chunkIndices.z >= -1 && chunkIndices.z <= 1);
3030

3131
return static_cast<NeighborChunk>((chunkIndices.x + 1) * 9 + (chunkIndices.y + 1) * 3 + (chunkIndices.z + 1));
3232
}

include/CommonLib/SurfaceNetsChunk.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2025 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
1+
// Copyright (C) 2026 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
22
// This file is part of the "This Space Of Mine" project
33
// For conditions of distribution and use, see copyright notice in LICENSE
44

include/CommonLib/SurfaceNetsChunk.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2025 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
1+
// Copyright (C) 2026 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
22
// This file is part of the "This Space Of Mine" project
33
// For conditions of distribution and use, see copyright notice in LICENSE
44

src/CommonLib/ChunkEntities.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,14 @@ namespace tsom
138138
DestroyChunkEntity(chunkIndices);
139139
}
140140
m_createdDestroyedChunks.clear();
141-
}
142141

143-
for (auto&& [chunkIndices, neighborMask] : m_invalidatedChunks)
144-
UpdateChunkEntity(chunkIndices, neighborMask);
142+
std::lock_guard lock2(m_invalidatedChunkMutex);
143+
144+
for (auto&& [chunkIndices, neighborMask] : m_invalidatedChunks)
145+
UpdateChunkEntity(chunkIndices, neighborMask);
145146

146-
m_invalidatedChunks.clear();
147+
m_invalidatedChunks.clear();
148+
}
147149
}
148150

149151
void ChunkEntities::CreateChunkEntity(const ChunkIndices& chunkIndices)

src/CommonLib/SurfaceNetsChunk.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2025 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
1+
// Copyright (C) 2026 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
22
// This file is part of the "This Space Of Mine" project
33
// For conditions of distribution and use, see copyright notice in LICENSE
44

@@ -12,9 +12,9 @@
1212
#include <NazaraUtils/Bitset.hpp>
1313
#include <NazaraUtils/CallOnExit.hpp>
1414
#include <NazaraUtils/FixedVector.hpp>
15+
#include <spdlog/spdlog.h>
1516
#include <map>
1617
#include <numeric>
17-
#include <spdlog/spdlog.h>
1818

1919
// Thanks a lot to:
2020
// https://github.com/Q-Minh/naive-surface-nets
@@ -362,6 +362,9 @@ namespace tsom
362362
MultiChunkReadLock chunkLock;
363363
for (const ChunkIndices& dir : s_neighborChunkOffset)
364364
{
365+
if (dir.x == 0 && dir.y == 0 && dir.z == 0)
366+
continue; //< Our own chunk is already locked
367+
365368
const Chunk* chunk = m_owner.GetChunk(m_indices + dir);
366369

367370
neighborChunks[ToNeighborChunk(dir)] = chunk;

src/Game/States/PlanetEditorState.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
#include <Nazara/Graphics/PropertyHandler/UniformValuePropertyHandler.hpp>
3434
#include <Nazara/Platform/Window.hpp>
3535
#include <Nazara/Renderer/Plugins/ImGuiPlugin.hpp>
36-
#include <numeric>
3736
#include <imgui.h>
3837
#include <misc/cpp/imgui_stdlib.h>
38+
#include <numeric>
3939

4040
namespace tsom
4141
{

0 commit comments

Comments
 (0)