From: jpbruyere Date: Sun, 6 Mar 2016 21:44:58 +0000 (+0100) Subject: non blocking update mutex, removed delegates, test parent==null in clip registration X-Git-Tag: v0.4~92 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=f6418d2a9219a63116ba706cbf54d8c0e8d88bff;p=jp%2Fcrow.git non blocking update mutex, removed delegates, test parent==null in clip registration --- diff --git a/LinuxCrow/LinuxCrow.csproj b/LinuxCrow/LinuxCrow.csproj new file mode 100644 index 00000000..116608be --- /dev/null +++ b/LinuxCrow/LinuxCrow.csproj @@ -0,0 +1,33 @@ + + + + Debug + Linux_x86 + 8.0.30703 + 2.0 + {819640AC-C8B0-4E4A-9845-B24D5402F836} + Exe + LinuxCrow + LinuxCrow + v4.5 + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + false + + + full + true + bin\Release + prompt + 4 + false + + + \ No newline at end of file diff --git a/OTKCrow/OpenTKGameWindow.cs b/OTKCrow/OpenTKGameWindow.cs index 07dd1d58..3a705fc0 100644 --- a/OTKCrow/OpenTKGameWindow.cs +++ b/OTKCrow/OpenTKGameWindow.cs @@ -270,7 +270,7 @@ namespace Crow protected override void OnResize(EventArgs e) { base.OnResize (e); - CrowInterface.ResizeDelegate.Invoke( + CrowInterface.ProcessResize( new Rectangle( this.ClientRectangle.X, this.ClientRectangle.Y, diff --git a/src/Interface.cs b/src/Interface.cs index 3f4cc918..d09e19e6 100644 --- a/src/Interface.cs +++ b/src/Interface.cs @@ -37,20 +37,12 @@ namespace Crow { public class Interface : ILayoutable { - public delegate void ResizeDelegatePrototype(Rectangle bounds); - public delegate void LoaderDelegatePrototype (string path); - public ResizeDelegatePrototype ResizeDelegate; - public LoaderDelegatePrototype LoadInterfaceDelegate; - #region CTOR static Interface(){ Interface.LoadCursors (); } public Interface(){ Interface.CurrentInterface = this; - - LoadInterfaceDelegate = new LoaderDelegatePrototype(InterfaceLoad); - ResizeDelegate = new ResizeDelegatePrototype (ProcessResize); } #endregion @@ -317,14 +309,16 @@ namespace Crow FocusedWidget.onMouseClick (this, new MouseButtonEventArgs (Mouse.X, Mouse.Y, MouseButton.Left, true)); } } + if (!Monitor.TryEnter (UpdateMutex)) + return; - lock (UpdateMutex) { - processLayouting (); + processLayouting (); - clippingRegistration (); + clippingRegistration (); - processDrawing (); - } + processDrawing (); + + Monitor.Exit (UpdateMutex); // if (ToolTip.isVisible) { // ToolTip.panel.processkLayouting(); @@ -378,6 +372,8 @@ namespace Crow foreach (GraphicObject p in RedrawList) { try { p.IsInRedrawList = false; + if (p.Parent == null) + continue; p.Parent.RegisterClip (p.LastPaintedSlot); p.Parent.RegisterClip (p.getSlot ()); } catch (Exception ex) {