Ejemplo n.º 1
0
        /// <summary>
        /// Draws all of the IDrawItems that are to be drawn.
        /// </summary>
        public void Render()
        {
            if (layers.Layers > 0)
            {
                if (LightingManager.LightCount > 0 && CameraManager.CurrentCamera != null)
                {
                    Draw(DrawingStage.Colour);
                    Draw(DrawingStage.Normal);
                    Draw(DrawingStage.Distortion);
                    lighting.SetTargets(render.Texture, opaqueRender.Texture);
                    lighting.Draw();

                    final = lighting.Final;
                }
                else
                {
                    Draw(DrawingStage.Colour);

                    final = render.Texture;
                }
            }
            else
            {
                final = black;
            }

            EngineComponent comp = EngineComponentManager.Find("D2RenderFramework");

            if (comp != null)
            {
                comp.SendMessage("SetPostProcessing", new object[] { final,
                                                                     opaqueRender.Texture, distortionRender.Texture });
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Disposes of the Framework.
        /// </summary>
        /// <param name="disposing">Weather or not to dispose.</param>
        protected override void Dispose(bool disposing)
        {
            compManager.Dispose();
            compManager = null;

            base.Dispose(disposing);
        }
Ejemplo n.º 3
0
        public World(string WorldName)
        {
            Name = WorldName;

            WorldObjects = new EngineComponentManager();

            Activate();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Creates a new Aeon framework.
        /// </summary>
        public Framework()
        {
            common = new Common(this);

            Common.ContentManager.RootDirectory = "Content\\";
            common.ViewChanged += new ViewportChanged(ViewportChanged);

            compManager = new EngineComponentManager();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Creates a new Eon framework.
        /// </summary>
        public Framework()
        {
            common = new Common(this);

            Common.ContentManager.RootDirectory = "Content\\";
            Common.OnScreenResChanged          += new ScreenResolutionChangedEvent(ScreenResChanged);
            Common.OnExit += Common_OnExit;

            compManager = new EngineComponentManager();
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Creates a new Eon framework.
        /// </summary>
        public Framework()
        {
            common = new Common(this);

            Common.OnTextureQualityChanged += new TextureQualityChangedEvent(TextureQualityChanged);
            Common.OnExit += Common_OnExit;

            compManager = new EngineComponentManager();

            TargetElapsedTime = TimeSpan.FromTicks(60000);
        }
Ejemplo n.º 7
0
        public void EngineComponentManager_Test()
        {
            #region Setup
            EngineComponentManager TestComponentManager = new EngineComponentManager("UnitTestManager");
            Random r = new Random();

            int MaxTestLoad   = 100;
            int NumLoadables  = r.Next(MaxTestLoad);
            int NumComponents = r.Next(MaxTestLoad);
            int NumUpdatable  = r.Next(MaxTestLoad);
            int NumRenderable = r.Next(MaxTestLoad);
            int NumUnloadable = r.Next(MaxTestLoad);

            TestLoadable[]   loadables   = new TestLoadable[NumLoadables];
            TestUnloadable[] unloadables = new TestUnloadable[NumUnloadable];
            TestUnloadable[] updatables  = new TestUnloadable[NumUpdatable];
            TestRenderable[] renderables = new TestRenderable[NumRenderable];
            TestComponent[]  components  = new TestComponent[NumComponents];

            for (int i = 0; i < NumLoadables; ++i)
            {
                loadables[i] = new TestLoadable();
                TestComponentManager.AddComponent(loadables[i]);
            }
            for (int i = 0; i < NumUnloadable; ++i)
            {
                unloadables[i] = new TestUnloadable();
                TestComponentManager.AddComponent(unloadables[i]);
            }
            for (int i = 0; i < NumUpdatable; ++i)
            {
                updatables[i] = new TestUnloadable();
                TestComponentManager.AddComponent(updatables[i]);
            }
            for (int i = 0; i < NumRenderable; ++i)
            {
                renderables[i] = new TestRenderable();
                TestComponentManager.AddComponent(renderables[i]);
            }
            for (int i = 0; i < NumComponents; ++i)
            {
                components[i] = new TestComponent();
                TestComponentManager.AddComponent(components[i]);
            }
            #endregion

            int TotalExpectedComponentCount = (NumComponents + NumLoadables + NumRenderable + NumUnloadable + NumUpdatable);

            Assert.IsTrue(TestComponentManager.TotalComponents == TotalExpectedComponentCount);
            Assert.IsTrue(TestComponentManager.UnloadableComponentCount == NumUnloadable);
            Assert.IsTrue(TestComponentManager.UpdatableComponentCount == NumUpdatable);
            Assert.IsTrue(TestComponentManager.RenderableComponentCount == NumRenderable);
            Assert.IsTrue(TestComponentManager.UnloadableComponentCount == NumUnloadable);
        }
Ejemplo n.º 8
0
        internal void Initialize()
        {
            AnimaticManager am = (AnimaticManager)EngineComponentManager.Find("AnimaticManager");

            if (am != null)
            {
                AnimaticStream stream = am.GetStream(streamNumber);
                actions = stream.GetActions(actionIDs);
            }

            for (int i = 0; i < actions.Count; i++)
            {
                actions[i].OnComplete  = null;
                actions[i].OnComplete += new FinishedActionEvent(Complete);
            }
        }
Ejemplo n.º 9
0
        protected virtual void _LevelTransitionOn(string levelID)
        {
            EngineComponent comp = EngineComponentManager.Find("Camera2DManager");

            if (comp == null)
            {
                comp = EngineComponentManager.Find("Camera3DManager");

                if (comp != null)
                {
                    comp.SendMessage("LockToGameObject", position);
                }
            }
            else
            {
                comp.SendMessage("LockToGameObject", position, size);
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Creates a new Animatic.
        /// </summary>
        /// <param name="filepath">The filepath of the Animatic.</param>
        public Animatic(string filepath)
        {
            AnimaticInfo info = XmlHelper.Deserialize <AnimaticInfo>(filepath, ".Animatic", true);

            activeState = info.ActiveInState;

            for (int i = 0; i < info.Streams.Length; i++)
            {
                AnimaticStream stream = new AnimaticStream(info.Streams[i], i);
                stream.OnEnd += new EndOfStreamEvent(OnEnd);

                streams.Add(stream);
            }

            AnimaticManager am = (AnimaticManager)EngineComponentManager.Find("AnimaticManager");

            if (am != null)
            {
                am.Add(this);
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Creates a new Animatic.
        /// </summary>
        /// <param name="filepath">The filepath of the Animatic.</param>
        public Animatic(string filepath)
        {
            AnimaticInfo info =
                Common.ContentManager.Load <AnimaticInfo>(filepath);

            activeState = info.ActiveInState;

            for (int i = 0; i < info.Streams.Count; i++)
            {
                AnimaticStream stream = new AnimaticStream(info.Streams[i], i);
                stream.OnEnd += new EndOfStreamEvent(OnEnd);

                streams.Add(stream);
            }

            AnimaticManager am = (AnimaticManager)EngineComponentManager.Find("AnimaticManager");

            if (am != null)
            {
                am.Add(this);
            }
        }
Ejemplo n.º 12
0
 public EngineComponent(string id)
 {
     this.id = id;
     EngineComponentManager.AddComp(this);
 }
Ejemplo n.º 13
0
        private EngineComponentManager.ComponentInfo[] GetSortedComponentsByType(EngineComponentManager.ComponentTypeFlags type)
        {
            EngineComponentManager.ComponentInfo[] components = EngineComponentManager.Instance.GetComponentsByType(
                type, true);

            ArrayUtils.SelectionSort<EngineComponentManager.ComponentInfo>(components,
                delegate(EngineComponentManager.ComponentInfo info1, EngineComponentManager.ComponentInfo info2)
                {
                    if (info1.Name.Contains("NULL"))
                        return -1;
                    if (info2.Name.Contains("NULL"))
                        return 1;
                    return string.Compare(info1.FullName, info2.FullName, true);
                });

            return components;
        }
Ejemplo n.º 14
0
        public World()
        {
            Name = "GameWorld";

            WorldObjects = new EngineComponentManager("World_Object_Manager");
        }