summaryrefslogtreecommitdiffstats
path: root/src/SpawnPrepare.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/SpawnPrepare.h')
-rw-r--r--src/SpawnPrepare.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/SpawnPrepare.h b/src/SpawnPrepare.h
index 6d001b5f7..62daf1f84 100644
--- a/src/SpawnPrepare.h
+++ b/src/SpawnPrepare.h
@@ -6,10 +6,15 @@ class cWorld;
/** Generates and lights the spawn area of the world. Runs as a separate thread. */
-class cSpawnPrepare
+class cSpawnPrepare:
+ public std::enable_shared_from_this<cSpawnPrepare>
{
-
+ /** Private tag allows public constructors that can only be used with private access. */
+ struct sMakeSharedTag {};
public:
+
+ cSpawnPrepare(cWorld & a_World, int a_SpawnChunkX, int a_SpawnChunkZ, int a_PrepareDistance, int a_FirstIdx, sMakeSharedTag);
+
static void PrepareChunks(cWorld & a_World, int a_SpawnChunkX, int a_SpawnChunkZ, int a_PrepareDistance);
protected:
@@ -36,8 +41,6 @@ protected:
/** Number of chunks prepared when the last progress report was emitted. */
int m_LastReportChunkCount;
- cSpawnPrepare(cWorld & a_World, int a_SpawnChunkX, int a_SpawnChunkZ, int a_PrepareDistance, int a_FirstIdx);
-
void PreparedChunkCallback(int a_ChunkX, int a_ChunkZ);
/** Decodes the index into chunk coords. Provides the specific chunk ordering. */