diff --git a/ClassicalSharp/Blocks/BlockInfo.cs b/ClassicalSharp/Blocks/BlockInfo.cs index 492c2027e..594326f37 100644 --- a/ClassicalSharp/Blocks/BlockInfo.cs +++ b/ClassicalSharp/Blocks/BlockInfo.cs @@ -62,6 +62,7 @@ namespace ClassicalSharp { /// Lava style 'swimming'/'bobbing' interaction when player collides. public const byte LiquidLava = 6; + /// Rope/Ladder style climbing interaction when player collides. public const byte ClimbRope = 7; } diff --git a/ClassicalSharp/GraphicsAPI/Direct3D9Api.cs b/ClassicalSharp/GraphicsAPI/Direct3D9Api.cs index 48ba7f174..c586b2482 100644 --- a/ClassicalSharp/GraphicsAPI/Direct3D9Api.cs +++ b/ClassicalSharp/GraphicsAPI/Direct3D9Api.cs @@ -89,7 +89,7 @@ namespace ClassicalSharp.GraphicsAPI { } Compare[] compareFuncs; - Compare alphaTestFunc; + Compare alphaTestFunc = Compare.Always; int alphaTestRef; public override void AlphaTestFunc(CompareFunc func, float value) { alphaTestFunc = compareFuncs[(int)func]; @@ -99,7 +99,8 @@ namespace ClassicalSharp.GraphicsAPI { } Blend[] blendFuncs; - Blend srcBlendFunc, dstBlendFunc; + Blend srcBlendFunc = Blend.One; + Blend dstBlendFunc = Blend.Zero; public override void AlphaBlendFunc(BlendFunc srcFunc, BlendFunc dstFunc) { srcBlendFunc = blendFuncs[(int)srcFunc]; dstBlendFunc = blendFuncs[(int)dstFunc]; @@ -252,7 +253,7 @@ namespace ClassicalSharp.GraphicsAPI { device.SetRenderState(RenderState.ColorWriteEnable, flags); } - Compare depthTestFunc; + Compare depthTestFunc = Compare.LessEqual; public override void DepthTestFunc(CompareFunc func) { depthTestFunc = compareFuncs[(int)func]; device.SetRenderState(RenderState.ZFunc, (int)depthTestFunc); diff --git a/src/Client/D3D9Api.c b/src/Client/D3D9Api.c index 340794950..6f5ad47a7 100644 --- a/src/Client/D3D9Api.c +++ b/src/Client/D3D9Api.c @@ -355,7 +355,7 @@ void Gfx_SetAlphaTest(bool enabled) { D3D9_SetRenderState((UInt32)enabled, D3DRS_ALPHATESTENABLE, "D3D9_SetAlphaTest"); } -D3DCMPFUNC d3d9_alphaTestFunc = 0; +D3DCMPFUNC d3d9_alphaTestFunc = D3DCMP_ALWAYS; Int32 d3d9_alphaTestRef = 0; void Gfx_SetAlphaTestFunc(Int32 compareFunc, Real32 refValue) { d3d9_alphaTestFunc = d3d9_compareFuncs[compareFunc]; @@ -372,8 +372,8 @@ void Gfx_SetAlphaBlending(bool enabled) { D3D9_SetRenderState((UInt32)enabled, D3DRS_ALPHABLENDENABLE, "D3D9_SetAlphaBlending"); } -D3DBLEND d3d9_srcBlendFunc = 0; -D3DBLEND d3d9_dstBlendFunc = 0; +D3DBLEND d3d9_srcBlendFunc = D3DBLEND_ONE; +D3DBLEND d3d9_dstBlendFunc = D3DBLEND_ZERO; void Gfx_SetAlphaBlendFunc(Int32 srcBlendFunc, Int32 dstBlendFunc) { d3d9_srcBlendFunc = d3d9_blendFuncs[srcBlendFunc]; D3D9_SetRenderState(d3d9_srcBlendFunc, D3DRS_SRCBLEND, "D3D9_SetAlphaBlendFunc_Src"); @@ -405,7 +405,7 @@ void Gfx_SetDepthTest(bool enabled) { D3D9_SetRenderState((UInt32)enabled, D3DRS_ZENABLE, "D3D9_SetDepthTest"); } -D3DCMPFUNC d3d9_depthTestFunc = 0; +D3DCMPFUNC d3d9_depthTestFunc = D3DCMP_LESSEQUAL; void Gfx_SetDepthTestFunc(Int32 compareFunc) { d3d9_depthTestFunc = d3d9_compareFuncs[compareFunc]; D3D9_SetRenderState(d3d9_alphaTestFunc, D3DRS_ZFUNC, "D3D9_SetDepthTestFunc"); @@ -528,7 +528,7 @@ void Gfx_DrawVb_IndexedTris_Range(Int32 verticesCount, Int32 startVertex) { } void Gfx_DrawIndexedVb_TrisT2fC4b(Int32 verticesCount, Int32 startVertex) { - ReturnCode hresult = IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, + ReturnCode hresult = IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, startVertex, 0, verticesCount, 0, verticesCount >> 1); ErrorHandler_CheckOrFail(hresult, "D3D9_DrawIndexedVb_TrisT2fC4b"); }