if else shortcut
This commit is contained in:
@@ -129,15 +129,8 @@ namespace OpenVulkano::Scene
|
|||||||
uint32_t packedFlag = packIntoSingleFile;
|
uint32_t packedFlag = packIntoSingleFile;
|
||||||
if (packIntoSingleFile)
|
if (packIntoSingleFile)
|
||||||
{
|
{
|
||||||
bool isPng = std::filesystem::path(fileName).extension() == ".png";
|
std::filesystem::path fPath(fileName);
|
||||||
if (!isPng)
|
fileName = (fPath.parent_path() / fPath.stem()).string() + "_packed.png";
|
||||||
{
|
|
||||||
fileName += "_packed.png";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fileName.insert(fileName.size() - 4, "_packed");
|
|
||||||
}
|
|
||||||
SavePng(fileName);
|
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));
|
std::fstream fs(fileName.c_str(), std::ios_base::out | std::ios_base::binary | (packedFlag ? std::ios_base::app : std::ios_base::trunc));
|
||||||
|
|||||||
Reference in New Issue
Block a user