Really low graphics patch thanks to Stephan Beyer
[crack-attack.git] / src / obj_garbage_small.cxx
blobb677c9670712117454c9de40a030414868899c5e
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 #ifndef _WIN32
31 #else
32 # include <glext.h>
33 #endif
35 using namespace std;
37 #include "Game.h"
38 #include "Displayer.h"
40 GLuint Displayer::garbage_small_list;
42 void Displayer::generateGarbageSmallList ( )
44 garbage_small_list = glGenLists(1);
46 glEnableClientState(GL_VERTEX_ARRAY);
47 glEnableClientState(GL_NORMAL_ARRAY);
48 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
50 glNewList(garbage_small_list, GL_COMPILE);
52 GLfloat vertices_0[3 * 18] = {
53 -0.8f, -0.8f, -1.0f,
54 0.8f, -0.8f, -1.0f,
55 -0.8f, -1.0f, -0.8f,
56 0.8f, -1.0f, -0.8f,
57 -0.8f, -1.0f, 0.8f,
58 0.8f, -1.0f, 0.8f,
59 -0.8f, -0.8f, 1.0f,
60 0.8f, -0.8f, 1.0f,
61 -0.8f, 0.8f, 1.0f,
62 0.8f, 0.8f, 1.0f,
63 -0.8f, 1.0f, 0.8f,
64 0.8f, 1.0f, 0.8f,
65 -0.8f, 1.0f, -0.8f,
66 0.8f, 1.0f, -0.8f,
67 -0.8f, 0.8f, -1.0f,
68 0.8f, 0.8f, -1.0f,
69 -0.8f, -0.8f, -1.0f,
70 0.8f, -0.8f, -1.0f
73 GLfloat vertices_1[3 * 8] = {
74 -0.8f, -0.8f, -1.0f,
75 -1.0f, -0.8f, -0.8f,
76 -0.8f, 0.8f, -1.0f,
77 -1.0f, 0.8f, -0.8f,
78 -0.8f, 1.0f, -0.8f,
79 -1.0f, 0.8f, 0.8f,
80 -0.8f, 1.0f, 0.8f,
81 -0.8f, 0.8f, 1.0f
84 GLfloat vertices_2[3 * 8] = {
85 -0.8f, 0.8f, 1.0f,
86 -1.0f, 0.8f, 0.8f,
87 -0.8f, -0.8f, 1.0f,
88 -1.0f, -0.8f, 0.8f,
89 -0.8f, -1.0f, 0.8f,
90 -1.0f, -0.8f, -0.8f,
91 -0.8f, -1.0f, -0.8f,
92 -0.8f, -0.8f, -1.0f
95 GLfloat vertices_3[3 * 4] = {
96 -1.0f, 0.8f, 0.8f,
97 -1.0f, 0.8f, -0.8f,
98 -1.0f, -0.8f, 0.8f,
99 -1.0f, -0.8f, -0.8f
102 GLfloat vertices_4[3 * 4] = {
103 1.0f, 0.8f, 0.8f,
104 1.0f, -0.8f, 0.8f,
105 1.0f, 0.8f, -0.8f,
106 1.0f, -0.8f, -0.8f
109 GLfloat vertices_5[3 * 8] = {
110 0.8f, 1.0f, 0.8f,
111 1.0f, 0.8f, 0.8f,
112 0.8f, 1.0f, -0.8f,
113 1.0f, 0.8f, -0.8f,
114 0.8f, 0.8f, -1.0f,
115 1.0f, -0.8f, -0.8f,
116 0.8f, -0.8f, -1.0f,
117 0.8f, -1.0f, -0.8f,
120 GLfloat vertices_6[3 * 8] = {
121 0.8f, -1.0f, -0.8f,
122 1.0f, -0.8f, -0.8f,
123 0.8f, -1.0f, 0.8f,
124 1.0f, -0.8f, 0.8f,
125 0.8f, -0.8f, 1.0f,
126 1.0f, 0.8f, 0.8f,
127 0.8f, 0.8f, 1.0f,
128 0.8f, 1.0f, 0.8f,
131 GLfloat normals_0[3 * 18] = {
132 0.0f, 0.0f, -1.0f,
133 0.0f, 0.0f, -1.0f,
134 0.0f, -1.0f, 0.0f,
135 0.0f, -1.0f, 0.0f,
136 0.0f, -1.0f, 0.0f,
137 0.0f, -1.0f, 0.0f,
138 0.0f, 0.0f, 1.0f,
139 0.0f, 0.0f, 1.0f,
140 0.0f, 0.0f, 1.0f,
141 0.0f, 0.0f, 1.0f,
142 0.0f, 1.0f, 0.0f,
143 0.0f, 1.0f, 0.0f,
144 0.0f, 1.0f, 0.0f,
145 0.0f, 1.0f, 0.0f,
146 0.0f, 0.0f, -1.0f,
147 0.0f, 0.0f, -1.0f,
148 0.0f, 0.0f, -1.0f,
149 0.0f, 0.0f, -1.0f
152 GLfloat normals_1[3 * 8] = {
153 0.0f, 0.0f, -1.0f,
154 -1.0f, 0.0f, 0.0f,
155 0.0f, 0.0f, -1.0f,
156 -1.0f, 0.0f, 0.0f,
157 0.0f, 1.0f, 0.0f,
158 -1.0f, 0.0f, 0.0f,
159 0.0f, 1.0f, 0.0f,
160 0.0f, 0.0f, 1.0f
163 GLfloat normals_2[3 * 8] = {
164 0.0f, 0.0f, 1.0f,
165 -1.0f, 0.0f, 0.0f,
166 0.0f, 0.0f, 1.0f,
167 -1.0f, 0.0f, 0.0f,
168 0.0f, -1.0f, 0.0f,
169 -1.0f, 0.0f, 0.0f,
170 0.0f, -1.0f, 0.0f,
171 0.0f, 0.0f, -1.0f
174 GLfloat normals_3[3 * 4] = {
175 -1.0f, 0.0f, 0.0f,
176 -1.0f, 0.0f, 0.0f,
177 -1.0f, 0.0f, 0.0f,
178 -1.0f, 0.0f, 0.0f
181 GLfloat normals_4[3 * 4] = {
182 1.0f, 0.0f, 0.0f,
183 1.0f, 0.0f, 0.0f,
184 1.0f, 0.0f, 0.0f,
185 1.0f, 0.0f, 0.0f
188 GLfloat normals_5[3 * 8] = {
189 0.0f, 1.0f, 0.0f,
190 1.0f, 0.0f, 0.0f,
191 0.0f, 1.0f, 0.0f,
192 1.0f, 0.0f, 0.0f,
193 0.0f, 0.0f, -1.0f,
194 1.0f, 0.0f, 0.0f,
195 0.0f, 0.0f, -1.0f,
196 1.0f, 0.0f, 0.0f,
199 GLfloat normals_6[3 * 8] = {
200 0.0f, -1.0f, 0.0f,
201 1.0f, 0.0f, 0.0f,
202 0.0f, -1.0f, 0.0f,
203 1.0f, 0.0f, 0.0f,
204 0.0f, 0.0f, 1.0f,
205 1.0f, 0.0f, 0.0f,
206 0.0f, 0.0f, 1.0f,
207 0.0f, 1.0f, 0.0f,
210 GLfloat tex_coords_0[3 * 18];
211 for (int n = 3 * 18; n--; )
212 tex_coords_0[n] = vertices_0[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
214 GLfloat tex_coords_1[3 * 8];
215 for (int n = 3 * 8; n--; )
216 tex_coords_1[n] = vertices_1[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
218 GLfloat tex_coords_2[3 * 8];
219 for (int n = 3 * 8; n--; )
220 tex_coords_2[n] = vertices_2[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
222 GLfloat tex_coords_3[3 * 4];
223 for (int n = 3 * 4; n--; )
224 tex_coords_3[n] = vertices_3[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
226 GLfloat tex_coords_4[3 * 4];
227 for (int n = 3 * 4; n--; )
228 tex_coords_4[n] = vertices_4[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
230 GLfloat tex_coords_5[3 * 8];
231 for (int n = 3 * 8; n--; )
232 tex_coords_5[n] = vertices_5[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
234 GLfloat tex_coords_6[3 * 8];
235 for (int n = 3 * 8; n--; )
236 tex_coords_6[n] = vertices_6[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
238 glVertexPointer(3, GL_FLOAT, 0, vertices_0);
239 glNormalPointer(GL_FLOAT, 0, normals_0);
240 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_0);
241 glDrawArrays(GL_TRIANGLE_STRIP, 0, 18);
243 glVertexPointer(3, GL_FLOAT, 0, vertices_1);
244 glNormalPointer(GL_FLOAT, 0, normals_1);
245 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_1);
246 glDrawArrays(GL_TRIANGLE_STRIP, 0, 8);
248 glVertexPointer(3, GL_FLOAT, 0, vertices_2);
249 glNormalPointer(GL_FLOAT, 0, normals_2);
250 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_2);
251 glDrawArrays(GL_TRIANGLE_STRIP, 0, 8);
253 glVertexPointer(3, GL_FLOAT, 0, vertices_3);
254 glNormalPointer(GL_FLOAT, 0, normals_3);
255 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_3);
256 glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
258 glVertexPointer(3, GL_FLOAT, 0, vertices_4);
259 glNormalPointer(GL_FLOAT, 0, normals_4);
260 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_4);
261 glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
263 glVertexPointer(3, GL_FLOAT, 0, vertices_5);
264 glNormalPointer(GL_FLOAT, 0, normals_5);
265 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_5);
266 glDrawArrays(GL_TRIANGLE_STRIP, 0, 8);
268 glVertexPointer(3, GL_FLOAT, 0, vertices_6);
269 glNormalPointer(GL_FLOAT, 0, normals_6);
270 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_6);
271 glDrawArrays(GL_TRIANGLE_STRIP, 0, 8);
273 glEndList();
275 glDisableClientState(GL_VERTEX_ARRAY);
276 glDisableClientState(GL_NORMAL_ARRAY);
277 glDisableClientState(GL_TEXTURE_COORD_ARRAY);