Browse Source

Remove Lime backend (#684) close #682

Pavel Alexandrov 6 years ago
parent
commit
609814e202

+ 1 - 1
all.hxml

@@ -4,7 +4,7 @@
 --macro include('h3d')
 --macro include('h2d',true,['h2d.domkit'])
 --macro include('hxsl',true,['hxsl.Macros','hxsl.CacheFile','hxsl.CacheFileBuilder','hxsl.Checker'])
---macro include('hxd',true,['hxd.res.FileTree','hxd.Res','hxd.impl.BitsBuilder','hxd.impl.Air3File','hxd.fmt.pak.Build','hxd.impl.LimeStage','hxd.fs.LimeFileSystem','hxd.net.SteamHost','hxd.snd.efx','hxd.snd.openal','hxd.res.Config'])
+--macro include('hxd',true,['hxd.res.FileTree','hxd.Res','hxd.impl.BitsBuilder','hxd.impl.Air3File','hxd.fmt.pak.Build','hxd.net.SteamHost','hxd.snd.efx','hxd.snd.openal','hxd.res.Config'])
 --no-output
 --each
 

+ 0 - 10
h2d/Text.hx

@@ -33,9 +33,6 @@ class Text extends Drawable {
 	var constraintWidth:Float = -1;
 	var realMaxWidth:Float = -1;
 
-	#if lime
-	var waShader : h3d.shader.WhiteAlpha;
-	#end
 	var sdfShader : h3d.shader.SignedDistanceField;
 
 	public function new( font : Font, ?parent : h2d.Object ) {
@@ -52,13 +49,6 @@ class Text extends Drawable {
 		if( this.font == font ) return font;
 		this.font = font;
 		if ( font != null ) {
-			#if lime
-			if( font.tile.getTexture().format == ALPHA ){
-				if( waShader == null ) addShader( waShader = new h3d.shader.WhiteAlpha() );
-			}else{
-				if( waShader != null ) removeShader( waShader );
-			}
-			#end
 			switch( font.type ) {
 				case BitmapFont:
 					if ( sdfShader != null ) {

+ 1 - 1
h3d/Engine.hx

@@ -67,7 +67,7 @@ class Engine {
 		window.addResizeEvent(onWindowResize);
 		#if macro
 		driver = new h3d.impl.NullDriver();
-		#elseif (js || cpp || hlsdl || usegl)
+		#elseif (js || hlsdl || usegl)
 		driver = new h3d.impl.GlDriver(antiAlias);
 		#elseif flash
 		driver = new h3d.impl.Stage3dDriver(antiAlias);

+ 0 - 12
h3d/impl/Driver.hx

@@ -18,18 +18,6 @@ typedef VertexBuffer = { b : js.html.webgl.Buffer, stride : Int #if multidriver,
 typedef Texture = { t : js.html.webgl.Texture, width : Int, height : Int, internalFmt : Int, pixelFmt : Int, bits : Int, bind : Int #if multidriver, driver : Driver #end };
 typedef DepthBuffer = { r : js.html.webgl.Renderbuffer #if multidriver, driver : Driver #end };
 typedef Query = {};
-#elseif nme
-typedef IndexBuffer = nme.gl.GLBuffer;
-typedef VertexBuffer = { b : nme.gl.GLBuffer, stride : Int };
-typedef Texture = { t : nme.gl.GLTexture, width : Int, height : Int, internalFmt : Int, pixelFmt : Int, bits : Int, bind : Int };
-typedef DepthBuffer = { r : nme.gl.Renderbuffer };
-typedef Query = {};
-#elseif lime
-typedef IndexBuffer = lime.graphics.opengl.GLBuffer;
-typedef VertexBuffer = { b : lime.graphics.opengl.GLBuffer, stride : Int };
-typedef Texture = { t : lime.graphics.opengl.GLTexture, width : Int, height : Int, internalFmt : Int, pixelFmt : Int, bits : Int, bind : Int };
-typedef DepthBuffer = { r : lime.graphics.opengl.GLRenderbuffer };
-typedef Query = {};
 #elseif hlsdl
 typedef IndexBuffer = { b : sdl.GL.Buffer, is32 : Bool };
 typedef VertexBuffer = { b : sdl.GL.Buffer, stride : Int };

+ 3 - 40
h3d/impl/GlDriver.hx

@@ -4,7 +4,7 @@ import h3d.mat.Pass;
 import h3d.mat.Stencil;
 import h3d.mat.Data;
 
-#if (js||cpp||hlsdl||usegl)
+#if (js||hlsdl||usegl)
 
 #if js
 import hxd.impl.TypedArray;
@@ -52,24 +52,6 @@ private typedef Uniform = js.html.webgl.UniformLocation;
 private typedef Program = js.html.webgl.Program;
 private typedef GLShader = js.html.webgl.Shader;
 private typedef Framebuffer = js.html.webgl.Framebuffer;
-#elseif lime
-import lime.graphics.opengl.GL;
-private typedef Uniform = Dynamic;
-private typedef Program = lime.graphics.opengl.GLProgram;
-private typedef GLShader = lime.graphics.opengl.GLShader;
-private typedef Framebuffer = lime.graphics.opengl.GLFramebuffer;
-private typedef Uint16Array = lime.utils.UInt16Array;
-private typedef Uint8Array = lime.utils.UInt8Array;
-private typedef Float32Array = lime.utils.Float32Array;
-#elseif nme
-import nme.gl.GL;
-private typedef Uniform = Dynamic;
-private typedef Program = nme.gl.GLProgram;
-private typedef GLShader = nme.gl.GLShader;
-private typedef Framebuffer = nme.gl.Framebuffer;
-private typedef Uint16Array = nme.utils.Int16Array;
-private typedef Uint8Array = nme.utils.UInt8Array;
-private typedef Float32Array = nme.utils.Float32Array;
 #elseif hlsdl
 import sdl.GL;
 private typedef Uniform = sdl.GL.Uniform;
@@ -79,9 +61,6 @@ private typedef Framebuffer = sdl.GL.Framebuffer;
 private typedef Texture = h3d.impl.Driver.Texture;
 private typedef Query = h3d.impl.Driver.Query;
 private typedef VertexArray = sdl.GL.VertexArray;
-#if cpp
-private typedef Float32Array = Array<cpp.Float32>;
-#end
 #elseif usegl
 import haxe.GLTypes;
 private typedef Uniform = haxe.GLTypes.Uniform;
@@ -137,7 +116,7 @@ private class CompiledProgram {
 }
 
 @:access(h3d.impl.Shader)
-#if (cpp||hlsdl||usegl)
+#if (hlsdl||usegl)
 @:build(h3d.impl.MacroHelper.replaceGL())
 #end
 class GlDriver extends Driver {
@@ -283,11 +262,6 @@ class GlDriver extends Driver {
 	override function begin(frame) {
 		this.frame = frame;
 		resetStream();
-		#if cpp
-		curAttribs = new Array<Bool>();
-		maxIdxCurAttribs = 0;
-		curMatBits = -1;
-		#end
 		gl.useProgram(null);
 		curShader = null;
 		curBuffer = null;
@@ -673,12 +647,7 @@ class GlDriver extends Driver {
 			var cop = Pass.getBlendOp(bits);
 			var aop = Pass.getBlendAlphaOp(bits);
 			if( cop == aop ) {
-				#if (nme || openfl)
-				if( OP[cop] != GL.FUNC_ADD )
-					throw "blendEquation() disable atm (crash)";
-				#else
 				gl.blendEquation(OP[cop]);
-				#end
 			}
 			else
 				gl.blendEquationSeparate(OP[cop], OP[aop]);
@@ -784,8 +753,6 @@ class GlDriver extends Driver {
 		}
 		canvas.width = width;
 		canvas.height = height;
-		#elseif cpp
-		// resize window
 		#end
 		bufferWidth = width;
 		bufferHeight = height;
@@ -1054,7 +1021,7 @@ class GlDriver extends Driver {
 	}
 
 	override function uploadTextureBitmap( t : h3d.mat.Texture, bmp : hxd.BitmapData, mipLevel : Int, side : Int ) {
-	#if (hxcpp || hl)
+	#if hl
 		var pixels = bmp.getPixels();
 		uploadTexturePixels(t, pixels, mipLevel, side);
 		pixels.dispose();
@@ -1371,11 +1338,7 @@ class GlDriver extends Driver {
 	}
 
 	override function isDisposed() {
-		#if (nme || openfl) //lime ??
-		return false;
-		#else
 		return gl.isContextLost();
-		#end
 	}
 
 	override function setRenderZone( x : Int, y : Int, width : Int, height : Int ) {

+ 19 - 51
hxd/BitmapData.hx

@@ -1,12 +1,10 @@
 package hxd;
 
 typedef BitmapInnerData =
-#if (flash || openfl || nme)
+#if flash
 	flash.display.BitmapData;
 #elseif js
 	js.html.CanvasRenderingContext2D;
-#elseif lime
-	lime.graphics.Image;
 #else
 	BitmapInnerDataImpl;
 
@@ -25,13 +23,13 @@ class BitmapInnerDataImpl {
 
 class BitmapData {
 
-	#if (flash || nme || openfl)
+	#if flash
 	static var tmpRect = new flash.geom.Rectangle();
 	static var tmpPoint = new flash.geom.Point();
 	static var tmpMatrix = new flash.geom.Matrix();
 	#end
 
-#if (flash||openfl||nme)
+#if flash
 	var bmp : flash.display.BitmapData;
 #elseif js
 	var ctx : js.html.CanvasRenderingContext2D;
@@ -48,15 +46,13 @@ class BitmapData {
 		if( width == -101 && height == -102 ) {
 			// no alloc
 		} else {
-			#if (flash||openfl||nme)
+			#if flash
 			bmp = new flash.display.BitmapData(width, height, true, 0);
 			#elseif js
 			var canvas = js.Browser.document.createCanvasElement();
 			canvas.width = width;
 			canvas.height = height;
 			ctx = canvas.getContext2d();
-			#elseif lime
-			data = new lime.graphics.Image( null, 0, 0, width, height );
 			#else
 			data = new BitmapInnerData();
 			#if hl
@@ -72,7 +68,7 @@ class BitmapData {
 	}
 
 	public function clear( color : Int ) {
-		#if (flash||openfl||nme)
+		#if flash
 		bmp.fillRect(bmp.rect, color);
 		#else
 		fill(0, 0, width, height, color);
@@ -84,7 +80,7 @@ class BitmapData {
 	}
 
 	public function fill( x : Int, y : Int, width : Int, height : Int, color : Int ) {
-		#if (flash || openfl || nme)
+		#if flash
 		var r = tmpRect;
 		r.x = x;
 		r.y = y;
@@ -110,17 +106,13 @@ class BitmapData {
 		for( dy in 0...height ) {
 			var p = x + (y + dy) * data.width;
 			for( dx in 0...width )
-				#if lime
-				data.buffer.data[p++] = color;
-				#else
 				data.pixels[p++] = color;
-				#end
 		}
 		#end
 	}
 
 	public function draw( x : Int, y : Int, src : BitmapData, srcX : Int, srcY : Int, width : Int, height : Int, ?blendMode : h2d.BlendMode ) {
-		#if (flash || openfl || nme)
+		#if flash
 		if( blendMode == null ) blendMode = Alpha;
 		var r = tmpRect;
 		r.x = srcX;
@@ -176,7 +168,7 @@ class BitmapData {
 
 	public function drawScaled( x : Int, y : Int, width : Int, height : Int, src : BitmapData, srcX : Int, srcY : Int, srcWidth : Int, srcHeight : Int, ?blendMode : h2d.BlendMode, smooth = true ) {
 		if( blendMode == null ) blendMode = Alpha;
-		#if (flash || openfl || nme)
+		#if flash
 
 		var b = switch( blendMode ) {
 		case None:
@@ -467,7 +459,7 @@ class BitmapData {
 	}
 
 	public inline function dispose() {
-		#if (flash||openfl||nme)
+		#if flash
 		bmp.dispose();
 		#elseif js
 		ctx = null;
@@ -482,7 +474,7 @@ class BitmapData {
 	}
 
 	public function sub( x, y, w, h ) : BitmapData {
-		#if (flash || openfl || nme)
+		#if flash
 		var b = new flash.display.BitmapData(w, h);
 		b.copyPixels(bmp, new flash.geom.Rectangle(x, y, w, h), new flash.geom.Point(0, 0));
 		return fromNative(b);
@@ -493,9 +485,6 @@ class BitmapData {
 		var ctx = canvas.getContext2d();
 		ctx.drawImage(this.ctx.canvas, x, y, w, h, 0, 0, w, h);
 		return fromNative(ctx);
-		#elseif lime
-		notImplemented();
-		return null;
 		#else
 		if( x < 0 || y < 0 || w < 0 || h < 0 || x + w > width || y + h > height ) throw "Outside bounds";
 		var b = new BitmapInnerData();
@@ -543,8 +532,8 @@ class BitmapData {
 	/**
 		Access the pixel color value at the given position. Note : this function can be very slow if done many times and the BitmapData has not been locked.
 	**/
-	public #if (flash || openfl || nme) inline #end function getPixel( x : Int, y : Int ) : Int {
-		#if ( flash || openfl || nme )
+	public #if flash inline #end function getPixel( x : Int, y : Int ) : Int {
+		#if flash
 		return bmp.getPixel32(x, y);
 		#elseif js
 		var i = lockImage;
@@ -556,8 +545,6 @@ class BitmapData {
 			i = ctx.getImageData(x, y, 1, 1);
 		}
 		return (i.data[a] << 16) | (i.data[a|1] << 8) | i.data[a|2] | (i.data[a|3] << 24);
-		#elseif lime
-		return if( x >= 0 && y >= 0 && x < data.width && y < data.height ) data.buffer.data[x + y * data.width] else 0;
 		#else
 		return if( x >= 0 && y >= 0 && x < data.width && y < data.height ) data.pixels[x + y * data.width] else 0;
 		#end
@@ -566,8 +553,8 @@ class BitmapData {
 	/**
 		Modify the pixel color value at the given position. Note : this function can be very slow if done many times and the BitmapData has not been locked.
 	**/
-	public #if (flash || openfl || nme) inline #end function setPixel( x : Int, y : Int, c : Int ) {
-		#if ( flash || openfl || nme)
+	public #if flash inline #end function setPixel( x : Int, y : Int, c : Int ) {
+		#if flash
 		bmp.setPixel32(x, y, c);
 		#elseif js
 		var i : js.html.ImageData = lockImage;
@@ -589,15 +576,13 @@ class BitmapData {
 		i.data[2] = c & 0xFF;
 		i.data[3] = (c >>> 24) & 0xFF;
 		ctx.putImageData(i, x, y);
-		#elseif lime
-		if( x >= 0 && y >= 0 && x < data.width && y < data.height ) data.buffer.data[x + y * data.width] = c;
 		#else
 		if( x >= 0 && y >= 0 && x < data.width && y < data.height ) data.pixels[x + y * data.width] = c;
 		#end
 	}
 
 	inline function get_width() : Int {
-		#if (flash || nme || openfl)
+		#if flash
 		return bmp.width;
 		#elseif js
 		return ctx.canvas.width;
@@ -607,7 +592,7 @@ class BitmapData {
 	}
 
 	inline function get_height() {
-		#if (flash || nme || openfl)
+		#if flash
 		return bmp.height;
 		#elseif js
 		return ctx.canvas.height;
@@ -617,7 +602,7 @@ class BitmapData {
 	}
 
 	public function getPixels() : Pixels {
-		#if (flash || nme || openfl)
+		#if flash
 		var p = new Pixels(width, height, haxe.io.Bytes.ofData(bmp.getPixels(bmp.rect)), ARGB);
 		p.flags.set(AlphaPremultiplied);
 		return p;
@@ -627,9 +612,6 @@ class BitmapData {
 		var data = ctx.getImageData(0, 0, w, h).data;
 		var pixels = data.buffer;
 		return new Pixels(w, h, haxe.io.Bytes.ofData(pixels), RGBA);
-		#elseif lime
-		var p = new Pixels(width, height, this.data.data.buffer, RGBA);
-		return p;
 		#else
 		var out = haxe.io.Bytes.alloc(data.width * data.height * 4);
 		for( i in 0...data.width*data.height )
@@ -660,20 +642,6 @@ class BitmapData {
 		pixels.convert(RGBA);
 		for( i in 0...pixels.width*pixels.height*4 ) img.data[i] = pixels.bytes.get(i);
 		ctx.putImageData(img, 0, 0);
-		#elseif (nme || openfl)
-		pixels.convert(BGRA);
-		bmp.setPixels(bmp.rect, flash.utils.ByteArray.fromBytes(pixels.bytes));
-		#elseif lime
-		// TODO format
-		pixels.convert(BGRA);
-		var src = pixels.bytes;
-		var i = 0;
-		for( y in 0...height ){
-			for( x in 0...width ){
-				data.setPixel32( x, y, src.getInt32(i<<2) );
-				i++;
-			}
-		}
 		#else
 		pixels.convert(BGRA);
 		var src = pixels.bytes;
@@ -683,7 +651,7 @@ class BitmapData {
 	}
 
 	public inline function toNative() : BitmapInnerData {
-		#if (flash || nme || openfl)
+		#if flash
 		return bmp;
 		#elseif js
 		return ctx;
@@ -694,7 +662,7 @@ class BitmapData {
 
 	public static function fromNative( data : BitmapInnerData ) : BitmapData {
 		var b = new BitmapData( -101, -102 );
-		#if (flash || nme || openfl)
+		#if flash
 		b.bmp = data;
 		#elseif js
 		b.ctx = data;

+ 8 - 29
hxd/ByteConversions.hx

@@ -7,41 +7,20 @@ import haxe.io.Bytes;
  */
 class ByteConversions{
 
-#if (flash || openfl)
-
-	public static function byteArrayToBytes( v: flash.utils.ByteArray ) : haxe.io.Bytes {
-		return
-		#if flash
-		Bytes.ofData( v );
-		#elseif (js&&openfl)
-		{
-			var b :Bytes = Bytes.alloc(v.length);
-			for ( i in 0...v.length )
-				b.set(i,v[i]);
-			b;
-		};
-		#elseif (openfl)
-		v;
-		#else
-		throw "unsupported on this platform";
-		#end
+#if flash
+
+	public static inline function byteArrayToBytes( v: flash.utils.ByteArray ) : haxe.io.Bytes {
+		return Bytes.ofData( v );
 	}
 
-	public static function bytesToByteArray( v: haxe.io.Bytes ) :  flash.utils.ByteArray {
-		#if flash
+	public static inline function bytesToByteArray( v: haxe.io.Bytes ) :  flash.utils.ByteArray {
 		return v.getData();
-		#elseif openfl
-		return flash.utils.ByteArray.fromBytes(v);
-		#else
-		throw "unsupported on this platform";
-		#end
 	}
+#elseif js
 
-	#if js
-	public static function arrayBufferToBytes( v : js.html.ArrayBuffer ) : haxe.io.Bytes{
-		return byteArrayToBytes(flash.utils.ByteArray.nmeOfBuffer(v));
+	public static inline function arrayBufferToBytes( v : hxd.impl.TypedArray.ArrayBuffer ) : haxe.io.Bytes{
+		return haxe.io.Bytes.ofData(v);
 	}
-	#end
 
 #end
 

+ 1 - 4
hxd/fs/EmbedFileSystem.hx

@@ -109,7 +109,7 @@ private class EmbedEntry extends FileEntry {
 	}
 
 	override function loadBitmap( onLoaded : LoadedBitmap -> Void ) : Void {
-		#if (flash || openfl)
+		#if flash
 		var loader = new flash.display.Loader();
 		loader.contentLoaderInfo.addEventListener(flash.events.IOErrorEvent.IO_ERROR, function(e:flash.events.IOErrorEvent) {
 			throw Std.string(e) + " while loading " + relPath;
@@ -140,9 +140,6 @@ private class EmbedEntry extends FileEntry {
 		for( i in 0...(3-(bytes*4)%3)%3 )
 			extra += "=";
 		image.src = "data:image/" + extension + ";base64," + rawData + extra;
-		#elseif lime
-		open();
-		onLoaded( new LoadedBitmap(lime.graphics.Image.fromBytes(bytes)) );
 		#else
 		throw "TODO";
 		#end

+ 0 - 219
hxd/fs/LimeFileSystem.hx

@@ -1,219 +0,0 @@
-package hxd.fs;
-
-#if !macro
-
-@:allow(hxd.fs.LimeFileSystem)
-@:access(hxd.fs.LimeFileSystem)
-private class LimeEntry extends FileEntry {
-
-	var fs : LimeFileSystem;
-	var relPath : String;
-	
-	#if flash
-	var bytes : flash.utils.ByteArray;
-	#else
-	var bytes : haxe.io.Bytes;
-	var readPos : Int;
-	#end
-
-	var isReady:Bool = false;
-	override function get_isAvailable() return isReady;
-	
-	function new(fs, name, relPath) {
-		this.fs = fs;
-		this.name = name;
-		this.relPath = relPath;
-	}
-
-	override function getSign() : Int {
-		#if flash
-		var old = bytes == null ? 0 : bytes.position;
-		open();
-		bytes.endian = flash.utils.Endian.LITTLE_ENDIAN;
-		var v = bytes.readUnsignedInt();
-		bytes.position = old;
-		return v;
-		#else
-		var old = readPos;
-		open();
-		readPos = old;
-		return bytes.get(0) | (bytes.get(1) << 8) | (bytes.get(2) << 16) | (bytes.get(3) << 24);
-		#end
-	}
-
-	override function getBytes() : haxe.io.Bytes {
-		#if flash
-		if( bytes == null )
-			open();
-		return haxe.io.Bytes.ofData(bytes);
-		#else
-		if( bytes == null )
-			open();
-		return bytes;
-		#end
-	}
-	
-	override function open() {
-		if(lime.Assets.isLocal(name)) {
-			var inBytes = lime.Assets.getBytes(name);
-			if( inBytes == null ) throw "Missing resource " + name;
-			#if flash
-			bytes = inBytes.getData();
-			bytes.position = 0;
-			#else
-			bytes = inBytes;
-			readPos = 0;
-			#end
-			isReady = true;
-		} else {
-			//#if flash
-			//	throw "Non embeded files are not supported on flash platform with Lime";
-			//#else
-			lime.Assets.loadBytes(name).onComplete(function(inBytes) {
-				#if flash
-				bytes = inBytes.getData();
-				bytes.position = 0;
-				#else
-				bytes = inBytes;
-				readPos = 0;
-				#end
-				isReady = true;
-			});
-			//#end
-		}
-	}
-	
-	override function skip( nbytes : Int ) {
-		#if flash
-		bytes.position += nbytes;
-		#else
-		readPos += nbytes;
-		#end
-	}
-	
-	override function readByte() : Int {
-		#if flash
-		return bytes.readUnsignedByte();
-		#else
-		return bytes.get(readPos++);
-		#end
-	}
-	
-	override function read( out : haxe.io.Bytes, pos : Int, size : Int ) : Void {
-		#if flash
-		bytes.readBytes(out.getData(), pos, size);
-		#else
-		out.blit(pos, bytes, readPos, size);
-		readPos += size;
-		#end
-	}
-	
-	override function close() {
-		bytes = null;
-		#if !flash
-		readPos = 0;
-		#end
-	}
-
-	override function load( ?onReady : Void -> Void ) : Void {
-		#if (flash || js)
-		if( onReady != null ) haxe.Timer.delay(onReady, 1);
-		#end
-	}
-
-	override function loadBitmap( onLoaded : LoadedBitmap -> Void ) : Void {
-		#if flash
-		var loader = new flash.display.Loader();
-		loader.contentLoaderInfo.addEventListener(flash.events.IOErrorEvent.IO_ERROR, function(e:flash.events.IOErrorEvent) {
-			throw Std.string(e) + " while loading " + relPath;
-		});
-		loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, function(_) {
-			var content : flash.display.Bitmap = cast loader.content;
-			onLoaded(new LoadedBitmap(content.bitmapData));
-			loader.unload();
-		});
-		open();
-		loader.loadBytes(bytes);
-		close(); // flash will copy bytes content in loadBytes() !
-		#else
-		
-		lime.graphics.Image.fromBytes(bytes, function(img) {
-			onLoaded(new hxd.fs.LoadedBitmap(img));
-		});
-		close();
-		#end
-	}
-	
-	override function get_isDirectory() {
-		return fs.isDirectory(relPath);
-	}
-
-	override function get_path() {
-		return relPath == "." ? "<root>" : relPath;
-	}
-
-	override function exists( name : String ) {
-		return fs.exists(relPath == "." ? name : relPath + "/" + name);
-	}
-
-	override function get( name : String ) {
-		return fs.get(relPath == "." ? name : relPath + "/" + name);
-	}
-
-	override function get_size() {
-		open();
-		return bytes.length;
-	}
-
-	override function iterator() {
-		return new hxd.impl.ArrayIterator(fs.subFiles(relPath));
-	}
-}
-
-#end
-
-class LimeFileSystem #if !macro implements FileSystem #end {
-
-	#if !macro
-	
-	public function new() {
-	}
-
-	public function getRoot() : FileEntry {
-		return new LimeEntry(this,"root",".");
-	}
-	
-	function splitPath( path : String ) {
-		return path == "." ? [] : path.split("/");
-	}
-
-	function subFiles( path : String ) : Array<FileEntry> {
-		var out:Array<FileEntry> = [];
-		var all = lime.Assets.list();
-		for( f in all )
-		{
-			if( f != path && StringTools.startsWith(f, path) )
-				out.push(get(f));
-		}
-		return out;
-	}
-
-	function isDirectory( path : String ) {
-		return subFiles(path).length > 0;
-	}
-
-	public function exists( path : String ) {
-		return lime.Assets.exists(path);
-	}
-
-	public function get( path : String ) {
-		if( !exists(path) )
-			throw new NotFound(path);
-		return new LimeEntry(this, path.split("/").pop(), path);
-	}
-	#end
-	
-	public function dispose() {
-	}
-
-}

+ 2 - 11
hxd/fs/LoadedBitmap.hx

@@ -1,9 +1,7 @@
 package hxd.fs;
 
-#if (flash || openfl)
+#if flash
 typedef LoadedBitmapData = flash.display.BitmapData;
-#elseif lime
-typedef LoadedBitmapData = lime.graphics.Image;
 #elseif js
 typedef LoadedBitmapData = js.html.Image;
 #else
@@ -17,15 +15,8 @@ abstract LoadedBitmap(LoadedBitmapData) {
 	}
 
 	public function toBitmap() : hxd.BitmapData {
-		#if (flash || openfl)
+		#if flash
 		return hxd.BitmapData.fromNative(this);
-		#elseif lime
-		var bmp = new hxd.BitmapData(this.width, this.height);
-			//TODO  test this
-			#if js @:privateAccess bmp.pixel = this.src;
-			#else @:privateAccess bmp.data = this;
-			#end
-		return bmp;
 		#elseif js
 		var bmp = new hxd.BitmapData(this.width, this.height);
 		@:privateAccess bmp.ctx.drawImage(this, 0, 0);

+ 1 - 1
hxd/impl/Float32.hx

@@ -1,3 +1,3 @@
 package hxd.impl;
 
-typedef Float32 = #if cpp cpp.Float32 #elseif hl hl.F32 #else Float #end;
+typedef Float32 = #if hl hl.F32 #else Float #end;

+ 0 - 411
hxd/impl/LimeStage.hx

@@ -1,411 +0,0 @@
-package hxd.impl;
-import hxd.Event;
-
-@:allow(hxd.Stage)
-@:access(hxd.Stage)
-class LimeStage extends lime.app.Module {
-	
-	var stage : hxd.Stage;
-
-	var width : Int;
-	var height : Int;
-	
-	var enableMouse : Bool;
-
-	var mouseX : Int = 0;
-	var mouseY : Int = 0;
-
-	public function new( s : hxd.Stage ){
-		super();
-		stage = s;
-		enableMouse = !hxd.System.isTouch;
-		width = hxd.System.width;
-		height = hxd.System.height;
-	}
-	
-	override public function render(renderer){
-		if( hxd.System.loopFunc != null )
-			hxd.System.loopFunc();
-	}
-
-	override public function onWindowResize(win:lime.ui.Window, w, h){
-		width = Std.int(w * win.scale);
-		height = Std.int(h * win.scale);
-		stage.onResize(null);
-	}
-
-	override public function onMouseMove(win, x : Float, y : Float){
-		if( !enableMouse ) return;
-		mouseX = Std.int(x);
-		mouseY = Std.int(y);
-		stage.event(new Event(EMove, mouseX, mouseY));
-	}
-
-	override public function onMouseDown(win, x : Float, y : Float, button : Int ){
-		if( !enableMouse ) return;
-		var e = new Event(EPush, x, y);
-		e.button = button;
-		stage.event(e);
-	}
-
-	override public function onMouseUp(win, x : Float, y : Float, button : Int){
-		if( !enableMouse ) return;
-		var e = new Event(ERelease, x, y);
-		e.button = button;
-		stage.event(e);
-	}
-	
-	override public function onMouseWheel( win, dx : Float, dy : Float ){
-		if( dy != 0 ){
-			var ev = new Event(EWheel, mouseX, mouseY);
-			ev.wheelDelta = dy;
-			stage.event(ev);
-		}
-	}
-
-	override public function onTouchEnd( touch : lime.ui.Touch ){
-		if( !hxd.Stage.ENABLE_TOUCH ) return;
-		var e = new Event( ERelease, touch.x*width, touch.y*height );
-		e.touchId = touch.id;
-		stage.event(e);
-	}
-
-	override public function onTouchMove( touch : lime.ui.Touch ){
-		if( !hxd.Stage.ENABLE_TOUCH ) return;
-		var e = new Event( EMove, touch.x*width, touch.y*height );
-		e.touchId = touch.id;
-		stage.event(e);
-	}
-
-	override public function onTouchStart( touch : lime.ui.Touch ){
-		if( !hxd.Stage.ENABLE_TOUCH ) return;
-		var e = new Event( EPush, touch.x*width, touch.y*height );
-		e.touchId = touch.id;
-		stage.event(e);
-	}
-
-	override public function onKeyDown( window, keyCode:lime.ui.KeyCode, modifier:lime.ui.KeyModifier ){
-		var ev = new Event(EKeyDown, mouseX, mouseY);
-		ev.keyCode = Keyboard.convertKeyCode(keyCode);
-		ev.charCode = Keyboard.getCharCode(ev.keyCode, modifier.shiftKey);
-		stage.event(ev);
-	}
-
-	override public function onKeyUp( window, keyCode:lime.ui.KeyCode, modifier:lime.ui.KeyModifier ){
-		var ev = new Event(EKeyUp, mouseX, mouseY);
-		ev.keyCode = Keyboard.convertKeyCode(keyCode);
-		ev.charCode = Keyboard.getCharCode(ev.keyCode, modifier.shiftKey);
-		stage.event(ev);
-	}
-
-		
-}
-
-@:allow(hxd.impl.LimeStage)
-class Keyboard {
-		
-	static inline var NUMBER_0 = 48;
-	static inline var NUMBER_1 = 49;
-	static inline var NUMBER_2 = 50;
-	static inline var NUMBER_3 = 51;
-	static inline var NUMBER_4 = 52;
-	static inline var NUMBER_5 = 53;
-	static inline var NUMBER_6 = 54;
-	static inline var NUMBER_7 = 55;
-	static inline var NUMBER_8 = 56; 
-	static inline var NUMBER_9 = 57;
-	static inline var A = 65;
-	static inline var B = 66;
-	static inline var C = 67;
-	static inline var D = 68;
-	static inline var E = 69;
-	static inline var F = 70;
-	static inline var G = 71;
-	static inline var H = 72;
-	static inline var I = 73;
-	static inline var J = 74;
-	static inline var K = 75;
-	static inline var L = 76;
-	static inline var M = 77;
-	static inline var N = 78;
-	static inline var O = 79;
-	static inline var P = 80;
-	static inline var Q = 81;
-	static inline var R = 82;
-	static inline var S = 83;
-	static inline var T = 84;
-	static inline var U = 85;
-	static inline var V = 86;
-	static inline var W = 87;
-	static inline var X = 88;
-	static inline var Y = 89;
-	static inline var Z = 90;
-	static inline var NUMPAD_0 = 96;
-	static inline var NUMPAD_1 = 97;
-	static inline var NUMPAD_2 = 98;
-	static inline var NUMPAD_3 = 99;
-	static inline var NUMPAD_4 = 100;
-	static inline var NUMPAD_5 = 101;
-	static inline var NUMPAD_6 = 102;
-	static inline var NUMPAD_7 = 103;
-	static inline var NUMPAD_8 = 104;
-	static inline var NUMPAD_9 = 105;
-	static inline var NUMPAD_MULTIPLY = 106;
-	static inline var NUMPAD_ADD = 107;
-	static inline var NUMPAD_ENTER = 108;
-	static inline var NUMPAD_SUBTRACT = 109;
-	static inline var NUMPAD_DECIMAL = 110;
-	static inline var NUMPAD_DIVIDE = 111;
-	static inline var F1 = 112;
-	static inline var F2 = 113;
-	static inline var F3 = 114;
-	static inline var F4 = 115;
-	static inline var F5 = 116;
-	static inline var F6 = 117;
-	static inline var F7 = 118;
-	static inline var F8 = 119;
-	static inline var F9 = 120;
-	static inline var F10 = 121; //  F10 is used by browser.
-	static inline var F11 = 122;
-	static inline var F12 = 123;
-	static inline var F13 = 124;
-	static inline var F14 = 125;
-	static inline var F15 = 126;
-	static inline var BACKSPACE = 8;
-	static inline var TAB = 9;
-	static inline var ALTERNATE = 18;
-	static inline var ENTER = 13;
-	static inline var COMMAND = 15;
-	static inline var SHIFT = 16;
-	static inline var CONTROL = 17;
-	static inline var BREAK = 19;
-	static inline var CAPS_LOCK = 20;
-	static inline var NUMPAD = 21;
-	static inline var ESCAPE = 27;
-	static inline var SPACE = 32;
-	static inline var PAGE_UP = 33;
-	static inline var PAGE_DOWN = 34;
-	static inline var END = 35;
-	static inline var HOME = 36;
-	static inline var LEFT = 37;
-	static inline var RIGHT = 39;
-	static inline var UP = 38;
-	static inline var DOWN = 40;
-	static inline var INSERT = 45;
-	static inline var DELETE = 46;
-	static inline var NUMLOCK = 144;
-	static inline var SEMICOLON = 186;
-	static inline var EQUAL = 187;
-	static inline var COMMA = 188;
-	static inline var MINUS = 189;
-	static inline var PERIOD = 190;
-	static inline var SLASH = 191;
-	static inline var BACKQUOTE = 192;
-	static inline var LEFTBRACKET = 219;
-	static inline var BACKSLASH = 220;
-	static inline var RIGHTBRACKET = 221;
-	static inline var QUOTE = 222;
-	
-	static function convertKeyCode (key:lime.ui.KeyCode):Int {
-		return switch (key) {
-			case BACKSPACE: Keyboard.BACKSPACE;
-			case TAB: Keyboard.TAB;
-			case RETURN: Keyboard.ENTER;
-			case ESCAPE: Keyboard.ESCAPE;
-			case SPACE: Keyboard.SPACE;
-			case EXCLAMATION: Keyboard.NUMBER_1;
-			case QUOTE: Keyboard.QUOTE;
-			case HASH: Keyboard.NUMBER_3;
-			case DOLLAR: Keyboard.NUMBER_4;
-			case PERCENT: Keyboard.NUMBER_5;
-			case AMPERSAND: Keyboard.NUMBER_7;
-			case SINGLE_QUOTE: Keyboard.QUOTE;
-			case LEFT_PARENTHESIS: Keyboard.NUMBER_9;
-			case RIGHT_PARENTHESIS: Keyboard.NUMBER_0;
-			case ASTERISK: Keyboard.NUMBER_8;
-			case COMMA: Keyboard.COMMA;
-			case MINUS: Keyboard.MINUS;
-			case PERIOD: Keyboard.PERIOD;
-			case SLASH: Keyboard.SLASH;
-			case NUMBER_0: Keyboard.NUMBER_0;
-			case NUMBER_1: Keyboard.NUMBER_1;
-			case NUMBER_2: Keyboard.NUMBER_2;
-			case NUMBER_3: Keyboard.NUMBER_3;
-			case NUMBER_4: Keyboard.NUMBER_4;
-			case NUMBER_5: Keyboard.NUMBER_5;
-			case NUMBER_6: Keyboard.NUMBER_6;
-			case NUMBER_7: Keyboard.NUMBER_7;
-			case NUMBER_8: Keyboard.NUMBER_8;
-			case NUMBER_9: Keyboard.NUMBER_9;
-			case COLON: Keyboard.SEMICOLON;
-			case SEMICOLON: Keyboard.SEMICOLON;
-			case LESS_THAN: 60;
-			case EQUALS: Keyboard.EQUAL;
-			case GREATER_THAN: Keyboard.PERIOD;
-			case QUESTION: Keyboard.SLASH;
-			case AT: Keyboard.NUMBER_2;
-			case LEFT_BRACKET: Keyboard.LEFTBRACKET;
-			case BACKSLASH: Keyboard.BACKSLASH;
-			case RIGHT_BRACKET: Keyboard.RIGHTBRACKET;
-			case CARET: Keyboard.NUMBER_6;
-			case UNDERSCORE: Keyboard.MINUS;
-			case GRAVE: Keyboard.BACKQUOTE;
-			case A: Keyboard.A;
-			case B: Keyboard.B;
-			case C: Keyboard.C;
-			case D: Keyboard.D;
-			case E: Keyboard.E;
-			case F: Keyboard.F;
-			case G: Keyboard.G;
-			case H: Keyboard.H;
-			case I: Keyboard.I;
-			case J: Keyboard.J;
-			case K: Keyboard.K;
-			case L: Keyboard.L;
-			case M: Keyboard.M;
-			case N: Keyboard.N;
-			case O: Keyboard.O;
-			case P: Keyboard.P;
-			case Q: Keyboard.Q;
-			case R: Keyboard.R;
-			case S: Keyboard.S;
-			case T: Keyboard.T;
-			case U: Keyboard.U;
-			case V: Keyboard.V;
-			case W: Keyboard.W;
-			case X: Keyboard.X;
-			case Y: Keyboard.Y;
-			case Z: Keyboard.Z;
-			case DELETE: Keyboard.DELETE;
-			case CAPS_LOCK: Keyboard.CAPS_LOCK;
-			case F1: Keyboard.F1;
-			case F2: Keyboard.F2;
-			case F3: Keyboard.F3;
-			case F4: Keyboard.F4;
-			case F5: Keyboard.F5;
-			case F6: Keyboard.F6;
-			case F7: Keyboard.F7;
-			case F8: Keyboard.F8;
-			case F9: Keyboard.F9;
-			case F10: Keyboard.F10;
-			case F11: Keyboard.F11;
-			case F12: Keyboard.F12;
-			case PRINT_SCREEN: 301;
-			case SCROLL_LOCK: 145;
-			case PAUSE: Keyboard.BREAK;
-			case INSERT: Keyboard.INSERT;
-			case HOME: Keyboard.HOME;
-			case PAGE_UP: Keyboard.PAGE_UP;
-			case END: Keyboard.END;
-			case PAGE_DOWN: Keyboard.PAGE_DOWN;
-			case RIGHT: Keyboard.RIGHT;
-			case LEFT: Keyboard.LEFT;
-			case DOWN: Keyboard.DOWN;
-			case UP: Keyboard.UP;
-			case NUM_LOCK: Keyboard.NUMLOCK;
-			case NUMPAD_DIVIDE: Keyboard.NUMPAD_DIVIDE;
-			case NUMPAD_MULTIPLY: Keyboard.NUMPAD_MULTIPLY;
-			case NUMPAD_MINUS: Keyboard.NUMPAD_SUBTRACT;
-			case NUMPAD_PLUS: Keyboard.NUMPAD_ADD;
-			case NUMPAD_ENTER: Keyboard.NUMPAD_ENTER;
-			case NUMPAD_1: Keyboard.NUMPAD_1;
-			case NUMPAD_2: Keyboard.NUMPAD_2;
-			case NUMPAD_3: Keyboard.NUMPAD_3;
-			case NUMPAD_4: Keyboard.NUMPAD_4;
-			case NUMPAD_5: Keyboard.NUMPAD_5;
-			case NUMPAD_6: Keyboard.NUMPAD_6;
-			case NUMPAD_7: Keyboard.NUMPAD_7;
-			case NUMPAD_8: Keyboard.NUMPAD_8;
-			case NUMPAD_9: Keyboard.NUMPAD_9;
-			case NUMPAD_0: Keyboard.NUMPAD_0;
-			case NUMPAD_PERIOD: Keyboard.NUMPAD_DECIMAL;
-			case APPLICATION: 302;
-			case F13: Keyboard.F13;
-			case F14: Keyboard.F14;
-			case F15: Keyboard.F15;
-			case NUMPAD_DECIMAL: Keyboard.NUMPAD_DECIMAL;
-			case LEFT_CTRL: Keyboard.CONTROL;
-			case LEFT_SHIFT: Keyboard.SHIFT;
-			case LEFT_ALT: Keyboard.ALTERNATE;
-			case LEFT_META: Keyboard.COMMAND;
-			case RIGHT_CTRL: Keyboard.CONTROL;
-			case RIGHT_SHIFT: Keyboard.SHIFT;
-			case RIGHT_ALT: Keyboard.ALTERNATE;
-			case RIGHT_META: Keyboard.COMMAND;
-			default: key;
-		}
-	}
-
-	static function getCharCode (key:Int, shift:Bool = false):Int {
-		if (!shift) {
-			switch (key) {
-				case Keyboard.BACKSPACE: return 8;
-				case Keyboard.TAB: return 9;
-				case Keyboard.ENTER: return 13;
-				case Keyboard.ESCAPE: return 27;
-				case Keyboard.SPACE: return 32;
-				case Keyboard.SEMICOLON: return 59;
-				case Keyboard.EQUAL: return 61;
-				case Keyboard.COMMA: return 44;
-				case Keyboard.MINUS: return 45;
-				case Keyboard.PERIOD: return 46;
-				case Keyboard.SLASH: return 47;
-				case Keyboard.BACKQUOTE: return 96;
-				case Keyboard.LEFTBRACKET: return 91;
-				case Keyboard.BACKSLASH: return 92;
-				case Keyboard.RIGHTBRACKET: return 93;
-				case Keyboard.QUOTE: return 39;
-			}
-			
-			if (key >= Keyboard.NUMBER_0 && key <= Keyboard.NUMBER_9) 
-				return key - Keyboard.NUMBER_0 + 48;
-			
-			if (key >= Keyboard.A && key <= Keyboard.Z)
-				return key - Keyboard.A + 97;
-		}else{
-			switch (key) {
-				case Keyboard.NUMBER_0: return 41;
-				case Keyboard.NUMBER_1: return 33;
-				case Keyboard.NUMBER_2: return 64;
-				case Keyboard.NUMBER_3: return 35;
-				case Keyboard.NUMBER_4: return 36;
-				case Keyboard.NUMBER_5: return 37;
-				case Keyboard.NUMBER_6: return 94;
-				case Keyboard.NUMBER_7: return 38;
-				case Keyboard.NUMBER_8: return 42;
-				case Keyboard.NUMBER_9: return 40;
-				case Keyboard.SEMICOLON: return 58;
-				case Keyboard.EQUAL: return 43;
-				case Keyboard.COMMA: return 60;
-				case Keyboard.MINUS: return 95;
-				case Keyboard.PERIOD: return 62;
-				case Keyboard.SLASH: return 63;
-				case Keyboard.BACKQUOTE: return 126;
-				case Keyboard.LEFTBRACKET: return 123;
-				case Keyboard.BACKSLASH: return 124;
-				case Keyboard.RIGHTBRACKET: return 125;
-				case Keyboard.QUOTE: return 34;
-			}
-			
-			if (key >= Keyboard.A && key <= Keyboard.Z) 
-				return key - Keyboard.A + 65;
-		}
-		
-		if (key >= Keyboard.NUMPAD_0 && key <= Keyboard.NUMPAD_9)
-			return key - Keyboard.NUMPAD_0 + 48;
-		
-		switch (key) {
-			case Keyboard.NUMPAD_MULTIPLY: return 42;
-			case Keyboard.NUMPAD_ADD: return 43;
-			case Keyboard.NUMPAD_ENTER: return 44;
-			case Keyboard.NUMPAD_DECIMAL: return 45;
-			case Keyboard.NUMPAD_DIVIDE: return 46;
-			case Keyboard.DELETE: return 127;
-			case Keyboard.ENTER: return 13;
-			case Keyboard.BACKSPACE: return 8;
-		}
-		
-		return 0;
-		
-	}
-}

+ 1 - 1
hxd/impl/UInt16.hx

@@ -1,3 +1,3 @@
 package hxd.impl;
 
-typedef UInt16 = #if cpp cpp.UInt16 #elseif hl hl.UI16 #else Int #end;
+typedef UInt16 = #if hl hl.UI16 #else Int #end;

+ 1 - 1
hxd/poly2tri/VisiblePolygon.hx

@@ -67,7 +67,7 @@ class VisiblePolygon
 	}
 
 
-	#if (nme || flash)
+	#if flash
 	public function drawShape(g:flash.display.Graphics)
 	{
 		var t:Triangle;

+ 0 - 2
hxd/res/Config.hx

@@ -3,7 +3,6 @@ package hxd.res;
 enum Platform {
 	Flash;
 	HL;
-	Cpp;
 	JS;
 	Unknown;
 }
@@ -65,7 +64,6 @@ class Config {
 		var pf =
 			if( defined("flash") ) Flash else
 			if( defined("js") ) JS else
-			if( defined("cpp") ) Cpp else
 			if( defined("hl") ) HL else
 			Unknown;
 		switch( pf ) {

+ 1 - 1
hxd/res/Embed.hx

@@ -23,7 +23,7 @@ class Embed {
 		var m = Context.getLocalClass().get().module;
 		Context.registerModuleDependency(m, file);
 
-		if( Context.defined("flash") || Context.defined("openfl") ) {
+		if( Context.defined("flash") ) {
 			if( chars == null ) // convert char list to char range
 				chars = Charset.DEFAULT_CHARS.split("-").join("\\-");
 			var pos = Context.currentPos();

+ 0 - 4
hxd/res/FileTree.hx

@@ -275,11 +275,7 @@ class FileTree {
 					ret : field.t,
 					expr : { expr : EMeta({ name : ":privateAccess", params : [], pos : pos }, { expr : EReturn(field.e), pos : pos }), pos : pos },
 				}),
-				#if openfl
-				meta : [ { name:":keep", pos:pos, params:[] } ],
-				#else
 				meta : [ { name:":extern", pos:pos, params:[] } ],
-				#end
 				access : [AStatic, AInline, APrivate],
 			};
 			var field : Field = {

+ 1 - 3
hxd/res/Font.hx

@@ -8,9 +8,7 @@ package hxd.res;
 class Font extends Resource {
 
 	public function build( size : Int, ?options ) : h2d.Font {
-		#if lime
-		return FontBuilder.getFont(name, size, options);
-		#elseif flash
+		#if flash
 		var fontClass : Class<flash.text.Font> = cast Type.resolveClass("_R_" + ~/[^A-Za-z0-9_]/g.replace(entry.path, "_"));
 		if( fontClass == null ) throw "Embeded font not found " + entry.path;
 		var font = Type.createInstance(fontClass, []);

+ 0 - 105
hxd/res/FontBuilder.hx

@@ -241,111 +241,6 @@ class FontBuilder {
 		return result;
 	}
 
-	#elseif lime
-
-	function build() : h2d.Font {
-		var f = lime.text.Font.fromBytes( hxd.Res.load(font.name).entry.getBytes() );
-		var surf = 0;
-		var bh = 0;
-		var tmp = [];
-		var gcode = new Map<lime.text.Glyph,Int>();
-		for( i in 0...options.chars.length ) {
-			var c = options.chars.charAt(i);
-			var code = options.chars.charCodeAt(i);
-			var g = f.getGlyph(c);
-			gcode.set(g, code);
-			var img = f.renderGlyph(g,font.size);
-			var m = f.getGlyphMetrics(g);
-			if( img == null ){
-				tmp[i] = { i: null, w:0, h:0, x:0, y:0, adv:Std.int(m.advance.x)>>6 };
-				continue;
-			}
-			var w = img.width;
-			var h = img.height;
-			var x = Std.int(img.x);
-			if( x < 0 )
-				x = 0;
-			var y = Std.int(img.y); // baseline y pos
-			surf += (w + 2) * (h + 2);
-			if( h+1 > font.lineHeight )
-				font.lineHeight = h + 1;
-			if( h - y > bh )
-				bh = h - y;
-			tmp[i] = { i: img, w:w, h:h, x: x, y:y, adv:Std.int(m.advance.x)>>6 };
-		}
-		var baseline = font.lineHeight - bh;
-
-		var side = Math.ceil( Math.sqrt(surf) );
-		var width = 1;
-		while( side > width )
-			width <<= 1;
-		var height = width;
-		while( width * height >> 1 > surf )
-			height >>= 1;
-
-		var all, px;
-		do {
-			font.glyphs = new Map();
-			all = [];
-			var x = 0, y = 0, lineH = font.lineHeight;
-			px = haxe.io.Bytes.alloc( width * height  );
-			for( i in 0...options.chars.length ) {
-				var size = tmp[i];
-				var w = size.x + size.w + 1;
-				if( x + w > width ) {
-					x = 0;
-					y += lineH + 1;
-				}
-				// no space, resize
-				if( y + lineH + 1 > height ) {
-					px = null;
-					height <<= 1;
-					break;
-				}
-				var gy = baseline-size.y;
-				var gx = size.x;
-				if( size.w > 0 && size.h > 0 ){
-					var ib = size.i.buffer.data.toBytes();
-					for( ty in 0...size.h )
-						px.blit( (gx+x+(y+gy+ty)*width), ib, ty*size.w, size.w );
-				}
-				var t = new h2d.Tile(innerTex, x, y, gx+size.w, gy+size.h);
-				all.push(t);
-				font.glyphs.set(options.chars.charCodeAt(i), new h2d.Font.FontChar(t,size.adv-1));
-				// next element
-				x += w + 1;
-			}
-		} while( px == null );
-
-		// Kerning
-		// lime font.decompose() currently force size to 320*64 (= 20*1024)
-		if( options.kerning ){
-			var kernratio = font.size / (320 * 64);
-			var kerning = f.decompose().kerning;
-			for( k in kerning ){
-				var v = Math.round(k.x * kernratio);
-				if( v == 0 || !gcode.exists(k.right_glyph) || !gcode.exists(k.left_glyph) )
-					continue;
-				var c = font.glyphs.get( gcode.get(k.right_glyph) );
-				c.addKerning( gcode.get(k.left_glyph), v );
-			}
-		}
-
-		var pixels = new hxd.Pixels( width, height, px, ALPHA );
-		if( innerTex == null ) {
-			innerTex = new h3d.mat.Texture(pixels.width, pixels.height, h3d.mat.Data.TextureFormat.ALPHA);
-			innerTex.uploadPixels(pixels);
-			font.tile = h2d.Tile.fromTexture(innerTex);
-			for( t in all )
-				t.setTexture(innerTex);
-			innerTex.realloc = build;
-		} else
-			innerTex.uploadPixels(pixels);
-		pixels.dispose();
-
-		return font;
-	}
-
 	#else
 
 	function build() {

+ 1 - 5
hxd/res/Image.hx

@@ -150,11 +150,7 @@ class Image extends Resource {
 		case Png:
 			var bytes = entry.getBytes(); // using getTmpBytes cause bug in E2
 
-			#if (lime && (cpp || neko || nodejs))
-			// native PNG loader is faster
-			var i = lime.graphics.Image.fromBytes( bytes );
-			pixels = new Pixels(inf.width, inf.height, i.data.toBytes(), RGBA );
-			#elseif hl
+			#if hl
 			if( fmt == null ) fmt = BGRA;
 			pixels = decodePNG(bytes, inf.width, inf.height, fmt, flipY);
 			if( pixels == null ) throw "Failed to decode PNG " + entry.path;

+ 0 - 91
hxd/snd/NativeChannel.hx

@@ -1,87 +1,5 @@
 package hxd.snd;
 
-#if lime_openal
-import lime.media.openal.AL;
-import lime.media.openal.ALBuffer;
-import lime.media.openal.ALSource;
-
-private class ALChannel {
-	var native : NativeChannel;
-	var samples : Int;
-
-	var buffers : Array<ALBuffer>;
-	var src : ALSource;
-
-	var fbuf : haxe.io.Bytes;
-	var ibuf : haxe.io.Bytes;
-	var iview : lime.utils.ArrayBufferView;
-
-	public function new(samples, native){
-		this.native = native;
-		this.samples = samples;
-		buffers = AL.genBuffers(2);
-		src = AL.genSource();
-		AL.sourcef(src,AL.PITCH,1.0);
-		AL.sourcef(src,AL.GAIN,1.0);
-		fbuf = haxe.io.Bytes.alloc( samples<<3 );
-		ibuf = haxe.io.Bytes.alloc( samples<<2 );
-		iview = new lime.utils.Int16Array(ibuf);
-
-		for ( b in buffers )
-			onSample(b);
-		forcePlay();
-		lime.app.Application.current.onUpdate.add( onUpdate );
-	}
-
-	public function stop() {
-		if ( src != null ){
-			lime.app.Application.current.onUpdate.remove( onUpdate );
-
-			AL.sourceStop(src);
-			AL.deleteSource(src);
-			AL.deleteBuffers(buffers);
-			src = null;
-			buffers = null;
-		}
-	}
-
-	@:noDebug function onSample( buf : ALBuffer ) {
-		@:privateAccess native.onSample(haxe.io.Float32Array.fromBytes(fbuf));
-
-		// Convert Float32 to Int16
-		#if cpp
-		var fb = fbuf.getData();
-		var ib = ibuf.getData();
-		for( i in 0...samples<<1 )
-			untyped __global__.__hxcpp_memory_set_i16( ib, i<<1, __global__.__int__(__global__.__hxcpp_memory_get_float( fb, i<<2 ) * 0x7FFF) );
-		#else
-		for ( i in 0...samples << 1 ) {
-			var v = Std.int(fbuf.getFloat(i << 2) * 0x7FFF);
-			ibuf.set( i<<1, v );
-			ibuf.set( (i<<1) + 1, v>>>8 );
-		}
-		#end
-
-		AL.bufferData(buf, AL.FORMAT_STEREO16, iview, ibuf.length, 44100);
-		AL.sourceQueueBuffers(src, 1, [buf]);
-	}
-
-	inline function forcePlay() {
-		if( AL.getSourcei(src,AL.SOURCE_STATE) != AL.PLAYING )
-			AL.sourcePlay(src);
-	}
-
-	function onUpdate( i : Int ){
-		var r = AL.getSourcei(src,AL.BUFFERS_PROCESSED);
-		if( r > 0 ){
-			for( b in AL.sourceUnqueueBuffers(src,r) )
-				onSample(b);
-			forcePlay();
-		}
-	}
-}
-#end
-
 class NativeChannel {
 
 	#if flash
@@ -120,8 +38,6 @@ class NativeChannel {
 	var queued : js.html.audio.AudioBufferSourceNode;
 	var time : Float; // Mandatory for proper buffer sync, otherwise produces gaps in playback due to innacurate timings.
 	var tmpBuffer : haxe.io.Float32Array;
-	#elseif lime_openal
-	var channel : ALChannel;
 	#end
 	public var bufferSamples(default, null) : Int;
 
@@ -160,8 +76,6 @@ class NativeChannel {
 		time = currTime + front.duration;
 		queued.start(time);
 		
-		#elseif lime_openal
-		channel = new ALChannel(bufferSamples, this);
 		#end
 	}
 
@@ -263,11 +177,6 @@ class NativeChannel {
 			bufferPool.push(tmpBuffer);
 			tmpBuffer = null;
 		}
-		#elseif lime_openal
-		if( channel != null ) {
-			channel.stop();
-			channel = null;
-		}
 		#end
 	}