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_shot.c,v 1.3 2003/11/30 17:43:55 nsubtil Exp $";
43 #include "render_shot.h"
44 #include "render_particle.h"
46 void shot_render_opaque(struct game
*game
, int shot_no
)
50 shot
= &game
->shots
[shot_no
];
51 if(shot
->state
== SHOT_STATE_DEAD
)
54 glMatrixMode(GL_MODELVIEW
);
57 glEnable(GL_LIGHTING
);
58 glShadeModel(GL_SMOOTH
);
60 glTranslatef(shot
->position
[X
], shot
->position
[Y
], shot
->position
[Z
]);
61 render_setup_model_direction(shot
->direction
);
63 glEnable(GL_COLOR_MATERIAL
);
65 glDisable(GL_TEXTURE_2D
);
66 glEnable(GL_DEPTH_TEST
);
69 render_dlist(&shot
->model
[(int)shot
->time
% shot
->frames
],
70 game
->players
[shot
->owner
].color
);
73 void shot_render_translucent(struct game
*game
, int player_no
, int shot_no
)
77 shot
= &game
->shots
[shot_no
];
79 if(shot
->type
== SHOT_TYPE_ROCKET
)
80 particle_render_src(game
, player_no
, shot
->particle_trail
);