@@ -10,74 +10,77 @@ void fix_texture_name(LPSTR fn);
1010
1111void CBlender_Compile::r_Stencil (BOOL Enable, u32 Func, u32 Mask, u32 WriteMask, u32 Fail, u32 Pass, u32 ZFail)
1212{
13- RS.SetRS ( D3DRS_STENCILENABLE, BC (Enable) );
14- if (!Enable) return ;
15- RS.SetRS ( D3DRS_STENCILFUNC, Func);
16- RS.SetRS ( D3DRS_STENCILMASK, Mask);
17- RS.SetRS ( D3DRS_STENCILWRITEMASK, WriteMask);
18- RS.SetRS ( D3DRS_STENCILFAIL, Fail);
19- RS.SetRS ( D3DRS_STENCILPASS, Pass);
20- RS.SetRS ( D3DRS_STENCILZFAIL, ZFail);
13+ RS.SetRS (D3DRS_STENCILENABLE, BC (Enable));
14+ if (!Enable) return ;
15+ RS.SetRS (D3DRS_STENCILFUNC, Func);
16+ RS.SetRS (D3DRS_STENCILMASK, Mask);
17+ RS.SetRS (D3DRS_STENCILWRITEMASK, WriteMask);
18+ RS.SetRS (D3DRS_STENCILFAIL, Fail);
19+ RS.SetRS (D3DRS_STENCILPASS, Pass);
20+ RS.SetRS (D3DRS_STENCILZFAIL, ZFail);
2121}
2222
2323void CBlender_Compile::r_StencilRef (u32 Ref)
2424{
25- RS.SetRS ( D3DRS_STENCILREF, Ref);
25+ RS.SetRS (D3DRS_STENCILREF, Ref);
2626}
2727
2828void CBlender_Compile::r_CullMode (D3DCULL Mode)
2929{
30- RS.SetRS ( D3DRS_CULLMODE, (u32 )Mode);
30+ RS.SetRS (D3DRS_CULLMODE, (u32 )Mode);
3131}
3232
33- void CBlender_Compile::i_Comparison (u32 s, u32 func)
33+ void CBlender_Compile::i_Comparison (u32 s, u32 func)
3434{
35- RS.SetSAMP (s, XRDX10SAMP_COMPARISONFILTER, TRUE );
36- RS.SetSAMP (s, XRDX10SAMP_COMPARISONFUNC, func);
35+ RS.SetSAMP (s, XRDX10SAMP_COMPARISONFILTER, TRUE );
36+ RS.SetSAMP (s, XRDX10SAMP_COMPARISONFUNC, func);
3737}
3838
39- void CBlender_Compile::r_Sampler_cmp (LPCSTR name, LPCSTR texture, bool b_ps1x_ProjectiveDivide)
39+ void CBlender_Compile::r_Sampler_cmp (LPCSTR name, LPCSTR texture, bool b_ps1x_ProjectiveDivide)
4040{
41- u32 s = r_Sampler (name, texture, b_ps1x_ProjectiveDivide, D3DTADDRESS_CLAMP, D3DTEXF_LINEAR, D3DTEXF_NONE, D3DTEXF_LINEAR);
42- if (u32 (-1 ) != s)
43- {
44- RS.SetSAMP (s, XRDX10SAMP_COMPARISONFILTER, TRUE );
45- RS.SetSAMP (s, XRDX10SAMP_COMPARISONFUNC, (u32 )D3D_COMPARISON_LESS_EQUAL);
46- }
41+ u32 s = r_Sampler (name, texture, b_ps1x_ProjectiveDivide, D3DTADDRESS_CLAMP, D3DTEXF_LINEAR, D3DTEXF_NONE,
42+ D3DTEXF_LINEAR);
43+ if (u32 (-1 ) != s)
44+ {
45+ RS.SetSAMP (s, XRDX10SAMP_COMPARISONFILTER, TRUE );
46+ RS.SetSAMP (s, XRDX10SAMP_COMPARISONFUNC, (u32 )D3D_COMPARISON_LESS_EQUAL);
47+ }
4748}
4849
49- 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)
50+ void CBlender_Compile::r_Pass (LPCSTR _vs, LPCSTR _gs, LPCSTR _ps, bool bFog, BOOL bZtest, BOOL bZwrite, BOOL bABlend,
51+ D3DBLEND abSRC, D3DBLEND abDST, BOOL aTest, u32 aRef)
5052{
51- RS.Invalidate ();
52- ctable.clear ();
53- passTextures.clear ();
54- passMatrices.clear ();
55- passConstants.clear ();
56- dwStage = 0 ;
53+ RS.Invalidate ();
54+ ctable.clear ();
55+ passTextures.clear ();
56+ passMatrices.clear ();
57+ passConstants.clear ();
58+ dwStage = 0 ;
5759
58- // Setup FF-units (Z-buffer, blender)
59- PassSET_ZB (bZtest,bZwrite);
60- PassSET_Blend (bABlend,abSRC,abDST,aTest,aRef);
61- PassSET_LightFog (FALSE ,bFog);
60+ // Setup FF-units (Z-buffer, blender)
61+ PassSET_ZB (bZtest, bZwrite);
62+ PassSET_Blend (bABlend, abSRC, abDST, aTest, aRef);
63+ PassSET_LightFog (FALSE , bFog);
6264
63- // Create shaders
64- SPS* ps = RImplementation.Resources ->_CreatePS (_ps);
65- SVS* vs = RImplementation.Resources ->_CreateVS (_vs);
66- SGS* gs = RImplementation.Resources ->_CreateGS (_gs);
67- dest.ps = ps;
68- dest.vs = vs;
69- dest.gs = gs;
65+ // Create shaders
66+ SPS* ps = RImplementation.Resources ->_CreatePS (_ps);
67+ SVS* vs = RImplementation.Resources ->_CreateVS (_vs);
68+ SGS* gs = RImplementation.Resources ->_CreateGS (_gs);
69+ dest.ps = ps;
70+ dest.vs = vs;
71+ dest.gs = gs;
7072#ifdef USE_DX11
7173 dest.hs = RImplementation.Resources ->_CreateHS (" null" );
7274 dest.ds = RImplementation.Resources ->_CreateDS (" null" );
7375#endif
74- ctable.merge (&ps->constants );
75- ctable.merge (&vs->constants );
76- ctable.merge (&gs->constants );
76+ ctable.merge (&ps->constants );
77+ ctable.merge (&vs->constants );
78+ ctable.merge (&gs->constants );
7779
78- // Last Stage - disable
79- if (0 ==xr_stricmp (_ps," null" )) {
80- RS.SetTSS (0 ,D3DTSS_COLOROP,D3DTOP_DISABLE);
81- RS.SetTSS (0 ,D3DTSS_ALPHAOP,D3DTOP_DISABLE);
82- }
80+ // Last Stage - disable
81+ if (0 == xr_stricmp (_ps, " null" ))
82+ {
83+ RS.SetTSS (0 , D3DTSS_COLOROP, D3DTOP_DISABLE);
84+ RS.SetTSS (0 , D3DTSS_ALPHAOP, D3DTOP_DISABLE);
85+ }
8386}
0 commit comments