change signature

This commit is contained in:
ohyzha
2024-10-07 17:46:34 +03:00
parent a4e716006a
commit aaa8974006
6 changed files with 21 additions and 14 deletions

View File

@@ -61,9 +61,15 @@ namespace OpenVulkano::Image
return std::make_unique<Image>(std::move(result));
}
bool IImageLoader::GetDimensionsInternal(const std::string& filename, int& width, int& height)
Math::Vector2i IImageLoader::GetDimensionsInternal(const std::string& filename)
{
Math::Vector2i res = {};
int channels;
return stbi_info(filename.c_str(), &width, &height, &channels);
if (!stbi_info(filename.c_str(), &res.x, &res.y, &channels))
{
Logger::FILESYS->error("Failed to read image header of file {}", filename);
return Math::Vector2i{ -1, -1 };
}
return res;
}
}