Allow camera to go 0.15 degrees closer to truly vertical (Thanks 123DMWM), also read code page instead of ascii strings for 'disconnect packets' and block names in 'DefineBlock'.

This commit is contained in:
UnknownShadow200 2016-04-26 11:42:08 +10:00
parent fc4028f013
commit d50476e760
6 changed files with 9 additions and 10 deletions

View File

@ -201,7 +201,7 @@ namespace ClassicalSharp.Entities {
using( FastBitmap fastBmp = new FastBitmap( bmp, true, false ) )
{
int inPix = new FastColour( 0, 0, 0, 200 ).ToArgb();
int outPix = inPix & 0xFFFFFF;
int outPix = new FastColour( 0, 0, 0, 0 ).ToArgb();
for( int y = 0; y < fastBmp.Height; y++ ) {
int* row = fastBmp.GetRowPtr( y );
for( int x = 0; x < fastBmp.Width; x++ ) {

View File

@ -8,7 +8,6 @@ using System.Collections.Generic;
namespace ClassicalSharp.Generator {
// TODO: figure out how noise functions differ, probably based on rnd.
public sealed partial class NotchyGenerator {
void FillOblateSpheroid( int x, int y, int z, float radius, byte block ) {

View File

@ -165,7 +165,7 @@ namespace ClassicalSharp.Net {
void HandleCpeSetTextHotkey() {
string label = reader.ReadAsciiString();
string action = reader.ReadAsciiString();
string action = reader.ReadCp437String();
int keyCode = reader.ReadInt32();
byte keyMods = reader.ReadUInt8();
@ -173,7 +173,7 @@ namespace ClassicalSharp.Net {
Key key = LwjglToKey.Map[keyCode];
if( key == Key.Unknown ) return;
Console.WriteLine( "CPE Hotkey added: " + key + "," + keyMods + " : " + action );
Utils.LogDebug( "CPE Hotkey added: " + key + "," + keyMods + " : " + action );
if( action == "" ) {
game.InputHandler.Hotkeys.RemoveHotkey( key, keyMods );
} else if( action[action.Length - 1] == '\n' ) {

View File

@ -66,7 +66,7 @@ namespace ClassicalSharp.Net {
BlockInfo info = game.BlockInfo;
info.ResetBlockInfo( block, false );
info.Name[block] = reader.ReadAsciiString();
info.Name[block] = reader.ReadCp437String();
info.Collide[block] = (CollideType)reader.ReadUInt8();
if( info.Collide[block] != CollideType.Solid ) {
info.IsTransparent[block] = true;

View File

@ -263,7 +263,7 @@ namespace ClassicalSharp.Net {
}
void HandleKick() {
string reason = reader.ReadAsciiString();
string reason = reader.ReadCp437String();
game.Disconnect( "&eLost connection to the server", reason );
Dispose();
}

View File

@ -32,10 +32,10 @@ namespace ClassicalSharp {
public virtual void GetPickedBlock( PickedPos pos ) { }
protected float AdjustPitch( float value ) {
if( value >= 90.00f && value <= 90.25f ) return 90.25f * Utils.Deg2Rad;
if( value >= 89.75f && value <= 90.00f ) return 89.75f * Utils.Deg2Rad;
if( value >= 270.00f && value <= 270.25f ) return 270.25f * Utils.Deg2Rad;
if( value >= 269.75f && value <= 270.00f ) return 269.75f * Utils.Deg2Rad;
if( value >= 90.0f && value <= 90.1f ) return 90.1f * Utils.Deg2Rad;
if( value >= 89.9f && value <= 90.0f ) return 89.9f * Utils.Deg2Rad;
if( value >= 270.0f && value <= 270.1f ) return 270.1f * Utils.Deg2Rad;
if( value >= 269.9f && value <= 270.0f ) return 269.9f * Utils.Deg2Rad;
return value * Utils.Deg2Rad;
}
}