mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-07-20 23:10:36 +00:00
fix: dds dumping for A8 textures (#888)
This commit is contained in:
@@ -93,14 +93,25 @@ namespace
|
|||||||
pf.dwABitMask = format->HasA() ? Mask1(format->m_a_size) << format->m_a_offset : 0;
|
pf.dwABitMask = format->HasA() ? Mask1(format->m_a_size) << format->m_a_offset : 0;
|
||||||
|
|
||||||
pf.dwFlags = 0;
|
pf.dwFlags = 0;
|
||||||
if (format->HasA())
|
|
||||||
|
const auto hasAnyColor = format->HasR() || format->HasG() || format->HasB();
|
||||||
|
const auto hasAlpha = format->HasA();
|
||||||
|
|
||||||
|
if (!hasAnyColor && hasAlpha)
|
||||||
|
{
|
||||||
|
pf.dwFlags |= DDPF_ALPHA;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (hasAlpha)
|
||||||
pf.dwFlags |= DDPF_ALPHAPIXELS;
|
pf.dwFlags |= DDPF_ALPHAPIXELS;
|
||||||
|
|
||||||
if (format->HasR() && !format->HasG() && !format->HasB())
|
if (format->HasR() && !format->HasG() && !format->HasB())
|
||||||
pf.dwFlags |= DDPF_LUMINANCE;
|
pf.dwFlags |= DDPF_LUMINANCE;
|
||||||
else
|
else if (hasAnyColor)
|
||||||
pf.dwFlags |= DDPF_RGB;
|
pf.dwFlags |= DDPF_RGB;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void PopulatePixelFormat(DDS_PIXELFORMAT& pf)
|
void PopulatePixelFormat(DDS_PIXELFORMAT& pf)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user