Esempio n. 1
0
        //--------------------//

        #region Dispose
        protected override void OnDispose()
        {
            Log.Info("Disposing engine\nLast framerate: " + Performance.Fps);

            // Dispose scenes and views
            ExtraRender = null;
            foreach (var view in Views)
            {
                view.Scene.Dispose();
            }
            base.OnDispose();

            // Shutdown music
            Music?.Dispose();

            // Dispose cached assets
            Cache?.Dispose();

            // Dispose default meshes
            SimpleSphere?.Dispose();
            SimpleBox?.Dispose();

            // Dispose Direct3D device
            BackBuffer?.Dispose();
            Device?.Dispose();

            // Dispose DirectSound objects
            //_listener?.Dispose();
            AudioDevice?.Dispose();

            _direct3D?.Dispose();

            // Dispose debug window
            _debugForm?.Dispose();
        }
Esempio n. 2
0
        public static ISceneObject SpectatorActionReadinessIndicator(ISpectatorAction a, MiningModule parent, double rotation, Color begin, Color end, Color stroke)
        {
            SimpleSphere s = new SimpleSphere(a.SceneMgr, IdMgr.GetNewId(a.SceneMgr.GetCurrentPlayer().GetId()));

            s.Color    = a.CastingColor;
            s.Radius   = 6;
            s.Category = DrawingCategory.PLAYER_OBJECTS;

            Vector offset = new Vector(parent.Radius + 15, 0).Rotate(rotation);

            s.SetGeometry(SceneGeometryFactory.CreateRadialGradientEllipseGeometry(a.SceneMgr, s.Radius, begin, end, stroke, parent.Center + offset, 1));

            CenterCloneControl ccc = new CenterCloneControl(parent);

            ccc.Offset = offset;
            s.AddControl(ccc);

            return(s);
        }