Fix material text icons with some techsets causing issues when rendering
This commit is contained in:
parent
4ab20ae8f5
commit
e84e0774a6
@ -161,7 +161,12 @@ namespace Components
|
|||||||
Materials::ImageNameLength = 4 + length;
|
Materials::ImageNameLength = 4 + length;
|
||||||
std::string image(imagePtr, length);
|
std::string image(imagePtr, length);
|
||||||
|
|
||||||
return Game::DB_FindXAssetHeader(Game::XAssetType::ASSET_TYPE_MATERIAL, image.data()).material;
|
auto* material = Game::DB_FindXAssetHeader(Game::XAssetType::ASSET_TYPE_MATERIAL, image.data()).material;
|
||||||
|
|
||||||
|
if(material == nullptr || material->techniqueSet == nullptr || material->techniqueSet->name == nullptr || strcmp(material->techniqueSet->name, "2d") != 0)
|
||||||
|
return Game::DB_FindXAssetHeader(Game::XAssetType::ASSET_TYPE_MATERIAL, "default").material;
|
||||||
|
|
||||||
|
return material;
|
||||||
}
|
}
|
||||||
|
|
||||||
Materials::ImageNameLength = 4;
|
Materials::ImageNameLength = 4;
|
||||||
|
Loading…
Reference in New Issue
Block a user