if else shortcut

This commit is contained in:
ohyzha
2024-08-13 12:04:53 +03:00
parent dba13b754d
commit 55ebb9f630

View File

@@ -129,15 +129,8 @@ namespace OpenVulkano::Scene
uint32_t packedFlag = packIntoSingleFile;
if (packIntoSingleFile)
{
bool isPng = std::filesystem::path(fileName).extension() == ".png";
if (!isPng)
{
fileName += "_packed.png";
}
else
{
fileName.insert(fileName.size() - 4, "_packed");
}
std::filesystem::path fPath(fileName);
fileName = (fPath.parent_path() / fPath.stem()).string() + "_packed.png";
SavePng(fileName);
}
std::fstream fs(fileName.c_str(), std::ios_base::out | std::ios_base::binary | (packedFlag ? std::ios_base::app : std::ios_base::trunc));