mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-14 18:15:28 -04:00
Fix crashing of client on all platforms, fix new launcher crashing on linux.
This commit is contained in:
parent
7cf129963d
commit
d06bca9dba
@ -44,7 +44,7 @@ namespace ClassicalSharp {
|
|||||||
elementsPerAtlas1D = Math.Min( elementsPerFullAtlas, totalElements );
|
elementsPerAtlas1D = Math.Min( elementsPerFullAtlas, totalElements );
|
||||||
int atlas1DHeight = Utils.NextPowerOf2( elementsPerAtlas1D * atlas2D.elementSize );
|
int atlas1DHeight = Utils.NextPowerOf2( elementsPerAtlas1D * atlas2D.elementSize );
|
||||||
|
|
||||||
Convert2DTo1D( atlas2D, atlasesCount, elementsPerAtlas1D );
|
Convert2DTo1D( atlas2D, atlasesCount, atlas1DHeight );
|
||||||
elementsPerBitmap = atlas1DHeight / atlas2D.elementSize;
|
elementsPerBitmap = atlas1DHeight / atlas2D.elementSize;
|
||||||
invElementSize = 1f / elementsPerBitmap;
|
invElementSize = 1f / elementsPerBitmap;
|
||||||
}
|
}
|
||||||
@ -65,8 +65,6 @@ namespace ClassicalSharp {
|
|||||||
using( Bitmap atlas1d = new Bitmap( atlas2D.elementSize, atlas1DHeight ) ) {
|
using( Bitmap atlas1d = new Bitmap( atlas2D.elementSize, atlas1DHeight ) ) {
|
||||||
using( FastBitmap dst = new FastBitmap( atlas1d, true ) ) {
|
using( FastBitmap dst = new FastBitmap( atlas1d, true ) ) {
|
||||||
for( int index1D = 0; index1D < elementsPerAtlas1D; index1D++ ) {
|
for( int index1D = 0; index1D < elementsPerAtlas1D; index1D++ ) {
|
||||||
|
|
||||||
if( index >= 256 ) break;
|
|
||||||
FastBitmap.MovePortion( (index & 0x0F) * elemSize, (index >> 4) * elemSize,
|
FastBitmap.MovePortion( (index & 0x0F) * elemSize, (index >> 4) * elemSize,
|
||||||
0, index1D * elemSize, atlas, dst, elemSize );
|
0, index1D * elemSize, atlas, dst, elemSize );
|
||||||
index++;
|
index++;
|
||||||
|
@ -55,7 +55,7 @@ namespace Launcher2 {
|
|||||||
fastBmp.Width, fastBmp.Height, 32, 0 );
|
fastBmp.Width, fastBmp.Height, 32, 0 );
|
||||||
API.XPutImage( API.DefaultDisplay, x11Info.WindowHandle, gc, image,
|
API.XPutImage( API.DefaultDisplay, x11Info.WindowHandle, gc, image,
|
||||||
0, 0, 0, 0, fastBmp.Width, fastBmp.Height );
|
0, 0, 0, 0, fastBmp.Width, fastBmp.Height );
|
||||||
API.XDestroyImage( image );
|
API.XFree( image );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,9 +45,6 @@ namespace OpenTK.Platform.X11 {
|
|||||||
[DllImport("libX11"), SuppressUnmanagedCodeSecurity]
|
[DllImport("libX11"), SuppressUnmanagedCodeSecurity]
|
||||||
public extern static Bool XCheckTypedWindowEvent(Display display, Window w, XEventName event_type, ref XEvent event_return);
|
public extern static Bool XCheckTypedWindowEvent(Display display, Window w, XEventName event_type, ref XEvent event_return);
|
||||||
|
|
||||||
[DllImport("libX11"), SuppressUnmanagedCodeSecurity]
|
|
||||||
public extern static int XDestroyImage(IntPtr image);
|
|
||||||
|
|
||||||
[DllImport("libX11"), SuppressUnmanagedCodeSecurity]
|
[DllImport("libX11"), SuppressUnmanagedCodeSecurity]
|
||||||
public extern static int XDestroyWindow(IntPtr display, IntPtr window);
|
public extern static int XDestroyWindow(IntPtr display, IntPtr window);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user