Add option to use dds10 headers.
This commit is contained in:
parent
b1cd916105
commit
c2508d9eeb
|
@ -33,9 +33,6 @@
|
||||||
|
|
||||||
#include <time.h> // clock
|
#include <time.h> // clock
|
||||||
|
|
||||||
//#define WINDOWS_LEAN_AND_MEAN
|
|
||||||
//#include <windows.h> // TIMER
|
|
||||||
|
|
||||||
|
|
||||||
struct MyOutputHandler : public nvtt::OutputHandler
|
struct MyOutputHandler : public nvtt::OutputHandler
|
||||||
{
|
{
|
||||||
|
@ -87,7 +84,10 @@ struct MyErrorHandler : public nvtt::ErrorHandler
|
||||||
{
|
{
|
||||||
virtual void error(nvtt::Error e)
|
virtual void error(nvtt::Error e)
|
||||||
{
|
{
|
||||||
|
#if _DEBUG
|
||||||
nvDebugBreak();
|
nvDebugBreak();
|
||||||
|
#endif
|
||||||
|
printf("Error: '%s'\n", nvtt::errorString(e));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -137,7 +137,6 @@ int main(int argc, char *argv[])
|
||||||
bool noMipmaps = false;
|
bool noMipmaps = false;
|
||||||
bool fast = false;
|
bool fast = false;
|
||||||
bool nocuda = false;
|
bool nocuda = false;
|
||||||
bool silent = false;
|
|
||||||
bool bc1n = false;
|
bool bc1n = false;
|
||||||
nvtt::Format format = nvtt::Format_BC1;
|
nvtt::Format format = nvtt::Format_BC1;
|
||||||
bool premultiplyAlpha = false;
|
bool premultiplyAlpha = false;
|
||||||
|
@ -145,6 +144,9 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
const char * externalCompressor = NULL;
|
const char * externalCompressor = NULL;
|
||||||
|
|
||||||
|
bool silent = false;
|
||||||
|
bool dds10 = false;
|
||||||
|
|
||||||
nv::Path input;
|
nv::Path input;
|
||||||
nv::Path output;
|
nv::Path output;
|
||||||
|
|
||||||
|
@ -245,11 +247,15 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Misc options
|
// Output options
|
||||||
else if (strcmp("-silent", argv[i]) == 0)
|
else if (strcmp("-silent", argv[i]) == 0)
|
||||||
{
|
{
|
||||||
silent = true;
|
silent = true;
|
||||||
}
|
}
|
||||||
|
else if (strcmp("-dds10", argv[i]) == 0)
|
||||||
|
{
|
||||||
|
dds10 = true;
|
||||||
|
}
|
||||||
|
|
||||||
else if (argv[i][0] != '-')
|
else if (argv[i][0] != '-')
|
||||||
{
|
{
|
||||||
|
@ -303,6 +309,10 @@ int main(int argc, char *argv[])
|
||||||
printf(" -bc4 \tBC4 format (ATI1)\n");
|
printf(" -bc4 \tBC4 format (ATI1)\n");
|
||||||
printf(" -bc5 \tBC5 format (3Dc/ATI2)\n\n");
|
printf(" -bc5 \tBC5 format (3Dc/ATI2)\n\n");
|
||||||
|
|
||||||
|
printf("Output options:\n");
|
||||||
|
printf(" -silent \tDo not output progress messages\n");
|
||||||
|
printf(" -dds10 \tUse DirectX 10 DDS format\n\n");
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -446,30 +456,25 @@ int main(int argc, char *argv[])
|
||||||
outputOptions.setOutputHandler(&outputHandler);
|
outputOptions.setOutputHandler(&outputHandler);
|
||||||
outputOptions.setErrorHandler(&errorHandler);
|
outputOptions.setErrorHandler(&errorHandler);
|
||||||
|
|
||||||
|
if (dds10)
|
||||||
|
{
|
||||||
|
outputOptions.setContainer(nvtt::Container_DDS10);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// printf("Press ENTER.\n");
|
// printf("Press ENTER.\n");
|
||||||
// fflush(stdout);
|
// fflush(stdout);
|
||||||
// getchar();
|
// getchar();
|
||||||
|
|
||||||
/* LARGE_INTEGER temp;
|
|
||||||
QueryPerformanceFrequency((LARGE_INTEGER*) &temp);
|
|
||||||
double freq = ((double) temp.QuadPart) / 1000.0;
|
|
||||||
|
|
||||||
LARGE_INTEGER start_time;
|
|
||||||
QueryPerformanceCounter((LARGE_INTEGER*) &start_time);
|
|
||||||
*/
|
|
||||||
clock_t start = clock();
|
clock_t start = clock();
|
||||||
|
|
||||||
compressor.process(inputOptions, compressionOptions, outputOptions);
|
bool success = compressor.process(inputOptions, compressionOptions, outputOptions);
|
||||||
/*
|
|
||||||
LARGE_INTEGER end_time;
|
|
||||||
QueryPerformanceCounter((LARGE_INTEGER*) &end_time);
|
|
||||||
|
|
||||||
float diff_time = (float) (((double) end_time.QuadPart - (double) start_time.QuadPart) / freq);
|
|
||||||
printf("\rtime taken: %.3f seconds\n", diff_time/1000);
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
if (success)
|
||||||
|
{
|
||||||
clock_t end = clock();
|
clock_t end = clock();
|
||||||
printf("\rtime taken: %.3f seconds\n", float(end-start) / CLOCKS_PER_SEC);
|
printf("\rtime taken: %.3f seconds\n", float(end-start) / CLOCKS_PER_SEC);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user