- if(ind.empty())
- return;
-
- if(data.empty())
- min_index = max_index = ind.front();
-
- for(vector<unsigned>::const_iterator i=ind.begin(); i!=ind.end(); ++i)
- {
- min_index = min(min_index, *i);
- max_index = max(max_index, *i);
- }
-
- if((data_type==UNSIGNED_BYTE || data_type==UNSIGNED_SHORT) && max_index>0xFFFE)
- set_data_type(UNSIGNED_INT);
- else if(data_type==UNSIGNED_BYTE && max_index>0xFE)
- set_data_type(UNSIGNED_SHORT);
-
- unsigned base = data.size();
- data.resize(data.size()+ind.size()*get_index_size());
- if(data_type==UNSIGNED_SHORT)
- {
- unsigned short *ptr = reinterpret_cast<unsigned short *>(&data[base]);
- for(unsigned i=0; i<ind.size(); ++i)
- ptr[i] = ind[i];
- }
- else if(data_type==UNSIGNED_INT)
- {
- unsigned *ptr = reinterpret_cast<unsigned *>(&data[base]);
- for(unsigned i=0; i<ind.size(); ++i)
- ptr[i] = ind[i];
- }
+ if(other_type!=prim_type)
+ return false;
+ else if(prim_type==LINE_STRIP || prim_type==LINE_LOOP || prim_type==TRIANGLE_FAN)
+ return MSP_primitive_restart;