public static bool IsObjectOnScreen(DevicePanel d, Classes.Scene.EditorEntity _entity) { int x = _entity.Position.X.High; int y = _entity.Position.Y.High; int Transparency = (Methods.Solution.CurrentSolution.EditLayerA == null) ? 0xff : 0x32; if (!_entity.FilteredOut) { if (_entity.CurrentRender == null) { var RenderDrawing = EntityRenderers.Where(t => t.GetObjectName() == _entity.Object.Name.Name).FirstOrDefault(); _entity.CurrentRender = RenderDrawing; } if (_entity.CurrentRender != null) { return(_entity.CurrentRender.isObjectOnScreen(d, _entity, x, y, Transparency)); } else { return(d.IsObjectOnScreen(x, y, 20, 20)); } } else { return(false); } }
public static void DrawDedicatedRender(DevicePanel d, Classes.Scene.EditorEntity e) { if (ProgramBase.IsDebug) { Call(); } else { try { Call(); } catch (Exception ex) { string note = "This object will no longer render until reloaded!"; string error = string.Format("Entity Rendering Error on Object {0}:{1}{2}{1}{3}{1}{1}{4})", e.Object.Name.Name, Environment.NewLine, ex.Message, ex.StackTrace, note); MessageBox.Show(error); e.DoesRenderHaveErrors = true; } } void Call() { int x = e.Position.X.High; int y = e.Position.Y.High; int Transparency = (Methods.Solution.CurrentSolution.EditLayerA == null) ? 0xff : 0x32; Structures.EntityRenderProp properties = new Structures.EntityRenderProp(d, e, x, y, Transparency); if (!e.DoesRenderHaveErrors) { if (e.CurrentRender == null) { var RenderDrawing = EntityRenderers.Where(t => t.GetObjectName() == e.Object.Name.Name).FirstOrDefault(); e.CurrentRender = RenderDrawing; } if (e.CurrentRender != null) { e.CurrentRender.Draw(properties); } } } }