Add -alpha option. Get things ready for 2.0.8 revision.
This commit is contained in:
parent
20606def7c
commit
3fafa5f0a6
|
@ -532,7 +532,7 @@ DDSHeader::DDSHeader()
|
||||||
|
|
||||||
// Store version information on the reserved header attributes.
|
// Store version information on the reserved header attributes.
|
||||||
this->reserved[9] = MAKEFOURCC('N', 'V', 'T', 'T');
|
this->reserved[9] = MAKEFOURCC('N', 'V', 'T', 'T');
|
||||||
this->reserved[10] = (2 << 16) | (0 << 8) | (7); // major.minor.revision
|
this->reserved[10] = (2 << 16) | (0 << 8) | (8); // major.minor.revision
|
||||||
|
|
||||||
this->pf.size = 32;
|
this->pf.size = 32;
|
||||||
this->pf.flags = 0;
|
this->pf.flags = 0;
|
||||||
|
|
|
@ -134,6 +134,7 @@ int main(int argc, char *argv[])
|
||||||
MyAssertHandler assertHandler;
|
MyAssertHandler assertHandler;
|
||||||
MyMessageHandler messageHandler;
|
MyMessageHandler messageHandler;
|
||||||
|
|
||||||
|
bool alpha = false;
|
||||||
bool normal = false;
|
bool normal = false;
|
||||||
bool color2normal = false;
|
bool color2normal = false;
|
||||||
bool wrapRepeat = false;
|
bool wrapRepeat = false;
|
||||||
|
@ -157,6 +158,10 @@ int main(int argc, char *argv[])
|
||||||
if (strcmp("-color", argv[i]) == 0)
|
if (strcmp("-color", argv[i]) == 0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
else if (strcmp("-alpha", argv[i]) == 0)
|
||||||
|
{
|
||||||
|
alpha = true;
|
||||||
|
}
|
||||||
else if (strcmp("-normal", argv[i]) == 0)
|
else if (strcmp("-normal", argv[i]) == 0)
|
||||||
{
|
{
|
||||||
normal = true;
|
normal = true;
|
||||||
|
@ -270,6 +275,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
printf("Input options:\n");
|
printf("Input options:\n");
|
||||||
printf(" -color \tThe input image is a color map (default).\n");
|
printf(" -color \tThe input image is a color map (default).\n");
|
||||||
|
printf(" -alpha \tThe input image has an alpha channel used for transparency.\n");
|
||||||
printf(" -normal \tThe input image is a normal map.\n");
|
printf(" -normal \tThe input image is a normal map.\n");
|
||||||
printf(" -tonormal\tConvert input to normal map.\n");
|
printf(" -tonormal\tConvert input to normal map.\n");
|
||||||
printf(" -clamp \tClamp wrapping mode (default).\n");
|
printf(" -clamp \tClamp wrapping mode (default).\n");
|
||||||
|
@ -363,6 +369,15 @@ int main(int argc, char *argv[])
|
||||||
inputOptions.setWrapMode(nvtt::WrapMode_Clamp);
|
inputOptions.setWrapMode(nvtt::WrapMode_Clamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (alpha)
|
||||||
|
{
|
||||||
|
inputOptions.setAlphaMode(nvtt::AlphaMode_Transparency);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
inputOptions.setAlphaMode(nvtt::AlphaMode_None);
|
||||||
|
}
|
||||||
|
|
||||||
if (normal)
|
if (normal)
|
||||||
{
|
{
|
||||||
setNormalMap(inputOptions);
|
setNormalMap(inputOptions);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user