19 |
template <class T> |
template <class T> |
20 |
void nop(T t) {}; |
void nop(T t) {}; |
21 |
|
|
22 |
|
inline void texCoord(ZPt p) { |
23 |
|
glTexCoord3f(p.x, p.y, p.z); |
24 |
|
} |
25 |
|
|
26 |
inline void texCoord(ZPt p, float q) { |
inline void texCoord(ZPt p, float q) { |
27 |
glTexCoord4f(p.x, p.y, p.z, q); |
glTexCoord4f(p.x, p.y, p.z, q); |
28 |
} |
} |
52 |
const unsigned SLICE_1D = 16; |
const unsigned SLICE_1D = 16; |
53 |
const unsigned SLICE_2D = 32; |
const unsigned SLICE_2D = 32; |
54 |
const unsigned SHIFTS = 64; |
const unsigned SHIFTS = 64; |
55 |
|
const unsigned INSIDE = 128; |
56 |
|
|
57 |
template <class Coords> |
template <class Coords> |
58 |
void fill(Coords &coords, ZPt center, |
void fill(Coords &coords, ZPt center, |
103 |
vert2[i][1] = coords.transform(vert[i][1]); |
vert2[i][1] = coords.transform(vert[i][1]); |
104 |
} |
} |
105 |
|
|
106 |
|
if (flags & INSIDE) { |
107 |
|
colorfv(c0); |
108 |
|
glBegin(GL_POLYGON); |
109 |
|
for (unsigned i = 0; i < pt.size(); i++) { |
110 |
|
texCoord(vert[i][0]); |
111 |
|
coords.vertex(vert[i][0]); |
112 |
|
} |
113 |
|
glEnd(); |
114 |
|
} |
115 |
|
|
116 |
if (flags & SLICE_2D) { |
if (flags & SLICE_2D) { |
117 |
glBegin(GL_QUAD_STRIP); |
glBegin(GL_QUAD_STRIP); |
118 |
for (unsigned i = 0; i < pt.size(); i++) { |
for (unsigned i = 0; i < pt.size(); i++) { |