Jump to content

[SOLVED] Speed-up ObjectWaterMesh loading


photo

Recommended Posts

Increase number of memory reserved in a stack when loading ObjectWaterMesh

 

 int ObjectWaterMesh::loadWorld(const Xml *xml) {

...

 

  // vertices
  if(xml->isChild("vertex")) {
   const Xml *x = xml->getChild("vertex");
   int num_vertex = x->getIntArg("num_vertex");

         //> SVA
         //VectorStack<float> data(num_vertex * 14);
   VectorStack<float, 1024> data(num_vertex * 14);
         //< SVA

 

 

 

Link to comment

Same with indices

 

if(xml->isChild("indices")) {

const Xml *x = xml->getChild("indices");

int num_indices = x->getIntArg("num_indices");

mesh_ptr->setIndicesArray(NULL,num_indices);

unsigned short *indices = mesh_ptr->getIndices();

//VectorStack<int> data(num_indices);

VectorStack<int, 1024> data(num_indices);

Link to comment
  • 1 month later...
×
×
  • Create New...