check for texture path existence on load

This commit is contained in:
ohsqueezy 2023-07-10 20:33:15 -04:00
parent 55d6e08480
commit cdd01672c3
1 changed files with 15 additions and 1 deletions

View File

@ -42,7 +42,21 @@ void Texture::load()
{
if (!path.empty())
{
load(path);
#if !defined(__ANDROID__)
/* Can't check for file existence in an Android APK */
if (fs::exists(path))
{
#endif
load(path);
#if !defined(__ANDROID__)
}
else
{
std::ostringstream message;
message << "Error loading texture path: " << path;
sb::Log::log(message, sb::Log::ERROR);
}
#endif
}
else
{