]> O.S.I.I.S - jp/crow.git/commitdiff
non blocking update mutex, removed delegates, test parent==null in clip registration
authorjpbruyere <jp.bruyere@hotmail.com>
Sun, 6 Mar 2016 21:44:58 +0000 (22:44 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Sun, 6 Mar 2016 21:44:58 +0000 (22:44 +0100)
LinuxCrow/LinuxCrow.csproj [new file with mode: 0644]
OTKCrow/OpenTKGameWindow.cs
src/Interface.cs

diff --git a/LinuxCrow/LinuxCrow.csproj b/LinuxCrow/LinuxCrow.csproj
new file mode 100644 (file)
index 0000000..116608b
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">Linux_x86</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{819640AC-C8B0-4E4A-9845-B24D5402F836}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>LinuxCrow</RootNamespace>
+    <AssemblyName>LinuxCrow</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Linux_x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug</OutputPath>
+    <DefineConstants>DEBUG;</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <ConsolePause>false</ConsolePause>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Linux_x86' ">
+    <DebugType>full</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release</OutputPath>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <ConsolePause>false</ConsolePause>
+  </PropertyGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+</Project>
\ No newline at end of file
index 07dd1d5810ec4ed309815883c8616e4998277648..3a705fc08d60a2a9d65dc7826c98156671adb52b 100644 (file)
@@ -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,
index 3f4cc918bf4490ac7a83aee2d3169ce96ab00428..d09e19e6cbb5bbc28d92c025b3c1c98b85209e00 100644 (file)
@@ -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) {