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