fixed crash problem
This commit is contained in:
parent
c0a84c7513
commit
be97fa8e6f
|
@ -61,7 +61,7 @@ private:
|
|||
void setModlDefault(Modl* model);
|
||||
void loadChunks(std::list<ChunkHeader*> &destination, std::streampos start, const std::uint32_t end);
|
||||
void analyseMsh2Chunks(std::list<ChunkHeader*> &chunkList);
|
||||
void analyseMatdChunks(Modl* dataDestination, std::list<ChunkHeader*> &chunkList);
|
||||
void analyseMatdChunks(std::list<ChunkHeader*> &chunkList);
|
||||
void analyseModlChunks(Modl* dataDestination, std::list<ChunkHeader*> &chunkList);
|
||||
void analyseGeomChunks(Modl* dataDestination, std::list<ChunkHeader*> &chunkList);
|
||||
void analyseSegmChunks(Modl* dataDestination, std::list<ChunkHeader*> &chunkList);
|
||||
|
|
|
@ -133,9 +133,6 @@ void Object::analyseMsh2Chunks(std::list<ChunkHeader*>& chunkList)
|
|||
{
|
||||
for (std::list<ChunkHeader*>::iterator it = chunkList.begin(); it != chunkList.end(); it++)
|
||||
{
|
||||
Modl* tempModl = new Modl;
|
||||
setModlDefault(tempModl);
|
||||
|
||||
if (!strcmp("MATL", (*it)->name))
|
||||
{
|
||||
// get all MATD from MATL list
|
||||
|
@ -153,7 +150,7 @@ void Object::analyseMsh2Chunks(std::list<ChunkHeader*>& chunkList)
|
|||
loadChunks(tempMatdChunks, (*it)->position, (*it)->size);
|
||||
|
||||
// analyse MATD subchunks
|
||||
analyseMatdChunks(tempModl, tempMatdChunks);
|
||||
analyseMatdChunks(tempMatdChunks);
|
||||
|
||||
// clean up
|
||||
while (!tempMatdChunks.empty())
|
||||
|
@ -178,6 +175,10 @@ void Object::analyseMsh2Chunks(std::list<ChunkHeader*>& chunkList)
|
|||
|
||||
if (!strcmp("MODL", (*it)->name))
|
||||
{
|
||||
|
||||
Modl* tempModl = new Modl;
|
||||
setModlDefault(tempModl);
|
||||
|
||||
// get all subchunks
|
||||
std::list<ChunkHeader*> tempChunks;
|
||||
loadChunks(tempChunks, (*it)->position, (*it)->size);
|
||||
|
@ -193,15 +194,15 @@ void Object::analyseMsh2Chunks(std::list<ChunkHeader*>& chunkList)
|
|||
delete tempCursor;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// save Model data
|
||||
lModls.push_back(tempModl);
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Object::analyseMatdChunks(Modl * dataDestination, std::list<ChunkHeader*>& chunkList)
|
||||
void Object::analyseMatdChunks(std::list<ChunkHeader*>& chunkList)
|
||||
{
|
||||
for (std::list<ChunkHeader*>::iterator it = chunkList.begin(); it != chunkList.end(); it++)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue