-static void cube_vertices(float x, float y, float z, int wire);
+static int cube_vertices(float x, float y, float z, int wire);
lp->block_dlist = glGenLists (1);
glNewList (lp->block_dlist, GL_COMPILE);
lp->block_dlist = glGenLists (1);
glNewList (lp->block_dlist, GL_COMPILE);
- cube_vertices(0.15, 1.2, 5.25, wire);
+ lp->polys = cube_vertices(0.15, 1.2, 5.25, wire);
-static void cube_vertices(float x, float y, float z, int wire)
+static int cube_vertices(float x, float y, float z, int wire)
float x2, y2, z2, nv = 0.7;
x2 = x/2;
y2 = y/2;
float x2, y2, z2, nv = 0.7;
x2 = x/2;
y2 = y/2;
glTexCoord2f(1.0, 0.0); glVertex3f( x2, y2, z2);
glTexCoord2f(1.0, 1.0); glVertex3f( x2, -y2, z2);
glTexCoord2f(0.0, 1.0); glVertex3f(-x2, -y2, z2);
glTexCoord2f(1.0, 0.0); glVertex3f( x2, y2, z2);
glTexCoord2f(1.0, 1.0); glVertex3f( x2, -y2, z2);
glTexCoord2f(0.0, 1.0); glVertex3f(-x2, -y2, z2);
glTexCoord2f(1.0, 1.0); glVertex3f( x2, -y2, -z2);
glTexCoord2f(0.0, 1.0); glVertex3f( x2, y2, -z2);
glTexCoord2f(0.0, 0.0); glVertex3f(-x2, y2, -z2);
glTexCoord2f(1.0, 1.0); glVertex3f( x2, -y2, -z2);
glTexCoord2f(0.0, 1.0); glVertex3f( x2, y2, -z2);
glTexCoord2f(0.0, 0.0); glVertex3f(-x2, y2, -z2);
glTexCoord2f(0.0, 0.0); glVertex3f( x2, y2, -z2);
glTexCoord2f(1.0, 0.0); glVertex3f( x2, y2, z2);
glTexCoord2f(1.0, 1.0); glVertex3f(-x2, y2, z2);
glTexCoord2f(0.0, 0.0); glVertex3f( x2, y2, -z2);
glTexCoord2f(1.0, 0.0); glVertex3f( x2, y2, z2);
glTexCoord2f(1.0, 1.0); glVertex3f(-x2, y2, z2);
glTexCoord2f(0.0, 1.0); glVertex3f(-x2, -y2, z2);
glTexCoord2f(0.0, 0.0); glVertex3f( x2, -y2, z2);
glTexCoord2f(1.0, 0.0); glVertex3f( x2, -y2, -z2);
glTexCoord2f(0.0, 1.0); glVertex3f(-x2, -y2, z2);
glTexCoord2f(0.0, 0.0); glVertex3f( x2, -y2, z2);
glTexCoord2f(1.0, 0.0); glVertex3f( x2, -y2, -z2);
glTexCoord2f(1.0, 1.0); glVertex3f( x2, -y2, z2);
glTexCoord2f(0.0, 1.0); glVertex3f( x2, y2, z2);
glTexCoord2f(0.0, 0.0); glVertex3f( x2, y2, -z2);
glTexCoord2f(1.0, 1.0); glVertex3f( x2, -y2, z2);
glTexCoord2f(0.0, 1.0); glVertex3f( x2, y2, z2);
glTexCoord2f(0.0, 0.0); glVertex3f( x2, y2, -z2);
glTexCoord2f(1.0, 0.0); glVertex3f(-x2, y2, -z2);
glTexCoord2f(1.0, 1.0); glVertex3f(-x2, y2, z2);
glTexCoord2f(0.0, 1.0); glVertex3f(-x2, -y2, z2);
glTexCoord2f(1.0, 0.0); glVertex3f(-x2, y2, -z2);
glTexCoord2f(1.0, 1.0); glVertex3f(-x2, y2, z2);
glTexCoord2f(0.0, 1.0); glVertex3f(-x2, -y2, z2);
}
static void draw_block(ModeInfo *mi, entity *ent)
{
blocktube_configuration *lp = &lps[MI_SCREEN(mi)];
glCallList (lp->block_dlist);
}
static void draw_block(ModeInfo *mi, entity *ent)
{
blocktube_configuration *lp = &lps[MI_SCREEN(mi)];
glCallList (lp->block_dlist);
glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(lp->glx_context));
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(lp->glx_context));
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);