Add option to control prefered swizzle.
This commit is contained in:
parent
923b57db45
commit
fa03dfc291
@ -45,6 +45,7 @@ int main(int argc, char *argv[])
|
|||||||
bool assembleCubeMap = true;
|
bool assembleCubeMap = true;
|
||||||
bool assembleVolume = false;
|
bool assembleVolume = false;
|
||||||
bool assembleTextureArray = false;
|
bool assembleTextureArray = false;
|
||||||
|
bool bgra = false;
|
||||||
|
|
||||||
nv::Array<nv::Path> files;
|
nv::Array<nv::Path> files;
|
||||||
nv::Path output = "output.dds";
|
nv::Path output = "output.dds";
|
||||||
@ -79,6 +80,10 @@ int main(int argc, char *argv[])
|
|||||||
output = argv[i];
|
output = argv[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (strcmp("-bgra", argv[i]) == 0)
|
||||||
|
{
|
||||||
|
bgra = true;
|
||||||
|
}
|
||||||
else if (argv[i][0] != '-')
|
else if (argv[i][0] != '-')
|
||||||
{
|
{
|
||||||
files.append(argv[i]);
|
files.append(argv[i]);
|
||||||
@ -170,9 +175,19 @@ int main(int argc, char *argv[])
|
|||||||
// @@ It always outputs 32 bpp.
|
// @@ It always outputs 32 bpp.
|
||||||
if (!assembleTextureArray) {
|
if (!assembleTextureArray) {
|
||||||
header.setPitch(4 * w);
|
header.setPitch(4 * w);
|
||||||
header.setPixelFormat(32, 0xFF0000, 0xFF00, 0xFF, hasAlpha ? 0xFF000000 : 0);
|
if (bgra) {
|
||||||
|
header.setPixelFormat(32, 0xFF0000, 0xFF00, 0xFF, hasAlpha ? 0xFF000000 : 0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
header.setPixelFormat(32, 0xFF, 0xFF00, 0xFF0000, hasAlpha ? 0xFF000000 : 0);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
header.setDX10Format(hasAlpha ? nv::DXGI_FORMAT_B8G8R8A8_UNORM : nv::DXGI_FORMAT_B8G8R8X8_UNORM);
|
if (bgra) {
|
||||||
|
header.setDX10Format(hasAlpha ? nv::DXGI_FORMAT_B8G8R8A8_UNORM : nv::DXGI_FORMAT_B8G8R8X8_UNORM);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
header.setDX10Format(hasAlpha ? nv::DXGI_FORMAT_R8G8B8A8_UNORM : nv::DXGI_FORMAT_R8G8B8X8_UNORM);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stream << header;
|
stream << header;
|
||||||
|
Loading…
Reference in New Issue
Block a user