Really low graphics patch thanks to Stephan Beyer
[crack-attack.git] / src / obj_garbage_thick_corner.cxx
blobe5e40713ccf4b699931d46bb0a20cb9d4c5d176a
1 /*
2 * garbage_thick_corner.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 corner of thick 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_thick_corner_list;
42 void Displayer::generateGarbageThickCornerList ( )
44 garbage_thick_corner_list = glGenLists(1);
46 glEnableClientState(GL_VERTEX_ARRAY);
47 glEnableClientState(GL_NORMAL_ARRAY);
48 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
50 glNewList(garbage_thick_corner_list, GL_COMPILE);
52 GLfloat vertices_0[3 * 12] =
54 1.0f, -1.0f, -1.0f,
55 -0.8f, -1.0f, -1.0f,
56 1.0f, 0.8f, -1.0f,
57 -0.8f, 0.8f, -1.0f,
58 1.0f, 1.0f, -0.8f,
59 -0.8f, 1.0f, -0.8f,
60 1.0f, 1.0f, 0.8f,
61 -0.8f, 1.0f, 0.8f,
62 1.0f, 0.8f, 1.0f,
63 -0.8f, 0.8f, 1.0f,
64 1.0f, -1.0f, 1.0f,
65 -0.8f, -1.0f, 1.0f
68 GLfloat vertices_1[3 * 8] =
70 -0.8f, -1.0f, -1.0f,
71 -1.0f, -1.0f, -0.8f,
72 -0.8f, 0.8f, -1.0f,
73 -1.0f, 0.8f, -0.8f,
74 -0.8f, 1.0f, -0.8f,
75 -1.0f, 0.8f, 0.8f,
76 -0.8f, 1.0f, 0.8f,
77 -0.8f, 0.8f, 1.0f
80 GLfloat vertices_2[3 * 6] =
82 -1.0f, 0.8f, -0.8f,
83 -1.0f, -1.0f, -0.8f,
84 -1.0f, 0.8f, 0.8f,
85 -1.0f, -1.0f, 0.8f,
86 -0.8f, 0.8f, 1.0f,
87 -0.8f, -1.0f, 1.0f
90 GLfloat normals_0[3 * 12] =
92 0.0f, 0.0f, -1.0f,
93 0.0f, 0.0f, -1.0f,
94 0.0f, 0.0f, -1.0f,
95 0.0f, 0.0f, -1.0f,
96 0.0f, 1.0f, 0.0f,
97 0.0f, 1.0f, 0.0f,
98 0.0f, 1.0f, 0.0f,
99 0.0f, 1.0f, 0.0f,
100 0.0f, 0.0f, 1.0f,
101 0.0f, 0.0f, 1.0f,
102 0.0f, 0.0f, 1.0f,
103 0.0f, 0.0f, 1.0f
106 GLfloat normals_1[3 * 8] =
108 0.0f, 0.0f, -1.0f,
109 -1.0f, 0.0f, 0.0f,
110 0.0f, 0.0f, -1.0f,
111 -1.0f, 0.0f, 0.0f,
112 0.0f, 1.0f, 0.0f,
113 -1.0f, 0.0f, 0.0f,
114 0.0f, 1.0f, 0.0f,
115 0.0f, 0.0f, 1.0f
118 GLfloat normals_2[3 * 6] =
120 -1.0f, 0.0f, 0.0f,
121 -1.0f, 0.0f, 0.0f,
122 -1.0f, 0.0f, 0.0f,
123 -1.0f, 0.0f, 0.0f,
124 0.0f, 0.0f, 1.0f,
125 0.0f, 0.0f, 1.0f
128 GLfloat tex_coords_0[3 * 12];
129 for (int n = 3 * 12; n--; )
130 tex_coords_0[n] = vertices_0[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
132 GLfloat tex_coords_1[3 * 8];
133 for (int n = 3 * 8; n--; )
134 tex_coords_1[n] = vertices_1[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
136 GLfloat tex_coords_2[3 * 6];
137 for (int n = 3 * 6; n--; )
138 tex_coords_2[n] = vertices_2[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
140 glVertexPointer(3, GL_FLOAT, 0, vertices_0);
141 glNormalPointer(GL_FLOAT, 0, normals_0);
142 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_0);
143 glDrawArrays(GL_TRIANGLE_STRIP, 0, 12);
145 glVertexPointer(3, GL_FLOAT, 0, vertices_1);
146 glNormalPointer(GL_FLOAT, 0, normals_1);
147 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_1);
148 glDrawArrays(GL_TRIANGLE_STRIP, 0, 8);
150 glVertexPointer(3, GL_FLOAT, 0, vertices_2);
151 glNormalPointer(GL_FLOAT, 0, normals_2);
152 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_2);
153 glDrawArrays(GL_TRIANGLE_STRIP, 0, 6);
155 glEndList();
157 glDisableClientState(GL_VERTEX_ARRAY);
158 glDisableClientState(GL_NORMAL_ARRAY);
159 glDisableClientState(GL_TEXTURE_COORD_ARRAY);