Fix a couple of errors.
Disable cone mapping, it is not ready yet.
This commit is contained in:
parent
0008199435
commit
d1d71dd2b3
@ -307,7 +307,7 @@ namespace nv
|
||||
s << header.caps;
|
||||
s << header.notused;
|
||||
|
||||
if (header.pf.flags == 0)
|
||||
if (header.hasDX10Header())
|
||||
{
|
||||
s << header.header10;
|
||||
}
|
||||
@ -586,6 +586,11 @@ void DDSHeader::swapBytes()
|
||||
this->header10.reserved = POSH_LittleU32(this->header10.reserved);
|
||||
}
|
||||
|
||||
bool DDSHeader::hasDX10Header() const
|
||||
{
|
||||
return this->pf.flags == 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
DirectDrawSurface::DirectDrawSurface(const char * name) : stream(new StdInputStream(name))
|
||||
|
@ -99,6 +99,7 @@ namespace nv
|
||||
|
||||
void swapBytes();
|
||||
|
||||
bool hasDX10Header() const;
|
||||
};
|
||||
|
||||
|
||||
|
@ -68,8 +68,11 @@ namespace nvtt
|
||||
bool normalMap;
|
||||
bool normalizeMipmaps;
|
||||
bool convertToNormalMap;
|
||||
nv::Vector4 heightFactors;
|
||||
nv::Vector4 heightFactors; // Used for cone mapping too.
|
||||
nv::Vector4 bumpFrequencyScale;
|
||||
|
||||
// Cone map options.
|
||||
bool convertToConeMap;
|
||||
};
|
||||
|
||||
// Internal image structure.
|
||||
|
@ -159,8 +159,15 @@ static void outputHeader(const InputOptions::Private & inputOptions, const Outpu
|
||||
// Swap bytes if necessary.
|
||||
header.swapBytes();
|
||||
|
||||
nvStaticCheck(sizeof(DDSHeader) == 128);
|
||||
outputOptions.outputHandler->writeData(&header, 128);
|
||||
nvStaticCheck(sizeof(DDSHeader) == 128 + 20);
|
||||
if (header.hasDX10Header())
|
||||
{
|
||||
outputOptions.outputHandler->writeData(&header, 128 + 20);
|
||||
}
|
||||
else
|
||||
{
|
||||
outputOptions.outputHandler->writeData(&header, 128);
|
||||
}
|
||||
|
||||
// Revert swap.
|
||||
header.swapBytes();
|
||||
@ -416,6 +423,10 @@ bool nvtt::compress(const InputOptions & inputOptions, const OutputOptions & out
|
||||
{
|
||||
floatImage = createNormalMap(mipmap.data.ptr(), (FloatImage::WrapMode)inputOptions.m.wrapMode, inputOptions.m.heightFactors, inputOptions.m.bumpFrequencyScale);
|
||||
}
|
||||
/*else if (inputOptions.m.convertToConeMap)
|
||||
{
|
||||
floatImage = createConeMap(mipmap.data, inputOptions.m.heightFactors);
|
||||
}*/
|
||||
else
|
||||
{
|
||||
lastImage = img = mipmap.data.ptr();
|
||||
@ -512,9 +523,8 @@ const char * nvtt::errorString(Error e)
|
||||
case Error_CudaError:
|
||||
return "CUDA error";
|
||||
case Error_Unknown:
|
||||
default:
|
||||
return "Unknown error";
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user