[gnome-chess/gnome-3-8] 3D: fix board numbering when Black is on bottom



commit 5bd2b5266581115b866bcc6b16df0ba02607604e
Author: Michael Catanzaro <mike catanzaro gmail com>
Date:   Fri Jul 19 21:20:33 2013 -0500

    3D: fix board numbering when Black is on bottom
    
    https://bugzilla.gnome.org/show_bug.cgi?id=703837

 src/chess-view-3d.vala |   30 ++++++++++++++++++++++--------
 1 files changed, 22 insertions(+), 8 deletions(-)
---
diff --git a/src/chess-view-3d.vala b/src/chess-view-3d.vala
index 52f4668..70606b0 100644
--- a/src/chess-view-3d.vala
+++ b/src/chess-view-3d.vala
@@ -384,14 +384,28 @@ private class ChessView3D : ChessView
         glTranslatef (x, 0.0f, z);
 
         glBegin (GL_QUADS);
-        glTexCoord2f (l, 0.0f);
-        glVertex3f (-width/2, 0.0f, -width/2);
-        glTexCoord2f (l, 1.0f);
-        glVertex3f (-width/2, 0.0f, width/2);
-        glTexCoord2f (l + w, 1.0f);
-        glVertex3f (width/2, 0.0f, width/2);
-        glTexCoord2f (l + w, 0.0f);
-        glVertex3f (width/2, 0.0f, -width/2);
+        if (scene.board_angle == 180.0)
+        {
+            glTexCoord2f (l + w, 1.0f);
+            glVertex3f (-width/2, 0.0f, -width/2);
+            glTexCoord2f (l + w, 0.0f);
+            glVertex3f (-width/2, 0.0f, width/2);
+            glTexCoord2f (l, 0.0f);
+            glVertex3f (width/2, 0.0f, width/2);
+            glTexCoord2f (l, 1.0f);
+            glVertex3f (width/2, 0.0f, -width/2);
+        }
+        else
+        {
+            glTexCoord2f (l, 0.0f);
+            glVertex3f (-width/2, 0.0f, -width/2);
+            glTexCoord2f (l, 1.0f);
+            glVertex3f (-width/2, 0.0f, width/2);
+            glTexCoord2f (l + w, 1.0f);
+            glVertex3f (width/2, 0.0f, width/2);
+            glTexCoord2f (l + w, 0.0f);
+            glVertex3f (width/2, 0.0f, -width/2);
+        }
         glEnd ();
 
         glPopMatrix ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]