texture is now correctly detected and used,
there seams to be a problem with the UV. They are not correctly
This commit is contained in:
@@ -135,9 +135,14 @@ void Object::analyseMsh2Chunks(std::list<ChunkHeader*>& chunkList)
|
||||
{
|
||||
if (!strcmp("MATL", (*it)->name))
|
||||
{
|
||||
// "useless" information how many MATD follow
|
||||
fsMesh.seekg((*it)->position);
|
||||
std::uint32_t tempMatdCount;
|
||||
fsMesh.read(reinterpret_cast<char*>(&tempMatdCount), sizeof(std::uint32_t));
|
||||
|
||||
// get all MATD from MATL list
|
||||
std::list<ChunkHeader*> tempMatlChunks;
|
||||
loadChunks(tempMatlChunks, (*it)->position, (*it)->size);
|
||||
loadChunks(tempMatlChunks, fsMesh.tellg(), (*it)->size - 4);
|
||||
|
||||
// evaluate MATL subchunks
|
||||
for (std::list<ChunkHeader*>::iterator it = tempMatlChunks.begin(); it != tempMatlChunks.end(); it++)
|
||||
@@ -383,13 +388,13 @@ void Object::analyseSegmChunks(Modl * dataDestination, std::list<ChunkHeader*>&
|
||||
fsMesh.seekg((*it)->position);
|
||||
std::uint32_t tempIndex;
|
||||
fsMesh.read(reinterpret_cast<char*>(&tempIndex), sizeof(tempIndex));
|
||||
if (vTextures.size() < tempIndex - 1)
|
||||
if (vTextures.size() <= tempIndex)
|
||||
{
|
||||
std::cout << "warning texture index <" << tempIndex << "> unknown" << std::endl;
|
||||
dataDestination->texture = "";
|
||||
continue;
|
||||
}
|
||||
dataDestination->texture = vTextures[tempIndex - 1];
|
||||
dataDestination->texture = vTextures[tempIndex];
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user