fixed messed up textures of the cluster
This commit is contained in:
parent
9abd285239
commit
60cc7bb562
@ -131,6 +131,8 @@ void Object::analyseMsh2Chunks(std::list<ChunkHeader*>& chunkList)
|
||||
std::list<ChunkHeader*> tempMatdChunks;
|
||||
loadChunks(tempMatdChunks, (*it)->position, (*it)->size);
|
||||
|
||||
vTextures.push_back("");
|
||||
|
||||
// analyse MATD subchunks
|
||||
analyseMatdChunks(tempMatdChunks);
|
||||
|
||||
@ -193,7 +195,7 @@ void Object::analyseMatdChunks(std::list<ChunkHeader*>& chunkList)
|
||||
char* buffer = new char[(*it)->size + 1];
|
||||
*buffer = { 0 };
|
||||
fsMesh.read(buffer, (*it)->size);
|
||||
vTextures.push_back(buffer);
|
||||
vTextures.back() = buffer;
|
||||
delete buffer;
|
||||
continue;
|
||||
}
|
||||
@ -389,6 +391,8 @@ void Object::analyseSegmChunks(Modl * dataDestination, std::list<ChunkHeader*>&
|
||||
/*if (!strcmp("NRML", (*it)->name))
|
||||
{
|
||||
fsMesh.seekg((*it)->position);
|
||||
std::uint32_t tempSize;
|
||||
fsMesh.read(reinterpret_cast<char*>(&tempSize), sizeof(tempSize));
|
||||
// List of normals
|
||||
// long int - 4 - number of normal vectores stored in this list
|
||||
// float[3][] - 12 each - UVW vector for each vertex
|
||||
|
@ -324,7 +324,7 @@ void OpenGLController::updateScene()
|
||||
{
|
||||
// give texture to the shader
|
||||
std::uint32_t tempTexIndex = segIt->textureIndex >= vTextures.size() ? vTextures.size() - 1 : segIt->textureIndex;
|
||||
|
||||
|
||||
glTexImage2D(
|
||||
GL_TEXTURE_2D,
|
||||
0,
|
||||
|
@ -17,7 +17,7 @@ int main(int argc, char** argv)
|
||||
else
|
||||
scene = OpenGLController::getInstance();
|
||||
|
||||
scene->loadMsh("..\\Release\\Msh\\cluster.msh");
|
||||
scene->loadMsh("..\\Release\\Msh\\quadPoly.msh");
|
||||
|
||||
do {
|
||||
scene->updateScene();
|
||||
|
BIN
Release/Msh/1.tga
Normal file
BIN
Release/Msh/1.tga
Normal file
Binary file not shown.
After Width: | Height: | Size: 48 KiB |
BIN
Release/Msh/2.tga
Normal file
BIN
Release/Msh/2.tga
Normal file
Binary file not shown.
After Width: | Height: | Size: 48 KiB |
BIN
Release/Msh/3.tga
Normal file
BIN
Release/Msh/3.tga
Normal file
Binary file not shown.
After Width: | Height: | Size: 48 KiB |
BIN
Release/Msh/4.tga
Normal file
BIN
Release/Msh/4.tga
Normal file
Binary file not shown.
After Width: | Height: | Size: 48 KiB |
BIN
Release/Msh/5.tga
Normal file
BIN
Release/Msh/5.tga
Normal file
Binary file not shown.
After Width: | Height: | Size: 48 KiB |
BIN
Release/Msh/6.tga
Normal file
BIN
Release/Msh/6.tga
Normal file
Binary file not shown.
After Width: | Height: | Size: 48 KiB |
BIN
Release/Msh/quadPoly.msh
Normal file
BIN
Release/Msh/quadPoly.msh
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user