Skip to content

Commit

Permalink
Fix world holes.
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSmith33 committed Jan 1, 2015
1 parent 0ca63a7 commit 4513767
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion source/modular/modules/eventdispatchermodule.d
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ abstract class Event
private alias EventHandler = void delegate(Event event);

/// Event
class EventDispatcherModule : IModule, IEventDispatcherModule
class EventDispatcherModule : IModule
{
override string name() @property { return "EventDispatcherModule"; }
override string semver() @property { return "1.0.0"; }
Expand Down
14 changes: 8 additions & 6 deletions source/voxelman/chunkman.d
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ struct ChunkMan
storeWorker.stopWorkersWhenDone();

thread_joinAll();

}

void update()
Expand All @@ -113,22 +114,23 @@ struct ChunkMan
chunk.hasWriter = false;
chunk.isLoaded = true;

assert(!chunk.isUsed);

++totalLoadedChunks;
--numLoadChunkTasks;

if (chunk.isMarkedForDeletion)
{
delete data;
return;
}

chunk.isVisible = true;
if (data.chunkData.uniform)
{
chunk.isVisible = blockMan.blocks[data.chunkData.uniformType].isVisible;
}
chunk.data = data.chunkData;

if (chunk.isMarkedForDeletion)
{
return;
}

if (chunk.isVisible)
tryMeshChunk(chunk);
foreach(a; chunk.adjacent)
Expand Down
2 changes: 2 additions & 0 deletions source/voxelman/storageworker.d
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ void storageWorkerThread(Tid mainTid, string regionDir)
while (isRunningLocal)
{
receive(
// read
(ivec3 chunkPos, Tid genWorker) {
if (!atomicLoad(*isRunning)) return;
if (regionStorage.isChunkOnDisk(chunkPos))
Expand All @@ -85,6 +86,7 @@ void storageWorkerThread(Tid mainTid, string regionDir)
genWorker.send(chunkPos);
}
},
// write
(ivec3 chunkPos, shared ChunkData chunkData, bool deleteData) {
writeChunk(chunkPos, cast(ChunkData)chunkData);

Expand Down

0 comments on commit 4513767

Please sign in to comment.