Ok, a little farther:
131 * @brief Use the vertex, texture and normal arrays to draw a surface
132 * @sa R_DrawSurfaces
133 */
134 static inline void R_DrawSurface (const mBspSurface_t *surf)
135 {
136 debug(0);
137 glDrawArrays(GL_POLYGON, surf->index, surf->numedges);
138
139 if (r_showbox->integer == 2)
140 R_DrawBoundingBox(surf->mins, surf->maxs);
(gdb) p surf->index
$7 = 18763
(gdb) p surf->numedges
$8 = 4
(gdb) p surf
$9 = (const mBspSurface_t *) 0x2e552c8c
(gdb) p *$
$10 = {
plane = 0x2d5c102c,
flags = 2,
tile = 0,
frame = 2,
firstedge = 18763,
numedges = 4,
stmins = {4992, -2688},
stmaxs = {6080, -2304},
stcenter = {5536, -2496},
stextents = {1088, 384},
mins = {1486.40002, 768, 6},
maxs = {1788.80005, 856, 6},
center = {1637.6001, 812, 6},
color = {0, 0, 0, 1},
normal = {0, 0, 1},
light_s = 1941,
light_t = 14,
lightmap_scale = 64,
index = 18763,
tracenum = 0,
texinfo = 0x2b15d02c,
flare = 0x0,
lightmap_texnum = 1024,
deluxemap_texnum = 1280,
samples = 0x2d5a7d4b "BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BBB?BB"...,
lightmap = 0x2b06ea6c '?' <repeats 200 times>...,
lightframe = 0,
lights = 0,
isOriginBrushModel = qfalse
}
glDrawArrays looks interesting. It is being given a type (polygon), an index, and number of corners (4; so much for my thought that everything was triangles), but it isn't given a list of verticies, only index and count.
"Samples" and "lightmap": Are those values reasonable? Should they be initialized by this point?