2 * Copyright (C) 2003 Robert Kooima
4 * NEVERBALL is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published
6 * by the Free Software Foundation; either version 2 of the License,
7 * or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
21 #include "solid_draw.h"
23 /*---------------------------------------------------------------------------*/
25 static struct s_full item_coin_file;
26 static struct s_full item_grow_file;
27 static struct s_full item_shrink_file;
29 void item_color(const struct v_item *hp, float *c)
89 sol_load_full(&item_coin_file, "item/coin/coin.sol", 0);
90 sol_load_full(&item_grow_file, "item/grow/grow.sol", 0);
91 sol_load_full(&item_shrink_file, "item/shrink/shrink.sol", 0);
96 sol_free_full(&item_coin_file);
97 sol_free_full(&item_grow_file);
98 sol_free_full(&item_shrink_file);
101 void item_draw(struct s_rend *rend,
102 const struct v_item *hp,
103 const GLfloat *M, float t)
105 struct s_draw *draw = NULL;
110 case ITEM_COIN: draw = &item_coin_file.draw; break;
111 case ITEM_GROW: draw = &item_grow_file.draw; break;
112 case ITEM_SHRINK: draw = &item_shrink_file.draw; break;
117 glColor4f(c[0], c[1], c[2], c[3]);
119 glDepthMask(GL_FALSE);
121 sol_bill(draw, rend, M, t);
123 glDepthMask(GL_TRUE);
127 glRotatef(360.0f * t, 0.0f, 1.0f, 0.0f);
128 sol_draw(draw, rend, 0, 1);
133 /*---------------------------------------------------------------------------*/