- buffer_fix( pscene->verts, pscene->vertex_count,
- &pscene->vertex_cap, sizeof( mdl_vert ));
-
- buffer_fix( pscene->indices, pscene->indice_count,
- &pscene->indice_cap, sizeof( mdl_vert ));
+ return pscene;
+ u32 vertex_count = pscene->vertex_count,
+ indice_count = pscene->indice_count,
+ vertex_length = vertex_count * sizeof(mdl_vert),
+ index_length = indice_count * sizeof(u32),
+ tot_size = sizeof(scene) + vertex_length + index_length;
+
+ /* copy down index data */
+ void *dst_indices = pscene->arrvertices + vertex_length;
+ memmove( dst_indices, pscene->arrindices, index_length );
+
+ /* realloc */
+ pscene = vg_linear_resize( lin_alloc, pscene, tot_size );
+
+ pscene->arrvertices = (mdl_vert *)(pscene+1);
+ pscene->arrindices = (u32 *)(pscene->arrvertices+vertex_count);
+ pscene->max_vertices = vertex_count;
+ pscene->max_indices = indice_count;
+
+ return pscene;