Updates for a new interface to the networking
[crack-attack.git] / src / obj_garbage_small.cxx
blob07e720d9376c9962b94e9c1a20b1eb967298c7fc
1 /*
2 * garbage_small.cxx
3 * Daniel Nelson - 11/12/0
5 * Copyright (C) 2000 Daniel Nelson
6 *
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
22 * 174 W. 18th Ave.
23 * Columbus, OH 43210
25 * Generates a display list for the cute li'l purple garbage blocks.
28 #include <GL/glut.h>
30 #include "glext.h"
32 using namespace std;
34 #include "Game.h"
35 #include "Displayer.h"
37 GLuint Displayer::garbage_small_list;
39 void Displayer::generateGarbageSmallList ( )
41 garbage_small_list = glGenLists(1);
43 glEnableClientState(GL_VERTEX_ARRAY);
44 glEnableClientState(GL_NORMAL_ARRAY);
45 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
47 glNewList(garbage_small_list, GL_COMPILE);
49 GLfloat vertices_0[3 * 18] = {
50 -0.8f, -0.8f, -1.0f,
51 0.8f, -0.8f, -1.0f,
52 -0.8f, -1.0f, -0.8f,
53 0.8f, -1.0f, -0.8f,
54 -0.8f, -1.0f, 0.8f,
55 0.8f, -1.0f, 0.8f,
56 -0.8f, -0.8f, 1.0f,
57 0.8f, -0.8f, 1.0f,
58 -0.8f, 0.8f, 1.0f,
59 0.8f, 0.8f, 1.0f,
60 -0.8f, 1.0f, 0.8f,
61 0.8f, 1.0f, 0.8f,
62 -0.8f, 1.0f, -0.8f,
63 0.8f, 1.0f, -0.8f,
64 -0.8f, 0.8f, -1.0f,
65 0.8f, 0.8f, -1.0f,
66 -0.8f, -0.8f, -1.0f,
67 0.8f, -0.8f, -1.0f
70 GLfloat vertices_1[3 * 8] = {
71 -0.8f, -0.8f, -1.0f,
72 -1.0f, -0.8f, -0.8f,
73 -0.8f, 0.8f, -1.0f,
74 -1.0f, 0.8f, -0.8f,
75 -0.8f, 1.0f, -0.8f,
76 -1.0f, 0.8f, 0.8f,
77 -0.8f, 1.0f, 0.8f,
78 -0.8f, 0.8f, 1.0f
81 GLfloat vertices_2[3 * 8] = {
82 -0.8f, 0.8f, 1.0f,
83 -1.0f, 0.8f, 0.8f,
84 -0.8f, -0.8f, 1.0f,
85 -1.0f, -0.8f, 0.8f,
86 -0.8f, -1.0f, 0.8f,
87 -1.0f, -0.8f, -0.8f,
88 -0.8f, -1.0f, -0.8f,
89 -0.8f, -0.8f, -1.0f
92 GLfloat vertices_3[3 * 4] = {
93 -1.0f, 0.8f, 0.8f,
94 -1.0f, 0.8f, -0.8f,
95 -1.0f, -0.8f, 0.8f,
96 -1.0f, -0.8f, -0.8f
99 GLfloat vertices_4[3 * 4] = {
100 1.0f, 0.8f, 0.8f,
101 1.0f, -0.8f, 0.8f,
102 1.0f, 0.8f, -0.8f,
103 1.0f, -0.8f, -0.8f
106 GLfloat vertices_5[3 * 8] = {
107 0.8f, 1.0f, 0.8f,
108 1.0f, 0.8f, 0.8f,
109 0.8f, 1.0f, -0.8f,
110 1.0f, 0.8f, -0.8f,
111 0.8f, 0.8f, -1.0f,
112 1.0f, -0.8f, -0.8f,
113 0.8f, -0.8f, -1.0f,
114 0.8f, -1.0f, -0.8f,
117 GLfloat vertices_6[3 * 8] = {
118 0.8f, -1.0f, -0.8f,
119 1.0f, -0.8f, -0.8f,
120 0.8f, -1.0f, 0.8f,
121 1.0f, -0.8f, 0.8f,
122 0.8f, -0.8f, 1.0f,
123 1.0f, 0.8f, 0.8f,
124 0.8f, 0.8f, 1.0f,
125 0.8f, 1.0f, 0.8f,
128 GLfloat normals_0[3 * 18] = {
129 0.0f, 0.0f, -1.0f,
130 0.0f, 0.0f, -1.0f,
131 0.0f, -1.0f, 0.0f,
132 0.0f, -1.0f, 0.0f,
133 0.0f, -1.0f, 0.0f,
134 0.0f, -1.0f, 0.0f,
135 0.0f, 0.0f, 1.0f,
136 0.0f, 0.0f, 1.0f,
137 0.0f, 0.0f, 1.0f,
138 0.0f, 0.0f, 1.0f,
139 0.0f, 1.0f, 0.0f,
140 0.0f, 1.0f, 0.0f,
141 0.0f, 1.0f, 0.0f,
142 0.0f, 1.0f, 0.0f,
143 0.0f, 0.0f, -1.0f,
144 0.0f, 0.0f, -1.0f,
145 0.0f, 0.0f, -1.0f,
146 0.0f, 0.0f, -1.0f
149 GLfloat normals_1[3 * 8] = {
150 0.0f, 0.0f, -1.0f,
151 -1.0f, 0.0f, 0.0f,
152 0.0f, 0.0f, -1.0f,
153 -1.0f, 0.0f, 0.0f,
154 0.0f, 1.0f, 0.0f,
155 -1.0f, 0.0f, 0.0f,
156 0.0f, 1.0f, 0.0f,
157 0.0f, 0.0f, 1.0f
160 GLfloat normals_2[3 * 8] = {
161 0.0f, 0.0f, 1.0f,
162 -1.0f, 0.0f, 0.0f,
163 0.0f, 0.0f, 1.0f,
164 -1.0f, 0.0f, 0.0f,
165 0.0f, -1.0f, 0.0f,
166 -1.0f, 0.0f, 0.0f,
167 0.0f, -1.0f, 0.0f,
168 0.0f, 0.0f, -1.0f
171 GLfloat normals_3[3 * 4] = {
172 -1.0f, 0.0f, 0.0f,
173 -1.0f, 0.0f, 0.0f,
174 -1.0f, 0.0f, 0.0f,
175 -1.0f, 0.0f, 0.0f
178 GLfloat normals_4[3 * 4] = {
179 1.0f, 0.0f, 0.0f,
180 1.0f, 0.0f, 0.0f,
181 1.0f, 0.0f, 0.0f,
182 1.0f, 0.0f, 0.0f
185 GLfloat normals_5[3 * 8] = {
186 0.0f, 1.0f, 0.0f,
187 1.0f, 0.0f, 0.0f,
188 0.0f, 1.0f, 0.0f,
189 1.0f, 0.0f, 0.0f,
190 0.0f, 0.0f, -1.0f,
191 1.0f, 0.0f, 0.0f,
192 0.0f, 0.0f, -1.0f,
193 1.0f, 0.0f, 0.0f,
196 GLfloat normals_6[3 * 8] = {
197 0.0f, -1.0f, 0.0f,
198 1.0f, 0.0f, 0.0f,
199 0.0f, -1.0f, 0.0f,
200 1.0f, 0.0f, 0.0f,
201 0.0f, 0.0f, 1.0f,
202 1.0f, 0.0f, 0.0f,
203 0.0f, 0.0f, 1.0f,
204 0.0f, 1.0f, 0.0f,
207 GLfloat tex_coords_0[3 * 18];
208 for (int n = 3 * 18; n--; )
209 tex_coords_0[n] = vertices_0[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
211 GLfloat tex_coords_1[3 * 8];
212 for (int n = 3 * 8; n--; )
213 tex_coords_1[n] = vertices_1[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
215 GLfloat tex_coords_2[3 * 8];
216 for (int n = 3 * 8; n--; )
217 tex_coords_2[n] = vertices_2[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
219 GLfloat tex_coords_3[3 * 4];
220 for (int n = 3 * 4; n--; )
221 tex_coords_3[n] = vertices_3[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
223 GLfloat tex_coords_4[3 * 4];
224 for (int n = 3 * 4; n--; )
225 tex_coords_4[n] = vertices_4[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
227 GLfloat tex_coords_5[3 * 8];
228 for (int n = 3 * 8; n--; )
229 tex_coords_5[n] = vertices_5[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
231 GLfloat tex_coords_6[3 * 8];
232 for (int n = 3 * 8; n--; )
233 tex_coords_6[n] = vertices_6[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
235 glVertexPointer(3, GL_FLOAT, 0, vertices_0);
236 glNormalPointer(GL_FLOAT, 0, normals_0);
237 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_0);
238 glDrawArrays(GL_TRIANGLE_STRIP, 0, 18);
240 glVertexPointer(3, GL_FLOAT, 0, vertices_1);
241 glNormalPointer(GL_FLOAT, 0, normals_1);
242 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_1);
243 glDrawArrays(GL_TRIANGLE_STRIP, 0, 8);
245 glVertexPointer(3, GL_FLOAT, 0, vertices_2);
246 glNormalPointer(GL_FLOAT, 0, normals_2);
247 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_2);
248 glDrawArrays(GL_TRIANGLE_STRIP, 0, 8);
250 glVertexPointer(3, GL_FLOAT, 0, vertices_3);
251 glNormalPointer(GL_FLOAT, 0, normals_3);
252 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_3);
253 glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
255 glVertexPointer(3, GL_FLOAT, 0, vertices_4);
256 glNormalPointer(GL_FLOAT, 0, normals_4);
257 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_4);
258 glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
260 glVertexPointer(3, GL_FLOAT, 0, vertices_5);
261 glNormalPointer(GL_FLOAT, 0, normals_5);
262 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_5);
263 glDrawArrays(GL_TRIANGLE_STRIP, 0, 8);
265 glVertexPointer(3, GL_FLOAT, 0, vertices_6);
266 glNormalPointer(GL_FLOAT, 0, normals_6);
267 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_6);
268 glDrawArrays(GL_TRIANGLE_STRIP, 0, 8);
270 glEndList();
272 glDisableClientState(GL_VERTEX_ARRAY);
273 glDisableClientState(GL_NORMAL_ARRAY);
274 glDisableClientState(GL_TEXTURE_COORD_ARRAY);