}
static void game_draw_fore(struct s_rend *rend,
- const struct game_draw *gd,
+ struct game_draw *gd,
int pose, const float *M,
int d, float t)
{
const float *ball_p = gd->vary.uv[0].p;
- const struct s_draw *draw = &gd->draw;
+ struct s_draw *draw = &gd->draw;
glPushMatrix();
{
/*---------------------------------------------------------------------------*/
-void game_draw(const struct game_draw *gd, int pose, float t)
+void game_draw(struct game_draw *gd, int pose, float t)
{
float fov = (float) config_get_d(CONFIG_VIEW_FOV);
const struct game_view *view = &gd->view;
struct s_rend rend;
+ gd->draw.shadow = 0;
+
sol_draw_enable(&rend);
video_push_persp(fov, 0.1f, FAR_DIST);
/* FIXME: this is just for POSE_* constants. */
#include "game_client.h"
-void game_draw(const struct game_draw *, int, float);
+void game_draw(struct game_draw *, int, float);
/*---------------------------------------------------------------------------*/
{
const float light_p[4] = { 8.f, 32.f, 8.f, 0.f };
- const struct s_draw *fp = &file.draw;
+ struct s_draw *fp = &file.draw;
struct s_rend rend = { NULL };
float fov = FOV;
+ fp->shadow = ball;
+
sol_draw_enable(&rend);
if (jump_b) fov *= 2.0f * fabsf(jump_dt - 0.5f);
/*---------------------------------------------------------------------------*/
static void sol_transform(const struct s_vary *vary,
- const struct v_body *bp)
+ const struct v_body *bp, int ui)
{
float a;
float e[4];
/* Apply the shadow transform to the texture matrix. */
- if (vary->uc && vary->uv->r > 0.0)
+ if (ui >= 0 && ui < vary->uc && vary->uv[ui].r > 0.0f)
{
+ struct v_ball *up = vary->uv + ui;
+
glActiveTexture_(GL_TEXTURE1);
glMatrixMode(GL_TEXTURE);
{
- float k = 0.25f / vary->uv->r;
+ float k = 0.25f / up->r;
glLoadIdentity();
/* Move the shadow texture under the ball. */
- glTranslatef(-vary->uv->p[0],
- -vary->uv->p[1],
- -vary->uv->p[2]);
+ glTranslatef(-up->p[0], -up->p[1], -up->p[2]);
/* Apply the body position and rotation. */
{
glPushMatrix();
{
- sol_transform(draw->vary, draw->vary->bv + bi);
+ sol_transform(draw->vary, draw->vary->bv + bi, draw->shadow);
sol_draw_body(draw->bv + bi, rend, p);
}
glPopMatrix();
GLuint bill;
int reflective;
+ int shadow;
};
/*---------------------------------------------------------------------------*/