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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user