9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
-
+
-
+
-
+
|
void
setarraypointers()
{
glVertexPointer(3, GL_FLOAT, sizeof(vertex), &verts[0].x);
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(vertex), &verts[0].r);
glTexCoordPointer(2, GL_FLOAT, sizeof(vertex), &verts[0].u);
};
}
void
reallocv()
{
verts = (vertex *)realloc(verts, (curmaxverts *= 2) * sizeof(vertex));
curmaxverts -= 10;
if (!verts)
fatal("no vertex memory!");
fatal(@"no vertex memory!");
setarraypointers();
};
}
// generating the actual vertices is done dynamically every frame and sits at
// the leaves of all these functions, and are part of the cpu bottleneck on
// really slow machines, hence the macros.
#define vertcheck() \
{ \
|