B3DImporter: Add unique_to_array helper function
parent
949375e695
commit
30ae14fae9
|
@ -267,6 +267,21 @@ T *B3DImporter::to_array( const vector<T> &v ){
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
template<class T>
|
||||||
|
T **unique_to_array( vector<std::unique_ptr<T> > &v ){
|
||||||
|
if( v.empty() ) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
T **p = new T*[ v.size() ];
|
||||||
|
for( size_t i = 0; i < v.size(); ++i ){
|
||||||
|
p[i] = v[i].release();
|
||||||
|
}
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void B3DImporter::ReadTEXS(){
|
void B3DImporter::ReadTEXS(){
|
||||||
while( ChunkSize() ){
|
while( ChunkSize() ){
|
||||||
|
|
Loading…
Reference in New Issue