Fix crashing on close, remove file that somehow magically appeared?

This commit is contained in:
UnknownShadow200 2015-07-21 19:05:59 +10:00
parent 25d7cbda9e
commit f99e9eeb3a
3 changed files with 9 additions and 47 deletions

View File

@ -12,6 +12,7 @@ namespace ClassicalSharp {
protected internal int PlayerTextureId = -1, MobTextureId = -1;
public override void Despawn() {
if( api == null ) return;
api.DeleteTexture( ref PlayerTextureId );
api.DeleteTexture( ref nameTex.ID );
}

View File

@ -53,16 +53,17 @@ namespace OpenTK {
del = null;
}
}
protected bool IsInvalidAddress( IntPtr address ) {
return address == IntPtr.Zero || address == new IntPtr(1) ||
address == new IntPtr(2) || address == new IntPtr(-1);
}
// Creates a System.Delegate that can be used to call a dynamically exported OpenGL function.
// Creates a System.Delegate that can be used to call a dynamically exported OpenGL function.
protected internal void GetExtensionDelegate<T>( string name, out T del ) where T : class {
IntPtr address = GetAddress( name );
if (address == IntPtr.Zero || address == new IntPtr(1) ||
address == new IntPtr(2) || address == new IntPtr(-1)) {
del = null;
return;
}
del = (T)(object)Marshal.GetDelegateForFunctionPointer( address, typeof(T) );
del = IsInvalidAddress( address ) ? null :
(T)(object)Marshal.GetDelegateForFunctionPointer( address, typeof( T ) );
}
}
}

View File

@ -1,40 +0,0 @@
using System;
namespace ClassicalSharp.Renderers {
/// <summary> Minimialistic environment renderer - only sets the clear colour to be sky colour.
/// (no fog, clouds, or proper overhead sky) </summary>
public class MinimalEnvRenderer : EnvRenderer {
public MinimalEnvRenderer( Game window ) {
Window = window;
Map = Window.Map;
}
public override void Render( double deltaTime ) {
Graphics.ClearColour( Map.SkyCol );
}
public override void Init() {
base.Init();
Graphics.Fog = false;
Graphics.ClearColour( Map.SkyCol );
}
public override void OnNewMap( object sender, EventArgs e ) {
}
public override void OnNewMapLoaded( object sender, EventArgs e ) {
Graphics.ClearColour( Map.SkyCol );
}
protected override void CloudsColourChanged() {
}
protected override void FogColourChanged() {
}
protected override void SkyColourChanged() {
}
}
}