{
if(vbuf->vertices) {
- vbuf->render->unmap_vertices( vbuf->render, 0, vbuf->nr_vertices );
+ vbuf->render->unmap_vertices( vbuf->render, 0, vbuf->nr_vertices - 1 );
if (vbuf->nr_indices)
{
*/
draw_do_flush( draw, DRAW_FLUSH_BACKEND );
+ if (vertex_count == 0)
+ return;
+
if (vertex_count >= UNDEFINED_VERTEX_ID) {
assert(0);
return;
render->unmap_vertices( render,
0,
- vertex_count );
+ vertex_count - 1 );
render->draw(render,
elts,
}
}
- render->unmap_vertices( render, 0, count );
+ render->unmap_vertices( render, 0, count - 1 );
render->draw_arrays(render, 0, count);
draw->render->unmap_vertices( draw->render,
0,
- (ushort)fetch_count );
+ (ushort)(fetch_count - 1) );
/* XXX: Draw arrays path to avoid re-emitting index list again and
* again.
}
}
- draw->render->unmap_vertices( draw->render, 0, count );
+ draw->render->unmap_vertices( draw->render, 0, count - 1 );
/* XXX: Draw arrays path to avoid re-emitting index list again and
* again.
count,
hw_verts );
- draw->render->unmap_vertices( draw->render, 0, (ushort)count );
+ draw->render->unmap_vertices( draw->render, 0, (ushort)(count - 1) );
/* XXX: Draw arrays path to avoid re-emitting index list again and
* again.
}
}
- draw->render->unmap_vertices( draw->render, 0, (ushort)count );
+ draw->render->unmap_vertices( draw->render, 0, (ushort)(count - 1) );
/* Draw arrays path to avoid re-emitting index list again and
* again.
}
}
- draw->render->unmap_vertices( draw->render, 0, (ushort)fetch_count );
+ draw->render->unmap_vertices( draw->render, 0, (ushort)(fetch_count - 1) );
draw->render->draw( draw->render,
draw_elts,
draw_count );
- draw->render->unmap_vertices( draw->render, 0, (ushort) count );
+ draw->render->unmap_vertices( draw->render, 0, (ushort)(count - 1) );
draw->render->release_vertices( draw->render );