Clean up the array copying for the new high scores list. It was way
[attac-man.git] / render_bomb.c
blobea96b5b92fbb8382a6839123543b7d8a48e09ecd
1 /*
2 Pacman Arena
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 $";
23 #ifdef _WIN32
24 #include <windows.h>
25 #endif
27 #include <SDL.h>
28 #include <GL/gl.h>
29 #include <stdio.h>
31 #include "object.h"
32 #include "game.h"
33 #include "screen.h"
34 #include "render.h"
35 #include "player.h"
36 #include "particle.h"
37 #include "render_particle.h"
39 #include "bomb.h"
41 void bomb_render_opaque(struct game *game, int bomb_no)
43 struct bomb *bomb;
45 bomb = &game->bombs[bomb_no];
46 if(bomb->state == BOMB_STATE_EXPLOSION)
47 return;
49 glMatrixMode(GL_MODELVIEW);
50 glLoadIdentity();
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);
59 glDisable(GL_BLEND);
60 glDisable(GL_TEXTURE_2D);
61 glEnable(GL_DEPTH_TEST);
62 glDepthMask(GL_TRUE);
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)
70 struct bomb *bomb;
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);