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_bomb.c,v 1.2 2003/11/30 17:43:55 nsubtil Exp $";
37 #include "render_particle.h"
41 void bomb_render_opaque(struct game
*game
, int bomb_no
)
45 bomb
= &game
->bombs
[bomb_no
];
46 if(bomb
->state
== BOMB_STATE_EXPLOSION
)
49 glMatrixMode(GL_MODELVIEW
);
52 glEnable(GL_LIGHTING
);
53 glShadeModel(GL_SMOOTH
);
55 glTranslatef(bomb
->position
[X
], bomb
->position
[Y
], bomb
->position
[Z
]);
56 render_setup_model_direction(DIRECTION_UP
);
58 glEnable(GL_COLOR_MATERIAL
);
60 glDisable(GL_TEXTURE_2D
);
61 glEnable(GL_DEPTH_TEST
);
64 render_dlist(&bomb
->model
[(int)bomb
->time
% bomb
->n_frames
],
65 game
->players
[bomb
->owner
].color
);
68 void bomb_render_translucent(struct game
*game
, int player_no
, int bomb_no
)
72 bomb
= &game
->bombs
[bomb_no
];
74 if(bomb
->state
== BOMB_STATE_EXPLOSION
)
76 particle_render_src(game
, player_no
, bomb
->trail_left
);
77 particle_render_src(game
, player_no
, bomb
->trail_right
);
78 particle_render_src(game
, player_no
, bomb
->trail_up
);
79 particle_render_src(game
, player_no
, bomb
->trail_down
);
80 particle_render_src(game
, player_no
, bomb
->explosion
);