OSDN Git Service

Avoid looking up in the whole sim Dictionary.
authorLatif Khalifa <latifer@streamgrid.net>
Tue, 28 Jun 2011 04:40:02 +0000 (04:40 +0000)
committerLatif Khalifa <latifer@streamgrid.net>
Tue, 28 Jun 2011 04:40:02 +0000 (04:40 +0000)
Disable vsync.

git-svn-id: https://radegast.googlecode.com/svn/trunk@908 f7a694da-4d33-11de-9ad6-1127a62b9fcd

Radegast/GUI/Rendering/Rendering.cs

index affad93..99a6a9c 100644 (file)
@@ -296,6 +296,7 @@ namespace Radegast
             glControl.Load += new EventHandler(glControl_Load);\r
             glControl.Disposed += new EventHandler(glControl_Disposed);\r
             glControl.Dock = DockStyle.Fill;\r
+            glControl.VSync = false;\r
             Controls.Add(glControl);\r
             glControl.BringToFront();\r
         }\r
@@ -616,7 +617,7 @@ namespace Radegast
                 {\r
                     Client.Network.CurrentSim.ObjectsPrimitives.FindAll((Primitive root) => root.ParentID == 0).ForEach((Primitive mainPrim) =>\r
                     {\r
-                        UpdatePrimBlocking(Client.Network.CurrentSim.ObjectsPrimitives[mainPrim.LocalID]);\r
+                        UpdatePrimBlocking(mainPrim);\r
                         Client.Network.CurrentSim.ObjectsPrimitives.FindAll((Primitive p) => { return p.ParentID == mainPrim.LocalID; })\r
                             .FindAll((Primitive child) => child.ParentID == mainPrim.LocalID)\r
                             .ForEach((Primitive subPrim) => UpdatePrimBlocking(subPrim));\r
@@ -671,10 +672,10 @@ namespace Radegast
             }\r
             else\r
             {\r
-                Primitive parent;\r
-                if (Client.Network.CurrentSim.ObjectsPrimitives.TryGetValue(prim.ParentID, out parent))\r
+                FacetedMesh parent;\r
+                if (Prims.TryGetValue(prim.ParentID, out parent))\r
                 {\r
-                    return parent.Position + prim.Position * Matrix4.CreateFromQuaternion(parent.Rotation);\r
+                    return parent.Prim.Position + prim.Position * Matrix4.CreateFromQuaternion(parent.Prim.Rotation);\r
                     //return parent.Position * prim.Position * prim.Rotation;\r
                 }\r
                 else\r
@@ -773,8 +774,8 @@ namespace Radegast
                 {\r
                     primNr++;\r
                     Primitive prim = mesh.Prim;\r
-                    Primitive parent = null;\r
-                    if (prim.ParentID != 0 && !Client.Network.CurrentSim.ObjectsPrimitives.TryGetValue(prim.ParentID, out parent)) continue;\r
+                    FacetedMesh parent = null;\r
+                    if (prim.ParentID != 0 && !Prims.TryGetValue(prim.ParentID, out parent)) continue;\r
 \r
                     // Individual prim matrix\r
                     GL.PushMatrix();\r
@@ -782,8 +783,8 @@ namespace Radegast
                     if (prim.ParentID != 0)\r
                     {\r
                         // Apply prim translation and rotation relative to the root prim\r
-                        GL.MultMatrix(Math3D.CreateTranslationMatrix(parent.Position));\r
-                        GL.MultMatrix(Math3D.CreateRotationMatrix(parent.Rotation));\r
+                        GL.MultMatrix(Math3D.CreateTranslationMatrix(parent.Prim.Position));\r
+                        GL.MultMatrix(Math3D.CreateRotationMatrix(parent.Prim.Rotation));\r
                     }\r
 \r
                     // Prim roation and position\r
@@ -1049,7 +1050,7 @@ namespace Radegast
                 }\r
                 else\r
                 {\r
-                    mesh = renderer.GenerateFacetedMesh(prim, DetailLevel.Highest);\r
+                    mesh = renderer.GenerateFacetedMesh(prim, DetailLevel.High);\r
                 }\r
             }\r
             catch\r