From 69a0b146b6be401c89f7b32124269dedd224fa9c Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sat, 16 Apr 2016 22:56:31 +1000 Subject: [PATCH] Active option should be in yellow-ish text, also make 'done' buttons bigger in classic mode. (Thanks FrostFox) --- ClassicalSharp/2D/Drawing/IDrawer2D.cs | 1 + ClassicalSharp/2D/Screens/HudScreen.cs | 2 +- .../2D/Screens/Inventory/InventoryScreen.cs | 2 +- ClassicalSharp/2D/Screens/LoadingMapScreen.cs | 2 +- .../2D/Screens/Menu/ClassicOptionsScreen.cs | 27 ++++++++++--------- .../2D/Screens/Menu/OptionsGroupScreen.cs | 3 ++- ClassicalSharp/2D/Screens/Menu/PauseScreen.cs | 7 +++-- ClassicalSharp/2D/Widgets/ButtonWidget.cs | 8 ++++++ ClassicalSharp/2D/Widgets/Widget.cs | 4 +-- ClassicalSharp/Entities/Player.cs | 2 +- ClassicalSharp/GraphicsAPI/IGraphicsApi.cs | 22 ++++++--------- ClassicalSharp/GraphicsAPI/OpenGLApi.cs | 4 +-- ClassicalSharp/GraphicsAPI/OpenGLESApi.cs | 4 +-- .../Map/ChunkMeshBuilderTex2Col4.cs | 2 +- ClassicalSharp/Model/IModel.cs | 2 +- ClassicalSharp/Model/ModelCache.cs | 2 +- ClassicalSharp/Particles/ParticleManager.cs | 4 +-- ClassicalSharp/Program.cs | 4 +-- .../Rendering/MapBordersRenderer.cs | 6 ++--- .../Rendering/MapRenderer.Rendering.cs | 4 +-- .../Rendering/StandardEnvRenderer.cs | 8 +++--- ClassicalSharp/Rendering/WeatherRenderer.cs | 4 +-- .../Selections/AxisLinesRenderer.cs | 4 +-- .../Selections/PickedPosRenderer.cs | 4 +-- ClassicalSharp/Selections/SelectionManager.cs | 6 ++--- 25 files changed, 73 insertions(+), 65 deletions(-) diff --git a/ClassicalSharp/2D/Drawing/IDrawer2D.cs b/ClassicalSharp/2D/Drawing/IDrawer2D.cs index 3e9a8c6fd..acb7bd283 100644 --- a/ClassicalSharp/2D/Drawing/IDrawer2D.cs +++ b/ClassicalSharp/2D/Drawing/IDrawer2D.cs @@ -157,6 +157,7 @@ namespace ClassicalSharp { Colours['a' + i - 10] = FastColour.GetHexEncodedCol( i ); Colours['A' + i - 10] = FastColour.GetHexEncodedCol( i ); } + Colours[255] = new FastColour( 255, 255, 160 ); } protected List parts = new List( 64 ); diff --git a/ClassicalSharp/2D/Screens/HudScreen.cs b/ClassicalSharp/2D/Screens/HudScreen.cs index 2cfe863d8..c7939c6b9 100644 --- a/ClassicalSharp/2D/Screens/HudScreen.cs +++ b/ClassicalSharp/2D/Screens/HudScreen.cs @@ -18,7 +18,7 @@ namespace ClassicalSharp.Gui { public override void Render( double delta ) { if( game.HideGui ) return; - bool showMinimal = game.GetActiveScreen != this; + bool showMinimal = game.GetActiveScreen.BlocksWorld; if( chat.HandlesAllInput ) chat.RenderBackground(); api.Texturing = true; diff --git a/ClassicalSharp/2D/Screens/Inventory/InventoryScreen.cs b/ClassicalSharp/2D/Screens/Inventory/InventoryScreen.cs index d3192e517..17012d425 100644 --- a/ClassicalSharp/2D/Screens/Inventory/InventoryScreen.cs +++ b/ClassicalSharp/2D/Screens/Inventory/InventoryScreen.cs @@ -34,7 +34,7 @@ namespace ClassicalSharp.Gui { if( rows > maxRows ) DrawScrollbar(); api.Texturing = true; - api.SetBatchFormat( VertexFormat.Pos3fTex2fCol4b ); + api.SetBatchFormat( VertexFormat.P3fT2fC4b ); IsometricBlockDrawer.lastTexId = -1; for( int i = 0; i < blocksTable.Length; i++ ) { diff --git a/ClassicalSharp/2D/Screens/LoadingMapScreen.cs b/ClassicalSharp/2D/Screens/LoadingMapScreen.cs index f03fb4994..3e8a76b04 100644 --- a/ClassicalSharp/2D/Screens/LoadingMapScreen.cs +++ b/ClassicalSharp/2D/Screens/LoadingMapScreen.cs @@ -79,7 +79,7 @@ namespace ClassicalSharp.Gui { } ModelCache cache = game.ModelCache; - api.SetBatchFormat( VertexFormat.Pos3fTex2fCol4b ); + api.SetBatchFormat( VertexFormat.P3fT2fC4b ); api.UpdateDynamicIndexedVb( DrawMode.Triangles, cache.vb, cache.vertices, index, index * 6 / 4 ); index = 0; } diff --git a/ClassicalSharp/2D/Screens/Menu/ClassicOptionsScreen.cs b/ClassicalSharp/2D/Screens/Menu/ClassicOptionsScreen.cs index 4c28712c9..1b9eaa05c 100644 --- a/ClassicalSharp/2D/Screens/Menu/ClassicOptionsScreen.cs +++ b/ClassicalSharp/2D/Screens/Menu/ClassicOptionsScreen.cs @@ -16,49 +16,50 @@ namespace ClassicalSharp.Gui { widgets = new Widget[] { // Column 1 - MakeClassicBool( -1, -200, "Music", OptionsKey.UseMusic, + MakeClassicBool( -1, -150, "Music", OptionsKey.UseMusic, OnWidgetClick, g => g.UseMusic, (g, v) => { g.UseMusic = v; g.AudioPlayer.SetMusic( g.UseMusic ); }), - MakeClassicBool( -1, -150, "Invert mouse", OptionsKey.InvertMouse, + MakeClassicBool( -1, -100, "Invert mouse", OptionsKey.InvertMouse, OnWidgetClick, g => g.InvertMouse, (g, v) => g.InvertMouse = v ), - MakeClassic2( -1, -100, "View distance", OnWidgetClick, + MakeClassic2( -1, -50, "View distance", OnWidgetClick, g => g.ViewDistance.ToString(), (g, v) => g.SetViewDistance( Int32.Parse( v ), true ) ), !network.IsSinglePlayer ? null : - MakeClassicBool( -1, -50, "Block physics", OptionsKey.SingleplayerPhysics, OnWidgetClick, + MakeClassicBool( -1, 0, "Block physics", OptionsKey.SingleplayerPhysics, OnWidgetClick, g => ((SinglePlayerServer)network).physics.Enabled, (g, v) => ((SinglePlayerServer)network).physics.Enabled = v), // Column 2 - MakeClassicBool( 1, -200, "Sound", OptionsKey.UseSound, + MakeClassicBool( 1, -150, "Sound", OptionsKey.UseSound, OnWidgetClick, g => g.UseSound, (g, v) => { g.UseSound = v; g.AudioPlayer.SetSound( g.UseSound ); }), - MakeClassicBool( 1, -150, "Show FPS", OptionsKey.ShowFPS, + MakeClassicBool( 1, -100, "Show FPS", OptionsKey.ShowFPS, OnWidgetClick, g => g.ShowFPS, (g, v) => g.ShowFPS = v ), - MakeClassicBool( 1, -100, "View bobbing", OptionsKey.ViewBobbing, + MakeClassicBool( 1, -50, "View bobbing", OptionsKey.ViewBobbing, OnWidgetClick, g => g.ViewBobbing, (g, v) => g.ViewBobbing = v ), - MakeClassic2( 1, -50, "FPS mode", OnWidgetClick, + MakeClassic2( 1, 0, "FPS mode", OnWidgetClick, g => g.FpsLimit.ToString(), (g, v) => { object raw = Enum.Parse( typeof(FpsLimitMethod), v ); g.SetFpsLimitMethod( (FpsLimitMethod)raw ); Options.Set( OptionsKey.FpsLimit, v ); } ), !game.ClassicHacks ? null : - MakeClassicBool( 0, 0, "Hacks enabled", OptionsKey.HacksEnabled, + MakeClassicBool( 0, 60, "Hacks enabled", OptionsKey.HacksEnabled, OnWidgetClick, g => g.LocalPlayer.Hacks.Enabled, (g, v) => { g.LocalPlayer.Hacks.Enabled = v; g.LocalPlayer.CheckHacksConsistency(); } ), MakeControlsWidget(), - MakeBack( false, titleFont, - (g, w) => g.SetNewScreen( new PauseScreen( g ) ) ), + ButtonWidget.Create( game, 0, 25, 301, 40, "Done", + Anchor.Centre, Anchor.BottomOrRight, titleFont, + LeftOnly( (g, w) => g.SetNewScreen( new PauseScreen( g ) ) ) ), null, null, }; MakeValidators(); @@ -66,9 +67,9 @@ namespace ClassicalSharp.Gui { Widget MakeControlsWidget() { if( !game.ClassicHacks ) - return MakeClassic( 0, 50, "Controls", LeftOnly( + return MakeClassic( 0, 110, "Controls", LeftOnly( (g, w) => g.SetNewScreen( new ClassicKeyBindingsScreen( g ) ) ), null, null ); - return MakeClassic( 0, 50, "Controls", LeftOnly( + return MakeClassic( 0, 110, "Controls", LeftOnly( (g, w) => g.SetNewScreen( new ClassicHacksKeyBindingsScreen( g ) ) ), null, null ); } diff --git a/ClassicalSharp/2D/Screens/Menu/OptionsGroupScreen.cs b/ClassicalSharp/2D/Screens/Menu/OptionsGroupScreen.cs index b0131228e..32f3101a8 100644 --- a/ClassicalSharp/2D/Screens/Menu/OptionsGroupScreen.cs +++ b/ClassicalSharp/2D/Screens/Menu/OptionsGroupScreen.cs @@ -47,7 +47,8 @@ namespace ClassicalSharp.Gui { Make( 140, 50, "Nostalgia options", (g, w) => g.SetNewScreen( new NostalgiaScreen( g ) ) ), - MakeBack( true, titleFont, (g, w) => g.SetNewScreen( null ) ), + MakeBack( false, titleFont, + (g, w) => g.SetNewScreen( new PauseScreen( g ) ) ), }; } diff --git a/ClassicalSharp/2D/Screens/Menu/PauseScreen.cs b/ClassicalSharp/2D/Screens/Menu/PauseScreen.cs index 58148db87..2e748618a 100644 --- a/ClassicalSharp/2D/Screens/Menu/PauseScreen.cs +++ b/ClassicalSharp/2D/Screens/Menu/PauseScreen.cs @@ -62,8 +62,11 @@ namespace ClassicalSharp.Gui { MakeClassic( 0, 0, "Load level", (g, w) => g.SetNewScreen( new LoadLevelScreen( g ) ) ), MakeClassic( 0, 50, "Save level", - (g, w) => g.SetNewScreen( new SaveLevelScreen( g ) ) ), - MakeBack( true, titleFont, (g, w) => g.SetNewScreen( null ) ), + (g, w) => g.SetNewScreen( new SaveLevelScreen( g ) ) ), + + ButtonWidget.Create( game, 0, 25, 301, 40, "Back to game", + Anchor.Centre, Anchor.BottomOrRight, titleFont, + LeftOnly( (g, w) => g.SetNewScreen( null ) ) ), game.ClassicMode ? null : MakeClassic( 0, 150, "Nostalgia options", diff --git a/ClassicalSharp/2D/Widgets/ButtonWidget.cs b/ClassicalSharp/2D/Widgets/ButtonWidget.cs index 6b7157373..a76a727ee 100644 --- a/ClassicalSharp/2D/Widgets/ButtonWidget.cs +++ b/ClassicalSharp/2D/Widgets/ButtonWidget.cs @@ -32,6 +32,12 @@ namespace ClassicalSharp.Gui { public int DesiredMaxWidth, DesiredMaxHeight; int defaultHeight; internal Font font; + bool active = false; + + public override bool Active { + get { return active; } + set { active = value; SetText( Text ); } + } public override void Init() { DrawTextArgs args = new DrawTextArgs( "I", font, true ); @@ -92,6 +98,8 @@ namespace ClassicalSharp.Gui { void MakeTexture( string text ) { DrawTextArgs args = new DrawTextArgs( text, font, true ); + if( active ) + args.Text = "&" + (char)0xFF + args.Text; Size size = game.Drawer2D.MeasureChatSize( ref args ); int xOffset = Math.Max( size.Width, DesiredMaxWidth ) - size.Width; diff --git a/ClassicalSharp/2D/Widgets/Widget.cs b/ClassicalSharp/2D/Widgets/Widget.cs index 0cb8fb6a9..f2fced0b0 100644 --- a/ClassicalSharp/2D/Widgets/Widget.cs +++ b/ClassicalSharp/2D/Widgets/Widget.cs @@ -14,10 +14,10 @@ namespace ClassicalSharp.Gui { } /// Whether this widget is currently being moused over. - public bool Active; + public virtual bool Active { get; set; } /// Whether this widget is prevented from being interacted with. - public bool Disabled; + public virtual bool Disabled { get; set; } /// Invoked when this widget is clicked on. Can be null. public ClickHandler OnClick; diff --git a/ClassicalSharp/Entities/Player.cs b/ClassicalSharp/Entities/Player.cs index 6b068440f..154348e0d 100644 --- a/ClassicalSharp/Entities/Player.cs +++ b/ClassicalSharp/Entities/Player.cs @@ -69,7 +69,7 @@ namespace ClassicalSharp.Entities { api.texVerts[2] = new VertexP3fT2fC4b( p222, nameTex.U2, nameTex.V1, col ); api.texVerts[3] = new VertexP3fT2fC4b( p212, nameTex.U2, nameTex.V2, col ); - api.SetBatchFormat( VertexFormat.Pos3fTex2fCol4b ); + api.SetBatchFormat( VertexFormat.P3fT2fC4b ); api.UpdateDynamicIndexedVb( DrawMode.Triangles, api.texVb, api.texVerts, 4, 6 ); } diff --git a/ClassicalSharp/GraphicsAPI/IGraphicsApi.cs b/ClassicalSharp/GraphicsAPI/IGraphicsApi.cs index 87e93d179..b8dbd3610 100644 --- a/ClassicalSharp/GraphicsAPI/IGraphicsApi.cs +++ b/ClassicalSharp/GraphicsAPI/IGraphicsApi.cs @@ -243,8 +243,8 @@ namespace ClassicalSharp.GraphicsAPI { public Action LostContextFunction; protected void InitDynamicBuffers() { - quadVb = CreateDynamicVb( VertexFormat.Pos3fCol4b, 4 ); - texVb = CreateDynamicVb( VertexFormat.Pos3fTex2fCol4b, 4 ); + quadVb = CreateDynamicVb( VertexFormat.P3fC4b, 4 ); + texVb = CreateDynamicVb( VertexFormat.P3fT2fC4b, 4 ); } public virtual void Dispose() { @@ -259,7 +259,7 @@ namespace ClassicalSharp.GraphicsAPI { quadVerts[1] = new VertexP3fC4b( x + width, y, 0, col ); quadVerts[2] = new VertexP3fC4b( x + width, y + height, 0, col ); quadVerts[3] = new VertexP3fC4b( x, y + height, 0, col ); - SetBatchFormat( VertexFormat.Pos3fCol4b ); + SetBatchFormat( VertexFormat.P3fC4b ); UpdateDynamicIndexedVb( DrawMode.Triangles, quadVb, quadVerts, 4, 6 ); } @@ -277,7 +277,7 @@ namespace ClassicalSharp.GraphicsAPI { texVerts[1] = new VertexP3fT2fC4b( x2, y1, 0, tex.U2, tex.V1, col ); texVerts[2] = new VertexP3fT2fC4b( x2, y2, 0, tex.U2, tex.V2, col ); texVerts[3] = new VertexP3fT2fC4b( x1, y2, 0, tex.U1, tex.V2, col ); - SetBatchFormat( VertexFormat.Pos3fTex2fCol4b ); + SetBatchFormat( VertexFormat.P3fT2fC4b ); UpdateDynamicIndexedVb( DrawMode.Triangles, texVb, texVerts, 4, 6 ); } @@ -352,13 +352,11 @@ namespace ClassicalSharp.GraphicsAPI { } public enum VertexFormat { - Pos3fCol4b = 0, - Pos3fTex2fCol4b = 1, + P3fC4b = 0, P3fT2fC4b = 1, } public enum DrawMode { - Triangles = 0, - Lines = 1, + Triangles = 0, Lines = 1, } public enum CompareFunc { @@ -384,14 +382,10 @@ namespace ClassicalSharp.GraphicsAPI { } public enum Fog { - Linear = 0, - Exp = 1, - Exp2 = 2, + Linear = 0, Exp = 1, Exp2 = 2, } public enum MatrixType { - Projection = 0, - Modelview = 1, - Texture = 2, + Projection = 0, Modelview = 1, Texture = 2, } } \ No newline at end of file diff --git a/ClassicalSharp/GraphicsAPI/OpenGLApi.cs b/ClassicalSharp/GraphicsAPI/OpenGLApi.cs index 9c65c033d..5c0b1e383 100644 --- a/ClassicalSharp/GraphicsAPI/OpenGLApi.cs +++ b/ClassicalSharp/GraphicsAPI/OpenGLApi.cs @@ -258,12 +258,12 @@ namespace ClassicalSharp.GraphicsAPI { public override void SetBatchFormat( VertexFormat format ) { if( format == batchFormat ) return; - if( batchFormat == VertexFormat.Pos3fTex2fCol4b ) { + if( batchFormat == VertexFormat.P3fT2fC4b ) { GL.DisableClientState( ArrayCap.TextureCoordArray ); } batchFormat = format; - if( format == VertexFormat.Pos3fTex2fCol4b ) { + if( format == VertexFormat.P3fT2fC4b ) { GL.EnableClientState( ArrayCap.TextureCoordArray ); setupBatchFunc = setupBatchFuncTex2fCol4b; batchStride = VertexP3fT2fC4b.Size; diff --git a/ClassicalSharp/GraphicsAPI/OpenGLESApi.cs b/ClassicalSharp/GraphicsAPI/OpenGLESApi.cs index 7684fd367..821de88dd 100644 --- a/ClassicalSharp/GraphicsAPI/OpenGLESApi.cs +++ b/ClassicalSharp/GraphicsAPI/OpenGLESApi.cs @@ -237,12 +237,12 @@ namespace ClassicalSharp.GraphicsAPI { public override void SetBatchFormat( VertexFormat format ) { if( format == batchFormat ) return; - if( batchFormat == VertexFormat.Pos3fTex2fCol4b ) { + if( batchFormat == VertexFormat.P3fT2fC4b ) { GL.DisableClientState( All.TextureCoordArray ); } batchFormat = format; - if( format == VertexFormat.Pos3fTex2fCol4b ) { + if( format == VertexFormat.P3fT2fC4b ) { GL.EnableClientState( All.TextureCoordArray ); setupBatchFunc = setupBatchFuncTex2fCol4b; batchStride = VertexP3fT2fC4b.Size; diff --git a/ClassicalSharp/Map/ChunkMeshBuilderTex2Col4.cs b/ClassicalSharp/Map/ChunkMeshBuilderTex2Col4.cs index 5d739db1f..f8aa3dcc1 100644 --- a/ClassicalSharp/Map/ChunkMeshBuilderTex2Col4.cs +++ b/ClassicalSharp/Map/ChunkMeshBuilderTex2Col4.cs @@ -97,7 +97,7 @@ namespace ClassicalSharp { if( part.iCount == 0 ) return; ChunkPartInfo info; - info.VbId = graphics.CreateVb( part.vertices, VertexFormat.Pos3fTex2fCol4b, part.vCount + 2 ); + info.VbId = graphics.CreateVb( part.vertices, VertexFormat.P3fT2fC4b, part.vCount + 2 ); info.IndicesCount = part.iCount; info.leftCount = (ushort)part.Count.left; info.rightCount = (ushort)part.Count.right; info.frontCount = (ushort)part.Count.front; info.backCount = (ushort)part.Count.back; diff --git a/ClassicalSharp/Model/IModel.cs b/ClassicalSharp/Model/IModel.cs index d4bcc5976..e67b2b714 100644 --- a/ClassicalSharp/Model/IModel.cs +++ b/ClassicalSharp/Model/IModel.cs @@ -67,7 +67,7 @@ namespace ClassicalSharp.Model { cosHead = (float)Math.Cos( p.HeadYawDegrees * Utils.Deg2Rad ); sinHead = (float)Math.Sin( p.HeadYawDegrees * Utils.Deg2Rad ); - graphics.SetBatchFormat( VertexFormat.Pos3fTex2fCol4b ); + graphics.SetBatchFormat( VertexFormat.P3fT2fC4b ); DrawModel( p ); } diff --git a/ClassicalSharp/Model/ModelCache.cs b/ClassicalSharp/Model/ModelCache.cs index 07d35c493..048879a05 100644 --- a/ClassicalSharp/Model/ModelCache.cs +++ b/ClassicalSharp/Model/ModelCache.cs @@ -18,7 +18,7 @@ namespace ClassicalSharp.Model { public void InitCache() { vertices = new VertexP3fT2fC4b[24 * 12]; - vb = api.CreateDynamicVb( VertexFormat.Pos3fTex2fCol4b, vertices.Length ); + vb = api.CreateDynamicVb( VertexFormat.P3fT2fC4b, vertices.Length ); IModel model = new HumanoidModel( game ); model.CreateParts(); cache["humanoid"] = model; diff --git a/ClassicalSharp/Particles/ParticleManager.cs b/ClassicalSharp/Particles/ParticleManager.cs index 579e9fdc9..be5e23840 100644 --- a/ClassicalSharp/Particles/ParticleManager.cs +++ b/ClassicalSharp/Particles/ParticleManager.cs @@ -20,7 +20,7 @@ namespace ClassicalSharp.Particles { public ParticleManager( Game game ) { this.game = game; rnd = new Random(); - vb = game.Graphics.CreateDynamicVb( VertexFormat.Pos3fTex2fCol4b, maxParticles * 4 ); + vb = game.Graphics.CreateDynamicVb( VertexFormat.P3fT2fC4b, maxParticles * 4 ); game.Events.TerrainAtlasChanged += TerrainAtlasChanged; } @@ -35,7 +35,7 @@ namespace ClassicalSharp.Particles { IGraphicsApi graphics = game.Graphics; graphics.Texturing = true; graphics.AlphaTest = true; - graphics.SetBatchFormat( VertexFormat.Pos3fTex2fCol4b ); + graphics.SetBatchFormat( VertexFormat.P3fT2fC4b ); RenderTerrainParticles( graphics, terrainParticles, terrainCount, delta, t ); RenderRainParticles( graphics, rainParticles, rainCount, delta, t ); diff --git a/ClassicalSharp/Program.cs b/ClassicalSharp/Program.cs index 08e3add72..8f826d53a 100644 --- a/ClassicalSharp/Program.cs +++ b/ClassicalSharp/Program.cs @@ -52,10 +52,10 @@ namespace ClassicalSharp { width = 640; height = 480; if( device.Width >= 1024 && device.Height >= 768 ) { - width = 800; height = 600; + //width = 800; height = 600; } if( device.Width >= 1920 && device.Height >= 1080 ) { - width = 1600; height = 900; + //width = 1600; height = 900; } } diff --git a/ClassicalSharp/Rendering/MapBordersRenderer.cs b/ClassicalSharp/Rendering/MapBordersRenderer.cs index 31a904894..01860d524 100644 --- a/ClassicalSharp/Rendering/MapBordersRenderer.cs +++ b/ClassicalSharp/Rendering/MapBordersRenderer.cs @@ -48,7 +48,7 @@ namespace ClassicalSharp.Renderers { graphics.Texturing = true; graphics.AlphaTest = true; graphics.BindTexture( sideTexId ); - graphics.SetBatchFormat( VertexFormat.Pos3fTex2fCol4b ); + graphics.SetBatchFormat( VertexFormat.P3fT2fC4b ); if( game.World.SidesBlock != Block.Air ) { graphics.BindVb( sidesVb ); graphics.DrawIndexedVb_TrisT2fC4b( sidesVertices * 6 / 4, 0 ); @@ -161,7 +161,7 @@ namespace ClassicalSharp.Renderers { DrawZ( map.Length, 0, map.Width, y1, y2, axisSize, col, ref vertices ); DrawX( 0, 0, map.Length, y1, y2, axisSize, col, ref vertices ); DrawX( map.Width, 0, map.Length, y1, y2, axisSize, col, ref vertices ); - sidesVb = graphics.CreateVb( ptr, VertexFormat.Pos3fTex2fCol4b, sidesVertices ); + sidesVb = graphics.CreateVb( ptr, VertexFormat.P3fT2fC4b, sidesVertices ); } void RebuildEdges( int waterLevel, int axisSize ) { @@ -177,7 +177,7 @@ namespace ClassicalSharp.Renderers { foreach( Rectangle rec in rects ) { DrawY( rec.X, rec.Y, rec.X + rec.Width, rec.Y + rec.Height, waterLevel, axisSize, col, -0.1f/16f, ref vertices ); } - edgesVb = graphics.CreateVb( ptr, VertexFormat.Pos3fTex2fCol4b, edgesVertices ); + edgesVb = graphics.CreateVb( ptr, VertexFormat.P3fT2fC4b, edgesVertices ); } void DrawX( int x, int z1, int z2, int y1, int y2, int axisSize, FastColour col, ref VertexP3fT2fC4b* vertices ) { diff --git a/ClassicalSharp/Rendering/MapRenderer.Rendering.cs b/ClassicalSharp/Rendering/MapRenderer.Rendering.cs index 69397186b..af166c24b 100644 --- a/ClassicalSharp/Rendering/MapRenderer.Rendering.cs +++ b/ClassicalSharp/Rendering/MapRenderer.Rendering.cs @@ -11,7 +11,7 @@ namespace ClassicalSharp.Renderers { // These blocks are treated as having an alpha value of either none or full. void RenderNormal() { int[] texIds = game.TerrainAtlas1D.TexIds; - api.SetBatchFormat( VertexFormat.Pos3fTex2fCol4b ); + api.SetBatchFormat( VertexFormat.P3fT2fC4b ); api.Texturing = true; api.AlphaTest = true; @@ -34,7 +34,7 @@ namespace ClassicalSharp.Renderers { drawAllFaces = block == Block.Water || block == Block.StillWater; // First fill depth buffer int[] texIds = game.TerrainAtlas1D.TexIds; - api.SetBatchFormat( VertexFormat.Pos3fTex2fCol4b ); + api.SetBatchFormat( VertexFormat.P3fT2fC4b ); api.Texturing = false; api.AlphaBlending = false; api.ColourWrite = false; diff --git a/ClassicalSharp/Rendering/StandardEnvRenderer.cs b/ClassicalSharp/Rendering/StandardEnvRenderer.cs index 77184bca2..677d0c896 100644 --- a/ClassicalSharp/Rendering/StandardEnvRenderer.cs +++ b/ClassicalSharp/Rendering/StandardEnvRenderer.cs @@ -29,7 +29,7 @@ namespace ClassicalSharp.Renderers { float normalY = map.Height + 8; float skyY = Math.Max( pos.Y + 8, normalY ); - graphics.SetBatchFormat( VertexFormat.Pos3fCol4b ); + graphics.SetBatchFormat( VertexFormat.P3fC4b ); graphics.BindVb( skyVb ); if( skyY == normalY ) { graphics.DrawIndexedVb( DrawMode.Triangles, skyVertices * 6 / 4, 0 ); @@ -102,7 +102,7 @@ namespace ClassicalSharp.Renderers { graphics.AlphaTest = true; graphics.Texturing = true; graphics.BindTexture( game.CloudsTexId ); - graphics.SetBatchFormat( VertexFormat.Pos3fTex2fCol4b ); + graphics.SetBatchFormat( VertexFormat.P3fT2fC4b ); graphics.BindVb( cloudsVb ); graphics.DrawIndexedVb_TrisT2fC4b( cloudVertices * 6 / 4, 0 ); graphics.AlphaTest = false; @@ -171,7 +171,7 @@ namespace ClassicalSharp.Renderers { VertexP3fT2fC4b[] vertices = new VertexP3fT2fC4b[cloudVertices]; DrawCloudsY( x1, z1, x2, z2, map.CloudHeight, axisSize, map.CloudsCol, vertices ); - cloudsVb = graphics.CreateVb( vertices, VertexFormat.Pos3fTex2fCol4b, cloudVertices ); + cloudsVb = graphics.CreateVb( vertices, VertexFormat.P3fT2fC4b, cloudVertices ); } void ResetSky( int extent, int axisSize ) { @@ -184,7 +184,7 @@ namespace ClassicalSharp.Renderers { int height = Math.Max( map.Height + 2 + 6, map.CloudHeight + 6); DrawSkyY( x1, z1, x2, z2, height, axisSize, map.SkyCol, vertices ); - skyVb = graphics.CreateVb( vertices, VertexFormat.Pos3fCol4b, skyVertices ); + skyVb = graphics.CreateVb( vertices, VertexFormat.P3fC4b, skyVertices ); } void DrawSkyY( int x1, int z1, int x2, int z2, int y, int axisSize, FastColour col, VertexP3fC4b[] vertices ) { diff --git a/ClassicalSharp/Rendering/WeatherRenderer.cs b/ClassicalSharp/Rendering/WeatherRenderer.cs index 80bcf972d..f11cb3447 100644 --- a/ClassicalSharp/Rendering/WeatherRenderer.cs +++ b/ClassicalSharp/Rendering/WeatherRenderer.cs @@ -17,7 +17,7 @@ namespace ClassicalSharp.Renderers { map = game.World; graphics = game.Graphics; info = game.BlockInfo; - weatherVb = graphics.CreateDynamicVb( VertexFormat.Pos3fTex2fCol4b, vertices.Length ); + weatherVb = graphics.CreateDynamicVb( VertexFormat.P3fT2fC4b, vertices.Length ); } int weatherVb; @@ -64,7 +64,7 @@ namespace ClassicalSharp.Renderers { rainAcc = 0; if( index > 0 ) { - graphics.SetBatchFormat( VertexFormat.Pos3fTex2fCol4b ); + graphics.SetBatchFormat( VertexFormat.P3fT2fC4b ); graphics.UpdateDynamicIndexedVb( DrawMode.Triangles, weatherVb, vertices, index, index * 6 / 4 ); } graphics.AlphaTest = true; diff --git a/ClassicalSharp/Selections/AxisLinesRenderer.cs b/ClassicalSharp/Selections/AxisLinesRenderer.cs index bc8572bae..598f75aea 100644 --- a/ClassicalSharp/Selections/AxisLinesRenderer.cs +++ b/ClassicalSharp/Selections/AxisLinesRenderer.cs @@ -20,7 +20,7 @@ namespace ClassicalSharp.Selections { return; if( vertices == null ) { vertices = new VertexP3fC4b[12]; - vb = game.Graphics.CreateDynamicVb( VertexFormat.Pos3fCol4b, vertices.Length ); + vb = game.Graphics.CreateDynamicVb( VertexFormat.P3fC4b, vertices.Length ); } game.Graphics.Texturing = false; Vector3 pos = game.LocalPlayer.Position; pos.Y += 0.05f; @@ -31,7 +31,7 @@ namespace ClassicalSharp.Selections { if( game.Camera.IsThirdPerson ) VerQuad( ref index, pos.X - size, pos.Y, pos.Z + size, pos.X + size, pos.Y + 3, pos.Z - size, FastColour.Green ); - game.Graphics.SetBatchFormat( VertexFormat.Pos3fCol4b ); + game.Graphics.SetBatchFormat( VertexFormat.P3fC4b ); game.Graphics.UpdateDynamicIndexedVb( DrawMode.Triangles, vb, vertices, index, index * 6 / 4 ); } diff --git a/ClassicalSharp/Selections/PickedPosRenderer.cs b/ClassicalSharp/Selections/PickedPosRenderer.cs index 73080edb9..fcc74f35d 100644 --- a/ClassicalSharp/Selections/PickedPosRenderer.cs +++ b/ClassicalSharp/Selections/PickedPosRenderer.cs @@ -13,7 +13,7 @@ namespace ClassicalSharp.Renderers { public PickedPosRenderer( Game game ) { graphics = game.Graphics; - vb = graphics.CreateDynamicVb( VertexFormat.Pos3fCol4b, verticesCount ); + vb = graphics.CreateDynamicVb( VertexFormat.P3fC4b, verticesCount ); this.game = game; } @@ -64,7 +64,7 @@ namespace ClassicalSharp.Renderers { ZQuad( p2.Z, p1.X, p1.Y, p2.X, p1.Y + size ); ZQuad( p2.Z, p1.X, p2.Y, p2.X, p2.Y - size ); - graphics.SetBatchFormat( VertexFormat.Pos3fCol4b ); + graphics.SetBatchFormat( VertexFormat.P3fC4b ); graphics.UpdateDynamicIndexedVb( DrawMode.Triangles, vb, vertices, verticesCount, verticesCount * 6 / 4 ); } diff --git a/ClassicalSharp/Selections/SelectionManager.cs b/ClassicalSharp/Selections/SelectionManager.cs index 6338e1c33..d3c8d6230 100644 --- a/ClassicalSharp/Selections/SelectionManager.cs +++ b/ClassicalSharp/Selections/SelectionManager.cs @@ -56,7 +56,7 @@ namespace ClassicalSharp.Selections { box.Render( delta, vertices, lineVertices, ref index, ref lineIndex ); } - Graphics.SetBatchFormat( VertexFormat.Pos3fCol4b ); + Graphics.SetBatchFormat( VertexFormat.P3fC4b ); Graphics.UpdateDynamicVb( DrawMode.Lines, lineVb, lineVertices, selections.Count * LineVerticesCount ); Graphics.DepthWrite = false; @@ -80,8 +80,8 @@ namespace ClassicalSharp.Selections { void InitData() { vertices = new VertexP3fC4b[256 * VerticesCount]; lineVertices = new VertexP3fC4b[256 * LineVerticesCount]; - vb = Graphics.CreateDynamicVb( VertexFormat.Pos3fCol4b, vertices.Length ); - lineVb = Graphics.CreateDynamicVb( VertexFormat.Pos3fCol4b, lineVertices.Length ); + vb = Graphics.CreateDynamicVb( VertexFormat.P3fC4b, vertices.Length ); + lineVb = Graphics.CreateDynamicVb( VertexFormat.P3fC4b, lineVertices.Length ); } void OnNewMap( object sender, EventArgs e ) {