3 * Daniel Nelson - 11/12/0
5 * Copyright (C) 2000 Daniel Nelson
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 * Daniel Nelson - aluminumangel.org
25 * Generates a display list for the cute li'l purple garbage blocks.
33 #include "Displayer.h"
35 GLuint
Displayer::garbage_small_list
;
37 void Displayer::generateGarbageSmallList ( )
39 garbage_small_list
= glGenLists(1);
41 glEnableClientState(GL_VERTEX_ARRAY
);
42 glEnableClientState(GL_NORMAL_ARRAY
);
43 glEnableClientState(GL_TEXTURE_COORD_ARRAY
);
45 glNewList(garbage_small_list
, GL_COMPILE
);
47 GLfloat vertices_0
[3 * 18] = {
68 GLfloat vertices_1
[3 * 8] = {
79 GLfloat vertices_2
[3 * 8] = {
90 GLfloat vertices_3
[3 * 4] = {
97 GLfloat vertices_4
[3 * 4] = {
104 GLfloat vertices_5
[3 * 8] = {
115 GLfloat vertices_6
[3 * 8] = {
126 GLfloat normals_0
[3 * 18] = {
147 GLfloat normals_1
[3 * 8] = {
158 GLfloat normals_2
[3 * 8] = {
169 GLfloat normals_3
[3 * 4] = {
176 GLfloat normals_4
[3 * 4] = {
183 GLfloat normals_5
[3 * 8] = {
194 GLfloat normals_6
[3 * 8] = {
205 GLfloat tex_coords_0
[3 * 18];
206 for (int n
= 3 * 18; n
--; )
207 tex_coords_0
[n
] = vertices_0
[n
] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER
;
209 GLfloat tex_coords_1
[3 * 8];
210 for (int n
= 3 * 8; n
--; )
211 tex_coords_1
[n
] = vertices_1
[n
] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER
;
213 GLfloat tex_coords_2
[3 * 8];
214 for (int n
= 3 * 8; n
--; )
215 tex_coords_2
[n
] = vertices_2
[n
] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER
;
217 GLfloat tex_coords_3
[3 * 4];
218 for (int n
= 3 * 4; n
--; )
219 tex_coords_3
[n
] = vertices_3
[n
] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER
;
221 GLfloat tex_coords_4
[3 * 4];
222 for (int n
= 3 * 4; n
--; )
223 tex_coords_4
[n
] = vertices_4
[n
] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER
;
225 GLfloat tex_coords_5
[3 * 8];
226 for (int n
= 3 * 8; n
--; )
227 tex_coords_5
[n
] = vertices_5
[n
] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER
;
229 GLfloat tex_coords_6
[3 * 8];
230 for (int n
= 3 * 8; n
--; )
231 tex_coords_6
[n
] = vertices_6
[n
] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER
;
233 glVertexPointer(3, GL_FLOAT
, 0, vertices_0
);
234 glNormalPointer(GL_FLOAT
, 0, normals_0
);
235 glTexCoordPointer(3, GL_FLOAT
, 0, tex_coords_0
);
236 glDrawArrays(GL_TRIANGLE_STRIP
, 0, 18);
238 glVertexPointer(3, GL_FLOAT
, 0, vertices_1
);
239 glNormalPointer(GL_FLOAT
, 0, normals_1
);
240 glTexCoordPointer(3, GL_FLOAT
, 0, tex_coords_1
);
241 glDrawArrays(GL_TRIANGLE_STRIP
, 0, 8);
243 glVertexPointer(3, GL_FLOAT
, 0, vertices_2
);
244 glNormalPointer(GL_FLOAT
, 0, normals_2
);
245 glTexCoordPointer(3, GL_FLOAT
, 0, tex_coords_2
);
246 glDrawArrays(GL_TRIANGLE_STRIP
, 0, 8);
248 glVertexPointer(3, GL_FLOAT
, 0, vertices_3
);
249 glNormalPointer(GL_FLOAT
, 0, normals_3
);
250 glTexCoordPointer(3, GL_FLOAT
, 0, tex_coords_3
);
251 glDrawArrays(GL_TRIANGLE_STRIP
, 0, 4);
253 glVertexPointer(3, GL_FLOAT
, 0, vertices_4
);
254 glNormalPointer(GL_FLOAT
, 0, normals_4
);
255 glTexCoordPointer(3, GL_FLOAT
, 0, tex_coords_4
);
256 glDrawArrays(GL_TRIANGLE_STRIP
, 0, 4);
258 glVertexPointer(3, GL_FLOAT
, 0, vertices_5
);
259 glNormalPointer(GL_FLOAT
, 0, normals_5
);
260 glTexCoordPointer(3, GL_FLOAT
, 0, tex_coords_5
);
261 glDrawArrays(GL_TRIANGLE_STRIP
, 0, 8);
263 glVertexPointer(3, GL_FLOAT
, 0, vertices_6
);
264 glNormalPointer(GL_FLOAT
, 0, normals_6
);
265 glTexCoordPointer(3, GL_FLOAT
, 0, tex_coords_6
);
266 glDrawArrays(GL_TRIANGLE_STRIP
, 0, 8);
270 glDisableClientState(GL_VERTEX_ARRAY
);
271 glDisableClientState(GL_NORMAL_ARRAY
);
272 glDisableClientState(GL_TEXTURE_COORD_ARRAY
);