node = (struct ts_node*)cell->next;
cell->next = 0;
- if(j <= 0 || cell[-1].type == CELL_SOLID) {
+ if(i >= lvl->height - 1 || cell[lvl->width].type == CELL_SOLID) {
cell->wall[0] = TILE_STRAIGHT;
}
- if(i <= 0 || cell[-lvl->width].type == CELL_SOLID) {
+ if(j >= lvl->width - 1 || cell[1].type == CELL_SOLID) {
cell->wall[1] = TILE_STRAIGHT;
}
- if(j >= lvl->width - 1 || cell[1].type == CELL_SOLID) {
+ if(i <= 0 || cell[-lvl->width].type == CELL_SOLID) {
cell->wall[2] = TILE_STRAIGHT;
}
- if(i >= lvl->height - 1 || cell[lvl->width].type == CELL_SOLID) {
+ if(j <= 0 || cell[-1].type == CELL_SOLID) {
cell->wall[3] = TILE_STRAIGHT;
}
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;
vptr += m->num_verts;
if(iarr) {
- memcpy(iptr, m->iarr, m->num_idx * sizeof *iptr);
- iptr += m->num_idx;
+ for(j=0; j<m->num_idx; j++) {
+ *iptr++ = m->iarr[j] + idx0;
+ }
+ idx0 += m->num_idx;
}
}