glEnd();
}
-static void game_draw_vect(const struct s_vary *fp)
+static const struct d_mtrl *game_draw_vect(const struct d_mtrl *mq,
+ const struct s_vary *fp)
{
if (view_m > 0.f)
{
glPopAttrib();
glPopAttrib();
}
+ return mq;
}
-static void game_draw_balls(const struct s_vary *fp,
- const float *bill_M, float t)
+static const struct d_mtrl *game_draw_balls(const struct d_mtrl *mq,
+ const struct s_vary *fp,
+ const float *bill_M, float t)
{
static const GLfloat color[5][4] = {
{ 1.0f, 1.0f, 1.0f, 0.7f },
fp->uv[ui].r);
glColor4fv(color[ui]);
- ball_draw(ball_M, pend_M, bill_M, t);
+ mq = ball_draw(mq, ball_M, pend_M, bill_M, t);
}
glPopMatrix();
}
color[ui][1],
color[ui][2], 0.5f);
- mark_draw();
+ mq = mark_draw(mq);
}
glPopMatrix();
}
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
glDisable(GL_COLOR_MATERIAL);
+
+ return mq;
}
-static void game_draw_goals(const struct s_base *fp)
+static const struct d_mtrl *game_draw_goals(const struct d_mtrl *mq,
+ const struct s_base *fp)
{
int zi;
glTranslatef(fp->zv[zi].p[0],
fp->zv[zi].p[1],
fp->zv[zi].p[2]);
- flag_draw();
+ mq = flag_draw(mq);
}
glPopMatrix();
}
+ return mq;
}
-static void game_draw_jumps(const struct s_base *fp)
+static const struct d_mtrl *game_draw_jumps(const struct d_mtrl *mq,
+ const struct s_base *fp)
{
float t = 0.001f * SDL_GetTicks();
int ji;
fp->jv[ji].p[2]);
glScalef(fp->jv[ji].r, 1.f, fp->jv[ji].r);
- jump_draw(t, !jump_e);
+ mq = jump_draw(mq, t, !jump_e);
}
glPopMatrix();
}
+ return mq;
}
-static void game_draw_swchs(const struct s_vary *fp)
+static const struct d_mtrl *game_draw_swchs(const struct d_mtrl *mq,
+ const struct s_vary *fp)
{
int xi;
xp->base->p[2]);
glScalef(xp->base->r, 1.f, xp->base->r);
- swch_draw(xp->f, xp->e);
+ mq = swch_draw(mq, xp->f, xp->e);
}
glPopMatrix();
}
+ return mq;
}
/*---------------------------------------------------------------------------*/
const float light_p[4] = { 8.f, 32.f, 8.f, 0.f };
const struct s_draw *fp = &file.draw;
+ const struct d_mtrl *mq = sol_draw_enable();
float fov = FOV;
glPushMatrix();
{
glTranslatef(view_p[0], view_p[1], view_p[2]);
- back_draw(0);
+ mq = back_draw(mq, 0);
}
glPopMatrix();
/* Draw the floor. */
- sol_draw(fp, 0, 1);
-
- if (config_get_d(CONFIG_SHADOW) && !pose)
- {
- shad_draw_set();
- sol_shad(fp, ball);
- shad_draw_clr();
- }
+ mq = sol_draw(fp, mq, 0, 1);
/* Draw the game elements. */
if (pose == 0)
{
- game_draw_balls(fp->vary, T, t);
- game_draw_vect(fp->vary);
+ mq = game_draw_balls(mq, fp->vary, T, t);
+ mq = game_draw_vect(mq, fp->vary);
}
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, a);
glDisable(GL_LIGHTING);
glDepthMask(GL_FALSE);
{
- game_draw_goals(fp->base);
- game_draw_jumps(fp->base);
- game_draw_swchs(fp->vary);
+ mq = game_draw_goals(mq, fp->base);
+ mq = game_draw_jumps(mq, fp->base);
+ mq = game_draw_swchs(mq, fp->vary);
}
glDepthMask(GL_TRUE);
glEnable(GL_LIGHTING);
glPopMatrix();
glPopAttrib();
video_pop_matrix();
+
+ sol_draw_disable(mq);
}
/*---------------------------------------------------------------------------*/