mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-13 17:47:12 -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 );
|
||||
int atlas1DHeight = Utils.NextPowerOf2( elementsPerAtlas1D * atlas2D.elementSize );
|
||||
|
||||
Convert2DTo1D( atlas2D, atlasesCount, elementsPerAtlas1D );
|
||||
Convert2DTo1D( atlas2D, atlasesCount, atlas1DHeight );
|
||||
elementsPerBitmap = atlas1DHeight / atlas2D.elementSize;
|
||||
invElementSize = 1f / elementsPerBitmap;
|
||||
}
|
||||
@ -63,10 +63,8 @@ namespace ClassicalSharp {
|
||||
void Make1DTexture( int i, FastBitmap atlas, TerrainAtlas2D atlas2D, int atlas1DHeight, ref int index ) {
|
||||
int elemSize = atlas2D.elementSize;
|
||||
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++ ) {
|
||||
|
||||
if( index >= 256 ) break;
|
||||
FastBitmap.MovePortion( (index & 0x0F) * elemSize, (index >> 4) * elemSize,
|
||||
0, index1D * elemSize, atlas, dst, elemSize );
|
||||
index++;
|
||||
|
@ -55,7 +55,7 @@ namespace Launcher2 {
|
||||
fastBmp.Width, fastBmp.Height, 32, 0 );
|
||||
API.XPutImage( API.DefaultDisplay, x11Info.WindowHandle, gc, image,
|
||||
0, 0, 0, 0, fastBmp.Width, fastBmp.Height );
|
||||
API.XDestroyImage( image );
|
||||
API.XFree( image );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -44,9 +44,6 @@ namespace OpenTK.Platform.X11 {
|
||||
public extern static Bool XCheckWindowEvent(Display display, Window w, EventMask event_mask, ref XEvent event_return);
|
||||
[DllImport("libX11"), SuppressUnmanagedCodeSecurity]
|
||||
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]
|
||||
public extern static int XDestroyWindow(IntPtr display, IntPtr window);
|
||||
|
Loading…
x
Reference in New Issue
Block a user