OSDN Git Service

* Remove unnecessary glFlush() calls
authorLatif Khalifa <latifer@streamgrid.net>
Wed, 6 Jul 2011 22:14:42 +0000 (22:14 +0000)
committerLatif Khalifa <latifer@streamgrid.net>
Wed, 6 Jul 2011 22:14:42 +0000 (22:14 +0000)
* Fudge sphere UV mapping

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

Radegast/GUI/Rendering/Rendering.cs

index 5574019..0e082d8 100644 (file)
@@ -716,7 +716,6 @@ namespace Radegast.Rendering
             }\r
 \r
             bitmap.UnlockBits(bitmapData);\r
-            GL.Flush();\r
             return ret;\r
         }\r
 \r
@@ -1744,8 +1743,6 @@ namespace Radegast.Rendering
 \r
             // Pop the world matrix\r
             GL.PopMatrix();\r
-            GL.Flush();\r
-\r
         }\r
 \r
         private void GluPerspective(float fovy, float aspect, float zNear, float zFar)\r
@@ -1903,6 +1900,14 @@ namespace Radegast.Rendering
                     teFace.OffsetV = 0;\r
                 }\r
 \r
+                // Need to adjust UV for spheres as they are sort of half-prim\r
+                if (prim.PrimData.ProfileCurve == ProfileCurve.HalfCircle)\r
+                {\r
+                    teFace = new Primitive.TextureEntryFace(teFace);\r
+                    teFace.RepeatV *= 2;\r
+                    teFace.OffsetV += 0.5f;\r
+                }\r
+\r
                 // Texture transform for this face\r
                 renderer.TransformTexCoords(face.Vertices, face.Center, teFace);\r
 \r