mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-16 11:06:06 -04:00
Implement basic entity shadows.
This commit is contained in:
parent
17f87dbbbb
commit
f78af8e815
@ -42,6 +42,12 @@ namespace ClassicalSharp {
|
||||
g => g.ViewDistance.ToString(),
|
||||
(g, v) => g.SetViewDistance( Int32.Parse( v ), true ) ),
|
||||
|
||||
Make( -140, 50, "Entity shadows", OnWidgetClick,
|
||||
g => g.Players.ShadowMode.ToString(),
|
||||
(g, v) => { object raw = Enum.Parse( typeof(EntityShadow), v );
|
||||
g.Players.ShadowMode = (EntityShadow)raw;
|
||||
Options.Set( OptionsKey.EntityShadow, v ); } ),
|
||||
|
||||
// Column 2
|
||||
!network.IsSinglePlayer ? null :
|
||||
Make( 140, -200, "Block physics", OnWidgetClick,
|
||||
@ -82,6 +88,7 @@ namespace ClassicalSharp {
|
||||
};
|
||||
widgets[2].Metadata = typeof(NameMode);
|
||||
widgets[3].Metadata = typeof(FpsLimitMethod);
|
||||
widgets[5].Metadata = typeof(EntityShadow);
|
||||
MakeValidators();
|
||||
MakeDescriptions();
|
||||
}
|
||||
@ -94,6 +101,7 @@ namespace ClassicalSharp {
|
||||
new EnumValidator(),
|
||||
new EnumValidator(),
|
||||
new IntegerValidator( 16, 4096 ),
|
||||
new EnumValidator(),
|
||||
|
||||
network.IsSinglePlayer ? new BooleanValidator() : null,
|
||||
new BooleanValidator(),
|
||||
@ -123,6 +131,13 @@ namespace ClassicalSharp {
|
||||
"&eNoLimit: &Renders as many frames as the GPU can handle each second.",
|
||||
"&cUsing NoLimit mode is discouraged for general usage.",
|
||||
};
|
||||
|
||||
descriptions[5] = new[] {
|
||||
"&eNone: &fNo entity shadows are drawn.",
|
||||
"&eSnapToBlock: &fA square shadow is shown on block you are directly above.",
|
||||
"&eCircle: &fA circular shadow is shown across the blocks you are above.",
|
||||
"&eCircleAll: &fA circular shadow is shown underneath all entities.",
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
@ -65,7 +65,6 @@ namespace ClassicalSharp {
|
||||
yOffset = 0;
|
||||
if( textSize.Height < DesiredMaxHeight )
|
||||
yOffset = DesiredMaxHeight / 2 - textSize.Height / 2;
|
||||
Console.WriteLine( yOffset );
|
||||
|
||||
using( Bitmap bmp = IDrawer2D.CreatePow2Bitmap( size ) )
|
||||
using( IDrawer2D drawer = game.Drawer2D )
|
||||
|
@ -155,6 +155,7 @@
|
||||
<Compile Include="Entities\LocalPlayer.Physics.cs" />
|
||||
<Compile Include="Entities\LocationUpdate.cs" />
|
||||
<Compile Include="Entities\NetPlayer.cs" />
|
||||
<Compile Include="Entities\Player.Shadows.cs" />
|
||||
<Compile Include="Events\EntityEvents.cs" />
|
||||
<Compile Include="Events\Events.cs" />
|
||||
<Compile Include="Events\MapEvents.cs" />
|
||||
@ -173,7 +174,6 @@
|
||||
<Compile Include="Particles\RainParticle.cs" />
|
||||
<Compile Include="Particles\TerrainParticle.cs" />
|
||||
<Compile Include="Entities\Player.cs" />
|
||||
<Compile Include="Entities\Player.Rendering.cs" />
|
||||
<Compile Include="Game\ChatLog.cs" />
|
||||
<Compile Include="Game\Game.cs" />
|
||||
<Compile Include="Game\InputHandler.cs" />
|
||||
|
@ -16,6 +16,7 @@ namespace ClassicalSharp {
|
||||
public const int MaxCount = 256;
|
||||
public Player[] Players = new Player[MaxCount];
|
||||
public Game game;
|
||||
public EntityShadow ShadowMode = EntityShadow.None;
|
||||
byte closestId;
|
||||
|
||||
/// <summary> Mode of how names of hovered entities are rendered (with or without depth testing),
|
||||
@ -26,6 +27,7 @@ namespace ClassicalSharp {
|
||||
this.game = game;
|
||||
game.Events.ChatFontChanged += ChatFontChanged;
|
||||
NamesMode = Options.GetEnum( OptionsKey.NamesMode, NameMode.AllNamesAndHovered );
|
||||
ShadowMode = Options.GetEnum( OptionsKey.EntityShadow, EntityShadow.None );
|
||||
}
|
||||
|
||||
/// <summary> Performs a tick call for all player entities contained in this list. </summary>
|
||||
@ -137,5 +139,17 @@ namespace ClassicalSharp {
|
||||
value.ID = (byte)id;
|
||||
}
|
||||
}
|
||||
|
||||
public void DrawShadows() {
|
||||
if( ShadowMode == EntityShadow.None ) return;
|
||||
Player.boundShadowTex = false;
|
||||
Players[255].DrawShadow( ShadowMode );
|
||||
if( ShadowMode != EntityShadow.CircleAll ) return;
|
||||
|
||||
for( int i = 0; i < 255; i++) {
|
||||
if( Players[i] == null ) continue;
|
||||
Players[i].DrawShadow( ShadowMode );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,8 +17,6 @@ namespace ClassicalSharp {
|
||||
/// reach to and interact/modify blocks in. </summary>
|
||||
public float ReachDistance = 5f;
|
||||
|
||||
public EntityShadow Shadow = EntityShadow.None;
|
||||
|
||||
internal float jumpVel = 0.42f, serverJumpVel = 0.42f;
|
||||
/// <summary> Returns the height that the client can currently jump up to.<br/>
|
||||
/// Note that when speeding is enabled the client is able to jump much further. </summary>
|
||||
|
@ -1,57 +1,18 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using ClassicalSharp.GraphicsAPI;
|
||||
using OpenTK;
|
||||
|
||||
namespace ClassicalSharp {
|
||||
|
||||
partial class Player {
|
||||
|
||||
protected Texture nameTex;
|
||||
protected internal int PlayerTextureId = -1, MobTextureId = -1;
|
||||
|
||||
public override void Despawn() {
|
||||
game.Graphics.DeleteTexture( ref PlayerTextureId );
|
||||
game.Graphics.DeleteTexture( ref nameTex.ID );
|
||||
if( shadowTex != -1 )
|
||||
game.Graphics.DeleteTexture( ref shadowTex );
|
||||
}
|
||||
|
||||
protected void InitRenderingData() {
|
||||
using( Font font = new Font( game.FontName, 20 ) ) {
|
||||
DrawTextArgs args = new DrawTextArgs( DisplayName, font, true );
|
||||
nameTex = game.Drawer2D.MakeBitmappedTextTexture( ref args, 0, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateNameFont() {
|
||||
game.Graphics.DeleteTexture( ref nameTex );
|
||||
InitRenderingData();
|
||||
}
|
||||
|
||||
protected void DrawName() {
|
||||
IGraphicsApi api = game.Graphics;
|
||||
api.BindTexture( nameTex.ID );
|
||||
Vector3 pos = Position; pos.Y += Model.NameYOffset;
|
||||
|
||||
Vector3 p111, p121, p212, p222;
|
||||
FastColour col = FastColour.White;
|
||||
Vector2 size = new Vector2( nameTex.Width / 70f, nameTex.Height / 70f );
|
||||
Utils.CalcBillboardPoints( size, pos, ref game.View, out p111, out p121, out p212, out p222 );
|
||||
api.texVerts[0] = new VertexPos3fTex2fCol4b( p111, nameTex.U1, nameTex.V2, col );
|
||||
api.texVerts[1] = new VertexPos3fTex2fCol4b( p121, nameTex.U1, nameTex.V1, col );
|
||||
api.texVerts[2] = new VertexPos3fTex2fCol4b( p222, nameTex.U2, nameTex.V1, col );
|
||||
api.texVerts[3] = new VertexPos3fTex2fCol4b( p212, nameTex.U2, nameTex.V2, col );
|
||||
|
||||
api.SetBatchFormat( VertexFormat.Pos3fTex2fCol4b );
|
||||
api.UpdateDynamicIndexedVb( DrawMode.Triangles, api.texVb, api.texVerts, 4, 6 );
|
||||
}
|
||||
internal static bool boundShadowTex = false;
|
||||
|
||||
internal unsafe void DrawShadow( EntityShadow shadow ) {
|
||||
if( shadow == EntityShadow.None ) return;
|
||||
float posX = Position.X, posZ = Position.Z;
|
||||
float posX = Position.X, posZ = Position.Z;
|
||||
int posY = Math.Min( (int)Position.Y, game.Map.Height - 1 );
|
||||
float y; byte rgb;
|
||||
float y; byte alpha;
|
||||
|
||||
int index = 0, vb = 0;
|
||||
VertexPos3fTex2fCol4b[] verts = null;
|
||||
@ -64,58 +25,64 @@ namespace ClassicalSharp {
|
||||
vb = game.Graphics.texVb; verts = game.Graphics.texVerts;
|
||||
TextureRec rec = new TextureRec( 63/128f, 63/128f, 1/128f, 1/128f );
|
||||
|
||||
if( !CalculateShadow( coords, ref coordsCount, posX, posZ, posY, out y, out rgb ) )
|
||||
if( !CalculateShadow( coords, ref coordsCount, posX, posZ, posY, out y, out alpha ) )
|
||||
return;
|
||||
alpha = 220;
|
||||
float x1 = Utils.Floor( posX ), z1 = Utils.Floor( posZ );
|
||||
DrawShadowPart( verts, ref index, y, rgb, x1, z1, x1 + 1, z1 + 1, rec );
|
||||
DrawShadowPart( verts, ref index, y, alpha, x1, z1, x1 + 1, z1 + 1, rec );
|
||||
} else {
|
||||
vb = game.ModelCache.vb; verts = game.ModelCache.vertices;
|
||||
TextureRec rec;
|
||||
|
||||
float x1 = posX - 7/16f, x2 = Math.Min( posX + 7/16f, Utils.Floor( x1 ) + 1 );
|
||||
float z1 = posZ - 7/16f, z2 = Math.Min( posZ + 7/16f, Utils.Floor( z1 ) + 1 );
|
||||
if( CalculateShadow( coords, ref coordsCount, x1, z1, posY, out y, out rgb ) ) {
|
||||
if( CalculateShadow( coords, ref coordsCount, x1, z1, posY, out y, out alpha ) && alpha > 0 ) {
|
||||
rec = TextureRec.FromPoints( 0, 0, (x2 - x1) * 16/14f, (z2 - z1) * 16/14f );
|
||||
DrawShadowPart( verts, ref index, y, rgb, x1, z1, x2, z2, rec );
|
||||
DrawShadowPart( verts, ref index, y, alpha, x1, z1, x2, z2, rec );
|
||||
}
|
||||
|
||||
x2 = posX + 7/16f; x1 = Math.Max( posX - 7/16f, Utils.Floor( x2 ) );
|
||||
if( CalculateShadow( coords, ref coordsCount, x1, z1, posY, out y, out rgb ) ) {
|
||||
if( CalculateShadow( coords, ref coordsCount, x1, z1, posY, out y, out alpha ) && alpha > 0 ) {
|
||||
rec = TextureRec.FromPoints( 1 - (x2 - x1) * 16/14f, 0, 1, (z2 - z1) * 16/14f );
|
||||
DrawShadowPart( verts, ref index, y, rgb, x1, z1, x2, z2, rec );
|
||||
DrawShadowPart( verts, ref index, y, alpha, x1, z1, x2, z2, rec );
|
||||
}
|
||||
|
||||
z2 = posZ + 7/16f; z1 = Math.Max( posZ - 7/16f, Utils.Floor( z2 ) );
|
||||
if( CalculateShadow( coords, ref coordsCount, x1, z1, posY, out y, out rgb ) ) {
|
||||
if( CalculateShadow( coords, ref coordsCount, x1, z1, posY, out y, out alpha ) && alpha > 0 ) {
|
||||
rec = TextureRec.FromPoints( 1 - (x2 - x1) * 16/14f, 1 - (z2 - z1) * 16/14f, 1, 1 );
|
||||
DrawShadowPart( verts, ref index, y, rgb, x1, z1, x2, z2, rec );
|
||||
DrawShadowPart( verts, ref index, y, alpha, x1, z1, x2, z2, rec );
|
||||
}
|
||||
|
||||
x1 = posX - 7/16f; x2 = Math.Min( posX + 7/16f, Utils.Floor( x1 ) + 1 );
|
||||
if( CalculateShadow( coords, ref coordsCount, x1, z1, posY, out y, out rgb ) ) {
|
||||
if( CalculateShadow( coords, ref coordsCount, x1, z1, posY, out y, out alpha ) && alpha > 0 ) {
|
||||
rec = TextureRec.FromPoints( 0, 1 - (z2 - z1) * 16/14f, (x2 - x1) * 16/14f, 1 );
|
||||
DrawShadowPart( verts, ref index, y, rgb, x1, z1, x2, z2, rec );
|
||||
DrawShadowPart( verts, ref index, y, alpha, x1, z1, x2, z2, rec );
|
||||
}
|
||||
}
|
||||
|
||||
if( index == 0 ) return;
|
||||
CheckShadowTexture();
|
||||
game.Graphics.BindTexture( shadowTex );
|
||||
game.Graphics.AlphaTest = false;
|
||||
if( !boundShadowTex ) {
|
||||
game.Graphics.BindTexture( shadowTex );
|
||||
boundShadowTex = true;
|
||||
}
|
||||
game.Graphics.UpdateDynamicIndexedVb( DrawMode.Triangles, vb, verts, index, index * 6 / 4 );
|
||||
game.Graphics.AlphaTest = true;
|
||||
}
|
||||
|
||||
unsafe bool CalculateShadow( Vector3I* coords, ref int coordsCount, float x, float z, int posY, out float y, out byte rgb ) {
|
||||
y = 0; rgb = 80;
|
||||
unsafe bool CalculateShadow( Vector3I* coords, ref int coordsCount, float x, float z, int posY, out float y, out byte alpha ) {
|
||||
y = 0; alpha = 0;
|
||||
int blockX = Utils.Floor( x ), blockZ = Utils.Floor( z );
|
||||
Vector3I p = new Vector3I( blockX, 0, blockZ );
|
||||
BlockInfo info = game.BlockInfo;
|
||||
|
||||
if( !game.Map.IsValidPos( p ) || Position.Y < 0 ) return false;
|
||||
if( Position.Y < 0 ) return false;
|
||||
for( int i = 0; i < 4; i++ )
|
||||
if( coords[i] == p ) return false;
|
||||
|
||||
while( posY >= 0 ) {
|
||||
byte block = game.Map.GetBlock( blockX, posY, blockZ );
|
||||
byte block = GetShadowBlock( blockX, posY, blockZ );
|
||||
if( !(info.IsAir[block] || info.IsSprite[block] || info.IsLiquid[block]) ) {
|
||||
float blockY = y = posY + info.MaxBB[block].Y;
|
||||
if( blockY < Position.Y + 0.01f ) { y = blockY; break; }
|
||||
@ -124,16 +91,23 @@ namespace ClassicalSharp {
|
||||
}
|
||||
|
||||
coords[coordsCount] = p; coordsCount++;
|
||||
if( (Position.Y - posY) <= 16 ) { y += 1/64f; rgb = (byte)(80 * (Position.Y - posY) / 16); }
|
||||
else if( (Position.Y - posY) <= 32 ) y += 1/16f;
|
||||
else if( (Position.Y - posY) <= 96 ) y += 1/8f;
|
||||
else y += 1/4f;
|
||||
if( (Position.Y - posY) <= 6 ) { y += 1/64f; alpha = (byte)(255 - 255 * (Position.Y - posY) / 6); }
|
||||
else if( (Position.Y - posY) <= 16 ) { y += 1/64f; alpha = 0; }
|
||||
else if( (Position.Y - posY) <= 32 ) { y += 1/16f; alpha = 0; }
|
||||
else if( (Position.Y - posY) <= 96 ) { y += 1/8f; alpha = 0; }
|
||||
else { y += 1/4f; alpha = 0; }
|
||||
return true;
|
||||
}
|
||||
|
||||
void DrawShadowPart( VertexPos3fTex2fCol4b[] verts, ref int index, float y, byte rgb,
|
||||
byte GetShadowBlock( int x, int y, int z ) {
|
||||
if( x < 0 || z < 0 || x >= game.Map.Width || z >= game.Map.Length )
|
||||
return y == (game.Map.SidesHeight - 1) ? (byte)game.Map.SidesBlock : (byte)0;
|
||||
return game.Map.GetBlock( x, y, z );
|
||||
}
|
||||
|
||||
void DrawShadowPart( VertexPos3fTex2fCol4b[] verts, ref int index, float y, byte alpha,
|
||||
float x1, float z1, float x2, float z2, TextureRec rec ) {
|
||||
FastColour col = new FastColour( rgb, rgb, rgb );
|
||||
FastColour col = FastColour.White; col.A = alpha;
|
||||
verts[index++] = new VertexPos3fTex2fCol4b( x1, y, z1, rec.U1, rec.V1, col );
|
||||
verts[index++] = new VertexPos3fTex2fCol4b( x2, y, z1, rec.U2, rec.V1, col );
|
||||
verts[index++] = new VertexPos3fTex2fCol4b( x2, y, z2, rec.U2, rec.V2, col );
|
||||
@ -147,7 +121,7 @@ namespace ClassicalSharp {
|
||||
using( Bitmap bmp = new Bitmap( size, size ) )
|
||||
using( FastBitmap fastBmp = new FastBitmap( bmp, true, false ) )
|
||||
{
|
||||
int inPix = new FastColour( 127, 127, 127, 200 ).ToArgb();
|
||||
int inPix = new FastColour( 0, 0, 0, 200 ).ToArgb();
|
||||
int outPix = inPix & 0xFFFFFF;
|
||||
for( int y = 0; y < fastBmp.Height; y++ ) {
|
||||
int* row = fastBmp.GetRowPtr( y );
|
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using ClassicalSharp.GraphicsAPI;
|
||||
using ClassicalSharp.Model;
|
||||
using ClassicalSharp.Network;
|
||||
using OpenTK;
|
||||
@ -23,6 +24,54 @@ namespace ClassicalSharp {
|
||||
SetModel( "humanoid" );
|
||||
}
|
||||
|
||||
DateTime lastModelChange = new DateTime( 1, 1, 1 );
|
||||
public void SetModel( string modelName ) {
|
||||
ModelName = modelName;
|
||||
Model = game.ModelCache.GetModel( ModelName );
|
||||
lastModelChange = DateTime.UtcNow;
|
||||
MobTextureId = -1;
|
||||
}
|
||||
|
||||
protected Texture nameTex;
|
||||
protected internal int PlayerTextureId = -1, MobTextureId = -1;
|
||||
|
||||
public override void Despawn() {
|
||||
game.Graphics.DeleteTexture( ref PlayerTextureId );
|
||||
game.Graphics.DeleteTexture( ref nameTex.ID );
|
||||
if( shadowTex != -1 )
|
||||
game.Graphics.DeleteTexture( ref shadowTex );
|
||||
}
|
||||
|
||||
protected void InitRenderingData() {
|
||||
using( Font font = new Font( game.FontName, 20 ) ) {
|
||||
DrawTextArgs args = new DrawTextArgs( DisplayName, font, true );
|
||||
nameTex = game.Drawer2D.MakeBitmappedTextTexture( ref args, 0, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateNameFont() {
|
||||
game.Graphics.DeleteTexture( ref nameTex );
|
||||
InitRenderingData();
|
||||
}
|
||||
|
||||
protected void DrawName() {
|
||||
IGraphicsApi api = game.Graphics;
|
||||
api.BindTexture( nameTex.ID );
|
||||
Vector3 pos = Position; pos.Y += Model.NameYOffset;
|
||||
|
||||
Vector3 p111, p121, p212, p222;
|
||||
FastColour col = FastColour.White;
|
||||
Vector2 size = new Vector2( nameTex.Width / 70f, nameTex.Height / 70f );
|
||||
Utils.CalcBillboardPoints( size, pos, ref game.View, out p111, out p121, out p212, out p222 );
|
||||
api.texVerts[0] = new VertexPos3fTex2fCol4b( p111, nameTex.U1, nameTex.V2, col );
|
||||
api.texVerts[1] = new VertexPos3fTex2fCol4b( p121, nameTex.U1, nameTex.V1, col );
|
||||
api.texVerts[2] = new VertexPos3fTex2fCol4b( p222, nameTex.U2, nameTex.V1, col );
|
||||
api.texVerts[3] = new VertexPos3fTex2fCol4b( p212, nameTex.U2, nameTex.V2, col );
|
||||
|
||||
api.SetBatchFormat( VertexFormat.Pos3fTex2fCol4b );
|
||||
api.UpdateDynamicIndexedVb( DrawMode.Triangles, api.texVb, api.texVerts, 4, 6 );
|
||||
}
|
||||
|
||||
protected void CheckSkin() {
|
||||
DownloadedItem item;
|
||||
game.AsyncDownloader.TryGetItem( SkinIdentifier, out item );
|
||||
@ -57,14 +106,6 @@ namespace ClassicalSharp {
|
||||
SkinType = game.DefaultPlayerSkinType;
|
||||
}
|
||||
|
||||
DateTime lastModelChange = new DateTime( 1, 1, 1 );
|
||||
public void SetModel( string modelName ) {
|
||||
ModelName = modelName;
|
||||
Model = game.ModelCache.GetModel( ModelName );
|
||||
lastModelChange = DateTime.UtcNow;
|
||||
MobTextureId = -1;
|
||||
}
|
||||
|
||||
unsafe static void ClearHat( Bitmap bmp, SkinType skinType ) {
|
||||
using( FastBitmap fastBmp = new FastBitmap( bmp, true, false ) ) {
|
||||
int sizeX = (bmp.Width / 64) * 32;
|
||||
|
@ -348,9 +348,6 @@ namespace ClassicalSharp {
|
||||
game.SetNewScreen( new PauseScreen( game ) );
|
||||
} else if( key == Keys[KeyBinding.OpenInventory] ) {
|
||||
game.SetNewScreen( new BlockSelectScreen( game ) );
|
||||
} else if( key == Key.F8 ) {
|
||||
int newMode = ((int)game.LocalPlayer.Shadow + 1) % 3;
|
||||
game.LocalPlayer.Shadow = (EntityShadow)newMode;
|
||||
} else if( key == Key.F9 ) {
|
||||
game.ShowClock = !game.ShowClock;
|
||||
} else {
|
||||
|
@ -54,10 +54,9 @@ namespace ClassicalSharp {
|
||||
Vector3 camPos = game.CurrentCameraPos;
|
||||
bool underWater = camPos.Y < game.Map.EdgeHeight;
|
||||
graphics.AlphaBlending = true;
|
||||
if( underWater ) {
|
||||
game.LocalPlayer.DrawShadow( game.LocalPlayer.Shadow );
|
||||
game.Players.DrawShadows();
|
||||
if( underWater )
|
||||
game.WeatherRenderer.Render( deltaTime );
|
||||
}
|
||||
|
||||
graphics.BindTexture( edgeTexId );
|
||||
graphics.BindVb( edgesVb );
|
||||
@ -67,10 +66,8 @@ namespace ClassicalSharp {
|
||||
if( game.Map.EdgeBlock != Block.Air && camPos.Y >= yVisible )
|
||||
graphics.DrawIndexedVb_TrisT2fC4b( edgesVertices * 6 / 4, 0 );
|
||||
|
||||
if( !underWater ) {
|
||||
game.LocalPlayer.DrawShadow( game.LocalPlayer.Shadow );
|
||||
if( !underWater )
|
||||
game.WeatherRenderer.Render( deltaTime );
|
||||
}
|
||||
graphics.AlphaBlending = false;
|
||||
graphics.Texturing = false;
|
||||
graphics.AlphaTest = false;
|
||||
|
@ -20,6 +20,7 @@ namespace ClassicalSharp {
|
||||
public const string FpsLimit = "fpslimit";
|
||||
public const string AutoCloseLauncher = "autocloselauncher";
|
||||
public const string ViewBobbing = "viewbobbing";
|
||||
public const string EntityShadow = "entityshadow";
|
||||
|
||||
public const string HacksEnabled = "hacks-hacksenabled";
|
||||
public const string FieldOfView = "hacks-fov";
|
||||
@ -55,7 +56,7 @@ namespace ClassicalSharp {
|
||||
}
|
||||
|
||||
public enum EntityShadow {
|
||||
None, SnapToBlock, Circle,
|
||||
None, SnapToBlock, Circle, CircleAll,
|
||||
}
|
||||
|
||||
public static class Options {
|
||||
|
@ -138,7 +138,7 @@ namespace ClassicalSharp {
|
||||
} catch( ArgumentException ) {
|
||||
result = defValue;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
result = mapping;
|
||||
return true;
|
||||
}
|
||||
@ -247,7 +247,8 @@ namespace ClassicalSharp {
|
||||
}
|
||||
|
||||
public static int Floor( float value ) {
|
||||
return value >= 0 ? (int)value : (int)value - 1;
|
||||
int valueI = (int)value;
|
||||
return value < valueI ? valueI - 1 : valueI;
|
||||
}
|
||||
|
||||
public static int AdjViewDist( int value ) {
|
||||
@ -282,7 +283,7 @@ namespace ClassicalSharp {
|
||||
p222 = Transform( 0.5f, 0.5f, ref size, ref centre, ref up, ref right );
|
||||
}
|
||||
|
||||
static Vector3 Transform( float x, float y, ref Vector2 size,
|
||||
static Vector3 Transform( float x, float y, ref Vector2 size,
|
||||
ref Vector3 centre, ref Vector3 up, ref Vector3 right ) {
|
||||
return centre + right * x * size.X + up * y * size.Y;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user