- if (!cp->AreObjectsDefined[ObjWoodPlank]) {
- glNewList(objects + ObjWoodPlank, GL_COMPILE_AND_EXECUTE);
- glBegin(GL_QUADS);
- glNormal3f(0, 0, 1);
- glTexCoord2f(0, 0);
- glVertex3f(-PlankWidth, -PlankHeight, PlankThickness);
- glTexCoord2f(1, 0);
- glVertex3f(PlankWidth, -PlankHeight, PlankThickness);
- glTexCoord2f(1, 1);
- glVertex3f(PlankWidth, PlankHeight, PlankThickness);
- glTexCoord2f(0, 1);
- glVertex3f(-PlankWidth, PlankHeight, PlankThickness);
- glNormal3f(0, 0, -1);
- glTexCoord2f(0, 0);
- glVertex3f(-PlankWidth, PlankHeight, -PlankThickness);
- glTexCoord2f(1, 0);
- glVertex3f(PlankWidth, PlankHeight, -PlankThickness);
- glTexCoord2f(1, 1);
- glVertex3f(PlankWidth, -PlankHeight, -PlankThickness);
- glTexCoord2f(0, 1);
- glVertex3f(-PlankWidth, -PlankHeight, -PlankThickness);
- glNormal3f(0, 1, 0);
- glTexCoord2f(0, 0);
- glVertex3f(-PlankWidth, PlankHeight, PlankThickness);
- glTexCoord2f(1, 0);
- glVertex3f(PlankWidth, PlankHeight, PlankThickness);
- glTexCoord2f(1, 1);
- glVertex3f(PlankWidth, PlankHeight, -PlankThickness);
- glTexCoord2f(0, 1);
- glVertex3f(-PlankWidth, PlankHeight, -PlankThickness);
- glNormal3f(0, -1, 0);
- glTexCoord2f(0, 0);
- glVertex3f(-PlankWidth, -PlankHeight, -PlankThickness);
- glTexCoord2f(1, 0);
- glVertex3f(PlankWidth, -PlankHeight, -PlankThickness);
- glTexCoord2f(1, 1);
- glVertex3f(PlankWidth, -PlankHeight, PlankThickness);
- glTexCoord2f(0, 1);
- glVertex3f(-PlankWidth, -PlankHeight, PlankThickness);
- glNormal3f(1, 0, 0);
- glTexCoord2f(0, 0);
- glVertex3f(PlankWidth, -PlankHeight, PlankThickness);
- glTexCoord2f(1, 0);
- glVertex3f(PlankWidth, -PlankHeight, -PlankThickness);
- glTexCoord2f(1, 1);
- glVertex3f(PlankWidth, PlankHeight, -PlankThickness);
- glTexCoord2f(0, 1);
- glVertex3f(PlankWidth, PlankHeight, PlankThickness);
- glNormal3f(-1, 0, 0);
- glTexCoord2f(0, 0);
- glVertex3f(-PlankWidth, PlankHeight, PlankThickness);
- glTexCoord2f(1, 0);
- glVertex3f(-PlankWidth, PlankHeight, -PlankThickness);
- glTexCoord2f(1, 1);
- glVertex3f(-PlankWidth, -PlankHeight, -PlankThickness);
- glTexCoord2f(0, 1);
- glVertex3f(-PlankWidth, -PlankHeight, PlankThickness);
- glEnd();
- glEndList();
- cp->AreObjectsDefined[ObjWoodPlank] = 1;
-#ifdef DEBUG_LISTS
- (void) printf("WoodPlank drawn SLOWLY\n");
-#endif
- } else {
- glCallList(objects + ObjWoodPlank);
-#ifdef DEBUG_LISTS
- (void) printf("WoodPlank drawn quickly\n");
-#endif
- }
+ glBegin(wire ? GL_LINES : GL_QUADS);
+ glNormal3f(0, 0, 1);
+ glTexCoord2f(0, 0);
+ glVertex3f(-PlankWidth, -PlankHeight, PlankThickness);
+ glTexCoord2f(1, 0);
+ glVertex3f(PlankWidth, -PlankHeight, PlankThickness);
+ glTexCoord2f(1, 1);
+ glVertex3f(PlankWidth, PlankHeight, PlankThickness);
+ glTexCoord2f(0, 1);
+ glVertex3f(-PlankWidth, PlankHeight, PlankThickness);
+ mi->polygon_count++;
+ glNormal3f(0, 0, -1);
+ glTexCoord2f(0, 0);
+ glVertex3f(-PlankWidth, PlankHeight, -PlankThickness);
+ glTexCoord2f(1, 0);
+ glVertex3f(PlankWidth, PlankHeight, -PlankThickness);
+ glTexCoord2f(1, 1);
+ glVertex3f(PlankWidth, -PlankHeight, -PlankThickness);
+ glTexCoord2f(0, 1);
+ glVertex3f(-PlankWidth, -PlankHeight, -PlankThickness);
+ mi->polygon_count++;
+ glNormal3f(0, 1, 0);
+ glTexCoord2f(0, 0);
+ glVertex3f(-PlankWidth, PlankHeight, PlankThickness);
+ glTexCoord2f(1, 0);
+ glVertex3f(PlankWidth, PlankHeight, PlankThickness);
+ glTexCoord2f(1, 1);
+ glVertex3f(PlankWidth, PlankHeight, -PlankThickness);
+ glTexCoord2f(0, 1);
+ glVertex3f(-PlankWidth, PlankHeight, -PlankThickness);
+ mi->polygon_count++;
+ glNormal3f(0, -1, 0);
+ glTexCoord2f(0, 0);
+ glVertex3f(-PlankWidth, -PlankHeight, -PlankThickness);
+ glTexCoord2f(1, 0);
+ glVertex3f(PlankWidth, -PlankHeight, -PlankThickness);
+ glTexCoord2f(1, 1);
+ glVertex3f(PlankWidth, -PlankHeight, PlankThickness);
+ glTexCoord2f(0, 1);
+ glVertex3f(-PlankWidth, -PlankHeight, PlankThickness);
+ mi->polygon_count++;
+ glNormal3f(1, 0, 0);
+ glTexCoord2f(0, 0);
+ glVertex3f(PlankWidth, -PlankHeight, PlankThickness);
+ glTexCoord2f(1, 0);
+ glVertex3f(PlankWidth, -PlankHeight, -PlankThickness);
+ glTexCoord2f(1, 1);
+ glVertex3f(PlankWidth, PlankHeight, -PlankThickness);
+ glTexCoord2f(0, 1);
+ glVertex3f(PlankWidth, PlankHeight, PlankThickness);
+ mi->polygon_count++;
+ glNormal3f(-1, 0, 0);
+ glTexCoord2f(0, 0);
+ glVertex3f(-PlankWidth, PlankHeight, PlankThickness);
+ glTexCoord2f(1, 0);
+ glVertex3f(-PlankWidth, PlankHeight, -PlankThickness);
+ glTexCoord2f(1, 1);
+ glVertex3f(-PlankWidth, -PlankHeight, -PlankThickness);
+ glTexCoord2f(0, 1);
+ glVertex3f(-PlankWidth, -PlankHeight, PlankThickness);
+ mi->polygon_count++;
+ glEnd();
+
+ return True;