Each module now includes its own header first. Removed sstream.h and the definition...
[crack-attack.git] / src / obj_garbage_thick_corner.cxx
blob201e9247966af2d588924a9d9020a56054619176
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 #include "glext.h"
32 #include "Game.h"
33 #include "Displayer.h"
35 GLuint Displayer::garbage_thick_corner_list;
37 void Displayer::generateGarbageThickCornerList ( )
39 garbage_thick_corner_list = glGenLists(1);
41 glEnableClientState(GL_VERTEX_ARRAY);
42 glEnableClientState(GL_NORMAL_ARRAY);
43 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
45 glNewList(garbage_thick_corner_list, GL_COMPILE);
47 GLfloat vertices_0[3 * 12] =
49 1.0f, -1.0f, -1.0f,
50 -0.8f, -1.0f, -1.0f,
51 1.0f, 0.8f, -1.0f,
52 -0.8f, 0.8f, -1.0f,
53 1.0f, 1.0f, -0.8f,
54 -0.8f, 1.0f, -0.8f,
55 1.0f, 1.0f, 0.8f,
56 -0.8f, 1.0f, 0.8f,
57 1.0f, 0.8f, 1.0f,
58 -0.8f, 0.8f, 1.0f,
59 1.0f, -1.0f, 1.0f,
60 -0.8f, -1.0f, 1.0f
63 GLfloat vertices_1[3 * 8] =
65 -0.8f, -1.0f, -1.0f,
66 -1.0f, -1.0f, -0.8f,
67 -0.8f, 0.8f, -1.0f,
68 -1.0f, 0.8f, -0.8f,
69 -0.8f, 1.0f, -0.8f,
70 -1.0f, 0.8f, 0.8f,
71 -0.8f, 1.0f, 0.8f,
72 -0.8f, 0.8f, 1.0f
75 GLfloat vertices_2[3 * 6] =
77 -1.0f, 0.8f, -0.8f,
78 -1.0f, -1.0f, -0.8f,
79 -1.0f, 0.8f, 0.8f,
80 -1.0f, -1.0f, 0.8f,
81 -0.8f, 0.8f, 1.0f,
82 -0.8f, -1.0f, 1.0f
85 GLfloat normals_0[3 * 12] =
87 0.0f, 0.0f, -1.0f,
88 0.0f, 0.0f, -1.0f,
89 0.0f, 0.0f, -1.0f,
90 0.0f, 0.0f, -1.0f,
91 0.0f, 1.0f, 0.0f,
92 0.0f, 1.0f, 0.0f,
93 0.0f, 1.0f, 0.0f,
94 0.0f, 1.0f, 0.0f,
95 0.0f, 0.0f, 1.0f,
96 0.0f, 0.0f, 1.0f,
97 0.0f, 0.0f, 1.0f,
98 0.0f, 0.0f, 1.0f
101 GLfloat normals_1[3 * 8] =
103 0.0f, 0.0f, -1.0f,
104 -1.0f, 0.0f, 0.0f,
105 0.0f, 0.0f, -1.0f,
106 -1.0f, 0.0f, 0.0f,
107 0.0f, 1.0f, 0.0f,
108 -1.0f, 0.0f, 0.0f,
109 0.0f, 1.0f, 0.0f,
110 0.0f, 0.0f, 1.0f
113 GLfloat normals_2[3 * 6] =
115 -1.0f, 0.0f, 0.0f,
116 -1.0f, 0.0f, 0.0f,
117 -1.0f, 0.0f, 0.0f,
118 -1.0f, 0.0f, 0.0f,
119 0.0f, 0.0f, 1.0f,
120 0.0f, 0.0f, 1.0f
123 GLfloat tex_coords_0[3 * 12];
124 for (int n = 3 * 12; n--; )
125 tex_coords_0[n] = vertices_0[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
127 GLfloat tex_coords_1[3 * 8];
128 for (int n = 3 * 8; n--; )
129 tex_coords_1[n] = vertices_1[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
131 GLfloat tex_coords_2[3 * 6];
132 for (int n = 3 * 6; n--; )
133 tex_coords_2[n] = vertices_2[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
135 glVertexPointer(3, GL_FLOAT, 0, vertices_0);
136 glNormalPointer(GL_FLOAT, 0, normals_0);
137 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_0);
138 glDrawArrays(GL_TRIANGLE_STRIP, 0, 12);
140 glVertexPointer(3, GL_FLOAT, 0, vertices_1);
141 glNormalPointer(GL_FLOAT, 0, normals_1);
142 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_1);
143 glDrawArrays(GL_TRIANGLE_STRIP, 0, 8);
145 glVertexPointer(3, GL_FLOAT, 0, vertices_2);
146 glNormalPointer(GL_FLOAT, 0, normals_2);
147 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_2);
148 glDrawArrays(GL_TRIANGLE_STRIP, 0, 6);
150 glEndList();
152 glDisableClientState(GL_VERTEX_ARRAY);
153 glDisableClientState(GL_NORMAL_ARRAY);
154 glDisableClientState(GL_TEXTURE_COORD_ARRAY);