mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-13 17:47:12 -04:00
Minor cleanups here and there.
This commit is contained in:
parent
1ae63a0fee
commit
359060889f
@ -97,7 +97,6 @@ namespace ClassicalSharp {
|
||||
textInput.Dispose();
|
||||
status.Dispose();
|
||||
bottomRight.Dispose();
|
||||
status.Dispose();
|
||||
GraphicsApi.DeleteTexture( ref pageTexture );
|
||||
GraphicsApi.DeleteTexture( ref announcementTexture );
|
||||
Window.ChatReceived -= ChatReceived;
|
||||
|
@ -86,6 +86,7 @@ namespace ClassicalSharp {
|
||||
GraphicsApi.DeleteTexture( ref info[i].Texture );
|
||||
}
|
||||
Window.CpeListInfoAdded -= PlayerListInfoAdded;
|
||||
Window.CpeListInfoChanged -= PlayerListInfoChanged;
|
||||
Window.CpeListInfoRemoved -= PlayerListInfoRemoved;
|
||||
}
|
||||
|
||||
|
@ -43,6 +43,14 @@ namespace ClassicalSharp {
|
||||
B = c.B;
|
||||
}
|
||||
|
||||
public static FastColour Scale( FastColour value, float t ) {
|
||||
FastColour result = value;
|
||||
result.R = (byte)( value.R * t );
|
||||
result.G = (byte)( value.G * t );
|
||||
result.B = (byte)( value.B * t );
|
||||
return result;
|
||||
}
|
||||
|
||||
public Color ToColor() {
|
||||
return Color.FromArgb( A, R, G, B );
|
||||
}
|
||||
|
@ -91,9 +91,7 @@ namespace Launcher {
|
||||
}
|
||||
|
||||
static void HtmlDecode( string value, StringBuilder output ) {
|
||||
int length = value.Length;
|
||||
|
||||
for( int i = 0; i < length; i++ ) {
|
||||
for( int i = 0; i < value.Length; i++ ) {
|
||||
char token = value[i];
|
||||
if( token != '&' ) {
|
||||
output.Append( token );
|
||||
@ -122,7 +120,6 @@ namespace Launcher {
|
||||
i = entityEnd;
|
||||
char decodedEntity;
|
||||
if( Lookup( entity, out decodedEntity ) ) {
|
||||
token = decodedEntity;
|
||||
output.Append( decodedEntity );
|
||||
} else { // Invalid token.
|
||||
output.Append( '&' );
|
||||
|
15
Map.cs
15
Map.cs
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using EnvDefault = ClassicalSharp.Renderers.EnvRenderer;
|
||||
|
||||
namespace ClassicalSharp {
|
||||
|
||||
@ -134,17 +133,9 @@ namespace ClassicalSharp {
|
||||
}
|
||||
|
||||
void AdjustLight( FastColour normal, ref FastColour xSide, ref FastColour zSide, ref FastColour yBottom ) {
|
||||
xSide = Scale( normal, 0.6f );
|
||||
zSide = Scale( normal, 0.8f );
|
||||
yBottom = Scale( normal, 0.5f );
|
||||
}
|
||||
|
||||
static FastColour Scale( FastColour value, float t ) {
|
||||
FastColour result = value;
|
||||
result.R = (byte)( value.R * t );
|
||||
result.G = (byte)( value.G * t );
|
||||
result.B = (byte)( value.B * t );
|
||||
return result;
|
||||
xSide = FastColour.Scale( normal, 0.6f );
|
||||
zSide = FastColour.Scale( normal, 0.8f );
|
||||
yBottom = FastColour.Scale( normal, 0.5f );
|
||||
}
|
||||
|
||||
public void UseRawMap( byte[] map, int width, int height, int length ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user