public static void SaveAllVoxels() { foreach (var voxelMap in MyVoxelMaps.GetVoxelMaps()) { SaveVoxel(voxelMap); } }
// Initialized new voxel cell cache. Capacity specified count of voxel cells in the cache. public static void LoadContent() { MyMwcLog.WriteLine("MyVoxelCacheRender.LoadContent() - START"); MyMwcLog.IncreaseIndent(); MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().StartProfilingBlock("MyVoxelCacheRender::LoadContent"); foreach (KeyValuePair <Int64, LinkedListNode <MyVoxelCacheCellRender> > kvp in m_cellsByCoordinate) { //kvp.Value.Value.Reset(); m_priority.Remove(kvp.Value.Value); m_priority.AddFirst(kvp.Value.Value); } m_cellsByCoordinate.Clear();//forces to recreate all rendering cells on next call //this is here becouse it worked and is probably right way how to invalidate this stuff (really dont know why) foreach (MyVoxelMap map in MyVoxelMaps.GetVoxelMaps()) { map.InvalidateCache(new MyMwcVector3Int(-1000, -1000, -1000), new MyMwcVector3Int(1000, 1000, 1000)); } MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().EndProfilingBlock(); MyMwcLog.DecreaseIndent(); MyMwcLog.WriteLine("MyVoxelCacheRender.LoadContent() - END"); }
public static bool LoadAllVoxels() { bool foundAll = true; foreach (var voxelMap in MyVoxelMaps.GetVoxelMaps()) { var foundVoxelMap = LoadVoxel(voxelMap); foundAll &= foundVoxelMap; } return(foundAll); }