mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-05-25 02:51:43 +00:00
fix: do not dump iwis with format unknown
This commit is contained in:
@@ -65,10 +65,10 @@ namespace image
|
||||
{
|
||||
switch (ObjWriting::Configuration.ImageOutputFormat)
|
||||
{
|
||||
case ObjWriting::Configuration_t::ImageOutputFormat_e::DDS:
|
||||
case ImageOutputFormat_e::DDS:
|
||||
m_writer = std::make_unique<DdsWriter>();
|
||||
break;
|
||||
case ObjWriting::Configuration_t::ImageOutputFormat_e::IWI:
|
||||
case ImageOutputFormat_e::IWI:
|
||||
m_writer = std::make_unique<iwi8::IwiWriter>();
|
||||
break;
|
||||
default:
|
||||
@@ -85,6 +85,15 @@ namespace image
|
||||
if (!texture)
|
||||
return;
|
||||
|
||||
if (!m_writer->SupportsImageFormat(texture->GetFormat()))
|
||||
{
|
||||
con::warn("Not dumping image {} as {} does not support the image format {}",
|
||||
image->name,
|
||||
GetImageOutputFormatName(ObjWriting::Configuration.ImageOutputFormat),
|
||||
GetImageFormatName(texture->GetFormat()->GetId()));
|
||||
return;
|
||||
}
|
||||
|
||||
const auto assetFile = context.OpenAssetFile(GetFileNameForAsset(asset.m_name, m_writer->GetFileExtension()));
|
||||
|
||||
if (!assetFile)
|
||||
|
||||
Reference in New Issue
Block a user