mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-15 10:35:11 -04:00
Slightly reduce OpenTK even further, fix indention of FastColour.
This commit is contained in:
parent
6d6067ec1c
commit
92f3e723a8
BIN
OpenTK.dll
BIN
OpenTK.dll
Binary file not shown.
@ -8,40 +8,40 @@ namespace ClassicalSharp {
|
|||||||
|
|
||||||
public byte A, R, G, B;
|
public byte A, R, G, B;
|
||||||
|
|
||||||
public FastColour( byte r, byte g, byte b, byte a ) {
|
public FastColour( byte r, byte g, byte b, byte a ) {
|
||||||
A = a;
|
A = a;
|
||||||
R = r;
|
R = r;
|
||||||
G = g;
|
G = g;
|
||||||
B = b;
|
B = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
public FastColour( int r, int g, int b, int a ) {
|
public FastColour( int r, int g, int b, int a ) {
|
||||||
A = (byte)a;
|
A = (byte)a;
|
||||||
R = (byte)r;
|
R = (byte)r;
|
||||||
G = (byte)g;
|
G = (byte)g;
|
||||||
B = (byte)b;
|
B = (byte)b;
|
||||||
}
|
}
|
||||||
|
|
||||||
public FastColour( byte r, byte g, byte b ) {
|
public FastColour( byte r, byte g, byte b ) {
|
||||||
A = 255;
|
A = 255;
|
||||||
R = r;
|
R = r;
|
||||||
G = g;
|
G = g;
|
||||||
B = b;
|
B = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
public FastColour( int r, int g, int b ) {
|
public FastColour( int r, int g, int b ) {
|
||||||
A = 255;
|
A = 255;
|
||||||
R = (byte)r;
|
R = (byte)r;
|
||||||
G = (byte)g;
|
G = (byte)g;
|
||||||
B = (byte)b;
|
B = (byte)b;
|
||||||
}
|
}
|
||||||
|
|
||||||
public FastColour( Color c ) {
|
public FastColour( Color c ) {
|
||||||
A = c.A;
|
A = c.A;
|
||||||
R = c.R;
|
R = c.R;
|
||||||
G = c.G;
|
G = c.G;
|
||||||
B = c.B;
|
B = c.B;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static FastColour Scale( FastColour value, float t ) {
|
public static FastColour Scale( FastColour value, float t ) {
|
||||||
FastColour result = value;
|
FastColour result = value;
|
||||||
@ -51,32 +51,32 @@ namespace ClassicalSharp {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Color ToColor() {
|
public Color ToColor() {
|
||||||
return Color.FromArgb( A, R, G, B );
|
return Color.FromArgb( A, R, G, B );
|
||||||
}
|
}
|
||||||
|
|
||||||
public Color4 ToColor4() {
|
public Color4 ToColor4() {
|
||||||
return new Color4( R, G, B, A );
|
return new Color4( R, G, B, A );
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString() {
|
public override string ToString() {
|
||||||
return R + ", " + G + ", " + B + " : " + A;
|
return R + ", " + G + ", " + B + " : " + A;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ToRGBHexString() {
|
public string ToRGBHexString() {
|
||||||
return Utils.ToHexString( new byte[] { R, G, B } );
|
return Utils.ToHexString( new byte[] { R, G, B } );
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Equals( object obj ) {
|
public override bool Equals( object obj ) {
|
||||||
return ( obj is FastColour ) && Equals( (FastColour)obj );
|
return ( obj is FastColour ) && Equals( (FastColour)obj );
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals( FastColour other ) {
|
public bool Equals( FastColour other ) {
|
||||||
return A == other.A && R == other.R && G == other.G && B == other.B;
|
return A == other.A && R == other.R && G == other.G && B == other.B;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int GetHashCode() {
|
public override int GetHashCode() {
|
||||||
return A << 24 | R << 16 | G << 8 | B;
|
return A << 24 | R << 16 | G << 8 | B;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool operator == ( FastColour left, FastColour right ) {
|
public static bool operator == ( FastColour left, FastColour right ) {
|
||||||
@ -87,22 +87,22 @@ namespace ClassicalSharp {
|
|||||||
return !left.Equals( right );
|
return !left.Equals( right );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static implicit operator FastColour( Color col ) {
|
public static implicit operator FastColour( Color col ) {
|
||||||
return new FastColour( col );
|
return new FastColour( col );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static implicit operator Color( FastColour col ) {
|
public static implicit operator Color( FastColour col ) {
|
||||||
return Color.FromArgb( col.A, col.R, col.G, col.B );
|
return Color.FromArgb( col.A, col.R, col.G, col.B );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static FastColour Red = new FastColour( 255, 0, 0 );
|
public static FastColour Red = new FastColour( 255, 0, 0 );
|
||||||
public static FastColour Green = new FastColour( 0, 255, 0 );
|
public static FastColour Green = new FastColour( 0, 255, 0 );
|
||||||
public static FastColour Blue = new FastColour( 0, 0, 255 );
|
public static FastColour Blue = new FastColour( 0, 0, 255 );
|
||||||
public static FastColour White = new FastColour( 255, 255, 255 );
|
public static FastColour White = new FastColour( 255, 255, 255 );
|
||||||
public static FastColour Black = new FastColour( 0, 0, 0 );
|
public static FastColour Black = new FastColour( 0, 0, 0 );
|
||||||
|
|
||||||
public static FastColour Yellow = new FastColour( 255, 255, 0 );
|
public static FastColour Yellow = new FastColour( 255, 255, 0 );
|
||||||
public static FastColour Magenta = new FastColour( 255, 0, 255 );
|
public static FastColour Magenta = new FastColour( 255, 0, 255 );
|
||||||
public static FastColour Cyan = new FastColour( 0, 255, 255 );
|
public static FastColour Cyan = new FastColour( 0, 255, 255 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user