IO::print("%s %sindices[] =\n{", type[0], prefix);
for(list<GL::Batch>::const_iterator i=mesh.get_batches().begin(); i!=mesh.get_batches().end(); ++i)
{
- const vector<unsigned> &indices = i->get_indices();
- for(unsigned j=0; j<indices.size(); ++j)
+ unsigned count = i->size();
+ for(unsigned j=0; j<count; ++j)
{
if(j%16==0)
IO::print("\n\t");
- IO::print("%d, ", indices[j]);
+ IO::print("%d, ", i->get_index(j));
}
}
IO::print("\n};\n\n");
case GL_TRIANGLES: mode = "GL_TRIANGLES"; break;
default: mode = format("%d", i->get_type()); break;
}
- IO::print("\tglDrawElements(%s, %d, %s, %sindices+%d);\n", mode, i->get_indices().size(), type[1], prefix, offset);
- offset += i->get_indices().size();
+ IO::print("\tglDrawElements(%s, %d, %s, %sindices+%d);\n", mode, i->size(), type[1], prefix, offset);
+ offset += i->size();
}
if(render_func)
{