+faceSizes(rubikstruct * rp, int face, int * sizeOfRow, int * sizeOfColumn)
+{
+ switch (face) {
+ case 0: /* TOP */
+ case 4: /* BOTTOM */
+ *sizeOfRow = MAXSIZEX;
+ *sizeOfColumn = MAXSIZEZ;
+ break;
+ case 1: /* LEFT */
+ case 3: /* RIGHT */
+ *sizeOfRow = MAXSIZEZ;
+ *sizeOfColumn = MAXSIZEY;
+ break;
+ case 2: /* FRONT */
+ case 5: /* BACK */
+ *sizeOfRow = MAXSIZEX;
+ *sizeOfColumn = MAXSIZEY;
+ break;
+ }
+}
+
+static Bool
+checkFaceSquare(rubikstruct * rp, int face)
+{
+ int sizeOfRow, sizeOfColumn;
+
+ faceSizes(rp, face, &sizeOfRow, &sizeOfColumn);
+ return (sizeOfRow == sizeOfColumn);
+ /* Cubes can be made square with a 4x2 face where 90 degree turns
+ * should be permitted but that is kind of complicated for me.
+ * This can be done in 2 ways where the side of the cubies are
+ * the same size and one where one side (the side with half the
+ * number of cubies) is twice the size of the other. The first is
+ * complicated because faces of cubies can go under other faces.
+ * The second way is similar to "banded cubes" where scotch tape
+ * restricts the moves of some cubes. Here you have to keep track
+ * of the restrictions and show banded cubies graphically as one
+ * cube.
+ */
+}
+
+static int
+sizeFace(rubikstruct * rp, int face)
+{
+ int sizeOfRow, sizeOfColumn;
+
+ faceSizes(rp, face, &sizeOfRow, &sizeOfColumn);
+ return (sizeOfRow * sizeOfColumn);
+}
+
+static int
+sizeRow(rubikstruct * rp, int face)
+{
+ int sizeOfRow, sizeOfColumn; /* sizeOfColumn not used */
+
+ faceSizes(rp, face, &sizeOfRow, &sizeOfColumn);
+ return sizeOfRow;
+}
+
+static Bool
+draw_stickerless_cubit(rubikstruct *rp, unsigned long *polysP)
+{
+ glBegin(GL_QUADS);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray);
+ /* Put sticker here */
+ glNormal3f(0.00, 0.00, 1.00);
+ glVertex3f(-CUBEROUND, -CUBEROUND, CUBELEN);
+ glVertex3f(CUBEROUND, -CUBEROUND, CUBELEN);
+ glVertex3f(CUBEROUND, CUBEROUND, CUBELEN);
+ glVertex3f(-CUBEROUND, CUBEROUND, CUBELEN);
+ (*polysP)++;
+ glNormal3f(0.00, 0.00, -1.00);
+ glVertex3f(-CUBEROUND, CUBEROUND, -CUBELEN);
+ glVertex3f(CUBEROUND, CUBEROUND, -CUBELEN);
+ glVertex3f(CUBEROUND, -CUBEROUND, -CUBELEN);
+ glVertex3f(-CUBEROUND, -CUBEROUND, -CUBELEN);
+ (*polysP)++;
+ glNormal3f(-1.00, 0.00, 0.00);
+ glVertex3f(-CUBELEN, -CUBEROUND, CUBEROUND);
+ glVertex3f(-CUBELEN, CUBEROUND, CUBEROUND);
+ glVertex3f(-CUBELEN, CUBEROUND, -CUBEROUND);
+ glVertex3f(-CUBELEN, -CUBEROUND, -CUBEROUND);
+ (*polysP)++;
+ glNormal3f(1.00, 0.00, 0.00);
+ glVertex3f(CUBELEN, -CUBEROUND, -CUBEROUND);
+ glVertex3f(CUBELEN, CUBEROUND, -CUBEROUND);
+ glVertex3f(CUBELEN, CUBEROUND, CUBEROUND);
+ glVertex3f(CUBELEN, -CUBEROUND, CUBEROUND);
+ (*polysP)++;
+ glNormal3f(0.00, -1.00, 0.00);
+ glVertex3f(CUBEROUND, -CUBELEN, -CUBEROUND);
+ glVertex3f(CUBEROUND, -CUBELEN, CUBEROUND);
+ glVertex3f(-CUBEROUND, -CUBELEN, CUBEROUND);
+ glVertex3f(-CUBEROUND, -CUBELEN, -CUBEROUND);
+ (*polysP)++;
+ glNormal3f(0.00, 1.00, 0.00);
+ glVertex3f(-CUBEROUND, CUBELEN, -CUBEROUND);
+ glVertex3f(-CUBEROUND, CUBELEN, CUBEROUND);
+ glVertex3f(CUBEROUND, CUBELEN, CUBEROUND);
+ glVertex3f(CUBEROUND, CUBELEN, -CUBEROUND);
+ (*polysP)++;
+
+ /* Edges of cubit */
+ glNormal3f(-1.00, -1.00, 0.00);
+ glVertex3f(-CUBEROUND, -CUBELEN, -CUBEROUND);
+ glVertex3f(-CUBEROUND, -CUBELEN, CUBEROUND);
+ glVertex3f(-CUBELEN, -CUBEROUND, CUBEROUND);
+ glVertex3f(-CUBELEN, -CUBEROUND, -CUBEROUND);
+ (*polysP)++;
+ glNormal3f(1.00, 1.00, 0.00);
+ glVertex3f(CUBEROUND, CUBELEN, -CUBEROUND);
+ glVertex3f(CUBEROUND, CUBELEN, CUBEROUND);
+ glVertex3f(CUBELEN, CUBEROUND, CUBEROUND);
+ glVertex3f(CUBELEN, CUBEROUND, -CUBEROUND);
+ (*polysP)++;
+ glNormal3f(-1.00, 1.00, 0.00);
+ glVertex3f(-CUBELEN, CUBEROUND, -CUBEROUND);
+ glVertex3f(-CUBELEN, CUBEROUND, CUBEROUND);
+ glVertex3f(-CUBEROUND, CUBELEN, CUBEROUND);
+ glVertex3f(-CUBEROUND, CUBELEN, -CUBEROUND);
+ (*polysP)++;
+ glNormal3f(1.00, -1.00, 0.00);
+ glVertex3f(CUBELEN, -CUBEROUND, -CUBEROUND);
+ glVertex3f(CUBELEN, -CUBEROUND, CUBEROUND);
+ glVertex3f(CUBEROUND, -CUBELEN, CUBEROUND);
+ glVertex3f(CUBEROUND, -CUBELEN, -CUBEROUND);
+ (*polysP)++;
+ glNormal3f(0.00, -1.00, -1.00);
+ glVertex3f(-CUBEROUND, -CUBEROUND, -CUBELEN);
+ glVertex3f(CUBEROUND, -CUBEROUND, -CUBELEN);
+ glVertex3f(CUBEROUND, -CUBELEN, -CUBEROUND);
+ glVertex3f(-CUBEROUND, -CUBELEN, -CUBEROUND);
+ (*polysP)++;
+ glNormal3f(0.00, 1.00, 1.00);
+ glVertex3f(-CUBEROUND, CUBEROUND, CUBELEN);
+ glVertex3f(CUBEROUND, CUBEROUND, CUBELEN);
+ glVertex3f(CUBEROUND, CUBELEN, CUBEROUND);
+ glVertex3f(-CUBEROUND, CUBELEN, CUBEROUND);
+ (*polysP)++;
+ glNormal3f(0.00, -1.00, 1.00);
+ glVertex3f(-CUBEROUND, -CUBELEN, CUBEROUND);
+ glVertex3f(CUBEROUND, -CUBELEN, CUBEROUND);
+ glVertex3f(CUBEROUND, -CUBEROUND, CUBELEN);
+ glVertex3f(-CUBEROUND, -CUBEROUND, CUBELEN);
+ (*polysP)++;
+ glNormal3f(0.00, 1.00, -1.00);
+ glVertex3f(-CUBEROUND, CUBELEN, -CUBEROUND);
+ glVertex3f(CUBEROUND, CUBELEN, -CUBEROUND);
+ glVertex3f(CUBEROUND, CUBEROUND, -CUBELEN);
+ glVertex3f(-CUBEROUND, CUBEROUND, -CUBELEN);
+ (*polysP)++;
+ glNormal3f(-1.00, 0.00, -1.00);
+ glVertex3f(-CUBELEN, -CUBEROUND, -CUBEROUND);
+ glVertex3f(-CUBELEN, CUBEROUND, -CUBEROUND);
+ glVertex3f(-CUBEROUND, CUBEROUND, -CUBELEN);
+ glVertex3f(-CUBEROUND, -CUBEROUND, -CUBELEN);
+ (*polysP)++;
+ glNormal3f(1.00, 0.00, 1.00);
+ glVertex3f(CUBELEN, -CUBEROUND, CUBEROUND);
+ glVertex3f(CUBELEN, CUBEROUND, CUBEROUND);
+ glVertex3f(CUBEROUND, CUBEROUND, CUBELEN);
+ glVertex3f(CUBEROUND, -CUBEROUND, CUBELEN);
+ (*polysP)++;
+ glNormal3f(1.00, 0.00, -1.00);
+ glVertex3f(CUBEROUND, -CUBEROUND, -CUBELEN);
+ glVertex3f(CUBEROUND, CUBEROUND, -CUBELEN);
+ glVertex3f(CUBELEN, CUBEROUND, -CUBEROUND);
+ glVertex3f(CUBELEN, -CUBEROUND, -CUBEROUND);
+ (*polysP)++;
+ glNormal3f(-1.00, 0.00, 1.00);
+ glVertex3f(-CUBEROUND, -CUBEROUND, CUBELEN);
+ glVertex3f(-CUBEROUND, CUBEROUND, CUBELEN);
+ glVertex3f(-CUBELEN, CUBEROUND, CUBEROUND);
+ glVertex3f(-CUBELEN, -CUBEROUND, CUBEROUND);
+ (*polysP)++;
+ glEnd();
+ glBegin(GL_TRIANGLES);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray);
+ /* Corners of cubit */
+ glNormal3f(1.00, 1.00, 1.00);
+ glVertex3f(CUBEROUND, CUBEROUND, CUBELEN);
+ glVertex3f(CUBELEN, CUBEROUND, CUBEROUND);
+ glVertex3f(CUBEROUND, CUBELEN, CUBEROUND);
+ (*polysP)++;
+ glNormal3f(-1.00, -1.00, -1.00);
+ glVertex3f(-CUBEROUND, -CUBELEN, -CUBEROUND);
+ glVertex3f(-CUBELEN, -CUBEROUND, -CUBEROUND);
+ glVertex3f(-CUBEROUND, -CUBEROUND, -CUBELEN);
+ (*polysP)++;
+ glNormal3f(-1.00, 1.00, 1.00);
+ glVertex3f(-CUBEROUND, CUBEROUND, CUBELEN);
+ glVertex3f(-CUBEROUND, CUBELEN, CUBEROUND);
+ (*polysP)++;
+ glVertex3f(-CUBELEN, CUBEROUND, CUBEROUND);
+ glNormal3f(1.00, -1.00, -1.00);
+ glVertex3f(CUBELEN, -CUBEROUND, -CUBEROUND);
+ glVertex3f(CUBEROUND, -CUBELEN, -CUBEROUND);
+ glVertex3f(CUBEROUND, -CUBEROUND, -CUBELEN);
+ (*polysP)++;
+ glNormal3f(1.00, -1.00, 1.00);
+ glVertex3f(CUBEROUND, -CUBEROUND, CUBELEN);
+ glVertex3f(CUBEROUND, -CUBELEN, CUBEROUND);
+ glVertex3f(CUBELEN, -CUBEROUND, CUBEROUND);
+ (*polysP)++;
+ glNormal3f(-1.00, 1.00, -1.00);
+ glVertex3f(-CUBELEN, CUBEROUND, -CUBEROUND);
+ glVertex3f(-CUBEROUND, CUBELEN, -CUBEROUND);
+ glVertex3f(-CUBEROUND, CUBEROUND, -CUBELEN);
+ (*polysP)++;
+ glNormal3f(-1.00, -1.00, 1.00);
+ glVertex3f(-CUBEROUND, -CUBEROUND, CUBELEN);
+ glVertex3f(-CUBELEN, -CUBEROUND, CUBEROUND);
+ glVertex3f(-CUBEROUND, -CUBELEN, CUBEROUND);
+ (*polysP)++;
+ glNormal3f(1.00, 1.00, -1.00);
+ glVertex3f(CUBELEN, CUBEROUND, -CUBEROUND);
+ glVertex3f(CUBEROUND, CUBEROUND, -CUBELEN);
+ glVertex3f(CUBEROUND, CUBELEN, -CUBEROUND);
+ (*polysP)++;
+ glEnd();
+ return True;
+}
+
+static Bool