Really low graphics patch thanks to Stephan Beyer
[crack-attack.git] / src / obj_garbage_thin_cap.cxx
blob9be75760a2c8a062b92120edb7d5318f0f89a4b2
1 /*
2 * garbage_thin_cap.cxx
3 * Daniel Nelson - 9/1/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 cap of thin garbage.
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_thin_cap_list;
42 void Displayer::generateGarbageThinCapList ( )
44 garbage_thin_cap_list = glGenLists(1);
46 glEnableClientState(GL_VERTEX_ARRAY);
47 glEnableClientState(GL_NORMAL_ARRAY);
48 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
50 glNewList(garbage_thin_cap_list, GL_COMPILE);
52 GLfloat vertices_0[3 * 18] = {
53 -0.8f, -0.8f, -1.0f,
54 1.0f, -0.8f, -1.0f,
55 -0.8f, -1.0f, -0.8f,
56 1.0f, -1.0f, -0.8f,
57 -0.8f, -1.0f, 0.8f,
58 1.0f, -1.0f, 0.8f,
59 -0.8f, -0.8f, 1.0f,
60 1.0f, -0.8f, 1.0f,
61 -0.8f, 0.8f, 1.0f,
62 1.0f, 0.8f, 1.0f,
63 -0.8f, 1.0f, 0.8f,
64 1.0f, 1.0f, 0.8f,
65 -0.8f, 1.0f, -0.8f,
66 1.0f, 1.0f, -0.8f,
67 -0.8f, 0.8f, -1.0f,
68 1.0f, 0.8f, -1.0f,
69 -0.8f, -0.8f, -1.0f,
70 1.0f, -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 normals_0[3 * 18] = {
103 0.0f, 0.0f, -1.0f,
104 0.0f, 0.0f, -1.0f,
105 0.0f, -1.0f, 0.0f,
106 0.0f, -1.0f, 0.0f,
107 0.0f, -1.0f, 0.0f,
108 0.0f, -1.0f, 0.0f,
109 0.0f, 0.0f, 1.0f,
110 0.0f, 0.0f, 1.0f,
111 0.0f, 0.0f, 1.0f,
112 0.0f, 0.0f, 1.0f,
113 0.0f, 1.0f, 0.0f,
114 0.0f, 1.0f, 0.0f,
115 0.0f, 1.0f, 0.0f,
116 0.0f, 1.0f, 0.0f,
117 0.0f, 0.0f, -1.0f,
118 0.0f, 0.0f, -1.0f,
119 0.0f, 0.0f, -1.0f,
120 0.0f, 0.0f, -1.0f
123 GLfloat normals_1[3 * 8] = {
124 0.0f, 0.0f, -1.0f,
125 -1.0f, 0.0f, 0.0f,
126 0.0f, 0.0f, -1.0f,
127 -1.0f, 0.0f, 0.0f,
128 0.0f, 1.0f, 0.0f,
129 -1.0f, 0.0f, 0.0f,
130 0.0f, 1.0f, 0.0f,
131 0.0f, 0.0f, 1.0f
134 GLfloat normals_2[3 * 8] = {
135 0.0f, 0.0f, 1.0f,
136 -1.0f, 0.0f, 0.0f,
137 0.0f, 0.0f, 1.0f,
138 -1.0f, 0.0f, 0.0f,
139 0.0f, -1.0f, 0.0f,
140 -1.0f, 0.0f, 0.0f,
141 0.0f, -1.0f, 0.0f,
142 0.0f, 0.0f, -1.0f
145 GLfloat normals_3[3 * 4] = {
146 -1.0f, 0.0f, 0.0f,
147 -1.0f, 0.0f, 0.0f,
148 -1.0f, 0.0f, 0.0f,
149 -1.0f, 0.0f, 0.0f
152 GLfloat tex_coords_0[3 * 18];
153 for (int n = 3 * 18; n--; )
154 tex_coords_0[n] = vertices_0[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
156 GLfloat tex_coords_1[3 * 8];
157 for (int n = 3 * 8; n--; )
158 tex_coords_1[n] = vertices_1[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
160 GLfloat tex_coords_2[3 * 8];
161 for (int n = 3 * 8; n--; )
162 tex_coords_2[n] = vertices_2[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
164 GLfloat tex_coords_3[3 * 4];
165 for (int n = 3 * 4; n--; )
166 tex_coords_3[n] = vertices_3[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
168 glVertexPointer(3, GL_FLOAT, 0, vertices_0);
169 glNormalPointer(GL_FLOAT, 0, normals_0);
170 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_0);
171 glDrawArrays(GL_TRIANGLE_STRIP, 0, 18);
173 glVertexPointer(3, GL_FLOAT, 0, vertices_1);
174 glNormalPointer(GL_FLOAT, 0, normals_1);
175 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_1);
176 glDrawArrays(GL_TRIANGLE_STRIP, 0, 8);
178 glVertexPointer(3, GL_FLOAT, 0, vertices_2);
179 glNormalPointer(GL_FLOAT, 0, normals_2);
180 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_2);
181 glDrawArrays(GL_TRIANGLE_STRIP, 0, 8);
183 glVertexPointer(3, GL_FLOAT, 0, vertices_3);
184 glNormalPointer(GL_FLOAT, 0, normals_3);
185 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_3);
186 glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
188 glEndList();
190 glDisableClientState(GL_VERTEX_ARRAY);
191 glDisableClientState(GL_NORMAL_ARRAY);
192 glDisableClientState(GL_TEXTURE_COORD_ARRAY);