/// <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 }); } }
/// <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); }
public World(string WorldName) { Name = WorldName; WorldObjects = new EngineComponentManager(); Activate(); }
/// <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(); }
/// <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(); }
/// <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); }
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); }
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); } }
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); } }
/// <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); } }
/// <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); } }
public EngineComponent(string id) { this.id = id; EngineComponentManager.AddComp(this); }
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; }
public World() { Name = "GameWorld"; WorldObjects = new EngineComponentManager("World_Object_Manager"); }