mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-13 09:35:23 -04:00
Fix crashing on close, remove file that somehow magically appeared?
This commit is contained in:
parent
25d7cbda9e
commit
f99e9eeb3a
@ -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 );
|
||||
}
|
||||
|
@ -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 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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() {
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user