mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
Apply suggestions from code review
This commit is contained in:
parent
e325902bac
commit
63b2aba467
|
|
@ -186,10 +186,11 @@ GFXD3D11StateBlock::GFXD3D11StateBlock(const GFXStateBlockDesc& desc)
|
|||
else
|
||||
mSamplerDesc[i].Filter = comparison ? D3D11_FILTER_COMPARISON_ANISOTROPIC : D3D11_FILTER_ANISOTROPIC;
|
||||
|
||||
mSamplerDesc[i].BorderColor[0] = gfxSamplerState.borderColor.red;
|
||||
mSamplerDesc[i].BorderColor[1] = gfxSamplerState.borderColor.green;
|
||||
mSamplerDesc[i].BorderColor[2] = gfxSamplerState.borderColor.blue;
|
||||
mSamplerDesc[i].BorderColor[3] = gfxSamplerState.borderColor.alpha;
|
||||
LinearColorF bc = LinearColorF(gfxSamplerState.borderColor);
|
||||
mSamplerDesc[i].BorderColor[0] = bc.red;
|
||||
mSamplerDesc[i].BorderColor[1] = bc.green;
|
||||
mSamplerDesc[i].BorderColor[2] = bc.blue;
|
||||
mSamplerDesc[i].BorderColor[3] = bc.alpha;
|
||||
mSamplerDesc[i].ComparisonFunc = GFXD3D11CmpFunc[gfxSamplerState.samplerFunc];
|
||||
|
||||
hr = D3D11DEVICE->CreateSamplerState(&mSamplerDesc[i], &mSamplerStates[i]);
|
||||
|
|
|
|||
|
|
@ -278,7 +278,7 @@ GFXSamplerStateDesc::GFXSamplerStateDesc()
|
|||
samplerFunc = GFXCmpNever;
|
||||
maxAnisotropy = 1;
|
||||
mipLODBias = 0.0f;
|
||||
borderColor = LinearColorF::WHITE;
|
||||
borderColor = ColorI::WHITE;
|
||||
}
|
||||
|
||||
GFXSamplerStateDesc GFXSamplerStateDesc::getWrapLinear()
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ struct GFXSamplerStateDesc
|
|||
|
||||
GFXCmpFunc samplerFunc;
|
||||
|
||||
LinearColorF borderColor;
|
||||
ColorI borderColor;
|
||||
|
||||
/// The maximum anisotropy used when one of the filter types
|
||||
/// is set to anisotropic.
|
||||
|
|
|
|||
|
|
@ -220,7 +220,9 @@ void GFXGLTextureObject::initSamplerState(const GFXSamplerStateDesc &ssd)
|
|||
if(static_cast< GFXGLDevice* >( GFX )->supportsAnisotropic() )
|
||||
glTexParameterf(mBinding, GL_TEXTURE_MAX_ANISOTROPY_EXT, ssd.maxAnisotropy);
|
||||
|
||||
glTexParameterfv(mBinding, GL_TEXTURE_BORDER_COLOR, ssd.borderColor);
|
||||
LinearColorF bc = LinearColorF(ssd.borderColor);
|
||||
GLfloat color[4]={bc.red, bc.green, bc.blue, bc.alpha};
|
||||
glTexParameterfv(mBinding, GL_TEXTURE_BORDER_COLOR, color);
|
||||
mNeedInitSamplerState = false;
|
||||
mSampler = ssd;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -315,7 +315,7 @@ void GFXSamplerStateData::initPersistFields()
|
|||
|
||||
endGroup( "Filter State" );
|
||||
|
||||
addField("borderColor", TypeColorF, Offset(mState.borderColor, GFXSamplerStateData), "");
|
||||
addField("borderColor", TypeColorI, Offset(mState.borderColor, GFXSamplerStateData), "");
|
||||
|
||||
addField("samplerFunc", TypeGFXCmpFunc, Offset(mState.samplerFunc, GFXSamplerStateData),
|
||||
"Compares sampled data against existing sampled data. The default is GFXCmpNever.");
|
||||
|
|
|
|||
Loading…
Reference in a new issue