X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=vrlugburz;a=blobdiff_plain;f=src%2Fmesh.c;h=9f208a44630f4d30133efac1d768d7b3a5ec11b1;hp=dbafcbdc9d006ffa8d775bd7e7d5b1b5b6abf4c5;hb=2562604c2c0de321b67317f315a52335a60b708f;hpb=8de1d701e4e9a45e7ed69ccf1fc298514fed5d8f diff --git a/src/mesh.c b/src/mesh.c index dbafcbd..9f208a4 100644 --- a/src/mesh.c +++ b/src/mesh.c @@ -302,7 +302,7 @@ static int update_mesh_vbo(struct mesh *m) static int update_meshgroup_vbo(struct meshgroup *mg) { - int i; + int i, j, idx0 = 0; struct vertex *varr, *vptr; unsigned int *iarr = 0, *iptr; struct mesh *m; @@ -337,8 +337,10 @@ static int update_meshgroup_vbo(struct meshgroup *mg) vptr += m->num_verts; if(iarr) { - memcpy(iptr, m->iarr, m->num_idx * sizeof *iptr); - iptr += m->num_idx; + for(j=0; jnum_idx; j++) { + *iptr++ = m->iarr[j] + idx0; + } + idx0 += m->num_idx; } }