X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=Automap%2FSubsystems%2FAutomapSystem.cs;h=f61fef5769ac9fc3fb4e1b674549d1c4b9206cd1;hb=983e2ab853a3288297ed32d6fb46b8655041c009;hp=fef3886ddf6d232845af76c03f275f88865cd3e7;hpb=c9b09ff738d6b37b52be5ae9d25bae1690f1b3a1;p=automap%2Fautomap.git diff --git a/Automap/Subsystems/AutomapSystem.cs b/Automap/Subsystems/AutomapSystem.cs index fef3886..f61fef5 100644 --- a/Automap/Subsystems/AutomapSystem.cs +++ b/Automap/Subsystems/AutomapSystem.cs @@ -132,9 +132,14 @@ namespace Automap private void ChunkAChanging(Vec3i chunkCoord, IWorldChunk chunk, EnumChunkDirtyReason reason) { - Vec2i topPosition = new Vec2i(chunkCoord.X, chunkCoord.Z); - - columnCounter.AddOrUpdate(topPosition, 1, (key, colAct) => colAct + 1); + Vec2i topPosition = new Vec2i(chunkCoord.X, chunkCoord.Z); + + //TODO: Track Y Chunk - Column, surface chunks being more important + //Only NEW/LOADED chunks unless edits > N + //if (reason == EnumChunkDirtyReason.NewlyCreated || reason == EnumChunkDirtyReason.NewlyLoaded) + //{ + columnCounter.AddOrUpdate(topPosition, 1, (key, colAct) => colAct + 1); + //} } private void AwakenCartographer(float delayed) @@ -221,7 +226,7 @@ namespace Automap ProcessChunkBlocks(mostActiveCol.Key, mapChunk, ref chunkMeta); ChunkRenderer.SetupPngImage(mostActiveCol.Key, path, _chunkPath, ref chunkMeta); - ChunkRenderer.GenerateChunkPngShard(mostActiveCol.Key, mapChunk, chunkMeta, out updatedPixels); + ChunkRenderer.GenerateChunkPngShard(mostActiveCol.Key, mapChunk, chunkMeta, ref chunkTopMetadata, out updatedPixels); if (updatedPixels > 0) { @@ -240,8 +245,6 @@ namespace Automap #endif } } - //Cleanup in-memory Metadata... - chunkTopMetadata.ClearMetadata(); } UpdateStatus(this.updatedChunksTotal, this.nullChunkCount, updatedChunks); @@ -252,6 +255,9 @@ namespace Automap updatedChunksTotal += updatedChunks; JsonGenerator.GenerateJSONMetadata(chunkTopMetadata, startChunkColumn, POIs, EOIs, RockIdCodes); updatedChunks = 0; + + //Cleanup in-memory Metadata... + chunkTopMetadata.ClearMetadata( ); } //Then sleep until interupted again, and repeat @@ -322,10 +328,16 @@ namespace Automap this.BlockID_Designators = new Dictionary(); this.Entity_Designators = new Dictionary(); this.RockIdCodes = Helpers.ArbitrarytBlockIdHunter(ClientAPI, new AssetLocation(GlobalConstants.DefaultDomain, "rock-"), EnumBlockMaterial.Stone); - this.AiryIdCodes = Helpers.ArbitrarytBlockIdHunter(ClientAPI, new AssetLocation(GlobalConstants.DefaultDomain, "tallgrass-"), EnumBlockMaterial.Plant); - //Add special marker types for BlockID's of "Interest", overwrite colour, and method + var airBlocksQuery = from airyBlock in ClientAPI.World.Blocks + where airyBlock.MatterState == EnumMatterState.Solid + where airyBlock.BlockMaterial == EnumBlockMaterial.Plant || airyBlock.BlockMaterial == EnumBlockMaterial.Leaves + where airyBlock.CollisionBoxes == null || airyBlock.CollisionBoxes.Length == 0 + select airyBlock; + //^^ 'Solid' phase - 'Plant' Blocks without any boundg box ? Except water... + this.AiryIdCodes = airBlocksQuery.ToDictionary(aBlk => aBlk.BlockId, aBlk => aBlk.Code.Path); + //Add special marker types for BlockID's of "Interest", overwrite colour, and method Reload_POI_Designators(); }