+ int i, j;
+ float x, y;
+ struct level_cell *cell;
+
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ cgm_mtranslation(view_mat, 0, 0, -cam_dist);
+ cgm_mprerotate_x(view_mat, cam_phi);
+ cgm_mprerotate_y(view_mat, cam_theta);
+ cgm_mpretranslate(view_mat, cam_pan.x, cam_pan.y, cam_pan.z);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadMatrixf(view_mat);
+
+ cell = lvl->cells;
+ glBegin(GL_QUADS);
+ glColor3f(1, 1, 1);
+ glNormal3f(0, 1, 0);
+ for(i=0; i<lvl->ysz; i++) {
+ y = (float)i * lvl->scale;
+ for(j=0; j<lvl->xsz; j++) {
+ x = (float)j * lvl->scale;
+ if(cell->type) {
+ glVertex3f(x - 0.48, -1, y - 0.48);
+ glVertex3f(x + 0.48, -1, y - 0.48);
+ glVertex3f(x + 0.48, -1, y + 0.48);
+ glVertex3f(x - 0.48, -1, y + 0.48);
+ }
+ cell++;
+ }
+ }
+ glEnd();