- glShadeModel(GL_SMOOTH);
- glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, front_shininess);
- glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, front_specular);
-
- if (zera) {
- pp->system_number = 1;
- glDrawBuffer(GL_FRONT_AND_BACK);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- (void) memset(pp->Cells, 0, sizeof (pp->Cells));
- for (X = 0; X < HCELLS; X++) {
- for (Y = 0; Y < VCELLS; Y++) {
- pp->Cells[X][Y][0] = 1;
- pp->Cells[X][Y][HCELLS - 1] = 1;
- pp->Cells[0][Y][X] = 1;
- pp->Cells[HCELLS - 1][Y][X] = 1;
- }
- }
- for (X = 0; X < HCELLS; X++) {
- for (Z = 0; Z < HCELLS; Z++) {
- pp->Cells[X][0][Z] = 1;
- pp->Cells[X][VCELLS - 1][Z] = 1;
- }
- }
- (void) memset(pp->usedcolors, 0, sizeof (pp->usedcolors));
- if ((pp->initial_rotation += 10.0) > 45.0) {
- pp->initial_rotation -= 90.0;
- }
- }
- pp->counter = 0;
- pp->turncounter = 0;
-
- if (!MI_WIN_IS_MONO(mi)) {
- int collist[DEFINEDCOLORS];
- int i, j, lower = 1000;
-
- /* Avoid repeating colors on the same screen unless necessary */
- for (i = 0; i < DEFINEDCOLORS; i++) {
- if (lower > pp->usedcolors[i])
- lower = pp->usedcolors[i];
- }
- for (i = 0, j = 0; i < DEFINEDCOLORS; i++) {
- if (pp->usedcolors[i] == lower) {
- collist[j] = i;
- j++;
- }
- }
- i = collist[NRAND(j)];
- pp->usedcolors[i]++;
- switch (i) {
- case 0:
- pp->system_color = MaterialRed;
- break;
- case 1:
- pp->system_color = MaterialGreen;
- break;
- case 2:
- pp->system_color = MaterialBlue;
- break;
- case 3:
- pp->system_color = MaterialCyan;
- break;
- case 4:
- pp->system_color = MaterialYellow;
- break;
- case 5:
- pp->system_color = MaterialMagenta;
- break;
- case 6:
- pp->system_color = MaterialWhite;
- break;
- }
- } else {
- pp->system_color = MaterialGray;
- }
-
- do {
- pp->PX = NRAND((HCELLS - 1)) + 1;
- pp->PY = NRAND((VCELLS - 1)) + 1;
- pp->PZ = NRAND((HCELLS - 1)) + 1;
- } while (pp->Cells[pp->PX][pp->PY][pp->PZ] ||
- (pp->Cells[pp->PX + 1][pp->PY][pp->PZ] && pp->Cells[pp->PX - 1][pp->PY][pp->PZ] &&
- pp->Cells[pp->PX][pp->PY + 1][pp->PZ] && pp->Cells[pp->PX][pp->PY - 1][pp->PZ] &&
- pp->Cells[pp->PX][pp->PY][pp->PZ + 1] && pp->Cells[pp->PX][pp->PY][pp->PZ - 1]));
- pp->Cells[pp->PX][pp->PY][pp->PZ] = 1;
- pp->olddir = dirNone;
-
- FindNeighbors(mi);
-
- pp->nowdir = SelectNeighbor(mi);
-}
-
-void
-init_pipes(ModeInfo * mi)
-{
- int screen = MI_SCREEN(mi);
- pipesstruct *pp;
-
- if (pipes == NULL) {
- if ((pipes = (pipesstruct *) calloc(MI_NUM_SCREENS(mi),
- sizeof (pipesstruct))) == NULL)
- return;
- }
- pp = &pipes[screen];
-
- pp->glx_context = init_GL(mi);