Exemplo n.º 1
0
        internal static void OnResourcesGather()
        {
            foreach (var id in MaterialQueryResourcesTable)
            {
                MyVoxelMaterialDetailSet.ReleaseResources(ref Table[id].Near);
                MyVoxelMaterialDetailSet.PrepareArrays(ref Table[id].Near);

                MyVoxelMaterialDetailSet.ReleaseResources(ref Table[id].Far1);
                MyVoxelMaterialDetailSet.PrepareArrays(ref Table[id].Far1);

                MyVoxelMaterialDetailSet.ReleaseResources(ref Table[id].Far2);
                MyVoxelMaterialDetailSet.PrepareArrays(ref Table[id].Far2);
            }

            if (MaterialQueryResourcesTable.Count > 0)
            {
                // because array of foliage might have changed
                RebuildMaterialFoliageTable();

                // traverse and update all existing proxies
                foreach (var kv in MaterialProxyTripleIndex)
                {
                    MyMaterials1.ProxyPool.Data[kv.Value.Index] = CreateProxy(kv.Key);
                }
            }

            MaterialQueryResourcesTable.Clear();
        }
Exemplo n.º 2
0
 internal static void ReleaseResources()
 {
     for (int i = 0; i < Table.Length; i++)
     {
         MyVoxelMaterialDetailSet.ReleaseResources(ref Table[i].Near);
         MyVoxelMaterialDetailSet.ReleaseResources(ref Table[i].Far1);
         MyVoxelMaterialDetailSet.ReleaseResources(ref Table[i].Far2);
     }
 }
Exemplo n.º 3
0
 internal static void ReleaseResources()
 {
     for (int i = 0; i < Table.Length; i++)
     {
         MyVoxelMaterialDetailSet.ReleaseResources(ref Table[i].Near);
         MyVoxelMaterialDetailSet.ReleaseResources(ref Table[i].Far1);
         MyVoxelMaterialDetailSet.ReleaseResources(ref Table[i].Far2);
         if (Table[i].FoliageColorTextureArray != null)
         {
             Table[i].FoliageColorTextureArray.Dispose();
         }
         if (Table[i].FoliageNormalTextureArray != null)
         {
             Table[i].FoliageNormalTextureArray.Dispose();
         }
     }
 }
Exemplo n.º 4
0
 internal static void ReleaseResources()
 {
     for (int i = 0; i < Table.Length; i++)
     {
         MyVoxelMaterialDetailSet.ReleaseResources(ref Table[i].Near);
         MyVoxelMaterialDetailSet.ReleaseResources(ref Table[i].Far1);
         MyVoxelMaterialDetailSet.ReleaseResources(ref Table[i].Far2);
         MyFileArrayTextureManager manager = MyManagers.FileArrayTextures;
         if (Table[i].FoliageColorTextureArray != null)
         {
             manager.DisposeTex(ref Table[i].FoliageColorTextureArray);
         }
         if (Table[i].FoliageNormalTextureArray != null)
         {
             manager.DisposeTex(ref Table[i].FoliageNormalTextureArray);
         }
     }
 }