mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-17 03:25:14 -04:00
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:
parent
fc4028f013
commit
d50476e760
@ -201,7 +201,7 @@ namespace ClassicalSharp.Entities {
|
|||||||
using( FastBitmap fastBmp = new FastBitmap( bmp, true, false ) )
|
using( FastBitmap fastBmp = new FastBitmap( bmp, true, false ) )
|
||||||
{
|
{
|
||||||
int inPix = new FastColour( 0, 0, 0, 200 ).ToArgb();
|
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++ ) {
|
for( int y = 0; y < fastBmp.Height; y++ ) {
|
||||||
int* row = fastBmp.GetRowPtr( y );
|
int* row = fastBmp.GetRowPtr( y );
|
||||||
for( int x = 0; x < fastBmp.Width; x++ ) {
|
for( int x = 0; x < fastBmp.Width; x++ ) {
|
||||||
|
@ -8,7 +8,6 @@ using System.Collections.Generic;
|
|||||||
|
|
||||||
namespace ClassicalSharp.Generator {
|
namespace ClassicalSharp.Generator {
|
||||||
|
|
||||||
// TODO: figure out how noise functions differ, probably based on rnd.
|
|
||||||
public sealed partial class NotchyGenerator {
|
public sealed partial class NotchyGenerator {
|
||||||
|
|
||||||
void FillOblateSpheroid( int x, int y, int z, float radius, byte block ) {
|
void FillOblateSpheroid( int x, int y, int z, float radius, byte block ) {
|
||||||
|
@ -165,7 +165,7 @@ namespace ClassicalSharp.Net {
|
|||||||
|
|
||||||
void HandleCpeSetTextHotkey() {
|
void HandleCpeSetTextHotkey() {
|
||||||
string label = reader.ReadAsciiString();
|
string label = reader.ReadAsciiString();
|
||||||
string action = reader.ReadAsciiString();
|
string action = reader.ReadCp437String();
|
||||||
int keyCode = reader.ReadInt32();
|
int keyCode = reader.ReadInt32();
|
||||||
byte keyMods = reader.ReadUInt8();
|
byte keyMods = reader.ReadUInt8();
|
||||||
|
|
||||||
@ -173,7 +173,7 @@ namespace ClassicalSharp.Net {
|
|||||||
Key key = LwjglToKey.Map[keyCode];
|
Key key = LwjglToKey.Map[keyCode];
|
||||||
if( key == Key.Unknown ) return;
|
if( key == Key.Unknown ) return;
|
||||||
|
|
||||||
Console.WriteLine( "CPE Hotkey added: " + key + "," + keyMods + " : " + action );
|
Utils.LogDebug( "CPE Hotkey added: " + key + "," + keyMods + " : " + action );
|
||||||
if( action == "" ) {
|
if( action == "" ) {
|
||||||
game.InputHandler.Hotkeys.RemoveHotkey( key, keyMods );
|
game.InputHandler.Hotkeys.RemoveHotkey( key, keyMods );
|
||||||
} else if( action[action.Length - 1] == '\n' ) {
|
} else if( action[action.Length - 1] == '\n' ) {
|
||||||
|
@ -66,7 +66,7 @@ namespace ClassicalSharp.Net {
|
|||||||
BlockInfo info = game.BlockInfo;
|
BlockInfo info = game.BlockInfo;
|
||||||
info.ResetBlockInfo( block, false );
|
info.ResetBlockInfo( block, false );
|
||||||
|
|
||||||
info.Name[block] = reader.ReadAsciiString();
|
info.Name[block] = reader.ReadCp437String();
|
||||||
info.Collide[block] = (CollideType)reader.ReadUInt8();
|
info.Collide[block] = (CollideType)reader.ReadUInt8();
|
||||||
if( info.Collide[block] != CollideType.Solid ) {
|
if( info.Collide[block] != CollideType.Solid ) {
|
||||||
info.IsTransparent[block] = true;
|
info.IsTransparent[block] = true;
|
||||||
|
@ -263,7 +263,7 @@ namespace ClassicalSharp.Net {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void HandleKick() {
|
void HandleKick() {
|
||||||
string reason = reader.ReadAsciiString();
|
string reason = reader.ReadCp437String();
|
||||||
game.Disconnect( "&eLost connection to the server", reason );
|
game.Disconnect( "&eLost connection to the server", reason );
|
||||||
Dispose();
|
Dispose();
|
||||||
}
|
}
|
||||||
|
@ -32,10 +32,10 @@ namespace ClassicalSharp {
|
|||||||
public virtual void GetPickedBlock( PickedPos pos ) { }
|
public virtual void GetPickedBlock( PickedPos pos ) { }
|
||||||
|
|
||||||
protected float AdjustPitch( float value ) {
|
protected float AdjustPitch( float value ) {
|
||||||
if( value >= 90.00f && value <= 90.25f ) return 90.25f * Utils.Deg2Rad;
|
if( value >= 90.0f && value <= 90.1f ) return 90.1f * Utils.Deg2Rad;
|
||||||
if( value >= 89.75f && value <= 90.00f ) return 89.75f * Utils.Deg2Rad;
|
if( value >= 89.9f && value <= 90.0f ) return 89.9f * Utils.Deg2Rad;
|
||||||
if( value >= 270.00f && value <= 270.25f ) return 270.25f * Utils.Deg2Rad;
|
if( value >= 270.0f && value <= 270.1f ) return 270.1f * Utils.Deg2Rad;
|
||||||
if( value >= 269.75f && value <= 270.00f ) return 269.75f * Utils.Deg2Rad;
|
if( value >= 269.9f && value <= 270.0f ) return 269.9f * Utils.Deg2Rad;
|
||||||
return value * Utils.Deg2Rad;
|
return value * Utils.Deg2Rad;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user