File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
1313namespace tsom
1414{
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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)
Original file line number Diff line number Diff line change 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
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;
Original file line number Diff line number Diff line change 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
4040namespace tsom
4141{
You can’t perform that action at this time.
0 commit comments