3 Copyright (C) 2003 Nuno Subtil
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 static const char cvsid
[] =
21 "$Id: render_player.c,v 1.2 2003/11/30 17:43:55 nsubtil Exp $";
39 void player_render(struct player
*p
)
41 glMatrixMode(GL_MODELVIEW
);
44 glEnable(GL_LIGHTING
);
45 glShadeModel(GL_SMOOTH
);
47 glTranslatef(p
->position
[X
], p
->position
[Y
], p
->position
[Z
]);
53 glRotatef(90.0, 0.0, 1.0, 0.0);
58 glRotatef(-90.0, 0.0, 1.0, 0.0);
63 glRotatef(180.0, 0.0, 1.0, 0.0);
67 glEnable(GL_COLOR_MATERIAL
);
69 glDisable(GL_TEXTURE_2D
);
70 glEnable(GL_DEPTH_TEST
);
73 if(p
->pill_time
> 0.0)
78 case PLAYER_STATE_STOPPED
:
79 render_dlist(&p
->model_stopped
[(int)p
->current_frame
% p
->frames_stopped
], p
->color
);
82 case PLAYER_STATE_MOVING
:
83 render_dlist(&p
->model_moving
[(int)p
->current_frame
% p
->frames_moving
], p
->color
);
86 case PLAYER_STATE_DEAD
:
87 render_dlist(&p
->model_dying
[(int)p
->current_frame
% p
->frames_dying
], p
->color
);
90 case PLAYER_STATE_WON
:
91 render_dlist(&p
->model_won
[(int)p
->current_frame
% p
->frames_won
], p
->color
);