Example #1
0
        public void Dispose()
        {
            MapRenderer.Dispose();
            TerrainAtlas.Dispose();
            TerrainAtlas1D.Dispose();
            ModelCache.Dispose();
            Entities.Dispose();
            WorldEvents.OnNewMap       -= OnNewMapCore;
            WorldEvents.OnNewMapLoaded -= OnNewMapLoadedCore;
            Events.TextureChanged      -= TextureChangedCore;

            for (int i = 0; i < Components.Count; i++)
            {
                Components[i].Dispose();
            }

            Graphics.DeleteIb(ref defaultIb);
            Drawer2D.DisposeInstance();
            Graphics.DeleteTexture(ref CloudsTex);
            Graphics.Dispose();
            if (lastAtlas != null)
            {
                lastAtlas.Dispose();
            }

            if (Options.OptionsChanged.Count == 0)
            {
                return;
            }
            Options.Load();
            Options.Save();
        }
Example #2
0
        public override void Dispose()
        {
            MapRenderer.Dispose();
            MapBordersRenderer.Dispose();
            EnvRenderer.Dispose();
            WeatherRenderer.Dispose();
            SetNewScreen(null);
            fpsScreen.Dispose();
            SelectionManager.Dispose();
            TerrainAtlas.Dispose();
            TerrainAtlas1D.Dispose();
            ModelCache.Dispose();
            Picking.Dispose();
            ParticleManager.Dispose();
            Players.Dispose();
            AsyncDownloader.Dispose();
            AudioPlayer.Dispose();
            AxisLinesRenderer.Dispose();

            Chat.Dispose();
            if (activeScreen != null)
            {
                activeScreen.Dispose();
            }
            Graphics.DeleteIb(defaultIb);
            Graphics.Dispose();
            Drawer2D.DisposeInstance();
            Animations.Dispose();
            Graphics.DeleteTexture(ref CloudsTexId);
            Graphics.DeleteTexture(ref RainTexId);
            Graphics.DeleteTexture(ref SnowTexId);
            Graphics.DeleteTexture(ref GuiTexId);
            Graphics.DeleteTexture(ref GuiClassicTexId);

            if (Options.HasChanged)
            {
                Options.Save();
            }
            base.Dispose();
        }
Example #3
0
        public void Dispose()
        {
            MapRenderer.Dispose();
            SetNewScreen(null);
            fpsScreen.Dispose();
            TerrainAtlas.Dispose();
            TerrainAtlas1D.Dispose();
            ModelCache.Dispose();
            Entities.Dispose();
            WorldEvents.OnNewMap       -= OnNewMapCore;
            WorldEvents.OnNewMapLoaded -= OnNewMapLoadedCore;

            foreach (IGameComponent comp in Components)
            {
                comp.Dispose();
            }

            if (activeScreen != null)
            {
                activeScreen.Dispose();
            }
            Graphics.DeleteIb(defaultIb);
            Drawer2D.DisposeInstance();
            Graphics.DeleteTexture(ref CloudsTex);
            Graphics.DeleteTexture(ref GuiTex);
            Graphics.DeleteTexture(ref GuiClassicTex);
            Graphics.DeleteTexture(ref IconsTex);
            Graphics.Dispose();

            foreach (WarningScreen screen in WarningOverlays)
            {
                screen.Dispose();
            }

            if (Options.HasChanged)
            {
                Options.Load();
                Options.Save();
            }
        }