Skip to content

Commit

Permalink
Autoformat xrRenderGL via ReSharper
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Jan 29, 2018
1 parent 04489f4 commit e50333c
Show file tree
Hide file tree
Showing 94 changed files with 15,955 additions and 14,792 deletions.
95 changes: 49 additions & 46 deletions src/Layers/xrRenderGL/Blender_Recorder_GL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,74 +10,77 @@ void fix_texture_name(LPSTR fn);

void CBlender_Compile::r_Stencil(BOOL Enable, u32 Func, u32 Mask, u32 WriteMask, u32 Fail, u32 Pass, u32 ZFail)
{
RS.SetRS( D3DRS_STENCILENABLE, BC(Enable) );
if (!Enable) return;
RS.SetRS( D3DRS_STENCILFUNC, Func);
RS.SetRS( D3DRS_STENCILMASK, Mask);
RS.SetRS( D3DRS_STENCILWRITEMASK, WriteMask);
RS.SetRS( D3DRS_STENCILFAIL, Fail);
RS.SetRS( D3DRS_STENCILPASS, Pass);
RS.SetRS( D3DRS_STENCILZFAIL, ZFail);
RS.SetRS(D3DRS_STENCILENABLE, BC(Enable));
if (!Enable) return;
RS.SetRS(D3DRS_STENCILFUNC, Func);
RS.SetRS(D3DRS_STENCILMASK, Mask);
RS.SetRS(D3DRS_STENCILWRITEMASK, WriteMask);
RS.SetRS(D3DRS_STENCILFAIL, Fail);
RS.SetRS(D3DRS_STENCILPASS, Pass);
RS.SetRS(D3DRS_STENCILZFAIL, ZFail);
}

void CBlender_Compile::r_StencilRef(u32 Ref)
{
RS.SetRS( D3DRS_STENCILREF, Ref);
RS.SetRS(D3DRS_STENCILREF, Ref);
}

void CBlender_Compile::r_CullMode(D3DCULL Mode)
{
RS.SetRS( D3DRS_CULLMODE, (u32)Mode);
RS.SetRS(D3DRS_CULLMODE, (u32)Mode);
}

void CBlender_Compile::i_Comparison(u32 s, u32 func)
void CBlender_Compile::i_Comparison(u32 s, u32 func)
{
RS.SetSAMP(s, XRDX10SAMP_COMPARISONFILTER, TRUE);
RS.SetSAMP(s, XRDX10SAMP_COMPARISONFUNC, func);
RS.SetSAMP(s, XRDX10SAMP_COMPARISONFILTER, TRUE);
RS.SetSAMP(s, XRDX10SAMP_COMPARISONFUNC, func);
}

void CBlender_Compile::r_Sampler_cmp(LPCSTR name, LPCSTR texture, bool b_ps1x_ProjectiveDivide)
void CBlender_Compile::r_Sampler_cmp(LPCSTR name, LPCSTR texture, bool b_ps1x_ProjectiveDivide)
{
u32 s = r_Sampler(name, texture, b_ps1x_ProjectiveDivide, D3DTADDRESS_CLAMP, D3DTEXF_LINEAR, D3DTEXF_NONE, D3DTEXF_LINEAR);
if (u32(-1) != s)
{
RS.SetSAMP(s, XRDX10SAMP_COMPARISONFILTER, TRUE);
RS.SetSAMP(s, XRDX10SAMP_COMPARISONFUNC, (u32)D3D_COMPARISON_LESS_EQUAL);
}
u32 s = r_Sampler(name, texture, b_ps1x_ProjectiveDivide, D3DTADDRESS_CLAMP, D3DTEXF_LINEAR, D3DTEXF_NONE,
D3DTEXF_LINEAR);
if (u32(-1) != s)
{
RS.SetSAMP(s, XRDX10SAMP_COMPARISONFILTER, TRUE);
RS.SetSAMP(s, XRDX10SAMP_COMPARISONFUNC, (u32)D3D_COMPARISON_LESS_EQUAL);
}
}

void CBlender_Compile::r_Pass (LPCSTR _vs, LPCSTR _gs, LPCSTR _ps, bool bFog, BOOL bZtest, BOOL bZwrite, BOOL bABlend, D3DBLEND abSRC, D3DBLEND abDST, BOOL aTest, u32 aRef)
void CBlender_Compile::r_Pass(LPCSTR _vs, LPCSTR _gs, LPCSTR _ps, bool bFog, BOOL bZtest, BOOL bZwrite, BOOL bABlend,
D3DBLEND abSRC, D3DBLEND abDST, BOOL aTest, u32 aRef)
{
RS.Invalidate ();
ctable.clear ();
passTextures.clear ();
passMatrices.clear ();
passConstants.clear ();
dwStage = 0;
RS.Invalidate();
ctable.clear();
passTextures.clear();
passMatrices.clear();
passConstants.clear();
dwStage = 0;

// Setup FF-units (Z-buffer, blender)
PassSET_ZB (bZtest,bZwrite);
PassSET_Blend (bABlend,abSRC,abDST,aTest,aRef);
PassSET_LightFog (FALSE,bFog);
// Setup FF-units (Z-buffer, blender)
PassSET_ZB(bZtest, bZwrite);
PassSET_Blend(bABlend, abSRC, abDST, aTest, aRef);
PassSET_LightFog(FALSE, bFog);

// Create shaders
SPS* ps = RImplementation.Resources->_CreatePS(_ps);
SVS* vs = RImplementation.Resources->_CreateVS(_vs);
SGS* gs = RImplementation.Resources->_CreateGS(_gs);
dest.ps = ps;
dest.vs = vs;
dest.gs = gs;
// Create shaders
SPS* ps = RImplementation.Resources->_CreatePS(_ps);
SVS* vs = RImplementation.Resources->_CreateVS(_vs);
SGS* gs = RImplementation.Resources->_CreateGS(_gs);
dest.ps = ps;
dest.vs = vs;
dest.gs = gs;
#ifdef USE_DX11
dest.hs = RImplementation.Resources->_CreateHS("null");
dest.ds = RImplementation.Resources->_CreateDS("null");
#endif
ctable.merge (&ps->constants);
ctable.merge (&vs->constants);
ctable.merge (&gs->constants);
ctable.merge(&ps->constants);
ctable.merge(&vs->constants);
ctable.merge(&gs->constants);

// Last Stage - disable
if (0==xr_stricmp(_ps,"null")) {
RS.SetTSS (0,D3DTSS_COLOROP,D3DTOP_DISABLE);
RS.SetTSS (0,D3DTSS_ALPHAOP,D3DTOP_DISABLE);
}
// Last Stage - disable
if (0 == xr_stricmp(_ps, "null"))
{
RS.SetTSS(0, D3DTSS_COLOROP, D3DTOP_DISABLE);
RS.SetTSS(0, D3DTSS_ALPHAOP, D3DTOP_DISABLE);
}
}
Loading

0 comments on commit e50333c

Please sign in to comment.