Update ModelLoader.cpp
parent
4456b7ca82
commit
db4b959868
|
@ -102,7 +102,7 @@ vector<Texture> ModelLoader::loadMaterialTextures(aiMaterial * mat, aiTextureTyp
|
||||||
bool skip = false;
|
bool skip = false;
|
||||||
for (UINT j = 0; j < textures_loaded.size(); j++)
|
for (UINT j = 0; j < textures_loaded.size(); j++)
|
||||||
{
|
{
|
||||||
if (std::strcmp(textures_loaded[j].path.C_Str(), str.C_Str()) == 0)
|
if (std::strcmp(textures_loaded[j].path.c_str(), str.C_Str()) == 0)
|
||||||
{
|
{
|
||||||
textures.push_back(textures_loaded[j]);
|
textures.push_back(textures_loaded[j]);
|
||||||
skip = true; // A texture with the same filepath has already been loaded, continue to next one. (optimization)
|
skip = true; // A texture with the same filepath has already been loaded, continue to next one. (optimization)
|
||||||
|
@ -128,7 +128,7 @@ vector<Texture> ModelLoader::loadMaterialTextures(aiMaterial * mat, aiTextureTyp
|
||||||
MessageBox(hwnd, "Texture couldn't be loaded", "Error!", MB_ICONERROR | MB_OK);
|
MessageBox(hwnd, "Texture couldn't be loaded", "Error!", MB_ICONERROR | MB_OK);
|
||||||
}
|
}
|
||||||
texture.type = typeName;
|
texture.type = typeName;
|
||||||
texture.path = str;
|
texture.path = str.C_Str();
|
||||||
textures.push_back(texture);
|
textures.push_back(texture);
|
||||||
this->textures_loaded.push_back(texture); // Store it as texture loaded for entire model, to ensure we won't unnecesery load duplicate textures.
|
this->textures_loaded.push_back(texture); // Store it as texture loaded for entire model, to ensure we won't unnecesery load duplicate textures.
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue