From d535448bb4fceeea9132b74ac5ccdfdcd207aab5 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sat, 12 Sep 2015 13:56:37 +1000 Subject: [PATCH] Load animations.png from texture pack if it exists. --- ClassicalSharp/Entities/LocalPlayer.cs | 3 +-- ClassicalSharp/TexturePack/Animations.cs | 2 +- ClassicalSharp/TexturePack/ZipExtractor.cs | 3 +++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ClassicalSharp/Entities/LocalPlayer.cs b/ClassicalSharp/Entities/LocalPlayer.cs index 929da3f0e..dd3b97231 100644 --- a/ClassicalSharp/Entities/LocalPlayer.cs +++ b/ClassicalSharp/Entities/LocalPlayer.cs @@ -10,7 +10,7 @@ namespace ClassicalSharp { public Vector3 SpawnPoint; - public float ReachDistance = 50f; + public float ReachDistance = 5f; public byte UserType; bool canSpeed = true, canFly = true, canRespawn = true, canNoclip = true; @@ -64,7 +64,6 @@ namespace ClassicalSharp { public override void Tick( double delta ) { if( game.Map.IsNotLoaded ) return; - //Window.Title = ( GC.GetTotalMemory( false ) / 1024.0 / 1024.0 ).ToString(); // TODO: temp debug statement float xMoving = 0, zMoving = 0; lastPos = Position = nextPos; diff --git a/ClassicalSharp/TexturePack/Animations.cs b/ClassicalSharp/TexturePack/Animations.cs index 7d01752f7..343d4e31d 100644 --- a/ClassicalSharp/TexturePack/Animations.cs +++ b/ClassicalSharp/TexturePack/Animations.cs @@ -20,7 +20,7 @@ namespace ClassicalSharp.TexturePack { //DefineAnimation( 0, 0, 0, 0, 16, 7, 5 ); } - public void SetAnimationAtlas( Bitmap bmp ) { + public void SetAtlas( Bitmap bmp ) { Dispose(); this.bmp = bmp; fastBmp = new FastBitmap( bmp, true ); diff --git a/ClassicalSharp/TexturePack/ZipExtractor.cs b/ClassicalSharp/TexturePack/ZipExtractor.cs index 5fba7a611..614cfc52c 100644 --- a/ClassicalSharp/TexturePack/ZipExtractor.cs +++ b/ClassicalSharp/TexturePack/ZipExtractor.cs @@ -100,6 +100,9 @@ namespace ClassicalSharp.TexturePack { UpdateTexture( ref cache.SheepFurTexId, stream, false ); break; case "char.png": UpdateTexture( ref cache.HumanoidTexId, stream, true ); break; + case "animations.png": + case "animation.png": + game.Animations.SetAtlas( new Bitmap( stream ) ); break; } }