+ int num_dirs = 0;
+
+ // count directories ...
+ for(int i=0; i<nchildren; i++) {
+ FSNode *node = cur_node->children[i];
+ if(node->type == FSTYPE_DIR) {
+ ++num_dirs;
+ }
+ }
+
+ // ... and draw them
+ glLineWidth(5.0);
+ for(int i=0; i<nchildren; i++) {
+ FSNode *node = cur_node->children[i];
+
+ if(node->type != FSTYPE_DIR) {
+ continue;
+ }
+
+ float angle = (float)col++ / (float)(num_dirs - 1) * max_icon_angle - max_icon_angle * 0.5;
+
+ Mat4 xform;
+ xform.rotate_y(angle);
+ xform.translate(0, -0.3, 0);
+
+ glUseProgram(0);
+ glPushMatrix();
+ glMultMatrixf(xform[0]);
+
+ glBegin(GL_LINES);
+ glColor3f(0.2, 0.3, 0.8);
+ glVertex3f(0, 0, -0.3);
+ glVertex3f(0, 0, -2);
+ glColor3f(1, 1, 1);
+ glEnd();
+ glPopMatrix();