diff --git a/ClassicalSharp/Blocks/BlockInfo.Atlas.cs b/ClassicalSharp/Blocks/BlockInfo.Atlas.cs index eaf0b25fe..8480bf6dd 100644 --- a/ClassicalSharp/Blocks/BlockInfo.Atlas.cs +++ b/ClassicalSharp/Blocks/BlockInfo.Atlas.cs @@ -5,8 +5,6 @@ namespace ClassicalSharp { public partial class BlockInfo { int[] textures = new int[BlocksCount * TileSide.Sides]; - const int Row1 = 0, Row2 = 16, Row3 = 32, Row4 = 48, - Row5 = 64, Row6 = 80, Row7 = 96, Row8 = 112, Row9 = 128; void SetupOptimTextures() { // Row 1 @@ -70,8 +68,7 @@ namespace ClassicalSharp { for( int i = index; i < index + TileSide.Bottom; i++ ) { textures[i] = textureId; } - } - int texId; + } void SetTopAndBottom( int textureId, Block blockId ) { textures[(byte)blockId * TileSide.Sides + TileSide.Bottom] = textureId; @@ -86,10 +83,10 @@ namespace ClassicalSharp { textures[(byte)blockId * TileSide.Sides + TileSide.Bottom] = textureId; } + int texId; void SetAll( params Block[] blocks ) { for( int i = 0; i < blocks.Length; i++ ) { - SetAll( texId, blocks[i] ); - texId++; + SetAll( texId, blocks[i] ); texId++; } } diff --git a/ClassicalSharp/Rendering/MapRenderer.Rendering.cs b/ClassicalSharp/Rendering/MapRenderer.Rendering.cs index 55976bcca..bbfb2c8f2 100644 --- a/ClassicalSharp/Rendering/MapRenderer.Rendering.cs +++ b/ClassicalSharp/Rendering/MapRenderer.Rendering.cs @@ -21,7 +21,7 @@ namespace ClassicalSharp { if( part.IndicesCount > maxIndices ) { DrawBigPart( info, ref part ); } else { - DrawPart( info, ref part ); + DrawPart( info, ref part, true ); } if( part.spriteCount > 0 ) @@ -37,7 +37,7 @@ namespace ClassicalSharp { ChunkPartInfo part = info.TranslucentParts[batch]; if( part.IndicesCount == 0 ) continue; - DrawPart( info, ref part ); + DrawPart( info, ref part, false ); game.Vertices += part.IndicesCount; } } @@ -49,11 +49,11 @@ namespace ClassicalSharp { ChunkPartInfo part = info.TranslucentParts[batch]; if( part.IndicesCount == 0 ) continue; - DrawPart( info, ref part ); + DrawPart( info, ref part, false ); } } - void DrawPart( ChunkInfo info, ref ChunkPartInfo part ) { + void DrawPart( ChunkInfo info, ref ChunkPartInfo part, bool faceCulling ) { api.BindVb( part.VbId ); bool drawLeft = info.DrawLeft && part.leftCount > 0; bool drawRight = info.DrawRight && part.rightCount > 0; @@ -63,7 +63,7 @@ namespace ClassicalSharp { bool drawBack = info.DrawBack && part.backCount > 0; if( drawLeft && drawRight ) { - api.FaceCulling = true; + api.FaceCulling = faceCulling; api.DrawIndexedVb_TrisT2fC4b( part.leftCount + part.rightCount, part.leftIndex ); api.FaceCulling = false; } else if( drawLeft ) { @@ -73,7 +73,7 @@ namespace ClassicalSharp { } if( drawFront && drawBack ) { - api.FaceCulling = true; + api.FaceCulling = faceCulling; api.DrawIndexedVb_TrisT2fC4b( part.frontCount + part.backCount, part.frontIndex ); api.FaceCulling = false; } else if( drawFront ) { @@ -83,7 +83,7 @@ namespace ClassicalSharp { } if( drawBottom && drawTop ) { - api.FaceCulling = true; + api.FaceCulling = faceCulling; api.DrawIndexedVb_TrisT2fC4b( part.bottomCount + part.topCount, part.bottomIndex ); api.FaceCulling = false; } else if( drawBottom ) { diff --git a/OpenTK/Platform/X11/X11GraphicsMode.cs b/OpenTK/Platform/X11/X11GraphicsMode.cs index 6e9a5d376..a6c9455c7 100644 --- a/OpenTK/Platform/X11/X11GraphicsMode.cs +++ b/OpenTK/Platform/X11/X11GraphicsMode.cs @@ -8,9 +8,8 @@ using System; using System.Collections.Generic; -using System.Text; -using System.Runtime.InteropServices; using System.Diagnostics; +using System.Runtime.InteropServices; using OpenTK.Graphics; @@ -21,14 +20,6 @@ namespace OpenTK.Platform.X11 // Todo: Add custom visual selection algorithm, instead of ChooseFBConfig/ChooseVisual. // It seems the Choose* methods do not take multisampling into account (at least on some // drivers). - - #region Constructors - - public X11GraphicsMode() - { - } - - #endregion #region IGraphicsMode Members