don't copy the model list. It can be very big - using pointer now,

garbage is not from the texture or object changes
This commit is contained in:
Anakin
2016-11-25 16:14:33 +01:00
parent e1e8e165fe
commit 5c5b9ac2f1
4 changed files with 40 additions and 36 deletions

View File

@@ -10,6 +10,8 @@
Object::Object(const char* path)
{
vModls = new std::vector<Modl*>;
// open file
fsMesh.open(path, std::ios::in | std::ios::binary);
@@ -65,9 +67,6 @@ Object::~Object()
{
// clear texture list
vTextures.clear();
// clear Model list (don't delete the elements)
vModls.clear();
}
@@ -177,7 +176,7 @@ void Object::analyseMsh2Chunks(std::list<ChunkHeader*>& chunkList)
}
// save Model data
vModls.push_back(tempModl);
vModls->push_back(tempModl);
continue;
}
@@ -593,7 +592,7 @@ void Object::readUV(Segment* dataDestination, std::streampos position)
/////////////////////////////////////////////////////////////////////////
// public getter
std::vector<Modl*> Object::getModels() const
std::vector<Modl*>* Object::getModels() const
{
return vModls;
}