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.caps;
|
||||||
s << header.notused;
|
s << header.notused;
|
||||||
|
|
||||||
if (header.pf.flags == 0)
|
if (header.hasDX10Header())
|
||||||
{
|
{
|
||||||
s << header.header10;
|
s << header.header10;
|
||||||
}
|
}
|
||||||
@ -586,6 +586,11 @@ void DDSHeader::swapBytes()
|
|||||||
this->header10.reserved = POSH_LittleU32(this->header10.reserved);
|
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))
|
DirectDrawSurface::DirectDrawSurface(const char * name) : stream(new StdInputStream(name))
|
||||||
|
@ -99,6 +99,7 @@ namespace nv
|
|||||||
|
|
||||||
void swapBytes();
|
void swapBytes();
|
||||||
|
|
||||||
|
bool hasDX10Header() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -68,8 +68,11 @@ namespace nvtt
|
|||||||
bool normalMap;
|
bool normalMap;
|
||||||
bool normalizeMipmaps;
|
bool normalizeMipmaps;
|
||||||
bool convertToNormalMap;
|
bool convertToNormalMap;
|
||||||
nv::Vector4 heightFactors;
|
nv::Vector4 heightFactors; // Used for cone mapping too.
|
||||||
nv::Vector4 bumpFrequencyScale;
|
nv::Vector4 bumpFrequencyScale;
|
||||||
|
|
||||||
|
// Cone map options.
|
||||||
|
bool convertToConeMap;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Internal image structure.
|
// Internal image structure.
|
||||||
|
@ -159,8 +159,15 @@ static void outputHeader(const InputOptions::Private & inputOptions, const Outpu
|
|||||||
// Swap bytes if necessary.
|
// Swap bytes if necessary.
|
||||||
header.swapBytes();
|
header.swapBytes();
|
||||||
|
|
||||||
nvStaticCheck(sizeof(DDSHeader) == 128);
|
nvStaticCheck(sizeof(DDSHeader) == 128 + 20);
|
||||||
outputOptions.outputHandler->writeData(&header, 128);
|
if (header.hasDX10Header())
|
||||||
|
{
|
||||||
|
outputOptions.outputHandler->writeData(&header, 128 + 20);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
outputOptions.outputHandler->writeData(&header, 128);
|
||||||
|
}
|
||||||
|
|
||||||
// Revert swap.
|
// Revert swap.
|
||||||
header.swapBytes();
|
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);
|
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
|
else
|
||||||
{
|
{
|
||||||
lastImage = img = mipmap.data.ptr();
|
lastImage = img = mipmap.data.ptr();
|
||||||
@ -512,9 +523,8 @@ const char * nvtt::errorString(Error e)
|
|||||||
case Error_CudaError:
|
case Error_CudaError:
|
||||||
return "CUDA error";
|
return "CUDA error";
|
||||||
case Error_Unknown:
|
case Error_Unknown:
|
||||||
|
default:
|
||||||
return "Unknown error";
|
return "Unknown error";
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user