(function ($hx_exports, $global) { "use strict"; var $hx_script = (function (exports, global) { // Generated by Haxe 4.1.5
(function ($hx_exports, $global) { "use strict";
$hx_exports["lime"] = $hx_exports["lime"] || {};
var $hxClasses = {},$estr = function() { return js_Boot.__string_rec(this,''); },$hxEnums = $hxEnums || {},$_;
function $extend(from, fields) {
	var proto = Object.create(from);
	for (var name in fields) proto[name] = fields[name];
	if( fields.toString !== Object.prototype.toString ) proto.toString = fields.toString;
	return proto;
}
var lime_app_IModule = function() { };
$hxClasses["lime.app.IModule"] = lime_app_IModule;
lime_app_IModule.__name__ = "lime.app.IModule";
lime_app_IModule.__isInterface__ = true;
lime_app_IModule.prototype = {
	__registerLimeModule: null
	,__unregisterLimeModule: null
	,__class__: lime_app_IModule
};
var lime_app_Module = function() {
	this.onExit = new lime_app__$Event_$Int_$Void();
};
$hxClasses["lime.app.Module"] = lime_app_Module;
lime_app_Module.__name__ = "lime.app.Module";
lime_app_Module.__interfaces__ = [lime_app_IModule];
lime_app_Module.prototype = {
	onExit: null
	,__registerLimeModule: function(application) {
	}
	,__unregisterLimeModule: function(application) {
	}
	,__class__: lime_app_Module
};
var lime__$internal_backend_html5_HTML5Application = function(parent) {
	this.gameDeviceCache = new haxe_ds_IntMap();
	this.parent = parent;
	this.currentUpdate = 0;
	this.lastUpdate = 0;
	this.nextUpdate = 0;
	this.framePeriod = -1;
	lime_media_AudioManager.init();
	this.accelerometer = lime_system_Sensor.registerSensor(lime_system_SensorType.ACCELEROMETER,0);
};
$hxClasses["lime._internal.backend.html5.HTML5Application"] = lime__$internal_backend_html5_HTML5Application;
lime__$internal_backend_html5_HTML5Application.__name__ = "lime._internal.backend.html5.HTML5Application";
lime__$internal_backend_html5_HTML5Application.prototype = {
	gameDeviceCache: null
	,accelerometer: null
	,currentUpdate: null
	,deltaTime: null
	,framePeriod: null
	,lastUpdate: null
	,nextUpdate: null
	,parent: null
	,convertKeyCode: function(keyCode) {
		if(keyCode >= 65 && keyCode <= 90) {
			return keyCode + 32;
		}
		switch(keyCode) {
		case 12:
			return 1073741980;
		case 16:
			return 1073742049;
		case 17:
			return 1073742048;
		case 18:
			return 1073742050;
		case 19:
			return 1073741896;
		case 20:
			return 1073741881;
		case 33:
			return 1073741899;
		case 34:
			return 1073741902;
		case 35:
			return 1073741901;
		case 36:
			return 1073741898;
		case 37:
			return 1073741904;
		case 38:
			return 1073741906;
		case 39:
			return 1073741903;
		case 40:
			return 1073741905;
		case 41:
			return 1073741943;
		case 43:
			return 1073741940;
		case 44:
			return 1073741894;
		case 45:
			return 1073741897;
		case 46:
			return 127;
		case 91:
			return 1073742051;
		case 92:
			return 1073742055;
		case 93:
			return 1073742055;
		case 95:
			return 1073742106;
		case 96:
			return 1073741922;
		case 97:
			return 1073741913;
		case 98:
			return 1073741914;
		case 99:
			return 1073741915;
		case 100:
			return 1073741916;
		case 101:
			return 1073741917;
		case 102:
			return 1073741918;
		case 103:
			return 1073741919;
		case 104:
			return 1073741920;
		case 105:
			return 1073741921;
		case 106:
			return 1073741909;
		case 107:
			return 1073741911;
		case 108:
			return 1073741923;
		case 109:
			return 1073741910;
		case 110:
			return 1073741923;
		case 111:
			return 1073741908;
		case 112:
			return 1073741882;
		case 113:
			return 1073741883;
		case 114:
			return 1073741884;
		case 115:
			return 1073741885;
		case 116:
			return 1073741886;
		case 117:
			return 1073741887;
		case 118:
			return 1073741888;
		case 119:
			return 1073741889;
		case 120:
			return 1073741890;
		case 121:
			return 1073741891;
		case 122:
			return 1073741892;
		case 123:
			return 1073741893;
		case 124:
			return 1073741928;
		case 125:
			return 1073741929;
		case 126:
			return 1073741930;
		case 127:
			return 1073741931;
		case 128:
			return 1073741932;
		case 129:
			return 1073741933;
		case 130:
			return 1073741934;
		case 131:
			return 1073741935;
		case 132:
			return 1073741936;
		case 133:
			return 1073741937;
		case 134:
			return 1073741938;
		case 135:
			return 1073741939;
		case 144:
			return 1073741907;
		case 145:
			return 1073741895;
		case 160:
			return 94;
		case 161:
			return 33;
		case 163:
			return 35;
		case 164:
			return 36;
		case 166:
			return 1073742094;
		case 167:
			return 1073742095;
		case 168:
			return 1073742097;
		case 169:
			return 41;
		case 170:
			return 42;
		case 171:
			return 96;
		case 172:
			return 1073741898;
		case 173:
			return 45;
		case 174:
			return 1073741953;
		case 175:
			return 1073741952;
		case 176:
			return 1073742082;
		case 177:
			return 1073742083;
		case 178:
			return 1073742084;
		case 179:
			return 1073742085;
		case 180:
			return 1073742089;
		case 181:
			return 1073742086;
		case 182:
			return 1073741953;
		case 183:
			return 1073741952;
		case 186:
			return 59;
		case 187:
			return 61;
		case 188:
			return 44;
		case 189:
			return 45;
		case 190:
			return 46;
		case 191:
			return 47;
		case 192:
			return 96;
		case 193:
			return 63;
		case 194:
			return 1073741923;
		case 219:
			return 91;
		case 220:
			return 92;
		case 221:
			return 93;
		case 222:
			return 39;
		case 223:
			return 96;
		case 224:
			return 1073742051;
		case 226:
			return 92;
		}
		return keyCode;
	}
	,exec: function() {
		window.addEventListener("keydown",$bind(this,this.handleKeyEvent),false);
		window.addEventListener("keyup",$bind(this,this.handleKeyEvent),false);
		window.addEventListener("focus",$bind(this,this.handleWindowEvent),false);
		window.addEventListener("blur",$bind(this,this.handleWindowEvent),false);
		window.addEventListener("resize",$bind(this,this.handleWindowEvent),false);
		window.addEventListener("beforeunload",$bind(this,this.handleWindowEvent),false);
		window.addEventListener("devicemotion",$bind(this,this.handleSensorEvent),false);
		
			if (!CanvasRenderingContext2D.prototype.isPointInStroke) {
				CanvasRenderingContext2D.prototype.isPointInStroke = function (path, x, y) {
					return false;
				};
			}
			if (!CanvasRenderingContext2D.prototype.isPointInPath) {
				CanvasRenderingContext2D.prototype.isPointInPath = function (path, x, y) {
					return false;
				};
			}

			if ('performance' in window == false) {
				window.performance = {};
			}

			if ('now' in window.performance == false) {
				var offset = Date.now();
				if (performance.timing && performance.timing.navigationStart) {
					offset = performance.timing.navigationStart
				}
				window.performance.now = function now() {
					return Date.now() - offset;
				}
			}

			var lastTime = 0;
			var vendors = ['ms', 'moz', 'webkit', 'o'];
			for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
				window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
				window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame'];
			}

			if (!window.requestAnimationFrame)
				window.requestAnimationFrame = function(callback, element) {
					var currTime = new Date().getTime();
					var timeToCall = Math.max(0, 16 - (currTime - lastTime));
					var id = window.setTimeout(function() { callback(currTime + timeToCall); },
					  timeToCall);
					lastTime = currTime + timeToCall;
					return id;
				};

			if (!window.cancelAnimationFrame)
				window.cancelAnimationFrame = function(id) {
					clearTimeout(id);
				};

			window.requestAnimFrame = window.requestAnimationFrame;
		;
		this.lastUpdate = new Date().getTime();
		this.handleApplicationEvent();
		return 0;
	}
	,exit: function() {
	}
	,handleApplicationEvent: function(__) {
		var _g = 0;
		var _g1 = this.parent.__windows;
		while(_g < _g1.length) {
			var $window = _g1[_g];
			++_g;
			$window.__backend.updateSize();
		}
		this.updateGameDevices();
		this.currentUpdate = new Date().getTime();
		if(this.currentUpdate >= this.nextUpdate) {
			this.deltaTime = this.currentUpdate - this.lastUpdate;
			var _g = 0;
			var _g1 = this.parent.__windows;
			while(_g < _g1.length) {
				var $window = _g1[_g];
				++_g;
				this.parent.onUpdate.dispatch(this.deltaTime | 0);
				if($window.context != null) {
					$window.onRender.dispatch($window.context);
				}
			}
			if(this.framePeriod < 0) {
				this.nextUpdate = this.currentUpdate;
			} else {
				this.nextUpdate = this.currentUpdate - this.currentUpdate % this.framePeriod + this.framePeriod;
			}
			this.lastUpdate = this.currentUpdate;
		}
		window.requestAnimationFrame($bind(this,this.handleApplicationEvent));
	}
	,handleKeyEvent: function(event) {
		if(this.parent.__window != null) {
			var keyCode = this.convertKeyCode(event.keyCode != null ? event.keyCode : event.which);
			var modifier = (event.shiftKey ? 3 : 0) | (event.ctrlKey ? 192 : 0) | (event.altKey ? 768 : 0) | (event.metaKey ? 3072 : 0);
			if(event.type == "keydown") {
				this.parent.__window.onKeyDown.dispatch(keyCode,modifier);
				if(this.parent.__window.onKeyDown.canceled && event.cancelable) {
					event.preventDefault();
				}
			} else {
				this.parent.__window.onKeyUp.dispatch(keyCode,modifier);
				if(this.parent.__window.onKeyUp.canceled && event.cancelable) {
					event.preventDefault();
				}
			}
		}
	}
	,handleSensorEvent: function(event) {
		this.accelerometer.onUpdate.dispatch(event.accelerationIncludingGravity.x,event.accelerationIncludingGravity.y,event.accelerationIncludingGravity.z);
	}
	,handleWindowEvent: function(event) {
		if(this.parent.__window != null) {
			switch(event.type) {
			case "beforeunload":
				break;
			case "blur":
				this.parent.__window.onFocusOut.dispatch();
				this.parent.__window.onDeactivate.dispatch();
				break;
			case "focus":
				this.parent.__window.onFocusIn.dispatch();
				this.parent.__window.onActivate.dispatch();
				break;
			case "resize":
				this.parent.__window.__backend.handleResizeEvent(event);
				break;
			}
		}
	}
	,updateGameDevices: function() {
		var devices = lime_ui_Joystick.__getDeviceData();
		if(devices == null) {
			return;
		}
		var id;
		var gamepad;
		var joystick;
		var data;
		var cache;
		var _g = 0;
		var _g1 = devices.length;
		while(_g < _g1) {
			var i = _g++;
			id = i;
			data = devices[id];
			if(data == null) {
				continue;
			}
			if(!this.gameDeviceCache.h.hasOwnProperty(id)) {
				cache = new lime__$internal_backend_html5_GameDeviceData();
				cache.id = id;
				cache.connected = data.connected;
				var _g2 = 0;
				var _g3 = data.buttons.length;
				while(_g2 < _g3) {
					var i1 = _g2++;
					cache.buttons.push(data.buttons[i1].value);
				}
				var _g4 = 0;
				var _g5 = data.axes.length;
				while(_g4 < _g5) {
					var i2 = _g4++;
					cache.axes.push(data.axes[i2]);
				}
				if(data.mapping == "standard") {
					cache.isGamepad = true;
				}
				this.gameDeviceCache.h[id] = cache;
				if(data.connected) {
					lime_ui_Joystick.__connect(id);
					if(cache.isGamepad) {
						lime_ui_Gamepad.__connect(id);
					}
				}
			}
			cache = this.gameDeviceCache.h[id];
			joystick = lime_ui_Joystick.devices.h[id];
			gamepad = lime_ui_Gamepad.devices.h[id];
			if(data.connected) {
				var button;
				var value;
				var _g6 = 0;
				var _g7 = data.buttons.length;
				while(_g6 < _g7) {
					var i3 = _g6++;
					value = data.buttons[i3].value;
					if(value != cache.buttons[i3]) {
						if(i3 == 6) {
							joystick.onAxisMove.dispatch(data.axes.length,value);
							if(gamepad != null) {
								gamepad.onAxisMove.dispatch(4,value);
							}
						} else if(i3 == 7) {
							joystick.onAxisMove.dispatch(data.axes.length + 1,value);
							if(gamepad != null) {
								gamepad.onAxisMove.dispatch(5,value);
							}
						} else {
							if(value > 0) {
								joystick.onButtonDown.dispatch(i3);
							} else {
								joystick.onButtonUp.dispatch(i3);
							}
							if(gamepad != null) {
								switch(i3) {
								case 0:
									button = 0;
									break;
								case 1:
									button = 1;
									break;
								case 2:
									button = 2;
									break;
								case 3:
									button = 3;
									break;
								case 4:
									button = 9;
									break;
								case 5:
									button = 10;
									break;
								case 8:
									button = 4;
									break;
								case 9:
									button = 6;
									break;
								case 10:
									button = 7;
									break;
								case 11:
									button = 8;
									break;
								case 12:
									button = 11;
									break;
								case 13:
									button = 12;
									break;
								case 14:
									button = 13;
									break;
								case 15:
									button = 14;
									break;
								case 16:
									button = 5;
									break;
								default:
									continue;
								}
								if(value > 0) {
									gamepad.onButtonDown.dispatch(button);
								} else {
									gamepad.onButtonUp.dispatch(button);
								}
							}
						}
						cache.buttons[i3] = value;
					}
				}
				var _g8 = 0;
				var _g9 = data.axes.length;
				while(_g8 < _g9) {
					var i4 = _g8++;
					if(data.axes[i4] != cache.axes[i4]) {
						joystick.onAxisMove.dispatch(i4,data.axes[i4]);
						if(gamepad != null) {
							gamepad.onAxisMove.dispatch(i4,data.axes[i4]);
						}
						cache.axes[i4] = data.axes[i4];
					}
				}
			} else if(cache.connected) {
				cache.connected = false;
				lime_ui_Joystick.__disconnect(id);
				lime_ui_Gamepad.__disconnect(id);
			}
		}
	}
	,__class__: lime__$internal_backend_html5_HTML5Application
};
var lime_app_Application = function() {
	this.onCreateWindow = new lime_app__$Event_$lime_$ui_$Window_$Void();
	this.onUpdate = new lime_app__$Event_$Int_$Void();
	lime_app_Module.call(this);
	if(lime_app_Application.current == null) {
		lime_app_Application.current = this;
	}
	this.meta = new haxe_ds_StringMap();
	this.modules = [];
	this.__windowByID = new haxe_ds_IntMap();
	this.__windows = [];
	this.__backend = new lime__$internal_backend_html5_HTML5Application(this);
	this.__registerLimeModule(this);
	this.__preloader = new lime_utils_Preloader();
	this.__preloader.onProgress.add($bind(this,this.onPreloadProgress));
	this.__preloader.onComplete.add($bind(this,this.onPreloadComplete));
};
$hxClasses["lime.app.Application"] = lime_app_Application;
lime_app_Application.__name__ = "lime.app.Application";
lime_app_Application.current = null;
lime_app_Application.__super__ = lime_app_Module;
lime_app_Application.prototype = $extend(lime_app_Module.prototype,{
	meta: null
	,modules: null
	,onUpdate: null
	,onCreateWindow: null
	,preloader: null
	,window: null
	,windows: null
	,__backend: null
	,__preloader: null
	,__window: null
	,__windowByID: null
	,__windows: null
	,addModule: function(module) {
		module.__registerLimeModule(this);
		this.modules.push(module);
	}
	,createWindow: function(attributes) {
		var $window = this.__createWindow(attributes);
		this.__addWindow($window);
		return $window;
	}
	,exec: function() {
		lime_app_Application.current = this;
		return this.__backend.exec();
	}
	,onGamepadAxisMove: function(gamepad,axis,value) {
	}
	,onGamepadButtonDown: function(gamepad,button) {
	}
	,onGamepadButtonUp: function(gamepad,button) {
	}
	,onGamepadConnect: function(gamepad) {
	}
	,onGamepadDisconnect: function(gamepad) {
	}
	,onJoystickAxisMove: function(joystick,axis,value) {
	}
	,onJoystickButtonDown: function(joystick,button) {
	}
	,onJoystickButtonUp: function(joystick,button) {
	}
	,onJoystickConnect: function(joystick) {
	}
	,onJoystickDisconnect: function(joystick) {
	}
	,onJoystickHatMove: function(joystick,hat,position) {
	}
	,onJoystickTrackballMove: function(joystick,trackball,x,y) {
	}
	,onKeyDown: function(keyCode,modifier) {
	}
	,onKeyUp: function(keyCode,modifier) {
	}
	,onModuleExit: function(code) {
	}
	,onMouseDown: function(x,y,button) {
	}
	,onMouseMove: function(x,y) {
	}
	,onMouseMoveRelative: function(x,y) {
	}
	,onMouseUp: function(x,y,button) {
	}
	,onMouseWheel: function(deltaX,deltaY,deltaMode) {
	}
	,onPreloadComplete: function() {
	}
	,onPreloadProgress: function(loaded,total) {
	}
	,onRenderContextLost: function() {
	}
	,onRenderContextRestored: function(context) {
	}
	,onTextEdit: function(text,start,length) {
	}
	,onTextInput: function(text) {
	}
	,onTouchCancel: function(touch) {
	}
	,onTouchEnd: function(touch) {
	}
	,onTouchMove: function(touch) {
	}
	,onTouchStart: function(touch) {
	}
	,onWindowActivate: function() {
	}
	,onWindowClose: function() {
	}
	,onWindowCreate: function() {
	}
	,onWindowDeactivate: function() {
	}
	,onWindowDropFile: function(file) {
	}
	,onWindowEnter: function() {
	}
	,onWindowExpose: function() {
	}
	,onWindowFocusIn: function() {
	}
	,onWindowFocusOut: function() {
	}
	,onWindowFullscreen: function() {
	}
	,onWindowLeave: function() {
	}
	,onWindowMove: function(x,y) {
	}
	,onWindowMinimize: function() {
	}
	,onWindowResize: function(width,height) {
	}
	,onWindowRestore: function() {
	}
	,removeModule: function(module) {
		if(module != null) {
			module.__unregisterLimeModule(this);
			HxOverrides.remove(this.modules,module);
		}
	}
	,render: function(context) {
	}
	,update: function(deltaTime) {
	}
	,__addWindow: function($window) {
		if($window != null) {
			this.__windows.push($window);
			this.__windowByID.h[$window.id] = $window;
			var _g = $bind(this,this.__onWindowClose);
			var window1 = $window;
			var tmp = function() {
				_g(window1);
			};
			$window.onClose.add(tmp,false,-10000);
			if(this.__window == null) {
				this.__window = $window;
				$window.onActivate.add($bind(this,this.onWindowActivate));
				$window.onRenderContextLost.add($bind(this,this.onRenderContextLost));
				$window.onRenderContextRestored.add($bind(this,this.onRenderContextRestored));
				$window.onDeactivate.add($bind(this,this.onWindowDeactivate));
				$window.onDropFile.add($bind(this,this.onWindowDropFile));
				$window.onEnter.add($bind(this,this.onWindowEnter));
				$window.onExpose.add($bind(this,this.onWindowExpose));
				$window.onFocusIn.add($bind(this,this.onWindowFocusIn));
				$window.onFocusOut.add($bind(this,this.onWindowFocusOut));
				$window.onFullscreen.add($bind(this,this.onWindowFullscreen));
				$window.onKeyDown.add($bind(this,this.onKeyDown));
				$window.onKeyUp.add($bind(this,this.onKeyUp));
				$window.onLeave.add($bind(this,this.onWindowLeave));
				$window.onMinimize.add($bind(this,this.onWindowMinimize));
				$window.onMouseDown.add($bind(this,this.onMouseDown));
				$window.onMouseMove.add($bind(this,this.onMouseMove));
				$window.onMouseMoveRelative.add($bind(this,this.onMouseMoveRelative));
				$window.onMouseUp.add($bind(this,this.onMouseUp));
				$window.onMouseWheel.add($bind(this,this.onMouseWheel));
				$window.onMove.add($bind(this,this.onWindowMove));
				$window.onRender.add($bind(this,this.render));
				$window.onResize.add($bind(this,this.onWindowResize));
				$window.onRestore.add($bind(this,this.onWindowRestore));
				$window.onTextEdit.add($bind(this,this.onTextEdit));
				$window.onTextInput.add($bind(this,this.onTextInput));
				this.onWindowCreate();
			}
			this.onCreateWindow.dispatch($window);
		}
	}
	,__createWindow: function(attributes) {
		var $window = new lime_ui_Window(this,attributes);
		if($window.id == -1) {
			return null;
		}
		return $window;
	}
	,__registerLimeModule: function(application) {
		application.onUpdate.add($bind(this,this.update));
		application.onExit.add($bind(this,this.onModuleExit),false,0);
		application.onExit.add($bind(this,this.__onModuleExit),false,0);
		var gamepad = lime_ui_Gamepad.devices.iterator();
		while(gamepad.hasNext()) {
			var gamepad1 = gamepad.next();
			this.__onGamepadConnect(gamepad1);
		}
		lime_ui_Gamepad.onConnect.add($bind(this,this.__onGamepadConnect));
		var joystick = lime_ui_Joystick.devices.iterator();
		while(joystick.hasNext()) {
			var joystick1 = joystick.next();
			this.__onJoystickConnect(joystick1);
		}
		lime_ui_Joystick.onConnect.add($bind(this,this.__onJoystickConnect));
		lime_ui_Touch.onCancel.add($bind(this,this.onTouchCancel));
		lime_ui_Touch.onStart.add($bind(this,this.onTouchStart));
		lime_ui_Touch.onMove.add($bind(this,this.onTouchMove));
		lime_ui_Touch.onEnd.add($bind(this,this.onTouchEnd));
	}
	,__removeWindow: function($window) {
		if($window != null && this.__windowByID.h.hasOwnProperty($window.id)) {
			if(this.__window == $window) {
				this.__window = null;
			}
			HxOverrides.remove(this.__windows,$window);
			this.__windowByID.remove($window.id);
			$window.close();
			if(this.__windows.length == 0) {
				lime_system_System.exit(0);
			}
		}
	}
	,__onGamepadConnect: function(gamepad) {
		this.onGamepadConnect(gamepad);
		var _g = $bind(this,this.onGamepadAxisMove);
		var gamepad1 = gamepad;
		var tmp = function(axis,value) {
			_g(gamepad1,axis,value);
		};
		gamepad.onAxisMove.add(tmp);
		var _g1 = $bind(this,this.onGamepadButtonDown);
		var gamepad2 = gamepad;
		var tmp = function(button) {
			_g1(gamepad2,button);
		};
		gamepad.onButtonDown.add(tmp);
		var _g2 = $bind(this,this.onGamepadButtonUp);
		var gamepad3 = gamepad;
		var tmp = function(button) {
			_g2(gamepad3,button);
		};
		gamepad.onButtonUp.add(tmp);
		var _g3 = $bind(this,this.onGamepadDisconnect);
		var gamepad4 = gamepad;
		var tmp = function() {
			_g3(gamepad4);
		};
		gamepad.onDisconnect.add(tmp);
	}
	,__onJoystickConnect: function(joystick) {
		this.onJoystickConnect(joystick);
		var _g = $bind(this,this.onJoystickAxisMove);
		var joystick1 = joystick;
		var tmp = function(axis,value) {
			_g(joystick1,axis,value);
		};
		joystick.onAxisMove.add(tmp);
		var _g1 = $bind(this,this.onJoystickButtonDown);
		var joystick2 = joystick;
		var tmp = function(button) {
			_g1(joystick2,button);
		};
		joystick.onButtonDown.add(tmp);
		var _g2 = $bind(this,this.onJoystickButtonUp);
		var joystick3 = joystick;
		var tmp = function(button) {
			_g2(joystick3,button);
		};
		joystick.onButtonUp.add(tmp);
		var _g3 = $bind(this,this.onJoystickDisconnect);
		var joystick4 = joystick;
		var tmp = function() {
			_g3(joystick4);
		};
		joystick.onDisconnect.add(tmp);
		var _g4 = $bind(this,this.onJoystickHatMove);
		var joystick5 = joystick;
		var tmp = function(hat,position) {
			_g4(joystick5,hat,position);
		};
		joystick.onHatMove.add(tmp);
		var _g5 = $bind(this,this.onJoystickTrackballMove);
		var joystick6 = joystick;
		var tmp = function(trackball,x,y) {
			_g5(joystick6,trackball,x,y);
		};
		joystick.onTrackballMove.add(tmp);
	}
	,__onModuleExit: function(code) {
		this.__backend.exit();
	}
	,__onWindowClose: function($window) {
		if(this.__window == $window) {
			this.onWindowClose();
		}
		this.__removeWindow($window);
	}
	,__unregisterLimeModule: function(application) {
		application.onUpdate.remove($bind(this,this.update));
		application.onExit.remove($bind(this,this.__onModuleExit));
		application.onExit.remove($bind(this,this.onModuleExit));
		lime_ui_Gamepad.onConnect.remove($bind(this,this.__onGamepadConnect));
		lime_ui_Joystick.onConnect.remove($bind(this,this.__onJoystickConnect));
		lime_ui_Touch.onCancel.remove($bind(this,this.onTouchCancel));
		lime_ui_Touch.onStart.remove($bind(this,this.onTouchStart));
		lime_ui_Touch.onMove.remove($bind(this,this.onTouchMove));
		lime_ui_Touch.onEnd.remove($bind(this,this.onTouchEnd));
		this.onModuleExit(0);
	}
	,get_preloader: function() {
		return this.__preloader;
	}
	,get_window: function() {
		return this.__window;
	}
	,get_windows: function() {
		return this.__windows;
	}
	,__class__: lime_app_Application
	,__properties__: {get_windows:"get_windows",get_window:"get_window",get_preloader:"get_preloader"}
});
var ApplicationMain = function() { };
$hxClasses["ApplicationMain"] = ApplicationMain;
ApplicationMain.__name__ = "ApplicationMain";
ApplicationMain.main = function() {
	lime_system_System.__registerEntryPoint("MonsterMatch",ApplicationMain.create);
};
ApplicationMain.create = function(config) {
	var app = new openfl_display_Application();
	ManifestResources.init(config);
	app.meta.h["build"] = "1";
	app.meta.h["company"] = "Axol Studio, LLC";
	app.meta.h["file"] = "MonsterMatch";
	app.meta.h["name"] = "Monster Match";
	app.meta.h["packageName"] = "com.example.myapp";
	app.meta.h["version"] = "1.0.2";
	var attributes = { allowHighDPI : true, alwaysOnTop : false, borderless : false, element : null, frameRate : 120, height : 600, hidden : false, maximized : false, minimized : false, parameters : { }, resizable : false, title : "Monster Match", width : 800, x : null, y : null};
	attributes.context = { antialiasing : 0, background : 3355443, colorDepth : 32, depth : true, hardware : true, stencil : true, type : null, vsync : true};
	if(app.__window == null) {
		if(config != null) {
			var _g = 0;
			var _g1 = Reflect.fields(config);
			while(_g < _g1.length) {
				var field = _g1[_g];
				++_g;
				if(Object.prototype.hasOwnProperty.call(attributes,field)) {
					attributes[field] = Reflect.field(config,field);
				} else if(Object.prototype.hasOwnProperty.call(attributes.context,field)) {
					attributes.context[field] = Reflect.field(config,field);
				}
			}
		}
	}
	app.createWindow(attributes);
	var preloader = new openfl_display_Preloader(new flixel_system_FlxPreloader());
	app.__preloader.onProgress.add(function(loaded,total) {
		preloader.update(loaded,total);
	});
	app.__preloader.onComplete.add(function() {
		preloader.start();
	});
	var stage = (js_Boot.__cast(app.__window , openfl_display_Window)).stage;
	var tmp = function() {
		ApplicationMain.start(stage);
	};
	preloader.onComplete.add(tmp);
	var _g = 0;
	var _g1 = ManifestResources.preloadLibraries;
	while(_g < _g1.length) {
		var library = _g1[_g];
		++_g;
		app.__preloader.addLibrary(library);
	}
	var _g = 0;
	var _g1 = ManifestResources.preloadLibraryNames;
	while(_g < _g1.length) {
		var name = _g1[_g];
		++_g;
		app.__preloader.addLibraryName(name);
	}
	app.__preloader.load();
	var result = app.exec();
};
ApplicationMain.start = function(stage) {
	try {
		var current = stage.getChildAt(0);
		if(current == null || !((current) instanceof openfl_display_DisplayObjectContainer)) {
			current = new openfl_display_MovieClip();
			stage.addChild(current);
		}
		new DocumentClass(current);
		stage.dispatchEvent(new openfl_events_Event("resize",false,false));
		if(stage.window.__fullscreen) {
			stage.dispatchEvent(new openfl_events_FullScreenEvent("fullScreen",false,false,true,true));
		}
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		stage.__handleError(e);
	}
};
var openfl_events_IEventDispatcher = function() { };
$hxClasses["openfl.events.IEventDispatcher"] = openfl_events_IEventDispatcher;
openfl_events_IEventDispatcher.__name__ = "openfl.events.IEventDispatcher";
openfl_events_IEventDispatcher.__isInterface__ = true;
openfl_events_IEventDispatcher.prototype = {
	addEventListener: null
	,dispatchEvent: null
	,hasEventListener: null
	,removeEventListener: null
	,willTrigger: null
	,__class__: openfl_events_IEventDispatcher
};
var openfl_events_EventDispatcher = function(target) {
	if(target != null) {
		this.__targetDispatcher = target;
	}
};
$hxClasses["openfl.events.EventDispatcher"] = openfl_events_EventDispatcher;
openfl_events_EventDispatcher.__name__ = "openfl.events.EventDispatcher";
openfl_events_EventDispatcher.__interfaces__ = [openfl_events_IEventDispatcher];
openfl_events_EventDispatcher.prototype = {
	__eventMap: null
	,__iterators: null
	,__targetDispatcher: null
	,addEventListener: function(type,listener,useCapture,priority,useWeakReference) {
		if(useWeakReference == null) {
			useWeakReference = false;
		}
		if(priority == null) {
			priority = 0;
		}
		if(useCapture == null) {
			useCapture = false;
		}
		if(listener == null) {
			return;
		}
		if(this.__eventMap == null) {
			this.__eventMap = new haxe_ds_StringMap();
			this.__iterators = new haxe_ds_StringMap();
		}
		if(!Object.prototype.hasOwnProperty.call(this.__eventMap.h,type)) {
			var list = [];
			list.push(new openfl_events__$EventDispatcher_Listener(listener,useCapture,priority));
			var iterator = new openfl_events__$EventDispatcher_DispatchIterator(list);
			this.__eventMap.h[type] = list;
			this.__iterators.h[type] = [iterator];
		} else {
			var list = this.__eventMap.h[type];
			var _g = 0;
			var _g1 = list.length;
			while(_g < _g1) {
				var i = _g++;
				if(list[i].match(listener,useCapture)) {
					return;
				}
			}
			var iterators = this.__iterators.h[type];
			var _g = 0;
			while(_g < iterators.length) {
				var iterator = iterators[_g];
				++_g;
				if(iterator.active) {
					iterator.copy();
				}
			}
			this.__addListenerByPriority(list,new openfl_events__$EventDispatcher_Listener(listener,useCapture,priority));
		}
	}
	,dispatchEvent: function(event) {
		if(this.__targetDispatcher != null) {
			event.target = this.__targetDispatcher;
		} else {
			event.target = this;
		}
		return this.__dispatchEvent(event);
	}
	,hasEventListener: function(type) {
		if(this.__eventMap == null) {
			return false;
		}
		return Object.prototype.hasOwnProperty.call(this.__eventMap.h,type);
	}
	,removeEventListener: function(type,listener,useCapture) {
		if(useCapture == null) {
			useCapture = false;
		}
		if(this.__eventMap == null || listener == null) {
			return;
		}
		var list = this.__eventMap.h[type];
		if(list == null) {
			return;
		}
		var iterators = this.__iterators.h[type];
		var _g = 0;
		var _g1 = list.length;
		while(_g < _g1) {
			var i = _g++;
			if(list[i].match(listener,useCapture)) {
				var _g2 = 0;
				while(_g2 < iterators.length) {
					var iterator = iterators[_g2];
					++_g2;
					iterator.remove(list[i],i);
				}
				list.splice(i,1);
				break;
			}
		}
		if(list.length == 0) {
			var _this = this.__eventMap;
			if(Object.prototype.hasOwnProperty.call(_this.h,type)) {
				delete(_this.h[type]);
			}
			var _this = this.__iterators;
			if(Object.prototype.hasOwnProperty.call(_this.h,type)) {
				delete(_this.h[type]);
			}
		}
		if(!haxe_ds_StringMap.valueIterator(this.__eventMap.h).hasNext()) {
			this.__eventMap = null;
			this.__iterators = null;
		}
	}
	,toString: function() {
		var c = js_Boot.getClass(this);
		var full = c.__name__;
		var short = full.split(".").pop();
		return "[object " + short + "]";
	}
	,willTrigger: function(type) {
		return this.hasEventListener(type);
	}
	,__dispatchEvent: function(event) {
		if(this.__eventMap == null || event == null) {
			return true;
		}
		var type = event.type;
		var list = this.__eventMap.h[type];
		if(list == null) {
			return true;
		}
		if(event.target == null) {
			if(this.__targetDispatcher != null) {
				event.target = this.__targetDispatcher;
			} else {
				event.target = this;
			}
		}
		event.currentTarget = this;
		var capture = event.eventPhase == 1;
		var iterators = this.__iterators.h[type];
		var iterator = iterators[0];
		if(iterator.active) {
			iterator = new openfl_events__$EventDispatcher_DispatchIterator(list);
			iterators.push(iterator);
		}
		iterator.start();
		var listener = iterator;
		while(listener.hasNext()) {
			var listener1 = listener.next();
			if(listener1 == null) {
				continue;
			}
			if(listener1.useCapture == capture) {
				listener1.callback(event);
				if(event.__isCanceledNow) {
					break;
				}
			}
		}
		iterator.stop();
		if(iterator != iterators[0]) {
			HxOverrides.remove(iterators,iterator);
		} else {
			iterator.reset(list);
		}
		return !event.isDefaultPrevented();
	}
	,__removeAllListeners: function() {
		this.__eventMap = null;
		this.__iterators = null;
	}
	,__addListenerByPriority: function(list,listener) {
		var numElements = list.length;
		var addAtPosition = numElements;
		var _g = 0;
		var _g1 = numElements;
		while(_g < _g1) {
			var i = _g++;
			if(list[i].priority < listener.priority) {
				addAtPosition = i;
				break;
			}
		}
		list.splice(addAtPosition,0,listener);
	}
	,__class__: openfl_events_EventDispatcher
};
var openfl_display_IBitmapDrawable = function() { };
$hxClasses["openfl.display.IBitmapDrawable"] = openfl_display_IBitmapDrawable;
openfl_display_IBitmapDrawable.__name__ = "openfl.display.IBitmapDrawable";
openfl_display_IBitmapDrawable.__isInterface__ = true;
openfl_display_IBitmapDrawable.prototype = {
	__blendMode: null
	,__isMask: null
	,__renderable: null
	,__renderTransform: null
	,__transform: null
	,__worldAlpha: null
	,__worldColorTransform: null
	,__worldTransform: null
	,__getBounds: null
	,__renderCairo: null
	,__renderCairoMask: null
	,__renderCanvas: null
	,__renderCanvasMask: null
	,__renderDOM: null
	,__renderGL: null
	,__renderGLMask: null
	,__update: null
	,__updateTransforms: null
	,__mask: null
	,__scrollRect: null
	,__class__: openfl_display_IBitmapDrawable
};
var openfl_Vector = {};
openfl_Vector.__properties__ = {set_length:"set_length",get_length:"get_length",set_fixed:"set_fixed",get_fixed:"get_fixed"};
openfl_Vector.ofArray_Float = function(array) {
	var vector = openfl_Vector.toFloatVector(null);
	var _g = 0;
	var _g1 = array.length;
	while(_g < _g1) {
		var i = _g++;
		vector.set(i,array[i]);
	}
	return vector;
};
openfl_Vector.ofArray_Int = function(array) {
	var vector = openfl_Vector.toIntVector(null);
	var _g = 0;
	var _g1 = array.length;
	while(_g < _g1) {
		var i = _g++;
		vector.set(i,array[i]);
	}
	return vector;
};
openfl_Vector.concat = function(this1,vec) {
	return this1.concat(vec);
};
openfl_Vector.copy = function(this1) {
	return this1.copy();
};
openfl_Vector.filter = function(this1,callback) {
	return this1.filter(callback);
};
openfl_Vector.get = function(this1,index) {
	return this1.get(index);
};
openfl_Vector.indexOf = function(this1,searchElement,fromIndex) {
	if(fromIndex == null) {
		fromIndex = 0;
	}
	return this1.indexOf(searchElement,fromIndex);
};
openfl_Vector.insertAt = function(this1,index,element) {
	this1.insertAt(index,element);
};
openfl_Vector.iterator = function(this1) {
	return this1.iterator();
};
openfl_Vector.join = function(this1,sep) {
	if(sep == null) {
		sep = ",";
	}
	return this1.join(sep);
};
openfl_Vector.lastIndexOf = function(this1,searchElement,fromIndex) {
	return this1.lastIndexOf(searchElement,fromIndex);
};
openfl_Vector.pop = function(this1) {
	return this1.pop();
};
openfl_Vector.push = function(this1,value) {
	return this1.push(value);
};
openfl_Vector.removeAt = function(this1,index) {
	return this1.removeAt(index);
};
openfl_Vector.reverse = function(this1) {
	return this1.reverse();
};
openfl_Vector.set = function(this1,index,value) {
	return this1.set(index,value);
};
openfl_Vector.shift = function(this1) {
	return this1.shift();
};
openfl_Vector.slice = function(this1,startIndex,endIndex) {
	if(startIndex == null) {
		startIndex = 0;
	}
	return this1.slice(startIndex,endIndex);
};
openfl_Vector.sort = function(this1,sortBehavior) {
	this1.sort(sortBehavior);
};
openfl_Vector.splice = function(this1,startIndex,deleteCount) {
	return this1.splice(startIndex,deleteCount);
};
openfl_Vector.toString = function(this1) {
	if(this1 != null) {
		return this1.toString();
	} else {
		return null;
	}
};
openfl_Vector.unshift = function(this1,value) {
	this1.unshift(value);
};
openfl_Vector.convert = function(vec) {
	return vec;
};
openfl_Vector.toBoolVector = function(t,length,fixed,array) {
	return new openfl__$Vector_BoolVector(length,fixed,array);
};
openfl_Vector.toIntVector = function(t,length,fixed,array) {
	return new openfl__$Vector_IntVector(length,fixed,array);
};
openfl_Vector.toFloatVector = function(t,length,fixed,array) {
	return new openfl__$Vector_FloatVector(length,fixed,array,true);
};
openfl_Vector.toFunctionVector = function(t,length,fixed,array) {
	return new openfl__$Vector_FunctionVector(length,fixed,array);
};
openfl_Vector.toObjectVector = function(t,length,fixed,array) {
	return new openfl__$Vector_ObjectVector(length,fixed,array,true);
};
openfl_Vector.toNullVector = function(t,length,fixed,array) {
	return new openfl__$Vector_ObjectVector(length,fixed,array,true);
};
openfl_Vector.fromBoolVector = function(vector) {
	return vector;
};
openfl_Vector.fromIntVector = function(vector) {
	return vector;
};
openfl_Vector.fromFloatVector = function(vector) {
	return vector;
};
openfl_Vector.fromFunctionVector = function(vector) {
	return vector;
};
openfl_Vector.fromObjectVector = function(vector) {
	return vector;
};
openfl_Vector.get_fixed = function(this1) {
	return this1.fixed;
};
openfl_Vector.set_fixed = function(this1,value) {
	return this1.fixed = value;
};
openfl_Vector.get_length = function(this1) {
	return this1.get_length();
};
openfl_Vector.set_length = function(this1,value) {
	return this1.set_length(value);
};
var lime_utils_ObjectPool = function(create,clean,size) {
	this.__pool = new haxe_ds_ObjectMap();
	this.activeObjects = 0;
	this.inactiveObjects = 0;
	this.__inactiveObject0 = null;
	this.__inactiveObject1 = null;
	this.__inactiveObjectList = new haxe_ds_List();
	if(create != null) {
		this.create = create;
	}
	if(clean != null) {
		this.clean = clean;
	}
	if(size != null) {
		this.set_size(size);
	}
};
$hxClasses["lime.utils.ObjectPool"] = lime_utils_ObjectPool;
lime_utils_ObjectPool.__name__ = "lime.utils.ObjectPool";
lime_utils_ObjectPool.prototype = {
	activeObjects: null
	,inactiveObjects: null
	,__inactiveObject0: null
	,__inactiveObject1: null
	,__inactiveObjectList: null
	,__pool: null
	,__size: null
	,add: function(object) {
		if(!this.__pool.exists(object)) {
			this.__pool.set(object,false);
			this.clean(object);
			if(this.__inactiveObject0 == null) {
				this.__inactiveObject0 = object;
			} else if(this.__inactiveObject1 == null) {
				this.__inactiveObject1 = object;
			} else {
				this.__inactiveObjectList.add(object);
			}
			this.inactiveObjects++;
		}
	}
	,clean: function(object) {
	}
	,clear: function() {
		this.__pool = new haxe_ds_ObjectMap();
		this.activeObjects = 0;
		this.inactiveObjects = 0;
		this.__inactiveObject0 = null;
		this.__inactiveObject1 = null;
		this.__inactiveObjectList.clear();
	}
	,create: function() {
		return null;
	}
	,get: function() {
		var object = null;
		if(this.inactiveObjects > 0) {
			var object1 = null;
			if(this.__inactiveObject0 != null) {
				object1 = this.__inactiveObject0;
				this.__inactiveObject0 = null;
			} else if(this.__inactiveObject1 != null) {
				object1 = this.__inactiveObject1;
				this.__inactiveObject1 = null;
			} else {
				object1 = this.__inactiveObjectList.pop();
				if(this.__inactiveObjectList.length > 0) {
					this.__inactiveObject0 = this.__inactiveObjectList.pop();
				}
				if(this.__inactiveObjectList.length > 0) {
					this.__inactiveObject1 = this.__inactiveObjectList.pop();
				}
			}
			this.inactiveObjects--;
			this.activeObjects++;
			object = object1;
		} else if(this.__size == null || this.activeObjects < this.__size) {
			object = this.create();
			if(object != null) {
				this.__pool.set(object,true);
				this.activeObjects++;
			}
		}
		return object;
	}
	,release: function(object) {
		this.activeObjects--;
		if(this.__size == null || this.activeObjects + this.inactiveObjects < this.__size) {
			this.clean(object);
			if(this.__inactiveObject0 == null) {
				this.__inactiveObject0 = object;
			} else if(this.__inactiveObject1 == null) {
				this.__inactiveObject1 = object;
			} else {
				this.__inactiveObjectList.add(object);
			}
			this.inactiveObjects++;
		} else {
			this.__pool.remove(object);
		}
	}
	,remove: function(object) {
		if(this.__pool.exists(object)) {
			this.__pool.remove(object);
			if(this.__inactiveObject0 == object) {
				this.__inactiveObject0 = null;
				this.inactiveObjects--;
			} else if(this.__inactiveObject1 == object) {
				this.__inactiveObject1 = null;
				this.inactiveObjects--;
			} else if(this.__inactiveObjectList.remove(object)) {
				this.inactiveObjects--;
			} else {
				this.activeObjects--;
			}
		}
	}
	,__addInactive: function(object) {
		if(this.__inactiveObject0 == null) {
			this.__inactiveObject0 = object;
		} else if(this.__inactiveObject1 == null) {
			this.__inactiveObject1 = object;
		} else {
			this.__inactiveObjectList.add(object);
		}
		this.inactiveObjects++;
	}
	,__getInactive: function() {
		var object = null;
		if(this.__inactiveObject0 != null) {
			object = this.__inactiveObject0;
			this.__inactiveObject0 = null;
		} else if(this.__inactiveObject1 != null) {
			object = this.__inactiveObject1;
			this.__inactiveObject1 = null;
		} else {
			object = this.__inactiveObjectList.pop();
			if(this.__inactiveObjectList.length > 0) {
				this.__inactiveObject0 = this.__inactiveObjectList.pop();
			}
			if(this.__inactiveObjectList.length > 0) {
				this.__inactiveObject1 = this.__inactiveObjectList.pop();
			}
		}
		this.inactiveObjects--;
		this.activeObjects++;
		return object;
	}
	,__removeInactive: function(count) {
		if(count <= 0 || this.inactiveObjects == 0) {
			return;
		}
		if(this.__inactiveObject0 != null) {
			this.__pool.remove(this.__inactiveObject0);
			this.__inactiveObject0 = null;
			this.inactiveObjects--;
			--count;
		}
		if(count == 0 || this.inactiveObjects == 0) {
			return;
		}
		if(this.__inactiveObject1 != null) {
			this.__pool.remove(this.__inactiveObject1);
			this.__inactiveObject1 = null;
			this.inactiveObjects--;
			--count;
		}
		if(count == 0 || this.inactiveObjects == 0) {
			return;
		}
		var _g_head = this.__inactiveObjectList.h;
		while(_g_head != null) {
			var val = _g_head.item;
			_g_head = _g_head.next;
			var object = val;
			this.__pool.remove(object);
			this.__inactiveObjectList.remove(object);
			this.inactiveObjects--;
			--count;
			if(count == 0 || this.inactiveObjects == 0) {
				return;
			}
		}
	}
	,get_size: function() {
		return this.__size;
	}
	,set_size: function(value) {
		if(value == null) {
			this.__size = null;
		} else {
			var current = this.inactiveObjects + this.activeObjects;
			this.__size = value;
			if(current > value) {
				this.__removeInactive(current - value);
			} else if(value > current) {
				var object;
				var _g = 0;
				var _g1 = value - current;
				while(_g < _g1) {
					var i = _g++;
					object = this.create();
					if(object != null) {
						this.__pool.set(object,false);
						this.__inactiveObjectList.add(object);
						this.inactiveObjects++;
					} else {
						break;
					}
				}
			}
		}
		return value;
	}
	,__class__: lime_utils_ObjectPool
	,__properties__: {set_size:"set_size",get_size:"get_size"}
};
var haxe_IMap = function() { };
$hxClasses["haxe.IMap"] = haxe_IMap;
haxe_IMap.__name__ = "haxe.IMap";
haxe_IMap.__isInterface__ = true;
haxe_IMap.prototype = {
	get: null
	,set: null
	,exists: null
	,remove: null
	,__class__: haxe_IMap
};
var haxe_ds_ObjectMap = function() {
	this.h = { __keys__ : { }};
};
$hxClasses["haxe.ds.ObjectMap"] = haxe_ds_ObjectMap;
haxe_ds_ObjectMap.__name__ = "haxe.ds.ObjectMap";
haxe_ds_ObjectMap.__interfaces__ = [haxe_IMap];
haxe_ds_ObjectMap.count = null;
haxe_ds_ObjectMap.prototype = {
	h: null
	,set: function(key,value) {
		var id = key.__id__;
		if(id == null) {
			id = (key.__id__ = $global.$haxeUID++);
		}
		this.h[id] = value;
		this.h.__keys__[id] = key;
	}
	,get: function(key) {
		return this.h[key.__id__];
	}
	,exists: function(key) {
		return this.h.__keys__[key.__id__] != null;
	}
	,remove: function(key) {
		var id = key.__id__;
		if(this.h.__keys__[id] == null) {
			return false;
		}
		delete(this.h[id]);
		delete(this.h.__keys__[id]);
		return true;
	}
	,keys: function() {
		var a = [];
		for( var key in this.h.__keys__ ) {
		if(this.h.hasOwnProperty(key)) {
			a.push(this.h.__keys__[key]);
		}
		}
		return new haxe_iterators_ArrayIterator(a);
	}
	,__class__: haxe_ds_ObjectMap
};
var haxe_ds_List = function() {
	this.length = 0;
};
$hxClasses["haxe.ds.List"] = haxe_ds_List;
haxe_ds_List.__name__ = "haxe.ds.List";
haxe_ds_List.prototype = {
	h: null
	,q: null
	,length: null
	,add: function(item) {
		var x = new haxe_ds__$List_ListNode(item,null);
		if(this.h == null) {
			this.h = x;
		} else {
			this.q.next = x;
		}
		this.q = x;
		this.length++;
	}
	,push: function(item) {
		var x = new haxe_ds__$List_ListNode(item,this.h);
		this.h = x;
		if(this.q == null) {
			this.q = x;
		}
		this.length++;
	}
	,pop: function() {
		if(this.h == null) {
			return null;
		}
		var x = this.h.item;
		this.h = this.h.next;
		if(this.h == null) {
			this.q = null;
		}
		this.length--;
		return x;
	}
	,clear: function() {
		this.h = null;
		this.q = null;
		this.length = 0;
	}
	,remove: function(v) {
		var prev = null;
		var l = this.h;
		while(l != null) {
			if(l.item == v) {
				if(prev == null) {
					this.h = l.next;
				} else {
					prev.next = l.next;
				}
				if(this.q == l) {
					this.q = prev;
				}
				this.length--;
				return true;
			}
			prev = l;
			l = l.next;
		}
		return false;
	}
	,iterator: function() {
		return new haxe_ds__$List_ListIterator(this.h);
	}
	,__class__: haxe_ds_List
};
var openfl_display_DisplayObject = function() {
	openfl_events_EventDispatcher.call(this);
	this.__alpha = 1;
	this.__blendMode = 10;
	this.__cacheAsBitmap = false;
	this.__transform = new openfl_geom_Matrix();
	this.__visible = true;
	this.__rotation = 0;
	this.__rotationSine = 0;
	this.__rotationCosine = 1;
	this.__scaleX = 1;
	this.__scaleY = 1;
	this.__worldAlpha = 1;
	this.__worldBlendMode = 10;
	this.__worldTransform = new openfl_geom_Matrix();
	this.__worldColorTransform = new openfl_geom_ColorTransform();
	this.__renderTransform = new openfl_geom_Matrix();
	this.__worldVisible = true;
	this.set_name("instance" + ++openfl_display_DisplayObject.__instanceCount);
	if(openfl_display_DisplayObject.__initStage != null) {
		this.stage = openfl_display_DisplayObject.__initStage;
		openfl_display_DisplayObject.__initStage = null;
		this.stage.addChild(this);
	}
};
$hxClasses["openfl.display.DisplayObject"] = openfl_display_DisplayObject;
openfl_display_DisplayObject.__name__ = "openfl.display.DisplayObject";
openfl_display_DisplayObject.__interfaces__ = [openfl_display_IBitmapDrawable];
openfl_display_DisplayObject.__initStage = null;
openfl_display_DisplayObject.__supportDOM = null;
openfl_display_DisplayObject.__calculateAbsoluteTransform = function(local,parentTransform,target) {
	target.a = local.a * parentTransform.a + local.b * parentTransform.c;
	target.b = local.a * parentTransform.b + local.b * parentTransform.d;
	target.c = local.c * parentTransform.a + local.d * parentTransform.c;
	target.d = local.c * parentTransform.b + local.d * parentTransform.d;
	target.tx = local.tx * parentTransform.a + local.ty * parentTransform.c + parentTransform.tx;
	target.ty = local.tx * parentTransform.b + local.ty * parentTransform.d + parentTransform.ty;
};
openfl_display_DisplayObject.__super__ = openfl_events_EventDispatcher;
openfl_display_DisplayObject.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	opaqueBackground: null
	,parent: null
	,stage: null
	,__alpha: null
	,__blendMode: null
	,__cacheAsBitmap: null
	,__cacheAsBitmapMatrix: null
	,__cacheBitmap: null
	,__cacheBitmapBackground: null
	,__cacheBitmapColorTransform: null
	,__cacheBitmapData: null
	,__cacheBitmapData2: null
	,__cacheBitmapData3: null
	,__cacheBitmapMatrix: null
	,__cacheBitmapRenderer: null
	,__cairo: null
	,__children: null
	,__customRenderClear: null
	,__customRenderEvent: null
	,__filters: null
	,__graphics: null
	,__interactive: null
	,__isCacheBitmapRender: null
	,__isMask: null
	,__loaderInfo: null
	,__mask: null
	,__maskTarget: null
	,__name: null
	,__objectTransform: null
	,__renderable: null
	,__renderDirty: null
	,__renderParent: null
	,__renderTransform: null
	,__renderTransformCache: null
	,__renderTransformChanged: null
	,__rotation: null
	,__rotationCosine: null
	,__rotationSine: null
	,__scale9Grid: null
	,__scaleX: null
	,__scaleY: null
	,__scrollRect: null
	,__shader: null
	,__tempPoint: null
	,__transform: null
	,__transformDirty: null
	,__visible: null
	,__worldAlpha: null
	,__worldAlphaChanged: null
	,__worldBlendMode: null
	,__worldClip: null
	,__worldClipChanged: null
	,__worldColorTransform: null
	,__worldShader: null
	,__worldScale9Grid: null
	,__worldTransform: null
	,__worldVisible: null
	,__worldVisibleChanged: null
	,__worldTransformInvalid: null
	,__worldZ: null
	,__canvas: null
	,__context: null
	,__style: null
	,addEventListener: function(type,listener,useCapture,priority,useWeakReference) {
		if(useWeakReference == null) {
			useWeakReference = false;
		}
		if(priority == null) {
			priority = 0;
		}
		if(useCapture == null) {
			useCapture = false;
		}
		switch(type) {
		case "activate":case "deactivate":case "enterFrame":case "exitFrame":case "frameConstructed":case "render":
			if(!Object.prototype.hasOwnProperty.call(openfl_display_DisplayObject.__broadcastEvents.h,type)) {
				openfl_display_DisplayObject.__broadcastEvents.h[type] = [];
			}
			var dispatchers = openfl_display_DisplayObject.__broadcastEvents.h[type];
			if(dispatchers.indexOf(this) == -1) {
				dispatchers.push(this);
			}
			break;
		case "clearDOM":case "renderCairo":case "renderCanvas":case "renderDOM":case "renderOpenGL":
			if(this.__customRenderEvent == null) {
				this.__customRenderEvent = new openfl_events_RenderEvent(null);
				this.__customRenderEvent.objectColorTransform = new openfl_geom_ColorTransform();
				this.__customRenderEvent.objectMatrix = new openfl_geom_Matrix();
				this.__customRenderClear = true;
			}
			break;
		default:
		}
		openfl_events_EventDispatcher.prototype.addEventListener.call(this,type,listener,useCapture,priority,useWeakReference);
	}
	,dispatchEvent: function(event) {
		if(((event) instanceof openfl_events_MouseEvent)) {
			var mouseEvent = event;
			var _this = this.__getRenderTransform();
			mouseEvent.stageX = mouseEvent.localX * _this.a + mouseEvent.localY * _this.c + _this.tx;
			var _this = this.__getRenderTransform();
			mouseEvent.stageY = mouseEvent.localX * _this.b + mouseEvent.localY * _this.d + _this.ty;
		} else if(((event) instanceof openfl_events_TouchEvent)) {
			var touchEvent = event;
			var _this = this.__getRenderTransform();
			touchEvent.stageX = touchEvent.localX * _this.a + touchEvent.localY * _this.c + _this.tx;
			var _this = this.__getRenderTransform();
			touchEvent.stageY = touchEvent.localX * _this.b + touchEvent.localY * _this.d + _this.ty;
		}
		event.target = this;
		return this.__dispatchWithCapture(event);
	}
	,getBounds: function(targetCoordinateSpace) {
		var matrix = openfl_geom_Matrix.__pool.get();
		if(targetCoordinateSpace != null && targetCoordinateSpace != this) {
			matrix.copyFrom(this.__getWorldTransform());
			var targetMatrix = openfl_geom_Matrix.__pool.get();
			targetMatrix.copyFrom(targetCoordinateSpace.__getWorldTransform());
			targetMatrix.invert();
			matrix.concat(targetMatrix);
			openfl_geom_Matrix.__pool.release(targetMatrix);
		} else {
			matrix.identity();
		}
		var bounds = new openfl_geom_Rectangle();
		this.__getBounds(bounds,matrix);
		openfl_geom_Matrix.__pool.release(matrix);
		return bounds;
	}
	,getRect: function(targetCoordinateSpace) {
		return this.getBounds(targetCoordinateSpace);
	}
	,globalToLocal: function(pos) {
		return this.__globalToLocal(pos,new openfl_geom_Point());
	}
	,hitTestObject: function(obj) {
		if(obj != null && obj.parent != null && this.parent != null) {
			var currentBounds = this.getBounds(this);
			var targetBounds = obj.getBounds(this);
			return currentBounds.intersects(targetBounds);
		}
		return false;
	}
	,hitTestPoint: function(x,y,shapeFlag) {
		if(shapeFlag == null) {
			shapeFlag = false;
		}
		if(this.stage != null) {
			return this.__hitTest(x,y,shapeFlag,null,false,this);
		} else {
			return false;
		}
	}
	,invalidate: function() {
		if(!this.__renderDirty) {
			this.__renderDirty = true;
			this.__setParentRenderDirty();
		}
	}
	,localToGlobal: function(point) {
		return this.__getRenderTransform().transformPoint(point);
	}
	,removeEventListener: function(type,listener,useCapture) {
		if(useCapture == null) {
			useCapture = false;
		}
		openfl_events_EventDispatcher.prototype.removeEventListener.call(this,type,listener,useCapture);
		switch(type) {
		case "activate":case "deactivate":case "enterFrame":case "exitFrame":case "frameConstructed":case "render":
			if(!this.hasEventListener(type)) {
				if(Object.prototype.hasOwnProperty.call(openfl_display_DisplayObject.__broadcastEvents.h,type)) {
					HxOverrides.remove(openfl_display_DisplayObject.__broadcastEvents.h[type],this);
				}
			}
			break;
		case "clearDOM":case "renderCairo":case "renderCanvas":case "renderDOM":case "renderOpenGL":
			if(!this.hasEventListener("clearDOM") && !this.hasEventListener("renderCairo") && !this.hasEventListener("renderCanvas") && !this.hasEventListener("renderDOM") && !this.hasEventListener("renderOpenGL")) {
				this.__customRenderEvent = null;
			}
			break;
		default:
		}
	}
	,__cleanup: function() {
		this.__cairo = null;
		this.__canvas = null;
		this.__context = null;
		if(this.__graphics != null) {
			this.__graphics.__cleanup();
		}
		if(this.__cacheBitmap != null) {
			this.__cacheBitmap.__cleanup();
			this.__cacheBitmap = null;
		}
		if(this.__cacheBitmapData != null) {
			this.__cacheBitmapData.dispose();
			this.__cacheBitmapData = null;
		}
	}
	,__dispatch: function(event) {
		if(this.__eventMap != null && this.hasEventListener(event.type)) {
			var result = openfl_events_EventDispatcher.prototype.__dispatchEvent.call(this,event);
			if(event.__isCanceled) {
				return true;
			}
			return result;
		}
		return true;
	}
	,__dispatchChildren: function(event) {
	}
	,__dispatchEvent: function(event) {
		var parent = event.bubbles ? this.parent : null;
		var result = openfl_events_EventDispatcher.prototype.__dispatchEvent.call(this,event);
		if(event.__isCanceled) {
			return true;
		}
		if(parent != null && parent != this) {
			event.eventPhase = 3;
			if(event.target == null) {
				event.target = this;
			}
			parent.__dispatchEvent(event);
		}
		return result;
	}
	,__dispatchWithCapture: function(event) {
		if(event.target == null) {
			event.target = this;
		}
		if(this.parent != null) {
			event.eventPhase = 1;
			if(this.parent == this.stage) {
				this.parent.__dispatch(event);
			} else {
				var stack = openfl_display_DisplayObject.__tempStack.get();
				var parent = this.parent;
				var i = 0;
				while(parent != null) {
					stack.set(i,parent);
					parent = parent.parent;
					++i;
				}
				var _g = 0;
				var _g1 = i;
				while(_g < _g1) {
					var j = _g++;
					stack.get(i - j - 1).__dispatch(event);
				}
				openfl_display_DisplayObject.__tempStack.release(stack);
			}
		}
		event.eventPhase = 2;
		return this.__dispatchEvent(event);
	}
	,__enterFrame: function(deltaTime) {
	}
	,__getBounds: function(rect,matrix) {
		if(this.__graphics != null) {
			this.__graphics.__getBounds(rect,matrix);
		}
	}
	,__getCursor: function() {
		return null;
	}
	,__getFilterBounds: function(rect,matrix) {
		this.__getRenderBounds(rect,matrix);
		if(this.__filters != null) {
			var extension = openfl_geom_Rectangle.__pool.get();
			var _g = 0;
			var _g1 = this.__filters;
			while(_g < _g1.length) {
				var filter = _g1[_g];
				++_g;
				extension.__expand(-filter.__leftExtension,-filter.__topExtension,filter.__leftExtension + filter.__rightExtension,filter.__topExtension + filter.__bottomExtension);
			}
			rect.width += extension.width;
			rect.height += extension.height;
			rect.x += extension.x;
			rect.y += extension.y;
			openfl_geom_Rectangle.__pool.release(extension);
		}
	}
	,__getInteractive: function(stack) {
		return false;
	}
	,__getLocalBounds: function(rect) {
		this.__getBounds(rect,this.__transform);
		rect.x -= this.__transform.tx;
		rect.y -= this.__transform.ty;
	}
	,__getRenderBounds: function(rect,matrix) {
		if(this.__scrollRect == null) {
			this.__getBounds(rect,matrix);
		} else {
			var r = openfl_geom_Rectangle.__pool.get();
			r.copyFrom(this.__scrollRect);
			r.__transform(r,matrix);
			rect.__expand(r.x,r.y,r.width,r.height);
			openfl_geom_Rectangle.__pool.release(r);
		}
	}
	,__getRenderTransform: function() {
		this.__getWorldTransform();
		return this.__renderTransform;
	}
	,__getWorldTransform: function() {
		var transformDirty = this.__transformDirty || this.__worldTransformInvalid;
		if(transformDirty) {
			var list = [];
			var current = this;
			if(this.parent == null) {
				this.__update(true,false);
			} else {
				while(current != this.stage) {
					list.push(current);
					current = current.parent;
					if(current == null) {
						break;
					}
				}
			}
			var i = list.length;
			while(--i >= 0) {
				current = list[i];
				current.__update(true,false);
			}
		}
		return this.__worldTransform;
	}
	,__globalToLocal: function(global,local) {
		this.__getRenderTransform();
		if(global == local) {
			var _this = this.__renderTransform;
			var norm = _this.a * _this.d - _this.b * _this.c;
			if(norm == 0) {
				global.x = -_this.tx;
				global.y = -_this.ty;
			} else {
				var px = 1.0 / norm * (_this.c * (_this.ty - global.y) + _this.d * (global.x - _this.tx));
				global.y = 1.0 / norm * (_this.a * (global.y - _this.ty) + _this.b * (_this.tx - global.x));
				global.x = px;
			}
		} else {
			var _this = this.__renderTransform;
			var norm = _this.a * _this.d - _this.b * _this.c;
			local.x = norm == 0 ? -_this.tx : 1.0 / norm * (_this.c * (_this.ty - global.y) + _this.d * (global.x - _this.tx));
			var _this = this.__renderTransform;
			var norm = _this.a * _this.d - _this.b * _this.c;
			local.y = norm == 0 ? -_this.ty : 1.0 / norm * (_this.a * (global.y - _this.ty) + _this.b * (_this.tx - global.x));
		}
		return local;
	}
	,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) {
		if(this.__graphics != null) {
			if(!hitObject.__visible || this.__isMask) {
				return false;
			}
			if(this.get_mask() != null && !this.get_mask().__hitTestMask(x,y)) {
				return false;
			}
			if(this.__graphics.__hitTest(x,y,shapeFlag,this.__getRenderTransform())) {
				if(stack != null && !interactiveOnly) {
					stack.push(hitObject);
				}
				return true;
			}
		}
		return false;
	}
	,__hitTestMask: function(x,y) {
		if(this.__graphics != null) {
			if(this.__graphics.__hitTest(x,y,true,this.__getRenderTransform())) {
				return true;
			}
		}
		return false;
	}
	,__readGraphicsData: function(graphicsData,recurse) {
		if(this.__graphics != null) {
			this.__graphics.__readGraphicsData(graphicsData);
		}
	}
	,__renderCairo: function(renderer) {
	}
	,__renderCairoMask: function(renderer) {
	}
	,__renderCanvas: function(renderer) {
		if(this.get_mask() == null || this.get_mask().get_width() > 0 && this.get_mask().get_height() > 0) {
			this.__updateCacheBitmap(renderer,false);
			if(this.__cacheBitmap != null && !this.__isCacheBitmapRender) {
				var bitmap = this.__cacheBitmap;
				if(bitmap.__renderable) {
					var alpha = renderer.__getAlpha(bitmap.__worldAlpha);
					if(alpha > 0 && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) {
						var context = renderer.context;
						renderer.__setBlendMode(bitmap.__worldBlendMode);
						renderer.__pushMaskObject(bitmap,false);
						lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(bitmap.__bitmapData.image);
						context.globalAlpha = alpha;
						var scrollRect = bitmap.__scrollRect;
						renderer.setTransform(bitmap.__renderTransform,context);
						if(!renderer.__allowSmoothing || !bitmap.smoothing) {
							context.imageSmoothingEnabled = false;
						}
						if(scrollRect == null) {
							context.drawImage(bitmap.__bitmapData.image.get_src(),0,0,bitmap.__bitmapData.image.width,bitmap.__bitmapData.image.height);
						} else {
							context.drawImage(bitmap.__bitmapData.image.get_src(),scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height);
						}
						if(!renderer.__allowSmoothing || !bitmap.smoothing) {
							context.imageSmoothingEnabled = true;
						}
						renderer.__popMaskObject(bitmap,false);
					}
				}
			} else if(!(this.opaqueBackground == null && this.__graphics == null)) {
				if(this.__renderable) {
					var alpha = renderer.__getAlpha(this.__worldAlpha);
					if(!(alpha <= 0)) {
						if(this.opaqueBackground != null && !this.__isCacheBitmapRender && this.get_width() > 0 && this.get_height() > 0) {
							renderer.__setBlendMode(this.__worldBlendMode);
							renderer.__pushMaskObject(this);
							var context = renderer.context;
							renderer.setTransform(this.__renderTransform,context);
							var color = this.opaqueBackground;
							context.fillStyle = "rgb(" + (color >>> 16 & 255) + "," + (color >>> 8 & 255) + "," + (color & 255) + ")";
							context.fillRect(0,0,this.get_width(),this.get_height());
							renderer.__popMaskObject(this);
						}
						if(this.__graphics != null) {
							if(this.__renderable) {
								var alpha = renderer.__getAlpha(this.__worldAlpha);
								if(!(alpha <= 0)) {
									var graphics = this.__graphics;
									if(graphics != null) {
										openfl_display__$internal_CanvasGraphics.render(graphics,renderer);
										var width = graphics.__width;
										var height = graphics.__height;
										var canvas = graphics.__canvas;
										if(canvas != null && graphics.__visible && width >= 1 && height >= 1) {
											var transform = graphics.__worldTransform;
											var context = renderer.context;
											var scrollRect = this.__scrollRect;
											var scale9Grid = this.__worldScale9Grid;
											if(scrollRect == null || scrollRect.width > 0 && scrollRect.height > 0) {
												renderer.__setBlendMode(this.__worldBlendMode);
												renderer.__pushMaskObject(this);
												context.globalAlpha = alpha;
												if(scale9Grid != null && transform.b == 0 && transform.c == 0) {
													context.setTransform(1,0,0,1,transform.tx,transform.ty);
													var bounds = graphics.__bounds;
													var scaleX = graphics.__renderTransform.a;
													var scaleY = graphics.__renderTransform.d;
													var renderScaleX = transform.a;
													var renderScaleY = transform.d;
													var left = Math.max(1,Math.round(scale9Grid.x * scaleX));
													var top = Math.round(scale9Grid.y * scaleY);
													var right = Math.max(1,Math.round((bounds.get_right() - scale9Grid.get_right()) * scaleX));
													var bottom = Math.round((bounds.get_bottom() - scale9Grid.get_bottom()) * scaleY);
													var centerWidth = Math.round(scale9Grid.width * scaleX);
													var centerHeight = Math.round(scale9Grid.height * scaleY);
													var renderLeft = Math.round(scale9Grid.x * renderScaleX);
													var renderTop = Math.round(scale9Grid.y * renderScaleY);
													var renderRight = Math.round((bounds.get_right() - scale9Grid.get_right()) * renderScaleX);
													var renderBottom = Math.round((bounds.get_bottom() - scale9Grid.get_bottom()) * renderScaleY);
													var renderCenterWidth = Math.round(width * renderScaleX) - renderLeft - renderRight;
													var renderCenterHeight = Math.round(height * renderScaleY) - renderTop - renderBottom;
													renderer.applySmoothing(context,false);
													if(centerWidth != 0 && centerHeight != 0) {
														context.drawImage(canvas,0,0,left,top,0,0,renderLeft,renderTop);
														context.drawImage(canvas,left,0,centerWidth,top,renderLeft,0,renderCenterWidth,renderTop);
														context.drawImage(canvas,left + centerWidth,0,right,top,renderLeft + renderCenterWidth,0,renderRight,renderTop);
														context.drawImage(canvas,0,top,left,centerHeight,0,renderTop,renderLeft,renderCenterHeight);
														context.drawImage(canvas,left,top,centerWidth,centerHeight,renderLeft,renderTop,renderCenterWidth,renderCenterHeight);
														context.drawImage(canvas,left + centerWidth,top,right,centerHeight,renderLeft + renderCenterWidth,renderTop,renderRight,renderCenterHeight);
														context.drawImage(canvas,0,top + centerHeight,left,bottom,0,renderTop + renderCenterHeight,renderLeft,renderBottom);
														context.drawImage(canvas,left,top + centerHeight,centerWidth,bottom,renderLeft,renderTop + renderCenterHeight,renderCenterWidth,renderBottom);
														context.drawImage(canvas,left + centerWidth,top + centerHeight,right,bottom,renderLeft + renderCenterWidth,renderTop + renderCenterHeight,renderRight,renderBottom);
													} else if(centerWidth == 0 && centerHeight != 0) {
														var renderWidth = renderLeft + renderCenterWidth + renderRight;
														context.drawImage(canvas,0,0,width,top,0,0,renderWidth,renderTop);
														context.drawImage(canvas,0,top,width,centerHeight,0,renderTop,renderWidth,renderCenterHeight);
														context.drawImage(canvas,0,top + centerHeight,width,bottom,0,renderTop + renderCenterHeight,renderWidth,renderBottom);
													} else if(centerHeight == 0 && centerWidth != 0) {
														var renderHeight = renderTop + renderCenterHeight + renderBottom;
														context.drawImage(canvas,0,0,left,height,0,0,renderLeft,renderHeight);
														context.drawImage(canvas,left,0,centerWidth,height,renderLeft,0,renderCenterWidth,renderHeight);
														context.drawImage(canvas,left + centerWidth,0,right,height,renderLeft + renderCenterWidth,0,renderRight,renderHeight);
													}
												} else {
													renderer.setTransform(transform,context);
													if(renderer.__isDOM) {
														var reverseScale = 1 / renderer.pixelRatio;
														context.scale(reverseScale,reverseScale);
													}
													context.drawImage(canvas,0,0,width,height);
												}
												renderer.__popMaskObject(this);
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
		this.__renderEvent(renderer);
	}
	,__renderCanvasMask: function(renderer) {
		if(this.__graphics != null) {
			openfl_display__$internal_CanvasGraphics.renderMask(this.__graphics,renderer);
		}
	}
	,__renderDOM: function(renderer) {
		this.__updateCacheBitmap(renderer,false);
		if(this.__cacheBitmap != null && !this.__isCacheBitmapRender) {
			this.__renderDOMClear(renderer);
			this.__cacheBitmap.stage = this.stage;
			var bitmap = this.__cacheBitmap;
			if(bitmap.stage != null && bitmap.__worldVisible && bitmap.__renderable && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) {
				renderer.__pushMaskObject(bitmap);
				if(bitmap.__bitmapData.image.buffer.__srcImage != null) {
					openfl_display__$internal_DOMBitmap.renderImage(bitmap,renderer);
				} else {
					openfl_display__$internal_DOMBitmap.renderCanvas(bitmap,renderer);
				}
				renderer.__popMaskObject(bitmap);
			} else {
				openfl_display__$internal_DOMBitmap.clear(bitmap,renderer);
			}
		} else {
			var tmp = this.opaqueBackground != null && !this.__isCacheBitmapRender && this.get_width() > 0 && this.get_height() > 0;
			var graphics = this.__graphics;
			if(this.stage != null && this.__worldVisible && this.__renderable && graphics != null) {
				openfl_display__$internal_CanvasGraphics.render(graphics,renderer.__canvasRenderer);
				if(graphics.__softwareDirty || this.__worldAlphaChanged || this.__canvas != graphics.__canvas) {
					if(graphics.__canvas != null) {
						if(this.__canvas != graphics.__canvas) {
							if(this.__canvas != null) {
								renderer.element.removeChild(this.__canvas);
							}
							this.__canvas = graphics.__canvas;
							this.__context = graphics.__context;
							renderer.__initializeElement(this,this.__canvas);
						}
					} else {
						openfl_display__$internal_DOMShape.clear(this,renderer);
					}
				}
				if(this.__canvas != null) {
					renderer.__pushMaskObject(this);
					var cacheTransform = this.__renderTransform;
					this.__renderTransform = graphics.__worldTransform;
					if(graphics.__transformDirty) {
						graphics.__transformDirty = false;
						this.__renderTransformChanged = true;
					}
					renderer.__updateClip(this);
					renderer.__applyStyle(this,true,true,true);
					this.__renderTransform = cacheTransform;
					renderer.__popMaskObject(this);
				}
			} else {
				openfl_display__$internal_DOMShape.clear(this,renderer);
			}
		}
		this.__renderEvent(renderer);
	}
	,__renderDOMClear: function(renderer) {
		openfl_display__$internal_DOMDisplayObject.clear(this,renderer);
	}
	,__renderEvent: function(renderer) {
		if(this.__customRenderEvent != null && this.__renderable) {
			this.__customRenderEvent.allowSmoothing = renderer.__allowSmoothing;
			this.__customRenderEvent.objectMatrix.copyFrom(this.__renderTransform);
			this.__customRenderEvent.objectColorTransform.__copyFrom(this.__worldColorTransform);
			this.__customRenderEvent.renderer = renderer;
			switch(renderer.__type) {
			case "cairo":
				this.__customRenderEvent.type = "renderCairo";
				break;
			case "canvas":
				this.__customRenderEvent.type = "renderCanvas";
				break;
			case "dom":
				if(this.stage != null && this.__worldVisible) {
					this.__customRenderEvent.type = "renderDOM";
				} else {
					this.__customRenderEvent.type = "clearDOM";
				}
				break;
			case "opengl":
				if(!renderer.__cleared) {
					renderer.__clear();
				}
				var renderer1 = renderer;
				renderer1.setShader(this.__worldShader);
				renderer1.__context3D.__flushGL();
				this.__customRenderEvent.type = "renderOpenGL";
				break;
			default:
				return;
			}
			renderer.__setBlendMode(this.__worldBlendMode);
			renderer.__pushMaskObject(this);
			this.dispatchEvent(this.__customRenderEvent);
			renderer.__popMaskObject(this);
			if(renderer.__type == "opengl") {
				var renderer1 = renderer;
				renderer1.setViewport();
			}
		}
	}
	,__renderGL: function(renderer) {
		this.__updateCacheBitmap(renderer,false);
		if(this.__cacheBitmap != null && !this.__isCacheBitmapRender) {
			openfl_display__$internal_Context3DBitmap.render(this.__cacheBitmap,renderer);
		} else if(!(this.opaqueBackground == null && this.__graphics == null)) {
			if(!(!this.__renderable || this.__worldAlpha <= 0)) {
				if(this.opaqueBackground != null && !this.__isCacheBitmapRender && this.get_width() > 0 && this.get_height() > 0) {
					renderer.__setBlendMode(this.__worldBlendMode);
					renderer.__pushMaskObject(this);
					var context = renderer.__context3D;
					var rect = openfl_geom_Rectangle.__pool.get();
					rect.setTo(0,0,this.get_width(),this.get_height());
					renderer.__pushMaskRect(rect,this.__renderTransform);
					var color = this.opaqueBackground;
					context.clear((color >>> 16 & 255) / 255,(color >>> 8 & 255) / 255,(color & 255) / 255,1,0,0,1);
					renderer.__popMaskRect();
					renderer.__popMaskObject(this);
					openfl_geom_Rectangle.__pool.release(rect);
				}
				if(this.__graphics != null) {
					openfl_display__$internal_Context3DShape.render(this,renderer);
				}
			}
		}
		this.__renderEvent(renderer);
	}
	,__renderGLMask: function(renderer) {
		if(this.__graphics != null) {
			openfl_display__$internal_Context3DShape.renderMask(this,renderer);
		}
	}
	,__setParentRenderDirty: function() {
		var renderParent = this.__renderParent != null ? this.__renderParent : this.parent;
		if(renderParent != null && !renderParent.__renderDirty) {
			renderParent.__renderDirty = true;
			renderParent.__setParentRenderDirty();
		}
	}
	,__setRenderDirty: function() {
		if(!this.__renderDirty) {
			this.__renderDirty = true;
			this.__setParentRenderDirty();
		}
	}
	,__setStageReference: function(stage) {
		this.stage = stage;
	}
	,__setTransformDirty: function() {
		if(!this.__transformDirty) {
			this.__transformDirty = true;
			this.__setWorldTransformInvalid();
			this.__setParentRenderDirty();
		}
	}
	,__setWorldTransformInvalid: function() {
		this.__worldTransformInvalid = true;
	}
	,__shouldCacheHardware: function(value) {
		if(value == true || this.__filters != null) {
			return true;
		}
		if(value == false || this.__graphics != null && !openfl_display__$internal_Context3DGraphics.isCompatible(this.__graphics)) {
			return false;
		}
		return null;
	}
	,__stopAllMovieClips: function() {
	}
	,__update: function(transformOnly,updateChildren) {
		var renderParent = this.__renderParent != null ? this.__renderParent : this.parent;
		if(this.__isMask && renderParent == null) {
			renderParent = this.__maskTarget;
		}
		this.__renderable = this.__visible && this.__scaleX != 0 && this.__scaleY != 0 && !this.__isMask && (renderParent == null || !renderParent.__isMask);
		this.__updateTransforms();
		this.__transformDirty = false;
		this.__worldTransformInvalid = false;
		if(!transformOnly) {
			if(openfl_display_DisplayObject.__supportDOM) {
				this.__renderTransformChanged = !this.__renderTransform.equals(this.__renderTransformCache);
				if(this.__renderTransformCache == null) {
					this.__renderTransformCache = this.__renderTransform.clone();
				} else {
					this.__renderTransformCache.copyFrom(this.__renderTransform);
				}
			}
			if(renderParent != null) {
				if(openfl_display_DisplayObject.__supportDOM) {
					var worldVisible = renderParent.__worldVisible && this.__visible;
					this.__worldVisibleChanged = this.__worldVisible != worldVisible;
					this.__worldVisible = worldVisible;
					var worldAlpha = this.get_alpha() * renderParent.__worldAlpha;
					this.__worldAlphaChanged = this.__worldAlpha != worldAlpha;
					this.__worldAlpha = worldAlpha;
				} else {
					this.__worldAlpha = this.get_alpha() * renderParent.__worldAlpha;
				}
				if(this.__objectTransform != null) {
					this.__worldColorTransform.__copyFrom(this.__objectTransform.get_colorTransform());
					this.__worldColorTransform.__combine(renderParent.__worldColorTransform);
				} else {
					this.__worldColorTransform.__copyFrom(renderParent.__worldColorTransform);
				}
				if(this.__blendMode == null || this.__blendMode == 10) {
					this.__worldBlendMode = renderParent.__worldBlendMode;
				} else {
					this.__worldBlendMode = this.__blendMode;
				}
				if(this.__shader == null) {
					this.__worldShader = renderParent.__shader;
				} else {
					this.__worldShader = this.__shader;
				}
				if(this.__scale9Grid == null) {
					this.__worldScale9Grid = renderParent.__scale9Grid;
				} else {
					this.__worldScale9Grid = this.__scale9Grid;
				}
			} else {
				this.__worldAlpha = this.get_alpha();
				if(openfl_display_DisplayObject.__supportDOM) {
					this.__worldVisibleChanged = this.__worldVisible != this.__visible;
					this.__worldVisible = this.__visible;
					this.__worldAlphaChanged = this.__worldAlpha != this.get_alpha();
				}
				if(this.__objectTransform != null) {
					this.__worldColorTransform.__copyFrom(this.__objectTransform.get_colorTransform());
				} else {
					this.__worldColorTransform.__identity();
				}
				this.__worldBlendMode = this.__blendMode;
				this.__worldShader = this.__shader;
				this.__worldScale9Grid = this.__scale9Grid;
			}
		}
		if(updateChildren && this.get_mask() != null) {
			this.get_mask().__update(transformOnly,true);
		}
	}
	,__updateCacheBitmap: function(renderer,force) {
		if(this.__isCacheBitmapRender) {
			return false;
		}
		var colorTransform = openfl_geom_ColorTransform.__pool.get();
		colorTransform.__copyFrom(this.__worldColorTransform);
		if(renderer.__worldColorTransform != null) {
			colorTransform.__combine(renderer.__worldColorTransform);
		}
		var updated = false;
		if(this.get_cacheAsBitmap() || renderer.__type != "opengl" && !colorTransform.__isDefault(true)) {
			var rect = null;
			var needRender = this.__cacheBitmap == null || this.__renderDirty && (force || this.__children != null && this.__children.length > 0) || this.opaqueBackground != this.__cacheBitmapBackground;
			var softwareDirty = needRender || this.__graphics != null && this.__graphics.__softwareDirty || !this.__cacheBitmapColorTransform.__equals(colorTransform,true);
			var hardwareDirty = needRender || this.__graphics != null && this.__graphics.__hardwareDirty;
			var renderType = renderer.__type;
			if(softwareDirty || hardwareDirty) {
				if(renderType == "opengl") {
					if(this.__shouldCacheHardware(null) == false) {
						renderType = "canvas";
					}
				}
				if(softwareDirty && (renderType == "canvas" || renderType == "cairo")) {
					needRender = true;
				}
				if(hardwareDirty && renderType == "opengl") {
					needRender = true;
				}
			}
			var updateTransform = needRender || !this.__cacheBitmap.__worldTransform.equals(this.__worldTransform);
			var hasFilters = this.__filters != null;
			if(hasFilters && !needRender) {
				var _g = 0;
				var _g1 = this.__filters;
				while(_g < _g1.length) {
					var filter = _g1[_g];
					++_g;
					if(filter.__renderDirty) {
						needRender = true;
						break;
					}
				}
			}
			if(this.__cacheBitmapMatrix == null) {
				this.__cacheBitmapMatrix = new openfl_geom_Matrix();
			}
			var bitmapMatrix = this.__cacheAsBitmapMatrix != null ? this.__cacheAsBitmapMatrix : this.__renderTransform;
			if(!needRender && (bitmapMatrix.a != this.__cacheBitmapMatrix.a || bitmapMatrix.b != this.__cacheBitmapMatrix.b || bitmapMatrix.c != this.__cacheBitmapMatrix.c || bitmapMatrix.d != this.__cacheBitmapMatrix.d)) {
				needRender = true;
			}
			if(!needRender && renderer.__type != "opengl" && this.__cacheBitmapData != null && this.__cacheBitmapData.image != null && this.__cacheBitmapData.image.version < this.__cacheBitmapData.__textureVersion) {
				needRender = true;
			}
			this.__cacheBitmapMatrix.copyFrom(bitmapMatrix);
			this.__cacheBitmapMatrix.tx = 0;
			this.__cacheBitmapMatrix.ty = 0;
			var bitmapWidth = 0;
			var bitmapHeight = 0;
			var filterWidth = 0;
			var filterHeight = 0;
			var offsetX = 0.;
			var offsetY = 0.;
			if(updateTransform || needRender) {
				rect = openfl_geom_Rectangle.__pool.get();
				this.__getFilterBounds(rect,this.__cacheBitmapMatrix);
				filterWidth = Math.ceil(rect.width);
				filterHeight = Math.ceil(rect.height);
				offsetX = rect.x > 0 ? Math.ceil(rect.x) : Math.floor(rect.x);
				offsetY = rect.y > 0 ? Math.ceil(rect.y) : Math.floor(rect.y);
				if(this.__cacheBitmapData != null) {
					if(filterWidth > this.__cacheBitmapData.width || filterHeight > this.__cacheBitmapData.height) {
						bitmapWidth = Math.ceil(Math.max(filterWidth * 1.25,this.__cacheBitmapData.width));
						bitmapHeight = Math.ceil(Math.max(filterHeight * 1.25,this.__cacheBitmapData.height));
						needRender = true;
					} else {
						bitmapWidth = this.__cacheBitmapData.width;
						bitmapHeight = this.__cacheBitmapData.height;
					}
				} else {
					bitmapWidth = filterWidth;
					bitmapHeight = filterHeight;
				}
			}
			if(needRender) {
				updateTransform = true;
				this.__cacheBitmapBackground = this.opaqueBackground;
				if(filterWidth >= 0.5 && filterHeight >= 0.5) {
					var needsFill = this.opaqueBackground != null && (bitmapWidth != filterWidth || bitmapHeight != filterHeight);
					var fillColor = this.opaqueBackground != null ? -16777216 | this.opaqueBackground : 0;
					var bitmapColor = needsFill ? 0 : fillColor;
					var allowFramebuffer = renderer.__type == "opengl";
					if(this.__cacheBitmapData == null || bitmapWidth > this.__cacheBitmapData.width || bitmapHeight > this.__cacheBitmapData.height) {
						this.__cacheBitmapData = new openfl_display_BitmapData(bitmapWidth,bitmapHeight,true,bitmapColor);
						if(this.__cacheBitmap == null) {
							this.__cacheBitmap = new openfl_display_Bitmap();
						}
						this.__cacheBitmap.__bitmapData = this.__cacheBitmapData;
						this.__cacheBitmapRenderer = null;
					} else {
						this.__cacheBitmapData.__fillRect(this.__cacheBitmapData.rect,bitmapColor,allowFramebuffer);
					}
					if(needsFill) {
						rect.setTo(0,0,filterWidth,filterHeight);
						this.__cacheBitmapData.__fillRect(rect,fillColor,allowFramebuffer);
					}
				} else {
					openfl_geom_ColorTransform.__pool.release(colorTransform);
					this.__cacheBitmap = null;
					this.__cacheBitmapData = null;
					this.__cacheBitmapData2 = null;
					this.__cacheBitmapData3 = null;
					this.__cacheBitmapRenderer = null;
					return true;
				}
			} else {
				this.__cacheBitmapData = this.__cacheBitmap.get_bitmapData();
				this.__cacheBitmapData2 = null;
				this.__cacheBitmapData3 = null;
			}
			if(updateTransform || needRender) {
				this.__cacheBitmap.__worldTransform.copyFrom(this.__worldTransform);
				if(bitmapMatrix == this.__renderTransform) {
					this.__cacheBitmap.__renderTransform.identity();
					this.__cacheBitmap.__renderTransform.tx = this.__renderTransform.tx + offsetX;
					this.__cacheBitmap.__renderTransform.ty = this.__renderTransform.ty + offsetY;
				} else {
					this.__cacheBitmap.__renderTransform.copyFrom(this.__cacheBitmapMatrix);
					this.__cacheBitmap.__renderTransform.invert();
					this.__cacheBitmap.__renderTransform.concat(this.__renderTransform);
					this.__cacheBitmap.__renderTransform.tx += offsetX;
					this.__cacheBitmap.__renderTransform.ty += offsetY;
				}
			}
			this.__cacheBitmap.smoothing = renderer.__allowSmoothing;
			this.__cacheBitmap.__renderable = this.__renderable;
			this.__cacheBitmap.__worldAlpha = this.__worldAlpha;
			this.__cacheBitmap.__worldBlendMode = this.__worldBlendMode;
			this.__cacheBitmap.__worldShader = this.__worldShader;
			this.__cacheBitmap.set_mask(this.__mask);
			if(needRender) {
				if(this.__cacheBitmapRenderer == null || renderType != this.__cacheBitmapRenderer.__type) {
					if(renderType == "opengl") {
						this.__cacheBitmapRenderer = new openfl_display_OpenGLRenderer((js_Boot.__cast(renderer , openfl_display_OpenGLRenderer)).__context3D,this.__cacheBitmapData);
					} else {
						if(this.__cacheBitmapData.image == null) {
							var color = this.opaqueBackground != null ? -16777216 | this.opaqueBackground : 0;
							this.__cacheBitmapData = new openfl_display_BitmapData(bitmapWidth,bitmapHeight,true,color);
							this.__cacheBitmap.__bitmapData = this.__cacheBitmapData;
						}
						lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(this.__cacheBitmapData.image);
						this.__cacheBitmapRenderer = new openfl_display_CanvasRenderer(this.__cacheBitmapData.image.buffer.__srcContext);
					}
					this.__cacheBitmapRenderer.__worldTransform = new openfl_geom_Matrix();
					this.__cacheBitmapRenderer.__worldColorTransform = new openfl_geom_ColorTransform();
				}
				if(this.__cacheBitmapColorTransform == null) {
					this.__cacheBitmapColorTransform = new openfl_geom_ColorTransform();
				}
				this.__cacheBitmapRenderer.__stage = this.stage;
				this.__cacheBitmapRenderer.__allowSmoothing = renderer.__allowSmoothing;
				this.__cacheBitmapRenderer.__setBlendMode(10);
				this.__cacheBitmapRenderer.__worldAlpha = 1 / this.__worldAlpha;
				this.__cacheBitmapRenderer.__worldTransform.copyFrom(this.__renderTransform);
				this.__cacheBitmapRenderer.__worldTransform.invert();
				this.__cacheBitmapRenderer.__worldTransform.concat(this.__cacheBitmapMatrix);
				this.__cacheBitmapRenderer.__worldTransform.tx -= offsetX;
				this.__cacheBitmapRenderer.__worldTransform.ty -= offsetY;
				this.__cacheBitmapRenderer.__worldColorTransform.__copyFrom(colorTransform);
				this.__cacheBitmapRenderer.__worldColorTransform.__invert();
				this.__isCacheBitmapRender = true;
				if(this.__cacheBitmapRenderer.__type == "opengl") {
					var parentRenderer = renderer;
					var childRenderer = this.__cacheBitmapRenderer;
					var context = childRenderer.__context3D;
					var cacheRTT = context.__state.renderToTexture;
					var cacheRTTDepthStencil = context.__state.renderToTextureDepthStencil;
					var cacheRTTAntiAlias = context.__state.renderToTextureAntiAlias;
					var cacheRTTSurfaceSelector = context.__state.renderToTextureSurfaceSelector;
					var cacheBlendMode = parentRenderer.__blendMode;
					parentRenderer.__suspendClipAndMask();
					childRenderer.__copyShader(parentRenderer);
					this.__cacheBitmapData.__setUVRect(context,0,0,filterWidth,filterHeight);
					childRenderer.__setRenderTarget(this.__cacheBitmapData);
					if(this.__cacheBitmapData.image != null) {
						this.__cacheBitmapData.__textureVersion = this.__cacheBitmapData.image.version + 1;
					}
					this.__cacheBitmapData.__drawGL(this,childRenderer);
					if(hasFilters) {
						var needSecondBitmapData = true;
						var needCopyOfOriginal = false;
						var _g = 0;
						var _g1 = this.__filters;
						while(_g < _g1.length) {
							var filter = _g1[_g];
							++_g;
							if(filter.__preserveObject) {
								needCopyOfOriginal = true;
							}
						}
						var bitmap = this.__cacheBitmapData;
						var bitmap2 = null;
						var bitmap3 = null;
						if(this.__cacheBitmapData2 == null || bitmapWidth > this.__cacheBitmapData2.width || bitmapHeight > this.__cacheBitmapData2.height) {
							this.__cacheBitmapData2 = new openfl_display_BitmapData(bitmapWidth,bitmapHeight,true,0);
						} else {
							this.__cacheBitmapData2.fillRect(this.__cacheBitmapData2.rect,0);
							if(this.__cacheBitmapData2.image != null) {
								this.__cacheBitmapData2.__textureVersion = this.__cacheBitmapData2.image.version + 1;
							}
						}
						this.__cacheBitmapData2.__setUVRect(context,0,0,filterWidth,filterHeight);
						bitmap2 = this.__cacheBitmapData2;
						if(needCopyOfOriginal) {
							if(this.__cacheBitmapData3 == null || bitmapWidth > this.__cacheBitmapData3.width || bitmapHeight > this.__cacheBitmapData3.height) {
								this.__cacheBitmapData3 = new openfl_display_BitmapData(bitmapWidth,bitmapHeight,true,0);
							} else {
								this.__cacheBitmapData3.fillRect(this.__cacheBitmapData3.rect,0);
								if(this.__cacheBitmapData3.image != null) {
									this.__cacheBitmapData3.__textureVersion = this.__cacheBitmapData3.image.version + 1;
								}
							}
							this.__cacheBitmapData3.__setUVRect(context,0,0,filterWidth,filterHeight);
							bitmap3 = this.__cacheBitmapData3;
						}
						childRenderer.__setBlendMode(10);
						childRenderer.__worldAlpha = 1;
						childRenderer.__worldTransform.identity();
						childRenderer.__worldColorTransform.__identity();
						var shader;
						var cacheBitmap;
						var _g = 0;
						var _g1 = this.__filters;
						while(_g < _g1.length) {
							var filter = _g1[_g];
							++_g;
							if(filter.__preserveObject) {
								childRenderer.__setRenderTarget(bitmap3);
								childRenderer.__renderFilterPass(bitmap,childRenderer.__defaultDisplayShader,filter.__smooth);
							}
							var _g2 = 0;
							var _g3 = filter.__numShaderPasses;
							while(_g2 < _g3) {
								var i = _g2++;
								shader = filter.__initShader(childRenderer,i,filter.__preserveObject ? bitmap3 : null);
								childRenderer.__setBlendMode(filter.__shaderBlendMode);
								childRenderer.__setRenderTarget(bitmap2);
								childRenderer.__renderFilterPass(bitmap,shader,filter.__smooth);
								cacheBitmap = bitmap;
								bitmap = bitmap2;
								bitmap2 = cacheBitmap;
							}
							filter.__renderDirty = false;
						}
						this.__cacheBitmap.__bitmapData = bitmap;
					}
					parentRenderer.__blendMode = 10;
					parentRenderer.__setBlendMode(cacheBlendMode);
					parentRenderer.__copyShader(childRenderer);
					if(cacheRTT != null) {
						context.setRenderToTexture(cacheRTT,cacheRTTDepthStencil,cacheRTTAntiAlias,cacheRTTSurfaceSelector);
					} else {
						context.setRenderToBackBuffer();
					}
					parentRenderer.__resumeClipAndMask(childRenderer);
					parentRenderer.setViewport();
					this.__cacheBitmapColorTransform.__copyFrom(colorTransform);
				} else {
					this.__cacheBitmapData.__drawCanvas(this,this.__cacheBitmapRenderer);
					if(hasFilters) {
						var needSecondBitmapData = false;
						var needCopyOfOriginal = false;
						var _g = 0;
						var _g1 = this.__filters;
						while(_g < _g1.length) {
							var filter = _g1[_g];
							++_g;
							if(filter.__needSecondBitmapData) {
								needSecondBitmapData = true;
							}
							if(filter.__preserveObject) {
								needCopyOfOriginal = true;
							}
						}
						var bitmap = this.__cacheBitmapData;
						var bitmap2 = null;
						var bitmap3 = null;
						if(needSecondBitmapData) {
							if(this.__cacheBitmapData2 == null || this.__cacheBitmapData2.image == null || bitmapWidth > this.__cacheBitmapData2.width || bitmapHeight > this.__cacheBitmapData2.height) {
								this.__cacheBitmapData2 = new openfl_display_BitmapData(bitmapWidth,bitmapHeight,true,0);
							} else {
								this.__cacheBitmapData2.fillRect(this.__cacheBitmapData2.rect,0);
							}
							bitmap2 = this.__cacheBitmapData2;
						} else {
							bitmap2 = bitmap;
						}
						if(needCopyOfOriginal) {
							if(this.__cacheBitmapData3 == null || this.__cacheBitmapData3.image == null || bitmapWidth > this.__cacheBitmapData3.width || bitmapHeight > this.__cacheBitmapData3.height) {
								this.__cacheBitmapData3 = new openfl_display_BitmapData(bitmapWidth,bitmapHeight,true,0);
							} else {
								this.__cacheBitmapData3.fillRect(this.__cacheBitmapData3.rect,0);
							}
							bitmap3 = this.__cacheBitmapData3;
						}
						if(this.__tempPoint == null) {
							this.__tempPoint = new openfl_geom_Point();
						}
						var destPoint = this.__tempPoint;
						var cacheBitmap;
						var lastBitmap;
						var _g = 0;
						var _g1 = this.__filters;
						while(_g < _g1.length) {
							var filter = _g1[_g];
							++_g;
							if(filter.__preserveObject) {
								bitmap3.copyPixels(bitmap,bitmap.rect,destPoint);
							}
							lastBitmap = filter.__applyFilter(bitmap2,bitmap,bitmap.rect,destPoint);
							if(filter.__preserveObject) {
								lastBitmap.draw(bitmap3,null,this.__objectTransform != null ? this.__objectTransform.get_colorTransform() : null);
							}
							filter.__renderDirty = false;
							if(needSecondBitmapData && lastBitmap == bitmap2) {
								cacheBitmap = bitmap;
								bitmap = bitmap2;
								bitmap2 = cacheBitmap;
							}
						}
						if(this.__cacheBitmapData != bitmap) {
							cacheBitmap = this.__cacheBitmapData;
							this.__cacheBitmapData = bitmap;
							this.__cacheBitmapData2 = cacheBitmap;
							this.__cacheBitmap.__bitmapData = this.__cacheBitmapData;
							this.__cacheBitmapRenderer = null;
						}
						this.__cacheBitmap.__imageVersion = this.__cacheBitmapData.__textureVersion;
					}
					this.__cacheBitmapColorTransform.__copyFrom(colorTransform);
					if(!this.__cacheBitmapColorTransform.__isDefault(true)) {
						this.__cacheBitmapColorTransform.alphaMultiplier = 1;
						this.__cacheBitmapData.colorTransform(this.__cacheBitmapData.rect,this.__cacheBitmapColorTransform);
					}
				}
				this.__isCacheBitmapRender = false;
			}
			if(updateTransform || needRender) {
				openfl_geom_Rectangle.__pool.release(rect);
			}
			updated = updateTransform;
		} else if(this.__cacheBitmap != null) {
			if(renderer.__type == "dom") {
				this.__cacheBitmap.__renderDOMClear(renderer);
			}
			this.__cacheBitmap = null;
			this.__cacheBitmapData = null;
			this.__cacheBitmapData2 = null;
			this.__cacheBitmapData3 = null;
			this.__cacheBitmapColorTransform = null;
			this.__cacheBitmapRenderer = null;
			updated = true;
		}
		openfl_geom_ColorTransform.__pool.release(colorTransform);
		return updated;
	}
	,__updateTransforms: function(overrideTransform) {
		var overrided = overrideTransform != null;
		var local = overrided ? overrideTransform : this.__transform;
		if(this.__worldTransform == null) {
			this.__worldTransform = new openfl_geom_Matrix();
		}
		if(this.__renderTransform == null) {
			this.__renderTransform = new openfl_geom_Matrix();
		}
		var renderParent = this.__renderParent != null ? this.__renderParent : this.parent;
		if(!overrided && this.parent != null) {
			var parentTransform = this.parent.__worldTransform;
			var target = this.__worldTransform;
			target.a = local.a * parentTransform.a + local.b * parentTransform.c;
			target.b = local.a * parentTransform.b + local.b * parentTransform.d;
			target.c = local.c * parentTransform.a + local.d * parentTransform.c;
			target.d = local.c * parentTransform.b + local.d * parentTransform.d;
			target.tx = local.tx * parentTransform.a + local.ty * parentTransform.c + parentTransform.tx;
			target.ty = local.tx * parentTransform.b + local.ty * parentTransform.d + parentTransform.ty;
		} else {
			this.__worldTransform.copyFrom(local);
		}
		if(!overrided && renderParent != null) {
			var parentTransform = renderParent.__renderTransform;
			var target = this.__renderTransform;
			target.a = local.a * parentTransform.a + local.b * parentTransform.c;
			target.b = local.a * parentTransform.b + local.b * parentTransform.d;
			target.c = local.c * parentTransform.a + local.d * parentTransform.c;
			target.d = local.c * parentTransform.b + local.d * parentTransform.d;
			target.tx = local.tx * parentTransform.a + local.ty * parentTransform.c + parentTransform.tx;
			target.ty = local.tx * parentTransform.b + local.ty * parentTransform.d + parentTransform.ty;
		} else {
			this.__renderTransform.copyFrom(local);
		}
		if(this.__scrollRect != null) {
			var _this = this.__renderTransform;
			var px = -this.__scrollRect.x;
			var py = -this.__scrollRect.y;
			_this.tx = px * _this.a + py * _this.c + _this.tx;
			_this.ty = px * _this.b + py * _this.d + _this.ty;
		}
	}
	,get_alpha: function() {
		return this.__alpha;
	}
	,set_alpha: function(value) {
		if(value > 1.0) {
			value = 1.0;
		}
		if(value < 0.0) {
			value = 0.0;
		}
		if(value != this.__alpha && !this.get_cacheAsBitmap()) {
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__alpha = value;
	}
	,get_blendMode: function() {
		return this.__blendMode;
	}
	,set_blendMode: function(value) {
		if(value == null) {
			value = 10;
		}
		if(value != this.__blendMode) {
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__blendMode = value;
	}
	,get_cacheAsBitmap: function() {
		if(this.__filters == null) {
			return this.__cacheAsBitmap;
		} else {
			return true;
		}
	}
	,set_cacheAsBitmap: function(value) {
		if(value != this.__cacheAsBitmap) {
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__cacheAsBitmap = value;
	}
	,get_cacheAsBitmapMatrix: function() {
		return this.__cacheAsBitmapMatrix;
	}
	,set_cacheAsBitmapMatrix: function(value) {
		if(!this.__renderDirty) {
			this.__renderDirty = true;
			this.__setParentRenderDirty();
		}
		return this.__cacheAsBitmapMatrix = value != null ? value.clone() : value;
	}
	,get_filters: function() {
		if(this.__filters == null) {
			return [];
		} else {
			return this.__filters.slice();
		}
	}
	,set_filters: function(value) {
		if(value != null && value.length > 0) {
			this.__filters = value;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		} else if(this.__filters != null) {
			this.__filters = null;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return value;
	}
	,get_height: function() {
		var rect = openfl_geom_Rectangle.__pool.get();
		this.__getLocalBounds(rect);
		var height = rect.height;
		openfl_geom_Rectangle.__pool.release(rect);
		return height;
	}
	,set_height: function(value) {
		var rect = openfl_geom_Rectangle.__pool.get();
		var matrix = openfl_geom_Matrix.__pool.get();
		matrix.identity();
		this.__getBounds(rect,matrix);
		if(value != rect.height) {
			this.set_scaleY(value / rect.height);
		} else {
			this.set_scaleY(1);
		}
		openfl_geom_Rectangle.__pool.release(rect);
		openfl_geom_Matrix.__pool.release(matrix);
		return value;
	}
	,get_loaderInfo: function() {
		if(this.stage != null) {
			return openfl__$internal_Lib.current.__loaderInfo;
		}
		return null;
	}
	,get_mask: function() {
		return this.__mask;
	}
	,set_mask: function(value) {
		if(value == this.__mask) {
			return value;
		}
		if(value != this.__mask) {
			this.__setTransformDirty();
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		if(this.__mask != null) {
			this.__mask.__isMask = false;
			this.__mask.__maskTarget = null;
			this.__mask.__setTransformDirty();
			var _this = this.__mask;
			if(!_this.__renderDirty) {
				_this.__renderDirty = true;
				_this.__setParentRenderDirty();
			}
		}
		if(value != null) {
			value.__isMask = true;
			value.__maskTarget = this;
			value.__setWorldTransformInvalid();
		}
		if(this.__cacheBitmap != null && this.__cacheBitmap.get_mask() != value) {
			this.__cacheBitmap.set_mask(value);
		}
		return this.__mask = value;
	}
	,get_mouseX: function() {
		var mouseX = this.stage != null ? this.stage.__mouseX : openfl__$internal_Lib.current.stage.__mouseX;
		var mouseY = this.stage != null ? this.stage.__mouseY : openfl__$internal_Lib.current.stage.__mouseY;
		var _this = this.__getRenderTransform();
		var norm = _this.a * _this.d - _this.b * _this.c;
		if(norm == 0) {
			return -_this.tx;
		} else {
			return 1.0 / norm * (_this.c * (_this.ty - mouseY) + _this.d * (mouseX - _this.tx));
		}
	}
	,get_mouseY: function() {
		var mouseX = this.stage != null ? this.stage.__mouseX : openfl__$internal_Lib.current.stage.__mouseX;
		var mouseY = this.stage != null ? this.stage.__mouseY : openfl__$internal_Lib.current.stage.__mouseY;
		var _this = this.__getRenderTransform();
		var norm = _this.a * _this.d - _this.b * _this.c;
		if(norm == 0) {
			return -_this.ty;
		} else {
			return 1.0 / norm * (_this.a * (mouseY - _this.ty) + _this.b * (_this.tx - mouseX));
		}
	}
	,get_name: function() {
		return this.__name;
	}
	,set_name: function(value) {
		return this.__name = value;
	}
	,get_root: function() {
		if(this.stage != null) {
			return openfl__$internal_Lib.current;
		}
		return null;
	}
	,get_rotation: function() {
		return this.__rotation;
	}
	,set_rotation: function(value) {
		if(value != this.__rotation) {
			this.__rotation = value;
			var radians = this.__rotation * (Math.PI / 180);
			this.__rotationSine = Math.sin(radians);
			this.__rotationCosine = Math.cos(radians);
			this.__transform.a = this.__rotationCosine * this.__scaleX;
			this.__transform.b = this.__rotationSine * this.__scaleX;
			this.__transform.c = -this.__rotationSine * this.__scaleY;
			this.__transform.d = this.__rotationCosine * this.__scaleY;
			this.__setTransformDirty();
		}
		return value;
	}
	,get_scale9Grid: function() {
		if(this.__scale9Grid == null) {
			return null;
		}
		return this.__scale9Grid.clone();
	}
	,set_scale9Grid: function(value) {
		if(value == null && this.__scale9Grid == null) {
			return value;
		}
		if(value != null && this.__scale9Grid != null && this.__scale9Grid.equals(value)) {
			return value;
		}
		if(value != null) {
			if(this.__scale9Grid == null) {
				this.__scale9Grid = new openfl_geom_Rectangle();
			}
			this.__scale9Grid.copyFrom(value);
		} else {
			this.__scale9Grid = null;
		}
		if(!this.__renderDirty) {
			this.__renderDirty = true;
			this.__setParentRenderDirty();
		}
		return value;
	}
	,get_scaleX: function() {
		return this.__scaleX;
	}
	,set_scaleX: function(value) {
		if(value != this.__scaleX) {
			this.__scaleX = value;
			if(this.__transform.b == 0) {
				if(value != this.__transform.a) {
					this.__setTransformDirty();
				}
				this.__transform.a = value;
			} else {
				var a = this.__rotationCosine * value;
				var b = this.__rotationSine * value;
				if(this.__transform.a != a || this.__transform.b != b) {
					this.__setTransformDirty();
				}
				this.__transform.a = a;
				this.__transform.b = b;
			}
		}
		return value;
	}
	,get_scaleY: function() {
		return this.__scaleY;
	}
	,set_scaleY: function(value) {
		if(value != this.__scaleY) {
			this.__scaleY = value;
			if(this.__transform.c == 0) {
				if(value != this.__transform.d) {
					this.__setTransformDirty();
				}
				this.__transform.d = value;
			} else {
				var c = -this.__rotationSine * value;
				var d = this.__rotationCosine * value;
				if(this.__transform.d != d || this.__transform.c != c) {
					this.__setTransformDirty();
				}
				this.__transform.c = c;
				this.__transform.d = d;
			}
		}
		return value;
	}
	,get_scrollRect: function() {
		if(this.__scrollRect == null) {
			return null;
		}
		return this.__scrollRect.clone();
	}
	,set_scrollRect: function(value) {
		if(value == null && this.__scrollRect == null) {
			return value;
		}
		if(value != null && this.__scrollRect != null && this.__scrollRect.equals(value)) {
			return value;
		}
		if(value != null) {
			if(this.__scrollRect == null) {
				this.__scrollRect = new openfl_geom_Rectangle();
			}
			this.__scrollRect.copyFrom(value);
		} else {
			this.__scrollRect = null;
		}
		this.__setTransformDirty();
		if(openfl_display_DisplayObject.__supportDOM) {
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return value;
	}
	,get_shader: function() {
		return this.__shader;
	}
	,set_shader: function(value) {
		this.__shader = value;
		if(!this.__renderDirty) {
			this.__renderDirty = true;
			this.__setParentRenderDirty();
		}
		return value;
	}
	,get_transform: function() {
		if(this.__objectTransform == null) {
			this.__objectTransform = new openfl_geom_Transform(this);
		}
		return this.__objectTransform;
	}
	,set_transform: function(value) {
		if(value == null) {
			throw haxe_Exception.thrown(new openfl_errors_TypeError("Parameter transform must be non-null."));
		}
		if(this.__objectTransform == null) {
			this.__objectTransform = new openfl_geom_Transform(this);
		}
		this.__setTransformDirty();
		this.__objectTransform.set_matrix(value.get_matrix());
		if(!this.__objectTransform.get_colorTransform().__equals(value.get_colorTransform(),true) || !this.get_cacheAsBitmap() && this.__objectTransform.get_colorTransform().alphaMultiplier != value.get_colorTransform().alphaMultiplier) {
			this.__objectTransform.get_colorTransform().__copyFrom(value.get_colorTransform());
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__objectTransform;
	}
	,get_visible: function() {
		return this.__visible;
	}
	,set_visible: function(value) {
		if(value != this.__visible) {
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__visible = value;
	}
	,get_width: function() {
		var rect = openfl_geom_Rectangle.__pool.get();
		this.__getLocalBounds(rect);
		var width = rect.width;
		openfl_geom_Rectangle.__pool.release(rect);
		return width;
	}
	,set_width: function(value) {
		var rect = openfl_geom_Rectangle.__pool.get();
		var matrix = openfl_geom_Matrix.__pool.get();
		matrix.identity();
		this.__getBounds(rect,matrix);
		if(value != rect.width) {
			this.set_scaleX(value / rect.width);
		} else {
			this.set_scaleX(1);
		}
		openfl_geom_Rectangle.__pool.release(rect);
		openfl_geom_Matrix.__pool.release(matrix);
		return value;
	}
	,get_x: function() {
		return this.__transform.tx;
	}
	,set_x: function(value) {
		if(value != this.__transform.tx) {
			this.__setTransformDirty();
		}
		return this.__transform.tx = value;
	}
	,get_y: function() {
		return this.__transform.ty;
	}
	,set_y: function(value) {
		if(value != this.__transform.ty) {
			this.__setTransformDirty();
		}
		return this.__transform.ty = value;
	}
	,__class__: openfl_display_DisplayObject
	,__properties__: {set_y:"set_y",get_y:"get_y",set_x:"set_x",get_x:"get_x",set_width:"set_width",get_width:"get_width",set_visible:"set_visible",get_visible:"get_visible",set_transform:"set_transform",get_transform:"get_transform",set_shader:"set_shader",get_shader:"get_shader",set_scrollRect:"set_scrollRect",get_scrollRect:"get_scrollRect",set_scaleY:"set_scaleY",get_scaleY:"get_scaleY",set_scaleX:"set_scaleX",get_scaleX:"get_scaleX",set_scale9Grid:"set_scale9Grid",get_scale9Grid:"get_scale9Grid",set_rotation:"set_rotation",get_rotation:"get_rotation",get_root:"get_root",set_name:"set_name",get_name:"get_name",get_mouseY:"get_mouseY",get_mouseX:"get_mouseX",set_mask:"set_mask",get_mask:"get_mask",get_loaderInfo:"get_loaderInfo",set_height:"set_height",get_height:"get_height",set_filters:"set_filters",get_filters:"get_filters",set_cacheAsBitmapMatrix:"set_cacheAsBitmapMatrix",get_cacheAsBitmapMatrix:"get_cacheAsBitmapMatrix",set_cacheAsBitmap:"set_cacheAsBitmap",get_cacheAsBitmap:"get_cacheAsBitmap",set_blendMode:"set_blendMode",get_blendMode:"get_blendMode",set_alpha:"set_alpha",get_alpha:"get_alpha"}
});
var openfl_display_InteractiveObject = function() {
	openfl_display_DisplayObject.call(this);
	this.doubleClickEnabled = false;
	this.mouseEnabled = true;
	this.needsSoftKeyboard = false;
	this.__tabEnabled = null;
	this.__tabIndex = -1;
};
$hxClasses["openfl.display.InteractiveObject"] = openfl_display_InteractiveObject;
openfl_display_InteractiveObject.__name__ = "openfl.display.InteractiveObject";
openfl_display_InteractiveObject.__super__ = openfl_display_DisplayObject;
openfl_display_InteractiveObject.prototype = $extend(openfl_display_DisplayObject.prototype,{
	doubleClickEnabled: null
	,focusRect: null
	,mouseEnabled: null
	,needsSoftKeyboard: null
	,softKeyboardInputAreaOfInterest: null
	,__tabEnabled: null
	,__tabIndex: null
	,requestSoftKeyboard: function() {
		openfl__$internal_Lib.notImplemented({ fileName : "openfl/display/InteractiveObject.hx", lineNumber : 57, className : "openfl.display.InteractiveObject", methodName : "requestSoftKeyboard"});
		return false;
	}
	,__allowMouseFocus: function() {
		return this.get_tabEnabled();
	}
	,__getInteractive: function(stack) {
		if(stack != null) {
			stack.push(this);
			if(this.parent != null) {
				this.parent.__getInteractive(stack);
			}
		}
		return true;
	}
	,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) {
		if(!hitObject.get_visible() || this.__isMask || interactiveOnly && !this.mouseEnabled) {
			return false;
		}
		return openfl_display_DisplayObject.prototype.__hitTest.call(this,x,y,shapeFlag,stack,interactiveOnly,hitObject);
	}
	,__tabTest: function(stack) {
		if(this.get_tabEnabled()) {
			stack.push(this);
		}
	}
	,get_tabEnabled: function() {
		if(this.__tabEnabled == true) {
			return true;
		} else {
			return false;
		}
	}
	,set_tabEnabled: function(value) {
		if(this.__tabEnabled != value) {
			this.__tabEnabled = value;
			this.dispatchEvent(new openfl_events_Event("tabEnabledChange",true,false));
		}
		return this.__tabEnabled;
	}
	,get_tabIndex: function() {
		return this.__tabIndex;
	}
	,set_tabIndex: function(value) {
		if(this.__tabIndex != value) {
			if(value < -1) {
				throw haxe_Exception.thrown(new openfl_errors_RangeError("Parameter tabIndex must be a non-negative number; got " + value));
			}
			this.__tabIndex = value;
			this.dispatchEvent(new openfl_events_Event("tabIndexChange",true,false));
		}
		return this.__tabIndex;
	}
	,__class__: openfl_display_InteractiveObject
	,__properties__: $extend(openfl_display_DisplayObject.prototype.__properties__,{set_tabIndex:"set_tabIndex",get_tabIndex:"get_tabIndex",set_tabEnabled:"set_tabEnabled",get_tabEnabled:"get_tabEnabled"})
});
var openfl_display_DisplayObjectContainer = function() {
	openfl_display_InteractiveObject.call(this);
	this.mouseChildren = true;
	this.__tabChildren = true;
	this.__children = [];
	this.__removedChildren = openfl_Vector.toObjectVector(null);
};
$hxClasses["openfl.display.DisplayObjectContainer"] = openfl_display_DisplayObjectContainer;
openfl_display_DisplayObjectContainer.__name__ = "openfl.display.DisplayObjectContainer";
openfl_display_DisplayObjectContainer.__super__ = openfl_display_InteractiveObject;
openfl_display_DisplayObjectContainer.prototype = $extend(openfl_display_InteractiveObject.prototype,{
	mouseChildren: null
	,__removedChildren: null
	,__tabChildren: null
	,addChild: function(child) {
		return this.addChildAt(child,this.get_numChildren());
	}
	,addChildAt: function(child,index) {
		if(child == null) {
			var error = new openfl_errors_TypeError("Error #2007: Parameter child must be non-null.");
			error.errorID = 2007;
			throw haxe_Exception.thrown(error);
		} else if(child.stage == child) {
			var error = new openfl_errors_ArgumentError("Error #3783: A Stage object cannot be added as the child of another object.");
			error.errorID = 3783;
			throw haxe_Exception.thrown(error);
		}
		if(index > this.__children.length || index < 0) {
			throw haxe_Exception.thrown("Invalid index position " + index);
		}
		if(child.parent == this) {
			if(this.__children[index] != child) {
				HxOverrides.remove(this.__children,child);
				this.__children.splice(index,0,child);
				if(!this.__renderDirty) {
					this.__renderDirty = true;
					this.__setParentRenderDirty();
				}
			}
		} else {
			if(child.parent != null) {
				child.parent.removeChild(child);
			}
			this.__children.splice(index,0,child);
			child.parent = this;
			var addedToStage = this.stage != null && child.stage == null;
			if(addedToStage) {
				child.__setStageReference(this.stage);
			}
			child.__setTransformDirty();
			if(!child.__renderDirty) {
				child.__renderDirty = true;
				child.__setParentRenderDirty();
			}
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
			var event = new openfl_events_Event("added");
			event.bubbles = true;
			event.target = child;
			child.__dispatchWithCapture(event);
			if(addedToStage) {
				event = new openfl_events_Event("addedToStage",false,false);
				child.__dispatchWithCapture(event);
				child.__dispatchChildren(event);
			}
		}
		return child;
	}
	,areInaccessibleObjectsUnderPoint: function(point) {
		return false;
	}
	,contains: function(child) {
		while(child != this && child != null) child = child.parent;
		return child == this;
	}
	,getChildAt: function(index) {
		if(index >= 0 && index < this.__children.length) {
			return this.__children[index];
		}
		return null;
	}
	,getChildByName: function(name) {
		var _g = 0;
		var _g1 = this.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			if(child.get_name() == name) {
				return child;
			}
		}
		return null;
	}
	,getChildIndex: function(child) {
		var _g = 0;
		var _g1 = this.__children.length;
		while(_g < _g1) {
			var i = _g++;
			if(this.__children[i] == child) {
				return i;
			}
		}
		return -1;
	}
	,getObjectsUnderPoint: function(point) {
		var stack = [];
		this.__hitTest(point.x,point.y,false,stack,false,this);
		stack.reverse();
		return stack;
	}
	,removeChild: function(child) {
		if(child != null && child.parent == this) {
			child.__setTransformDirty();
			if(!child.__renderDirty) {
				child.__renderDirty = true;
				child.__setParentRenderDirty();
			}
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
			var event = new openfl_events_Event("removed",true);
			child.__dispatchWithCapture(event);
			if(this.stage != null) {
				if(child.stage != null && this.stage.get_focus() == child) {
					this.stage.set_focus(null);
				}
				var event = new openfl_events_Event("removedFromStage",false,false);
				child.__dispatchWithCapture(event);
				child.__dispatchChildren(event);
				child.__setStageReference(null);
			}
			child.parent = null;
			HxOverrides.remove(this.__children,child);
			this.__removedChildren.push(child);
			child.__setTransformDirty();
		}
		return child;
	}
	,removeChildAt: function(index) {
		if(index >= 0 && index < this.__children.length) {
			return this.removeChild(this.__children[index]);
		}
		return null;
	}
	,removeChildren: function(beginIndex,endIndex) {
		if(endIndex == null) {
			endIndex = 2147483647;
		}
		if(beginIndex == null) {
			beginIndex = 0;
		}
		if(endIndex == 2147483647) {
			endIndex = this.__children.length - 1;
			if(endIndex < 0) {
				return;
			}
		}
		if(beginIndex > this.__children.length - 1) {
			return;
		} else if(endIndex < beginIndex || beginIndex < 0 || endIndex > this.__children.length) {
			throw haxe_Exception.thrown(new openfl_errors_RangeError("The supplied index is out of bounds."));
		}
		var numRemovals = endIndex - beginIndex;
		while(numRemovals >= 0) {
			this.removeChildAt(beginIndex);
			--numRemovals;
		}
	}
	,resolve: function(fieldName) {
		if(this.__children == null) {
			return null;
		}
		var _g = 0;
		var _g1 = this.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			if(child.get_name() == fieldName) {
				return child;
			}
		}
		return null;
	}
	,setChildIndex: function(child,index) {
		if(index >= 0 && index <= this.__children.length && child.parent == this) {
			HxOverrides.remove(this.__children,child);
			this.__children.splice(index,0,child);
		}
	}
	,stopAllMovieClips: function() {
		this.__stopAllMovieClips();
	}
	,swapChildren: function(child1,child2) {
		if(child1.parent == this && child2.parent == this) {
			var index1 = this.__children.indexOf(child1);
			var index2 = this.__children.indexOf(child2);
			this.__children[index1] = child2;
			this.__children[index2] = child1;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
	}
	,swapChildrenAt: function(index1,index2) {
		var swap = this.__children[index1];
		this.__children[index1] = this.__children[index2];
		this.__children[index2] = swap;
		swap = null;
		if(!this.__renderDirty) {
			this.__renderDirty = true;
			this.__setParentRenderDirty();
		}
	}
	,__cleanup: function() {
		openfl_display_InteractiveObject.prototype.__cleanup.call(this);
		var _g = 0;
		var _g1 = this.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			child.__cleanup();
		}
		var orphan = this.__removedChildren.iterator();
		while(orphan.hasNext()) {
			var orphan1 = orphan.next();
			if(orphan1.stage == null) {
				orphan1.__cleanup();
			}
		}
		this.__removedChildren.set_length(0);
	}
	,__cleanupRemovedChildren: function() {
		var orphan = this.__removedChildren.iterator();
		while(orphan.hasNext()) {
			var orphan1 = orphan.next();
			if(orphan1.stage == null) {
				orphan1.__cleanup();
			}
		}
		this.__removedChildren.set_length(0);
	}
	,__dispatchChildren: function(event) {
		if(this.__children != null) {
			var _g = 0;
			var _g1 = this.__children;
			while(_g < _g1.length) {
				var child = _g1[_g];
				++_g;
				event.target = child;
				if(!child.__dispatchWithCapture(event)) {
					break;
				}
				child.__dispatchChildren(event);
			}
		}
	}
	,__enterFrame: function(deltaTime) {
		var _g = 0;
		var _g1 = this.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			child.__enterFrame(deltaTime);
		}
	}
	,__getBounds: function(rect,matrix) {
		openfl_display_InteractiveObject.prototype.__getBounds.call(this,rect,matrix);
		if(this.__children.length == 0) {
			return;
		}
		var childWorldTransform = openfl_geom_Matrix.__pool.get();
		var _g = 0;
		var _g1 = this.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			if(child.__scaleX == 0 || child.__scaleY == 0) {
				continue;
			}
			var local = child.__transform;
			childWorldTransform.a = local.a * matrix.a + local.b * matrix.c;
			childWorldTransform.b = local.a * matrix.b + local.b * matrix.d;
			childWorldTransform.c = local.c * matrix.a + local.d * matrix.c;
			childWorldTransform.d = local.c * matrix.b + local.d * matrix.d;
			childWorldTransform.tx = local.tx * matrix.a + local.ty * matrix.c + matrix.tx;
			childWorldTransform.ty = local.tx * matrix.b + local.ty * matrix.d + matrix.ty;
			child.__getBounds(rect,childWorldTransform);
		}
		openfl_geom_Matrix.__pool.release(childWorldTransform);
	}
	,__getFilterBounds: function(rect,matrix) {
		openfl_display_InteractiveObject.prototype.__getFilterBounds.call(this,rect,matrix);
		if(this.__scrollRect != null) {
			return;
		}
		if(this.__children.length == 0) {
			return;
		}
		var childWorldTransform = openfl_geom_Matrix.__pool.get();
		var _g = 0;
		var _g1 = this.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			if(child.__scaleX == 0 || child.__scaleY == 0 || child.__isMask) {
				continue;
			}
			var local = child.__transform;
			childWorldTransform.a = local.a * matrix.a + local.b * matrix.c;
			childWorldTransform.b = local.a * matrix.b + local.b * matrix.d;
			childWorldTransform.c = local.c * matrix.a + local.d * matrix.c;
			childWorldTransform.d = local.c * matrix.b + local.d * matrix.d;
			childWorldTransform.tx = local.tx * matrix.a + local.ty * matrix.c + matrix.tx;
			childWorldTransform.ty = local.tx * matrix.b + local.ty * matrix.d + matrix.ty;
			child.__getFilterBounds(rect,childWorldTransform);
		}
		openfl_geom_Matrix.__pool.release(childWorldTransform);
	}
	,__getRenderBounds: function(rect,matrix) {
		if(this.__scrollRect != null) {
			openfl_display_InteractiveObject.prototype.__getRenderBounds.call(this,rect,matrix);
			return;
		} else {
			openfl_display_InteractiveObject.prototype.__getBounds.call(this,rect,matrix);
		}
		if(this.__children.length == 0) {
			return;
		}
		var childWorldTransform = openfl_geom_Matrix.__pool.get();
		var _g = 0;
		var _g1 = this.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			if(child.__scaleX == 0 || child.__scaleY == 0 || child.__isMask) {
				continue;
			}
			var local = child.__transform;
			childWorldTransform.a = local.a * matrix.a + local.b * matrix.c;
			childWorldTransform.b = local.a * matrix.b + local.b * matrix.d;
			childWorldTransform.c = local.c * matrix.a + local.d * matrix.c;
			childWorldTransform.d = local.c * matrix.b + local.d * matrix.d;
			childWorldTransform.tx = local.tx * matrix.a + local.ty * matrix.c + matrix.tx;
			childWorldTransform.ty = local.tx * matrix.b + local.ty * matrix.d + matrix.ty;
			child.__getRenderBounds(rect,childWorldTransform);
		}
		openfl_geom_Matrix.__pool.release(childWorldTransform);
	}
	,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) {
		if(!hitObject.get_visible() || this.__isMask || interactiveOnly && !this.mouseEnabled && !this.mouseChildren) {
			return false;
		}
		if(this.get_mask() != null && !this.get_mask().__hitTestMask(x,y)) {
			return false;
		}
		if(this.__scrollRect != null) {
			var point = openfl_geom_Point.__pool.get();
			point.setTo(x,y);
			var _this = this.__getRenderTransform();
			var norm = _this.a * _this.d - _this.b * _this.c;
			if(norm == 0) {
				point.x = -_this.tx;
				point.y = -_this.ty;
			} else {
				var px = 1.0 / norm * (_this.c * (_this.ty - point.y) + _this.d * (point.x - _this.tx));
				point.y = 1.0 / norm * (_this.a * (point.y - _this.ty) + _this.b * (_this.tx - point.x));
				point.x = px;
			}
			if(!this.__scrollRect.containsPoint(point)) {
				openfl_geom_Point.__pool.release(point);
				return false;
			}
			openfl_geom_Point.__pool.release(point);
		}
		var i = this.__children.length;
		if(interactiveOnly) {
			if(stack == null || !this.mouseChildren) {
				while(--i >= 0) if(this.__children[i].__hitTest(x,y,shapeFlag,null,true,this.__children[i])) {
					if(stack != null) {
						stack.push(hitObject);
					}
					return true;
				}
			} else if(stack != null) {
				var length = stack.length;
				var interactive = false;
				var hitTest = false;
				while(--i >= 0) {
					interactive = this.__children[i].__getInteractive(null);
					if(interactive || this.mouseEnabled && !hitTest) {
						if(this.__children[i].__hitTest(x,y,shapeFlag,stack,true,this.__children[i])) {
							hitTest = true;
							if(interactive && stack.length > length) {
								break;
							}
						}
					}
				}
				if(hitTest) {
					stack.splice(length,0,hitObject);
					return true;
				}
			}
		} else {
			var hitTest = false;
			while(--i >= 0) if(this.__children[i].__hitTest(x,y,shapeFlag,stack,false,this.__children[i])) {
				hitTest = true;
				if(stack == null) {
					break;
				}
			}
			return hitTest;
		}
		return false;
	}
	,__hitTestMask: function(x,y) {
		var i = this.__children.length;
		while(--i >= 0) if(this.__children[i].__hitTestMask(x,y)) {
			return true;
		}
		return false;
	}
	,__readGraphicsData: function(graphicsData,recurse) {
		openfl_display_InteractiveObject.prototype.__readGraphicsData.call(this,graphicsData,recurse);
		if(recurse) {
			var _g = 0;
			var _g1 = this.__children;
			while(_g < _g1.length) {
				var child = _g1[_g];
				++_g;
				child.__readGraphicsData(graphicsData,recurse);
			}
		}
	}
	,__renderCairo: function(renderer) {
	}
	,__renderCairoMask: function(renderer) {
	}
	,__renderCanvas: function(renderer) {
		var orphan = this.__removedChildren.iterator();
		while(orphan.hasNext()) {
			var orphan1 = orphan.next();
			if(orphan1.stage == null) {
				orphan1.__cleanup();
			}
		}
		this.__removedChildren.set_length(0);
		if(!this.__renderable || this.__worldAlpha <= 0 || this.get_mask() != null && (this.get_mask().get_width() <= 0 || this.get_mask().get_height() <= 0)) {
			return;
		}
		openfl_display_InteractiveObject.prototype.__renderCanvas.call(this,renderer);
		if(this.__cacheBitmap != null && !this.__isCacheBitmapRender) {
			return;
		}
		renderer.__pushMaskObject(this);
		if(renderer.__stage != null) {
			var _g = 0;
			var _g1 = this.__children;
			while(_g < _g1.length) {
				var child = _g1[_g];
				++_g;
				child.__renderCanvas(renderer);
				child.__renderDirty = false;
			}
			this.__renderDirty = false;
		} else {
			var _g = 0;
			var _g1 = this.__children;
			while(_g < _g1.length) {
				var child = _g1[_g];
				++_g;
				child.__renderCanvas(renderer);
			}
		}
		renderer.__popMaskObject(this);
	}
	,__renderCanvasMask: function(renderer) {
		var orphan = this.__removedChildren.iterator();
		while(orphan.hasNext()) {
			var orphan1 = orphan.next();
			if(orphan1.stage == null) {
				orphan1.__cleanup();
			}
		}
		this.__removedChildren.set_length(0);
		if(this.__graphics != null) {
			openfl_display__$internal_CanvasGraphics.renderMask(this.__graphics,renderer);
		}
		var _g = 0;
		var _g1 = this.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			child.__renderCanvasMask(renderer);
		}
	}
	,__renderDOM: function(renderer) {
		var orphan = this.__removedChildren.iterator();
		while(orphan.hasNext()) {
			var orphan1 = orphan.next();
			if(orphan1.stage == null) {
				orphan1.__renderDOM(renderer);
			}
		}
		var orphan = this.__removedChildren.iterator();
		while(orphan.hasNext()) {
			var orphan1 = orphan.next();
			if(orphan1.stage == null) {
				orphan1.__cleanup();
			}
		}
		this.__removedChildren.set_length(0);
		openfl_display_InteractiveObject.prototype.__renderDOM.call(this,renderer);
		if(this.__cacheBitmap != null && !this.__isCacheBitmapRender) {
			return;
		}
		renderer.__pushMaskObject(this);
		if(renderer.__stage != null) {
			var _g = 0;
			var _g1 = this.__children;
			while(_g < _g1.length) {
				var child = _g1[_g];
				++_g;
				child.__renderDOM(renderer);
				child.__renderDirty = false;
			}
			this.__renderDirty = false;
		} else {
			var _g = 0;
			var _g1 = this.__children;
			while(_g < _g1.length) {
				var child = _g1[_g];
				++_g;
				child.__renderDOM(renderer);
			}
		}
		renderer.__popMaskObject(this);
	}
	,__renderDOMClear: function(renderer) {
		var orphan = this.__removedChildren.iterator();
		while(orphan.hasNext()) {
			var orphan1 = orphan.next();
			if(orphan1.stage == null) {
				orphan1.__renderDOMClear(renderer);
			}
		}
		var orphan = this.__removedChildren.iterator();
		while(orphan.hasNext()) {
			var orphan1 = orphan.next();
			if(orphan1.stage == null) {
				orphan1.__cleanup();
			}
		}
		this.__removedChildren.set_length(0);
		var _g = 0;
		var _g1 = this.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			child.__renderDOMClear(renderer);
		}
	}
	,__renderGL: function(renderer) {
		var orphan = this.__removedChildren.iterator();
		while(orphan.hasNext()) {
			var orphan1 = orphan.next();
			if(orphan1.stage == null) {
				orphan1.__cleanup();
			}
		}
		this.__removedChildren.set_length(0);
		if(!this.__renderable || this.__worldAlpha <= 0) {
			return;
		}
		openfl_display_InteractiveObject.prototype.__renderGL.call(this,renderer);
		if(this.__cacheBitmap != null && !this.__isCacheBitmapRender) {
			return;
		}
		if(this.__children.length > 0) {
			renderer.__pushMaskObject(this);
			if(renderer.__stage != null) {
				var _g = 0;
				var _g1 = this.__children;
				while(_g < _g1.length) {
					var child = _g1[_g];
					++_g;
					child.__renderGL(renderer);
					child.__renderDirty = false;
				}
				this.__renderDirty = false;
			} else {
				var _g = 0;
				var _g1 = this.__children;
				while(_g < _g1.length) {
					var child = _g1[_g];
					++_g;
					child.__renderGL(renderer);
				}
			}
		}
		if(this.__children.length > 0) {
			renderer.__popMaskObject(this);
		}
	}
	,__renderGLMask: function(renderer) {
		var orphan = this.__removedChildren.iterator();
		while(orphan.hasNext()) {
			var orphan1 = orphan.next();
			if(orphan1.stage == null) {
				orphan1.__cleanup();
			}
		}
		this.__removedChildren.set_length(0);
		if(this.__graphics != null) {
			openfl_display__$internal_Context3DShape.renderMask(this,renderer);
		}
		var _g = 0;
		var _g1 = this.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			child.__renderGLMask(renderer);
		}
	}
	,__setStageReference: function(stage) {
		openfl_display_InteractiveObject.prototype.__setStageReference.call(this,stage);
		if(this.__children != null) {
			var _g = 0;
			var _g1 = this.__children;
			while(_g < _g1.length) {
				var child = _g1[_g];
				++_g;
				child.__setStageReference(stage);
			}
		}
	}
	,__setWorldTransformInvalid: function() {
		if(!this.__worldTransformInvalid) {
			this.__worldTransformInvalid = true;
			if(this.__children != null) {
				var _g = 0;
				var _g1 = this.__children;
				while(_g < _g1.length) {
					var child = _g1[_g];
					++_g;
					child.__setWorldTransformInvalid();
				}
			}
		}
	}
	,__shouldCacheHardware: function(value) {
		if(value == true) {
			return true;
		}
		value = openfl_display_InteractiveObject.prototype.__shouldCacheHardware.call(this,value);
		if(value == true) {
			return true;
		}
		if(this.__children != null) {
			var _g = 0;
			var _g1 = this.__children;
			while(_g < _g1.length) {
				var child = _g1[_g];
				++_g;
				value = child.__shouldCacheHardware(value);
				if(value == true) {
					return true;
				}
			}
		}
		return value;
	}
	,__stopAllMovieClips: function() {
		var _g = 0;
		var _g1 = this.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			child.__stopAllMovieClips();
		}
	}
	,__tabTest: function(stack) {
		openfl_display_InteractiveObject.prototype.__tabTest.call(this,stack);
		if(!this.get_tabChildren()) {
			return;
		}
		var interactive = false;
		var interactiveObject = null;
		var _g = 0;
		var _g1 = this.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			interactive = child.__getInteractive(null);
			if(interactive) {
				interactiveObject = child;
				interactiveObject.__tabTest(stack);
			}
		}
	}
	,__update: function(transformOnly,updateChildren) {
		openfl_display_InteractiveObject.prototype.__update.call(this,transformOnly,updateChildren);
		if(updateChildren) {
			var _g = 0;
			var _g1 = this.__children;
			while(_g < _g1.length) {
				var child = _g1[_g];
				++_g;
				child.__update(transformOnly,true);
			}
		}
	}
	,get_numChildren: function() {
		return this.__children.length;
	}
	,get_tabChildren: function() {
		return this.__tabChildren;
	}
	,set_tabChildren: function(value) {
		if(this.__tabChildren != value) {
			this.__tabChildren = value;
			this.dispatchEvent(new openfl_events_Event("tabChildrenChange",true,false));
		}
		return this.__tabChildren;
	}
	,__class__: openfl_display_DisplayObjectContainer
	,__properties__: $extend(openfl_display_InteractiveObject.prototype.__properties__,{set_tabChildren:"set_tabChildren",get_tabChildren:"get_tabChildren",get_numChildren:"get_numChildren"})
});
var openfl_display_Sprite = function() {
	openfl_display_DisplayObjectContainer.call(this);
	this.__buttonMode = false;
	this.useHandCursor = true;
};
$hxClasses["openfl.display.Sprite"] = openfl_display_Sprite;
openfl_display_Sprite.__name__ = "openfl.display.Sprite";
openfl_display_Sprite.__super__ = openfl_display_DisplayObjectContainer;
openfl_display_Sprite.prototype = $extend(openfl_display_DisplayObjectContainer.prototype,{
	dropTarget: null
	,hitArea: null
	,useHandCursor: null
	,__buttonMode: null
	,startDrag: function(lockCenter,bounds) {
		if(lockCenter == null) {
			lockCenter = false;
		}
		if(this.stage != null) {
			this.stage.__startDrag(this,lockCenter,bounds);
		}
	}
	,stopDrag: function() {
		if(this.stage != null) {
			this.stage.__stopDrag(this);
		}
	}
	,__getCursor: function() {
		if(this.__buttonMode && this.useHandCursor) {
			return "button";
		} else {
			return null;
		}
	}
	,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) {
		if(interactiveOnly && !this.mouseEnabled && !this.mouseChildren) {
			return false;
		}
		if(!hitObject.get_visible() || this.__isMask) {
			return this.__hitTestHitArea(x,y,shapeFlag,stack,interactiveOnly,hitObject);
		}
		if(this.get_mask() != null && !this.get_mask().__hitTestMask(x,y)) {
			return this.__hitTestHitArea(x,y,shapeFlag,stack,interactiveOnly,hitObject);
		}
		if(this.__scrollRect != null) {
			var point = openfl_geom_Point.__pool.get();
			point.setTo(x,y);
			var _this = this.__getRenderTransform();
			var norm = _this.a * _this.d - _this.b * _this.c;
			if(norm == 0) {
				point.x = -_this.tx;
				point.y = -_this.ty;
			} else {
				var px = 1.0 / norm * (_this.c * (_this.ty - point.y) + _this.d * (point.x - _this.tx));
				point.y = 1.0 / norm * (_this.a * (point.y - _this.ty) + _this.b * (_this.tx - point.x));
				point.x = px;
			}
			if(!this.__scrollRect.containsPoint(point)) {
				openfl_geom_Point.__pool.release(point);
				return this.__hitTestHitArea(x,y,shapeFlag,stack,true,hitObject);
			}
			openfl_geom_Point.__pool.release(point);
		}
		if(openfl_display_DisplayObjectContainer.prototype.__hitTest.call(this,x,y,shapeFlag,stack,interactiveOnly,hitObject)) {
			if(stack != null) {
				return interactiveOnly;
			} else {
				return true;
			}
		} else if(this.hitArea == null && this.__graphics != null && this.__graphics.__hitTest(x,y,shapeFlag,this.__getRenderTransform())) {
			if(stack != null && (!interactiveOnly || this.mouseEnabled)) {
				stack.push(hitObject);
			}
			return true;
		}
		return this.__hitTestHitArea(x,y,shapeFlag,stack,interactiveOnly,hitObject);
	}
	,__hitTestHitArea: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) {
		if(this.hitArea != null) {
			if(!this.hitArea.mouseEnabled) {
				this.hitArea.mouseEnabled = true;
				var hitTest = this.hitArea.__hitTest(x,y,shapeFlag,null,true,hitObject);
				this.hitArea.mouseEnabled = false;
				if(stack != null && hitTest) {
					stack[stack.length] = hitObject;
				}
				return hitTest;
			}
		}
		return false;
	}
	,__hitTestMask: function(x,y) {
		if(openfl_display_DisplayObjectContainer.prototype.__hitTestMask.call(this,x,y)) {
			return true;
		} else if(this.__graphics != null && this.__graphics.__hitTest(x,y,true,this.__getRenderTransform())) {
			return true;
		}
		return false;
	}
	,get_graphics: function() {
		if(this.__graphics == null) {
			this.__graphics = new openfl_display_Graphics(this);
		}
		return this.__graphics;
	}
	,get_tabEnabled: function() {
		if(this.__tabEnabled == null) {
			return this.__buttonMode;
		} else {
			return this.__tabEnabled;
		}
	}
	,get_buttonMode: function() {
		return this.__buttonMode;
	}
	,set_buttonMode: function(value) {
		return this.__buttonMode = value;
	}
	,__class__: openfl_display_Sprite
	,__properties__: $extend(openfl_display_DisplayObjectContainer.prototype.__properties__,{get_graphics:"get_graphics",set_buttonMode:"set_buttonMode",get_buttonMode:"get_buttonMode"})
});
var Main = function() {
	openfl_display_Sprite.call(this);
	axollib_AxolAPI.firstState = TitleState;
	this.addChild(new flixel_FlxGame(160,120,axollib_DissolveState,1,120,30));
};
$hxClasses["Main"] = Main;
Main.__name__ = "Main";
Main.__super__ = openfl_display_Sprite;
Main.prototype = $extend(openfl_display_Sprite.prototype,{
	__class__: Main
});
var DocumentClass = function(current) {
	current.addChild(this);
	Main.call(this);
	this.dispatchEvent(new openfl_events_Event("addedToStage",false,false));
};
$hxClasses["DocumentClass"] = DocumentClass;
DocumentClass.__name__ = "DocumentClass";
DocumentClass.__super__ = Main;
DocumentClass.prototype = $extend(Main.prototype,{
	__class__: DocumentClass
});
var AssetPaths = function() { };
$hxClasses["AssetPaths"] = AssetPaths;
AssetPaths.__name__ = "AssetPaths";
var flixel_util_IFlxDestroyable = function() { };
$hxClasses["flixel.util.IFlxDestroyable"] = flixel_util_IFlxDestroyable;
flixel_util_IFlxDestroyable.__name__ = "flixel.util.IFlxDestroyable";
flixel_util_IFlxDestroyable.__isInterface__ = true;
flixel_util_IFlxDestroyable.prototype = {
	destroy: null
	,__class__: flixel_util_IFlxDestroyable
};
var flixel_FlxBasic = function() {
	this.flixelType = 0;
	this.exists = true;
	this.alive = true;
	this.visible = true;
	this.active = true;
	this.ID = flixel_FlxBasic.idEnumerator++;
};
$hxClasses["flixel.FlxBasic"] = flixel_FlxBasic;
flixel_FlxBasic.__name__ = "flixel.FlxBasic";
flixel_FlxBasic.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_FlxBasic.prototype = {
	ID: null
	,active: null
	,visible: null
	,alive: null
	,exists: null
	,flixelType: null
	,_cameras: null
	,destroy: function() {
		this.set_exists(false);
		this._cameras = null;
	}
	,kill: function() {
		this.set_alive(false);
		this.set_exists(false);
	}
	,revive: function() {
		this.set_alive(true);
		this.set_exists(true);
	}
	,update: function(elapsed) {
	}
	,draw: function() {
	}
	,toString: function() {
		var value = this.active;
		var _this = flixel_util_LabelValuePair._pool.get();
		_this.label = "active";
		_this.value = value;
		var value = this.visible;
		var _this1 = flixel_util_LabelValuePair._pool.get();
		_this1.label = "visible";
		_this1.value = value;
		var value = this.alive;
		var _this2 = flixel_util_LabelValuePair._pool.get();
		_this2.label = "alive";
		_this2.value = value;
		var value = this.exists;
		var _this3 = flixel_util_LabelValuePair._pool.get();
		_this3.label = "exists";
		_this3.value = value;
		return flixel_util_FlxStringUtil.getDebugString([_this,_this1,_this2,_this3]);
	}
	,set_visible: function(Value) {
		return this.visible = Value;
	}
	,set_active: function(Value) {
		return this.active = Value;
	}
	,set_exists: function(Value) {
		return this.exists = Value;
	}
	,set_alive: function(Value) {
		return this.alive = Value;
	}
	,get_camera: function() {
		if(this._cameras == null || this._cameras.length == 0) {
			return flixel_FlxCamera._defaultCameras[0];
		} else {
			return this._cameras[0];
		}
	}
	,set_camera: function(Value) {
		if(this._cameras == null) {
			this._cameras = [Value];
		} else {
			this._cameras[0] = Value;
		}
		return Value;
	}
	,get_cameras: function() {
		if(this._cameras == null) {
			return flixel_FlxCamera._defaultCameras;
		} else {
			return this._cameras;
		}
	}
	,set_cameras: function(Value) {
		return this._cameras = Value;
	}
	,__class__: flixel_FlxBasic
	,__properties__: {set_cameras:"set_cameras",get_cameras:"get_cameras",set_camera:"set_camera",get_camera:"get_camera",set_exists:"set_exists",set_alive:"set_alive",set_visible:"set_visible",set_active:"set_active"}
};
var flixel_util_IFlxPooled = function() { };
$hxClasses["flixel.util.IFlxPooled"] = flixel_util_IFlxPooled;
flixel_util_IFlxPooled.__name__ = "flixel.util.IFlxPooled";
flixel_util_IFlxPooled.__isInterface__ = true;
flixel_util_IFlxPooled.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_util_IFlxPooled.prototype = {
	put: null
	,_inPool: null
	,__class__: flixel_util_IFlxPooled
};
var flixel_util_IFlxPool = function() { };
$hxClasses["flixel.util.IFlxPool"] = flixel_util_IFlxPool;
flixel_util_IFlxPool.__name__ = "flixel.util.IFlxPool";
flixel_util_IFlxPool.__isInterface__ = true;
flixel_util_IFlxPool.prototype = {
	preAllocate: null
	,clear: null
	,__class__: flixel_util_IFlxPool
};
var flixel_util_FlxPool_$flixel_$math_$FlxRect = function(classObj) {
	this._count = 0;
	this._pool = [];
	this._class = classObj;
};
$hxClasses["flixel.util.FlxPool_flixel_math_FlxRect"] = flixel_util_FlxPool_$flixel_$math_$FlxRect;
flixel_util_FlxPool_$flixel_$math_$FlxRect.__name__ = "flixel.util.FlxPool_flixel_math_FlxRect";
flixel_util_FlxPool_$flixel_$math_$FlxRect.__interfaces__ = [flixel_util_IFlxPool];
flixel_util_FlxPool_$flixel_$math_$FlxRect.prototype = {
	_pool: null
	,_class: null
	,_count: null
	,get: function() {
		if(this._count == 0) {
			return Type.createInstance(this._class,[]);
		}
		return this._pool[--this._count];
	}
	,put: function(obj) {
		if(obj != null) {
			var i = this._pool.indexOf(obj);
			if(i == -1 || i >= this._count) {
				obj.destroy();
				this._pool[this._count++] = obj;
			}
		}
	}
	,putUnsafe: function(obj) {
		if(obj != null) {
			obj.destroy();
			this._pool[this._count++] = obj;
		}
	}
	,preAllocate: function(numObjects) {
		while(numObjects-- > 0) this._pool[this._count++] = Type.createInstance(this._class,[]);
	}
	,clear: function() {
		this._count = 0;
		var oldPool = this._pool;
		this._pool = [];
		return oldPool;
	}
	,get_length: function() {
		return this._count;
	}
	,__class__: flixel_util_FlxPool_$flixel_$math_$FlxRect
	,__properties__: {get_length:"get_length"}
};
var flixel_math_FlxRect = function(X,Y,Width,Height) {
	if(Height == null) {
		Height = 0;
	}
	if(Width == null) {
		Width = 0;
	}
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	this._inPool = false;
	this._weak = false;
	var X1 = X;
	var Y1 = Y;
	var Width1 = Width;
	var Height1 = Height;
	if(Height1 == null) {
		Height1 = 0;
	}
	if(Width1 == null) {
		Width1 = 0;
	}
	if(Y1 == null) {
		Y1 = 0;
	}
	if(X1 == null) {
		X1 = 0;
	}
	this.x = X1;
	this.y = Y1;
	this.width = Width1;
	this.height = Height1;
};
$hxClasses["flixel.math.FlxRect"] = flixel_math_FlxRect;
flixel_math_FlxRect.__name__ = "flixel.math.FlxRect";
flixel_math_FlxRect.__interfaces__ = [flixel_util_IFlxPooled];
flixel_math_FlxRect.__properties__ = {get_pool:"get_pool"};
flixel_math_FlxRect.get = function(X,Y,Width,Height) {
	if(Height == null) {
		Height = 0;
	}
	if(Width == null) {
		Width = 0;
	}
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	var _this = flixel_math_FlxRect._pool.get();
	var X1 = X;
	var Y1 = Y;
	var Width1 = Width;
	var Height1 = Height;
	if(Height1 == null) {
		Height1 = 0;
	}
	if(Width1 == null) {
		Width1 = 0;
	}
	if(Y1 == null) {
		Y1 = 0;
	}
	if(X1 == null) {
		X1 = 0;
	}
	_this.x = X1;
	_this.y = Y1;
	_this.width = Width1;
	_this.height = Height1;
	var rect = _this;
	rect._inPool = false;
	return rect;
};
flixel_math_FlxRect.weak = function(X,Y,Width,Height) {
	if(Height == null) {
		Height = 0;
	}
	if(Width == null) {
		Width = 0;
	}
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	var X1 = X;
	var Y1 = Y;
	var Width1 = Width;
	var Height1 = Height;
	if(Height1 == null) {
		Height1 = 0;
	}
	if(Width1 == null) {
		Width1 = 0;
	}
	if(Y1 == null) {
		Y1 = 0;
	}
	if(X1 == null) {
		X1 = 0;
	}
	var _this = flixel_math_FlxRect._pool.get();
	var X = X1;
	var Y = Y1;
	var Width = Width1;
	var Height = Height1;
	if(Height == null) {
		Height = 0;
	}
	if(Width == null) {
		Width = 0;
	}
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	_this.x = X;
	_this.y = Y;
	_this.width = Width;
	_this.height = Height;
	var rect = _this;
	rect._inPool = false;
	var rect1 = rect;
	rect1._weak = true;
	return rect1;
};
flixel_math_FlxRect.get_pool = function() {
	return flixel_math_FlxRect._pool;
};
flixel_math_FlxRect.prototype = {
	x: null
	,y: null
	,width: null
	,height: null
	,_weak: null
	,_inPool: null
	,put: function() {
		if(!this._inPool) {
			this._inPool = true;
			this._weak = false;
			flixel_math_FlxRect._pool.putUnsafe(this);
		}
	}
	,putWeak: function() {
		if(this._weak) {
			if(!this._inPool) {
				this._inPool = true;
				this._weak = false;
				flixel_math_FlxRect._pool.putUnsafe(this);
			}
		}
	}
	,setSize: function(Width,Height) {
		this.width = Width;
		this.height = Height;
		return this;
	}
	,setPosition: function(x,y) {
		this.x = x;
		this.y = y;
		return this;
	}
	,set: function(X,Y,Width,Height) {
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		this.x = X;
		this.y = Y;
		this.width = Width;
		this.height = Height;
		return this;
	}
	,copyFrom: function(Rect) {
		this.x = Rect.x;
		this.y = Rect.y;
		this.width = Rect.width;
		this.height = Rect.height;
		if(Rect._weak) {
			if(!Rect._inPool) {
				Rect._inPool = true;
				Rect._weak = false;
				flixel_math_FlxRect._pool.putUnsafe(Rect);
			}
		}
		return this;
	}
	,copyTo: function(Rect) {
		Rect.x = this.x;
		Rect.y = this.y;
		Rect.width = this.width;
		Rect.height = this.height;
		if(Rect._weak) {
			if(!Rect._inPool) {
				Rect._inPool = true;
				Rect._weak = false;
				flixel_math_FlxRect._pool.putUnsafe(Rect);
			}
		}
		return Rect;
	}
	,copyFromFlash: function(FlashRect) {
		this.x = FlashRect.x;
		this.y = FlashRect.y;
		this.width = FlashRect.width;
		this.height = FlashRect.height;
		return this;
	}
	,copyToFlash: function(FlashRect) {
		if(FlashRect == null) {
			FlashRect = new openfl_geom_Rectangle();
		}
		FlashRect.x = this.x;
		FlashRect.y = this.y;
		FlashRect.width = this.width;
		FlashRect.height = this.height;
		return FlashRect;
	}
	,overlaps: function(Rect) {
		var result = Rect.x + Rect.width > this.x && Rect.x < this.x + this.width && Rect.y + Rect.height > this.y && Rect.y < this.y + this.height;
		if(Rect._weak) {
			if(!Rect._inPool) {
				Rect._inPool = true;
				Rect._weak = false;
				flixel_math_FlxRect._pool.putUnsafe(Rect);
			}
		}
		return result;
	}
	,containsPoint: function(Point) {
		var result = flixel_math_FlxMath.pointInFlxRect(Point.x,Point.y,this);
		if(Point._weak) {
			Point.put();
		}
		return result;
	}
	,union: function(Rect) {
		var minX = Math.min(this.x,Rect.x);
		var minY = Math.min(this.y,Rect.y);
		var maxX = Math.max(this.x + this.width,Rect.x + Rect.width);
		var maxY = Math.max(this.y + this.height,Rect.y + Rect.height);
		if(Rect._weak) {
			if(!Rect._inPool) {
				Rect._inPool = true;
				Rect._weak = false;
				flixel_math_FlxRect._pool.putUnsafe(Rect);
			}
		}
		var X = minX;
		var Y = minY;
		var Width = maxX - minX;
		var Height = maxY - minY;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		this.x = X;
		this.y = Y;
		this.width = Width;
		this.height = Height;
		return this;
	}
	,floor: function() {
		this.x = Math.floor(this.x);
		this.y = Math.floor(this.y);
		this.width = Math.floor(this.width);
		this.height = Math.floor(this.height);
		return this;
	}
	,ceil: function() {
		this.x = Math.ceil(this.x);
		this.y = Math.ceil(this.y);
		this.width = Math.ceil(this.width);
		this.height = Math.ceil(this.height);
		return this;
	}
	,round: function() {
		this.x = Math.round(this.x);
		this.y = Math.round(this.y);
		this.width = Math.round(this.width);
		this.height = Math.round(this.height);
		return this;
	}
	,fromTwoPoints: function(Point1,Point2) {
		var minX = Math.min(Point1.x,Point2.x);
		var minY = Math.min(Point1.y,Point2.y);
		var maxX = Math.max(Point1.x,Point2.x);
		var maxY = Math.max(Point1.y,Point2.y);
		if(Point1._weak) {
			Point1.put();
		}
		if(Point2._weak) {
			Point2.put();
		}
		var X = minX;
		var Y = minY;
		var Width = maxX - minX;
		var Height = maxY - minY;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		this.x = X;
		this.y = Y;
		this.width = Width;
		this.height = Height;
		return this;
	}
	,unionWithPoint: function(Point) {
		var minX = Math.min(this.x,Point.x);
		var minY = Math.min(this.y,Point.y);
		var maxX = Math.max(this.x + this.width,Point.x);
		var maxY = Math.max(this.y + this.height,Point.y);
		if(Point._weak) {
			Point.put();
		}
		var X = minX;
		var Y = minY;
		var Width = maxX - minX;
		var Height = maxY - minY;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		this.x = X;
		this.y = Y;
		this.width = Width;
		this.height = Height;
		return this;
	}
	,offset: function(dx,dy) {
		this.x += dx;
		this.y += dy;
		return this;
	}
	,destroy: function() {
	}
	,equals: function(rect) {
		var result = Math.abs(this.x - rect.x) <= 0.0000001 && Math.abs(this.y - rect.y) <= 0.0000001 && Math.abs(this.width - rect.width) <= 0.0000001 && Math.abs(this.height - rect.height) <= 0.0000001;
		if(rect._weak) {
			if(!rect._inPool) {
				rect._inPool = true;
				rect._weak = false;
				flixel_math_FlxRect._pool.putUnsafe(rect);
			}
		}
		return result;
	}
	,intersection: function(rect,result) {
		if(result == null) {
			var _this = flixel_math_FlxRect._pool.get();
			var X = 0;
			var Y = 0;
			var Width = 0;
			var Height = 0;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			_this.x = X;
			_this.y = Y;
			_this.width = Width;
			_this.height = Height;
			var rect1 = _this;
			rect1._inPool = false;
			result = rect1;
		}
		var x0 = this.x < rect.x ? rect.x : this.x;
		var x1 = this.x + this.width > rect.x + rect.width ? rect.x + rect.width : this.x + this.width;
		if(x1 <= x0) {
			if(rect._weak) {
				if(!rect._inPool) {
					rect._inPool = true;
					rect._weak = false;
					flixel_math_FlxRect._pool.putUnsafe(rect);
				}
			}
			return result;
		}
		var y0 = this.y < rect.y ? rect.y : this.y;
		var y1 = this.y + this.height > rect.y + rect.height ? rect.y + rect.height : this.y + this.height;
		if(y1 <= y0) {
			if(rect._weak) {
				if(!rect._inPool) {
					rect._inPool = true;
					rect._weak = false;
					flixel_math_FlxRect._pool.putUnsafe(rect);
				}
			}
			return result;
		}
		if(rect._weak) {
			if(!rect._inPool) {
				rect._inPool = true;
				rect._weak = false;
				flixel_math_FlxRect._pool.putUnsafe(rect);
			}
		}
		var X = x0;
		var Y = y0;
		var Width = x1 - x0;
		var Height = y1 - y0;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		result.x = X;
		result.y = Y;
		result.width = Width;
		result.height = Height;
		return result;
	}
	,toString: function() {
		var value = this.x;
		var _this = flixel_util_LabelValuePair._pool.get();
		_this.label = "x";
		_this.value = value;
		var value = this.y;
		var _this1 = flixel_util_LabelValuePair._pool.get();
		_this1.label = "y";
		_this1.value = value;
		var value = this.width;
		var _this2 = flixel_util_LabelValuePair._pool.get();
		_this2.label = "w";
		_this2.value = value;
		var value = this.height;
		var _this3 = flixel_util_LabelValuePair._pool.get();
		_this3.label = "h";
		_this3.value = value;
		return flixel_util_FlxStringUtil.getDebugString([_this,_this1,_this2,_this3]);
	}
	,get_left: function() {
		return this.x;
	}
	,set_left: function(Value) {
		this.width -= Value - this.x;
		return this.x = Value;
	}
	,get_right: function() {
		return this.x + this.width;
	}
	,set_right: function(Value) {
		this.width = Value - this.x;
		return Value;
	}
	,get_top: function() {
		return this.y;
	}
	,set_top: function(Value) {
		this.height -= Value - this.y;
		return this.y = Value;
	}
	,get_bottom: function() {
		return this.y + this.height;
	}
	,set_bottom: function(Value) {
		this.height = Value - this.y;
		return Value;
	}
	,get_isEmpty: function() {
		if(this.width != 0) {
			return this.height == 0;
		} else {
			return true;
		}
	}
	,__class__: flixel_math_FlxRect
	,__properties__: {get_isEmpty:"get_isEmpty",set_bottom:"set_bottom",get_bottom:"get_bottom",set_top:"set_top",get_top:"get_top",set_right:"set_right",get_right:"get_right",set_left:"set_left",get_left:"get_left"}
};
var flixel_FlxObject = function(X,Y,Width,Height) {
	if(Height == null) {
		Height = 0;
	}
	if(Width == null) {
		Width = 0;
	}
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	var _this = flixel_math_FlxRect._pool.get();
	_this.x = 0;
	_this.y = 0;
	_this.width = 0;
	_this.height = 0;
	_this._inPool = false;
	this._rect = _this;
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	this._point = point;
	this.path = null;
	this.collisonXDrag = true;
	this.allowCollisions = 4369;
	this.wasTouching = 0;
	this.touching = 0;
	this.health = 1;
	this.maxAngular = 10000;
	this.angularDrag = 0;
	this.angularAcceleration = 0;
	this.angularVelocity = 0;
	this.elasticity = 0;
	this.mass = 1;
	this.immovable = false;
	this.moves = true;
	this.angle = 0;
	this.pixelPerfectPosition = true;
	this.y = 0;
	this.x = 0;
	flixel_FlxBasic.call(this);
	this.set_x(X);
	this.set_y(Y);
	this.set_width(Width);
	this.set_height(Height);
	this.initVars();
};
$hxClasses["flixel.FlxObject"] = flixel_FlxObject;
flixel_FlxObject.__name__ = "flixel.FlxObject";
flixel_FlxObject.separate = function(Object1,Object2) {
	var separatedX = flixel_FlxObject.separateX(Object1,Object2);
	var separatedY = flixel_FlxObject.separateY(Object1,Object2);
	if(!separatedX) {
		return separatedY;
	} else {
		return true;
	}
};
flixel_FlxObject.updateTouchingFlags = function(Object1,Object2) {
	var touchingX = flixel_FlxObject.updateTouchingFlagsX(Object1,Object2);
	var touchingY = flixel_FlxObject.updateTouchingFlagsY(Object1,Object2);
	if(!touchingX) {
		return touchingY;
	} else {
		return true;
	}
};
flixel_FlxObject.computeOverlapX = function(Object1,Object2,checkMaxOverlap) {
	if(checkMaxOverlap == null) {
		checkMaxOverlap = true;
	}
	var overlap = 0;
	var obj1delta = Object1.x - Object1.last.x;
	var obj2delta = Object2.x - Object2.last.x;
	if(obj1delta != obj2delta) {
		var obj1deltaAbs = obj1delta > 0 ? obj1delta : -obj1delta;
		var obj2deltaAbs = obj2delta > 0 ? obj2delta : -obj2delta;
		var _this = flixel_FlxObject._firstSeparateFlxRect;
		var X = Object1.x - (obj1delta > 0 ? obj1delta : 0);
		var Y = Object1.last.y;
		var Width = Object1.get_width() + obj1deltaAbs;
		var Height = Object1.get_height();
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		var obj1rect = _this;
		var _this = flixel_FlxObject._secondSeparateFlxRect;
		var X = Object2.x - (obj2delta > 0 ? obj2delta : 0);
		var Y = Object2.last.y;
		var Width = Object2.get_width() + obj2deltaAbs;
		var Height = Object2.get_height();
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		var obj2rect = _this;
		if(obj1rect.x + obj1rect.width > obj2rect.x && obj1rect.x < obj2rect.x + obj2rect.width && obj1rect.y + obj1rect.height > obj2rect.y && obj1rect.y < obj2rect.y + obj2rect.height) {
			var maxOverlap = checkMaxOverlap ? obj1deltaAbs + obj2deltaAbs + flixel_FlxObject.SEPARATE_BIAS : 0;
			if(obj1delta > obj2delta) {
				overlap = Object1.x + Object1.get_width() - Object2.x;
				if(checkMaxOverlap && overlap > maxOverlap || (Object1.allowCollisions & 16) == 0 || (Object2.allowCollisions & 1) == 0) {
					overlap = 0;
				} else {
					Object1.touching |= 16;
					Object2.touching |= 1;
				}
			} else if(obj1delta < obj2delta) {
				overlap = Object1.x - Object2.get_width() - Object2.x;
				if(checkMaxOverlap && -overlap > maxOverlap || (Object1.allowCollisions & 1) == 0 || (Object2.allowCollisions & 16) == 0) {
					overlap = 0;
				} else {
					Object1.touching |= 1;
					Object2.touching |= 16;
				}
			}
		}
	}
	return overlap;
};
flixel_FlxObject.separateX = function(Object1,Object2) {
	var obj1immovable = Object1.immovable;
	var obj2immovable = Object2.immovable;
	if(obj1immovable && obj2immovable) {
		return false;
	}
	if(Object1.flixelType == 3) {
		var tilemap = Object1;
		return tilemap.overlapsWithCallback(Object2,flixel_FlxObject.separateX);
	}
	if(Object2.flixelType == 3) {
		var tilemap = Object2;
		return tilemap.overlapsWithCallback(Object1,flixel_FlxObject.separateX,true);
	}
	var overlap = flixel_FlxObject.computeOverlapX(Object1,Object2);
	if(overlap != 0) {
		var obj1v = Object1.velocity.x;
		var obj2v = Object2.velocity.x;
		if(!obj1immovable && !obj2immovable) {
			overlap *= 0.5;
			Object1.set_x(Object1.x - overlap);
			var _g = Object2;
			_g.set_x(_g.x + overlap);
			var obj1velocity = Math.sqrt(obj2v * obj2v * Object2.mass / Object1.mass) * (obj2v > 0 ? 1 : -1);
			var obj2velocity = Math.sqrt(obj1v * obj1v * Object1.mass / Object2.mass) * (obj1v > 0 ? 1 : -1);
			var average = (obj1velocity + obj2velocity) * 0.5;
			obj1velocity -= average;
			obj2velocity -= average;
			Object1.velocity.set_x(average + obj1velocity * Object1.elasticity);
			Object2.velocity.set_x(average + obj2velocity * Object2.elasticity);
		} else if(!obj1immovable) {
			Object1.set_x(Object1.x - overlap);
			Object1.velocity.set_x(obj2v - obj1v * Object1.elasticity);
		} else if(!obj2immovable) {
			var _g = Object2;
			_g.set_x(_g.x + overlap);
			Object2.velocity.set_x(obj1v - obj2v * Object2.elasticity);
		}
		return true;
	}
	return false;
};
flixel_FlxObject.updateTouchingFlagsX = function(Object1,Object2) {
	if(Object1.flixelType == 3) {
		var tilemap = Object1;
		return tilemap.overlapsWithCallback(Object2,flixel_FlxObject.updateTouchingFlagsX);
	}
	if(Object2.flixelType == 3) {
		var tilemap = Object2;
		return tilemap.overlapsWithCallback(Object1,flixel_FlxObject.updateTouchingFlagsX,true);
	}
	return flixel_FlxObject.computeOverlapX(Object1,Object2,false) != 0;
};
flixel_FlxObject.computeOverlapY = function(Object1,Object2,checkMaxOverlap) {
	if(checkMaxOverlap == null) {
		checkMaxOverlap = true;
	}
	var overlap = 0;
	var obj1delta = Object1.y - Object1.last.y;
	var obj2delta = Object2.y - Object2.last.y;
	if(obj1delta != obj2delta) {
		var obj1deltaAbs = obj1delta > 0 ? obj1delta : -obj1delta;
		var obj2deltaAbs = obj2delta > 0 ? obj2delta : -obj2delta;
		var _this = flixel_FlxObject._firstSeparateFlxRect;
		var X = Object1.x;
		var Y = Object1.y - (obj1delta > 0 ? obj1delta : 0);
		var Width = Object1.get_width();
		var Height = Object1.get_height() + obj1deltaAbs;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		var obj1rect = _this;
		var _this = flixel_FlxObject._secondSeparateFlxRect;
		var X = Object2.x;
		var Y = Object2.y - (obj2delta > 0 ? obj2delta : 0);
		var Width = Object2.get_width();
		var Height = Object2.get_height() + obj2deltaAbs;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		var obj2rect = _this;
		if(obj1rect.x + obj1rect.width > obj2rect.x && obj1rect.x < obj2rect.x + obj2rect.width && obj1rect.y + obj1rect.height > obj2rect.y && obj1rect.y < obj2rect.y + obj2rect.height) {
			var maxOverlap = checkMaxOverlap ? obj1deltaAbs + obj2deltaAbs + flixel_FlxObject.SEPARATE_BIAS : 0;
			if(obj1delta > obj2delta) {
				overlap = Object1.y + Object1.get_height() - Object2.y;
				if(checkMaxOverlap && overlap > maxOverlap || (Object1.allowCollisions & 4096) == 0 || (Object2.allowCollisions & 256) == 0) {
					overlap = 0;
				} else {
					Object1.touching |= 4096;
					Object2.touching |= 256;
				}
			} else if(obj1delta < obj2delta) {
				overlap = Object1.y - Object2.get_height() - Object2.y;
				if(checkMaxOverlap && -overlap > maxOverlap || (Object1.allowCollisions & 256) == 0 || (Object2.allowCollisions & 4096) == 0) {
					overlap = 0;
				} else {
					Object1.touching |= 256;
					Object2.touching |= 4096;
				}
			}
		}
	}
	return overlap;
};
flixel_FlxObject.separateY = function(Object1,Object2) {
	var obj1immovable = Object1.immovable;
	var obj2immovable = Object2.immovable;
	if(obj1immovable && obj2immovable) {
		return false;
	}
	if(Object1.flixelType == 3) {
		var tilemap = Object1;
		return tilemap.overlapsWithCallback(Object2,flixel_FlxObject.separateY);
	}
	if(Object2.flixelType == 3) {
		var tilemap = Object2;
		return tilemap.overlapsWithCallback(Object1,flixel_FlxObject.separateY,true);
	}
	var overlap = flixel_FlxObject.computeOverlapY(Object1,Object2);
	if(overlap != 0) {
		var obj1delta = Object1.y - Object1.last.y;
		var obj2delta = Object2.y - Object2.last.y;
		var obj1v = Object1.velocity.y;
		var obj2v = Object2.velocity.y;
		if(!obj1immovable && !obj2immovable) {
			overlap *= 0.5;
			Object1.set_y(Object1.y - overlap);
			var _g = Object2;
			_g.set_y(_g.y + overlap);
			var obj1velocity = Math.sqrt(obj2v * obj2v * Object2.mass / Object1.mass) * (obj2v > 0 ? 1 : -1);
			var obj2velocity = Math.sqrt(obj1v * obj1v * Object1.mass / Object2.mass) * (obj1v > 0 ? 1 : -1);
			var average = (obj1velocity + obj2velocity) * 0.5;
			obj1velocity -= average;
			obj2velocity -= average;
			Object1.velocity.set_y(average + obj1velocity * Object1.elasticity);
			Object2.velocity.set_y(average + obj2velocity * Object2.elasticity);
		} else if(!obj1immovable) {
			Object1.set_y(Object1.y - overlap);
			Object1.velocity.set_y(obj2v - obj1v * Object1.elasticity);
			if(Object1.collisonXDrag && Object2.active && Object2.moves && obj1delta > obj2delta) {
				var _g = Object1;
				_g.set_x(_g.x + (Object2.x - Object2.last.x));
			}
		} else if(!obj2immovable) {
			var _g = Object2;
			_g.set_y(_g.y + overlap);
			Object2.velocity.set_y(obj1v - obj2v * Object2.elasticity);
			if(Object2.collisonXDrag && Object1.active && Object1.moves && obj1delta < obj2delta) {
				var _g = Object2;
				_g.set_x(_g.x + (Object1.x - Object1.last.x));
			}
		}
		return true;
	}
	return false;
};
flixel_FlxObject.updateTouchingFlagsY = function(Object1,Object2) {
	if(Object1.flixelType == 3) {
		var tilemap = Object1;
		return tilemap.overlapsWithCallback(Object2,flixel_FlxObject.updateTouchingFlagsY);
	}
	if(Object2.flixelType == 3) {
		var tilemap = Object2;
		return tilemap.overlapsWithCallback(Object1,flixel_FlxObject.updateTouchingFlagsY,true);
	}
	return flixel_FlxObject.computeOverlapY(Object1,Object2,false) != 0;
};
flixel_FlxObject.__super__ = flixel_FlxBasic;
flixel_FlxObject.prototype = $extend(flixel_FlxBasic.prototype,{
	x: null
	,y: null
	,width: null
	,height: null
	,pixelPerfectRender: null
	,pixelPerfectPosition: null
	,angle: null
	,moves: null
	,immovable: null
	,scrollFactor: null
	,velocity: null
	,acceleration: null
	,drag: null
	,maxVelocity: null
	,last: null
	,mass: null
	,elasticity: null
	,angularVelocity: null
	,angularAcceleration: null
	,angularDrag: null
	,maxAngular: null
	,health: null
	,touching: null
	,wasTouching: null
	,allowCollisions: null
	,collisonXDrag: null
	,path: null
	,_point: null
	,_rect: null
	,initVars: function() {
		this.flixelType = 1;
		var X = this.x;
		var Y = this.y;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		this.last = point;
		var X = 1;
		var Y = 1;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		this.scrollFactor = point;
		this.pixelPerfectPosition = flixel_FlxObject.defaultPixelPerfectPosition;
		var point = flixel_math_FlxPoint._pool.get().set(0,0);
		point._inPool = false;
		this.velocity = point;
		var point = flixel_math_FlxPoint._pool.get().set(0,0);
		point._inPool = false;
		this.acceleration = point;
		var point = flixel_math_FlxPoint._pool.get().set(0,0);
		point._inPool = false;
		this.drag = point;
		var X = 10000;
		var Y = 10000;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		this.maxVelocity = point;
	}
	,initMotionVars: function() {
		var point = flixel_math_FlxPoint._pool.get().set(0,0);
		point._inPool = false;
		this.velocity = point;
		var point = flixel_math_FlxPoint._pool.get().set(0,0);
		point._inPool = false;
		this.acceleration = point;
		var point = flixel_math_FlxPoint._pool.get().set(0,0);
		point._inPool = false;
		this.drag = point;
		var X = 10000;
		var Y = 10000;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		this.maxVelocity = point;
	}
	,destroy: function() {
		flixel_FlxBasic.prototype.destroy.call(this);
		this.velocity = flixel_util_FlxDestroyUtil.put(this.velocity);
		this.acceleration = flixel_util_FlxDestroyUtil.put(this.acceleration);
		this.drag = flixel_util_FlxDestroyUtil.put(this.drag);
		this.maxVelocity = flixel_util_FlxDestroyUtil.put(this.maxVelocity);
		this.scrollFactor = flixel_util_FlxDestroyUtil.put(this.scrollFactor);
		this.last = flixel_util_FlxDestroyUtil.put(this.last);
		this._point = flixel_util_FlxDestroyUtil.put(this._point);
		this._rect = flixel_util_FlxDestroyUtil.put(this._rect);
	}
	,update: function(elapsed) {
		this.last.set(this.x,this.y);
		if(this.path != null && this.path.active) {
			this.path.update(elapsed);
		}
		if(this.moves) {
			this.updateMotion(elapsed);
		}
		this.wasTouching = this.touching;
		this.touching = 0;
	}
	,updateMotion: function(elapsed) {
		var velocityDelta = 0.5 * (flixel_math_FlxVelocity.computeVelocity(this.angularVelocity,this.angularAcceleration,this.angularDrag,this.maxAngular,elapsed) - this.angularVelocity);
		this.angularVelocity += velocityDelta;
		var _g = this;
		_g.set_angle(_g.angle + this.angularVelocity * elapsed);
		this.angularVelocity += velocityDelta;
		velocityDelta = 0.5 * (flixel_math_FlxVelocity.computeVelocity(this.velocity.x,this.acceleration.x,this.drag.x,this.maxVelocity.x,elapsed) - this.velocity.x);
		var _g = this.velocity;
		_g.set_x(_g.x + velocityDelta);
		var delta = this.velocity.x * elapsed;
		var _g = this.velocity;
		_g.set_x(_g.x + velocityDelta);
		var _g = this;
		_g.set_x(_g.x + delta);
		velocityDelta = 0.5 * (flixel_math_FlxVelocity.computeVelocity(this.velocity.y,this.acceleration.y,this.drag.y,this.maxVelocity.y,elapsed) - this.velocity.y);
		var _g = this.velocity;
		_g.set_y(_g.y + velocityDelta);
		delta = this.velocity.y * elapsed;
		var _g = this.velocity;
		_g.set_y(_g.y + velocityDelta);
		var _g = this;
		_g.set_y(_g.y + delta);
	}
	,draw: function() {
	}
	,overlaps: function(ObjectOrGroup,InScreenSpace,Camera) {
		if(InScreenSpace == null) {
			InScreenSpace = false;
		}
		var group = flixel_group_FlxTypedGroup.resolveGroup(ObjectOrGroup);
		if(group != null) {
			return flixel_group_FlxTypedGroup.overlaps($bind(this,this.overlapsCallback),group,0,0,InScreenSpace,Camera);
		}
		if(ObjectOrGroup.flixelType == 3) {
			var tilemap = ObjectOrGroup;
			return tilemap.overlaps(this,InScreenSpace,Camera);
		}
		var object = ObjectOrGroup;
		if(!InScreenSpace) {
			if(object.x + object.get_width() > this.x && object.x < this.x + this.get_width() && object.y + object.get_height() > this.y) {
				return object.y < this.y + this.get_height();
			} else {
				return false;
			}
		}
		if(Camera == null) {
			Camera = flixel_FlxG.camera;
		}
		var objectScreenPos = object.getScreenPosition(null,Camera);
		this.getScreenPosition(this._point,Camera);
		if(objectScreenPos.x + object.get_width() > this._point.x && objectScreenPos.x < this._point.x + this.get_width() && objectScreenPos.y + object.get_height() > this._point.y) {
			return objectScreenPos.y < this._point.y + this.get_height();
		} else {
			return false;
		}
	}
	,overlapsCallback: function(ObjectOrGroup,X,Y,InScreenSpace,Camera) {
		return this.overlaps(ObjectOrGroup,InScreenSpace,Camera);
	}
	,overlapsAt: function(X,Y,ObjectOrGroup,InScreenSpace,Camera) {
		if(InScreenSpace == null) {
			InScreenSpace = false;
		}
		var group = flixel_group_FlxTypedGroup.resolveGroup(ObjectOrGroup);
		if(group != null) {
			return flixel_group_FlxTypedGroup.overlaps($bind(this,this.overlapsAtCallback),group,X,Y,InScreenSpace,Camera);
		}
		if(ObjectOrGroup.flixelType == 3) {
			var tilemap = ObjectOrGroup;
			return tilemap.overlapsAt(tilemap.x - (X - this.x),tilemap.y - (Y - this.y),this,InScreenSpace,Camera);
		}
		var object = ObjectOrGroup;
		if(!InScreenSpace) {
			if(object.x + object.get_width() > X && object.x < X + this.get_width() && object.y + object.get_height() > Y) {
				return object.y < Y + this.get_height();
			} else {
				return false;
			}
		}
		if(Camera == null) {
			Camera = flixel_FlxG.camera;
		}
		var objectScreenPos = object.getScreenPosition(null,Camera);
		this.getScreenPosition(this._point,Camera);
		if(objectScreenPos.x + object.get_width() > this._point.x && objectScreenPos.x < this._point.x + this.get_width() && objectScreenPos.y + object.get_height() > this._point.y) {
			return objectScreenPos.y < this._point.y + this.get_height();
		} else {
			return false;
		}
	}
	,overlapsAtCallback: function(ObjectOrGroup,X,Y,InScreenSpace,Camera) {
		return this.overlapsAt(X,Y,ObjectOrGroup,InScreenSpace,Camera);
	}
	,overlapsPoint: function(point,InScreenSpace,Camera) {
		if(InScreenSpace == null) {
			InScreenSpace = false;
		}
		if(!InScreenSpace) {
			if(point.x >= this.x && point.x < this.x + this.get_width() && point.y >= this.y) {
				return point.y < this.y + this.get_height();
			} else {
				return false;
			}
		}
		if(Camera == null) {
			Camera = flixel_FlxG.camera;
		}
		var xPos = point.x - Camera.scroll.x;
		var yPos = point.y - Camera.scroll.y;
		this.getScreenPosition(this._point,Camera);
		if(point._weak) {
			point.put();
		}
		if(xPos >= this._point.x && xPos < this._point.x + this.get_width() && yPos >= this._point.y) {
			return yPos < this._point.y + this.get_height();
		} else {
			return false;
		}
	}
	,inWorldBounds: function() {
		var tmp;
		if(this.x + this.get_width() > flixel_FlxG.worldBounds.x) {
			var _this = flixel_FlxG.worldBounds;
			tmp = this.x < _this.x + _this.width;
		} else {
			tmp = false;
		}
		if(tmp && this.y + this.get_height() > flixel_FlxG.worldBounds.y) {
			var _this = flixel_FlxG.worldBounds;
			return this.y < _this.y + _this.height;
		} else {
			return false;
		}
	}
	,getScreenPosition: function(point,Camera) {
		if(point == null) {
			var point1 = flixel_math_FlxPoint._pool.get().set(0,0);
			point1._inPool = false;
			point = point1;
		}
		if(Camera == null) {
			Camera = flixel_FlxG.camera;
		}
		point.set(this.x,this.y);
		if(this.pixelPerfectPosition) {
			point.set_x(Math.floor(point.x));
			point.set_y(Math.floor(point.y));
		}
		var X = Camera.scroll.x * this.scrollFactor.x;
		var Y = Camera.scroll.y * this.scrollFactor.y;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var _g = point;
		_g.set_x(_g.x - X);
		var _g = point;
		_g.set_y(_g.y - Y);
		return point;
	}
	,getPosition: function(point) {
		if(point == null) {
			var point1 = flixel_math_FlxPoint._pool.get().set(0,0);
			point1._inPool = false;
			point = point1;
		}
		return point.set(this.x,this.y);
	}
	,getMidpoint: function(point) {
		if(point == null) {
			var point1 = flixel_math_FlxPoint._pool.get().set(0,0);
			point1._inPool = false;
			point = point1;
		}
		return point.set(this.x + this.get_width() * 0.5,this.y + this.get_height() * 0.5);
	}
	,getHitbox: function(rect) {
		if(rect == null) {
			var _this = flixel_math_FlxRect._pool.get();
			var X = 0;
			var Y = 0;
			var Width = 0;
			var Height = 0;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			_this.x = X;
			_this.y = Y;
			_this.width = Width;
			_this.height = Height;
			var rect1 = _this;
			rect1._inPool = false;
			rect = rect1;
		}
		var X = this.x;
		var Y = this.y;
		var Width = this.get_width();
		var Height = this.get_height();
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		rect.x = X;
		rect.y = Y;
		rect.width = Width;
		rect.height = Height;
		return rect;
	}
	,reset: function(X,Y) {
		this.touching = 0;
		this.wasTouching = 0;
		this.setPosition(X,Y);
		this.last.set(this.x,this.y);
		this.velocity.set();
		this.revive();
	}
	,isOnScreen: function(Camera) {
		if(Camera == null) {
			Camera = flixel_FlxG.camera;
		}
		this.getScreenPosition(this._point,Camera);
		var point = this._point;
		var width = this.get_width();
		var height = this.get_height();
		if(height == null) {
			height = 0;
		}
		if(width == null) {
			width = 0;
		}
		if(point.x + width > Camera.viewOffsetX && point.x < Camera.viewOffsetWidth && point.y + height > Camera.viewOffsetY) {
			return point.y < Camera.viewOffsetHeight;
		} else {
			return false;
		}
	}
	,isPixelPerfectRender: function(Camera) {
		if(Camera == null) {
			Camera = flixel_FlxG.camera;
		}
		if(this.pixelPerfectRender == null) {
			return Camera.pixelPerfectRender;
		} else {
			return this.pixelPerfectRender;
		}
	}
	,isTouching: function(Direction) {
		return (this.touching & Direction) > 0;
	}
	,justTouched: function(Direction) {
		if((this.touching & Direction) > 0) {
			return (this.wasTouching & Direction) <= 0;
		} else {
			return false;
		}
	}
	,hurt: function(Damage) {
		this.health -= Damage;
		if(this.health <= 0) {
			this.kill();
		}
	}
	,screenCenter: function(axes) {
		if(axes == null) {
			axes = flixel_util_FlxAxes.XY;
		}
		if(axes != flixel_util_FlxAxes.Y) {
			this.set_x(flixel_FlxG.width / 2 - this.get_width() / 2);
		}
		if(axes != flixel_util_FlxAxes.X) {
			this.set_y(flixel_FlxG.height / 2 - this.get_height() / 2);
		}
		return this;
	}
	,setPosition: function(X,Y) {
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		this.set_x(X);
		this.set_y(Y);
	}
	,setSize: function(Width,Height) {
		this.set_width(Width);
		this.set_height(Height);
	}
	,getBoundingBox: function(camera) {
		this.getScreenPosition(this._point,camera);
		var _this = this._rect;
		var X = this._point.x;
		var Y = this._point.y;
		var Width = this.get_width();
		var Height = this.get_height();
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		this._rect = camera.transformRect(this._rect);
		if(this.isPixelPerfectRender(camera)) {
			var _this = this._rect;
			_this.x = Math.floor(_this.x);
			_this.y = Math.floor(_this.y);
			_this.width = Math.floor(_this.width);
			_this.height = Math.floor(_this.height);
		}
		return this._rect;
	}
	,toString: function() {
		var value = this.x;
		var _this = flixel_util_LabelValuePair._pool.get();
		_this.label = "x";
		_this.value = value;
		var value = this.y;
		var _this1 = flixel_util_LabelValuePair._pool.get();
		_this1.label = "y";
		_this1.value = value;
		var value = this.get_width();
		var _this2 = flixel_util_LabelValuePair._pool.get();
		_this2.label = "w";
		_this2.value = value;
		var value = this.get_height();
		var _this3 = flixel_util_LabelValuePair._pool.get();
		_this3.label = "h";
		_this3.value = value;
		var value = this.visible;
		var _this4 = flixel_util_LabelValuePair._pool.get();
		_this4.label = "visible";
		_this4.value = value;
		var value = this.velocity;
		var _this5 = flixel_util_LabelValuePair._pool.get();
		_this5.label = "velocity";
		_this5.value = value;
		return flixel_util_FlxStringUtil.getDebugString([_this,_this1,_this2,_this3,_this4,_this5]);
	}
	,set_x: function(NewX) {
		return this.x = NewX;
	}
	,set_y: function(NewY) {
		return this.y = NewY;
	}
	,set_width: function(Width) {
		return this.width = Width;
	}
	,set_height: function(Height) {
		return this.height = Height;
	}
	,get_width: function() {
		return this.width;
	}
	,get_height: function() {
		return this.height;
	}
	,get_solid: function() {
		return (this.allowCollisions & 4369) > 0;
	}
	,set_solid: function(Solid) {
		this.set_allowCollisions(Solid ? 4369 : 0);
		return Solid;
	}
	,set_angle: function(Value) {
		return this.angle = Value;
	}
	,set_moves: function(Value) {
		return this.moves = Value;
	}
	,set_immovable: function(Value) {
		return this.immovable = Value;
	}
	,set_pixelPerfectRender: function(Value) {
		return this.pixelPerfectRender = Value;
	}
	,set_allowCollisions: function(Value) {
		return this.allowCollisions = Value;
	}
	,set_path: function(path) {
		if(this.path == path) {
			return path;
		}
		if(this.path != null) {
			this.path.object = null;
		}
		if(path != null) {
			path.object = this;
		}
		return this.path = path;
	}
	,__class__: flixel_FlxObject
	,__properties__: $extend(flixel_FlxBasic.prototype.__properties__,{set_path:"set_path",set_allowCollisions:"set_allowCollisions",set_solid:"set_solid",get_solid:"get_solid",set_immovable:"set_immovable",set_moves:"set_moves",set_angle:"set_angle",set_pixelPerfectRender:"set_pixelPerfectRender",set_height:"set_height",get_height:"get_height",set_width:"set_width",get_width:"get_width",set_y:"set_y",set_x:"set_x"})
});
var flixel_FlxSprite = function(X,Y,SimpleGraphic) {
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	this._facingFlip = new haxe_ds_IntMap();
	this._angleChanged = true;
	this._cosAngle = 1;
	this._sinAngle = 0;
	this._facingVerticalMult = 1;
	this._facingHorizontalMult = 1;
	this.useColorTransform = false;
	this.color = 16777215;
	this.flipY = false;
	this.flipX = false;
	this.facing = 16;
	this.alpha = 1.0;
	this.bakedRotationAngle = 0;
	this.numFrames = 0;
	this.frameHeight = 0;
	this.frameWidth = 0;
	this.dirty = true;
	this.antialiasing = false;
	this.useFramePixels = true;
	flixel_FlxObject.call(this,X,Y);
	this.set_useFramePixels(flixel_FlxG.renderBlit);
	if(SimpleGraphic != null) {
		this.loadGraphic(SimpleGraphic);
	}
};
$hxClasses["flixel.FlxSprite"] = flixel_FlxSprite;
flixel_FlxSprite.__name__ = "flixel.FlxSprite";
flixel_FlxSprite.__super__ = flixel_FlxObject;
flixel_FlxSprite.prototype = $extend(flixel_FlxObject.prototype,{
	animation: null
	,framePixels: null
	,useFramePixels: null
	,antialiasing: null
	,dirty: null
	,frame: null
	,frameWidth: null
	,frameHeight: null
	,numFrames: null
	,frames: null
	,graphic: null
	,bakedRotationAngle: null
	,alpha: null
	,facing: null
	,flipX: null
	,flipY: null
	,origin: null
	,offset: null
	,scale: null
	,blend: null
	,color: null
	,colorTransform: null
	,useColorTransform: null
	,clipRect: null
	,shader: null
	,_frame: null
	,_frameGraphic: null
	,_facingHorizontalMult: null
	,_facingVerticalMult: null
	,_flashPoint: null
	,_flashRect: null
	,_flashRect2: null
	,_flashPointZero: null
	,_matrix: null
	,_halfSize: null
	,_sinAngle: null
	,_cosAngle: null
	,_angleChanged: null
	,_facingFlip: null
	,initVars: function() {
		flixel_FlxObject.prototype.initVars.call(this);
		this.animation = new flixel_animation_FlxAnimationController(this);
		this._flashPoint = new openfl_geom_Point();
		this._flashRect = new openfl_geom_Rectangle();
		this._flashRect2 = new openfl_geom_Rectangle();
		this._flashPointZero = new openfl_geom_Point();
		var point = flixel_math_FlxPoint._pool.get().set(0,0);
		point._inPool = false;
		this.offset = point;
		var point = flixel_math_FlxPoint._pool.get().set(0,0);
		point._inPool = false;
		this.origin = point;
		var X = 1;
		var Y = 1;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		this.scale = point;
		var point = flixel_math_FlxPoint._pool.get().set(0,0);
		point._inPool = false;
		this._halfSize = point;
		this._matrix = new flixel_math_FlxMatrix();
		this.colorTransform = new openfl_geom_ColorTransform();
	}
	,destroy: function() {
		flixel_FlxObject.prototype.destroy.call(this);
		this.animation = flixel_util_FlxDestroyUtil.destroy(this.animation);
		this.offset = flixel_util_FlxDestroyUtil.put(this.offset);
		this.origin = flixel_util_FlxDestroyUtil.put(this.origin);
		this.scale = flixel_util_FlxDestroyUtil.put(this.scale);
		this._halfSize = flixel_util_FlxDestroyUtil.put(this._halfSize);
		this.framePixels = flixel_util_FlxDestroyUtil.dispose(this.framePixels);
		this._flashPoint = null;
		this._flashRect = null;
		this._flashRect2 = null;
		this._flashPointZero = null;
		this._matrix = null;
		this.colorTransform = null;
		this.set_blend(null);
		this.set_frames(null);
		this.set_graphic(null);
		this._frame = flixel_util_FlxDestroyUtil.destroy(this._frame);
		this._frameGraphic = flixel_util_FlxDestroyUtil.destroy(this._frameGraphic);
		this.shader = null;
	}
	,clone: function() {
		return new flixel_FlxSprite().loadGraphicFromSprite(this);
	}
	,loadGraphicFromSprite: function(Sprite) {
		this.set_frames(Sprite.frames);
		this.bakedRotationAngle = Sprite.bakedRotationAngle;
		if(this.bakedRotationAngle > 0) {
			this.set_width(Sprite.get_width());
			this.set_height(Sprite.get_height());
			this.centerOffsets();
		}
		this.set_antialiasing(Sprite.antialiasing);
		this.animation.copyFrom(Sprite.animation);
		this.graphicLoaded();
		this.set_clipRect(Sprite.clipRect);
		return this;
	}
	,loadGraphic: function(Graphic,Animated,Width,Height,Unique,Key) {
		if(Unique == null) {
			Unique = false;
		}
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Animated == null) {
			Animated = false;
		}
		var graph = flixel_FlxG.bitmap.add(Graphic,Unique,Key);
		if(graph == null) {
			return this;
		}
		if(Width == 0) {
			Width = Animated ? graph.height : graph.width;
			if(Width > graph.width) {
				Width = graph.width;
			}
		}
		if(Height == 0) {
			Height = Animated ? Width : graph.height;
			if(Height > graph.height) {
				Height = graph.height;
			}
		}
		if(Animated) {
			var X = Width;
			var Y = Height;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			this.set_frames(flixel_graphics_frames_FlxTileFrames.fromGraphic(graph,point));
		} else {
			this.set_frames(graph.get_imageFrame());
		}
		return this;
	}
	,loadRotatedGraphic: function(Graphic,Rotations,Frame,AntiAliasing,AutoBuffer,Key) {
		if(AutoBuffer == null) {
			AutoBuffer = false;
		}
		if(AntiAliasing == null) {
			AntiAliasing = false;
		}
		if(Frame == null) {
			Frame = -1;
		}
		if(Rotations == null) {
			Rotations = 16;
		}
		var brushGraphic = flixel_FlxG.bitmap.add(Graphic,false,Key);
		if(brushGraphic == null) {
			return this;
		}
		var brush = brushGraphic.bitmap;
		var key = brushGraphic.key;
		if(Frame >= 0) {
			var brushSize = brush.height;
			var framesNum = brush.width / brushSize | 0;
			if(framesNum <= Frame) {
				Frame %= framesNum;
			}
			key += ":" + Frame;
			var full = brush;
			brush = new openfl_display_BitmapData(brushSize,brushSize,true,0);
			this._flashRect.setTo(Frame * brushSize,0,brushSize,brushSize);
			brush.copyPixels(full,this._flashRect,this._flashPointZero);
		}
		key += ":" + Rotations + ":" + (AutoBuffer == null ? "null" : "" + AutoBuffer);
		var tempGraph = flixel_FlxG.bitmap._cache.h[key];
		if(tempGraph == null) {
			var bitmap = flixel_util_FlxBitmapDataUtil.generateRotations(brush,Rotations,AntiAliasing,AutoBuffer);
			tempGraph = flixel_graphics_FlxGraphic.fromBitmapData(bitmap,false,key);
		}
		var max = brush.height > brush.width ? brush.height : brush.width;
		if(AutoBuffer) {
			max = max * 1.5 | 0;
		}
		var X = max;
		var Y = max;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		this.set_frames(flixel_graphics_frames_FlxTileFrames.fromGraphic(tempGraph,point));
		if(AutoBuffer) {
			this.set_width(brush.width);
			this.set_height(brush.height);
			this.centerOffsets();
		}
		this.bakedRotationAngle = 360 / Rotations;
		this.animation.createPrerotated();
		return this;
	}
	,loadRotatedFrame: function(Frame,Rotations,AntiAliasing,AutoBuffer) {
		if(AutoBuffer == null) {
			AutoBuffer = false;
		}
		if(AntiAliasing == null) {
			AntiAliasing = false;
		}
		if(Rotations == null) {
			Rotations = 16;
		}
		var key = Frame.parent.key;
		if(Frame.name != null) {
			key += ":" + Frame.name;
		} else {
			var _this = Frame.frame;
			var value = _this.x;
			var _this1 = flixel_util_LabelValuePair._pool.get();
			_this1.label = "x";
			_this1.value = value;
			var value = _this.y;
			var _this2 = flixel_util_LabelValuePair._pool.get();
			_this2.label = "y";
			_this2.value = value;
			var value = _this.width;
			var _this3 = flixel_util_LabelValuePair._pool.get();
			_this3.label = "w";
			_this3.value = value;
			var value = _this.height;
			var _this = flixel_util_LabelValuePair._pool.get();
			_this.label = "h";
			_this.value = value;
			key += ":" + flixel_util_FlxStringUtil.getDebugString([_this1,_this2,_this3,_this]);
		}
		var graphic = flixel_FlxG.bitmap._cache.h[key];
		if(graphic == null) {
			graphic = flixel_graphics_FlxGraphic.fromBitmapData(Frame.paint(),false,key);
		}
		return this.loadRotatedGraphic(graphic,Rotations,-1,AntiAliasing,AutoBuffer);
	}
	,makeGraphic: function(Width,Height,Color,Unique,Key) {
		if(Unique == null) {
			Unique = false;
		}
		if(Color == null) {
			Color = -1;
		}
		var graph = flixel_FlxG.bitmap.create(Width,Height,Color,Unique,Key);
		this.set_frames(graph.get_imageFrame());
		return this;
	}
	,graphicLoaded: function() {
	}
	,resetSize: function() {
		this._flashRect.x = 0;
		this._flashRect.y = 0;
		this._flashRect.width = this.frameWidth;
		this._flashRect.height = this.frameHeight;
	}
	,resetFrameSize: function() {
		if(this.frame != null) {
			this.frameWidth = this.frame.sourceSize.x | 0;
			this.frameHeight = this.frame.sourceSize.y | 0;
		}
		this._halfSize.set(0.5 * this.frameWidth,0.5 * this.frameHeight);
		this._flashRect.x = 0;
		this._flashRect.y = 0;
		this._flashRect.width = this.frameWidth;
		this._flashRect.height = this.frameHeight;
	}
	,resetSizeFromFrame: function() {
		this.set_width(this.frameWidth);
		this.set_height(this.frameHeight);
	}
	,resetFrame: function() {
		this.set_frame(this.frame);
	}
	,setGraphicSize: function(Width,Height) {
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Width <= 0 && Height <= 0) {
			return;
		}
		var newScaleX = Width / this.frameWidth;
		var newScaleY = Height / this.frameHeight;
		this.scale.set(newScaleX,newScaleY);
		if(Width <= 0) {
			this.scale.set_x(newScaleY);
		} else if(Height <= 0) {
			this.scale.set_y(newScaleX);
		}
	}
	,updateHitbox: function() {
		this.set_width(Math.abs(this.scale.x) * this.frameWidth);
		this.set_height(Math.abs(this.scale.y) * this.frameHeight);
		this.offset.set(-0.5 * (this.get_width() - this.frameWidth),-0.5 * (this.get_height() - this.frameHeight));
		this.origin.set(this.frameWidth * 0.5,this.frameHeight * 0.5);
	}
	,resetHelpers: function() {
		if(this.frame != null) {
			this.frameWidth = this.frame.sourceSize.x | 0;
			this.frameHeight = this.frame.sourceSize.y | 0;
		}
		this._halfSize.set(0.5 * this.frameWidth,0.5 * this.frameHeight);
		this._flashRect.x = 0;
		this._flashRect.y = 0;
		this._flashRect.width = this.frameWidth;
		this._flashRect.height = this.frameHeight;
		this.set_width(this.frameWidth);
		this.set_height(this.frameHeight);
		this._flashRect2.x = 0;
		this._flashRect2.y = 0;
		if(this.graphic != null) {
			this._flashRect2.width = this.graphic.width;
			this._flashRect2.height = this.graphic.height;
		}
		this.origin.set(this.frameWidth * 0.5,this.frameHeight * 0.5);
		if(flixel_FlxG.renderBlit) {
			this.dirty = true;
			this.updateFramePixels();
		}
	}
	,update: function(elapsed) {
		flixel_FlxObject.prototype.update.call(this,elapsed);
		this.updateAnimation(elapsed);
	}
	,updateAnimation: function(elapsed) {
		this.animation.update(elapsed);
	}
	,checkEmptyFrame: function() {
		if(this._frame == null) {
			this.loadGraphic("flixel/images/logo/default.png");
		}
	}
	,draw: function() {
		this.checkEmptyFrame();
		if(this.alpha == 0 || this._frame.type == 2) {
			return;
		}
		if(this.dirty) {
			this.calcFrame(this.useFramePixels);
		}
		var _g = 0;
		var _g1 = this.get_cameras();
		while(_g < _g1.length) {
			var camera = _g1[_g];
			++_g;
			if(!camera.visible || !camera.exists || !this.isOnScreen(camera)) {
				continue;
			}
			this.getScreenPosition(this._point,camera).subtractPoint(this.offset);
			if(this.isSimpleRender(camera)) {
				this.drawSimple(camera);
			} else {
				this.drawComplex(camera);
			}
		}
	}
	,drawSimple: function(camera) {
		if(this.isPixelPerfectRender(camera)) {
			var _this = this._point;
			_this.set_x(Math.floor(_this.x));
			_this.set_y(Math.floor(_this.y));
		}
		var _this = this._point;
		var FlashPoint = this._flashPoint;
		if(FlashPoint == null) {
			FlashPoint = new openfl_geom_Point();
		}
		FlashPoint.x = _this.x;
		FlashPoint.y = _this.y;
		camera.copyPixels(this._frame,this.framePixels,this._flashRect,this._flashPoint,this.colorTransform,this.blend,this.antialiasing);
	}
	,drawComplex: function(camera) {
		var doFlipX = this.flipX != this._frame.flipX;
		var doFlipY = this.flipY != this._frame.flipY;
		this._frame.prepareMatrix(this._matrix,0,this.animation._curAnim != null ? doFlipX != this.animation._curAnim.flipX : doFlipX,this.animation._curAnim != null ? doFlipY != this.animation._curAnim.flipY : doFlipY);
		this._matrix.translate(-this.origin.x,-this.origin.y);
		this._matrix.scale(this.scale.x,this.scale.y);
		if(this.bakedRotationAngle <= 0) {
			if(this._angleChanged) {
				var radians = this.angle * (Math.PI / 180);
				this._sinAngle = Math.sin(radians);
				this._cosAngle = Math.cos(radians);
				this._angleChanged = false;
			}
			if(this.angle != 0) {
				var _this = this._matrix;
				var cos = this._cosAngle;
				var sin = this._sinAngle;
				var a1 = _this.a * cos - _this.b * sin;
				_this.b = _this.a * sin + _this.b * cos;
				_this.a = a1;
				var c1 = _this.c * cos - _this.d * sin;
				_this.d = _this.c * sin + _this.d * cos;
				_this.c = c1;
				var tx1 = _this.tx * cos - _this.ty * sin;
				_this.ty = _this.tx * sin + _this.ty * cos;
				_this.tx = tx1;
			}
		}
		var _this = this._point;
		var X = this.origin.x;
		var Y = this.origin.y;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var _g = _this;
		_g.set_x(_g.x + X);
		var _g = _this;
		_g.set_y(_g.y + Y);
		this._matrix.translate(this._point.x,this._point.y);
		if(this.isPixelPerfectRender(camera)) {
			this._matrix.tx = Math.floor(this._matrix.tx);
			this._matrix.ty = Math.floor(this._matrix.ty);
		}
		camera.drawPixels(this._frame,this.framePixels,this._matrix,this.colorTransform,this.blend,this.antialiasing,this.shader);
	}
	,stamp: function(Brush,X,Y) {
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		Brush.drawFrame();
		if(this.graphic == null || Brush.graphic == null) {
			throw haxe_Exception.thrown("Cannot stamp to or from a FlxSprite with no graphics.");
		}
		var bitmapData = Brush.framePixels;
		if(this.isSimpleRenderBlit()) {
			this._flashPoint.x = X + this.frame.frame.x;
			this._flashPoint.y = Y + this.frame.frame.y;
			this._flashRect2.width = bitmapData.width;
			this._flashRect2.height = bitmapData.height;
			this.graphic.bitmap.copyPixels(bitmapData,this._flashRect2,this._flashPoint,null,null,true);
			this._flashRect2.width = this.graphic.bitmap.width;
			this._flashRect2.height = this.graphic.bitmap.height;
		} else {
			this._matrix.identity();
			this._matrix.translate(-Brush.origin.x,-Brush.origin.y);
			this._matrix.scale(Brush.scale.x,Brush.scale.y);
			if(Brush.angle != 0) {
				this._matrix.rotate(Brush.angle * (Math.PI / 180));
			}
			this._matrix.translate(X + this.frame.frame.x + Brush.origin.x,Y + this.frame.frame.y + Brush.origin.y);
			var brushBlend = Brush.blend;
			this.graphic.bitmap.draw(bitmapData,this._matrix,null,brushBlend,null,Brush.antialiasing);
		}
		if(flixel_FlxG.renderBlit) {
			this.dirty = true;
			this.calcFrame();
		}
	}
	,drawFrame: function(Force) {
		if(Force == null) {
			Force = false;
		}
		if(flixel_FlxG.renderBlit) {
			if(Force || this.dirty) {
				this.dirty = true;
				this.calcFrame();
			}
		} else {
			this.dirty = true;
			this.calcFrame(true);
		}
	}
	,centerOffsets: function(AdjustPosition) {
		if(AdjustPosition == null) {
			AdjustPosition = false;
		}
		this.offset.set_x((this.frameWidth - this.get_width()) * 0.5);
		this.offset.set_y((this.frameHeight - this.get_height()) * 0.5);
		if(AdjustPosition) {
			var _g = this;
			_g.set_x(_g.x + this.offset.x);
			var _g = this;
			_g.set_y(_g.y + this.offset.y);
		}
	}
	,centerOrigin: function() {
		this.origin.set(this.frameWidth * 0.5,this.frameHeight * 0.5);
	}
	,replaceColor: function(Color,NewColor,FetchPositions) {
		if(FetchPositions == null) {
			FetchPositions = false;
		}
		var positions = flixel_util_FlxBitmapDataUtil.replaceColor(this.graphic.bitmap,Color,NewColor,FetchPositions);
		if(positions != null) {
			this.dirty = true;
		}
		return positions;
	}
	,setColorTransform: function(redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier,redOffset,greenOffset,blueOffset,alphaOffset) {
		if(alphaOffset == null) {
			alphaOffset = 0;
		}
		if(blueOffset == null) {
			blueOffset = 0;
		}
		if(greenOffset == null) {
			greenOffset = 0;
		}
		if(redOffset == null) {
			redOffset = 0;
		}
		if(alphaMultiplier == null) {
			alphaMultiplier = 1.0;
		}
		if(blueMultiplier == null) {
			blueMultiplier = 1.0;
		}
		if(greenMultiplier == null) {
			greenMultiplier = 1.0;
		}
		if(redMultiplier == null) {
			redMultiplier = 1.0;
		}
		var color = flixel_util_FlxColor._new();
		var Alpha = 1;
		if(Alpha == null) {
			Alpha = 1;
		}
		var Value = Math.round(redMultiplier * 255);
		color &= -16711681;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(greenMultiplier * 255);
		color &= -65281;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(blueMultiplier * 255);
		color &= -256;
		color |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha * 255);
		color &= 16777215;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		this.set_color(color & 16777215);
		this.set_alpha(alphaMultiplier);
		flixel_util_FlxColorTransformUtil.setMultipliers(this.colorTransform,redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier);
		flixel_util_FlxColorTransformUtil.setOffsets(this.colorTransform,redOffset,greenOffset,blueOffset,alphaOffset);
		this.useColorTransform = this.alpha != 1 || this.color != 16777215 || flixel_util_FlxColorTransformUtil.hasRGBOffsets(this.colorTransform);
		this.dirty = true;
	}
	,updateColorTransform: function() {
		if(this.colorTransform == null) {
			this.colorTransform = new openfl_geom_ColorTransform();
		}
		this.useColorTransform = this.alpha != 1 || this.color != 16777215;
		if(this.useColorTransform) {
			flixel_util_FlxColorTransformUtil.setMultipliers(this.colorTransform,(this.color >> 16 & 255) / 255,(this.color >> 8 & 255) / 255,(this.color & 255) / 255,this.alpha);
		} else {
			flixel_util_FlxColorTransformUtil.setMultipliers(this.colorTransform,1,1,1,1);
		}
		this.dirty = true;
	}
	,pixelsOverlapPoint: function(point,Mask,Camera) {
		if(Mask == null) {
			Mask = 255;
		}
		if(Camera == null) {
			Camera = flixel_FlxG.camera;
		}
		this.getScreenPosition(this._point,Camera);
		this._point.subtractPoint(this.offset);
		this._flashPoint.x = point.x - Camera.scroll.x - this._point.x;
		this._flashPoint.y = point.y - Camera.scroll.y - this._point.y;
		if(point._weak) {
			point.put();
		}
		if(this._flashPoint.x < 0 || this._flashPoint.x > this.frameWidth || this._flashPoint.y < 0 || this._flashPoint.y > this.frameHeight) {
			return false;
		} else {
			var frameData = this.updateFramePixels();
			var pixelColor = frameData.getPixel32(this._flashPoint.x | 0,this._flashPoint.y | 0);
			return (pixelColor >> 24 & 255) * this.alpha >= Mask;
		}
	}
	,calcFrame: function(RunOnCpp) {
		if(RunOnCpp == null) {
			RunOnCpp = false;
		}
		this.checkEmptyFrame();
		if(flixel_FlxG.renderTile && !RunOnCpp) {
			return;
		}
		this.updateFramePixels();
	}
	,updateFramePixels: function() {
		if(this._frame == null || !this.dirty) {
			return this.framePixels;
		}
		if(flixel_FlxG.renderTile && this._frameGraphic != null) {
			this.dirty = false;
			return this.framePixels;
		}
		var doFlipX = this.flipX != this._frame.flipX;
		var doFlipX1 = this.animation._curAnim != null ? doFlipX != this.animation._curAnim.flipX : doFlipX;
		var doFlipY = this.flipY != this._frame.flipY;
		var doFlipY1 = this.animation._curAnim != null ? doFlipY != this.animation._curAnim.flipY : doFlipY;
		if(!doFlipX1 && !doFlipY1 && this._frame.type == 0) {
			this.framePixels = this._frame.paint(this.framePixels,this._flashPointZero,false,true);
		} else {
			this.framePixels = this._frame.paintRotatedAndFlipped(this.framePixels,this._flashPointZero,0,doFlipX1,doFlipY1,false,true);
		}
		if(this.useColorTransform) {
			this.framePixels.colorTransform(this._flashRect,this.colorTransform);
		}
		if(flixel_FlxG.renderTile && this.useFramePixels) {
			this._frameGraphic = flixel_util_FlxDestroyUtil.destroy(this._frameGraphic);
			this._frameGraphic = flixel_graphics_FlxGraphic.fromBitmapData(this.framePixels,false,null,false);
			this._frame = this._frameGraphic.get_imageFrame().get_frame().copyTo(this._frame);
		}
		this.dirty = false;
		return this.framePixels;
	}
	,getGraphicMidpoint: function(point) {
		if(point == null) {
			var point1 = flixel_math_FlxPoint._pool.get().set(0,0);
			point1._inPool = false;
			point = point1;
		}
		return point.set(this.x + this.frameWidth * 0.5,this.y + this.frameHeight * 0.5);
	}
	,isOnScreen: function(Camera) {
		if(Camera == null) {
			Camera = flixel_FlxG.camera;
		}
		var minX = this.x - this.offset.x - Camera.scroll.x * this.scrollFactor.x;
		var minY = this.y - this.offset.y - Camera.scroll.y * this.scrollFactor.y;
		if((this.angle == 0 || this.bakedRotationAngle > 0) && this.scale.x == 1 && this.scale.y == 1) {
			this._point.set(minX,minY);
			var point = this._point;
			var width = this.frameWidth;
			var height = this.frameHeight;
			if(height == null) {
				height = 0;
			}
			if(width == null) {
				width = 0;
			}
			if(point.x + width > Camera.viewOffsetX && point.x < Camera.viewOffsetWidth && point.y + height > Camera.viewOffsetY) {
				return point.y < Camera.viewOffsetHeight;
			} else {
				return false;
			}
		}
		var radiusX = this._halfSize.x;
		var radiusY = this._halfSize.y;
		var ox = this.origin.x;
		if(ox != radiusX) {
			var x1 = Math.abs(ox);
			var x2 = Math.abs(this.frameWidth - ox);
			radiusX = Math.max(x2,x1);
		}
		var oy = this.origin.y;
		if(oy != radiusY) {
			var y1 = Math.abs(oy);
			var y2 = Math.abs(this.frameHeight - oy);
			radiusY = Math.max(y2,y1);
		}
		radiusX *= Math.abs(this.scale.x);
		radiusY *= Math.abs(this.scale.y);
		var radius = Math.max(radiusX,radiusY);
		radius *= 1.41421356237;
		minX += ox - radius;
		minY += oy - radius;
		var doubleRadius = 2 * radius;
		this._point.set(minX,minY);
		var point = this._point;
		var width = doubleRadius;
		var height = doubleRadius;
		if(height == null) {
			height = 0;
		}
		if(width == null) {
			width = 0;
		}
		if(point.x + width > Camera.viewOffsetX && point.x < Camera.viewOffsetWidth && point.y + height > Camera.viewOffsetY) {
			return point.y < Camera.viewOffsetHeight;
		} else {
			return false;
		}
	}
	,isSimpleRender: function(camera) {
		if(flixel_FlxG.renderTile) {
			return false;
		}
		return this.isSimpleRenderBlit(camera);
	}
	,isSimpleRenderBlit: function(camera) {
		var result = (this.angle == 0 || this.bakedRotationAngle > 0) && this.scale.x == 1 && this.scale.y == 1 && this.blend == null;
		result = result && (camera != null ? this.isPixelPerfectRender(camera) : this.pixelPerfectRender);
		return result;
	}
	,setFacingFlip: function(Direction,FlipX,FlipY) {
		this._facingFlip.h[Direction] = { x : FlipX, y : FlipY};
	}
	,setFrames: function(Frames,saveAnimations) {
		if(saveAnimations == null) {
			saveAnimations = true;
		}
		if(saveAnimations) {
			var animations = this.animation._animations;
			var reverse = false;
			var index = 0;
			var frameIndex = this.animation.frameIndex;
			var currName = null;
			if(this.animation._curAnim != null) {
				reverse = this.animation._curAnim.reversed;
				index = this.animation._curAnim.curFrame;
				currName = this.animation._curAnim.name;
			}
			this.animation._animations = null;
			this.set_frames(Frames);
			this.set_frame(this.frames.frames[frameIndex]);
			this.animation._animations = animations;
			if(currName != null) {
				this.animation.play(currName,false,reverse,index);
			}
		} else {
			this.set_frames(Frames);
		}
		return this;
	}
	,get_pixels: function() {
		if(this.graphic == null) {
			return null;
		} else {
			return this.graphic.bitmap;
		}
	}
	,set_pixels: function(Pixels) {
		var key = flixel_FlxG.bitmap.findKeyForBitmap(Pixels);
		if(key == null) {
			key = flixel_FlxG.bitmap.getUniqueKey();
			this.set_graphic(flixel_FlxG.bitmap.add(Pixels,false,key));
		} else {
			this.set_graphic(flixel_FlxG.bitmap._cache.h[key]);
		}
		this.set_frames(this.graphic.get_imageFrame());
		return Pixels;
	}
	,set_frame: function(Value) {
		this.frame = Value;
		if(this.frame != null) {
			if(this.frame != null) {
				this.frameWidth = this.frame.sourceSize.x | 0;
				this.frameHeight = this.frame.sourceSize.y | 0;
			}
			this._halfSize.set(0.5 * this.frameWidth,0.5 * this.frameHeight);
			this._flashRect.x = 0;
			this._flashRect.y = 0;
			this._flashRect.width = this.frameWidth;
			this._flashRect.height = this.frameHeight;
			this.dirty = true;
		} else if(this.frames != null && this.frames.frames != null && this.numFrames > 0) {
			this.frame = this.frames.frames[0];
			this.dirty = true;
		} else {
			return null;
		}
		if(flixel_FlxG.renderTile) {
			this._frameGraphic = flixel_util_FlxDestroyUtil.destroy(this._frameGraphic);
		}
		if(this.clipRect != null) {
			this._frame = this.frame.clipTo(this.clipRect,this._frame);
		} else {
			this._frame = this.frame.copyTo(this._frame);
		}
		return this.frame;
	}
	,set_facing: function(Direction) {
		var flip = this._facingFlip.h[Direction];
		if(flip != null) {
			this.set_flipX(flip.x);
			this.set_flipY(flip.y);
		}
		return this.facing = Direction;
	}
	,set_alpha: function(Alpha) {
		if(this.alpha == Alpha) {
			return Alpha;
		}
		var lowerBound = Alpha < 0 ? 0 : Alpha;
		this.alpha = lowerBound > 1 ? 1 : lowerBound;
		this.updateColorTransform();
		return this.alpha;
	}
	,set_color: function(Color) {
		if(this.color == Color) {
			return Color;
		}
		this.color = Color;
		this.updateColorTransform();
		return this.color;
	}
	,set_angle: function(Value) {
		var newAngle = this.angle != Value;
		var ret = flixel_FlxObject.prototype.set_angle.call(this,Value);
		if(newAngle) {
			this._angleChanged = true;
			this.animation.update(0);
		}
		return ret;
	}
	,updateTrig: function() {
		if(this._angleChanged) {
			var radians = this.angle * (Math.PI / 180);
			this._sinAngle = Math.sin(radians);
			this._cosAngle = Math.cos(radians);
			this._angleChanged = false;
		}
	}
	,set_blend: function(Value) {
		return this.blend = Value;
	}
	,set_graphic: function(Value) {
		var oldGraphic = this.graphic;
		if(this.graphic != Value && Value != null) {
			var _g = Value;
			_g.set_useCount(_g.get_useCount() + 1);
		}
		if(oldGraphic != null && oldGraphic != Value) {
			var _g = oldGraphic;
			_g.set_useCount(_g.get_useCount() - 1);
		}
		return this.graphic = Value;
	}
	,set_clipRect: function(rect) {
		if(rect != null) {
			rect.x = Math.round(rect.x);
			rect.y = Math.round(rect.y);
			rect.width = Math.round(rect.width);
			rect.height = Math.round(rect.height);
			this.clipRect = rect;
		} else {
			this.clipRect = null;
		}
		if(this.frames != null) {
			this.set_frame(this.frames.frames[this.animation.frameIndex]);
		}
		return rect;
	}
	,set_frames: function(Frames) {
		if(this.animation != null) {
			this.animation.destroyAnimations();
		}
		if(Frames != null) {
			this.set_graphic(Frames.parent);
			this.frames = Frames;
			this.set_frame(this.frames.frames[0]);
			this.numFrames = this.frames.frames.length;
			this.resetHelpers();
			this.bakedRotationAngle = 0;
			this.animation.set_frameIndex(0);
			this.graphicLoaded();
		} else {
			this.frames = null;
			this.set_frame(null);
			this.set_graphic(null);
		}
		return Frames;
	}
	,set_flipX: function(Value) {
		if(flixel_FlxG.renderTile) {
			this._facingHorizontalMult = Value ? -1 : 1;
		}
		this.dirty = this.flipX != Value || this.dirty;
		return this.flipX = Value;
	}
	,set_flipY: function(Value) {
		if(flixel_FlxG.renderTile) {
			this._facingVerticalMult = Value ? -1 : 1;
		}
		this.dirty = this.flipY != Value || this.dirty;
		return this.flipY = Value;
	}
	,set_antialiasing: function(value) {
		return this.antialiasing = value;
	}
	,set_useFramePixels: function(value) {
		if(flixel_FlxG.renderTile) {
			if(value != this.useFramePixels) {
				this.useFramePixels = value;
				this.set_frame(this.frame);
				if(value) {
					this.updateFramePixels();
				}
			}
			return value;
		} else {
			this.useFramePixels = true;
			return true;
		}
	}
	,checkFlipX: function() {
		var doFlipX = this.flipX != this._frame.flipX;
		if(this.animation._curAnim != null) {
			return doFlipX != this.animation._curAnim.flipX;
		}
		return doFlipX;
	}
	,checkFlipY: function() {
		var doFlipY = this.flipY != this._frame.flipY;
		if(this.animation._curAnim != null) {
			return doFlipY != this.animation._curAnim.flipY;
		}
		return doFlipY;
	}
	,__class__: flixel_FlxSprite
	,__properties__: $extend(flixel_FlxObject.prototype.__properties__,{set_clipRect:"set_clipRect",set_color:"set_color",set_blend:"set_blend",set_flipY:"set_flipY",set_flipX:"set_flipX",set_facing:"set_facing",set_alpha:"set_alpha",set_graphic:"set_graphic",set_frames:"set_frames",set_frame:"set_frame",set_pixels:"set_pixels",get_pixels:"get_pixels",set_antialiasing:"set_antialiasing",set_useFramePixels:"set_useFramePixels"})
});
var AttackAnim = function() {
	flixel_FlxSprite.call(this);
	this.loadGraphic("assets/images/combat_effects.png",true,8,8);
	this.animation.add("physhit",[2,1,0,0],12,false);
	this.animation.add("maghit",[5,4,3,3],12,false);
	this.animation.add("physblock",[6,7,6,7],12,false);
	this.animation.add("magblock",[9,10,11,12],12,false);
	this.set_visible(false);
};
$hxClasses["AttackAnim"] = AttackAnim;
AttackAnim.__name__ = "AttackAnim";
AttackAnim.__super__ = flixel_FlxSprite;
AttackAnim.prototype = $extend(flixel_FlxSprite.prototype,{
	playEffect: function(Effect) {
		this.set_visible(true);
		this.animation.play(Effect,true);
	}
	,update: function(elapsed) {
		this.set_visible(!this.animation.get_finished());
		flixel_FlxSprite.prototype.update.call(this,elapsed);
	}
	,__class__: AttackAnim
});
var Barrier = function() {
	flixel_FlxSprite.call(this);
	this.loadGraphic("assets/images/barrier.png",true,6,16);
	this.animation.add("hit",[1,2,0],12,false);
	this.kill();
};
$hxClasses["Barrier"] = Barrier;
Barrier.__name__ = "Barrier";
Barrier.__super__ = flixel_FlxSprite;
Barrier.prototype = $extend(flixel_FlxSprite.prototype,{
	hurt: function(Damage) {
		flixel_FlxSprite.prototype.hurt.call(this,Damage);
		if(this.alive) {
			this.animation.play("hit");
		}
	}
	,__class__: Barrier
});
var Block = function() {
	this.skull = false;
	this.isPotion = false;
	this.isNew = false;
	this.baseX = -1;
	this.baseY = -1;
	this.shifting = false;
	this.falling = false;
	this.matchedY = false;
	this.matchedX = false;
	this.isMatched = false;
	flixel_FlxSprite.call(this);
	this.loadGraphic("assets/images/monsters.png",true,8,8);
};
$hxClasses["Block"] = Block;
Block.__name__ = "Block";
Block.__super__ = flixel_FlxSprite;
Block.prototype = $extend(flixel_FlxSprite.prototype,{
	isMatched: null
	,matchedX: null
	,matchedY: null
	,falling: null
	,shifting: null
	,baseY: null
	,baseX: null
	,isNew: null
	,isPotion: null
	,skull: null
	,set_falling: function(Value) {
		if(Value) {
			this.baseY = this.y;
		}
		this.falling = Value;
		return this.falling;
	}
	,set_shifting: function(Value) {
		if(Value) {
			this.baseX = this.x;
		}
		this.shifting = Value;
		return this.shifting;
	}
	,revive: function() {
		flixel_FlxSprite.prototype.revive.call(this);
		this.set_isPotion(this.set_skull(this.isMatched = this.matchedX = this.matchedY = this.set_falling(this.set_shifting(false))));
		this.baseY = this.baseX = -1;
	}
	,set_isPotion: function(Value) {
		if(this.isPotion != Value) {
			this.isPotion = Value;
		}
		if(this.isPotion) {
			this.set_skull(false);
			this.animation.set_frameIndex(40);
		}
		return this.isPotion;
	}
	,draw: function() {
		if(this.isPotion) {
			this.animation.set_frameIndex(40 + flixel_FlxG.game.ticks / 250 % 7 | 0);
		}
		flixel_FlxSprite.prototype.draw.call(this);
	}
	,set_skull: function(Value) {
		if(this.skull != Value) {
			this.skull = Value;
			if(this.skull) {
				this.animation.set_frameIndex(47);
			}
		}
		return this.skull;
	}
	,__class__: Block
	,__properties__: $extend(flixel_FlxSprite.prototype.__properties__,{set_skull:"set_skull",set_isPotion:"set_isPotion",set_shifting:"set_shifting",set_falling:"set_falling"})
});
var flixel_text_FlxBitmapText = function(font) {
	this.pendingPixelsChange = true;
	this.pendingTextBitmapChange = true;
	this.pendingTextChange = true;
	this.multiLine = true;
	this.backgroundColor = 0;
	this.background = false;
	this.borderQuality = 0;
	this.borderSize = 1;
	this.borderColor = -16777216;
	this.borderStyle = flixel_text_FlxTextBorderStyle.NONE;
	this.useTextColor = false;
	this.textColor = -1;
	this.numSpacesInTab = 4;
	this.padding = 0;
	this.autoSize = true;
	this.wrapByWord = true;
	this.wordWrap = true;
	this.autoUpperCase = false;
	this.letterSpacing = 0;
	this.lineSpacing = 0;
	this.alignment = "left";
	this._linesWidth = [];
	this._lines = [];
	this._colorParams = new openfl_geom_ColorTransform();
	this.text = "";
	flixel_FlxSprite.call(this);
	this.set_width(this.set_fieldWidth(2));
	this.set_alpha(1);
	this.set_font(font == null ? flixel_graphics_frames_FlxBitmapFont.getDefaultFont() : font);
	var X = 1;
	var Y = 1;
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	var point = flixel_math_FlxPoint._pool.get().set(X,Y);
	point._inPool = false;
	this.shadowOffset = point;
	if(flixel_FlxG.renderBlit) {
		this.set_pixels(new openfl_display_BitmapData(1,1,true,0));
	} else {
		this.textData = [];
		this.textDrawData = [];
		this.borderDrawData = [];
	}
};
$hxClasses["flixel.text.FlxBitmapText"] = flixel_text_FlxBitmapText;
flixel_text_FlxBitmapText.__name__ = "flixel.text.FlxBitmapText";
flixel_text_FlxBitmapText.__super__ = flixel_FlxSprite;
flixel_text_FlxBitmapText.prototype = $extend(flixel_FlxSprite.prototype,{
	font: null
	,text: null
	,_colorParams: null
	,_lines: null
	,_linesWidth: null
	,alignment: null
	,lineSpacing: null
	,letterSpacing: null
	,autoUpperCase: null
	,wordWrap: null
	,wrapByWord: null
	,autoSize: null
	,padding: null
	,numSpacesInTab: null
	,textColor: null
	,useTextColor: null
	,borderStyle: null
	,borderColor: null
	,borderSize: null
	,borderQuality: null
	,shadowOffset: null
	,background: null
	,backgroundColor: null
	,multiLine: null
	,_fieldWidth: null
	,pendingTextChange: null
	,pendingTextBitmapChange: null
	,pendingPixelsChange: null
	,textData: null
	,textDrawData: null
	,borderDrawData: null
	,textBitmap: null
	,destroy: function() {
		this.set_font(null);
		this.set_text(null);
		this._lines = null;
		this._linesWidth = null;
		this.shadowOffset = flixel_util_FlxDestroyUtil.put(this.shadowOffset);
		this.textBitmap = flixel_util_FlxDestroyUtil.dispose(this.textBitmap);
		this._colorParams = null;
		if(flixel_FlxG.renderTile) {
			this.textData = null;
			this.textDrawData = null;
			this.borderDrawData = null;
		}
		flixel_FlxSprite.prototype.destroy.call(this);
	}
	,drawFrame: function(Force) {
		if(Force == null) {
			Force = false;
		}
		if(flixel_FlxG.renderTile) {
			Force = true;
		}
		this.pendingTextBitmapChange = this.pendingTextBitmapChange || Force;
		var useTiles = false;
		if(useTiles == null) {
			useTiles = false;
		}
		if(flixel_FlxG.renderBlit) {
			useTiles = false;
		}
		if(this.pendingTextChange) {
			this.updateText();
			this.pendingTextBitmapChange = true;
		}
		if(this.pendingTextBitmapChange) {
			this.updateTextBitmap(useTiles);
			this.pendingPixelsChange = true;
		}
		if(this.pendingPixelsChange) {
			this.updatePixels(useTiles);
		}
		if(flixel_FlxG.renderBlit) {
			flixel_FlxSprite.prototype.drawFrame.call(this,Force);
		}
	}
	,checkPendingChanges: function(useTiles) {
		if(useTiles == null) {
			useTiles = false;
		}
		if(flixel_FlxG.renderBlit) {
			useTiles = false;
		}
		if(this.pendingTextChange) {
			this.updateText();
			this.pendingTextBitmapChange = true;
		}
		if(this.pendingTextBitmapChange) {
			this.updateTextBitmap(useTiles);
			this.pendingPixelsChange = true;
		}
		if(this.pendingPixelsChange) {
			this.updatePixels(useTiles);
		}
	}
	,draw: function() {
		if(flixel_FlxG.renderBlit) {
			var useTiles = false;
			if(useTiles == null) {
				useTiles = false;
			}
			if(flixel_FlxG.renderBlit) {
				useTiles = false;
			}
			if(this.pendingTextChange) {
				this.updateText();
				this.pendingTextBitmapChange = true;
			}
			if(this.pendingTextBitmapChange) {
				this.updateTextBitmap(useTiles);
				this.pendingPixelsChange = true;
			}
			if(this.pendingPixelsChange) {
				this.updatePixels(useTiles);
			}
			flixel_FlxSprite.prototype.draw.call(this);
		} else {
			var useTiles = true;
			if(useTiles == null) {
				useTiles = false;
			}
			if(flixel_FlxG.renderBlit) {
				useTiles = false;
			}
			if(this.pendingTextChange) {
				this.updateText();
				this.pendingTextBitmapChange = true;
			}
			if(this.pendingTextBitmapChange) {
				this.updateTextBitmap(useTiles);
				this.pendingPixelsChange = true;
			}
			if(this.pendingPixelsChange) {
				this.updatePixels(useTiles);
			}
			var textLength = this.textDrawData.length / 3 | 0;
			var borderLength = this.borderDrawData.length / 3 | 0;
			var dataPos;
			var cr = (this.color >> 16 & 255) / 255;
			var cg = (this.color >> 8 & 255) / 255;
			var cb = (this.color & 255) / 255;
			var borderRed = (this.borderColor >> 16 & 255) / 255 * cr;
			var borderGreen = (this.borderColor >> 8 & 255) / 255 * cg;
			var borderBlue = (this.borderColor & 255) / 255 * cb;
			var bAlpha = (this.borderColor >> 24 & 255) / 255 * this.alpha;
			var textRed = cr;
			var textGreen = cg;
			var textBlue = cb;
			var tAlpha = this.alpha;
			if(this.useTextColor) {
				textRed *= (this.textColor >> 16 & 255) / 255;
				textGreen *= (this.textColor >> 8 & 255) / 255;
				textBlue *= (this.textColor & 255) / 255;
				tAlpha *= this.textColor >> 24 & 255;
			}
			var bgRed = cr;
			var bgGreen = cg;
			var bgBlue = cb;
			var bgAlpha = this.alpha;
			if(this.background) {
				bgRed *= (this.backgroundColor >> 16 & 255) / 255;
				bgGreen *= (this.backgroundColor >> 8 & 255) / 255;
				bgBlue *= (this.backgroundColor & 255) / 255;
				bgAlpha *= (this.backgroundColor >> 24 & 255) / 255;
			}
			var drawItem;
			var currFrame = null;
			var currTileX = 0;
			var currTileY = 0;
			var sx = this.scale.x * this._facingHorizontalMult;
			var sy = this.scale.y * this._facingVerticalMult;
			var ox = this.origin.x;
			var oy = this.origin.y;
			if(this._facingHorizontalMult != 1) {
				ox = this.frameWidth - ox;
			}
			if(this._facingVerticalMult != 1) {
				oy = this.frameHeight - oy;
			}
			var clippedFrameRect;
			if(this.clipRect != null) {
				var clippedFrameRect1 = this.clipRect;
				var X = 0;
				var Y = 0;
				var Width = this.frameWidth;
				var Height = this.frameHeight;
				if(Height == null) {
					Height = 0;
				}
				if(Width == null) {
					Width = 0;
				}
				if(Y == null) {
					Y = 0;
				}
				if(X == null) {
					X = 0;
				}
				var X1 = X;
				var Y1 = Y;
				var Width1 = Width;
				var Height1 = Height;
				if(Height1 == null) {
					Height1 = 0;
				}
				if(Width1 == null) {
					Width1 = 0;
				}
				if(Y1 == null) {
					Y1 = 0;
				}
				if(X1 == null) {
					X1 = 0;
				}
				var _this = flixel_math_FlxRect._pool.get();
				var X = X1;
				var Y = Y1;
				var Width = Width1;
				var Height = Height1;
				if(Height == null) {
					Height = 0;
				}
				if(Width == null) {
					Width = 0;
				}
				if(Y == null) {
					Y = 0;
				}
				if(X == null) {
					X = 0;
				}
				_this.x = X;
				_this.y = Y;
				_this.width = Width;
				_this.height = Height;
				var rect = _this;
				rect._inPool = false;
				var rect1 = rect;
				rect1._weak = true;
				clippedFrameRect = clippedFrameRect1.intersection(rect1);
				if(clippedFrameRect.width == 0 || clippedFrameRect.height == 0) {
					return;
				}
			} else {
				var X = 0;
				var Y = 0;
				var Width = this.frameWidth;
				var Height = this.frameHeight;
				if(Height == null) {
					Height = 0;
				}
				if(Width == null) {
					Width = 0;
				}
				if(Y == null) {
					Y = 0;
				}
				if(X == null) {
					X = 0;
				}
				var _this = flixel_math_FlxRect._pool.get();
				var X1 = X;
				var Y1 = Y;
				var Width1 = Width;
				var Height1 = Height;
				if(Height1 == null) {
					Height1 = 0;
				}
				if(Width1 == null) {
					Width1 = 0;
				}
				if(Y1 == null) {
					Y1 = 0;
				}
				if(X1 == null) {
					X1 = 0;
				}
				_this.x = X1;
				_this.y = Y1;
				_this.width = Width1;
				_this.height = Height1;
				var rect = _this;
				rect._inPool = false;
				clippedFrameRect = rect;
			}
			var _g = 0;
			var _g1 = this.get_cameras();
			while(_g < _g1.length) {
				var camera = _g1[_g];
				++_g;
				if(!camera.visible || !camera.exists || !this.isOnScreen(camera)) {
					continue;
				}
				this.getScreenPosition(this._point,camera).subtractPoint(this.offset);
				if(this.isPixelPerfectRender(camera)) {
					var _this = this._point;
					_this.set_x(Math.floor(_this.x));
					_this.set_y(Math.floor(_this.y));
				}
				if(this._angleChanged) {
					var radians = this.angle * (Math.PI / 180);
					this._sinAngle = Math.sin(radians);
					this._cosAngle = Math.cos(radians);
					this._angleChanged = false;
				}
				if(this.background) {
					currFrame = flixel_FlxG.bitmap.get_whitePixel();
					this._matrix.identity();
					this._matrix.scale(0.1 * clippedFrameRect.width,0.1 * clippedFrameRect.height);
					this._matrix.translate(clippedFrameRect.x - ox,clippedFrameRect.y - oy);
					this._matrix.scale(sx,sy);
					if(this.angle != 0) {
						var _this1 = this._matrix;
						var cos = this._cosAngle;
						var sin = this._sinAngle;
						var a1 = _this1.a * cos - _this1.b * sin;
						_this1.b = _this1.a * sin + _this1.b * cos;
						_this1.a = a1;
						var c1 = _this1.c * cos - _this1.d * sin;
						_this1.d = _this1.c * sin + _this1.d * cos;
						_this1.c = c1;
						var tx1 = _this1.tx * cos - _this1.ty * sin;
						_this1.ty = _this1.tx * sin + _this1.ty * cos;
						_this1.tx = tx1;
					}
					this._matrix.translate(this._point.x + ox,this._point.y + oy);
					flixel_util_FlxColorTransformUtil.setMultipliers(this._colorParams,bgRed,bgGreen,bgBlue,bgAlpha);
					camera.drawPixels(currFrame,null,this._matrix,this._colorParams,this.blend,this.antialiasing);
				}
				var hasColorOffsets = this.colorTransform != null && flixel_util_FlxColorTransformUtil.hasRGBAOffsets(this.colorTransform);
				drawItem = camera.startQuadBatch(this.font.parent,true,hasColorOffsets,this.blend,this.antialiasing,this.shader);
				var _g2 = 0;
				var _g3 = borderLength;
				while(_g2 < _g3) {
					var j = _g2++;
					dataPos = j * 3;
					currFrame = this.font.charMap.h[this.borderDrawData[dataPos] | 0];
					currTileX = this.borderDrawData[dataPos + 1];
					currTileY = this.borderDrawData[dataPos + 2];
					if(this.clipRect != null) {
						var Rect = this.clipRect;
						clippedFrameRect.x = Rect.x;
						clippedFrameRect.y = Rect.y;
						clippedFrameRect.width = Rect.width;
						clippedFrameRect.height = Rect.height;
						if(Rect._weak) {
							if(!Rect._inPool) {
								Rect._inPool = true;
								Rect._weak = false;
								flixel_math_FlxRect._pool.putUnsafe(Rect);
							}
						}
						var _this2 = clippedFrameRect;
						_this2.x += -currTileX;
						_this2.y += -currTileY;
						currFrame = currFrame.clipTo(clippedFrameRect);
					}
					currFrame.prepareMatrix(this._matrix);
					this._matrix.translate(currTileX - ox,currTileY - oy);
					this._matrix.scale(sx,sy);
					if(this.angle != 0) {
						var _this3 = this._matrix;
						var cos1 = this._cosAngle;
						var sin1 = this._sinAngle;
						var a11 = _this3.a * cos1 - _this3.b * sin1;
						_this3.b = _this3.a * sin1 + _this3.b * cos1;
						_this3.a = a11;
						var c11 = _this3.c * cos1 - _this3.d * sin1;
						_this3.d = _this3.c * sin1 + _this3.d * cos1;
						_this3.c = c11;
						var tx11 = _this3.tx * cos1 - _this3.ty * sin1;
						_this3.ty = _this3.tx * sin1 + _this3.ty * cos1;
						_this3.tx = tx11;
					}
					this._matrix.translate(this._point.x + ox,this._point.y + oy);
					flixel_util_FlxColorTransformUtil.setMultipliers(this._colorParams,borderRed,borderGreen,borderBlue,bAlpha);
					drawItem.addQuad(currFrame,this._matrix,this._colorParams);
				}
				var _g4 = 0;
				var _g5 = textLength;
				while(_g4 < _g5) {
					var j1 = _g4++;
					dataPos = j1 * 3;
					currFrame = this.font.charMap.h[this.textDrawData[dataPos] | 0];
					currTileX = this.textDrawData[dataPos + 1];
					currTileY = this.textDrawData[dataPos + 2];
					if(this.clipRect != null) {
						var Rect1 = this.clipRect;
						clippedFrameRect.x = Rect1.x;
						clippedFrameRect.y = Rect1.y;
						clippedFrameRect.width = Rect1.width;
						clippedFrameRect.height = Rect1.height;
						if(Rect1._weak) {
							if(!Rect1._inPool) {
								Rect1._inPool = true;
								Rect1._weak = false;
								flixel_math_FlxRect._pool.putUnsafe(Rect1);
							}
						}
						var _this4 = clippedFrameRect;
						_this4.x += -currTileX;
						_this4.y += -currTileY;
						currFrame = currFrame.clipTo(clippedFrameRect);
					}
					currFrame.prepareMatrix(this._matrix);
					this._matrix.translate(currTileX - ox,currTileY - oy);
					this._matrix.scale(sx,sy);
					if(this.angle != 0) {
						var _this5 = this._matrix;
						var cos2 = this._cosAngle;
						var sin2 = this._sinAngle;
						var a12 = _this5.a * cos2 - _this5.b * sin2;
						_this5.b = _this5.a * sin2 + _this5.b * cos2;
						_this5.a = a12;
						var c12 = _this5.c * cos2 - _this5.d * sin2;
						_this5.d = _this5.c * sin2 + _this5.d * cos2;
						_this5.c = c12;
						var tx12 = _this5.tx * cos2 - _this5.ty * sin2;
						_this5.ty = _this5.tx * sin2 + _this5.ty * cos2;
						_this5.tx = tx12;
					}
					this._matrix.translate(this._point.x + ox,this._point.y + oy);
					flixel_util_FlxColorTransformUtil.setMultipliers(this._colorParams,textRed,textGreen,textBlue,tAlpha);
					drawItem.addQuad(currFrame,this._matrix,this._colorParams);
				}
			}
			if(!clippedFrameRect._inPool) {
				clippedFrameRect._inPool = true;
				clippedFrameRect._weak = false;
				flixel_math_FlxRect._pool.putUnsafe(clippedFrameRect);
			}
		}
	}
	,set_clipRect: function(Rect) {
		flixel_FlxSprite.prototype.set_clipRect.call(this,Rect);
		if(!flixel_FlxG.renderBlit) {
			this.pendingTextBitmapChange = true;
		}
		return this.clipRect;
	}
	,set_color: function(Color) {
		flixel_FlxSprite.prototype.set_color.call(this,Color);
		if(flixel_FlxG.renderBlit) {
			this.pendingTextBitmapChange = true;
		}
		return this.color;
	}
	,set_alpha: function(value) {
		flixel_FlxSprite.prototype.set_alpha.call(this,value);
		if(flixel_FlxG.renderBlit) {
			this.pendingTextBitmapChange = true;
		}
		return value;
	}
	,set_textColor: function(value) {
		if(this.textColor != value) {
			this.textColor = value;
			if(flixel_FlxG.renderBlit) {
				this.pendingPixelsChange = true;
			}
		}
		return value;
	}
	,set_useTextColor: function(value) {
		if(this.useTextColor != value) {
			this.useTextColor = value;
			if(flixel_FlxG.renderBlit) {
				this.pendingPixelsChange = true;
			}
		}
		return value;
	}
	,calcFrame: function(RunOnCpp) {
		if(RunOnCpp == null) {
			RunOnCpp = false;
		}
		if(flixel_FlxG.renderTile) {
			this.drawFrame(RunOnCpp);
		} else {
			flixel_FlxSprite.prototype.calcFrame.call(this,RunOnCpp);
		}
	}
	,set_text: function(value) {
		if(value != this.text) {
			this.text = value;
			this.pendingTextChange = true;
		}
		return value;
	}
	,updateText: function() {
		var tmp = this.autoUpperCase ? this.text.toUpperCase() : this.text;
		this._lines = tmp.split("\n");
		if(!this.autoSize) {
			if(this.wordWrap) {
				this.wrap();
			} else {
				this.cutLines();
			}
		}
		if(!this.multiLine) {
			this._lines = [this._lines[0]];
		}
		var numLines = this._lines.length;
		var _g = 0;
		var _g1 = numLines;
		while(_g < _g1) {
			var i = _g++;
			this._lines[i] = StringTools.rtrim(this._lines[i]);
		}
		this.pendingTextChange = false;
		this.pendingTextBitmapChange = true;
	}
	,computeTextSize: function() {
		var txtWidth = this.get_textWidth() + (this.borderSize | 0) * 2;
		var txtHeight = this.get_textHeight() + 2 * this.padding + (this.borderSize | 0) * 2;
		if(this.autoSize) {
			txtWidth += 2 * this.padding;
		} else {
			txtWidth = this.get_fieldWidth();
		}
		this.frameWidth = txtWidth == 0 ? 1 : txtWidth;
		this.frameHeight = txtHeight == 0 ? 1 : txtHeight;
	}
	,getLineWidth: function(lineIndex) {
		if(lineIndex < 0 || lineIndex >= this._lines.length) {
			return 0;
		}
		return this.getStringWidth(this._lines[lineIndex]);
	}
	,getStringWidth: function(str) {
		var spaceWidth = this.font.spaceWidth;
		var tabWidth = spaceWidth * this.numSpacesInTab;
		var lineLength = UnicodeString.get_length(str);
		var lineWidth = this.font.minOffsetX;
		var charCode;
		var charWidth;
		var charFrame;
		var _g = 0;
		var _g1 = lineLength;
		while(_g < _g1) {
			var c = _g++;
			charCode = UnicodeString.charCodeAt(str,c);
			charWidth = 0;
			if(charCode == 32) {
				charWidth = spaceWidth;
			} else if(charCode == 9) {
				charWidth = tabWidth;
			} else if(this.font.charMap.h.hasOwnProperty(charCode)) {
				var _this = this.font;
				charWidth = _this.charAdvance.h.hasOwnProperty(charCode) ? _this.charAdvance.h[charCode] : 0;
				if(c == lineLength - 1) {
					charFrame = this.font.charMap.h[charCode];
					charWidth = charFrame.sourceSize.x | 0;
				}
			}
			lineWidth += charWidth + this.letterSpacing;
		}
		if(lineLength > 0) {
			lineWidth -= this.letterSpacing;
		}
		return lineWidth | 0;
	}
	,cutLines: function() {
		var newLines = [];
		var lineLength;
		var c;
		var charCode;
		var charWidth;
		var this1 = "";
		var subLine = this1;
		var subLineWidth;
		var spaceWidth = this.font.spaceWidth;
		var tabWidth = spaceWidth * this.numSpacesInTab;
		var startX = this.font.minOffsetX;
		var _g = 0;
		var _g1 = this._lines;
		while(_g < _g1.length) {
			var line = _g1[_g];
			++_g;
			lineLength = UnicodeString.get_length(line);
			var this1 = "";
			subLine = this1;
			subLineWidth = startX;
			c = 0;
			while(c < lineLength) {
				charCode = UnicodeString.charCodeAt(line,c);
				if(charCode == 32) {
					charWidth = spaceWidth;
				} else if(charCode == 9) {
					charWidth = tabWidth;
				} else {
					var _this = this.font;
					charWidth = _this.charAdvance.h.hasOwnProperty(charCode) ? _this.charAdvance.h[charCode] : 0;
				}
				charWidth += this.letterSpacing;
				if(subLineWidth + charWidth > this._fieldWidth - 2 * this.padding) {
					var s = subLine + String.fromCodePoint(charCode);
					if(s == null) {
						s = "";
					}
					var this2 = s;
					subLine = this2;
					newLines.push(subLine);
					var this3 = "";
					subLine = this3;
					subLineWidth = startX;
					c = lineLength;
				} else {
					var s1 = subLine + String.fromCodePoint(charCode);
					if(s1 == null) {
						s1 = "";
					}
					var this4 = s1;
					subLine = this4;
					subLineWidth += charWidth;
				}
				++c;
			}
		}
		this._lines = newLines;
	}
	,wrap: function() {
		var newLines = [];
		var words;
		var _g = 0;
		var _g1 = this._lines;
		while(_g < _g1.length) {
			var line = _g1[_g];
			++_g;
			words = [];
			this.splitLineIntoWords(line,words);
			if(this.wrapByWord) {
				this.wrapLineByWord(words,newLines);
			} else {
				this.wrapLineByCharacter(words,newLines);
			}
		}
		this._lines = newLines;
	}
	,splitLineIntoWords: function(line,words) {
		var word = "";
		var this1 = "";
		var wordUtf8 = this1;
		var isSpaceWord = false;
		var lineLength = UnicodeString.get_length(line);
		var c = 0;
		var charCode;
		while(c < lineLength) {
			charCode = UnicodeString.charCodeAt(line,c);
			word = wordUtf8;
			if(charCode == 32 || charCode == 9) {
				if(!isSpaceWord) {
					isSpaceWord = true;
					if(word != "") {
						words.push(word);
						var this1 = "";
						wordUtf8 = this1;
					}
				}
				var s = wordUtf8 + String.fromCodePoint(charCode);
				if(s == null) {
					s = "";
				}
				var this2 = s;
				wordUtf8 = this2;
			} else if(charCode == 45) {
				if(isSpaceWord && word != "") {
					isSpaceWord = false;
					words.push(word);
					words.push("-");
				} else if(!isSpaceWord) {
					var this3 = "";
					var charUtf8 = this3;
					var s1 = charUtf8 + String.fromCodePoint(charCode);
					if(s1 == null) {
						s1 = "";
					}
					var this4 = s1;
					charUtf8 = this4;
					words.push(word + charUtf8);
				}
				var this5 = "";
				wordUtf8 = this5;
			} else {
				if(isSpaceWord && word != "") {
					isSpaceWord = false;
					words.push(word);
					var this6 = "";
					wordUtf8 = this6;
				}
				var s2 = wordUtf8 + String.fromCodePoint(charCode);
				if(s2 == null) {
					s2 = "";
				}
				var this7 = s2;
				wordUtf8 = this7;
			}
			++c;
		}
		word = wordUtf8;
		if(word != "") {
			words.push(word);
		}
	}
	,wrapLineByWord: function(words,newLines) {
		var numWords = words.length;
		var w;
		var word;
		var wordWidth;
		var wordLength;
		var isSpaceWord = false;
		var charCode;
		var charWidth = 0;
		var subLines = [];
		var subLine;
		var subLineWidth;
		var spaceWidth = this.font.spaceWidth;
		var tabWidth = spaceWidth * this.numSpacesInTab;
		var startX = this.font.minOffsetX;
		if(numWords > 0) {
			w = 0;
			subLineWidth = startX;
			subLine = "";
			while(w < numWords) {
				wordWidth = 0;
				word = words[w];
				wordLength = UnicodeString.get_length(word);
				charCode = HxOverrides.cca(word,0);
				isSpaceWord = charCode == 32 || charCode == 9;
				var _g = 0;
				var _g1 = wordLength;
				while(_g < _g1) {
					var c = _g++;
					charCode = HxOverrides.cca(word,c);
					if(charCode == 32) {
						charWidth = spaceWidth;
					} else if(charCode == 9) {
						charWidth = tabWidth;
					} else {
						var _this = this.font;
						charWidth = _this.charAdvance.h.hasOwnProperty(charCode) ? _this.charAdvance.h[charCode] : 0;
					}
					wordWidth += charWidth;
				}
				wordWidth += (wordLength - 1) * this.letterSpacing;
				if(subLineWidth + wordWidth > this._fieldWidth - 2 * this.padding) {
					if(isSpaceWord) {
						subLines.push(subLine);
						subLine = "";
						subLineWidth = startX;
					} else if(subLine != "") {
						subLines.push(subLine);
						subLine = word;
						subLineWidth = startX + wordWidth + this.letterSpacing;
					} else {
						subLine = word;
						subLineWidth = startX + wordWidth + this.letterSpacing;
					}
				} else {
					subLine += word;
					subLineWidth += wordWidth + this.letterSpacing;
				}
				++w;
			}
			if(subLine != "") {
				subLines.push(subLine);
			}
		}
		var _g = 0;
		while(_g < subLines.length) {
			var subline = subLines[_g];
			++_g;
			newLines.push(subline);
		}
	}
	,wrapLineByCharacter: function(words,newLines) {
		var numWords = words.length;
		var w;
		var word;
		var wordLength;
		var isSpaceWord = false;
		var charCode;
		var c;
		var charWidth = 0;
		var subLines = [];
		var subLine;
		var subLineUtf8;
		var subLineWidth;
		var spaceWidth = this.font.spaceWidth;
		var tabWidth = spaceWidth * this.numSpacesInTab;
		var startX = this.font.minOffsetX;
		if(numWords > 0) {
			w = 0;
			subLineWidth = startX;
			var this1 = "";
			subLineUtf8 = this1;
			while(w < numWords) {
				word = words[w];
				wordLength = UnicodeString.get_length(word);
				charCode = UnicodeString.charCodeAt(word,0);
				isSpaceWord = charCode == 32 || charCode == 9;
				c = 0;
				while(c < wordLength) {
					charCode = UnicodeString.charCodeAt(word,c);
					if(charCode == 32) {
						charWidth = spaceWidth;
					} else if(charCode == 9) {
						charWidth = tabWidth;
					} else {
						var _this = this.font;
						charWidth = _this.charAdvance.h.hasOwnProperty(charCode) ? _this.charAdvance.h[charCode] : 0;
					}
					if(subLineWidth + charWidth > this._fieldWidth - 2 * this.padding) {
						subLine = subLineUtf8;
						if(isSpaceWord) {
							subLines.push(subLine);
							c = wordLength;
							var this1 = "";
							subLineUtf8 = this1;
							subLineWidth = startX;
						} else if(subLine != "") {
							subLines.push(subLine);
							var this2 = "";
							subLineUtf8 = this2;
							var s = subLineUtf8 + String.fromCodePoint(charCode);
							if(s == null) {
								s = "";
							}
							var this3 = s;
							subLineUtf8 = this3;
							subLineWidth = startX + charWidth + this.letterSpacing;
						} else {
							var this4 = "";
							subLineUtf8 = this4;
							var s1 = subLineUtf8 + String.fromCodePoint(charCode);
							if(s1 == null) {
								s1 = "";
							}
							var this5 = s1;
							subLineUtf8 = this5;
							subLineWidth = startX + charWidth + this.letterSpacing;
						}
					} else {
						var s2 = subLineUtf8 + String.fromCodePoint(charCode);
						if(s2 == null) {
							s2 = "";
						}
						var this6 = s2;
						subLineUtf8 = this6;
						subLineWidth += charWidth + this.letterSpacing;
					}
					++c;
				}
				++w;
			}
			subLine = subLineUtf8;
			if(subLine != "") {
				subLines.push(subLine);
			}
		}
		var _g = 0;
		while(_g < subLines.length) {
			var subline = subLines[_g];
			++_g;
			newLines.push(subline);
		}
	}
	,updateTextBitmap: function(useTiles) {
		if(useTiles == null) {
			useTiles = false;
		}
		this.computeTextSize();
		if(flixel_FlxG.renderBlit) {
			useTiles = false;
		}
		if(!useTiles) {
			this.textBitmap = flixel_util_FlxDestroyUtil.disposeIfNotEqual(this.textBitmap,this.frameWidth,this.frameHeight);
			if(this.textBitmap == null) {
				this.textBitmap = new openfl_display_BitmapData(this.frameWidth,this.frameHeight,true,0);
			} else {
				this.textBitmap.fillRect(this.textBitmap.rect,0);
			}
			this.textBitmap.lock();
		} else if(flixel_FlxG.renderTile) {
			this.textData.splice(0,this.textData.length);
		}
		this._fieldWidth = this.frameWidth;
		var numLines = this._lines.length;
		var line;
		var lineWidth;
		var ox;
		var oy;
		var _g = 0;
		var _g1 = numLines;
		while(_g < _g1) {
			var i = _g++;
			line = this._lines[i];
			lineWidth = this._linesWidth[i];
			ox = this.font.minOffsetX;
			oy = i * (this.font.lineHeight + this.lineSpacing) + this.padding;
			if(this.alignment == "center") {
				ox += (this.frameWidth - lineWidth) / 2 | 0;
			} else if(this.alignment == "right") {
				ox += this.frameWidth - lineWidth - this.padding;
			} else {
				ox += this.padding;
			}
			this.drawLine(i,ox,oy,useTiles);
		}
		if(!useTiles) {
			this.textBitmap.unlock();
		}
		this.pendingTextBitmapChange = false;
	}
	,drawLine: function(lineIndex,posX,posY,useTiles) {
		if(useTiles == null) {
			useTiles = false;
		}
		if(flixel_FlxG.renderBlit) {
			useTiles = false;
		}
		if(useTiles) {
			this.tileLine(lineIndex,posX,posY);
		} else {
			this.blitLine(lineIndex,posX,posY);
		}
	}
	,blitLine: function(lineIndex,startX,startY) {
		var charFrame;
		var charCode;
		var curX = startX;
		var curY = startY;
		var line = this._lines[lineIndex];
		var spaceWidth = this.font.spaceWidth;
		var lineLength = UnicodeString.get_length(line);
		var textWidth = this.get_textWidth();
		if(this.alignment == "justify") {
			var numSpaces = 0;
			var _g = 0;
			var _g1 = lineLength;
			while(_g < _g1) {
				var i = _g++;
				charCode = UnicodeString.charCodeAt(line,i);
				if(charCode == 32) {
					++numSpaces;
				} else if(charCode == 9) {
					numSpaces += this.numSpacesInTab;
				}
			}
			var lineWidth = this.getStringWidth(line);
			var totalSpacesWidth = numSpaces * this.font.spaceWidth;
			spaceWidth = (textWidth - lineWidth + totalSpacesWidth) / numSpaces | 0;
		}
		var tabWidth = spaceWidth * this.numSpacesInTab;
		var charUt8;
		var _g = 0;
		var _g1 = lineLength;
		while(_g < _g1) {
			var i = _g++;
			charCode = UnicodeString.charCodeAt(line,i);
			if(charCode == 32) {
				curX += spaceWidth + this.letterSpacing;
			} else if(charCode == 9) {
				curX += tabWidth + this.letterSpacing;
			} else {
				charFrame = this.font.charMap.h[charCode];
				if(charFrame != null) {
					if(this.isUnicodeComboMark(charCode)) {
						var _this = this.font;
						this._flashPoint.setTo(curX - (_this.charAdvance.h.hasOwnProperty(charCode) ? _this.charAdvance.h[charCode] : 0) - this.letterSpacing,curY);
					} else {
						this._flashPoint.setTo(curX,curY);
						var _this1 = this.font;
						curX += (_this1.charAdvance.h.hasOwnProperty(charCode) ? _this1.charAdvance.h[charCode] : 0) + this.letterSpacing;
					}
					charFrame.paint(this.textBitmap,this._flashPoint,true);
					var this1 = "";
					charUt8 = this1;
					var s = charUt8 + String.fromCodePoint(charCode);
					if(s == null) {
						s = "";
					}
					var this2 = s;
					charUt8 = this2;
				}
			}
		}
	}
	,tileLine: function(lineIndex,startX,startY) {
		if(!flixel_FlxG.renderTile) {
			return;
		}
		var charFrame;
		var pos = this.textData.length;
		var charCode;
		var curX = startX;
		var curY = startY;
		var line = this._lines[lineIndex];
		var spaceWidth = this.font.spaceWidth;
		var lineLength = UnicodeString.get_length(line);
		var textWidth = this.get_textWidth();
		if(this.alignment == "justify") {
			var numSpaces = 0;
			var _g = 0;
			var _g1 = lineLength;
			while(_g < _g1) {
				var i = _g++;
				charCode = UnicodeString.charCodeAt(line,i);
				if(charCode == 32) {
					++numSpaces;
				} else if(charCode == 9) {
					numSpaces += this.numSpacesInTab;
				}
			}
			var lineWidth = this.getStringWidth(line);
			var totalSpacesWidth = numSpaces * this.font.spaceWidth;
			spaceWidth = (textWidth - lineWidth + totalSpacesWidth) / numSpaces | 0;
		}
		var tabWidth = spaceWidth * this.numSpacesInTab;
		var _g = 0;
		var _g1 = lineLength;
		while(_g < _g1) {
			var i = _g++;
			charCode = UnicodeString.charCodeAt(line,i);
			if(charCode == 32) {
				curX += spaceWidth + this.letterSpacing;
			} else if(charCode == 9) {
				curX += tabWidth + this.letterSpacing;
			} else {
				charFrame = this.font.charMap.h[charCode];
				if(charFrame != null) {
					this.textData[pos++] = charCode;
					if(this.isUnicodeComboMark(charCode)) {
						var _this = this.font;
						this.textData[pos++] = curX - (_this.charAdvance.h.hasOwnProperty(charCode) ? _this.charAdvance.h[charCode] : 0) - this.letterSpacing;
					} else {
						this.textData[pos++] = curX;
						var _this1 = this.font;
						curX += (_this1.charAdvance.h.hasOwnProperty(charCode) ? _this1.charAdvance.h[charCode] : 0) + this.letterSpacing;
					}
					this.textData[pos++] = curY;
				}
			}
		}
	}
	,updatePixels: function(useTiles) {
		if(useTiles == null) {
			useTiles = false;
		}
		var colorForFill = this.background ? this.backgroundColor : 0;
		var bitmap = null;
		if(flixel_FlxG.renderBlit) {
			if(this.get_pixels() == null || (this.frameWidth != this.get_pixels().width || this.frameHeight != this.get_pixels().height)) {
				this.set_pixels(new openfl_display_BitmapData(this.frameWidth,this.frameHeight,true,colorForFill));
			} else {
				this.get_pixels().fillRect(this.graphic.bitmap.rect,colorForFill);
			}
			bitmap = this.get_pixels();
		} else {
			if(!useTiles) {
				if(this.framePixels == null || (this.frameWidth != this.framePixels.width || this.frameHeight != this.framePixels.height)) {
					this.framePixels = flixel_util_FlxDestroyUtil.dispose(this.framePixels);
					this.framePixels = new openfl_display_BitmapData(this.frameWidth,this.frameHeight,true,colorForFill);
				} else {
					this.framePixels.fillRect(this.framePixels.rect,colorForFill);
				}
				bitmap = this.framePixels;
			} else {
				this.textDrawData.splice(0,this.textDrawData.length);
				this.borderDrawData.splice(0,this.borderDrawData.length);
			}
			this.set_width(this.frameWidth);
			this.set_height(this.frameHeight);
			this.origin.set_x(this.frameWidth * 0.5);
			this.origin.set_y(this.frameHeight * 0.5);
		}
		if(!useTiles) {
			bitmap.lock();
		}
		var isFront = false;
		var iterations = this.borderSize * this.borderQuality | 0;
		if(iterations <= 0) {
			iterations = 1;
		}
		var delta = this.borderSize / iterations | 0;
		var iterationsX = 1;
		var iterationsY = 1;
		var deltaX = 1;
		var deltaY = 1;
		if(this.borderStyle == flixel_text_FlxTextBorderStyle.SHADOW) {
			iterationsX = Math.round(Math.abs(this.shadowOffset.x) * this.borderQuality);
			if(iterationsX <= 0) {
				iterationsX = 1;
			}
			iterationsY = Math.round(Math.abs(this.shadowOffset.y) * this.borderQuality);
			if(iterationsY <= 0) {
				iterationsY = 1;
			}
			deltaX = Math.round(this.shadowOffset.x / iterationsX);
			deltaY = Math.round(this.shadowOffset.y / iterationsY);
		}
		switch(this.borderStyle._hx_index) {
		case 0:
			break;
		case 1:
			var _g = 0;
			var _g1 = iterationsY;
			while(_g < _g1) {
				var iterY = _g++;
				var _g2 = 0;
				var _g3 = iterationsX;
				while(_g2 < _g3) {
					var iterX = _g2++;
					this.drawText(deltaX * (iterX + 1),deltaY * (iterY + 1),isFront,bitmap,useTiles);
				}
			}
			break;
		case 2:
			var itd = 0;
			var _g = 0;
			var _g1 = iterations;
			while(_g < _g1) {
				var iter = _g++;
				itd = delta * (iter + 1);
				this.drawText(-itd,-itd,isFront,bitmap,useTiles);
				this.drawText(0,-itd,isFront,bitmap,useTiles);
				this.drawText(itd,-itd,isFront,bitmap,useTiles);
				this.drawText(-itd,0,isFront,bitmap,useTiles);
				this.drawText(itd,0,isFront,bitmap,useTiles);
				this.drawText(-itd,itd,isFront,bitmap,useTiles);
				this.drawText(0,itd,isFront,bitmap,useTiles);
				this.drawText(itd,itd,isFront,bitmap,useTiles);
			}
			break;
		case 3:
			var itd = 0;
			var _g = 0;
			var _g1 = iterations;
			while(_g < _g1) {
				var iter = _g++;
				itd = delta * (iter + 1);
				this.drawText(-itd,-itd,isFront,bitmap,useTiles);
				this.drawText(itd,-itd,isFront,bitmap,useTiles);
				this.drawText(-itd,itd,isFront,bitmap,useTiles);
				this.drawText(itd,itd,isFront,bitmap,useTiles);
			}
			break;
		}
		isFront = true;
		this.drawText(0,0,isFront,bitmap,useTiles);
		if(!useTiles) {
			bitmap.unlock();
		}
		if(flixel_FlxG.renderBlit) {
			this.dirty = true;
		}
		this.pendingPixelsChange = false;
	}
	,drawText: function(posX,posY,isFront,bitmap,useTiles) {
		if(useTiles == null) {
			useTiles = false;
		}
		if(isFront == null) {
			isFront = true;
		}
		if(flixel_FlxG.renderBlit) {
			useTiles = false;
		}
		if(useTiles) {
			this.tileText(posX,posY,isFront);
		} else {
			this.blitText(posX,posY,isFront,bitmap);
		}
	}
	,blitText: function(posX,posY,isFront,bitmap) {
		if(isFront == null) {
			isFront = true;
		}
		this._matrix.identity();
		this._matrix.translate(posX,posY);
		var colorToApply = -1;
		if(isFront && this.useTextColor) {
			colorToApply = this.textColor;
		} else if(!isFront) {
			colorToApply = this.borderColor;
		}
		flixel_util_FlxColorTransformUtil.setMultipliers(this._colorParams,(colorToApply >> 16 & 255) / 255,(colorToApply >> 8 & 255) / 255,(colorToApply & 255) / 255,(colorToApply >> 24 & 255) / 255);
		if(isFront && !this.useTextColor) {
			this._flashRect.setTo(0,0,this.textBitmap.width,this.textBitmap.height);
			bitmap.copyPixels(this.textBitmap,this._flashRect,this._flashPointZero,null,null,true);
		} else {
			bitmap.draw(this.textBitmap,this._matrix,this._colorParams);
		}
	}
	,tileText: function(posX,posY,isFront) {
		if(isFront == null) {
			isFront = true;
		}
		if(!flixel_FlxG.renderTile) {
			return;
		}
		var data = isFront ? this.textDrawData : this.borderDrawData;
		var pos = data.length;
		var textPos;
		var textLen = this.textData.length / 3 | 0;
		var _this = flixel_math_FlxRect._pool.get();
		var X = 0;
		var Y = 0;
		var Width = 0;
		var Height = 0;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		var rect = _this;
		rect._inPool = false;
		var rect1 = rect;
		var frameVisible;
		var _g = 0;
		var _g1 = textLen;
		while(_g < _g1) {
			var i = _g++;
			textPos = 3 * i;
			frameVisible = true;
			if(this.clipRect != null) {
				var Rect = this.clipRect;
				rect1.x = Rect.x;
				rect1.y = Rect.y;
				rect1.width = Rect.width;
				rect1.height = Rect.height;
				if(Rect._weak) {
					if(!Rect._inPool) {
						Rect._inPool = true;
						Rect._weak = false;
						flixel_math_FlxRect._pool.putUnsafe(Rect);
					}
				}
				var _this = rect1;
				var dy = -this.textData[textPos + 2] - posY;
				_this.x += -this.textData[textPos + 1] - posX;
				_this.y += dy;
				frameVisible = this.font.charMap.h[this.textData[textPos] | 0].clipTo(rect1).type != 2;
			}
			if(frameVisible) {
				data[pos++] = this.textData[textPos];
				data[pos++] = this.textData[textPos + 1] + posX;
				data[pos++] = this.textData[textPos + 2] + posY;
			}
		}
		if(!rect1._inPool) {
			rect1._inPool = true;
			rect1._weak = false;
			flixel_math_FlxRect._pool.putUnsafe(rect1);
		}
	}
	,setBorderStyle: function(Style,Color,Size,Quality) {
		if(Quality == null) {
			Quality = 1;
		}
		if(Size == null) {
			Size = 1;
		}
		if(Color == null) {
			Color = 0;
		}
		this.set_borderStyle(Style);
		this.set_borderColor(Color);
		this.set_borderSize(Size);
		this.set_borderQuality(Quality);
		if(this.borderStyle == flixel_text_FlxTextBorderStyle.SHADOW) {
			this.shadowOffset.set(this.borderSize,this.borderSize);
		}
		this.pendingTextBitmapChange = true;
	}
	,get_fieldWidth: function() {
		if(this.autoSize) {
			return this.get_textWidth();
		} else {
			return this._fieldWidth;
		}
	}
	,set_fieldWidth: function(value) {
		if(value <= 1) {
			value = 1;
		}
		if(value != this._fieldWidth) {
			if(value <= 0) {
				this.set_autoSize(true);
				this.set_wordWrap(false);
			}
			this.pendingTextChange = true;
		}
		return this._fieldWidth = value;
	}
	,set_alignment: function(value) {
		if(this.alignment != value && this.alignment != "justify") {
			this.alignment = value;
			this.pendingTextBitmapChange = true;
		}
		return value;
	}
	,set_multiLine: function(value) {
		if(this.multiLine != value) {
			this.multiLine = value;
			this.pendingTextChange = true;
		}
		return value;
	}
	,set_font: function(value) {
		if(this.font != value) {
			this.font = value;
			this.pendingTextChange = true;
		}
		return value;
	}
	,set_lineSpacing: function(value) {
		if(this.lineSpacing != value) {
			this.lineSpacing = value;
			this.pendingTextBitmapChange = true;
		}
		return this.lineSpacing;
	}
	,set_letterSpacing: function(value) {
		if(value != this.letterSpacing) {
			this.letterSpacing = value;
			this.pendingTextChange = true;
		}
		return this.letterSpacing;
	}
	,set_autoUpperCase: function(value) {
		if(this.autoUpperCase != value) {
			this.autoUpperCase = value;
			this.pendingTextChange = true;
		}
		return this.autoUpperCase;
	}
	,set_wordWrap: function(value) {
		if(this.wordWrap != value) {
			this.wordWrap = value;
			this.pendingTextChange = true;
		}
		return this.wordWrap;
	}
	,set_wrapByWord: function(value) {
		if(this.wrapByWord != value) {
			this.wrapByWord = value;
			this.pendingTextChange = true;
		}
		return value;
	}
	,set_autoSize: function(value) {
		if(this.autoSize != value) {
			this.autoSize = value;
			this.pendingTextChange = true;
		}
		return this.autoSize;
	}
	,set_padding: function(value) {
		if(value != this.padding) {
			this.padding = value;
			this.pendingTextChange = true;
		}
		return value;
	}
	,set_numSpacesInTab: function(value) {
		if(this.numSpacesInTab != value && value > 0) {
			this.numSpacesInTab = value;
			this.pendingTextChange = true;
		}
		return value;
	}
	,set_background: function(value) {
		if(this.background != value) {
			this.background = value;
			if(flixel_FlxG.renderBlit) {
				this.pendingPixelsChange = true;
			}
		}
		return value;
	}
	,set_backgroundColor: function(value) {
		if(this.backgroundColor != value) {
			this.backgroundColor = value;
			if(flixel_FlxG.renderBlit) {
				this.pendingPixelsChange = true;
			}
		}
		return value;
	}
	,set_borderStyle: function(style) {
		if(style != this.borderStyle) {
			this.borderStyle = style;
			this.pendingTextBitmapChange = true;
		}
		return this.borderStyle;
	}
	,set_borderColor: function(value) {
		if(this.borderColor != value) {
			this.borderColor = value;
			if(flixel_FlxG.renderBlit) {
				this.pendingPixelsChange = true;
			}
		}
		return value;
	}
	,set_borderSize: function(value) {
		if(value != this.borderSize) {
			this.borderSize = value;
			if(this.borderStyle != flixel_text_FlxTextBorderStyle.NONE) {
				this.pendingTextBitmapChange = true;
			}
		}
		return value;
	}
	,set_borderQuality: function(value) {
		value = Math.min(1,Math.max(0,value));
		if(value != this.borderQuality) {
			this.borderQuality = value;
			if(this.borderStyle != flixel_text_FlxTextBorderStyle.NONE) {
				this.pendingTextBitmapChange = true;
			}
		}
		return value;
	}
	,get_numLines: function() {
		return this._lines.length;
	}
	,get_textWidth: function() {
		var max = 0;
		var numLines = this._lines.length;
		var lineWidth;
		this._linesWidth = [];
		var _g = 0;
		var _g1 = numLines;
		while(_g < _g1) {
			var i = _g++;
			lineWidth = this.getLineWidth(i);
			this._linesWidth[i] = lineWidth;
			if(max <= lineWidth) {
				max = lineWidth;
			}
		}
		return max;
	}
	,get_textHeight: function() {
		return (this.get_lineHeight() + this.lineSpacing) * this._lines.length - this.lineSpacing;
	}
	,get_lineHeight: function() {
		return this.font.lineHeight;
	}
	,get_width: function() {
		var useTiles = true;
		if(useTiles == null) {
			useTiles = false;
		}
		if(flixel_FlxG.renderBlit) {
			useTiles = false;
		}
		if(this.pendingTextChange) {
			this.updateText();
			this.pendingTextBitmapChange = true;
		}
		if(this.pendingTextBitmapChange) {
			this.updateTextBitmap(useTiles);
			this.pendingPixelsChange = true;
		}
		if(this.pendingPixelsChange) {
			this.updatePixels(useTiles);
		}
		return flixel_FlxSprite.prototype.get_width.call(this);
	}
	,get_height: function() {
		var useTiles = true;
		if(useTiles == null) {
			useTiles = false;
		}
		if(flixel_FlxG.renderBlit) {
			useTiles = false;
		}
		if(this.pendingTextChange) {
			this.updateText();
			this.pendingTextBitmapChange = true;
		}
		if(this.pendingTextBitmapChange) {
			this.updateTextBitmap(useTiles);
			this.pendingPixelsChange = true;
		}
		if(this.pendingPixelsChange) {
			this.updatePixels(useTiles);
		}
		return flixel_FlxSprite.prototype.get_height.call(this);
	}
	,isUnicodeComboMark: function(Code) {
		if(!(Code >= 768 && Code <= 879 || Code >= 6832 && Code <= 6911 || Code >= 7616 && Code <= 7679 || Code >= 8400 && Code <= 8447)) {
			if(Code >= 65056) {
				return Code <= 65071;
			} else {
				return false;
			}
		} else {
			return true;
		}
	}
	,__class__: flixel_text_FlxBitmapText
	,__properties__: $extend(flixel_FlxSprite.prototype.__properties__,{set_fieldWidth:"set_fieldWidth",get_fieldWidth:"get_fieldWidth",get_numLines:"get_numLines",set_multiLine:"set_multiLine",set_backgroundColor:"set_backgroundColor",set_background:"set_background",set_borderQuality:"set_borderQuality",set_borderSize:"set_borderSize",set_borderColor:"set_borderColor",set_borderStyle:"set_borderStyle",set_useTextColor:"set_useTextColor",set_textColor:"set_textColor",set_numSpacesInTab:"set_numSpacesInTab",get_lineHeight:"get_lineHeight",get_textHeight:"get_textHeight",get_textWidth:"get_textWidth",set_padding:"set_padding",set_autoSize:"set_autoSize",set_wrapByWord:"set_wrapByWord",set_wordWrap:"set_wordWrap",set_autoUpperCase:"set_autoUpperCase",set_letterSpacing:"set_letterSpacing",set_lineSpacing:"set_lineSpacing",set_alignment:"set_alignment",set_text:"set_text",set_font:"set_font"})
});
var ComboDisplay = function(X,Y) {
	this.colors = [-65536,-256,-16744448,-16711681,-16776961,-65281,-1];
	flixel_text_FlxBitmapText.call(this,flixel_graphics_frames_FlxBitmapFont.fromAngelCode("assets/images/large_numbers.png","assets/images/large_numbers.xml"));
	this.set_x(this.baseX = X);
	this.set_y(this.baseY = Y);
	this.set_text("*1");
	this.set_alpha(0);
};
$hxClasses["ComboDisplay"] = ComboDisplay;
ComboDisplay.__name__ = "ComboDisplay";
ComboDisplay.__super__ = flixel_text_FlxBitmapText;
ComboDisplay.prototype = $extend(flixel_text_FlxBitmapText.prototype,{
	tween: null
	,colors: null
	,baseY: null
	,baseX: null
	,draw: function() {
		if(this.alpha > 0 && this.visible && this.exists && this.alive) {
			this.set_color(this.colors[flixel_FlxG.game.ticks / 100 % 7 | 0]);
		}
		flixel_text_FlxBitmapText.prototype.draw.call(this);
	}
	,show: function(Value) {
		var _gthis = this;
		this.set_text("*" + Value);
		var tmp = this.alpha == 0;
		this.set_alpha(0);
		this.set_y(this.baseY + 4);
		this.set_x(this.baseX - this.get_width() / 2);
		this.tween = flixel_tweens_FlxTween.tween(this,{ alpha : 1, y : this.baseY},.2,{ type : 8, ease : flixel_tweens_FlxEase.backOut, onComplete : function(_) {
			_gthis.tween = flixel_tweens_FlxTween.tween(_gthis,{ alpha : 0, y : _gthis.baseY - 4},.2,{ type : 8, ease : flixel_tweens_FlxEase.backIn, startDelay : 1});
		}});
	}
	,__class__: ComboDisplay
});
var flixel_group_FlxTypedGroup = function(MaxSize) {
	if(MaxSize == null) {
		MaxSize = 0;
	}
	this._marker = 0;
	this.length = 0;
	flixel_FlxBasic.call(this);
	this.members = [];
	this.set_maxSize(Math.abs(MaxSize) | 0);
	this.flixelType = 2;
};
$hxClasses["flixel.group.FlxTypedGroup"] = flixel_group_FlxTypedGroup;
flixel_group_FlxTypedGroup.__name__ = "flixel.group.FlxTypedGroup";
flixel_group_FlxTypedGroup.overlaps = function(Callback,Group,X,Y,InScreenSpace,Camera) {
	var result = false;
	if(Group != null) {
		var i = 0;
		var l = Group.length;
		var basic;
		while(i < l) {
			basic = Group.members[i++];
			if(basic != null && Callback(basic,X,Y,InScreenSpace,Camera)) {
				result = true;
				break;
			}
		}
	}
	return result;
};
flixel_group_FlxTypedGroup.resolveGroup = function(ObjectOrGroup) {
	var group = null;
	if(ObjectOrGroup != null) {
		if(ObjectOrGroup.flixelType == 2) {
			group = ObjectOrGroup;
		} else if(ObjectOrGroup.flixelType == 4) {
			var spriteGroup = ObjectOrGroup;
			group = spriteGroup.group;
		}
	}
	return group;
};
flixel_group_FlxTypedGroup.__super__ = flixel_FlxBasic;
flixel_group_FlxTypedGroup.prototype = $extend(flixel_FlxBasic.prototype,{
	members: null
	,maxSize: null
	,length: null
	,_memberAdded: null
	,_memberRemoved: null
	,_marker: null
	,destroy: function() {
		flixel_FlxBasic.prototype.destroy.call(this);
		flixel_util_FlxDestroyUtil.destroy(this._memberAdded);
		flixel_util_FlxDestroyUtil.destroy(this._memberRemoved);
		if(this.members != null) {
			var i = 0;
			var basic = null;
			while(i < this.length) {
				basic = this.members[i++];
				if(basic != null) {
					basic.destroy();
				}
			}
			this.members = null;
		}
	}
	,update: function(elapsed) {
		var i = 0;
		var basic = null;
		while(i < this.length) {
			basic = this.members[i++];
			if(basic != null && basic.exists && basic.active) {
				basic.update(elapsed);
			}
		}
	}
	,draw: function() {
		var i = 0;
		var basic = null;
		var oldDefaultCameras = flixel_FlxCamera._defaultCameras;
		if(this.get_cameras() != null) {
			flixel_FlxCamera._defaultCameras = this.get_cameras();
		}
		while(i < this.length) {
			basic = this.members[i++];
			if(basic != null && basic.exists && basic.visible) {
				basic.draw();
			}
		}
		flixel_FlxCamera._defaultCameras = oldDefaultCameras;
	}
	,add: function(Object1) {
		if(Object1 == null) {
			return null;
		}
		if(this.members.indexOf(Object1) >= 0) {
			return Object1;
		}
		var index = this.getFirstNull();
		if(index != -1) {
			this.members[index] = Object1;
			if(index >= this.length) {
				this.length = index + 1;
			}
			if(this._memberAdded != null) {
				this._memberAdded.dispatch(Object1);
			}
			return Object1;
		}
		if(this.maxSize > 0 && this.length >= this.maxSize) {
			return Object1;
		}
		this.members.push(Object1);
		this.length++;
		if(this._memberAdded != null) {
			this._memberAdded.dispatch(Object1);
		}
		return Object1;
	}
	,insert: function(position,object) {
		if(object == null) {
			return null;
		}
		if(this.members.indexOf(object) >= 0) {
			return object;
		}
		if(position < this.length && this.members[position] == null) {
			this.members[position] = object;
			if(this._memberAdded != null) {
				this._memberAdded.dispatch(object);
			}
			return object;
		}
		if(this.maxSize > 0 && this.length >= this.maxSize) {
			return object;
		}
		this.members.splice(position,0,object);
		this.length++;
		if(this._memberAdded != null) {
			this._memberAdded.dispatch(object);
		}
		return object;
	}
	,recycle: function(ObjectClass,ObjectFactory,Force,Revive) {
		if(Revive == null) {
			Revive = true;
		}
		if(Force == null) {
			Force = false;
		}
		var basic = null;
		if(this.maxSize > 0) {
			if(this.length < this.maxSize) {
				var object = null;
				if(ObjectFactory != null) {
					object = ObjectFactory();
					this.add(object);
				} else if(ObjectClass != null) {
					object = Type.createInstance(ObjectClass,[]);
					this.add(object);
				}
				return object;
			} else {
				basic = this.members[this._marker++];
				if(this._marker >= this.maxSize) {
					this._marker = 0;
				}
				if(Revive) {
					basic.revive();
				}
				return basic;
			}
		} else {
			basic = this.getFirstAvailable(ObjectClass,Force);
			if(basic != null) {
				if(Revive) {
					basic.revive();
				}
				return basic;
			}
			var object = null;
			if(ObjectFactory != null) {
				object = ObjectFactory();
				this.add(object);
			} else if(ObjectClass != null) {
				object = Type.createInstance(ObjectClass,[]);
				this.add(object);
			}
			return object;
		}
	}
	,recycleCreateObject: function(ObjectClass,ObjectFactory) {
		var object = null;
		if(ObjectFactory != null) {
			object = ObjectFactory();
			this.add(object);
		} else if(ObjectClass != null) {
			object = Type.createInstance(ObjectClass,[]);
			this.add(object);
		}
		return object;
	}
	,remove: function(Object1,Splice) {
		if(Splice == null) {
			Splice = false;
		}
		if(this.members == null) {
			return null;
		}
		var index = this.members.indexOf(Object1);
		if(index < 0) {
			return null;
		}
		if(Splice) {
			this.members.splice(index,1);
			this.length--;
		} else {
			this.members[index] = null;
		}
		if(this._memberRemoved != null) {
			this._memberRemoved.dispatch(Object1);
		}
		return Object1;
	}
	,replace: function(OldObject,NewObject) {
		var index = this.members.indexOf(OldObject);
		if(index < 0) {
			return null;
		}
		this.members[index] = NewObject;
		if(this._memberRemoved != null) {
			this._memberRemoved.dispatch(OldObject);
		}
		if(this._memberAdded != null) {
			this._memberAdded.dispatch(NewObject);
		}
		return NewObject;
	}
	,sort: function(Function1,Order) {
		if(Order == null) {
			Order = -1;
		}
		var _g = Function1;
		var a1 = Order;
		var tmp = function(a2,a3) {
			return _g(a1,a2,a3);
		};
		this.members.sort(tmp);
	}
	,getFirstAvailable: function(ObjectClass,Force) {
		if(Force == null) {
			Force = false;
		}
		var i = 0;
		var basic = null;
		while(i < this.length) {
			basic = this.members[i++];
			if(basic != null && !basic.exists && (ObjectClass == null || js_Boot.__instanceof(basic,ObjectClass))) {
				var tmp;
				if(Force) {
					var c = js_Boot.getClass(basic);
					tmp = c.__name__ != ObjectClass.__name__;
				} else {
					tmp = false;
				}
				if(tmp) {
					continue;
				}
				return this.members[i - 1];
			}
		}
		return null;
	}
	,getFirstNull: function() {
		var i = 0;
		while(i < this.length) {
			if(this.members[i] == null) {
				return i;
			}
			++i;
		}
		return -1;
	}
	,getFirstExisting: function() {
		var i = 0;
		var basic = null;
		while(i < this.length) {
			basic = this.members[i++];
			if(basic != null && basic.exists) {
				return basic;
			}
		}
		return null;
	}
	,getFirstAlive: function() {
		var i = 0;
		var basic = null;
		while(i < this.length) {
			basic = this.members[i++];
			if(basic != null && basic.exists && basic.alive) {
				return basic;
			}
		}
		return null;
	}
	,getFirstDead: function() {
		var i = 0;
		var basic = null;
		while(i < this.length) {
			basic = this.members[i++];
			if(basic != null && !basic.alive) {
				return basic;
			}
		}
		return null;
	}
	,countLiving: function() {
		var i = 0;
		var count = -1;
		var basic = null;
		while(i < this.length) {
			basic = this.members[i++];
			if(basic != null) {
				if(count < 0) {
					count = 0;
				}
				if(basic.exists && basic.alive) {
					++count;
				}
			}
		}
		return count;
	}
	,countDead: function() {
		var i = 0;
		var count = -1;
		var basic = null;
		while(i < this.length) {
			basic = this.members[i++];
			if(basic != null) {
				if(count < 0) {
					count = 0;
				}
				if(!basic.alive) {
					++count;
				}
			}
		}
		return count;
	}
	,getRandom: function(StartIndex,Length) {
		if(Length == null) {
			Length = 0;
		}
		if(StartIndex == null) {
			StartIndex = 0;
		}
		if(StartIndex < 0) {
			StartIndex = 0;
		}
		if(Length <= 0) {
			Length = this.length;
		}
		return flixel_FlxG.random.getObject_flixel_group_FlxTypedGroup_T(this.members,null,StartIndex,Length);
	}
	,clear: function() {
		this.length = 0;
		if(this._memberRemoved != null) {
			var _g = 0;
			var _g1 = this.members;
			while(_g < _g1.length) {
				var member = _g1[_g];
				++_g;
				if(member != null) {
					this._memberRemoved.dispatch(member);
				}
			}
		}
		flixel_util_FlxArrayUtil.clearArray(this.members);
	}
	,kill: function() {
		var i = 0;
		var basic = null;
		while(i < this.length) {
			basic = this.members[i++];
			if(basic != null && basic.exists) {
				basic.kill();
			}
		}
		flixel_FlxBasic.prototype.kill.call(this);
	}
	,revive: function() {
		var i = 0;
		var basic = null;
		while(i < this.length) {
			basic = this.members[i++];
			if(basic != null && !basic.exists) {
				basic.revive();
			}
		}
		flixel_FlxBasic.prototype.revive.call(this);
	}
	,iterator: function(filter) {
		return new flixel_group_FlxTypedGroupIterator(this.members,filter);
	}
	,forEach: function(Function1,Recurse) {
		if(Recurse == null) {
			Recurse = false;
		}
		var i = 0;
		var basic = null;
		while(i < this.length) {
			basic = this.members[i++];
			if(basic != null) {
				if(Recurse) {
					var group = flixel_group_FlxTypedGroup.resolveGroup(basic);
					if(group != null) {
						group.forEach(Function1,Recurse);
					}
				}
				Function1(basic);
			}
		}
	}
	,forEachAlive: function(Function1,Recurse) {
		if(Recurse == null) {
			Recurse = false;
		}
		var i = 0;
		var basic = null;
		while(i < this.length) {
			basic = this.members[i++];
			if(basic != null && basic.exists && basic.alive) {
				if(Recurse) {
					var group = flixel_group_FlxTypedGroup.resolveGroup(basic);
					if(group != null) {
						group.forEachAlive(Function1,Recurse);
					}
				}
				Function1(basic);
			}
		}
	}
	,forEachDead: function(Function1,Recurse) {
		if(Recurse == null) {
			Recurse = false;
		}
		var i = 0;
		var basic = null;
		while(i < this.length) {
			basic = this.members[i++];
			if(basic != null && !basic.alive) {
				if(Recurse) {
					var group = flixel_group_FlxTypedGroup.resolveGroup(basic);
					if(group != null) {
						group.forEachDead(Function1,Recurse);
					}
				}
				Function1(basic);
			}
		}
	}
	,forEachExists: function(Function1,Recurse) {
		if(Recurse == null) {
			Recurse = false;
		}
		var i = 0;
		var basic = null;
		while(i < this.length) {
			basic = this.members[i++];
			if(basic != null && basic.exists) {
				if(Recurse) {
					var group = flixel_group_FlxTypedGroup.resolveGroup(basic);
					if(group != null) {
						group.forEachExists(Function1,Recurse);
					}
				}
				Function1(basic);
			}
		}
	}
	,forEachOfType: function(ObjectClass,Function1,Recurse) {
		if(Recurse == null) {
			Recurse = false;
		}
		var i = 0;
		var basic = null;
		while(i < this.length) {
			basic = this.members[i++];
			if(basic != null) {
				if(Recurse) {
					var group = flixel_group_FlxTypedGroup.resolveGroup(basic);
					if(group != null) {
						group.forEachOfType(ObjectClass,Function1,Recurse);
					}
				}
				if(js_Boot.__instanceof(basic,ObjectClass)) {
					Function1(basic);
				}
			}
		}
	}
	,set_maxSize: function(Size) {
		this.maxSize = Math.abs(Size) | 0;
		if(this._marker >= this.maxSize) {
			this._marker = 0;
		}
		if(this.maxSize == 0 || this.members == null || this.maxSize >= this.length) {
			return this.maxSize;
		}
		var i = this.maxSize;
		var l = this.length;
		var basic = null;
		while(i < l) {
			basic = this.members[i++];
			if(basic != null) {
				if(this._memberRemoved != null) {
					this._memberRemoved.dispatch(basic);
				}
				basic.destroy();
			}
		}
		flixel_util_FlxArrayUtil.setLength_flixel_group_FlxTypedGroup_T(this.members,this.maxSize);
		this.length = this.members.length;
		return this.maxSize;
	}
	,get_memberAdded: function() {
		if(this._memberAdded == null) {
			this._memberAdded = new flixel_util__$FlxSignal_FlxSignal1();
		}
		return this._memberAdded;
	}
	,get_memberRemoved: function() {
		if(this._memberRemoved == null) {
			this._memberRemoved = new flixel_util__$FlxSignal_FlxSignal1();
		}
		return this._memberRemoved;
	}
	,__class__: flixel_group_FlxTypedGroup
	,__properties__: $extend(flixel_FlxBasic.prototype.__properties__,{get_memberRemoved:"get_memberRemoved",get_memberAdded:"get_memberAdded",set_maxSize:"set_maxSize"})
});
var flixel_FlxState = function(MaxSize) {
	this._requestSubStateReset = false;
	this.destroySubStates = true;
	this.persistentDraw = true;
	this.persistentUpdate = false;
	flixel_group_FlxTypedGroup.call(this,MaxSize);
};
$hxClasses["flixel.FlxState"] = flixel_FlxState;
flixel_FlxState.__name__ = "flixel.FlxState";
flixel_FlxState.__super__ = flixel_group_FlxTypedGroup;
flixel_FlxState.prototype = $extend(flixel_group_FlxTypedGroup.prototype,{
	persistentUpdate: null
	,persistentDraw: null
	,destroySubStates: null
	,subState: null
	,_requestedSubState: null
	,_requestSubStateReset: null
	,_subStateOpened: null
	,_subStateClosed: null
	,create: function() {
	}
	,draw: function() {
		if(this.persistentDraw || this.subState == null) {
			flixel_group_FlxTypedGroup.prototype.draw.call(this);
		}
		if(this.subState != null) {
			this.subState.draw();
		}
	}
	,openSubState: function(SubState) {
		this._requestSubStateReset = true;
		this._requestedSubState = SubState;
	}
	,closeSubState: function() {
		this._requestSubStateReset = true;
	}
	,resetSubState: function() {
		if(this.subState != null) {
			if(this.subState.closeCallback != null) {
				this.subState.closeCallback();
			}
			if(this._subStateClosed != null) {
				this._subStateClosed.dispatch(this.subState);
			}
			if(this.destroySubStates) {
				this.subState.destroy();
			}
		}
		this.subState = this._requestedSubState;
		this._requestedSubState = null;
		if(this.subState != null) {
			if(!this.persistentUpdate) {
				flixel_FlxG.inputs.onStateSwitch();
			}
			this.subState._parentState = this;
			if(!this.subState._created) {
				this.subState._created = true;
				this.subState.create();
			}
			if(this.subState.openCallback != null) {
				this.subState.openCallback();
			}
			if(this._subStateOpened != null) {
				this._subStateOpened.dispatch(this.subState);
			}
		}
	}
	,destroy: function() {
		flixel_util_FlxDestroyUtil.destroy(this._subStateOpened);
		flixel_util_FlxDestroyUtil.destroy(this._subStateClosed);
		if(this.subState != null) {
			this.subState.destroy();
			this.subState = null;
		}
		flixel_group_FlxTypedGroup.prototype.destroy.call(this);
	}
	,switchTo: function(nextState) {
		return true;
	}
	,onFocusLost: function() {
	}
	,onFocus: function() {
	}
	,onResize: function(Width,Height) {
	}
	,tryUpdate: function(elapsed) {
		if(this.persistentUpdate || this.subState == null) {
			this.update(elapsed);
		}
		if(this._requestSubStateReset) {
			this._requestSubStateReset = false;
			this.resetSubState();
		}
		if(this.subState != null) {
			this.subState.tryUpdate(elapsed);
		}
	}
	,get_bgColor: function() {
		return flixel_FlxG.cameras.get_bgColor();
	}
	,set_bgColor: function(Value) {
		return flixel_FlxG.cameras.set_bgColor(Value);
	}
	,get_subStateOpened: function() {
		if(this._subStateOpened == null) {
			this._subStateOpened = new flixel_util__$FlxSignal_FlxSignal1();
		}
		return this._subStateOpened;
	}
	,get_subStateClosed: function() {
		if(this._subStateClosed == null) {
			this._subStateClosed = new flixel_util__$FlxSignal_FlxSignal1();
		}
		return this._subStateClosed;
	}
	,__class__: flixel_FlxState
	,__properties__: $extend(flixel_group_FlxTypedGroup.prototype.__properties__,{get_subStateClosed:"get_subStateClosed",get_subStateOpened:"get_subStateOpened",set_bgColor:"set_bgColor",get_bgColor:"get_bgColor"})
});
var flixel_FlxSubState = function(BGColor) {
	if(BGColor == null) {
		BGColor = 0;
	}
	this._created = false;
	flixel_FlxState.call(this);
	this.closeCallback = null;
	this.openCallback = null;
	if(flixel_FlxG.renderTile) {
		this._bgSprite = new flixel_system_FlxBGSprite();
	}
	this.set_bgColor(BGColor);
};
$hxClasses["flixel.FlxSubState"] = flixel_FlxSubState;
flixel_FlxSubState.__name__ = "flixel.FlxSubState";
flixel_FlxSubState.__super__ = flixel_FlxState;
flixel_FlxSubState.prototype = $extend(flixel_FlxState.prototype,{
	openCallback: null
	,closeCallback: null
	,_bgSprite: null
	,_parentState: null
	,_bgColor: null
	,_created: null
	,draw: function() {
		if(flixel_FlxG.renderBlit) {
			var _g = 0;
			var _g1 = this.get_cameras();
			while(_g < _g1.length) {
				var camera = _g1[_g];
				++_g;
				camera.fill(this._bgColor);
			}
		} else {
			this._bgSprite.draw();
		}
		flixel_FlxState.prototype.draw.call(this);
	}
	,destroy: function() {
		flixel_FlxState.prototype.destroy.call(this);
		this.closeCallback = null;
		this.openCallback = null;
		this._parentState = null;
		this._bgSprite = null;
	}
	,close: function() {
		if(this._parentState != null && this._parentState.subState == this) {
			this._parentState.closeSubState();
		}
	}
	,get_bgColor: function() {
		return this._bgColor;
	}
	,set_bgColor: function(Value) {
		if(flixel_FlxG.renderTile && this._bgSprite != null) {
			this._bgSprite.get_pixels().setPixel32(0,0,Value);
		}
		return this._bgColor = Value;
	}
	,__class__: flixel_FlxSubState
});
var ConfirmQuit = function() {
	this.ready = false;
	flixel_FlxSubState.call(this);
	this.ready = false;
	this.back = new flixel_FlxSprite(0,0,"assets/images/prompt_back.png");
	this.back.screenCenter(flixel_util_FlxAxes.XY);
	this.back.set_alpha(0);
	this.add(this.back);
	this.quitText = new flixel_text_FlxBitmapText(flixel_graphics_frames_FlxBitmapFont.fromAngelCode("assets/images/simple_font.png","assets/images/simple_font.xml"));
	this.quitText.set_text("Do you really\nwant to quit?");
	this.quitText.set_alignment("center");
	this.quitText.set_multiLine(true);
	this.quitText.set_borderStyle(flixel_text_FlxTextBorderStyle.SHADOW);
	this.quitText.set_borderColor(-15658735);
	this.quitText.set_borderSize(1);
	this.quitText.set_alpha(0);
	this.quitText.set_y(flixel_FlxG.height / 2 - 12);
	this.quitText.screenCenter(flixel_util_FlxAxes.X);
	this.add(this.quitText);
	this.quitButton = new flixel_ui_FlxSpriteButton(0,0,null,$bind(this,this.clickQuit));
	this.quitButton.loadGraphic("assets/images/exit_button.png",true,36,12);
	this.quitButton.set_x(flixel_FlxG.width / 2 - 40);
	this.quitButton.set_y(flixel_FlxG.height / 2 + 4);
	this.quitButton.set_alpha(0);
	this.add(this.quitButton);
	this.resumeButton = new flixel_ui_FlxSpriteButton(0,0,null,$bind(this,this.clickResume));
	this.resumeButton.loadGraphic("assets/images/resume_button.png",true,36,12);
	this.resumeButton.set_x(flixel_FlxG.width / 2 + 4);
	this.resumeButton.set_y(flixel_FlxG.height / 2 + 4);
	this.resumeButton.set_alpha(0);
	this.add(this.resumeButton);
};
$hxClasses["ConfirmQuit"] = ConfirmQuit;
ConfirmQuit.__name__ = "ConfirmQuit";
ConfirmQuit.__super__ = flixel_FlxSubState;
ConfirmQuit.prototype = $extend(flixel_FlxSubState.prototype,{
	quitButton: null
	,resumeButton: null
	,quitText: null
	,back: null
	,ready: null
	,create: function() {
		var _gthis = this;
		flixel_tweens_FlxTween.num(0,1,.33,{ type : 8, ease : flixel_tweens_FlxEase.circOut, onComplete : function(_) {
			_gthis.ready = true;
		}},function(Value) {
			_gthis.back.set_alpha(_gthis.quitButton.set_alpha(_gthis.resumeButton.set_alpha(_gthis.quitText.set_alpha(Value))));
		});
		flixel_FlxSubState.prototype.create.call(this);
	}
	,clickQuit: function() {
		var _gthis = this;
		if(!this.ready) {
			return;
		}
		this.ready = false;
		Sounds.play("click",.2);
		flixel_tweens_FlxTween.num(1,0,.33,{ type : 8, ease : flixel_tweens_FlxEase.circIn, onComplete : function(_) {
			var nextState = new TitleState();
			if(flixel_FlxG.game._state.switchTo(nextState)) {
				flixel_FlxG.game._requestedState = nextState;
			}
		}},function(Value) {
			_gthis.back.set_alpha(_gthis.quitButton.set_alpha(_gthis.resumeButton.set_alpha(_gthis.quitText.set_alpha(Value))));
		});
	}
	,clickResume: function() {
		var _gthis = this;
		if(!this.ready) {
			return;
		}
		this.ready = false;
		Sounds.play("click",.2);
		flixel_tweens_FlxTween.num(1,0,.33,{ type : 8, ease : flixel_tweens_FlxEase.circIn, onComplete : function(_) {
			_gthis.close();
		}},function(Value) {
			_gthis.back.set_alpha(_gthis.quitButton.set_alpha(_gthis.resumeButton.set_alpha(_gthis.quitText.set_alpha(Value))));
		});
	}
	,__class__: ConfirmQuit
});
var Counts = function() { };
$hxClasses["Counts"] = Counts;
Counts.__name__ = "Counts";
Counts.counts = null;
Counts.init = function() {
	Counts.counts = new haxe_ds_StringMap();
};
Counts.clear = function() {
	var k = haxe_ds_StringMap.keysIterator(Counts.counts.h);
	while(k.hasNext()) {
		var k1 = k.next();
		var _this = Counts.counts;
		if(Object.prototype.hasOwnProperty.call(_this.h,k1)) {
			delete(_this.h[k1]);
		}
	}
};
Counts.add = function(Count,Amount) {
	var oldAmount = 0;
	if(Object.prototype.hasOwnProperty.call(Counts.counts.h,Count)) {
		oldAmount = Counts.counts.h[Count];
	}
	Counts.counts.h[Count] = oldAmount + Amount;
};
Counts.increaseIfHigher = function(Count,Amount) {
	var oldAmount = -1;
	if(Object.prototype.hasOwnProperty.call(Counts.counts.h,Count)) {
		oldAmount = Counts.counts.h[Count];
	}
	if(Amount > oldAmount) {
		Counts.counts.h[Count] = Amount;
	}
};
var CreditsState = function() {
	this.ready = false;
	flixel_FlxState.call(this);
	this.ready = false;
	this.messages = [];
	this.messages2 = [];
	this.font = flixel_graphics_frames_FlxBitmapFont.fromAngelCode("assets/images/simple_font.png","assets/images/simple_font.xml");
	this.addLine("Credits");
	this.addLine("");
	this.addLine("Design & Code:","Tim I Hely");
	this.addLine("Music:","Filippo Vicarelli");
	this.addLine("Title Artwork:","Mau Mora");
	this.addLine("Game Art:","Oryx Design Lab");
	this.addLine("");
	this.addLine("");
	this.addLine("");
	this.addLine("");
	this.addLine("Â©2019 Axol Studio, LLC");
	this.addLine("axolstudio.com");
	this.buttonQuit = new flixel_ui_FlxSpriteButton(0,0,null,$bind(this,this.closeQuit));
	this.buttonQuit.loadGraphic("assets/images/exit_button.png",true,36,12);
	this.buttonQuit.set_x(flixel_FlxG.width - 2 - this.buttonQuit.get_width());
	this.buttonQuit.set_y(flixel_FlxG.height - 2 - this.buttonQuit.get_height());
	this.buttonQuit.set_alpha(0);
	this.add(this.buttonQuit);
	this.logo = new flixel_FlxSprite(0,this.messages[5].y + this.messages[5].get_height() + 2,"assets/images/axol_logo.png");
	this.logo.set_alpha(0);
	this.logo.screenCenter(flixel_util_FlxAxes.X);
	this.add(this.logo);
};
$hxClasses["CreditsState"] = CreditsState;
CreditsState.__name__ = "CreditsState";
CreditsState.__super__ = flixel_FlxState;
CreditsState.prototype = $extend(flixel_FlxState.prototype,{
	messages: null
	,messages2: null
	,font: null
	,ready: null
	,logo: null
	,buttonQuit: null
	,closeQuit: function() {
		if(!this.ready) {
			return;
		}
		this.ready = false;
		Sounds.play("click",.2);
		flixel_FlxG.camera.fade(-16777216,1,false,function() {
			var nextState = new TitleState();
			if(flixel_FlxG.game._state.switchTo(nextState)) {
				flixel_FlxG.game._requestedState = nextState;
			}
		});
	}
	,addLine: function(Text1,Text2) {
		var t = new flixel_text_FlxBitmapText(this.font);
		t.set_text(Text1);
		t.set_borderStyle(flixel_text_FlxTextBorderStyle.SHADOW);
		t.set_borderColor(-13421773);
		t.set_borderSize(1);
		t.set_y(4 + this.messages.length * 8);
		if(Text2 == null) {
			t.set_alignment("center");
			t.screenCenter(flixel_util_FlxAxes.X);
		} else {
			t.set_alignment("right");
			t.set_x(flixel_FlxG.width / 2 - t.get_width() - 2);
		}
		t.set_alpha(0);
		this.messages.push(t);
		this.add(t);
		if(Text2 != null) {
			t = new RainbowText(this.font,250);
			t.set_text(Text2);
			t.set_borderStyle(flixel_text_FlxTextBorderStyle.SHADOW);
			t.set_borderColor(-13421773);
			t.set_borderSize(1);
			t.set_y(4 + (this.messages.length - 1) * 8);
			t.set_alignment("left");
			t.set_x(flixel_FlxG.width / 2 + 2);
			t.set_alpha(0);
			this.messages2[this.messages.length - 1] = t;
			this.add(t);
		}
	}
	,create: function() {
		var _gthis = this;
		var _g = 0;
		var _g1 = this.messages.length;
		while(_g < _g1) {
			var i = _g++;
			flixel_tweens_FlxTween.tween(this.messages[i],{ alpha : 1},.2,{ type : 8, ease : flixel_tweens_FlxEase.circOut, startDelay : i * .2});
			if(this.messages2[i] != null) {
				flixel_tweens_FlxTween.tween(this.messages2[i],{ alpha : 1},.2,{ type : 8, ease : flixel_tweens_FlxEase.circOut, startDelay : i * .2});
			}
		}
		flixel_tweens_FlxTween.tween(this.logo,{ alpha : 1},.2,{ type : 8, ease : flixel_tweens_FlxEase.circOut, startDelay : 1.4000000000000001});
		flixel_tweens_FlxTween.num(0,1,.2,{ type : 8, ease : flixel_tweens_FlxEase.circOut, startDelay : this.messages.length * .2, onComplete : function(_) {
			_gthis.ready = true;
		}},function(Value) {
			_gthis.buttonQuit.set_alpha(Value);
		});
		flixel_FlxState.prototype.create.call(this);
	}
	,__class__: CreditsState
});
var EReg = function(r,opt) {
	this.r = new RegExp(r,opt.split("u").join(""));
};
$hxClasses["EReg"] = EReg;
EReg.__name__ = "EReg";
EReg.prototype = {
	r: null
	,match: function(s) {
		if(this.r.global) {
			this.r.lastIndex = 0;
		}
		this.r.m = this.r.exec(s);
		this.r.s = s;
		return this.r.m != null;
	}
	,matched: function(n) {
		if(this.r.m != null && n >= 0 && n < this.r.m.length) {
			return this.r.m[n];
		} else {
			throw haxe_Exception.thrown("EReg::matched");
		}
	}
	,matchedRight: function() {
		if(this.r.m == null) {
			throw haxe_Exception.thrown("No string matched");
		}
		var sz = this.r.m.index + this.r.m[0].length;
		return HxOverrides.substr(this.r.s,sz,this.r.s.length - sz);
	}
	,matchedPos: function() {
		if(this.r.m == null) {
			throw haxe_Exception.thrown("No string matched");
		}
		return { pos : this.r.m.index, len : this.r.m[0].length};
	}
	,matchSub: function(s,pos,len) {
		if(len == null) {
			len = -1;
		}
		if(this.r.global) {
			this.r.lastIndex = pos;
			this.r.m = this.r.exec(len < 0 ? s : HxOverrides.substr(s,0,pos + len));
			var b = this.r.m != null;
			if(b) {
				this.r.s = s;
			}
			return b;
		} else {
			var b = this.match(len < 0 ? HxOverrides.substr(s,pos,null) : HxOverrides.substr(s,pos,len));
			if(b) {
				this.r.s = s;
				this.r.m.index += pos;
			}
			return b;
		}
	}
	,split: function(s) {
		var d = "#__delim__#";
		return s.replace(this.r,d).split(d);
	}
	,map: function(s,f) {
		var offset = 0;
		var buf_b = "";
		while(true) {
			if(offset >= s.length) {
				break;
			} else if(!this.matchSub(s,offset)) {
				buf_b += Std.string(HxOverrides.substr(s,offset,null));
				break;
			}
			var p = this.matchedPos();
			buf_b += Std.string(HxOverrides.substr(s,offset,p.pos - offset));
			buf_b += Std.string(f(this));
			if(p.len == 0) {
				buf_b += Std.string(HxOverrides.substr(s,p.pos,1));
				offset = p.pos + 1;
			} else {
				offset = p.pos + p.len;
			}
			if(!this.r.global) {
				break;
			}
		}
		if(!this.r.global && offset > 0 && offset < s.length) {
			buf_b += Std.string(HxOverrides.substr(s,offset,null));
		}
		return buf_b;
	}
	,__class__: EReg
};
var EnvData = function(Name,Id,Monsters) {
	this.id = -1;
	this.name = "";
	this.name = Name;
	this.id = Id;
	this.monsters = Monsters.slice();
};
$hxClasses["EnvData"] = EnvData;
EnvData.__name__ = "EnvData";
EnvData.data = null;
EnvData.initData = function() {
	EnvData.data = [];
	var json = JSON.parse(lime_utils_Assets.getText("assets/data/environments.json"));
	var _g = 0;
	var _g1 = json.environments;
	while(_g < _g1.length) {
		var e = _g1[_g];
		++_g;
		EnvData.data.push(new EnvData(e.name,Std.parseInt(e.id),e.monsters));
	}
};
EnvData.getFromID = function(Id) {
	var _g = 0;
	var _g1 = EnvData.data;
	while(_g < _g1.length) {
		var d = _g1[_g];
		++_g;
		if(d.id == Id) {
			return new EnvData(d.name,d.id,d.monsters);
		}
	}
	return null;
};
EnvData.getFromName = function(Name) {
	var _g = 0;
	var _g1 = EnvData.data;
	while(_g < _g1.length) {
		var d = _g1[_g];
		++_g;
		if(d.name == Name) {
			return new EnvData(d.name,d.id,d.monsters);
		}
	}
	return null;
};
EnvData.count = function() {
	return EnvData.data.length;
};
EnvData.prototype = {
	name: null
	,id: null
	,monsters: null
	,__class__: EnvData
};
var Environment = function(X,Y,WhichEnv) {
	if(WhichEnv == null) {
		WhichEnv = 0;
	}
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	this.whichEnv = 0;
	this.progress = 0;
	flixel_FlxSprite.call(this,X,Y);
	this.whichEnv = WhichEnv;
	this.makeGraphic(60,16,-16777216,true,"environment");
	this.master = flixel_FlxG.bitmap.add("assets/images/environments.png");
	this.cam = new openfl_geom_Rectangle(this.master.width - 60,16 * WhichEnv,60,16);
};
$hxClasses["Environment"] = Environment;
Environment.__name__ = "Environment";
Environment.__super__ = flixel_FlxSprite;
Environment.prototype = $extend(flixel_FlxSprite.prototype,{
	master: null
	,cam: null
	,progress: null
	,whichEnv: null
	,set_progress: function(Value) {
		var lowerBound = Value < 0 ? 0 : Value;
		this.progress = lowerBound > 1 ? 1 : lowerBound;
		if(this.cam != null && this.master != null) {
			if(this.progress == 0) {
				this.cam.x = this.master.width - 60;
			} else {
				var a = this.master.width - 60;
				flixel_tweens_FlxTween.tween(this.cam,{ x : a + this.progress * (0 - a)},.66,{ type : 8, ease : flixel_tweens_FlxEase.backInOut});
			}
		}
		return this.progress;
	}
	,draw: function() {
		if(this.master != null && this.cam != null) {
			this.get_pixels().copyPixels(this.master.bitmap,this.cam,this._flashPointZero);
		}
		flixel_FlxSprite.prototype.draw.call(this);
	}
	,__class__: Environment
	,__properties__: $extend(flixel_FlxSprite.prototype.__properties__,{set_progress:"set_progress"})
});
var Explosion = function() {
	flixel_FlxSprite.call(this);
	this.set_frames(axollib_GraphicsCache.loadGraphicFromAtlas("explosion","assets/images/explosion.png","assets/images/explosion.xml").get_atlasFrames());
	this.animation.addByPrefix("explosion","regularExplosion0",8,false);
	this.kill();
};
$hxClasses["Explosion"] = Explosion;
Explosion.__name__ = "Explosion";
Explosion.__super__ = flixel_FlxSprite;
Explosion.prototype = $extend(flixel_FlxSprite.prototype,{
	start: function(X,Y) {
		var _gthis = this;
		this.reset(X - 11,Y - 11);
		this.animation.play("explosion");
		this.animation.finishCallback = function(Anim) {
			_gthis.kill();
		};
	}
	,__class__: Explosion
});
var FloatingNumber = function() {
	this.colors = [-65536,-256,-16744448,-16711681,-16776961,-65281,-1];
	flixel_text_FlxBitmapText.call(this,flixel_graphics_frames_FlxBitmapFont.fromAngelCode("assets/images/tiny_digits.png","assets/images/tiny_digits.xml"));
	this.set_autoSize(false);
	this.set_alignment("center");
	this.set_fieldWidth(16);
	this.set_borderStyle(flixel_text_FlxTextBorderStyle.OUTLINE);
	this.set_borderSize(1);
	this.set_borderColor(-13421773);
	this.kill();
};
$hxClasses["FloatingNumber"] = FloatingNumber;
FloatingNumber.__name__ = "FloatingNumber";
FloatingNumber.__super__ = flixel_text_FlxBitmapText;
FloatingNumber.prototype = $extend(flixel_text_FlxBitmapText.prototype,{
	colors: null
	,start: function(X,Y,Value) {
		var _gthis = this;
		this.reset(X - 4,Y - 6);
		this.set_text(Value);
		this.set_alpha(0);
		flixel_tweens_FlxTween.tween(this,{ alpha : 1},.2,{ type : 8, ease : flixel_tweens_FlxEase.circOut, onComplete : function(_) {
			flixel_tweens_FlxTween.tween(_gthis,{ alpha : 0},.2,{ type : 8, ease : flixel_tweens_FlxEase.circIn, startDelay : .4, onComplete : function(_) {
				_gthis.kill();
			}});
		}});
		flixel_tweens_FlxTween.tween(this,{ y : Y - 10},.8,{ type : 8, ease : flixel_tweens_FlxEase.backIn});
	}
	,draw: function() {
		if(this.alpha > 0 && this.visible && this.exists && this.alive) {
			this.set_color(this.colors[flixel_FlxG.game.ticks / 100 % 7 | 0]);
		}
		flixel_text_FlxBitmapText.prototype.draw.call(this);
	}
	,__class__: FloatingNumber
});
var GameOver = function(IsWin,Score) {
	this.sel = 0;
	this.stats = [];
	this.score = 0;
	this.tCount = 0;
	this.gameWinText = "~ Victory ~";
	this.gameOverText = "~ Game Over ~";
	this.ready = false;
	this.letters = [" ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9","!"];
	flixel_FlxSubState.call(this);
	this.ready = false;
	this.font = flixel_graphics_frames_FlxBitmapFont.fromAngelCode("assets/images/simple_font.png","assets/images/simple_font.xml");
	this.initVals = [0,0,0];
	this.initVals[0] = this.getVal(Globals.Save.data.init.charAt(0));
	this.initVals[1] = this.getVal(Globals.Save.data.init.charAt(1));
	this.initVals[2] = this.getVal(Globals.Save.data.init.charAt(2));
	this.score = Score;
	this.back = new flixel_FlxSprite();
	this.back.makeGraphic(flixel_FlxG.width,flixel_FlxG.height,1711276032);
	this.back.set_alpha(0);
	this.add(this.back);
	this.frame = new flixel_FlxSprite(0,0,"assets/images/screen_frame.png");
	this.frame.screenCenter(flixel_util_FlxAxes.XY);
	this.frame.set_alpha(0);
	this.add(this.frame);
	this.scene = new flixel_FlxSprite();
	this.text = new flixel_text_FlxBitmapText(flixel_graphics_frames_FlxBitmapFont.fromAngelCode("assets/images/fancy_font.png","assets/images/fancy_font.xml"));
	this.text.set_text("");
	this.text.set_borderColor(-13421773);
	this.text.set_borderSize(1);
	this.text.set_borderStyle(flixel_text_FlxTextBorderStyle.SHADOW);
	this.text.set_autoSize(false);
	if(IsWin) {
		this.whichText = this.gameWinText;
		this.scene.loadGraphic("assets/images/victory_scene.png",true,110,40);
		this.scene.animation.add("play",[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,0],8,false);
		this.text.set_x(52.5);
		this.text.set_fieldWidth(57);
	} else {
		this.whichText = this.gameOverText;
		this.scene.loadGraphic("assets/images/game_over_scene.png",true,110,40);
		this.scene.animation.add("play",[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,2,2,3,3,3,3,4,4,4,5,5,6],8,false);
		this.text.set_x(44.5);
		this.text.set_fieldWidth(73);
	}
	this.scene.set_alpha(0);
	this.scene.screenCenter(flixel_util_FlxAxes.X);
	this.scene.set_y(this.frame.y + 2);
	this.add(this.scene);
	this.text.set_y(this.scene.y + this.scene.get_height() - 10);
	this.add(this.text);
};
$hxClasses["GameOver"] = GameOver;
GameOver.__name__ = "GameOver";
GameOver.__super__ = flixel_FlxSubState;
GameOver.prototype = $extend(flixel_FlxSubState.prototype,{
	letters: null
	,back: null
	,frame: null
	,ready: null
	,scene: null
	,text: null
	,gameOverText: null
	,gameWinText: null
	,whichText: null
	,tCount: null
	,score: null
	,stats: null
	,txtInits: null
	,initVals: null
	,cursor: null
	,sel: null
	,font: null
	,getVal: function(Char) {
		var _g = 0;
		var _g1 = this.letters.length;
		while(_g < _g1) {
			var i = _g++;
			if(this.letters[i] == Char) {
				return i;
			}
		}
		return -1;
	}
	,advanceText: function(T) {
		if(this.whichText.charAt(this.text.text.length) == " ") {
			var _g = this.text;
			_g.set_text(_g.text + this.whichText.charAt(this.text.text.length));
		}
		var _g = this.text;
		_g.set_text(_g.text + this.whichText.charAt(this.text.text.length));
		if(this.text.text.length < this.whichText.length) {
			T.start(.33,$bind(this,this.advanceText));
		}
	}
	,showStat: function(T) {
		var _gthis = this;
		var s = this.stats.shift();
		var t = new flixel_text_FlxBitmapText(this.font);
		t.set_borderColor(-15658735);
		t.set_borderSize(1);
		t.set_borderStyle(flixel_text_FlxTextBorderStyle.SHADOW);
		t.set_text(s);
		t.screenCenter(flixel_util_FlxAxes.X);
		t.set_y(this.scene.y + this.scene.get_height() + 2 + 9 * this.tCount);
		this.tCount++;
		this.add(t);
		if(this.stats.length > 0) {
			T.start(.33,$bind(this,this.showStat));
		} else {
			t.set_color(-256);
			T.start(.33,function(_) {
				var m = new flixel_text_FlxBitmapText(_gthis.font);
				m.set_borderColor(-15658735);
				m.set_borderSize(1);
				m.set_borderStyle(flixel_text_FlxTextBorderStyle.SHADOW);
				m.set_text("Enter Initials:");
				m.set_y(_gthis.scene.y + _gthis.scene.get_height() + 2 + 9 * _gthis.tCount);
				_gthis.add(m);
				_gthis.txtInits = [];
				var init = new flixel_text_FlxBitmapText(_gthis.font);
				init.set_alignment("center");
				init.set_autoSize(false);
				init.set_fieldWidth(5);
				init.set_text(_gthis.letters[_gthis.initVals[0]]);
				init.set_y(m.y);
				init.set_borderColor(-15658735);
				init.set_borderSize(1);
				init.set_borderStyle(flixel_text_FlxTextBorderStyle.SHADOW);
				_gthis.txtInits.push(init);
				_gthis.add(init);
				init = new flixel_text_FlxBitmapText(_gthis.font);
				init.set_alignment("center");
				init.set_autoSize(false);
				init.set_fieldWidth(5);
				init.set_text(_gthis.letters[_gthis.initVals[1]]);
				init.set_y(m.y);
				init.set_borderColor(-15658735);
				init.set_borderSize(1);
				init.set_borderStyle(flixel_text_FlxTextBorderStyle.SHADOW);
				_gthis.txtInits.push(init);
				_gthis.add(init);
				init = new flixel_text_FlxBitmapText(_gthis.font);
				init.set_alignment("center");
				init.set_autoSize(false);
				init.set_fieldWidth(5);
				init.set_text(_gthis.letters[_gthis.initVals[2]]);
				init.set_y(m.y);
				init.set_borderColor(-15658735);
				init.set_borderSize(1);
				init.set_borderStyle(flixel_text_FlxTextBorderStyle.SHADOW);
				_gthis.txtInits.push(init);
				_gthis.add(init);
				m.set_x(flixel_FlxG.width / 2 - (m.get_width() + 27) / 2);
				_gthis.txtInits[0].set_x(m.x + m.get_width() + 4);
				_gthis.txtInits[1].set_x(_gthis.txtInits[0].x + 9);
				_gthis.txtInits[2].set_x(_gthis.txtInits[1].x + 9);
				_gthis.cursor = new flixel_text_FlxBitmapText(_gthis.font);
				_gthis.cursor.set_alignment("center");
				_gthis.cursor.set_y(_gthis.txtInits[0].y + _gthis.txtInits[0].get_height());
				_gthis.cursor.set_autoSize(false);
				_gthis.cursor.set_fieldWidth(5);
				_gthis.cursor.set_text("^");
				_gthis.cursor.set_visible(false);
				_gthis.cursor.set_borderColor(-15658735);
				_gthis.cursor.set_borderSize(1);
				_gthis.cursor.set_borderStyle(flixel_text_FlxTextBorderStyle.SHADOW);
				_gthis.cursor.set_x(_gthis.txtInits[_gthis.sel].x);
				_gthis.add(_gthis.cursor);
			});
		}
	}
	,updateInits: function() {
		this.txtInits[0].set_text(this.letters[this.initVals[0]]);
		this.txtInits[1].set_text(this.letters[this.initVals[1]]);
		this.txtInits[2].set_text(this.letters[this.initVals[2]]);
	}
	,updateCursor: function() {
		this.cursor.set_x(this.txtInits[this.sel].x);
	}
	,update: function(elapsed) {
		flixel_FlxSubState.prototype.update.call(this,elapsed);
		if(this.ready) {
			this.cursor.set_visible(true);
			if(flixel_FlxG.keys.checkKeyArrayState([40,83],2)) {
				this.initVals[this.sel] = flixel_math_FlxMath.wrap(this.initVals[this.sel] + 1,0,this.letters.length - 1);
				this.updateInits();
				Sounds.play("click",.2);
			} else if(flixel_FlxG.keys.checkKeyArrayState([38,87],2)) {
				this.initVals[this.sel] = flixel_math_FlxMath.wrap(this.initVals[this.sel] - 1,0,this.letters.length - 1);
				this.updateInits();
				Sounds.play("click",.2);
			} else if(flixel_FlxG.keys.checkKeyArrayState([39,68],2)) {
				this.sel = flixel_math_FlxMath.wrap(this.sel + 1,0,2);
				this.updateCursor();
				Sounds.play("swap",.2);
			} else if(flixel_FlxG.keys.checkKeyArrayState([37,65],2)) {
				this.sel = flixel_math_FlxMath.wrap(this.sel - 1,0,2);
				this.updateCursor();
				Sounds.play("swap",.2);
			} else if(flixel_FlxG.keys.checkKeyArrayState([88,32,13],2)) {
				if(this.sel < 2) {
					this.sel = flixel_math_FlxMath.wrap(this.sel + 1,0,2);
					this.updateCursor();
					Sounds.play("swap",.2);
				} else {
					Sounds.play("match",.5);
					this.cursor.set_visible(false);
					this.ready = false;
					Globals.Save.data.init = this.letters[this.initVals[0]] + this.letters[this.initVals[1]] + this.letters[this.initVals[2]];
					Globals.Save.flush();
					axollib_AxolAPI.sendScore(this.score,this.letters[this.initVals[0]] + this.letters[this.initVals[1]] + this.letters[this.initVals[2]],$bind(this,this.scoreSent));
				}
			}
		}
	}
	,scoreSent: function(Msg) {
		this.scoresGot(Msg);
	}
	,scoresGot: function(Scores) {
		var _gthis = this;
		flixel_FlxG.camera.flash(-1,.1,function() {
			var nextState = new HiScoreState(Scores,_gthis.letters[_gthis.initVals[0]] + _gthis.letters[_gthis.initVals[1]] + _gthis.letters[_gthis.initVals[2]],_gthis.score);
			if(flixel_FlxG.game._state.switchTo(nextState)) {
				flixel_FlxG.game._requestedState = nextState;
			}
		});
	}
	,create: function() {
		var _gthis = this;
		flixel_FlxSubState.prototype.create.call(this);
		this.ready = false;
		this.back.set_alpha(0);
		this.scene.set_alpha(0);
		this.frame.set_alpha(0);
		var k = haxe_ds_StringMap.keysIterator(Counts.counts.h);
		while(k.hasNext()) {
			var k1 = k.next();
			this.stats.push(StringTools.replace(k1,"_"," ") + ": " + Std.string(Counts.counts.h[k1]));
		}
		this.stats.push("Final Score: " + Std.string(this.score));
		flixel_FlxG.camera.flash(-1,.1,function() {
			flixel_tweens_FlxTween.tween(_gthis.back,{ alpha : 1},.2,{ type : 8, ease : flixel_tweens_FlxEase.sineIn, onComplete : function(_) {
				flixel_tweens_FlxTween.tween(_gthis.frame,{ alpha : 1},.2,{ type : 8, ease : flixel_tweens_FlxEase.sineIn, startDelay : .2, onComplete : function(_) {
					new flixel_util_FlxTimer().start(.66,$bind(_gthis,_gthis.showStat));
					flixel_tweens_FlxTween.tween(_gthis.scene,{ alpha : 1},.2,{ type : 8, ease : flixel_tweens_FlxEase.sineOut, startDelay : .2, onComplete : function(_) {
						new flixel_util_FlxTimer().start(.66,$bind(_gthis,_gthis.advanceText));
						_gthis.scene.animation.play("play");
						_gthis.scene.animation.finishCallback = function(Anim) {
							_gthis.ready = true;
						};
					}});
				}});
			}});
		});
		flixel_FlxSubState.prototype.create.call(this);
	}
	,__class__: GameOver
});
var Keys = function() { };
$hxClasses["Keys"] = Keys;
Keys.__name__ = "Keys";
var Globals = function() { };
$hxClasses["Globals"] = Globals;
Globals.__name__ = "Globals";
Globals.Save = null;
Globals.initGame = function() {
	if(Globals.gameInitialized) {
		return;
	}
	Globals.gameInitialized = true;
	axollib_AxolAPI.initialize(Globals.AXOL_KEY);
	Globals.Save = new flixel_util_FlxSave();
	Globals.Save.bind("MonsterMatch-userData");
	var playerID;
	if(Globals.Save.data.guid == null || Globals.Save.data.guid == "") {
		playerID = axollib_AxolAPI.generateGUID();
	} else {
		playerID = Globals.Save.data.guid;
	}
	if(Globals.Save.data.init == null) {
		Globals.Save.data.init = "   ";
	}
	if(Globals.Save.data.seenTut == null) {
		Globals.SeenTut = false;
	} else {
		Globals.SeenTut = Globals.Save.data.seenTut;
	}
	axollib_AxolAPI.initSave(playerID,Globals.Save);
	Counts.init();
	flixel_FlxG.autoPause = false;
	flixel_FlxG.mouse.load("assets/images/cursor.png",3,1,1);
	Globals.mouseOffScreen(null);
	Sounds.preloadSounds();
	MonsterData.initData();
	HeroData.initData();
	EnvData.initData();
};
Globals.mouseOffScreen = function(E) {
	flixel_FlxG.mouse.set_visible(false);
	openfl_Lib.get_current().stage.removeEventListener("mouseLeave",Globals.mouseOffScreen);
	openfl_Lib.get_current().stage.addEventListener("mouseMove",Globals.mouseOnScreen);
};
Globals.mouseOnScreen = function(E) {
	flixel_FlxG.mouse.set_visible(true);
	openfl_Lib.get_current().stage.removeEventListener("mouseMove",Globals.mouseOnScreen);
	openfl_Lib.get_current().stage.addEventListener("mouseLeave",Globals.mouseOffScreen);
};
var HelpState = function(Forced) {
	if(Forced == null) {
		Forced = false;
	}
	this.forced = false;
	this.scrolling = false;
	this.ready = false;
	flixel_FlxState.call(this);
	this.forced = Forced;
};
$hxClasses["HelpState"] = HelpState;
HelpState.__name__ = "HelpState";
HelpState.__super__ = flixel_FlxState;
HelpState.prototype = $extend(flixel_FlxState.prototype,{
	story: null
	,cauldron: null
	,tube: null
	,demo: null
	,attackMonster: null
	,attackHero: null
	,monDamage: null
	,heroDamage: null
	,progress: null
	,ready: null
	,potions: null
	,upButton: null
	,downButton: null
	,exitButton: null
	,scrolling: null
	,forced: null
	,create: function() {
		var _gthis = this;
		this.ready = false;
		this.story = new flixel_FlxSprite(0,0,"assets/images/story.png");
		this.add(this.story);
		this.cauldron = new flixel_FlxSprite();
		this.cauldron.set_x(61);
		this.cauldron.set_y(300);
		this.cauldron.loadGraphic("assets/images/cauldron.png",true,8,8);
		this.cauldron.animation.add("burst",[1,2,3,4,5,0],8,true);
		this.cauldron.animation.play("burst");
		this.add(this.cauldron);
		this.tube = new Tube(78,349);
		this.tube.set_whichMonster(0);
		this.add(this.tube);
		this.demo = new flixel_FlxSprite();
		this.demo.set_frames(axollib_GraphicsCache.loadGraphicFromAtlas("demo","assets/images/demo.png","assets/images/demo.xml").get_atlasFrames());
		this.demo.animation.addByPrefix("demo","demo_frame_",8,true);
		this.demo.animation.play("demo");
		this.demo.set_x(17);
		this.demo.set_y(351);
		this.add(this.demo);
		this.attackMonster = new flixel_FlxSprite();
		this.attackMonster.loadGraphic("assets/images/monsters.png",true,8,8);
		this.attackMonster.animation.set_frameIndex(8);
		this.attackMonster.set_x(104);
		this.attackMonster.set_y(570);
		this.add(this.attackMonster);
		this.attackHero = new flixel_FlxSprite();
		this.attackHero.loadGraphic("assets/images/heroes.png",true,8,8);
		this.attackHero.set_flipX(true);
		this.attackHero.animation.set_frameIndex(1);
		this.attackHero.set_x(112);
		this.attackHero.set_y(570);
		this.add(this.attackHero);
		this.monDamage = new AttackAnim();
		this.monDamage.set_x(104);
		this.monDamage.set_y(this.attackMonster.y);
		this.add(this.monDamage);
		this.heroDamage = new AttackAnim();
		this.heroDamage.set_x(116);
		this.heroDamage.set_y(this.attackMonster.y);
		this.add(this.heroDamage);
		this.progress = new ProgressMeter(74,1061);
		this.progress.set_x(flixel_FlxG.width / 2 - 25);
		this.add(this.progress);
		this.doMonsterTween();
		this.doHeroTween();
		new flixel_util_FlxTimer().start(1,$bind(this,this.updateProgress));
		this.potions = [];
		var p = new flixel_FlxSprite();
		p.loadGraphic("assets/images/monsters.png",true,8,8);
		this.add(p);
		this.potions.push(p);
		p = new flixel_FlxSprite();
		p.loadGraphic("assets/images/monsters.png",true,8,8);
		this.add(p);
		this.potions.push(p);
		p = new flixel_FlxSprite();
		p.loadGraphic("assets/images/monsters.png",true,8,8);
		this.add(p);
		this.potions.push(p);
		p = new flixel_FlxSprite();
		p.loadGraphic("assets/images/monsters.png",true,8,8);
		this.add(p);
		this.potions.push(p);
		this.potions[0].set_x(96);
		this.potions[0].set_y(674);
		this.potions[1].set_x(63);
		this.potions[1].set_y(736);
		this.potions[2].set_x(73);
		this.potions[2].set_y(736);
		this.potions[3].set_x(83);
		this.potions[3].set_y(736);
		this.upButton = new flixel_ui_FlxSpriteButton(flixel_FlxG.width - 22,flixel_FlxG.height - 12,null,$bind(this,this.clickUp));
		this.upButton.loadGraphic("assets/images/up_button.png",true,8,8);
		this.upButton.set_alpha(.66);
		this.add(this.upButton);
		this.downButton = new flixel_ui_FlxSpriteButton(flixel_FlxG.width - 12,flixel_FlxG.height - 12,null,$bind(this,this.clickDown));
		this.downButton.loadGraphic("assets/images/down_button.png",true,8,8);
		this.downButton.set_alpha(.66);
		this.add(this.downButton);
		this.exitButton = new flixel_ui_FlxSpriteButton(2,2,null,$bind(this,this.clickExit));
		this.exitButton.loadGraphic("assets/images/close_button.png",true,8,8);
		this.exitButton.set_alpha(.66);
		this.add(this.exitButton);
		flixel_FlxG.camera.fade(-16777216,1,true,function() {
			_gthis.ready = true;
		});
		flixel_FlxState.prototype.create.call(this);
	}
	,clickUp: function() {
		var _gthis = this;
		if(!this.ready) {
			return;
		}
		if(flixel_FlxG.keys.checkKeyArrayState([38,40,27,87,83],1)) {
			return;
		}
		if(this.scrolling) {
			return;
		}
		this.scrolling = true;
		Sounds.play("click",.2);
		var Value = this.story.y + 60;
		var Min = flixel_FlxG.height - this.story.get_height();
		var lowerBound = Min != null && Value < Min ? Min : Value;
		var newDest = lowerBound > 0 ? 0 : lowerBound;
		flixel_tweens_FlxTween.tween(this.story,{ y : newDest},.33,{ type : 8, ease : flixel_tweens_FlxEase.sineInOut, onComplete : function(_) {
			_gthis.scrolling = false;
		}});
	}
	,clickDown: function() {
		var _gthis = this;
		if(!this.ready) {
			return;
		}
		if(flixel_FlxG.keys.checkKeyArrayState([38,40,27,87,83],1)) {
			return;
		}
		this.scrolling = true;
		Sounds.play("click",.2);
		var Value = this.story.y - 60;
		var Min = flixel_FlxG.height - this.story.get_height();
		var lowerBound = Min != null && Value < Min ? Min : Value;
		var newDest = lowerBound > 0 ? 0 : lowerBound;
		flixel_tweens_FlxTween.tween(this.story,{ y : newDest},.33,{ type : 8, ease : flixel_tweens_FlxEase.sineInOut, onComplete : function(_) {
			_gthis.scrolling = false;
		}});
	}
	,clickExit: function() {
		if(!this.ready) {
			return;
		}
		if(flixel_FlxG.keys.checkKeyArrayState([38,40,27,87,83],1)) {
			return;
		}
		Sounds.play("click",.2);
		this.exitScreen();
	}
	,exitScreen: function() {
		var _gthis = this;
		this.ready = false;
		flixel_FlxG.camera.fade(-16777216,1,false,function() {
			if(_gthis.forced) {
				Globals.SeenTut = true;
				Globals.Save.data.seenTut = true;
				Globals.Save.flush();
				var nextState = new PlayState();
				if(flixel_FlxG.game._state.switchTo(nextState)) {
					flixel_FlxG.game._requestedState = nextState;
				}
			} else {
				var nextState = new TitleState();
				if(flixel_FlxG.game._state.switchTo(nextState)) {
					flixel_FlxG.game._requestedState = nextState;
				}
			}
		});
	}
	,updateProgress: function(T) {
		var _g = this.progress;
		_g.set_progress(_g.progress + .025);
		if(this.progress.progress >= 1) {
			this.progress.set_progress(0);
		}
		T.start(1,$bind(this,this.updateProgress));
	}
	,doMonsterTween: function() {
		var _gthis = this;
		flixel_tweens_FlxTween.tween(this.attackMonster,{ x : 108},.5,{ type : 8, ease : flixel_tweens_FlxEase.backIn, startDelay : .5, onComplete : function(_) {
			switch(flixel_FlxG.random.int(0,3)) {
			case 0:
				_gthis.monDamage.playEffect("physblock");
				break;
			case 1:
				_gthis.monDamage.playEffect("physhit");
				break;
			case 2:
				_gthis.monDamage.playEffect("magblock");
				break;
			case 3:
				_gthis.monDamage.playEffect("maghit");
				break;
			}
			flixel_tweens_FlxTween.tween(_gthis.attackMonster,{ x : 104},.5,{ type : 8, ease : flixel_tweens_FlxEase.backOut, onComplete : function(_) {
				_gthis.doMonsterTween();
			}});
		}});
	}
	,doHeroTween: function() {
		var _gthis = this;
		flixel_tweens_FlxTween.tween(this.attackHero,{ x : 112},.5,{ type : 8, ease : flixel_tweens_FlxEase.backIn, startDelay : .5, onComplete : function(_) {
			switch(flixel_FlxG.random.int(0,3)) {
			case 0:
				_gthis.heroDamage.playEffect("physblock");
				break;
			case 1:
				_gthis.heroDamage.playEffect("physhit");
				break;
			case 2:
				_gthis.heroDamage.playEffect("magblock");
				break;
			case 3:
				_gthis.heroDamage.playEffect("maghit");
				break;
			}
			flixel_tweens_FlxTween.tween(_gthis.attackHero,{ x : 116},.5,{ type : 8, ease : flixel_tweens_FlxEase.backOut, onComplete : function(_) {
				_gthis.doHeroTween();
			}});
		}});
	}
	,update: function(elapsed) {
		flixel_FlxState.prototype.update.call(this,elapsed);
		if(this.ready) {
			this.upButton.set_alpha(this.downButton.set_alpha(this.exitButton.set_alpha(.66)));
			if(flixel_FlxG.keys.checkKeyArrayState([40,83],1)) {
				var _g = this.story;
				_g.set_y(_g.y - 2);
				if(this.story.y < flixel_FlxG.height - this.story.get_height()) {
					this.story.set_y(flixel_FlxG.height - this.story.get_height());
				}
			} else if(flixel_FlxG.keys.checkKeyArrayState([38,87],1)) {
				var _g = this.story;
				_g.set_y(_g.y + 2);
				if(this.story.y > 0) {
					this.story.set_y(0);
				}
			} else if(flixel_FlxG.keys.checkKeyArrayState([27],1)) {
				this.exitScreen();
			} else if(flixel_FlxG.mouse.overlaps(this.upButton)) {
				this.upButton.set_alpha(1);
			} else if(flixel_FlxG.mouse.overlaps(this.downButton)) {
				this.downButton.set_alpha(1);
			} else if(flixel_FlxG.mouse.overlaps(this.exitButton)) {
				this.exitButton.set_alpha(1);
			}
		}
		var _g = this.tube;
		_g.set_fillAmount(_g.fillAmount + .25 * elapsed);
		if(this.tube.fillAmount >= 1) {
			var _g = this.tube;
			_g.set_fillAmount(_g.fillAmount - 1);
			this.tube.showSpawn();
		}
		this.updatePos();
	}
	,updatePos: function() {
		this.cauldron.set_y(this.story.y + 300);
		this.tube.set_y(this.story.y + 349);
		this.demo.set_y(this.story.y + 351);
		this.heroDamage.set_y(this.monDamage.set_y(this.attackHero.set_y(this.attackMonster.set_y(this.story.y + 570))));
		this.progress.set_y(this.story.y + 1061);
		var _g = 0;
		var _g1 = this.potions;
		while(_g < _g1.length) {
			var p = _g1[_g];
			++_g;
			p.animation.set_frameIndex(40 + flixel_FlxG.game.ticks / 250 % 7 | 0);
		}
		this.potions[0].set_y(this.story.y + 674);
		this.potions[3].set_y(this.potions[2].set_y(this.potions[1].set_y(this.story.y + 736)));
	}
	,__class__: HelpState
});
var HeroData = function(Id,Hp,Att,Def,SAtt,SDef) {
	this.sdef = 0;
	this.satt = 0;
	this.def = 0;
	this.att = 0;
	this.hp = 0;
	this.id = -1;
	this.id = Id;
	this.hp = Hp;
	this.att = Att;
	this.def = Def;
	this.satt = SAtt;
	this.sdef = SDef;
};
$hxClasses["HeroData"] = HeroData;
HeroData.__name__ = "HeroData";
HeroData.data = null;
HeroData.initData = function() {
	HeroData.data = [];
	var json = JSON.parse(lime_utils_Assets.getText("assets/data/heroes.json"));
	var _g = 0;
	var _g1 = json.heroes;
	while(_g < _g1.length) {
		var h = _g1[_g];
		++_g;
		HeroData.data.push(new HeroData(Std.parseInt(h.id),Std.parseInt(h.hp),Std.parseInt(h.att),Std.parseInt(h.def),Std.parseInt(h.satt),Std.parseInt(h.sdef)));
	}
};
HeroData.getFromID = function(Id) {
	var _g = 0;
	var _g1 = HeroData.data;
	while(_g < _g1.length) {
		var d = _g1[_g];
		++_g;
		if(d.id == Id) {
			return new HeroData(d.id,d.hp,d.att,d.def,d.satt,d.sdef);
		}
	}
	return null;
};
HeroData.count = function() {
	return HeroData.data.length;
};
HeroData.prototype = {
	id: null
	,hp: null
	,att: null
	,def: null
	,satt: null
	,sdef: null
	,__class__: HeroData
};
var HiScoreState = function(Scores,Initials,Amount) {
	if(Amount == null) {
		Amount = -1;
	}
	if(Initials == null) {
		Initials = "$";
	}
	this.ready = false;
	flixel_FlxSubState.call(this,0);
	this.ready = false;
	this.messages = [];
	this.font = flixel_graphics_frames_FlxBitmapFont.fromAngelCode("assets/images/simple_font.png","assets/images/simple_font.xml");
	this.frame = new flixel_FlxSprite(0,0,"assets/images/screen_frame.png");
	this.frame.screenCenter(flixel_util_FlxAxes.XY);
	this.frame.set_alpha(0);
	this.add(this.frame);
	this.addLine("Hi Scores");
	this.addLine("");
	var scores = Scores.data.scores.scores;
	var _g = 0;
	while(_g < scores.length) {
		var s = scores[_g];
		++_g;
		this.addLine(StringTools.rpad(Std.string(s.initials) + " ",".",20) + " " + StringTools.lpad(s.amount,"0",6),s.initials == Initials && Std.parseInt(s.amount) == Amount);
	}
	this.buttonReplay = new flixel_ui_FlxSpriteButton(0,0,null,$bind(this,this.closeReplay));
	this.buttonReplay.loadGraphic("assets/images/replay_button.png",true,36,12);
	this.buttonReplay.set_x(this.frame.x + 2);
	this.buttonReplay.set_y(this.frame.y + this.frame.get_height() - 2 - this.buttonReplay.get_height());
	this.buttonQuit = new flixel_ui_FlxSpriteButton(0,0,null,$bind(this,this.closeQuit));
	this.buttonQuit.loadGraphic("assets/images/exit_button.png",true,36,12);
	this.buttonQuit.set_x(this.frame.x + this.frame.get_width() - 2 - this.buttonQuit.get_width());
	this.buttonQuit.set_y(this.frame.y + this.frame.get_height() - 2 - this.buttonQuit.get_height());
	this.buttonQuit.set_alpha(this.buttonReplay.set_alpha(0));
	this.add(this.buttonReplay);
	this.add(this.buttonQuit);
};
$hxClasses["HiScoreState"] = HiScoreState;
HiScoreState.__name__ = "HiScoreState";
HiScoreState.__super__ = flixel_FlxSubState;
HiScoreState.prototype = $extend(flixel_FlxSubState.prototype,{
	messages: null
	,font: null
	,ready: null
	,frame: null
	,buttonReplay: null
	,buttonQuit: null
	,closeReplay: function() {
		if(!this.ready) {
			return;
		}
		this.ready = false;
		Sounds.play("click",.2);
		flixel_FlxG.camera.fade(-16777216,1,false,function() {
			var nextState = new PlayState();
			if(flixel_FlxG.game._state.switchTo(nextState)) {
				flixel_FlxG.game._requestedState = nextState;
			}
		});
	}
	,closeQuit: function() {
		if(!this.ready) {
			return;
		}
		this.ready = false;
		Sounds.play("click",.2);
		flixel_FlxG.camera.fade(-16777216,1,false,function() {
			var nextState = new TitleState();
			if(flixel_FlxG.game._state.switchTo(nextState)) {
				flixel_FlxG.game._requestedState = nextState;
			}
		});
	}
	,create: function() {
		var _gthis = this;
		flixel_tweens_FlxTween.tween(this.frame,{ alpha : 1},.2,{ type : 8, ease : flixel_tweens_FlxEase.circOut});
		var m = null;
		var _g = 0;
		var _g1 = this.messages.length;
		while(_g < _g1) {
			var i = _g++;
			m = this.messages[i];
			flixel_tweens_FlxTween.tween(m,{ alpha : 1},.2,{ type : 8, ease : flixel_tweens_FlxEase.circOut, startDelay : i * .2});
		}
		flixel_tweens_FlxTween.num(0,1,.2,{ type : 8, ease : flixel_tweens_FlxEase.circOut, startDelay : this.messages.length * .2, onComplete : function(_) {
			_gthis.ready = true;
		}},function(Value) {
			_gthis.buttonQuit.set_alpha(_gthis.buttonReplay.set_alpha(Value));
		});
		flixel_FlxSubState.prototype.create.call(this);
	}
	,addLine: function(Text1,Rainbow) {
		if(Rainbow == null) {
			Rainbow = false;
		}
		var t;
		if(Rainbow) {
			t = new RainbowText(this.font);
		} else {
			t = new flixel_text_FlxBitmapText(this.font);
		}
		t.set_text(Text1);
		t.set_alignment("center");
		t.set_borderStyle(flixel_text_FlxTextBorderStyle.SHADOW);
		t.set_borderColor(-13421773);
		t.set_borderSize(1);
		t.set_y(8 + this.messages.length * 8);
		t.screenCenter(flixel_util_FlxAxes.X);
		t.set_alpha(0);
		this.messages.push(t);
		this.add(t);
	}
	,__class__: HiScoreState
});
var HxOverrides = function() { };
$hxClasses["HxOverrides"] = HxOverrides;
HxOverrides.__name__ = "HxOverrides";
HxOverrides.strDate = function(s) {
	switch(s.length) {
	case 8:
		var k = s.split(":");
		var d = new Date();
		d["setTime"](0);
		d["setUTCHours"](k[0]);
		d["setUTCMinutes"](k[1]);
		d["setUTCSeconds"](k[2]);
		return d;
	case 10:
		var k = s.split("-");
		return new Date(k[0],k[1] - 1,k[2],0,0,0);
	case 19:
		var k = s.split(" ");
		var y = k[0].split("-");
		var t = k[1].split(":");
		return new Date(y[0],y[1] - 1,y[2],t[0],t[1],t[2]);
	default:
		throw haxe_Exception.thrown("Invalid date format : " + s);
	}
};
HxOverrides.cca = function(s,index) {
	var x = s.charCodeAt(index);
	if(x != x) {
		return undefined;
	}
	return x;
};
HxOverrides.substr = function(s,pos,len) {
	if(len == null) {
		len = s.length;
	} else if(len < 0) {
		if(pos == 0) {
			len = s.length + len;
		} else {
			return "";
		}
	}
	return s.substr(pos,len);
};
HxOverrides.remove = function(a,obj) {
	var i = a.indexOf(obj);
	if(i == -1) {
		return false;
	}
	a.splice(i,1);
	return true;
};
HxOverrides.now = function() {
	return Date.now();
};
var IntIterator = function(min,max) {
	this.min = min;
	this.max = max;
};
$hxClasses["IntIterator"] = IntIterator;
IntIterator.__name__ = "IntIterator";
IntIterator.prototype = {
	min: null
	,max: null
	,hasNext: function() {
		return this.min < this.max;
	}
	,next: function() {
		return this.min++;
	}
	,__class__: IntIterator
};
var Juice = function() {
	flixel_FlxSprite.call(this);
	this.loadGraphic("assets/images/juice.png",true,8,8);
	this.animation.add("play",[0,1],12,true);
	this.kill();
};
$hxClasses["Juice"] = Juice;
Juice.__name__ = "Juice";
Juice.__super__ = flixel_FlxSprite;
Juice.prototype = $extend(flixel_FlxSprite.prototype,{
	start: function(StartX,StartY,Color,DestX,DestY) {
		var _gthis = this;
		this.reset(StartX - 4,StartY - 4);
		this.animation.play("play");
		this.set_color(flixel_util_FlxColor.fromString("#" + Color));
		flixel_tweens_FlxTween.tween(this,{ x : DestX - 4},.33,{ type : 8, ease : flixel_tweens_FlxEase.backIn});
		flixel_tweens_FlxTween.tween(this,{ y : DestY - 4},.33,{ type : 8, ease : flixel_tweens_FlxEase.circInOut, onComplete : function(_) {
			_gthis.kill();
		}});
	}
	,__class__: Juice
});
var Lambda = function() { };
$hxClasses["Lambda"] = Lambda;
Lambda.__name__ = "Lambda";
Lambda.array = function(it) {
	var a = [];
	var i = $getIterator(it);
	while(i.hasNext()) {
		var i1 = i.next();
		a.push(i1);
	}
	return a;
};
Lambda.exists = function(it,f) {
	var x = $getIterator(it);
	while(x.hasNext()) {
		var x1 = x.next();
		if(f(x1)) {
			return true;
		}
	}
	return false;
};
var ManifestResources = function() { };
$hxClasses["ManifestResources"] = ManifestResources;
ManifestResources.__name__ = "ManifestResources";
ManifestResources.preloadLibraries = null;
ManifestResources.preloadLibraryNames = null;
ManifestResources.rootPath = null;
ManifestResources.init = function(config) {
	ManifestResources.preloadLibraries = [];
	ManifestResources.preloadLibraryNames = [];
	ManifestResources.rootPath = null;
	if(config != null && Object.prototype.hasOwnProperty.call(config,"rootPath")) {
		ManifestResources.rootPath = Reflect.field(config,"rootPath");
	}
	if(ManifestResources.rootPath == null) {
		ManifestResources.rootPath = "./";
	}
	openfl_text_Font.registerFont(_$_$ASSET_$_$OPENFL_$_$assets_$fonts_$dejavusans_$ttf);
	openfl_text_Font.registerFont(_$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$nokiafc22_$ttf);
	openfl_text_Font.registerFont(_$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$monsterrat_$ttf);
	openfl_text_Font.registerFont(_$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$nokiafc23);
	openfl_text_Font.registerFont(_$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$monsterrat_$ttf1);
	var bundle;
	var data = "{\"name\":null,\"assets\":\"aoy4:pathy31:assets%2Fimages%2Faxol_logo.pngy4:sizei345y4:typey5:IMAGEy2:idR1y7:preloadtgoR0y32:assets%2Fimages%2Fbackground.pngR2i1275R3R4R5R7R6tgoR0y29:assets%2Fimages%2Fbarrier.pngR2i241R3R4R5R8R6tgoR0y30:assets%2Fimages%2Fcauldron.pngR2i226R3R4R5R9R6tgoR0y34:assets%2Fimages%2Fclose_button.pngR2i217R3R4R5R10R6tgoR0y36:assets%2Fimages%2Fcombat_effects.pngR2i574R3R4R5R11R6tgoR0y36:assets%2Fimages%2Fcredits_button.pngR2i590R3R4R5R12R6tgoR0y28:assets%2Fimages%2Fcursor.pngR2i318R3R4R5R13R6tgoR0y32:assets%2Fimages%2Fdark_frame.pngR2i112R3R4R5R14R6tgoR0y26:assets%2Fimages%2Fdemo.pngR2i1941R3R4R5R15R6tgoR0y26:assets%2Fimages%2Fdemo.xmlR2i2078R3y4:TEXTR5R16R6tgoR0y36:assets%2Fimages%2Fdoor_indicator.pngR2i320R3R4R5R18R6tgoR0y33:assets%2Fimages%2Fdown_button.pngR2i182R3R4R5R19R6tgoR0y34:assets%2Fimages%2Fenvironments.pngR2i4640R3R4R5R20R6tgoR0y33:assets%2Fimages%2Fexit_button.pngR2i456R3R4R5R21R6tgoR0y31:assets%2Fimages%2Fexplosion.pngR2i2452R3R4R5R22R6tgoR0y31:assets%2Fimages%2Fexplosion.xmlR2i1318R3R17R5R23R6tgoR0y32:assets%2Fimages%2Ffancy_font.pngR2i2395R3R4R5R24R6tgoR0y32:assets%2Fimages%2Ffancy_font.xmlR2i10139R3R17R5R25R6tgoR0y37:assets%2Fimages%2FGameFieldBorder.pngR2i81R3R4R5R26R6tgoR0y37:assets%2Fimages%2FGameFieldBottom.pngR2i103R3R4R5R27R6tgoR0y37:assets%2Fimages%2Fgame_over_scene.pngR2i3061R3R4R5R28R6tgoR0y32:assets%2Fimages%2Fgrass_back.pngR2i1046R3R4R5R29R6tgoR0y31:assets%2Fimages%2Fgrid_back.pngR2i111R3R4R5R30R6tgoR0y28:assets%2Fimages%2Fheroes.pngR2i3178R3R4R5R31R6tgoR0y31:assets%2Fimages%2Finfo_back.pngR2i215R3R4R5R32R6tgoR0y31:assets%2Fimages%2Finjustice.pngR2i999R3R4R5R33R6tgoR0y29:assets%2Fimages%2Fjuggler.pngR2i827R3R4R5R34R6tgoR0y27:assets%2Fimages%2Fjuice.pngR2i153R3R4R5R35R6tgoR0y35:assets%2Fimages%2Flarge_numbers.pngR2i588R3R4R5R36R6tgoR0y35:assets%2Fimages%2Flarge_numbers.xmlR2i1788R3R17R5R37R6tgoR0y31:assets%2Fimages%2Flich_lord.pngR2i157R3R4R5R38R6tgoR0y25:assets%2Fimages%2Fmap.pngR2i1287R3R4R5R39R6tgoR0y30:assets%2Fimages%2Fmap_node.pngR2i107R3R4R5R40R6tgoR0y32:assets%2Fimages%2Fmap_path_0.pngR2i156R3R4R5R41R6tgoR0y32:assets%2Fimages%2Fmap_path_1.pngR2i139R3R4R5R42R6tgoR0y32:assets%2Fimages%2Fmap_path_2.pngR2i178R3R4R5R43R6tgoR0y32:assets%2Fimages%2Fmap_path_3.pngR2i138R3R4R5R44R6tgoR0y32:assets%2Fimages%2Fmap_path_4.pngR2i183R3R4R5R45R6tgoR0y32:assets%2Fimages%2Fmap_path_5.pngR2i140R3R4R5R46R6tgoR0y28:assets%2Fimages%2Fmeteor.pngR2i260R3R4R5R47R6tgoR0y30:assets%2Fimages%2Fmonsters.pngR2i3471R3R4R5R48R6tgoR0y43:assets%2Fimages%2Fng%2Fng-medal-popup-A.pngR2i100786R3R4R5R49R6tgoR0y43:assets%2Fimages%2Fng%2Fng-medal-popup-B.pngR2i4443R3R4R5R50R6tgoR0y43:assets%2Fimages%2Fng%2Fng-medal-popup-C.pngR2i113325R3R4R5R51R6tgoR0y35:assets%2Fimages%2Fng%2Fno-medal.pngR2i2557R3R4R5R52R6tgoR0y37:assets%2Fimages%2Fparty_indicator.pngR2i181R3R4R5R53R6tgoR0y34:assets%2Fimages%2Fpause_button.pngR2i306R3R4R5R54R6tgoR0y33:assets%2Fimages%2Fplay_button.pngR2i447R3R4R5R55R6tgoR0y25:assets%2Fimages%2Fpop.pngR2i265R3R4R5R56R6tgoR0y29:assets%2Fimages%2Fpotions.pngR2i404R3R4R5R57R6tgoR0y35:assets%2Fimages%2Fprogress_back.pngR2i90R3R4R5R58R6tgoR0y34:assets%2Fimages%2Fprogress_cap.pngR2i81R3R4R5R59R6tgoR0y33:assets%2Fimages%2Fprompt_back.pngR2i231R3R4R5R60R6tgoR0y33:assets%2Fimages%2Fquit_button.pngR2i329R3R4R5R61R6tgoR0y34:assets%2Fimages%2Frefill_empty.pngR2i157R3R4R5R62R6tgoR0y33:assets%2Fimages%2Frefill_fill.pngR2i222R3R4R5R63R6tgoR0y35:assets%2Fimages%2Freplay_button.pngR2i521R3R4R5R64R6tgoR0y35:assets%2Fimages%2Fresume_button.pngR2i560R3R4R5R65R6tgoR0y32:assets%2Fimages%2Fscore_back.pngR2i228R3R4R5R66R6tgoR0y34:assets%2Fimages%2Fscreen_frame.pngR2i447R3R4R5R67R6tgoR0y30:assets%2Fimages%2Fselected.pngR2i121R3R4R5R68R6tgoR0y31:assets%2Fimages%2Fselecting.pngR2i113R3R4R5R69R6tgoR0y33:assets%2Fimages%2Fsimple_font.pngR2i670R3R4R5R70R6tgoR0y33:assets%2Fimages%2Fsimple_font.xmlR2i10340R3R17R5R71R6tgoR0y27:assets%2Fimages%2Fskull.pngR2i115R3R4R5R72R6tgoR0y30:assets%2Fimages%2Fsparkles.pngR2i131R3R4R5R73R6tgoR0y27:assets%2Fimages%2Fspawn.pngR2i440R3R4R5R74R6tgoR0y32:assets%2Fimages%2Fspell_back.pngR2i240R3R4R5R75R6tgoR0y36:assets%2Fimages%2FStandardBGTile.pngR2i134R3R4R5R76R6tgoR0y27:assets%2Fimages%2Fstory.pngR2i29527R3R4R5R77R6tgoR0y36:assets%2Fimages%2Fstriking-balls.pngR2i1109R3R4R5R78R6tgoR0y33:assets%2Fimages%2Ftiny_digits.pngR2i1584R3R4R5R79R6tgoR0y33:assets%2Fimages%2Ftiny_digits.xmlR2i1779R3R17R5R80R6tgoR0y27:assets%2Fimages%2Ftitle.pngR2i73368R3R4R5R81R6tgoR0y32:assets%2Fimages%2Ftitle_logo.pngR2i8503R3R4R5R82R6tgoR0y31:assets%2Fimages%2Ftransform.pngR2i180R3R4R5R83R6tgoR0y26:assets%2Fimages%2Ftube.pngR2i147R3R4R5R84R6tgoR0y32:assets%2Fimages%2Ftut_button.pngR2i307R3R4R5R85R6tgoR0y31:assets%2Fimages%2Fup_button.pngR2i146R3R4R5R86R6tgoR0y35:assets%2Fimages%2Fvictory_scene.pngR2i3067R3R4R5R87R6tgoR0y33:assets%2Fdata%2Fenvironments.jsonR2i944R3R17R5R88R6tgoR0y27:assets%2Fdata%2Fheroes.jsonR2i2065R3R17R5R89R6tgoR0y29:assets%2Fdata%2Fmonsters.jsonR2i5730R3R17R5R90R6tgoR2i956839R3y5:SOUNDR5y29:assets%2Fmusic%2Fgameloop.oggy9:pathGroupaR92hR6tgoR2i425571R3R91R5y26:assets%2Fmusic%2Ftitle.oggR93aR94hR6tgoR2i12770R3R91R5y27:assets%2Fsounds%2Fblock.wavR93aR95hR6tgoR2i12970R3R91R5y29:assets%2Fsounds%2Fboop_01.wavR93aR96hR6tgoR2i12970R3R91R5y29:assets%2Fsounds%2Fboop_02.wavR93aR97hR6tgoR2i12970R3R91R5y29:assets%2Fsounds%2Fboop_03.wavR93aR98hR6tgoR2i12970R3R91R5y29:assets%2Fsounds%2Fboop_04.wavR93aR99hR6tgoR2i12524R3R91R5y27:assets%2Fsounds%2Fclick.wavR93aR100hR6tgoR2i10188R3R91R5y28:assets%2Fsounds%2Fdamage.wavR93aR101hR6tgoR2i18792R3R91R5y27:assets%2Fsounds%2Fdeath.wavR93aR102hR6tgoR2i212436R3R91R5y26:assets%2Fsounds%2Fdrop.wavR93aR103hR6tgoR2i31752R3R91R5y35:assets%2Fsounds%2Ffinished_area.wavR93aR104hR6tgoR2i10188R3R91R5y33:assets%2Fsounds%2Fhit_barrier.wavR93aR105hR6tgoR2i10188R3R91R5y32:assets%2Fsounds%2Fhover_card.wavR93aR106hR6tgoR2i48188R3R91R5y34:assets%2Fsounds%2Fmake_barrier.wavR93aR107hR6tgoR2i29864R3R91R5y27:assets%2Fsounds%2Fmatch.wavR93aR108hR6tgoR2i64390R3R91R5y38:assets%2Fsounds%2Fmeteor_impact_01.wavR93aR109hR6tgoR2i54480R3R91R5y38:assets%2Fsounds%2Fmeteor_impact_02.wavR93aR110hR6tgoR2i57774R3R91R5y38:assets%2Fsounds%2Fmeteor_impact_03.wavR93aR111hR6tgoR2i51856R3R91R5y32:assets%2Fsounds%2Fnew_blocks.wavR93aR112hR6tgoR2i194382R3R91R5y34:assets%2Fsounds%2Fng_medal_GET.wavR93aR113hR6tgoR2i143694R3R91R5y34:assets%2Fsounds%2Fng_medal_GOT.wavR93aR114hR6tgoR2i16058R3R91R5y28:assets%2Fsounds%2Fpotion.wavR93aR115hR6tgoR2i21182R3R91R5y33:assets%2Fsounds%2Fskull_crush.wavR93aR116hR6tgoR2i24210R3R91R5y27:assets%2Fsounds%2Fspawn.wavR93aR117hR6tgoR2i55934R3R91R5y27:assets%2Fsounds%2Fspell.wavR93aR118hR6tgoR2i55266R3R91R5y34:assets%2Fsounds%2Fspell_select.wavR93aR119hR6tgoR2i10188R3R91R5y29:assets%2Fsounds%2Fstep_01.wavR93aR120hR6tgoR2i10188R3R91R5y29:assets%2Fsounds%2Fstep_02.wavR93aR121hR6tgoR2i19570R3R91R5y26:assets%2Fsounds%2Fswap.wavR93aR122hR6tgoR2i57304R3R91R5y32:assets%2Fsounds%2Fthunder_01.wavR93aR123hR6tgoR2i67010R3R91R5y32:assets%2Fsounds%2Fthunder_02.wavR93aR124hR6tgoR2i26460R3R91R5y30:assets%2Fsounds%2Fto_skull.wavR93aR125hR6tgoR2i622020R3y4:FONTy9:classNamey36:__ASSET__assets_fonts_dejavusans_ttfR5y31:assets%2Ffonts%2FDejaVuSans.ttfR6tgoR2i2114R3y5:MUSICR5y26:flixel%2Fsounds%2Fbeep.mp3R93aR131y26:flixel%2Fsounds%2Fbeep.oggR131R132hR6tgoR2i39706R3R130R5y28:flixel%2Fsounds%2Fflixel.mp3R93aR133y28:flixel%2Fsounds%2Fflixel.oggR133R134hR6tgoR2i5794R3R91R5R132R93aR131R132R131R132hgoR2i33629R3R91R5R134R93aR133R134R133R134hgoR2i15744R3R126R127y35:__ASSET__flixel_fonts_nokiafc22_ttfR5y30:flixel%2Ffonts%2Fnokiafc22.ttfR6tgoR2i29724R3R126R127y36:__ASSET__flixel_fonts_monsterrat_ttfR5y31:flixel%2Ffonts%2Fmonsterrat.ttfR6tgoR0y33:flixel%2Fimages%2Fui%2Fbutton.pngR2i519R3R4R5R139R6tgoR0y36:flixel%2Fimages%2Flogo%2Fdefault.pngR2i3280R3R4R5R140R6tgoR2i2114R3R130R5R131R93aR131R132R131R132hgoR2i39706R3R130R5R133R93aR133R134R133R134hgoR2i5794R3R91R5R132R93aR131R132R131R132hgoR2i33629R3R91R5R134R93aR133R134R133R134hgoR2i15744R3R126R127y31:__ASSET__flixel_fonts_nokiafc23R5R136R6tgoR2i29724R3R126R127y37:__ASSET__flixel_fonts_monsterrat_ttf1R5R138R6tgoR0R139R2i519R3R4R5R139R6tgoR0R140R2i3280R3R4R5R140R6tgoR0y33:axollib%2Fimages%2Fcolor-logo.pngR2i429R3R4R5R143R6tgoR0y35:axollib%2Fimages%2Fcolor-stroke.pngR2i1350R3R4R5R144R6tgoR2i576182R3R91R5y32:axollib%2Fsounds%2Fmadeinstl.wavR93aR145hR6tgoR0y36:axollib%2Fimages%2Fmadeinstlouis.pngR2i230R3R4R5R146R6tgoR0y43:axollib%2Fimages%2Fwhite-logo-w-rainbow.pngR2i596R3R4R5R147R6tgh\",\"rootPath\":null,\"version\":2,\"libraryArgs\":[],\"libraryType\":null}";
	var manifest = lime_utils_AssetManifest.parse(data,ManifestResources.rootPath);
	var library = lime_utils_AssetLibrary.fromManifest(manifest);
	lime_utils_Assets.registerLibrary("default",library);
	library = lime_utils_Assets.getLibrary("default");
	if(library != null) {
		ManifestResources.preloadLibraries.push(library);
	} else {
		ManifestResources.preloadLibraryNames.push("default");
	}
};
var lime_text_Font = function(name) {
	if(name != null) {
		this.name = name;
	}
	if(!this.__init) {
		if(this.ascender == undefined) {
			this.ascender = 0;
		}
		if(this.descender == undefined) {
			this.descender = 0;
		}
		if(this.height == undefined) {
			this.height = 0;
		}
		if(this.numGlyphs == undefined) {
			this.numGlyphs = 0;
		}
		if(this.underlinePosition == undefined) {
			this.underlinePosition = 0;
		}
		if(this.underlineThickness == undefined) {
			this.underlineThickness = 0;
		}
		if(this.unitsPerEM == undefined) {
			this.unitsPerEM = 0;
		}
		if(this.__fontID != null) {
			if(lime_utils_Assets.isLocal(this.__fontID)) {
				this.__fromBytes(lime_utils_Assets.getBytes(this.__fontID));
			}
		} else if(this.__fontPath != null) {
			this.__fromFile(this.__fontPath);
		}
	}
};
$hxClasses["lime.text.Font"] = lime_text_Font;
lime_text_Font.__name__ = "lime.text.Font";
lime_text_Font.fromBytes = function(bytes) {
	if(bytes == null) {
		return null;
	}
	var font = new lime_text_Font();
	font.__fromBytes(bytes);
	return font;
};
lime_text_Font.fromFile = function(path) {
	if(path == null) {
		return null;
	}
	var font = new lime_text_Font();
	font.__fromFile(path);
	return font;
};
lime_text_Font.loadFromBytes = function(bytes) {
	return lime_app_Future.withValue(lime_text_Font.fromBytes(bytes));
};
lime_text_Font.loadFromFile = function(path) {
	var request = new lime_net__$HTTPRequest_$lime_$text_$Font();
	return request.load(path).then(function(font) {
		if(font != null) {
			return lime_app_Future.withValue(font);
		} else {
			return lime_app_Future.withError("");
		}
	});
};
lime_text_Font.loadFromName = function(path) {
	var font = new lime_text_Font();
	return font.__loadFromName(path);
};
lime_text_Font.__measureFontNode = function(fontFamily) {
	var node = window.document.createElement("span");
	node.setAttribute("aria-hidden","true");
	var text = window.document.createTextNode("BESbswy");
	node.appendChild(text);
	var style = node.style;
	style.display = "block";
	style.position = "absolute";
	style.top = "-9999px";
	style.left = "-9999px";
	style.fontSize = "300px";
	style.width = "auto";
	style.height = "auto";
	style.lineHeight = "normal";
	style.margin = "0";
	style.padding = "0";
	style.fontVariant = "normal";
	style.whiteSpace = "nowrap";
	style.fontFamily = fontFamily;
	window.document.body.appendChild(node);
	return node;
};
lime_text_Font.prototype = {
	ascender: null
	,descender: null
	,height: null
	,name: null
	,numGlyphs: null
	,src: null
	,underlinePosition: null
	,underlineThickness: null
	,unitsPerEM: null
	,__fontID: null
	,__fontPath: null
	,__init: null
	,decompose: function() {
		return null;
	}
	,getGlyph: function(character) {
		return -1;
	}
	,getGlyphs: function(characters) {
		if(characters == null) {
			characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^`'\"/\\&*()[]{}<>|:;_-+=?,. ";
		}
		return null;
	}
	,getGlyphMetrics: function(glyph) {
		return null;
	}
	,renderGlyph: function(glyph,fontSize) {
		return null;
	}
	,renderGlyphs: function(glyphs,fontSize) {
		return null;
	}
	,__copyFrom: function(other) {
		if(other != null) {
			this.ascender = other.ascender;
			this.descender = other.descender;
			this.height = other.height;
			this.name = other.name;
			this.numGlyphs = other.numGlyphs;
			this.src = other.src;
			this.underlinePosition = other.underlinePosition;
			this.underlineThickness = other.underlineThickness;
			this.unitsPerEM = other.unitsPerEM;
			this.__fontID = other.__fontID;
			this.__fontPath = other.__fontPath;
			this.__init = true;
		}
	}
	,__fromBytes: function(bytes) {
		this.__fontPath = null;
	}
	,__fromFile: function(path) {
		this.__fontPath = path;
	}
	,__initializeSource: function() {
		this.__init = true;
	}
	,__loadFromName: function(name) {
		var _gthis = this;
		var promise = new lime_app_Promise();
		this.name = name;
		var userAgent = $global.navigator.userAgent.toLowerCase();
		var isSafari = userAgent.indexOf(" safari/") >= 0 && userAgent.indexOf(" chrome/") < 0;
		var isUIWebView = new EReg("(iPhone|iPod|iPad).*AppleWebKit(?!.*Version)","i").match(userAgent);
		if(!isSafari && !isUIWebView && (window.document.fonts && ($_=window.document.fonts,$bind($_,$_.load)))) {
			window.document.fonts.load("1em '" + name + "'").then(function(_) {
				promise.complete(_gthis);
			},function(_) {
				lime_utils_Log.warn("Could not load web font \"" + name + "\"",{ fileName : "lime/text/Font.hx", lineNumber : 513, className : "lime.text.Font", methodName : "__loadFromName"});
				promise.complete(_gthis);
			});
		} else {
			var node1 = lime_text_Font.__measureFontNode("'" + name + "', sans-serif");
			var node2 = lime_text_Font.__measureFontNode("'" + name + "', serif");
			var width1 = node1.offsetWidth;
			var width2 = node2.offsetWidth;
			var interval = -1;
			var timeout = 3000;
			var intervalLength = 50;
			var intervalCount = 0;
			var loaded;
			var timeExpired;
			var checkFont = function() {
				intervalCount += 1;
				loaded = node1.offsetWidth != width1 || node2.offsetWidth != width2;
				timeExpired = intervalCount * intervalLength >= timeout;
				if(loaded || timeExpired) {
					window.clearInterval(interval);
					node1.parentNode.removeChild(node1);
					node2.parentNode.removeChild(node2);
					node1 = null;
					node2 = null;
					if(timeExpired) {
						lime_utils_Log.warn("Could not load web font \"" + name + "\"",{ fileName : "lime/text/Font.hx", lineNumber : 548, className : "lime.text.Font", methodName : "__loadFromName"});
					}
					promise.complete(_gthis);
				}
			};
			interval = window.setInterval(checkFont,intervalLength);
		}
		return promise.future;
	}
	,__setSize: function(size) {
	}
	,__class__: lime_text_Font
};
var _$_$ASSET_$_$assets_$fonts_$dejavusans_$ttf = $hx_exports["__ASSET__assets_fonts_dejavusans_ttf"] = function() {
	this.ascender = 1901;
	this.descender = -483;
	this.height = 2384;
	this.numGlyphs = 5466;
	this.underlinePosition = -175;
	this.underlineThickness = 90;
	this.unitsPerEM = 2048;
	this.name = "DejaVu Sans";
	lime_text_Font.call(this);
};
$hxClasses["__ASSET__assets_fonts_dejavusans_ttf"] = _$_$ASSET_$_$assets_$fonts_$dejavusans_$ttf;
_$_$ASSET_$_$assets_$fonts_$dejavusans_$ttf.__name__ = "__ASSET__assets_fonts_dejavusans_ttf";
_$_$ASSET_$_$assets_$fonts_$dejavusans_$ttf.__super__ = lime_text_Font;
_$_$ASSET_$_$assets_$fonts_$dejavusans_$ttf.prototype = $extend(lime_text_Font.prototype,{
	__class__: _$_$ASSET_$_$assets_$fonts_$dejavusans_$ttf
});
var _$_$ASSET_$_$flixel_$fonts_$nokiafc22_$ttf = $hx_exports["__ASSET__flixel_fonts_nokiafc22_ttf"] = function() {
	this.ascender = 2048;
	this.descender = -512;
	this.height = 2816;
	this.numGlyphs = 172;
	this.underlinePosition = -640;
	this.underlineThickness = 256;
	this.unitsPerEM = 2048;
	this.name = "Nokia Cellphone FC Small";
	lime_text_Font.call(this);
};
$hxClasses["__ASSET__flixel_fonts_nokiafc22_ttf"] = _$_$ASSET_$_$flixel_$fonts_$nokiafc22_$ttf;
_$_$ASSET_$_$flixel_$fonts_$nokiafc22_$ttf.__name__ = "__ASSET__flixel_fonts_nokiafc22_ttf";
_$_$ASSET_$_$flixel_$fonts_$nokiafc22_$ttf.__super__ = lime_text_Font;
_$_$ASSET_$_$flixel_$fonts_$nokiafc22_$ttf.prototype = $extend(lime_text_Font.prototype,{
	__class__: _$_$ASSET_$_$flixel_$fonts_$nokiafc22_$ttf
});
var _$_$ASSET_$_$flixel_$fonts_$monsterrat_$ttf = $hx_exports["__ASSET__flixel_fonts_monsterrat_ttf"] = function() {
	this.ascender = 968;
	this.descender = -251;
	this.height = 1219;
	this.numGlyphs = 263;
	this.underlinePosition = -150;
	this.underlineThickness = 50;
	this.unitsPerEM = 1000;
	this.name = "Monsterrat";
	lime_text_Font.call(this);
};
$hxClasses["__ASSET__flixel_fonts_monsterrat_ttf"] = _$_$ASSET_$_$flixel_$fonts_$monsterrat_$ttf;
_$_$ASSET_$_$flixel_$fonts_$monsterrat_$ttf.__name__ = "__ASSET__flixel_fonts_monsterrat_ttf";
_$_$ASSET_$_$flixel_$fonts_$monsterrat_$ttf.__super__ = lime_text_Font;
_$_$ASSET_$_$flixel_$fonts_$monsterrat_$ttf.prototype = $extend(lime_text_Font.prototype,{
	__class__: _$_$ASSET_$_$flixel_$fonts_$monsterrat_$ttf
});
var _$_$ASSET_$_$flixel_$fonts_$nokiafc23 = $hx_exports["__ASSET__flixel_fonts_nokiafc23"] = function() {
	this.ascender = null;
	this.descender = null;
	this.height = null;
	this.numGlyphs = null;
	this.underlinePosition = null;
	this.underlineThickness = null;
	this.unitsPerEM = null;
	this.name = "Nokia Cellphone FC Small";
	lime_text_Font.call(this);
};
$hxClasses["__ASSET__flixel_fonts_nokiafc23"] = _$_$ASSET_$_$flixel_$fonts_$nokiafc23;
_$_$ASSET_$_$flixel_$fonts_$nokiafc23.__name__ = "__ASSET__flixel_fonts_nokiafc23";
_$_$ASSET_$_$flixel_$fonts_$nokiafc23.__super__ = lime_text_Font;
_$_$ASSET_$_$flixel_$fonts_$nokiafc23.prototype = $extend(lime_text_Font.prototype,{
	__class__: _$_$ASSET_$_$flixel_$fonts_$nokiafc23
});
var _$_$ASSET_$_$flixel_$fonts_$monsterrat_$ttf1 = $hx_exports["__ASSET__flixel_fonts_monsterrat_ttf1"] = function() {
	this.ascender = null;
	this.descender = null;
	this.height = null;
	this.numGlyphs = null;
	this.underlinePosition = null;
	this.underlineThickness = null;
	this.unitsPerEM = null;
	this.name = "Monsterrat";
	lime_text_Font.call(this);
};
$hxClasses["__ASSET__flixel_fonts_monsterrat_ttf1"] = _$_$ASSET_$_$flixel_$fonts_$monsterrat_$ttf1;
_$_$ASSET_$_$flixel_$fonts_$monsterrat_$ttf1.__name__ = "__ASSET__flixel_fonts_monsterrat_ttf1";
_$_$ASSET_$_$flixel_$fonts_$monsterrat_$ttf1.__super__ = lime_text_Font;
_$_$ASSET_$_$flixel_$fonts_$monsterrat_$ttf1.prototype = $extend(lime_text_Font.prototype,{
	__class__: _$_$ASSET_$_$flixel_$fonts_$monsterrat_$ttf1
});
var openfl_text_Font = function(name) {
	lime_text_Font.call(this,name);
};
$hxClasses["openfl.text.Font"] = openfl_text_Font;
openfl_text_Font.__name__ = "openfl.text.Font";
openfl_text_Font.enumerateFonts = function(enumerateDeviceFonts) {
	if(enumerateDeviceFonts == null) {
		enumerateDeviceFonts = false;
	}
	return openfl_text_Font.__registeredFonts;
};
openfl_text_Font.fromBytes = function(bytes) {
	var font = new openfl_text_Font();
	font.__fromBytes(openfl_utils_ByteArray.toBytes(bytes));
	return font;
};
openfl_text_Font.fromFile = function(path) {
	var font = new openfl_text_Font();
	font.__fromFile(path);
	return font;
};
openfl_text_Font.loadFromBytes = function(bytes) {
	return lime_text_Font.loadFromBytes(openfl_utils_ByteArray.toBytes(bytes)).then(function(limeFont) {
		var font = new openfl_text_Font();
		font.__fromLimeFont(limeFont);
		return lime_app_Future.withValue(font);
	});
};
openfl_text_Font.loadFromFile = function(path) {
	return lime_text_Font.loadFromFile(path).then(function(limeFont) {
		var font = new openfl_text_Font();
		font.__fromLimeFont(limeFont);
		return lime_app_Future.withValue(font);
	});
};
openfl_text_Font.loadFromName = function(path) {
	return lime_text_Font.loadFromName(path).then(function(limeFont) {
		var font = new openfl_text_Font();
		font.__fromLimeFont(limeFont);
		return lime_app_Future.withValue(font);
	});
};
openfl_text_Font.registerFont = function(font) {
	var instance = null;
	if(js_Boot.getClass(font) == null) {
		instance = js_Boot.__cast(Type.createInstance(font,[]) , openfl_text_Font);
	} else {
		instance = js_Boot.__cast(font , openfl_text_Font);
	}
	if(instance != null) {
		openfl_text_Font.__registeredFonts.push(instance);
		openfl_text_Font.__fontByName.h[instance.name] = instance;
	}
};
openfl_text_Font.__super__ = lime_text_Font;
openfl_text_Font.prototype = $extend(lime_text_Font.prototype,{
	fontStyle: null
	,fontType: null
	,__initialized: null
	,__fromLimeFont: function(font) {
		this.__copyFrom(font);
	}
	,__initialize: function() {
		return this.__initialized;
	}
	,get_fontName: function() {
		return this.name;
	}
	,set_fontName: function(value) {
		return this.name = value;
	}
	,__class__: openfl_text_Font
	,__properties__: {set_fontName:"set_fontName",get_fontName:"get_fontName"}
});
var _$_$ASSET_$_$OPENFL_$_$assets_$fonts_$dejavusans_$ttf = $hx_exports["__ASSET__OPENFL__assets_fonts_dejavusans_ttf"] = function() {
	this.__fromLimeFont(new _$_$ASSET_$_$assets_$fonts_$dejavusans_$ttf());
	openfl_text_Font.call(this);
};
$hxClasses["__ASSET__OPENFL__assets_fonts_dejavusans_ttf"] = _$_$ASSET_$_$OPENFL_$_$assets_$fonts_$dejavusans_$ttf;
_$_$ASSET_$_$OPENFL_$_$assets_$fonts_$dejavusans_$ttf.__name__ = "__ASSET__OPENFL__assets_fonts_dejavusans_ttf";
_$_$ASSET_$_$OPENFL_$_$assets_$fonts_$dejavusans_$ttf.__super__ = openfl_text_Font;
_$_$ASSET_$_$OPENFL_$_$assets_$fonts_$dejavusans_$ttf.prototype = $extend(openfl_text_Font.prototype,{
	__class__: _$_$ASSET_$_$OPENFL_$_$assets_$fonts_$dejavusans_$ttf
});
var _$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$nokiafc22_$ttf = $hx_exports["__ASSET__OPENFL__flixel_fonts_nokiafc22_ttf"] = function() {
	this.__fromLimeFont(new _$_$ASSET_$_$flixel_$fonts_$nokiafc22_$ttf());
	openfl_text_Font.call(this);
};
$hxClasses["__ASSET__OPENFL__flixel_fonts_nokiafc22_ttf"] = _$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$nokiafc22_$ttf;
_$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$nokiafc22_$ttf.__name__ = "__ASSET__OPENFL__flixel_fonts_nokiafc22_ttf";
_$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$nokiafc22_$ttf.__super__ = openfl_text_Font;
_$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$nokiafc22_$ttf.prototype = $extend(openfl_text_Font.prototype,{
	__class__: _$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$nokiafc22_$ttf
});
var _$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$monsterrat_$ttf = $hx_exports["__ASSET__OPENFL__flixel_fonts_monsterrat_ttf"] = function() {
	this.__fromLimeFont(new _$_$ASSET_$_$flixel_$fonts_$monsterrat_$ttf());
	openfl_text_Font.call(this);
};
$hxClasses["__ASSET__OPENFL__flixel_fonts_monsterrat_ttf"] = _$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$monsterrat_$ttf;
_$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$monsterrat_$ttf.__name__ = "__ASSET__OPENFL__flixel_fonts_monsterrat_ttf";
_$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$monsterrat_$ttf.__super__ = openfl_text_Font;
_$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$monsterrat_$ttf.prototype = $extend(openfl_text_Font.prototype,{
	__class__: _$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$monsterrat_$ttf
});
var _$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$nokiafc23 = $hx_exports["__ASSET__OPENFL__flixel_fonts_nokiafc23"] = function() {
	this.__fromLimeFont(new _$_$ASSET_$_$flixel_$fonts_$nokiafc23());
	openfl_text_Font.call(this);
};
$hxClasses["__ASSET__OPENFL__flixel_fonts_nokiafc23"] = _$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$nokiafc23;
_$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$nokiafc23.__name__ = "__ASSET__OPENFL__flixel_fonts_nokiafc23";
_$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$nokiafc23.__super__ = openfl_text_Font;
_$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$nokiafc23.prototype = $extend(openfl_text_Font.prototype,{
	__class__: _$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$nokiafc23
});
var _$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$monsterrat_$ttf1 = $hx_exports["__ASSET__OPENFL__flixel_fonts_monsterrat_ttf1"] = function() {
	this.__fromLimeFont(new _$_$ASSET_$_$flixel_$fonts_$monsterrat_$ttf1());
	openfl_text_Font.call(this);
};
$hxClasses["__ASSET__OPENFL__flixel_fonts_monsterrat_ttf1"] = _$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$monsterrat_$ttf1;
_$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$monsterrat_$ttf1.__name__ = "__ASSET__OPENFL__flixel_fonts_monsterrat_ttf1";
_$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$monsterrat_$ttf1.__super__ = openfl_text_Font;
_$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$monsterrat_$ttf1.prototype = $extend(openfl_text_Font.prototype,{
	__class__: _$_$ASSET_$_$OPENFL_$_$flixel_$fonts_$monsterrat_$ttf1
});
Math.__name__ = "Math";
var Meteor = function() {
	this.targetY = 0;
	this.targetX = 0;
	flixel_FlxSprite.call(this);
	this.loadGraphic("assets/images/meteor.png");
	this.kill();
};
$hxClasses["Meteor"] = Meteor;
Meteor.__name__ = "Meteor";
Meteor.__super__ = flixel_FlxSprite;
Meteor.prototype = $extend(flixel_FlxSprite.prototype,{
	targetX: null
	,targetY: null
	,callback: null
	,start: function(TargetX,TargetY,Delay,Callback) {
		var _gthis = this;
		this.targetX = TargetX;
		this.targetY = TargetY;
		this.callback = Callback;
		this.reset(this.targetX,this.targetY - (flixel_FlxG.height + 50) - this.get_height());
		this.scale.set(4,4);
		flixel_tweens_FlxTween.num(0,1,1,{ type : 8, ease : flixel_tweens_FlxEase.sineIn, startDelay : Delay, onComplete : function(_) {
			_gthis.kill();
			if(_gthis.callback != null) {
				_gthis.callback();
			}
		}},function(Value) {
			_gthis.scale.set(4 + Value * -3,4 + Value * -3);
			var _gthis1 = _gthis;
			var tmp = _gthis.targetY - _gthis.get_height();
			var a = flixel_FlxG.height + 50;
			_gthis1.set_y(tmp - (a + Value * (0 - a)));
		});
	}
	,__class__: Meteor
});
var MonsterData = function(Name,Id,Hp,Att,Def,SAtt,SDef,Color) {
	this.sdef = 0;
	this.satt = 0;
	this.def = 0;
	this.att = 0;
	this.hp = 0;
	this.id = -1;
	this.name = "";
	this.name = Name;
	this.id = Id;
	this.hp = Hp;
	this.att = Att;
	this.def = Def;
	this.satt = SAtt;
	this.sdef = SDef;
	this.color = Color;
};
$hxClasses["MonsterData"] = MonsterData;
MonsterData.__name__ = "MonsterData";
MonsterData.data = null;
MonsterData.monstersById = null;
MonsterData.monstersByName = null;
MonsterData.initData = function() {
	MonsterData.data = [];
	var json = JSON.parse(lime_utils_Assets.getText("assets/data/monsters.json"));
	var _g = 0;
	var _g1 = json.monsters;
	while(_g < _g1.length) {
		var m = _g1[_g];
		++_g;
		MonsterData.data.push(new MonsterData(m.name,Std.parseInt(m.id),Std.parseInt(m.hp),Std.parseInt(m.att),Std.parseInt(m.def),Std.parseInt(m.satt),Std.parseInt(m.sdef),m.color));
	}
	MonsterData.monstersById = new haxe_ds_IntMap();
	MonsterData.monstersByName = new haxe_ds_StringMap();
	var _g = 0;
	var _g1 = MonsterData.data.length;
	while(_g < _g1) {
		var id = _g++;
		MonsterData.monstersById.h[MonsterData.data[id].id] = id;
		MonsterData.monstersByName.h[MonsterData.data[id].name] = id;
	}
};
MonsterData.getFromID = function(Id) {
	if(MonsterData.monstersById.h.hasOwnProperty(Id)) {
		var m = MonsterData.monstersById.h[Id];
		return MonsterData.data[m].copy();
	}
	return null;
};
MonsterData.getFromName = function(Name) {
	if(Object.prototype.hasOwnProperty.call(MonsterData.monstersByName.h,Name)) {
		var m = MonsterData.monstersByName.h[Name];
		return MonsterData.data[m].copy();
	}
	return null;
};
MonsterData.prototype = {
	name: null
	,id: null
	,hp: null
	,att: null
	,def: null
	,satt: null
	,sdef: null
	,color: null
	,copy: function() {
		return new MonsterData(this.name,this.id,this.hp,this.att,this.def,this.satt,this.sdef,this.color);
	}
	,__class__: MonsterData
};
var MonsterInfo = function(X,Y,MonsterName) {
	this.alpha = 1;
	flixel_group_FlxTypedGroup.call(this);
	var mDef = MonsterData.getFromName(MonsterName);
	this.monster = new flixel_FlxSprite();
	this.monster.set_x(X + 2);
	this.monster.set_y(Y + 2);
	this.monster.loadGraphic("assets/images/monsters.png",true,8,8);
	this.monster.animation.set_frameIndex(mDef.id);
	this.name = new flixel_text_FlxBitmapText(flixel_graphics_frames_FlxBitmapFont.fromAngelCode("assets/images/simple_font.png","assets/images/simple_font.xml"));
	this.name.set_text(mDef.name);
	this.name.set_borderStyle(flixel_text_FlxTextBorderStyle.SHADOW);
	this.name.set_borderColor(-15658735);
	this.name.set_borderSize(1);
	this.name.set_x(this.monster.x + this.monster.get_width() + 2);
	this.name.set_y(Y + 3);
	this.hpLabel = new flixel_text_FlxBitmapText(flixel_graphics_frames_FlxBitmapFont.fromAngelCode("assets/images/simple_font.png","assets/images/simple_font.xml"));
	this.hpLabel.set_borderStyle(flixel_text_FlxTextBorderStyle.SHADOW);
	this.hpLabel.set_borderColor(-15658735);
	this.hpLabel.set_borderSize(1);
	this.hpLabel.set_text("H");
	this.hpLabel.set_x(X + 2);
	this.hpLabel.set_y(this.monster.y + this.monster.get_height() + 2);
	var amt = mDef.hp / 25 * 25;
	amt = Math.max(1,amt);
	this.hpBar = new flixel_FlxSprite();
	this.hpBar.makeGraphic(Math.round(amt),4,-16744448);
	this.hpBar.set_x(this.hpLabel.x + this.hpLabel.get_width());
	this.hpBar.set_y(this.hpLabel.y + 2);
	this.attLabel = new flixel_text_FlxBitmapText(flixel_graphics_frames_FlxBitmapFont.fromAngelCode("assets/images/simple_font.png","assets/images/simple_font.xml"));
	this.attLabel.set_borderStyle(flixel_text_FlxTextBorderStyle.SHADOW);
	this.attLabel.set_borderColor(-15658735);
	this.attLabel.set_borderSize(1);
	this.attLabel.set_text(mDef.att == 0 ? "Ã©" : "Ã¢");
	this.attLabel.set_x(this.hpLabel.x);
	this.attLabel.set_y(this.hpLabel.y + this.hpLabel.get_height());
	amt = (mDef.att == 0 ? mDef.satt : mDef.att) / 25 * 25;
	if((mDef.att == 0 ? mDef.satt : mDef.att) > 0) {
		amt = Math.max(1,amt);
		this.attBar = new flixel_FlxSprite();
		this.attBar.makeGraphic(Math.round(amt),4,mDef.att == 0 ? -65281 : -65536);
		this.attBar.set_x(this.hpBar.x);
		this.attBar.set_y(this.attLabel.y + 2);
	}
	this.pdefLabel = new flixel_text_FlxBitmapText(flixel_graphics_frames_FlxBitmapFont.fromAngelCode("assets/images/simple_font.png","assets/images/simple_font.xml"));
	this.pdefLabel.set_borderStyle(flixel_text_FlxTextBorderStyle.SHADOW);
	this.pdefLabel.set_borderColor(-15658735);
	this.pdefLabel.set_borderSize(1);
	this.pdefLabel.set_text("P");
	this.pdefLabel.set_x(this.hpLabel.x + this.hpLabel.get_width() + 53);
	this.pdefLabel.set_y(this.hpLabel.y);
	amt = mDef.def / 25 * 25;
	if(mDef.def > 0) {
		amt = Math.max(1,amt);
		this.pdefBar = new flixel_FlxSprite();
		this.pdefBar.makeGraphic(Math.round(amt),4,-256);
		this.pdefBar.set_x(this.pdefLabel.x - amt - 1);
		this.pdefBar.set_y(this.hpBar.y);
	}
	this.sdefLabel = new flixel_text_FlxBitmapText(flixel_graphics_frames_FlxBitmapFont.fromAngelCode("assets/images/simple_font.png","assets/images/simple_font.xml"));
	this.sdefLabel.set_borderStyle(flixel_text_FlxTextBorderStyle.SHADOW);
	this.sdefLabel.set_borderColor(-15658735);
	this.sdefLabel.set_borderSize(1);
	this.sdefLabel.set_text("S");
	this.sdefLabel.set_x(this.hpLabel.x + this.hpLabel.get_width() + 53);
	this.sdefLabel.set_y(this.attLabel.y);
	amt = mDef.sdef / 25 * 25;
	if(mDef.sdef > 0) {
		amt = Math.max(1,amt);
		this.sdefBar = new flixel_FlxSprite();
		this.sdefBar.makeGraphic(Math.round(amt),4,-8388480);
		this.sdefBar.set_x(this.sdefLabel.x - amt - 1);
		this.sdefBar.set_y(this.sdefLabel.y + 2);
	}
	this.back = new flixel_FlxSprite();
	this.back.loadGraphic("assets/images/info_back.png");
	this.back.set_x(X);
	this.back.set_y(Y);
	this.back.set_color(flixel_util_FlxColor.fromString("#" + mDef.color));
	this.add(this.back);
	this.add(this.name);
	this.add(this.monster);
	this.add(this.hpLabel);
	this.add(this.attLabel);
	this.add(this.pdefLabel);
	this.add(this.sdefLabel);
	this.add(this.hpBar);
	if(this.attBar != null) {
		this.add(this.attBar);
	}
	if(this.pdefBar != null) {
		this.add(this.pdefBar);
	}
	if(this.sdefBar != null) {
		this.add(this.sdefBar);
	}
};
$hxClasses["MonsterInfo"] = MonsterInfo;
MonsterInfo.__name__ = "MonsterInfo";
MonsterInfo.__super__ = flixel_group_FlxTypedGroup;
MonsterInfo.prototype = $extend(flixel_group_FlxTypedGroup.prototype,{
	monster: null
	,name: null
	,hpBar: null
	,attBar: null
	,sdefBar: null
	,pdefBar: null
	,back: null
	,hpLabel: null
	,attLabel: null
	,pdefLabel: null
	,sdefLabel: null
	,alpha: null
	,set_alpha: function(Value) {
		var lowerBound = Value < 0 ? 0 : Value;
		this.alpha = lowerBound > 1 ? 1 : lowerBound;
		this.back.set_alpha(this.alpha);
		this.name.set_alpha(this.alpha);
		this.monster.set_alpha(this.alpha);
		this.hpLabel.set_alpha(this.alpha);
		this.attLabel.set_alpha(this.alpha);
		this.pdefLabel.set_alpha(this.alpha);
		this.sdefLabel.set_alpha(this.alpha);
		this.hpBar.set_alpha(this.alpha);
		if(this.attBar != null) {
			this.attBar.set_alpha(this.alpha);
		}
		if(this.pdefBar != null) {
			this.pdefBar.set_alpha(this.alpha);
		}
		if(this.sdefBar != null) {
			this.sdefBar.set_alpha(this.alpha);
		}
		return this.alpha;
	}
	,__class__: MonsterInfo
	,__properties__: $extend(flixel_group_FlxTypedGroup.prototype.__properties__,{set_alpha:"set_alpha"})
});
var MonsterQueue = function(Parent) {
	flixel_FlxSprite.call(this);
	this.parent = Parent;
	this.makeGraphic(60,2,0,true,"mqueue");
};
$hxClasses["MonsterQueue"] = MonsterQueue;
MonsterQueue.__name__ = "MonsterQueue";
MonsterQueue.__super__ = flixel_FlxSprite;
MonsterQueue.prototype = $extend(flixel_FlxSprite.prototype,{
	parent: null
	,update: function(elapsed) {
		this.get_pixels().fillRect(this.get_pixels().rect,0);
		var pX = 0;
		var d = null;
		var r = new openfl_geom_Rectangle(0,0,2,2);
		var _g = 0;
		var _g1 = this.parent.monsterQueue;
		while(_g < _g1.length) {
			var m = _g1[_g];
			++_g;
			if(pX >= 20) {
				break;
			}
			d = MonsterData.getFromID(m);
			r.x = pX * 3;
			this.get_pixels().fillRect(r,flixel_util_FlxColor.fromString("#" + d.color));
			++pX;
		}
		this.dirty = true;
		flixel_FlxSprite.prototype.update.call(this,elapsed);
	}
	,__class__: MonsterQueue
});
var PauseScreen = function(CurrentEnv,Callback) {
	this.ready = false;
	flixel_FlxSubState.call(this);
	this.closeCallback = Callback;
	this.ready = false;
	this.back = new flixel_FlxSprite();
	this.back.makeGraphic(flixel_FlxG.width,flixel_FlxG.height,1711276032);
	this.back.set_alpha(0);
	this.add(this.back);
	var mI;
	this.infos = [];
	var envDef = EnvData.getFromID(CurrentEnv);
	var _g = 0;
	var _g1 = envDef.monsters.length;
	while(_g < _g1) {
		var no = _g++;
		mI = new MonsterInfo(flixel_FlxG.width / 2 + (no > 2 ? 2 : -70),10 + 32 * (no % 3),envDef.monsters[no]);
		mI.set_alpha(0);
		this.add(mI);
		this.infos.push(mI);
	}
	this.key = new flixel_text_FlxBitmapText(flixel_graphics_frames_FlxBitmapFont.fromAngelCode("assets/images/simple_font.png","assets/images/simple_font.xml"));
	this.key.set_borderStyle(flixel_text_FlxTextBorderStyle.SHADOW);
	this.key.set_borderColor(-15658735);
	this.key.set_borderSize(1);
	this.key.set_text("H=HP, Ã¢=PhysAtt, Ã©=SpAtt,\nP=Def, S=SpDef");
	this.key.set_multiLine(true);
	this.key.set_alignment("center");
	this.key.screenCenter(flixel_util_FlxAxes.X);
	this.key.set_y(flixel_FlxG.height - this.key.get_height() - 2);
	this.key.set_alpha(0);
	this.add(this.key);
	this.unpause = new flixel_ui_FlxSpriteButton(flixel_FlxG.width - 12,flixel_FlxG.height - 14,null,$bind(this,this.resumeGame));
	this.unpause.loadGraphic("assets/images/pause_button.png",true,10,12);
	this.unpause.set_alpha(0);
	this.add(this.unpause);
	this.text = new flixel_text_FlxBitmapText(flixel_graphics_frames_FlxBitmapFont.fromAngelCode("assets/images/fancy_font.png","assets/images/fancy_font.xml"));
	this.text.set_borderStyle(flixel_text_FlxTextBorderStyle.SHADOW);
	this.text.set_borderColor(-15658735);
	this.text.set_borderSize(1);
	this.text.set_text("~ GAME PAUSED ~");
	this.text.set_alpha(0);
	this.text.set_y(2);
	this.text.screenCenter(flixel_util_FlxAxes.X);
	this.add(this.text);
	this.quit = new flixel_ui_FlxSpriteButton(2,2,null,$bind(this,this.quitGame));
	this.quit.loadGraphic("assets/images/quit_button.png",true,10,12);
	this.quit.set_alpha(0);
	this.add(this.quit);
};
$hxClasses["PauseScreen"] = PauseScreen;
PauseScreen.__name__ = "PauseScreen";
PauseScreen.__super__ = flixel_FlxSubState;
PauseScreen.prototype = $extend(flixel_FlxSubState.prototype,{
	back: null
	,infos: null
	,ready: null
	,key: null
	,unpause: null
	,quit: null
	,text: null
	,quitGame: function() {
		Sounds.play("click",.2);
		this.openSubState(new ConfirmQuit());
	}
	,create: function() {
		var _gthis = this;
		flixel_FlxSubState.prototype.create.call(this);
		flixel_tweens_FlxTween.num(0,1,.2,{ type : 8, ease : flixel_tweens_FlxEase.circOut, onComplete : function(_) {
			_gthis.ready = true;
		}},function(Value) {
			var _g = 0;
			var _g1 = _gthis.infos;
			while(_g < _g1.length) {
				var m = _g1[_g];
				++_g;
				m.set_alpha(Value);
			}
			_gthis.quit.set_alpha(_gthis.text.set_alpha(_gthis.unpause.set_alpha(_gthis.back.set_alpha(_gthis.key.set_alpha(Value)))));
		});
	}
	,update: function(elapsed) {
		flixel_FlxSubState.prototype.update.call(this,elapsed);
		if(!this.ready) {
			return;
		}
		if(flixel_FlxG.keys.checkKeyArrayState([27,80],-1)) {
			this.resumeGame();
		}
	}
	,resumeGame: function() {
		var _gthis = this;
		if(!this.ready) {
			return;
		}
		this.ready = false;
		Sounds.play("click",.2);
		flixel_tweens_FlxTween.num(1,0,.2,{ type : 8, ease : flixel_tweens_FlxEase.circOut, onComplete : function(_) {
			_gthis.close();
		}},function(Value) {
			var _g = 0;
			var _g1 = _gthis.infos;
			while(_g < _g1.length) {
				var m = _g1[_g];
				++_g;
				m.set_alpha(Value);
			}
			_gthis.quit.set_alpha(_gthis.text.set_alpha(_gthis.unpause.set_alpha(_gthis.back.set_alpha(_gthis.key.set_alpha(Value)))));
		});
	}
	,__class__: PauseScreen
});
var PlayState = function(MaxSize) {
	this.lastStep = -1;
	this.ready = false;
	this.shuffleTimes = 0;
	this.castingSpell = false;
	this.matchedPotion = false;
	this.refillTimer = 0;
	this.score = 0;
	this.newCombo = true;
	this.combo = 1;
	this.transFormEnd = 0;
	this.transFormStart = 0;
	this.firstMatch = false;
	this.doChangeEnv = false;
	this.changingEnv = false;
	this.currentEnv = 0;
	this.fightCounter = 0;
	this.fighting = false;
	this.monsterReady = false;
	this.heroReady = false;
	this.heroHealth = -1;
	this.currentHero = -1;
	this.currentMonster = -1;
	this.anyMatches = false;
	this.numMatchesFound = 0;
	this.swapping = false;
	this.overlappingBlock = -1;
	this.selectedBlock = -1;
	flixel_FlxState.call(this,MaxSize);
};
$hxClasses["PlayState"] = PlayState;
PlayState.__name__ = "PlayState";
PlayState.__super__ = flixel_FlxState;
PlayState.prototype = $extend(flixel_FlxState.prototype,{
	blocks: null
	,selector: null
	,selected: null
	,selectedBlock: null
	,overlappingBlock: null
	,swapping: null
	,numMatchesFound: null
	,anyMatches: null
	,fightingHero: null
	,fightingMonster: null
	,currentMonster: null
	,currentHero: null
	,heroHealth: null
	,heroReady: null
	,monsterReady: null
	,fighting: null
	,monsterQueue: null
	,fightCounter: null
	,progress: null
	,backdrop: null
	,currentEnv: null
	,envLayer: null
	,changingEnv: null
	,thisEnvironment: null
	,thisHero: null
	,thisMonster: null
	,monstAttAnim: null
	,heroAttAnim: null
	,pops: null
	,queueDisp: null
	,doChangeEnv: null
	,lich: null
	,cauldron: null
	,tubes: null
	,firstMatch: null
	,transforms: null
	,transFormStart: null
	,transFormEnd: null
	,combo: null
	,newCombo: null
	,comboDisp: null
	,score: null
	,scoreDisp: null
	,refillBar: null
	,refillTimer: null
	,matchedPotion: null
	,castingSpell: null
	,sprMeteors: null
	,explosions: null
	,shuffleTimes: null
	,envTitle: null
	,monstDmgNo: null
	,heroDmgNo: null
	,heroSkull: null
	,floatingNumbers: null
	,mapPoints: null
	,mapPaths: null
	,heroCounter: null
	,ready: null
	,lastStep: null
	,pauseButton: null
	,juices: null
	,barrier: null
	,create: function() {
		var _gthis = this;
		this.ready = false;
		Counts.clear();
		Counts.add("monsters_spawned",0);
		Counts.add("heroes_defeated",0);
		Counts.add("spells_cast",0);
		Counts.add("highest_area",1);
		this.changingEnv = true;
		this.thisEnvironment = EnvData.getFromID(this.currentEnv);
		this.createUI();
		this.buildGrid();
		this.selector = new flixel_FlxSprite();
		this.selector.loadGraphic("assets/images/selecting.png");
		this.selector.set_visible(false);
		this.add(this.selector);
		this.selected = new flixel_FlxSprite();
		this.selected.loadGraphic("assets/images/selected.png");
		this.selected.set_visible(false);
		this.add(this.selected);
		this.createHero();
		this.createMonster();
		this.createBarrier();
		this.monsterQueue = [];
		this.showMap();
		flixel_FlxState.prototype.create.call(this);
		Sounds.playMusic("gameloop");
		flixel_FlxG.camera.fade(-16777216,1,true,function() {
			_gthis.ready = true;
			_gthis.dropNewBlocks();
		});
	}
	,showMap: function() {
		if(this.currentEnv > 0) {
			this.mapPaths[this.currentEnv - 1].revive();
			var Object1 = this.mapPoints[this.currentEnv - 1];
			flixel_effects_FlxFlicker.stopFlickering(Object1);
			this.mapPoints[this.currentEnv - 1].set_alpha(.66);
		}
		this.mapPoints[this.currentEnv].set_alpha(1);
		var Duration = 0;
		var Interval = .2;
		var EndVisibility = true;
		if(EndVisibility == null) {
			EndVisibility = true;
		}
		if(Interval == null) {
			Interval = 0.04;
		}
		if(Duration == null) {
			Duration = 1;
		}
		flixel_effects_FlxFlicker.flicker(this.mapPoints[this.currentEnv],Duration,Interval,EndVisibility,true,null,null);
	}
	,returnFromSpellChoice: function(Selection1) {
		Counts.add("spells_cast",1);
		switch(Selection1) {
		case 0:
			this.shuffleMonsters();
			break;
		case 1:
			this.removeMinority();
			break;
		case 2:
			this.meteors();
			break;
		default:
		}
	}
	,createBarrier: function() {
		this.barrier = new Barrier();
		this.barrier.set_x(this.backdrop.x + 27);
		this.barrier.set_y(this.backdrop.y);
		this.add(this.barrier);
	}
	,shuffleMonsters: function() {
		var _gthis = this;
		var tmp = [];
		var types = [];
		var b = new flixel_group_FlxTypedGroupIterator(this.blocks.members,null);
		while(b.hasNext()) {
			var b1 = b.next();
			if(b1.alive) {
				tmp.push(b1);
				types.push(b1.isPotion ? -99 : b1.animation.frameIndex);
			}
		}
		this.shuffleTimes = 0;
		var whichSound = -1;
		new flixel_util_FlxTimer().start(.1,function(T) {
			whichSound = flixel_FlxG.random.int(1,4,[whichSound]);
			Sounds.play("boop_0" + (whichSound == null ? "null" : "" + whichSound),.33);
			flixel_FlxG.random.shuffle_Int(types);
			var _g = 0;
			var _g1 = types.length;
			while(_g < _g1) {
				var i = _g++;
				if(tmp[i].isPotion) {
					tmp[i].set_isPotion(false);
				}
				if(tmp[i].skull) {
					tmp[i].set_skull(false);
				}
				if(types[i] == 40) {
					tmp[i].set_skull(true);
				} else if(types[i] == -99) {
					tmp[i].set_isPotion(true);
				} else {
					tmp[i].animation.set_frameIndex(types[i]);
				}
			}
			_gthis.shuffleTimes++;
			if(_gthis.shuffleTimes < 10) {
				T.reset(.1);
			} else {
				_gthis.combo = 1;
				_gthis.newCombo = true;
				_gthis.matchedPotion = false;
				_gthis.swapping = true;
				_gthis.findMatches();
				_gthis.castingSpell = false;
			}
		});
	}
	,removeMinority: function() {
		var matches = [];
		var targetType = flixel_FlxG.random.getObject_String(this.thisEnvironment.monsters);
		var mID = MonsterData.getFromName(targetType).id;
		var b = new flixel_group_FlxTypedGroupIterator(this.blocks.members,null);
		while(b.hasNext()) {
			var b1 = b.next();
			if(b1.alive) {
				if(b1.animation.frameIndex == mID) {
					b1.isMatched = true;
					this.anyMatches = true;
					var X = b1.x;
					var Y = b1.y;
					if(Y == null) {
						Y = 0;
					}
					if(X == null) {
						X = 0;
					}
					var point = flixel_math_FlxPoint._pool.get().set(X,Y);
					point._inPool = false;
					matches.push({ source : point, whichMonster : b1.animation.frameIndex, count : 1, potion : b1.isPotion, skull : b1.skull});
				}
			}
		}
		this.combo = 1;
		this.newCombo = true;
		this.matchedPotion = false;
		this.swapping = true;
		var _g = 0;
		while(_g < matches.length) {
			var m = matches[_g];
			++_g;
			if(m.potion) {
				this.matchedPotion = true;
				this.giveScore(10);
				Sounds.play("potion",.66);
			} else if(m.skull) {
				this.giveScore(2);
				Sounds.play("skull_crush",.33);
			} else {
				this.addToTubes(m.source.x,m.source.y,m.whichMonster,m.count,0,true);
				Sounds.play("match",.66);
			}
		}
		this.destroyMatches();
		this.castingSpell = false;
	}
	,countNeighbors: function(X,Y) {
		var neighbors = 0;
		var _g = X - 1;
		var _g1 = X + 2;
		while(_g < _g1) {
			var x = _g++;
			var _g2 = Y - 1;
			var _g3 = Y + 2;
			while(_g2 < _g3) {
				var y = _g2++;
				if(x >= 0 && x < 8 && y >= 0 && y < 8) {
					if(this.findBlock(PlayState.SPAWNX + 10 * x,PlayState.SPAWNY - 10 * y) != null) {
						++neighbors;
					}
				}
			}
		}
		return neighbors;
	}
	,meteors: function() {
		var _gthis = this;
		var targets = [];
		var matches = [];
		var b = null;
		if(this.countNeighbors(0,0) >= 3) {
			var X = 0;
			var Y = 0;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(0,1) >= 3) {
			var X = 0;
			var Y = 1;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(0,2) >= 3) {
			var X = 0;
			var Y = 2;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(0,3) >= 3) {
			var X = 0;
			var Y = 3;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(0,4) >= 3) {
			var X = 0;
			var Y = 4;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(0,5) >= 3) {
			var X = 0;
			var Y = 5;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(0,6) >= 3) {
			var X = 0;
			var Y = 6;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(0,7) >= 3) {
			var X = 0;
			var Y = 7;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(1,0) >= 3) {
			var X = 1;
			var Y = 0;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(1,1) >= 3) {
			var X = 1;
			var Y = 1;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(1,2) >= 3) {
			var X = 1;
			var Y = 2;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(1,3) >= 3) {
			var X = 1;
			var Y = 3;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(1,4) >= 3) {
			var X = 1;
			var Y = 4;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(1,5) >= 3) {
			var X = 1;
			var Y = 5;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(1,6) >= 3) {
			var X = 1;
			var Y = 6;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(1,7) >= 3) {
			var X = 1;
			var Y = 7;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(2,0) >= 3) {
			var X = 2;
			var Y = 0;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(2,1) >= 3) {
			var X = 2;
			var Y = 1;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(2,2) >= 3) {
			var X = 2;
			var Y = 2;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(2,3) >= 3) {
			var X = 2;
			var Y = 3;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(2,4) >= 3) {
			var X = 2;
			var Y = 4;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(2,5) >= 3) {
			var X = 2;
			var Y = 5;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(2,6) >= 3) {
			var X = 2;
			var Y = 6;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(2,7) >= 3) {
			var X = 2;
			var Y = 7;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(3,0) >= 3) {
			var X = 3;
			var Y = 0;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(3,1) >= 3) {
			var X = 3;
			var Y = 1;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(3,2) >= 3) {
			var X = 3;
			var Y = 2;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(3,3) >= 3) {
			var X = 3;
			var Y = 3;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(3,4) >= 3) {
			var X = 3;
			var Y = 4;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(3,5) >= 3) {
			var X = 3;
			var Y = 5;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(3,6) >= 3) {
			var X = 3;
			var Y = 6;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(3,7) >= 3) {
			var X = 3;
			var Y = 7;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(4,0) >= 3) {
			var X = 4;
			var Y = 0;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(4,1) >= 3) {
			var X = 4;
			var Y = 1;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(4,2) >= 3) {
			var X = 4;
			var Y = 2;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(4,3) >= 3) {
			var X = 4;
			var Y = 3;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(4,4) >= 3) {
			var X = 4;
			var Y = 4;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(4,5) >= 3) {
			var X = 4;
			var Y = 5;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(4,6) >= 3) {
			var X = 4;
			var Y = 6;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(4,7) >= 3) {
			var X = 4;
			var Y = 7;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(5,0) >= 3) {
			var X = 5;
			var Y = 0;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(5,1) >= 3) {
			var X = 5;
			var Y = 1;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(5,2) >= 3) {
			var X = 5;
			var Y = 2;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(5,3) >= 3) {
			var X = 5;
			var Y = 3;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(5,4) >= 3) {
			var X = 5;
			var Y = 4;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(5,5) >= 3) {
			var X = 5;
			var Y = 5;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(5,6) >= 3) {
			var X = 5;
			var Y = 6;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(5,7) >= 3) {
			var X = 5;
			var Y = 7;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(6,0) >= 3) {
			var X = 6;
			var Y = 0;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(6,1) >= 3) {
			var X = 6;
			var Y = 1;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(6,2) >= 3) {
			var X = 6;
			var Y = 2;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(6,3) >= 3) {
			var X = 6;
			var Y = 3;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(6,4) >= 3) {
			var X = 6;
			var Y = 4;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(6,5) >= 3) {
			var X = 6;
			var Y = 5;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(6,6) >= 3) {
			var X = 6;
			var Y = 6;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(6,7) >= 3) {
			var X = 6;
			var Y = 7;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(7,0) >= 3) {
			var X = 7;
			var Y = 0;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(7,1) >= 3) {
			var X = 7;
			var Y = 1;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(7,2) >= 3) {
			var X = 7;
			var Y = 2;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(7,3) >= 3) {
			var X = 7;
			var Y = 3;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(7,4) >= 3) {
			var X = 7;
			var Y = 4;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(7,5) >= 3) {
			var X = 7;
			var Y = 5;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(7,6) >= 3) {
			var X = 7;
			var Y = 6;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		if(this.countNeighbors(7,7) >= 3) {
			var X = 7;
			var Y = 7;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			targets.push(point);
		}
		flixel_FlxG.random.shuffle_flixel_math_FlxPoint(targets);
		var _g = 0;
		while(_g < 3) {
			var i = [_g++];
			if(targets.length <= i[0]) {
				break;
			}
			var _g1 = targets[i[0]].x - 1 | 0;
			var _g2 = targets[i[0]].x + 2 | 0;
			while(_g1 < _g2) {
				var x = _g1++;
				var _g3 = targets[i[0]].y - 1 | 0;
				var _g4 = targets[i[0]].y + 2 | 0;
				while(_g3 < _g4) {
					var y = _g3++;
					b = this.findBlock(PlayState.SPAWNX + x * 10,PlayState.SPAWNY - y * 10);
					if(b != null) {
						b.isMatched = true;
						this.anyMatches = true;
						var matches1 = matches;
						var X = b.x;
						var Y = b.y;
						if(Y == null) {
							Y = 0;
						}
						if(X == null) {
							X = 0;
						}
						var point = flixel_math_FlxPoint._pool.get().set(X,Y);
						point._inPool = false;
						matches1.push({ source : point, whichMonster : b.animation.frameIndex, count : 1, potion : b.isPotion, skull : b.skull});
					}
				}
			}
			this.sprMeteors[i[0]].start(PlayState.SPAWNX + targets[i[0]].x * 10,PlayState.SPAWNY - targets[i[0]].y * 10,i[0] * .2,i[0] == 2 ? (function(i) {
				return function() {
					_gthis.explosions[i[0]].start(_gthis.sprMeteors[i[0]].targetX,_gthis.sprMeteors[i[0]].targetY);
					flixel_FlxG.camera.shake(0.05,0.1);
					_gthis.combo = 1;
					_gthis.newCombo = true;
					_gthis.matchedPotion = false;
					_gthis.swapping = true;
					var _g = 0;
					while(_g < matches.length) {
						var m = matches[_g];
						++_g;
						if(m.potion) {
							_gthis.matchedPotion = true;
							_gthis.giveScore(10);
							Sounds.play("potion",.66);
						} else if(m.skull) {
							_gthis.giveScore(2);
							Sounds.play("skull_crush",.33);
						} else {
							_gthis.addToTubes(m.source.x,m.source.y,m.whichMonster,m.count,0,true);
							Sounds.play("match",.66);
						}
					}
					_gthis.destroyMatches();
					_gthis.castingSpell = false;
				};
			})(i) : (function(i) {
				return function() {
					_gthis.explosions[i[0]].start(_gthis.sprMeteors[i[0]].targetX,_gthis.sprMeteors[i[0]].targetY);
					Sounds.play("meteor_impact_0" + Std.string(i[0] + 1),.66);
					flixel_FlxG.camera.shake(0.05,0.1);
				};
			})(i));
		}
		targets = flixel_util_FlxDestroyUtil.putArray(targets);
	}
	,findBlock: function(X,Y) {
		var b = new flixel_group_FlxTypedGroupIterator(this.blocks.members,null);
		while(b.hasNext()) {
			var b1 = b.next();
			if(b1.alive) {
				if(b1.x == X && b1.y == Y) {
					return b1;
				}
			}
		}
		return null;
	}
	,createHero: function() {
		this.fightingHero = new flixel_FlxSprite(PlayState.HEROSTARTX,PlayState.HEROSTARTY);
		this.fightingHero.loadGraphic("assets/images/heroes.png",true,8,8);
		this.fightingHero.set_flipX(true);
		this.fightingHero.set_alpha(0);
		this.add(this.fightingHero);
		this.heroAttAnim = new AttackAnim();
		this.heroAttAnim.set_x(126);
		this.heroAttAnim.set_y(this.fightingHero.y);
		this.add(this.heroAttAnim);
	}
	,createMonster: function() {
		this.fightingMonster = new flixel_FlxSprite(PlayState.MONSTERSTARTX,PlayState.MONSTERSTARTY);
		this.fightingMonster.loadGraphic("assets/images/monsters.png",true,8,8);
		this.fightingMonster.set_alpha(0);
		this.add(this.fightingMonster);
		this.monstAttAnim = new AttackAnim();
		this.monstAttAnim.set_x(118);
		this.monstAttAnim.set_y(this.fightingMonster.y);
		this.add(this.monstAttAnim);
	}
	,createUI: function() {
		var bg = new flixel_tile_FlxTileblock(-3,-2,170,130);
		bg.loadTiles("assets/images/background.png",10,10);
		this.add(bg);
		var backColor = new flixel_tile_FlxTileblock(7,28,80,80);
		backColor.loadTiles("assets/images/grid_back.png",10,10);
		this.add(backColor);
		this.blocks = new flixel_group_FlxTypedGroup();
		this.add(this.blocks);
		this.pops = new flixel_group_FlxTypedGroup();
		this.add(this.pops);
		this.transforms = new flixel_group_FlxTypedGroup();
		this.add(this.transforms);
		var t = null;
		var _g = 0;
		while(_g < 8) {
			var tx = _g++;
			var _g1 = 0;
			var _g2 = tx + 1;
			while(_g1 < _g2) {
				var ty = _g1++;
				t = new Transformer(PlayState.SPAWNX + 10 * (tx - ty),PlayState.SPAWNY - 10 * ty);
				this.transforms.add(t);
			}
		}
		var _g = 1;
		while(_g < 8) {
			var ty = _g++;
			var _g1 = 0;
			var _g2 = 8 - ty;
			while(_g1 < _g2) {
				var tx = _g1++;
				t = new Transformer(PlayState.SPAWNX + 10 * (7 - tx),PlayState.SPAWNY - 10 * (ty + tx));
				this.transforms.add(t);
			}
		}
		var border = new flixel_addons_display_FlxSliceSprite("assets/images/GameFieldBottom.png",new flixel_math_FlxRect(2,2,2,2),5,124);
		border.set_x(2);
		border.set_y(-2);
		this.add(border);
		border = new flixel_addons_display_FlxSliceSprite("assets/images/GameFieldBottom.png",new flixel_math_FlxRect(2,2,2,2),5,124);
		border.set_x(87);
		border.set_y(-2);
		this.add(border);
		var top = new flixel_addons_display_FlxSliceSprite("assets/images/GameFieldBottom.png",new flixel_math_FlxRect(2,2,2,2),84,30);
		top.set_x(5);
		top.set_y(108);
		this.add(top);
		top = new flixel_addons_display_FlxSliceSprite("assets/images/GameFieldBottom.png",new flixel_math_FlxRect(2,2,2,2),84,31);
		top.set_x(5);
		top.set_y(-3);
		top.set_angle(180);
		this.add(top);
		this.lich = new flixel_FlxSprite(8,18,"assets/images/lich_lord.png");
		this.add(this.lich);
		this.cauldron = new flixel_FlxSprite(16,18);
		this.cauldron.loadGraphic("assets/images/cauldron.png",true,8,8);
		this.cauldron.animation.add("normal",[0]);
		this.cauldron.animation.add("burst",[1,2,3,4,5,0],8,false);
		this.cauldron.animation.play("normal");
		this.add(this.cauldron);
		this.comboDisp = new ComboDisplay(this.cauldron.x + this.cauldron.get_width() / 2 - 4,this.cauldron.y - 8 - 4);
		this.add(this.comboDisp);
		this.tubes = [];
		var t = null;
		t = new Tube(28,2);
		this.tubes.push(t);
		this.add(t);
		t = new Tube(38,2);
		this.tubes.push(t);
		this.add(t);
		t = new Tube(48,2);
		this.tubes.push(t);
		this.add(t);
		t = new Tube(58,2);
		this.tubes.push(t);
		this.add(t);
		t = new Tube(68,2);
		this.tubes.push(t);
		this.add(t);
		t = new Tube(78,2);
		this.tubes.push(t);
		this.add(t);
		this.floatingNumbers = new flixel_group_FlxTypedGroup();
		this.add(this.floatingNumbers);
		var scoreback = new flixel_FlxSprite(96,3,"assets/images/score_back.png");
		this.add(scoreback);
		this.scoreDisp = new ScoreDisplay();
		this.scoreDisp.set_x(scoreback.x + 2);
		this.scoreDisp.set_y(scoreback.y + 2);
		this.add(this.scoreDisp);
		this.scoreDisp.set_text("0");
		border = new flixel_addons_display_FlxSliceSprite("assets/images/GameFieldBottom.png",new flixel_math_FlxRect(2,2,2,2),64,40);
		border.set_x(94);
		border.set_y(21);
		border.set_angle(180);
		this.add(border);
		this.queueDisp = new MonsterQueue(this);
		this.queueDisp.set_x(border.x + 2);
		this.queueDisp.set_y(border.y + 2);
		this.add(this.queueDisp);
		this.envLayer = new flixel_group_FlxTypedGroup();
		this.add(this.envLayer);
		this.backdrop = new Environment(border.x + 2,border.y + 5,0);
		this.envLayer.add(this.backdrop);
		this.envTitle = new flixel_text_FlxBitmapText(flixel_graphics_frames_FlxBitmapFont.fromAngelCode("assets/images/fancy_font.png","assets/images/fancy_font.xml"));
		this.envTitle.set_x(this.backdrop.x);
		this.envTitle.set_y(this.backdrop.y + this.backdrop.get_height());
		this.envTitle.set_autoSize(false);
		this.envTitle.set_alignment("center");
		this.envTitle.set_fieldWidth(this.backdrop.get_width() | 0);
		this.envTitle.set_text(axollib_TitleCase.toTitleCase(this.thisEnvironment.name));
		this.envTitle.set_borderStyle(flixel_text_FlxTextBorderStyle.SHADOW);
		this.envTitle.set_borderColor(-13421773);
		this.envTitle.set_borderSize(1);
		this.add(this.envTitle);
		this.progress = new ProgressMeter(this.backdrop.x,this.envTitle.y + this.envTitle.get_height());
		this.add(this.progress);
		this.heroCounter = new flixel_text_FlxBitmapText(flixel_graphics_frames_FlxBitmapFont.fromAngelCode("assets/images/tiny_digits.png","assets/images/tiny_digits.xml"));
		this.heroCounter.set_autoSize(false);
		this.heroCounter.set_fieldWidth(30);
		this.heroCounter.set_alignment("right");
		this.heroCounter.set_borderColor(-13421773);
		this.heroCounter.set_borderStyle(flixel_text_FlxTextBorderStyle.OUTLINE);
		this.heroCounter.set_borderSize(1);
		this.heroCounter.set_text("*20");
		this.heroCounter.set_x(this.backdrop.x + this.backdrop.get_width() - 31);
		this.heroCounter.set_y(this.backdrop.y + this.backdrop.get_height() - this.heroCounter.get_height() + 1);
		this.heroCounter.set_alpha(0);
		this.add(this.heroCounter);
		PlayState.MONSTERSTARTY = PlayState.HEROSTARTY = this.backdrop.y + this.backdrop.get_height() - 8 - 1 | 0;
		this.monstDmgNo = new flixel_text_FlxBitmapText(flixel_graphics_frames_FlxBitmapFont.fromAngelCode("assets/images/tiny_digits.png","assets/images/tiny_digits.xml"));
		this.monstDmgNo.set_text("0");
		this.monstDmgNo.set_x(0);
		this.monstDmgNo.set_y(PlayState.MONSTERSTARTY - 6);
		this.monstDmgNo.set_alignment("center");
		this.monstDmgNo.set_borderStyle(flixel_text_FlxTextBorderStyle.OUTLINE);
		this.monstDmgNo.set_borderColor(-15658735);
		this.monstDmgNo.set_borderSize(1);
		this.monstDmgNo.set_alpha(0);
		this.add(this.monstDmgNo);
		this.heroDmgNo = new flixel_text_FlxBitmapText(flixel_graphics_frames_FlxBitmapFont.fromAngelCode("assets/images/tiny_digits.png","assets/images/tiny_digits.xml"));
		this.heroDmgNo.set_text("0");
		this.heroDmgNo.set_x(0);
		this.heroDmgNo.set_y(PlayState.MONSTERSTARTY - 6);
		this.heroDmgNo.set_alignment("center");
		this.heroDmgNo.set_borderStyle(flixel_text_FlxTextBorderStyle.OUTLINE);
		this.heroDmgNo.set_borderColor(-15658735);
		this.heroDmgNo.set_borderSize(1);
		this.heroDmgNo.set_alpha(0);
		this.add(this.heroDmgNo);
		this.heroSkull = new flixel_FlxSprite();
		this.heroSkull.loadGraphic("assets/images/skull.png",false);
		this.heroSkull.set_flipX(true);
		this.heroSkull.set_alpha(0);
		this.heroSkull.kill();
		this.add(this.heroSkull);
		this.refillBar = new flixel_ui_FlxBar(7,110,flixel_ui_FlxBarFillDirection.LEFT_TO_RIGHT,80,10,this,"refillTimer",0,15,true);
		this.refillBar.createImageBar("assets/images/refill_empty.png","assets/images/refill_fill.png");
		this.add(this.refillBar);
		this.sprMeteors = [new Meteor(),new Meteor(),new Meteor()];
		this.add(this.sprMeteors[0]);
		this.add(this.sprMeteors[1]);
		this.add(this.sprMeteors[2]);
		this.explosions = [new Explosion(),new Explosion(),new Explosion()];
		this.add(this.explosions[0]);
		this.add(this.explosions[1]);
		this.add(this.explosions[2]);
		var mapBack = new flixel_addons_display_FlxSliceSprite("assets/images/spell_back.png",new flixel_math_FlxRect(7,7,41,17),64,54);
		mapBack.set_x(94);
		mapBack.set_y(63);
		this.add(mapBack);
		var map = new flixel_FlxSprite(mapBack.x + 3,mapBack.y + 3,"assets/images/map.png");
		this.add(map);
		this.mapPaths = [];
		this.mapPoints = [];
		var mP = new flixel_FlxSprite(map.x,map.y,"assets/images/map_path_0.png");
		this.mapPaths.push(mP);
		mP.set_alpha(.66);
		mP.kill();
		this.add(mP);
		mP = new flixel_FlxSprite(map.x,map.y,"assets/images/map_path_1.png");
		this.mapPaths.push(mP);
		mP.set_alpha(.66);
		mP.kill();
		this.add(mP);
		mP = new flixel_FlxSprite(map.x,map.y,"assets/images/map_path_2.png");
		this.mapPaths.push(mP);
		mP.set_alpha(.66);
		mP.kill();
		this.add(mP);
		mP = new flixel_FlxSprite(map.x,map.y,"assets/images/map_path_3.png");
		this.mapPaths.push(mP);
		mP.set_alpha(.66);
		mP.kill();
		this.add(mP);
		mP = new flixel_FlxSprite(map.x,map.y,"assets/images/map_path_4.png");
		this.mapPaths.push(mP);
		mP.set_alpha(.66);
		mP.kill();
		this.add(mP);
		mP = new flixel_FlxSprite(map.x,map.y,"assets/images/map_path_5.png");
		this.mapPaths.push(mP);
		mP.set_alpha(.66);
		mP.kill();
		this.add(mP);
		mP = new flixel_FlxSprite(map.x + 13,map.y + 38,"assets/images/map_node.png");
		this.mapPoints.push(mP);
		mP.set_alpha(.33);
		this.add(mP);
		mP = new flixel_FlxSprite(map.x + 40,map.y + 37,"assets/images/map_node.png");
		this.mapPoints.push(mP);
		mP.set_alpha(.33);
		this.add(mP);
		mP = new flixel_FlxSprite(map.x + 41,map.y + 27,"assets/images/map_node.png");
		this.mapPoints.push(mP);
		mP.set_alpha(.33);
		this.add(mP);
		mP = new flixel_FlxSprite(map.x + 21,map.y + 25,"assets/images/map_node.png");
		this.mapPoints.push(mP);
		mP.set_alpha(.33);
		this.add(mP);
		mP = new flixel_FlxSprite(map.x + 6,map.y + 27,"assets/images/map_node.png");
		this.mapPoints.push(mP);
		mP.set_alpha(.33);
		this.add(mP);
		mP = new flixel_FlxSprite(map.x + 11,map.y + 8,"assets/images/map_node.png");
		this.mapPoints.push(mP);
		mP.set_alpha(.33);
		this.add(mP);
		mP = new flixel_FlxSprite(map.x + 2,map.y + 3,"assets/images/map_node.png");
		this.mapPoints.push(mP);
		mP.set_alpha(.33);
		this.add(mP);
		this.pauseButton = new flixel_ui_FlxSpriteButton(flixel_FlxG.width - 12,flixel_FlxG.height - 14,null,$bind(this,this.pauseGame));
		this.pauseButton.loadGraphic("assets/images/pause_button.png",true,10,12);
		this.add(this.pauseButton);
		this.juices = new flixel_group_FlxTypedGroup();
		this.add(this.juices);
	}
	,spawnJuice: function(StartX,StartY,Color,DestX,DestY) {
		var j = this.juices.recycle(Juice);
		j.start(StartX,StartY,Color,DestX,DestY);
		this.juices.add(j);
	}
	,getFromArrayWithExclusions: function(Objects,Exclusions) {
		var selected = null;
		var attempts = 0;
		if(Objects.length != 0) {
			while(true) {
				selected = flixel_FlxG.random.getObject_Null_getFromArrayWithExclusions_T(Objects);
				if(Exclusions != null) {
					if(Exclusions.length != 0) {
						if(Exclusions.indexOf(selected) != -1) {
							selected = null;
							++attempts;
						}
					}
				}
				if(!(selected == null || attempts > 20)) {
					break;
				}
			}
		}
		return selected;
	}
	,buildGrid: function() {
		var monsterList = [];
		var _g = 0;
		var _g1 = this.thisEnvironment.monsters;
		while(_g < _g1.length) {
			var m = _g1[_g];
			++_g;
			monsterList.push(MonsterData.getFromName(m).id);
		}
		var _g = 0;
		while(_g < 8) {
			var y = _g++;
			var _g1 = 0;
			while(_g1 < 8) {
				var x = _g1++;
				var b = new Block();
				b.set_x(PlayState.SPAWNX + x * 10);
				b.baseY = PlayState.SPAWNY - y * 10;
				b.set_y(b.baseY);
				b.animation.set_frameIndex(this.getFromArrayWithExclusions(monsterList));
				b.ID = 8 * y + x;
				b.isNew = true;
				this.blocks.add(b);
			}
		}
		this.fixPreMatches(monsterList);
		var b = new flixel_group_FlxTypedGroupIterator(this.blocks.members,null);
		while(b.hasNext()) {
			var b1 = b.next();
			if(b1.alive && b1.isNew) {
				b1.set_y(b1.baseY - flixel_FlxG.height);
			}
		}
	}
	,dropNewBlocks: function() {
		var _gthis = this;
		var b = new flixel_group_FlxTypedGroupIterator(this.blocks.members,null);
		while(b.hasNext()) {
			var b1 = b.next();
			if(b1.alive && b1.isNew) {
				b1.set_y(b1.baseY - flixel_FlxG.height);
			}
		}
		Sounds.play("new_blocks");
		flixel_tweens_FlxTween.num(0,1,.66,{ type : 8, ease : flixel_tweens_FlxEase.quadIn, onComplete : function(_) {
			var b = new flixel_group_FlxTypedGroupIterator(_gthis.blocks.members,null);
			while(b.hasNext()) {
				var b1 = b.next();
				if(b1.alive && b1.isNew) {
					b1.set_y(b1.baseY);
					b1.isNew = false;
				}
			}
			if(_gthis.changingEnv) {
				_gthis.changingEnv = false;
			} else {
				_gthis.findMatches();
			}
		}},function(Value) {
			var b = new flixel_group_FlxTypedGroupIterator(_gthis.blocks.members,null);
			while(b.hasNext()) {
				var b1 = b.next();
				if(b1.isNew && b1.alive) {
					var a = b1.baseY - flixel_FlxG.height;
					b1.set_y(a + Value * (b1.baseY - a));
				}
			}
		});
	}
	,fixPreMatches: function(MonsterList) {
		var numMatches = 0;
		var lastMatch = -1;
		var anyMatches = false;
		while(true) {
			anyMatches = false;
			var _g = 0;
			while(_g < 8) {
				var y = _g++;
				lastMatch = -1;
				numMatches = 0;
				var _g1 = 0;
				while(_g1 < 8) {
					var x = _g1++;
					var b = new flixel_group_FlxTypedGroupIterator(this.blocks.members,null);
					while(b.hasNext()) {
						var b1 = b.next();
						if(!b1.alive) {
							numMatches = 0;
							lastMatch = -1;
						} else if(b1.x == PlayState.SPAWNX + x * 10 && b1.y == PlayState.SPAWNY - y * 10) {
							if(lastMatch == b1.animation.frameIndex) {
								++numMatches;
								if(numMatches >= 2 && b1.isNew) {
									b1.animation.set_frameIndex(this.getFromArrayWithExclusions(MonsterList,[lastMatch]));
									numMatches = 0;
									anyMatches = true;
								}
							}
							lastMatch = b1.animation.frameIndex;
							break;
						}
					}
				}
			}
			var _g2 = 0;
			while(_g2 < 8) {
				var x1 = _g2++;
				lastMatch = -1;
				numMatches = 0;
				var _g3 = 0;
				while(_g3 < 8) {
					var y1 = _g3++;
					var b2 = new flixel_group_FlxTypedGroupIterator(this.blocks.members,null);
					while(b2.hasNext()) {
						var b3 = b2.next();
						if(!b3.alive) {
							numMatches = 0;
							lastMatch = -1;
						} else if(b3.x == PlayState.SPAWNX + x1 * 10 && b3.y == PlayState.SPAWNY - y1 * 10) {
							if(lastMatch == b3.animation.frameIndex) {
								++numMatches;
								if(numMatches >= 2 && b3.isNew) {
									b3.animation.set_frameIndex(this.getFromArrayWithExclusions(MonsterList,[lastMatch]));
									numMatches = 0;
									anyMatches = true;
								}
							}
							lastMatch = b3.animation.frameIndex;
							break;
						}
					}
				}
			}
			if(!anyMatches) {
				break;
			}
		}
	}
	,fillNewColumn: function() {
		var _gthis = this;
		var monsterList = [];
		var b = null;
		var newBlocks = [];
		var _g = 0;
		var _g1 = this.thisEnvironment.monsters;
		while(_g < _g1.length) {
			var m = _g1[_g];
			++_g;
			monsterList.push(MonsterData.getFromName(m).id);
		}
		var _g = 0;
		while(_g < 8) {
			var y = _g++;
			b = this.blocks.recycle(Block);
			b.revive();
			b.set_x(PlayState.SPAWNX);
			b.set_y(PlayState.SPAWNY - y * 10);
			b.isMatched = b.matchedX = b.matchedY = false;
			b.set_isPotion(false);
			b.animation.set_frameIndex(this.getFromArrayWithExclusions(monsterList));
			b.scale.set(0.001,0.001);
			b.set_alpha(0);
			this.blocks.add(b);
			newBlocks.push(b);
		}
		flixel_tweens_FlxTween.num(0,1,.33,{ type : 8, ease : flixel_tweens_FlxEase.circInOut, onComplete : function(_) {
			_gthis.condenseEmptyColumns();
		}},function(Value) {
			var _g = 0;
			while(_g < newBlocks.length) {
				var b = newBlocks[_g];
				++_g;
				var s = 0.001 + Value * 0.999;
				b.scale.set(s,s);
				b.set_alpha(Value);
			}
		});
	}
	,fillWithNewBlocks: function() {
		var monsterList = [];
		var _g = 0;
		var _g1 = this.thisEnvironment.monsters;
		while(_g < _g1.length) {
			var m = _g1[_g];
			++_g;
			monsterList.push(MonsterData.getFromName(m).id);
		}
		var b = null;
		var blockExists = false;
		var _g = 0;
		while(_g < 8) {
			var y = _g++;
			var _g1 = 0;
			while(_g1 < 8) {
				var x = _g1++;
				blockExists = false;
				var b1 = new flixel_group_FlxTypedGroupIterator(this.blocks.members,null);
				while(b1.hasNext()) {
					var b2 = b1.next();
					if(!b2.alive) {
						continue;
					}
					if(b2.x == PlayState.SPAWNX + x * 10 && b2.y == PlayState.SPAWNY - y * 10) {
						blockExists = true;
						break;
					}
				}
				if(!blockExists) {
					b = this.blocks.recycle(Block);
					b.revive();
					b.set_x(PlayState.SPAWNX + x * 10);
					b.set_y(PlayState.SPAWNY - y * 10);
					b.baseY = b.y;
					b.isMatched = b.matchedX = b.matchedY = false;
					b.set_isPotion(false);
					b.animation.set_frameIndex(this.getFromArrayWithExclusions(monsterList));
					b.scale.set(1,1);
					b.set_alpha(1);
					b.isNew = true;
					this.blocks.add(b);
				}
			}
		}
		this.fixPreMatches(monsterList);
		this.dropNewBlocks();
	}
	,spawnHero: function() {
		var _gthis = this;
		if(this.currentHero == HeroData.count() - 1) {
			this.score += 10000;
			this.openSubState(new GameOver(true,this.score));
		} else {
			this.currentHero++;
			this.heroCounter.set_text("*" + Std.string(20 - this.currentHero));
			flixel_tweens_FlxTween.tween(this.heroCounter,{ alpha : 1},.2,{ type : 8, ease : flixel_tweens_FlxEase.circIn});
			this.thisHero = HeroData.getFromID(this.currentHero);
			this.heroHealth = this.thisHero.hp;
			this.fightingHero.animation.set_frameIndex(this.currentHero);
			var tmp = this.fightingHero;
			var Alpha = 0;
			if(Alpha == null) {
				Alpha = 255;
			}
			var color = flixel_util_FlxColor._new();
			var Alpha1 = Alpha;
			if(Alpha1 == null) {
				Alpha1 = 255;
			}
			color &= -16711681;
			color |= 0;
			color &= -65281;
			color |= 0;
			color &= -256;
			color |= 0;
			color &= 16777215;
			color |= (Alpha1 > 255 ? 255 : Alpha1 < 0 ? 0 : Alpha1) << 24;
			flixel_tweens_FlxTween.color(tmp,.5,color,-1,{ type : 8, ease : flixel_tweens_FlxEase.circInOut});
			flixel_tweens_FlxTween.tween(this.fightingHero,{ x : 130},.5,{ type : 8, ease : flixel_tweens_FlxEase.circInOut, onComplete : function(_) {
				_gthis.heroReady = true;
			}});
		}
	}
	,triggerNewEnv: function() {
		this.doChangeEnv = true;
	}
	,nextEnv: function() {
		Sounds.play("finished_area",.66);
		if(this.currentEnv == EnvData.count() - 1) {
			this.openSubState(new GameOver(false,this.score));
		} else {
			this.currentEnv++;
			Counts.increaseIfHigher("highest_area",this.currentEnv);
			this.showMap();
			this.changingEnv = true;
			this.doChangeEnv = false;
			this.transFormStart = 0;
			this.transFormEnd = 0;
			var tmr = new flixel_util_FlxTimer();
			this.doTrans(tmr);
		}
	}
	,finishNewEnv: function() {
		var _gthis = this;
		var bHp = 0;
		var amt = 0;
		var _g = 0;
		var _g1 = this.tubes;
		while(_g < _g1.length) {
			var t = _g1[_g];
			++_g;
			amt = t.fillAmount * 10 * this.currentEnv | 0;
			if(amt > 0) {
				this.spawnJuice(t.x + 4,t.y + 12,MonsterData.getFromID(t.whichMonster).color,this.backdrop.x + 30,this.backdrop.y + 8);
				bHp += amt;
			}
			t.set_whichMonster(-1);
			t.set_fillAmount(0);
		}
		if(bHp > 0) {
			this.barrier.health = bHp;
			new flixel_util_FlxTimer().start(.33,function(_) {
				_gthis.barrier.revive();
				Sounds.play("make_barrier",.33);
			});
		}
		this.thisEnvironment = EnvData.getFromID(this.currentEnv);
		this.envTitle.set_text(axollib_TitleCase.toTitleCase(this.thisEnvironment.name));
		var newEnv = new Environment(this.backdrop.x,this.backdrop.y,this.currentEnv);
		this.envLayer.add(newEnv);
		newEnv.set_alpha(0);
		newEnv.set_progress(0);
		this.progress.set_progress(0);
		flixel_tweens_FlxTween.tween(newEnv,{ alpha : 1},.5,{ type : 8, ease : flixel_tweens_FlxEase.circInOut, onComplete : function(_) {
			var oldEnv = _gthis.backdrop;
			oldEnv.kill();
			_gthis.envLayer.replace(oldEnv,newEnv);
			oldEnv = flixel_util_FlxDestroyUtil.destroy(oldEnv);
			_gthis.backdrop = newEnv;
			_gthis.heroReady = true;
			_gthis.changingEnv = false;
			_gthis.fillWithNewBlocks();
		}});
	}
	,doTrans: function(tmr) {
		var t = null;
		var _g = this.transFormStart;
		var _g1 = this.transFormStart + this.transFormEnd + 1;
		while(_g < _g1) {
			var i = _g++;
			t = this.transforms.members[i];
			t.start();
			var b = new flixel_group_FlxTypedGroupIterator(this.blocks.members,null);
			while(b.hasNext()) {
				var b1 = b.next();
				if(b1.alive && !b1.isPotion) {
					if(b1.x == t.x && b1.y == t.y) {
						Sounds.play("to_skull",.2);
						b1.set_skull(true);
						break;
					}
				}
			}
		}
		this.transFormStart += this.transFormEnd + 1;
		if(this.transFormStart <= 35) {
			this.transFormEnd++;
		} else {
			this.transFormEnd--;
		}
		if(this.transFormEnd == 8) {
			this.transFormEnd--;
		}
		if(this.transFormEnd < 0) {
			this.matchedPotion = false;
			this.combo = 1;
			this.newCombo = true;
			this.findMatches();
		} else {
			tmr.start(.1,$bind(this,this.doTrans));
		}
	}
	,doCombat: function(elapsed) {
		var _gthis = this;
		if((this.heroReady || this.currentHero == -1) && (this.monsterReady || this.currentMonster == -1)) {
			this.fightCounter += elapsed;
			if(this.fightCounter >= .4) {
				this.fightCounter -= .4;
				if(this.currentHero == -1 && this.firstMatch) {
					this.spawnHero();
					return;
				}
				if(this.currentMonster == -1) {
					if(this.spawnMonster()) {
						return;
					}
				}
				if(this.barrier.alive) {
					this.heroReady = false;
					flixel_tweens_FlxTween.tween(this.fightingHero,{ x : this.fightingHero.x - 4},.5,{ type : 8, ease : flixel_tweens_FlxEase.backIn, onComplete : function(_) {
						_gthis.barrier.hurt(_gthis.thisHero.att + _gthis.thisHero.satt);
						Sounds.play("hit_barrier",.33);
						flixel_tweens_FlxTween.tween(_gthis.fightingHero,{ x : _gthis.fightingHero.x + 4},.5,{ type : 8, ease : flixel_tweens_FlxEase.backOut, onComplete : function(_) {
							_gthis.heroReady = true;
						}});
					}});
				} else if(this.heroReady && this.currentMonster == -1) {
					var _g = this.progress;
					_g.set_progress(_g.progress + .025);
					this.backdrop.set_progress(this.progress.progress);
					this.heroReady = false;
					flixel_tweens_FlxTween.tween(this.fightingHero,{ x : this.fightingHero.x - 4},.5,{ type : 8, ease : flixel_tweens_FlxEase.backIn, onComplete : function(_) {
						_gthis.lastStep = flixel_FlxG.random.int(1,2,[_gthis.lastStep]);
						Sounds.play("step_0" + Std.string(_gthis.lastStep));
						flixel_tweens_FlxTween.tween(_gthis.fightingHero,{ x : _gthis.fightingHero.x + 4},.5,{ type : 8, ease : flixel_tweens_FlxEase.backOut, onComplete : function(_) {
							if(_gthis.progress.progress == 1) {
								_gthis.triggerNewEnv();
							} else {
								_gthis.heroReady = true;
							}
						}});
					}});
				} else if(this.heroReady && this.monsterReady) {
					this.heroReady = this.monsterReady = false;
					var mRoll = 0;
					var hRoll = 0;
					var mPDmg = -1;
					var mSDmg = -1;
					if(this.thisHero.att != 0) {
						mPDmg = 1;
						hRoll = flixel_FlxG.random.int(1,20) + this.thisHero.att;
						mRoll = this.thisMonster.def + 10;
						if(hRoll >= mRoll) {
							var a = this.thisHero.att - this.thisMonster.def;
							mPDmg = a > 1 ? a : 1;
						}
					}
					if(this.thisHero.satt != 0) {
						mSDmg = 1;
						hRoll = flixel_FlxG.random.int(1,20) + this.thisHero.satt;
						mRoll = this.thisMonster.sdef + 10;
						if(hRoll >= mRoll) {
							var a = this.thisHero.satt - this.thisMonster.sdef;
							mSDmg = a > 1 ? a : 1;
						}
					}
					var hPDmg = -1;
					var hSDmg = -1;
					if(this.thisMonster.att != 0) {
						hPDmg = 0;
						mRoll = flixel_FlxG.random.int(1,20) + this.thisMonster.att;
						hRoll = this.thisHero.def + 10;
						if(mRoll >= hRoll) {
							var a = this.thisMonster.att - this.thisHero.def;
							hPDmg = a > 1 ? a : 1;
						}
					}
					if(this.thisMonster.satt != 0) {
						hSDmg = 0;
						mRoll = flixel_FlxG.random.int(1,20) + this.thisMonster.satt;
						hRoll = this.thisHero.sdef + 10;
						if(mRoll >= hRoll) {
							var a = this.thisMonster.satt - this.thisHero.sdef;
							hSDmg = a > 1 ? a : 1;
						}
					}
					flixel_tweens_FlxTween.tween(this.fightingMonster,{ x : this.fightingMonster.x + 4},.5,{ type : 8, ease : flixel_tweens_FlxEase.backIn, onComplete : function(_) {
						if(mSDmg < 0) {
							if(mPDmg == 0) {
								_gthis.monstAttAnim.playEffect("physblock");
								_gthis.showMonsterDamage(0);
								Sounds.play("block",.33);
							} else if(mPDmg > 0) {
								_gthis.monstAttAnim.playEffect("physhit");
								_gthis.thisMonster.hp -= mPDmg;
								_gthis.showMonsterDamage(mPDmg);
								Sounds.play("damage",.33);
							}
						} else if(mSDmg == 0) {
							_gthis.monstAttAnim.playEffect("magblock");
							_gthis.showMonsterDamage(0);
							Sounds.play("block",.33);
						} else if(mSDmg > 0) {
							_gthis.monstAttAnim.playEffect("maghit");
							_gthis.thisMonster.hp -= mSDmg;
							_gthis.showMonsterDamage(mSDmg);
							Sounds.play("damage",.33);
						}
						if(_gthis.thisMonster.hp > 0) {
							flixel_tweens_FlxTween.tween(_gthis.fightingMonster,{ x : _gthis.fightingMonster.x - 4},.5,{ type : 8, ease : flixel_tweens_FlxEase.backOut, onComplete : function(_) {
								_gthis.monsterReady = true;
							}});
						} else {
							Sounds.play("death");
							var _gthis1 = _gthis.fightingMonster;
							var Alpha = 0;
							if(Alpha == null) {
								Alpha = 255;
							}
							var color = flixel_util_FlxColor._new();
							var Alpha1 = Alpha;
							if(Alpha1 == null) {
								Alpha1 = 255;
							}
							color &= -16711681;
							color |= 16711680;
							color &= -65281;
							color |= 0;
							color &= -256;
							color |= 0;
							color &= 16777215;
							color |= (Alpha1 > 255 ? 255 : Alpha1 < 0 ? 0 : Alpha1) << 24;
							flixel_tweens_FlxTween.color(_gthis1,.5,-1,color,{ type : 8, ease : flixel_tweens_FlxEase.circInOut, onComplete : function(_) {
								_gthis.fightingMonster.set_x(PlayState.MONSTERSTARTX);
								_gthis.currentMonster = -1;
							}});
						}
					}});
					flixel_tweens_FlxTween.tween(this.fightingHero,{ x : this.fightingHero.x - 4},.5,{ type : 8, ease : flixel_tweens_FlxEase.backIn, onComplete : function(_) {
						if(hSDmg < 0) {
							if(hPDmg == 0) {
								_gthis.heroAttAnim.playEffect("physblock");
								_gthis.showHeroDamage(0);
								Sounds.play("block",.33);
							} else if(hPDmg > 0) {
								_gthis.heroAttAnim.playEffect("physhit");
								_gthis.heroHealth -= hPDmg;
								_gthis.showHeroDamage(hPDmg);
								Sounds.play("damage",.33);
							}
						} else if(hSDmg == 0) {
							_gthis.heroAttAnim.playEffect("magblock");
							_gthis.showHeroDamage(0);
							Sounds.play("block",.33);
						} else if(hSDmg > 0) {
							_gthis.heroAttAnim.playEffect("maghit");
							_gthis.heroHealth -= hSDmg;
							_gthis.showHeroDamage(hSDmg);
							Sounds.play("damage",.33);
						}
						if(_gthis.heroHealth > 0) {
							flixel_tweens_FlxTween.tween(_gthis.fightingHero,{ x : _gthis.fightingHero.x + 4},.5,{ type : 8, ease : flixel_tweens_FlxEase.backOut, onComplete : function(_) {
								_gthis.heroReady = true;
							}});
						} else {
							_gthis.giveScore(HeroData.getFromID(_gthis.currentHero).hp * 100);
							Counts.add("heroes_defeated",1);
							Sounds.play("death");
							flixel_tweens_FlxTween.tween(_gthis.heroCounter,{ alpha : 0},.2,{ type : 8, ease : flixel_tweens_FlxEase.circOut});
							_gthis.showHeroSkull();
							var _gthis1 = _gthis.fightingHero;
							var Alpha = 0;
							if(Alpha == null) {
								Alpha = 255;
							}
							var color = flixel_util_FlxColor._new();
							var Alpha1 = Alpha;
							if(Alpha1 == null) {
								Alpha1 = 255;
							}
							color &= -16711681;
							color |= 16711680;
							color &= -65281;
							color |= 0;
							color &= -256;
							color |= 0;
							color &= 16777215;
							color |= (Alpha1 > 255 ? 255 : Alpha1 < 0 ? 0 : Alpha1) << 24;
							flixel_tweens_FlxTween.color(_gthis1,.5,-1,color,{ type : 8, ease : flixel_tweens_FlxEase.circInOut, onComplete : function(_) {
								_gthis.fightingHero.set_x(PlayState.HEROSTARTX);
								_gthis.spawnHero();
							}});
						}
					}});
				}
			}
		} else {
			this.fightCounter = 0;
		}
	}
	,showHeroSkull: function() {
		var _gthis = this;
		this.heroSkull.reset(this.fightingHero.x + 6,this.fightingHero.y);
		this.heroSkull.set_alpha(0);
		flixel_tweens_FlxTween.tween(this.heroSkull,{ alpha : .8},.2,{ type : 8, ease : flixel_tweens_FlxEase.sineIn, onComplete : function(_) {
			var Duration = 2;
			var Interval = 0.1;
			var EndVisibility = true;
			var ForceRestart = true;
			if(ForceRestart == null) {
				ForceRestart = true;
			}
			if(EndVisibility == null) {
				EndVisibility = true;
			}
			if(Interval == null) {
				Interval = 0.04;
			}
			if(Duration == null) {
				Duration = 1;
			}
			flixel_effects_FlxFlicker.flicker(_gthis.heroSkull,Duration,Interval,EndVisibility,ForceRestart,null,null);
			flixel_tweens_FlxTween.tween(_gthis.heroSkull,{ alpha : 0},.2,{ type : 8, ease : flixel_tweens_FlxEase.sineOut, startDelay : 1.8});
		}});
		flixel_tweens_FlxTween.tween(this.heroSkull,{ y : PlayState.HEROSTARTY - 16},2,{ type : 8, ease : flixel_tweens_FlxEase.sineInOut, onComplete : function(_) {
			_gthis.heroSkull.kill();
		}});
	}
	,showHeroDamage: function(Amount) {
		var _gthis = this;
		this.heroDmgNo.set_text(Amount == null ? "null" : "" + Amount);
		this.heroDmgNo.set_alpha(0);
		this.heroDmgNo.reset(this.fightingHero.x + 8 - this.heroDmgNo.get_width() / 2,PlayState.MONSTERSTARTY - 4);
		flixel_tweens_FlxTween.tween(this.heroDmgNo,{ y : PlayState.MONSTERSTARTY - this.heroDmgNo.get_height() - 4, alpha : 1},.33,{ type : 8, ease : flixel_tweens_FlxEase.backOut, onComplete : function(_) {
			flixel_tweens_FlxTween.tween(_gthis.heroDmgNo,{ alpha : 0, y : PlayState.MONSTERSTARTY - _gthis.heroDmgNo.get_height()},.1,{ startDelay : .5, type : 8, ease : flixel_tweens_FlxEase.circOut, onComplete : function(_) {
				_gthis.heroDmgNo.kill();
			}});
		}});
	}
	,showMonsterDamage: function(Amount) {
		var _gthis = this;
		this.monstDmgNo.set_text(Amount == null ? "null" : "" + Amount);
		this.monstDmgNo.set_alpha(0);
		this.monstDmgNo.reset(this.fightingMonster.x - this.monstDmgNo.get_width() / 2,PlayState.MONSTERSTARTY - 4);
		flixel_tweens_FlxTween.tween(this.monstDmgNo,{ y : PlayState.MONSTERSTARTY - this.monstDmgNo.get_height() - 4, alpha : 1},.33,{ type : 8, ease : flixel_tweens_FlxEase.backOut, onComplete : function(_) {
			flixel_tweens_FlxTween.tween(_gthis.monstDmgNo,{ alpha : 0, y : PlayState.MONSTERSTARTY - _gthis.monstDmgNo.get_height()},.1,{ startDelay : .5, type : 8, ease : flixel_tweens_FlxEase.circOut, onComplete : function(_) {
				_gthis.monstDmgNo.kill();
			}});
		}});
	}
	,giveScore: function(Amount) {
		this.score += Amount;
		this.scoreDisp.changeAmount(this.score);
	}
	,pauseGame: function() {
		var _gthis = this;
		if(!this.ready) {
			return;
		}
		this.ready = false;
		Sounds.play("click",.2);
		this.openSubState(new PauseScreen(this.currentEnv,function() {
			_gthis.ready = true;
		}));
	}
	,update: function(elapsed) {
		flixel_FlxState.prototype.update.call(this,elapsed);
		if(!this.ready) {
			return;
		}
		this.selector.set_visible(false);
		if(flixel_FlxG.keys.checkKeyArrayState([27,80],-1)) {
			Sounds.play("click",.2);
			this.pauseGame();
			return;
		}
		if(this.changingEnv) {
			return;
		}
		if(this.firstMatch) {
			this.refillTimer += elapsed;
		}
		if(this.swapping || this.castingSpell) {
			return;
		}
		if(this.doChangeEnv) {
			this.selector.set_visible(false);
			this.selected.set_visible(false);
			this.nextEnv();
			return;
		}
		if(this.refillTimer >= 15) {
			this.refillTimer -= 15;
			this.swapping = true;
			this.fillWithNewBlocks();
			return;
		}
		var b = new flixel_group_FlxTypedGroupIterator(this.blocks.members,null);
		while(b.hasNext()) {
			var b1 = b.next();
			if(flixel_FlxG.mouse.overlaps(b1) && b1.alive && b1.exists) {
				this.selector.set_visible(true);
				this.selector.set_x(b1.x - 1);
				this.selector.set_y(b1.y - 1);
				this.overlappingBlock = b1.ID;
				break;
			}
		}
		if(this.selector.visible) {
			if(flixel_FlxG.mouse._leftButton.current == -1) {
				Sounds.play("click",.2);
				if(this.selectedBlock != -1) {
					if(!this.trySwap(this.selectedBlock,this.overlappingBlock)) {
						this.selectBlock(this.overlappingBlock);
					}
				} else {
					this.selectBlock(this.overlappingBlock);
				}
			}
		}
		if(this.swapping) {
			return;
		}
		this.doCombat(elapsed);
	}
	,trySwap: function(From,To) {
		var swapOK = false;
		var fromBlock = null;
		var toBlock = null;
		if(To == From || To == -1 || From == -1) {
			return false;
		}
		var b = new flixel_group_FlxTypedGroupIterator(this.blocks.members,null);
		while(b.hasNext()) {
			var b1 = b.next();
			if(b1.ID == To) {
				toBlock = b1;
			} else if(b1.ID == From) {
				fromBlock = b1;
			}
		}
		if(toBlock.y == fromBlock.y) {
			swapOK = toBlock.x == fromBlock.x - 10 || toBlock.x == fromBlock.x + 10;
		} else if(toBlock.x == fromBlock.x) {
			swapOK = toBlock.y == fromBlock.y - 10 || toBlock.y == fromBlock.y + 10;
		}
		if(swapOK) {
			this.doSwap(fromBlock,toBlock);
			return true;
		}
		return false;
	}
	,doSwap: function(From,To) {
		var _gthis = this;
		this.selected.set_visible(this.selector.set_visible(false));
		this.swapping = true;
		this.selectedBlock = -1;
		this.overlappingBlock = -1;
		Sounds.play("swap");
		flixel_tweens_FlxTween.linearMotion(To,To.x,To.y,From.x,From.y,.33,true,{ type : 8, ease : flixel_tweens_FlxEase.circInOut});
		flixel_tweens_FlxTween.linearMotion(From,From.x,From.y,To.x,To.y,.33,true,{ type : 8, ease : flixel_tweens_FlxEase.circInOut, onComplete : function(_) {
			_gthis.combo = 1;
			_gthis.newCombo = true;
			_gthis.matchedPotion = false;
			_gthis.findMatches();
		}});
	}
	,selectBlock: function(ID) {
		var b = new flixel_group_FlxTypedGroupIterator(this.blocks.members,null);
		while(b.hasNext()) {
			var b1 = b.next();
			if(!b1.alive) {
				continue;
			}
			if(b1.ID == ID) {
				this.selected.set_visible(true);
				this.selected.set_x(b1.x - 1);
				this.selected.set_y(b1.y - 1);
				this.selectedBlock = b1.ID;
				break;
			}
		}
	}
	,addToTubes: function(X,Y,MonsterID,Amount,Bonus,FromMeteor) {
		if(FromMeteor == null) {
			FromMeteor = false;
		}
		var whichT = null;
		var _g = 0;
		var _g1 = this.tubes;
		while(_g < _g1.length) {
			var t = _g1[_g];
			++_g;
			if(t.whichMonster == MonsterID) {
				whichT = t;
				break;
			}
		}
		if(whichT == null) {
			var _g = 0;
			var _g1 = this.tubes;
			while(_g < _g1.length) {
				var t = _g1[_g];
				++_g;
				if(t.whichMonster == -1) {
					whichT = t;
					whichT.set_whichMonster(MonsterID);
					break;
				}
			}
		}
		var m = MonsterData.getFromID(MonsterID);
		if(whichT != null && m != null) {
			var amount = 0;
			var n = 0;
			if(FromMeteor) {
				amount = Amount;
			} else {
				amount = Math.pow(Amount - 3,2) + 1;
			}
			n = (amount / 10 + Bonus * .05) * this.combo;
			n = flixel_math_FlxMath.roundDecimal(n,2);
			this.showFloatingNumber(X,Y,Std.string(n * 100 + "%"));
			var amt = whichT.fillAmount + n;
			this.giveScore(n * 150 | 0);
			this.spawnJuice(X + 4,Y + 4,m.color,whichT.x + 4,whichT.y + 12);
			if(amt >= 1) {
				var leftOver = amt - 1;
				this.monsterQueue.push(MonsterID);
				whichT.set_fillAmount(leftOver);
				whichT.showSpawn();
				Counts.add("monsters_spawned",1);
				Sounds.play("spawn");
			} else {
				whichT.set_fillAmount(amt);
			}
		}
	}
	,showFloatingNumber: function(X,Y,Display) {
		var f = this.floatingNumbers.recycle(FloatingNumber);
		f.start(X,Y,Display);
		this.floatingNumbers.add(f);
	}
	,countMatches: function(X,Y,ID,XDir,YDir,Count) {
		if(Count == null) {
			Count = 0;
		}
		if(YDir == null) {
			YDir = 0;
		}
		if(XDir == null) {
			XDir = 0;
		}
		var newX = X + 10 * XDir;
		var newY = Y - 10 * YDir;
		var b = new flixel_group_FlxTypedGroupIterator(this.blocks.members,null);
		while(b.hasNext()) {
			var b1 = b.next();
			if(b1.x == newX && b1.y == newY && b1.alive) {
				if(b1.matchedX && XDir == 1 || b1.matchedY && YDir == 1) {
					break;
				}
				if(b1.isPotion && ID == -99 || b1.animation.frameIndex == ID) {
					Count = this.countMatches(b1.x,b1.y,b1.isPotion ? -99 : b1.animation.frameIndex,XDir,YDir,Count + 1);
					if(Count >= 2) {
						b1.isMatched = true;
						if(XDir == 1) {
							b1.matchedX = true;
						} else {
							b1.matchedY = true;
						}
					}
				}
			}
		}
		return Count;
	}
	,findMatches: function() {
		var matches = [];
		this.swapping = true;
		this.anyMatches = false;
		this.numMatchesFound = 0;
		var counts = 0;
		var matchedThisCombo = false;
		var _g = 0;
		while(_g < 8) {
			var y = _g++;
			var _g1 = 0;
			while(_g1 < 8) {
				var x = _g1++;
				var b = new flixel_group_FlxTypedGroupIterator(this.blocks.members,null);
				while(b.hasNext()) {
					var b1 = b.next();
					if(b1.x == PlayState.SPAWNX + 10 * x && b1.y == PlayState.SPAWNY - 10 * y && b1.alive) {
						if(!b1.matchedX) {
							counts = this.countMatches(b1.x,b1.y,b1.isPotion ? -99 : b1.animation.frameIndex,1,0);
							if(counts >= 2) {
								b1.isMatched = true;
								b1.matchedX = true;
								var X = b1.x;
								var Y = b1.y;
								if(Y == null) {
									Y = 0;
								}
								if(X == null) {
									X = 0;
								}
								var point = flixel_math_FlxPoint._pool.get().set(X,Y);
								point._inPool = false;
								matches.push({ source : point, whichMonster : b1.animation.frameIndex, count : counts + 1, potion : b1.isPotion, skull : b1.skull});
								this.anyMatches = true;
							}
						}
						break;
					}
				}
			}
		}
		var _g = 0;
		while(_g < 8) {
			var x2 = _g++;
			var _g1 = 0;
			while(_g1 < 8) {
				var y2 = _g1++;
				var b = new flixel_group_FlxTypedGroupIterator(this.blocks.members,null);
				while(b.hasNext()) {
					var b1 = b.next();
					if(b1.x == PlayState.SPAWNX + 10 * x2 && b1.y == PlayState.SPAWNY - 10 * y2 && b1.alive) {
						if(!b1.matchedY) {
							counts = this.countMatches(b1.x,b1.y,b1.isPotion ? -99 : b1.animation.frameIndex,0,1,0);
							if(counts >= 2) {
								b1.isMatched = true;
								b1.matchedY = true;
								var X = b1.x;
								var Y = b1.y;
								if(Y == null) {
									Y = 0;
								}
								if(X == null) {
									X = 0;
								}
								var point = flixel_math_FlxPoint._pool.get().set(X,Y);
								point._inPool = false;
								matches.push({ source : point, whichMonster : b1.animation.frameIndex, count : counts + 1, potion : b1.isPotion, skull : b1.skull});
								this.anyMatches = true;
							}
						}
						break;
					}
				}
			}
		}
		var matchCount = -1;
		var _g = 0;
		while(_g < matches.length) {
			var m = matches[_g];
			++_g;
			if(!m.skull && !m.potion) {
				++matchCount;
			}
		}
		var _g = 0;
		while(_g < matches.length) {
			var m = matches[_g];
			++_g;
			if(!this.changingEnv && !matchedThisCombo) {
				matchedThisCombo = true;
				if(this.newCombo) {
					this.newCombo = false;
				} else {
					this.combo++;
					this.comboDisp.show(this.combo);
				}
			}
			if(m.potion) {
				this.matchedPotion = true;
				this.giveScore(10 * counts * this.combo);
				Sounds.play("potion",.66);
			} else if(m.skull) {
				this.giveScore(2 * counts * this.combo);
				Sounds.play("skull_crush",.33);
			} else {
				this.addToTubes(m.source.x,m.source.y,m.whichMonster,m.count,matchCount);
				Sounds.play("match",.66);
			}
		}
		this.destroyMatches();
	}
	,spawnMonster: function() {
		var _gthis = this;
		if(this.monsterQueue.length == 0) {
			return false;
		}
		var m = this.monsterQueue.shift();
		this.currentMonster = m;
		this.thisMonster = MonsterData.getFromID(m);
		this.thisMonster.hp = this.thisMonster.hp;
		this.thisMonster.att = this.thisMonster.att;
		this.thisMonster.def = this.thisMonster.def;
		this.thisMonster.sdef = this.thisMonster.sdef;
		this.thisMonster.satt = this.thisMonster.satt;
		this.fightingMonster.animation.set_frameIndex(m);
		this.fightingMonster.set_x(PlayState.MONSTERSTARTX);
		var tmp = this.fightingMonster;
		var Alpha = 0;
		if(Alpha == null) {
			Alpha = 255;
		}
		var color = flixel_util_FlxColor._new();
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 255;
		}
		color &= -16711681;
		color |= 0;
		color &= -65281;
		color |= 0;
		color &= -256;
		color |= 0;
		color &= 16777215;
		color |= (Alpha1 > 255 ? 255 : Alpha1 < 0 ? 0 : Alpha1) << 24;
		flixel_tweens_FlxTween.color(tmp,.5,color,-1,{ type : 8, ease : flixel_tweens_FlxEase.circInOut});
		flixel_tweens_FlxTween.tween(this.fightingMonster,{ x : 114},.5,{ type : 8, ease : flixel_tweens_FlxEase.circInOut, onComplete : function(_) {
			_gthis.monsterReady = true;
		}});
		return true;
	}
	,spawnPop: function(X,Y) {
		var p = null;
		p = this.pops.recycle(Pop);
		if(p == null) {
			p = new Pop();
		}
		p.start(X,Y);
		this.pops.add(p);
	}
	,destroyMatches: function() {
		var _gthis = this;
		if(!this.anyMatches) {
			if(this.changingEnv) {
				this.finishNewEnv();
			} else {
				this.reset();
			}
			return;
		}
		this.firstMatch = true;
		this.cauldron.animation.play("burst",true);
		var b = new flixel_group_FlxTypedGroupIterator(this.blocks.members,null);
		while(b.hasNext()) {
			var b1 = b.next();
			if(b1.isMatched && b1.alive) {
				this.spawnPop(b1.x,b1.y);
			}
		}
		flixel_tweens_FlxTween.num(1,0.001,.33,{ ease : flixel_tweens_FlxEase.circInOut, type : 8, onComplete : function(_) {
			var b = new flixel_group_FlxTypedGroupIterator(_gthis.blocks.members,null);
			while(b.hasNext()) {
				var b1 = b.next();
				if(b1.isMatched && b1.alive) {
					if(b1.matchedX && b1.matchedY && (!b1.skull && !b1.isPotion)) {
						Sounds.play("potion",.66);
						b1.matchedX = b1.matchedY = b1.isMatched = false;
						b1.set_isPotion(true);
						b1.scale.set(1,1);
						b1.set_alpha(1);
					} else {
						b1.kill();
					}
				}
			}
			_gthis.checkGravity();
		}},$bind(this,this.shrinkMatches));
	}
	,checkGravity: function() {
		var _gthis = this;
		var anyFall = false;
		var _g = 1;
		while(_g < 8) {
			var y = _g++;
			var _g1 = 0;
			while(_g1 < 8) {
				var x = _g1++;
				var b = new flixel_group_FlxTypedGroupIterator(this.blocks.members,null);
				while(b.hasNext()) {
					var b1 = b.next();
					if(!b1.alive) {
						continue;
					}
					if(b1.x == PlayState.SPAWNX + 10 * x && b1.y == PlayState.SPAWNY - 10 * y) {
						if(!this.hasNeighborBelow(b1.x,b1.y)) {
							anyFall = true;
							b1.set_falling(true);
						}
					}
				}
			}
		}
		if(anyFall) {
			Sounds.play("drop");
			flixel_tweens_FlxTween.num(0,10,.1,{ ease : flixel_tweens_FlxEase.cubeOut, type : 8, onComplete : function(_) {
				var b = new flixel_group_FlxTypedGroupIterator(_gthis.blocks.members,null);
				while(b.hasNext()) {
					var b1 = b.next();
					if(b1.falling) {
						b1.set_falling(false);
					}
				}
				_gthis.checkGravity();
			}},function(Value) {
				var b = new flixel_group_FlxTypedGroupIterator(_gthis.blocks.members,null);
				while(b.hasNext()) {
					var b1 = b.next();
					if(b1.falling) {
						b1.set_y(b1.baseY + Value);
					}
				}
			});
		} else if(this.changingEnv) {
			this.findMatches();
		} else {
			this.condenseEmptyColumns();
		}
	}
	,condenseEmptyColumns: function() {
		var _gthis = this;
		var hasOne = false;
		var hasAny = false;
		var _g = 0;
		while(_g < 8) {
			var x = _g++;
			if(hasAny) {
				continue;
			}
			hasOne = false;
			var b = new flixel_group_FlxTypedGroupIterator(this.blocks.members,null);
			while(b.hasNext()) {
				var b1 = b.next();
				if(!b1.alive) {
					continue;
				}
				if(b1.x == PlayState.SPAWNX + 10 * (7 - x) && b1.y == PlayState.SPAWNY) {
					hasOne = true;
					break;
				}
			}
			if(!hasOne) {
				hasAny = true;
				if(x < 7) {
					var b2 = new flixel_group_FlxTypedGroupIterator(this.blocks.members,null);
					while(b2.hasNext()) {
						var b3 = b2.next();
						if(b3.alive && b3.x < PlayState.SPAWNX + 10 * (7 - x)) {
							b3.set_shifting(true);
						}
					}
					flixel_tweens_FlxTween.num(0,10,.33,{ ease : flixel_tweens_FlxEase.cubeInOut, type : 8, onComplete : function(_) {
						var b = new flixel_group_FlxTypedGroupIterator(_gthis.blocks.members,null);
						while(b.hasNext()) {
							var b1 = b.next();
							if(b1.shifting) {
								b1.set_shifting(false);
							}
						}
						_gthis.fillNewColumn();
					}},function(Value) {
						var b = new flixel_group_FlxTypedGroupIterator(_gthis.blocks.members,null);
						while(b.hasNext()) {
							var b1 = b.next();
							if(b1.shifting) {
								b1.set_x(b1.baseX + Value);
							}
						}
					});
				} else {
					this.fillNewColumn();
				}
			}
		}
		if(!hasAny) {
			this.findMatches();
		}
	}
	,hasNeighborBelow: function(X,Y) {
		var b = new flixel_group_FlxTypedGroupIterator(this.blocks.members,null);
		while(b.hasNext()) {
			var b1 = b.next();
			if(!b1.alive) {
				continue;
			}
			if(b1.x == X && b1.y == Y + 10) {
				return !b1.falling;
			}
		}
		return false;
	}
	,shrinkMatches: function(Value) {
		var b = new flixel_group_FlxTypedGroupIterator(this.blocks.members,null);
		while(b.hasNext()) {
			var b1 = b.next();
			if(b1.isMatched) {
				b1.scale.set(Value,Value);
			}
		}
	}
	,reset: function() {
		this.swapping = false;
		this.changingEnv = false;
		this.combo = 1;
		this.newCombo = true;
		if(this.matchedPotion) {
			this.castingSpell = true;
			Sounds.play("spell_select");
			this.openSubState(new SpellChoice($bind(this,this.returnFromSpellChoice)));
		}
	}
	,__class__: PlayState
});
var Pop = function() {
	flixel_FlxSprite.call(this);
	this.loadGraphic("assets/images/pop.png",true,8,8);
	this.animation.add("pop",[4,3,2,1,0],12,false);
	this.kill();
};
$hxClasses["Pop"] = Pop;
Pop.__name__ = "Pop";
Pop.__super__ = flixel_FlxSprite;
Pop.prototype = $extend(flixel_FlxSprite.prototype,{
	start: function(X,Y) {
		this.reset(X,Y);
		this.animation.play("pop",true);
	}
	,update: function(elapsed) {
		if(this.animation.get_finished()) {
			this.kill();
		}
		flixel_FlxSprite.prototype.update.call(this,elapsed);
	}
	,__class__: Pop
});
var ProgressMeter = function(X,Y) {
	this.whichEnv = -1;
	this.y = 0;
	this.x = 0;
	flixel_group_FlxTypedGroup.call(this);
	this.set_x(X);
	this.set_y(Y);
	this.back = new flixel_addons_display_FlxSliceSprite("assets/images/progress_back.png",new flixel_math_FlxRect(0,0,1,6),46,6);
	this.back.set_x(this.x + 7);
	this.back.set_y(this.y + 2);
	this.add(this.back);
	this.cap = new flixel_FlxSprite(null,null,"assets/images/progress_cap.png");
	this.cap.set_x(this.back.x + this.back.get_width());
	this.cap.set_y(this.back.y);
	this.add(this.cap);
	this.door = new flixel_FlxSprite();
	this.door.loadGraphic("assets/images/door_indicator.png",true,8,8);
	this.door.set_x(this.back.x - this.door.get_width() / 2);
	this.door.set_y(this.back.y + this.back.get_height() / 2 - this.door.get_width() / 2);
	this.add(this.door);
	this.party = new flixel_FlxSprite();
	this.party.loadGraphic("assets/images/party_indicator.png");
	this.party.set_x(this.back.x + this.back.get_width() - this.party.get_width() / 2);
	this.party.set_y(this.back.y + this.back.get_height() / 2 - this.party.get_height() / 2);
	this.add(this.party);
	this.set_progress(0);
};
$hxClasses["ProgressMeter"] = ProgressMeter;
ProgressMeter.__name__ = "ProgressMeter";
ProgressMeter.__super__ = flixel_group_FlxTypedGroup;
ProgressMeter.prototype = $extend(flixel_group_FlxTypedGroup.prototype,{
	x: null
	,y: null
	,back: null
	,cap: null
	,party: null
	,door: null
	,whichEnv: null
	,progress: null
	,set_progress: function(Value) {
		var _gthis = this;
		var lowerBound = Value < 0 ? 0 : Value;
		this.progress = lowerBound > 1 ? 1 : lowerBound;
		if(this.progress >= .9) {
			if(this.whichEnv < 5) {
				this.door.animation.set_frameIndex(1);
			} else {
				this.door.animation.set_frameIndex(3);
			}
		} else if(this.whichEnv < 5) {
			this.door.animation.set_frameIndex(0);
		} else {
			this.door.animation.set_frameIndex(2);
		}
		if(this.progress == 0) {
			this.party.set_x(this.back.x + this.back.get_width() - this.party.get_width() / 2);
			if(this.party.alpha == 0) {
				this.party.scale.set(.5,.5);
				flixel_tweens_FlxTween.tween(this.party,{ alpha : 1},.5,{ type : 8, ease : flixel_tweens_FlxEase.circOut});
				flixel_tweens_FlxTween.tween(this.party.scale,{ x : 1, y : 1},.5,{ type : 8, ease : flixel_tweens_FlxEase.circOut});
			}
		} else {
			var tmp = this.party;
			var a = this.back.x + this.back.get_width();
			flixel_tweens_FlxTween.tween(tmp,{ x : a + this.progress * (this.back.x - a) - this.party.get_width() / 2},.2,{ type : 8, ease : flixel_tweens_FlxEase.circInOut, onComplete : function(_) {
				if(_gthis.progress == 1) {
					flixel_tweens_FlxTween.tween(_gthis.party,{ alpha : 0},.5,{ type : 8, ease : flixel_tweens_FlxEase.circOut});
					flixel_tweens_FlxTween.tween(_gthis.party.scale,{ x : 1.5, y : 1.5},.5,{ type : 8, ease : flixel_tweens_FlxEase.circOut});
				}
			}});
		}
		return this.progress;
	}
	,set_x: function(Value) {
		this.x = Value;
		if(this.back != null && this.door != null && this.party != null) {
			this.back.set_x(this.x + 7);
			this.cap.set_x(this.back.x + this.back.get_width());
			this.door.set_x(this.back.x - this.door.get_width() / 2);
			var a = this.x + 53;
			this.party.set_x(a + this.progress * (this.x + 7 - a) - this.party.get_width() / 2);
		}
		return this.x;
	}
	,set_y: function(Value) {
		this.y = Value;
		if(this.back != null && this.door != null && this.party != null) {
			this.back.set_y(this.y + 2);
			this.cap.set_y(this.back.y);
			this.door.set_y(this.back.y + this.back.get_height() / 2 - this.door.get_width() / 2);
			this.party.set_y(this.back.y + this.back.get_height() / 2 - this.party.get_height() / 2);
		}
		return this.x;
	}
	,__class__: ProgressMeter
	,__properties__: $extend(flixel_group_FlxTypedGroup.prototype.__properties__,{set_progress:"set_progress",set_y:"set_y",set_x:"set_x"})
});
var RainbowText = function(font,Speed) {
	if(Speed == null) {
		Speed = 100;
	}
	this.colors = [-65536,-256,-16744448,-16711681,-16776961,-65281,-1];
	this.speed = 100;
	flixel_text_FlxBitmapText.call(this,font);
	this.speed = Speed;
};
$hxClasses["RainbowText"] = RainbowText;
RainbowText.__name__ = "RainbowText";
RainbowText.__super__ = flixel_text_FlxBitmapText;
RainbowText.prototype = $extend(flixel_text_FlxBitmapText.prototype,{
	speed: null
	,colors: null
	,draw: function() {
		if(this.alpha > 0 && this.visible && this.exists && this.alive) {
			this.set_color(this.colors[flixel_FlxG.game.ticks / this.speed % 7 | 0]);
		}
		flixel_text_FlxBitmapText.prototype.draw.call(this);
	}
	,__class__: RainbowText
});
var Reflect = function() { };
$hxClasses["Reflect"] = Reflect;
Reflect.__name__ = "Reflect";
Reflect.field = function(o,field) {
	try {
		return o[field];
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		return null;
	}
};
Reflect.getProperty = function(o,field) {
	var tmp;
	if(o == null) {
		return null;
	} else {
		var tmp1;
		if(o.__properties__) {
			tmp = o.__properties__["get_" + field];
			tmp1 = tmp;
		} else {
			tmp1 = false;
		}
		if(tmp1) {
			return o[tmp]();
		} else {
			return o[field];
		}
	}
};
Reflect.setProperty = function(o,field,value) {
	var tmp;
	var tmp1;
	if(o.__properties__) {
		tmp = o.__properties__["set_" + field];
		tmp1 = tmp;
	} else {
		tmp1 = false;
	}
	if(tmp1) {
		o[tmp](value);
	} else {
		o[field] = value;
	}
};
Reflect.fields = function(o) {
	var a = [];
	if(o != null) {
		var hasOwnProperty = Object.prototype.hasOwnProperty;
		for( var f in o ) {
		if(f != "__id__" && f != "hx__closures__" && hasOwnProperty.call(o,f)) {
			a.push(f);
		}
		}
	}
	return a;
};
Reflect.isFunction = function(f) {
	if(typeof(f) == "function") {
		return !(f.__name__ || f.__ename__);
	} else {
		return false;
	}
};
Reflect.compare = function(a,b) {
	if(a == b) {
		return 0;
	} else if(a > b) {
		return 1;
	} else {
		return -1;
	}
};
Reflect.compareMethods = function(f1,f2) {
	if(f1 == f2) {
		return true;
	}
	if(!Reflect.isFunction(f1) || !Reflect.isFunction(f2)) {
		return false;
	}
	if(f1.scope == f2.scope && f1.method == f2.method) {
		return f1.method != null;
	} else {
		return false;
	}
};
Reflect.isObject = function(v) {
	if(v == null) {
		return false;
	}
	var t = typeof(v);
	if(!(t == "string" || t == "object" && v.__enum__ == null)) {
		if(t == "function") {
			return (v.__name__ || v.__ename__) != null;
		} else {
			return false;
		}
	} else {
		return true;
	}
};
Reflect.isEnumValue = function(v) {
	if(v != null) {
		return v.__enum__ != null;
	} else {
		return false;
	}
};
Reflect.deleteField = function(o,field) {
	if(!Object.prototype.hasOwnProperty.call(o,field)) {
		return false;
	}
	delete(o[field]);
	return true;
};
Reflect.makeVarArgs = function(f) {
	return function() {
		var a = Array.prototype.slice;
		var a1 = arguments;
		var a2 = a.call(a1);
		return f(a2);
	};
};
var ScoreDisplay = function() {
	this.showAmount = 0;
	flixel_text_FlxBitmapText.call(this,flixel_graphics_frames_FlxBitmapFont.fromAngelCode("assets/images/large_numbers.png","assets/images/large_numbers.xml"));
	this.set_autoSize(false);
	this.set_fieldWidth(56);
	this.set_alignment("right");
	this.set_color(-23296);
};
$hxClasses["ScoreDisplay"] = ScoreDisplay;
ScoreDisplay.__name__ = "ScoreDisplay";
ScoreDisplay.__super__ = flixel_text_FlxBitmapText;
ScoreDisplay.prototype = $extend(flixel_text_FlxBitmapText.prototype,{
	showAmount: null
	,changeAmount: function(Amount) {
		this.showAmount = Amount;
	}
	,update: function(elapsed) {
		var shownValue = Std.parseInt(this.text);
		if(shownValue < this.showAmount) {
			if(this.showAmount >= shownValue + 1000000) {
				shownValue += 1000000;
			} else if(this.showAmount >= shownValue + 100000) {
				shownValue += 100000;
			} else if(this.showAmount >= shownValue + 10000) {
				shownValue += 10000;
			} else if(this.showAmount >= shownValue + 1000) {
				shownValue += 1000;
			} else if(this.showAmount >= shownValue + 100) {
				shownValue += 100;
			} else if(this.showAmount >= shownValue + 10) {
				shownValue += 10;
			} else if(this.showAmount >= shownValue + 1) {
				++shownValue;
			}
			this.set_text(shownValue == null ? "null" : "" + shownValue);
		}
		flixel_text_FlxBitmapText.prototype.update.call(this,elapsed);
	}
	,__class__: ScoreDisplay
});
var Sounds = function() { };
$hxClasses["Sounds"] = Sounds;
Sounds.__name__ = "Sounds";
Sounds.currentMusic = null;
Sounds.sounds = null;
Sounds.music = null;
Sounds.preloadSounds = function() {
	Sounds.sounds = new haxe_ds_StringMap();
	var s = null;
	var sName = "";
	var _g = 0;
	var _g1 = lime_utils_Assets.list("SOUND");
	while(_g < _g1.length) {
		var a = _g1[_g];
		++_g;
		if(StringTools.startsWith(a,"assets/sounds/")) {
			s = new flixel_system_FlxSound().loadEmbedded(a,false,false);
			sName = a.substring("assets/sounds/".length,a.indexOf("."));
			Sounds.sounds.h[sName] = s;
		}
	}
	Sounds.music = new haxe_ds_StringMap();
	var _g = 0;
	var _g1 = lime_utils_Assets.list("SOUND");
	while(_g < _g1.length) {
		var a = _g1[_g];
		++_g;
		if(StringTools.startsWith(a,"assets/music/")) {
			sName = a.substring("assets/music/".length,a.indexOf("."));
			Sounds.music.h[sName] = a;
		}
	}
};
Sounds.play = function(SoundName,Volume) {
	if(Volume == null) {
		Volume = 0.5;
	}
	var s = Sounds.sounds.h[SoundName];
	if(s == null) {
		throw haxe_Exception.thrown("Unknown sound: '" + SoundName + "'");
	}
	s.set_volume(Volume);
	s.play(true);
};
Sounds.playMusic = function(MusicName,Volume) {
	if(Volume == null) {
		Volume = 0.5;
	}
	if(Sounds.currentMusic != null) {
		if(Sounds.currentMusic != MusicName) {
			var _this = flixel_FlxG.sound.music;
			var Duration = .5;
			var To = 0;
			if(To == null) {
				To = 0;
			}
			if(Duration == null) {
				Duration = 1;
			}
			if(_this.fadeTween != null) {
				_this.fadeTween.cancel();
			}
			_this.fadeTween = flixel_tweens_FlxTween.num(_this._volume,To,Duration,{ onComplete : function(_) {
				Sounds.switchMusicTo(MusicName,Volume);
			}},$bind(_this,_this.volumeTween));
		}
	} else {
		Sounds.switchMusicTo(MusicName,Volume);
	}
};
Sounds.switchMusicTo = function(MusicName,Volume) {
	if(Volume == null) {
		Volume = 0.5;
	}
	var m = Sounds.music.h[MusicName];
	if(m == null) {
		throw haxe_Exception.thrown("Unknown music: '" + MusicName + "'");
	}
	flixel_FlxG.sound.playMusic(m,Volume,true);
	Sounds.currentMusic = MusicName;
};
var SpellCard = function(WhichCard) {
	if(WhichCard == null) {
		WhichCard = -1;
	}
	this.whichCard = -1;
	this.alpha = 1;
	this.height = 42;
	this.width = 42;
	this.y = 0;
	this.x = 0;
	flixel_group_FlxTypedGroup.call(this);
	this.back = new flixel_addons_display_FlxSliceSprite("assets/images/spell_back.png",new flixel_math_FlxRect(7,7,41,17),44,44);
	this.whichCard = WhichCard;
	this.symbol = new flixel_FlxSprite();
	switch(this.whichCard) {
	case 0:
		this.symbol.loadGraphic("assets/images/juggler.png");
		break;
	case 1:
		this.symbol.loadGraphic("assets/images/injustice.png");
		break;
	case 2:
		this.symbol.loadGraphic("assets/images/striking-balls.png");
		break;
	default:
	}
	this.add(this.back);
	this.symbol.set_x(4);
	this.symbol.set_y(4);
	this.add(this.symbol);
};
$hxClasses["SpellCard"] = SpellCard;
SpellCard.__name__ = "SpellCard";
SpellCard.__super__ = flixel_group_FlxTypedGroup;
SpellCard.prototype = $extend(flixel_group_FlxTypedGroup.prototype,{
	x: null
	,y: null
	,width: null
	,height: null
	,alpha: null
	,back: null
	,symbol: null
	,whichCard: null
	,set_x: function(Value) {
		this.x = Value;
		this.back.set_x(this.x);
		this.symbol.set_x(this.x + 4);
		return this.x;
	}
	,set_y: function(Value) {
		this.y = Value;
		this.back.set_y(this.y);
		this.symbol.set_y(this.y + 4);
		return this.y;
	}
	,set_alpha: function(Value) {
		var lowerBound = Value < 0 ? 0 : Value;
		this.alpha = lowerBound > 1 ? 1 : lowerBound;
		this.back.set_alpha(this.symbol.set_alpha(this.alpha));
		return this.alpha;
	}
	,__class__: SpellCard
	,__properties__: $extend(flixel_group_FlxTypedGroup.prototype.__properties__,{set_alpha:"set_alpha",set_y:"set_y",set_x:"set_x"})
});
var SpellChoice = function(Callback) {
	this.currentHover = -1;
	this.ready = false;
	flixel_FlxSubState.call(this);
	this.ready = false;
	this.callback = Callback;
	this.back = new flixel_FlxSprite();
	this.back.makeGraphic(flixel_FlxG.width,flixel_FlxG.height,1711276032);
	this.back.set_alpha(0);
	this.add(this.back);
	this.cards = [];
	var c = new SpellCard(0);
	this.cards.push(c);
	c.set_x(7);
	c.set_y(flixel_FlxG.height / 2 - 22);
	c.set_alpha(0);
	c = new SpellCard(1);
	this.cards.push(c);
	c.set_x(58);
	c.set_y(flixel_FlxG.height / 2 - 22);
	c.set_alpha(0);
	c = new SpellCard(2);
	this.cards.push(c);
	c.set_x(109);
	c.set_y(flixel_FlxG.height / 2 - 22);
	c.set_alpha(0);
	var e = null;
	this.emitters = [];
	e = new flixel_effects_particles_FlxTypedEmitter();
	e.loadParticles("assets/images/sparkles.png",200,0,true,false);
	e.x = this.cards[0].x;
	e.y = this.cards[0].y + this.cards[0].height - 10;
	e.height = 5;
	e.width = this.cards[0].width;
	e.launchMode = flixel_effects_particles_FlxEmitterMode.SQUARE;
	e.velocity.set(-5,100,5,150,0,20,0,50);
	e.lifespan.set(.2,1);
	e.alpha.set(1,1,0,0);
	this.emitters.push(e);
	e = new flixel_effects_particles_FlxTypedEmitter();
	e.loadParticles("assets/images/sparkles.png",200,0,true,false);
	e.x = this.cards[1].x;
	e.y = this.cards[1].y + this.cards[1].height - 10;
	e.height = 5;
	e.width = this.cards[1].width;
	e.launchMode = flixel_effects_particles_FlxEmitterMode.SQUARE;
	e.velocity.set(-5,100,5,150,0,20,0,50);
	e.lifespan.set(.2,1);
	e.alpha.set(1,1,0,0);
	this.emitters.push(e);
	e = new flixel_effects_particles_FlxTypedEmitter();
	e.loadParticles("assets/images/sparkles.png",200,0,true,false);
	e.x = this.cards[2].x;
	e.y = this.cards[2].y + this.cards[2].height - 10;
	e.height = 5;
	e.width = this.cards[2].width;
	e.launchMode = flixel_effects_particles_FlxEmitterMode.SQUARE;
	e.velocity.set(-5,100,5,150,0,20,0,50);
	e.lifespan.set(.2,1);
	e.alpha.set(1,1,0,0);
	this.emitters.push(e);
	this.add(this.emitters[0]);
	this.add(this.emitters[1]);
	this.add(this.emitters[2]);
	this.add(this.cards[0]);
	this.add(this.cards[1]);
	this.add(this.cards[2]);
};
$hxClasses["SpellChoice"] = SpellChoice;
SpellChoice.__name__ = "SpellChoice";
SpellChoice.__super__ = flixel_FlxSubState;
SpellChoice.prototype = $extend(flixel_FlxSubState.prototype,{
	back: null
	,cards: null
	,ready: null
	,callback: null
	,emitters: null
	,currentHover: null
	,create: function() {
		var _gthis = this;
		this.ready = false;
		this.back.set_alpha(0);
		var _g = 0;
		var _g1 = this.cards;
		while(_g < _g1.length) {
			var c = _g1[_g];
			++_g;
			c.set_alpha(0);
			c.set_y(flixel_FlxG.height / 2 - 22 + 100);
		}
		flixel_FlxG.camera.flash(-1,.1,function() {
			_gthis.emitters[0].start(false,0.01);
			_gthis.emitters[1].start(false,0.01);
			_gthis.emitters[2].start(false,0.01);
			flixel_tweens_FlxTween.tween(_gthis.back,{ alpha : 1},.2,{ type : 8, ease : flixel_tweens_FlxEase.sineIn, onComplete : function(_) {
				flixel_tweens_FlxTween.num(0,1,.33,{ ease : flixel_tweens_FlxEase.backOut, type : 8, onComplete : function(_) {
					_gthis.ready = true;
				}},function(Value) {
					var _g = 0;
					var _g1 = _gthis.cards;
					while(_g < _g1.length) {
						var c = _g1[_g];
						++_g;
						c.set_alpha(Value);
						c.set_y(flixel_FlxG.height / 2 - 22 + 100 * (1 - Value));
					}
				});
			}});
		});
		flixel_FlxSubState.prototype.create.call(this);
	}
	,update: function(elapsed) {
		var _gthis = this;
		this.emitters[0].y = this.cards[0].y + this.cards[0].height - 10;
		this.emitters[1].y = this.cards[1].y + this.cards[1].height - 10;
		this.emitters[2].y = this.cards[2].y + this.cards[2].height - 10;
		if(this.ready) {
			var over = -1;
			if(flixel_FlxG.mouse.overlaps(this.cards[0])) {
				over = 0;
				if(this.cards[0].y > flixel_FlxG.height / 2 - 27) {
					var _g = this.cards[0];
					_g.set_y(_g.y - 1);
				}
			} else if(flixel_FlxG.mouse.overlaps(this.cards[1])) {
				over = 1;
				if(this.cards[1].y > flixel_FlxG.height / 2 - 27) {
					var _g = this.cards[1];
					_g.set_y(_g.y - 1);
				}
			} else if(flixel_FlxG.mouse.overlaps(this.cards[2])) {
				over = 2;
				if(this.cards[2].y > flixel_FlxG.height / 2 - 27) {
					var _g = this.cards[2];
					_g.set_y(_g.y - 1);
				}
			}
			if(over != this.currentHover) {
				this.currentHover = over;
				if(over != -1) {
					Sounds.play("hover_card",.33);
				}
			}
			var _g = 0;
			var _g1 = this.cards;
			while(_g < _g1.length) {
				var c = _g1[_g];
				++_g;
				if(c.whichCard != over) {
					if(c.y < flixel_FlxG.height / 2 - 22) {
						var _g2 = c;
						_g2.set_y(_g2.y + 1);
					}
				}
			}
			if(over != -1 && flixel_FlxG.mouse._leftButton.current == -1) {
				this.ready = false;
				Sounds.play("spell",.66);
				flixel_tweens_FlxTween.num(1,0,.33,{ type : 8, ease : flixel_tweens_FlxEase.backIn},function(Value) {
					var _g = 0;
					var _g1 = _gthis.cards;
					while(_g < _g1.length) {
						var c = _g1[_g];
						++_g;
						if(c.whichCard != over) {
							c.set_alpha(Value);
							c.set_y(flixel_FlxG.height / 2 - 22 + 100 * (1 - Value));
						}
					}
					_gthis.back.set_alpha(Value);
				});
				flixel_tweens_FlxTween.tween(this.cards[over],{ alpha : 0, y : -60},.4,{ type : 8, startDelay : .2, onComplete : function(_) {
					_gthis.close();
					_gthis.callback(over);
				}});
			}
		}
		flixel_FlxSubState.prototype.update.call(this,elapsed);
	}
	,__class__: SpellChoice
});
var Std = function() { };
$hxClasses["Std"] = Std;
Std.__name__ = "Std";
Std.string = function(s) {
	return js_Boot.__string_rec(s,"");
};
Std.parseInt = function(x) {
	if(x != null) {
		var _g = 0;
		var _g1 = x.length;
		while(_g < _g1) {
			var i = _g++;
			var c = x.charCodeAt(i);
			if(c <= 8 || c >= 14 && c != 32 && c != 45) {
				var nc = x.charCodeAt(i + 1);
				var v = parseInt(x,nc == 120 || nc == 88 ? 16 : 10);
				if(isNaN(v)) {
					return null;
				} else {
					return v;
				}
			}
		}
	}
	return null;
};
var _$String_String_$Impl_$ = function() { };
$hxClasses["_String.String_Impl_"] = _$String_String_$Impl_$;
_$String_String_$Impl_$.__name__ = "_String.String_Impl_";
_$String_String_$Impl_$.fromCharCode = function(code) {
	return String.fromCodePoint(code);
};
var StringBuf = function() {
	this.b = "";
};
$hxClasses["StringBuf"] = StringBuf;
StringBuf.__name__ = "StringBuf";
StringBuf.prototype = {
	b: null
	,__class__: StringBuf
};
var StringTools = function() { };
$hxClasses["StringTools"] = StringTools;
StringTools.__name__ = "StringTools";
StringTools.htmlEscape = function(s,quotes) {
	var buf_b = "";
	var _g_offset = 0;
	var _g_s = s;
	while(_g_offset < _g_s.length) {
		var s = _g_s;
		var index = _g_offset++;
		var c = s.charCodeAt(index);
		if(c >= 55296 && c <= 56319) {
			c = c - 55232 << 10 | s.charCodeAt(index + 1) & 1023;
		}
		var c1 = c;
		if(c1 >= 65536) {
			++_g_offset;
		}
		var code = c1;
		switch(code) {
		case 34:
			if(quotes) {
				buf_b += "&quot;";
			} else {
				buf_b += String.fromCodePoint(code);
			}
			break;
		case 38:
			buf_b += "&amp;";
			break;
		case 39:
			if(quotes) {
				buf_b += "&#039;";
			} else {
				buf_b += String.fromCodePoint(code);
			}
			break;
		case 60:
			buf_b += "&lt;";
			break;
		case 62:
			buf_b += "&gt;";
			break;
		default:
			buf_b += String.fromCodePoint(code);
		}
	}
	return buf_b;
};
StringTools.startsWith = function(s,start) {
	if(s.length >= start.length) {
		return s.lastIndexOf(start,0) == 0;
	} else {
		return false;
	}
};
StringTools.endsWith = function(s,end) {
	var elen = end.length;
	var slen = s.length;
	if(slen >= elen) {
		return s.indexOf(end,slen - elen) == slen - elen;
	} else {
		return false;
	}
};
StringTools.isSpace = function(s,pos) {
	var c = HxOverrides.cca(s,pos);
	if(!(c > 8 && c < 14)) {
		return c == 32;
	} else {
		return true;
	}
};
StringTools.ltrim = function(s) {
	var l = s.length;
	var r = 0;
	while(r < l && StringTools.isSpace(s,r)) ++r;
	if(r > 0) {
		return HxOverrides.substr(s,r,l - r);
	} else {
		return s;
	}
};
StringTools.rtrim = function(s) {
	var l = s.length;
	var r = 0;
	while(r < l && StringTools.isSpace(s,l - r - 1)) ++r;
	if(r > 0) {
		return HxOverrides.substr(s,0,l - r);
	} else {
		return s;
	}
};
StringTools.trim = function(s) {
	return StringTools.ltrim(StringTools.rtrim(s));
};
StringTools.lpad = function(s,c,l) {
	if(c.length <= 0) {
		return s;
	}
	var buf_b = "";
	l -= s.length;
	while(buf_b.length < l) buf_b += c == null ? "null" : "" + c;
	buf_b += s == null ? "null" : "" + s;
	return buf_b;
};
StringTools.rpad = function(s,c,l) {
	if(c.length <= 0) {
		return s;
	}
	var buf_b = "";
	buf_b += s == null ? "null" : "" + s;
	while(buf_b.length < l) buf_b += c == null ? "null" : "" + c;
	return buf_b;
};
StringTools.replace = function(s,sub,by) {
	return s.split(sub).join(by);
};
StringTools.hex = function(n,digits) {
	var s = "";
	var hexChars = "0123456789ABCDEF";
	while(true) {
		s = hexChars.charAt(n & 15) + s;
		n >>>= 4;
		if(!(n > 0)) {
			break;
		}
	}
	if(digits != null) {
		while(s.length < digits) s = "0" + s;
	}
	return s;
};
var TitleState = function(MaxSize) {
	this.ready = false;
	flixel_FlxState.call(this,MaxSize);
};
$hxClasses["TitleState"] = TitleState;
TitleState.__name__ = "TitleState";
TitleState.__super__ = flixel_FlxState;
TitleState.prototype = $extend(flixel_FlxState.prototype,{
	buttonPlay: null
	,buttonHelp: null
	,buttonCredits: null
	,title: null
	,logoEffect: null
	,logo: null
	,titleEffect: null
	,titleWave: null
	,logoWave: null
	,ready: null
	,create: function() {
		var _gthis = this;
		Globals.initGame();
		Sounds.playMusic("title");
		this.title = new flixel_FlxSprite();
		this.title.loadGraphic("assets/images/title.png");
		this.title.screenCenter(flixel_util_FlxAxes.X);
		this.title.set_y(flixel_FlxG.height - this.title.get_height());
		this.titleWave = new flixel_addons_effects_chainable_FlxWaveEffect(flixel_addons_effects_chainable_FlxWaveMode.END,20,0,5,5,flixel_addons_effects_chainable_FlxWaveDirection.HORIZONTAL,1);
		this.titleEffect = new flixel_addons_effects_chainable_FlxEffectSprite(this.title,[this.titleWave]);
		this.titleEffect.set_x(this.title.x);
		this.titleEffect.set_y(this.title.y);
		this.add(this.titleEffect);
		this.logo = new flixel_FlxSprite();
		this.logo.loadGraphic("assets/images/title_logo.png");
		this.logo.screenCenter(flixel_util_FlxAxes.X);
		this.logo.set_x(this.logo.x | 0);
		this.logo.set_y(2);
		this.logo.set_alpha(0);
		this.logoWave = new flixel_addons_effects_chainable_FlxWaveEffect(flixel_addons_effects_chainable_FlxWaveMode.ALL,10,0.5,3,2,flixel_addons_effects_chainable_FlxWaveDirection.VERTICAL,0);
		this.logoEffect = new flixel_addons_effects_chainable_FlxEffectSprite(this.logo,[this.logoWave]);
		this.logoEffect.set_x(this.logo.x);
		this.logoEffect.set_y(this.logo.y);
		this.add(this.logoEffect);
		this.buttonPlay = new flixel_ui_FlxSpriteButton(0,0,null,$bind(this,this.clickPlay));
		this.buttonPlay.loadGraphic("assets/images/play_button.png",true,24,12);
		this.buttonPlay.set_x(2);
		this.buttonPlay.set_y(flixel_FlxG.height - 14);
		this.buttonPlay.set_alpha(0);
		this.add(this.buttonPlay);
		this.buttonHelp = new flixel_ui_FlxSpriteButton(0,0,null,$bind(this,this.clickHelp));
		this.buttonHelp.loadGraphic("assets/images/tut_button.png",true,10,12);
		this.buttonHelp.set_x(this.buttonPlay.x + this.buttonPlay.get_width() + 2);
		this.buttonHelp.set_y(flixel_FlxG.height - 14);
		this.buttonHelp.set_alpha(0);
		this.add(this.buttonHelp);
		this.buttonCredits = new flixel_ui_FlxSpriteButton(0,0,null,$bind(this,this.clickCredits));
		this.buttonCredits.loadGraphic("assets/images/credits_button.png",true,37,12);
		this.buttonCredits.set_x(flixel_FlxG.width - this.buttonCredits.get_width() - 2);
		this.buttonCredits.set_y(flixel_FlxG.height - 14);
		this.buttonCredits.set_alpha(0);
		this.add(this.buttonCredits);
		flixel_FlxG.camera.fade(-16777216,1,true);
		flixel_tweens_FlxTween.num(0,1,1,{ type : 8, ease : flixel_tweens_FlxEase.sineIn, startDelay : .2},function(Value) {
			_gthis.titleWave.center = Value;
		});
		flixel_tweens_FlxTween.num(0,1,1,{ type : 8, ease : flixel_tweens_FlxEase.sineIn, startDelay : .4},function(Value) {
			_gthis.titleWave.strength = Math.round(20 + Value * -20);
		});
		flixel_tweens_FlxTween.tween(this.titleEffect,{ y : -3},2,{ type : 8, ease : flixel_tweens_FlxEase.sineInOut, onComplete : function(_) {
			flixel_FlxG.camera.flash(1728052992,.2,function() {
				Sounds.play("thunder_01",.33);
				flixel_FlxG.camera.flash(872414976,.2);
			});
			flixel_tweens_FlxTween.num(0,1,1,{ type : 8, ease : flixel_tweens_FlxEase.sineIn, startDelay : .2, onComplete : function(_) {
				Sounds.play("thunder_02",.5);
				flixel_FlxG.camera.flash(-1711276288,.4);
				flixel_tweens_FlxTween.num(0,1,.33,{ type : 8, ease : flixel_tweens_FlxEase.sineOut, onComplete : function(_) {
					_gthis.ready = true;
				}},function(Value) {
					_gthis.buttonCredits.set_alpha(_gthis.buttonHelp.set_alpha(_gthis.buttonPlay.set_alpha(Value)));
				});
			}},function(Value) {
				_gthis.logoWave.strength = Math.round(10 + Value * -10);
			});
			flixel_tweens_FlxTween.tween(_gthis.logo,{ alpha : 1},.33,{ type : 8, ease : flixel_tweens_FlxEase.sineOut});
		}});
		flixel_FlxState.prototype.create.call(this);
	}
	,clickPlay: function() {
		if(!this.ready) {
			return;
		}
		this.ready = false;
		Sounds.play("click",.2);
		flixel_FlxG.camera.flash(-1711276288,.2,function() {
			flixel_FlxG.camera.fade(-16777216,.66,false,function() {
				if(!Globals.SeenTut) {
					var nextState = new HelpState(true);
					if(flixel_FlxG.game._state.switchTo(nextState)) {
						flixel_FlxG.game._requestedState = nextState;
					}
				} else {
					var nextState = new PlayState();
					if(flixel_FlxG.game._state.switchTo(nextState)) {
						flixel_FlxG.game._requestedState = nextState;
					}
				}
			});
		});
	}
	,clickHelp: function() {
		if(!this.ready) {
			return;
		}
		this.ready = false;
		Sounds.play("click",.2);
		flixel_FlxG.camera.flash(-1711276288,.2,function() {
			flixel_FlxG.camera.fade(-16777216,.66,false,function() {
				var nextState = new HelpState();
				if(flixel_FlxG.game._state.switchTo(nextState)) {
					flixel_FlxG.game._requestedState = nextState;
				}
			});
		});
	}
	,clickCredits: function() {
		if(!this.ready) {
			return;
		}
		this.ready = false;
		Sounds.play("click",.2);
		flixel_FlxG.camera.flash(-1711276288,.2,function() {
			flixel_FlxG.camera.fade(-16777216,.66,false,function() {
				var nextState = new CreditsState();
				if(flixel_FlxG.game._state.switchTo(nextState)) {
					flixel_FlxG.game._requestedState = nextState;
				}
			});
		});
	}
	,__class__: TitleState
});
var Transformer = function(X,Y) {
	flixel_FlxSprite.call(this,X,Y);
	this.loadGraphic("assets/images/transform.png",true,8,8);
	this.animation.add("go",[0,1,2],8,false);
	this.kill();
};
$hxClasses["Transformer"] = Transformer;
Transformer.__name__ = "Transformer";
Transformer.__super__ = flixel_FlxSprite;
Transformer.prototype = $extend(flixel_FlxSprite.prototype,{
	start: function() {
		this.revive();
		this.animation.play("go");
	}
	,update: function(elapsed) {
		if(this.animation.get_finished()) {
			this.kill();
		}
		flixel_FlxSprite.prototype.update.call(this,elapsed);
	}
	,__class__: Transformer
});
var Tube = function(X,Y) {
	this.colors = [-65536,-256,-16744448,-16711681,-16776961,-65281,-1];
	this.fillAmount = 0;
	this.whichMonster = -1;
	this.y = 0;
	this.x = 0;
	flixel_group_FlxTypedGroup.call(this);
	this.fill = new flixel_FlxSprite();
	this.fill.makeGraphic(4,11,0,true,"tube+" + X + "-" + Y);
	this.add(this.fill);
	this.portrait = new flixel_FlxSprite();
	this.portrait.loadGraphic("assets/images/monsters.png",true,8,8);
	this.portrait.set_visible(false);
	this.add(this.portrait);
	this.spawn = new flixel_FlxSprite();
	this.spawn.loadGraphic("assets/images/spawn.png",true,8,8);
	this.spawn.animation.add("spawn",[0,1,2,3,4,5,2,3,4,5,6,7,8,9,10],12,false);
	this.spawn.kill();
	this.add(this.spawn);
	this.tube = new flixel_FlxSprite();
	this.tube.loadGraphic("assets/images/tube.png");
	this.add(this.tube);
	this.set_x(X);
	this.set_y(Y);
};
$hxClasses["Tube"] = Tube;
Tube.__name__ = "Tube";
Tube.__super__ = flixel_group_FlxTypedGroup;
Tube.prototype = $extend(flixel_group_FlxTypedGroup.prototype,{
	x: null
	,y: null
	,whichMonster: null
	,fillAmount: null
	,colors: null
	,tube: null
	,fill: null
	,portrait: null
	,monsterData: null
	,fillRect: null
	,spawn: null
	,set_whichMonster: function(Value) {
		this.whichMonster = Value;
		if(Value >= 0) {
			this.monsterData = MonsterData.getFromID(this.whichMonster);
			this.portrait.animation.set_frameIndex(this.monsterData.id);
			this.fillRect = new openfl_geom_Rectangle(0,9,4,2);
			this.fill.get_pixels().fillRect(this.fillRect,-1);
			this.fill.dirty = true;
			this.portrait.set_visible(true);
			this.fill.set_visible(true);
		} else {
			this.fillRect = new openfl_geom_Rectangle(0,9,4,2);
			this.fill.get_pixels().fillRect(this.fill.get_pixels().rect,0);
			this.monsterData = null;
			this.portrait.set_visible(false);
			this.fill.set_visible(false);
		}
		return this.whichMonster;
	}
	,set_x: function(Value) {
		this.x = Value;
		this.tube.set_x(this.x);
		this.fill.set_x(this.tube.x + 2);
		this.portrait.set_x(this.tube.x);
		this.spawn.set_x(this.portrait.x);
		return this.x;
	}
	,set_y: function(Value) {
		this.y = Value;
		this.portrait.set_y(this.y);
		this.tube.set_y(this.portrait.y + 8);
		this.fill.set_y(this.tube.y + this.tube.get_height() - 1 - this.fill.get_height());
		this.spawn.set_y(this.portrait.y);
		return this.y;
	}
	,set_fillAmount: function(Value) {
		var lowerBound = Value < 0 ? 0 : Value;
		Value = lowerBound > 1 ? 1 : lowerBound;
		if(Value < this.fillAmount) {
			this.fill.get_pixels().fillRect(this.fill.get_pixels().rect,0);
		}
		this.fillAmount = Value;
		this.fillRect.height = 2 + this.fillAmount * 9;
		this.fillRect.y = 11 - Math.floor(this.fillRect.height);
		this.fill.get_pixels().fillRect(this.fillRect,-1);
		this.fill.dirty = true;
		return this.fillAmount;
	}
	,draw: function() {
		if(this.spawn.alive) {
			this.spawn.set_color(this.fill.set_color(this.colors[flixel_FlxG.game.ticks / 100 % 7 | 0]));
		} else if(this.whichMonster >= 0) {
			this.fill.set_color(flixel_util_FlxColor.fromString("#" + this.monsterData.color));
		}
		flixel_group_FlxTypedGroup.prototype.draw.call(this);
	}
	,showSpawn: function() {
		var _gthis = this;
		this.spawn.revive();
		this.spawn.animation.play("spawn",true);
		this.spawn.animation.finishCallback = function(Anim) {
			_gthis.spawn.kill();
		};
	}
	,__class__: Tube
	,__properties__: $extend(flixel_group_FlxTypedGroup.prototype.__properties__,{set_fillAmount:"set_fillAmount",set_whichMonster:"set_whichMonster",set_y:"set_y",set_x:"set_x"})
});
var ValueType = $hxEnums["ValueType"] = { __ename__ : "ValueType", __constructs__ : ["TNull","TInt","TFloat","TBool","TObject","TFunction","TClass","TEnum","TUnknown"]
	,TNull: {_hx_index:0,__enum__:"ValueType",toString:$estr}
	,TInt: {_hx_index:1,__enum__:"ValueType",toString:$estr}
	,TFloat: {_hx_index:2,__enum__:"ValueType",toString:$estr}
	,TBool: {_hx_index:3,__enum__:"ValueType",toString:$estr}
	,TObject: {_hx_index:4,__enum__:"ValueType",toString:$estr}
	,TFunction: {_hx_index:5,__enum__:"ValueType",toString:$estr}
	,TClass: ($_=function(c) { return {_hx_index:6,c:c,__enum__:"ValueType",toString:$estr}; },$_.__params__ = ["c"],$_)
	,TEnum: ($_=function(e) { return {_hx_index:7,e:e,__enum__:"ValueType",toString:$estr}; },$_.__params__ = ["e"],$_)
	,TUnknown: {_hx_index:8,__enum__:"ValueType",toString:$estr}
};
var Type = function() { };
$hxClasses["Type"] = Type;
Type.__name__ = "Type";
Type.getEnum = function(o) {
	if(o == null) {
		return null;
	}
	return $hxEnums[o.__enum__];
};
Type.resolveEnum = function(name) {
	return $hxEnums[name];
};
Type.createInstance = function(cl,args) {
	var ctor = Function.prototype.bind.apply(cl,[null].concat(args));
	return new (ctor);
};
Type.createEnum = function(e,constr,params) {
	var f = Reflect.field(e,constr);
	if(f == null) {
		throw haxe_Exception.thrown("No such constructor " + constr);
	}
	if(Reflect.isFunction(f)) {
		if(params == null) {
			throw haxe_Exception.thrown("Constructor " + constr + " need parameters");
		}
		return f.apply(e,params);
	}
	if(params != null && params.length != 0) {
		throw haxe_Exception.thrown("Constructor " + constr + " does not need parameters");
	}
	return f;
};
Type.getInstanceFields = function(c) {
	var a = [];
	for(var i in c.prototype) a.push(i);
	HxOverrides.remove(a,"__class__");
	HxOverrides.remove(a,"__properties__");
	return a;
};
Type.getClassFields = function(c) {
	var a = Reflect.fields(c);
	HxOverrides.remove(a,"__name__");
	HxOverrides.remove(a,"__interfaces__");
	HxOverrides.remove(a,"__properties__");
	HxOverrides.remove(a,"__super__");
	HxOverrides.remove(a,"__meta__");
	HxOverrides.remove(a,"prototype");
	return a;
};
Type.typeof = function(v) {
	switch(typeof(v)) {
	case "boolean":
		return ValueType.TBool;
	case "function":
		if(v.__name__ || v.__ename__) {
			return ValueType.TObject;
		}
		return ValueType.TFunction;
	case "number":
		if(Math.ceil(v) == v % 2147483648.0) {
			return ValueType.TInt;
		}
		return ValueType.TFloat;
	case "object":
		if(v == null) {
			return ValueType.TNull;
		}
		var e = v.__enum__;
		if(e != null) {
			return ValueType.TEnum($hxEnums[e]);
		}
		var c = js_Boot.getClass(v);
		if(c != null) {
			return ValueType.TClass(c);
		}
		return ValueType.TObject;
	case "string":
		return ValueType.TClass(String);
	case "undefined":
		return ValueType.TNull;
	default:
		return ValueType.TUnknown;
	}
};
Type.enumEq = function(a,b) {
	if(a == b) {
		return true;
	}
	try {
		var e = a.__enum__;
		if(e == null || e != b.__enum__) {
			return false;
		}
		if(a._hx_index != b._hx_index) {
			return false;
		}
		var enm = $hxEnums[e];
		var ctorName = enm.__constructs__[a._hx_index];
		var params = enm[ctorName].__params__;
		var _g = 0;
		while(_g < params.length) {
			var f = params[_g];
			++_g;
			if(!Type.enumEq(a[f],b[f])) {
				return false;
			}
		}
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		return false;
	}
	return true;
};
Type.enumParameters = function(e) {
	var enm = $hxEnums[e.__enum__];
	var ctorName = enm.__constructs__[e._hx_index];
	var params = enm[ctorName].__params__;
	if(params != null) {
		var _g = [];
		var _g1 = 0;
		while(_g1 < params.length) {
			var p = params[_g1];
			++_g1;
			_g.push(e[p]);
		}
		return _g;
	} else {
		return [];
	}
};
var UInt = {};
UInt.gt = function(a,b) {
	var aNeg = a < 0;
	var bNeg = b < 0;
	if(aNeg != bNeg) {
		return aNeg;
	} else {
		return a > b;
	}
};
UInt.toFloat = function(this1) {
	var int = this1;
	if(int < 0) {
		return 4294967296.0 + int;
	} else {
		return int + 0.0;
	}
};
var UnicodeString = {};
UnicodeString.__properties__ = {get_length:"get_length"};
UnicodeString.charCodeAt = function(this1,index) {
	if(index < 0) {
		return null;
	}
	var unicodeOffset = 0;
	var nativeOffset = 0;
	while(nativeOffset < this1.length) {
		var index1 = nativeOffset++;
		var c = this1.charCodeAt(index1);
		if(c >= 55296 && c <= 56319) {
			c = c - 55232 << 10 | this1.charCodeAt(index1 + 1) & 1023;
		}
		var c1 = c;
		if(unicodeOffset == index) {
			return c1;
		}
		if(c1 >= 65536) {
			++nativeOffset;
		}
		++unicodeOffset;
	}
	return null;
};
UnicodeString.substr = function(this1,pos,len) {
	if(pos < 0) {
		pos = UnicodeString.get_length(this1) + pos;
		if(pos < 0) {
			pos = 0;
		}
	}
	if(len != null) {
		if(len < 0) {
			len = UnicodeString.get_length(this1) + len;
		}
		if(len <= 0) {
			return "";
		}
	}
	var unicodeOffset = 0;
	var nativeOffset = 0;
	var fromOffset = -1;
	var subLength = 0;
	while(nativeOffset < this1.length) {
		var c = this1.charCodeAt(nativeOffset);
		if(c >= 55296 && c <= 56319) {
			c = c - 55232 << 10 | this1.charCodeAt(nativeOffset + 1) & 1023;
		}
		var c1 = c;
		if(unicodeOffset >= pos) {
			if(fromOffset < 0) {
				if(len == null) {
					return HxOverrides.substr(this1,nativeOffset,null);
				}
				fromOffset = nativeOffset;
			}
			++subLength;
			if(subLength >= len) {
				var lastOffset = c1 < 65536 ? nativeOffset : nativeOffset + 1;
				return HxOverrides.substr(this1,fromOffset,lastOffset - fromOffset + 1);
			}
		}
		nativeOffset += c1 >= 65536 ? 2 : 1;
		++unicodeOffset;
	}
	if(fromOffset < 0) {
		return "";
	} else {
		return HxOverrides.substr(this1,fromOffset,null);
	}
};
UnicodeString.get_length = function(this1) {
	var l = 0;
	var _g_offset = 0;
	var _g_s = this1;
	while(_g_offset < _g_s.length) {
		var s = _g_s;
		var index = _g_offset++;
		var c = s.charCodeAt(index);
		if(c >= 55296 && c <= 56319) {
			c = c - 55232 << 10 | s.charCodeAt(index + 1) & 1023;
		}
		var c1 = c;
		if(c1 >= 65536) {
			++_g_offset;
		}
		var c2 = c1;
		++l;
	}
	return l;
};
var XmlType = {};
XmlType.toString = function(this1) {
	switch(this1) {
	case 0:
		return "Element";
	case 1:
		return "PCData";
	case 2:
		return "CData";
	case 3:
		return "Comment";
	case 4:
		return "DocType";
	case 5:
		return "ProcessingInstruction";
	case 6:
		return "Document";
	}
};
var Xml = function(nodeType) {
	this.nodeType = nodeType;
	this.children = [];
	this.attributeMap = new haxe_ds_StringMap();
};
$hxClasses["Xml"] = Xml;
Xml.__name__ = "Xml";
Xml.parse = function(str) {
	return haxe_xml_Parser.parse(str);
};
Xml.createElement = function(name) {
	var xml = new Xml(Xml.Element);
	if(xml.nodeType != Xml.Element) {
		throw haxe_Exception.thrown("Bad node type, expected Element but found " + (xml.nodeType == null ? "null" : XmlType.toString(xml.nodeType)));
	}
	xml.nodeName = name;
	return xml;
};
Xml.createPCData = function(data) {
	var xml = new Xml(Xml.PCData);
	if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) {
		throw haxe_Exception.thrown("Bad node type, unexpected " + (xml.nodeType == null ? "null" : XmlType.toString(xml.nodeType)));
	}
	xml.nodeValue = data;
	return xml;
};
Xml.createCData = function(data) {
	var xml = new Xml(Xml.CData);
	if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) {
		throw haxe_Exception.thrown("Bad node type, unexpected " + (xml.nodeType == null ? "null" : XmlType.toString(xml.nodeType)));
	}
	xml.nodeValue = data;
	return xml;
};
Xml.createComment = function(data) {
	var xml = new Xml(Xml.Comment);
	if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) {
		throw haxe_Exception.thrown("Bad node type, unexpected " + (xml.nodeType == null ? "null" : XmlType.toString(xml.nodeType)));
	}
	xml.nodeValue = data;
	return xml;
};
Xml.createDocType = function(data) {
	var xml = new Xml(Xml.DocType);
	if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) {
		throw haxe_Exception.thrown("Bad node type, unexpected " + (xml.nodeType == null ? "null" : XmlType.toString(xml.nodeType)));
	}
	xml.nodeValue = data;
	return xml;
};
Xml.createProcessingInstruction = function(data) {
	var xml = new Xml(Xml.ProcessingInstruction);
	if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) {
		throw haxe_Exception.thrown("Bad node type, unexpected " + (xml.nodeType == null ? "null" : XmlType.toString(xml.nodeType)));
	}
	xml.nodeValue = data;
	return xml;
};
Xml.createDocument = function() {
	return new Xml(Xml.Document);
};
Xml.prototype = {
	nodeType: null
	,nodeName: null
	,nodeValue: null
	,parent: null
	,children: null
	,attributeMap: null
	,get: function(att) {
		if(this.nodeType != Xml.Element) {
			throw haxe_Exception.thrown("Bad node type, expected Element but found " + (this.nodeType == null ? "null" : XmlType.toString(this.nodeType)));
		}
		return this.attributeMap.h[att];
	}
	,set: function(att,value) {
		if(this.nodeType != Xml.Element) {
			throw haxe_Exception.thrown("Bad node type, expected Element but found " + (this.nodeType == null ? "null" : XmlType.toString(this.nodeType)));
		}
		this.attributeMap.h[att] = value;
	}
	,exists: function(att) {
		if(this.nodeType != Xml.Element) {
			throw haxe_Exception.thrown("Bad node type, expected Element but found " + (this.nodeType == null ? "null" : XmlType.toString(this.nodeType)));
		}
		return Object.prototype.hasOwnProperty.call(this.attributeMap.h,att);
	}
	,attributes: function() {
		if(this.nodeType != Xml.Element) {
			throw haxe_Exception.thrown("Bad node type, expected Element but found " + (this.nodeType == null ? "null" : XmlType.toString(this.nodeType)));
		}
		return haxe_ds_StringMap.keysIterator(this.attributeMap.h);
	}
	,elements: function() {
		if(this.nodeType != Xml.Document && this.nodeType != Xml.Element) {
			throw haxe_Exception.thrown("Bad node type, expected Element or Document but found " + (this.nodeType == null ? "null" : XmlType.toString(this.nodeType)));
		}
		var _g = [];
		var _g1 = 0;
		var _g2 = this.children;
		while(_g1 < _g2.length) {
			var child = _g2[_g1];
			++_g1;
			if(child.nodeType == Xml.Element) {
				_g.push(child);
			}
		}
		var ret = _g;
		return new haxe_iterators_ArrayIterator(ret);
	}
	,elementsNamed: function(name) {
		if(this.nodeType != Xml.Document && this.nodeType != Xml.Element) {
			throw haxe_Exception.thrown("Bad node type, expected Element or Document but found " + (this.nodeType == null ? "null" : XmlType.toString(this.nodeType)));
		}
		var _g = [];
		var _g1 = 0;
		var _g2 = this.children;
		while(_g1 < _g2.length) {
			var child = _g2[_g1];
			++_g1;
			var tmp;
			if(child.nodeType == Xml.Element) {
				if(child.nodeType != Xml.Element) {
					throw haxe_Exception.thrown("Bad node type, expected Element but found " + (child.nodeType == null ? "null" : XmlType.toString(child.nodeType)));
				}
				tmp = child.nodeName == name;
			} else {
				tmp = false;
			}
			if(tmp) {
				_g.push(child);
			}
		}
		var ret = _g;
		return new haxe_iterators_ArrayIterator(ret);
	}
	,firstElement: function() {
		if(this.nodeType != Xml.Document && this.nodeType != Xml.Element) {
			throw haxe_Exception.thrown("Bad node type, expected Element or Document but found " + (this.nodeType == null ? "null" : XmlType.toString(this.nodeType)));
		}
		var _g = 0;
		var _g1 = this.children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			if(child.nodeType == Xml.Element) {
				return child;
			}
		}
		return null;
	}
	,addChild: function(x) {
		if(this.nodeType != Xml.Document && this.nodeType != Xml.Element) {
			throw haxe_Exception.thrown("Bad node type, expected Element or Document but found " + (this.nodeType == null ? "null" : XmlType.toString(this.nodeType)));
		}
		if(x.parent != null) {
			x.parent.removeChild(x);
		}
		this.children.push(x);
		x.parent = this;
	}
	,removeChild: function(x) {
		if(this.nodeType != Xml.Document && this.nodeType != Xml.Element) {
			throw haxe_Exception.thrown("Bad node type, expected Element or Document but found " + (this.nodeType == null ? "null" : XmlType.toString(this.nodeType)));
		}
		if(HxOverrides.remove(this.children,x)) {
			x.parent = null;
			return true;
		}
		return false;
	}
	,toString: function() {
		return haxe_xml_Printer.print(this);
	}
	,__class__: Xml
};
var axollib_AxolAPI = function() { };
$hxClasses["axollib.AxolAPI"] = axollib_AxolAPI;
axollib_AxolAPI.__name__ = "axollib.AxolAPI";
axollib_AxolAPI.firstState = null;
axollib_AxolAPI.Save = null;
axollib_AxolAPI.Packets = null;
axollib_AxolAPI.Timer = null;
axollib_AxolAPI.User = null;
axollib_AxolAPI.initialize = function(GameID,PlayerID) {
	if(PlayerID == null) {
		PlayerID = "";
	}
	if(GameID == null) {
		GameID = "";
	}
	if(axollib_AxolAPI.initialized) {
		return;
	}
	axollib_AxolAPI.initialized = true;
	axollib_AxolAPI.gameID = GameID;
	if(PlayerID == "") {
		PlayerID = axollib_AxolAPI.generateGUID();
	}
	axollib_AxolAPI.initSave(PlayerID);
	axollib_AxolAPI.Packets = new haxe_ds_StringMap();
	axollib_AxolAPI.Timer = new flixel_util_FlxTimer().start(.5,axollib_AxolAPI.checkData,0);
};
axollib_AxolAPI.initSave = function(PlayerID,UseSave) {
	if(PlayerID == null) {
		PlayerID = "";
	}
	axollib_AxolAPI.playerID = PlayerID;
	axollib_AxolAPI.User = null;
	axollib_AxolAPI.UserNo = -1;
	axollib_AxolAPI.LoggedIn = false;
	if(UseSave == null) {
		axollib_AxolAPI.Save = new flixel_util_FlxSave();
		axollib_AxolAPI.Save.bind(axollib_AxolAPI.gameID + axollib_AxolAPI.playerID);
	} else {
		axollib_AxolAPI.Save = UseSave;
	}
	if(axollib_AxolAPI.Save.data.packets != null) {
		axollib_AxolAPI.Packets = axollib_AxolAPI.Save.data.packets;
	}
	axollib_AxolAPI.Save.flush();
};
axollib_AxolAPI.generateGUID = function() {
	var uid_b = "";
	var a = 8;
	uid_b += Std.string(StringTools.hex(Std.parseInt(axollib_AxolAPI.getDate()),8));
	while(a++ < 36) uid_b += Std.string((a * 51 & 52) != 0 ? StringTools.hex((a ^ 15) != 0 ? 8 ^ (Math.random() * ((a ^ 20) != 0 ? 16 : 4) | 0) : 4) : "-");
	return uid_b.toLowerCase();
};
axollib_AxolAPI.sendData = function(P) {
	var url = "https://axolstudio.com/api/" + "2.0" + "/" + P.action + "/" + P.object + "?ref=" + new Date().getTime();
	var h = new haxe_http_HttpJs(url);
	h.setHeader("Content-Type","application/json; charset=utf-8");
	var PacketID = P.ID;
	var R = h.get_responseData();
	h.onError = function(Msg) {
		axollib_AxolAPI.onError(Msg,PacketID,R);
	};
	var PacketID1 = P.ID;
	h.onData = function(Data) {
		axollib_AxolAPI.onData(Data,PacketID1);
	};
	var PacketID2 = P.ID;
	h.onStatus = function(Status) {
		axollib_AxolAPI.onStatus(Status,PacketID2);
	};
	P.packetStatus = 1;
	P.timeSent = Std.parseInt(axollib_AxolAPI.getDate());
	h.setPostData(P.data);
	h.request(true);
};
axollib_AxolAPI.onStatus = function(Status,PacketID) {
	haxe_Log.trace(Status,{ fileName : "axollib/AxolAPI.hx", lineNumber : 114, className : "axollib.AxolAPI", methodName : "onStatus"});
};
axollib_AxolAPI.onError = function(Msg,PacketID,R) {
	var p = axollib_AxolAPI.Packets.h[PacketID];
	p.packetStatus = 3;
	haxe_Log.trace("API Data Error",{ fileName : "axollib/AxolAPI.hx", lineNumber : 124, className : "axollib.AxolAPI", methodName : "onError", customParams : [Msg,p,R]});
	if(StringTools.endsWith(Msg,"#451")) {
		var nextState = new axollib_Blocked();
		if(flixel_FlxG.game._state.switchTo(nextState)) {
			flixel_FlxG.game._requestedState = nextState;
		}
	}
};
axollib_AxolAPI.logout = function() {
	axollib_AxolAPI.UserNo = -1;
	axollib_AxolAPI.User = null;
	axollib_AxolAPI.Save.data.jwt = null;
	axollib_AxolAPI.Save.data.user = null;
	axollib_AxolAPI.LoggedIn = false;
	axollib_AxolAPI.Save.flush();
};
axollib_AxolAPI.onData = function(Data,PacketID) {
	var p = axollib_AxolAPI.Packets.h[PacketID];
	if(p == null) {
		return;
	}
	p.packetStatus = 2;
	var data = null;
	try {
		data = JSON.parse(Data);
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		haxe_Log.trace("Error Parsing Data",{ fileName : "axollib/AxolAPI.hx", lineNumber : 164, className : "axollib.AxolAPI", methodName : "onData", customParams : [e,Data]});
	}
	if(data != null) {
		if(data.status == 200) {
			if(data.data != null) {
				if(data.data.user != null) {
					axollib_AxolAPI.UserNo = data.data.user.user_id;
					axollib_AxolAPI.Save.data.user = data.data.user;
					axollib_AxolAPI.User = data.data.user;
				}
				if(data.data.jwt != null) {
					axollib_AxolAPI.Save.data.jwt = data.data.jwt;
					axollib_AxolAPI.LoggedIn = true;
				}
				axollib_AxolAPI.Save.flush();
			}
		} else if(data.status == 451) {
			var nextState = new axollib_Blocked();
			if(flixel_FlxG.game._state.switchTo(nextState)) {
				flixel_FlxG.game._requestedState = nextState;
			}
		} else {
			haxe_Log.trace("API Data Error",{ fileName : "axollib/AxolAPI.hx", lineNumber : 186, className : "axollib.AxolAPI", methodName : "onData", customParams : [data,p]});
		}
	}
	if(p.callback != null) {
		p.callback(data);
	}
	var key = p.ID;
	var _this = axollib_AxolAPI.Packets;
	if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
		delete(_this.h[key]);
	}
};
axollib_AxolAPI.login = function(U,P,Callback) {
	var p = new axollib_APIPacket();
	p.action = "login";
	p.object = "user";
	p.callback = Callback;
	p.data = JSON.stringify({ username : U, password : haxe_crypto_Sha1.encode(P)});
	p.usesData = true;
	axollib_AxolAPI.addPacket(p);
};
axollib_AxolAPI.checkUser = function(K,Callback) {
	var p = new axollib_APIPacket();
	p.action = "check";
	p.object = "user";
	p.callback = Callback;
	p.data = JSON.stringify({ token : K});
	p.usesData = true;
	axollib_AxolAPI.addPacket(p);
};
axollib_AxolAPI.getScores = function(Callback) {
	var p = new axollib_APIPacket();
	p.action = "get";
	p.object = "scores";
	p.callback = Callback;
	p.usesData = true;
	p.data = JSON.stringify({ game_id : axollib_AxolAPI.gameID});
	axollib_AxolAPI.addPacket(p);
};
axollib_AxolAPI.sendScore = function(Amount,Initials,Callback) {
	haxe_Log.trace("sending!",{ fileName : "axollib/AxolAPI.hx", lineNumber : 259, className : "axollib.AxolAPI", methodName : "sendScore"});
	var p = new axollib_APIPacket();
	p.action = "set";
	p.object = "scores";
	p.callback = Callback;
	p.data = JSON.stringify({ game_id : axollib_AxolAPI.gameID, amount : Amount, initials : Initials});
	axollib_AxolAPI.addPacket(p);
};
axollib_AxolAPI.addPacket = function(P) {
	axollib_AxolAPI.Packets.h[P.ID] = P;
	axollib_AxolAPI.sendData(P);
};
axollib_AxolAPI.checkData = function(_) {
	if(!axollib_AxolAPI.initialized) {
		return;
	}
	var p = haxe_ds_StringMap.valueIterator(axollib_AxolAPI.Packets.h);
	while(p.hasNext()) {
		var p1 = p.next();
		if(p1.packetStatus == 1 && p1.timeSent + 60000 >= Std.parseInt(axollib_AxolAPI.getDate()) || p1.packetStatus != 2) {
			axollib_AxolAPI.sendData(p1);
		}
	}
};
axollib_AxolAPI.sendAchieve = function(PA,Callback) {
	var p = new axollib_APIPacket();
	p.action = "give-achieve";
	p.object = "user";
	var _g = Callback;
	var a2 = PA;
	p.callback = function(a1) {
		_g(a1,a2);
	};
	p.data = JSON.stringify({ token : axollib_AxolAPI.Save.data.jwt, user_id : axollib_AxolAPI.UserNo, game_id : axollib_AxolAPI.gameID, achieve_id : PA.ID, earned : PA.earned});
	axollib_AxolAPI.addPacket(p);
};
axollib_AxolAPI.sendEvent = function(EventName,Value) {
	if(Value == null) {
		Value = 0;
	}
	var p = new axollib_APIPacket();
	p.action = "add";
	p.object = "event";
	var pID = axollib_AxolAPI.playerID;
	p.data = JSON.stringify({ event_time : axollib_AxolAPI.getDate(), event_name : EventName, player_id : pID, game_id : axollib_AxolAPI.gameID, value : Value});
	axollib_AxolAPI.addPacket(p);
};
axollib_AxolAPI.sendDeath = function(Room,X,Y) {
	var p = new axollib_APIPacket();
	p.action = "add";
	p.object = "death";
	var pID = axollib_AxolAPI.playerID;
	p.data = JSON.stringify({ death_time : axollib_AxolAPI.getDate(), player_id : pID, game_id : axollib_AxolAPI.gameID, room : Room, x_pos : X, y_pos : Y});
	axollib_AxolAPI.addPacket(p);
};
axollib_AxolAPI.getDate = function(D) {
	var d;
	if(D == null) {
		d = new Date();
	} else {
		d = D;
	}
	return HxOverrides.substr(Std.string(d.getTime()),0,10);
};
var axollib_APIPacket = function() {
	this.usesData = false;
	this.callback = null;
	this.timeSent = -1;
	this.packetStatus = 0;
	this.data = "";
	this.object = "";
	this.action = "";
	this.ID = axollib_AxolAPI.generateGUID();
};
$hxClasses["axollib.APIPacket"] = axollib_APIPacket;
axollib_APIPacket.__name__ = "axollib.APIPacket";
axollib_APIPacket.prototype = {
	ID: null
	,action: null
	,object: null
	,data: null
	,packetStatus: null
	,timeSent: null
	,callback: null
	,usesData: null
	,__class__: axollib_APIPacket
};
var axollib_APIPlayerAchieve = function() {
};
$hxClasses["axollib.APIPlayerAchieve"] = axollib_APIPlayerAchieve;
axollib_APIPlayerAchieve.__name__ = "axollib.APIPlayerAchieve";
axollib_APIPlayerAchieve.prototype = {
	ID: null
	,earned: null
	,confirmed: null
	,__class__: axollib_APIPlayerAchieve
};
var axollib_Blocked = function(MaxSize) {
	flixel_FlxState.call(this,MaxSize);
};
$hxClasses["axollib.Blocked"] = axollib_Blocked;
axollib_Blocked.__name__ = "axollib.Blocked";
axollib_Blocked.__super__ = flixel_FlxState;
axollib_Blocked.prototype = $extend(flixel_FlxState.prototype,{
	create: function() {
		this.add(new flixel_text_FlxText(5,5,flixel_FlxG.width - 10,"You appear to be accessing this software Illegally. Please contact help@axolstudio.com for help or visit https://axolstudio.com/\n\nYour Activity and Personal Information has been logged."));
		flixel_FlxState.prototype.create.call(this);
	}
	,__class__: axollib_Blocked
});
var flixel_addons_transition_FlxTransitionableState = function(TransIn,TransOut) {
	this._exiting = false;
	this.transOutFinished = false;
	this.transIn = TransIn;
	this.transOut = TransOut;
	if(this.transIn == null && flixel_addons_transition_FlxTransitionableState.defaultTransIn != null) {
		this.transIn = flixel_addons_transition_FlxTransitionableState.defaultTransIn;
	}
	if(this.transOut == null && flixel_addons_transition_FlxTransitionableState.defaultTransOut != null) {
		this.transOut = flixel_addons_transition_FlxTransitionableState.defaultTransOut;
	}
	flixel_FlxState.call(this);
};
$hxClasses["flixel.addons.transition.FlxTransitionableState"] = flixel_addons_transition_FlxTransitionableState;
flixel_addons_transition_FlxTransitionableState.__name__ = "flixel.addons.transition.FlxTransitionableState";
flixel_addons_transition_FlxTransitionableState.__super__ = flixel_FlxState;
flixel_addons_transition_FlxTransitionableState.prototype = $extend(flixel_FlxState.prototype,{
	transIn: null
	,transOut: null
	,destroy: function() {
		flixel_FlxState.prototype.destroy.call(this);
		this.transIn = null;
		this.transOut = null;
		this._onExit = null;
	}
	,create: function() {
		flixel_FlxState.prototype.create.call(this);
		this.transitionIn();
	}
	,switchTo: function(nextState) {
		if(!this.get_hasTransOut()) {
			return true;
		}
		if(!this._exiting) {
			this.transitionToState(nextState);
		}
		return this.transOutFinished;
	}
	,transitionToState: function(nextState) {
		this._exiting = true;
		this.transitionOut(function() {
			if(flixel_FlxG.game._state.switchTo(nextState)) {
				flixel_FlxG.game._requestedState = nextState;
			}
		});
		if(flixel_addons_transition_FlxTransitionableState.skipNextTransOut) {
			flixel_addons_transition_FlxTransitionableState.skipNextTransOut = false;
			this.finishTransOut();
		}
	}
	,transitionIn: function() {
		if(this.transIn != null && this.transIn.type != "none") {
			if(flixel_addons_transition_FlxTransitionableState.skipNextTransIn) {
				flixel_addons_transition_FlxTransitionableState.skipNextTransIn = false;
				if(this.finishTransIn != null) {
					this.finishTransIn();
				}
				return;
			}
			var _trans = this.createTransition(this.transIn);
			_trans.setStatus(3);
			this.openSubState(_trans);
			_trans.set_finishCallback($bind(this,this.finishTransIn));
			_trans.start(1);
		}
	}
	,transitionOut: function(OnExit) {
		this._onExit = OnExit;
		if(this.get_hasTransOut()) {
			var _trans = this.createTransition(this.transOut);
			_trans.setStatus(2);
			this.openSubState(_trans);
			_trans.set_finishCallback($bind(this,this.finishTransOut));
			_trans.start(0);
		} else {
			this._onExit();
		}
	}
	,transOutFinished: null
	,_exiting: null
	,_onExit: null
	,get_hasTransIn: function() {
		if(this.transIn != null) {
			return this.transIn.type != "none";
		} else {
			return false;
		}
	}
	,get_hasTransOut: function() {
		if(this.transOut != null) {
			return this.transOut.type != "none";
		} else {
			return false;
		}
	}
	,createTransition: function(data) {
		switch(data.type) {
		case "fade":
			return new flixel_addons_transition_Transition(data);
		case "tiles":
			return new flixel_addons_transition_Transition(data);
		default:
			return null;
		}
	}
	,finishTransIn: function() {
		this.closeSubState();
	}
	,finishTransOut: function() {
		this.transOutFinished = true;
		if(!this._exiting) {
			this.closeSubState();
		}
		if(this._onExit != null) {
			this._onExit();
		}
	}
	,__class__: flixel_addons_transition_FlxTransitionableState
	,__properties__: $extend(flixel_FlxState.prototype.__properties__,{get_hasTransOut:"get_hasTransOut",get_hasTransIn:"get_hasTransIn"})
});
var axollib_DissolveState = function() {
	this.stage = 0;
	this.timer3 = 1;
	this.timer2 = 0;
	this.shiftNo = 0;
	this.timer = .25;
	flixel_addons_transition_FlxTransitionableState.call(this,null,new flixel_addons_transition_TransitionData("fade",-1,.66));
	flixel_FlxG.autoPause = false;
	flixel_FlxG.sound.set_volume(.66);
};
$hxClasses["axollib.DissolveState"] = axollib_DissolveState;
axollib_DissolveState.__name__ = "axollib.DissolveState";
axollib_DissolveState.__super__ = flixel_addons_transition_FlxTransitionableState;
axollib_DissolveState.prototype = $extend(flixel_addons_transition_FlxTransitionableState.prototype,{
	baseColors: null
	,baseBitmapData: null
	,baseImage: null
	,displayImage: null
	,timer: null
	,shiftNo: null
	,timer2: null
	,timer3: null
	,strokeImage: null
	,strokeBitmapData: null
	,strokeColors: null
	,madeinstlouis: null
	,stage: null
	,parts: null
	,destroy: function() {
		this.baseColors = [];
		this.baseBitmapData = flixel_util_FlxDestroyUtil.dispose(this.baseBitmapData);
		this.baseImage = flixel_util_FlxDestroyUtil.destroy(this.baseImage);
		this.displayImage = flixel_util_FlxDestroyUtil.destroy(this.displayImage);
		this.strokeImage = flixel_util_FlxDestroyUtil.destroy(this.strokeImage);
		this.strokeBitmapData = flixel_util_FlxDestroyUtil.dispose(this.strokeBitmapData);
		this.madeinstlouis = flixel_util_FlxDestroyUtil.destroy(this.madeinstlouis);
		this.strokeColors = [];
		var _g = 0;
		var _g1 = this.parts;
		while(_g < _g1.length) {
			var p = _g1[_g];
			++_g;
			p = null;
		}
		this.parts = [];
		flixel_addons_transition_FlxTransitionableState.prototype.destroy.call(this);
	}
	,create: function() {
		flixel_FlxG.autoPause = false;
		this.baseImage = new flixel_FlxSprite();
		this.baseImage.loadGraphic("axollib/images/color-logo.png",false);
		var scale = .25 / (this.baseImage.get_width() / flixel_FlxG.width);
		this.get_camera().setScale(scale,scale);
		this.baseImage.screenCenter();
		this.strokeImage = new flixel_FlxSprite();
		this.strokeImage.loadGraphic("axollib/images/color-stroke.png",false);
		this.baseColors = [-65281,-16776961,-16711681,-16711936,-256,-65536];
		this.strokeColors = [-16777216,-16777216,-16777216,-16777216,-16777216,-16777216];
		this.displayImage = new flixel_FlxSprite();
		this.displayImage.makeGraphic(this.baseImage.get_width() | 0,this.baseImage.get_height() + 50 | 0,-16777216);
		this.displayImage.set_x(this.baseImage.x);
		this.displayImage.set_y(this.baseImage.y - 50);
		this.add(this.displayImage);
		this.madeinstlouis = new flixel_FlxSprite();
		this.madeinstlouis.loadGraphic("axollib/images/madeinstlouis.png",false);
		this.madeinstlouis.screenCenter(flixel_util_FlxAxes.X);
		this.madeinstlouis.set_y(this.displayImage.y + this.displayImage.get_height() + 20);
		this.madeinstlouis.set_alpha(0);
		this.add(this.madeinstlouis);
		this.baseBitmapData = this.baseImage.get_pixels().clone();
		this.strokeBitmapData = this.strokeImage.get_pixels().clone();
		this.parts = [];
		var _g = 0;
		var _g1 = this.baseBitmapData.height;
		while(_g < _g1) {
			var y = _g++;
			var _g2 = 0;
			var _g3 = this.baseBitmapData.width;
			while(_g2 < _g3) {
				var x = _g2++;
				var c = this.baseBitmapData.getPixel32(x,y);
				if(c != 0 && c != -16777216) {
					var p = new axollib_Part(x,y + 50);
					this.parts.push(p);
				}
			}
		}
		this.displayImage.get_pixels().fillRect(this.displayImage.get_pixels().rect,-16777216);
		new flixel_util_FlxTimer().start(.33,function(_) {
			flixel_FlxG.sound.play("axollib/sounds/madeinstl.wav",.5);
		});
		flixel_addons_transition_FlxTransitionableState.prototype.create.call(this);
	}
	,colorStroke: function() {
		var _g = 0;
		var _g1 = this.strokeBitmapData.height | 0;
		while(_g < _g1) {
			var y = _g++;
			var _g2 = 0;
			var _g3 = this.strokeBitmapData.width | 0;
			while(_g2 < _g3) {
				var x = _g2++;
				var color = this.strokeBitmapData.getPixel32(x,y);
				var c = -1;
				if(color != 0 && color != -16777216) {
					var _g4 = 0;
					var _g5 = this.baseColors.length;
					while(_g4 < _g5) {
						var j = _g4++;
						if(color == this.baseColors[j]) {
							c = j;
						}
					}
				}
				if(c != -1) {
					if(y + 50 < this.strokeBitmapData.height) {
						this.displayImage.get_pixels().setPixel32(x,y + 50,this.strokeColors[c]);
					}
				}
			}
		}
		this.displayImage.dirty = true;
	}
	,shiftColors: function() {
		if(this.shiftNo < 6) {
			this.strokeColors.pop();
			this.strokeColors.unshift(this.baseColors[this.shiftNo]);
			this.shiftNo++;
			this.colorStroke();
		} else if(this.shiftNo < 12) {
			this.strokeColors.pop();
			this.strokeColors.unshift(this.baseColors[5 - (this.shiftNo - 6)]);
			this.shiftNo++;
			this.colorStroke();
		} else if(this.shiftNo < 18) {
			this.strokeColors.pop();
			this.strokeColors.unshift(this.baseColors[-16777216]);
			this.shiftNo++;
			this.colorStroke();
		} else if(this.shiftNo == 18) {
			this.shiftNo++;
			this.stage = 2;
		}
	}
	,update: function(elapsed) {
		if(this.stage == 0) {
			this.timer -= elapsed;
			if(this.timer <= 0) {
				this.timer = .02;
				this.stage = 1;
			}
		} else if(this.stage == 1) {
			this.timer -= elapsed;
			if(this.timer <= 0) {
				this.timer = .01;
				this.displayImage.get_pixels().fillRect(this.displayImage.get_pixels().rect,-16777216);
				var anyNotDone = false;
				var _g = 0;
				var _g1 = this.parts;
				while(_g < _g1.length) {
					var p = _g1[_g];
					++_g;
					p.update();
					if(p.done) {
						var tmp = this.displayImage.get_pixels();
						var tmp1 = p.x | 0;
						var tmp2 = p.y | 0;
						var Alpha = p.alpha | 0;
						if(Alpha == null) {
							Alpha = 255;
						}
						var color = flixel_util_FlxColor._new();
						var Alpha1 = Alpha;
						if(Alpha1 == null) {
							Alpha1 = 255;
						}
						color &= -16711681;
						color |= 16711680;
						color &= -65281;
						color |= 65280;
						color &= -256;
						color |= 255;
						color &= 16777215;
						color |= (Alpha1 > 255 ? 255 : Alpha1 < 0 ? 0 : Alpha1) << 24;
						tmp.setPixel32(tmp1,tmp2,color);
					} else {
						this.displayImage.get_pixels().setPixel32(p.x | 0,p.y | 0,flixel_util_FlxColor.fromHSB(p.hue,1,1,p.alpha | 0));
						anyNotDone = true;
					}
				}
				this.displayImage.dirty = true;
			}
		} else if(this.stage == 2) {
			var _g = 0;
			var _g1 = this.parts;
			while(_g < _g1.length) {
				var p = _g1[_g];
				++_g;
				p.switchMode();
			}
			this.timer = 1.5;
			this.stage = 3;
			flixel_tweens_FlxTween.tween(this.madeinstlouis,{ alpha : 1},1,{ type : 8, ease : flixel_tweens_FlxEase.sineIn});
		} else if(this.stage == 3) {
			this.timer -= elapsed;
			if(this.timer <= 0) {
				this.timer = .002;
				this.displayImage.get_pixels().fillRect(this.displayImage.get_pixels().rect,-16777216);
				var anyNotDone = false;
				var _g = 0;
				var _g1 = this.parts;
				while(_g < _g1.length) {
					var p = _g1[_g];
					++_g;
					p.update();
					var tmp = this.displayImage.get_pixels();
					var tmp1 = p.x | 0;
					var tmp2 = p.y | 0;
					var Alpha = p.alpha | 0;
					if(Alpha == null) {
						Alpha = 255;
					}
					var color = flixel_util_FlxColor._new();
					var Alpha1 = Alpha;
					if(Alpha1 == null) {
						Alpha1 = 255;
					}
					color &= -16711681;
					color |= 16711680;
					color &= -65281;
					color |= 65280;
					color &= -256;
					color |= 255;
					color &= 16777215;
					color |= (Alpha1 > 255 ? 255 : Alpha1 < 0 ? 0 : Alpha1) << 24;
					tmp.setPixel32(tmp1,tmp2,color);
					if(p.y < p.destY) {
						var tmp3 = this.displayImage.get_pixels();
						var tmp4 = p.x | 0;
						var tmp5 = p.y | 0;
						var Alpha2 = p.alpha | 0;
						if(Alpha2 == null) {
							Alpha2 = 255;
						}
						var color1 = flixel_util_FlxColor._new();
						var Alpha3 = Alpha2;
						if(Alpha3 == null) {
							Alpha3 = 255;
						}
						color1 &= -16711681;
						color1 |= 16711680;
						color1 &= -65281;
						color1 |= 65280;
						color1 &= -256;
						color1 |= 255;
						color1 &= 16777215;
						color1 |= (Alpha3 > 255 ? 255 : Alpha3 < 0 ? 0 : Alpha3) << 24;
						tmp3.setPixel32(tmp4,tmp5,color1);
					}
					if(p.y + 1 < p.destY) {
						var tmp6 = this.displayImage.get_pixels();
						var tmp7 = p.x | 0;
						var tmp8 = p.y + 1 | 0;
						var Alpha4 = p.alpha - 20 | 0;
						if(Alpha4 == null) {
							Alpha4 = 255;
						}
						var color2 = flixel_util_FlxColor._new();
						var Alpha5 = Alpha4;
						if(Alpha5 == null) {
							Alpha5 = 255;
						}
						color2 &= -16711681;
						color2 |= 16711680;
						color2 &= -65281;
						color2 |= 65280;
						color2 &= -256;
						color2 |= 255;
						color2 &= 16777215;
						color2 |= (Alpha5 > 255 ? 255 : Alpha5 < 0 ? 0 : Alpha5) << 24;
						tmp6.setPixel32(tmp7,tmp8,color2);
					}
					if(p.y + 2 < p.destY) {
						var tmp9 = this.displayImage.get_pixels();
						var tmp10 = p.x | 0;
						var tmp11 = p.y + 2 | 0;
						var Alpha6 = p.alpha - 40 | 0;
						if(Alpha6 == null) {
							Alpha6 = 255;
						}
						var color3 = flixel_util_FlxColor._new();
						var Alpha7 = Alpha6;
						if(Alpha7 == null) {
							Alpha7 = 255;
						}
						color3 &= -16711681;
						color3 |= 16711680;
						color3 &= -65281;
						color3 |= 65280;
						color3 &= -256;
						color3 |= 255;
						color3 &= 16777215;
						color3 |= (Alpha7 > 255 ? 255 : Alpha7 < 0 ? 0 : Alpha7) << 24;
						tmp9.setPixel32(tmp10,tmp11,color3);
					}
					if(p.y + 3 < p.destY) {
						var tmp12 = this.displayImage.get_pixels();
						var tmp13 = p.x | 0;
						var tmp14 = p.y + 3 | 0;
						var Alpha8 = p.alpha - 60 | 0;
						if(Alpha8 == null) {
							Alpha8 = 255;
						}
						var color4 = flixel_util_FlxColor._new();
						var Alpha9 = Alpha8;
						if(Alpha9 == null) {
							Alpha9 = 255;
						}
						color4 &= -16711681;
						color4 |= 16711680;
						color4 &= -65281;
						color4 |= 65280;
						color4 &= -256;
						color4 |= 255;
						color4 &= 16777215;
						color4 |= (Alpha9 > 255 ? 255 : Alpha9 < 0 ? 0 : Alpha9) << 24;
						tmp12.setPixel32(tmp13,tmp14,color4);
					}
					if(p.y + 4 < p.destY) {
						var tmp15 = this.displayImage.get_pixels();
						var tmp16 = p.x | 0;
						var tmp17 = p.y + 4 | 0;
						var Alpha10 = p.alpha - 80 | 0;
						if(Alpha10 == null) {
							Alpha10 = 255;
						}
						var color5 = flixel_util_FlxColor._new();
						var Alpha11 = Alpha10;
						if(Alpha11 == null) {
							Alpha11 = 255;
						}
						color5 &= -16711681;
						color5 |= 16711680;
						color5 &= -65281;
						color5 |= 65280;
						color5 &= -256;
						color5 |= 255;
						color5 &= 16777215;
						color5 |= (Alpha11 > 255 ? 255 : Alpha11 < 0 ? 0 : Alpha11) << 24;
						tmp15.setPixel32(tmp16,tmp17,color5);
					}
					if(!p.done && p.alpha > 0) {
						anyNotDone = true;
					}
				}
				this.displayImage.dirty = true;
				if(!anyNotDone) {
					this.stage = 4;
					this.timer = .33;
				}
			}
		} else if(this.stage == 4) {
			this.timer -= elapsed;
			if(this.timer <= 0) {
				this.displayImage.get_pixels().fillRect(this.displayImage.get_pixels().rect,-16777216);
				this.stage = 5;
				var nextState = Type.createInstance(axollib_AxolAPI.firstState,[]);
				if(flixel_FlxG.game._state.switchTo(nextState)) {
					flixel_FlxG.game._requestedState = nextState;
				}
			}
		}
		if(this.timer3 > 0) {
			this.timer3 -= elapsed;
		} else if(this.shiftNo <= 18) {
			this.timer2 -= elapsed;
			if(this.timer2 <= 0) {
				this.timer2 = .025;
				this.shiftColors();
			}
		}
		flixel_addons_transition_FlxTransitionableState.prototype.update.call(this,elapsed);
	}
	,__class__: axollib_DissolveState
});
var axollib_GraphicsCache = function() { };
$hxClasses["axollib.GraphicsCache"] = axollib_GraphicsCache;
axollib_GraphicsCache.__name__ = "axollib.GraphicsCache";
axollib_GraphicsCache.frames = null;
axollib_GraphicsCache.graphics = null;
axollib_GraphicsCache.init = function() {
	axollib_GraphicsCache.graphics = new haxe_ds_StringMap();
	axollib_GraphicsCache.frames = new haxe_ds_StringMap();
	axollib_GraphicsCache.initialized = true;
};
axollib_GraphicsCache.loadGraphicFromAtlas = function(Name,AtlasImage,AtlasXML,Unique) {
	if(Unique == null) {
		Unique = false;
	}
	if(!axollib_GraphicsCache.initialized) {
		axollib_GraphicsCache.init();
	}
	var g = null;
	if(!Unique) {
		g = axollib_GraphicsCache.graphics.h[Name];
	}
	if(g == null) {
		var t = axollib_GraphicsCache.loadAtlasFrames(Name,AtlasImage,AtlasXML);
		g = flixel_graphics_FlxGraphic.fromGraphic(t.parent,false,null);
		g.persist = true;
		g.set_destroyOnNoUse(false);
		if(!Unique) {
			axollib_GraphicsCache.graphics.h[Name] = g;
		}
	}
	return g;
};
axollib_GraphicsCache.loadGraphic = function(Name,Image1) {
	if(!axollib_GraphicsCache.initialized) {
		axollib_GraphicsCache.init();
	}
	var g = axollib_GraphicsCache.graphics.h[Name];
	if(g == null) {
		g = flixel_graphics_FlxGraphic.fromAssetKey(Image1,true,Name);
		g.set_destroyOnNoUse(false);
		g.persist = true;
		axollib_GraphicsCache.graphics.h[Name] = g;
	}
	return g;
};
axollib_GraphicsCache.loadAtlasFrames = function(Name,AtlasImage,AtlasXML,Unique) {
	if(Unique == null) {
		Unique = false;
	}
	if(!axollib_GraphicsCache.initialized) {
		axollib_GraphicsCache.init();
	}
	var f = null;
	if(!Unique) {
		f = axollib_GraphicsCache.frames.h[Name];
	}
	if(f == null) {
		f = flixel_graphics_frames_FlxAtlasFrames.fromSparrow(AtlasImage,AtlasXML,Unique);
		f.parent.set_destroyOnNoUse(false);
		f.parent.persist = true;
		if(!Unique) {
			axollib_GraphicsCache.frames.h[Name] = f;
		} else {
			f.parent.unique = true;
		}
	}
	return f;
};
axollib_GraphicsCache.loadFlxSpriteFromAtlas = function(FilePrefix) {
	if(!axollib_GraphicsCache.initialized) {
		axollib_GraphicsCache.init();
	}
	var tmp = new flixel_FlxSprite();
	tmp.set_frames(axollib_GraphicsCache.loadAtlasFrames(FilePrefix,"assets/images/" + FilePrefix + ".png","assets/images/" + FilePrefix + ".xml"));
	return tmp;
};
axollib_GraphicsCache.getGraphic = function(Name) {
	return axollib_GraphicsCache.graphics.h[Name];
};
axollib_GraphicsCache.setGraphic = function(Name,Graphic) {
	axollib_GraphicsCache.graphics.h[Name] = Graphic;
	return Graphic;
};
axollib_GraphicsCache.preloadGraphics = function() {
	var r = new EReg("([\\w-]+)(?:\\.)","gi");
	var _g = 0;
	var _g1 = openfl_utils_Assets.list();
	while(_g < _g1.length) {
		var f = _g1[_g];
		++_g;
		if(StringTools.startsWith(f,"assets/images/") && StringTools.endsWith(f,".png")) {
			r.match(f);
			axollib_GraphicsCache.loadGraphic(r.matched(1),f);
		}
	}
};
var axollib_Part = function(DestX,DestY) {
	this.hue = 0;
	this.delay = 0;
	this.done = false;
	this.modeIn = true;
	this.x = this.destX = DestX;
	this.destY = DestY;
	this.alpha = 0;
	this.y = flixel_FlxG.random.int(0,this.destY / 4 | 0);
	this.speed = flixel_FlxG.random.float(.33,3);
	this.alphaSpeed = flixel_FlxG.random.float(1,10);
	this.hue = flixel_FlxG.random.float(0,360);
	this.hueSpeed = flixel_FlxG.random.float(10,30);
};
$hxClasses["axollib.Part"] = axollib_Part;
axollib_Part.__name__ = "axollib.Part";
axollib_Part.prototype = {
	x: null
	,y: null
	,destX: null
	,destY: null
	,alpha: null
	,speed: null
	,alphaSpeed: null
	,modeIn: null
	,done: null
	,delay: null
	,hue: null
	,hueSpeed: null
	,update: function() {
		if(this.modeIn) {
			if(!this.done) {
				this.hue += this.hueSpeed;
				while(this.hue > 360) this.hue -= 360;
				if(this.y < this.destY) {
					this.y += this.speed;
					this.speed += .025;
					if(this.y >= this.destY) {
						this.y = this.destY;
					}
				}
				if(this.alpha < 255) {
					this.alpha += this.alphaSpeed;
					this.alphaSpeed += .1;
					if(this.alpha > 255) {
						this.alpha = 255;
					}
				}
				if(this.y == this.destY && this.alpha == 255) {
					this.done = true;
				}
			}
		} else if(this.delay > 0) {
			this.delay -= flixel_FlxG.elapsed;
		} else if(!this.done) {
			this.y -= this.speed;
			this.speed += .025;
			this.alpha -= this.alphaSpeed;
			this.alphaSpeed += 4;
			if(this.alpha <= 128.) {
				this.alphaSpeed = 64.;
				this.done = true;
			}
		} else {
			this.alpha += this.alphaSpeed;
			this.alphaSpeed *= 2;
			if(this.alpha >= 255) {
				this.alpha = 0;
			}
		}
	}
	,switchMode: function() {
		this.modeIn = false;
		this.done = false;
		this.speed = flixel_FlxG.random.float(.11,.75);
		this.alphaSpeed = flixel_FlxG.random.float(2,20);
		this.delay = flixel_FlxG.random.float(.2,1);
	}
	,__class__: axollib_Part
};
var axollib_TitleCase = function() { };
$hxClasses["axollib.TitleCase"] = axollib_TitleCase;
axollib_TitleCase.__name__ = "axollib.TitleCase";
axollib_TitleCase.toTitleCase = function(str) {
	var words = str.split(" ");
	var _g = 0;
	var _g1 = words.length;
	while(_g < _g1) {
		var i = _g++;
		if(axollib_TitleCase.exempt.indexOf(words[i]) == -1) {
			words[i] = words[i].charAt(0).toUpperCase() + HxOverrides.substr(words[i],1,null);
		}
	}
	haxe_Log.trace(words,{ fileName : "axollib/TitleCase.hx", lineNumber : 19, className : "axollib.TitleCase", methodName : "toTitleCase"});
	return words.join(" ");
};
var flixel_IFlxBasic = function() { };
$hxClasses["flixel.IFlxBasic"] = flixel_IFlxBasic;
flixel_IFlxBasic.__name__ = "flixel.IFlxBasic";
flixel_IFlxBasic.__isInterface__ = true;
flixel_IFlxBasic.prototype = {
	set_active: null
	,set_visible: null
	,set_alive: null
	,set_exists: null
	,ID: null
	,active: null
	,visible: null
	,alive: null
	,exists: null
	,draw: null
	,update: null
	,destroy: null
	,kill: null
	,revive: null
	,toString: null
	,__class__: flixel_IFlxBasic
	,__properties__: {set_exists:"set_exists",set_alive:"set_alive",set_visible:"set_visible",set_active:"set_active"}
};
var flixel_util_FlxPool_$flixel_$math_$FlxPoint = function(classObj) {
	this._count = 0;
	this._pool = [];
	this._class = classObj;
};
$hxClasses["flixel.util.FlxPool_flixel_math_FlxPoint"] = flixel_util_FlxPool_$flixel_$math_$FlxPoint;
flixel_util_FlxPool_$flixel_$math_$FlxPoint.__name__ = "flixel.util.FlxPool_flixel_math_FlxPoint";
flixel_util_FlxPool_$flixel_$math_$FlxPoint.__interfaces__ = [flixel_util_IFlxPool];
flixel_util_FlxPool_$flixel_$math_$FlxPoint.prototype = {
	_pool: null
	,_class: null
	,_count: null
	,get: function() {
		if(this._count == 0) {
			return Type.createInstance(this._class,[]);
		}
		return this._pool[--this._count];
	}
	,put: function(obj) {
		if(obj != null) {
			var i = this._pool.indexOf(obj);
			if(i == -1 || i >= this._count) {
				obj.destroy();
				this._pool[this._count++] = obj;
			}
		}
	}
	,putUnsafe: function(obj) {
		if(obj != null) {
			obj.destroy();
			this._pool[this._count++] = obj;
		}
	}
	,preAllocate: function(numObjects) {
		while(numObjects-- > 0) this._pool[this._count++] = Type.createInstance(this._class,[]);
	}
	,clear: function() {
		this._count = 0;
		var oldPool = this._pool;
		this._pool = [];
		return oldPool;
	}
	,get_length: function() {
		return this._count;
	}
	,__class__: flixel_util_FlxPool_$flixel_$math_$FlxPoint
	,__properties__: {get_length:"get_length"}
};
var flixel_math_FlxPoint = function(X,Y) {
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	this._inPool = false;
	this._weak = false;
	this.y = 0;
	this.x = 0;
	this.set(X,Y);
};
$hxClasses["flixel.math.FlxPoint"] = flixel_math_FlxPoint;
flixel_math_FlxPoint.__name__ = "flixel.math.FlxPoint";
flixel_math_FlxPoint.__interfaces__ = [flixel_util_IFlxPooled];
flixel_math_FlxPoint.__properties__ = {get_pool:"get_pool"};
flixel_math_FlxPoint.get = function(X,Y) {
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	var point = flixel_math_FlxPoint._pool.get().set(X,Y);
	point._inPool = false;
	return point;
};
flixel_math_FlxPoint.weak = function(X,Y) {
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	var X1 = X;
	var Y1 = Y;
	if(Y1 == null) {
		Y1 = 0;
	}
	if(X1 == null) {
		X1 = 0;
	}
	var point = flixel_math_FlxPoint._pool.get().set(X1,Y1);
	point._inPool = false;
	var point1 = point;
	point1._weak = true;
	return point1;
};
flixel_math_FlxPoint.get_pool = function() {
	return flixel_math_FlxPoint._pool;
};
flixel_math_FlxPoint.prototype = {
	x: null
	,y: null
	,_weak: null
	,_inPool: null
	,put: function() {
		if(!this._inPool) {
			this._inPool = true;
			this._weak = false;
			flixel_math_FlxPoint._pool.putUnsafe(this);
		}
	}
	,putWeak: function() {
		if(this._weak) {
			this.put();
		}
	}
	,set: function(X,Y) {
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		this.set_x(X);
		this.set_y(Y);
		return this;
	}
	,add: function(X,Y) {
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var _g = this;
		_g.set_x(_g.x + X);
		var _g = this;
		_g.set_y(_g.y + Y);
		return this;
	}
	,addPoint: function(point) {
		var _g = this;
		_g.set_x(_g.x + point.x);
		var _g = this;
		_g.set_y(_g.y + point.y);
		if(point._weak) {
			point.put();
		}
		return this;
	}
	,addPointWeak: function(point) {
		var _g = this;
		_g.set_x(_g.x + point.x);
		var _g = this;
		_g.set_y(_g.y + point.y);
		return this;
	}
	,subtract: function(X,Y) {
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var _g = this;
		_g.set_x(_g.x - X);
		var _g = this;
		_g.set_y(_g.y - Y);
		return this;
	}
	,subtractPoint: function(point) {
		var _g = this;
		_g.set_x(_g.x - point.x);
		var _g = this;
		_g.set_y(_g.y - point.y);
		if(point._weak) {
			point.put();
		}
		return this;
	}
	,subtractPointWeak: function(point) {
		var _g = this;
		_g.set_x(_g.x - point.x);
		var _g = this;
		_g.set_y(_g.y - point.y);
		return this;
	}
	,scale: function(k) {
		var _g = this;
		_g.set_x(_g.x * k);
		var _g = this;
		_g.set_y(_g.y * k);
		return this;
	}
	,copyFrom: function(point) {
		this.set_x(point.x);
		this.set_y(point.y);
		if(point._weak) {
			point.put();
		}
		return this;
	}
	,copyTo: function(point) {
		if(point == null) {
			var point1 = flixel_math_FlxPoint._pool.get().set(0,0);
			point1._inPool = false;
			point = point1;
		}
		point.set_x(this.x);
		point.set_y(this.y);
		return point;
	}
	,copyFromFlash: function(FlashPoint) {
		this.set_x(FlashPoint.x);
		this.set_y(FlashPoint.y);
		return this;
	}
	,copyToFlash: function(FlashPoint) {
		if(FlashPoint == null) {
			FlashPoint = new openfl_geom_Point();
		}
		FlashPoint.x = this.x;
		FlashPoint.y = this.y;
		return FlashPoint;
	}
	,addToFlash: function(FlashPoint) {
		FlashPoint.x += this.x;
		FlashPoint.y += this.y;
		return FlashPoint;
	}
	,subtractFromFlash: function(FlashPoint) {
		FlashPoint.x -= this.x;
		FlashPoint.y -= this.y;
		return FlashPoint;
	}
	,inCoords: function(RectX,RectY,RectWidth,RectHeight) {
		return flixel_math_FlxMath.pointInCoordinates(this.x,this.y,RectX,RectY,RectWidth,RectHeight);
	}
	,inRect: function(Rect) {
		return flixel_math_FlxMath.pointInFlxRect(this.x,this.y,Rect);
	}
	,distanceTo: function(point) {
		var dx = this.x - point.x;
		var dy = this.y - point.y;
		if(point._weak) {
			point.put();
		}
		return Math.sqrt(dx * dx + dy * dy);
	}
	,floor: function() {
		this.set_x(Math.floor(this.x));
		this.set_y(Math.floor(this.y));
		return this;
	}
	,ceil: function() {
		this.set_x(Math.ceil(this.x));
		this.set_y(Math.ceil(this.y));
		return this;
	}
	,round: function() {
		this.set_x(Math.round(this.x));
		this.set_y(Math.round(this.y));
		return this;
	}
	,rotate: function(Pivot,Angle) {
		var radians = Angle * (Math.PI / 180);
		var n = radians;
		n *= 0.3183098862;
		if(n > 1) {
			n -= Math.ceil(n) >> 1 << 1;
		} else if(n < -1) {
			n += Math.ceil(-n) >> 1 << 1;
		}
		var sin = n > 0 ? n * (3.1 + n * (0.5 + n * (-7.2 + n * 3.6))) : n * (3.1 - n * (0.5 + n * (7.2 + n * 3.6)));
		var n = radians + 1.570796327;
		n *= 0.3183098862;
		if(n > 1) {
			n -= Math.ceil(n) >> 1 << 1;
		} else if(n < -1) {
			n += Math.ceil(-n) >> 1 << 1;
		}
		var cos = n > 0 ? n * (3.1 + n * (0.5 + n * (-7.2 + n * 3.6))) : n * (3.1 - n * (0.5 + n * (7.2 + n * 3.6)));
		var dx = this.x - Pivot.x;
		var dy = this.y - Pivot.y;
		this.set_x(cos * dx - sin * dy + Pivot.x);
		this.set_y(sin * dx + cos * dy + Pivot.y);
		if(Pivot._weak) {
			Pivot.put();
		}
		return this;
	}
	,angleBetween: function(point) {
		var x = point.x - this.x;
		var y = point.y - this.y;
		var angle = 0;
		if(x != 0 || y != 0) {
			var c1 = Math.PI * 0.25;
			var c2 = 3 * c1;
			var ay = y < 0 ? -y : y;
			if(x >= 0) {
				angle = c1 - c1 * ((x - ay) / (x + ay));
			} else {
				angle = c2 - c1 * ((x + ay) / (ay - x));
			}
			angle = (y < 0 ? -angle : angle) * (180 / Math.PI);
			if(angle > 90) {
				angle -= 270;
			} else {
				angle += 90;
			}
		}
		if(point._weak) {
			point.put();
		}
		return angle;
	}
	,toVector: function() {
		var x = this.x;
		var y = this.y;
		if(y == null) {
			y = 0;
		}
		if(x == null) {
			x = 0;
		}
		var X = x;
		var Y = y;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		return point;
	}
	,equals: function(point) {
		var result = Math.abs(this.x - point.x) <= 0.0000001 && Math.abs(this.y - point.y) <= 0.0000001;
		if(point._weak) {
			point.put();
		}
		return result;
	}
	,destroy: function() {
	}
	,transform: function(matrix) {
		var x1 = this.x * matrix.a + this.y * matrix.c + matrix.tx;
		var y1 = this.x * matrix.b + this.y * matrix.d + matrix.ty;
		return this.set(x1,y1);
	}
	,toString: function() {
		var value = this.x;
		var _this = flixel_util_LabelValuePair._pool.get();
		_this.label = "x";
		_this.value = value;
		var value = this.y;
		var _this1 = flixel_util_LabelValuePair._pool.get();
		_this1.label = "y";
		_this1.value = value;
		return flixel_util_FlxStringUtil.getDebugString([_this,_this1]);
	}
	,set_x: function(Value) {
		return this.x = Value;
	}
	,set_y: function(Value) {
		return this.y = Value;
	}
	,__class__: flixel_math_FlxPoint
	,__properties__: {set_y:"set_y",set_x:"set_x"}
};
var lime_math_Matrix3 = function(a,b,c,d,tx,ty) {
	if(ty == null) {
		ty = 0;
	}
	if(tx == null) {
		tx = 0;
	}
	if(d == null) {
		d = 1;
	}
	if(c == null) {
		c = 0;
	}
	if(b == null) {
		b = 0;
	}
	if(a == null) {
		a = 1;
	}
	this.a = a;
	this.b = b;
	this.c = c;
	this.d = d;
	this.tx = tx;
	this.ty = ty;
};
$hxClasses["lime.math.Matrix3"] = lime_math_Matrix3;
lime_math_Matrix3.__name__ = "lime.math.Matrix3";
lime_math_Matrix3.prototype = {
	a: null
	,b: null
	,c: null
	,d: null
	,tx: null
	,ty: null
	,clone: function() {
		return new lime_math_Matrix3(this.a,this.b,this.c,this.d,this.tx,this.ty);
	}
	,concat: function(m) {
		var a1 = this.a * m.a + this.b * m.c;
		this.b = this.a * m.b + this.b * m.d;
		this.a = a1;
		var c1 = this.c * m.a + this.d * m.c;
		this.d = this.c * m.b + this.d * m.d;
		this.c = c1;
		var tx1 = this.tx * m.a + this.ty * m.c + m.tx;
		this.ty = this.tx * m.b + this.ty * m.d + m.ty;
		this.tx = tx1;
	}
	,copyColumnFrom: function(column,vector4) {
		if(column > 2) {
			throw haxe_Exception.thrown("Column " + column + " out of bounds (2)");
		} else if(column == 0) {
			this.a = vector4.x;
			this.b = vector4.y;
		} else if(column == 1) {
			this.c = vector4.x;
			this.d = vector4.y;
		} else {
			this.tx = vector4.x;
			this.ty = vector4.y;
		}
	}
	,copyColumnTo: function(column,vector4) {
		if(column > 2) {
			throw haxe_Exception.thrown("Column " + column + " out of bounds (2)");
		} else if(column == 0) {
			vector4.x = this.a;
			vector4.y = this.b;
			vector4.z = 0;
		} else if(column == 1) {
			vector4.x = this.c;
			vector4.y = this.d;
			vector4.z = 0;
		} else {
			vector4.x = this.tx;
			vector4.y = this.ty;
			vector4.z = 1;
		}
	}
	,copyFrom: function(sourceMatrix3) {
		this.a = sourceMatrix3.a;
		this.b = sourceMatrix3.b;
		this.c = sourceMatrix3.c;
		this.d = sourceMatrix3.d;
		this.tx = sourceMatrix3.tx;
		this.ty = sourceMatrix3.ty;
	}
	,copyRowFrom: function(row,vector4) {
		if(row > 2) {
			throw haxe_Exception.thrown("Row " + row + " out of bounds (2)");
		} else if(row == 0) {
			this.a = vector4.x;
			this.c = vector4.y;
			this.tx = vector4.z;
		} else if(row == 1) {
			this.b = vector4.x;
			this.d = vector4.y;
			this.ty = vector4.z;
		}
	}
	,copyRowTo: function(row,vector4) {
		if(row > 2) {
			throw haxe_Exception.thrown("Row " + row + " out of bounds (2)");
		} else if(row == 0) {
			vector4.x = this.a;
			vector4.y = this.c;
			vector4.z = this.tx;
		} else if(row == 1) {
			vector4.x = this.b;
			vector4.y = this.d;
			vector4.z = this.ty;
		} else {
			vector4.x = 0;
			vector4.y = 0;
			vector4.z = 1;
		}
	}
	,createBox: function(scaleX,scaleY,rotation,tx,ty) {
		if(ty == null) {
			ty = 0;
		}
		if(tx == null) {
			tx = 0;
		}
		if(rotation == null) {
			rotation = 0;
		}
		if(rotation != 0) {
			var cos = Math.cos(rotation);
			var sin = Math.sin(rotation);
			this.a = cos * scaleX;
			this.b = sin * scaleY;
			this.c = -sin * scaleX;
			this.d = cos * scaleY;
		} else {
			this.a = scaleX;
			this.b = 0;
			this.c = 0;
			this.d = scaleY;
		}
		this.tx = tx;
		this.ty = ty;
	}
	,createGradientBox: function(width,height,rotation,tx,ty) {
		if(ty == null) {
			ty = 0;
		}
		if(tx == null) {
			tx = 0;
		}
		if(rotation == null) {
			rotation = 0;
		}
		this.a = width / 1638.4;
		this.d = height / 1638.4;
		if(rotation != 0) {
			var cos = Math.cos(rotation);
			var sin = Math.sin(rotation);
			this.b = sin * this.d;
			this.c = -sin * this.a;
			this.a *= cos;
			this.d *= cos;
		} else {
			this.b = 0;
			this.c = 0;
		}
		this.tx = tx + width / 2;
		this.ty = ty + height / 2;
	}
	,equals: function(matrix3) {
		if(matrix3 != null && this.tx == matrix3.tx && this.ty == matrix3.ty && this.a == matrix3.a && this.b == matrix3.b && this.c == matrix3.c) {
			return this.d == matrix3.d;
		} else {
			return false;
		}
	}
	,deltaTransformVector: function(Vector2,result) {
		if(result == null) {
			result = new lime_math_Vector2();
		}
		result.x = Vector2.x * this.a + Vector2.y * this.c;
		result.y = Vector2.x * this.b + Vector2.y * this.d;
		return result;
	}
	,identity: function() {
		this.a = 1;
		this.b = 0;
		this.c = 0;
		this.d = 1;
		this.tx = 0;
		this.ty = 0;
	}
	,invert: function() {
		var norm = this.a * this.d - this.b * this.c;
		if(norm == 0) {
			this.a = this.b = this.c = this.d = 0;
			this.tx = -this.tx;
			this.ty = -this.ty;
		} else {
			norm = 1.0 / norm;
			var a1 = this.d * norm;
			this.d = this.a * norm;
			this.a = a1;
			this.b *= -norm;
			this.c *= -norm;
			var tx1 = -this.a * this.tx - this.c * this.ty;
			this.ty = -this.b * this.tx - this.d * this.ty;
			this.tx = tx1;
		}
		return this;
	}
	,rotate: function(theta) {
		var cos = Math.cos(theta);
		var sin = Math.sin(theta);
		var a1 = this.a * cos - this.b * sin;
		this.b = this.a * sin + this.b * cos;
		this.a = a1;
		var c1 = this.c * cos - this.d * sin;
		this.d = this.c * sin + this.d * cos;
		this.c = c1;
		var tx1 = this.tx * cos - this.ty * sin;
		this.ty = this.tx * sin + this.ty * cos;
		this.tx = tx1;
	}
	,scale: function(sx,sy) {
		this.a *= sx;
		this.b *= sy;
		this.c *= sx;
		this.d *= sy;
		this.tx *= sx;
		this.ty *= sy;
	}
	,setRotation: function(theta,scale) {
		if(scale == null) {
			scale = 1;
		}
		this.a = Math.cos(theta) * scale;
		this.c = Math.sin(theta) * scale;
		this.b = -this.c;
		this.d = this.a;
	}
	,setTo: function(a,b,c,d,tx,ty) {
		this.a = a;
		this.b = b;
		this.c = c;
		this.d = d;
		this.tx = tx;
		this.ty = ty;
	}
	,to3DString: function(roundPixels) {
		if(roundPixels == null) {
			roundPixels = false;
		}
		if(roundPixels) {
			return "matrix3d(" + this.a + ", " + this.b + ", " + "0, 0, " + this.c + ", " + this.d + ", " + "0, 0, 0, 0, 1, 0, " + (this.tx | 0) + ", " + (this.ty | 0) + ", 0, 1)";
		} else {
			return "matrix3d(" + this.a + ", " + this.b + ", " + "0, 0, " + this.c + ", " + this.d + ", " + "0, 0, 0, 0, 1, 0, " + this.tx + ", " + this.ty + ", 0, 1)";
		}
	}
	,toString: function() {
		return "matrix(" + this.a + ", " + this.b + ", " + this.c + ", " + this.d + ", " + this.tx + ", " + this.ty + ")";
	}
	,transformRect: function(rect,result) {
		if(result == null) {
			result = new lime_math_Rectangle();
		}
		var tx0 = this.a * rect.x + this.c * rect.y;
		var tx1 = tx0;
		var ty0 = this.b * rect.x + this.d * rect.y;
		var ty1 = ty0;
		var tx = this.a * (rect.x + rect.width) + this.c * rect.y;
		var ty = this.b * (rect.x + rect.width) + this.d * rect.y;
		if(tx < tx0) {
			tx0 = tx;
		}
		if(ty < ty0) {
			ty0 = ty;
		}
		if(tx > tx1) {
			tx1 = tx;
		}
		if(ty > ty1) {
			ty1 = ty;
		}
		tx = this.a * (rect.x + rect.width) + this.c * (rect.y + rect.height);
		ty = this.b * (rect.x + rect.width) + this.d * (rect.y + rect.height);
		if(tx < tx0) {
			tx0 = tx;
		}
		if(ty < ty0) {
			ty0 = ty;
		}
		if(tx > tx1) {
			tx1 = tx;
		}
		if(ty > ty1) {
			ty1 = ty;
		}
		tx = this.a * rect.x + this.c * (rect.y + rect.height);
		ty = this.b * rect.x + this.d * (rect.y + rect.height);
		if(tx < tx0) {
			tx0 = tx;
		}
		if(ty < ty0) {
			ty0 = ty;
		}
		if(tx > tx1) {
			tx1 = tx;
		}
		if(ty > ty1) {
			ty1 = ty;
		}
		result.setTo(tx0 + tx,ty0 + ty,tx1 - tx0,ty1 - ty0);
		return result;
	}
	,transformVector: function(pos,result) {
		if(result == null) {
			result = new lime_math_Vector2();
		}
		result.x = pos.x * this.a + pos.y * this.c + this.tx;
		result.y = pos.x * this.b + pos.y * this.d + this.ty;
		return result;
	}
	,translate: function(dx,dy) {
		this.tx += dx;
		this.ty += dy;
	}
	,__class__: lime_math_Matrix3
};
var openfl_geom_Matrix = function(a,b,c,d,tx,ty) {
	if(ty == null) {
		ty = 0;
	}
	if(tx == null) {
		tx = 0;
	}
	if(d == null) {
		d = 1;
	}
	if(c == null) {
		c = 0;
	}
	if(b == null) {
		b = 0;
	}
	if(a == null) {
		a = 1;
	}
	this.a = a;
	this.b = b;
	this.c = c;
	this.d = d;
	this.tx = tx;
	this.ty = ty;
};
$hxClasses["openfl.geom.Matrix"] = openfl_geom_Matrix;
openfl_geom_Matrix.__name__ = "openfl.geom.Matrix";
openfl_geom_Matrix.prototype = {
	a: null
	,b: null
	,c: null
	,d: null
	,tx: null
	,ty: null
	,__array: null
	,clone: function() {
		return new openfl_geom_Matrix(this.a,this.b,this.c,this.d,this.tx,this.ty);
	}
	,concat: function(m) {
		var a1 = this.a * m.a + this.b * m.c;
		this.b = this.a * m.b + this.b * m.d;
		this.a = a1;
		var c1 = this.c * m.a + this.d * m.c;
		this.d = this.c * m.b + this.d * m.d;
		this.c = c1;
		var tx1 = this.tx * m.a + this.ty * m.c + m.tx;
		this.ty = this.tx * m.b + this.ty * m.d + m.ty;
		this.tx = tx1;
	}
	,copyColumnFrom: function(column,vector3D) {
		if(column > 2) {
			throw haxe_Exception.thrown("Column " + column + " out of bounds (2)");
		} else if(column == 0) {
			this.a = vector3D.x;
			this.b = vector3D.y;
		} else if(column == 1) {
			this.c = vector3D.x;
			this.d = vector3D.y;
		} else {
			this.tx = vector3D.x;
			this.ty = vector3D.y;
		}
	}
	,copyColumnTo: function(column,vector3D) {
		if(column > 2) {
			throw haxe_Exception.thrown("Column " + column + " out of bounds (2)");
		} else if(column == 0) {
			vector3D.x = this.a;
			vector3D.y = this.b;
			vector3D.z = 0;
		} else if(column == 1) {
			vector3D.x = this.c;
			vector3D.y = this.d;
			vector3D.z = 0;
		} else {
			vector3D.x = this.tx;
			vector3D.y = this.ty;
			vector3D.z = 1;
		}
	}
	,copyFrom: function(sourceMatrix) {
		this.a = sourceMatrix.a;
		this.b = sourceMatrix.b;
		this.c = sourceMatrix.c;
		this.d = sourceMatrix.d;
		this.tx = sourceMatrix.tx;
		this.ty = sourceMatrix.ty;
	}
	,copyRowFrom: function(row,vector3D) {
		if(row > 2) {
			throw haxe_Exception.thrown("Row " + row + " out of bounds (2)");
		} else if(row == 0) {
			this.a = vector3D.x;
			this.c = vector3D.y;
			this.tx = vector3D.z;
		} else if(row == 1) {
			this.b = vector3D.x;
			this.d = vector3D.y;
			this.ty = vector3D.z;
		}
	}
	,copyRowTo: function(row,vector3D) {
		if(row > 2) {
			throw haxe_Exception.thrown("Row " + row + " out of bounds (2)");
		} else if(row == 0) {
			vector3D.x = this.a;
			vector3D.y = this.c;
			vector3D.z = this.tx;
		} else if(row == 1) {
			vector3D.x = this.b;
			vector3D.y = this.d;
			vector3D.z = this.ty;
		} else {
			vector3D.setTo(0,0,1);
		}
	}
	,createBox: function(scaleX,scaleY,rotation,tx,ty) {
		if(ty == null) {
			ty = 0;
		}
		if(tx == null) {
			tx = 0;
		}
		if(rotation == null) {
			rotation = 0;
		}
		if(rotation != 0) {
			var cos = Math.cos(rotation);
			var sin = Math.sin(rotation);
			this.a = cos * scaleX;
			this.b = sin * scaleY;
			this.c = -sin * scaleX;
			this.d = cos * scaleY;
		} else {
			this.a = scaleX;
			this.b = 0;
			this.c = 0;
			this.d = scaleY;
		}
		this.tx = tx;
		this.ty = ty;
	}
	,createGradientBox: function(width,height,rotation,tx,ty) {
		if(ty == null) {
			ty = 0;
		}
		if(tx == null) {
			tx = 0;
		}
		if(rotation == null) {
			rotation = 0;
		}
		this.a = width / 1638.4;
		this.d = height / 1638.4;
		if(rotation != 0) {
			var cos = Math.cos(rotation);
			var sin = Math.sin(rotation);
			this.b = sin * this.d;
			this.c = -sin * this.a;
			this.a *= cos;
			this.d *= cos;
		} else {
			this.b = 0;
			this.c = 0;
		}
		this.tx = tx + width / 2;
		this.ty = ty + height / 2;
	}
	,deltaTransformPoint: function(point) {
		return new openfl_geom_Point(point.x * this.a + point.y * this.c,point.x * this.b + point.y * this.d);
	}
	,equals: function(matrix) {
		if(matrix != null && this.tx == matrix.tx && this.ty == matrix.ty && this.a == matrix.a && this.b == matrix.b && this.c == matrix.c) {
			return this.d == matrix.d;
		} else {
			return false;
		}
	}
	,identity: function() {
		this.a = 1;
		this.b = 0;
		this.c = 0;
		this.d = 1;
		this.tx = 0;
		this.ty = 0;
	}
	,invert: function() {
		var norm = this.a * this.d - this.b * this.c;
		if(norm == 0) {
			this.a = this.b = this.c = this.d = 0;
			this.tx = -this.tx;
			this.ty = -this.ty;
		} else {
			norm = 1.0 / norm;
			var a1 = this.d * norm;
			this.d = this.a * norm;
			this.a = a1;
			this.b *= -norm;
			this.c *= -norm;
			var tx1 = -this.a * this.tx - this.c * this.ty;
			this.ty = -this.b * this.tx - this.d * this.ty;
			this.tx = tx1;
		}
		return this;
	}
	,rotate: function(theta) {
		var cos = Math.cos(theta);
		var sin = Math.sin(theta);
		var a1 = this.a * cos - this.b * sin;
		this.b = this.a * sin + this.b * cos;
		this.a = a1;
		var c1 = this.c * cos - this.d * sin;
		this.d = this.c * sin + this.d * cos;
		this.c = c1;
		var tx1 = this.tx * cos - this.ty * sin;
		this.ty = this.tx * sin + this.ty * cos;
		this.tx = tx1;
	}
	,scale: function(sx,sy) {
		this.a *= sx;
		this.b *= sy;
		this.c *= sx;
		this.d *= sy;
		this.tx *= sx;
		this.ty *= sy;
	}
	,setRotation: function(theta,scale) {
		if(scale == null) {
			scale = 1;
		}
		this.a = Math.cos(theta) * scale;
		this.c = Math.sin(theta) * scale;
		this.b = -this.c;
		this.d = this.a;
	}
	,setTo: function(a,b,c,d,tx,ty) {
		this.a = a;
		this.b = b;
		this.c = c;
		this.d = d;
		this.tx = tx;
		this.ty = ty;
	}
	,to3DString: function(roundPixels) {
		if(roundPixels == null) {
			roundPixels = false;
		}
		if(roundPixels) {
			return "matrix3d(" + this.a + ", " + this.b + ", 0, 0, " + this.c + ", " + this.d + ", 0, 0, 0, 0, 1, 0, " + (this.tx | 0) + ", " + (this.ty | 0) + ", 0, 1)";
		} else {
			return "matrix3d(" + this.a + ", " + this.b + ", 0, 0, " + this.c + ", " + this.d + ", 0, 0, 0, 0, 1, 0, " + this.tx + ", " + this.ty + ", 0, 1)";
		}
	}
	,toMozString: function() {
		return "matrix(" + this.a + ", " + this.b + ", " + this.c + ", " + this.d + ", " + this.tx + "px, " + this.ty + "px)";
	}
	,toString: function() {
		return "matrix(" + this.a + ", " + this.b + ", " + this.c + ", " + this.d + ", " + this.tx + ", " + this.ty + ")";
	}
	,transformPoint: function(pos) {
		return new openfl_geom_Point(pos.x * this.a + pos.y * this.c + this.tx,pos.x * this.b + pos.y * this.d + this.ty);
	}
	,translate: function(dx,dy) {
		this.tx += dx;
		this.ty += dy;
	}
	,toArray: function(transpose) {
		if(transpose == null) {
			transpose = false;
		}
		if(this.__array == null) {
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1 = new Float32Array(9);
			this.__array = this1;
		}
		if(transpose) {
			this.__array[0] = this.a;
			this.__array[1] = this.b;
			this.__array[2] = 0;
			this.__array[3] = this.c;
			this.__array[4] = this.d;
			this.__array[5] = 0;
			this.__array[6] = this.tx;
			this.__array[7] = this.ty;
			this.__array[8] = 1;
		} else {
			this.__array[0] = this.a;
			this.__array[1] = this.c;
			this.__array[2] = this.tx;
			this.__array[3] = this.b;
			this.__array[4] = this.d;
			this.__array[5] = this.ty;
			this.__array[6] = 0;
			this.__array[7] = 0;
			this.__array[8] = 1;
		}
		return this.__array;
	}
	,__cleanValues: function() {
		this.a = Math.round(this.a * 1000) / 1000;
		this.b = Math.round(this.b * 1000) / 1000;
		this.c = Math.round(this.c * 1000) / 1000;
		this.d = Math.round(this.d * 1000) / 1000;
		this.tx = Math.round(this.tx * 10) / 10;
		this.ty = Math.round(this.ty * 10) / 10;
	}
	,__toMatrix3: function() {
		openfl_geom_Matrix.__matrix3.setTo(this.a,this.b,this.c,this.d,this.tx,this.ty);
		return openfl_geom_Matrix.__matrix3;
	}
	,__transformInversePoint: function(point) {
		var norm = this.a * this.d - this.b * this.c;
		if(norm == 0) {
			point.x = -this.tx;
			point.y = -this.ty;
		} else {
			var px = 1.0 / norm * (this.c * (this.ty - point.y) + this.d * (point.x - this.tx));
			point.y = 1.0 / norm * (this.a * (point.y - this.ty) + this.b * (this.tx - point.x));
			point.x = px;
		}
	}
	,__transformInverseX: function(px,py) {
		var norm = this.a * this.d - this.b * this.c;
		if(norm == 0) {
			return -this.tx;
		} else {
			return 1.0 / norm * (this.c * (this.ty - py) + this.d * (px - this.tx));
		}
	}
	,__transformInverseY: function(px,py) {
		var norm = this.a * this.d - this.b * this.c;
		if(norm == 0) {
			return -this.ty;
		} else {
			return 1.0 / norm * (this.a * (py - this.ty) + this.b * (this.tx - px));
		}
	}
	,__transformPoint: function(point) {
		var px = point.x;
		var py = point.y;
		point.x = px * this.a + py * this.c + this.tx;
		point.y = px * this.b + py * this.d + this.ty;
	}
	,__transformX: function(px,py) {
		return px * this.a + py * this.c + this.tx;
	}
	,__transformY: function(px,py) {
		return px * this.b + py * this.d + this.ty;
	}
	,__translateTransformed: function(px,py) {
		this.tx = px * this.a + py * this.c + this.tx;
		this.ty = px * this.b + py * this.d + this.ty;
	}
	,__class__: openfl_geom_Matrix
};
var openfl_geom_ColorTransform = function(redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier,redOffset,greenOffset,blueOffset,alphaOffset) {
	if(alphaOffset == null) {
		alphaOffset = 0;
	}
	if(blueOffset == null) {
		blueOffset = 0;
	}
	if(greenOffset == null) {
		greenOffset = 0;
	}
	if(redOffset == null) {
		redOffset = 0;
	}
	if(alphaMultiplier == null) {
		alphaMultiplier = 1;
	}
	if(blueMultiplier == null) {
		blueMultiplier = 1;
	}
	if(greenMultiplier == null) {
		greenMultiplier = 1;
	}
	if(redMultiplier == null) {
		redMultiplier = 1;
	}
	this.redMultiplier = redMultiplier;
	this.greenMultiplier = greenMultiplier;
	this.blueMultiplier = blueMultiplier;
	this.alphaMultiplier = alphaMultiplier;
	this.redOffset = redOffset;
	this.greenOffset = greenOffset;
	this.blueOffset = blueOffset;
	this.alphaOffset = alphaOffset;
};
$hxClasses["openfl.geom.ColorTransform"] = openfl_geom_ColorTransform;
openfl_geom_ColorTransform.__name__ = "openfl.geom.ColorTransform";
openfl_geom_ColorTransform.__limeColorMatrix = null;
openfl_geom_ColorTransform.prototype = {
	alphaMultiplier: null
	,alphaOffset: null
	,blueMultiplier: null
	,blueOffset: null
	,greenMultiplier: null
	,greenOffset: null
	,redMultiplier: null
	,redOffset: null
	,concat: function(second) {
		this.redOffset = second.redOffset * this.redMultiplier + this.redOffset;
		this.greenOffset = second.greenOffset * this.greenMultiplier + this.greenOffset;
		this.blueOffset = second.blueOffset * this.blueMultiplier + this.blueOffset;
		this.alphaOffset = second.alphaOffset * this.alphaMultiplier + this.alphaOffset;
		this.redMultiplier *= second.redMultiplier;
		this.greenMultiplier *= second.greenMultiplier;
		this.blueMultiplier *= second.blueMultiplier;
		this.alphaMultiplier *= second.alphaMultiplier;
	}
	,toString: function() {
		return "(redMultiplier=" + this.redMultiplier + ", greenMultiplier=" + this.greenMultiplier + ", blueMultiplier=" + this.blueMultiplier + ", alphaMultiplier=" + this.alphaMultiplier + ", redOffset=" + this.redOffset + ", greenOffset=" + this.greenOffset + ", blueOffset=" + this.blueOffset + ", alphaOffset=" + this.alphaOffset + ")";
	}
	,__clone: function() {
		return new openfl_geom_ColorTransform(this.redMultiplier,this.greenMultiplier,this.blueMultiplier,this.alphaMultiplier,this.redOffset,this.greenOffset,this.blueOffset,this.alphaOffset);
	}
	,__copyFrom: function(ct) {
		this.redMultiplier = ct.redMultiplier;
		this.greenMultiplier = ct.greenMultiplier;
		this.blueMultiplier = ct.blueMultiplier;
		this.alphaMultiplier = ct.alphaMultiplier;
		this.redOffset = ct.redOffset;
		this.greenOffset = ct.greenOffset;
		this.blueOffset = ct.blueOffset;
		this.alphaOffset = ct.alphaOffset;
	}
	,__combine: function(ct) {
		this.redMultiplier *= ct.redMultiplier;
		this.greenMultiplier *= ct.greenMultiplier;
		this.blueMultiplier *= ct.blueMultiplier;
		this.alphaMultiplier *= ct.alphaMultiplier;
		this.redOffset += ct.redOffset;
		this.greenOffset += ct.greenOffset;
		this.blueOffset += ct.blueOffset;
		this.alphaOffset += ct.alphaOffset;
	}
	,__identity: function() {
		this.redMultiplier = 1;
		this.greenMultiplier = 1;
		this.blueMultiplier = 1;
		this.alphaMultiplier = 1;
		this.redOffset = 0;
		this.greenOffset = 0;
		this.blueOffset = 0;
		this.alphaOffset = 0;
	}
	,__invert: function() {
		this.redMultiplier = this.redMultiplier != 0 ? 1 / this.redMultiplier : 1;
		this.greenMultiplier = this.greenMultiplier != 0 ? 1 / this.greenMultiplier : 1;
		this.blueMultiplier = this.blueMultiplier != 0 ? 1 / this.blueMultiplier : 1;
		this.alphaMultiplier = this.alphaMultiplier != 0 ? 1 / this.alphaMultiplier : 1;
		this.redOffset = -this.redOffset;
		this.greenOffset = -this.greenOffset;
		this.blueOffset = -this.blueOffset;
		this.alphaOffset = -this.alphaOffset;
	}
	,__equals: function(ct,ignoreAlphaMultiplier) {
		if(ct != null && this.redMultiplier == ct.redMultiplier && this.greenMultiplier == ct.greenMultiplier && this.blueMultiplier == ct.blueMultiplier && (ignoreAlphaMultiplier || this.alphaMultiplier == ct.alphaMultiplier) && this.redOffset == ct.redOffset && this.greenOffset == ct.greenOffset && this.blueOffset == ct.blueOffset) {
			return this.alphaOffset == ct.alphaOffset;
		} else {
			return false;
		}
	}
	,__isDefault: function(ignoreAlphaMultiplier) {
		if(ignoreAlphaMultiplier) {
			if(this.redMultiplier == 1 && this.greenMultiplier == 1 && this.blueMultiplier == 1 && this.redOffset == 0 && this.greenOffset == 0 && this.blueOffset == 0) {
				return this.alphaOffset == 0;
			} else {
				return false;
			}
		} else if(this.redMultiplier == 1 && this.greenMultiplier == 1 && this.blueMultiplier == 1 && this.alphaMultiplier == 1 && this.redOffset == 0 && this.greenOffset == 0 && this.blueOffset == 0) {
			return this.alphaOffset == 0;
		} else {
			return false;
		}
	}
	,__setArrays: function(colorMultipliers,colorOffsets) {
		colorMultipliers[0] = this.redMultiplier;
		colorMultipliers[1] = this.greenMultiplier;
		colorMultipliers[2] = this.blueMultiplier;
		colorMultipliers[3] = this.alphaMultiplier;
		colorOffsets[0] = this.redOffset;
		colorOffsets[1] = this.greenOffset;
		colorOffsets[2] = this.blueOffset;
		colorOffsets[3] = this.alphaOffset;
	}
	,get_color: function() {
		return (this.redOffset | 0) << 16 | (this.greenOffset | 0) << 8 | (this.blueOffset | 0);
	}
	,set_color: function(value) {
		this.redOffset = value >> 16 & 255;
		this.greenOffset = value >> 8 & 255;
		this.blueOffset = value & 255;
		this.redMultiplier = 0;
		this.greenMultiplier = 0;
		this.blueMultiplier = 0;
		return this.get_color();
	}
	,__toLimeColorMatrix: function() {
		if(openfl_geom_ColorTransform.__limeColorMatrix == null) {
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1 = new Float32Array(20);
			openfl_geom_ColorTransform.__limeColorMatrix = this1;
		}
		openfl_geom_ColorTransform.__limeColorMatrix[0] = this.redMultiplier;
		openfl_geom_ColorTransform.__limeColorMatrix[4] = this.redOffset / 255;
		openfl_geom_ColorTransform.__limeColorMatrix[6] = this.greenMultiplier;
		openfl_geom_ColorTransform.__limeColorMatrix[9] = this.greenOffset / 255;
		openfl_geom_ColorTransform.__limeColorMatrix[12] = this.blueMultiplier;
		openfl_geom_ColorTransform.__limeColorMatrix[14] = this.blueOffset / 255;
		openfl_geom_ColorTransform.__limeColorMatrix[18] = this.alphaMultiplier;
		openfl_geom_ColorTransform.__limeColorMatrix[19] = this.alphaOffset / 255;
		return openfl_geom_ColorTransform.__limeColorMatrix;
	}
	,__class__: openfl_geom_ColorTransform
	,__properties__: {set_color:"set_color",get_color:"get_color"}
};
var flixel_FlxCamera = function(X,Y,Width,Height,Zoom) {
	if(Zoom == null) {
		Zoom = 0;
	}
	if(Height == null) {
		Height = 0;
	}
	if(Width == null) {
		Width = 0;
	}
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	this._helperPoint = new openfl_geom_Point();
	this._helperMatrix = new flixel_math_FlxMatrix();
	var _this = flixel_math_FlxRect._pool.get();
	_this.x = 0;
	_this.y = 0;
	_this.width = 0;
	_this.height = 0;
	_this._inPool = false;
	this._bounds = _this;
	this._scrollRect = new openfl_display_Sprite();
	this.initialZoom = 1;
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	this._point = point;
	this._fxShakeAxes = flixel_util_FlxAxes.XY;
	this._fxShakeDuration = 0;
	this._fxShakeIntensity = 0;
	this._fxFadeAlpha = 0;
	this._fxFadeCompleted = true;
	this._fxFadeComplete = null;
	this._fxFadeIn = false;
	this._fxFadeDuration = 0;
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	this._scrollTarget = point;
	this._fxFadeColor = 0;
	this._fxFlashAlpha = 0;
	this._fxFlashComplete = null;
	this._fxFlashDuration = 0;
	this._fxFlashColor = 0;
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	this._flashOffset = point;
	this._flashPoint = new openfl_geom_Point();
	this.filtersEnabled = true;
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	this.followLead = point;
	this.antialiasing = false;
	this.color = -1;
	this.angle = 0;
	this.alpha = 1;
	this._useBlitMatrix = false;
	this._blitMatrix = new flixel_math_FlxMatrix();
	this.viewHeight = 0;
	this.viewWidth = 0;
	this.viewOffsetHeight = 0;
	this.viewOffsetWidth = 0;
	this.viewOffsetY = 0;
	this.viewOffsetX = 0;
	this.height = 0;
	this.width = 0;
	this.flashSprite = new openfl_display_Sprite();
	this.useBgAlphaBlending = false;
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	this.scroll = point;
	this.followLerp = 60 / flixel_FlxG.updateFramerate;
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	this.targetOffset = point;
	this.scaleY = 0;
	this.scaleX = 0;
	this.y = 0;
	this.x = 0;
	flixel_FlxBasic.call(this);
	this.set_x(X);
	this.set_y(Y);
	this.set_width(Width <= 0 ? flixel_FlxG.width : Width);
	this.set_height(Height <= 0 ? flixel_FlxG.height : Height);
	this._flashRect = new openfl_geom_Rectangle(0,0,this.width,this.height);
	this.flashSprite.addChild(this._scrollRect);
	this._scrollRect.set_scrollRect(new openfl_geom_Rectangle());
	this.pixelPerfectRender = flixel_FlxG.renderBlit;
	if(flixel_FlxG.renderBlit) {
		this.screen = new flixel_FlxSprite();
		this.buffer = new openfl_display_BitmapData(this.width,this.height,true,0);
		this.screen.set_pixels(this.buffer);
		this.screen.origin.set();
		this._flashBitmap = new openfl_display_Bitmap(this.buffer);
		this._scrollRect.addChild(this._flashBitmap);
		this._fill = new openfl_display_BitmapData(this.width,this.height,true,0);
	} else {
		this.canvas = new openfl_display_Sprite();
		this._scrollRect.addChild(this.canvas);
	}
	this.set_color(-1);
	this.initialZoom = Zoom == 0 ? flixel_FlxCamera.defaultZoom : Zoom;
	this.set_zoom(Zoom);
	this.updateScrollRect();
	this.updateFlashOffset();
	this.updateFlashSpritePosition();
	this.updateInternalSpritePositions();
	this.bgColor = flixel_FlxG.cameras.get_bgColor();
};
$hxClasses["flixel.FlxCamera"] = flixel_FlxCamera;
flixel_FlxCamera.__name__ = "flixel.FlxCamera";
flixel_FlxCamera.__properties__ = {set_defaultCameras:"set_defaultCameras",get_defaultCameras:"get_defaultCameras"};
flixel_FlxCamera.defaultZoom = null;
flixel_FlxCamera._defaultCameras = null;
flixel_FlxCamera._storageTilesHead = null;
flixel_FlxCamera._storageTrianglesHead = null;
flixel_FlxCamera.get_defaultCameras = function() {
	return flixel_FlxCamera._defaultCameras;
};
flixel_FlxCamera.set_defaultCameras = function(value) {
	return flixel_FlxCamera._defaultCameras = value;
};
flixel_FlxCamera.__super__ = flixel_FlxBasic;
flixel_FlxCamera.prototype = $extend(flixel_FlxBasic.prototype,{
	x: null
	,y: null
	,scaleX: null
	,scaleY: null
	,totalScaleX: null
	,totalScaleY: null
	,style: null
	,target: null
	,targetOffset: null
	,followLerp: null
	,deadzone: null
	,minScrollX: null
	,maxScrollX: null
	,minScrollY: null
	,maxScrollY: null
	,scroll: null
	,buffer: null
	,bgColor: null
	,screen: null
	,useBgAlphaBlending: null
	,flashSprite: null
	,pixelPerfectRender: null
	,width: null
	,height: null
	,zoom: null
	,viewOffsetX: null
	,viewOffsetY: null
	,viewOffsetWidth: null
	,viewOffsetHeight: null
	,viewWidth: null
	,viewHeight: null
	,_blitMatrix: null
	,_useBlitMatrix: null
	,alpha: null
	,angle: null
	,color: null
	,antialiasing: null
	,followLead: null
	,filtersEnabled: null
	,_flashRect: null
	,_flashPoint: null
	,_flashOffset: null
	,_fxFlashColor: null
	,_fxFlashDuration: null
	,_fxFlashComplete: null
	,_fxFlashAlpha: null
	,_fxFadeColor: null
	,_lastTargetPosition: null
	,_scrollTarget: null
	,_fxFadeDuration: null
	,_fxFadeIn: null
	,_fxFadeComplete: null
	,_fxFadeCompleted: null
	,_fxFadeAlpha: null
	,_fxShakeIntensity: null
	,_fxShakeDuration: null
	,_fxShakeComplete: null
	,_fxShakeAxes: null
	,_point: null
	,_filters: null
	,initialZoom: null
	,_fill: null
	,_flashBitmap: null
	,_scrollRect: null
	,_bounds: null
	,canvas: null
	,_helperMatrix: null
	,_helperPoint: null
	,_currentDrawItem: null
	,_headOfDrawStack: null
	,_headTiles: null
	,_headTriangles: null
	,startQuadBatch: function(graphic,colored,hasColorOffsets,blend,smooth,shader) {
		if(smooth == null) {
			smooth = false;
		}
		if(hasColorOffsets == null) {
			hasColorOffsets = false;
		}
		var itemToReturn = null;
		var blendInt = flixel_graphics_tile_FlxDrawBaseItem.blendToInt(blend);
		if(this._currentDrawItem != null && this._currentDrawItem.type == flixel_graphics_tile_FlxDrawItemType.TILES && this._headTiles.graphics == graphic && this._headTiles.colored == colored && this._headTiles.hasColorOffsets == hasColorOffsets && this._headTiles.blending == blendInt && this._headTiles.blend == blend && this._headTiles.antialiasing == smooth && this._headTiles.shader == shader) {
			return this._headTiles;
		}
		if(flixel_FlxCamera._storageTilesHead != null) {
			itemToReturn = flixel_FlxCamera._storageTilesHead;
			var newHead = flixel_FlxCamera._storageTilesHead.nextTyped;
			itemToReturn.reset();
			flixel_FlxCamera._storageTilesHead = newHead;
		} else {
			itemToReturn = new flixel_graphics_tile_FlxDrawQuadsItem();
		}
		itemToReturn.graphics = graphic;
		itemToReturn.antialiasing = smooth;
		itemToReturn.colored = colored;
		itemToReturn.hasColorOffsets = hasColorOffsets;
		itemToReturn.blending = blendInt;
		itemToReturn.blend = blend;
		itemToReturn.shader = shader;
		itemToReturn.nextTyped = this._headTiles;
		this._headTiles = itemToReturn;
		if(this._headOfDrawStack == null) {
			this._headOfDrawStack = itemToReturn;
		}
		if(this._currentDrawItem != null) {
			this._currentDrawItem.next = itemToReturn;
		}
		this._currentDrawItem = itemToReturn;
		return itemToReturn;
	}
	,startTrianglesBatch: function(graphic,smoothing,isColored,blend) {
		if(isColored == null) {
			isColored = false;
		}
		if(smoothing == null) {
			smoothing = false;
		}
		var blendInt = flixel_graphics_tile_FlxDrawBaseItem.blendToInt(blend);
		if(this._currentDrawItem != null && this._currentDrawItem.type == flixel_graphics_tile_FlxDrawItemType.TRIANGLES && this._headTriangles.graphics == graphic && this._headTriangles.antialiasing == smoothing && this._headTriangles.colored == isColored && this._headTriangles.blending == blendInt) {
			return this._headTriangles;
		}
		return this.getNewDrawTrianglesItem(graphic,smoothing,isColored,blend);
	}
	,getNewDrawTrianglesItem: function(graphic,smoothing,isColored,blend) {
		if(isColored == null) {
			isColored = false;
		}
		if(smoothing == null) {
			smoothing = false;
		}
		var itemToReturn = null;
		var blendInt = flixel_graphics_tile_FlxDrawBaseItem.blendToInt(blend);
		if(flixel_FlxCamera._storageTrianglesHead != null) {
			itemToReturn = flixel_FlxCamera._storageTrianglesHead;
			var newHead = flixel_FlxCamera._storageTrianglesHead.nextTyped;
			itemToReturn.reset();
			flixel_FlxCamera._storageTrianglesHead = newHead;
		} else {
			itemToReturn = new flixel_graphics_tile_FlxDrawTrianglesItem();
		}
		itemToReturn.graphics = graphic;
		itemToReturn.antialiasing = smoothing;
		itemToReturn.colored = isColored;
		itemToReturn.blending = blendInt;
		itemToReturn.nextTyped = this._headTriangles;
		this._headTriangles = itemToReturn;
		if(this._headOfDrawStack == null) {
			this._headOfDrawStack = itemToReturn;
		}
		if(this._currentDrawItem != null) {
			this._currentDrawItem.next = itemToReturn;
		}
		this._currentDrawItem = itemToReturn;
		return itemToReturn;
	}
	,clearDrawStack: function() {
		var currTiles = this._headTiles;
		var newTilesHead;
		while(currTiles != null) {
			newTilesHead = currTiles.nextTyped;
			currTiles.reset();
			currTiles.nextTyped = flixel_FlxCamera._storageTilesHead;
			flixel_FlxCamera._storageTilesHead = currTiles;
			currTiles = newTilesHead;
		}
		var currTriangles = this._headTriangles;
		var newTrianglesHead;
		while(currTriangles != null) {
			newTrianglesHead = currTriangles.nextTyped;
			currTriangles.reset();
			currTriangles.nextTyped = flixel_FlxCamera._storageTrianglesHead;
			flixel_FlxCamera._storageTrianglesHead = currTriangles;
			currTriangles = newTrianglesHead;
		}
		this._currentDrawItem = null;
		this._headOfDrawStack = null;
		this._headTiles = null;
		this._headTriangles = null;
	}
	,render: function() {
		var currItem = this._headOfDrawStack;
		while(currItem != null) {
			currItem.render(this);
			currItem = currItem.next;
		}
	}
	,drawPixels: function(frame,pixels,matrix,transform,blend,smoothing,shader) {
		if(smoothing == null) {
			smoothing = false;
		}
		if(flixel_FlxG.renderBlit) {
			this._helperMatrix.copyFrom(matrix);
			if(this._useBlitMatrix) {
				this._helperMatrix.concat(this._blitMatrix);
				this.buffer.draw(pixels,this._helperMatrix,null,null,null,smoothing || this.antialiasing);
			} else {
				this._helperMatrix.translate(-this.viewOffsetX,-this.viewOffsetY);
				this.buffer.draw(pixels,this._helperMatrix,null,blend,null,smoothing || this.antialiasing);
			}
		} else {
			var isColored = transform != null && flixel_util_FlxColorTransformUtil.hasRGBMultipliers(transform);
			var hasColorOffsets = transform != null && flixel_util_FlxColorTransformUtil.hasRGBAOffsets(transform);
			var drawItem = this.startQuadBatch(frame.parent,isColored,hasColorOffsets,blend,smoothing,shader);
			drawItem.addQuad(frame,matrix,transform);
		}
	}
	,copyPixels: function(frame,pixels,sourceRect,destPoint,transform,blend,smoothing,shader) {
		if(smoothing == null) {
			smoothing = false;
		}
		if(flixel_FlxG.renderBlit) {
			if(pixels != null) {
				if(this._useBlitMatrix) {
					this._helperMatrix.identity();
					this._helperMatrix.translate(destPoint.x,destPoint.y);
					this._helperMatrix.concat(this._blitMatrix);
					this.buffer.draw(pixels,this._helperMatrix,null,null,null,smoothing || this.antialiasing);
				} else {
					this._helperPoint.x = destPoint.x - (this.viewOffsetX | 0);
					this._helperPoint.y = destPoint.y - (this.viewOffsetY | 0);
					this.buffer.copyPixels(pixels,sourceRect,this._helperPoint,null,null,true);
				}
			} else if(frame != null) {
				frame.paint(this.buffer,destPoint,true);
			}
		} else {
			this._helperMatrix.identity();
			this._helperMatrix.translate(destPoint.x + frame.offset.x,destPoint.y + frame.offset.y);
			var isColored = transform != null && flixel_util_FlxColorTransformUtil.hasRGBMultipliers(transform);
			var hasColorOffsets = transform != null && flixel_util_FlxColorTransformUtil.hasRGBAOffsets(transform);
			var drawItem = this.startQuadBatch(frame.parent,isColored,hasColorOffsets,blend,smoothing,shader);
			drawItem.addQuad(frame,this._helperMatrix,transform);
		}
	}
	,drawTriangles: function(graphic,vertices,indices,uvtData,colors,position,blend,repeat,smoothing) {
		if(smoothing == null) {
			smoothing = false;
		}
		if(repeat == null) {
			repeat = false;
		}
		if(flixel_FlxG.renderBlit) {
			if(position == null) {
				position = flixel_FlxCamera.renderPoint.set();
			}
			var _this = this._bounds;
			var X = 0;
			var Y = 0;
			var Width = this.width;
			var Height = this.height;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			_this.x = X;
			_this.y = Y;
			_this.width = Width;
			_this.height = Height;
			var verticesLength = vertices.get_length();
			var currentVertexPosition = 0;
			var tempX;
			var tempY;
			var i = 0;
			var _this = flixel_FlxCamera.renderRect;
			_this.x = 0;
			_this.y = 0;
			_this.width = 0;
			_this.height = 0;
			var bounds = _this;
			flixel_FlxCamera.drawVertices.splice(0,flixel_FlxCamera.drawVertices.get_length());
			while(i < verticesLength) {
				tempX = position.x + vertices.get(i);
				tempY = position.y + vertices.get(i + 1);
				flixel_FlxCamera.drawVertices.set(currentVertexPosition++,tempX);
				flixel_FlxCamera.drawVertices.set(currentVertexPosition++,tempY);
				if(i == 0) {
					var X = tempX;
					var Y = tempY;
					var Width = 0;
					var Height = 0;
					if(Height == null) {
						Height = 0;
					}
					if(Width == null) {
						Width = 0;
					}
					if(Y == null) {
						Y = 0;
					}
					if(X == null) {
						X = 0;
					}
					bounds.x = X;
					bounds.y = Y;
					bounds.width = Width;
					bounds.height = Height;
				} else {
					if(tempX < bounds.x) {
						bounds.width += bounds.x - tempX;
						bounds.x = tempX;
					}
					if(tempY < bounds.y) {
						bounds.height += bounds.y - tempY;
						bounds.y = tempY;
					}
					if(tempX > bounds.x + bounds.width) {
						bounds.width = tempX - bounds.x;
					}
					if(tempY > bounds.y + bounds.height) {
						bounds.height = tempY - bounds.y;
					}
				}
				i += 2;
			}
			if(position._weak) {
				position.put();
			}
			var _this = this._bounds;
			var result = bounds.x + bounds.width > _this.x && bounds.x < _this.x + _this.width && bounds.y + bounds.height > _this.y && bounds.y < _this.y + _this.height;
			if(bounds._weak) {
				if(!bounds._inPool) {
					bounds._inPool = true;
					bounds._weak = false;
					flixel_math_FlxRect._pool.putUnsafe(bounds);
				}
			}
			if(!result) {
				flixel_FlxCamera.drawVertices.splice(flixel_FlxCamera.drawVertices.get_length() - verticesLength,verticesLength);
			} else {
				flixel_FlxCamera.trianglesSprite.get_graphics().clear();
				flixel_FlxCamera.trianglesSprite.get_graphics().beginBitmapFill(graphic.bitmap,null,repeat,smoothing);
				flixel_FlxCamera.trianglesSprite.get_graphics().drawTriangles(flixel_FlxCamera.drawVertices,indices,uvtData);
				flixel_FlxCamera.trianglesSprite.get_graphics().endFill();
				if(this._useBlitMatrix) {
					this._helperMatrix.copyFrom(this._blitMatrix);
				} else {
					this._helperMatrix.identity();
					this._helperMatrix.translate(-this.viewOffsetX,-this.viewOffsetY);
				}
				this.buffer.draw(flixel_FlxCamera.trianglesSprite,this._helperMatrix);
			}
			if(!bounds._inPool) {
				bounds._inPool = true;
				bounds._weak = false;
				flixel_math_FlxRect._pool.putUnsafe(bounds);
			}
		} else {
			var _this = this._bounds;
			var X = 0;
			var Y = 0;
			var Width = this.width;
			var Height = this.height;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			_this.x = X;
			_this.y = Y;
			_this.width = Width;
			_this.height = Height;
			var isColored = colors != null && colors.get_length() != 0;
			var drawItem = this.startTrianglesBatch(graphic,smoothing,isColored,blend);
			drawItem.addTriangles(vertices,indices,uvtData,colors,position,this._bounds);
		}
	}
	,transformRect: function(rect) {
		if(flixel_FlxG.renderBlit) {
			rect.x += -this.viewOffsetX;
			rect.y += -this.viewOffsetY;
			if(this._useBlitMatrix) {
				rect.x *= this.zoom;
				rect.y *= this.zoom;
				rect.width *= this.zoom;
				rect.height *= this.zoom;
			}
		}
		return rect;
	}
	,transformPoint: function(point) {
		if(flixel_FlxG.renderBlit) {
			var X = this.viewOffsetX;
			var Y = this.viewOffsetY;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var _g = point;
			_g.set_x(_g.x - X);
			var _g = point;
			_g.set_y(_g.y - Y);
			if(this._useBlitMatrix) {
				point.scale(this.zoom);
			}
		}
		return point;
	}
	,transformVector: function(vector) {
		if(flixel_FlxG.renderBlit && this._useBlitMatrix) {
			vector.scale(this.zoom);
		}
		return vector;
	}
	,transformObject: function(object) {
		var _g = object;
		_g.set_scaleX(_g.get_scaleX() * this.totalScaleX);
		var _g = object;
		_g.set_scaleY(_g.get_scaleY() * this.totalScaleY);
		var _g = object;
		_g.set_x(_g.get_x() - this.scroll.x * this.totalScaleX);
		var _g = object;
		_g.set_y(_g.get_y() - this.scroll.y * this.totalScaleY);
		var _g = object;
		_g.set_x(_g.get_x() - 0.5 * this.width * (this.scaleX - this.initialZoom) * flixel_FlxG.scaleMode.scale.x);
		var _g = object;
		_g.set_y(_g.get_y() - 0.5 * this.height * (this.scaleY - this.initialZoom) * flixel_FlxG.scaleMode.scale.y);
		return object;
	}
	,destroy: function() {
		flixel_util_FlxDestroyUtil.removeChild(this.flashSprite,this._scrollRect);
		if(flixel_FlxG.renderBlit) {
			flixel_util_FlxDestroyUtil.removeChild(this._scrollRect,this._flashBitmap);
			this.screen = flixel_util_FlxDestroyUtil.destroy(this.screen);
			this.buffer = null;
			this._flashBitmap = null;
			this._fill = flixel_util_FlxDestroyUtil.dispose(this._fill);
		} else {
			flixel_util_FlxDestroyUtil.removeChild(this._scrollRect,this.canvas);
			if(this.canvas != null) {
				var _g = 0;
				var _g1 = this.canvas.get_numChildren();
				while(_g < _g1) {
					var i = _g++;
					this.canvas.removeChildAt(0);
				}
				this.canvas = null;
			}
			if(this._headOfDrawStack != null) {
				this.clearDrawStack();
			}
			this._blitMatrix = null;
			this._helperMatrix = null;
			this._helperPoint = null;
		}
		this._bounds = null;
		this.scroll = flixel_util_FlxDestroyUtil.put(this.scroll);
		this.targetOffset = flixel_util_FlxDestroyUtil.put(this.targetOffset);
		this.deadzone = flixel_util_FlxDestroyUtil.put(this.deadzone);
		this.target = null;
		this.flashSprite = null;
		this._scrollRect = null;
		this._flashRect = null;
		this._flashPoint = null;
		this._fxFlashComplete = null;
		this._fxFadeComplete = null;
		this._fxShakeComplete = null;
		flixel_FlxBasic.prototype.destroy.call(this);
	}
	,update: function(elapsed) {
		if(this.target != null) {
			this.updateFollow();
		}
		this.updateScroll();
		this.updateFlash(elapsed);
		this.updateFade(elapsed);
		this.flashSprite.set_filters(this.filtersEnabled ? this._filters : null);
		this.updateFlashSpritePosition();
		this.updateShake(elapsed);
	}
	,updateScroll: function() {
		var zoom = this.zoom / flixel_FlxG.initialZoom;
		var minX = this.minScrollX == null ? null : this.minScrollX - (zoom - 1) * this.width / (2 * zoom);
		var maxX = this.maxScrollX == null ? null : this.maxScrollX + (zoom - 1) * this.width / (2 * zoom);
		var minY = this.minScrollY == null ? null : this.minScrollY - (zoom - 1) * this.height / (2 * zoom);
		var maxY = this.maxScrollY == null ? null : this.maxScrollY + (zoom - 1) * this.height / (2 * zoom);
		var Value = this.scroll.x;
		var Max = maxX != null ? maxX - this.width : null;
		var lowerBound = minX != null && Value < minX ? minX : Value;
		this.scroll.set_x(Max != null && lowerBound > Max ? Max : lowerBound);
		var Value = this.scroll.y;
		var Max = maxY != null ? maxY - this.height : null;
		var lowerBound = minY != null && Value < minY ? minY : Value;
		this.scroll.set_y(Max != null && lowerBound > Max ? Max : lowerBound);
	}
	,updateFollow: function() {
		if(this.deadzone == null) {
			this.target.getMidpoint(this._point);
			this._point.addPoint(this.targetOffset);
			var point = this._point;
			this.scroll.set(point.x - this.width * 0.5,point.y - this.height * 0.5);
			if(point._weak) {
				point.put();
			}
		} else {
			var edge;
			var targetX = this.target.x + this.targetOffset.x;
			var targetY = this.target.y + this.targetOffset.y;
			if(this.style == flixel_FlxCameraFollowStyle.SCREEN_BY_SCREEN) {
				if(targetX >= this.scroll.x + this.width) {
					var _g = this._scrollTarget;
					_g.set_x(_g.x + this.width);
				} else if(targetX < this.scroll.x) {
					var _g = this._scrollTarget;
					_g.set_x(_g.x - this.width);
				}
				if(targetY >= this.scroll.y + this.height) {
					var _g = this._scrollTarget;
					_g.set_y(_g.y + this.height);
				} else if(targetY < this.scroll.y) {
					var _g = this._scrollTarget;
					_g.set_y(_g.y - this.height);
				}
			} else {
				edge = targetX - this.deadzone.x;
				if(this._scrollTarget.x > edge) {
					this._scrollTarget.set_x(edge);
				}
				edge = targetX + this.target.get_width() - this.deadzone.x - this.deadzone.width;
				if(this._scrollTarget.x < edge) {
					this._scrollTarget.set_x(edge);
				}
				edge = targetY - this.deadzone.y;
				if(this._scrollTarget.y > edge) {
					this._scrollTarget.set_y(edge);
				}
				edge = targetY + this.target.get_height() - this.deadzone.y - this.deadzone.height;
				if(this._scrollTarget.y < edge) {
					this._scrollTarget.set_y(edge);
				}
			}
			if(((this.target) instanceof flixel_FlxSprite)) {
				if(this._lastTargetPosition == null) {
					var X = this.target.x;
					var Y = this.target.y;
					if(Y == null) {
						Y = 0;
					}
					if(X == null) {
						X = 0;
					}
					var point = flixel_math_FlxPoint._pool.get().set(X,Y);
					point._inPool = false;
					this._lastTargetPosition = point;
				}
				var _g = this._scrollTarget;
				_g.set_x(_g.x + (this.target.x - this._lastTargetPosition.x) * this.followLead.x);
				var _g = this._scrollTarget;
				_g.set_y(_g.y + (this.target.y - this._lastTargetPosition.y) * this.followLead.y);
				this._lastTargetPosition.set_x(this.target.x);
				this._lastTargetPosition.set_y(this.target.y);
			}
			if(this.followLerp >= 60 / flixel_FlxG.updateFramerate) {
				var _this = this.scroll;
				var point = this._scrollTarget;
				_this.set_x(point.x);
				_this.set_y(point.y);
				if(point._weak) {
					point.put();
				}
			} else {
				var _g = this.scroll;
				_g.set_x(_g.x + (this._scrollTarget.x - this.scroll.x) * this.followLerp * flixel_FlxG.updateFramerate / 60);
				var _g = this.scroll;
				_g.set_y(_g.y + (this._scrollTarget.y - this.scroll.y) * this.followLerp * flixel_FlxG.updateFramerate / 60);
			}
		}
	}
	,updateFlash: function(elapsed) {
		if(this._fxFlashAlpha > 0.0) {
			this._fxFlashAlpha -= elapsed / this._fxFlashDuration;
			if(this._fxFlashAlpha <= 0 && this._fxFlashComplete != null) {
				this._fxFlashComplete();
			}
		}
	}
	,updateFade: function(elapsed) {
		if(this._fxFadeCompleted) {
			return;
		}
		if(this._fxFadeIn) {
			this._fxFadeAlpha -= elapsed / this._fxFadeDuration;
			if(this._fxFadeAlpha <= 0.0) {
				this._fxFadeAlpha = 0.0;
				this.completeFade();
			}
		} else {
			this._fxFadeAlpha += elapsed / this._fxFadeDuration;
			if(this._fxFadeAlpha >= 1.0) {
				this._fxFadeAlpha = 1.0;
				this.completeFade();
			}
		}
	}
	,completeFade: function() {
		this._fxFadeCompleted = true;
		if(this._fxFadeComplete != null) {
			this._fxFadeComplete();
		}
	}
	,updateShake: function(elapsed) {
		if(this._fxShakeDuration > 0) {
			this._fxShakeDuration -= elapsed;
			if(this._fxShakeDuration <= 0) {
				if(this._fxShakeComplete != null) {
					this._fxShakeComplete();
				}
			} else {
				if(this._fxShakeAxes != flixel_util_FlxAxes.Y) {
					var _g = this.flashSprite;
					_g.set_x(_g.get_x() + flixel_FlxG.random.float(-this._fxShakeIntensity * this.width,this._fxShakeIntensity * this.width) * this.zoom * flixel_FlxG.scaleMode.scale.x);
				}
				if(this._fxShakeAxes != flixel_util_FlxAxes.X) {
					var _g = this.flashSprite;
					_g.set_y(_g.get_y() + flixel_FlxG.random.float(-this._fxShakeIntensity * this.height,this._fxShakeIntensity * this.height) * this.zoom * flixel_FlxG.scaleMode.scale.y);
				}
			}
		}
	}
	,updateFlashSpritePosition: function() {
		if(this.flashSprite != null) {
			this.flashSprite.set_x(this.x * flixel_FlxG.scaleMode.scale.x + this._flashOffset.x);
			this.flashSprite.set_y(this.y * flixel_FlxG.scaleMode.scale.y + this._flashOffset.y);
		}
	}
	,updateFlashOffset: function() {
		this._flashOffset.set_x(this.width * 0.5 * flixel_FlxG.scaleMode.scale.x * this.initialZoom);
		this._flashOffset.set_y(this.height * 0.5 * flixel_FlxG.scaleMode.scale.y * this.initialZoom);
	}
	,updateScrollRect: function() {
		var rect = this._scrollRect != null ? this._scrollRect.get_scrollRect() : null;
		if(rect != null) {
			rect.x = rect.y = 0;
			rect.width = this.width * this.initialZoom * flixel_FlxG.scaleMode.scale.x;
			rect.height = this.height * this.initialZoom * flixel_FlxG.scaleMode.scale.y;
			this._scrollRect.set_scrollRect(rect);
			this._scrollRect.set_x(-0.5 * rect.width);
			this._scrollRect.set_y(-0.5 * rect.height);
		}
	}
	,updateInternalSpritePositions: function() {
		if(flixel_FlxG.renderBlit) {
			if(this._flashBitmap != null) {
				this._flashBitmap.set_x(0);
				this._flashBitmap.set_y(0);
			}
		} else if(this.canvas != null) {
			this.canvas.set_x(-0.5 * this.width * (this.scaleX - this.initialZoom) * flixel_FlxG.scaleMode.scale.x);
			this.canvas.set_y(-0.5 * this.height * (this.scaleY - this.initialZoom) * flixel_FlxG.scaleMode.scale.y);
			this.canvas.set_scaleX(this.totalScaleX);
			this.canvas.set_scaleY(this.totalScaleY);
		}
	}
	,follow: function(Target,Style,Lerp) {
		if(Style == null) {
			Style = flixel_FlxCameraFollowStyle.LOCKON;
		}
		if(Lerp == null) {
			Lerp = 60 / flixel_FlxG.updateFramerate;
		}
		this.style = Style;
		this.target = Target;
		this.set_followLerp(Lerp);
		var helper;
		var w = 0;
		var h = 0;
		this._lastTargetPosition = null;
		switch(Style._hx_index) {
		case 0:
			if(this.target != null) {
				w = this.target.get_width();
				h = this.target.get_height();
			}
			var X = (this.width - w) / 2;
			var Y = (this.height - h) / 2 - h * 0.25;
			var Width = w;
			var Height = h;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var _this = flixel_math_FlxRect._pool.get();
			var X1 = X;
			var Y1 = Y;
			var Width1 = Width;
			var Height1 = Height;
			if(Height1 == null) {
				Height1 = 0;
			}
			if(Width1 == null) {
				Width1 = 0;
			}
			if(Y1 == null) {
				Y1 = 0;
			}
			if(X1 == null) {
				X1 = 0;
			}
			_this.x = X1;
			_this.y = Y1;
			_this.width = Width1;
			_this.height = Height1;
			var rect = _this;
			rect._inPool = false;
			this.deadzone = rect;
			break;
		case 1:
			var w = this.width / 8;
			var h = this.height / 3;
			var X = (this.width - w) / 2;
			var Y = (this.height - h) / 2 - h * 0.25;
			var Width = w;
			var Height = h;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var _this = flixel_math_FlxRect._pool.get();
			var X1 = X;
			var Y1 = Y;
			var Width1 = Width;
			var Height1 = Height;
			if(Height1 == null) {
				Height1 = 0;
			}
			if(Width1 == null) {
				Width1 = 0;
			}
			if(Y1 == null) {
				Y1 = 0;
			}
			if(X1 == null) {
				X1 = 0;
			}
			_this.x = X1;
			_this.y = Y1;
			_this.width = Width1;
			_this.height = Height1;
			var rect = _this;
			rect._inPool = false;
			this.deadzone = rect;
			break;
		case 2:
			helper = Math.max(this.width,this.height) / 4;
			var X = (this.width - helper) / 2;
			var Y = (this.height - helper) / 2;
			var Width = helper;
			var Height = helper;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var _this = flixel_math_FlxRect._pool.get();
			var X1 = X;
			var Y1 = Y;
			var Width1 = Width;
			var Height1 = Height;
			if(Height1 == null) {
				Height1 = 0;
			}
			if(Width1 == null) {
				Width1 = 0;
			}
			if(Y1 == null) {
				Y1 = 0;
			}
			if(X1 == null) {
				X1 = 0;
			}
			_this.x = X1;
			_this.y = Y1;
			_this.width = Width1;
			_this.height = Height1;
			var rect = _this;
			rect._inPool = false;
			this.deadzone = rect;
			break;
		case 3:
			helper = Math.max(this.width,this.height) / 8;
			var X = (this.width - helper) / 2;
			var Y = (this.height - helper) / 2;
			var Width = helper;
			var Height = helper;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var _this = flixel_math_FlxRect._pool.get();
			var X1 = X;
			var Y1 = Y;
			var Width1 = Width;
			var Height1 = Height;
			if(Height1 == null) {
				Height1 = 0;
			}
			if(Width1 == null) {
				Width1 = 0;
			}
			if(Y1 == null) {
				Y1 = 0;
			}
			if(X1 == null) {
				X1 = 0;
			}
			_this.x = X1;
			_this.y = Y1;
			_this.width = Width1;
			_this.height = Height1;
			var rect = _this;
			rect._inPool = false;
			this.deadzone = rect;
			break;
		case 4:
			var X = 0;
			var Y = 0;
			var Width = this.width;
			var Height = this.height;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var _this = flixel_math_FlxRect._pool.get();
			var X1 = X;
			var Y1 = Y;
			var Width1 = Width;
			var Height1 = Height;
			if(Height1 == null) {
				Height1 = 0;
			}
			if(Width1 == null) {
				Width1 = 0;
			}
			if(Y1 == null) {
				Y1 = 0;
			}
			if(X1 == null) {
				X1 = 0;
			}
			_this.x = X1;
			_this.y = Y1;
			_this.width = Width1;
			_this.height = Height1;
			var rect = _this;
			rect._inPool = false;
			this.deadzone = rect;
			break;
		case 5:
			this.deadzone = null;
			break;
		}
	}
	,snapToTarget: function() {
		this.updateFollow();
		var _this = this.scroll;
		var point = this._scrollTarget;
		_this.set_x(point.x);
		_this.set_y(point.y);
		if(point._weak) {
			point.put();
		}
	}
	,focusOn: function(point) {
		this.scroll.set(point.x - this.width * 0.5,point.y - this.height * 0.5);
		if(point._weak) {
			point.put();
		}
	}
	,flash: function(Color,Duration,OnComplete,Force) {
		if(Force == null) {
			Force = false;
		}
		if(Duration == null) {
			Duration = 1;
		}
		if(Color == null) {
			Color = -1;
		}
		if(!Force && this._fxFlashAlpha > 0.0) {
			return;
		}
		this._fxFlashColor = Color;
		if(Duration <= 0) {
			Duration = 0.000001;
		}
		this._fxFlashDuration = Duration;
		this._fxFlashComplete = OnComplete;
		this._fxFlashAlpha = 1.0;
	}
	,fade: function(Color,Duration,FadeIn,OnComplete,Force) {
		if(Force == null) {
			Force = false;
		}
		if(FadeIn == null) {
			FadeIn = false;
		}
		if(Duration == null) {
			Duration = 1;
		}
		if(Color == null) {
			Color = -16777216;
		}
		if(!this._fxFadeCompleted && !Force) {
			return;
		}
		this._fxFadeColor = Color;
		if(Duration <= 0) {
			Duration = 0.000001;
		}
		this._fxFadeIn = FadeIn;
		this._fxFadeDuration = Duration;
		this._fxFadeComplete = OnComplete;
		this._fxFadeAlpha = this._fxFadeIn ? 0.999999 : 0.000001;
		this._fxFadeCompleted = false;
	}
	,shake: function(Intensity,Duration,OnComplete,Force,Axes) {
		if(Force == null) {
			Force = true;
		}
		if(Duration == null) {
			Duration = 0.5;
		}
		if(Intensity == null) {
			Intensity = 0.05;
		}
		if(Axes == null) {
			Axes = flixel_util_FlxAxes.XY;
		}
		if(!Force && this._fxShakeDuration > 0) {
			return;
		}
		this._fxShakeIntensity = Intensity;
		this._fxShakeDuration = Duration;
		this._fxShakeComplete = OnComplete;
		this._fxShakeAxes = Axes;
	}
	,stopFX: function() {
		this._fxFlashAlpha = 0.0;
		this._fxFadeAlpha = 0.0;
		this._fxShakeDuration = 0;
		this.updateFlashSpritePosition();
	}
	,setFilters: function(filters) {
		this._filters = filters;
	}
	,copyFrom: function(Camera) {
		this.setScrollBounds(Camera.minScrollX,Camera.maxScrollX,Camera.minScrollY,Camera.maxScrollY);
		this.target = Camera.target;
		if(this.target != null) {
			if(Camera.deadzone == null) {
				this.deadzone = null;
			} else {
				if(this.deadzone == null) {
					var _this = flixel_math_FlxRect._pool.get();
					var X = 0;
					var Y = 0;
					var Width = 0;
					var Height = 0;
					if(Height == null) {
						Height = 0;
					}
					if(Width == null) {
						Width = 0;
					}
					if(Y == null) {
						Y = 0;
					}
					if(X == null) {
						X = 0;
					}
					_this.x = X;
					_this.y = Y;
					_this.width = Width;
					_this.height = Height;
					var rect = _this;
					rect._inPool = false;
					this.deadzone = rect;
				}
				var _this = this.deadzone;
				var Rect = Camera.deadzone;
				_this.x = Rect.x;
				_this.y = Rect.y;
				_this.width = Rect.width;
				_this.height = Rect.height;
				if(Rect._weak) {
					if(!Rect._inPool) {
						Rect._inPool = true;
						Rect._weak = false;
						flixel_math_FlxRect._pool.putUnsafe(Rect);
					}
				}
			}
		}
		return this;
	}
	,fill: function(Color,BlendAlpha,FxAlpha,graphics) {
		if(FxAlpha == null) {
			FxAlpha = 1.0;
		}
		if(BlendAlpha == null) {
			BlendAlpha = true;
		}
		if(flixel_FlxG.renderBlit) {
			if(BlendAlpha) {
				this._fill.fillRect(this._flashRect,Color);
				this.buffer.copyPixels(this._fill,this._flashRect,this._flashPoint,null,null,BlendAlpha);
			} else {
				this.buffer.fillRect(this._flashRect,Color);
			}
		} else {
			if(FxAlpha == 0) {
				return;
			}
			var targetGraphics = graphics == null ? this.canvas.get_graphics() : graphics;
			targetGraphics.beginFill(Color,FxAlpha);
			targetGraphics.drawRect(this.viewOffsetX - 1,this.viewOffsetY - 1,this.viewWidth + 2,this.viewHeight + 2);
			targetGraphics.endFill();
		}
	}
	,drawFX: function() {
		var alphaComponent;
		if(this._fxFlashAlpha > 0.0) {
			alphaComponent = this._fxFlashColor >> 24 & 255;
			if(flixel_FlxG.renderBlit) {
				this.fill((((alphaComponent <= 0 ? 255 : alphaComponent) * this._fxFlashAlpha | 0) << 24) + (this._fxFlashColor & 16777215));
			} else {
				this.fill(this._fxFlashColor & 16777215,true,(alphaComponent <= 0 ? 255 : alphaComponent) * this._fxFlashAlpha / 255,this.canvas.get_graphics());
			}
		}
		if(this._fxFadeAlpha > 0.0) {
			alphaComponent = this._fxFadeColor >> 24 & 255;
			if(flixel_FlxG.renderBlit) {
				this.fill((((alphaComponent <= 0 ? 255 : alphaComponent) * this._fxFadeAlpha | 0) << 24) + (this._fxFadeColor & 16777215));
			} else {
				this.fill(this._fxFadeColor & 16777215,true,(alphaComponent <= 0 ? 255 : alphaComponent) * this._fxFadeAlpha / 255,this.canvas.get_graphics());
			}
		}
	}
	,checkResize: function() {
		if(flixel_FlxG.renderBlit) {
			if(this.width != this.buffer.width || this.height != this.buffer.height) {
				var oldBuffer = this.screen.graphic;
				this.buffer = new openfl_display_BitmapData(this.width,this.height,true,0);
				this.screen.set_pixels(this.buffer);
				this.screen.origin.set();
				this._flashBitmap.set_bitmapData(this.buffer);
				this._flashRect.width = this.width;
				this._flashRect.height = this.height;
				this._fill = flixel_util_FlxDestroyUtil.dispose(this._fill);
				this._fill = new openfl_display_BitmapData(this.width,this.height,true,0);
				flixel_FlxG.bitmap.removeIfNoUse(oldBuffer);
			}
			this._blitMatrix.identity();
			this._blitMatrix.translate(-this.viewOffsetX,-this.viewOffsetY);
			this._blitMatrix.scale(this.scaleX,this.scaleY);
			this._useBlitMatrix = this.scaleX < this.initialZoom || this.scaleY < this.initialZoom;
		}
	}
	,updateBlitMatrix: function() {
		this._blitMatrix.identity();
		this._blitMatrix.translate(-this.viewOffsetX,-this.viewOffsetY);
		this._blitMatrix.scale(this.scaleX,this.scaleY);
		this._useBlitMatrix = this.scaleX < this.initialZoom || this.scaleY < this.initialZoom;
	}
	,setSize: function(Width,Height) {
		this.set_width(Width);
		this.set_height(Height);
	}
	,setPosition: function(X,Y) {
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		this.set_x(X);
		this.set_y(Y);
	}
	,setScrollBoundsRect: function(X,Y,Width,Height,UpdateWorld) {
		if(UpdateWorld == null) {
			UpdateWorld = false;
		}
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		if(UpdateWorld) {
			var _this = flixel_FlxG.worldBounds;
			var X1 = X;
			var Y1 = Y;
			var Width1 = Width;
			var Height1 = Height;
			if(Height1 == null) {
				Height1 = 0;
			}
			if(Width1 == null) {
				Width1 = 0;
			}
			if(Y1 == null) {
				Y1 = 0;
			}
			if(X1 == null) {
				X1 = 0;
			}
			_this.x = X1;
			_this.y = Y1;
			_this.width = Width1;
			_this.height = Height1;
		}
		this.setScrollBounds(X,X + Width,Y,Y + Height);
	}
	,setScrollBounds: function(MinX,MaxX,MinY,MaxY) {
		this.minScrollX = MinX;
		this.maxScrollX = MaxX;
		this.minScrollY = MinY;
		this.maxScrollY = MaxY;
		this.updateScroll();
	}
	,setScale: function(X,Y) {
		this.scaleX = X;
		this.scaleY = Y;
		this.totalScaleX = this.scaleX * flixel_FlxG.scaleMode.scale.x;
		this.totalScaleY = this.scaleY * flixel_FlxG.scaleMode.scale.y;
		if(flixel_FlxG.renderBlit) {
			this._blitMatrix.identity();
			this._blitMatrix.translate(-this.viewOffsetX,-this.viewOffsetY);
			this._blitMatrix.scale(this.scaleX,this.scaleY);
			this._useBlitMatrix = this.scaleX < this.initialZoom || this.scaleY < this.initialZoom;
			if(this._useBlitMatrix) {
				this._flashBitmap.set_scaleX(this.initialZoom * flixel_FlxG.scaleMode.scale.x);
				this._flashBitmap.set_scaleY(this.initialZoom * flixel_FlxG.scaleMode.scale.y);
			} else {
				this._flashBitmap.set_scaleX(this.totalScaleX);
				this._flashBitmap.set_scaleY(this.totalScaleY);
			}
		}
		this.viewOffsetX = 0.5 * this.width * (this.scaleX - this.initialZoom) / this.scaleX;
		this.viewOffsetWidth = this.width - this.viewOffsetX;
		this.viewWidth = this.width - 2 * this.viewOffsetX;
		this.viewOffsetY = 0.5 * this.height * (this.scaleY - this.initialZoom) / this.scaleY;
		this.viewOffsetHeight = this.height - this.viewOffsetY;
		this.viewHeight = this.height - 2 * this.viewOffsetY;
		this.updateScrollRect();
		this.updateInternalSpritePositions();
		flixel_FlxG.cameras.cameraResized.dispatch(this);
	}
	,onResize: function() {
		this.updateFlashOffset();
		this.setScale(this.scaleX,this.scaleY);
	}
	,containsPoint: function(point,width,height) {
		if(height == null) {
			height = 0;
		}
		if(width == null) {
			width = 0;
		}
		if(point.x + width > this.viewOffsetX && point.x < this.viewOffsetWidth && point.y + height > this.viewOffsetY) {
			return point.y < this.viewOffsetHeight;
		} else {
			return false;
		}
	}
	,set_followLerp: function(Value) {
		var Max = 60 / flixel_FlxG.updateFramerate;
		var lowerBound = Value < 0 ? 0 : Value;
		return this.followLerp = Max != null && lowerBound > Max ? Max : lowerBound;
	}
	,set_width: function(Value) {
		if(this.width != Value && Value > 0) {
			this.width = Value;
			this.viewOffsetX = 0.5 * this.width * (this.scaleX - this.initialZoom) / this.scaleX;
			this.viewOffsetWidth = this.width - this.viewOffsetX;
			this.viewWidth = this.width - 2 * this.viewOffsetX;
			this.updateFlashOffset();
			this.updateScrollRect();
			this.updateInternalSpritePositions();
			flixel_FlxG.cameras.cameraResized.dispatch(this);
		}
		return Value;
	}
	,set_height: function(Value) {
		if(this.height != Value && Value > 0) {
			this.height = Value;
			this.viewOffsetY = 0.5 * this.height * (this.scaleY - this.initialZoom) / this.scaleY;
			this.viewOffsetHeight = this.height - this.viewOffsetY;
			this.viewHeight = this.height - 2 * this.viewOffsetY;
			this.updateFlashOffset();
			this.updateScrollRect();
			this.updateInternalSpritePositions();
			flixel_FlxG.cameras.cameraResized.dispatch(this);
		}
		return Value;
	}
	,set_zoom: function(Zoom) {
		this.zoom = Zoom == 0 ? flixel_FlxCamera.defaultZoom : Zoom;
		this.setScale(this.zoom,this.zoom);
		return this.zoom;
	}
	,set_alpha: function(Alpha) {
		var lowerBound = Alpha < 0 ? 0 : Alpha;
		this.alpha = lowerBound > 1 ? 1 : lowerBound;
		if(flixel_FlxG.renderBlit) {
			this._flashBitmap.set_alpha(Alpha);
		} else {
			this.canvas.set_alpha(Alpha);
		}
		return Alpha;
	}
	,set_angle: function(Angle) {
		this.angle = Angle;
		this.flashSprite.set_rotation(Angle);
		return Angle;
	}
	,set_color: function(Color) {
		this.color = Color;
		var colorTransform;
		if(flixel_FlxG.renderBlit) {
			if(this._flashBitmap == null) {
				return Color;
			}
			colorTransform = this._flashBitmap.get_transform().get_colorTransform();
		} else {
			colorTransform = this.canvas.get_transform().get_colorTransform();
		}
		colorTransform.redMultiplier = (this.color >> 16 & 255) / 255;
		colorTransform.greenMultiplier = (this.color >> 8 & 255) / 255;
		colorTransform.blueMultiplier = (this.color & 255) / 255;
		if(flixel_FlxG.renderBlit) {
			this._flashBitmap.get_transform().set_colorTransform(colorTransform);
		} else {
			this.canvas.get_transform().set_colorTransform(colorTransform);
		}
		return Color;
	}
	,set_antialiasing: function(Antialiasing) {
		this.antialiasing = Antialiasing;
		if(flixel_FlxG.renderBlit) {
			this._flashBitmap.smoothing = Antialiasing;
		}
		return Antialiasing;
	}
	,set_x: function(x) {
		this.x = x;
		this.updateFlashSpritePosition();
		return x;
	}
	,set_y: function(y) {
		this.y = y;
		this.updateFlashSpritePosition();
		return y;
	}
	,set_visible: function(visible) {
		if(this.flashSprite != null) {
			this.flashSprite.set_visible(visible);
		}
		return this.visible = visible;
	}
	,calcOffsetX: function() {
		this.viewOffsetX = 0.5 * this.width * (this.scaleX - this.initialZoom) / this.scaleX;
		this.viewOffsetWidth = this.width - this.viewOffsetX;
		this.viewWidth = this.width - 2 * this.viewOffsetX;
	}
	,calcOffsetY: function() {
		this.viewOffsetY = 0.5 * this.height * (this.scaleY - this.initialZoom) / this.scaleY;
		this.viewOffsetHeight = this.height - this.viewOffsetY;
		this.viewHeight = this.height - 2 * this.viewOffsetY;
	}
	,__class__: flixel_FlxCamera
	,__properties__: $extend(flixel_FlxBasic.prototype.__properties__,{set_antialiasing:"set_antialiasing",set_color:"set_color",set_angle:"set_angle",set_alpha:"set_alpha",set_zoom:"set_zoom",set_height:"set_height",set_width:"set_width",set_followLerp:"set_followLerp",set_y:"set_y",set_x:"set_x"})
});
var flixel_FlxCameraFollowStyle = $hxEnums["flixel.FlxCameraFollowStyle"] = { __ename__ : "flixel.FlxCameraFollowStyle", __constructs__ : ["LOCKON","PLATFORMER","TOPDOWN","TOPDOWN_TIGHT","SCREEN_BY_SCREEN","NO_DEAD_ZONE"]
	,LOCKON: {_hx_index:0,__enum__:"flixel.FlxCameraFollowStyle",toString:$estr}
	,PLATFORMER: {_hx_index:1,__enum__:"flixel.FlxCameraFollowStyle",toString:$estr}
	,TOPDOWN: {_hx_index:2,__enum__:"flixel.FlxCameraFollowStyle",toString:$estr}
	,TOPDOWN_TIGHT: {_hx_index:3,__enum__:"flixel.FlxCameraFollowStyle",toString:$estr}
	,SCREEN_BY_SCREEN: {_hx_index:4,__enum__:"flixel.FlxCameraFollowStyle",toString:$estr}
	,NO_DEAD_ZONE: {_hx_index:5,__enum__:"flixel.FlxCameraFollowStyle",toString:$estr}
};
var flixel_system_FlxVersion = function(Major,Minor,Patch) {
	this.major = Major;
	this.minor = Minor;
	this.patch = Patch;
};
$hxClasses["flixel.system.FlxVersion"] = flixel_system_FlxVersion;
flixel_system_FlxVersion.__name__ = "flixel.system.FlxVersion";
flixel_system_FlxVersion.prototype = {
	major: null
	,minor: null
	,patch: null
	,toString: function() {
		var sha = flixel_system_FlxVersion.sha;
		if(sha != "") {
			sha = "@" + sha.substring(0,7);
		}
		return "HaxeFlixel " + this.major + "." + this.minor + "." + this.patch + sha;
	}
	,__class__: flixel_system_FlxVersion
};
var flixel_system_frontEnds_BitmapFrontEnd = function() {
	this._lastUniqueKeyIndex = 0;
	this.reset();
};
$hxClasses["flixel.system.frontEnds.BitmapFrontEnd"] = flixel_system_frontEnds_BitmapFrontEnd;
flixel_system_frontEnds_BitmapFrontEnd.__name__ = "flixel.system.frontEnds.BitmapFrontEnd";
flixel_system_frontEnds_BitmapFrontEnd.prototype = {
	_cache: null
	,_whitePixel: null
	,_lastUniqueKeyIndex: null
	,onAssetsReload: function(_) {
		var key = haxe_ds_StringMap.keysIterator(this._cache.h);
		while(key.hasNext()) {
			var key1 = key.next();
			var obj = this._cache.h[key1];
			if(obj != null && (obj.assetsClass != null || obj.assetsKey != null)) {
				obj.onAssetsReload();
			}
		}
	}
	,onContext: function() {
		var key = haxe_ds_StringMap.keysIterator(this._cache.h);
		while(key.hasNext()) {
			var key1 = key.next();
			var obj = this._cache.h[key1];
			if(obj != null && obj.isDumped) {
				obj.onContext();
			}
		}
	}
	,dumpCache: function() {
	}
	,undumpCache: function() {
	}
	,checkCache: function(Key) {
		return this._cache.h[Key] != null;
	}
	,create: function(Width,Height,Color,Unique,Key) {
		if(Unique == null) {
			Unique = false;
		}
		return flixel_graphics_FlxGraphic.fromRectangle(Width,Height,Color,Unique,Key);
	}
	,add: function(Graphic,Unique,Key) {
		if(Unique == null) {
			Unique = false;
		}
		if(((Graphic) instanceof flixel_graphics_FlxGraphic)) {
			return flixel_graphics_FlxGraphic.fromGraphic(Graphic,Unique,Key);
		} else if(((Graphic) instanceof openfl_display_BitmapData)) {
			return flixel_graphics_FlxGraphic.fromBitmapData(Graphic,Unique,Key);
		}
		return flixel_graphics_FlxGraphic.fromAssetKey(Std.string(Graphic),Unique,Key);
	}
	,addGraphic: function(graphic) {
		this._cache.h[graphic.key] = graphic;
		return graphic;
	}
	,get: function(key) {
		return this._cache.h[key];
	}
	,findKeyForBitmap: function(bmd) {
		var key = haxe_ds_StringMap.keysIterator(this._cache.h);
		while(key.hasNext()) {
			var key1 = key.next();
			var obj = this._cache.h[key1];
			if(obj != null && obj.bitmap == bmd) {
				return key1;
			}
		}
		return null;
	}
	,getKeyForClass: function(source) {
		return source.__name__;
	}
	,generateKey: function(systemKey,userKey,unique) {
		if(unique == null) {
			unique = false;
		}
		var key = userKey;
		if(key == null) {
			key = systemKey;
		}
		if(unique || key == null) {
			key = this.getUniqueKey(key);
		}
		return key;
	}
	,getUniqueKey: function(baseKey) {
		if(baseKey == null) {
			baseKey = "pixels";
		}
		if(this._cache.h[baseKey] == null) {
			return baseKey;
		}
		var i = this._lastUniqueKeyIndex;
		var uniqueKey;
		while(true) {
			++i;
			uniqueKey = baseKey + i;
			if(!(this._cache.h[uniqueKey] != null)) {
				break;
			}
		}
		this._lastUniqueKeyIndex = i;
		return uniqueKey;
	}
	,getKeyWithSpacesAndBorders: function(baseKey,frameSize,frameSpacing,frameBorder,region) {
		var result = baseKey;
		if(region != null) {
			result += "_Region:" + region.x + "_" + region.y + "_" + region.width + "_" + region.height;
		}
		if(frameSize != null) {
			result += "_FrameSize:" + frameSize.x + "_" + frameSize.y;
		}
		if(frameSpacing != null) {
			result += "_Spaces:" + frameSpacing.x + "_" + frameSpacing.y;
		}
		if(frameBorder != null) {
			result += "_Border:" + frameBorder.x + "_" + frameBorder.y;
		}
		return result;
	}
	,remove: function(graphic) {
		if(graphic != null) {
			var key = graphic.key;
			if(key != null) {
				openfl_utils_Assets.cache.removeBitmapData(key);
				var _this = this._cache;
				if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
					delete(_this.h[key]);
				}
			}
			graphic.destroy();
		}
	}
	,removeByKey: function(key) {
		if(key != null) {
			var obj = this._cache.h[key];
			if(key != null) {
				openfl_utils_Assets.cache.removeBitmapData(key);
				var _this = this._cache;
				if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
					delete(_this.h[key]);
				}
			}
			if(obj != null) {
				obj.destroy();
			}
		}
	}
	,removeIfNoUse: function(graphic) {
		if(graphic != null && graphic.get_useCount() == 0 && !graphic.persist) {
			this.remove(graphic);
		}
	}
	,clearCache: function() {
		if(this._cache == null) {
			this._cache = new haxe_ds_StringMap();
			return;
		}
		var key = haxe_ds_StringMap.keysIterator(this._cache.h);
		while(key.hasNext()) {
			var key1 = key.next();
			var obj = this._cache.h[key1];
			if(obj != null && !obj.persist && obj.get_useCount() <= 0) {
				if(key1 != null) {
					openfl_utils_Assets.cache.removeBitmapData(key1);
					var _this = this._cache;
					if(Object.prototype.hasOwnProperty.call(_this.h,key1)) {
						delete(_this.h[key1]);
					}
				}
				obj.destroy();
			}
		}
	}
	,removeKey: function(key) {
		if(key != null) {
			openfl_utils_Assets.cache.removeBitmapData(key);
			var _this = this._cache;
			if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
				delete(_this.h[key]);
			}
		}
	}
	,reset: function() {
		if(this._cache == null) {
			this._cache = new haxe_ds_StringMap();
			return;
		}
		var key = haxe_ds_StringMap.keysIterator(this._cache.h);
		while(key.hasNext()) {
			var key1 = key.next();
			var obj = this._cache.h[key1];
			if(key1 != null) {
				openfl_utils_Assets.cache.removeBitmapData(key1);
				var _this = this._cache;
				if(Object.prototype.hasOwnProperty.call(_this.h,key1)) {
					delete(_this.h[key1]);
				}
			}
			if(obj != null) {
				obj.destroy();
			}
		}
	}
	,clearUnused: function() {
		var key = haxe_ds_StringMap.keysIterator(this._cache.h);
		while(key.hasNext()) {
			var key1 = key.next();
			var obj = this._cache.h[key1];
			if(obj != null && obj.get_useCount() <= 0 && !obj.persist && obj.get_destroyOnNoUse()) {
				this.removeByKey(key1);
			}
		}
	}
	,get_maxTextureSize: function() {
		return lime_graphics_opengl_GL.context.getParameter(3379);
	}
	,get_whitePixel: function() {
		if(this._whitePixel == null) {
			var bd = new openfl_display_BitmapData(10,10,true,-1);
			var graphic = flixel_FlxG.bitmap.add(bd,true,"whitePixels");
			graphic.persist = true;
			this._whitePixel = graphic.get_imageFrame().get_frame();
		}
		return this._whitePixel;
	}
	,__class__: flixel_system_frontEnds_BitmapFrontEnd
	,__properties__: {get_whitePixel:"get_whitePixel",get_maxTextureSize:"get_maxTextureSize"}
};
var flixel_system_frontEnds_BitmapLogFrontEnd = function() {
};
$hxClasses["flixel.system.frontEnds.BitmapLogFrontEnd"] = flixel_system_frontEnds_BitmapLogFrontEnd;
flixel_system_frontEnds_BitmapLogFrontEnd.__name__ = "flixel.system.frontEnds.BitmapLogFrontEnd";
flixel_system_frontEnds_BitmapLogFrontEnd.prototype = {
	add: function(Data,Name) {
		if(Name == null) {
			Name = "";
		}
	}
	,clear: function() {
	}
	,clearAt: function(Index) {
		if(Index == null) {
			Index = -1;
		}
	}
	,viewCache: function() {
	}
	,__class__: flixel_system_frontEnds_BitmapLogFrontEnd
};
var flixel_system_frontEnds_CameraFrontEnd = function() {
	this._cameraRect = new openfl_geom_Rectangle();
	this.useBufferLocking = false;
	this.cameraResized = new flixel_util__$FlxSignal_FlxSignal1();
	this.cameraRemoved = new flixel_util__$FlxSignal_FlxSignal1();
	this.cameraAdded = new flixel_util__$FlxSignal_FlxSignal1();
	this.defaults = [];
	this.list = [];
	flixel_FlxCamera._defaultCameras = this.defaults;
};
$hxClasses["flixel.system.frontEnds.CameraFrontEnd"] = flixel_system_frontEnds_CameraFrontEnd;
flixel_system_frontEnds_CameraFrontEnd.__name__ = "flixel.system.frontEnds.CameraFrontEnd";
flixel_system_frontEnds_CameraFrontEnd.prototype = {
	list: null
	,defaults: null
	,cameraAdded: null
	,cameraRemoved: null
	,cameraResized: null
	,useBufferLocking: null
	,_cameraRect: null
	,add: function(NewCamera,DefaultDrawTarget) {
		if(DefaultDrawTarget == null) {
			DefaultDrawTarget = true;
		}
		flixel_FlxG.game.addChildAt(NewCamera.flashSprite,flixel_FlxG.game.getChildIndex(flixel_FlxG.game._inputContainer));
		this.list.push(NewCamera);
		if(DefaultDrawTarget) {
			this.defaults.push(NewCamera);
		}
		NewCamera.ID = this.list.length - 1;
		this.cameraAdded.dispatch(NewCamera);
		return NewCamera;
	}
	,remove: function(Camera,Destroy) {
		if(Destroy == null) {
			Destroy = true;
		}
		var index = this.list.indexOf(Camera);
		if(Camera != null && index != -1) {
			flixel_FlxG.game.removeChild(Camera.flashSprite);
			this.list.splice(index,1);
			HxOverrides.remove(this.defaults,Camera);
		} else {
			return;
		}
		if(flixel_FlxG.renderTile) {
			var _g = 0;
			var _g1 = this.list.length;
			while(_g < _g1) {
				var i = _g++;
				this.list[i].ID = i;
			}
		}
		if(Destroy) {
			Camera.destroy();
		}
		this.cameraRemoved.dispatch(Camera);
	}
	,setDefaultDrawTarget: function(camera,value) {
		if(this.list.indexOf(camera) == -1) {
			return;
		}
		var index = this.defaults.indexOf(camera);
		if(value && index == -1) {
			this.defaults.push(camera);
		} else if(!value) {
			this.defaults.splice(index,1);
		}
	}
	,reset: function(NewCamera) {
		while(this.list.length > 0) this.remove(this.list[0]);
		if(NewCamera == null) {
			NewCamera = new flixel_FlxCamera(0,0,flixel_FlxG.width,flixel_FlxG.height);
		}
		flixel_FlxG.camera = this.add(NewCamera);
		NewCamera.ID = 0;
		flixel_FlxCamera._defaultCameras = this.defaults;
	}
	,flash: function(Color,Duration,OnComplete,Force) {
		if(Force == null) {
			Force = false;
		}
		if(Duration == null) {
			Duration = 1;
		}
		if(Color == null) {
			Color = -1;
		}
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var camera = _g1[_g];
			++_g;
			camera.flash(Color,Duration,OnComplete,Force);
		}
	}
	,fade: function(Color,Duration,FadeIn,OnComplete,Force) {
		if(Force == null) {
			Force = false;
		}
		if(FadeIn == null) {
			FadeIn = false;
		}
		if(Duration == null) {
			Duration = 1;
		}
		if(Color == null) {
			Color = -16777216;
		}
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var camera = _g1[_g];
			++_g;
			camera.fade(Color,Duration,FadeIn,OnComplete,Force);
		}
	}
	,shake: function(Intensity,Duration,OnComplete,Force,Axes) {
		if(Force == null) {
			Force = true;
		}
		if(Duration == null) {
			Duration = 0.5;
		}
		if(Intensity == null) {
			Intensity = 0.05;
		}
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var camera = _g1[_g];
			++_g;
			camera.shake(Intensity,Duration,OnComplete,Force,Axes);
		}
	}
	,lock: function() {
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var camera = _g1[_g];
			++_g;
			if(camera == null || !camera.exists || !camera.visible) {
				continue;
			}
			if(flixel_FlxG.renderBlit) {
				camera.checkResize();
				if(this.useBufferLocking) {
					camera.buffer.lock();
				}
			}
			if(flixel_FlxG.renderTile) {
				camera.clearDrawStack();
				camera.canvas.get_graphics().clear();
			}
			if(flixel_FlxG.renderBlit) {
				camera.fill(camera.bgColor,camera.useBgAlphaBlending);
				camera.screen.dirty = true;
			} else {
				camera.fill(camera.bgColor & 16777215,camera.useBgAlphaBlending,(camera.bgColor >> 24 & 255) / 255);
			}
		}
	}
	,render: function() {
		if(flixel_FlxG.renderTile) {
			var _g = 0;
			var _g1 = this.list;
			while(_g < _g1.length) {
				var camera = _g1[_g];
				++_g;
				if(camera != null && camera.exists && camera.visible) {
					camera.render();
				}
			}
		}
	}
	,unlock: function() {
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var camera = _g1[_g];
			++_g;
			if(camera == null || !camera.exists || !camera.visible) {
				continue;
			}
			camera.drawFX();
			if(flixel_FlxG.renderBlit) {
				if(this.useBufferLocking) {
					camera.buffer.unlock();
				}
				camera.screen.dirty = true;
			}
		}
	}
	,update: function(elapsed) {
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var camera = _g1[_g];
			++_g;
			if(camera != null && camera.exists && camera.active) {
				camera.update(elapsed);
			}
		}
	}
	,resize: function() {
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var camera = _g1[_g];
			++_g;
			camera.onResize();
		}
	}
	,get_bgColor: function() {
		if(flixel_FlxG.camera == null) {
			return -16777216;
		} else {
			return flixel_FlxG.camera.bgColor;
		}
	}
	,set_bgColor: function(Color) {
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var camera = _g1[_g];
			++_g;
			camera.bgColor = Color;
		}
		return Color;
	}
	,__class__: flixel_system_frontEnds_CameraFrontEnd
	,__properties__: {set_bgColor:"set_bgColor",get_bgColor:"get_bgColor"}
};
var flixel_system_frontEnds_ConsoleFrontEnd = function() {
	this.stepAfterCommand = true;
	this.autoPause = true;
};
$hxClasses["flixel.system.frontEnds.ConsoleFrontEnd"] = flixel_system_frontEnds_ConsoleFrontEnd;
flixel_system_frontEnds_ConsoleFrontEnd.__name__ = "flixel.system.frontEnds.ConsoleFrontEnd";
flixel_system_frontEnds_ConsoleFrontEnd.prototype = {
	autoPause: null
	,stepAfterCommand: null
	,registerFunction: function(FunctionAlias,Function1) {
	}
	,registerObject: function(ObjectAlias,AnyObject) {
	}
	,registerClass: function(cl) {
	}
	,registerEnum: function(e) {
	}
	,__class__: flixel_system_frontEnds_ConsoleFrontEnd
};
var flixel_system_frontEnds_DebuggerFrontEnd = function() {
	this.visible = false;
	this.visibilityChanged = new flixel_util__$FlxSignal_FlxSignal0();
	this.drawDebugChanged = new flixel_util__$FlxSignal_FlxSignal0();
	this.drawDebug = false;
	this.toggleKeys = [113,192,220];
	this.precision = 3;
};
$hxClasses["flixel.system.frontEnds.DebuggerFrontEnd"] = flixel_system_frontEnds_DebuggerFrontEnd;
flixel_system_frontEnds_DebuggerFrontEnd.__name__ = "flixel.system.frontEnds.DebuggerFrontEnd";
flixel_system_frontEnds_DebuggerFrontEnd.prototype = {
	precision: null
	,toggleKeys: null
	,drawDebug: null
	,drawDebugChanged: null
	,visibilityChanged: null
	,visible: null
	,setLayout: function(Layout) {
	}
	,resetLayout: function() {
	}
	,addButton: function(Alignment,Icon,UpHandler,ToggleMode,UpdateLayout) {
		if(UpdateLayout == null) {
			UpdateLayout = true;
		}
		if(ToggleMode == null) {
			ToggleMode = false;
		}
		return null;
	}
	,track: function(ObjectOrClass,WindowTitle) {
		return null;
	}
	,addTrackerProfile: function(Profile) {
	}
	,removeButton: function(Button,UpdateLayout) {
		if(UpdateLayout == null) {
			UpdateLayout = true;
		}
	}
	,set_drawDebug: function(Value) {
		if(this.drawDebug == Value) {
			return this.drawDebug;
		}
		this.drawDebug = Value;
		return this.drawDebug;
	}
	,set_visible: function(Value) {
		if(this.visible == Value) {
			return this.visible;
		}
		this.visible = Value;
		return this.visible;
	}
	,__class__: flixel_system_frontEnds_DebuggerFrontEnd
	,__properties__: {set_visible:"set_visible",set_drawDebug:"set_drawDebug"}
};
var flixel_system_frontEnds_HTML5FrontEnd = function() {
	this.browser = this.getBrowser();
	this.platform = this.getPlatform();
	this.onMobile = this.getOnMobile();
};
$hxClasses["flixel.system.frontEnds.HTML5FrontEnd"] = flixel_system_frontEnds_HTML5FrontEnd;
flixel_system_frontEnds_HTML5FrontEnd.__name__ = "flixel.system.frontEnds.HTML5FrontEnd";
flixel_system_frontEnds_HTML5FrontEnd.prototype = {
	browser: null
	,platform: null
	,onMobile: null
	,browserPosition: null
	,getBrowser: function() {
		if(this.userAgentContains(" OPR/")) {
			return flixel_system_frontEnds_FlxBrowser.OPERA;
		} else if(this.userAgentContains("chrome",true)) {
			return flixel_system_frontEnds_FlxBrowser.CHROME;
		} else if($global.navigator.appName == "Netscape") {
			return flixel_system_frontEnds_FlxBrowser.FIREFOX;
		} else if(document.documentMode) {
			return flixel_system_frontEnds_FlxBrowser.INTERNET_EXPLORER;
		} else if(Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor") > 0) {
			return flixel_system_frontEnds_FlxBrowser.SAFARI;
		}
		return flixel_system_frontEnds_FlxBrowser.UNKNOWN;
	}
	,getPlatform: function() {
		if(this.userAgentContains("Win")) {
			return flixel_system_frontEnds_FlxPlatform.WINDOWS;
		} else if(this.userAgentContains("IEMobile")) {
			return flixel_system_frontEnds_FlxPlatform.WINDOWS_PHONE;
		} else if(this.userAgentContains("Android")) {
			return flixel_system_frontEnds_FlxPlatform.ANDROID;
		} else if(this.userAgentContains("Linux")) {
			return flixel_system_frontEnds_FlxPlatform.LINUX;
		} else if(this.userAgentContains("BlackBerry")) {
			return flixel_system_frontEnds_FlxPlatform.BLACKBERRY;
		} else if(this.userAgentContains("iPhone")) {
			return flixel_system_frontEnds_FlxPlatform.IOS(flixel_system_frontEnds_FlxIOSDevice.IPHONE);
		} else if(this.userAgentContains("iPad")) {
			return flixel_system_frontEnds_FlxPlatform.IOS(flixel_system_frontEnds_FlxIOSDevice.IPAD);
		} else if(this.userAgentContains("iPod")) {
			return flixel_system_frontEnds_FlxPlatform.IOS(flixel_system_frontEnds_FlxIOSDevice.IPOD);
		} else if(this.userAgentContains("Mac")) {
			return flixel_system_frontEnds_FlxPlatform.MAC;
		} else {
			return flixel_system_frontEnds_FlxPlatform.UNKNOWN;
		}
	}
	,getOnMobile: function() {
		var _g = this.platform;
		switch(_g._hx_index) {
		case 3:case 4:case 5:
			return true;
		case 6:
			var _g1 = _g.device;
			return true;
		default:
			return false;
		}
	}
	,userAgentContains: function(substring,toLowerCase) {
		if(toLowerCase == null) {
			toLowerCase = false;
		}
		var userAgent = $global.navigator.userAgent;
		if(toLowerCase) {
			userAgent = userAgent.toLowerCase();
		}
		return userAgent.indexOf(substring) != -1;
	}
	,get_browserPosition: function() {
		if(this.browserPosition == null) {
			var X = 0;
			var Y = 0;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			this.browserPosition = point;
		}
		this.browserPosition.set(window.screenX,window.screenY);
		return this.browserPosition;
	}
	,get_browserWidth: function() {
		return window.innerWidth;
	}
	,get_browserHeight: function() {
		return window.innerHeight;
	}
	,__class__: flixel_system_frontEnds_HTML5FrontEnd
	,__properties__: {get_browserPosition:"get_browserPosition",get_browserHeight:"get_browserHeight",get_browserWidth:"get_browserWidth"}
};
var flixel_system_frontEnds_InputFrontEnd = function() {
	this.resetOnStateSwitch = true;
	this.list = [];
};
$hxClasses["flixel.system.frontEnds.InputFrontEnd"] = flixel_system_frontEnds_InputFrontEnd;
flixel_system_frontEnds_InputFrontEnd.__name__ = "flixel.system.frontEnds.InputFrontEnd";
flixel_system_frontEnds_InputFrontEnd.prototype = {
	add_flixel_input_touch_FlxTouchManager: function(Input) {
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var input = _g1[_g];
			++_g;
			if(flixel_util_FlxStringUtil.getClassName(Input,true) == flixel_util_FlxStringUtil.getClassName(input,true)) {
				return Input;
			}
		}
		this.list.push(Input);
		return Input;
	}
	,add_flixel_input_keyboard_FlxKeyboard: function(Input) {
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var input = _g1[_g];
			++_g;
			if(flixel_util_FlxStringUtil.getClassName(Input,true) == flixel_util_FlxStringUtil.getClassName(input,true)) {
				return Input;
			}
		}
		this.list.push(Input);
		return Input;
	}
	,replace_flixel_input_mouse_FlxMouse: function(Old,New) {
		var i = 0;
		var success = false;
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var input = _g1[_g];
			++_g;
			if(input == Old) {
				this.list[i] = New;
				success = true;
				break;
			}
			++i;
		}
		if(success) {
			return New;
		}
		return null;
	}
	,add_flixel_input_mouse_FlxMouse: function(Input) {
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var input = _g1[_g];
			++_g;
			if(flixel_util_FlxStringUtil.getClassName(Input,true) == flixel_util_FlxStringUtil.getClassName(input,true)) {
				return Input;
			}
		}
		this.list.push(Input);
		return Input;
	}
	,list: null
	,resetOnStateSwitch: null
	,reset: function() {
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var input = _g1[_g];
			++_g;
			input.reset();
		}
	}
	,update: function() {
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var input = _g1[_g];
			++_g;
			input.update();
		}
	}
	,onFocus: function() {
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var input = _g1[_g];
			++_g;
			input.onFocus();
		}
	}
	,onFocusLost: function() {
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var input = _g1[_g];
			++_g;
			input.onFocusLost();
		}
	}
	,onStateSwitch: function() {
		if(this.resetOnStateSwitch) {
			this.reset();
		}
	}
	,destroy: function() {
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var input = _g1[_g];
			++_g;
			input = flixel_util_FlxDestroyUtil.destroy(input);
		}
	}
	,__class__: flixel_system_frontEnds_InputFrontEnd
};
var flixel_system_frontEnds_LogFrontEnd = function() {
	this.redirectTraces = false;
	this._standardTraceFunction = haxe_Log.trace;
};
$hxClasses["flixel.system.frontEnds.LogFrontEnd"] = flixel_system_frontEnds_LogFrontEnd;
flixel_system_frontEnds_LogFrontEnd.__name__ = "flixel.system.frontEnds.LogFrontEnd";
flixel_system_frontEnds_LogFrontEnd.prototype = {
	redirectTraces: null
	,_standardTraceFunction: null
	,add: function(Data) {
	}
	,warn: function(Data) {
	}
	,error: function(Data) {
	}
	,notice: function(Data) {
	}
	,advanced: function(Data,Style,FireOnce) {
		if(FireOnce == null) {
			FireOnce = false;
		}
	}
	,clear: function() {
	}
	,set_redirectTraces: function(Redirect) {
		haxe_Log.trace = Redirect ? $bind(this,this.processTraceData) : this._standardTraceFunction;
		return this.redirectTraces = Redirect;
	}
	,processTraceData: function(Data,Info) {
		var paramArray = [Data];
		if(Info.customParams != null) {
			var _g = 0;
			var _g1 = Info.customParams;
			while(_g < _g1.length) {
				var i = _g1[_g];
				++_g;
				paramArray.push(i);
			}
		}
		this.advanced(paramArray,flixel_system_debug_log_LogStyle.NORMAL);
	}
	,__class__: flixel_system_frontEnds_LogFrontEnd
	,__properties__: {set_redirectTraces:"set_redirectTraces"}
};
var haxe_Log = function() { };
$hxClasses["haxe.Log"] = haxe_Log;
haxe_Log.__name__ = "haxe.Log";
haxe_Log.formatOutput = function(v,infos) {
	var str = Std.string(v);
	if(infos == null) {
		return str;
	}
	var pstr = infos.fileName + ":" + infos.lineNumber;
	if(infos.customParams != null) {
		var _g = 0;
		var _g1 = infos.customParams;
		while(_g < _g1.length) {
			var v = _g1[_g];
			++_g;
			str += ", " + Std.string(v);
		}
	}
	return pstr + ": " + str;
};
haxe_Log.trace = function(v,infos) {
	var str = haxe_Log.formatOutput(v,infos);
	if(typeof(console) != "undefined" && console.log != null) {
		console.log(str);
	}
};
var js_Boot = function() { };
$hxClasses["js.Boot"] = js_Boot;
js_Boot.__name__ = "js.Boot";
js_Boot.getClass = function(o) {
	if(o == null) {
		return null;
	} else if(((o) instanceof Array)) {
		return Array;
	} else {
		var cl = o.__class__;
		if(cl != null) {
			return cl;
		}
		var name = js_Boot.__nativeClassName(o);
		if(name != null) {
			return js_Boot.__resolveNativeClass(name);
		}
		return null;
	}
};
js_Boot.__string_rec = function(o,s) {
	if(o == null) {
		return "null";
	}
	if(s.length >= 5) {
		return "<...>";
	}
	var t = typeof(o);
	if(t == "function" && (o.__name__ || o.__ename__)) {
		t = "object";
	}
	switch(t) {
	case "function":
		return "<function>";
	case "object":
		if(o.__enum__) {
			var e = $hxEnums[o.__enum__];
			var n = e.__constructs__[o._hx_index];
			var con = e[n];
			if(con.__params__) {
				s = s + "\t";
				return n + "(" + ((function($this) {
					var $r;
					var _g = [];
					{
						var _g1 = 0;
						var _g2 = con.__params__;
						while(true) {
							if(!(_g1 < _g2.length)) {
								break;
							}
							var p = _g2[_g1];
							_g1 = _g1 + 1;
							_g.push(js_Boot.__string_rec(o[p],s));
						}
					}
					$r = _g;
					return $r;
				}(this))).join(",") + ")";
			} else {
				return n;
			}
		}
		if(((o) instanceof Array)) {
			var str = "[";
			s += "\t";
			var _g = 0;
			var _g1 = o.length;
			while(_g < _g1) {
				var i = _g++;
				str += (i > 0 ? "," : "") + js_Boot.__string_rec(o[i],s);
			}
			str += "]";
			return str;
		}
		var tostr;
		try {
			tostr = o.toString;
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			return "???";
		}
		if(tostr != null && tostr != Object.toString && typeof(tostr) == "function") {
			var s2 = o.toString();
			if(s2 != "[object Object]") {
				return s2;
			}
		}
		var str = "{\n";
		s += "\t";
		var hasp = o.hasOwnProperty != null;
		var k = null;
		for( k in o ) {
		if(hasp && !o.hasOwnProperty(k)) {
			continue;
		}
		if(k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__" || k == "__properties__") {
			continue;
		}
		if(str.length != 2) {
			str += ", \n";
		}
		str += s + k + " : " + js_Boot.__string_rec(o[k],s);
		}
		s = s.substring(1);
		str += "\n" + s + "}";
		return str;
	case "string":
		return o;
	default:
		return String(o);
	}
};
js_Boot.__interfLoop = function(cc,cl) {
	if(cc == null) {
		return false;
	}
	if(cc == cl) {
		return true;
	}
	var intf = cc.__interfaces__;
	if(intf != null) {
		var _g = 0;
		var _g1 = intf.length;
		while(_g < _g1) {
			var i = _g++;
			var i1 = intf[i];
			if(i1 == cl || js_Boot.__interfLoop(i1,cl)) {
				return true;
			}
		}
	}
	return js_Boot.__interfLoop(cc.__super__,cl);
};
js_Boot.__instanceof = function(o,cl) {
	if(cl == null) {
		return false;
	}
	switch(cl) {
	case Array:
		return ((o) instanceof Array);
	case Bool:
		return typeof(o) == "boolean";
	case Dynamic:
		return o != null;
	case Float:
		return typeof(o) == "number";
	case Int:
		if(typeof(o) == "number") {
			return ((o | 0) === o);
		} else {
			return false;
		}
		break;
	case String:
		return typeof(o) == "string";
	default:
		if(o != null) {
			if(typeof(cl) == "function") {
				if(js_Boot.__downcastCheck(o,cl)) {
					return true;
				}
			} else if(typeof(cl) == "object" && js_Boot.__isNativeObj(cl)) {
				if(((o) instanceof cl)) {
					return true;
				}
			}
		} else {
			return false;
		}
		if(cl == Class ? o.__name__ != null : false) {
			return true;
		}
		if(cl == Enum ? o.__ename__ != null : false) {
			return true;
		}
		return o.__enum__ != null ? $hxEnums[o.__enum__] == cl : false;
	}
};
js_Boot.__downcastCheck = function(o,cl) {
	if(!((o) instanceof cl)) {
		if(cl.__isInterface__) {
			return js_Boot.__interfLoop(js_Boot.getClass(o),cl);
		} else {
			return false;
		}
	} else {
		return true;
	}
};
js_Boot.__implements = function(o,iface) {
	return js_Boot.__interfLoop(js_Boot.getClass(o),iface);
};
js_Boot.__cast = function(o,t) {
	if(o == null || js_Boot.__instanceof(o,t)) {
		return o;
	} else {
		throw haxe_Exception.thrown("Cannot cast " + Std.string(o) + " to " + Std.string(t));
	}
};
js_Boot.__toStr = null;
js_Boot.__nativeClassName = function(o) {
	var name = js_Boot.__toStr.call(o).slice(8,-1);
	if(name == "Object" || name == "Function" || name == "Math" || name == "JSON") {
		return null;
	}
	return name;
};
js_Boot.__isNativeObj = function(o) {
	return js_Boot.__nativeClassName(o) != null;
};
js_Boot.__resolveNativeClass = function(name) {
	return $global[name];
};
var flixel_math_FlxRandom = function(InitialSeed) {
	this.internalSeed = 1;
	this._floatNormalRho = 0;
	this._twoPI = Math.PI * 2;
	this._floatNormalRand2 = 0;
	this._floatNormalRand1 = 0;
	this._hasFloatNormalSpare = false;
	this.initialSeed = 1;
	if(InitialSeed != null) {
		var lowerBound = InitialSeed < 1 ? 1 : InitialSeed;
		var NewSeed = (lowerBound > 2147483646 ? 2147483646 : lowerBound) | 0;
		var lowerBound = NewSeed < 1 ? 1 : NewSeed;
		this.initialSeed = (this.internalSeed = (lowerBound > 2147483646 ? 2147483646 : lowerBound) | 0) | 0;
	} else {
		var Value = Math.random() * 2147483647 | 0;
		var lowerBound = Value < 1 ? 1 : Value;
		var NewSeed = (lowerBound > 2147483646 ? 2147483646 : lowerBound) | 0;
		var lowerBound = NewSeed < 1 ? 1 : NewSeed;
		var NewSeed = (lowerBound > 2147483646 ? 2147483646 : lowerBound) | 0;
		var lowerBound = NewSeed < 1 ? 1 : NewSeed;
		this.initialSeed = (this.internalSeed = (lowerBound > 2147483646 ? 2147483646 : lowerBound) | 0) | 0;
	}
};
$hxClasses["flixel.math.FlxRandom"] = flixel_math_FlxRandom;
flixel_math_FlxRandom.__name__ = "flixel.math.FlxRandom";
flixel_math_FlxRandom.rangeBound = function(Value) {
	var lowerBound = Value < 1 ? 1 : Value;
	return (lowerBound > 2147483646 ? 2147483646 : lowerBound) | 0;
};
flixel_math_FlxRandom.prototype = {
	getObject_flixel_group_FlxTypedGroup_T: function(Objects,WeightsArray,StartIndex,EndIndex) {
		if(StartIndex == null) {
			StartIndex = 0;
		}
		var selected = null;
		if(Objects.length != 0) {
			if(WeightsArray == null) {
				var _g = [];
				var _g1 = 0;
				var _g2 = Objects.length;
				while(_g1 < _g2) {
					var i = _g1++;
					_g.push(1);
				}
				WeightsArray = _g;
			}
			if(EndIndex == null) {
				EndIndex = Objects.length - 1;
			}
			var Max = Objects.length - 1;
			var lowerBound = StartIndex < 0 ? 0 : StartIndex;
			StartIndex = (Max != null && lowerBound > Max ? Max : lowerBound) | 0;
			var Max = Objects.length - 1;
			var lowerBound = EndIndex < 0 ? 0 : EndIndex;
			EndIndex = (Max != null && lowerBound > Max ? Max : lowerBound) | 0;
			if(EndIndex < StartIndex) {
				StartIndex += EndIndex;
				EndIndex = StartIndex - EndIndex;
				StartIndex -= EndIndex;
			}
			if(EndIndex > WeightsArray.length - 1) {
				EndIndex = WeightsArray.length - 1;
			}
			var _g = [];
			var _g1 = StartIndex;
			var _g2 = EndIndex + 1;
			while(_g1 < _g2) {
				var i = _g1++;
				_g.push(WeightsArray[i]);
			}
			flixel_math_FlxRandom._arrayFloatHelper = _g;
			selected = Objects[StartIndex + this.weightedPick(flixel_math_FlxRandom._arrayFloatHelper)];
		}
		return selected;
	}
	,shuffle_flixel_math_FlxPoint: function(array) {
		var maxValidIndex = array.length - 1;
		var _g = 0;
		var _g1 = maxValidIndex;
		while(_g < _g1) {
			var i = _g++;
			var j = this.int(i,maxValidIndex);
			var tmp = array[i];
			array[i] = array[j];
			array[j] = tmp;
		}
	}
	,getObject_String: function(Objects,WeightsArray,StartIndex,EndIndex) {
		if(StartIndex == null) {
			StartIndex = 0;
		}
		var selected = null;
		if(Objects.length != 0) {
			if(WeightsArray == null) {
				var _g = [];
				var _g1 = 0;
				var _g2 = Objects.length;
				while(_g1 < _g2) {
					var i = _g1++;
					_g.push(1);
				}
				WeightsArray = _g;
			}
			if(EndIndex == null) {
				EndIndex = Objects.length - 1;
			}
			var Max = Objects.length - 1;
			var lowerBound = StartIndex < 0 ? 0 : StartIndex;
			StartIndex = (Max != null && lowerBound > Max ? Max : lowerBound) | 0;
			var Max = Objects.length - 1;
			var lowerBound = EndIndex < 0 ? 0 : EndIndex;
			EndIndex = (Max != null && lowerBound > Max ? Max : lowerBound) | 0;
			if(EndIndex < StartIndex) {
				StartIndex += EndIndex;
				EndIndex = StartIndex - EndIndex;
				StartIndex -= EndIndex;
			}
			if(EndIndex > WeightsArray.length - 1) {
				EndIndex = WeightsArray.length - 1;
			}
			var _g = [];
			var _g1 = StartIndex;
			var _g2 = EndIndex + 1;
			while(_g1 < _g2) {
				var i = _g1++;
				_g.push(WeightsArray[i]);
			}
			flixel_math_FlxRandom._arrayFloatHelper = _g;
			selected = Objects[StartIndex + this.weightedPick(flixel_math_FlxRandom._arrayFloatHelper)];
		}
		return selected;
	}
	,shuffle_Int: function(array) {
		var maxValidIndex = array.length - 1;
		var _g = 0;
		var _g1 = maxValidIndex;
		while(_g < _g1) {
			var i = _g++;
			var j = this.int(i,maxValidIndex);
			var tmp = array[i];
			array[i] = array[j];
			array[j] = tmp;
		}
	}
	,getObject_Null_getFromArrayWithExclusions_T: function(Objects,WeightsArray,StartIndex,EndIndex) {
		if(StartIndex == null) {
			StartIndex = 0;
		}
		var selected = null;
		if(Objects.length != 0) {
			if(WeightsArray == null) {
				var _g = [];
				var _g1 = 0;
				var _g2 = Objects.length;
				while(_g1 < _g2) {
					var i = _g1++;
					_g.push(1);
				}
				WeightsArray = _g;
			}
			if(EndIndex == null) {
				EndIndex = Objects.length - 1;
			}
			var Max = Objects.length - 1;
			var lowerBound = StartIndex < 0 ? 0 : StartIndex;
			StartIndex = (Max != null && lowerBound > Max ? Max : lowerBound) | 0;
			var Max = Objects.length - 1;
			var lowerBound = EndIndex < 0 ? 0 : EndIndex;
			EndIndex = (Max != null && lowerBound > Max ? Max : lowerBound) | 0;
			if(EndIndex < StartIndex) {
				StartIndex += EndIndex;
				EndIndex = StartIndex - EndIndex;
				StartIndex -= EndIndex;
			}
			if(EndIndex > WeightsArray.length - 1) {
				EndIndex = WeightsArray.length - 1;
			}
			var _g = [];
			var _g1 = StartIndex;
			var _g2 = EndIndex + 1;
			while(_g1 < _g2) {
				var i = _g1++;
				_g.push(WeightsArray[i]);
			}
			flixel_math_FlxRandom._arrayFloatHelper = _g;
			selected = Objects[StartIndex + this.weightedPick(flixel_math_FlxRandom._arrayFloatHelper)];
		}
		return selected;
	}
	,initialSeed: null
	,resetInitialSeed: function() {
		var Value = Math.random() * 2147483647 | 0;
		var lowerBound = Value < 1 ? 1 : Value;
		var NewSeed = (lowerBound > 2147483646 ? 2147483646 : lowerBound) | 0;
		var lowerBound = NewSeed < 1 ? 1 : NewSeed;
		var NewSeed = (lowerBound > 2147483646 ? 2147483646 : lowerBound) | 0;
		var lowerBound = NewSeed < 1 ? 1 : NewSeed;
		return this.initialSeed = (this.internalSeed = (lowerBound > 2147483646 ? 2147483646 : lowerBound) | 0) | 0;
	}
	,int: function(Min,Max,Excludes) {
		if(Max == null) {
			Max = 2147483647;
		}
		if(Min == null) {
			Min = 0;
		}
		if(Min == 0 && Max == 2147483647 && Excludes == null) {
			return (this.internalSeed = this.internalSeed * 48271.0 % 2147483647) | 0;
		} else if(Min == Max) {
			return Min;
		} else {
			if(Min > Max) {
				Min += Max;
				Max = Min - Max;
				Min -= Max;
			}
			if(Excludes == null) {
				return Math.floor(Min + (this.internalSeed = this.internalSeed * 48271.0 % 2147483647) / 2147483647 * (Max - Min + 1));
			} else {
				var result = 0;
				while(true) {
					result = Math.floor(Min + (this.internalSeed = this.internalSeed * 48271.0 % 2147483647) / 2147483647 * (Max - Min + 1));
					if(!(Excludes.indexOf(result) >= 0)) {
						break;
					}
				}
				return result;
			}
		}
	}
	,float: function(Min,Max,Excludes) {
		if(Max == null) {
			Max = 1;
		}
		if(Min == null) {
			Min = 0;
		}
		var result = 0;
		if(Min == 0 && Max == 1 && Excludes == null) {
			return (this.internalSeed = this.internalSeed * 48271.0 % 2147483647) / 2147483647;
		} else if(Min == Max) {
			result = Min;
		} else {
			if(Min > Max) {
				Min += Max;
				Max = Min - Max;
				Min -= Max;
			}
			if(Excludes == null) {
				result = Min + (this.internalSeed = this.internalSeed * 48271.0 % 2147483647) / 2147483647 * (Max - Min);
			} else {
				while(true) {
					result = Min + (this.internalSeed = this.internalSeed * 48271.0 % 2147483647) / 2147483647 * (Max - Min);
					if(!(Excludes.indexOf(result) >= 0)) {
						break;
					}
				}
			}
		}
		return result;
	}
	,_hasFloatNormalSpare: null
	,_floatNormalRand1: null
	,_floatNormalRand2: null
	,_twoPI: null
	,_floatNormalRho: null
	,floatNormal: function(Mean,StdDev) {
		if(StdDev == null) {
			StdDev = 1;
		}
		if(Mean == null) {
			Mean = 0;
		}
		if(this._hasFloatNormalSpare) {
			this._hasFloatNormalSpare = false;
			var scale = StdDev * this._floatNormalRho;
			return Mean + scale * this._floatNormalRand2;
		}
		this._hasFloatNormalSpare = true;
		var theta = this._twoPI * ((this.internalSeed = this.internalSeed * 48271.0 % 2147483647) / 2147483647);
		this._floatNormalRho = Math.sqrt(-2 * Math.log(1 - (this.internalSeed = this.internalSeed * 48271.0 % 2147483647) / 2147483647));
		var scale = StdDev * this._floatNormalRho;
		this._floatNormalRand1 = Math.cos(theta);
		this._floatNormalRand2 = Math.sin(theta);
		return Mean + scale * this._floatNormalRand1;
	}
	,bool: function(Chance) {
		if(Chance == null) {
			Chance = 50;
		}
		return this.float(0,100) < Chance;
	}
	,sign: function(Chance) {
		if(Chance == null) {
			Chance = 50;
		}
		var Chance1 = Chance;
		if(Chance1 == null) {
			Chance1 = 50;
		}
		if(this.float(0,100) < Chance1) {
			return 1;
		} else {
			return -1;
		}
	}
	,weightedPick: function(WeightsArray) {
		var totalWeight = 0;
		var pick = 0;
		var _g = 0;
		while(_g < WeightsArray.length) {
			var i = WeightsArray[_g];
			++_g;
			totalWeight += i;
		}
		totalWeight = this.float(0,totalWeight);
		var _g = 0;
		var _g1 = WeightsArray.length;
		while(_g < _g1) {
			var i = _g++;
			if(totalWeight < WeightsArray[i]) {
				pick = i;
				break;
			}
			totalWeight -= WeightsArray[i];
		}
		return pick;
	}
	,color: function(Min,Max,Alpha,GreyScale) {
		if(GreyScale == null) {
			GreyScale = false;
		}
		var red;
		var green;
		var blue;
		var alpha;
		if(Min == null && Max == null) {
			red = this.int(0,255);
			green = this.int(0,255);
			blue = this.int(0,255);
			alpha = Alpha == null ? this.int(0,255) : Alpha;
		} else if(Max == null) {
			red = this.int(Min >> 16 & 255,255);
			green = GreyScale ? red : this.int(Min >> 8 & 255,255);
			blue = GreyScale ? red : this.int(Min & 255,255);
			alpha = Alpha == null ? this.int(Min >> 24 & 255,255) : Alpha;
		} else if(Min == null) {
			red = this.int(0,Max >> 16 & 255);
			green = GreyScale ? red : this.int(0,Max >> 8 & 255);
			blue = GreyScale ? red : this.int(0,Max & 255);
			alpha = Alpha == null ? this.int(0,Max >> 24 & 255) : Alpha;
		} else {
			red = this.int(Min >> 16 & 255,Max >> 16 & 255);
			green = GreyScale ? red : this.int(Min >> 8 & 255,Max >> 8 & 255);
			blue = GreyScale ? red : this.int(Min & 255,Max & 255);
			alpha = Alpha == null ? this.int(Min >> 24 & 255,Max >> 24 & 255) : Alpha;
		}
		var Alpha = alpha;
		if(Alpha == null) {
			Alpha = 255;
		}
		var color = flixel_util_FlxColor._new();
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 255;
		}
		color &= -16711681;
		color |= (red > 255 ? 255 : red < 0 ? 0 : red) << 16;
		color &= -65281;
		color |= (green > 255 ? 255 : green < 0 ? 0 : green) << 8;
		color &= -256;
		color |= blue > 255 ? 255 : blue < 0 ? 0 : blue;
		color &= 16777215;
		color |= (Alpha1 > 255 ? 255 : Alpha1 < 0 ? 0 : Alpha1) << 24;
		return color;
	}
	,generate: function() {
		return this.internalSeed = this.internalSeed * 48271.0 % 2147483647;
	}
	,internalSeed: null
	,set_initialSeed: function(NewSeed) {
		var lowerBound = NewSeed < 1 ? 1 : NewSeed;
		var NewSeed = (lowerBound > 2147483646 ? 2147483646 : lowerBound) | 0;
		var lowerBound = NewSeed < 1 ? 1 : NewSeed;
		return this.initialSeed = (this.internalSeed = (lowerBound > 2147483646 ? 2147483646 : lowerBound) | 0) | 0;
	}
	,get_currentSeed: function() {
		return this.internalSeed | 0;
	}
	,set_currentSeed: function(NewSeed) {
		var lowerBound = NewSeed < 1 ? 1 : NewSeed;
		return (this.internalSeed = (lowerBound > 2147483646 ? 2147483646 : lowerBound) | 0) | 0;
	}
	,__class__: flixel_math_FlxRandom
	,__properties__: {set_currentSeed:"set_currentSeed",get_currentSeed:"get_currentSeed",set_initialSeed:"set_initialSeed"}
};
var flixel_util_FlxSave = function() {
	this._closeRequested = false;
};
$hxClasses["flixel.util.FlxSave"] = flixel_util_FlxSave;
flixel_util_FlxSave.__name__ = "flixel.util.FlxSave";
flixel_util_FlxSave.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_util_FlxSave.prototype = {
	data: null
	,name: null
	,path: null
	,_sharedObject: null
	,_onComplete: null
	,_closeRequested: null
	,destroy: function() {
		this._sharedObject = null;
		this.name = null;
		this.path = null;
		this.data = null;
		this._onComplete = null;
		this._closeRequested = false;
	}
	,bind: function(Name,Path) {
		this.destroy();
		this.name = Name;
		this.path = Path;
		try {
			this._sharedObject = openfl_net_SharedObject.getLocal(this.name,this.path);
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			if(((haxe_Exception.caught(_g).unwrap()) instanceof openfl_errors_Error)) {
				this.destroy();
				return false;
			} else {
				throw _g;
			}
		}
		this.data = this._sharedObject.data;
		return true;
	}
	,close: function(MinFileSize,OnComplete) {
		if(MinFileSize == null) {
			MinFileSize = 0;
		}
		this._closeRequested = true;
		return this.flush(MinFileSize,OnComplete);
	}
	,flush: function(MinFileSize,OnComplete) {
		if(MinFileSize == null) {
			MinFileSize = 0;
		}
		if(!this.checkBinding()) {
			return false;
		}
		this._onComplete = OnComplete;
		var result = null;
		try {
			result = this._sharedObject.flush();
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			if(((haxe_Exception.caught(_g).unwrap()) instanceof openfl_errors_Error)) {
				return this.onDone(flixel_util_FlxSaveStatus.ERROR);
			} else {
				throw _g;
			}
		}
		return this.onDone(result == 0 ? flixel_util_FlxSaveStatus.SUCCESS : flixel_util_FlxSaveStatus.PENDING);
	}
	,erase: function() {
		if(!this.checkBinding()) {
			return false;
		}
		this._sharedObject.clear();
		this.data = { };
		return true;
	}
	,onDone: function(Result) {
		switch(Result._hx_index) {
		case 1:
			break;
		case 2:
			break;
		default:
		}
		if(this._onComplete != null) {
			this._onComplete(Result == flixel_util_FlxSaveStatus.SUCCESS);
		}
		if(this._closeRequested) {
			this.destroy();
		}
		return Result == flixel_util_FlxSaveStatus.SUCCESS;
	}
	,checkBinding: function() {
		if(this._sharedObject == null) {
			return false;
		}
		return true;
	}
	,__class__: flixel_util_FlxSave
};
var flixel_system_scaleModes_BaseScaleMode = function() {
	this.verticalAlign = flixel_util_FlxVerticalAlign.CENTER;
	this.horizontalAlign = flixel_util_FlxHorizontalAlign.CENTER;
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	this.deviceSize = point;
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	this.gameSize = point;
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	this.scale = point;
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	this.offset = point;
};
$hxClasses["flixel.system.scaleModes.BaseScaleMode"] = flixel_system_scaleModes_BaseScaleMode;
flixel_system_scaleModes_BaseScaleMode.__name__ = "flixel.system.scaleModes.BaseScaleMode";
flixel_system_scaleModes_BaseScaleMode.prototype = {
	deviceSize: null
	,gameSize: null
	,scale: null
	,offset: null
	,horizontalAlign: null
	,verticalAlign: null
	,onMeasure: function(Width,Height) {
		flixel_FlxG.width = flixel_FlxG.initialWidth;
		flixel_FlxG.height = flixel_FlxG.initialHeight;
		this.updateGameSize(Width,Height);
		this.updateDeviceSize(Width,Height);
		this.updateScaleOffset();
		this.updateGamePosition();
	}
	,updateGameSize: function(Width,Height) {
		this.gameSize.set(Width,Height);
	}
	,updateDeviceSize: function(Width,Height) {
		this.deviceSize.set(Width,Height);
	}
	,updateScaleOffset: function() {
		this.scale.set_x(this.gameSize.x / (flixel_FlxG.width * flixel_FlxG.initialZoom));
		this.scale.set_y(this.gameSize.y / (flixel_FlxG.height * flixel_FlxG.initialZoom));
		this.updateOffsetX();
		this.updateOffsetY();
	}
	,updateOffsetX: function() {
		var tmp;
		switch(this.horizontalAlign._hx_index) {
		case 0:
			tmp = 0;
			break;
		case 1:
			tmp = Math.ceil((this.deviceSize.x - this.gameSize.x) * 0.5);
			break;
		case 2:
			tmp = this.deviceSize.x - this.gameSize.x;
			break;
		}
		this.offset.set_x(tmp);
	}
	,updateOffsetY: function() {
		var tmp;
		switch(this.verticalAlign._hx_index) {
		case 0:
			tmp = 0;
			break;
		case 1:
			tmp = Math.ceil((this.deviceSize.y - this.gameSize.y) * 0.5);
			break;
		case 2:
			tmp = this.deviceSize.y - this.gameSize.y;
			break;
		}
		this.offset.set_y(tmp);
	}
	,updateGamePosition: function() {
		if(flixel_FlxG.game == null) {
			return;
		}
		flixel_FlxG.game.set_x(this.offset.x);
		flixel_FlxG.game.set_y(this.offset.y);
	}
	,set_horizontalAlign: function(value) {
		this.horizontalAlign = value;
		if(this.offset != null) {
			this.updateOffsetX();
			this.updateGamePosition();
		}
		return value;
	}
	,set_verticalAlign: function(value) {
		this.verticalAlign = value;
		if(this.offset != null) {
			this.updateOffsetY();
			this.updateGamePosition();
		}
		return value;
	}
	,__class__: flixel_system_scaleModes_BaseScaleMode
	,__properties__: {set_verticalAlign:"set_verticalAlign",set_horizontalAlign:"set_horizontalAlign"}
};
var flixel_system_scaleModes_RatioScaleMode = function(fillScreen) {
	if(fillScreen == null) {
		fillScreen = false;
	}
	flixel_system_scaleModes_BaseScaleMode.call(this);
	this.fillScreen = fillScreen;
};
$hxClasses["flixel.system.scaleModes.RatioScaleMode"] = flixel_system_scaleModes_RatioScaleMode;
flixel_system_scaleModes_RatioScaleMode.__name__ = "flixel.system.scaleModes.RatioScaleMode";
flixel_system_scaleModes_RatioScaleMode.__super__ = flixel_system_scaleModes_BaseScaleMode;
flixel_system_scaleModes_RatioScaleMode.prototype = $extend(flixel_system_scaleModes_BaseScaleMode.prototype,{
	fillScreen: null
	,updateGameSize: function(Width,Height) {
		var ratio = flixel_FlxG.width / flixel_FlxG.height;
		var realRatio = Width / Height;
		var scaleY = realRatio < ratio;
		if(this.fillScreen) {
			scaleY = !scaleY;
		}
		if(scaleY) {
			this.gameSize.set_x(Width);
			this.gameSize.set_y(Math.floor(this.gameSize.x / ratio));
		} else {
			this.gameSize.set_y(Height);
			this.gameSize.set_x(Math.floor(this.gameSize.y * ratio));
		}
	}
	,__class__: flixel_system_scaleModes_RatioScaleMode
});
var flixel_system_frontEnds_SignalFrontEnd = function() {
	this.focusLost = new flixel_util__$FlxSignal_FlxSignal0();
	this.focusGained = new flixel_util__$FlxSignal_FlxSignal0();
	this.postDraw = new flixel_util__$FlxSignal_FlxSignal0();
	this.preDraw = new flixel_util__$FlxSignal_FlxSignal0();
	this.postUpdate = new flixel_util__$FlxSignal_FlxSignal0();
	this.preUpdate = new flixel_util__$FlxSignal_FlxSignal0();
	this.postGameStart = new flixel_util__$FlxSignal_FlxSignal0();
	this.preGameStart = new flixel_util__$FlxSignal_FlxSignal0();
	this.postGameReset = new flixel_util__$FlxSignal_FlxSignal0();
	this.preGameReset = new flixel_util__$FlxSignal_FlxSignal0();
	this.gameResized = new flixel_util__$FlxSignal_FlxSignal2();
	this.preStateCreate = new flixel_util__$FlxSignal_FlxSignal1();
	this.postStateSwitch = new flixel_util__$FlxSignal_FlxSignal0();
	this.preStateSwitch = new flixel_util__$FlxSignal_FlxSignal0();
};
$hxClasses["flixel.system.frontEnds.SignalFrontEnd"] = flixel_system_frontEnds_SignalFrontEnd;
flixel_system_frontEnds_SignalFrontEnd.__name__ = "flixel.system.frontEnds.SignalFrontEnd";
flixel_system_frontEnds_SignalFrontEnd.prototype = {
	preStateSwitch: null
	,postStateSwitch: null
	,preStateCreate: null
	,gameResized: null
	,preGameReset: null
	,postGameReset: null
	,preGameStart: null
	,postGameStart: null
	,preUpdate: null
	,postUpdate: null
	,preDraw: null
	,postDraw: null
	,focusGained: null
	,focusLost: null
	,get_stateSwitched: function() {
		return this.preStateSwitch;
	}
	,get_gameStarted: function() {
		return this.postGameStart;
	}
	,__class__: flixel_system_frontEnds_SignalFrontEnd
	,__properties__: {get_gameStarted:"get_gameStarted",get_stateSwitched:"get_stateSwitched"}
};
var flixel_system_frontEnds_WatchFrontEnd = function() {
};
$hxClasses["flixel.system.frontEnds.WatchFrontEnd"] = flixel_system_frontEnds_WatchFrontEnd;
flixel_system_frontEnds_WatchFrontEnd.__name__ = "flixel.system.frontEnds.WatchFrontEnd";
flixel_system_frontEnds_WatchFrontEnd.prototype = {
	add: function(object,field,displayName) {
	}
	,remove: function(object,field) {
	}
	,addQuick: function(displayName,value) {
	}
	,removeQuick: function(displayName) {
	}
	,addExpression: function(expression,displayName) {
	}
	,removeExpression: function(displayName) {
	}
	,addMouse: function() {
	}
	,removeMouse: function() {
	}
	,__class__: flixel_system_frontEnds_WatchFrontEnd
};
var flixel_FlxG = function() { };
$hxClasses["flixel.FlxG"] = flixel_FlxG;
flixel_FlxG.__name__ = "flixel.FlxG";
flixel_FlxG.__properties__ = {set_mouse:"set_mouse",set_fullscreen:"set_fullscreen",get_fullscreen:"get_fullscreen",set_scaleMode:"set_scaleMode",get_onMobile:"get_onMobile",set_drawFramerate:"set_drawFramerate",set_updateFramerate:"set_updateFramerate",get_state:"get_state",get_stage:"get_stage"};
flixel_FlxG.camera = null;
flixel_FlxG.game = null;
flixel_FlxG.updateFramerate = null;
flixel_FlxG.drawFramerate = null;
flixel_FlxG.renderMethod = null;
flixel_FlxG.renderBlit = null;
flixel_FlxG.renderTile = null;
flixel_FlxG.width = null;
flixel_FlxG.height = null;
flixel_FlxG.mouse = null;
flixel_FlxG.touches = null;
flixel_FlxG.keys = null;
flixel_FlxG.accelerometer = null;
flixel_FlxG.vcr = null;
flixel_FlxG.plugins = null;
flixel_FlxG.sound = null;
flixel_FlxG.resizeGame = function(Width,Height) {
	flixel_FlxG.scaleMode.onMeasure(Width,Height);
};
flixel_FlxG.resizeWindow = function(Width,Height) {
};
flixel_FlxG.resetGame = function() {
	flixel_FlxG.game._resetGame = true;
};
flixel_FlxG.switchState = function(nextState) {
	if(flixel_FlxG.game._state.switchTo(nextState)) {
		flixel_FlxG.game._requestedState = nextState;
	}
};
flixel_FlxG.resetState = function() {
	var nextState = Type.createInstance(js_Boot.getClass(flixel_FlxG.game._state),[]);
	if(flixel_FlxG.game._state.switchTo(nextState)) {
		flixel_FlxG.game._requestedState = nextState;
	}
};
flixel_FlxG.overlap = function(ObjectOrGroup1,ObjectOrGroup2,NotifyCallback,ProcessCallback) {
	if(ObjectOrGroup1 == null) {
		ObjectOrGroup1 = flixel_FlxG.game._state;
	}
	if(ObjectOrGroup2 == ObjectOrGroup1) {
		ObjectOrGroup2 = null;
	}
	flixel_system_FlxQuadTree.divisions = flixel_FlxG.worldDivisions;
	var quadTree = flixel_system_FlxQuadTree.recycle(flixel_FlxG.worldBounds.x,flixel_FlxG.worldBounds.y,flixel_FlxG.worldBounds.width,flixel_FlxG.worldBounds.height);
	quadTree.load(ObjectOrGroup1,ObjectOrGroup2,NotifyCallback,ProcessCallback);
	var result = quadTree.execute();
	quadTree.destroy();
	return result;
};
flixel_FlxG.pixelPerfectOverlap = function(Sprite1,Sprite2,AlphaTolerance,Camera) {
	if(AlphaTolerance == null) {
		AlphaTolerance = 255;
	}
	return flixel_util_FlxCollision.pixelPerfectCheck(Sprite1,Sprite2,AlphaTolerance,Camera);
};
flixel_FlxG.collide = function(ObjectOrGroup1,ObjectOrGroup2,NotifyCallback) {
	return flixel_FlxG.overlap(ObjectOrGroup1,ObjectOrGroup2,NotifyCallback,flixel_FlxObject.separate);
};
flixel_FlxG.addChildBelowMouse = function(Child,IndexModifier) {
	if(IndexModifier == null) {
		IndexModifier = 0;
	}
	var index = flixel_FlxG.game.getChildIndex(flixel_FlxG.game._inputContainer);
	var max = flixel_FlxG.game.get_numChildren();
	index = flixel_math_FlxMath.maxAdd(index,IndexModifier,max);
	flixel_FlxG.game.addChildAt(Child,index);
	return Child;
};
flixel_FlxG.removeChild = function(Child) {
	if(flixel_FlxG.game.contains(Child)) {
		flixel_FlxG.game.removeChild(Child);
	}
	return Child;
};
flixel_FlxG.addPostProcess = function(postProcess) {
	return postProcess;
};
flixel_FlxG.removePostProcess = function(postProcess) {
};
flixel_FlxG.openURL = function(URL1,Target) {
	if(Target == null) {
		Target = "_blank";
	}
	var prefix = "";
	if(!new EReg("^https?://","").match(URL1)) {
		prefix = "http://";
	}
	openfl_Lib.getURL(new openfl_net_URLRequest(prefix + URL1),Target);
};
flixel_FlxG.init = function(Game,Width,Height,Zoom) {
	flixel_FlxG.game = Game;
	flixel_FlxG.width = Math.abs(Width) | 0;
	flixel_FlxG.height = Math.abs(Height) | 0;
	flixel_FlxG.initRenderMethod();
	flixel_FlxG.initialWidth = flixel_FlxG.width;
	flixel_FlxG.initialHeight = flixel_FlxG.height;
	flixel_FlxG.initialZoom = flixel_FlxCamera.defaultZoom = Zoom;
	var Width = openfl_Lib.get_current().stage.stageWidth;
	var Height = openfl_Lib.get_current().stage.stageHeight;
	flixel_FlxG.scaleMode.onMeasure(Width,Height);
	flixel_FlxG.keys = flixel_FlxG.inputs.add_flixel_input_keyboard_FlxKeyboard(new flixel_input_keyboard_FlxKeyboard());
	flixel_FlxG.set_mouse(flixel_FlxG.inputs.add_flixel_input_mouse_FlxMouse(new flixel_input_mouse_FlxMouse(flixel_FlxG.game._inputContainer)));
	flixel_FlxG.touches = flixel_FlxG.inputs.add_flixel_input_touch_FlxTouchManager(new flixel_input_touch_FlxTouchManager());
	flixel_FlxG.accelerometer = new flixel_input_FlxAccelerometer();
	flixel_FlxG.save.bind("flixel");
	flixel_FlxG.plugins = new flixel_system_frontEnds_PluginFrontEnd();
	flixel_FlxG.vcr = new flixel_system_frontEnds_VCRFrontEnd();
	flixel_FlxG.sound = new flixel_system_frontEnds_SoundFrontEnd();
};
flixel_FlxG.initRenderMethod = function() {
	flixel_FlxG.renderMethod = flixel_FlxRenderMethod.BLITTING;
	var tmp;
	switch(openfl_Lib.get_current().stage.window.context.type) {
	case "opengl":case "opengles":case "webgl":
		tmp = flixel_FlxRenderMethod.DRAW_TILES;
		break;
	default:
		tmp = flixel_FlxRenderMethod.BLITTING;
	}
	flixel_FlxG.renderMethod = tmp;
	flixel_FlxG.renderBlit = flixel_FlxG.renderMethod == flixel_FlxRenderMethod.BLITTING;
	flixel_FlxG.renderTile = flixel_FlxG.renderMethod == flixel_FlxRenderMethod.DRAW_TILES;
	flixel_FlxObject.defaultPixelPerfectPosition = flixel_FlxG.renderBlit;
};
flixel_FlxG.reset = function() {
	var _this = flixel_FlxG.random;
	var Value = Math.random() * 2147483647 | 0;
	var lowerBound = Value < 1 ? 1 : Value;
	var NewSeed = (lowerBound > 2147483646 ? 2147483646 : lowerBound) | 0;
	var lowerBound = NewSeed < 1 ? 1 : NewSeed;
	var NewSeed = (lowerBound > 2147483646 ? 2147483646 : lowerBound) | 0;
	var lowerBound = NewSeed < 1 ? 1 : NewSeed;
	_this.initialSeed = (_this.internalSeed = (lowerBound > 2147483646 ? 2147483646 : lowerBound) | 0) | 0;
	flixel_FlxG.bitmap.reset();
	flixel_FlxG.inputs.reset();
	flixel_FlxG.sound.destroy(true);
	flixel_FlxG.autoPause = true;
	flixel_FlxG.fixedTimestep = true;
	flixel_FlxG.timeScale = 1.0;
	flixel_FlxG.elapsed = 0;
	flixel_FlxG.maxElapsed = 0.1;
	var _this = flixel_FlxG.worldBounds;
	var X = -10;
	var Y = -10;
	var Width = flixel_FlxG.width + 20;
	var Height = flixel_FlxG.height + 20;
	if(Height == null) {
		Height = 0;
	}
	if(Width == null) {
		Width = 0;
	}
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	_this.x = X;
	_this.y = Y;
	_this.width = Width;
	_this.height = Height;
	flixel_FlxG.worldDivisions = 6;
};
flixel_FlxG.set_scaleMode = function(ScaleMode) {
	flixel_FlxG.scaleMode = ScaleMode;
	flixel_FlxG.game.onResize(null);
	return ScaleMode;
};
flixel_FlxG.set_mouse = function(NewMouse) {
	if(flixel_FlxG.mouse == null) {
		flixel_FlxG.mouse = flixel_FlxG.inputs.add_flixel_input_mouse_FlxMouse(NewMouse);
		return flixel_FlxG.mouse;
	}
	var oldMouse = flixel_FlxG.mouse;
	var result = flixel_FlxG.inputs.replace_flixel_input_mouse_FlxMouse(oldMouse,NewMouse);
	if(result != null) {
		flixel_FlxG.mouse = result;
		oldMouse.destroy();
		return NewMouse;
	}
	return oldMouse;
};
flixel_FlxG.set_updateFramerate = function(Framerate) {
	var tmp = Framerate < flixel_FlxG.drawFramerate;
	flixel_FlxG.updateFramerate = Framerate;
	flixel_FlxG.game._stepMS = Math.abs(1000 / Framerate);
	flixel_FlxG.game._stepSeconds = flixel_FlxG.game._stepMS / 1000;
	if(flixel_FlxG.game._maxAccumulation < flixel_FlxG.game._stepMS) {
		flixel_FlxG.game._maxAccumulation = flixel_FlxG.game._stepMS;
	}
	return Framerate;
};
flixel_FlxG.set_drawFramerate = function(Framerate) {
	var tmp = Framerate > flixel_FlxG.updateFramerate;
	flixel_FlxG.drawFramerate = Math.abs(Framerate) | 0;
	if(flixel_FlxG.game.stage != null) {
		flixel_FlxG.game.stage.set_frameRate(flixel_FlxG.drawFramerate);
	}
	flixel_FlxG.game._maxAccumulation = 2000 / flixel_FlxG.drawFramerate - 1;
	if(flixel_FlxG.game._maxAccumulation < flixel_FlxG.game._stepMS) {
		flixel_FlxG.game._maxAccumulation = flixel_FlxG.game._stepMS;
	}
	return Framerate;
};
flixel_FlxG.get_fullscreen = function() {
	if(openfl_Lib.get_current().stage.get_displayState() != 0) {
		return openfl_Lib.get_current().stage.get_displayState() == 1;
	} else {
		return true;
	}
};
flixel_FlxG.set_fullscreen = function(Value) {
	openfl_Lib.get_current().stage.set_displayState(Value ? 0 : 2);
	return Value;
};
flixel_FlxG.get_stage = function() {
	return openfl_Lib.get_current().stage;
};
flixel_FlxG.get_state = function() {
	return flixel_FlxG.game._state;
};
flixel_FlxG.get_onMobile = function() {
	return flixel_FlxG.html5.onMobile;
};
var flixel_FlxRenderMethod = $hxEnums["flixel.FlxRenderMethod"] = { __ename__ : "flixel.FlxRenderMethod", __constructs__ : ["DRAW_TILES","BLITTING"]
	,DRAW_TILES: {_hx_index:0,__enum__:"flixel.FlxRenderMethod",toString:$estr}
	,BLITTING: {_hx_index:1,__enum__:"flixel.FlxRenderMethod",toString:$estr}
};
var flixel_FlxGame = function(GameWidth,GameHeight,InitialState,Zoom,UpdateFramerate,DrawFramerate,SkipSplash,StartFullscreen) {
	if(StartFullscreen == null) {
		StartFullscreen = false;
	}
	if(SkipSplash == null) {
		SkipSplash = false;
	}
	if(DrawFramerate == null) {
		DrawFramerate = 60;
	}
	if(UpdateFramerate == null) {
		UpdateFramerate = 60;
	}
	if(Zoom == null) {
		Zoom = 1;
	}
	if(GameHeight == null) {
		GameHeight = 0;
	}
	if(GameWidth == null) {
		GameWidth = 0;
	}
	this._resetGame = false;
	this._skipSplash = false;
	this._customSoundTray = flixel_system_ui_FlxSoundTray;
	this._lostFocus = false;
	this._startTime = 0;
	this._total = 0;
	this._gameJustStarted = false;
	this.filtersEnabled = true;
	this.ticks = 0;
	this.focusLostFramerate = 10;
	openfl_display_Sprite.call(this);
	this._inputContainer = new openfl_display_Sprite();
	if(GameWidth == 0) {
		GameWidth = openfl_Lib.get_current().stage.stageWidth;
	}
	if(GameHeight == 0) {
		GameHeight = openfl_Lib.get_current().stage.stageHeight;
	}
	flixel_FlxG.init(this,GameWidth,GameHeight,Zoom);
	flixel_FlxG.set_updateFramerate(UpdateFramerate);
	flixel_FlxG.set_drawFramerate(DrawFramerate);
	this._accumulator = this._stepMS;
	this._skipSplash = SkipSplash;
	this._initialState = InitialState == null ? flixel_FlxState : InitialState;
	this.addEventListener("addedToStage",$bind(this,this.create));
};
$hxClasses["flixel.FlxGame"] = flixel_FlxGame;
flixel_FlxGame.__name__ = "flixel.FlxGame";
flixel_FlxGame.__super__ = openfl_display_Sprite;
flixel_FlxGame.prototype = $extend(openfl_display_Sprite.prototype,{
	focusLostFramerate: null
	,soundTray: null
	,ticks: null
	,filtersEnabled: null
	,_gameJustStarted: null
	,_initialState: null
	,_state: null
	,_total: null
	,_startTime: null
	,_accumulator: null
	,_elapsedMS: null
	,_stepMS: null
	,_stepSeconds: null
	,_maxAccumulation: null
	,_lostFocus: null
	,_filters: null
	,_inputContainer: null
	,_customSoundTray: null
	,_skipSplash: null
	,_requestedState: null
	,_resetGame: null
	,setFilters: function(filters) {
		this._filters = filters;
	}
	,create: function(_) {
		if(this.stage == null) {
			return;
		}
		this.removeEventListener("addedToStage",$bind(this,this.create));
		this._startTime = this.getTimer();
		this._total = this.getTimer() - this._startTime;
		this.stage.set_scaleMode(2);
		this.stage.align = 6;
		this.stage.set_frameRate(flixel_FlxG.drawFramerate);
		this.addChild(this._inputContainer);
		this.soundTray = Type.createInstance(this._customSoundTray,[]);
		this.addChild(this.soundTray);
		this.stage.addEventListener("deactivate",$bind(this,this.onFocusLost));
		this.stage.addEventListener("activate",$bind(this,this.onFocus));
		flixel_FlxG.signals.preGameReset.dispatch();
		if(this._skipSplash || flixel_system_FlxSplash.nextState != null) {
			this._requestedState = Type.createInstance(this._initialState,[]);
			if(flixel_system_FlxSplash.nextState == null) {
				this._gameJustStarted = true;
			}
		} else {
			flixel_system_FlxSplash.nextState = this._initialState;
			this._requestedState = new flixel_system_FlxSplash();
			this._skipSplash = true;
		}
		flixel_FlxG.reset();
		flixel_FlxG.signals.postGameReset.dispatch();
		this.switchState();
		var tmp = flixel_FlxG.updateFramerate < flixel_FlxG.drawFramerate;
		this.stage.addEventListener("enterFrame",$bind(this,this.onEnterFrame));
		this.stage.addEventListener("resize",$bind(this,this.onResize));
		this.resizeGame(openfl_Lib.get_current().stage.stageWidth,openfl_Lib.get_current().stage.stageHeight);
		openfl_utils_Assets.addEventListener("change",($_=flixel_FlxG.bitmap,$bind($_,$_.onAssetsReload)));
	}
	,onFocus: function(_) {
		this._lostFocus = false;
		flixel_FlxG.signals.focusGained.dispatch();
		this._state.onFocus();
		if(!flixel_FlxG.autoPause) {
			return;
		}
		this.stage.set_frameRate(flixel_FlxG.drawFramerate);
		flixel_FlxG.sound.onFocus();
		var _g = 0;
		var _g1 = flixel_FlxG.inputs.list;
		while(_g < _g1.length) {
			var input = _g1[_g];
			++_g;
			input.onFocus();
		}
	}
	,onFocusLost: function(event) {
		this._lostFocus = true;
		flixel_FlxG.signals.focusLost.dispatch();
		this._state.onFocusLost();
		if(!flixel_FlxG.autoPause) {
			return;
		}
		this.stage.set_frameRate(this.focusLostFramerate);
		flixel_FlxG.sound.onFocusLost();
		var _g = 0;
		var _g1 = flixel_FlxG.inputs.list;
		while(_g < _g1.length) {
			var input = _g1[_g];
			++_g;
			input.onFocusLost();
		}
	}
	,onResize: function(_) {
		var width = openfl_Lib.get_current().stage.stageWidth;
		var height = openfl_Lib.get_current().stage.stageHeight;
		if(flixel_FlxG.renderTile) {
			flixel_FlxG.bitmap.onContext();
		}
		this.resizeGame(width,height);
	}
	,resizeGame: function(width,height) {
		flixel_FlxG.scaleMode.onMeasure(width,height);
		this._state.onResize(width,height);
		flixel_FlxG.cameras.resize();
		flixel_FlxG.signals.gameResized.dispatch(width,height);
		if(this.soundTray != null) {
			this.soundTray.screenCenter();
		}
	}
	,onEnterFrame: function(_) {
		this.ticks = this.getTimer() - this._startTime;
		this._elapsedMS = this.ticks - this._total;
		this._total = this.ticks;
		if(this.soundTray != null && this.soundTray.active) {
			this.soundTray.update(this._elapsedMS);
		}
		if(!this._lostFocus || !flixel_FlxG.autoPause) {
			if(flixel_FlxG.vcr.paused) {
				if(flixel_FlxG.vcr.stepRequested) {
					flixel_FlxG.vcr.stepRequested = false;
				} else if(this._state == this._requestedState) {
					return;
				}
			}
			if(flixel_FlxG.fixedTimestep) {
				this._accumulator += this._elapsedMS;
				this._accumulator = this._accumulator > this._maxAccumulation ? this._maxAccumulation : this._accumulator;
				while(this._accumulator >= this._stepMS) {
					this.step();
					this._accumulator -= this._stepMS;
				}
			} else {
				this.step();
			}
			this.draw();
		}
	}
	,resetGame: function() {
		flixel_FlxG.signals.preGameReset.dispatch();
		if(this._skipSplash || flixel_system_FlxSplash.nextState != null) {
			this._requestedState = Type.createInstance(this._initialState,[]);
			if(flixel_system_FlxSplash.nextState == null) {
				this._gameJustStarted = true;
			}
		} else {
			flixel_system_FlxSplash.nextState = this._initialState;
			this._requestedState = new flixel_system_FlxSplash();
			this._skipSplash = true;
		}
		flixel_FlxG.reset();
		flixel_FlxG.signals.postGameReset.dispatch();
	}
	,switchState: function() {
		flixel_FlxG.cameras.reset();
		flixel_FlxG.inputs.onStateSwitch();
		flixel_FlxG.sound.destroy();
		flixel_FlxG.signals.preStateSwitch.dispatch();
		if(this._state != null) {
			this._state.destroy();
		}
		flixel_FlxG.bitmap.clearCache();
		this._state = this._requestedState;
		if(this._gameJustStarted) {
			flixel_FlxG.signals.preGameStart.dispatch();
		}
		flixel_FlxG.signals.preStateCreate.dispatch(this._state);
		this._state.create();
		if(this._gameJustStarted) {
			this.gameStart();
		}
		flixel_FlxG.signals.postStateSwitch.dispatch();
	}
	,gameStart: function() {
		flixel_FlxG.signals.postGameStart.dispatch();
		this._gameJustStarted = false;
	}
	,step: function() {
		if(this._resetGame) {
			flixel_FlxG.signals.preGameReset.dispatch();
			if(this._skipSplash || flixel_system_FlxSplash.nextState != null) {
				this._requestedState = Type.createInstance(this._initialState,[]);
				if(flixel_system_FlxSplash.nextState == null) {
					this._gameJustStarted = true;
				}
			} else {
				flixel_system_FlxSplash.nextState = this._initialState;
				this._requestedState = new flixel_system_FlxSplash();
				this._skipSplash = true;
			}
			flixel_FlxG.reset();
			flixel_FlxG.signals.postGameReset.dispatch();
			this._resetGame = false;
		}
		this.handleReplayRequests();
		this.update();
	}
	,handleReplayRequests: function() {
	}
	,update: function() {
		if(!this._state.active || !this._state.exists) {
			return;
		}
		if(this._state != this._requestedState) {
			this.switchState();
		}
		this.updateElapsed();
		flixel_FlxG.signals.preUpdate.dispatch();
		this.updateInput();
		flixel_FlxG.sound.update(flixel_FlxG.elapsed);
		var elapsed = flixel_FlxG.elapsed;
		var _g = 0;
		var _g1 = flixel_FlxG.plugins.list;
		while(_g < _g1.length) {
			var plugin = _g1[_g];
			++_g;
			if(plugin.exists && plugin.active) {
				plugin.update(elapsed);
			}
		}
		this._state.tryUpdate(flixel_FlxG.elapsed);
		var elapsed = flixel_FlxG.elapsed;
		var _g = 0;
		var _g1 = flixel_FlxG.cameras.list;
		while(_g < _g1.length) {
			var camera = _g1[_g];
			++_g;
			if(camera != null && camera.exists && camera.active) {
				camera.update(elapsed);
			}
		}
		flixel_FlxG.signals.postUpdate.dispatch();
		flixel_util_FlxArrayUtil.clearArray(flixel_FlxG.swipes);
		this.set_filters(this.filtersEnabled ? this._filters : null);
	}
	,updateElapsed: function() {
		if(flixel_FlxG.fixedTimestep) {
			flixel_FlxG.elapsed = flixel_FlxG.timeScale * this._stepSeconds;
		} else {
			flixel_FlxG.elapsed = flixel_FlxG.timeScale * (this._elapsedMS / 1000);
			var max = flixel_FlxG.maxElapsed * flixel_FlxG.timeScale;
			if(flixel_FlxG.elapsed > max) {
				flixel_FlxG.elapsed = max;
			}
		}
	}
	,updateInput: function() {
		var _g = 0;
		var _g1 = flixel_FlxG.inputs.list;
		while(_g < _g1.length) {
			var input = _g1[_g];
			++_g;
			input.update();
		}
	}
	,draw: function() {
		if(!this._state.visible || !this._state.exists) {
			return;
		}
		flixel_FlxG.signals.preDraw.dispatch();
		if(flixel_FlxG.renderTile) {
			flixel_graphics_tile_FlxDrawBaseItem.drawCalls = 0;
		}
		var _this = flixel_FlxG.cameras;
		var _g = 0;
		var _g1 = _this.list;
		while(_g < _g1.length) {
			var camera = _g1[_g];
			++_g;
			if(camera == null || !camera.exists || !camera.visible) {
				continue;
			}
			if(flixel_FlxG.renderBlit) {
				camera.checkResize();
				if(_this.useBufferLocking) {
					camera.buffer.lock();
				}
			}
			if(flixel_FlxG.renderTile) {
				camera.clearDrawStack();
				camera.canvas.get_graphics().clear();
			}
			if(flixel_FlxG.renderBlit) {
				camera.fill(camera.bgColor,camera.useBgAlphaBlending);
				camera.screen.dirty = true;
			} else {
				camera.fill(camera.bgColor & 16777215,camera.useBgAlphaBlending,(camera.bgColor >> 24 & 255) / 255);
			}
		}
		var _g = 0;
		var _g1 = flixel_FlxG.plugins.list;
		while(_g < _g1.length) {
			var plugin = _g1[_g];
			++_g;
			if(plugin.exists && plugin.visible) {
				plugin.draw();
			}
		}
		this._state.draw();
		if(flixel_FlxG.renderTile) {
			if(flixel_FlxG.renderTile) {
				var _g = 0;
				var _g1 = flixel_FlxG.cameras.list;
				while(_g < _g1.length) {
					var camera = _g1[_g];
					++_g;
					if(camera != null && camera.exists && camera.visible) {
						camera.render();
					}
				}
			}
		}
		var _this = flixel_FlxG.cameras;
		var _g = 0;
		var _g1 = _this.list;
		while(_g < _g1.length) {
			var camera = _g1[_g];
			++_g;
			if(camera == null || !camera.exists || !camera.visible) {
				continue;
			}
			camera.drawFX();
			if(flixel_FlxG.renderBlit) {
				if(_this.useBufferLocking) {
					camera.buffer.unlock();
				}
				camera.screen.dirty = true;
			}
		}
		flixel_FlxG.signals.postDraw.dispatch();
	}
	,getTicks: function() {
		return this.getTimer() - this._startTime;
	}
	,getTimer: function() {
		return openfl_Lib.getTimer();
	}
	,__class__: flixel_FlxGame
});
var flixel_IFlxSprite = function() { };
$hxClasses["flixel.IFlxSprite"] = flixel_IFlxSprite;
flixel_IFlxSprite.__name__ = "flixel.IFlxSprite";
flixel_IFlxSprite.__isInterface__ = true;
flixel_IFlxSprite.__interfaces__ = [flixel_IFlxBasic];
flixel_IFlxSprite.prototype = {
	set_x: null
	,set_y: null
	,set_alpha: null
	,set_angle: null
	,set_facing: null
	,set_moves: null
	,set_immovable: null
	,x: null
	,y: null
	,alpha: null
	,angle: null
	,facing: null
	,moves: null
	,immovable: null
	,offset: null
	,origin: null
	,scale: null
	,velocity: null
	,maxVelocity: null
	,acceleration: null
	,drag: null
	,scrollFactor: null
	,reset: null
	,setPosition: null
	,__class__: flixel_IFlxSprite
	,__properties__: {set_immovable:"set_immovable",set_moves:"set_moves",set_facing:"set_facing",set_angle:"set_angle",set_alpha:"set_alpha",set_y:"set_y",set_x:"set_x"}
};
var flixel_FlxStrip = function(X,Y,SimpleGraphic) {
	this.repeat = false;
	this.colors = openfl_Vector.toIntVector(null);
	this.uvtData = openfl_Vector.toFloatVector(null);
	this.indices = openfl_Vector.toIntVector(null);
	this.vertices = openfl_Vector.toFloatVector(null);
	flixel_FlxSprite.call(this,X,Y,SimpleGraphic);
};
$hxClasses["flixel.FlxStrip"] = flixel_FlxStrip;
flixel_FlxStrip.__name__ = "flixel.FlxStrip";
flixel_FlxStrip.__super__ = flixel_FlxSprite;
flixel_FlxStrip.prototype = $extend(flixel_FlxSprite.prototype,{
	vertices: null
	,indices: null
	,uvtData: null
	,colors: null
	,repeat: null
	,destroy: function() {
		this.vertices = null;
		this.indices = null;
		this.uvtData = null;
		this.colors = null;
		flixel_FlxSprite.prototype.destroy.call(this);
	}
	,draw: function() {
		if(this.alpha == 0 || this.graphic == null || this.vertices == null) {
			return;
		}
		var _g = 0;
		var _g1 = this.get_cameras();
		while(_g < _g1.length) {
			var camera = _g1[_g];
			++_g;
			if(!camera.visible || !camera.exists) {
				continue;
			}
			this.getScreenPosition(this._point,camera).subtractPoint(this.offset);
			camera.drawTriangles(this.graphic,this.vertices,this.indices,this.uvtData,this.colors,this._point,this.blend,this.repeat,this.antialiasing);
		}
	}
	,__class__: flixel_FlxStrip
});
var flixel_addons_display_FlxSliceSprite = function(Graphic,SliceRect,Width,Height,SourceRect) {
	this.numVertices = 0;
	this._snappedHeight = -1;
	this._snappedWidth = -1;
	this.regenSlices = true;
	this.regen = true;
	this.fillCenter = true;
	this.stretchCenter = false;
	this.stretchBottom = false;
	this.stretchRight = false;
	this.stretchTop = false;
	this.stretchLeft = false;
	this.snapHeight = false;
	this.snapWidth = false;
	flixel_FlxStrip.call(this);
	if(this.renderSprite == null) {
		this.renderSprite = new flixel_FlxSprite();
	}
	this.sliceRects = [];
	this.sliceRects[0] = new flixel_math_FlxRect();
	this.sliceRects[1] = new flixel_math_FlxRect();
	this.sliceRects[2] = new flixel_math_FlxRect();
	this.sliceRects[3] = new flixel_math_FlxRect();
	this.sliceRects[4] = new flixel_math_FlxRect();
	this.sliceRects[5] = new flixel_math_FlxRect();
	this.sliceRects[6] = new flixel_math_FlxRect();
	this.sliceRects[7] = new flixel_math_FlxRect();
	this.sliceRects[8] = new flixel_math_FlxRect();
	this.repeat = true;
	this.set_sliceRect(SliceRect);
	this.set_sourceRect(SourceRect);
	this.loadGraphic(Graphic);
	this.set_width(Width);
	this.set_height(Height);
};
$hxClasses["flixel.addons.display.FlxSliceSprite"] = flixel_addons_display_FlxSliceSprite;
flixel_addons_display_FlxSliceSprite.__name__ = "flixel.addons.display.FlxSliceSprite";
flixel_addons_display_FlxSliceSprite.__super__ = flixel_FlxStrip;
flixel_addons_display_FlxSliceSprite.prototype = $extend(flixel_FlxStrip.prototype,{
	snapWidth: null
	,snapHeight: null
	,stretchLeft: null
	,stretchTop: null
	,stretchRight: null
	,stretchBottom: null
	,stretchCenter: null
	,fillCenter: null
	,sliceRect: null
	,sourceRect: null
	,sliceRects: null
	,renderSprite: null
	,regen: null
	,regenSlices: null
	,helperFrame: null
	,_snappedWidth: null
	,_snappedHeight: null
	,numVertices: null
	,destroy: function() {
		this.set_sliceRect(null);
		this.sliceRects = null;
		this.helperFrame = flixel_util_FlxDestroyUtil.destroy(this.helperFrame);
		this.renderSprite = flixel_util_FlxDestroyUtil.destroy(this.renderSprite);
		flixel_FlxStrip.prototype.destroy.call(this);
	}
	,loadGraphic: function(Graphic,Animated,Width,Height,Unique,Key) {
		if(Unique == null) {
			Unique = false;
		}
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Animated == null) {
			Animated = false;
		}
		this.set_graphic(flixel_FlxG.bitmap.add(Graphic));
		return this;
	}
	,loadFrame: function(Frame) {
		this.set_graphic(flixel_graphics_FlxGraphic.fromFrame(Frame));
		return this;
	}
	,set_graphic: function(Value) {
		if(this.graphic != Value) {
			this.regen = this.regenSlices = true;
		}
		return flixel_FlxStrip.prototype.set_graphic.call(this,Value);
	}
	,regenGraphic: function() {
		if(!this.regen || this.graphic == null) {
			return;
		}
		if(this.regenSlices) {
			this.regenSliceRects();
		}
		var topLeft = this.sliceRects[0];
		var topMiddle = this.sliceRects[1];
		var topRight = this.sliceRects[2];
		var middleLeft = this.sliceRects[3];
		var middle = this.sliceRects[4];
		var middleRight = this.sliceRects[5];
		var bottomLeft = this.sliceRects[6];
		var bottomMiddle = this.sliceRects[7];
		var bottomRight = this.sliceRects[8];
		var centerWidth = this.get_width() - middleLeft.width - middleRight.width;
		var centerHeight = this.get_height() - topMiddle.height - bottomMiddle.height;
		if(this.snapWidth) {
			centerWidth = Math.floor((this.get_width() - middleLeft.width - middleRight.width) / middle.width) * middle.width;
			centerWidth = Math.max(centerWidth,middle.width);
		}
		if(this.snapHeight) {
			centerHeight = Math.floor((this.get_height() - topMiddle.height - bottomMiddle.height) / middle.height) * middle.height;
			centerHeight = Math.max(centerHeight,middle.height);
		}
		this._snappedWidth = centerWidth + middleLeft.width + middleRight.width;
		this._snappedHeight = centerHeight + topMiddle.height + bottomMiddle.height;
		var centerX = topLeft.width;
		var centerY = topLeft.height;
		var bdSize = flixel_addons_display_FlxSliceSprite.helperBdSize.set(this.graphic.width,this.graphic.height);
		var dst = flixel_addons_display_FlxSliceSprite.helperDst;
		var slice = flixel_addons_display_FlxSliceSprite.helperRect;
		var size = flixel_addons_display_FlxSliceSprite.helperSize;
		var numHorizontal = Math.ceil((this._snappedWidth - topLeft.width - topRight.width) / topMiddle.width);
		var numVertical = Math.ceil((this._snappedHeight - topLeft.height - bottomLeft.height) / middleLeft.height);
		this.vertices = openfl_Vector.toFloatVector(null);
		this.uvtData = openfl_Vector.toFloatVector(null);
		this.indices = openfl_Vector.toIntVector(null);
		this.colors = openfl_Vector.toIntVector(null);
		this.numVertices = 0;
		if(this.fillCenter) {
			slice.x = middle.x;
			slice.y = middle.y;
			slice.width = middle.width;
			slice.height = middle.height;
			if(middle._weak) {
				if(!middle._inPool) {
					middle._inPool = true;
					middle._weak = false;
					flixel_math_FlxRect._pool.putUnsafe(middle);
				}
			}
			if(this.stretchCenter) {
				size.set(this._snappedWidth - middleLeft.width - middleRight.width,this._snappedHeight - topMiddle.height - bottomMiddle.height);
				dst.set(topLeft.width,topLeft.height);
				this.numVertices = this.stretchSlice(this.numVertices,slice,dst,bdSize,size);
			} else {
				var _g = 0;
				var _g1 = numHorizontal;
				while(_g < _g1) {
					var i = _g++;
					slice.width = middle.width;
					if(i == numHorizontal - 1) {
						slice.width = this._snappedWidth - middleLeft.width - middleRight.width - (numHorizontal - 1) * middle.width;
					}
					var _g2 = 0;
					var _g3 = numVertical;
					while(_g2 < _g3) {
						var j = _g2++;
						slice.height = middle.height;
						if(j == numVertical - 1) {
							slice.height = this._snappedHeight - topMiddle.height - bottomMiddle.height - (numVertical - 1) * middle.height;
						}
						size.set(slice.width,slice.height);
						dst.set(topLeft.width + i * middle.width,topLeft.height + j * middle.height);
						this.numVertices = this.stretchSlice(this.numVertices,slice,dst,bdSize,size);
					}
				}
			}
		}
		if(this.stretchTop) {
			slice.x = topMiddle.x;
			slice.y = topMiddle.y;
			slice.width = topMiddle.width;
			slice.height = topMiddle.height;
			if(topMiddle._weak) {
				if(!topMiddle._inPool) {
					topMiddle._inPool = true;
					topMiddle._weak = false;
					flixel_math_FlxRect._pool.putUnsafe(topMiddle);
				}
			}
			size.set(this._snappedWidth - topLeft.width - topRight.width,topMiddle.height);
			dst.set(topLeft.width,0);
			this.numVertices = this.stretchSlice(this.numVertices,slice,dst,bdSize,size);
		} else {
			var _g = 0;
			var _g1 = numHorizontal;
			while(_g < _g1) {
				var i = _g++;
				slice.x = topMiddle.x;
				slice.y = topMiddle.y;
				slice.width = topMiddle.width;
				slice.height = topMiddle.height;
				if(topMiddle._weak) {
					if(!topMiddle._inPool) {
						topMiddle._inPool = true;
						topMiddle._weak = false;
						flixel_math_FlxRect._pool.putUnsafe(topMiddle);
					}
				}
				if(i == numHorizontal - 1) {
					slice.width = this._snappedWidth - topLeft.width - topRight.width - (numHorizontal - 1) * topMiddle.width;
				}
				size.set(slice.width,slice.height);
				dst.set(topLeft.width + i * topMiddle.width,0);
				this.numVertices = this.stretchSlice(this.numVertices,slice,dst,bdSize,size);
			}
		}
		if(this.stretchBottom) {
			slice.x = bottomMiddle.x;
			slice.y = bottomMiddle.y;
			slice.width = bottomMiddle.width;
			slice.height = bottomMiddle.height;
			if(bottomMiddle._weak) {
				if(!bottomMiddle._inPool) {
					bottomMiddle._inPool = true;
					bottomMiddle._weak = false;
					flixel_math_FlxRect._pool.putUnsafe(bottomMiddle);
				}
			}
			dst.set(bottomLeft.width,this._snappedHeight - bottomMiddle.height);
			size.set(this._snappedWidth - bottomLeft.width - bottomRight.width,bottomMiddle.height);
			this.numVertices = this.stretchSlice(this.numVertices,slice,dst,bdSize,size);
		} else {
			var _g = 0;
			var _g1 = numHorizontal;
			while(_g < _g1) {
				var i = _g++;
				slice.x = bottomMiddle.x;
				slice.y = bottomMiddle.y;
				slice.width = bottomMiddle.width;
				slice.height = bottomMiddle.height;
				if(bottomMiddle._weak) {
					if(!bottomMiddle._inPool) {
						bottomMiddle._inPool = true;
						bottomMiddle._weak = false;
						flixel_math_FlxRect._pool.putUnsafe(bottomMiddle);
					}
				}
				if(i == numHorizontal - 1) {
					slice.width = this._snappedWidth - bottomLeft.width - bottomRight.width - (numHorizontal - 1) * bottomMiddle.width;
				}
				dst.set(bottomLeft.width + i * bottomMiddle.width,this._snappedHeight - bottomMiddle.height);
				size.set(slice.width,slice.height);
				this.numVertices = this.stretchSlice(this.numVertices,slice,dst,bdSize,size);
			}
		}
		if(this.stretchLeft) {
			slice.x = middleLeft.x;
			slice.y = middleLeft.y;
			slice.width = middleLeft.width;
			slice.height = middleLeft.height;
			if(middleLeft._weak) {
				if(!middleLeft._inPool) {
					middleLeft._inPool = true;
					middleLeft._weak = false;
					flixel_math_FlxRect._pool.putUnsafe(middleLeft);
				}
			}
			dst.set(0,topLeft.height);
			size.set(middleLeft.width,this._snappedHeight - topLeft.height - bottomLeft.height);
			this.numVertices = this.stretchSlice(this.numVertices,slice,dst,bdSize,size);
		} else {
			var _g = 0;
			var _g1 = numVertical;
			while(_g < _g1) {
				var i = _g++;
				slice.x = middleLeft.x;
				slice.y = middleLeft.y;
				slice.width = middleLeft.width;
				slice.height = middleLeft.height;
				if(middleLeft._weak) {
					if(!middleLeft._inPool) {
						middleLeft._inPool = true;
						middleLeft._weak = false;
						flixel_math_FlxRect._pool.putUnsafe(middleLeft);
					}
				}
				if(i == numVertical - 1) {
					slice.height = this._snappedHeight - topLeft.height - bottomLeft.height - (numVertical - 1) * middleLeft.height;
				}
				dst.set(0,topLeft.height + i * middleLeft.height);
				size.set(slice.width,slice.height);
				this.numVertices = this.stretchSlice(this.numVertices,slice,dst,bdSize,size);
			}
		}
		if(this.stretchRight) {
			slice.x = middleRight.x;
			slice.y = middleRight.y;
			slice.width = middleRight.width;
			slice.height = middleRight.height;
			if(middleRight._weak) {
				if(!middleRight._inPool) {
					middleRight._inPool = true;
					middleRight._weak = false;
					flixel_math_FlxRect._pool.putUnsafe(middleRight);
				}
			}
			dst.set(this._snappedWidth - middleRight.width,topRight.height);
			size.set(middleRight.width,this._snappedHeight - topRight.height - bottomRight.height);
			this.numVertices = this.stretchSlice(this.numVertices,slice,dst,bdSize,size);
		} else {
			var _g = 0;
			var _g1 = numVertical;
			while(_g < _g1) {
				var i = _g++;
				slice.x = middleRight.x;
				slice.y = middleRight.y;
				slice.width = middleRight.width;
				slice.height = middleRight.height;
				if(middleRight._weak) {
					if(!middleRight._inPool) {
						middleRight._inPool = true;
						middleRight._weak = false;
						flixel_math_FlxRect._pool.putUnsafe(middleRight);
					}
				}
				if(i == numVertical - 1) {
					slice.height = this._snappedHeight - topRight.height - bottomRight.height - (numVertical - 1) * middleRight.height;
				}
				dst.set(this._snappedWidth - middleRight.width,topRight.height + i * middleRight.height);
				size.set(slice.width,slice.height);
				this.numVertices = this.stretchSlice(this.numVertices,slice,dst,bdSize,size);
			}
		}
		dst.set(0,0);
		size.set(topLeft.width,topLeft.height);
		this.numVertices = this.stretchSlice(this.numVertices,topLeft,dst,bdSize,size);
		dst.set(0,this._snappedHeight - bottomLeft.height);
		size.set(bottomLeft.width,bottomLeft.height);
		this.numVertices = this.stretchSlice(this.numVertices,bottomLeft,dst,bdSize,size);
		dst.set(this._snappedWidth - topRight.width,0);
		size.set(topRight.width,topRight.height);
		this.numVertices = this.stretchSlice(this.numVertices,topRight,dst,bdSize,size);
		dst.set(this._snappedWidth - bottomRight.width,this._snappedHeight - bottomRight.height);
		size.set(bottomRight.width,bottomRight.height);
		this.numVertices = this.stretchSlice(this.numVertices,bottomRight,dst,bdSize,size);
		if(flixel_FlxG.renderBlit) {
			if(this.renderSprite.get_width() != this._snappedWidth || this.renderSprite.get_height() != this._snappedHeight) {
				this.renderSprite.makeGraphic(this._snappedWidth | 0,this._snappedHeight | 0,0,true);
			} else {
				this._flashRect2.setTo(0,0,this._snappedWidth,this._snappedHeight);
				this.renderSprite.get_pixels().fillRect(this._flashRect2,0);
			}
			flixel_util_FlxSpriteUtil.flashGfx.clear();
			flixel_util_FlxSpriteUtil.flashGfx.beginBitmapFill(this.graphic.bitmap);
			flixel_util_FlxSpriteUtil.flashGfx.drawTriangles(this.vertices,this.indices,this.uvtData);
			flixel_util_FlxSpriteUtil.flashGfx.endFill();
			this.renderSprite.get_pixels().draw(flixel_util_FlxSpriteUtil.flashGfxSprite,null,this.colorTransform);
			flixel_util_FlxSpriteUtil.flashGfx.clear();
			this.renderSprite.dirty = true;
		} else {
			var c = this.color;
			var Value = this.alpha;
			var Value1 = Math.round(Value * 255);
			c &= 16777215;
			c |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
			this.updateColors(c);
		}
		this.regen = false;
	}
	,stretchSlice: function(vertex,slice,dst,bdSize,size) {
		var vertexIndex = 2 * vertex;
		var uvIndex = vertexIndex;
		var colorIndex = vertex;
		this.vertices.set(vertexIndex++,dst.x);
		this.vertices.set(vertexIndex++,dst.y);
		this.vertices.set(vertexIndex++,dst.x + size.x);
		this.vertices.set(vertexIndex++,dst.y);
		this.vertices.set(vertexIndex++,dst.x + size.x);
		this.vertices.set(vertexIndex++,dst.y + size.y);
		this.vertices.set(vertexIndex++,dst.x);
		this.vertices.set(vertexIndex++,dst.y + size.y);
		this.uvtData.set(uvIndex++,slice.x / bdSize.x);
		this.uvtData.set(uvIndex++,slice.y / bdSize.y);
		this.uvtData.set(uvIndex++,(slice.x + slice.width) / bdSize.x);
		this.uvtData.set(uvIndex++,slice.y / bdSize.y);
		this.uvtData.set(uvIndex++,(slice.x + slice.width) / bdSize.x);
		this.uvtData.set(uvIndex++,(slice.y + slice.height) / bdSize.y);
		this.uvtData.set(uvIndex++,slice.x / bdSize.x);
		this.uvtData.set(uvIndex++,(slice.y + slice.height) / bdSize.y);
		var indexPosition = Math.round(6 * vertex / 4);
		this.indices.set(indexPosition++,vertex);
		this.indices.set(indexPosition++,vertex + 1);
		this.indices.set(indexPosition++,vertex + 2);
		this.indices.set(indexPosition++,vertex);
		this.indices.set(indexPosition++,vertex + 2);
		this.indices.set(indexPosition++,vertex + 3);
		return vertex + 4;
	}
	,regenSliceRects: function() {
		if(!this.regenSlices || this.graphic == null || this.sliceRect == null) {
			return;
		}
		var sourceWidth = this.graphic.width;
		var sourceHeight = this.graphic.height;
		var Value = this.sliceRect.x;
		var lowerBound = Value < 0 ? 0 : Value;
		var rectX = (sourceWidth != null && lowerBound > sourceWidth ? sourceWidth : lowerBound) | 0;
		var Value = this.sliceRect.y;
		var lowerBound = Value < 0 ? 0 : Value;
		var rectY = (sourceHeight != null && lowerBound > sourceHeight ? sourceHeight : lowerBound) | 0;
		var _this = this.sliceRect;
		var Value = _this.x + _this.width;
		var lowerBound = rectX != null && Value < rectX ? rectX : Value;
		var rectX2 = (sourceWidth != null && lowerBound > sourceWidth ? sourceWidth : lowerBound) | 0;
		var _this = this.sliceRect;
		var Value = _this.y + _this.height;
		var lowerBound = rectY != null && Value < rectY ? rectY : Value;
		var rectY2 = (sourceHeight != null && lowerBound > sourceHeight ? sourceHeight : lowerBound) | 0;
		var sourceX = 0;
		var sourceY = 0;
		if(this.sourceRect != null) {
			var Value = this.sourceRect.x;
			var lowerBound = Value < 0 ? 0 : Value;
			sourceX = (sourceWidth != null && lowerBound > sourceWidth ? sourceWidth : lowerBound) | 0;
			var Value = this.sourceRect.y;
			var lowerBound = Value < 0 ? 0 : Value;
			sourceY = (sourceHeight != null && lowerBound > sourceHeight ? sourceHeight : lowerBound) | 0;
			var Value = sourceX + this.sourceRect.width;
			var lowerBound = Value < 0 ? 0 : Value;
			sourceWidth = (sourceWidth != null && lowerBound > sourceWidth ? sourceWidth : lowerBound) | 0;
			var Value = sourceY + this.sourceRect.height;
			var lowerBound = Value < 0 ? 0 : Value;
			sourceHeight = (sourceHeight != null && lowerBound > sourceHeight ? sourceHeight : lowerBound) | 0;
		}
		rectX += sourceX;
		rectY += sourceY;
		rectX2 += sourceX;
		rectY2 += sourceY;
		var xArray_0 = sourceX;
		var xArray_1 = rectX;
		var xArray_2 = rectX2;
		var xArray_3 = sourceWidth;
		var yArray_0 = sourceY;
		var yArray_1 = rectY;
		var yArray_2 = rectY2;
		var yArray_3 = sourceHeight;
		rectX = xArray_0;
		rectX2 = xArray_1;
		rectY = yArray_0;
		rectY2 = yArray_1;
		var _this = this.sliceRects[0];
		var X = rectX;
		var Y = rectY;
		var Width = rectX2 - rectX;
		var Height = rectY2 - rectY;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		rectX = xArray_1;
		rectX2 = xArray_2;
		rectY = yArray_0;
		rectY2 = yArray_1;
		var _this = this.sliceRects[1];
		var X = rectX;
		var Y = rectY;
		var Width = rectX2 - rectX;
		var Height = rectY2 - rectY;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		rectX = xArray_2;
		rectX2 = xArray_3;
		rectY = yArray_0;
		rectY2 = yArray_1;
		var _this = this.sliceRects[2];
		var X = rectX;
		var Y = rectY;
		var Width = rectX2 - rectX;
		var Height = rectY2 - rectY;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		rectX = xArray_0;
		rectX2 = xArray_1;
		rectY = yArray_1;
		rectY2 = yArray_2;
		var _this = this.sliceRects[3];
		var X = rectX;
		var Y = rectY;
		var Width = rectX2 - rectX;
		var Height = rectY2 - rectY;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		rectX = xArray_1;
		rectX2 = xArray_2;
		rectY = yArray_1;
		rectY2 = yArray_2;
		var _this = this.sliceRects[4];
		var X = rectX;
		var Y = rectY;
		var Width = rectX2 - rectX;
		var Height = rectY2 - rectY;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		rectX = xArray_2;
		rectX2 = xArray_3;
		rectY = yArray_1;
		rectY2 = yArray_2;
		var _this = this.sliceRects[5];
		var X = rectX;
		var Y = rectY;
		var Width = rectX2 - rectX;
		var Height = rectY2 - rectY;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		rectX = xArray_0;
		rectX2 = xArray_1;
		rectY = yArray_2;
		rectY2 = yArray_3;
		var _this = this.sliceRects[6];
		var X = rectX;
		var Y = rectY;
		var Width = rectX2 - rectX;
		var Height = rectY2 - rectY;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		rectX = xArray_1;
		rectX2 = xArray_2;
		rectY = yArray_2;
		rectY2 = yArray_3;
		var _this = this.sliceRects[7];
		var X = rectX;
		var Y = rectY;
		var Width = rectX2 - rectX;
		var Height = rectY2 - rectY;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		rectX = xArray_2;
		rectX2 = xArray_3;
		rectY = yArray_2;
		rectY2 = yArray_3;
		var _this = this.sliceRects[8];
		var X = rectX;
		var Y = rectY;
		var Width = rectX2 - rectX;
		var Height = rectY2 - rectY;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		this.regenSlices = false;
	}
	,draw: function() {
		if(this.regen) {
			this.regenGraphic();
		}
		if(flixel_FlxG.renderBlit) {
			this.renderSprite.set_x(this.x);
			this.renderSprite.set_y(this.y);
			var _this = this.renderSprite.scale;
			var point = this.scale;
			_this.set_x(point.x);
			_this.set_y(point.y);
			if(point._weak) {
				point.put();
			}
			this.renderSprite.scrollFactor.set(this.scrollFactor.x,this.scrollFactor.y);
			this.renderSprite.set_cameras(this.get_cameras());
			this.renderSprite.draw();
		} else {
			flixel_FlxStrip.prototype.draw.call(this);
		}
	}
	,updateColors: function(color) {
		var _g = 0;
		var _g1 = this.numVertices;
		while(_g < _g1) {
			var i = _g++;
			this.colors.set(i,color);
		}
	}
	,set_alpha: function(Alpha) {
		if(this.alpha == Alpha) {
			return Alpha;
		}
		var newAlpha = flixel_FlxStrip.prototype.set_alpha.call(this,Alpha);
		if(flixel_FlxG.renderBlit && this.renderSprite != null) {
			this.renderSprite.set_alpha(newAlpha);
		} else if(flixel_FlxG.renderTile) {
			var c = this.color;
			var Value = Math.round(newAlpha * 255);
			c &= 16777215;
			c |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
			this.updateColors(c);
		}
		this.regen = true;
		return newAlpha;
	}
	,set_color: function(Color) {
		if(flixel_FlxG.renderBlit && this.renderSprite != null) {
			this.renderSprite.set_color(Color);
		} else if(flixel_FlxG.renderTile) {
			var newColor = Color;
			var Value = this.alpha;
			var Value1 = Math.round(Value * 255);
			newColor &= 16777215;
			newColor |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
			this.updateColors(newColor);
		}
		return flixel_FlxStrip.prototype.set_color.call(this,Color);
	}
	,set_width: function(Width) {
		if(Width <= 0) {
			return Width;
		}
		if(Width != this.get_width()) {
			this.regen = true;
		}
		return flixel_FlxStrip.prototype.set_width.call(this,Width);
	}
	,set_height: function(Height) {
		if(Height <= 0) {
			return Height;
		}
		if(Height != this.get_height()) {
			this.regen = true;
		}
		return flixel_FlxStrip.prototype.set_height.call(this,Height);
	}
	,set_snapWidth: function(Value) {
		if(Value != this.snapWidth) {
			this.regen = true;
		}
		return this.snapWidth = Value;
	}
	,set_snapHeight: function(Value) {
		if(Value != this.snapHeight) {
			this.regen = true;
		}
		return this.snapHeight = Value;
	}
	,set_stretchLeft: function(Value) {
		if(Value != this.stretchLeft) {
			this.regen = true;
		}
		return this.stretchLeft = Value;
	}
	,set_stretchTop: function(Value) {
		if(Value != this.stretchTop) {
			this.regen = true;
		}
		return this.stretchTop = Value;
	}
	,set_stretchRight: function(Value) {
		if(Value != this.stretchRight) {
			this.regen = true;
		}
		return this.stretchRight = Value;
	}
	,set_stretchBottom: function(Value) {
		if(Value != this.stretchBottom) {
			this.regen = true;
		}
		return this.stretchBottom = Value;
	}
	,set_stretchCenter: function(Value) {
		if(Value != this.stretchCenter) {
			this.regen = true;
		}
		return this.stretchCenter = Value;
	}
	,set_fillCenter: function(Value) {
		if(Value != this.fillCenter) {
			this.regen = true;
		}
		return this.fillCenter = Value;
	}
	,set_sliceRect: function(Value) {
		this.regen = this.regenSlices = true;
		return this.sliceRect = Value;
	}
	,set_sourceRect: function(Value) {
		this.regen = this.regenSlices = true;
		return this.sourceRect = Value;
	}
	,get_snappedWidth: function() {
		if(this.regen) {
			this.regenGraphic();
		}
		return this._snappedWidth;
	}
	,get_snappedHeight: function() {
		if(this.regen) {
			this.regenGraphic();
		}
		return this._snappedHeight;
	}
	,__class__: flixel_addons_display_FlxSliceSprite
	,__properties__: $extend(flixel_FlxStrip.prototype.__properties__,{get_snappedHeight:"get_snappedHeight",get_snappedWidth:"get_snappedWidth",set_sourceRect:"set_sourceRect",set_sliceRect:"set_sliceRect",set_fillCenter:"set_fillCenter",set_stretchCenter:"set_stretchCenter",set_stretchBottom:"set_stretchBottom",set_stretchRight:"set_stretchRight",set_stretchTop:"set_stretchTop",set_stretchLeft:"set_stretchLeft",set_snapHeight:"set_snapHeight",set_snapWidth:"set_snapWidth"})
});
var flixel_addons_effects_chainable_FlxEffectSprite = function(Target,Effects) {
	this.updateTargetAnimation = true;
	this.effectsEnabled = true;
	flixel_FlxSprite.call(this);
	this.target = Target;
	this.effects = Effects != null ? Effects : [];
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	this._effectOffset = point;
};
$hxClasses["flixel.addons.effects.chainable.FlxEffectSprite"] = flixel_addons_effects_chainable_FlxEffectSprite;
flixel_addons_effects_chainable_FlxEffectSprite.__name__ = "flixel.addons.effects.chainable.FlxEffectSprite";
flixel_addons_effects_chainable_FlxEffectSprite.__super__ = flixel_FlxSprite;
flixel_addons_effects_chainable_FlxEffectSprite.prototype = $extend(flixel_FlxSprite.prototype,{
	effectsEnabled: null
	,target: null
	,updateTargetAnimation: null
	,effects: null
	,_effectOffset: null
	,destroy: function() {
		this.effects = flixel_util_FlxDestroyUtil.destroyArray(this.effects);
		this._effectOffset = flixel_util_FlxDestroyUtil.put(this._effectOffset);
		this.target = null;
		flixel_FlxSprite.prototype.destroy.call(this);
	}
	,getScreenPosition: function(point,Camera) {
		return flixel_FlxSprite.prototype.getScreenPosition.call(this,point,Camera).addPoint(this._effectOffset);
	}
	,draw: function() {
		if(this.target.dirty) {
			this.target.drawFrame();
		}
		if(this.target.framePixels == null) {
			flixel_FlxSprite.prototype.draw.call(this);
			return;
		}
		if(this.get_pixels() != null && this.get_pixels().width == this.target.framePixels.width && this.get_pixels().height == this.target.framePixels.height) {
			this.get_pixels().fillRect(this.get_pixels().rect,0);
			this.get_pixels().draw(this.target.framePixels);
		} else {
			flixel_util_FlxDestroyUtil.dispose(this.get_pixels());
			this.set_pixels(this.target.framePixels.clone());
		}
		this._effectOffset.set(0,0);
		if(this.effectsEnabled) {
			this.get_pixels().lock();
			var _g = 0;
			var _g1 = this.effects;
			while(_g < _g1.length) {
				var effect = _g1[_g];
				++_g;
				if(effect.active) {
					this.set_pixels(effect.apply(this.get_pixels()));
					if(effect.offset != null) {
						this._effectOffset.addPoint(effect.offset);
					}
				}
			}
			this.get_pixels().unlock();
			this._flashRect = this.get_pixels().rect;
		}
		flixel_FlxSprite.prototype.draw.call(this);
	}
	,update: function(elapsed) {
		if(this.updateTargetAnimation && this.target.animation._sprite.numFrames > 1) {
			this.target.updateAnimation(elapsed);
		}
		if(this.effectsEnabled) {
			var _g = 0;
			var _g1 = this.effects;
			while(_g < _g1.length) {
				var effect = _g1[_g];
				++_g;
				if(effect.active) {
					effect.update(elapsed);
				}
			}
		}
		flixel_FlxSprite.prototype.update.call(this,elapsed);
	}
	,__class__: flixel_addons_effects_chainable_FlxEffectSprite
});
var flixel_addons_effects_chainable_IFlxEffect = function() { };
$hxClasses["flixel.addons.effects.chainable.IFlxEffect"] = flixel_addons_effects_chainable_IFlxEffect;
flixel_addons_effects_chainable_IFlxEffect.__name__ = "flixel.addons.effects.chainable.IFlxEffect";
flixel_addons_effects_chainable_IFlxEffect.__isInterface__ = true;
flixel_addons_effects_chainable_IFlxEffect.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_addons_effects_chainable_IFlxEffect.prototype = {
	active: null
	,offset: null
	,update: null
	,apply: null
	,__class__: flixel_addons_effects_chainable_IFlxEffect
};
var flixel_addons_effects_chainable_FlxWaveEffect = function(Mode,Strength,Center,Speed,Wavelength,Direction,InterlaceOffset) {
	if(InterlaceOffset == null) {
		InterlaceOffset = 0;
	}
	if(Wavelength == null) {
		Wavelength = 5;
	}
	if(Speed == null) {
		Speed = 3;
	}
	if(Center == null) {
		Center = 0.5;
	}
	if(Strength == null) {
		Strength = 10;
	}
	this._flashRect = new openfl_geom_Rectangle();
	this._flashPoint = new openfl_geom_Point();
	this._time = 0;
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	this.offset = point;
	this.active = true;
	this.strength = Strength;
	this.mode = Mode == null ? flixel_addons_effects_chainable_FlxWaveMode.ALL : Mode;
	this.speed = Speed;
	this.wavelength = Wavelength;
	this.direction = Direction != null ? Direction : flixel_addons_effects_chainable_FlxWaveDirection.HORIZONTAL;
	this.center = Center;
	this.set_interlaceOffset(InterlaceOffset);
};
$hxClasses["flixel.addons.effects.chainable.FlxWaveEffect"] = flixel_addons_effects_chainable_FlxWaveEffect;
flixel_addons_effects_chainable_FlxWaveEffect.__name__ = "flixel.addons.effects.chainable.FlxWaveEffect";
flixel_addons_effects_chainable_FlxWaveEffect.__interfaces__ = [flixel_addons_effects_chainable_IFlxEffect];
flixel_addons_effects_chainable_FlxWaveEffect.prototype = {
	active: null
	,offset: null
	,mode: null
	,speed: null
	,center: null
	,direction: null
	,wavelength: null
	,strength: null
	,interlaceOffset: null
	,_time: null
	,_flashPoint: null
	,_flashRect: null
	,_pixels: null
	,destroy: function() {
		this._flashPoint = null;
		this._flashRect = null;
		this.offset = flixel_util_FlxDestroyUtil.put(this.offset);
		this._pixels = flixel_util_FlxDestroyUtil.dispose(this._pixels);
	}
	,update: function(elapsed) {
		this._time += elapsed * this.speed;
	}
	,apply: function(bitmapData) {
		var horizontalStrength = this.direction == flixel_addons_effects_chainable_FlxWaveDirection.HORIZONTAL ? this.strength : 0;
		var verticalStrength = this.direction == flixel_addons_effects_chainable_FlxWaveDirection.VERTICAL ? this.strength : 0;
		this.offset.set(-horizontalStrength,-verticalStrength);
		if(this._pixels == null || this._pixels.width < bitmapData.width + horizontalStrength * 2 || this._pixels.height < bitmapData.height + verticalStrength * 2) {
			flixel_util_FlxDestroyUtil.dispose(this._pixels);
			this._pixels = new openfl_display_BitmapData(bitmapData.width + horizontalStrength * 2,bitmapData.height + verticalStrength * 2,true,0);
		} else {
			this._pixels.fillRect(this._pixels.rect,0);
		}
		var length = this.direction == flixel_addons_effects_chainable_FlxWaveDirection.HORIZONTAL ? bitmapData.height : bitmapData.width;
		var p = 0;
		while(p < length) {
			var pixelOffset = 0;
			var offsetP = length * this.center;
			var size = 1;
			switch(this.mode._hx_index) {
			case 0:
				offsetP = this.strength;
				break;
			case 1:
				if(p <= offsetP) {
					offsetP = (1 - p / offsetP) * this.strength;
				} else {
					size = length - p;
					offsetP = 0;
				}
				break;
			case 2:
				if(p >= offsetP) {
					offsetP = (1 - (1 - p / length) / (1 - this.center)) * this.strength;
				} else {
					size = Math.ceil(offsetP);
					offsetP = 0;
				}
				break;
			}
			var waveOffset = 0;
			if(this.interlaceOffset != 0 && this.interlaceOffset != 1 && ((p | 0) & 1) != 0) {
				waveOffset = Math.PI * 2 * this.interlaceOffset;
			}
			var n = p / this.wavelength + this._time + waveOffset;
			n *= 0.3183098862;
			if(n > 1) {
				n -= Math.ceil(n) >> 1 << 1;
			} else if(n < -1) {
				n += Math.ceil(-n) >> 1 << 1;
			}
			pixelOffset = offsetP * (n > 0 ? n * (3.1 + n * (0.5 + n * (-7.2 + n * 3.6))) : n * (3.1 - n * (0.5 + n * (7.2 + n * 3.6))));
			if(this.direction == flixel_addons_effects_chainable_FlxWaveDirection.HORIZONTAL) {
				this._flashPoint.setTo(this.strength + pixelOffset,p);
				this._flashRect.setTo(0,p,bitmapData.width,size);
			} else {
				this._flashPoint.setTo(p,this.strength + pixelOffset);
				this._flashRect.setTo(p,0,size,bitmapData.height);
			}
			this._pixels.copyPixels(bitmapData,this._flashRect,this._flashPoint);
			p += size;
		}
		flixel_util_FlxDestroyUtil.dispose(bitmapData);
		return this._pixels.clone();
	}
	,calculateOffset: function(p,length) {
		var waveOffset = 0;
		if(this.interlaceOffset != 0 && this.interlaceOffset != 1 && ((p | 0) & 1) != 0) {
			waveOffset = Math.PI * 2 * this.interlaceOffset;
		}
		var n = p / this.wavelength + this._time + waveOffset;
		n *= 0.3183098862;
		if(n > 1) {
			n -= Math.ceil(n) >> 1 << 1;
		} else if(n < -1) {
			n += Math.ceil(-n) >> 1 << 1;
		}
		if(n > 0) {
			return n * (3.1 + n * (0.5 + n * (-7.2 + n * 3.6)));
		} else {
			return n * (3.1 - n * (0.5 + n * (7.2 + n * 3.6)));
		}
	}
	,set_interlaceOffset: function(InterlaceOffset) {
		var lowerBound = InterlaceOffset < 0 ? 0 : InterlaceOffset;
		return this.interlaceOffset = lowerBound > 1 ? 1 : lowerBound;
	}
	,__class__: flixel_addons_effects_chainable_FlxWaveEffect
	,__properties__: {set_interlaceOffset:"set_interlaceOffset"}
};
var flixel_addons_effects_chainable_FlxWaveMode = $hxEnums["flixel.addons.effects.chainable.FlxWaveMode"] = { __ename__ : "flixel.addons.effects.chainable.FlxWaveMode", __constructs__ : ["ALL","START","END"]
	,ALL: {_hx_index:0,__enum__:"flixel.addons.effects.chainable.FlxWaveMode",toString:$estr}
	,START: {_hx_index:1,__enum__:"flixel.addons.effects.chainable.FlxWaveMode",toString:$estr}
	,END: {_hx_index:2,__enum__:"flixel.addons.effects.chainable.FlxWaveMode",toString:$estr}
};
var flixel_addons_effects_chainable_FlxWaveDirection = $hxEnums["flixel.addons.effects.chainable.FlxWaveDirection"] = { __ename__ : "flixel.addons.effects.chainable.FlxWaveDirection", __constructs__ : ["HORIZONTAL","VERTICAL"]
	,HORIZONTAL: {_hx_index:0,__enum__:"flixel.addons.effects.chainable.FlxWaveDirection",toString:$estr}
	,VERTICAL: {_hx_index:1,__enum__:"flixel.addons.effects.chainable.FlxWaveDirection",toString:$estr}
};
var lime_math_Vector2 = function(x,y) {
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	this.x = x;
	this.y = y;
};
$hxClasses["lime.math.Vector2"] = lime_math_Vector2;
lime_math_Vector2.__name__ = "lime.math.Vector2";
lime_math_Vector2.distance = function(pt1,pt2) {
	var dx = pt1.x - pt2.x;
	var dy = pt1.y - pt2.y;
	return Math.sqrt(dx * dx + dy * dy);
};
lime_math_Vector2.interpolate = function(pt1,pt2,f,result) {
	if(result == null) {
		result = new lime_math_Vector2();
	}
	result.x = pt2.x + f * (pt1.x - pt2.x);
	result.y = pt2.y + f * (pt1.y - pt2.y);
	return result;
};
lime_math_Vector2.polar = function(len,angle,result) {
	if(result == null) {
		result = new lime_math_Vector2();
	}
	var ya = len * Math.sin(angle);
	result.x = len * Math.cos(angle);
	result.y = ya;
	return result;
};
lime_math_Vector2.prototype = {
	x: null
	,y: null
	,add: function(v,result) {
		if(result == null) {
			result = new lime_math_Vector2();
		}
		result.x = v.x + this.x;
		result.y = v.y + this.y;
		return result;
	}
	,clone: function() {
		return new lime_math_Vector2(this.x,this.y);
	}
	,equals: function(toCompare) {
		if(toCompare != null && toCompare.x == this.x) {
			return toCompare.y == this.y;
		} else {
			return false;
		}
	}
	,normalize: function(thickness) {
		if(this.x == 0 && this.y == 0) {
			return;
		} else {
			var norm = thickness / Math.sqrt(this.x * this.x + this.y * this.y);
			this.x *= norm;
			this.y *= norm;
		}
	}
	,offset: function(dx,dy) {
		this.x += dx;
		this.y += dy;
	}
	,setTo: function(xa,ya) {
		this.x = xa;
		this.y = ya;
	}
	,subtract: function(v,result) {
		if(result == null) {
			result = new lime_math_Vector2();
		}
		result.x = this.x - v.x;
		result.y = this.y - v.y;
		return result;
	}
	,__toFlashPoint: function() {
		return null;
	}
	,get_length: function() {
		return Math.sqrt(this.x * this.x + this.y * this.y);
	}
	,get_lengthSquared: function() {
		return this.x * this.x + this.y * this.y;
	}
	,__class__: lime_math_Vector2
	,__properties__: {get_lengthSquared:"get_lengthSquared",get_length:"get_length"}
};
var openfl_display_BitmapData = function(width,height,transparent,fillColor) {
	if(fillColor == null) {
		fillColor = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	this.transparent = transparent;
	if(width == null) {
		width = 0;
	}
	if(height == null) {
		height = 0;
	}
	if(width < 0) {
		width = 0;
	}
	if(height < 0) {
		height = 0;
	}
	this.width = width;
	this.height = height;
	this.rect = new openfl_geom_Rectangle(0,0,width,height);
	this.__textureWidth = width;
	this.__textureHeight = height;
	if(width > 0 && height > 0) {
		if(transparent) {
			if((fillColor & -16777216) == 0) {
				fillColor = 0;
			}
		} else {
			fillColor = -16777216 | fillColor & 16777215;
		}
		fillColor = fillColor << 8 | fillColor >>> 24 & 255;
		this.image = new lime_graphics_Image(null,0,0,width,height,fillColor);
		this.image.set_transparent(transparent);
		this.__isValid = true;
		this.readable = true;
	}
	this.__renderTransform = new openfl_geom_Matrix();
	this.__worldAlpha = 1;
	this.__worldTransform = new openfl_geom_Matrix();
	this.__worldColorTransform = new openfl_geom_ColorTransform();
	this.__renderable = true;
};
$hxClasses["openfl.display.BitmapData"] = openfl_display_BitmapData;
openfl_display_BitmapData.__name__ = "openfl.display.BitmapData";
openfl_display_BitmapData.__interfaces__ = [openfl_display_IBitmapDrawable];
openfl_display_BitmapData.__textureFormat = null;
openfl_display_BitmapData.__textureInternalFormat = null;
openfl_display_BitmapData.fromBase64 = function(base64,type) {
	return null;
};
openfl_display_BitmapData.fromBytes = function(bytes,rawAlpha) {
	return null;
};
openfl_display_BitmapData.fromCanvas = function(canvas,transparent) {
	if(transparent == null) {
		transparent = true;
	}
	if(canvas == null) {
		return null;
	}
	var bitmapData = new openfl_display_BitmapData(0,0,transparent,0);
	bitmapData.__fromImage(lime_graphics_Image.fromCanvas(canvas));
	bitmapData.image.set_transparent(transparent);
	return bitmapData;
};
openfl_display_BitmapData.fromFile = function(path) {
	return null;
};
openfl_display_BitmapData.fromImage = function(image,transparent) {
	if(transparent == null) {
		transparent = true;
	}
	if(image == null || image.buffer == null) {
		return null;
	}
	var bitmapData = new openfl_display_BitmapData(0,0,transparent,0);
	bitmapData.__fromImage(image);
	bitmapData.image.set_transparent(transparent);
	if(bitmapData.image != null) {
		return bitmapData;
	} else {
		return null;
	}
};
openfl_display_BitmapData.fromTexture = function(texture) {
	if(texture == null) {
		return null;
	}
	var bitmapData = new openfl_display_BitmapData(texture.__width,texture.__height,true,0);
	bitmapData.readable = false;
	bitmapData.__texture = texture;
	bitmapData.__textureContext = texture.__textureContext;
	bitmapData.image = null;
	return bitmapData;
};
openfl_display_BitmapData.loadFromBase64 = function(base64,type) {
	return lime_graphics_Image.loadFromBase64(base64,type).then(function(image) {
		return lime_app_Future.withValue(openfl_display_BitmapData.fromImage(image));
	});
};
openfl_display_BitmapData.loadFromBytes = function(bytes,rawAlpha) {
	return lime_graphics_Image.loadFromBytes(openfl_utils_ByteArray.toBytes(bytes)).then(function(image) {
		var bitmapData = openfl_display_BitmapData.fromImage(image);
		if(rawAlpha != null) {
			bitmapData.__applyAlpha(rawAlpha);
		}
		return lime_app_Future.withValue(bitmapData);
	});
};
openfl_display_BitmapData.loadFromFile = function(path) {
	return lime_graphics_Image.loadFromFile(path).then(function(image) {
		return lime_app_Future.withValue(openfl_display_BitmapData.fromImage(image));
	});
};
openfl_display_BitmapData.prototype = {
	height: null
	,image: null
	,readable: null
	,rect: null
	,transparent: null
	,width: null
	,__blendMode: null
	,__framebuffer: null
	,__framebufferContext: null
	,__indexBuffer: null
	,__indexBufferContext: null
	,__indexBufferData: null
	,__indexBufferGrid: null
	,__isMask: null
	,__isValid: null
	,__mask: null
	,__renderable: null
	,__renderTransform: null
	,__scrollRect: null
	,__stencilBuffer: null
	,__surface: null
	,__texture: null
	,__textureContext: null
	,__textureHeight: null
	,__textureVersion: null
	,__textureWidth: null
	,__transform: null
	,__uvRect: null
	,__vertexBuffer: null
	,__vertexBufferContext: null
	,__vertexBufferData: null
	,__vertexBufferGrid: null
	,__vertexBufferHeight: null
	,__vertexBufferScaleX: null
	,__vertexBufferScaleY: null
	,__vertexBufferWidth: null
	,__worldAlpha: null
	,__worldColorTransform: null
	,__worldTransform: null
	,applyFilter: function(sourceBitmapData,sourceRect,destPoint,filter) {
		if(!this.readable || sourceBitmapData == null || !sourceBitmapData.readable) {
			return;
		}
		var needSecondBitmapData = filter.__needSecondBitmapData;
		var needCopyOfOriginal = filter.__preserveObject;
		var bitmapData2 = null;
		var bitmapData3 = null;
		if(needSecondBitmapData) {
			bitmapData2 = new openfl_display_BitmapData(this.width,this.height,true,0);
		} else {
			bitmapData2 = this;
		}
		if(needCopyOfOriginal) {
			bitmapData3 = new openfl_display_BitmapData(this.width,this.height,true,0);
		}
		if(filter.__preserveObject) {
			bitmapData3.copyPixels(this,this.rect,destPoint);
		}
		var lastBitmap = filter.__applyFilter(bitmapData2,this,sourceRect,destPoint);
		if(filter.__preserveObject) {
			lastBitmap.draw(bitmapData3,null,null);
		}
		if(needSecondBitmapData && lastBitmap == bitmapData2) {
			bitmapData2.image.version = this.image.version;
			this.image = bitmapData2.image;
		}
		this.image.dirty = true;
		this.image.version++;
	}
	,clone: function() {
		var bitmapData;
		if(!this.__isValid) {
			bitmapData = new openfl_display_BitmapData(this.width,this.height,this.transparent,0);
		} else if(!this.readable && this.image == null) {
			bitmapData = new openfl_display_BitmapData(0,0,this.transparent,0);
			bitmapData.width = this.width;
			bitmapData.height = this.height;
			bitmapData.__textureWidth = this.__textureWidth;
			bitmapData.__textureHeight = this.__textureHeight;
			bitmapData.rect.copyFrom(this.rect);
			bitmapData.__framebuffer = this.__framebuffer;
			bitmapData.__framebufferContext = this.__framebufferContext;
			bitmapData.__texture = this.__texture;
			bitmapData.__textureContext = this.__textureContext;
			bitmapData.__isValid = true;
		} else {
			bitmapData = openfl_display_BitmapData.fromImage(this.image.clone(),this.transparent);
		}
		bitmapData.__worldTransform.copyFrom(this.__worldTransform);
		bitmapData.__renderTransform.copyFrom(this.__renderTransform);
		return bitmapData;
	}
	,colorTransform: function(rect,colorTransform) {
		if(!this.readable) {
			return;
		}
		this.image.colorTransform(rect.__toLimeRectangle(),colorTransform.__toLimeColorMatrix());
	}
	,compare: function(otherBitmapData) {
		if(otherBitmapData == this) {
			return 0;
		} else if(otherBitmapData == null) {
			return -1;
		} else if(this.readable == false || otherBitmapData.readable == false) {
			return -2;
		} else if(this.width != otherBitmapData.width) {
			return -3;
		} else if(this.height != otherBitmapData.height) {
			return -4;
		}
		if(this.image != null && otherBitmapData.image != null && this.image.get_format() == otherBitmapData.image.get_format()) {
			var bytes = this.image.get_data();
			var otherBytes = otherBitmapData.image.get_data();
			var equal = true;
			var _g = 0;
			var _g1 = bytes.length;
			while(_g < _g1) {
				var i = _g++;
				if(bytes[i] != otherBytes[i]) {
					equal = false;
					break;
				}
			}
			if(equal) {
				return 0;
			}
		}
		var bitmapData = null;
		var foundDifference;
		var pixel;
		var otherPixel;
		var comparePixel;
		var r;
		var g;
		var b;
		var a;
		var _g = 0;
		var _g1 = this.height;
		while(_g < _g1) {
			var y = _g++;
			var _g2 = 0;
			var _g3 = this.width;
			while(_g2 < _g3) {
				var x = _g2++;
				foundDifference = false;
				pixel = this.getPixel32(x,y);
				otherPixel = otherBitmapData.getPixel32(x,y);
				comparePixel = 0;
				if(pixel != otherPixel) {
					r = (pixel >>> 16 & 255) - (otherPixel >>> 16 & 255);
					g = (pixel >>> 8 & 255) - (otherPixel >>> 8 & 255);
					b = (pixel & 255) - (otherPixel & 255);
					if(r < 0) {
						r *= -1;
					}
					if(g < 0) {
						g *= -1;
					}
					if(b < 0) {
						b *= -1;
					}
					if(r == 0 && g == 0 && b == 0) {
						a = (pixel >>> 24 & 255) - (otherPixel >>> 24 & 255);
						if(a != 0) {
							comparePixel = (comparePixel >>> 24 & 255 & 255) << 24 | 16711680 | (comparePixel >>> 8 & 255 & 255) << 8 | comparePixel & 255 & 255;
							comparePixel = (comparePixel >>> 24 & 255 & 255) << 24 | (comparePixel >>> 16 & 255 & 255) << 16 | 65280 | comparePixel & 255 & 255;
							comparePixel = (comparePixel >>> 24 & 255 & 255) << 24 | (comparePixel >>> 16 & 255 & 255) << 16 | (comparePixel >>> 8 & 255 & 255) << 8 | 255;
							comparePixel = (a & 255) << 24 | (comparePixel >>> 16 & 255 & 255) << 16 | (comparePixel >>> 8 & 255 & 255) << 8 | comparePixel & 255 & 255;
							foundDifference = true;
						}
					} else {
						comparePixel = (comparePixel >>> 24 & 255 & 255) << 24 | (r & 255) << 16 | (comparePixel >>> 8 & 255 & 255) << 8 | comparePixel & 255 & 255;
						comparePixel = (comparePixel >>> 24 & 255 & 255) << 24 | (comparePixel >>> 16 & 255 & 255) << 16 | (g & 255) << 8 | comparePixel & 255 & 255;
						comparePixel = (comparePixel >>> 24 & 255 & 255) << 24 | (comparePixel >>> 16 & 255 & 255) << 16 | (comparePixel >>> 8 & 255 & 255) << 8 | b & 255;
						comparePixel = -16777216 | (comparePixel >>> 16 & 255 & 255) << 16 | (comparePixel >>> 8 & 255 & 255) << 8 | comparePixel & 255 & 255;
						foundDifference = true;
					}
				}
				if(foundDifference) {
					if(bitmapData == null) {
						bitmapData = new openfl_display_BitmapData(this.width,this.height,this.transparent || otherBitmapData.transparent,0);
					}
					bitmapData.setPixel32(x,y,comparePixel);
				}
			}
		}
		if(bitmapData == null) {
			return 0;
		}
		return bitmapData;
	}
	,copyChannel: function(sourceBitmapData,sourceRect,destPoint,sourceChannel,destChannel) {
		if(!this.readable) {
			return;
		}
		var sourceChannel1;
		switch(sourceChannel) {
		case 1:
			sourceChannel1 = lime_graphics_ImageChannel.RED;
			break;
		case 2:
			sourceChannel1 = lime_graphics_ImageChannel.GREEN;
			break;
		case 4:
			sourceChannel1 = lime_graphics_ImageChannel.BLUE;
			break;
		case 8:
			sourceChannel1 = lime_graphics_ImageChannel.ALPHA;
			break;
		default:
			return;
		}
		var destChannel1;
		switch(destChannel) {
		case 1:
			destChannel1 = lime_graphics_ImageChannel.RED;
			break;
		case 2:
			destChannel1 = lime_graphics_ImageChannel.GREEN;
			break;
		case 4:
			destChannel1 = lime_graphics_ImageChannel.BLUE;
			break;
		case 8:
			destChannel1 = lime_graphics_ImageChannel.ALPHA;
			break;
		default:
			return;
		}
		this.image.copyChannel(sourceBitmapData.image,sourceRect.__toLimeRectangle(),destPoint.__toLimeVector2(),sourceChannel1,destChannel1);
	}
	,copyPixels: function(sourceBitmapData,sourceRect,destPoint,alphaBitmapData,alphaPoint,mergeAlpha) {
		if(mergeAlpha == null) {
			mergeAlpha = false;
		}
		if(!this.readable || sourceBitmapData == null) {
			return;
		}
		if(alphaPoint != null) {
			openfl_display_BitmapData.__tempVector.x = alphaPoint.x;
			openfl_display_BitmapData.__tempVector.y = alphaPoint.y;
		}
		this.image.copyPixels(sourceBitmapData.image,sourceRect.__toLimeRectangle(),destPoint.__toLimeVector2(),alphaBitmapData != null ? alphaBitmapData.image : null,alphaPoint != null ? openfl_display_BitmapData.__tempVector : null,mergeAlpha);
	}
	,dispose: function() {
		this.image = null;
		this.width = 0;
		this.height = 0;
		this.rect = null;
		this.__isValid = false;
		this.readable = false;
		this.__surface = null;
		this.__vertexBuffer = null;
		this.__framebuffer = null;
		this.__framebufferContext = null;
		this.__texture = null;
		this.__textureContext = null;
	}
	,disposeImage: function() {
		this.readable = false;
	}
	,draw: function(source,matrix,colorTransform,blendMode,clipRect,smoothing) {
		if(smoothing == null) {
			smoothing = false;
		}
		if(source == null) {
			return;
		}
		source.__update(false,true);
		var transform = openfl_geom_Matrix.__pool.get();
		transform.copyFrom(source.__renderTransform);
		transform.invert();
		if(matrix != null) {
			transform.concat(matrix);
		}
		var clipMatrix = null;
		if(clipRect != null) {
			clipMatrix = openfl_geom_Matrix.__pool.get();
			clipMatrix.copyFrom(transform);
			clipMatrix.invert();
		}
		var _colorTransform = new openfl_geom_ColorTransform();
		_colorTransform.__copyFrom(source.__worldColorTransform);
		_colorTransform.__invert();
		if(!this.readable && openfl_Lib.get_current().stage.context3D != null) {
			if(this.__textureContext == null) {
				this.__textureContext = lime_app_Application.current.__window.context;
			}
			if(colorTransform != null) {
				_colorTransform.__combine(colorTransform);
			}
			var renderer = new openfl_display_OpenGLRenderer(openfl_Lib.get_current().stage.context3D,this);
			renderer.__allowSmoothing = smoothing;
			renderer.__overrideBlendMode = blendMode;
			renderer.__worldTransform = transform;
			renderer.__worldAlpha = 1 / source.__worldAlpha;
			renderer.__worldColorTransform = _colorTransform;
			renderer.__resize(this.width,this.height);
			if(clipRect != null) {
				renderer.__pushMaskRect(clipRect,clipMatrix);
			}
			this.__drawGL(source,renderer);
			if(clipRect != null) {
				renderer.__popMaskRect();
				openfl_geom_Matrix.__pool.release(clipMatrix);
			}
		} else {
			if(colorTransform != null) {
				var bounds = openfl_geom_Rectangle.__pool.get();
				var boundsMatrix = openfl_geom_Matrix.__pool.get();
				source.__getBounds(bounds,boundsMatrix);
				var width = Math.ceil(bounds.width);
				var height = Math.ceil(bounds.height);
				boundsMatrix.tx = -bounds.x;
				boundsMatrix.ty = -bounds.y;
				var copy = new openfl_display_BitmapData(width,height,true,0);
				copy.draw(source,boundsMatrix);
				copy.colorTransform(copy.rect,colorTransform);
				copy.__renderTransform.identity();
				copy.__renderTransform.tx = bounds.x;
				copy.__renderTransform.ty = bounds.y;
				copy.__renderTransform.concat(source.__renderTransform);
				copy.__worldAlpha = source.__worldAlpha;
				copy.__worldColorTransform.__copyFrom(source.__worldColorTransform);
				source = copy;
				openfl_geom_Rectangle.__pool.release(bounds);
				openfl_geom_Matrix.__pool.release(boundsMatrix);
			}
			lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(this.image);
			var renderer = new openfl_display_CanvasRenderer(this.image.buffer.__srcContext);
			renderer.__allowSmoothing = smoothing;
			renderer.__overrideBlendMode = blendMode;
			renderer.__worldTransform = transform;
			renderer.__worldAlpha = 1 / source.__worldAlpha;
			renderer.__worldColorTransform = _colorTransform;
			if(clipRect != null) {
				renderer.__pushMaskRect(clipRect,clipMatrix);
			}
			this.__drawCanvas(source,renderer);
			if(clipRect != null) {
				renderer.__popMaskRect();
				openfl_geom_Matrix.__pool.release(clipMatrix);
			}
		}
		openfl_geom_Matrix.__pool.release(transform);
	}
	,drawWithQuality: function(source,matrix,colorTransform,blendMode,clipRect,smoothing,quality) {
		if(smoothing == null) {
			smoothing = false;
		}
		this.draw(source,matrix,colorTransform,blendMode,clipRect,quality != 2 && smoothing);
	}
	,encode: function(rect,compressor,byteArray) {
		if(!this.readable || rect == null) {
			byteArray = null;
			return byteArray;
		}
		if(byteArray == null) {
			var this1 = new openfl_utils_ByteArrayData(0);
			byteArray = this1;
		}
		var image = this.image;
		if(!rect.equals(this.rect)) {
			var matrix = openfl_geom_Matrix.__pool.get();
			matrix.tx = Math.round(-rect.x);
			matrix.ty = Math.round(-rect.y);
			var bitmapData = new openfl_display_BitmapData(Math.ceil(rect.width),Math.ceil(rect.height),true,0);
			bitmapData.draw(this,matrix);
			image = bitmapData.image;
			openfl_geom_Matrix.__pool.release(matrix);
		}
		if(((compressor) instanceof openfl_display_PNGEncoderOptions)) {
			byteArray.writeBytes(openfl_utils_ByteArray.fromBytes(image.encode(lime_graphics_ImageFileFormat.PNG)),0,0);
			return byteArray;
		} else if(((compressor) instanceof openfl_display_JPEGEncoderOptions)) {
			byteArray.writeBytes(openfl_utils_ByteArray.fromBytes(image.encode(lime_graphics_ImageFileFormat.JPEG,(js_Boot.__cast(compressor , openfl_display_JPEGEncoderOptions)).quality)),0,0);
			return byteArray;
		}
		byteArray = null;
		return byteArray;
	}
	,fillRect: function(rect,color) {
		this.__fillRect(rect,color,true);
	}
	,floodFill: function(x,y,color) {
		if(!this.readable) {
			return;
		}
		this.image.floodFill(x,y,color,1);
	}
	,generateFilterRect: function(sourceRect,filter) {
		return sourceRect.clone();
	}
	,getIndexBuffer: function(context,scale9Grid) {
		var gl = context.gl;
		if(this.__indexBuffer == null || this.__indexBufferContext != context.__context || scale9Grid != null && this.__indexBufferGrid == null || this.__indexBufferGrid != null && !this.__indexBufferGrid.equals(scale9Grid)) {
			this.__indexBufferContext = context.__context;
			this.__indexBuffer = null;
			if(scale9Grid != null) {
				if(this.__indexBufferGrid == null) {
					this.__indexBufferGrid = new openfl_geom_Rectangle();
				}
				this.__indexBufferGrid.copyFrom(scale9Grid);
				var centerX = scale9Grid.width;
				var centerY = scale9Grid.height;
				if(centerX != 0 && centerY != 0) {
					var array = null;
					var vector = null;
					var view = null;
					var buffer = null;
					var len = null;
					var this1 = new Uint16Array(54);
					this.__indexBufferData = this1;
					this.__indexBufferData[0] = 0;
					this.__indexBufferData[1] = 1;
					this.__indexBufferData[2] = 2;
					this.__indexBufferData[3] = 2;
					this.__indexBufferData[4] = 1;
					this.__indexBufferData[5] = 3;
					this.__indexBufferData[6] = 4;
					this.__indexBufferData[7] = 0;
					this.__indexBufferData[8] = 5;
					this.__indexBufferData[9] = 5;
					this.__indexBufferData[10] = 0;
					this.__indexBufferData[11] = 2;
					this.__indexBufferData[12] = 6;
					this.__indexBufferData[13] = 4;
					this.__indexBufferData[14] = 7;
					this.__indexBufferData[15] = 7;
					this.__indexBufferData[16] = 4;
					this.__indexBufferData[17] = 5;
					this.__indexBufferData[18] = 8;
					this.__indexBufferData[19] = 9;
					this.__indexBufferData[20] = 0;
					this.__indexBufferData[21] = 0;
					this.__indexBufferData[22] = 9;
					this.__indexBufferData[23] = 1;
					this.__indexBufferData[24] = 10;
					this.__indexBufferData[25] = 8;
					this.__indexBufferData[26] = 4;
					this.__indexBufferData[27] = 4;
					this.__indexBufferData[28] = 8;
					this.__indexBufferData[29] = 0;
					this.__indexBufferData[30] = 11;
					this.__indexBufferData[31] = 10;
					this.__indexBufferData[32] = 6;
					this.__indexBufferData[33] = 6;
					this.__indexBufferData[34] = 10;
					this.__indexBufferData[35] = 4;
					this.__indexBufferData[36] = 12;
					this.__indexBufferData[37] = 13;
					this.__indexBufferData[38] = 8;
					this.__indexBufferData[39] = 8;
					this.__indexBufferData[40] = 13;
					this.__indexBufferData[41] = 9;
					this.__indexBufferData[42] = 14;
					this.__indexBufferData[43] = 12;
					this.__indexBufferData[44] = 10;
					this.__indexBufferData[45] = 10;
					this.__indexBufferData[46] = 12;
					this.__indexBufferData[47] = 8;
					this.__indexBufferData[48] = 15;
					this.__indexBufferData[49] = 14;
					this.__indexBufferData[50] = 11;
					this.__indexBufferData[51] = 11;
					this.__indexBufferData[52] = 14;
					this.__indexBufferData[53] = 10;
					this.__indexBuffer = context.createIndexBuffer(54);
				} else if(centerX == 0 && centerY != 0) {
					var array = null;
					var vector = null;
					var view = null;
					var buffer = null;
					var len = null;
					var this1 = new Uint16Array(18);
					this.__indexBufferData = this1;
					this.__indexBufferData[0] = 0;
					this.__indexBufferData[1] = 1;
					this.__indexBufferData[2] = 2;
					this.__indexBufferData[3] = 2;
					this.__indexBufferData[4] = 1;
					this.__indexBufferData[5] = 3;
					this.__indexBufferData[6] = 4;
					this.__indexBufferData[7] = 5;
					this.__indexBufferData[8] = 0;
					this.__indexBufferData[9] = 0;
					this.__indexBufferData[10] = 5;
					this.__indexBufferData[11] = 1;
					this.__indexBufferData[12] = 6;
					this.__indexBufferData[13] = 7;
					this.__indexBufferData[14] = 4;
					this.__indexBufferData[15] = 4;
					this.__indexBufferData[16] = 7;
					this.__indexBufferData[17] = 5;
					this.__indexBuffer = context.createIndexBuffer(18);
				} else if(centerX != 0 && centerY == 0) {
					var array = null;
					var vector = null;
					var view = null;
					var buffer = null;
					var len = null;
					var this1 = new Uint16Array(18);
					this.__indexBufferData = this1;
					this.__indexBufferData[0] = 0;
					this.__indexBufferData[1] = 1;
					this.__indexBufferData[2] = 2;
					this.__indexBufferData[3] = 2;
					this.__indexBufferData[4] = 1;
					this.__indexBufferData[5] = 3;
					this.__indexBufferData[6] = 4;
					this.__indexBufferData[7] = 0;
					this.__indexBufferData[8] = 5;
					this.__indexBufferData[9] = 5;
					this.__indexBufferData[10] = 0;
					this.__indexBufferData[11] = 2;
					this.__indexBufferData[12] = 6;
					this.__indexBufferData[13] = 4;
					this.__indexBufferData[14] = 7;
					this.__indexBufferData[15] = 7;
					this.__indexBufferData[16] = 4;
					this.__indexBufferData[17] = 5;
					this.__indexBuffer = context.createIndexBuffer(18);
				}
			} else {
				this.__indexBufferGrid = null;
			}
			if(this.__indexBuffer == null) {
				var array = null;
				var vector = null;
				var view = null;
				var buffer = null;
				var len = null;
				var this1 = new Uint16Array(6);
				this.__indexBufferData = this1;
				this.__indexBufferData[0] = 0;
				this.__indexBufferData[1] = 1;
				this.__indexBufferData[2] = 2;
				this.__indexBufferData[3] = 2;
				this.__indexBufferData[4] = 1;
				this.__indexBufferData[5] = 3;
				this.__indexBuffer = context.createIndexBuffer(6);
			}
			this.__indexBuffer.uploadFromTypedArray(this.__indexBufferData);
		}
		return this.__indexBuffer;
	}
	,getVertexBuffer: function(context,scale9Grid,targetObject) {
		var gl = context.gl;
		if(this.__vertexBuffer == null || this.__vertexBufferContext != context.__context || scale9Grid != null && this.__vertexBufferGrid == null || this.__vertexBufferGrid != null && !this.__vertexBufferGrid.equals(scale9Grid) || targetObject != null && (this.__vertexBufferWidth != targetObject.get_width() || this.__vertexBufferHeight != targetObject.get_height() || this.__vertexBufferScaleX != targetObject.get_scaleX() || this.__vertexBufferScaleY != targetObject.get_scaleY())) {
			this.__uvRect = new openfl_geom_Rectangle(0,0,this.width,this.height);
			var uvWidth = 1;
			var uvHeight = 1;
			this.__vertexBufferContext = context.__context;
			this.__vertexBuffer = null;
			if(targetObject != null) {
				this.__vertexBufferWidth = targetObject.get_width();
				this.__vertexBufferHeight = targetObject.get_height();
				this.__vertexBufferScaleX = targetObject.get_scaleX();
				this.__vertexBufferScaleY = targetObject.get_scaleY();
			}
			if(scale9Grid != null && targetObject != null) {
				if(this.__vertexBufferGrid == null) {
					this.__vertexBufferGrid = new openfl_geom_Rectangle();
				}
				this.__vertexBufferGrid.copyFrom(scale9Grid);
				this.__vertexBufferWidth = targetObject.get_width();
				this.__vertexBufferHeight = targetObject.get_height();
				this.__vertexBufferScaleX = targetObject.get_scaleX();
				this.__vertexBufferScaleY = targetObject.get_scaleY();
				var centerX = scale9Grid.width;
				var centerY = scale9Grid.height;
				if(centerX != 0 && centerY != 0) {
					var array = null;
					var vector = null;
					var view = null;
					var buffer = null;
					var len = null;
					var this1 = new Float32Array(224);
					this.__vertexBufferData = this1;
					var left = scale9Grid.x;
					var top = scale9Grid.y;
					var right = this.width - centerX - left;
					var bottom = this.height - centerY - top;
					var uvLeft = left / this.width;
					var uvTop = top / this.height;
					var uvCenterX = centerX / this.width;
					var uvCenterY = centerY / this.height;
					var uvRight = right / this.width;
					var uvBottom = bottom / this.height;
					var renderedLeft = left / targetObject.get_scaleX();
					var renderedTop = top / targetObject.get_scaleY();
					var renderedRight = right / targetObject.get_scaleX();
					var renderedBottom = bottom / targetObject.get_scaleY();
					var renderedCenterX = targetObject.get_width() / targetObject.get_scaleX() - renderedLeft - renderedRight;
					var renderedCenterY = targetObject.get_height() / targetObject.get_scaleY() - renderedTop - renderedBottom;
					this.__vertexBufferData[0] = renderedLeft;
					this.__vertexBufferData[1] = renderedTop;
					this.__vertexBufferData[3] = uvWidth * uvLeft;
					this.__vertexBufferData[4] = uvHeight * uvTop;
					this.__vertexBufferData[15] = renderedTop;
					this.__vertexBufferData[18] = uvHeight * uvTop;
					this.__vertexBufferData[28] = renderedLeft;
					this.__vertexBufferData[31] = uvWidth * uvLeft;
					this.__vertexBufferData[56] = renderedLeft + renderedCenterX;
					this.__vertexBufferData[57] = renderedTop;
					this.__vertexBufferData[59] = uvWidth * (uvLeft + uvCenterX);
					this.__vertexBufferData[60] = uvHeight * uvTop;
					this.__vertexBufferData[70] = renderedLeft + renderedCenterX;
					this.__vertexBufferData[73] = uvWidth * (uvLeft + uvCenterX);
					this.__vertexBufferData[84] = this.width;
					this.__vertexBufferData[85] = renderedTop;
					this.__vertexBufferData[87] = uvWidth;
					this.__vertexBufferData[88] = uvHeight * uvTop;
					this.__vertexBufferData[98] = this.width;
					this.__vertexBufferData[101] = uvWidth;
					this.__vertexBufferData[112] = renderedLeft;
					this.__vertexBufferData[113] = renderedTop + renderedCenterY;
					this.__vertexBufferData[115] = uvWidth * uvLeft;
					this.__vertexBufferData[116] = uvHeight * (uvTop + uvCenterY);
					this.__vertexBufferData[127] = renderedTop + renderedCenterY;
					this.__vertexBufferData[130] = uvHeight * (uvTop + uvCenterY);
					this.__vertexBufferData[140] = renderedLeft + renderedCenterX;
					this.__vertexBufferData[141] = renderedTop + renderedCenterY;
					this.__vertexBufferData[143] = uvWidth * (uvLeft + uvCenterX);
					this.__vertexBufferData[144] = uvHeight * (uvTop + uvCenterY);
					this.__vertexBufferData[154] = this.width;
					this.__vertexBufferData[155] = renderedTop + renderedCenterY;
					this.__vertexBufferData[157] = uvWidth;
					this.__vertexBufferData[158] = uvHeight * (uvTop + uvCenterY);
					this.__vertexBufferData[168] = renderedLeft;
					this.__vertexBufferData[169] = this.height;
					this.__vertexBufferData[171] = uvWidth * uvLeft;
					this.__vertexBufferData[172] = uvHeight;
					this.__vertexBufferData[183] = this.height;
					this.__vertexBufferData[186] = uvHeight;
					this.__vertexBufferData[196] = renderedLeft + renderedCenterX;
					this.__vertexBufferData[197] = this.height;
					this.__vertexBufferData[199] = uvWidth * (uvLeft + uvCenterX);
					this.__vertexBufferData[200] = uvHeight;
					this.__vertexBufferData[210] = this.width;
					this.__vertexBufferData[211] = this.height;
					this.__vertexBufferData[213] = uvWidth;
					this.__vertexBufferData[214] = uvHeight;
					this.__vertexBuffer = context.createVertexBuffer(16,14);
				} else if(centerX == 0 && centerY != 0) {
					var array = null;
					var vector = null;
					var view = null;
					var buffer = null;
					var len = null;
					var this1 = new Float32Array(112);
					this.__vertexBufferData = this1;
					var top = scale9Grid.y;
					var bottom = this.height - centerY - top;
					var uvTop = top / this.height;
					var uvCenterY = centerY / this.height;
					var uvBottom = bottom / this.height;
					var renderedTop = top / targetObject.get_scaleY();
					var renderedBottom = bottom / targetObject.get_scaleY();
					var renderedCenterY = targetObject.get_height() / targetObject.get_scaleY() - renderedTop - renderedBottom;
					var renderedWidth = targetObject.get_width() / targetObject.get_scaleX();
					this.__vertexBufferData[0] = renderedWidth;
					this.__vertexBufferData[1] = renderedTop;
					this.__vertexBufferData[3] = uvWidth;
					this.__vertexBufferData[4] = uvHeight * uvTop;
					this.__vertexBufferData[15] = renderedTop;
					this.__vertexBufferData[18] = uvHeight * uvTop;
					this.__vertexBufferData[28] = renderedWidth;
					this.__vertexBufferData[31] = uvWidth;
					this.__vertexBufferData[56] = renderedWidth;
					this.__vertexBufferData[57] = renderedTop + renderedCenterY;
					this.__vertexBufferData[59] = uvWidth;
					this.__vertexBufferData[60] = uvHeight * (uvTop + uvCenterY);
					this.__vertexBufferData[71] = renderedTop + renderedCenterY;
					this.__vertexBufferData[74] = uvHeight * (uvTop + uvCenterY);
					this.__vertexBufferData[84] = renderedWidth;
					this.__vertexBufferData[85] = this.height;
					this.__vertexBufferData[87] = uvWidth;
					this.__vertexBufferData[88] = uvHeight;
					this.__vertexBufferData[99] = this.height;
					this.__vertexBufferData[102] = uvHeight;
					this.__vertexBuffer = context.createVertexBuffer(8,14);
				} else if(centerY == 0 && centerX != 0) {
					var array = null;
					var vector = null;
					var view = null;
					var buffer = null;
					var len = null;
					var this1 = new Float32Array(112);
					this.__vertexBufferData = this1;
					var left = scale9Grid.x;
					var right = this.width - centerX - left;
					var uvLeft = left / this.width;
					var uvCenterX = centerX / this.width;
					var uvRight = right / this.width;
					var renderedLeft = left / targetObject.get_scaleX();
					var renderedRight = right / targetObject.get_scaleX();
					var renderedCenterX = targetObject.get_width() / targetObject.get_scaleX() - renderedLeft - renderedRight;
					var renderedHeight = targetObject.get_height() / targetObject.get_scaleY();
					this.__vertexBufferData[0] = renderedLeft;
					this.__vertexBufferData[1] = renderedHeight;
					this.__vertexBufferData[3] = uvWidth * uvLeft;
					this.__vertexBufferData[4] = uvHeight;
					this.__vertexBufferData[15] = renderedHeight;
					this.__vertexBufferData[18] = uvHeight;
					this.__vertexBufferData[28] = renderedLeft;
					this.__vertexBufferData[31] = uvWidth * uvLeft;
					this.__vertexBufferData[56] = renderedLeft + renderedCenterX;
					this.__vertexBufferData[57] = renderedHeight;
					this.__vertexBufferData[59] = uvWidth * (uvLeft + uvCenterX);
					this.__vertexBufferData[60] = uvHeight;
					this.__vertexBufferData[70] = renderedLeft + renderedCenterX;
					this.__vertexBufferData[73] = uvWidth * (uvLeft + uvCenterX);
					this.__vertexBufferData[84] = this.width;
					this.__vertexBufferData[85] = renderedHeight;
					this.__vertexBufferData[87] = uvWidth;
					this.__vertexBufferData[88] = uvHeight;
					this.__vertexBufferData[98] = this.width;
					this.__vertexBufferData[101] = uvWidth;
					this.__vertexBuffer = context.createVertexBuffer(8,14);
				}
			} else {
				this.__vertexBufferGrid = null;
			}
			if(this.__vertexBuffer == null) {
				var array = null;
				var vector = null;
				var view = null;
				var buffer = null;
				var len = null;
				var this1 = new Float32Array(56);
				this.__vertexBufferData = this1;
				this.__vertexBufferData[0] = this.width;
				this.__vertexBufferData[1] = this.height;
				this.__vertexBufferData[3] = uvWidth;
				this.__vertexBufferData[4] = uvHeight;
				this.__vertexBufferData[15] = this.height;
				this.__vertexBufferData[18] = uvHeight;
				this.__vertexBufferData[28] = this.width;
				this.__vertexBufferData[31] = uvWidth;
				this.__vertexBuffer = context.createVertexBuffer(3,14);
			}
			this.__vertexBuffer.uploadFromTypedArray(lime_utils_Float32Array.toArrayBufferView(this.__vertexBufferData));
		}
		return this.__vertexBuffer;
	}
	,getColorBoundsRect: function(mask,color,findColor) {
		if(findColor == null) {
			findColor = true;
		}
		if(!this.readable) {
			return new openfl_geom_Rectangle(0,0,this.width,this.height);
		}
		if(!this.transparent || (mask >> 24 & 255) > 0) {
			var color1 = color;
			if((color1 >>> 24 & 255) == 0) {
				color1 = 0;
			}
		}
		var rect = this.image.getColorBoundsRect(mask,color,findColor,1);
		return new openfl_geom_Rectangle(rect.x,rect.y,rect.width,rect.height);
	}
	,getPixel: function(x,y) {
		if(!this.readable) {
			return 0;
		}
		return this.image.getPixel(x,y,1);
	}
	,getPixel32: function(x,y) {
		if(!this.readable) {
			return 0;
		}
		return this.image.getPixel32(x,y,1);
	}
	,getPixels: function(rect) {
		if(!this.readable) {
			return null;
		}
		if(rect == null) {
			rect = this.rect;
		}
		var byteArray = openfl_utils_ByteArray.fromBytes(this.image.getPixels(rect.__toLimeRectangle(),1));
		byteArray.__endian = 0;
		return byteArray;
	}
	,getSurface: function() {
		if(!this.readable) {
			return null;
		}
		if(this.__surface == null) {
			this.__surface = lime_graphics_cairo_CairoImageSurface.fromImage(this.image);
		}
		return this.__surface;
	}
	,getTexture: function(context) {
		if(!this.__isValid) {
			return null;
		}
		if(this.__texture == null || this.__textureContext != context.__context) {
			this.__textureContext = context.__context;
			this.__texture = context.createRectangleTexture(this.width,this.height,1,false);
			this.__textureVersion = -1;
		}
		lime__$internal_graphics_ImageCanvasUtil.sync(this.image,false);
		if(this.image != null && this.image.version > this.__textureVersion) {
			if(this.__surface != null) {
				lime_graphics_cairo_CairoSurface.flush(this.__surface);
			}
			var textureImage = this.image;
			if(!openfl_display3D_textures_TextureBase.__supportsBGRA && textureImage.get_format() != 0) {
				textureImage = textureImage.clone();
				textureImage.set_format(0);
			}
			this.__texture.__uploadFromImage(textureImage);
			this.__textureVersion = this.image.version;
			this.__textureWidth = textureImage.buffer.width;
			this.__textureHeight = textureImage.buffer.height;
		}
		if(!this.readable && this.image != null) {
			this.__surface = null;
			this.image = null;
		}
		return this.__texture;
	}
	,getVector: function(rect) {
		var pixels = this.getPixels(rect);
		var length = UInt.toFloat(openfl_utils_ByteArray.get_length(pixels)) / UInt.toFloat(4) | 0;
		var result = openfl_Vector.toIntVector(null,length,true);
		var _g = 0;
		var _g1 = length;
		while(_g < _g1) {
			var i = _g++;
			result.set(i,pixels.readUnsignedInt());
		}
		return result;
	}
	,histogram: function(hRect) {
		var rect = hRect != null ? hRect : new openfl_geom_Rectangle(0,0,this.width,this.height);
		var pixels = this.getPixels(rect);
		var _g = [];
		var _g1 = [];
		var _g2 = 0;
		while(_g2 < 256) {
			var j = _g2++;
			_g1.push(0);
		}
		_g.push(_g1);
		var _g1 = [];
		var _g2 = 0;
		while(_g2 < 256) {
			var j = _g2++;
			_g1.push(0);
		}
		_g.push(_g1);
		var _g1 = [];
		var _g2 = 0;
		while(_g2 < 256) {
			var j = _g2++;
			_g1.push(0);
		}
		_g.push(_g1);
		var _g1 = [];
		var _g2 = 0;
		while(_g2 < 256) {
			var j = _g2++;
			_g1.push(0);
		}
		_g.push(_g1);
		var result = _g;
		var _g = 0;
		var _g1 = openfl_utils_ByteArray.get_length(pixels);
		while(_g < _g1) {
			var i = _g++;
			var result1 = result[i % 4];
			++result1[pixels.readUnsignedByte()];
		}
		return result;
	}
	,hitTest: function(firstPoint,firstAlphaThreshold,secondObject,secondBitmapDataPoint,secondAlphaThreshold) {
		if(secondAlphaThreshold == null) {
			secondAlphaThreshold = 1;
		}
		if(!this.readable) {
			return false;
		}
		if(((secondObject) instanceof openfl_display_Bitmap)) {
			secondObject = (js_Boot.__cast(secondObject , openfl_display_Bitmap)).__bitmapData;
		}
		if(((secondObject) instanceof openfl_geom_Point)) {
			var secondPoint = secondObject;
			var x = secondPoint.x - firstPoint.x | 0;
			var y = secondPoint.y - firstPoint.y | 0;
			if(this.rect.contains(x,y)) {
				var pixel = this.getPixel32(x,y);
				if((pixel >> 24 & 255) > firstAlphaThreshold) {
					return true;
				}
			}
		} else if(((secondObject) instanceof openfl_display_BitmapData)) {
			var secondBitmapData = secondObject;
			var x;
			var y;
			if(secondBitmapDataPoint == null) {
				x = 0;
				y = 0;
			} else {
				x = Math.round(secondBitmapDataPoint.x - firstPoint.x);
				y = Math.round(secondBitmapDataPoint.y - firstPoint.y);
			}
			var hitRect = openfl_geom_Rectangle.__pool.get();
			hitRect.setTo(x,y,secondBitmapData.width,secondBitmapData.height);
			if(this.rect.intersects(hitRect)) {
				if(x < 0) {
					hitRect.x = 0;
					hitRect.width = Math.min(secondBitmapData.width + x,this.width);
				} else {
					hitRect.width = Math.min(secondBitmapData.width,this.width - x);
				}
				if(y < 0) {
					hitRect.y = 0;
					hitRect.height = Math.min(secondBitmapData.height + y,this.height);
				} else {
					hitRect.height = Math.min(secondBitmapData.height,this.height - y);
				}
				var pixels = this.getPixels(hitRect);
				hitRect.x = x < 0 ? -x : 0;
				hitRect.y = y < 0 ? -y : 0;
				var testPixels = secondBitmapData.getPixels(hitRect);
				var length = hitRect.width * hitRect.height | 0;
				var pixel;
				var testPixel;
				var _g = 0;
				var _g1 = length;
				while(_g < _g1) {
					var i = _g++;
					pixel = pixels.readUnsignedInt();
					testPixel = testPixels.readUnsignedInt();
					if(UInt.gt(pixel >>> 24 & 255,firstAlphaThreshold) && UInt.gt(testPixel >>> 24 & 255,secondAlphaThreshold)) {
						openfl_geom_Rectangle.__pool.release(hitRect);
						return true;
					}
				}
			}
			openfl_geom_Rectangle.__pool.release(hitRect);
		} else if(((secondObject) instanceof openfl_geom_Rectangle)) {
			var secondRectangle = openfl_geom_Rectangle.__pool.get();
			secondRectangle.copyFrom(secondObject);
			secondRectangle.offset(-firstPoint.x,-firstPoint.y);
			secondRectangle.__contract(0,0,this.width,this.height);
			if(secondRectangle.width > 0 && secondRectangle.height > 0) {
				var pixels = this.getPixels(secondRectangle);
				var length = UInt.toFloat(openfl_utils_ByteArray.get_length(pixels)) / UInt.toFloat(4) | 0;
				var pixel;
				var _g = 0;
				var _g1 = length;
				while(_g < _g1) {
					var i = _g++;
					pixel = pixels.readUnsignedInt();
					if(UInt.gt(pixel >>> 24 & 255,firstAlphaThreshold)) {
						openfl_geom_Rectangle.__pool.release(secondRectangle);
						return true;
					}
				}
			}
			openfl_geom_Rectangle.__pool.release(secondRectangle);
		}
		return false;
	}
	,lock: function() {
	}
	,merge: function(sourceBitmapData,sourceRect,destPoint,redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier) {
		if(!this.readable || sourceBitmapData == null || !sourceBitmapData.readable || sourceRect == null || destPoint == null) {
			return;
		}
		this.image.merge(sourceBitmapData.image,sourceRect.__toLimeRectangle(),destPoint.__toLimeVector2(),redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier);
	}
	,noise: function(randomSeed,low,high,channelOptions,grayScale) {
		if(grayScale == null) {
			grayScale = false;
		}
		if(channelOptions == null) {
			channelOptions = 7;
		}
		if(high == null) {
			high = 255;
		}
		if(low == null) {
			low = 0;
		}
		if(!this.readable) {
			return;
		}
		var func = function() {
			randomSeed = randomSeed * 1103515245 + 12345;
			return (Math.abs(randomSeed / 65536) | 0) % 32768;
		};
		var rand = func;
		rand();
		var range = high - low;
		var redChannel = (channelOptions & 1) == 1;
		var greenChannel = (channelOptions & 2) >> 1 == 1;
		var blueChannel = (channelOptions & 4) >> 2 == 1;
		var alphaChannel = (channelOptions & 8) >> 3 == 1;
		var _g = 0;
		var _g1 = this.height;
		while(_g < _g1) {
			var y = _g++;
			var _g2 = 0;
			var _g3 = this.width;
			while(_g2 < _g3) {
				var x = _g2++;
				var red = 0;
				var blue = 0;
				var green = 0;
				var alpha = 255;
				if(grayScale) {
					blue = low + rand() % range;
					green = blue;
					red = green;
					alpha = 255;
				} else {
					if(redChannel) {
						red = low + rand() % range;
					}
					if(greenChannel) {
						green = low + rand() % range;
					}
					if(blueChannel) {
						blue = low + rand() % range;
					}
					if(alphaChannel) {
						alpha = low + rand() % range;
					}
				}
				var rgb = alpha;
				rgb = (rgb << 8) + red;
				rgb = (rgb << 8) + green;
				rgb = (rgb << 8) + blue;
				this.setPixel32(x,y,rgb);
			}
		}
	}
	,paletteMap: function(sourceBitmapData,sourceRect,destPoint,redArray,greenArray,blueArray,alphaArray) {
		var sw = sourceRect.width | 0;
		var sh = sourceRect.height | 0;
		var pixels = sourceBitmapData.getPixels(sourceRect);
		var pixelValue;
		var r;
		var g;
		var b;
		var a;
		var color;
		var _g = 0;
		var _g1 = sh * sw;
		while(_g < _g1) {
			var i = _g++;
			pixelValue = pixels.readUnsignedInt();
			a = alphaArray == null ? pixelValue & -16777216 : alphaArray[pixelValue >> 24 & 255];
			r = redArray == null ? pixelValue & 16711680 : redArray[pixelValue >> 16 & 255];
			g = greenArray == null ? pixelValue & 65280 : greenArray[pixelValue >> 8 & 255];
			b = blueArray == null ? pixelValue & 255 : blueArray[pixelValue & 255];
			color = a + r + g + b;
			pixels.position = i * 4;
			pixels.writeUnsignedInt(color);
		}
		pixels.position = 0;
		var destRect = openfl_geom_Rectangle.__pool.get();
		destRect.setTo(destPoint.x,destPoint.y,sw,sh);
		this.setPixels(destRect,pixels);
		openfl_geom_Rectangle.__pool.release(destRect);
	}
	,perlinNoise: function(baseX,baseY,numOctaves,randomSeed,stitch,fractalNoise,channelOptions,grayScale,offsets) {
		if(grayScale == null) {
			grayScale = false;
		}
		if(channelOptions == null) {
			channelOptions = 7;
		}
		if(!this.readable) {
			return;
		}
		var noise = new openfl_display__$internal_PerlinNoise(randomSeed,numOctaves,channelOptions,grayScale,0.5,stitch,0.15);
		noise.fill(this,baseX,baseY,0);
	}
	,scroll: function(x,y) {
		if(!this.readable) {
			return;
		}
		this.image.scroll(x,y);
	}
	,setPixel: function(x,y,color) {
		if(!this.readable) {
			return;
		}
		this.image.setPixel(x,y,color,1);
	}
	,setPixel32: function(x,y,color) {
		if(!this.readable) {
			return;
		}
		this.image.setPixel32(x,y,color,1);
	}
	,setPixels: function(rect,byteArray) {
		if(!this.readable || rect == null) {
			return;
		}
		var length = rect.width * rect.height * 4;
		if(UInt.toFloat(byteArray.length - byteArray.position) < length) {
			throw haxe_Exception.thrown(new openfl_errors_Error("End of file was encountered.",2030));
		}
		this.image.setPixels(rect.__toLimeRectangle(),openfl_utils_ByteArray.toBytePointer(byteArray),1,openfl_utils_Endian.toLimeEndian(byteArray.__endian));
	}
	,setVector: function(rect,inputVector) {
		var this1 = new openfl_utils_ByteArrayData(0);
		var byteArray = this1;
		openfl_utils_ByteArray.set_length(byteArray,inputVector.get_length() * 4);
		var color = inputVector.iterator();
		while(color.hasNext()) {
			var color1 = color.next();
			byteArray.writeUnsignedInt(color1);
		}
		byteArray.position = 0;
		this.setPixels(rect,byteArray);
	}
	,threshold: function(sourceBitmapData,sourceRect,destPoint,operation,threshold,color,mask,copySource) {
		if(copySource == null) {
			copySource = false;
		}
		if(mask == null) {
			mask = -1;
		}
		if(color == null) {
			color = 0;
		}
		if(sourceBitmapData == null || sourceRect == null || destPoint == null || sourceRect.x > sourceBitmapData.width || sourceRect.y > sourceBitmapData.height || destPoint.x > this.width || destPoint.y > this.height) {
			return 0;
		}
		return this.image.threshold(sourceBitmapData.image,sourceRect.__toLimeRectangle(),destPoint.__toLimeVector2(),operation,threshold,color,mask,copySource,1);
	}
	,unlock: function(changeRect) {
	}
	,__applyAlpha: function(alpha) {
		lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(this.image);
		lime__$internal_graphics_ImageCanvasUtil.createImageData(this.image);
		var data = this.image.buffer.data;
		var _g = 0;
		var _g1 = openfl_utils_ByteArray.get_length(alpha);
		while(_g < _g1) {
			var i = _g++;
			data[i * 4 + 3] = alpha.readUnsignedByte();
		}
		this.image.version++;
	}
	,__drawCairo: function(source,renderer) {
	}
	,__drawCanvas: function(source,renderer) {
		var buffer = this.image.buffer;
		if(!renderer.__allowSmoothing) {
			renderer.applySmoothing(buffer.__srcContext,false);
		}
		renderer.__render(source);
		if(!renderer.__allowSmoothing) {
			renderer.applySmoothing(buffer.__srcContext,true);
		}
		buffer.__srcContext.setTransform(1,0,0,1,0,0);
		buffer.__srcImageData = null;
		buffer.data = null;
		this.image.dirty = true;
		this.image.version++;
	}
	,__drawGL: function(source,renderer) {
		var context = renderer.__context3D;
		var cacheRTT = context.__state.renderToTexture;
		var cacheRTTDepthStencil = context.__state.renderToTextureDepthStencil;
		var cacheRTTAntiAlias = context.__state.renderToTextureAntiAlias;
		var cacheRTTSurfaceSelector = context.__state.renderToTextureSurfaceSelector;
		context.setRenderToTexture(this.getTexture(context),true);
		renderer.__render(source);
		if(cacheRTT != null) {
			context.setRenderToTexture(cacheRTT,cacheRTTDepthStencil,cacheRTTAntiAlias,cacheRTTSurfaceSelector);
		} else {
			context.setRenderToBackBuffer();
		}
	}
	,__fillRect: function(rect,color,allowFramebuffer) {
		if(rect == null) {
			return;
		}
		if(this.transparent && (color & -16777216) == 0) {
			color = 0;
		}
		if(allowFramebuffer && this.__texture != null && this.__texture.__glFramebuffer != null && openfl_Lib.get_current().stage.__renderer.__type == "opengl") {
			var renderer = openfl_Lib.get_current().stage.__renderer;
			var context = renderer.__context3D;
			var color1 = color;
			var useScissor = !this.rect.equals(rect);
			var cacheRTT = context.__state.renderToTexture;
			var cacheRTTDepthStencil = context.__state.renderToTextureDepthStencil;
			var cacheRTTAntiAlias = context.__state.renderToTextureAntiAlias;
			var cacheRTTSurfaceSelector = context.__state.renderToTextureSurfaceSelector;
			context.setRenderToTexture(this.__texture);
			if(useScissor) {
				context.setScissorRectangle(rect);
			}
			context.clear((color1 >>> 16 & 255) / 255,(color1 >>> 8 & 255) / 255,(color1 & 255) / 255,this.transparent ? (color1 >>> 24 & 255) / 255 : 1,0,0,1);
			if(useScissor) {
				context.setScissorRectangle(null);
			}
			if(cacheRTT != null) {
				context.setRenderToTexture(cacheRTT,cacheRTTDepthStencil,cacheRTTAntiAlias,cacheRTTSurfaceSelector);
			} else {
				context.setRenderToBackBuffer();
			}
		} else if(this.readable) {
			this.image.fillRect(rect.__toLimeRectangle(),color,1);
		}
	}
	,__fromBase64: function(base64,type) {
		var image = lime_graphics_Image.fromBase64(base64,type);
		this.__fromImage(image);
	}
	,__fromBytes: function(bytes,rawAlpha) {
		var image = lime_graphics_Image.fromBytes(openfl_utils_ByteArray.toBytes(bytes));
		this.__fromImage(image);
		if(rawAlpha != null) {
			this.__applyAlpha(rawAlpha);
		}
	}
	,__fromFile: function(path) {
		var image = lime_graphics_Image.fromFile(path);
		this.__fromImage(image);
	}
	,__fromImage: function(image) {
		if(image != null && image.buffer != null) {
			this.image = image;
			this.width = image.width;
			this.height = image.height;
			this.rect = new openfl_geom_Rectangle(0,0,image.width,image.height);
			this.__textureWidth = this.width;
			this.__textureHeight = this.height;
			this.readable = true;
			this.__isValid = true;
		}
	}
	,__getBounds: function(rect,matrix) {
		var bounds = openfl_geom_Rectangle.__pool.get();
		this.rect.__transform(bounds,matrix);
		rect.__expand(bounds.x,bounds.y,bounds.width,bounds.height);
		openfl_geom_Rectangle.__pool.release(bounds);
	}
	,__loadFromBase64: function(base64,type) {
		var _gthis = this;
		return lime_graphics_Image.loadFromBase64(base64,type).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		});
	}
	,__loadFromBytes: function(bytes,rawAlpha) {
		var _gthis = this;
		return lime_graphics_Image.loadFromBytes(openfl_utils_ByteArray.toBytes(bytes)).then(function(image) {
			_gthis.__fromImage(image);
			if(rawAlpha != null) {
				_gthis.__applyAlpha(rawAlpha);
			}
			return lime_app_Future.withValue(_gthis);
		});
	}
	,__loadFromFile: function(path) {
		var _gthis = this;
		return lime_graphics_Image.loadFromFile(path).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		});
	}
	,__renderCairo: function(renderer) {
	}
	,__renderCairoMask: function(renderer) {
	}
	,__renderCanvas: function(renderer) {
		if(!this.readable) {
			return;
		}
		if(this.image.type == lime_graphics_ImageType.DATA) {
			lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(this.image);
		}
		var context = renderer.context;
		context.globalAlpha = 1;
		renderer.setTransform(this.__renderTransform,context);
		context.drawImage(this.image.get_src(),0,0,this.image.width,this.image.height);
	}
	,__renderCanvasMask: function(renderer) {
	}
	,__renderDOM: function(renderer) {
	}
	,__renderGL: function(renderer) {
		var context = renderer.__context3D;
		var gl = context.gl;
		renderer.__setBlendMode(10);
		var shader = renderer.__defaultDisplayShader;
		renderer.setShader(shader);
		renderer.applyBitmapData(this,renderer.__upscaled);
		renderer.applyMatrix(renderer.__getMatrix(this.__worldTransform,1));
		renderer.applyAlpha(this.__worldAlpha);
		renderer.applyColorTransform(this.__worldColorTransform);
		renderer.updateShader();
		var vertexBuffer = this.getVertexBuffer(context);
		if(shader.__position != null) {
			context.setVertexBufferAt(shader.__position.index,vertexBuffer,0,3);
		}
		if(shader.__textureCoord != null) {
			context.setVertexBufferAt(shader.__textureCoord.index,vertexBuffer,3,2);
		}
		var indexBuffer = this.getIndexBuffer(context);
		context.drawTriangles(indexBuffer);
		renderer.__clearShader();
	}
	,__renderGLMask: function(renderer) {
		var context = renderer.__context3D;
		var gl = context.gl;
		var shader = renderer.__maskShader;
		renderer.setShader(shader);
		renderer.applyBitmapData(this,renderer.__upscaled);
		renderer.applyMatrix(renderer.__getMatrix(this.__worldTransform,1));
		renderer.updateShader();
		var vertexBuffer = this.getVertexBuffer(context);
		if(shader.__position != null) {
			context.setVertexBufferAt(shader.__position.index,vertexBuffer,0,3);
		}
		if(shader.__textureCoord != null) {
			context.setVertexBufferAt(shader.__textureCoord.index,vertexBuffer,3,2);
		}
		var indexBuffer = this.getIndexBuffer(context);
		context.drawTriangles(indexBuffer);
		renderer.__clearShader();
	}
	,__resize: function(width,height) {
		this.width = width;
		this.height = height;
		this.rect.width = width;
		this.rect.height = height;
		this.__textureWidth = width;
		this.__textureHeight = height;
	}
	,__setUVRect: function(context,x,y,width,height) {
		var buffer = this.getVertexBuffer(context);
		if(buffer != null && (width != this.__uvRect.width || height != this.__uvRect.height || x != this.__uvRect.x || y != this.__uvRect.y)) {
			var gl = context.gl;
			if(this.__uvRect == null) {
				this.__uvRect = new openfl_geom_Rectangle();
			}
			this.__uvRect.setTo(x,y,width,height);
			var uvX = this.__textureWidth > 0 ? x / this.__textureWidth : 0;
			var uvY = this.__textureHeight > 0 ? y / this.__textureHeight : 0;
			var uvWidth = this.__textureWidth > 0 ? width / this.__textureWidth : 0;
			var uvHeight = this.__textureHeight > 0 ? height / this.__textureHeight : 0;
			this.__vertexBufferData[0] = width;
			this.__vertexBufferData[1] = height;
			this.__vertexBufferData[3] = uvX + uvWidth;
			this.__vertexBufferData[4] = uvY + uvHeight;
			this.__vertexBufferData[15] = height;
			this.__vertexBufferData[17] = uvX;
			this.__vertexBufferData[18] = uvY + uvHeight;
			this.__vertexBufferData[28] = width;
			this.__vertexBufferData[31] = uvX + uvWidth;
			this.__vertexBufferData[32] = uvY;
			this.__vertexBufferData[45] = uvX;
			this.__vertexBufferData[46] = uvY;
			this.__vertexBuffer.uploadFromTypedArray(lime_utils_Float32Array.toArrayBufferView(this.__vertexBufferData));
		}
	}
	,__sync: function() {
		lime__$internal_graphics_ImageCanvasUtil.sync(this.image,false);
	}
	,__update: function(transformOnly,updateChildren) {
		this.__updateTransforms();
	}
	,__updateTransforms: function(overrideTransform) {
		if(overrideTransform == null) {
			this.__worldTransform.identity();
		} else {
			this.__worldTransform.copyFrom(overrideTransform);
		}
		this.__renderTransform.copyFrom(this.__worldTransform);
	}
	,__class__: openfl_display_BitmapData
};
var flixel_addons_transition_GraphicTransTileCircle = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_addons_transition_GraphicTransTileCircle.preload != null) {
		this.__fromImage(flixel_addons_transition_GraphicTransTileCircle.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_addons_transition_GraphicTransTileCircle.resourceName),flixel_addons_transition_GraphicTransTileCircle.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_addons_transition_GraphicTransTileCircle.preload == null) {
				flixel_addons_transition_GraphicTransTileCircle.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.addons.transition.GraphicTransTileCircle"] = flixel_addons_transition_GraphicTransTileCircle;
flixel_addons_transition_GraphicTransTileCircle.__name__ = "flixel.addons.transition.GraphicTransTileCircle";
flixel_addons_transition_GraphicTransTileCircle.preload = null;
flixel_addons_transition_GraphicTransTileCircle.__super__ = openfl_display_BitmapData;
flixel_addons_transition_GraphicTransTileCircle.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_addons_transition_GraphicTransTileCircle
});
var flixel_addons_transition_GraphicTransTileDiamond = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_addons_transition_GraphicTransTileDiamond.preload != null) {
		this.__fromImage(flixel_addons_transition_GraphicTransTileDiamond.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_addons_transition_GraphicTransTileDiamond.resourceName),flixel_addons_transition_GraphicTransTileDiamond.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_addons_transition_GraphicTransTileDiamond.preload == null) {
				flixel_addons_transition_GraphicTransTileDiamond.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.addons.transition.GraphicTransTileDiamond"] = flixel_addons_transition_GraphicTransTileDiamond;
flixel_addons_transition_GraphicTransTileDiamond.__name__ = "flixel.addons.transition.GraphicTransTileDiamond";
flixel_addons_transition_GraphicTransTileDiamond.preload = null;
flixel_addons_transition_GraphicTransTileDiamond.__super__ = openfl_display_BitmapData;
flixel_addons_transition_GraphicTransTileDiamond.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_addons_transition_GraphicTransTileDiamond
});
var flixel_addons_transition_GraphicTransTileSquare = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_addons_transition_GraphicTransTileSquare.preload != null) {
		this.__fromImage(flixel_addons_transition_GraphicTransTileSquare.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_addons_transition_GraphicTransTileSquare.resourceName),flixel_addons_transition_GraphicTransTileSquare.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_addons_transition_GraphicTransTileSquare.preload == null) {
				flixel_addons_transition_GraphicTransTileSquare.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.addons.transition.GraphicTransTileSquare"] = flixel_addons_transition_GraphicTransTileSquare;
flixel_addons_transition_GraphicTransTileSquare.__name__ = "flixel.addons.transition.GraphicTransTileSquare";
flixel_addons_transition_GraphicTransTileSquare.preload = null;
flixel_addons_transition_GraphicTransTileSquare.__super__ = openfl_display_BitmapData;
flixel_addons_transition_GraphicTransTileSquare.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_addons_transition_GraphicTransTileSquare
});
var flixel_addons_transition_FlxTransitionSprite = function(X,Y,Delay,Graphic,GraphicWidth,GraphicHeight,FrameRate) {
	if(FrameRate == null) {
		FrameRate = 40;
	}
	if(GraphicHeight == null) {
		GraphicHeight = 32;
	}
	if(GraphicWidth == null) {
		GraphicWidth = 32;
	}
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	this._newStatus = -1;
	this.status = 0;
	this._finished = false;
	this._starting = true;
	flixel_FlxSprite.call(this,X,Y);
	if(Graphic == null) {
		Graphic = flixel_graphics_FlxGraphic.fromClass(flixel_addons_transition_GraphicTransTileDiamond);
		GraphicWidth = 32;
		GraphicHeight = 32;
	}
	this._delay = Delay;
	this.loadGraphic(Graphic,true,GraphicWidth,GraphicHeight);
	this.graphic.persist = true;
	this.graphic.set_destroyOnNoUse(false);
	var inArray = [];
	var outArray = [];
	var _g = 1;
	var _g1 = this.numFrames - 1;
	while(_g < _g1) {
		var i = _g++;
		inArray.push(i);
	}
	outArray = inArray.slice();
	outArray.reverse();
	this.animation.add("empty",[0],0,false);
	this.animation.add("in",inArray,FrameRate,false);
	this.animation.add("full",[this.numFrames - 1],0,false);
	this.animation.add("out",outArray,FrameRate,false);
	this.setStatus(3);
};
$hxClasses["flixel.addons.transition.FlxTransitionSprite"] = flixel_addons_transition_FlxTransitionSprite;
flixel_addons_transition_FlxTransitionSprite.__name__ = "flixel.addons.transition.FlxTransitionSprite";
flixel_addons_transition_FlxTransitionSprite.__super__ = flixel_FlxSprite;
flixel_addons_transition_FlxTransitionSprite.prototype = $extend(flixel_FlxSprite.prototype,{
	_delay: null
	,_count: null
	,_starting: null
	,_finished: null
	,status: null
	,_newStatus: null
	,start: function(NewStatus) {
		this._starting = true;
		this._finished = false;
		this._count = 0;
		this._newStatus = NewStatus;
	}
	,startStatus: function(NewStatus) {
		this.setStatus(NewStatus);
	}
	,setStatus: function(Status) {
		var anim;
		switch(Status) {
		case -1:case 2:
			anim = "empty";
			break;
		case 0:
			anim = "in";
			break;
		case 1:
			anim = "out";
			break;
		case 3:
			anim = "full";
			break;
		}
		this.animation.play(anim);
		this.animation.finishCallback = $bind(this,this.onFinishAnim);
		this.status = Status;
	}
	,onFinishAnim: function(str) {
		if(!this._finished) {
			this._finished = true;
			switch(this.status) {
			case 0:
				this.setStatus(3);
				break;
			case 1:
				this.setStatus(2);
				break;
			default:
			}
		}
	}
	,update: function(elapsed) {
		flixel_FlxSprite.prototype.update.call(this,elapsed);
		if(this._starting) {
			this._count += elapsed;
			if(this._count >= this._delay) {
				this.onTime();
			}
		}
	}
	,onTime: function() {
		this._starting = false;
		this._count = 0;
		this.setStatus(this._newStatus);
		this._newStatus = -1;
	}
	,__class__: flixel_addons_transition_FlxTransitionSprite
});
var flixel_addons_transition_Transition = function(data) {
	flixel_FlxSubState.call(this,0);
	this._effect = this.createEffect(data);
	this._effect.scrollFactor.set(0,0);
	this.add(this._effect);
};
$hxClasses["flixel.addons.transition.Transition"] = flixel_addons_transition_Transition;
flixel_addons_transition_Transition.__name__ = "flixel.addons.transition.Transition";
flixel_addons_transition_Transition.__super__ = flixel_FlxSubState;
flixel_addons_transition_Transition.prototype = $extend(flixel_FlxSubState.prototype,{
	_effect: null
	,update: function(elapsed) {
		flixel_FlxSubState.prototype.update.call(this,elapsed);
		this._effect.update(elapsed);
	}
	,destroy: function() {
		flixel_FlxSubState.prototype.destroy.call(this);
		this.set_finishCallback(null);
		this._effect.destroy();
		this._effect = null;
	}
	,start: function(NewStatus) {
		this._effect.start(NewStatus);
	}
	,setStatus: function(NewStatus) {
		this._effect.setStatus(NewStatus);
	}
	,createEffect: function(Data) {
		switch(Data.type) {
		case "fade":
			return new flixel_addons_transition_TransitionFade(Data);
		case "tiles":
			return new flixel_addons_transition_TransitionTiles(Data);
		default:
			return null;
		}
	}
	,get_finishCallback: function() {
		if(this._effect != null) {
			return this._effect.finishCallback;
		}
		return null;
	}
	,set_finishCallback: function(f) {
		if(this._effect != null) {
			this._effect.finishCallback = f;
			return f;
		}
		return null;
	}
	,__class__: flixel_addons_transition_Transition
	,__properties__: $extend(flixel_FlxSubState.prototype.__properties__,{set_finishCallback:"set_finishCallback",get_finishCallback:"get_finishCallback"})
});
var flixel_addons_transition_TransitionData = function(TransType,Color,Duration,Direction,TileData,Region) {
	if(Duration == null) {
		Duration = 1.0;
	}
	if(Color == null) {
		Color = -1;
	}
	if(TransType == null) {
		TransType = "fade";
	}
	this.duration = 1.0;
	this.type = TransType;
	this.tileData = TileData;
	this.duration = Duration;
	this.color = Color;
	this.direction = Direction;
	if(this.direction == null) {
		this.direction = new flixel_math_FlxPoint(0,0);
	}
	var Value = this.direction.x;
	var lowerBound = Value < -1 ? -1 : Value;
	var tmp = lowerBound > 1;
	var Value = this.direction.y;
	var lowerBound = Value < -1 ? -1 : Value;
	var tmp = lowerBound > 1;
	this.tweenOptions = { onComplete : null};
	this.region = Region;
	if(Region == null) {
		this.region = new flixel_math_FlxRect(0,0,flixel_FlxG.width,flixel_FlxG.height);
	}
};
$hxClasses["flixel.addons.transition.TransitionData"] = flixel_addons_transition_TransitionData;
flixel_addons_transition_TransitionData.__name__ = "flixel.addons.transition.TransitionData";
flixel_addons_transition_TransitionData.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_addons_transition_TransitionData.prototype = {
	type: null
	,tileData: null
	,color: null
	,duration: null
	,direction: null
	,tweenOptions: null
	,region: null
	,destroy: function() {
		this.tileData = null;
		this.direction = null;
		this.tweenOptions.onComplete = null;
		this.tweenOptions.ease = null;
		this.tweenOptions = null;
		this.region = null;
		this.direction = null;
	}
	,__class__: flixel_addons_transition_TransitionData
};
var flixel_group_FlxTypedSpriteGroup = function(X,Y,MaxSize) {
	if(MaxSize == null) {
		MaxSize = 0;
	}
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	this._skipTransformChildren = false;
	this.directAlpha = false;
	flixel_FlxSprite.call(this,X,Y);
	this.group = new flixel_group_FlxTypedGroup(MaxSize);
	this._sprites = this.group.members;
};
$hxClasses["flixel.group.FlxTypedSpriteGroup"] = flixel_group_FlxTypedSpriteGroup;
flixel_group_FlxTypedSpriteGroup.__name__ = "flixel.group.FlxTypedSpriteGroup";
flixel_group_FlxTypedSpriteGroup.__super__ = flixel_FlxSprite;
flixel_group_FlxTypedSpriteGroup.prototype = $extend(flixel_FlxSprite.prototype,{
	transformChildren_flixel_math_FlxRect: function(Function1,Value) {
		if(this.group == null) {
			return;
		}
		var _g = 0;
		var _g1 = this._sprites;
		while(_g < _g1.length) {
			var sprite = _g1[_g];
			++_g;
			if(sprite != null) {
				Function1(sprite,Value);
			}
		}
	}
	,transformChildren_flash_display_BlendMode: function(Function1,Value) {
		if(this.group == null) {
			return;
		}
		var _g = 0;
		var _g1 = this._sprites;
		while(_g < _g1.length) {
			var sprite = _g1[_g];
			++_g;
			if(sprite != null) {
				Function1(sprite,Value);
			}
		}
	}
	,transformChildren_Int: function(Function1,Value) {
		if(this.group == null) {
			return;
		}
		var _g = 0;
		var _g1 = this._sprites;
		while(_g < _g1.length) {
			var sprite = _g1[_g];
			++_g;
			if(sprite != null) {
				Function1(sprite,Value);
			}
		}
	}
	,transformChildren_Float: function(Function1,Value) {
		if(this.group == null) {
			return;
		}
		var _g = 0;
		var _g1 = this._sprites;
		while(_g < _g1.length) {
			var sprite = _g1[_g];
			++_g;
			if(sprite != null) {
				Function1(sprite,Value);
			}
		}
	}
	,transformChildren_Bool: function(Function1,Value) {
		if(this.group == null) {
			return;
		}
		var _g = 0;
		var _g1 = this._sprites;
		while(_g < _g1.length) {
			var sprite = _g1[_g];
			++_g;
			if(sprite != null) {
				Function1(sprite,Value);
			}
		}
	}
	,transformChildren_Array_flixel_FlxCamera: function(Function1,Value) {
		if(this.group == null) {
			return;
		}
		var _g = 0;
		var _g1 = this._sprites;
		while(_g < _g1.length) {
			var sprite = _g1[_g];
			++_g;
			if(sprite != null) {
				Function1(sprite,Value);
			}
		}
	}
	,transformChildren_flixel_FlxCamera: function(Function1,Value) {
		if(this.group == null) {
			return;
		}
		var _g = 0;
		var _g1 = this._sprites;
		while(_g < _g1.length) {
			var sprite = _g1[_g];
			++_g;
			if(sprite != null) {
				Function1(sprite,Value);
			}
		}
	}
	,multiTransformChildren_Float: function(FunctionArray,ValueArray) {
		if(this.group == null) {
			return;
		}
		var numProps = FunctionArray.length;
		if(numProps > ValueArray.length) {
			return;
		}
		var lambda;
		var _g = 0;
		var _g1 = this._sprites;
		while(_g < _g1.length) {
			var sprite = _g1[_g];
			++_g;
			if(sprite != null && sprite.exists) {
				var _g2 = 0;
				var _g3 = numProps;
				while(_g2 < _g3) {
					var i = _g2++;
					lambda = FunctionArray[i];
					lambda(sprite,ValueArray[i]);
				}
			}
		}
	}
	,transformChildren_flixel_math_FlxPoint: function(Function1,Value) {
		if(this.group == null) {
			return;
		}
		var _g = 0;
		var _g1 = this._sprites;
		while(_g < _g1.length) {
			var sprite = _g1[_g];
			++_g;
			if(sprite != null) {
				Function1(sprite,Value);
			}
		}
	}
	,group: null
	,directAlpha: null
	,_skipTransformChildren: null
	,_sprites: null
	,initVars: function() {
		this.flixelType = 4;
		this.offset = new flixel_math_FlxCallbackPoint($bind(this,this.offsetCallback));
		this.origin = new flixel_math_FlxCallbackPoint($bind(this,this.originCallback));
		this.scale = new flixel_math_FlxCallbackPoint($bind(this,this.scaleCallback));
		this.scrollFactor = new flixel_math_FlxCallbackPoint($bind(this,this.scrollFactorCallback));
		this.scale.set(1,1);
		this.scrollFactor.set(1,1);
		var point = flixel_math_FlxPoint._pool.get().set(0,0);
		point._inPool = false;
		this.velocity = point;
		var point = flixel_math_FlxPoint._pool.get().set(0,0);
		point._inPool = false;
		this.acceleration = point;
		var point = flixel_math_FlxPoint._pool.get().set(0,0);
		point._inPool = false;
		this.drag = point;
		var X = 10000;
		var Y = 10000;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		this.maxVelocity = point;
	}
	,destroy: function() {
		this.offset = flixel_util_FlxDestroyUtil.destroy(this.offset);
		this.origin = flixel_util_FlxDestroyUtil.destroy(this.origin);
		this.scale = flixel_util_FlxDestroyUtil.destroy(this.scale);
		this.scrollFactor = flixel_util_FlxDestroyUtil.destroy(this.scrollFactor);
		this.group = flixel_util_FlxDestroyUtil.destroy(this.group);
		this._sprites = null;
		flixel_FlxSprite.prototype.destroy.call(this);
	}
	,clone: function() {
		var newGroup = new flixel_group_FlxTypedSpriteGroup(this.x,this.y,this.group.maxSize);
		var _g = 0;
		var _g1 = this.group.members;
		while(_g < _g1.length) {
			var sprite = _g1[_g];
			++_g;
			if(sprite != null) {
				newGroup.add(sprite.clone());
			}
		}
		return newGroup;
	}
	,isOnScreen: function(Camera) {
		var _g = 0;
		var _g1 = this._sprites;
		while(_g < _g1.length) {
			var sprite = _g1[_g];
			++_g;
			if(sprite != null && sprite.exists && sprite.visible && sprite.isOnScreen(Camera)) {
				return true;
			}
		}
		return false;
	}
	,overlapsPoint: function(point,InScreenSpace,Camera) {
		if(InScreenSpace == null) {
			InScreenSpace = false;
		}
		var result = false;
		var _g = 0;
		var _g1 = this._sprites;
		while(_g < _g1.length) {
			var sprite = _g1[_g];
			++_g;
			if(sprite != null && sprite.exists && sprite.visible) {
				result = result || sprite.overlapsPoint(point,InScreenSpace,Camera);
			}
		}
		return result;
	}
	,pixelsOverlapPoint: function(point,Mask,Camera) {
		if(Mask == null) {
			Mask = 255;
		}
		var result = false;
		var _g = 0;
		var _g1 = this._sprites;
		while(_g < _g1.length) {
			var sprite = _g1[_g];
			++_g;
			if(sprite != null && sprite.exists && sprite.visible) {
				result = result || sprite.pixelsOverlapPoint(point,Mask,Camera);
			}
		}
		return result;
	}
	,update: function(elapsed) {
		this.group.update(elapsed);
		if(this.moves) {
			this.updateMotion(elapsed);
		}
	}
	,draw: function() {
		this.group.draw();
	}
	,replaceColor: function(Color,NewColor,FetchPositions) {
		if(FetchPositions == null) {
			FetchPositions = false;
		}
		var positions = null;
		if(FetchPositions) {
			positions = [];
		}
		var spritePositions;
		var _g = 0;
		var _g1 = this._sprites;
		while(_g < _g1.length) {
			var sprite = _g1[_g];
			++_g;
			if(sprite != null) {
				spritePositions = sprite.replaceColor(Color,NewColor,FetchPositions);
				if(FetchPositions) {
					positions = positions.concat(spritePositions);
				}
			}
		}
		return positions;
	}
	,add: function(Sprite) {
		this.preAdd(Sprite);
		return this.group.add(Sprite);
	}
	,insert: function(Position,Sprite) {
		this.preAdd(Sprite);
		return this.group.insert(Position,Sprite);
	}
	,preAdd: function(Sprite) {
		var sprite = Sprite;
		var _g = sprite;
		_g.set_x(_g.x + this.x);
		var _g = sprite;
		_g.set_y(_g.y + this.y);
		var _g = sprite;
		_g.set_alpha(_g.alpha * this.alpha);
		var _this = sprite.scrollFactor;
		var point = this.scrollFactor;
		_this.set_x(point.x);
		_this.set_y(point.y);
		if(point._weak) {
			point.put();
		}
		sprite.set_cameras(this._cameras);
		if(this.clipRect != null) {
			var ClipRect = this.clipRect;
			if(ClipRect == null) {
				sprite.set_clipRect(null);
			} else {
				var X = ClipRect.x - sprite.x + this.x;
				var Y = ClipRect.y - sprite.y + this.y;
				var Width = ClipRect.width;
				var Height = ClipRect.height;
				if(Height == null) {
					Height = 0;
				}
				if(Width == null) {
					Width = 0;
				}
				if(Y == null) {
					Y = 0;
				}
				if(X == null) {
					X = 0;
				}
				var _this = flixel_math_FlxRect._pool.get();
				var X1 = X;
				var Y1 = Y;
				var Width1 = Width;
				var Height1 = Height;
				if(Height1 == null) {
					Height1 = 0;
				}
				if(Width1 == null) {
					Width1 = 0;
				}
				if(Y1 == null) {
					Y1 = 0;
				}
				if(X1 == null) {
					X1 = 0;
				}
				_this.x = X1;
				_this.y = Y1;
				_this.width = Width1;
				_this.height = Height1;
				var rect = _this;
				rect._inPool = false;
				sprite.set_clipRect(rect);
			}
		}
	}
	,recycle: function(ObjectClass,ObjectFactory,Force,Revive) {
		if(Revive == null) {
			Revive = true;
		}
		if(Force == null) {
			Force = false;
		}
		return this.group.recycle(ObjectClass,ObjectFactory,Force,Revive);
	}
	,remove: function(Sprite,Splice) {
		if(Splice == null) {
			Splice = false;
		}
		var sprite = Sprite;
		var _g = sprite;
		_g.set_x(_g.x - this.x);
		var _g = sprite;
		_g.set_y(_g.y - this.y);
		sprite.set_cameras(null);
		return this.group.remove(Sprite,Splice);
	}
	,replace: function(OldObject,NewObject) {
		return this.group.replace(OldObject,NewObject);
	}
	,sort: function(Function1,Order) {
		if(Order == null) {
			Order = -1;
		}
		var Order1 = Order;
		if(Order1 == null) {
			Order1 = -1;
		}
		var _g = Function1;
		var a1 = Order1;
		var tmp = function(a2,a3) {
			return _g(a1,a2,a3);
		};
		this.group.members.sort(tmp);
	}
	,getFirstAvailable: function(ObjectClass,Force) {
		if(Force == null) {
			Force = false;
		}
		return this.group.getFirstAvailable(ObjectClass,Force);
	}
	,getFirstNull: function() {
		return this.group.getFirstNull();
	}
	,getFirstExisting: function() {
		return this.group.getFirstExisting();
	}
	,getFirstAlive: function() {
		return this.group.getFirstAlive();
	}
	,getFirstDead: function() {
		return this.group.getFirstDead();
	}
	,countLiving: function() {
		return this.group.countLiving();
	}
	,countDead: function() {
		return this.group.countDead();
	}
	,getRandom: function(StartIndex,Length) {
		if(Length == null) {
			Length = 0;
		}
		if(StartIndex == null) {
			StartIndex = 0;
		}
		return this.group.getRandom(StartIndex,Length);
	}
	,iterator: function(filter) {
		return new flixel_group_FlxTypedGroupIterator(this.group.members,filter);
	}
	,forEach: function(Function1,Recurse) {
		if(Recurse == null) {
			Recurse = false;
		}
		this.group.forEach(Function1,Recurse);
	}
	,forEachAlive: function(Function1,Recurse) {
		if(Recurse == null) {
			Recurse = false;
		}
		this.group.forEachAlive(Function1,Recurse);
	}
	,forEachDead: function(Function1,Recurse) {
		if(Recurse == null) {
			Recurse = false;
		}
		this.group.forEachDead(Function1,Recurse);
	}
	,forEachExists: function(Function1,Recurse) {
		if(Recurse == null) {
			Recurse = false;
		}
		this.group.forEachExists(Function1,Recurse);
	}
	,forEachOfType: function(ObjectClass,Function1,Recurse) {
		if(Recurse == null) {
			Recurse = false;
		}
		this.group.forEachOfType(ObjectClass,Function1,Recurse);
	}
	,clear: function() {
		this.group.clear();
	}
	,kill: function() {
		flixel_FlxSprite.prototype.kill.call(this);
		this.group.kill();
	}
	,revive: function() {
		flixel_FlxSprite.prototype.revive.call(this);
		this.group.revive();
	}
	,reset: function(X,Y) {
		this.revive();
		this.setPosition(X,Y);
		var _g = 0;
		var _g1 = this._sprites;
		while(_g < _g1.length) {
			var sprite = _g1[_g];
			++_g;
			if(sprite != null) {
				sprite.reset(X,Y);
			}
		}
	}
	,setPosition: function(X,Y) {
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var dx = X - this.x;
		var dy = Y - this.y;
		this.multiTransformChildren_Float([$bind(this,this.xTransform),$bind(this,this.yTransform)],[dx,dy]);
		this._skipTransformChildren = true;
		this.set_x(X);
		this.set_y(Y);
		this._skipTransformChildren = false;
	}
	,set_camera: function(Value) {
		if(this.get_camera() != Value) {
			this.transformChildren_flixel_FlxCamera($bind(this,this.cameraTransform),Value);
		}
		return flixel_FlxSprite.prototype.set_camera.call(this,Value);
	}
	,set_cameras: function(Value) {
		if(this.get_cameras() != Value) {
			this.transformChildren_Array_flixel_FlxCamera($bind(this,this.camerasTransform),Value);
		}
		return flixel_FlxSprite.prototype.set_cameras.call(this,Value);
	}
	,set_exists: function(Value) {
		if(this.exists != Value) {
			this.transformChildren_Bool($bind(this,this.existsTransform),Value);
		}
		return flixel_FlxSprite.prototype.set_exists.call(this,Value);
	}
	,set_visible: function(Value) {
		if(this.exists && this.visible != Value) {
			this.transformChildren_Bool($bind(this,this.visibleTransform),Value);
		}
		return flixel_FlxSprite.prototype.set_visible.call(this,Value);
	}
	,set_active: function(Value) {
		if(this.exists && this.active != Value) {
			this.transformChildren_Bool($bind(this,this.activeTransform),Value);
		}
		return flixel_FlxSprite.prototype.set_active.call(this,Value);
	}
	,set_alive: function(Value) {
		if(this.alive != Value) {
			this.transformChildren_Bool($bind(this,this.aliveTransform),Value);
		}
		return flixel_FlxSprite.prototype.set_alive.call(this,Value);
	}
	,set_x: function(Value) {
		if(!this._skipTransformChildren && this.exists && this.x != Value) {
			var offset = Value - this.x;
			this.transformChildren_Float($bind(this,this.xTransform),offset);
		}
		return this.x = Value;
	}
	,set_y: function(Value) {
		if(!this._skipTransformChildren && this.exists && this.y != Value) {
			var offset = Value - this.y;
			this.transformChildren_Float($bind(this,this.yTransform),offset);
		}
		return this.y = Value;
	}
	,set_angle: function(Value) {
		if(this.exists && this.angle != Value) {
			var offset = Value - this.angle;
			this.transformChildren_Float($bind(this,this.angleTransform),offset);
		}
		return this.angle = Value;
	}
	,set_alpha: function(Value) {
		var lowerBound = Value < 0 ? 0 : Value;
		Value = lowerBound > 1 ? 1 : lowerBound;
		if(this.exists && this.alpha != Value) {
			var factor = this.alpha > 0 ? Value / this.alpha : 0;
			if(!this.directAlpha && this.alpha != 0) {
				this.transformChildren_Float($bind(this,this.alphaTransform),factor);
			} else {
				this.transformChildren_Float($bind(this,this.directAlphaTransform),Value);
			}
		}
		return this.alpha = Value;
	}
	,set_facing: function(Value) {
		if(this.exists && this.facing != Value) {
			this.transformChildren_Int($bind(this,this.facingTransform),Value);
		}
		return this.facing = Value;
	}
	,set_flipX: function(Value) {
		if(this.exists && this.flipX != Value) {
			this.transformChildren_Bool($bind(this,this.flipXTransform),Value);
		}
		return this.flipX = Value;
	}
	,set_flipY: function(Value) {
		if(this.exists && this.flipY != Value) {
			this.transformChildren_Bool($bind(this,this.flipYTransform),Value);
		}
		return this.flipY = Value;
	}
	,set_moves: function(Value) {
		if(this.exists && this.moves != Value) {
			this.transformChildren_Bool($bind(this,this.movesTransform),Value);
		}
		return this.moves = Value;
	}
	,set_immovable: function(Value) {
		if(this.exists && this.immovable != Value) {
			this.transformChildren_Bool($bind(this,this.immovableTransform),Value);
		}
		return this.immovable = Value;
	}
	,set_solid: function(Value) {
		if(this.exists && (this.allowCollisions & 4369) > 0 != Value) {
			this.transformChildren_Bool($bind(this,this.solidTransform),Value);
		}
		return flixel_FlxSprite.prototype.set_solid.call(this,Value);
	}
	,set_color: function(Value) {
		if(this.exists && this.color != Value) {
			this.transformChildren_Int($bind(this,this.gColorTransform),Value);
		}
		return this.color = Value;
	}
	,set_blend: function(Value) {
		if(this.exists && this.blend != Value) {
			this.transformChildren_flash_display_BlendMode($bind(this,this.blendTransform),Value);
		}
		return this.blend = Value;
	}
	,set_clipRect: function(rect) {
		if(this.exists) {
			this.transformChildren_flixel_math_FlxRect($bind(this,this.clipRectTransform),rect);
		}
		return flixel_FlxSprite.prototype.set_clipRect.call(this,rect);
	}
	,set_pixelPerfectRender: function(Value) {
		if(this.exists && this.pixelPerfectRender != Value) {
			this.transformChildren_Bool($bind(this,this.pixelPerfectTransform),Value);
		}
		return flixel_FlxSprite.prototype.set_pixelPerfectRender.call(this,Value);
	}
	,set_width: function(Value) {
		return Value;
	}
	,get_width: function() {
		if(this.group.length == 0) {
			return 0;
		}
		var minX = Infinity;
		var maxX = -Infinity;
		var _g = 0;
		var _g1 = this._sprites;
		while(_g < _g1.length) {
			var member = _g1[_g];
			++_g;
			if(member == null) {
				continue;
			}
			var minMemberX = member.x;
			var maxMemberX = minMemberX + member.get_width();
			if(maxMemberX > maxX) {
				maxX = maxMemberX;
			}
			if(minMemberX < minX) {
				minX = minMemberX;
			}
		}
		return maxX - minX;
	}
	,set_height: function(Value) {
		return Value;
	}
	,get_height: function() {
		if(this.group.length == 0) {
			return 0;
		}
		var minY = Infinity;
		var maxY = -Infinity;
		var _g = 0;
		var _g1 = this._sprites;
		while(_g < _g1.length) {
			var member = _g1[_g];
			++_g;
			if(member == null) {
				continue;
			}
			var minMemberY = member.y;
			var maxMemberY = minMemberY + member.get_height();
			if(maxMemberY > maxY) {
				maxY = maxMemberY;
			}
			if(minMemberY < minY) {
				minY = minMemberY;
			}
		}
		return maxY - minY;
	}
	,get_length: function() {
		return this.group.length;
	}
	,get_maxSize: function() {
		return this.group.maxSize;
	}
	,set_maxSize: function(Size) {
		return this.group.set_maxSize(Size);
	}
	,get_members: function() {
		return this.group.members;
	}
	,xTransform: function(Sprite,X) {
		var _g = Sprite;
		_g.set_x(_g.x + X);
	}
	,yTransform: function(Sprite,Y) {
		var _g = Sprite;
		_g.set_y(_g.y + Y);
	}
	,angleTransform: function(Sprite,Angle) {
		var _g = Sprite;
		_g.set_angle(_g.angle + Angle);
	}
	,alphaTransform: function(Sprite,Alpha) {
		if(Sprite.alpha != 0 || Alpha == 0) {
			var _g = Sprite;
			_g.set_alpha(_g.alpha * Alpha);
		} else {
			Sprite.set_alpha(1 / Alpha);
		}
	}
	,directAlphaTransform: function(Sprite,Alpha) {
		Sprite.set_alpha(Alpha);
	}
	,facingTransform: function(Sprite,Facing) {
		Sprite.set_facing(Facing);
	}
	,flipXTransform: function(Sprite,FlipX) {
		Sprite.set_flipX(FlipX);
	}
	,flipYTransform: function(Sprite,FlipY) {
		Sprite.set_flipY(FlipY);
	}
	,movesTransform: function(Sprite,Moves) {
		Sprite.set_moves(Moves);
	}
	,pixelPerfectTransform: function(Sprite,PixelPerfect) {
		Sprite.set_pixelPerfectRender(PixelPerfect);
	}
	,gColorTransform: function(Sprite,Color) {
		Sprite.set_color(Color);
	}
	,blendTransform: function(Sprite,Blend) {
		Sprite.set_blend(Blend);
	}
	,immovableTransform: function(Sprite,Immovable) {
		Sprite.set_immovable(Immovable);
	}
	,visibleTransform: function(Sprite,Visible) {
		Sprite.set_visible(Visible);
	}
	,activeTransform: function(Sprite,Active) {
		Sprite.set_active(Active);
	}
	,solidTransform: function(Sprite,Solid) {
		Sprite.set_solid(Solid);
	}
	,aliveTransform: function(Sprite,Alive) {
		Sprite.set_alive(Alive);
	}
	,existsTransform: function(Sprite,Exists) {
		Sprite.set_exists(Exists);
	}
	,cameraTransform: function(Sprite,Camera) {
		Sprite.set_camera(Camera);
	}
	,camerasTransform: function(Sprite,Cameras) {
		Sprite.set_cameras(Cameras);
	}
	,offsetTransform: function(Sprite,Offset) {
		var _this = Sprite.offset;
		_this.set_x(Offset.x);
		_this.set_y(Offset.y);
		if(Offset._weak) {
			Offset.put();
		}
	}
	,originTransform: function(Sprite,Origin) {
		var _this = Sprite.origin;
		_this.set_x(Origin.x);
		_this.set_y(Origin.y);
		if(Origin._weak) {
			Origin.put();
		}
	}
	,scaleTransform: function(Sprite,Scale) {
		var _this = Sprite.scale;
		_this.set_x(Scale.x);
		_this.set_y(Scale.y);
		if(Scale._weak) {
			Scale.put();
		}
	}
	,scrollFactorTransform: function(Sprite,ScrollFactor) {
		var _this = Sprite.scrollFactor;
		_this.set_x(ScrollFactor.x);
		_this.set_y(ScrollFactor.y);
		if(ScrollFactor._weak) {
			ScrollFactor.put();
		}
	}
	,clipRectTransform: function(Sprite,ClipRect) {
		if(ClipRect == null) {
			Sprite.set_clipRect(null);
		} else {
			var X = ClipRect.x - Sprite.x + this.x;
			var Y = ClipRect.y - Sprite.y + this.y;
			var Width = ClipRect.width;
			var Height = ClipRect.height;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var _this = flixel_math_FlxRect._pool.get();
			var X1 = X;
			var Y1 = Y;
			var Width1 = Width;
			var Height1 = Height;
			if(Height1 == null) {
				Height1 = 0;
			}
			if(Width1 == null) {
				Width1 = 0;
			}
			if(Y1 == null) {
				Y1 = 0;
			}
			if(X1 == null) {
				X1 = 0;
			}
			_this.x = X1;
			_this.y = Y1;
			_this.width = Width1;
			_this.height = Height1;
			var rect = _this;
			rect._inPool = false;
			Sprite.set_clipRect(rect);
		}
	}
	,offsetCallback: function(Offset) {
		this.transformChildren_flixel_math_FlxPoint($bind(this,this.offsetTransform),Offset);
	}
	,originCallback: function(Origin) {
		this.transformChildren_flixel_math_FlxPoint($bind(this,this.originTransform),Origin);
	}
	,scaleCallback: function(Scale) {
		this.transformChildren_flixel_math_FlxPoint($bind(this,this.scaleTransform),Scale);
	}
	,scrollFactorCallback: function(ScrollFactor) {
		this.transformChildren_flixel_math_FlxPoint($bind(this,this.scrollFactorTransform),ScrollFactor);
	}
	,loadGraphicFromSprite: function(Sprite) {
		return this;
	}
	,loadGraphic: function(Graphic,Animated,Width,Height,Unique,Key) {
		if(Unique == null) {
			Unique = false;
		}
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Animated == null) {
			Animated = false;
		}
		return this;
	}
	,loadRotatedGraphic: function(Graphic,Rotations,Frame,AntiAliasing,AutoBuffer,Key) {
		if(AutoBuffer == null) {
			AutoBuffer = false;
		}
		if(AntiAliasing == null) {
			AntiAliasing = false;
		}
		if(Frame == null) {
			Frame = -1;
		}
		if(Rotations == null) {
			Rotations = 16;
		}
		return this;
	}
	,makeGraphic: function(Width,Height,Color,Unique,Key) {
		if(Unique == null) {
			Unique = false;
		}
		if(Color == null) {
			Color = -1;
		}
		return this;
	}
	,set_pixels: function(Value) {
		return Value;
	}
	,set_frame: function(Value) {
		return Value;
	}
	,get_pixels: function() {
		return null;
	}
	,calcFrame: function(RunOnCpp) {
		if(RunOnCpp == null) {
			RunOnCpp = false;
		}
	}
	,resetHelpers: function() {
	}
	,stamp: function(Brush,X,Y) {
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
	}
	,set_frames: function(Frames) {
		return Frames;
	}
	,updateColorTransform: function() {
	}
	,__class__: flixel_group_FlxTypedSpriteGroup
	,__properties__: $extend(flixel_FlxSprite.prototype.__properties__,{set_maxSize:"set_maxSize",get_maxSize:"get_maxSize",get_length:"get_length",get_members:"get_members"})
});
var flixel_addons_transition_TransitionEffect = function(data) {
	this._finalDelayTime = 0.0;
	this._started = false;
	this.finished = false;
	this._data = data;
	flixel_group_FlxTypedSpriteGroup.call(this);
};
$hxClasses["flixel.addons.transition.TransitionEffect"] = flixel_addons_transition_TransitionEffect;
flixel_addons_transition_TransitionEffect.__name__ = "flixel.addons.transition.TransitionEffect";
flixel_addons_transition_TransitionEffect.__super__ = flixel_group_FlxTypedSpriteGroup;
flixel_addons_transition_TransitionEffect.prototype = $extend(flixel_group_FlxTypedSpriteGroup.prototype,{
	finishCallback: null
	,finished: null
	,_started: null
	,_endStatus: null
	,_finalDelayTime: null
	,_data: null
	,destroy: function() {
		flixel_group_FlxTypedSpriteGroup.prototype.destroy.call(this);
		this.finishCallback = null;
	}
	,start: function(NewStatus) {
		this._started = true;
		if(NewStatus == 0) {
			this._endStatus = 3;
		} else {
			this._endStatus = 2;
		}
	}
	,setStatus: function(NewStatus) {
	}
	,delayThenFinish: function() {
		new flixel_util_FlxTimer().start(this._finalDelayTime,$bind(this,this.onFinish));
	}
	,onFinish: function(f) {
		this.finished = true;
		if(this.finishCallback != null) {
			this.finishCallback();
			this.finishCallback = null;
		}
	}
	,__class__: flixel_addons_transition_TransitionEffect
});
var flixel_addons_transition__$TransitionFade_GraphicDiagonalGradient = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_addons_transition__$TransitionFade_GraphicDiagonalGradient.preload != null) {
		this.__fromImage(flixel_addons_transition__$TransitionFade_GraphicDiagonalGradient.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_addons_transition__$TransitionFade_GraphicDiagonalGradient.resourceName),flixel_addons_transition__$TransitionFade_GraphicDiagonalGradient.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_addons_transition__$TransitionFade_GraphicDiagonalGradient.preload == null) {
				flixel_addons_transition__$TransitionFade_GraphicDiagonalGradient.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.addons.transition._TransitionFade.GraphicDiagonalGradient"] = flixel_addons_transition__$TransitionFade_GraphicDiagonalGradient;
flixel_addons_transition__$TransitionFade_GraphicDiagonalGradient.__name__ = "flixel.addons.transition._TransitionFade.GraphicDiagonalGradient";
flixel_addons_transition__$TransitionFade_GraphicDiagonalGradient.preload = null;
flixel_addons_transition__$TransitionFade_GraphicDiagonalGradient.__super__ = openfl_display_BitmapData;
flixel_addons_transition__$TransitionFade_GraphicDiagonalGradient.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_addons_transition__$TransitionFade_GraphicDiagonalGradient
});
var flixel_addons_transition_TransitionFade = function(data) {
	this.tweenValEnd2 = 0;
	this.tweenValEnd = 0;
	this.tweenValStart2 = 0;
	this.tweenValStart = 0;
	this.tweenStr2 = "";
	this.tweenStr = "";
	flixel_addons_transition_TransitionEffect.call(this,data);
	this.back = this.makeSprite(data.direction.x,data.direction.y);
	this.back.scrollFactor.set(0,0);
	this.add(this.back);
};
$hxClasses["flixel.addons.transition.TransitionFade"] = flixel_addons_transition_TransitionFade;
flixel_addons_transition_TransitionFade.__name__ = "flixel.addons.transition.TransitionFade";
flixel_addons_transition_TransitionFade.__super__ = flixel_addons_transition_TransitionEffect;
flixel_addons_transition_TransitionFade.prototype = $extend(flixel_addons_transition_TransitionEffect.prototype,{
	back: null
	,tweenStr: null
	,tweenStr2: null
	,tweenValStart: null
	,tweenValStart2: null
	,tweenValEnd: null
	,tweenValEnd2: null
	,destroy: function() {
		flixel_addons_transition_TransitionEffect.prototype.destroy.call(this);
		this.back = null;
	}
	,start: function(NewStatus) {
		flixel_addons_transition_TransitionEffect.prototype.start.call(this,NewStatus);
		this.setTweenValues(NewStatus,this._data.direction.x,this._data.direction.y);
		switch(this.tweenStr) {
		case "alpha":
			this.back.set_alpha(this.tweenValStart);
			break;
		case "x":
			this.back.set_x(this.tweenValStart);
			break;
		case "y":
			this.back.set_y(this.tweenValStart);
			break;
		}
		switch(this.tweenStr2) {
		case "alpha":
			this.back.set_alpha(this.tweenValStart2);
			break;
		case "x":
			this.back.set_x(this.tweenValStart2);
			break;
		case "y":
			this.back.set_y(this.tweenValStart2);
			break;
		}
		var Values = { };
		Values[this.tweenStr] = this.tweenValEnd;
		if(this.tweenStr2 != "") {
			Values[this.tweenStr2] = this.tweenValEnd2;
		}
		this._data.tweenOptions.onComplete = $bind(this,this.finishTween);
		flixel_tweens_FlxTween.tween(this.back,Values,this._data.duration,this._data.tweenOptions);
	}
	,setTweenValues: function(NewStatus,DirX,DirY) {
		if(DirX == 0 && DirY == 0) {
			this.tweenStr = "alpha";
			this.tweenValStart = NewStatus == 0 ? 0.0 : 1.0;
			this.tweenValEnd = NewStatus == 0 ? 1.0 : 0.0;
		} else if(Math.abs(DirX) > 0 && DirY == 0) {
			this.tweenStr = "x";
			if(DirX > 0) {
				this.tweenValStart = NewStatus == 0 ? -this.back.get_width() : 0;
				this.tweenValEnd = NewStatus == 0 ? 0 : -this.back.get_width();
			} else {
				this.tweenValStart = NewStatus == 0 ? flixel_FlxG.width : -this.back.get_width() / 2;
				this.tweenValEnd = NewStatus == 0 ? -this.back.get_width() / 2 : flixel_FlxG.width;
			}
		} else if(DirX == 0 && Math.abs(DirY) > 0) {
			this.tweenStr = "y";
			if(DirY > 0) {
				this.tweenValStart = NewStatus == 0 ? -this.back.get_height() : 0;
				this.tweenValEnd = NewStatus == 0 ? 0 : -this.back.get_height();
			} else {
				this.tweenValStart = NewStatus == 0 ? flixel_FlxG.height : -this.back.get_height() / 2;
				this.tweenValEnd = NewStatus == 0 ? -this.back.get_height() / 2 : flixel_FlxG.height;
			}
		} else if(Math.abs(DirX) > 0 && Math.abs(DirY) > 0) {
			this.tweenStr = "x";
			this.tweenStr2 = "y";
			if(DirX > 0) {
				this.tweenValStart = NewStatus == 0 ? -this.back.get_width() : 0;
				this.tweenValEnd = NewStatus == 0 ? 0 : -this.back.get_width();
			} else {
				this.tweenValStart = NewStatus == 0 ? flixel_FlxG.width : -this.back.get_width() * 0.66666666666666663;
				this.tweenValEnd = NewStatus == 0 ? -this.back.get_width() * 0.66666666666666663 : flixel_FlxG.width;
			}
			if(DirY > 0) {
				this.tweenValStart2 = NewStatus == 0 ? -this.back.get_height() : 0;
				this.tweenValEnd2 = NewStatus == 0 ? 0 : -this.back.get_height();
			} else {
				this.tweenValStart2 = NewStatus == 0 ? flixel_FlxG.height : -this.back.get_height() * 0.66666666666666663;
				this.tweenValEnd2 = NewStatus == 0 ? -this.back.get_height() * 0.66666666666666663 : flixel_FlxG.height;
			}
		}
	}
	,makeSprite: function(DirX,DirY) {
		var s = new flixel_FlxSprite(0,0);
		var locX = 0;
		var locY = 0;
		var angle = 0;
		var pixels = null;
		if(DirX == 0 && DirY == 0) {
			s.makeGraphic(flixel_FlxG.width,flixel_FlxG.height,this._data.color);
		} else if(DirX == 0 && Math.abs(DirY) > 0) {
			locY = DirY > 0 ? flixel_FlxG.height : 0;
			angle = DirY > 0 ? 90 : 270;
			s.makeGraphic(1,flixel_FlxG.height * 2,this._data.color);
			pixels = s.get_pixels();
			var gvert = flixel_util_FlxGradient.createGradientBitmapData(1,flixel_FlxG.height,[this._data.color,0],1,angle);
			pixels.copyPixels(gvert,gvert.rect,new openfl_geom_Point(0,locY));
			s.set_pixels(pixels);
			s.scale.set(flixel_FlxG.width,1.0);
			s.updateHitbox();
		} else if(Math.abs(DirX) > 0 && DirY == 0) {
			locX = DirX > 0 ? flixel_FlxG.width : 0;
			angle = DirX > 0 ? 0 : 180;
			s.makeGraphic(flixel_FlxG.width * 2,1,this._data.color);
			pixels = s.get_pixels();
			var ghorz = flixel_util_FlxGradient.createGradientBitmapData(flixel_FlxG.width,1,[this._data.color,0],1,angle);
			pixels.copyPixels(ghorz,ghorz.rect,new openfl_geom_Point(locX,0));
			s.set_pixels(pixels);
			s.scale.set(1.0,flixel_FlxG.height);
			s.updateHitbox();
		} else if(Math.abs(DirX) > 0 && Math.abs(DirY) > 0) {
			locY = DirY > 0 ? flixel_FlxG.height : 0;
			s.loadGraphic(this.getGradient());
			s.set_flipX(DirX < 0);
			s.set_flipY(DirY < 0);
		}
		return s;
	}
	,getGradient: function() {
		var rawBmp = new flixel_addons_transition__$TransitionFade_GraphicDiagonalGradient(0,0);
		var gdiag = rawBmp;
		var gdiag_scaled = new openfl_display_BitmapData(flixel_FlxG.width * 2,flixel_FlxG.height * 2,true);
		var m = new openfl_geom_Matrix();
		m.scale(gdiag_scaled.width / gdiag.width,gdiag_scaled.height / gdiag.height);
		gdiag_scaled.draw(gdiag,m,null,null,null,true);
		var theColor = this._data.color;
		var final_pixels = new openfl_display_BitmapData(flixel_FlxG.width * 3,flixel_FlxG.height * 3,true,theColor);
		final_pixels.copyChannel(gdiag_scaled,gdiag_scaled.rect,new openfl_geom_Point(final_pixels.width - gdiag_scaled.width,final_pixels.height - gdiag_scaled.height),1,8);
		gdiag.dispose();
		gdiag_scaled.dispose();
		return final_pixels;
	}
	,finishTween: function(f) {
		this.delayThenFinish();
	}
	,__class__: flixel_addons_transition_TransitionFade
});
var flixel_addons_transition_TransitionTiles = function(data) {
	this._isCenter = false;
	flixel_addons_transition_TransitionEffect.call(this,data);
	this._grpSprites = new flixel_group_FlxTypedSpriteGroup();
	var delay = 0;
	if(data.tileData == null) {
		data.tileData = { asset : null, width : 32, height : 32};
	}
	var region = data.region;
	var tilesX = Math.ceil(region.width / data.tileData.width);
	var tilesY = Math.ceil(region.height / data.tileData.height);
	var maxTiles = tilesX > tilesY ? tilesX : tilesY;
	var dTime = data.duration / maxTiles;
	var xDelay = dTime * Math.abs(data.direction.x);
	var yDelay = dTime * Math.abs(data.direction.y);
	var addX = data.tileData.width;
	var addY = data.tileData.height;
	var tx = 0;
	var ty = 0;
	var startX = region.x | 0;
	var startY = region.y | 0;
	if(data.direction.x < 0) {
		addX *= -1;
		startX += region.width + addX | 0;
	}
	if(data.direction.y < 0) {
		addY *= -1;
		startY += region.height + addY | 0;
	}
	tx = startX;
	ty = startY;
	var _g = 0;
	var _g1 = tilesY;
	while(_g < _g1) {
		var iy = _g++;
		var _g2 = 0;
		var _g3 = tilesX;
		while(_g2 < _g3) {
			var ix = _g2++;
			var frameRate = 40;
			if(data.tileData.frameRate != null) {
				frameRate = data.tileData.frameRate;
			}
			var ts = new flixel_addons_transition_FlxTransitionSprite(tx,ty,delay,data.tileData.asset,data.tileData.width,data.tileData.height,frameRate);
			ts.set_color(data.color);
			ts.scrollFactor.set(0,0);
			this._grpSprites.add(ts);
			tx += addX;
			delay += xDelay;
		}
		ty += addY;
		tx = startX;
		delay = (iy + 1) * yDelay;
	}
	this.add(this._grpSprites);
	this._isCenter = data.direction.x == 0 && data.direction.y == 0;
};
$hxClasses["flixel.addons.transition.TransitionTiles"] = flixel_addons_transition_TransitionTiles;
flixel_addons_transition_TransitionTiles.__name__ = "flixel.addons.transition.TransitionTiles";
flixel_addons_transition_TransitionTiles.__super__ = flixel_addons_transition_TransitionEffect;
flixel_addons_transition_TransitionTiles.prototype = $extend(flixel_addons_transition_TransitionEffect.prototype,{
	_grpSprites: null
	,_isCenter: null
	,destroy: function() {
		flixel_addons_transition_TransitionEffect.prototype.destroy.call(this);
		this._grpSprites = null;
	}
	,start: function(NewStatus) {
		flixel_addons_transition_TransitionEffect.prototype.start.call(this,NewStatus);
		this._grpSprites.group.forEach(function(t) {
			t.start(NewStatus);
		},false);
	}
	,setStatus: function(NewStatus) {
		flixel_addons_transition_TransitionEffect.prototype.setStatus.call(this,NewStatus);
		this._grpSprites.group.forEach(function(t) {
			t.setStatus(NewStatus);
		},false);
	}
	,update: function(elapsed) {
		flixel_addons_transition_TransitionEffect.prototype.update.call(this,elapsed);
		if(this._started) {
			var allDone = true;
			var _g = 0;
			var _g1 = this._grpSprites.group.members;
			while(_g < _g1.length) {
				var sprite = _g1[_g];
				++_g;
				if(sprite.status != -1 && sprite.status != this._endStatus) {
					allDone = false;
					break;
				}
			}
			if(allDone) {
				this._started = false;
				this.delayThenFinish();
			}
		}
	}
	,__class__: flixel_addons_transition_TransitionTiles
});
var flixel_animation_FlxBaseAnimation = function(Parent,Name) {
	this.curIndex = 0;
	this.parent = Parent;
	this.name = Name;
};
$hxClasses["flixel.animation.FlxBaseAnimation"] = flixel_animation_FlxBaseAnimation;
flixel_animation_FlxBaseAnimation.__name__ = "flixel.animation.FlxBaseAnimation";
flixel_animation_FlxBaseAnimation.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_animation_FlxBaseAnimation.prototype = {
	parent: null
	,name: null
	,curIndex: null
	,set_curIndex: function(Value) {
		this.curIndex = Value;
		if(this.parent != null && this.parent._curAnim == this) {
			this.parent.set_frameIndex(Value);
		}
		return Value;
	}
	,destroy: function() {
		this.parent = null;
		this.name = null;
	}
	,update: function(elapsed) {
	}
	,clone: function(Parent) {
		return null;
	}
	,__class__: flixel_animation_FlxBaseAnimation
	,__properties__: {set_curIndex:"set_curIndex"}
};
var flixel_animation_FlxAnimation = function(Parent,Name,Frames,FrameRate,Looped,FlipX,FlipY) {
	if(FlipY == null) {
		FlipY = false;
	}
	if(FlipX == null) {
		FlipX = false;
	}
	if(Looped == null) {
		Looped = true;
	}
	if(FrameRate == null) {
		FrameRate = 0;
	}
	this._frameTimer = 0;
	this.flipY = false;
	this.flipX = false;
	this.reversed = false;
	this.looped = true;
	this.paused = true;
	this.finished = true;
	this.delay = 0;
	this.curFrame = 0;
	flixel_animation_FlxBaseAnimation.call(this,Parent,Name);
	this.set_frameRate(FrameRate);
	this.frames = Frames;
	this.looped = Looped;
	this.flipX = FlipX;
	this.flipY = FlipY;
};
$hxClasses["flixel.animation.FlxAnimation"] = flixel_animation_FlxAnimation;
flixel_animation_FlxAnimation.__name__ = "flixel.animation.FlxAnimation";
flixel_animation_FlxAnimation.__super__ = flixel_animation_FlxBaseAnimation;
flixel_animation_FlxAnimation.prototype = $extend(flixel_animation_FlxBaseAnimation.prototype,{
	frameRate: null
	,curFrame: null
	,delay: null
	,finished: null
	,paused: null
	,looped: null
	,reversed: null
	,flipX: null
	,flipY: null
	,frames: null
	,_frameTimer: null
	,destroy: function() {
		this.frames = null;
		this.name = null;
		flixel_animation_FlxBaseAnimation.prototype.destroy.call(this);
	}
	,play: function(Force,Reversed,Frame) {
		if(Frame == null) {
			Frame = 0;
		}
		if(Reversed == null) {
			Reversed = false;
		}
		if(Force == null) {
			Force = false;
		}
		if(!Force && !this.finished && this.reversed == Reversed) {
			this.paused = false;
			this.finished = false;
			return;
		}
		this.reversed = Reversed;
		this.paused = false;
		this._frameTimer = 0;
		this.finished = this.delay == 0;
		var maxFrameIndex = this.frames.length - 1;
		if(Frame < 0) {
			this.set_curFrame(flixel_FlxG.random.int(0,maxFrameIndex));
		} else {
			if(Frame > maxFrameIndex) {
				Frame = maxFrameIndex;
			}
			if(this.reversed) {
				Frame = maxFrameIndex - Frame;
			}
			this.set_curFrame(Frame);
		}
		if(this.finished) {
			var _this = this.parent;
			if(_this.finishCallback != null) {
				_this.finishCallback(this.name);
			}
		}
	}
	,restart: function() {
		this.play(true,this.reversed);
	}
	,stop: function() {
		this.finished = true;
		this.paused = true;
	}
	,reset: function() {
		this.stop();
		this.set_curFrame(this.reversed ? this.frames.length - 1 : 0);
	}
	,finish: function() {
		this.stop();
		this.set_curFrame(this.reversed ? 0 : this.frames.length - 1);
	}
	,pause: function() {
		this.paused = true;
	}
	,resume: function() {
		this.paused = false;
	}
	,reverse: function() {
		this.reversed = !this.reversed;
		if(this.finished) {
			this.play(false,this.reversed);
		}
	}
	,update: function(elapsed) {
		if(this.delay == 0 || this.finished || this.paused) {
			return;
		}
		this._frameTimer += elapsed;
		while(this._frameTimer > this.delay && !this.finished) {
			this._frameTimer -= this.delay;
			if(this.reversed) {
				if(this.looped && this.curFrame == 0) {
					this.set_curFrame(this.frames.length - 1);
				} else {
					var _g = this;
					_g.set_curFrame(_g.curFrame - 1);
				}
			} else if(this.looped && this.curFrame == this.frames.length - 1) {
				this.set_curFrame(0);
			} else {
				var _g1 = this;
				_g1.set_curFrame(_g1.curFrame + 1);
			}
		}
	}
	,clone: function(Parent) {
		return new flixel_animation_FlxAnimation(Parent,this.name,this.frames,this.frameRate,this.looped,this.flipX,this.flipY);
	}
	,set_frameRate: function(value) {
		this.delay = 0;
		this.frameRate = value;
		if(value > 0) {
			this.delay = 1.0 / value;
		}
		return value;
	}
	,set_curFrame: function(Frame) {
		var maxFrameIndex = this.frames.length - 1;
		var tempFrame = this.reversed ? maxFrameIndex - Frame : Frame;
		if(tempFrame >= 0) {
			if(!this.looped && Frame > maxFrameIndex) {
				this.finished = true;
				this.curFrame = this.reversed ? 0 : maxFrameIndex;
			} else {
				this.curFrame = Frame;
			}
		} else {
			this.curFrame = flixel_FlxG.random.int(0,maxFrameIndex);
		}
		this.set_curIndex(this.frames[this.curFrame]);
		if(this.finished && this.parent != null) {
			var _this = this.parent;
			if(_this.finishCallback != null) {
				_this.finishCallback(this.name);
			}
		}
		return Frame;
	}
	,get_numFrames: function() {
		return this.frames.length;
	}
	,__class__: flixel_animation_FlxAnimation
	,__properties__: $extend(flixel_animation_FlxBaseAnimation.prototype.__properties__,{get_numFrames:"get_numFrames",set_curFrame:"set_curFrame",set_frameRate:"set_frameRate"})
});
var flixel_animation_FlxAnimationController = function(Sprite) {
	this.frameIndex = -1;
	this._sprite = Sprite;
	this._animations = new haxe_ds_StringMap();
};
$hxClasses["flixel.animation.FlxAnimationController"] = flixel_animation_FlxAnimationController;
flixel_animation_FlxAnimationController.__name__ = "flixel.animation.FlxAnimationController";
flixel_animation_FlxAnimationController.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_animation_FlxAnimationController.prototype = {
	frameIndex: null
	,callback: null
	,finishCallback: null
	,_sprite: null
	,_curAnim: null
	,_animations: null
	,_prerotated: null
	,update: function(elapsed) {
		if(this._curAnim != null) {
			this._curAnim.update(elapsed);
		} else if(this._prerotated != null) {
			this._prerotated.set_angle(this._sprite.angle);
		}
	}
	,copyFrom: function(controller) {
		this.destroyAnimations();
		var anim = haxe_ds_StringMap.valueIterator(controller._animations.h);
		while(anim.hasNext()) {
			var anim1 = anim.next();
			this.add(anim1.name,anim1.frames,anim1.frameRate,anim1.looped,anim1.flipX,anim1.flipY);
		}
		if(controller._prerotated != null) {
			this.createPrerotated();
		}
		if(controller.get_name() != null) {
			this.set_name(controller.get_name());
		}
		this.set_frameIndex(controller.frameIndex);
		return this;
	}
	,createPrerotated: function(Controller) {
		this.destroyAnimations();
		if(Controller == null) {
			Controller = this;
		}
		this._prerotated = new flixel_animation_FlxPrerotatedAnimation(Controller,Controller._sprite.bakedRotationAngle);
		this._prerotated.set_angle(this._sprite.angle);
	}
	,destroyAnimations: function() {
		this.clearAnimations();
		this.clearPrerotated();
	}
	,destroy: function() {
		this.destroyAnimations();
		this._animations = null;
		this.callback = null;
		this._sprite = null;
	}
	,clearPrerotated: function() {
		if(this._prerotated != null) {
			this._prerotated.destroy();
		}
		this._prerotated = null;
	}
	,clearAnimations: function() {
		if(this._animations != null) {
			var anim;
			var key = haxe_ds_StringMap.keysIterator(this._animations.h);
			while(key.hasNext()) {
				var key1 = key.next();
				anim = this._animations.h[key1];
				if(anim != null) {
					anim.destroy();
				}
			}
		}
		this._animations = new haxe_ds_StringMap();
		this._curAnim = null;
	}
	,add: function(Name,Frames,FrameRate,Looped,FlipX,FlipY) {
		if(FlipY == null) {
			FlipY = false;
		}
		if(FlipX == null) {
			FlipX = false;
		}
		if(Looped == null) {
			Looped = true;
		}
		if(FrameRate == null) {
			FrameRate = 30;
		}
		var framesToAdd = Frames;
		var numFrames = framesToAdd.length - 1;
		var i = numFrames;
		while(i >= 0) {
			if(framesToAdd[i] >= this._sprite.numFrames) {
				if(framesToAdd == Frames) {
					framesToAdd = Frames.slice();
				}
				framesToAdd.splice(i,1);
			}
			--i;
		}
		if(framesToAdd.length > 0) {
			var anim = new flixel_animation_FlxAnimation(this,Name,framesToAdd,FrameRate,Looped,FlipX,FlipY);
			this._animations.h[Name] = anim;
		}
	}
	,remove: function(Name) {
		var anim = this._animations.h[Name];
		if(anim != null) {
			var _this = this._animations;
			if(Object.prototype.hasOwnProperty.call(_this.h,Name)) {
				delete(_this.h[Name]);
			}
			anim.destroy();
		}
	}
	,append: function(Name,Frames) {
		var anim = this._animations.h[Name];
		if(anim == null) {
			return;
		}
		var numFrames = Frames.length - 1;
		var i = numFrames;
		while(i >= 0) {
			if(Frames[numFrames - i] < this._sprite.numFrames) {
				anim.frames.push(Frames[numFrames - i]);
			}
			--i;
		}
	}
	,addByNames: function(Name,FrameNames,FrameRate,Looped,FlipX,FlipY) {
		if(FlipY == null) {
			FlipY = false;
		}
		if(FlipX == null) {
			FlipX = false;
		}
		if(Looped == null) {
			Looped = true;
		}
		if(FrameRate == null) {
			FrameRate = 30;
		}
		if(this._sprite.frames != null) {
			var indices = [];
			this.byNamesHelper(indices,FrameNames);
			if(indices.length > 0) {
				var anim = new flixel_animation_FlxAnimation(this,Name,indices,FrameRate,Looped,FlipX,FlipY);
				this._animations.h[Name] = anim;
			}
		}
	}
	,appendByNames: function(Name,FrameNames) {
		var anim = this._animations.h[Name];
		if(anim == null) {
			return;
		}
		if(this._sprite.frames != null) {
			this.byNamesHelper(anim.frames,FrameNames);
		}
	}
	,addByStringIndices: function(Name,Prefix,Indices,Postfix,FrameRate,Looped,FlipX,FlipY) {
		if(FlipY == null) {
			FlipY = false;
		}
		if(FlipX == null) {
			FlipX = false;
		}
		if(Looped == null) {
			Looped = true;
		}
		if(FrameRate == null) {
			FrameRate = 30;
		}
		if(this._sprite.frames != null) {
			var frameIndices = [];
			this.byStringIndicesHelper(frameIndices,Prefix,Indices,Postfix);
			if(frameIndices.length > 0) {
				var anim = new flixel_animation_FlxAnimation(this,Name,frameIndices,FrameRate,Looped,FlipX,FlipY);
				this._animations.h[Name] = anim;
			}
		}
	}
	,appendByStringIndices: function(Name,Prefix,Indices,Postfix) {
		var anim = this._animations.h[Name];
		if(anim == null) {
			return;
		}
		if(this._sprite.frames != null) {
			this.byStringIndicesHelper(anim.frames,Prefix,Indices,Postfix);
		}
	}
	,addByIndices: function(Name,Prefix,Indices,Postfix,FrameRate,Looped,FlipX,FlipY) {
		if(FlipY == null) {
			FlipY = false;
		}
		if(FlipX == null) {
			FlipX = false;
		}
		if(Looped == null) {
			Looped = true;
		}
		if(FrameRate == null) {
			FrameRate = 30;
		}
		if(this._sprite.frames != null) {
			var frameIndices = [];
			this.byIndicesHelper(frameIndices,Prefix,Indices,Postfix);
			if(frameIndices.length > 0) {
				var anim = new flixel_animation_FlxAnimation(this,Name,frameIndices,FrameRate,Looped,FlipX,FlipY);
				this._animations.h[Name] = anim;
			}
		}
	}
	,appendByIndices: function(Name,Prefix,Indices,Postfix) {
		var anim = this._animations.h[Name];
		if(anim == null) {
			return;
		}
		if(this._sprite.frames != null) {
			this.byIndicesHelper(anim.frames,Prefix,Indices,Postfix);
		}
	}
	,findSpriteFrame: function(Prefix,Index,Postfix) {
		var numFrames = this._sprite.numFrames;
		var flxFrames = this._sprite.frames.frames;
		var _g = 0;
		var _g1 = numFrames;
		while(_g < _g1) {
			var i = _g++;
			var name = flxFrames[i].name;
			if(StringTools.startsWith(name,Prefix) && StringTools.endsWith(name,Postfix)) {
				var index = Std.parseInt(name.substring(Prefix.length,name.length - Postfix.length));
				if(index != null && index == Index) {
					return i;
				}
			}
		}
		return -1;
	}
	,addByPrefix: function(Name,Prefix,FrameRate,Looped,FlipX,FlipY) {
		if(FlipY == null) {
			FlipY = false;
		}
		if(FlipX == null) {
			FlipX = false;
		}
		if(Looped == null) {
			Looped = true;
		}
		if(FrameRate == null) {
			FrameRate = 30;
		}
		if(this._sprite.frames != null) {
			var animFrames = [];
			this.findByPrefix(animFrames,Prefix);
			if(animFrames.length > 0) {
				var frameIndices = [];
				this.byPrefixHelper(frameIndices,animFrames,Prefix);
				if(frameIndices.length > 0) {
					var anim = new flixel_animation_FlxAnimation(this,Name,frameIndices,FrameRate,Looped,FlipX,FlipY);
					this._animations.h[Name] = anim;
				}
			}
		}
	}
	,appendByPrefix: function(Name,Prefix) {
		var anim = this._animations.h[Name];
		if(anim == null) {
			return;
		}
		if(this._sprite.frames != null) {
			var animFrames = [];
			this.findByPrefix(animFrames,Prefix);
			if(animFrames.length > 0) {
				this.byPrefixHelper(anim.frames,animFrames,Prefix);
			}
		}
	}
	,play: function(AnimName,Force,Reversed,Frame) {
		if(Frame == null) {
			Frame = 0;
		}
		if(Reversed == null) {
			Reversed = false;
		}
		if(Force == null) {
			Force = false;
		}
		if(AnimName == null) {
			if(this._curAnim != null) {
				this._curAnim.stop();
			}
			this._curAnim = null;
		}
		if(AnimName == null || this._animations.h[AnimName] == null) {
			return;
		}
		var oldFlipX = false;
		var oldFlipY = false;
		if(this._curAnim != null && AnimName != this._curAnim.name) {
			oldFlipX = this._curAnim.flipX;
			oldFlipY = this._curAnim.flipY;
			this._curAnim.stop();
		}
		this._curAnim = this._animations.h[AnimName];
		this._curAnim.play(Force,Reversed,Frame);
		if(oldFlipX != this._curAnim.flipX || oldFlipY != this._curAnim.flipY) {
			this._sprite.dirty = true;
		}
	}
	,reset: function() {
		if(this._curAnim != null) {
			this._curAnim.reset();
		}
	}
	,finish: function() {
		if(this._curAnim != null) {
			this._curAnim.finish();
		}
	}
	,stop: function() {
		if(this._curAnim != null) {
			this._curAnim.stop();
		}
	}
	,pause: function() {
		if(this._curAnim != null) {
			this._curAnim.pause();
		}
	}
	,resume: function() {
		if(this._curAnim != null) {
			this._curAnim.paused = false;
		}
	}
	,reverse: function() {
		if(this._curAnim != null) {
			this._curAnim.reverse();
		}
	}
	,getByName: function(Name) {
		return this._animations.h[Name];
	}
	,randomFrame: function() {
		if(this._curAnim != null) {
			this._curAnim.stop();
			this._curAnim = null;
		}
		this.set_frameIndex(flixel_FlxG.random.int(0,this._sprite.numFrames - 1));
	}
	,fireCallback: function() {
		if(this.callback != null) {
			var name = this._curAnim != null ? this._curAnim.name : null;
			var number = this._curAnim != null ? this._curAnim.curFrame : this.frameIndex;
			this.callback(name,number,this.frameIndex);
		}
	}
	,fireFinishCallback: function(name) {
		if(this.finishCallback != null) {
			this.finishCallback(name);
		}
	}
	,byNamesHelper: function(AddTo,FrameNames) {
		var _g = 0;
		while(_g < FrameNames.length) {
			var frameName = FrameNames[_g];
			++_g;
			if(Object.prototype.hasOwnProperty.call(this._sprite.frames.framesHash.h,frameName)) {
				var frameToAdd = this._sprite.frames.framesHash.h[frameName];
				AddTo.push(this._sprite.frames.frames.indexOf(frameToAdd));
			}
		}
	}
	,byStringIndicesHelper: function(AddTo,Prefix,Indices,Postfix) {
		var _g = 0;
		while(_g < Indices.length) {
			var index = Indices[_g];
			++_g;
			var name = Prefix + index + Postfix;
			if(Object.prototype.hasOwnProperty.call(this._sprite.frames.framesHash.h,name)) {
				var frameToAdd = this._sprite.frames.framesHash.h[name];
				AddTo.push(this._sprite.frames.frames.indexOf(frameToAdd));
			}
		}
	}
	,byIndicesHelper: function(AddTo,Prefix,Indices,Postfix) {
		var _g = 0;
		while(_g < Indices.length) {
			var index = Indices[_g];
			++_g;
			var indexToAdd = this.findSpriteFrame(Prefix,index,Postfix);
			if(indexToAdd != -1) {
				AddTo.push(indexToAdd);
			}
		}
	}
	,byPrefixHelper: function(AddTo,AnimFrames,Prefix) {
		var name = AnimFrames[0].name;
		var postIndex = name.indexOf(".",Prefix.length);
		var postFix = name.substring(postIndex == -1 ? name.length : postIndex,name.length);
		flixel_graphics_frames_FlxFrame.sort(AnimFrames,Prefix.length,postFix.length);
		var _g = 0;
		while(_g < AnimFrames.length) {
			var animFrame = AnimFrames[_g];
			++_g;
			AddTo.push(this._sprite.frames.frames.indexOf(animFrame));
		}
	}
	,findByPrefix: function(AnimFrames,Prefix) {
		var _g = 0;
		var _g1 = this._sprite.frames.frames;
		while(_g < _g1.length) {
			var frame = _g1[_g];
			++_g;
			if(frame.name != null && StringTools.startsWith(frame.name,Prefix)) {
				AnimFrames.push(frame);
			}
		}
	}
	,set_frameIndex: function(Frame) {
		if(this._sprite.frames != null && this._sprite.numFrames > 0) {
			Frame %= this._sprite.numFrames;
			this._sprite.set_frame(this._sprite.frames.frames[Frame]);
			this.frameIndex = Frame;
			if(this.callback != null) {
				var name = this._curAnim != null ? this._curAnim.name : null;
				var number = this._curAnim != null ? this._curAnim.curFrame : this.frameIndex;
				this.callback(name,number,this.frameIndex);
			}
		}
		return this.frameIndex;
	}
	,get_frameName: function() {
		return this._sprite.frame.name;
	}
	,set_frameName: function(Value) {
		if(this._sprite.frames != null && Object.prototype.hasOwnProperty.call(this._sprite.frames.framesHash.h,Value)) {
			if(this._curAnim != null) {
				this._curAnim.stop();
				this._curAnim = null;
			}
			var frame = this._sprite.frames.framesHash.h[Value];
			if(frame != null) {
				this.set_frameIndex(this._sprite.frames.frames.indexOf(frame));
			}
		}
		return Value;
	}
	,get_name: function() {
		var animName = null;
		if(this._curAnim != null) {
			animName = this._curAnim.name;
		}
		return animName;
	}
	,set_name: function(AnimName) {
		this.play(AnimName);
		return AnimName;
	}
	,get_curAnim: function() {
		return this._curAnim;
	}
	,set_curAnim: function(Anim) {
		if(Anim != this._curAnim) {
			if(this._curAnim != null) {
				this._curAnim.stop();
			}
			if(Anim != null) {
				Anim.play();
			}
		}
		return this._curAnim = Anim;
	}
	,get_paused: function() {
		var paused = false;
		if(this._curAnim != null) {
			paused = this._curAnim.paused;
		}
		return paused;
	}
	,set_paused: function(Value) {
		if(this._curAnim != null) {
			if(Value) {
				this._curAnim.pause();
			} else {
				this._curAnim.paused = false;
			}
		}
		return Value;
	}
	,get_finished: function() {
		var finished = true;
		if(this._curAnim != null) {
			finished = this._curAnim.finished;
		}
		return finished;
	}
	,set_finished: function(Value) {
		if(Value && this._curAnim != null) {
			this._curAnim.finish();
		}
		return Value;
	}
	,get_frames: function() {
		return this._sprite.numFrames;
	}
	,getFrameIndex: function(Frame) {
		return this._sprite.frames.frames.indexOf(Frame);
	}
	,__class__: flixel_animation_FlxAnimationController
	,__properties__: {get_frames:"get_frames",set_finished:"set_finished",get_finished:"get_finished",set_paused:"set_paused",get_paused:"get_paused",set_name:"set_name",get_name:"get_name",set_frameName:"set_frameName",get_frameName:"get_frameName",set_frameIndex:"set_frameIndex",set_curAnim:"set_curAnim",get_curAnim:"get_curAnim"}
};
var flixel_animation_FlxPrerotatedAnimation = function(Parent,Baked) {
	this.angle = 0;
	flixel_animation_FlxBaseAnimation.call(this,Parent,"prerotated_animation");
	this.baked = Baked;
	this.rotations = Math.round(360 / Baked);
};
$hxClasses["flixel.animation.FlxPrerotatedAnimation"] = flixel_animation_FlxPrerotatedAnimation;
flixel_animation_FlxPrerotatedAnimation.__name__ = "flixel.animation.FlxPrerotatedAnimation";
flixel_animation_FlxPrerotatedAnimation.__super__ = flixel_animation_FlxBaseAnimation;
flixel_animation_FlxPrerotatedAnimation.prototype = $extend(flixel_animation_FlxBaseAnimation.prototype,{
	rotations: null
	,baked: null
	,angle: null
	,set_angle: function(Value) {
		if(isNaN(Value)) {
			throw haxe_Exception.thrown("angle must not be NaN");
		}
		var oldIndex = this.curIndex;
		var angleHelper = Math.floor(Value % 360);
		while(angleHelper < 0) angleHelper += 360;
		var newIndex = Math.floor(angleHelper / this.baked + 0.5);
		newIndex = newIndex % this.rotations | 0;
		if(oldIndex != newIndex) {
			this.set_curIndex(newIndex);
		}
		return this.angle = Value;
	}
	,set_curIndex: function(Value) {
		this.curIndex = Value;
		if(this.parent != null) {
			this.parent.set_frameIndex(Value);
		}
		return Value;
	}
	,clone: function(Parent) {
		return new flixel_animation_FlxPrerotatedAnimation(Parent,this.baked);
	}
	,__class__: flixel_animation_FlxPrerotatedAnimation
	,__properties__: $extend(flixel_animation_FlxBaseAnimation.prototype.__properties__,{set_angle:"set_angle"})
});
var flixel_util_FlxPool_$flixel_$effects_$FlxFlicker = function(classObj) {
	this._count = 0;
	this._pool = [];
	this._class = classObj;
};
$hxClasses["flixel.util.FlxPool_flixel_effects_FlxFlicker"] = flixel_util_FlxPool_$flixel_$effects_$FlxFlicker;
flixel_util_FlxPool_$flixel_$effects_$FlxFlicker.__name__ = "flixel.util.FlxPool_flixel_effects_FlxFlicker";
flixel_util_FlxPool_$flixel_$effects_$FlxFlicker.__interfaces__ = [flixel_util_IFlxPool];
flixel_util_FlxPool_$flixel_$effects_$FlxFlicker.prototype = {
	_pool: null
	,_class: null
	,_count: null
	,get: function() {
		if(this._count == 0) {
			return Type.createInstance(this._class,[]);
		}
		return this._pool[--this._count];
	}
	,put: function(obj) {
		if(obj != null) {
			var i = this._pool.indexOf(obj);
			if(i == -1 || i >= this._count) {
				obj.destroy();
				this._pool[this._count++] = obj;
			}
		}
	}
	,putUnsafe: function(obj) {
		if(obj != null) {
			obj.destroy();
			this._pool[this._count++] = obj;
		}
	}
	,preAllocate: function(numObjects) {
		while(numObjects-- > 0) this._pool[this._count++] = Type.createInstance(this._class,[]);
	}
	,clear: function() {
		this._count = 0;
		var oldPool = this._pool;
		this._pool = [];
		return oldPool;
	}
	,get_length: function() {
		return this._count;
	}
	,__class__: flixel_util_FlxPool_$flixel_$effects_$FlxFlicker
	,__properties__: {get_length:"get_length"}
};
var flixel_effects_FlxFlicker = function() {
};
$hxClasses["flixel.effects.FlxFlicker"] = flixel_effects_FlxFlicker;
flixel_effects_FlxFlicker.__name__ = "flixel.effects.FlxFlicker";
flixel_effects_FlxFlicker.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_effects_FlxFlicker.flicker = function(Object1,Duration,Interval,EndVisibility,ForceRestart,CompletionCallback,ProgressCallback) {
	if(ForceRestart == null) {
		ForceRestart = true;
	}
	if(EndVisibility == null) {
		EndVisibility = true;
	}
	if(Interval == null) {
		Interval = 0.04;
	}
	if(Duration == null) {
		Duration = 1;
	}
	if(flixel_effects_FlxFlicker.isFlickering(Object1)) {
		if(ForceRestart) {
			flixel_effects_FlxFlicker.stopFlickering(Object1);
		} else {
			return flixel_effects_FlxFlicker._boundObjects.h[Object1.__id__];
		}
	}
	if(Interval <= 0) {
		Interval = flixel_FlxG.elapsed;
	}
	var flicker = flixel_effects_FlxFlicker._pool.get();
	flicker.start(Object1,Duration,Interval,EndVisibility,CompletionCallback,ProgressCallback);
	flixel_effects_FlxFlicker._boundObjects.set(Object1,flicker);
	return flicker;
};
flixel_effects_FlxFlicker.isFlickering = function(Object1) {
	return flixel_effects_FlxFlicker._boundObjects.h.__keys__[Object1.__id__] != null;
};
flixel_effects_FlxFlicker.stopFlickering = function(Object1) {
	var boundFlicker = flixel_effects_FlxFlicker._boundObjects.h[Object1.__id__];
	if(boundFlicker != null) {
		boundFlicker.stop();
	}
};
flixel_effects_FlxFlicker.prototype = {
	object: null
	,endVisibility: null
	,timer: null
	,completionCallback: null
	,progressCallback: null
	,duration: null
	,interval: null
	,destroy: function() {
		this.object = null;
		this.timer = null;
		this.completionCallback = null;
		this.progressCallback = null;
	}
	,start: function(Object1,Duration,Interval,EndVisibility,CompletionCallback,ProgressCallback) {
		this.object = Object1;
		this.duration = Duration;
		this.interval = Interval;
		this.completionCallback = CompletionCallback;
		this.progressCallback = ProgressCallback;
		this.endVisibility = EndVisibility;
		this.timer = new flixel_util_FlxTimer().start(this.interval,$bind(this,this.flickerProgress),this.duration / this.interval | 0);
	}
	,stop: function() {
		this.timer.cancel();
		this.object.set_visible(true);
		this.release();
	}
	,release: function() {
		flixel_effects_FlxFlicker._boundObjects.remove(this.object);
		flixel_effects_FlxFlicker._pool.put(this);
	}
	,flickerProgress: function(Timer) {
		this.object.set_visible(!this.object.visible);
		if(this.progressCallback != null) {
			this.progressCallback(this);
		}
		if(Timer.loops > 0 && Timer.loops - Timer._loopsCounter == 0) {
			this.object.set_visible(this.endVisibility);
			if(this.completionCallback != null) {
				this.completionCallback(this);
			}
			this.release();
		}
	}
	,__class__: flixel_effects_FlxFlicker
};
var flixel_effects_particles_FlxTypedEmitter = function(X,Y,Size) {
	if(Size == null) {
		Size = 0;
	}
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	this._waitForKill = false;
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	this._point = point;
	this._counter = 0;
	this._timer = 0;
	this._explode = true;
	this._quantity = 0;
	this.allowCollisions = 0;
	this.autoUpdateHitbox = false;
	this.immovable = false;
	this.elasticity = new flixel_util_helpers_FlxRangeBounds(0);
	this.acceleration = new flixel_util_helpers_FlxPointRangeBounds(0,0);
	this.drag = new flixel_util_helpers_FlxPointRangeBounds(0,0);
	this.color = new flixel_util_helpers_FlxRangeBounds(-1,-1);
	this.alpha = new flixel_util_helpers_FlxRangeBounds(1);
	this.scale = new flixel_util_helpers_FlxPointRangeBounds(1,1);
	this.lifespan = new flixel_util_helpers_FlxBounds(3);
	this.launchAngle = new flixel_util_helpers_FlxBounds(-180,180);
	this.ignoreAngularVelocity = false;
	this.angle = new flixel_util_helpers_FlxRangeBounds(0);
	this.angularVelocity = new flixel_util_helpers_FlxRangeBounds(0,0);
	this.angularDrag = new flixel_util_helpers_FlxRangeBounds(0,0);
	this.angularAcceleration = new flixel_util_helpers_FlxRangeBounds(0,0);
	this.speed = new flixel_util_helpers_FlxRangeBounds(0,100);
	this.velocity = new flixel_util_helpers_FlxPointRangeBounds(-100,-100,100,100);
	this.keepScaleRatio = false;
	this.launchMode = flixel_effects_particles_FlxEmitterMode.CIRCLE;
	this.height = 0;
	this.width = 0;
	this.y = 0;
	this.x = 0;
	this.frequency = 0.1;
	this.emitting = false;
	this.particleClass = flixel_effects_particles_FlxParticle;
	flixel_group_FlxTypedGroup.call(this,Size);
	var X1 = X;
	var Y1 = Y;
	if(Y1 == null) {
		Y1 = 0;
	}
	if(X1 == null) {
		X1 = 0;
	}
	this.x = X1;
	this.y = Y1;
	this.set_exists(false);
};
$hxClasses["flixel.effects.particles.FlxTypedEmitter"] = flixel_effects_particles_FlxTypedEmitter;
flixel_effects_particles_FlxTypedEmitter.__name__ = "flixel.effects.particles.FlxTypedEmitter";
flixel_effects_particles_FlxTypedEmitter.__super__ = flixel_group_FlxTypedGroup;
flixel_effects_particles_FlxTypedEmitter.prototype = $extend(flixel_group_FlxTypedGroup.prototype,{
	particleClass: null
	,emitting: null
	,frequency: null
	,blend: null
	,x: null
	,y: null
	,width: null
	,height: null
	,launchMode: null
	,keepScaleRatio: null
	,velocity: null
	,speed: null
	,angularAcceleration: null
	,angularDrag: null
	,angularVelocity: null
	,angle: null
	,ignoreAngularVelocity: null
	,launchAngle: null
	,lifespan: null
	,scale: null
	,alpha: null
	,color: null
	,drag: null
	,acceleration: null
	,elasticity: null
	,immovable: null
	,autoUpdateHitbox: null
	,allowCollisions: null
	,_quantity: null
	,_explode: null
	,_timer: null
	,_counter: null
	,_point: null
	,_waitForKill: null
	,destroy: function() {
		this.velocity = flixel_util_FlxDestroyUtil.destroy(this.velocity);
		this.scale = flixel_util_FlxDestroyUtil.destroy(this.scale);
		this.drag = flixel_util_FlxDestroyUtil.destroy(this.drag);
		this.acceleration = flixel_util_FlxDestroyUtil.destroy(this.acceleration);
		this._point = flixel_util_FlxDestroyUtil.put(this._point);
		this.blend = null;
		this.angularAcceleration = null;
		this.angularDrag = null;
		this.angularVelocity = null;
		this.angle = null;
		this.speed = null;
		this.launchAngle = null;
		this.lifespan = null;
		this.alpha = null;
		this.color = null;
		this.elasticity = null;
		flixel_group_FlxTypedGroup.prototype.destroy.call(this);
	}
	,loadParticles: function(Graphics,Quantity,bakedRotationAngles,Multiple,AutoBuffer) {
		if(AutoBuffer == null) {
			AutoBuffer = false;
		}
		if(Multiple == null) {
			Multiple = false;
		}
		if(bakedRotationAngles == null) {
			bakedRotationAngles = 16;
		}
		if(Quantity == null) {
			Quantity = 50;
		}
		this.set_maxSize(Quantity);
		var totalFrames = 1;
		if(Multiple) {
			var sprite = new flixel_FlxSprite();
			sprite.loadGraphic(Graphics,true);
			totalFrames = sprite.numFrames;
			sprite.destroy();
		}
		var _g = 0;
		var _g1 = Quantity;
		while(_g < _g1) {
			var i = _g++;
			this.add(this.loadParticle(Graphics,Quantity,bakedRotationAngles,Multiple,AutoBuffer,totalFrames));
		}
		return this;
	}
	,loadParticle: function(Graphics,Quantity,bakedRotationAngles,Multiple,AutoBuffer,totalFrames) {
		if(AutoBuffer == null) {
			AutoBuffer = false;
		}
		if(Multiple == null) {
			Multiple = false;
		}
		var particle = Type.createInstance(this.particleClass,[]);
		var frame = Multiple ? flixel_FlxG.random.int(0,totalFrames - 1) : -1;
		if(flixel_FlxG.renderBlit && bakedRotationAngles > 0) {
			particle.loadRotatedGraphic(Graphics,bakedRotationAngles,frame,false,AutoBuffer);
		} else {
			particle.loadGraphic(Graphics,Multiple);
		}
		if(Multiple) {
			particle.animation.set_frameIndex(frame);
		}
		return particle;
	}
	,makeParticles: function(Width,Height,Color,Quantity) {
		if(Quantity == null) {
			Quantity = 50;
		}
		if(Color == null) {
			Color = -1;
		}
		if(Height == null) {
			Height = 2;
		}
		if(Width == null) {
			Width = 2;
		}
		this.set_maxSize(Quantity);
		var _g = 0;
		var _g1 = Quantity;
		while(_g < _g1) {
			var i = _g++;
			var particle = Type.createInstance(this.particleClass,[]);
			particle.makeGraphic(Width,Height,Color);
			this.add(particle);
		}
		return this;
	}
	,update: function(elapsed) {
		if(this.emitting) {
			if(this._explode) {
				this.explode();
			} else {
				this.emitContinuously(elapsed);
			}
		} else if(this._waitForKill) {
			this._timer += elapsed;
			if(this.lifespan.max > 0 && this._timer > this.lifespan.max) {
				this.kill();
				return;
			}
		}
		flixel_group_FlxTypedGroup.prototype.update.call(this,elapsed);
	}
	,explode: function() {
		var amount = this._quantity;
		if(amount <= 0 || amount > this.length) {
			amount = this.length;
		}
		var _g = 0;
		var _g1 = amount;
		while(_g < _g1) {
			var i = _g++;
			this.emitParticle();
		}
		this.onFinished();
	}
	,emitContinuously: function(elapsed) {
		if(this.frequency <= 0) {
			this.emitParticleContinuously();
		} else {
			this._timer += elapsed;
			while(this._timer > this.frequency) {
				this._timer -= this.frequency;
				this.emitParticleContinuously();
			}
		}
	}
	,emitParticleContinuously: function() {
		this.emitParticle();
		this._counter++;
		if(this._quantity > 0 && this._counter >= this._quantity) {
			this.onFinished();
		}
	}
	,onFinished: function() {
		this.emitting = false;
		this._waitForKill = true;
		this._quantity = 0;
	}
	,kill: function() {
		this.emitting = false;
		this._waitForKill = false;
		flixel_group_FlxTypedGroup.prototype.kill.call(this);
	}
	,start: function(Explode,Frequency,Quantity) {
		if(Quantity == null) {
			Quantity = 0;
		}
		if(Frequency == null) {
			Frequency = 0.1;
		}
		if(Explode == null) {
			Explode = true;
		}
		this.set_exists(true);
		this.set_visible(true);
		this.emitting = true;
		this._explode = Explode;
		this.frequency = Frequency;
		this._quantity += Quantity;
		this._counter = 0;
		this._timer = 0;
		this._waitForKill = false;
		return this;
	}
	,emitParticle: function() {
		var particle = this.recycle(this.particleClass);
		particle.reset(0,0);
		particle.set_blend(this.blend);
		particle.set_immovable(this.immovable);
		particle.set_solid((this.allowCollisions & 4369) > 0);
		particle.set_allowCollisions(this.allowCollisions);
		particle.autoUpdateHitbox = this.autoUpdateHitbox;
		if(this.lifespan.active) {
			particle.lifespan = flixel_FlxG.random.float(this.lifespan.min,this.lifespan.max);
		}
		if(this.velocity.active) {
			var tmp;
			if(particle.lifespan > 0) {
				var _this = particle.velocityRange.start;
				var point = particle.velocityRange.end;
				var result = Math.abs(_this.x - point.x) <= 0.0000001 && Math.abs(_this.y - point.y) <= 0.0000001;
				if(point._weak) {
					point.put();
				}
				tmp = !result;
			} else {
				tmp = false;
			}
			particle.velocityRange.active = tmp;
			if(this.launchMode == flixel_effects_particles_FlxEmitterMode.CIRCLE) {
				var particleAngle = 0;
				if(this.launchAngle.active) {
					particleAngle = flixel_FlxG.random.float(this.launchAngle.min,this.launchAngle.max);
				}
				var Speed = flixel_FlxG.random.float(this.speed.start.min,this.speed.start.max);
				var a = particleAngle * (Math.PI / 180);
				var X = Math.cos(a) * Speed;
				var Y = Math.sin(a) * Speed;
				if(Y == null) {
					Y = 0;
				}
				if(X == null) {
					X = 0;
				}
				var point = flixel_math_FlxPoint._pool.get().set(X,Y);
				point._inPool = false;
				this._point = point;
				particle.velocity.set_x(this._point.x);
				particle.velocity.set_y(this._point.y);
				particle.velocityRange.start.set(this._point.x,this._point.y);
				var Speed = flixel_FlxG.random.float(this.speed.end.min,this.speed.end.max);
				var a = particleAngle * (Math.PI / 180);
				var X = Math.cos(a) * Speed;
				var Y = Math.sin(a) * Speed;
				if(Y == null) {
					Y = 0;
				}
				if(X == null) {
					X = 0;
				}
				var point = flixel_math_FlxPoint._pool.get().set(X,Y);
				point._inPool = false;
				this._point = point;
				particle.velocityRange.end.set(this._point.x,this._point.y);
			} else {
				particle.velocityRange.start.set_x(flixel_FlxG.random.float(this.velocity.start.min.x,this.velocity.start.max.x));
				particle.velocityRange.start.set_y(flixel_FlxG.random.float(this.velocity.start.min.y,this.velocity.start.max.y));
				particle.velocityRange.end.set_x(flixel_FlxG.random.float(this.velocity.end.min.x,this.velocity.end.max.x));
				particle.velocityRange.end.set_y(flixel_FlxG.random.float(this.velocity.end.min.y,this.velocity.end.max.y));
				particle.velocity.set_x(particle.velocityRange.start.x);
				particle.velocity.set_y(particle.velocityRange.start.y);
			}
		} else {
			particle.velocityRange.active = false;
		}
		particle.angularVelocityRange.active = particle.lifespan > 0 && this.angularVelocity.start != this.angularVelocity.end;
		if(!this.ignoreAngularVelocity) {
			if(this.angularAcceleration.active) {
				particle.angularAcceleration = flixel_FlxG.random.float(this.angularAcceleration.start.min,this.angularAcceleration.start.max);
			}
			if(this.angularVelocity.active) {
				particle.angularVelocityRange.start = flixel_FlxG.random.float(this.angularVelocity.start.min,this.angularVelocity.start.max);
				particle.angularVelocityRange.end = flixel_FlxG.random.float(this.angularVelocity.end.min,this.angularVelocity.end.max);
				particle.angularVelocity = particle.angularVelocityRange.start;
			}
			if(this.angularDrag.active) {
				particle.angularDrag = flixel_FlxG.random.float(this.angularDrag.start.min,this.angularDrag.start.max);
			}
		} else if(this.angularVelocity.active) {
			particle.angularVelocity = (flixel_FlxG.random.float(this.angle.end.min,this.angle.end.max) - flixel_FlxG.random.float(this.angle.start.min,this.angle.start.max)) / flixel_FlxG.random.float(this.lifespan.min,this.lifespan.max);
			particle.angularVelocityRange.active = false;
		}
		if(this.angle.active) {
			particle.set_angle(flixel_FlxG.random.float(this.angle.start.min,this.angle.start.max));
		}
		if(this.scale.active) {
			particle.scaleRange.start.set_x(flixel_FlxG.random.float(this.scale.start.min.x,this.scale.start.max.x));
			particle.scaleRange.start.set_y(this.keepScaleRatio ? particle.scaleRange.start.x : flixel_FlxG.random.float(this.scale.start.min.y,this.scale.start.max.y));
			particle.scaleRange.end.set_x(flixel_FlxG.random.float(this.scale.end.min.x,this.scale.end.max.x));
			particle.scaleRange.end.set_y(this.keepScaleRatio ? particle.scaleRange.end.x : flixel_FlxG.random.float(this.scale.end.min.y,this.scale.end.max.y));
			var tmp;
			if(particle.lifespan > 0) {
				var _this = particle.scaleRange.start;
				var point = particle.scaleRange.end;
				var result = Math.abs(_this.x - point.x) <= 0.0000001 && Math.abs(_this.y - point.y) <= 0.0000001;
				if(point._weak) {
					point.put();
				}
				tmp = !result;
			} else {
				tmp = false;
			}
			particle.scaleRange.active = tmp;
			particle.scale.set_x(particle.scaleRange.start.x);
			particle.scale.set_y(particle.scaleRange.start.y);
			if(particle.autoUpdateHitbox) {
				particle.updateHitbox();
			}
		} else {
			particle.scaleRange.active = false;
		}
		if(this.alpha.active) {
			particle.alphaRange.start = flixel_FlxG.random.float(this.alpha.start.min,this.alpha.start.max);
			particle.alphaRange.end = flixel_FlxG.random.float(this.alpha.end.min,this.alpha.end.max);
			particle.alphaRange.active = particle.lifespan > 0 && particle.alphaRange.start != particle.alphaRange.end;
			particle.set_alpha(particle.alphaRange.start);
		} else {
			particle.alphaRange.active = false;
		}
		if(this.color.active) {
			particle.colorRange.start = flixel_FlxG.random.color(this.color.start.min,this.color.start.max);
			particle.colorRange.end = flixel_FlxG.random.color(this.color.end.min,this.color.end.max);
			particle.colorRange.active = particle.lifespan > 0 && particle.colorRange.start != particle.colorRange.end;
			particle.set_color(particle.colorRange.start);
		} else {
			particle.colorRange.active = false;
		}
		if(this.drag.active) {
			particle.dragRange.start.set_x(flixel_FlxG.random.float(this.drag.start.min.x,this.drag.start.max.x));
			particle.dragRange.start.set_y(flixel_FlxG.random.float(this.drag.start.min.y,this.drag.start.max.y));
			particle.dragRange.end.set_x(flixel_FlxG.random.float(this.drag.end.min.x,this.drag.end.max.x));
			particle.dragRange.end.set_y(flixel_FlxG.random.float(this.drag.end.min.y,this.drag.end.max.y));
			var tmp;
			if(particle.lifespan > 0) {
				var _this = particle.dragRange.start;
				var point = particle.dragRange.end;
				var result = Math.abs(_this.x - point.x) <= 0.0000001 && Math.abs(_this.y - point.y) <= 0.0000001;
				if(point._weak) {
					point.put();
				}
				tmp = !result;
			} else {
				tmp = false;
			}
			particle.dragRange.active = tmp;
			particle.drag.set_x(particle.dragRange.start.x);
			particle.drag.set_y(particle.dragRange.start.y);
		} else {
			particle.dragRange.active = false;
		}
		if(this.acceleration.active) {
			particle.accelerationRange.start.set_x(flixel_FlxG.random.float(this.acceleration.start.min.x,this.acceleration.start.max.x));
			particle.accelerationRange.start.set_y(flixel_FlxG.random.float(this.acceleration.start.min.y,this.acceleration.start.max.y));
			particle.accelerationRange.end.set_x(flixel_FlxG.random.float(this.acceleration.end.min.x,this.acceleration.end.max.x));
			particle.accelerationRange.end.set_y(flixel_FlxG.random.float(this.acceleration.end.min.y,this.acceleration.end.max.y));
			var tmp;
			if(particle.lifespan > 0) {
				var _this = particle.accelerationRange.start;
				var point = particle.accelerationRange.end;
				var result = Math.abs(_this.x - point.x) <= 0.0000001 && Math.abs(_this.y - point.y) <= 0.0000001;
				if(point._weak) {
					point.put();
				}
				tmp = !result;
			} else {
				tmp = false;
			}
			particle.accelerationRange.active = tmp;
			particle.acceleration.set_x(particle.accelerationRange.start.x);
			particle.acceleration.set_y(particle.accelerationRange.start.y);
		} else {
			particle.accelerationRange.active = false;
		}
		if(this.elasticity.active) {
			particle.elasticityRange.start = flixel_FlxG.random.float(this.elasticity.start.min,this.elasticity.start.max);
			particle.elasticityRange.end = flixel_FlxG.random.float(this.elasticity.end.min,this.elasticity.end.max);
			particle.elasticityRange.active = particle.lifespan > 0 && particle.elasticityRange.start != particle.elasticityRange.end;
			particle.elasticity = particle.elasticityRange.start;
		} else {
			particle.elasticityRange.active = false;
		}
		particle.set_x(flixel_FlxG.random.float(this.x,this.x + this.width) - particle.get_width() / 2);
		particle.set_y(flixel_FlxG.random.float(this.y,this.y + this.height) - particle.get_height() / 2);
		if(particle.animation._curAnim != null) {
			particle.animation._curAnim.restart();
		}
		particle.onEmit();
		return particle;
	}
	,focusOn: function(Object1) {
		Object1.getMidpoint(this._point);
		this.x = this._point.x - ((this.width | 0) >> 1);
		this.y = this._point.y - ((this.height | 0) >> 1);
	}
	,setPosition: function(X,Y) {
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		this.x = X;
		this.y = Y;
	}
	,setSize: function(Width,Height) {
		this.width = Width;
		this.height = Height;
	}
	,get_solid: function() {
		return (this.allowCollisions & 4369) > 0;
	}
	,set_solid: function(Solid) {
		if(Solid) {
			this.allowCollisions = 4369;
		} else {
			this.allowCollisions = 0;
		}
		return Solid;
	}
	,__class__: flixel_effects_particles_FlxTypedEmitter
	,__properties__: $extend(flixel_group_FlxTypedGroup.prototype.__properties__,{set_solid:"set_solid",get_solid:"get_solid"})
});
var flixel_effects_particles_FlxEmitterMode = $hxEnums["flixel.effects.particles.FlxEmitterMode"] = { __ename__ : "flixel.effects.particles.FlxEmitterMode", __constructs__ : ["SQUARE","CIRCLE"]
	,SQUARE: {_hx_index:0,__enum__:"flixel.effects.particles.FlxEmitterMode",toString:$estr}
	,CIRCLE: {_hx_index:1,__enum__:"flixel.effects.particles.FlxEmitterMode",toString:$estr}
};
var flixel_effects_particles_IFlxParticle = function() { };
$hxClasses["flixel.effects.particles.IFlxParticle"] = flixel_effects_particles_IFlxParticle;
flixel_effects_particles_IFlxParticle.__name__ = "flixel.effects.particles.IFlxParticle";
flixel_effects_particles_IFlxParticle.__isInterface__ = true;
flixel_effects_particles_IFlxParticle.__interfaces__ = [flixel_IFlxSprite];
flixel_effects_particles_IFlxParticle.prototype = {
	lifespan: null
	,age: null
	,percent: null
	,autoUpdateHitbox: null
	,velocityRange: null
	,angularVelocityRange: null
	,scaleRange: null
	,alphaRange: null
	,colorRange: null
	,dragRange: null
	,accelerationRange: null
	,elasticityRange: null
	,onEmit: null
	,__class__: flixel_effects_particles_IFlxParticle
};
var flixel_effects_particles_FlxParticle = function() {
	this._delta = 0;
	this.autoUpdateHitbox = false;
	this.percent = 0;
	this.age = 0;
	this.lifespan = 0;
	flixel_FlxSprite.call(this);
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	var point1 = flixel_math_FlxPoint._pool.get().set(0,0);
	point1._inPool = false;
	this.velocityRange = new flixel_util_helpers_FlxRange(point,point1);
	this.angularVelocityRange = new flixel_util_helpers_FlxRange(0);
	var X = 1;
	var Y = 1;
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	var point = flixel_math_FlxPoint._pool.get().set(X,Y);
	point._inPool = false;
	var X = 1;
	var Y = 1;
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	var point1 = flixel_math_FlxPoint._pool.get().set(X,Y);
	point1._inPool = false;
	this.scaleRange = new flixel_util_helpers_FlxRange(point,point1);
	this.alphaRange = new flixel_util_helpers_FlxRange(1,1);
	this.colorRange = new flixel_util_helpers_FlxRange(-1);
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	var point1 = flixel_math_FlxPoint._pool.get().set(0,0);
	point1._inPool = false;
	this.dragRange = new flixel_util_helpers_FlxRange(point,point1);
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	var point1 = flixel_math_FlxPoint._pool.get().set(0,0);
	point1._inPool = false;
	this.accelerationRange = new flixel_util_helpers_FlxRange(point,point1);
	this.elasticityRange = new flixel_util_helpers_FlxRange(0);
	this.set_exists(false);
};
$hxClasses["flixel.effects.particles.FlxParticle"] = flixel_effects_particles_FlxParticle;
flixel_effects_particles_FlxParticle.__name__ = "flixel.effects.particles.FlxParticle";
flixel_effects_particles_FlxParticle.__interfaces__ = [flixel_effects_particles_IFlxParticle];
flixel_effects_particles_FlxParticle.__super__ = flixel_FlxSprite;
flixel_effects_particles_FlxParticle.prototype = $extend(flixel_FlxSprite.prototype,{
	lifespan: null
	,age: null
	,percent: null
	,autoUpdateHitbox: null
	,velocityRange: null
	,angularVelocityRange: null
	,scaleRange: null
	,alphaRange: null
	,colorRange: null
	,dragRange: null
	,accelerationRange: null
	,elasticityRange: null
	,_delta: null
	,destroy: function() {
		if(this.velocityRange != null) {
			this.velocityRange.start = flixel_util_FlxDestroyUtil.put(this.velocityRange.start);
			this.velocityRange.end = flixel_util_FlxDestroyUtil.put(this.velocityRange.end);
			this.velocityRange = null;
		}
		if(this.scaleRange != null) {
			this.scaleRange.start = flixel_util_FlxDestroyUtil.put(this.scaleRange.start);
			this.scaleRange.end = flixel_util_FlxDestroyUtil.put(this.scaleRange.end);
			this.scaleRange = null;
		}
		if(this.dragRange != null) {
			this.dragRange.start = flixel_util_FlxDestroyUtil.put(this.dragRange.start);
			this.dragRange.end = flixel_util_FlxDestroyUtil.put(this.dragRange.end);
			this.dragRange = null;
		}
		if(this.accelerationRange != null) {
			this.accelerationRange.start = flixel_util_FlxDestroyUtil.put(this.accelerationRange.start);
			this.accelerationRange.end = flixel_util_FlxDestroyUtil.put(this.accelerationRange.end);
			this.angularVelocityRange = null;
		}
		this.alphaRange = null;
		this.colorRange = null;
		this.accelerationRange = null;
		this.elasticityRange = null;
		flixel_FlxSprite.prototype.destroy.call(this);
	}
	,update: function(elapsed) {
		if(this.age < this.lifespan) {
			this.age += elapsed;
		}
		if(this.age >= this.lifespan && this.lifespan != 0) {
			this.kill();
		} else {
			this._delta = elapsed / this.lifespan;
			this.percent = this.age / this.lifespan;
			if(this.velocityRange.active) {
				var _g = this.velocity;
				_g.set_x(_g.x + (this.velocityRange.end.x - this.velocityRange.start.x) * this._delta);
				var _g = this.velocity;
				_g.set_y(_g.y + (this.velocityRange.end.y - this.velocityRange.start.y) * this._delta);
			}
			if(this.angularVelocityRange.active) {
				this.angularVelocity += (this.angularVelocityRange.end - this.angularVelocityRange.start) * this._delta;
			}
			if(this.scaleRange.active) {
				var _g = this.scale;
				_g.set_x(_g.x + (this.scaleRange.end.x - this.scaleRange.start.x) * this._delta);
				var _g = this.scale;
				_g.set_y(_g.y + (this.scaleRange.end.y - this.scaleRange.start.y) * this._delta);
				if(this.autoUpdateHitbox) {
					this.updateHitbox();
				}
			}
			if(this.alphaRange.active) {
				var _g = this;
				_g.set_alpha(_g.alpha + (this.alphaRange.end - this.alphaRange.start) * this._delta);
			}
			if(this.colorRange.active) {
				var Color1 = this.colorRange.start;
				var Color2 = this.colorRange.end;
				var Factor = this.percent;
				if(Factor == null) {
					Factor = 0.5;
				}
				var r = ((Color2 >> 16 & 255) - (Color1 >> 16 & 255)) * Factor + (Color1 >> 16 & 255) | 0;
				var g = ((Color2 >> 8 & 255) - (Color1 >> 8 & 255)) * Factor + (Color1 >> 8 & 255) | 0;
				var b = ((Color2 & 255) - (Color1 & 255)) * Factor + (Color1 & 255) | 0;
				var a = ((Color2 >> 24 & 255) - (Color1 >> 24 & 255)) * Factor + (Color1 >> 24 & 255) | 0;
				var Alpha = a;
				if(Alpha == null) {
					Alpha = 255;
				}
				var color = flixel_util_FlxColor._new();
				var Alpha1 = Alpha;
				if(Alpha1 == null) {
					Alpha1 = 255;
				}
				color &= -16711681;
				color |= (r > 255 ? 255 : r < 0 ? 0 : r) << 16;
				color &= -65281;
				color |= (g > 255 ? 255 : g < 0 ? 0 : g) << 8;
				color &= -256;
				color |= b > 255 ? 255 : b < 0 ? 0 : b;
				color &= 16777215;
				color |= (Alpha1 > 255 ? 255 : Alpha1 < 0 ? 0 : Alpha1) << 24;
				this.set_color(color);
			}
			if(this.dragRange.active) {
				var _g = this.drag;
				_g.set_x(_g.x + (this.dragRange.end.x - this.dragRange.start.x) * this._delta);
				var _g = this.drag;
				_g.set_y(_g.y + (this.dragRange.end.y - this.dragRange.start.y) * this._delta);
			}
			if(this.accelerationRange.active) {
				var _g = this.acceleration;
				_g.set_x(_g.x + (this.accelerationRange.end.x - this.accelerationRange.start.x) * this._delta);
				var _g = this.acceleration;
				_g.set_y(_g.y + (this.accelerationRange.end.y - this.accelerationRange.start.y) * this._delta);
			}
			if(this.elasticityRange.active) {
				this.elasticity += (this.elasticityRange.end - this.elasticityRange.start) * this._delta;
			}
		}
		flixel_FlxSprite.prototype.update.call(this,elapsed);
	}
	,reset: function(X,Y) {
		flixel_FlxSprite.prototype.reset.call(this,X,Y);
		this.age = 0;
		this.set_visible(true);
	}
	,onEmit: function() {
	}
	,__class__: flixel_effects_particles_FlxParticle
});
var flixel_effects_postprocess_PostProcess = function(shader) {
};
$hxClasses["flixel.effects.postprocess.PostProcess"] = flixel_effects_postprocess_PostProcess;
flixel_effects_postprocess_PostProcess.__name__ = "flixel.effects.postprocess.PostProcess";
flixel_effects_postprocess_PostProcess.prototype = {
	enable: function(to) {
	}
	,capture: function() {
	}
	,rebuild: function() {
	}
	,update: function(elapsed) {
	}
	,render: function(rect) {
	}
	,setUniform: function(uniform,value) {
	}
	,set_to: function(value) {
		return null;
	}
	,__class__: flixel_effects_postprocess_PostProcess
	,__properties__: {set_to:"set_to"}
};
var flixel_graphics_FlxGraphic = function(Key,Bitmap,Persist) {
	this._destroyOnNoUse = true;
	this._useCount = 0;
	this.unique = false;
	this.isDumped = false;
	this.persist = false;
	this.height = 0;
	this.width = 0;
	this.key = Key;
	this.persist = Persist != null ? Persist : flixel_graphics_FlxGraphic.defaultPersist;
	this.frameCollections = new haxe_ds_EnumValueMap();
	this.frameCollectionTypes = [];
	this.set_bitmap(Bitmap);
	this.shader = new flixel_graphics_tile_FlxGraphicsShader();
};
$hxClasses["flixel.graphics.FlxGraphic"] = flixel_graphics_FlxGraphic;
flixel_graphics_FlxGraphic.__name__ = "flixel.graphics.FlxGraphic";
flixel_graphics_FlxGraphic.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_graphics_FlxGraphic.fromAssetKey = function(Source,Unique,Key,Cache1) {
	if(Cache1 == null) {
		Cache1 = true;
	}
	if(Unique == null) {
		Unique = false;
	}
	var bitmap = null;
	if(!Cache1) {
		bitmap = openfl_utils_Assets.exists(Source) ? openfl_utils_Assets.getBitmapData(Source,false) : null;
		if(bitmap == null) {
			return null;
		}
		return flixel_graphics_FlxGraphic.createGraphic(bitmap,Key,Unique,Cache1);
	}
	var key = flixel_FlxG.bitmap.generateKey(Source,Key,Unique);
	var graphic = flixel_FlxG.bitmap._cache.h[key];
	if(graphic != null) {
		return graphic;
	}
	bitmap = openfl_utils_Assets.exists(Source) ? openfl_utils_Assets.getBitmapData(Source,false) : null;
	if(bitmap == null) {
		return null;
	}
	graphic = flixel_graphics_FlxGraphic.createGraphic(bitmap,key,Unique);
	graphic.assetsKey = Source;
	return graphic;
};
flixel_graphics_FlxGraphic.fromClass = function(Source,Unique,Key,Cache1) {
	if(Cache1 == null) {
		Cache1 = true;
	}
	if(Unique == null) {
		Unique = false;
	}
	var bitmap = null;
	if(!Cache1) {
		bitmap = Type.createInstance(Source,[0,0]);
		return flixel_graphics_FlxGraphic.createGraphic(bitmap,Key,Unique,Cache1);
	}
	var _this = flixel_FlxG.bitmap;
	var key = Source.__name__;
	key = flixel_FlxG.bitmap.generateKey(key,Key,Unique);
	var graphic = flixel_FlxG.bitmap._cache.h[key];
	if(graphic != null) {
		return graphic;
	}
	bitmap = Type.createInstance(Source,[0,0]);
	graphic = flixel_graphics_FlxGraphic.createGraphic(bitmap,key,Unique);
	graphic.assetsClass = Source;
	return graphic;
};
flixel_graphics_FlxGraphic.fromBitmapData = function(Source,Unique,Key,Cache1) {
	if(Cache1 == null) {
		Cache1 = true;
	}
	if(Unique == null) {
		Unique = false;
	}
	if(!Cache1) {
		return flixel_graphics_FlxGraphic.createGraphic(Source,Key,Unique,Cache1);
	}
	var key = flixel_FlxG.bitmap.findKeyForBitmap(Source);
	var assetKey = null;
	var assetClass = null;
	var graphic = null;
	if(key != null) {
		graphic = flixel_FlxG.bitmap._cache.h[key];
		assetKey = graphic.assetsKey;
		assetClass = graphic.assetsClass;
	}
	key = flixel_FlxG.bitmap.generateKey(key,Key,Unique);
	graphic = flixel_FlxG.bitmap._cache.h[key];
	if(graphic != null) {
		return graphic;
	}
	graphic = flixel_graphics_FlxGraphic.createGraphic(Source,key,Unique);
	graphic.assetsKey = assetKey;
	graphic.assetsClass = assetClass;
	return graphic;
};
flixel_graphics_FlxGraphic.fromFrame = function(Source,Unique,Key,Cache1) {
	if(Cache1 == null) {
		Cache1 = true;
	}
	if(Unique == null) {
		Unique = false;
	}
	var key = Source.name;
	if(key == null) {
		var _this = Source.frame;
		var value = _this.x;
		var _this1 = flixel_util_LabelValuePair._pool.get();
		_this1.label = "x";
		_this1.value = value;
		var value = _this.y;
		var _this2 = flixel_util_LabelValuePair._pool.get();
		_this2.label = "y";
		_this2.value = value;
		var value = _this.width;
		var _this3 = flixel_util_LabelValuePair._pool.get();
		_this3.label = "w";
		_this3.value = value;
		var value = _this.height;
		var _this = flixel_util_LabelValuePair._pool.get();
		_this.label = "h";
		_this.value = value;
		key = flixel_util_FlxStringUtil.getDebugString([_this1,_this2,_this3,_this]);
	}
	key = Source.parent.key + ":" + key;
	key = flixel_FlxG.bitmap.generateKey(key,Key,Unique);
	var graphic = flixel_FlxG.bitmap._cache.h[key];
	if(graphic != null) {
		return graphic;
	}
	var bitmap = Source.paint();
	graphic = flixel_graphics_FlxGraphic.createGraphic(bitmap,key,Unique,Cache1);
	var image = flixel_graphics_frames_FlxImageFrame.fromGraphic(graphic);
	image.frames[0].name = Source.name;
	return graphic;
};
flixel_graphics_FlxGraphic.fromFrames = function(Source,Unique,Key) {
	if(Unique == null) {
		Unique = false;
	}
	return flixel_graphics_FlxGraphic.fromGraphic(Source.parent,Unique,Key);
};
flixel_graphics_FlxGraphic.fromGraphic = function(Source,Unique,Key) {
	if(Unique == null) {
		Unique = false;
	}
	if(!Unique) {
		return Source;
	}
	var key = flixel_FlxG.bitmap.generateKey(Source.key,Key,Unique);
	var graphic = flixel_graphics_FlxGraphic.createGraphic(Source.bitmap,key,Unique);
	graphic.unique = Unique;
	graphic.assetsClass = Source.assetsClass;
	graphic.assetsKey = Source.assetsKey;
	flixel_FlxG.bitmap._cache.h[graphic.key] = graphic;
	return graphic;
};
flixel_graphics_FlxGraphic.fromRectangle = function(Width,Height,Color,Unique,Key) {
	if(Unique == null) {
		Unique = false;
	}
	var systemKey = Width + "x" + Height + ":" + Color;
	var key = flixel_FlxG.bitmap.generateKey(systemKey,Key,Unique);
	var graphic = flixel_FlxG.bitmap._cache.h[key];
	if(graphic != null) {
		return graphic;
	}
	var bitmap = new openfl_display_BitmapData(Width,Height,true,Color);
	return flixel_graphics_FlxGraphic.createGraphic(bitmap,key);
};
flixel_graphics_FlxGraphic.getBitmap = function(Bitmap,Unique) {
	if(Unique == null) {
		Unique = false;
	}
	if(Unique) {
		return Bitmap.clone();
	} else {
		return Bitmap;
	}
};
flixel_graphics_FlxGraphic.createGraphic = function(Bitmap,Key,Unique,Cache1) {
	if(Cache1 == null) {
		Cache1 = true;
	}
	if(Unique == null) {
		Unique = false;
	}
	var Unique1 = Unique;
	if(Unique1 == null) {
		Unique1 = false;
	}
	if(Unique1) {
		Bitmap = Bitmap.clone();
	}
	var graphic = null;
	if(Cache1) {
		graphic = new flixel_graphics_FlxGraphic(Key,Bitmap);
		graphic.unique = Unique;
		flixel_FlxG.bitmap._cache.h[graphic.key] = graphic;
	} else {
		graphic = new flixel_graphics_FlxGraphic(null,Bitmap);
	}
	return graphic;
};
flixel_graphics_FlxGraphic.prototype = {
	key: null
	,bitmap: null
	,width: null
	,height: null
	,assetsKey: null
	,assetsClass: null
	,persist: null
	,isDumped: null
	,shader: null
	,frameCollections: null
	,frameCollectionTypes: null
	,unique: null
	,_imageFrame: null
	,_useCount: null
	,_destroyOnNoUse: null
	,dump: function() {
	}
	,undump: function() {
		var newBitmap = this.getBitmapFromSystem();
		if(newBitmap != null) {
			this.set_bitmap(newBitmap);
		}
		this.isDumped = false;
	}
	,onContext: function() {
		if(this.isDumped) {
			this.undump();
			this.dump();
		}
	}
	,onAssetsReload: function() {
		if(!(this.assetsClass != null || this.assetsKey != null)) {
			return;
		}
		var dumped = this.isDumped;
		this.undump();
		if(dumped) {
			this.dump();
		}
	}
	,destroy: function() {
		this.set_bitmap(flixel_util_FlxDestroyUtil.dispose(this.bitmap));
		this.shader = null;
		this.key = null;
		this.assetsKey = null;
		this.assetsClass = null;
		this._imageFrame = null;
		if(this.frameCollections == null) {
			return;
		}
		var collections;
		var _g = 0;
		var _g1 = this.frameCollectionTypes;
		while(_g < _g1.length) {
			var collectionType = _g1[_g];
			++_g;
			collections = this.frameCollections.get(collectionType);
			flixel_util_FlxDestroyUtil.destroyArray(collections);
		}
		this.frameCollections = null;
		this.frameCollectionTypes = null;
	}
	,addFrameCollection: function(collection) {
		if(collection.type != null) {
			var type = collection.type;
			var collections = this.frameCollections.get(type);
			if(collections == null) {
				collections = [];
				this.frameCollections.set(type,collections);
			}
			var collections1 = collections;
			collections1.push(collection);
		}
	}
	,getFramesCollections: function(type) {
		var collections = this.frameCollections.get(type);
		if(collections == null) {
			collections = [];
			this.frameCollections.set(type,collections);
		}
		return collections;
	}
	,getEmptyFrame: function(size) {
		var frame = new flixel_graphics_frames_FlxFrame(this);
		frame.type = 2;
		var _this = flixel_math_FlxRect._pool.get();
		var X = 0;
		var Y = 0;
		var Width = 0;
		var Height = 0;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		var rect = _this;
		rect._inPool = false;
		frame.set_frame(rect);
		var _this = frame.sourceSize;
		_this.set_x(size.x);
		_this.set_y(size.y);
		if(size._weak) {
			size.put();
		}
		return frame;
	}
	,getBitmapFromSystem: function() {
		var newBitmap = null;
		if(this.assetsClass != null) {
			newBitmap = Type.createInstance(this.assetsClass,[0,0]);
		} else if(this.assetsKey != null) {
			var id = this.assetsKey;
			newBitmap = openfl_utils_Assets.exists(id) ? openfl_utils_Assets.getBitmapData(id,false) : null;
		}
		if(newBitmap != null) {
			var Unique = this.unique;
			if(Unique == null) {
				Unique = false;
			}
			if(Unique) {
				return newBitmap.clone();
			} else {
				return newBitmap;
			}
		}
		return null;
	}
	,get_canBeDumped: function() {
		if(this.assetsClass == null) {
			return this.assetsKey != null;
		} else {
			return true;
		}
	}
	,get_useCount: function() {
		return this._useCount;
	}
	,set_useCount: function(Value) {
		if(Value <= 0 && this._destroyOnNoUse && !this.persist) {
			flixel_FlxG.bitmap.remove(this);
		}
		return this._useCount = Value;
	}
	,get_destroyOnNoUse: function() {
		return this._destroyOnNoUse;
	}
	,set_destroyOnNoUse: function(Value) {
		if(Value && this._useCount <= 0 && this.key != null && !this.persist) {
			flixel_FlxG.bitmap.remove(this);
		}
		return this._destroyOnNoUse = Value;
	}
	,get_imageFrame: function() {
		if(this._imageFrame == null) {
			var X = 0;
			var Y = 0;
			var Width = this.bitmap.width;
			var Height = this.bitmap.height;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var _this = flixel_math_FlxRect._pool.get();
			var X1 = X;
			var Y1 = Y;
			var Width1 = Width;
			var Height1 = Height;
			if(Height1 == null) {
				Height1 = 0;
			}
			if(Width1 == null) {
				Width1 = 0;
			}
			if(Y1 == null) {
				Y1 = 0;
			}
			if(X1 == null) {
				X1 = 0;
			}
			_this.x = X1;
			_this.y = Y1;
			_this.width = Width1;
			_this.height = Height1;
			var rect = _this;
			rect._inPool = false;
			this._imageFrame = flixel_graphics_frames_FlxImageFrame.fromRectangle(this,rect);
		}
		return this._imageFrame;
	}
	,get_atlasFrames: function() {
		return flixel_graphics_frames_FlxAtlasFrames.findFrame(this,null);
	}
	,set_bitmap: function(value) {
		if(value != null) {
			this.bitmap = value;
			this.width = this.bitmap.width;
			this.height = this.bitmap.height;
		}
		return value;
	}
	,__class__: flixel_graphics_FlxGraphic
	,__properties__: {get_atlasFrames:"get_atlasFrames",get_imageFrame:"get_imageFrame",set_useCount:"set_useCount",get_useCount:"get_useCount",get_canBeDumped:"get_canBeDumped",set_destroyOnNoUse:"set_destroyOnNoUse",get_destroyOnNoUse:"get_destroyOnNoUse",set_bitmap:"set_bitmap"}
};
var openfl_geom_Point = function(x,y) {
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	this.x = x;
	this.y = y;
};
$hxClasses["openfl.geom.Point"] = openfl_geom_Point;
openfl_geom_Point.__name__ = "openfl.geom.Point";
openfl_geom_Point.__limeVector2 = null;
openfl_geom_Point.distance = function(pt1,pt2) {
	var dx = pt1.x - pt2.x;
	var dy = pt1.y - pt2.y;
	return Math.sqrt(dx * dx + dy * dy);
};
openfl_geom_Point.interpolate = function(pt1,pt2,f) {
	return new openfl_geom_Point(pt2.x + f * (pt1.x - pt2.x),pt2.y + f * (pt1.y - pt2.y));
};
openfl_geom_Point.polar = function(len,angle) {
	return new openfl_geom_Point(len * Math.cos(angle),len * Math.sin(angle));
};
openfl_geom_Point.prototype = {
	x: null
	,y: null
	,add: function(v) {
		return new openfl_geom_Point(v.x + this.x,v.y + this.y);
	}
	,clone: function() {
		return new openfl_geom_Point(this.x,this.y);
	}
	,copyFrom: function(sourcePoint) {
		this.x = sourcePoint.x;
		this.y = sourcePoint.y;
	}
	,equals: function(toCompare) {
		if(toCompare != null && toCompare.x == this.x) {
			return toCompare.y == this.y;
		} else {
			return false;
		}
	}
	,normalize: function(thickness) {
		if(this.x == 0 && this.y == 0) {
			return;
		} else {
			var norm = thickness / Math.sqrt(this.x * this.x + this.y * this.y);
			this.x *= norm;
			this.y *= norm;
		}
	}
	,offset: function(dx,dy) {
		this.x += dx;
		this.y += dy;
	}
	,setTo: function(xa,ya) {
		this.x = xa;
		this.y = ya;
	}
	,subtract: function(v) {
		return new openfl_geom_Point(this.x - v.x,this.y - v.y);
	}
	,toString: function() {
		return "(x=" + this.x + ", y=" + this.y + ")";
	}
	,__toLimeVector2: function() {
		if(openfl_geom_Point.__limeVector2 == null) {
			openfl_geom_Point.__limeVector2 = new lime_math_Vector2();
		}
		var _this = openfl_geom_Point.__limeVector2;
		_this.x = this.x;
		_this.y = this.y;
		return openfl_geom_Point.__limeVector2;
	}
	,get_length: function() {
		return Math.sqrt(this.x * this.x + this.y * this.y);
	}
	,__class__: openfl_geom_Point
	,__properties__: {get_length:"get_length"}
};
var flixel_graphics_atlas_FlxAtlas = function(name,powerOfTwo,border,rotate,minSize,maxSize) {
	if(rotate == null) {
		rotate = false;
	}
	if(border == null) {
		border = 1;
	}
	if(powerOfTwo == null) {
		powerOfTwo = false;
	}
	this.powerOfTwo = false;
	this.allowRotation = false;
	this.maxHeight = 1024;
	this.maxWidth = 1024;
	this.minHeight = 128;
	this.minWidth = 128;
	this.border = 1;
	this.persist = false;
	this.nodes = new haxe_ds_StringMap();
	this.name = name;
	this.set_powerOfTwo(powerOfTwo);
	this.border = border;
	if(minSize == null) {
		minSize = flixel_graphics_atlas_FlxAtlas.defaultMinSize;
	}
	if(maxSize == null) {
		maxSize = flixel_graphics_atlas_FlxAtlas.defaultMaxSize;
	}
	this.set_minWidth(minSize.x | 0);
	this.set_minHeight(minSize.y | 0);
	this.set_maxWidth(maxSize.x > minSize.x ? maxSize.x | 0 : this.minWidth);
	this.set_maxHeight(maxSize.y > minSize.x ? maxSize.y | 0 : this.minHeight);
	this.allowRotation = rotate;
	this.initRoot();
	flixel_FlxG.signals.preStateCreate.add($bind(this,this.onClear));
};
$hxClasses["flixel.graphics.atlas.FlxAtlas"] = flixel_graphics_atlas_FlxAtlas;
flixel_graphics_atlas_FlxAtlas.__name__ = "flixel.graphics.atlas.FlxAtlas";
flixel_graphics_atlas_FlxAtlas.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_graphics_atlas_FlxAtlas.prototype = {
	root: null
	,name: null
	,nodes: null
	,bitmapData: null
	,persist: null
	,border: null
	,width: null
	,height: null
	,minWidth: null
	,minHeight: null
	,maxWidth: null
	,maxHeight: null
	,allowRotation: null
	,powerOfTwo: null
	,_graphic: null
	,_tempStorage: null
	,initRoot: function() {
		var rootWidth = this.minWidth;
		var rootHeight = this.minHeight;
		if(this.powerOfTwo) {
			rootWidth = this.getNextPowerOfTwo(rootWidth);
			rootHeight = this.getNextPowerOfTwo(rootHeight);
		}
		var X = 0;
		var Y = 0;
		var Width = rootWidth;
		var Height = rootHeight;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var _this = flixel_math_FlxRect._pool.get();
		var X1 = X;
		var Y1 = Y;
		var Width1 = Width;
		var Height1 = Height;
		if(Height1 == null) {
			Height1 = 0;
		}
		if(Width1 == null) {
			Width1 = 0;
		}
		if(Y1 == null) {
			Y1 = 0;
		}
		if(X1 == null) {
			X1 = 0;
		}
		_this.x = X1;
		_this.y = Y1;
		_this.width = Width1;
		_this.height = Height1;
		var rect = _this;
		rect._inPool = false;
		this.root = new flixel_graphics_atlas_FlxNode(rect,this);
	}
	,addNode: function(Graphic,Key) {
		var key = flixel_system_FlxAssets.resolveKey(Graphic,Key);
		if(key == null) {
			return null;
		}
		if(this.hasNodeWithName(key)) {
			return this.nodes.h[key];
		}
		var data = flixel_system_FlxAssets.resolveBitmapData(Graphic);
		if(data == null) {
			return null;
		}
		if(this.root.left == null) {
			return this.insertFirstNodeInRoot(data,key);
		}
		if(this.root.right == null) {
			return this.expand(data,key);
		}
		var inserted = this.tryInsert(data,key);
		if(inserted != null) {
			return inserted;
		}
		this.wrapRoot();
		return this.expand(data,key);
	}
	,wrapRoot: function() {
		var temp = this.root;
		var X = 0;
		var Y = 0;
		var Width = temp.rect.width | 0;
		var Height = temp.rect.height | 0;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var _this = flixel_math_FlxRect._pool.get();
		var X1 = X;
		var Y1 = Y;
		var Width1 = Width;
		var Height1 = Height;
		if(Height1 == null) {
			Height1 = 0;
		}
		if(Width1 == null) {
			Width1 = 0;
		}
		if(Y1 == null) {
			Y1 = 0;
		}
		if(X1 == null) {
			X1 = 0;
		}
		_this.x = X1;
		_this.y = Y1;
		_this.width = Width1;
		_this.height = Height1;
		var rect = _this;
		rect._inPool = false;
		this.root = new flixel_graphics_atlas_FlxNode(rect,this);
		this.root.left = temp;
	}
	,tryInsert: function(data,key) {
		var insertWidth = data.width + this.border;
		var insertHeight = data.height + this.border;
		var rotateNode = false;
		var nodeToInsert = this.findNodeToInsert(insertWidth,insertHeight);
		if(this.allowRotation) {
			var nodeToInsertWithRotation = this.findNodeToInsert(insertHeight,insertWidth);
			if(nodeToInsertWithRotation != null) {
				var nodeWithRotationArea = (nodeToInsertWithRotation.rect.width | 0) * (nodeToInsertWithRotation.rect.height | 0);
				if(nodeToInsert == null || nodeToInsert != null && (nodeToInsert.rect.width | 0) * (nodeToInsert.rect.height | 0) > nodeWithRotationArea) {
					nodeToInsert = nodeToInsertWithRotation;
					rotateNode = true;
					var temp = insertWidth;
					insertWidth = insertHeight;
					insertHeight = temp;
				}
			}
		}
		if(nodeToInsert != null) {
			var horizontally = this.needToDivideHorizontally(nodeToInsert,insertWidth,insertHeight);
			return this.divideNode(nodeToInsert,insertWidth,insertHeight,horizontally,data,key,rotateNode);
		}
		return null;
	}
	,needToDivideHorizontally: function(nodeToDivide,insertWidth,insertHeight) {
		var dw = (nodeToDivide.rect.width | 0) - insertWidth;
		var dh = (nodeToDivide.rect.height | 0) - insertHeight;
		return dw > dh;
	}
	,divideNode: function(nodeToDivide,insertWidth,insertHeight,divideHorizontally,firstGrandChildData,firstGrandChildKey,firstGrandChildRotated) {
		if(firstGrandChildRotated == null) {
			firstGrandChildRotated = false;
		}
		if(nodeToDivide != null) {
			var firstChild = null;
			var secondChild = null;
			var firstGrandChild = null;
			var secondGrandChild = null;
			var firstGrandChildFilled = firstGrandChildKey != null;
			if(divideHorizontally) {
				var X = nodeToDivide.rect.x | 0;
				var Y = nodeToDivide.rect.y | 0;
				var Width = insertWidth;
				var Height = nodeToDivide.rect.height | 0;
				if(Height == null) {
					Height = 0;
				}
				if(Width == null) {
					Width = 0;
				}
				if(Y == null) {
					Y = 0;
				}
				if(X == null) {
					X = 0;
				}
				var _this = flixel_math_FlxRect._pool.get();
				var X1 = X;
				var Y1 = Y;
				var Width1 = Width;
				var Height1 = Height;
				if(Height1 == null) {
					Height1 = 0;
				}
				if(Width1 == null) {
					Width1 = 0;
				}
				if(Y1 == null) {
					Y1 = 0;
				}
				if(X1 == null) {
					X1 = 0;
				}
				_this.x = X1;
				_this.y = Y1;
				_this.width = Width1;
				_this.height = Height1;
				var rect = _this;
				rect._inPool = false;
				firstChild = new flixel_graphics_atlas_FlxNode(rect,this);
				if((nodeToDivide.rect.width | 0) - insertWidth > 0) {
					var X = (nodeToDivide.rect.x | 0) + insertWidth;
					var Y = nodeToDivide.rect.y | 0;
					var Width = (nodeToDivide.rect.width | 0) - insertWidth;
					var Height = nodeToDivide.rect.height | 0;
					if(Height == null) {
						Height = 0;
					}
					if(Width == null) {
						Width = 0;
					}
					if(Y == null) {
						Y = 0;
					}
					if(X == null) {
						X = 0;
					}
					var _this = flixel_math_FlxRect._pool.get();
					var X1 = X;
					var Y1 = Y;
					var Width1 = Width;
					var Height1 = Height;
					if(Height1 == null) {
						Height1 = 0;
					}
					if(Width1 == null) {
						Width1 = 0;
					}
					if(Y1 == null) {
						Y1 = 0;
					}
					if(X1 == null) {
						X1 = 0;
					}
					_this.x = X1;
					_this.y = Y1;
					_this.width = Width1;
					_this.height = Height1;
					var rect = _this;
					rect._inPool = false;
					secondChild = new flixel_graphics_atlas_FlxNode(rect,this);
				}
				var X = firstChild.rect.x | 0;
				var Y = firstChild.rect.y | 0;
				var Width = insertWidth;
				var Height = insertHeight;
				if(Height == null) {
					Height = 0;
				}
				if(Width == null) {
					Width = 0;
				}
				if(Y == null) {
					Y = 0;
				}
				if(X == null) {
					X = 0;
				}
				var _this = flixel_math_FlxRect._pool.get();
				var X1 = X;
				var Y1 = Y;
				var Width1 = Width;
				var Height1 = Height;
				if(Height1 == null) {
					Height1 = 0;
				}
				if(Width1 == null) {
					Width1 = 0;
				}
				if(Y1 == null) {
					Y1 = 0;
				}
				if(X1 == null) {
					X1 = 0;
				}
				_this.x = X1;
				_this.y = Y1;
				_this.width = Width1;
				_this.height = Height1;
				var rect = _this;
				rect._inPool = false;
				firstGrandChild = new flixel_graphics_atlas_FlxNode(rect,this,firstGrandChildFilled,firstGrandChildKey,firstGrandChildRotated);
				if((firstChild.rect.height | 0) - insertHeight > 0) {
					var X = firstChild.rect.x | 0;
					var Y = (firstChild.rect.y | 0) + insertHeight;
					var Width = insertWidth;
					var Height = (firstChild.rect.height | 0) - insertHeight;
					if(Height == null) {
						Height = 0;
					}
					if(Width == null) {
						Width = 0;
					}
					if(Y == null) {
						Y = 0;
					}
					if(X == null) {
						X = 0;
					}
					var _this = flixel_math_FlxRect._pool.get();
					var X1 = X;
					var Y1 = Y;
					var Width1 = Width;
					var Height1 = Height;
					if(Height1 == null) {
						Height1 = 0;
					}
					if(Width1 == null) {
						Width1 = 0;
					}
					if(Y1 == null) {
						Y1 = 0;
					}
					if(X1 == null) {
						X1 = 0;
					}
					_this.x = X1;
					_this.y = Y1;
					_this.width = Width1;
					_this.height = Height1;
					var rect = _this;
					rect._inPool = false;
					secondGrandChild = new flixel_graphics_atlas_FlxNode(rect,this);
				}
			} else {
				var X = nodeToDivide.rect.x | 0;
				var Y = nodeToDivide.rect.y | 0;
				var Width = nodeToDivide.rect.width | 0;
				var Height = insertHeight;
				if(Height == null) {
					Height = 0;
				}
				if(Width == null) {
					Width = 0;
				}
				if(Y == null) {
					Y = 0;
				}
				if(X == null) {
					X = 0;
				}
				var _this = flixel_math_FlxRect._pool.get();
				var X1 = X;
				var Y1 = Y;
				var Width1 = Width;
				var Height1 = Height;
				if(Height1 == null) {
					Height1 = 0;
				}
				if(Width1 == null) {
					Width1 = 0;
				}
				if(Y1 == null) {
					Y1 = 0;
				}
				if(X1 == null) {
					X1 = 0;
				}
				_this.x = X1;
				_this.y = Y1;
				_this.width = Width1;
				_this.height = Height1;
				var rect = _this;
				rect._inPool = false;
				firstChild = new flixel_graphics_atlas_FlxNode(rect,this);
				if((nodeToDivide.rect.height | 0) - insertHeight > 0) {
					var X = nodeToDivide.rect.x | 0;
					var Y = (nodeToDivide.rect.y | 0) + insertHeight;
					var Width = nodeToDivide.rect.width | 0;
					var Height = (nodeToDivide.rect.height | 0) - insertHeight;
					if(Height == null) {
						Height = 0;
					}
					if(Width == null) {
						Width = 0;
					}
					if(Y == null) {
						Y = 0;
					}
					if(X == null) {
						X = 0;
					}
					var _this = flixel_math_FlxRect._pool.get();
					var X1 = X;
					var Y1 = Y;
					var Width1 = Width;
					var Height1 = Height;
					if(Height1 == null) {
						Height1 = 0;
					}
					if(Width1 == null) {
						Width1 = 0;
					}
					if(Y1 == null) {
						Y1 = 0;
					}
					if(X1 == null) {
						X1 = 0;
					}
					_this.x = X1;
					_this.y = Y1;
					_this.width = Width1;
					_this.height = Height1;
					var rect = _this;
					rect._inPool = false;
					secondChild = new flixel_graphics_atlas_FlxNode(rect,this);
				}
				var X = firstChild.rect.x | 0;
				var Y = firstChild.rect.y | 0;
				var Width = insertWidth;
				var Height = insertHeight;
				if(Height == null) {
					Height = 0;
				}
				if(Width == null) {
					Width = 0;
				}
				if(Y == null) {
					Y = 0;
				}
				if(X == null) {
					X = 0;
				}
				var _this = flixel_math_FlxRect._pool.get();
				var X1 = X;
				var Y1 = Y;
				var Width1 = Width;
				var Height1 = Height;
				if(Height1 == null) {
					Height1 = 0;
				}
				if(Width1 == null) {
					Width1 = 0;
				}
				if(Y1 == null) {
					Y1 = 0;
				}
				if(X1 == null) {
					X1 = 0;
				}
				_this.x = X1;
				_this.y = Y1;
				_this.width = Width1;
				_this.height = Height1;
				var rect = _this;
				rect._inPool = false;
				firstGrandChild = new flixel_graphics_atlas_FlxNode(rect,this,firstGrandChildFilled,firstGrandChildKey,firstGrandChildRotated);
				if((firstChild.rect.width | 0) - insertWidth > 0) {
					var X = (firstChild.rect.x | 0) + insertWidth;
					var Y = firstChild.rect.y | 0;
					var Width = (firstChild.rect.width | 0) - insertWidth;
					var Height = insertHeight;
					if(Height == null) {
						Height = 0;
					}
					if(Width == null) {
						Width = 0;
					}
					if(Y == null) {
						Y = 0;
					}
					if(X == null) {
						X = 0;
					}
					var _this = flixel_math_FlxRect._pool.get();
					var X1 = X;
					var Y1 = Y;
					var Width1 = Width;
					var Height1 = Height;
					if(Height1 == null) {
						Height1 = 0;
					}
					if(Width1 == null) {
						Width1 = 0;
					}
					if(Y1 == null) {
						Y1 = 0;
					}
					if(X1 == null) {
						X1 = 0;
					}
					_this.x = X1;
					_this.y = Y1;
					_this.width = Width1;
					_this.height = Height1;
					var rect = _this;
					rect._inPool = false;
					secondGrandChild = new flixel_graphics_atlas_FlxNode(rect,this);
				}
			}
			firstChild.left = firstGrandChild;
			firstChild.right = secondGrandChild;
			nodeToDivide.left = firstChild;
			nodeToDivide.right = secondChild;
			if(firstGrandChildKey != null && firstGrandChildData != null) {
				this.expandBitmapData();
				if(firstGrandChildRotated) {
					flixel_graphics_atlas_FlxAtlas.matrix.identity();
					flixel_graphics_atlas_FlxAtlas.matrix.rotate(Math.PI / 2);
					flixel_graphics_atlas_FlxAtlas.matrix.translate(firstGrandChildData.height + (firstGrandChild.rect.x | 0),firstGrandChild.rect.y | 0);
					this.bitmapData.draw(firstGrandChildData,flixel_graphics_atlas_FlxAtlas.matrix);
				} else {
					flixel_graphics_atlas_FlxAtlas.point.setTo(firstGrandChild.rect.x | 0,firstGrandChild.rect.y | 0);
					this.bitmapData.copyPixels(firstGrandChildData,firstGrandChildData.rect,flixel_graphics_atlas_FlxAtlas.point);
				}
				this.addNodeToAtlasFrames(firstGrandChild);
				this.nodes.h[firstGrandChildKey] = firstGrandChild;
			}
			return firstGrandChild;
		}
		return null;
	}
	,insertFirstNodeInRoot: function(data,key) {
		if(this.root.left == null) {
			var insertWidth = data.width + this.border;
			var insertHeight = data.height + this.border;
			var rootWidth = insertWidth;
			var rootHeight = insertHeight;
			if(this.powerOfTwo) {
				rootWidth = this.getNextPowerOfTwo(rootWidth);
				rootHeight = this.getNextPowerOfTwo(rootHeight);
			}
			if(this.minWidth > rootWidth) {
				rootWidth = this.minWidth;
			}
			if(this.minHeight > rootHeight) {
				rootHeight = this.minHeight;
			}
			if(this.powerOfTwo) {
				rootWidth = this.getNextPowerOfTwo(rootWidth);
				rootHeight = this.getNextPowerOfTwo(rootHeight);
			}
			if(this.maxWidth > 0 && rootWidth > this.maxWidth || this.maxHeight > 0 && rootHeight > this.maxHeight) {
				return null;
			}
			this.root.set_width(rootWidth);
			this.root.set_height(rootHeight);
			var horizontally = this.needToDivideHorizontally(this.root,insertWidth,insertHeight);
			return this.divideNode(this.root,insertWidth,insertHeight,horizontally,data,key);
		}
		return null;
	}
	,expand: function(data,key) {
		if(this.root.right == null) {
			var insertWidth = data.width + this.border;
			var insertHeight = data.height + this.border;
			var addRightWidth = (this.root.rect.width | 0) + insertWidth;
			var addRightHeight = Math.max(this.root.rect.height | 0,insertHeight) | 0;
			var addBottomWidth = Math.max(this.root.rect.width | 0,insertWidth) | 0;
			var addBottomHeight = (this.root.rect.height | 0) + insertHeight;
			var addRightWidthRotate = addRightWidth;
			var addRightHeightRotate = addRightHeight;
			var addBottomWidthRotate = addBottomWidth;
			var addBottomHeightRotate = addBottomHeight;
			if(this.allowRotation) {
				addRightWidthRotate = (this.root.rect.width | 0) + insertHeight;
				addRightHeightRotate = Math.max(this.root.rect.height | 0,insertWidth) | 0;
				addBottomWidthRotate = Math.max(this.root.rect.width | 0,insertHeight) | 0;
				addBottomHeightRotate = (this.root.rect.height | 0) + insertWidth;
			}
			if(this.powerOfTwo) {
				addRightWidth = this.getNextPowerOfTwo(addRightWidth);
				addRightWidthRotate = addRightWidth;
				addRightHeight = this.getNextPowerOfTwo(addRightHeight);
				addRightHeightRotate = addRightHeight;
				addBottomWidth = this.getNextPowerOfTwo(addBottomWidth);
				addBottomWidthRotate = addBottomWidth;
				addBottomHeight = this.getNextPowerOfTwo(addBottomHeight);
				addBottomHeightRotate = addBottomHeight;
				if(this.allowRotation) {
					addRightWidthRotate = this.getNextPowerOfTwo(addRightWidthRotate);
					addRightHeightRotate = this.getNextPowerOfTwo(addRightHeightRotate);
					addBottomWidthRotate = this.getNextPowerOfTwo(addBottomWidthRotate);
					addBottomHeightRotate = this.getNextPowerOfTwo(addBottomHeightRotate);
				}
			}
			var canExpandRight = true;
			var canExpandBottom = true;
			var canExpandRightRotate = this.allowRotation;
			var canExpandBottomRotate = this.allowRotation;
			if(this.maxWidth > 0 && addRightWidth > this.maxWidth || this.maxHeight > 0 && addRightHeight > this.maxHeight) {
				canExpandRight = false;
			}
			if(this.maxWidth > 0 && addBottomWidth > this.maxWidth || this.maxHeight > 0 && addBottomHeight > this.maxHeight) {
				canExpandBottom = false;
			}
			if(this.maxWidth > 0 && addRightWidthRotate > this.maxWidth || this.maxHeight > 0 && addRightHeightRotate > this.maxHeight) {
				canExpandRightRotate = false;
			}
			if(this.maxWidth > 0 && addBottomWidthRotate > this.maxWidth || this.maxHeight > 0 && addBottomHeightRotate > this.maxHeight) {
				canExpandBottomRotate = false;
			}
			if(!canExpandRight && !canExpandBottom && !canExpandRightRotate && !canExpandBottomRotate) {
				return null;
			}
			var addRightArea = addRightWidth * addRightHeight;
			var addBottomArea = addBottomWidth * addBottomHeight;
			var addRightAreaRotate = addRightWidthRotate * addRightHeightRotate;
			var addBottomAreaRotate = addBottomWidthRotate * addBottomHeightRotate;
			var rotateRight = false;
			var rotateBottom = false;
			var rotateNode = false;
			if(canExpandRight && canExpandRightRotate && addRightArea > addRightAreaRotate || !canExpandRight && canExpandRightRotate) {
				addRightArea = addBottomAreaRotate;
				addRightWidth = addRightWidthRotate;
				addRightHeight = addRightHeightRotate;
				canExpandRight = true;
				rotateRight = true;
			}
			if(canExpandBottom && canExpandBottomRotate && addBottomArea > addBottomAreaRotate || !canExpandBottom && canExpandBottomRotate) {
				addBottomArea = addBottomAreaRotate;
				addBottomWidth = addBottomWidthRotate;
				addBottomHeight = addBottomHeightRotate;
				canExpandBottom = true;
				rotateBottom = true;
			}
			if(!canExpandRight && canExpandBottom) {
				addRightArea = addBottomArea + 1;
				rotateNode = rotateRight;
			} else if(canExpandRight && !canExpandBottom) {
				addBottomArea = addRightArea + 1;
				rotateNode = rotateBottom;
			}
			var dataNode = null;
			var temp = this.root;
			var insertNodeWidth = insertWidth;
			var insertNodeHeight = insertHeight;
			if(addBottomArea >= addRightArea) {
				if(rotateRight) {
					insertNodeWidth = insertHeight;
					insertNodeHeight = insertWidth;
				}
				this.expandRoot((temp.rect.width | 0) + insertNodeWidth,Math.max(temp.rect.height | 0,insertNodeHeight),true);
				dataNode = this.divideNode(this.root.right,insertNodeWidth,insertNodeHeight,true,data,key,rotateRight);
				this.expandRoot(addRightWidth,addRightHeight,false,true);
			} else {
				if(rotateBottom) {
					insertNodeWidth = insertHeight;
					insertNodeHeight = insertWidth;
				}
				this.expandRoot(Math.max(temp.rect.width | 0,insertNodeWidth),(temp.rect.height | 0) + insertNodeHeight,false);
				dataNode = this.divideNode(this.root.right,insertNodeWidth,insertNodeHeight,true,data,key,rotateBottom);
				this.expandRoot(addBottomWidth,addBottomHeight,false,true);
			}
			return dataNode;
		}
		return null;
	}
	,expandRoot: function(newWidth,newHeight,divideHorizontally,decideHowToDivide) {
		if(decideHowToDivide == null) {
			decideHowToDivide = false;
		}
		if(newWidth > (this.root.rect.width | 0) || newHeight > (this.root.rect.height | 0)) {
			var temp = this.root;
			var X = 0;
			var Y = 0;
			var Width = newWidth;
			var Height = newHeight;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var _this = flixel_math_FlxRect._pool.get();
			var X1 = X;
			var Y1 = Y;
			var Width1 = Width;
			var Height1 = Height;
			if(Height1 == null) {
				Height1 = 0;
			}
			if(Width1 == null) {
				Width1 = 0;
			}
			if(Y1 == null) {
				Y1 = 0;
			}
			if(X1 == null) {
				X1 = 0;
			}
			_this.x = X1;
			_this.y = Y1;
			_this.width = Width1;
			_this.height = Height1;
			var rect = _this;
			rect._inPool = false;
			this.root = new flixel_graphics_atlas_FlxNode(rect,this);
			if(decideHowToDivide) {
				divideHorizontally = this.needToDivideHorizontally(this.root,temp.rect.width | 0,temp.rect.height | 0);
			}
			this.divideNode(this.root,temp.rect.width | 0,temp.rect.height | 0,divideHorizontally);
			this.root.left.left = temp;
		}
	}
	,expandBitmapData: function() {
		if(this.bitmapData != null && this.bitmapData.width == (this.root.rect.width | 0) && this.bitmapData.height == (this.root.rect.height | 0)) {
			return;
		}
		var newBitmapData = new openfl_display_BitmapData(this.root.rect.width | 0,this.root.rect.height | 0,true,0);
		if(this.bitmapData != null) {
			flixel_graphics_atlas_FlxAtlas.point.setTo(0,0);
			newBitmapData.copyPixels(this.bitmapData,this.bitmapData.rect,flixel_graphics_atlas_FlxAtlas.point);
		}
		this.set_bitmapData(flixel_util_FlxDestroyUtil.dispose(this.bitmapData));
		this.set_bitmapData(newBitmapData);
	}
	,getNextPowerOfTwo: function(number) {
		var n = number | 0;
		if(n > 0 && (n & n - 1) == 0) {
			return n;
		}
		var result = 1;
		while(result < n) result <<= 1;
		return result;
	}
	,addNodeWithSpacesAndBorders: function(Graphic,Key,tileSize,tileSpacing,tileBorder,region) {
		var key = flixel_system_FlxAssets.resolveKey(Graphic,Key);
		if(key == null) {
			return null;
		}
		key = flixel_FlxG.bitmap.getKeyWithSpacesAndBorders(key,tileSize,tileSpacing,tileBorder,region);
		if(this.hasNodeWithName(key)) {
			return this.nodes.h[key].getTileFrames(tileSize,tileSpacing,tileBorder);
		}
		var data = flixel_system_FlxAssets.resolveBitmapData(Graphic);
		if(data == null) {
			return null;
		}
		var nodeData = flixel_util_FlxBitmapDataUtil.addSpacesAndBorders(data,tileSize,tileSpacing,tileBorder,region);
		var node = this.addNode(nodeData,key);
		if(node == null) {
			return null;
		}
		if(tileBorder != null) {
			var X = 2 * tileBorder.x;
			var Y = 2 * tileBorder.y;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var _g = tileSize;
			_g.set_x(_g.x + X);
			var _g = tileSize;
			_g.set_y(_g.y + Y);
		}
		return node.getTileFrames(tileSize,tileSpacing,tileBorder);
	}
	,getAtlasFrames: function() {
		var graph = this.get_graphic();
		var atlasFrames = graph.get_atlasFrames();
		if(graph.get_atlasFrames() == null) {
			atlasFrames = new flixel_graphics_frames_FlxAtlasFrames(graph);
		}
		var node = haxe_ds_StringMap.valueIterator(this.nodes.h);
		while(node.hasNext()) {
			var node1 = node.next();
			this.addNodeToAtlasFrames(node1);
		}
		return atlasFrames;
	}
	,addNodeToAtlasFrames: function(node) {
		if(this._graphic == null || this._graphic.get_atlasFrames() == null || node == null) {
			return;
		}
		var atlasFrames = this._graphic.get_atlasFrames();
		if(node.filled && !Object.prototype.hasOwnProperty.call(atlasFrames.framesHash.h,node.key)) {
			var X = node.rect.x | 0;
			var Y = node.rect.y | 0;
			var Width = (node.rect.width | 0) - this.border;
			var Height = (node.rect.height | 0) - this.border;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var _this = flixel_math_FlxRect._pool.get();
			var X1 = X;
			var Y1 = Y;
			var Width1 = Width;
			var Height1 = Height;
			if(Height1 == null) {
				Height1 = 0;
			}
			if(Width1 == null) {
				Width1 = 0;
			}
			if(Y1 == null) {
				Y1 = 0;
			}
			if(X1 == null) {
				X1 = 0;
			}
			_this.x = X1;
			_this.y = Y1;
			_this.width = Width1;
			_this.height = Height1;
			var rect = _this;
			rect._inPool = false;
			var frame = rect;
			var sourceSize;
			if(node.rotated) {
				var X = (node.rect.height | 0) - this.border;
				var Y = (node.rect.width | 0) - this.border;
				if(Y == null) {
					Y = 0;
				}
				if(X == null) {
					X = 0;
				}
				var point = flixel_math_FlxPoint._pool.get().set(X,Y);
				point._inPool = false;
				sourceSize = point;
			} else {
				var X = (node.rect.width | 0) - this.border;
				var Y = (node.rect.height | 0) - this.border;
				if(Y == null) {
					Y = 0;
				}
				if(X == null) {
					X = 0;
				}
				var point = flixel_math_FlxPoint._pool.get().set(X,Y);
				point._inPool = false;
				sourceSize = point;
			}
			var X = 0;
			var Y = 0;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			var offset = point;
			var angle = node.rotated ? -90 : 0;
			atlasFrames.addAtlasFrame(frame,sourceSize,offset,node.key,angle);
		}
	}
	,hasNodeWithName: function(nodeName) {
		return Object.prototype.hasOwnProperty.call(this.nodes.h,nodeName);
	}
	,getNode: function(key) {
		return this.nodes.h[key];
	}
	,addNodes: function(bitmaps,keys) {
		var numKeys = keys.length;
		var numBitmaps = bitmaps.length;
		if(numBitmaps != numKeys) {
			return null;
		}
		this._tempStorage = [];
		var _g = 0;
		var _g1 = numBitmaps;
		while(_g < _g1) {
			var i = _g++;
			this._tempStorage.push({ bmd : bitmaps[i], keyStr : keys[i]});
		}
		this.addFromAtlasObjects(this._tempStorage);
		return this;
	}
	,addFromAtlasObjects: function(objects) {
		objects.sort($bind(this,this.bitmapSorter));
		var numBitmaps = objects.length;
		var _g = 0;
		var _g1 = numBitmaps;
		while(_g < _g1) {
			var i = _g++;
			this.addNode(objects[i].bmd,objects[i].keyStr);
		}
		this._tempStorage = null;
	}
	,bitmapSorter: function(obj1,obj2) {
		if(this.allowRotation) {
			var area1 = obj1.bmd.width * obj1.bmd.height;
			var area2 = obj2.bmd.width * obj2.bmd.height;
			return area2 - area1;
		}
		if(obj2.bmd.width == obj1.bmd.width) {
			return obj2.bmd.height - obj1.bmd.height;
		}
		return obj2.bmd.width - obj1.bmd.width;
	}
	,createQueue: function() {
		this._tempStorage = [];
		return this;
	}
	,addToQueue: function(data,key) {
		if(this._tempStorage == null) {
			this._tempStorage = [];
		}
		this._tempStorage.push({ bmd : data, keyStr : key});
		return this;
	}
	,generateFromQueue: function() {
		if(this._tempStorage != null) {
			this.addFromAtlasObjects(this._tempStorage);
		}
		return this;
	}
	,onClear: function(_) {
		if(!this.persist || this._graphic != null && this._graphic.get_useCount() <= 0) {
			this.destroy();
		}
	}
	,destroy: function() {
		this._tempStorage = null;
		this.deleteSubtree(this.root);
		this.root = null;
		flixel_FlxG.bitmap.removeByKey(this.name);
		this.set_bitmapData(null);
		this.nodes = null;
		this._graphic = null;
		flixel_FlxG.signals.preStateCreate.remove($bind(this,this.onClear));
	}
	,clear: function() {
		this.deleteSubtree(this.root);
		this.initRoot();
		flixel_FlxG.bitmap.removeByKey(this.name);
		this.set_bitmapData(null);
		this.nodes = new haxe_ds_StringMap();
		this._graphic = null;
	}
	,getLibGdxData: function() {
		var data = "\n";
		data += this.name + "\n";
		data += "format: RGBA8888\n";
		data += "filter: Linear,Linear\n";
		data += "repeat: none\n";
		var node = haxe_ds_StringMap.valueIterator(this.nodes.h);
		while(node.hasNext()) {
			var node1 = node.next();
			data += node1.key + "\n";
			data += "  rotate: " + (node1.rotated == null ? "null" : "" + node1.rotated) + "\n";
			data += "  xy: " + (node1.rect.x | 0) + ", " + (node1.rect.y | 0) + "\n";
			if(this.allowRotation) {
				data += "size: " + (node1.rect.height | 0) + ", " + (node1.rect.width | 0) + "\n";
				data += "orig: " + (node1.rect.height | 0) + ", " + (node1.rect.width | 0) + "\n";
			} else {
				data += "size: " + (node1.rect.width | 0) + ", " + (node1.rect.height | 0) + "\n";
				data += "orig: " + (node1.rect.width | 0) + ", " + (node1.rect.height | 0) + "\n";
			}
			data += "  offset: 0, 0\n";
			data += "  index: -1\n";
		}
		return data;
	}
	,deleteSubtree: function(node) {
		if(node != null) {
			if(node.left != null) {
				this.deleteSubtree(node.left);
			}
			if(node.right != null) {
				this.deleteSubtree(node.right);
			}
			node.key = null;
			node.left = null;
			node.right = null;
			node.rect = null;
			node.atlas = null;
		}
	}
	,findNodeToInsert: function(insertWidth,insertHeight) {
		var stack = [];
		var current = this.root;
		var emptyNodes = [];
		var canPlaceRight = false;
		var canPlaceLeft = false;
		var looping = true;
		var result = null;
		var minArea = this.maxWidth * this.maxHeight + 1;
		var nodeArea;
		while(looping) {
			if(!current.filled && current.left == null && current.right == null && (current.rect.width >= insertWidth && current.rect.height >= insertHeight)) {
				nodeArea = (current.rect.width | 0) * (current.rect.height | 0);
				if(nodeArea < minArea) {
					minArea = nodeArea;
					result = current;
				}
			}
			if(current.right != null) {
				var _this = current.right;
				canPlaceRight = _this.rect.width >= insertWidth && _this.rect.height >= insertHeight;
			} else {
				canPlaceRight = false;
			}
			if(current.left != null) {
				var _this1 = current.left;
				canPlaceLeft = _this1.rect.width >= insertWidth && _this1.rect.height >= insertHeight;
			} else {
				canPlaceLeft = false;
			}
			if(canPlaceRight && canPlaceLeft) {
				stack.push(current.right);
				current = current.left;
			} else if(canPlaceLeft) {
				current = current.left;
			} else if(canPlaceRight) {
				current = current.right;
			} else if(stack.length > 0) {
				current = stack.pop();
			} else {
				looping = false;
			}
		}
		return result;
	}
	,set_bitmapData: function(value) {
		if(value != null && this._graphic != null) {
			this._graphic.set_bitmap(value);
		}
		return this.bitmapData = value;
	}
	,get_graphic: function() {
		if(this._graphic != null) {
			return this._graphic;
		}
		this._graphic = flixel_FlxG.bitmap.add(this.bitmapData,false,this.name);
		this._graphic.persist = this.persist;
		return this._graphic;
	}
	,set_persist: function(value) {
		if(this._graphic != null) {
			this._graphic.persist = value;
		}
		return this.persist = value;
	}
	,set_minWidth: function(value) {
		if(value <= this.maxWidth) {
			this.minWidth = value;
			if(value > this.get_width()) {
				this.set_width(value);
			}
		}
		return this.minWidth;
	}
	,set_minHeight: function(value) {
		if(value <= this.maxHeight) {
			this.minHeight = value;
			if(value > this.get_height()) {
				this.set_height(value);
			}
		}
		return this.minHeight;
	}
	,get_width: function() {
		if(this.root != null) {
			return this.root.rect.width | 0;
		}
		return 0;
	}
	,set_width: function(value) {
		if(value > this.get_width()) {
			if(this.powerOfTwo) {
				value = this.getNextPowerOfTwo(value);
			}
			if(value <= this.maxWidth) {
				if(this.root != null && (this.root.rect.width | 0) < value) {
					this.expandRoot(value,this.root.rect.height | 0,this.needToDivideHorizontally(this.root,this.root.rect.width | 0,this.root.rect.height | 0));
				}
			}
		}
		return value;
	}
	,get_height: function() {
		if(this.root != null) {
			return this.root.rect.height | 0;
		}
		return 0;
	}
	,set_height: function(value) {
		if(value > this.get_height()) {
			if(this.powerOfTwo) {
				value = this.getNextPowerOfTwo(value);
			}
			if(value <= this.maxHeight) {
				if(this.root != null && (this.root.rect.height | 0) < value) {
					this.expandRoot(this.root.rect.width | 0,value,this.needToDivideHorizontally(this.root,this.root.rect.width | 0,this.root.rect.height | 0));
				}
			}
		}
		return value;
	}
	,set_maxWidth: function(value) {
		if(value >= this.minWidth && (this.root == null || value >= this.get_width())) {
			this.maxWidth = value;
		}
		return this.maxWidth;
	}
	,set_maxHeight: function(value) {
		if(value >= this.minHeight && (this.root == null || value >= this.get_height())) {
			this.maxHeight = value;
		}
		return this.maxHeight;
	}
	,set_powerOfTwo: function(value) {
		if(value != this.powerOfTwo && value && this.root != null) {
			var nextWidth = this.getNextPowerOfTwo(this.root.rect.width | 0);
			var nextHeight = this.getNextPowerOfTwo(this.root.rect.height | 0);
			if(nextWidth != (this.root.rect.width | 0) || nextHeight != (this.root.rect.height | 0)) {
				if(this.maxWidth > 0 && nextWidth > this.maxWidth || this.maxHeight > 0 && nextHeight > this.maxHeight) {
					return false;
				}
				var temp = this.root;
				var X = 0;
				var Y = 0;
				var Width = nextWidth;
				var Height = nextHeight;
				if(Height == null) {
					Height = 0;
				}
				if(Width == null) {
					Width = 0;
				}
				if(Y == null) {
					Y = 0;
				}
				if(X == null) {
					X = 0;
				}
				var _this = flixel_math_FlxRect._pool.get();
				var X1 = X;
				var Y1 = Y;
				var Width1 = Width;
				var Height1 = Height;
				if(Height1 == null) {
					Height1 = 0;
				}
				if(Width1 == null) {
					Width1 = 0;
				}
				if(Y1 == null) {
					Y1 = 0;
				}
				if(X1 == null) {
					X1 = 0;
				}
				_this.x = X1;
				_this.y = Y1;
				_this.width = Width1;
				_this.height = Height1;
				var rect = _this;
				rect._inPool = false;
				this.root = new flixel_graphics_atlas_FlxNode(rect,this);
				if(temp.left != null) {
					this.divideNode(this.root,temp.rect.width | 0,temp.rect.height | 0,this.needToDivideHorizontally(this.root,temp.rect.width | 0,temp.rect.height | 0));
					this.root.left.left = temp;
				}
			}
		}
		return this.powerOfTwo = value;
	}
	,__class__: flixel_graphics_atlas_FlxAtlas
	,__properties__: {set_powerOfTwo:"set_powerOfTwo",set_maxHeight:"set_maxHeight",set_maxWidth:"set_maxWidth",set_minHeight:"set_minHeight",set_minWidth:"set_minWidth",set_height:"set_height",get_height:"get_height",set_width:"set_width",get_width:"get_width",set_persist:"set_persist",get_graphic:"get_graphic",set_bitmapData:"set_bitmapData"}
};
var flixel_graphics_atlas_FlxNode = function(rect,atlas,filled,key,rotated) {
	if(rotated == null) {
		rotated = false;
	}
	if(key == null) {
		key = "";
	}
	if(filled == null) {
		filled = false;
	}
	this.filled = filled;
	this.left = null;
	this.right = null;
	this.rect = rect;
	this.key = key;
	this.atlas = atlas;
	this.rotated = rotated;
};
$hxClasses["flixel.graphics.atlas.FlxNode"] = flixel_graphics_atlas_FlxNode;
flixel_graphics_atlas_FlxNode.__name__ = "flixel.graphics.atlas.FlxNode";
flixel_graphics_atlas_FlxNode.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_graphics_atlas_FlxNode.prototype = {
	left: null
	,right: null
	,rect: null
	,key: null
	,filled: null
	,atlas: null
	,rotated: null
	,destroy: function() {
		this.key = null;
		this.left = null;
		this.right = null;
		this.rect = null;
		this.atlas = null;
	}
	,canPlace: function(width,height) {
		if(this.rect.width >= width) {
			return this.rect.height >= height;
		} else {
			return false;
		}
	}
	,getTileFrames: function(tileSize,tileSpacing,tileBorder) {
		flixel_FlxG.bitmap.add(this.atlas.bitmapData,false,this.atlas.name);
		var frame = this.atlas.getAtlasFrames().framesHash.h[this.key];
		if(frame != null) {
			var tileFrames = flixel_graphics_frames_FlxTileFrames.fromFrame(frame,tileSize,tileSpacing);
			if(tileBorder != null) {
				tileFrames = tileFrames.addBorder(tileBorder);
			}
			return tileFrames;
		}
		return null;
	}
	,getImageFrame: function() {
		flixel_FlxG.bitmap.add(this.atlas.bitmapData,false,this.atlas.name);
		var frame = this.atlas.getAtlasFrames().framesHash.h[this.key];
		if(frame != null) {
			return flixel_graphics_frames_FlxImageFrame.fromFrame(frame);
		}
		return null;
	}
	,get_isEmpty: function() {
		if(!this.filled && this.left == null) {
			return this.right == null;
		} else {
			return false;
		}
	}
	,get_x: function() {
		return this.rect.x | 0;
	}
	,get_y: function() {
		return this.rect.y | 0;
	}
	,get_width: function() {
		return this.rect.width | 0;
	}
	,set_width: function(value) {
		this.rect.width = value;
		return value;
	}
	,get_height: function() {
		return this.rect.height | 0;
	}
	,set_height: function(value) {
		this.rect.height = value;
		return value;
	}
	,__class__: flixel_graphics_atlas_FlxNode
	,__properties__: {get_isEmpty:"get_isEmpty",set_height:"set_height",get_height:"get_height",set_width:"set_width",get_width:"get_width",get_y:"get_y",get_x:"get_x"}
};
var flixel_graphics_frames_FlxFramesCollection = function(parent,type,border) {
	this.parent = parent;
	this.type = type;
	var tmp;
	if(border == null) {
		var point = flixel_math_FlxPoint._pool.get().set(0,0);
		point._inPool = false;
		tmp = point;
	} else {
		tmp = border;
	}
	this.border = tmp;
	this.frames = [];
	this.framesHash = new haxe_ds_StringMap();
	if(parent != null) {
		parent.addFrameCollection(this);
	}
};
$hxClasses["flixel.graphics.frames.FlxFramesCollection"] = flixel_graphics_frames_FlxFramesCollection;
flixel_graphics_frames_FlxFramesCollection.__name__ = "flixel.graphics.frames.FlxFramesCollection";
flixel_graphics_frames_FlxFramesCollection.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_graphics_frames_FlxFramesCollection.prototype = {
	frames: null
	,framesHash: null
	,parent: null
	,type: null
	,border: null
	,getByName: function(name) {
		return this.framesHash.h[name];
	}
	,getByIndex: function(index) {
		return this.frames[index];
	}
	,getIndexByName: function(name) {
		var _g = 0;
		var _g1 = this.frames.length;
		while(_g < _g1) {
			var i = _g++;
			if(this.frames[i].name == name) {
				return i;
			}
		}
		return -1;
	}
	,getFrameIndex: function(frame) {
		return this.frames.indexOf(frame);
	}
	,destroy: function() {
		this.frames = flixel_util_FlxDestroyUtil.destroyArray(this.frames);
		this.border = flixel_util_FlxDestroyUtil.put(this.border);
		this.framesHash = null;
		this.parent = null;
		this.type = null;
	}
	,addEmptyFrame: function(size) {
		var frame = new flixel_graphics_frames_FlxFrame(this.parent);
		frame.type = 2;
		var _this = flixel_math_FlxRect._pool.get();
		var X = 0;
		var Y = 0;
		var Width = 0;
		var Height = 0;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		var rect = _this;
		rect._inPool = false;
		frame.set_frame(rect);
		frame.sourceSize.set(size.width,size.height);
		this.frames.push(frame);
		return frame;
	}
	,addSpriteSheetFrame: function(region) {
		var frame = new flixel_graphics_frames_FlxFrame(this.parent);
		frame.set_frame(this.checkFrame(region));
		frame.sourceSize.set(region.width,region.height);
		frame.offset.set(0,0);
		return this.pushFrame(frame);
	}
	,addAtlasFrame: function(frame,sourceSize,offset,name,angle,flipX,flipY) {
		if(flipY == null) {
			flipY = false;
		}
		if(flipX == null) {
			flipX = false;
		}
		if(angle == null) {
			angle = 0;
		}
		if(name != null && Object.prototype.hasOwnProperty.call(this.framesHash.h,name)) {
			return this.framesHash.h[name];
		}
		var texFrame = new flixel_graphics_frames_FlxFrame(this.parent,angle,flipX,flipY);
		texFrame.name = name;
		texFrame.sourceSize.set(sourceSize.x,sourceSize.y);
		texFrame.offset.set(offset.x,offset.y);
		texFrame.set_frame(this.checkFrame(frame,name));
		sourceSize = flixel_util_FlxDestroyUtil.put(sourceSize);
		offset = flixel_util_FlxDestroyUtil.put(offset);
		return this.pushFrame(texFrame);
	}
	,checkFrame: function(frame,name) {
		var Value = frame.x;
		var Max = this.parent.width;
		var lowerBound = Value < 0 ? 0 : Value;
		var x = Max != null && lowerBound > Max ? Max : lowerBound;
		var Value = frame.y;
		var Max = this.parent.height;
		var lowerBound = Value < 0 ? 0 : Value;
		var y = Max != null && lowerBound > Max ? Max : lowerBound;
		var Value = frame.x + frame.width;
		var Max = this.parent.width;
		var lowerBound = Value < 0 ? 0 : Value;
		var r = Max != null && lowerBound > Max ? Max : lowerBound;
		var Value = frame.y + frame.height;
		var Max = this.parent.height;
		var lowerBound = Value < 0 ? 0 : Value;
		var b = Max != null && lowerBound > Max ? Max : lowerBound;
		var X = x;
		var Y = y;
		var Width = r - x;
		var Height = b - y;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		frame.x = X;
		frame.y = Y;
		frame.width = Width;
		frame.height = Height;
		var tmp = frame.width <= 0 || frame.height <= 0;
		return frame;
	}
	,pushFrame: function(frameObj) {
		var name = frameObj.name;
		if(name != null && Object.prototype.hasOwnProperty.call(this.framesHash.h,name)) {
			return this.framesHash.h[name];
		}
		this.frames.push(frameObj);
		frameObj.cacheFrameMatrix();
		if(name != null) {
			this.framesHash.h[name] = frameObj;
		}
		return frameObj;
	}
	,addBorder: function(border) {
		throw haxe_Exception.thrown("To be overriden in subclasses");
	}
	,toString: function() {
		var value = this.frames;
		var _this = flixel_util_LabelValuePair._pool.get();
		_this.label = "frames";
		_this.value = value;
		var value = this.type;
		var _this1 = flixel_util_LabelValuePair._pool.get();
		_this1.label = "type";
		_this1.value = value;
		return flixel_util_FlxStringUtil.getDebugString([_this,_this1]);
	}
	,get_numFrames: function() {
		return this.frames.length;
	}
	,__class__: flixel_graphics_frames_FlxFramesCollection
	,__properties__: {get_numFrames:"get_numFrames"}
};
var flixel_graphics_frames_FlxAtlasFrames = function(parent,border) {
	flixel_graphics_frames_FlxFramesCollection.call(this,parent,flixel_graphics_frames_FlxFrameCollectionType.ATLAS,border);
};
$hxClasses["flixel.graphics.frames.FlxAtlasFrames"] = flixel_graphics_frames_FlxAtlasFrames;
flixel_graphics_frames_FlxAtlasFrames.__name__ = "flixel.graphics.frames.FlxAtlasFrames";
flixel_graphics_frames_FlxAtlasFrames.fromTexturePackerJson = function(Source,Description) {
	var graphic = flixel_FlxG.bitmap.add(Source,false);
	if(graphic == null) {
		return null;
	}
	var frames = flixel_graphics_frames_FlxAtlasFrames.findFrame(graphic);
	if(frames != null) {
		return frames;
	}
	if(graphic == null || Description == null) {
		return null;
	}
	frames = new flixel_graphics_frames_FlxAtlasFrames(graphic);
	var data;
	if(typeof(Description) == "string") {
		var json = Description;
		if(openfl_utils_Assets.exists(json)) {
			json = openfl_utils_Assets.getText(json);
		}
		data = JSON.parse(json);
	} else {
		data = Description;
	}
	if(((data.frames) instanceof Array)) {
		var _g = 0;
		var _g1 = Lambda.array(data.frames);
		while(_g < _g1.length) {
			var frame = _g1[_g];
			++_g;
			flixel_graphics_frames_FlxAtlasFrames.texturePackerHelper(frame.filename,frame,frames);
		}
	} else {
		var _g = 0;
		var _g1 = Reflect.fields(data.frames);
		while(_g < _g1.length) {
			var frameName = _g1[_g];
			++_g;
			flixel_graphics_frames_FlxAtlasFrames.texturePackerHelper(frameName,Reflect.field(data.frames,frameName),frames);
		}
	}
	return frames;
};
flixel_graphics_frames_FlxAtlasFrames.texturePackerHelper = function(FrameName,FrameData,Frames) {
	var rotated = FrameData.rotated;
	var name = FrameName;
	var X = FrameData.sourceSize.w;
	var Y = FrameData.sourceSize.h;
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	var point = flixel_math_FlxPoint._pool.get().set(X,Y);
	point._inPool = false;
	var sourceSize = point;
	var X = FrameData.spriteSourceSize.x;
	var Y = FrameData.spriteSourceSize.y;
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	var point = flixel_math_FlxPoint._pool.get().set(X,Y);
	point._inPool = false;
	var offset = point;
	var angle = 0;
	var frameRect = null;
	if(rotated) {
		var X = FrameData.frame.x;
		var Y = FrameData.frame.y;
		var Width = FrameData.frame.h;
		var Height = FrameData.frame.w;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var _this = flixel_math_FlxRect._pool.get();
		var X1 = X;
		var Y1 = Y;
		var Width1 = Width;
		var Height1 = Height;
		if(Height1 == null) {
			Height1 = 0;
		}
		if(Width1 == null) {
			Width1 = 0;
		}
		if(Y1 == null) {
			Y1 = 0;
		}
		if(X1 == null) {
			X1 = 0;
		}
		_this.x = X1;
		_this.y = Y1;
		_this.width = Width1;
		_this.height = Height1;
		var rect = _this;
		rect._inPool = false;
		frameRect = rect;
		angle = -90;
	} else {
		var X = FrameData.frame.x;
		var Y = FrameData.frame.y;
		var Width = FrameData.frame.w;
		var Height = FrameData.frame.h;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var _this = flixel_math_FlxRect._pool.get();
		var X1 = X;
		var Y1 = Y;
		var Width1 = Width;
		var Height1 = Height;
		if(Height1 == null) {
			Height1 = 0;
		}
		if(Width1 == null) {
			Width1 = 0;
		}
		if(Y1 == null) {
			Y1 = 0;
		}
		if(X1 == null) {
			X1 = 0;
		}
		_this.x = X1;
		_this.y = Y1;
		_this.width = Width1;
		_this.height = Height1;
		var rect = _this;
		rect._inPool = false;
		frameRect = rect;
	}
	Frames.addAtlasFrame(frameRect,sourceSize,offset,name,angle);
};
flixel_graphics_frames_FlxAtlasFrames.fromLibGdx = function(source,description) {
	var graphic = flixel_FlxG.bitmap.add(source);
	if(graphic == null) {
		return null;
	}
	var frames = flixel_graphics_frames_FlxAtlasFrames.findFrame(graphic);
	if(frames != null) {
		return frames;
	}
	if(graphic == null || description == null) {
		return null;
	}
	frames = new flixel_graphics_frames_FlxAtlasFrames(graphic);
	if(openfl_utils_Assets.exists(description)) {
		description = openfl_utils_Assets.getText(description);
	}
	var pack = StringTools.trim(description);
	var lines = pack.split("\n");
	var repeatLine = lines[3].indexOf("repeat:") > -1 ? 3 : 4;
	lines.splice(0,repeatLine + 1);
	var numElementsPerImage = 7;
	var numImages = lines.length / numElementsPerImage | 0;
	var _g = 0;
	var _g1 = numImages;
	while(_g < _g1) {
		var i = _g++;
		var curIndex = i * numElementsPerImage;
		var name = lines[curIndex++];
		var rotated = lines[curIndex++].indexOf("true") >= 0;
		var angle = rotated ? 90 : 0;
		var tempString = lines[curIndex++];
		var size = flixel_graphics_frames_FlxAtlasFrames.getDimensions(tempString);
		var imageX = size.x;
		var imageY = size.y;
		tempString = lines[curIndex++];
		size = flixel_graphics_frames_FlxAtlasFrames.getDimensions(tempString);
		var imageWidth = size.x;
		var imageHeight = size.y;
		var X = imageX;
		var Y = imageY;
		var Width = imageWidth;
		var Height = imageHeight;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var _this = flixel_math_FlxRect._pool.get();
		var X1 = X;
		var Y1 = Y;
		var Width1 = Width;
		var Height1 = Height;
		if(Height1 == null) {
			Height1 = 0;
		}
		if(Width1 == null) {
			Width1 = 0;
		}
		if(Y1 == null) {
			Y1 = 0;
		}
		if(X1 == null) {
			X1 = 0;
		}
		_this.x = X1;
		_this.y = Y1;
		_this.width = Width1;
		_this.height = Height1;
		var rect = _this;
		rect._inPool = false;
		var rect1 = rect;
		tempString = lines[curIndex++];
		size = flixel_graphics_frames_FlxAtlasFrames.getDimensions(tempString);
		var X2 = size.x;
		var Y2 = size.y;
		if(Y2 == null) {
			Y2 = 0;
		}
		if(X2 == null) {
			X2 = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X2,Y2);
		point._inPool = false;
		var sourceSize = point;
		tempString = lines[curIndex++];
		size = flixel_graphics_frames_FlxAtlasFrames.getDimensions(tempString);
		tempString = lines[curIndex++];
		var index = Std.parseInt(tempString.split(":")[1]);
		if(index != -1) {
			name += "_" + index;
		}
		var X3 = size.x;
		var Y3 = sourceSize.y - size.y - imageHeight;
		if(Y3 == null) {
			Y3 = 0;
		}
		if(X3 == null) {
			X3 = 0;
		}
		var point1 = flixel_math_FlxPoint._pool.get().set(X3,Y3);
		point1._inPool = false;
		var offset = point1;
		frames.addAtlasFrame(rect1,sourceSize,offset,name,angle);
	}
	return frames;
};
flixel_graphics_frames_FlxAtlasFrames.getDimensions = function(line) {
	var colonPosition = line.indexOf(":");
	var comaPosition = line.indexOf(",");
	return { x : Std.parseInt(line.substring(colonPosition + 1,comaPosition)), y : Std.parseInt(line.substring(comaPosition + 1,line.length))};
};
flixel_graphics_frames_FlxAtlasFrames.fromSparrow = function(Source,Description,Unique) {
	if(Unique == null) {
		Unique = false;
	}
	var graphic = flixel_FlxG.bitmap.add(Source,Unique);
	if(graphic == null) {
		return null;
	}
	var frames = flixel_graphics_frames_FlxAtlasFrames.findFrame(graphic);
	if(frames != null) {
		return frames;
	}
	if(graphic == null || Description == null) {
		return null;
	}
	frames = new flixel_graphics_frames_FlxAtlasFrames(graphic);
	if(openfl_utils_Assets.exists(Description)) {
		Description = openfl_utils_Assets.getText(Description);
	}
	var x = Xml.parse(Description).firstElement();
	if(x.nodeType != Xml.Document && x.nodeType != Xml.Element) {
		throw haxe_Exception.thrown("Invalid nodeType " + (x.nodeType == null ? "null" : XmlType.toString(x.nodeType)));
	}
	var this1 = x;
	var data = this1;
	var _g = 0;
	var _g1 = haxe_xml__$Access_NodeListAccess.resolve(data,"SubTexture");
	while(_g < _g1.length) {
		var texture = _g1[_g];
		++_g;
		var name = haxe_xml__$Access_AttribAccess.resolve(texture,"name");
		var trimmed = haxe_xml__$Access_HasAttribAccess.resolve(texture,"frameX");
		var rotated = haxe_xml__$Access_HasAttribAccess.resolve(texture,"rotated") && haxe_xml__$Access_AttribAccess.resolve(texture,"rotated") == "true";
		var flipX = haxe_xml__$Access_HasAttribAccess.resolve(texture,"flipX") && haxe_xml__$Access_AttribAccess.resolve(texture,"flipX") == "true";
		var flipY = haxe_xml__$Access_HasAttribAccess.resolve(texture,"flipY") && haxe_xml__$Access_AttribAccess.resolve(texture,"flipY") == "true";
		var X = parseFloat(haxe_xml__$Access_AttribAccess.resolve(texture,"x"));
		var Y = parseFloat(haxe_xml__$Access_AttribAccess.resolve(texture,"y"));
		var Width = parseFloat(haxe_xml__$Access_AttribAccess.resolve(texture,"width"));
		var Height = parseFloat(haxe_xml__$Access_AttribAccess.resolve(texture,"height"));
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var _this = flixel_math_FlxRect._pool.get();
		var X1 = X;
		var Y1 = Y;
		var Width1 = Width;
		var Height1 = Height;
		if(Height1 == null) {
			Height1 = 0;
		}
		if(Width1 == null) {
			Width1 = 0;
		}
		if(Y1 == null) {
			Y1 = 0;
		}
		if(X1 == null) {
			X1 = 0;
		}
		_this.x = X1;
		_this.y = Y1;
		_this.width = Width1;
		_this.height = Height1;
		var rect = _this;
		rect._inPool = false;
		var rect1 = rect;
		var size = trimmed ? new openfl_geom_Rectangle(Std.parseInt(haxe_xml__$Access_AttribAccess.resolve(texture,"frameX")),Std.parseInt(haxe_xml__$Access_AttribAccess.resolve(texture,"frameY")),Std.parseInt(haxe_xml__$Access_AttribAccess.resolve(texture,"frameWidth")),Std.parseInt(haxe_xml__$Access_AttribAccess.resolve(texture,"frameHeight"))) : new openfl_geom_Rectangle(0,0,rect1.width,rect1.height);
		var angle = rotated ? -90 : 0;
		var X2 = -size.get_left();
		var Y2 = -size.get_top();
		if(Y2 == null) {
			Y2 = 0;
		}
		if(X2 == null) {
			X2 = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X2,Y2);
		point._inPool = false;
		var offset = point;
		var X3 = size.width;
		var Y3 = size.height;
		if(Y3 == null) {
			Y3 = 0;
		}
		if(X3 == null) {
			X3 = 0;
		}
		var point1 = flixel_math_FlxPoint._pool.get().set(X3,Y3);
		point1._inPool = false;
		var sourceSize = point1;
		if(rotated && !trimmed) {
			sourceSize.set(size.height,size.width);
		}
		frames.addAtlasFrame(rect1,sourceSize,offset,name,angle,flipX,flipY);
	}
	return frames;
};
flixel_graphics_frames_FlxAtlasFrames.fromTexturePackerXml = function(Source,Description) {
	var graphic = flixel_FlxG.bitmap.add(Source,false);
	if(graphic == null) {
		return null;
	}
	var frames = flixel_graphics_frames_FlxAtlasFrames.findFrame(graphic);
	if(frames != null) {
		return frames;
	}
	if(graphic == null || Description == null) {
		return null;
	}
	frames = new flixel_graphics_frames_FlxAtlasFrames(graphic);
	if(openfl_utils_Assets.exists(Description)) {
		Description = openfl_utils_Assets.getText(Description);
	}
	var xml = Xml.parse(Description);
	var sprite = xml.firstElement().elements();
	while(sprite.hasNext()) {
		var sprite1 = sprite.next();
		var trimmed = sprite1.exists("oX") || sprite1.exists("oY");
		var rotated = sprite1.exists("r") && sprite1.get("r") == "y";
		var angle = rotated ? -90 : 0;
		var name = sprite1.get("n");
		var X = 0;
		var Y = 0;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		var offset = point;
		var X1 = Std.parseInt(sprite1.get("x"));
		var Y1 = Std.parseInt(sprite1.get("y"));
		var Width = Std.parseInt(sprite1.get("w"));
		var Height = Std.parseInt(sprite1.get("h"));
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y1 == null) {
			Y1 = 0;
		}
		if(X1 == null) {
			X1 = 0;
		}
		var _this = flixel_math_FlxRect._pool.get();
		var X2 = X1;
		var Y2 = Y1;
		var Width1 = Width;
		var Height1 = Height;
		if(Height1 == null) {
			Height1 = 0;
		}
		if(Width1 == null) {
			Width1 = 0;
		}
		if(Y2 == null) {
			Y2 = 0;
		}
		if(X2 == null) {
			X2 = 0;
		}
		_this.x = X2;
		_this.y = Y2;
		_this.width = Width1;
		_this.height = Height1;
		var rect = _this;
		rect._inPool = false;
		var rect1 = rect;
		var X3 = rect1.width;
		var Y3 = rect1.height;
		if(Y3 == null) {
			Y3 = 0;
		}
		if(X3 == null) {
			X3 = 0;
		}
		var point1 = flixel_math_FlxPoint._pool.get().set(X3,Y3);
		point1._inPool = false;
		var sourceSize = point1;
		if(trimmed) {
			offset.set(Std.parseInt(sprite1.get("oX")),Std.parseInt(sprite1.get("oY")));
			sourceSize.set(Std.parseInt(sprite1.get("oW")),Std.parseInt(sprite1.get("oH")));
		}
		frames.addAtlasFrame(rect1,sourceSize,offset,name,angle);
	}
	return frames;
};
flixel_graphics_frames_FlxAtlasFrames.fromSpriteSheetPacker = function(Source,Description) {
	var graphic = flixel_FlxG.bitmap.add(Source);
	if(graphic == null) {
		return null;
	}
	var frames = flixel_graphics_frames_FlxAtlasFrames.findFrame(graphic);
	if(frames != null) {
		return frames;
	}
	if(graphic == null || Description == null) {
		return null;
	}
	frames = new flixel_graphics_frames_FlxAtlasFrames(graphic);
	if(openfl_utils_Assets.exists(Description)) {
		Description = openfl_utils_Assets.getText(Description);
	}
	var pack = StringTools.trim(Description);
	var lines = pack.split("\n");
	var _g = 0;
	var _g1 = lines.length;
	while(_g < _g1) {
		var i = _g++;
		var currImageData = lines[i].split("=");
		var name = StringTools.trim(currImageData[0]);
		var currImageRegion = StringTools.trim(currImageData[1]).split(" ");
		var X = Std.parseInt(currImageRegion[0]);
		var Y = Std.parseInt(currImageRegion[1]);
		var Width = Std.parseInt(currImageRegion[2]);
		var Height = Std.parseInt(currImageRegion[3]);
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var _this = flixel_math_FlxRect._pool.get();
		var X1 = X;
		var Y1 = Y;
		var Width1 = Width;
		var Height1 = Height;
		if(Height1 == null) {
			Height1 = 0;
		}
		if(Width1 == null) {
			Width1 = 0;
		}
		if(Y1 == null) {
			Y1 = 0;
		}
		if(X1 == null) {
			X1 = 0;
		}
		_this.x = X1;
		_this.y = Y1;
		_this.width = Width1;
		_this.height = Height1;
		var rect = _this;
		rect._inPool = false;
		var rect1 = rect;
		var X2 = rect1.width;
		var Y2 = rect1.height;
		if(Y2 == null) {
			Y2 = 0;
		}
		if(X2 == null) {
			X2 = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X2,Y2);
		point._inPool = false;
		var sourceSize = point;
		var point1 = flixel_math_FlxPoint._pool.get().set(0,0);
		point1._inPool = false;
		var offset = point1;
		frames.addAtlasFrame(rect1,sourceSize,offset,name,0);
	}
	return frames;
};
flixel_graphics_frames_FlxAtlasFrames.findFrame = function(graphic,border) {
	if(border == null) {
		var X = 0;
		var Y = 0;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		var point1 = point;
		point1._weak = true;
		border = point1;
	}
	var type = flixel_graphics_frames_FlxFrameCollectionType.ATLAS;
	var collections = graphic.frameCollections.get(type);
	if(collections == null) {
		collections = [];
		graphic.frameCollections.set(type,collections);
	}
	var atlasFrames = collections;
	var _g = 0;
	while(_g < atlasFrames.length) {
		var atlas = atlasFrames[_g];
		++_g;
		var _this = atlas.border;
		var result = Math.abs(_this.x - border.x) <= 0.0000001 && Math.abs(_this.y - border.y) <= 0.0000001;
		if(border._weak) {
			border.put();
		}
		if(result) {
			return atlas;
		}
	}
	return null;
};
flixel_graphics_frames_FlxAtlasFrames.__super__ = flixel_graphics_frames_FlxFramesCollection;
flixel_graphics_frames_FlxAtlasFrames.prototype = $extend(flixel_graphics_frames_FlxFramesCollection.prototype,{
	addBorder: function(border) {
		var X = 0;
		var Y = 0;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		var point1 = point;
		point1._weak = true;
		var resultBorder = point1.addPoint(this.border).addPoint(border);
		var atlasFrames = flixel_graphics_frames_FlxAtlasFrames.findFrame(this.parent,resultBorder);
		if(atlasFrames != null) {
			return atlasFrames;
		}
		atlasFrames = new flixel_graphics_frames_FlxAtlasFrames(this.parent,resultBorder);
		var _g = 0;
		var _g1 = this.frames;
		while(_g < _g1.length) {
			var frame = _g1[_g];
			++_g;
			atlasFrames.pushFrame(frame.setBorderTo(border));
		}
		return atlasFrames;
	}
	,__class__: flixel_graphics_frames_FlxAtlasFrames
});
var openfl_geom_Rectangle = function(x,y,width,height) {
	if(height == null) {
		height = 0;
	}
	if(width == null) {
		width = 0;
	}
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	this.x = x;
	this.y = y;
	this.width = width;
	this.height = height;
};
$hxClasses["openfl.geom.Rectangle"] = openfl_geom_Rectangle;
openfl_geom_Rectangle.__name__ = "openfl.geom.Rectangle";
openfl_geom_Rectangle.__limeRectangle = null;
openfl_geom_Rectangle.prototype = {
	height: null
	,width: null
	,x: null
	,y: null
	,clone: function() {
		return new openfl_geom_Rectangle(this.x,this.y,this.width,this.height);
	}
	,contains: function(x,y) {
		if(x >= this.x && y >= this.y && x < this.get_right()) {
			return y < this.get_bottom();
		} else {
			return false;
		}
	}
	,containsPoint: function(point) {
		return this.contains(point.x,point.y);
	}
	,containsRect: function(rect) {
		if(rect.width <= 0 || rect.height <= 0) {
			if(rect.x > this.x && rect.y > this.y && rect.get_right() < this.get_right()) {
				return rect.get_bottom() < this.get_bottom();
			} else {
				return false;
			}
		} else if(rect.x >= this.x && rect.y >= this.y && rect.get_right() <= this.get_right()) {
			return rect.get_bottom() <= this.get_bottom();
		} else {
			return false;
		}
	}
	,copyFrom: function(sourceRect) {
		this.x = sourceRect.x;
		this.y = sourceRect.y;
		this.width = sourceRect.width;
		this.height = sourceRect.height;
	}
	,equals: function(toCompare) {
		if(toCompare == this) {
			return true;
		} else if(toCompare != null && this.x == toCompare.x && this.y == toCompare.y && this.width == toCompare.width) {
			return this.height == toCompare.height;
		} else {
			return false;
		}
	}
	,inflate: function(dx,dy) {
		this.x -= dx;
		this.width += dx * 2;
		this.y -= dy;
		this.height += dy * 2;
	}
	,inflatePoint: function(point) {
		this.inflate(point.x,point.y);
	}
	,intersection: function(toIntersect) {
		var x0 = this.x < toIntersect.x ? toIntersect.x : this.x;
		var x1 = this.get_right() > toIntersect.get_right() ? toIntersect.get_right() : this.get_right();
		if(x1 <= x0) {
			return new openfl_geom_Rectangle();
		}
		var y0 = this.y < toIntersect.y ? toIntersect.y : this.y;
		var y1 = this.get_bottom() > toIntersect.get_bottom() ? toIntersect.get_bottom() : this.get_bottom();
		if(y1 <= y0) {
			return new openfl_geom_Rectangle();
		}
		return new openfl_geom_Rectangle(x0,y0,x1 - x0,y1 - y0);
	}
	,intersects: function(toIntersect) {
		var x0 = this.x < toIntersect.x ? toIntersect.x : this.x;
		var x1 = this.get_right() > toIntersect.get_right() ? toIntersect.get_right() : this.get_right();
		if(x1 <= x0) {
			return false;
		}
		var y0 = this.y < toIntersect.y ? toIntersect.y : this.y;
		var y1 = this.get_bottom() > toIntersect.get_bottom() ? toIntersect.get_bottom() : this.get_bottom();
		return y1 > y0;
	}
	,isEmpty: function() {
		if(!(this.width <= 0)) {
			return this.height <= 0;
		} else {
			return true;
		}
	}
	,offset: function(dx,dy) {
		this.x += dx;
		this.y += dy;
	}
	,offsetPoint: function(point) {
		this.x += point.x;
		this.y += point.y;
	}
	,setEmpty: function() {
		this.x = this.y = this.width = this.height = 0;
	}
	,setTo: function(xa,ya,widtha,heighta) {
		this.x = xa;
		this.y = ya;
		this.width = widtha;
		this.height = heighta;
	}
	,toString: function() {
		return "(x=" + this.x + ", y=" + this.y + ", width=" + this.width + ", height=" + this.height + ")";
	}
	,union: function(toUnion) {
		if(this.width == 0 || this.height == 0) {
			return toUnion.clone();
		} else if(toUnion.width == 0 || toUnion.height == 0) {
			return this.clone();
		}
		var x0 = this.x > toUnion.x ? toUnion.x : this.x;
		var x1 = this.get_right() < toUnion.get_right() ? toUnion.get_right() : this.get_right();
		var y0 = this.y > toUnion.y ? toUnion.y : this.y;
		var y1 = this.get_bottom() < toUnion.get_bottom() ? toUnion.get_bottom() : this.get_bottom();
		return new openfl_geom_Rectangle(x0,y0,x1 - x0,y1 - y0);
	}
	,__contract: function(x,y,width,height) {
		if(this.width == 0 && this.height == 0) {
			return;
		}
		var offsetX = 0.0;
		var offsetY = 0.0;
		var offsetRight = 0.0;
		var offsetBottom = 0.0;
		if(this.x < x) {
			offsetX = x - this.x;
		}
		if(this.y < y) {
			offsetY = y - this.y;
		}
		if(this.get_right() > x + width) {
			offsetRight = x + width - this.get_right();
		}
		if(this.get_bottom() > y + height) {
			offsetBottom = y + height - this.get_bottom();
		}
		this.x += offsetX;
		this.y += offsetY;
		this.width += offsetRight - offsetX;
		this.height += offsetBottom - offsetY;
	}
	,__expand: function(x,y,width,height) {
		if(this.width == 0 && this.height == 0) {
			this.x = x;
			this.y = y;
			this.width = width;
			this.height = height;
			return;
		}
		var cacheRight = this.get_right();
		var cacheBottom = this.get_bottom();
		if(this.x > x) {
			this.x = x;
			this.width = cacheRight - x;
		}
		if(this.y > y) {
			this.y = y;
			this.height = cacheBottom - y;
		}
		if(cacheRight < x + width) {
			this.width = x + width - this.x;
		}
		if(cacheBottom < y + height) {
			this.height = y + height - this.y;
		}
	}
	,__toLimeRectangle: function() {
		if(openfl_geom_Rectangle.__limeRectangle == null) {
			openfl_geom_Rectangle.__limeRectangle = new lime_math_Rectangle();
		}
		openfl_geom_Rectangle.__limeRectangle.setTo(this.x,this.y,this.width,this.height);
		return openfl_geom_Rectangle.__limeRectangle;
	}
	,__transform: function(rect,m) {
		var tx0 = m.a * this.x + m.c * this.y;
		var tx1 = tx0;
		var ty0 = m.b * this.x + m.d * this.y;
		var ty1 = ty0;
		var tx = m.a * (this.x + this.width) + m.c * this.y;
		var ty = m.b * (this.x + this.width) + m.d * this.y;
		if(tx < tx0) {
			tx0 = tx;
		}
		if(ty < ty0) {
			ty0 = ty;
		}
		if(tx > tx1) {
			tx1 = tx;
		}
		if(ty > ty1) {
			ty1 = ty;
		}
		tx = m.a * (this.x + this.width) + m.c * (this.y + this.height);
		ty = m.b * (this.x + this.width) + m.d * (this.y + this.height);
		if(tx < tx0) {
			tx0 = tx;
		}
		if(ty < ty0) {
			ty0 = ty;
		}
		if(tx > tx1) {
			tx1 = tx;
		}
		if(ty > ty1) {
			ty1 = ty;
		}
		tx = m.a * this.x + m.c * (this.y + this.height);
		ty = m.b * this.x + m.d * (this.y + this.height);
		if(tx < tx0) {
			tx0 = tx;
		}
		if(ty < ty0) {
			ty0 = ty;
		}
		if(tx > tx1) {
			tx1 = tx;
		}
		if(ty > ty1) {
			ty1 = ty;
		}
		rect.setTo(tx0 + m.tx,ty0 + m.ty,tx1 - tx0,ty1 - ty0);
	}
	,get_bottom: function() {
		return this.y + this.height;
	}
	,set_bottom: function(b) {
		this.height = b - this.y;
		return b;
	}
	,get_bottomRight: function() {
		return new openfl_geom_Point(this.x + this.width,this.y + this.height);
	}
	,set_bottomRight: function(p) {
		this.width = p.x - this.x;
		this.height = p.y - this.y;
		return p.clone();
	}
	,get_left: function() {
		return this.x;
	}
	,set_left: function(l) {
		this.width -= l - this.x;
		this.x = l;
		return l;
	}
	,get_right: function() {
		return this.x + this.width;
	}
	,set_right: function(r) {
		this.width = r - this.x;
		return r;
	}
	,get_size: function() {
		return new openfl_geom_Point(this.width,this.height);
	}
	,set_size: function(p) {
		this.width = p.x;
		this.height = p.y;
		return p.clone();
	}
	,get_top: function() {
		return this.y;
	}
	,set_top: function(t) {
		this.height -= t - this.y;
		this.y = t;
		return t;
	}
	,get_topLeft: function() {
		return new openfl_geom_Point(this.x,this.y);
	}
	,set_topLeft: function(p) {
		this.x = p.x;
		this.y = p.y;
		return p.clone();
	}
	,__class__: openfl_geom_Rectangle
	,__properties__: {set_topLeft:"set_topLeft",get_topLeft:"get_topLeft",set_top:"set_top",get_top:"get_top",set_size:"set_size",get_size:"get_size",set_right:"set_right",get_right:"get_right",set_left:"set_left",get_left:"get_left",set_bottomRight:"set_bottomRight",get_bottomRight:"get_bottomRight",set_bottom:"set_bottom",get_bottom:"get_bottom"}
};
var flixel_graphics_frames_FlxBitmapFont = function(frame,border) {
	this.spaceWidth = 0;
	this.minOffsetX = 0;
	this.numLetters = 0;
	this.italic = false;
	this.bold = false;
	this.lineHeight = 0;
	this.size = 0;
	flixel_graphics_frames_FlxFramesCollection.call(this,frame.parent,flixel_graphics_frames_FlxFrameCollectionType.FONT,border);
	this.frame = frame;
	this.parent.persist = true;
	this.parent.set_destroyOnNoUse(false);
	this.charMap = new haxe_ds_IntMap();
	this.charAdvance = new haxe_ds_IntMap();
};
$hxClasses["flixel.graphics.frames.FlxBitmapFont"] = flixel_graphics_frames_FlxBitmapFont;
flixel_graphics_frames_FlxBitmapFont.__name__ = "flixel.graphics.frames.FlxBitmapFont";
flixel_graphics_frames_FlxBitmapFont.getDefaultFont = function() {
	var graphic = flixel_FlxG.bitmap._cache.h["DEFAULT_FONT_KEY"];
	if(graphic != null) {
		var font = flixel_graphics_frames_FlxBitmapFont.findFont(graphic.get_imageFrame().get_frame());
		if(font != null) {
			return font;
		}
	}
	var letters = "";
	var bd = new openfl_display_BitmapData(700,9,true,-7829368);
	graphic = flixel_FlxG.bitmap.add(bd,false,"DEFAULT_FONT_KEY");
	var letterPos = 0;
	var i = 0;
	while(i < " 36000000000000000000!26101010001000\"46101010100000000000000000#66010100111110010100111110010100000000$56001000111011000001101110000100%66100100000100001000010000010010000000&66011000100000011010100100011010000000'26101000000000(36010100100100010000)36100010010010100000*46000010100100101000000000+46000001001110010000000000,36000000000000010100-46000000001110000000000000.26000000001000/66000010000100001000010000100000000000056011001001010010100100110000000156011000010000100001000010000000256111000001001100100001111000000356111000001001100000101110000000456100101001010010011100001000000556111101000011100000101110000000656011001000011100100100110000000756111000001000010001100001000000856011001001001100100100110000000956011001001010010011100001000000:26001000100000;26001000101000<46001001001000010000100000=46000011100000111000000000>46100001000010010010000000?56111000001001100000000100000000@66011100100010101110101010011100000000A56011001001010010111101001000000B56111001001011100100101110000000C56011001001010000100100110000000D56111001001010010100101110000000E56111101000011000100001111000000F56111101000010000110001000000000G56011001000010110100100111000000H56100101001011110100101001000000I26101010101000J56000100001000010100100110000000K56100101001010010111001001000000L46100010001000100011100000M66100010100010110110101010100010000000N56100101001011010101101001000000O56011001001010010100100110000000P56111001001010010111001000000000Q56011001001010010100100110000010R56111001001010010111001001000000S56011101000001100000101110000000T46111001000100010001000000U56100101001010010100100110000000V56100101001010010101000100000000W66100010100010101010110110100010000000X56100101001001100100101001000000Y56100101001010010011100001001100Z56111100001001100100001111000000[36110100100100110000}46110001000010010011000000]36110010010010110000^46010010100000000000000000_46000000000000000011110000'26101000000000a56000000111010010100100111000000b56100001110010010100101110000000c46000001101000100001100000d56000100111010010100100111000000e56000000110010110110000110000000f46011010001000110010000000g5700000011001001010010011100001001100h56100001110010010100101001000000i26100010101000j37010000010010010010100k56100001001010010111001001000000l26101010101000m66000000111100101010101010101010000000n56000001110010010100101001000000o56000000110010010100100110000000p5700000111001001010010111001000010000q5700000011101001010010011100001000010r46000010101100100010000000s56000000111011000001101110000000t46100011001000100001100000u56000001001010010100100111000000v56000001001010010101000100000000w66000000101010101010101010011110000000x56000001001010010011001001000000y5700000100101001010010011100001001100z56000001111000100010001111000000{46011001001000010001100000|26101010101000}46110001000010010011000000~56010101010000000000000000000000\\46111010101010101011100000".length) {
		letters += HxOverrides.substr(" 36000000000000000000!26101010001000\"46101010100000000000000000#66010100111110010100111110010100000000$56001000111011000001101110000100%66100100000100001000010000010010000000&66011000100000011010100100011010000000'26101000000000(36010100100100010000)36100010010010100000*46000010100100101000000000+46000001001110010000000000,36000000000000010100-46000000001110000000000000.26000000001000/66000010000100001000010000100000000000056011001001010010100100110000000156011000010000100001000010000000256111000001001100100001111000000356111000001001100000101110000000456100101001010010011100001000000556111101000011100000101110000000656011001000011100100100110000000756111000001000010001100001000000856011001001001100100100110000000956011001001010010011100001000000:26001000100000;26001000101000<46001001001000010000100000=46000011100000111000000000>46100001000010010010000000?56111000001001100000000100000000@66011100100010101110101010011100000000A56011001001010010111101001000000B56111001001011100100101110000000C56011001001010000100100110000000D56111001001010010100101110000000E56111101000011000100001111000000F56111101000010000110001000000000G56011001000010110100100111000000H56100101001011110100101001000000I26101010101000J56000100001000010100100110000000K56100101001010010111001001000000L46100010001000100011100000M66100010100010110110101010100010000000N56100101001011010101101001000000O56011001001010010100100110000000P56111001001010010111001000000000Q56011001001010010100100110000010R56111001001010010111001001000000S56011101000001100000101110000000T46111001000100010001000000U56100101001010010100100110000000V56100101001010010101000100000000W66100010100010101010110110100010000000X56100101001001100100101001000000Y56100101001010010011100001001100Z56111100001001100100001111000000[36110100100100110000}46110001000010010011000000]36110010010010110000^46010010100000000000000000_46000000000000000011110000'26101000000000a56000000111010010100100111000000b56100001110010010100101110000000c46000001101000100001100000d56000100111010010100100111000000e56000000110010110110000110000000f46011010001000110010000000g5700000011001001010010011100001001100h56100001110010010100101001000000i26100010101000j37010000010010010010100k56100001001010010111001001000000l26101010101000m66000000111100101010101010101010000000n56000001110010010100101001000000o56000000110010010100100110000000p5700000111001001010010111001000010000q5700000011101001010010011100001000010r46000010101100100010000000s56000000111011000001101110000000t46100011001000100001100000u56000001001010010100100111000000v56000001001010010101000100000000w66000000101010101010101010011110000000x56000001001010010011001001000000y5700000100101001010010011100001001100z56000001111000100010001111000000{46011001001000010001100000|26101010101000}46110001000010010011000000~56010101010000000000000000000000\\46111010101010101011100000",i,1);
		var gw = Std.parseInt(HxOverrides.substr(" 36000000000000000000!26101010001000\"46101010100000000000000000#66010100111110010100111110010100000000$56001000111011000001101110000100%66100100000100001000010000010010000000&66011000100000011010100100011010000000'26101000000000(36010100100100010000)36100010010010100000*46000010100100101000000000+46000001001110010000000000,36000000000000010100-46000000001110000000000000.26000000001000/66000010000100001000010000100000000000056011001001010010100100110000000156011000010000100001000010000000256111000001001100100001111000000356111000001001100000101110000000456100101001010010011100001000000556111101000011100000101110000000656011001000011100100100110000000756111000001000010001100001000000856011001001001100100100110000000956011001001010010011100001000000:26001000100000;26001000101000<46001001001000010000100000=46000011100000111000000000>46100001000010010010000000?56111000001001100000000100000000@66011100100010101110101010011100000000A56011001001010010111101001000000B56111001001011100100101110000000C56011001001010000100100110000000D56111001001010010100101110000000E56111101000011000100001111000000F56111101000010000110001000000000G56011001000010110100100111000000H56100101001011110100101001000000I26101010101000J56000100001000010100100110000000K56100101001010010111001001000000L46100010001000100011100000M66100010100010110110101010100010000000N56100101001011010101101001000000O56011001001010010100100110000000P56111001001010010111001000000000Q56011001001010010100100110000010R56111001001010010111001001000000S56011101000001100000101110000000T46111001000100010001000000U56100101001010010100100110000000V56100101001010010101000100000000W66100010100010101010110110100010000000X56100101001001100100101001000000Y56100101001010010011100001001100Z56111100001001100100001111000000[36110100100100110000}46110001000010010011000000]36110010010010110000^46010010100000000000000000_46000000000000000011110000'26101000000000a56000000111010010100100111000000b56100001110010010100101110000000c46000001101000100001100000d56000100111010010100100111000000e56000000110010110110000110000000f46011010001000110010000000g5700000011001001010010011100001001100h56100001110010010100101001000000i26100010101000j37010000010010010010100k56100001001010010111001001000000l26101010101000m66000000111100101010101010101010000000n56000001110010010100101001000000o56000000110010010100100110000000p5700000111001001010010111001000010000q5700000011101001010010011100001000010r46000010101100100010000000s56000000111011000001101110000000t46100011001000100001100000u56000001001010010100100111000000v56000001001010010101000100000000w66000000101010101010101010011110000000x56000001001010010011001001000000y5700000100101001010010011100001001100z56000001111000100010001111000000{46011001001000010001100000|26101010101000}46110001000010010011000000~56010101010000000000000000000000\\46111010101010101011100000",++i,1));
		var gh = Std.parseInt(HxOverrides.substr(" 36000000000000000000!26101010001000\"46101010100000000000000000#66010100111110010100111110010100000000$56001000111011000001101110000100%66100100000100001000010000010010000000&66011000100000011010100100011010000000'26101000000000(36010100100100010000)36100010010010100000*46000010100100101000000000+46000001001110010000000000,36000000000000010100-46000000001110000000000000.26000000001000/66000010000100001000010000100000000000056011001001010010100100110000000156011000010000100001000010000000256111000001001100100001111000000356111000001001100000101110000000456100101001010010011100001000000556111101000011100000101110000000656011001000011100100100110000000756111000001000010001100001000000856011001001001100100100110000000956011001001010010011100001000000:26001000100000;26001000101000<46001001001000010000100000=46000011100000111000000000>46100001000010010010000000?56111000001001100000000100000000@66011100100010101110101010011100000000A56011001001010010111101001000000B56111001001011100100101110000000C56011001001010000100100110000000D56111001001010010100101110000000E56111101000011000100001111000000F56111101000010000110001000000000G56011001000010110100100111000000H56100101001011110100101001000000I26101010101000J56000100001000010100100110000000K56100101001010010111001001000000L46100010001000100011100000M66100010100010110110101010100010000000N56100101001011010101101001000000O56011001001010010100100110000000P56111001001010010111001000000000Q56011001001010010100100110000010R56111001001010010111001001000000S56011101000001100000101110000000T46111001000100010001000000U56100101001010010100100110000000V56100101001010010101000100000000W66100010100010101010110110100010000000X56100101001001100100101001000000Y56100101001010010011100001001100Z56111100001001100100001111000000[36110100100100110000}46110001000010010011000000]36110010010010110000^46010010100000000000000000_46000000000000000011110000'26101000000000a56000000111010010100100111000000b56100001110010010100101110000000c46000001101000100001100000d56000100111010010100100111000000e56000000110010110110000110000000f46011010001000110010000000g5700000011001001010010011100001001100h56100001110010010100101001000000i26100010101000j37010000010010010010100k56100001001010010111001001000000l26101010101000m66000000111100101010101010101010000000n56000001110010010100101001000000o56000000110010010100100110000000p5700000111001001010010111001000010000q5700000011101001010010011100001000010r46000010101100100010000000s56000000111011000001101110000000t46100011001000100001100000u56000001001010010100100111000000v56000001001010010101000100000000w66000000101010101010101010011110000000x56000001001010010011001001000000y5700000100101001010010011100001001100z56000001111000100010001111000000{46011001001000010001100000|26101010101000}46110001000010010011000000~56010101010000000000000000000000\\46111010101010101011100000",++i,1));
		var _g = 0;
		var _g1 = gh;
		while(_g < _g1) {
			var py = _g++;
			var _g2 = 0;
			var _g3 = gw;
			while(_g2 < _g3) {
				var px = _g2++;
				++i;
				if(HxOverrides.substr(" 36000000000000000000!26101010001000\"46101010100000000000000000#66010100111110010100111110010100000000$56001000111011000001101110000100%66100100000100001000010000010010000000&66011000100000011010100100011010000000'26101000000000(36010100100100010000)36100010010010100000*46000010100100101000000000+46000001001110010000000000,36000000000000010100-46000000001110000000000000.26000000001000/66000010000100001000010000100000000000056011001001010010100100110000000156011000010000100001000010000000256111000001001100100001111000000356111000001001100000101110000000456100101001010010011100001000000556111101000011100000101110000000656011001000011100100100110000000756111000001000010001100001000000856011001001001100100100110000000956011001001010010011100001000000:26001000100000;26001000101000<46001001001000010000100000=46000011100000111000000000>46100001000010010010000000?56111000001001100000000100000000@66011100100010101110101010011100000000A56011001001010010111101001000000B56111001001011100100101110000000C56011001001010000100100110000000D56111001001010010100101110000000E56111101000011000100001111000000F56111101000010000110001000000000G56011001000010110100100111000000H56100101001011110100101001000000I26101010101000J56000100001000010100100110000000K56100101001010010111001001000000L46100010001000100011100000M66100010100010110110101010100010000000N56100101001011010101101001000000O56011001001010010100100110000000P56111001001010010111001000000000Q56011001001010010100100110000010R56111001001010010111001001000000S56011101000001100000101110000000T46111001000100010001000000U56100101001010010100100110000000V56100101001010010101000100000000W66100010100010101010110110100010000000X56100101001001100100101001000000Y56100101001010010011100001001100Z56111100001001100100001111000000[36110100100100110000}46110001000010010011000000]36110010010010110000^46010010100000000000000000_46000000000000000011110000'26101000000000a56000000111010010100100111000000b56100001110010010100101110000000c46000001101000100001100000d56000100111010010100100111000000e56000000110010110110000110000000f46011010001000110010000000g5700000011001001010010011100001001100h56100001110010010100101001000000i26100010101000j37010000010010010010100k56100001001010010111001001000000l26101010101000m66000000111100101010101010101010000000n56000001110010010100101001000000o56000000110010010100100110000000p5700000111001001010010111001000010000q5700000011101001010010011100001000010r46000010101100100010000000s56000000111011000001101110000000t46100011001000100001100000u56000001001010010100100111000000v56000001001010010101000100000000w66000000101010101010101010011110000000x56000001001010010011001001000000y5700000100101001010010011100001001100z56000001111000100010001111000000{46011001001000010001100000|26101010101000}46110001000010010011000000~56010101010000000000000000000000\\46111010101010101011100000",i,1) == "1") {
					bd.setPixel32(1 + letterPos * 7 + px,1 + py,-1);
				} else {
					bd.setPixel32(1 + letterPos * 7 + px,1 + py,0);
				}
			}
		}
		++i;
		++letterPos;
	}
	return flixel_graphics_frames_FlxBitmapFont.fromXNA(graphic,letters);
};
flixel_graphics_frames_FlxBitmapFont.fromAngelCode = function(Source,Data,Unique) {
	if(Unique == null) {
		Unique = false;
	}
	var graphic = null;
	var frame = null;
	if(((Source) instanceof flixel_graphics_frames_FlxFrame)) {
		frame = Source;
		graphic = frame.parent;
	} else {
		graphic = flixel_FlxG.bitmap.add(Source,Unique);
		frame = graphic.get_imageFrame().get_frame();
	}
	var font = flixel_graphics_frames_FlxBitmapFont.findFont(frame);
	if(font != null) {
		return font;
	}
	var fontData = null;
	if(Data != null) {
		if(((Data) instanceof Xml)) {
			fontData = Data;
		} else {
			var data = Std.string(Data);
			if(openfl_utils_Assets.exists(data)) {
				data = openfl_utils_Assets.getText(data);
			}
			fontData = Xml.parse(data);
		}
	}
	font = new flixel_graphics_frames_FlxBitmapFont(frame);
	var x = fontData.firstElement();
	if(x.nodeType != Xml.Document && x.nodeType != Xml.Element) {
		throw haxe_Exception.thrown("Invalid nodeType " + (x.nodeType == null ? "null" : XmlType.toString(x.nodeType)));
	}
	var this1 = x;
	var fast = this1;
	font.lineHeight = Std.parseInt(haxe_xml__$Access_AttribAccess.resolve(haxe_xml__$Access_NodeAccess.resolve(fast,"common"),"lineHeight"));
	font.size = Std.parseInt(haxe_xml__$Access_AttribAccess.resolve(haxe_xml__$Access_NodeAccess.resolve(fast,"info"),"size"));
	font.fontName = Std.string(haxe_xml__$Access_AttribAccess.resolve(haxe_xml__$Access_NodeAccess.resolve(fast,"info"),"face"));
	font.bold = Std.parseInt(haxe_xml__$Access_AttribAccess.resolve(haxe_xml__$Access_NodeAccess.resolve(fast,"info"),"bold")) != 0;
	font.italic = Std.parseInt(haxe_xml__$Access_AttribAccess.resolve(haxe_xml__$Access_NodeAccess.resolve(fast,"info"),"italic")) != 0;
	var frame;
	var frameHeight;
	var offset;
	var charStr;
	var charCode;
	var xOffset;
	var yOffset;
	var xAdvance;
	var chars = haxe_xml__$Access_NodeAccess.resolve(fast,"chars");
	var _g = 0;
	var _g1 = haxe_xml__$Access_NodeListAccess.resolve(chars,"char");
	while(_g < _g1.length) {
		var char = _g1[_g];
		++_g;
		var _this = flixel_math_FlxRect._pool.get();
		var X = 0;
		var Y = 0;
		var Width = 0;
		var Height = 0;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		var rect = _this;
		rect._inPool = false;
		frame = rect;
		frame.x = Std.parseInt(haxe_xml__$Access_AttribAccess.resolve(char,"x"));
		frame.y = Std.parseInt(haxe_xml__$Access_AttribAccess.resolve(char,"y"));
		frame.width = Std.parseInt(haxe_xml__$Access_AttribAccess.resolve(char,"width"));
		frameHeight = Std.parseInt(haxe_xml__$Access_AttribAccess.resolve(char,"height"));
		frame.height = frameHeight;
		xOffset = haxe_xml__$Access_HasAttribAccess.resolve(char,"xoffset") ? Std.parseInt(haxe_xml__$Access_AttribAccess.resolve(char,"xoffset")) : 0;
		yOffset = haxe_xml__$Access_HasAttribAccess.resolve(char,"yoffset") ? Std.parseInt(haxe_xml__$Access_AttribAccess.resolve(char,"yoffset")) : 0;
		xAdvance = haxe_xml__$Access_HasAttribAccess.resolve(char,"xadvance") ? Std.parseInt(haxe_xml__$Access_AttribAccess.resolve(char,"xadvance")) : 0;
		var X1 = xOffset;
		var Y1 = yOffset;
		if(Y1 == null) {
			Y1 = 0;
		}
		if(X1 == null) {
			X1 = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X1,Y1);
		point._inPool = false;
		offset = point;
		font.minOffsetX = font.minOffsetX < -xOffset ? -xOffset : font.minOffsetX;
		charCode = -1;
		charStr = null;
		if(haxe_xml__$Access_HasAttribAccess.resolve(char,"letter")) {
			charStr = haxe_xml__$Access_AttribAccess.resolve(char,"letter");
		} else if(haxe_xml__$Access_HasAttribAccess.resolve(char,"id")) {
			charCode = Std.parseInt(haxe_xml__$Access_AttribAccess.resolve(char,"id"));
		}
		if(charCode == -1 && charStr == null) {
			throw haxe_Exception.thrown("Invalid font xml data!");
		}
		if(charStr != null) {
			switch(charStr) {
			case "&amp;":
				charStr = "&";
				break;
			case "&gt;":
				charStr = ">";
				break;
			case "&lt;":
				charStr = "<";
				break;
			case "&quot;":
				charStr = "\"";
				break;
			case "space":
				charStr = " ";
				break;
			default:
			}
			charCode = UnicodeString.charCodeAt(charStr,0);
		}
		font.addCharFrame(charCode,frame,offset,xAdvance);
		if(charCode == 32) {
			font.spaceWidth = xAdvance;
		} else {
			font.lineHeight = font.lineHeight > frameHeight + yOffset ? font.lineHeight : frameHeight + yOffset;
		}
	}
	font.updateSourceHeight();
	return font;
};
flixel_graphics_frames_FlxBitmapFont.fromXNA = function(source,letters,charBGColor) {
	if(charBGColor == null) {
		charBGColor = 0;
	}
	var graphic = null;
	var frame = null;
	if(((source) instanceof flixel_graphics_frames_FlxFrame)) {
		frame = source;
		graphic = frame.parent;
	} else {
		graphic = flixel_FlxG.bitmap.add(source);
		frame = graphic.get_imageFrame().get_frame();
	}
	var font = flixel_graphics_frames_FlxBitmapFont.findFont(frame);
	if(font != null) {
		return font;
	}
	if(letters == null) {
		letters = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
	}
	font = new flixel_graphics_frames_FlxBitmapFont(frame);
	font.fontName = graphic.key;
	var bmd = graphic.bitmap;
	var p = new openfl_geom_Point();
	p.setTo(0,0);
	var x = p.x;
	var y = p.y;
	if(frame.angle == -90) {
		p.x = frame.frame.width - y;
		p.y = x;
	} else if(frame.angle == 90) {
		p.x = y;
		p.y = frame.frame.height - x;
	}
	p.x += frame.frame.x;
	p.y += frame.frame.y;
	var globalBGColor = bmd.getPixel(p.x | 0,p.y | 0);
	var frameWidth = frame.frame.width | 0;
	var frameHeight = frame.frame.height | 0;
	var letterIdx = 0;
	var charCode;
	var numLetters = UnicodeString.get_length(letters);
	var rect;
	var offset;
	var xAdvance;
	var cy = 0;
	var cx;
	var gx;
	var gy;
	var gw;
	var gh;
	while(cy < frameHeight && letterIdx < numLetters) {
		var rowHeight = 0;
		cx = 0;
		while(cx < frameWidth && letterIdx < numLetters) {
			p.setTo(cx,cy);
			var x = p.x;
			var y = p.y;
			if(frame.angle == -90) {
				p.x = frame.frame.width - y;
				p.y = x;
			} else if(frame.angle == 90) {
				p.x = y;
				p.y = frame.frame.height - x;
			}
			p.x += frame.frame.x;
			p.y += frame.frame.y;
			if(bmd.getPixel(p.x | 0,p.y | 0) != globalBGColor) {
				gx = cx;
				gy = cy;
				p.setTo(gx,gy);
				var x1 = p.x;
				var y1 = p.y;
				if(frame.angle == -90) {
					p.x = frame.frame.width - y1;
					p.y = x1;
				} else if(frame.angle == 90) {
					p.x = y1;
					p.y = frame.frame.height - x1;
				}
				p.x += frame.frame.x;
				p.y += frame.frame.y;
				while(gx < frameWidth && bmd.getPixel(p.x | 0,p.y | 0) != globalBGColor) {
					++gx;
					p.setTo(gx,cy);
					var x2 = p.x;
					var y2 = p.y;
					if(frame.angle == -90) {
						p.x = frame.frame.width - y2;
						p.y = x2;
					} else if(frame.angle == 90) {
						p.x = y2;
						p.y = frame.frame.height - x2;
					}
					p.x += frame.frame.x;
					p.y += frame.frame.y;
				}
				p.setTo(gx - 1,gy);
				var x3 = p.x;
				var y3 = p.y;
				if(frame.angle == -90) {
					p.x = frame.frame.width - y3;
					p.y = x3;
				} else if(frame.angle == 90) {
					p.x = y3;
					p.y = frame.frame.height - x3;
				}
				p.x += frame.frame.x;
				p.y += frame.frame.y;
				while(gy < frameHeight && bmd.getPixel(p.x | 0,p.y | 0) != globalBGColor) {
					++gy;
					p.setTo(cx,gy);
					var x4 = p.x;
					var y4 = p.y;
					if(frame.angle == -90) {
						p.x = frame.frame.width - y4;
						p.y = x4;
					} else if(frame.angle == 90) {
						p.x = y4;
						p.y = frame.frame.height - x4;
					}
					p.x += frame.frame.x;
					p.y += frame.frame.y;
				}
				gw = gx - cx;
				gh = gy - cy;
				charCode = UnicodeString.charCodeAt(letters,letterIdx);
				var X = cx;
				var Y = cy;
				var Width = gw;
				var Height = gh;
				if(Height == null) {
					Height = 0;
				}
				if(Width == null) {
					Width = 0;
				}
				if(Y == null) {
					Y = 0;
				}
				if(X == null) {
					X = 0;
				}
				var _this = flixel_math_FlxRect._pool.get();
				var X1 = X;
				var Y1 = Y;
				var Width1 = Width;
				var Height1 = Height;
				if(Height1 == null) {
					Height1 = 0;
				}
				if(Width1 == null) {
					Width1 = 0;
				}
				if(Y1 == null) {
					Y1 = 0;
				}
				if(X1 == null) {
					X1 = 0;
				}
				_this.x = X1;
				_this.y = Y1;
				_this.width = Width1;
				_this.height = Height1;
				var rect1 = _this;
				rect1._inPool = false;
				rect = rect1;
				var X2 = 0;
				var Y2 = 0;
				if(Y2 == null) {
					Y2 = 0;
				}
				if(X2 == null) {
					X2 = 0;
				}
				var point = flixel_math_FlxPoint._pool.get().set(X2,Y2);
				point._inPool = false;
				offset = point;
				xAdvance = gw;
				font.addCharFrame(charCode,rect,offset,xAdvance);
				if(charCode == 32) {
					font.spaceWidth = xAdvance;
				}
				if(gh > rowHeight) {
					rowHeight = gh;
				}
				if(gh > font.size) {
					font.size = gh;
				}
				cx += gw;
				++letterIdx;
			}
			++cx;
		}
		cy += rowHeight + 1;
	}
	font.lineHeight = font.size;
	font.updateSourceHeight();
	flixel_graphics_frames_FlxBitmapFont.point.setTo(frame.frame.x | 0,frame.frame.y | 0);
	var frameRect = flixel_graphics_frames_FlxBitmapFont.flashRect;
	var _this = frame.frame;
	var FlashRect = frameRect;
	if(FlashRect == null) {
		FlashRect = new openfl_geom_Rectangle();
	}
	FlashRect.x = _this.x;
	FlashRect.y = _this.y;
	FlashRect.width = _this.width;
	FlashRect.height = _this.height;
	var bgColor32 = bmd.getPixel32(frame.frame.x | 0,frame.frame.y | 0);
	bmd.threshold(bmd,frameRect,flixel_graphics_frames_FlxBitmapFont.point,"==",bgColor32,0,-1,true);
	if(charBGColor != 0) {
		bmd.threshold(bmd,frameRect,flixel_graphics_frames_FlxBitmapFont.point,"==",charBGColor,0,-1,true);
	}
	return font;
};
flixel_graphics_frames_FlxBitmapFont.transformPoint = function(point,frame) {
	var x = point.x;
	var y = point.y;
	if(frame.angle == -90) {
		point.x = frame.frame.width - y;
		point.y = x;
	} else if(frame.angle == 90) {
		point.x = y;
		point.y = frame.frame.height - x;
	}
	point.x += frame.frame.x;
	point.y += frame.frame.y;
	return point;
};
flixel_graphics_frames_FlxBitmapFont.fromMonospace = function(source,letters,charSize,region,spacing) {
	var graphic = null;
	var frame = null;
	if(((source) instanceof flixel_graphics_frames_FlxFrame)) {
		frame = source;
		graphic = frame.parent;
	} else {
		graphic = flixel_FlxG.bitmap.add(source);
		frame = graphic.get_imageFrame().get_frame();
	}
	var font = flixel_graphics_frames_FlxBitmapFont.findFont(frame);
	if(font != null) {
		return font;
	}
	if(letters == null) {
		letters = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
	}
	if(region == null) {
		var X = 0;
		var Y = 0;
		var Width = frame.sourceSize.x;
		var Height = frame.sourceSize.y;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var X1 = X;
		var Y1 = Y;
		var Width1 = Width;
		var Height1 = Height;
		if(Height1 == null) {
			Height1 = 0;
		}
		if(Width1 == null) {
			Width1 = 0;
		}
		if(Y1 == null) {
			Y1 = 0;
		}
		if(X1 == null) {
			X1 = 0;
		}
		var _this = flixel_math_FlxRect._pool.get();
		var X = X1;
		var Y = Y1;
		var Width = Width1;
		var Height = Height1;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		var rect = _this;
		rect._inPool = false;
		var rect1 = rect;
		rect1._weak = true;
		region = rect1;
	}
	if(spacing == null) {
		var X = 0;
		var Y = 0;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		spacing = point;
	}
	var bitmapWidth = region.width | 0;
	var bitmapHeight = region.height | 0;
	var startX = region.x | 0;
	var startY = region.y | 0;
	if(region._weak) {
		if(!region._inPool) {
			region._inPool = true;
			region._weak = false;
			flixel_math_FlxRect._pool.putUnsafe(region);
		}
	}
	var xSpacing = spacing.x | 0;
	var ySpacing = spacing.y | 0;
	var charWidth = charSize.x | 0;
	var charHeight = charSize.y | 0;
	var spacedWidth = charWidth + xSpacing;
	var spacedHeight = charHeight + ySpacing;
	var numRows = charHeight == 0 ? 1 : (bitmapHeight + ySpacing) / spacedHeight | 0;
	var numCols = charWidth == 0 ? 1 : (bitmapWidth + xSpacing) / spacedWidth | 0;
	font = new flixel_graphics_frames_FlxBitmapFont(frame);
	font.fontName = graphic.key;
	font.lineHeight = font.size = charHeight;
	var charRect;
	var offset;
	var xAdvance = charWidth;
	font.spaceWidth = xAdvance;
	var letterIndex = 0;
	var numLetters = UnicodeString.get_length(letters);
	var _g = 0;
	var _g1 = numRows;
	while(_g < _g1) {
		var j = _g++;
		var _g2 = 0;
		var _g3 = numCols;
		while(_g2 < _g3) {
			var i = _g2++;
			var X = startX + i * spacedWidth;
			var Y = startY + j * spacedHeight;
			var Width = charWidth;
			var Height = charHeight;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var _this = flixel_math_FlxRect._pool.get();
			var X1 = X;
			var Y1 = Y;
			var Width1 = Width;
			var Height1 = Height;
			if(Height1 == null) {
				Height1 = 0;
			}
			if(Width1 == null) {
				Width1 = 0;
			}
			if(Y1 == null) {
				Y1 = 0;
			}
			if(X1 == null) {
				X1 = 0;
			}
			_this.x = X1;
			_this.y = Y1;
			_this.width = Width1;
			_this.height = Height1;
			var rect = _this;
			rect._inPool = false;
			charRect = rect;
			var X2 = 0;
			var Y2 = 0;
			if(Y2 == null) {
				Y2 = 0;
			}
			if(X2 == null) {
				X2 = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X2,Y2);
			point._inPool = false;
			offset = point;
			font.addCharFrame(UnicodeString.charCodeAt(letters,letterIndex),charRect,offset,xAdvance);
			++letterIndex;
			if(letterIndex >= numLetters) {
				return font;
			}
		}
	}
	font.updateSourceHeight();
	return font;
};
flixel_graphics_frames_FlxBitmapFont.findFont = function(frame,border) {
	if(border == null) {
		var X = 0;
		var Y = 0;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		var point1 = point;
		point1._weak = true;
		border = point1;
	}
	var _this = frame.parent;
	var type = flixel_graphics_frames_FlxFrameCollectionType.FONT;
	var collections = _this.frameCollections.get(type);
	if(collections == null) {
		collections = [];
		_this.frameCollections.set(type,collections);
	}
	var bitmapFonts = collections;
	var _g = 0;
	while(_g < bitmapFonts.length) {
		var font = bitmapFonts[_g];
		++_g;
		var tmp;
		if(font.frame == frame) {
			var _this = font.border;
			var result = Math.abs(_this.x - border.x) <= 0.0000001 && Math.abs(_this.y - border.y) <= 0.0000001;
			if(border._weak) {
				border.put();
			}
			tmp = result;
		} else {
			tmp = false;
		}
		if(tmp) {
			return font;
		}
	}
	return null;
};
flixel_graphics_frames_FlxBitmapFont.__super__ = flixel_graphics_frames_FlxFramesCollection;
flixel_graphics_frames_FlxBitmapFont.prototype = $extend(flixel_graphics_frames_FlxFramesCollection.prototype,{
	size: null
	,lineHeight: null
	,bold: null
	,italic: null
	,fontName: null
	,numLetters: null
	,minOffsetX: null
	,spaceWidth: null
	,charMap: null
	,charAdvance: null
	,frame: null
	,destroy: function() {
		flixel_graphics_frames_FlxFramesCollection.prototype.destroy.call(this);
		this.frame = null;
		this.fontName = null;
		this.charMap = null;
		this.charAdvance = null;
	}
	,addCharFrame: function(charCode,frame,offset,xAdvance) {
		var this1 = "";
		var s = this1 + String.fromCodePoint(charCode);
		if(s == null) {
			s = "";
		}
		var this1 = s;
		var charName = this1;
		if(frame.width == 0 || frame.height == 0 || this.framesHash.h[charName] != null) {
			return;
		}
		var charFrame = this.frame.subFrameTo(frame);
		var w = charFrame.sourceSize.x;
		var h = charFrame.sourceSize.y;
		w += offset.x > 0 ? offset.x : 0;
		h += offset.y > 0 ? offset.y : 0;
		charFrame.sourceSize.set(w,h);
		charFrame.offset.addPoint(offset);
		charFrame.name = charName;
		this.pushFrame(charFrame);
		this.charMap.h[charCode] = charFrame;
		this.charAdvance.h[charCode] = xAdvance;
		offset.put();
	}
	,updateSourceHeight: function() {
		var _g = 0;
		var _g1 = this.frames;
		while(_g < _g1.length) {
			var frame = _g1[_g];
			++_g;
			frame.sourceSize.set_y(this.lineHeight);
			frame.cacheFrameMatrix();
		}
	}
	,charExists: function(charCode) {
		return this.charMap.h.hasOwnProperty(charCode);
	}
	,getCharFrame: function(charCode) {
		return this.charMap.h[charCode];
	}
	,getCharAdvance: function(charCode) {
		if(this.charAdvance.h.hasOwnProperty(charCode)) {
			return this.charAdvance.h[charCode];
		} else {
			return 0;
		}
	}
	,getCharWidth: function(charCode) {
		if(this.charMap.h.hasOwnProperty(charCode)) {
			return this.charMap.h[charCode].sourceSize.x;
		} else {
			return 0;
		}
	}
	,addBorder: function(border) {
		var X = 0;
		var Y = 0;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		var point1 = point;
		point1._weak = true;
		var resultBorder = point1.addPoint(this.border).addPoint(border);
		var font = flixel_graphics_frames_FlxBitmapFont.findFont(this.frame,resultBorder);
		if(font != null) {
			return font;
		}
		font = new flixel_graphics_frames_FlxBitmapFont(this.frame,border);
		font.spaceWidth = this.spaceWidth;
		font.fontName = this.fontName;
		font.numLetters = this.numLetters;
		font.minOffsetX = this.minOffsetX;
		font.size = this.size;
		font.lineHeight = this.lineHeight;
		font.italic = this.italic;
		font.bold = this.bold;
		var charWithBorder;
		var code;
		var _g = 0;
		var _g1 = this.frames;
		while(_g < _g1.length) {
			var char = _g1[_g];
			++_g;
			charWithBorder = char.setBorderTo(border);
			font.pushFrame(charWithBorder);
			code = UnicodeString.charCodeAt(char.name,0);
			font.charMap.h[code] = charWithBorder;
			font.charAdvance.h[code] = this.charAdvance.h[code];
		}
		font.updateSourceHeight();
		return font;
	}
	,__class__: flixel_graphics_frames_FlxBitmapFont
});
var flixel_graphics_frames_FlxFrame = function(parent,angle,flipX,flipY) {
	if(flipY == null) {
		flipY = false;
	}
	if(flipX == null) {
		flipX = false;
	}
	if(angle == null) {
		angle = 0;
	}
	this.matrix = new flixel_math_FlxMatrix();
	this.rect = new openfl_geom_Rectangle();
	this.point2 = new openfl_geom_Point();
	this.point1 = new openfl_geom_Point();
	this.parent = parent;
	this.angle = angle;
	this.flipX = flipX;
	this.flipY = flipY;
	this.type = 0;
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	this.sourceSize = point;
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	this.offset = point;
	var this1 = new Array(6);
	this.blitMatrix = this1;
	if(flixel_FlxG.renderTile) {
		var this1 = new Array(6);
		this.tileMatrix = this1;
	}
};
$hxClasses["flixel.graphics.frames.FlxFrame"] = flixel_graphics_frames_FlxFrame;
flixel_graphics_frames_FlxFrame.__name__ = "flixel.graphics.frames.FlxFrame";
flixel_graphics_frames_FlxFrame.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_graphics_frames_FlxFrame.sort = function(frames,prefixLength,postfixLength) {
	var prefixLength1 = prefixLength;
	var postfixLength1 = postfixLength;
	haxe_ds_ArraySort.sort(frames,function(frame1,frame2) {
		return flixel_graphics_frames_FlxFrame.sortByName(frame1,frame2,prefixLength1,postfixLength1);
	});
};
flixel_graphics_frames_FlxFrame.sortByName = function(frame1,frame2,prefixLength,postfixLength) {
	var name1 = frame1.name;
	var name2 = frame2.name;
	var num1 = Std.parseInt(name1.substring(prefixLength,name1.length - postfixLength));
	var num2 = Std.parseInt(name2.substring(prefixLength,name2.length - postfixLength));
	if(num1 == null) {
		num1 = 0;
	}
	if(num2 == null) {
		num2 = 0;
	}
	return num1 - num2;
};
flixel_graphics_frames_FlxFrame.prototype = {
	point1: null
	,point2: null
	,rect: null
	,matrix: null
	,name: null
	,frame: null
	,uv: null
	,parent: null
	,angle: null
	,flipX: null
	,flipY: null
	,sourceSize: null
	,offset: null
	,type: null
	,tileMatrix: null
	,blitMatrix: null
	,cacheFrameMatrix: function() {
		var mat = this.matrix;
		var blit = true;
		if(blit == null) {
			blit = true;
		}
		mat.identity();
		if(blit) {
			mat.translate(-this.frame.x,-this.frame.y);
		}
		if(this.angle == 90) {
			mat.setTo(-mat.b,mat.a,-mat.d,mat.c,-mat.ty,mat.tx);
			mat.translate(this.frame.height,0);
		} else if(this.angle == -90) {
			mat.setTo(mat.b,-mat.a,mat.d,-mat.c,mat.ty,-mat.tx);
			mat.translate(0,this.frame.width);
		}
		mat.translate(this.offset.x,this.offset.y);
		this.blitMatrix[0] = this.matrix.a;
		this.blitMatrix[1] = this.matrix.b;
		this.blitMatrix[2] = this.matrix.c;
		this.blitMatrix[3] = this.matrix.d;
		this.blitMatrix[4] = this.matrix.tx;
		this.blitMatrix[5] = this.matrix.ty;
		if(flixel_FlxG.renderTile) {
			var mat = this.matrix;
			var blit = false;
			if(blit == null) {
				blit = true;
			}
			mat.identity();
			if(blit) {
				mat.translate(-this.frame.x,-this.frame.y);
			}
			if(this.angle == 90) {
				mat.setTo(-mat.b,mat.a,-mat.d,mat.c,-mat.ty,mat.tx);
				mat.translate(this.frame.height,0);
			} else if(this.angle == -90) {
				mat.setTo(mat.b,-mat.a,mat.d,-mat.c,mat.ty,-mat.tx);
				mat.translate(0,this.frame.width);
			}
			mat.translate(this.offset.x,this.offset.y);
			this.tileMatrix[0] = this.matrix.a;
			this.tileMatrix[1] = this.matrix.b;
			this.tileMatrix[2] = this.matrix.c;
			this.tileMatrix[3] = this.matrix.d;
			this.tileMatrix[4] = this.matrix.tx;
			this.tileMatrix[5] = this.matrix.ty;
		}
	}
	,prepareBlitMatrix: function(mat,blit) {
		if(blit == null) {
			blit = true;
		}
		mat.identity();
		if(blit) {
			mat.translate(-this.frame.x,-this.frame.y);
		}
		if(this.angle == 90) {
			mat.setTo(-mat.b,mat.a,-mat.d,mat.c,-mat.ty,mat.tx);
			mat.translate(this.frame.height,0);
		} else if(this.angle == -90) {
			mat.setTo(mat.b,-mat.a,mat.d,-mat.c,mat.ty,-mat.tx);
			mat.translate(0,this.frame.width);
		}
		mat.translate(this.offset.x,this.offset.y);
		return mat;
	}
	,rotateAndFlip: function(mat,rotation,flipX,flipY) {
		if(flipY == null) {
			flipY = false;
		}
		if(flipX == null) {
			flipX = false;
		}
		if(rotation == null) {
			rotation = 0;
		}
		var w = this.sourceSize.x | 0;
		var h = this.sourceSize.y | 0;
		if(rotation != 0) {
			var t = w;
			w = h;
			h = t;
			if(rotation == 90) {
				mat.setTo(-mat.b,mat.a,-mat.d,mat.c,-mat.ty,mat.tx);
				mat.translate(this.sourceSize.y,0);
			} else if(rotation == -90 || rotation == -90) {
				mat.setTo(mat.b,-mat.a,mat.d,-mat.c,mat.ty,-mat.tx);
				mat.translate(0,this.sourceSize.x);
			}
		}
		if(flipX) {
			mat.scale(-1,1);
			mat.translate(w,0);
		}
		if(flipY) {
			mat.scale(1,-1);
			mat.translate(0,h);
		}
		return mat;
	}
	,prepareTransformedBlitMatrix: function(mat,rotation,flipX,flipY) {
		if(flipY == null) {
			flipY = false;
		}
		if(flipX == null) {
			flipX = false;
		}
		if(rotation == null) {
			rotation = 0;
		}
		mat.a = this.blitMatrix[0];
		mat.b = this.blitMatrix[1];
		mat.c = this.blitMatrix[2];
		mat.d = this.blitMatrix[3];
		mat.tx = this.blitMatrix[4];
		mat.ty = this.blitMatrix[5];
		var rotation1 = rotation;
		var flipX1 = flipX;
		var flipY1 = flipY;
		if(flipY1 == null) {
			flipY1 = false;
		}
		if(flipX1 == null) {
			flipX1 = false;
		}
		if(rotation1 == null) {
			rotation1 = 0;
		}
		var w = this.sourceSize.x | 0;
		var h = this.sourceSize.y | 0;
		if(rotation1 != 0) {
			var t = w;
			w = h;
			h = t;
			if(rotation1 == 90) {
				mat.setTo(-mat.b,mat.a,-mat.d,mat.c,-mat.ty,mat.tx);
				mat.translate(this.sourceSize.y,0);
			} else if(rotation1 == -90 || rotation1 == -90) {
				mat.setTo(mat.b,-mat.a,mat.d,-mat.c,mat.ty,-mat.tx);
				mat.translate(0,this.sourceSize.x);
			}
		}
		if(flipX1) {
			mat.scale(-1,1);
			mat.translate(w,0);
		}
		if(flipY1) {
			mat.scale(1,-1);
			mat.translate(0,h);
		}
		return mat;
	}
	,prepareMatrix: function(mat,rotation,flipX,flipY) {
		if(flipY == null) {
			flipY = false;
		}
		if(flipX == null) {
			flipX = false;
		}
		if(rotation == null) {
			rotation = 0;
		}
		if(flixel_FlxG.renderBlit) {
			mat.identity();
			return mat;
		}
		mat.a = this.tileMatrix[0];
		mat.b = this.tileMatrix[1];
		mat.c = this.tileMatrix[2];
		mat.d = this.tileMatrix[3];
		mat.tx = this.tileMatrix[4];
		mat.ty = this.tileMatrix[5];
		var doFlipX = flipX != this.flipX;
		var doFlipY = flipY != this.flipY;
		if(rotation == 0 && !doFlipX && !doFlipY) {
			return mat;
		}
		var rotation1 = rotation;
		var flipX = doFlipX;
		var flipY = doFlipY;
		if(flipY == null) {
			flipY = false;
		}
		if(flipX == null) {
			flipX = false;
		}
		if(rotation1 == null) {
			rotation1 = 0;
		}
		var w = this.sourceSize.x | 0;
		var h = this.sourceSize.y | 0;
		if(rotation1 != 0) {
			var t = w;
			w = h;
			h = t;
			if(rotation1 == 90) {
				mat.setTo(-mat.b,mat.a,-mat.d,mat.c,-mat.ty,mat.tx);
				mat.translate(this.sourceSize.y,0);
			} else if(rotation1 == -90 || rotation1 == -90) {
				mat.setTo(mat.b,-mat.a,mat.d,-mat.c,mat.ty,-mat.tx);
				mat.translate(0,this.sourceSize.x);
			}
		}
		if(flipX) {
			mat.scale(-1,1);
			mat.translate(w,0);
		}
		if(flipY) {
			mat.scale(1,-1);
			mat.translate(0,h);
		}
		return mat;
	}
	,fillBlitMatrix: function(mat) {
		mat.a = this.blitMatrix[0];
		mat.b = this.blitMatrix[1];
		mat.c = this.blitMatrix[2];
		mat.d = this.blitMatrix[3];
		mat.tx = this.blitMatrix[4];
		mat.ty = this.blitMatrix[5];
		return mat;
	}
	,paint: function(bmd,point,mergeAlpha,disposeIfNotEqual) {
		if(disposeIfNotEqual == null) {
			disposeIfNotEqual = false;
		}
		if(mergeAlpha == null) {
			mergeAlpha = false;
		}
		if(point == null) {
			point = this.point1;
			point.setTo(0,0);
		}
		var bmd1 = bmd;
		var rotation = 0;
		var mergeAlpha1 = mergeAlpha;
		var disposeIfNotEqual1 = disposeIfNotEqual;
		if(disposeIfNotEqual1 == null) {
			disposeIfNotEqual1 = false;
		}
		if(mergeAlpha1 == null) {
			mergeAlpha1 = false;
		}
		if(rotation == null) {
			rotation = 0;
		}
		var w = this.sourceSize.x | 0;
		var h = this.sourceSize.y | 0;
		if(rotation != 0) {
			var t = w;
			w = h;
			h = t;
		}
		if(bmd1 != null && disposeIfNotEqual1) {
			bmd1 = flixel_util_FlxDestroyUtil.disposeIfNotEqual(bmd1,w,h);
		}
		if(bmd1 != null && !mergeAlpha1) {
			this.rect.setTo(point.x,point.y,w,h);
			bmd1.fillRect(this.rect,0);
		} else if(bmd1 == null) {
			bmd1 = new openfl_display_BitmapData(w,h,true,0);
		}
		bmd = bmd1;
		if(this.type == 2) {
			return bmd;
		}
		if(this.angle == 0) {
			var _this = this.offset;
			var FlashPoint = this.point2;
			if(FlashPoint == null) {
				FlashPoint = new openfl_geom_Point();
			}
			FlashPoint.x = _this.x;
			FlashPoint.y = _this.y;
			this.point2.x += point.x;
			this.point2.y += point.y;
			var tmp = this.parent.bitmap;
			var _this = this.frame;
			var FlashRect = this.rect;
			if(FlashRect == null) {
				FlashRect = new openfl_geom_Rectangle();
			}
			FlashRect.x = _this.x;
			FlashRect.y = _this.y;
			FlashRect.width = _this.width;
			FlashRect.height = _this.height;
			bmd.copyPixels(tmp,FlashRect,this.point2,null,null,mergeAlpha);
		} else {
			var mat = this.matrix;
			mat.a = this.blitMatrix[0];
			mat.b = this.blitMatrix[1];
			mat.c = this.blitMatrix[2];
			mat.d = this.blitMatrix[3];
			mat.tx = this.blitMatrix[4];
			mat.ty = this.blitMatrix[5];
			this.matrix.translate(point.x,point.y);
			var mat = this.matrix;
			var X = this.frame.x;
			var Y = this.frame.y;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var X1 = X;
			var Y1 = Y;
			if(Y1 == null) {
				Y1 = 0;
			}
			if(X1 == null) {
				X1 = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X1,Y1);
			point._inPool = false;
			var point1 = point;
			point1._weak = true;
			var p1 = point1;
			var _this = this.frame;
			var X = _this.x + _this.width;
			var _this = this.frame;
			var Y = _this.y + _this.height;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var X1 = X;
			var Y1 = Y;
			if(Y1 == null) {
				Y1 = 0;
			}
			if(X1 == null) {
				X1 = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X1,Y1);
			point._inPool = false;
			var point1 = point;
			point1._weak = true;
			var p2 = point1;
			var x1 = p1.x * mat.a + p1.y * mat.c + mat.tx;
			var y1 = p1.x * mat.b + p1.y * mat.d + mat.ty;
			p1.set(x1,y1);
			var x1 = p2.x * mat.a + p2.y * mat.c + mat.tx;
			var y1 = p2.x * mat.b + p2.y * mat.d + mat.ty;
			p2.set(x1,y1);
			var _this = flixel_math_FlxRect._pool.get();
			var X = 0;
			var Y = 0;
			var Width = 0;
			var Height = 0;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			_this.x = X;
			_this.y = Y;
			_this.width = Width;
			_this.height = Height;
			var rect = _this;
			rect._inPool = false;
			var _this = rect;
			var minX = Math.min(p1.x,p2.x);
			var minY = Math.min(p1.y,p2.y);
			var maxX = Math.max(p1.x,p2.x);
			var maxY = Math.max(p1.y,p2.y);
			if(p1._weak) {
				p1.put();
			}
			if(p2._weak) {
				p2.put();
			}
			var X = minX;
			var Y = minY;
			var Width = maxX - minX;
			var Height = maxY - minY;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			_this.x = X;
			_this.y = Y;
			_this.width = Width;
			_this.height = Height;
			var flxRect = _this;
			var FlashRect = this.rect;
			if(FlashRect == null) {
				FlashRect = new openfl_geom_Rectangle();
			}
			FlashRect.x = flxRect.x;
			FlashRect.y = flxRect.y;
			FlashRect.width = flxRect.width;
			FlashRect.height = flxRect.height;
			if(!flxRect._inPool) {
				flxRect._inPool = true;
				flxRect._weak = false;
				flixel_math_FlxRect._pool.putUnsafe(flxRect);
			}
			var rect = this.rect;
			bmd.draw(this.parent.bitmap,this.matrix,null,null,rect);
		}
		return bmd;
	}
	,paintRotatedAndFlipped: function(bmd,point,rotation,flipX,flipY,mergeAlpha,disposeIfNotEqual) {
		if(disposeIfNotEqual == null) {
			disposeIfNotEqual = false;
		}
		if(mergeAlpha == null) {
			mergeAlpha = false;
		}
		if(flipY == null) {
			flipY = false;
		}
		if(flipX == null) {
			flipX = false;
		}
		if(rotation == null) {
			rotation = 0;
		}
		if(this.type == 2 && rotation == 0) {
			return this.paint(bmd,point,mergeAlpha,disposeIfNotEqual);
		}
		if(point == null) {
			point = this.point2;
			point.setTo(0,0);
		}
		var bmd1 = bmd;
		var rotation1 = rotation;
		var mergeAlpha1 = mergeAlpha;
		var disposeIfNotEqual1 = disposeIfNotEqual;
		if(disposeIfNotEqual1 == null) {
			disposeIfNotEqual1 = false;
		}
		if(mergeAlpha1 == null) {
			mergeAlpha1 = false;
		}
		if(rotation1 == null) {
			rotation1 = 0;
		}
		var w = this.sourceSize.x | 0;
		var h = this.sourceSize.y | 0;
		if(rotation1 != 0) {
			var t = w;
			w = h;
			h = t;
		}
		if(bmd1 != null && disposeIfNotEqual1) {
			bmd1 = flixel_util_FlxDestroyUtil.disposeIfNotEqual(bmd1,w,h);
		}
		if(bmd1 != null && !mergeAlpha1) {
			this.rect.setTo(point.x,point.y,w,h);
			bmd1.fillRect(this.rect,0);
		} else if(bmd1 == null) {
			bmd1 = new openfl_display_BitmapData(w,h,true,0);
		}
		bmd = bmd1;
		if(this.type == 2) {
			return bmd;
		}
		var doFlipX = flipX != this.flipX;
		var doFlipY = flipY != this.flipY;
		this.prepareTransformedBlitMatrix(this.matrix,rotation,doFlipX,doFlipY);
		this.matrix.translate(point.x,point.y);
		var mat = this.matrix;
		var X = this.frame.x;
		var Y = this.frame.y;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var X1 = X;
		var Y1 = Y;
		if(Y1 == null) {
			Y1 = 0;
		}
		if(X1 == null) {
			X1 = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X1,Y1);
		point._inPool = false;
		var point1 = point;
		point1._weak = true;
		var p1 = point1;
		var _this = this.frame;
		var X = _this.x + _this.width;
		var _this = this.frame;
		var Y = _this.y + _this.height;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var X1 = X;
		var Y1 = Y;
		if(Y1 == null) {
			Y1 = 0;
		}
		if(X1 == null) {
			X1 = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X1,Y1);
		point._inPool = false;
		var point1 = point;
		point1._weak = true;
		var p2 = point1;
		var x1 = p1.x * mat.a + p1.y * mat.c + mat.tx;
		var y1 = p1.x * mat.b + p1.y * mat.d + mat.ty;
		p1.set(x1,y1);
		var x1 = p2.x * mat.a + p2.y * mat.c + mat.tx;
		var y1 = p2.x * mat.b + p2.y * mat.d + mat.ty;
		p2.set(x1,y1);
		var _this = flixel_math_FlxRect._pool.get();
		var X = 0;
		var Y = 0;
		var Width = 0;
		var Height = 0;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		var rect = _this;
		rect._inPool = false;
		var _this = rect;
		var minX = Math.min(p1.x,p2.x);
		var minY = Math.min(p1.y,p2.y);
		var maxX = Math.max(p1.x,p2.x);
		var maxY = Math.max(p1.y,p2.y);
		if(p1._weak) {
			p1.put();
		}
		if(p2._weak) {
			p2.put();
		}
		var X = minX;
		var Y = minY;
		var Width = maxX - minX;
		var Height = maxY - minY;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		var flxRect = _this;
		var FlashRect = this.rect;
		if(FlashRect == null) {
			FlashRect = new openfl_geom_Rectangle();
		}
		FlashRect.x = flxRect.x;
		FlashRect.y = flxRect.y;
		FlashRect.width = flxRect.width;
		FlashRect.height = flxRect.height;
		if(!flxRect._inPool) {
			flxRect._inPool = true;
			flxRect._weak = false;
			flixel_math_FlxRect._pool.putUnsafe(flxRect);
		}
		var rect = this.rect;
		bmd.draw(this.parent.bitmap,this.matrix,null,null,rect);
		return bmd;
	}
	,checkInputBitmap: function(bmd,point,rotation,mergeAlpha,disposeIfNotEqual) {
		if(disposeIfNotEqual == null) {
			disposeIfNotEqual = false;
		}
		if(mergeAlpha == null) {
			mergeAlpha = false;
		}
		if(rotation == null) {
			rotation = 0;
		}
		var w = this.sourceSize.x | 0;
		var h = this.sourceSize.y | 0;
		if(rotation != 0) {
			var t = w;
			w = h;
			h = t;
		}
		if(bmd != null && disposeIfNotEqual) {
			bmd = flixel_util_FlxDestroyUtil.disposeIfNotEqual(bmd,w,h);
		}
		if(bmd != null && !mergeAlpha) {
			this.rect.setTo(point.x,point.y,w,h);
			bmd.fillRect(this.rect,0);
		} else if(bmd == null) {
			bmd = new openfl_display_BitmapData(w,h,true,0);
		}
		return bmd;
	}
	,getDrawFrameRect: function(mat) {
		var X = this.frame.x;
		var Y = this.frame.y;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var X1 = X;
		var Y1 = Y;
		if(Y1 == null) {
			Y1 = 0;
		}
		if(X1 == null) {
			X1 = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X1,Y1);
		point._inPool = false;
		var point1 = point;
		point1._weak = true;
		var p1 = point1;
		var _this = this.frame;
		var X = _this.x + _this.width;
		var _this = this.frame;
		var Y = _this.y + _this.height;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var X1 = X;
		var Y1 = Y;
		if(Y1 == null) {
			Y1 = 0;
		}
		if(X1 == null) {
			X1 = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X1,Y1);
		point._inPool = false;
		var point1 = point;
		point1._weak = true;
		var p2 = point1;
		var x1 = p1.x * mat.a + p1.y * mat.c + mat.tx;
		var y1 = p1.x * mat.b + p1.y * mat.d + mat.ty;
		p1.set(x1,y1);
		var x1 = p2.x * mat.a + p2.y * mat.c + mat.tx;
		var y1 = p2.x * mat.b + p2.y * mat.d + mat.ty;
		p2.set(x1,y1);
		var _this = flixel_math_FlxRect._pool.get();
		var X = 0;
		var Y = 0;
		var Width = 0;
		var Height = 0;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		var rect = _this;
		rect._inPool = false;
		var _this = rect;
		var minX = Math.min(p1.x,p2.x);
		var minY = Math.min(p1.y,p2.y);
		var maxX = Math.max(p1.x,p2.x);
		var maxY = Math.max(p1.y,p2.y);
		if(p1._weak) {
			p1.put();
		}
		if(p2._weak) {
			p2.put();
		}
		var X = minX;
		var Y = minY;
		var Width = maxX - minX;
		var Height = maxY - minY;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		var flxRect = _this;
		var FlashRect = this.rect;
		if(FlashRect == null) {
			FlashRect = new openfl_geom_Rectangle();
		}
		FlashRect.x = flxRect.x;
		FlashRect.y = flxRect.y;
		FlashRect.width = flxRect.width;
		FlashRect.height = flxRect.height;
		if(!flxRect._inPool) {
			flxRect._inPool = true;
			flxRect._weak = false;
			flixel_math_FlxRect._pool.putUnsafe(flxRect);
		}
		return this.rect;
	}
	,subFrameTo: function(rect,frameToFill) {
		if(frameToFill == null) {
			frameToFill = new flixel_graphics_frames_FlxFrame(this.parent,this.angle);
		} else {
			frameToFill.parent = this.parent;
			frameToFill.angle = this.angle;
			frameToFill.set_frame(flixel_util_FlxDestroyUtil.put(frameToFill.frame));
		}
		frameToFill.sourceSize.set(rect.width,rect.height);
		if(this.type == 2) {
			frameToFill.type = 2;
			frameToFill.offset.set(0,0);
			return frameToFill;
		}
		var _this = flixel_math_FlxRect._pool.get();
		var X = 0;
		var Y = 0;
		var Width = 0;
		var Height = 0;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		var rect1 = _this;
		rect1._inPool = false;
		var _this = rect1;
		_this.width = this.frame.width;
		_this.height = this.frame.height;
		var clippedRect = _this;
		if(this.angle != 0) {
			clippedRect.width = this.frame.height;
			clippedRect.height = this.frame.width;
		}
		var ox = Math.max(this.offset.x,0);
		var oy = Math.max(this.offset.y,0);
		rect.x += -ox;
		rect.y += -oy;
		var frameRect = clippedRect.intersection(rect);
		clippedRect = flixel_util_FlxDestroyUtil.put(clippedRect);
		rect.x += ox;
		rect.y += oy;
		if(frameRect.width == 0 || frameRect.height == 0) {
			frameToFill.type = 2;
			var X = 0;
			var Y = 0;
			var Width = 0;
			var Height = 0;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			frameRect.x = X;
			frameRect.y = Y;
			frameRect.width = Width;
			frameRect.height = Height;
			frameToFill.set_frame(frameRect);
			frameToFill.offset.set(0,0);
		} else {
			frameToFill.type = 0;
			var _this = frameToFill.offset.set(frameRect.x,frameRect.y);
			var X = rect.x;
			var Y = rect.y;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var _g = _this;
			_g.set_x(_g.x - X);
			var _g = _this;
			_g.set_y(_g.y - Y);
			_this.addPoint(this.offset);
			var X = frameRect.x;
			var Y = frameRect.y;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var X1 = X;
			var Y1 = Y;
			if(Y1 == null) {
				Y1 = 0;
			}
			if(X1 == null) {
				X1 = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X1,Y1);
			point._inPool = false;
			var point1 = point;
			point1._weak = true;
			var p1 = point1;
			var X = frameRect.x + frameRect.width;
			var Y = frameRect.y + frameRect.height;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var X1 = X;
			var Y1 = Y;
			if(Y1 == null) {
				Y1 = 0;
			}
			if(X1 == null) {
				X1 = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X1,Y1);
			point._inPool = false;
			var point1 = point;
			point1._weak = true;
			var p2 = point1;
			this.matrix.identity();
			if(this.angle == -90) {
				var _this = this.matrix;
				_this.setTo(-_this.b,_this.a,-_this.d,_this.c,-_this.ty,_this.tx);
				this.matrix.translate(this.frame.width,0);
			} else if(this.angle == 90) {
				var _this = this.matrix;
				_this.setTo(_this.b,-_this.a,_this.d,-_this.c,_this.ty,-_this.tx);
				this.matrix.translate(0,this.frame.height);
			}
			if(this.angle != 0) {
				var matrix = this.matrix;
				var x1 = p1.x * matrix.a + p1.y * matrix.c + matrix.tx;
				var y1 = p1.x * matrix.b + p1.y * matrix.d + matrix.ty;
				p1.set(x1,y1);
				var matrix = this.matrix;
				var x1 = p2.x * matrix.a + p2.y * matrix.c + matrix.tx;
				var y1 = p2.x * matrix.b + p2.y * matrix.d + matrix.ty;
				p2.set(x1,y1);
			}
			var minX = Math.min(p1.x,p2.x);
			var minY = Math.min(p1.y,p2.y);
			var maxX = Math.max(p1.x,p2.x);
			var maxY = Math.max(p1.y,p2.y);
			if(p1._weak) {
				p1.put();
			}
			if(p2._weak) {
				p2.put();
			}
			var X = minX;
			var Y = minY;
			var Width = maxX - minX;
			var Height = maxY - minY;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			frameRect.x = X;
			frameRect.y = Y;
			frameRect.width = Width;
			frameRect.height = Height;
			frameRect.x += this.frame.x;
			frameRect.y += this.frame.y;
			frameToFill.set_frame(frameRect);
			frameToFill.cacheFrameMatrix();
		}
		return frameToFill;
	}
	,setBorderTo: function(border,frameToFill) {
		var X = border.x;
		var Y = border.y;
		var Width = this.sourceSize.x - 2 * border.x;
		var Height = this.sourceSize.y - 2 * border.y;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var _this = flixel_math_FlxRect._pool.get();
		var X1 = X;
		var Y1 = Y;
		var Width1 = Width;
		var Height1 = Height;
		if(Height1 == null) {
			Height1 = 0;
		}
		if(Width1 == null) {
			Width1 = 0;
		}
		if(Y1 == null) {
			Y1 = 0;
		}
		if(X1 == null) {
			X1 = 0;
		}
		_this.x = X1;
		_this.y = Y1;
		_this.width = Width1;
		_this.height = Height1;
		var rect = _this;
		rect._inPool = false;
		var rect1 = rect;
		frameToFill = this.subFrameTo(rect1,frameToFill);
		frameToFill.name = this.name;
		rect1 = flixel_util_FlxDestroyUtil.put(rect1);
		return frameToFill;
	}
	,clipTo: function(clip,clippedFrame) {
		if(clippedFrame == null) {
			clippedFrame = new flixel_graphics_frames_FlxFrame(this.parent,this.angle);
		} else {
			clippedFrame.parent = this.parent;
			clippedFrame.angle = this.angle;
			clippedFrame.set_frame(flixel_util_FlxDestroyUtil.put(clippedFrame.frame));
		}
		var _this = clippedFrame.sourceSize;
		var point = this.sourceSize;
		_this.set_x(point.x);
		_this.set_y(point.y);
		if(point._weak) {
			point.put();
		}
		clippedFrame.name = this.name;
		if(this.type == 2) {
			clippedFrame.type = 2;
			clippedFrame.offset.set(0,0);
			return clippedFrame;
		}
		var X = 0;
		var Y = 0;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var _this = flixel_math_FlxRect._pool.get();
		var X1 = X;
		var Y1 = Y;
		var Width = 0;
		var Height = 0;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y1 == null) {
			Y1 = 0;
		}
		if(X1 == null) {
			X1 = 0;
		}
		_this.x = X1;
		_this.y = Y1;
		_this.width = Width;
		_this.height = Height;
		var rect = _this;
		rect._inPool = false;
		var _this = rect;
		_this.width = this.frame.width;
		_this.height = this.frame.height;
		var clippedRect = _this;
		if(this.angle != 0) {
			clippedRect.width = this.frame.height;
			clippedRect.height = this.frame.width;
		}
		clip.x += -this.offset.x;
		clip.y += -this.offset.y;
		var frameRect = clippedRect.intersection(clip);
		clippedRect = flixel_util_FlxDestroyUtil.put(clippedRect);
		if(frameRect.width == 0 || frameRect.height == 0) {
			clippedFrame.type = 2;
			var X = 0;
			var Y = 0;
			var Width = 0;
			var Height = 0;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			frameRect.x = X;
			frameRect.y = Y;
			frameRect.width = Width;
			frameRect.height = Height;
			clippedFrame.set_frame(frameRect);
			clippedFrame.offset.set(0,0);
		} else {
			clippedFrame.type = 0;
			clippedFrame.offset.set(frameRect.x,frameRect.y).addPoint(this.offset);
			var X = frameRect.x;
			var Y = frameRect.y;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var X1 = X;
			var Y1 = Y;
			if(Y1 == null) {
				Y1 = 0;
			}
			if(X1 == null) {
				X1 = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X1,Y1);
			point._inPool = false;
			var point1 = point;
			point1._weak = true;
			var p1 = point1;
			var X = frameRect.x + frameRect.width;
			var Y = frameRect.y + frameRect.height;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var X1 = X;
			var Y1 = Y;
			if(Y1 == null) {
				Y1 = 0;
			}
			if(X1 == null) {
				X1 = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X1,Y1);
			point._inPool = false;
			var point1 = point;
			point1._weak = true;
			var p2 = point1;
			this.matrix.identity();
			if(this.angle == -90) {
				var _this = this.matrix;
				_this.setTo(-_this.b,_this.a,-_this.d,_this.c,-_this.ty,_this.tx);
				this.matrix.translate(this.frame.width,0);
			} else if(this.angle == 90) {
				var _this = this.matrix;
				_this.setTo(_this.b,-_this.a,_this.d,-_this.c,_this.ty,-_this.tx);
				this.matrix.translate(0,this.frame.height);
			}
			if(this.angle != 0) {
				var matrix = this.matrix;
				var x1 = p1.x * matrix.a + p1.y * matrix.c + matrix.tx;
				var y1 = p1.x * matrix.b + p1.y * matrix.d + matrix.ty;
				p1.set(x1,y1);
				var matrix = this.matrix;
				var x1 = p2.x * matrix.a + p2.y * matrix.c + matrix.tx;
				var y1 = p2.x * matrix.b + p2.y * matrix.d + matrix.ty;
				p2.set(x1,y1);
			}
			var minX = Math.min(p1.x,p2.x);
			var minY = Math.min(p1.y,p2.y);
			var maxX = Math.max(p1.x,p2.x);
			var maxY = Math.max(p1.y,p2.y);
			if(p1._weak) {
				p1.put();
			}
			if(p2._weak) {
				p2.put();
			}
			var X = minX;
			var Y = minY;
			var Width = maxX - minX;
			var Height = maxY - minY;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			frameRect.x = X;
			frameRect.y = Y;
			frameRect.width = Width;
			frameRect.height = Height;
			frameRect.x += this.frame.x;
			frameRect.y += this.frame.y;
			clippedFrame.set_frame(frameRect);
			clippedFrame.cacheFrameMatrix();
		}
		clip.x += this.offset.x;
		clip.y += this.offset.y;
		return clippedFrame;
	}
	,copyTo: function(clone) {
		if(clone == null) {
			clone = new flixel_graphics_frames_FlxFrame(this.parent,this.angle);
		} else {
			clone.parent = this.parent;
			clone.angle = this.angle;
			clone.set_frame(flixel_util_FlxDestroyUtil.put(clone.frame));
		}
		var _this = clone.offset;
		var point = this.offset;
		_this.set_x(point.x);
		_this.set_y(point.y);
		if(point._weak) {
			point.put();
		}
		clone.flipX = this.flipX;
		clone.flipY = this.flipY;
		var _this = clone.sourceSize;
		var point = this.sourceSize;
		_this.set_x(point.x);
		_this.set_y(point.y);
		if(point._weak) {
			point.put();
		}
		var _this = flixel_math_FlxRect._pool.get();
		var X = 0;
		var Y = 0;
		var Width = 0;
		var Height = 0;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		var rect = _this;
		rect._inPool = false;
		var _this = rect;
		var Rect = this.frame;
		_this.x = Rect.x;
		_this.y = Rect.y;
		_this.width = Rect.width;
		_this.height = Rect.height;
		if(Rect._weak) {
			if(!Rect._inPool) {
				Rect._inPool = true;
				Rect._weak = false;
				flixel_math_FlxRect._pool.putUnsafe(Rect);
			}
		}
		clone.set_frame(_this);
		clone.type = this.type;
		clone.name = this.name;
		clone.cacheFrameMatrix();
		return clone;
	}
	,destroy: function() {
		this.name = null;
		this.parent = null;
		this.sourceSize = flixel_util_FlxDestroyUtil.put(this.sourceSize);
		this.offset = flixel_util_FlxDestroyUtil.put(this.offset);
		this.set_frame(flixel_util_FlxDestroyUtil.put(this.frame));
		this.uv = flixel_util_FlxDestroyUtil.put(this.uv);
		this.blitMatrix = null;
		this.tileMatrix = null;
	}
	,toString: function() {
		var value = this.name;
		var _this = flixel_util_LabelValuePair._pool.get();
		_this.label = "name";
		_this.value = value;
		return flixel_util_FlxStringUtil.getDebugString([_this]);
	}
	,set_frame: function(value) {
		if(value != null) {
			if(this.uv == null) {
				var _this = flixel_math_FlxRect._pool.get();
				var X = 0;
				var Y = 0;
				var Width = 0;
				var Height = 0;
				if(Height == null) {
					Height = 0;
				}
				if(Width == null) {
					Width = 0;
				}
				if(Y == null) {
					Y = 0;
				}
				if(X == null) {
					X = 0;
				}
				_this.x = X;
				_this.y = Y;
				_this.width = Width;
				_this.height = Height;
				var rect = _this;
				rect._inPool = false;
				this.uv = rect;
			}
			var _this = this.uv;
			var X = value.x / this.parent.width;
			var Y = value.y / this.parent.height;
			var Width = (value.x + value.width) / this.parent.width;
			var Height = (value.y + value.height) / this.parent.height;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			_this.x = X;
			_this.y = Y;
			_this.width = Width;
			_this.height = Height;
		}
		return this.frame = value;
	}
	,__class__: flixel_graphics_frames_FlxFrame
	,__properties__: {set_frame:"set_frame"}
};
var flixel_graphics_frames_FlxFrameCollectionType = $hxEnums["flixel.graphics.frames.FlxFrameCollectionType"] = { __ename__ : "flixel.graphics.frames.FlxFrameCollectionType", __constructs__ : ["IMAGE","TILES","ATLAS","FONT","USER","FILTER"]
	,IMAGE: {_hx_index:0,__enum__:"flixel.graphics.frames.FlxFrameCollectionType",toString:$estr}
	,TILES: {_hx_index:1,__enum__:"flixel.graphics.frames.FlxFrameCollectionType",toString:$estr}
	,ATLAS: {_hx_index:2,__enum__:"flixel.graphics.frames.FlxFrameCollectionType",toString:$estr}
	,FONT: {_hx_index:3,__enum__:"flixel.graphics.frames.FlxFrameCollectionType",toString:$estr}
	,USER: ($_=function(type) { return {_hx_index:4,type:type,__enum__:"flixel.graphics.frames.FlxFrameCollectionType",toString:$estr}; },$_.__params__ = ["type"],$_)
	,FILTER: {_hx_index:5,__enum__:"flixel.graphics.frames.FlxFrameCollectionType",toString:$estr}
};
var flixel_graphics_frames_FlxImageFrame = function(parent,border) {
	flixel_graphics_frames_FlxFramesCollection.call(this,parent,flixel_graphics_frames_FlxFrameCollectionType.IMAGE,border);
};
$hxClasses["flixel.graphics.frames.FlxImageFrame"] = flixel_graphics_frames_FlxImageFrame;
flixel_graphics_frames_FlxImageFrame.__name__ = "flixel.graphics.frames.FlxImageFrame";
flixel_graphics_frames_FlxImageFrame.fromEmptyFrame = function(graphic,frameRect) {
	if(graphic == null || frameRect == null) {
		return null;
	}
	var imageFrame = flixel_graphics_frames_FlxImageFrame.findEmptyFrame(graphic,frameRect);
	if(imageFrame != null) {
		return imageFrame;
	}
	imageFrame = new flixel_graphics_frames_FlxImageFrame(graphic);
	imageFrame.addEmptyFrame(frameRect);
	return imageFrame;
};
flixel_graphics_frames_FlxImageFrame.fromFrame = function(source) {
	var graphic = source.parent;
	var rect = source.frame;
	var imageFrame = flixel_graphics_frames_FlxImageFrame.findFrame(graphic,rect);
	if(imageFrame != null) {
		return imageFrame;
	}
	imageFrame = new flixel_graphics_frames_FlxImageFrame(graphic);
	var _this = flixel_math_FlxRect._pool.get();
	var X = 0;
	var Y = 0;
	var Width = 0;
	var Height = 0;
	if(Height == null) {
		Height = 0;
	}
	if(Width == null) {
		Width = 0;
	}
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	_this.x = X;
	_this.y = Y;
	_this.width = Width;
	_this.height = Height;
	var rect1 = _this;
	rect1._inPool = false;
	var Rect = rect1;
	Rect.x = rect.x;
	Rect.y = rect.y;
	Rect.width = rect.width;
	Rect.height = rect.height;
	if(Rect._weak) {
		if(!Rect._inPool) {
			Rect._inPool = true;
			Rect._weak = false;
			flixel_math_FlxRect._pool.putUnsafe(Rect);
		}
	}
	imageFrame.addSpriteSheetFrame(Rect);
	return imageFrame;
};
flixel_graphics_frames_FlxImageFrame.fromImage = function(source) {
	return flixel_graphics_frames_FlxImageFrame.fromRectangle(source,null);
};
flixel_graphics_frames_FlxImageFrame.fromGraphic = function(graphic,region) {
	if(graphic == null) {
		return null;
	}
	var checkRegion = region;
	if(checkRegion == null) {
		var X = 0;
		var Y = 0;
		var Width = graphic.width;
		var Height = graphic.height;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var X1 = X;
		var Y1 = Y;
		var Width1 = Width;
		var Height1 = Height;
		if(Height1 == null) {
			Height1 = 0;
		}
		if(Width1 == null) {
			Width1 = 0;
		}
		if(Y1 == null) {
			Y1 = 0;
		}
		if(X1 == null) {
			X1 = 0;
		}
		var _this = flixel_math_FlxRect._pool.get();
		var X = X1;
		var Y = Y1;
		var Width = Width1;
		var Height = Height1;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		var rect = _this;
		rect._inPool = false;
		var rect1 = rect;
		rect1._weak = true;
		checkRegion = rect1;
	}
	var imageFrame = flixel_graphics_frames_FlxImageFrame.findFrame(graphic,checkRegion);
	if(imageFrame != null) {
		return imageFrame;
	}
	imageFrame = new flixel_graphics_frames_FlxImageFrame(graphic);
	if(region == null) {
		var X = 0;
		var Y = 0;
		var Width = graphic.width;
		var Height = graphic.height;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var _this = flixel_math_FlxRect._pool.get();
		var X1 = X;
		var Y1 = Y;
		var Width1 = Width;
		var Height1 = Height;
		if(Height1 == null) {
			Height1 = 0;
		}
		if(Width1 == null) {
			Width1 = 0;
		}
		if(Y1 == null) {
			Y1 = 0;
		}
		if(X1 == null) {
			X1 = 0;
		}
		_this.x = X1;
		_this.y = Y1;
		_this.width = Width1;
		_this.height = Height1;
		var rect = _this;
		rect._inPool = false;
		region = rect;
	} else {
		if(region.width == 0) {
			region.width = graphic.width - region.x;
		}
		if(region.height == 0) {
			region.height = graphic.height - region.y;
		}
	}
	imageFrame.addSpriteSheetFrame(region);
	return imageFrame;
};
flixel_graphics_frames_FlxImageFrame.fromRectangle = function(source,region) {
	var graphic = flixel_FlxG.bitmap.add(source,false);
	return flixel_graphics_frames_FlxImageFrame.fromGraphic(graphic,region);
};
flixel_graphics_frames_FlxImageFrame.fromBitmapAddSpacesAndBorders = function(source,border,region) {
	var graphic = flixel_FlxG.bitmap.add(source,false);
	if(graphic == null) {
		return null;
	}
	var key = flixel_FlxG.bitmap.getKeyWithSpacesAndBorders(graphic.key,null,null,border,region);
	var result = flixel_FlxG.bitmap._cache.h[key];
	if(result == null) {
		var bitmap = flixel_util_FlxBitmapDataUtil.addSpacesAndBorders(graphic.bitmap,null,null,border,region);
		result = flixel_FlxG.bitmap.add(bitmap,false,key);
	}
	var imageFrame = flixel_graphics_frames_FlxImageFrame.fromGraphic(graphic);
	return imageFrame.addBorder(border);
};
flixel_graphics_frames_FlxImageFrame.fromFrameAddSpacesAndBorders = function(frame,border) {
	var bitmap = frame.paint();
	return flixel_graphics_frames_FlxImageFrame.fromBitmapAddSpacesAndBorders(bitmap,border);
};
flixel_graphics_frames_FlxImageFrame.findFrame = function(graphic,frameRect,frameBorder) {
	if(frameBorder == null) {
		var X = 0;
		var Y = 0;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		var point1 = point;
		point1._weak = true;
		frameBorder = point1;
	}
	var type = flixel_graphics_frames_FlxFrameCollectionType.IMAGE;
	var collections = graphic.frameCollections.get(type);
	if(collections == null) {
		collections = [];
		graphic.frameCollections.set(type,collections);
	}
	var imageFrames = collections;
	var _g = 0;
	while(_g < imageFrames.length) {
		var imageFrame = imageFrames[_g];
		++_g;
		var tmp;
		var rect = imageFrame.get_frame().frame;
		var result = Math.abs(frameRect.x - rect.x) <= 0.0000001 && Math.abs(frameRect.y - rect.y) <= 0.0000001 && Math.abs(frameRect.width - rect.width) <= 0.0000001 && Math.abs(frameRect.height - rect.height) <= 0.0000001;
		if(rect._weak) {
			if(!rect._inPool) {
				rect._inPool = true;
				rect._weak = false;
				flixel_math_FlxRect._pool.putUnsafe(rect);
			}
		}
		if(result) {
			var point = imageFrame.border;
			var result1 = Math.abs(frameBorder.x - point.x) <= 0.0000001 && Math.abs(frameBorder.y - point.y) <= 0.0000001;
			if(point._weak) {
				point.put();
			}
			tmp = result1;
		} else {
			tmp = false;
		}
		if(tmp && imageFrame.get_frame().type != 2) {
			return imageFrame;
		}
	}
	return null;
};
flixel_graphics_frames_FlxImageFrame.findEmptyFrame = function(graphic,frameRect) {
	var type = flixel_graphics_frames_FlxFrameCollectionType.IMAGE;
	var collections = graphic.frameCollections.get(type);
	if(collections == null) {
		collections = [];
		graphic.frameCollections.set(type,collections);
	}
	var imageFrames = collections;
	var _g = 0;
	while(_g < imageFrames.length) {
		var imageFrame = imageFrames[_g];
		++_g;
		var frame = imageFrame.get_frame();
		if(frame.sourceSize.x == frameRect.width && frame.sourceSize.y == frameRect.height && frame.type == 2) {
			return imageFrame;
		}
	}
	return null;
};
flixel_graphics_frames_FlxImageFrame.__super__ = flixel_graphics_frames_FlxFramesCollection;
flixel_graphics_frames_FlxImageFrame.prototype = $extend(flixel_graphics_frames_FlxFramesCollection.prototype,{
	equals: function(rect,border) {
		var rect1 = this.get_frame().frame;
		var result = Math.abs(rect.x - rect1.x) <= 0.0000001 && Math.abs(rect.y - rect1.y) <= 0.0000001 && Math.abs(rect.width - rect1.width) <= 0.0000001 && Math.abs(rect.height - rect1.height) <= 0.0000001;
		if(rect1._weak) {
			if(!rect1._inPool) {
				rect1._inPool = true;
				rect1._weak = false;
				flixel_math_FlxRect._pool.putUnsafe(rect1);
			}
		}
		if(result) {
			var point = this.border;
			var result = Math.abs(border.x - point.x) <= 0.0000001 && Math.abs(border.y - point.y) <= 0.0000001;
			if(point._weak) {
				point.put();
			}
			return result;
		} else {
			return false;
		}
	}
	,addBorder: function(border) {
		var X = 0;
		var Y = 0;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		var point1 = point;
		point1._weak = true;
		var resultBorder = point1.addPoint(this.border).addPoint(border);
		var imageFrame = flixel_graphics_frames_FlxImageFrame.findFrame(this.parent,this.get_frame().frame,resultBorder);
		if(imageFrame != null) {
			return imageFrame;
		}
		imageFrame = new flixel_graphics_frames_FlxImageFrame(this.parent,resultBorder);
		imageFrame.pushFrame(this.get_frame().setBorderTo(border));
		return imageFrame;
	}
	,destroy: function() {
		flixel_graphics_frames_FlxFramesCollection.prototype.destroy.call(this);
		flixel_util_FlxDestroyUtil.destroy(this.get_frame());
	}
	,get_frame: function() {
		return this.frames[0];
	}
	,__class__: flixel_graphics_frames_FlxImageFrame
	,__properties__: $extend(flixel_graphics_frames_FlxFramesCollection.prototype.__properties__,{get_frame:"get_frame"})
});
var flixel_graphics_frames_FlxTileFrames = function(parent,border) {
	this.numCols = 0;
	this.numRows = 0;
	flixel_graphics_frames_FlxFramesCollection.call(this,parent,flixel_graphics_frames_FlxFrameCollectionType.TILES,border);
};
$hxClasses["flixel.graphics.frames.FlxTileFrames"] = flixel_graphics_frames_FlxTileFrames;
flixel_graphics_frames_FlxTileFrames.__name__ = "flixel.graphics.frames.FlxTileFrames";
flixel_graphics_frames_FlxTileFrames.fromBitmapAddSpacesAndBorders = function(source,tileSize,tileSpacing,tileBorder,region) {
	var graphic = flixel_FlxG.bitmap.add(source,false);
	if(graphic == null) {
		return null;
	}
	var key = flixel_FlxG.bitmap.getKeyWithSpacesAndBorders(graphic.key,tileSize,tileSpacing,tileBorder,region);
	var result = flixel_FlxG.bitmap._cache.h[key];
	if(result == null) {
		var bitmap = flixel_util_FlxBitmapDataUtil.addSpacesAndBorders(graphic.bitmap,tileSize,tileSpacing,tileBorder,region);
		result = flixel_FlxG.bitmap.add(bitmap,false,key);
	}
	var borderX = 0;
	var borderY = 0;
	if(tileBorder != null) {
		borderX = tileBorder.x | 0;
		borderY = tileBorder.y | 0;
	}
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	var _this = point.addPoint(tileSize);
	var X = 2 * borderX;
	var Y = 2 * borderY;
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	var _g = _this;
	_g.set_x(_g.x + X);
	var _g = _this;
	_g.set_y(_g.y + Y);
	var tileFrames = flixel_graphics_frames_FlxTileFrames.fromGraphic(result,_this,null,tileSpacing);
	if(tileBorder == null) {
		return tileFrames;
	}
	return tileFrames.addBorder(tileBorder);
};
flixel_graphics_frames_FlxTileFrames.fromFrameAddSpacesAndBorders = function(frame,tileSize,tileSpacing,tileBorder) {
	var bitmap = frame.paint();
	return flixel_graphics_frames_FlxTileFrames.fromBitmapAddSpacesAndBorders(bitmap,tileSize,tileSpacing,tileBorder);
};
flixel_graphics_frames_FlxTileFrames.fromFrame = function(frame,tileSize,tileSpacing) {
	var graphic = frame.parent;
	var tileFrames = flixel_graphics_frames_FlxTileFrames.findFrame(graphic,tileSize,null,frame,tileSpacing);
	if(tileFrames != null) {
		return tileFrames;
	}
	if(tileSpacing == null) {
		var X = 0;
		var Y = 0;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		tileSpacing = point;
	}
	tileFrames = new flixel_graphics_frames_FlxTileFrames(graphic);
	tileFrames.atlasFrame = frame;
	tileFrames.region = frame.frame;
	tileFrames.tileSize = tileSize;
	tileFrames.tileSpacing = tileSpacing;
	tileSpacing.set_x(Math.floor(tileSpacing.x));
	tileSpacing.set_y(Math.floor(tileSpacing.y));
	tileSize.set_x(Math.floor(tileSize.x));
	tileSize.set_y(Math.floor(tileSize.y));
	var spacedWidth = tileSize.x + tileSpacing.x;
	var spacedHeight = tileSize.y + tileSpacing.y;
	var numRows = tileSize.y == 0 ? 1 : (frame.sourceSize.y + tileSpacing.y) / spacedHeight | 0;
	var numCols = tileSize.x == 0 ? 1 : (frame.sourceSize.x + tileSpacing.x) / spacedWidth | 0;
	var X = 0;
	var Y = 0;
	var Width = tileSize.x;
	var Height = tileSize.y;
	if(Height == null) {
		Height = 0;
	}
	if(Width == null) {
		Width = 0;
	}
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	var _this = flixel_math_FlxRect._pool.get();
	var X1 = X;
	var Y1 = Y;
	var Width1 = Width;
	var Height1 = Height;
	if(Height1 == null) {
		Height1 = 0;
	}
	if(Width1 == null) {
		Width1 = 0;
	}
	if(Y1 == null) {
		Y1 = 0;
	}
	if(X1 == null) {
		X1 = 0;
	}
	_this.x = X1;
	_this.y = Y1;
	_this.width = Width1;
	_this.height = Height1;
	var rect = _this;
	rect._inPool = false;
	var helperRect = rect;
	var _g = 0;
	var _g1 = numRows;
	while(_g < _g1) {
		var j = _g++;
		var _g2 = 0;
		var _g3 = numCols;
		while(_g2 < _g3) {
			var i = _g2++;
			helperRect.x = spacedWidth * i;
			helperRect.y = spacedHeight * j;
			tileFrames.pushFrame(frame.subFrameTo(helperRect));
		}
	}
	helperRect = flixel_util_FlxDestroyUtil.put(helperRect);
	tileFrames.numCols = numCols;
	tileFrames.numRows = numRows;
	return tileFrames;
};
flixel_graphics_frames_FlxTileFrames.fromFrames = function(Frames) {
	var firstFrame = Frames[0];
	var graphic = firstFrame.parent;
	var _g = 0;
	while(_g < Frames.length) {
		var frame = Frames[_g];
		++_g;
		var tmp;
		if(frame.parent == firstFrame.parent) {
			var _this = frame.sourceSize;
			var point = firstFrame.sourceSize;
			var result = Math.abs(_this.x - point.x) <= 0.0000001 && Math.abs(_this.y - point.y) <= 0.0000001;
			if(point._weak) {
				point.put();
			}
			tmp = !result;
		} else {
			tmp = true;
		}
		if(tmp) {
			return null;
		}
	}
	var tileFrames = new flixel_graphics_frames_FlxTileFrames(graphic);
	tileFrames.region = null;
	tileFrames.atlasFrame = null;
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	var _this = point;
	var point = firstFrame.sourceSize;
	_this.set_x(point.x);
	_this.set_y(point.y);
	if(point._weak) {
		point.put();
	}
	tileFrames.tileSize = _this;
	var X = 0;
	var Y = 0;
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	var point = flixel_math_FlxPoint._pool.get().set(X,Y);
	point._inPool = false;
	tileFrames.tileSpacing = point;
	tileFrames.numCols = Frames.length;
	tileFrames.numRows = 1;
	var _g = 0;
	while(_g < Frames.length) {
		var frame = Frames[_g];
		++_g;
		tileFrames.frames.push(frame);
		if(frame.name != null) {
			tileFrames.framesHash.h[frame.name] = frame;
		}
	}
	return tileFrames;
};
flixel_graphics_frames_FlxTileFrames.fromAtlasByPrefix = function(Frames,Prefix) {
	var framesToAdd = [];
	var _g = 0;
	var _g1 = Frames.frames;
	while(_g < _g1.length) {
		var frame = _g1[_g];
		++_g;
		if(StringTools.startsWith(frame.name,Prefix)) {
			framesToAdd.push(frame);
		}
	}
	if(framesToAdd.length > 0) {
		var name = framesToAdd[0].name;
		var postIndex = name.indexOf(".",Prefix.length);
		var postFix = name.substring(postIndex == -1 ? name.length : postIndex,name.length);
		flixel_graphics_frames_FlxFrame.sort(framesToAdd,Prefix.length,postFix.length);
		return flixel_graphics_frames_FlxTileFrames.fromFrames(framesToAdd);
	}
	return null;
};
flixel_graphics_frames_FlxTileFrames.fromGraphic = function(graphic,tileSize,region,tileSpacing) {
	var tileFrames = flixel_graphics_frames_FlxTileFrames.findFrame(graphic,tileSize,region,null,tileSpacing);
	if(tileFrames != null) {
		return tileFrames;
	}
	if(region == null) {
		var X = 0;
		var Y = 0;
		var Width = graphic.width;
		var Height = graphic.height;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var _this = flixel_math_FlxRect._pool.get();
		var X1 = X;
		var Y1 = Y;
		var Width1 = Width;
		var Height1 = Height;
		if(Height1 == null) {
			Height1 = 0;
		}
		if(Width1 == null) {
			Width1 = 0;
		}
		if(Y1 == null) {
			Y1 = 0;
		}
		if(X1 == null) {
			X1 = 0;
		}
		_this.x = X1;
		_this.y = Y1;
		_this.width = Width1;
		_this.height = Height1;
		var rect = _this;
		rect._inPool = false;
		region = rect;
	} else {
		if(region.width == 0) {
			region.width = graphic.width - region.x;
		}
		if(region.height == 0) {
			region.height = graphic.height - region.y;
		}
	}
	if(tileSpacing == null) {
		var X = 0;
		var Y = 0;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		tileSpacing = point;
	}
	tileFrames = new flixel_graphics_frames_FlxTileFrames(graphic);
	tileFrames.region = region;
	tileFrames.atlasFrame = null;
	tileFrames.tileSize = tileSize;
	tileFrames.tileSpacing = tileSpacing;
	region.x = Math.floor(region.x);
	region.y = Math.floor(region.y);
	region.width = Math.floor(region.width);
	region.height = Math.floor(region.height);
	tileSpacing.set_x(Math.floor(tileSpacing.x));
	tileSpacing.set_y(Math.floor(tileSpacing.y));
	tileSize.set_x(Math.floor(tileSize.x));
	tileSize.set_y(Math.floor(tileSize.y));
	var spacedWidth = tileSize.x + tileSpacing.x;
	var spacedHeight = tileSize.y + tileSpacing.y;
	var numRows = tileSize.y == 0 ? 1 : (region.height + tileSpacing.y) / spacedHeight | 0;
	var numCols = tileSize.x == 0 ? 1 : (region.width + tileSpacing.x) / spacedWidth | 0;
	var tileRect;
	var _g = 0;
	var _g1 = numRows;
	while(_g < _g1) {
		var j = _g++;
		var _g2 = 0;
		var _g3 = numCols;
		while(_g2 < _g3) {
			var i = _g2++;
			var X = region.x + i * spacedWidth;
			var Y = region.y + j * spacedHeight;
			var Width = tileSize.x;
			var Height = tileSize.y;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var _this = flixel_math_FlxRect._pool.get();
			var X1 = X;
			var Y1 = Y;
			var Width1 = Width;
			var Height1 = Height;
			if(Height1 == null) {
				Height1 = 0;
			}
			if(Width1 == null) {
				Width1 = 0;
			}
			if(Y1 == null) {
				Y1 = 0;
			}
			if(X1 == null) {
				X1 = 0;
			}
			_this.x = X1;
			_this.y = Y1;
			_this.width = Width1;
			_this.height = Height1;
			var rect = _this;
			rect._inPool = false;
			tileRect = rect;
			tileFrames.addSpriteSheetFrame(tileRect);
		}
	}
	tileFrames.numCols = numCols;
	tileFrames.numRows = numRows;
	return tileFrames;
};
flixel_graphics_frames_FlxTileFrames.fromRectangle = function(source,tileSize,region,tileSpacing) {
	var graphic = flixel_FlxG.bitmap.add(source,false);
	if(graphic == null) {
		return null;
	}
	return flixel_graphics_frames_FlxTileFrames.fromGraphic(graphic,tileSize,region,tileSpacing);
};
flixel_graphics_frames_FlxTileFrames.combineTileSets = function(bitmaps,tileSize,spacing,border) {
	var framesCollections = [];
	var _g = 0;
	while(_g < bitmaps.length) {
		var bitmap = bitmaps[_g];
		++_g;
		framesCollections.push(flixel_graphics_frames_FlxTileFrames.fromRectangle(bitmap,tileSize));
	}
	return flixel_graphics_frames_FlxTileFrames.combineTileFrames(framesCollections,spacing,border);
};
flixel_graphics_frames_FlxTileFrames.combineTileFrames = function(tileframes,spacing,border) {
	var totalArea = 0;
	var rows = 0;
	var cols = 0;
	var tileWidth = tileframes[0].frames[0].sourceSize.x | 0;
	var tileHeight = tileframes[0].frames[0].sourceSize.y | 0;
	var spaceX = 0;
	var spaceY = 0;
	if(spacing != null) {
		spaceX = spacing.x | 0;
		spaceY = spacing.y | 0;
	}
	var borderX = 0;
	var borderY = 0;
	if(border != null) {
		borderX = border.x | 0;
		borderY = border.y | 0;
	}
	var _g = 0;
	while(_g < tileframes.length) {
		var collection = tileframes[_g];
		++_g;
		cols = collection.numCols;
		rows = collection.numRows;
		totalArea += cols * (tileWidth + 2 * borderX) * rows * (tileHeight + 2 * borderY) | 0;
	}
	var side = Math.sqrt(totalArea);
	cols = side / (tileWidth + 2 * borderX) | 0;
	rows = Math.ceil(totalArea / (cols * (tileWidth + 2 * borderX) * (tileHeight + 2 * borderY)));
	var width = (cols * (tileWidth + 2 * borderX) | 0) + (cols - 1) * spaceX;
	var height = (rows * (tileHeight + 2 * borderY) | 0) + (rows - 1) * spaceY;
	var combined = new openfl_display_BitmapData(width,height,true,0);
	var graphic = flixel_FlxG.bitmap.add(combined);
	var result = new flixel_graphics_frames_FlxTileFrames(graphic);
	var destPoint = new openfl_geom_Point(borderX,borderY);
	var X = 0;
	var Y = 0;
	var Width = width;
	var Height = height;
	if(Height == null) {
		Height = 0;
	}
	if(Width == null) {
		Width = 0;
	}
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	var _this = flixel_math_FlxRect._pool.get();
	var X1 = X;
	var Y1 = Y;
	var Width1 = Width;
	var Height1 = Height;
	if(Height1 == null) {
		Height1 = 0;
	}
	if(Width1 == null) {
		Width1 = 0;
	}
	if(Y1 == null) {
		Y1 = 0;
	}
	if(X1 == null) {
		X1 = 0;
	}
	_this.x = X1;
	_this.y = Y1;
	_this.width = Width1;
	_this.height = Height1;
	var rect = _this;
	rect._inPool = false;
	result.region = rect;
	result.atlasFrame = null;
	var X = tileWidth;
	var Y = tileHeight;
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	var point = flixel_math_FlxPoint._pool.get().set(X,Y);
	point._inPool = false;
	result.tileSize = point;
	var X = spaceX;
	var Y = spaceY;
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	var point = flixel_math_FlxPoint._pool.get().set(X,Y);
	point._inPool = false;
	result.tileSpacing = point;
	result.numCols = cols;
	result.numRows = rows;
	var _g = 0;
	while(_g < tileframes.length) {
		var collection = tileframes[_g];
		++_g;
		var _g1 = 0;
		var _g2 = collection.frames;
		while(_g1 < _g2.length) {
			var frame = _g2[_g1];
			++_g1;
			frame.paint(combined,destPoint,true);
			var X = destPoint.x;
			var Y = destPoint.y;
			var Width = tileWidth;
			var Height = tileHeight;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var _this = flixel_math_FlxRect._pool.get();
			var X1 = X;
			var Y1 = Y;
			var Width1 = Width;
			var Height1 = Height;
			if(Height1 == null) {
				Height1 = 0;
			}
			if(Width1 == null) {
				Width1 = 0;
			}
			if(Y1 == null) {
				Y1 = 0;
			}
			if(X1 == null) {
				X1 = 0;
			}
			_this.x = X1;
			_this.y = Y1;
			_this.width = Width1;
			_this.height = Height1;
			var rect = _this;
			rect._inPool = false;
			var X2 = tileWidth;
			var Y2 = tileHeight;
			if(Y2 == null) {
				Y2 = 0;
			}
			if(X2 == null) {
				X2 = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X2,Y2);
			point._inPool = false;
			var X3 = 0;
			var Y3 = 0;
			if(Y3 == null) {
				Y3 = 0;
			}
			if(X3 == null) {
				X3 = 0;
			}
			var point1 = flixel_math_FlxPoint._pool.get().set(X3,Y3);
			point1._inPool = false;
			result.addAtlasFrame(rect,point,point1);
			destPoint.x += tileWidth + 2 * borderX + spaceX;
			if(destPoint.x >= combined.width) {
				destPoint.x = borderX;
				destPoint.y += tileHeight + 2 * borderY + spaceY;
			}
		}
	}
	flixel_util_FlxBitmapDataUtil.copyBorderPixels(combined,tileWidth,tileHeight,spaceX,spaceY,borderX,borderY,cols,rows);
	return result;
};
flixel_graphics_frames_FlxTileFrames.findFrame = function(graphic,tileSize,region,atlasFrame,tileSpacing,border) {
	var type = flixel_graphics_frames_FlxFrameCollectionType.TILES;
	var collections = graphic.frameCollections.get(type);
	if(collections == null) {
		collections = [];
		graphic.frameCollections.set(type,collections);
	}
	var tileFrames = collections;
	var _g = 0;
	while(_g < tileFrames.length) {
		var sheet = tileFrames[_g];
		++_g;
		if(sheet.equals(tileSize,region,null,tileSpacing,border)) {
			return sheet;
		}
	}
	return null;
};
flixel_graphics_frames_FlxTileFrames.__super__ = flixel_graphics_frames_FlxFramesCollection;
flixel_graphics_frames_FlxTileFrames.prototype = $extend(flixel_graphics_frames_FlxFramesCollection.prototype,{
	atlasFrame: null
	,region: null
	,tileSize: null
	,tileSpacing: null
	,numRows: null
	,numCols: null
	,getByTilePosition: function(column,row) {
		return this.frames[row * this.numCols + column];
	}
	,equals: function(tileSize,region,atlasFrame,tileSpacing,border) {
		if(this.region == null && this.atlasFrame == null) {
			return false;
		}
		if(atlasFrame != null) {
			region = atlasFrame.frame;
		}
		if(region == null) {
			var X = 0;
			var Y = 0;
			var Width = this.parent.width;
			var Height = this.parent.height;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var X1 = X;
			var Y1 = Y;
			var Width1 = Width;
			var Height1 = Height;
			if(Height1 == null) {
				Height1 = 0;
			}
			if(Width1 == null) {
				Width1 = 0;
			}
			if(Y1 == null) {
				Y1 = 0;
			}
			if(X1 == null) {
				X1 = 0;
			}
			var _this = flixel_math_FlxRect._pool.get();
			var X = X1;
			var Y = Y1;
			var Width = Width1;
			var Height = Height1;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			_this.x = X;
			_this.y = Y;
			_this.width = Width;
			_this.height = Height;
			var rect = _this;
			rect._inPool = false;
			var rect1 = rect;
			rect1._weak = true;
			region = rect1;
		}
		if(tileSpacing == null) {
			var X = 0;
			var Y = 0;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			var point1 = point;
			point1._weak = true;
			tileSpacing = point1;
		}
		if(border == null) {
			var X = 0;
			var Y = 0;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			var point1 = point;
			point1._weak = true;
			border = point1;
		}
		var tmp;
		var tmp1;
		var tmp2;
		if(this.atlasFrame == atlasFrame) {
			var _this = this.region;
			var result = Math.abs(_this.x - region.x) <= 0.0000001 && Math.abs(_this.y - region.y) <= 0.0000001 && Math.abs(_this.width - region.width) <= 0.0000001 && Math.abs(_this.height - region.height) <= 0.0000001;
			if(region._weak) {
				if(!region._inPool) {
					region._inPool = true;
					region._weak = false;
					flixel_math_FlxRect._pool.putUnsafe(region);
				}
			}
			tmp2 = result;
		} else {
			tmp2 = false;
		}
		if(tmp2) {
			var _this = this.tileSize;
			var result = Math.abs(_this.x - tileSize.x) <= 0.0000001 && Math.abs(_this.y - tileSize.y) <= 0.0000001;
			if(tileSize._weak) {
				tileSize.put();
			}
			tmp1 = result;
		} else {
			tmp1 = false;
		}
		if(tmp1) {
			var _this = this.tileSpacing;
			var result = Math.abs(_this.x - tileSpacing.x) <= 0.0000001 && Math.abs(_this.y - tileSpacing.y) <= 0.0000001;
			if(tileSpacing._weak) {
				tileSpacing.put();
			}
			tmp = result;
		} else {
			tmp = false;
		}
		if(tmp) {
			var _this = this.border;
			var result = Math.abs(_this.x - border.x) <= 0.0000001 && Math.abs(_this.y - border.y) <= 0.0000001;
			if(border._weak) {
				border.put();
			}
			return result;
		} else {
			return false;
		}
	}
	,addBorder: function(border) {
		var point = flixel_math_FlxPoint._pool.get().set(0,0);
		point._inPool = false;
		var resultBorder = point.addPoint(this.border).addPoint(border);
		var point = flixel_math_FlxPoint._pool.get().set(0,0);
		point._inPool = false;
		var _this = point;
		var point = this.tileSize;
		_this.set_x(point.x);
		_this.set_y(point.y);
		if(point._weak) {
			point.put();
		}
		var _this1 = _this;
		var X = 2 * border.x;
		var Y = 2 * border.y;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var _g = _this1;
		_g.set_x(_g.x - X);
		var _g = _this1;
		_g.set_y(_g.y - Y);
		var resultSize = _this1;
		var tileFrames = flixel_graphics_frames_FlxTileFrames.findFrame(this.parent,resultSize,this.region,this.atlasFrame,this.tileSpacing,resultBorder);
		if(tileFrames != null) {
			resultSize = flixel_util_FlxDestroyUtil.put(resultSize);
			return tileFrames;
		}
		tileFrames = new flixel_graphics_frames_FlxTileFrames(this.parent,resultBorder);
		var _this = flixel_math_FlxRect._pool.get();
		var X = 0;
		var Y = 0;
		var Width = 0;
		var Height = 0;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		var rect = _this;
		rect._inPool = false;
		var _this = rect;
		var Rect = this.region;
		_this.x = Rect.x;
		_this.y = Rect.y;
		_this.width = Rect.width;
		_this.height = Rect.height;
		if(Rect._weak) {
			if(!Rect._inPool) {
				Rect._inPool = true;
				Rect._weak = false;
				flixel_math_FlxRect._pool.putUnsafe(Rect);
			}
		}
		tileFrames.region = _this;
		tileFrames.atlasFrame = this.atlasFrame;
		tileFrames.tileSize = resultSize;
		var point = flixel_math_FlxPoint._pool.get().set(0,0);
		point._inPool = false;
		var _this = point;
		var point = this.tileSpacing;
		_this.set_x(point.x);
		_this.set_y(point.y);
		if(point._weak) {
			point.put();
		}
		tileFrames.tileSpacing = _this;
		var _g = 0;
		var _g1 = this.frames;
		while(_g < _g1.length) {
			var frame = _g1[_g];
			++_g;
			tileFrames.pushFrame(frame.setBorderTo(border));
		}
		return tileFrames;
	}
	,destroy: function() {
		flixel_graphics_frames_FlxFramesCollection.prototype.destroy.call(this);
		this.atlasFrame = null;
		this.region = flixel_util_FlxDestroyUtil.put(this.region);
		this.tileSize = flixel_util_FlxDestroyUtil.put(this.tileSize);
		this.tileSpacing = flixel_util_FlxDestroyUtil.put(this.tileSpacing);
	}
	,__class__: flixel_graphics_frames_FlxTileFrames
});
var flixel_graphics_tile_FlxDrawBaseItem = function() {
	this.blending = 0;
	this.hasColorOffsets = false;
	this.colored = false;
	this.antialiasing = false;
};
$hxClasses["flixel.graphics.tile.FlxDrawBaseItem"] = flixel_graphics_tile_FlxDrawBaseItem;
flixel_graphics_tile_FlxDrawBaseItem.__name__ = "flixel.graphics.tile.FlxDrawBaseItem";
flixel_graphics_tile_FlxDrawBaseItem.blendToInt = function(blend) {
	return 0;
};
flixel_graphics_tile_FlxDrawBaseItem.prototype = {
	nextTyped: null
	,next: null
	,graphics: null
	,antialiasing: null
	,colored: null
	,hasColorOffsets: null
	,blending: null
	,blend: null
	,type: null
	,reset: function() {
		this.graphics = null;
		this.antialiasing = false;
		this.nextTyped = null;
		this.next = null;
	}
	,dispose: function() {
		this.graphics = null;
		this.next = null;
		this.type = null;
		this.nextTyped = null;
	}
	,render: function(camera) {
		flixel_graphics_tile_FlxDrawBaseItem.drawCalls++;
	}
	,addQuad: function(frame,matrix,transform) {
	}
	,get_numVertices: function() {
		return 0;
	}
	,get_numTriangles: function() {
		return 0;
	}
	,__class__: flixel_graphics_tile_FlxDrawBaseItem
	,__properties__: {get_numTriangles:"get_numTriangles",get_numVertices:"get_numVertices"}
};
var flixel_graphics_tile_FlxDrawItemType = $hxEnums["flixel.graphics.tile.FlxDrawItemType"] = { __ename__ : "flixel.graphics.tile.FlxDrawItemType", __constructs__ : ["TILES","TRIANGLES"]
	,TILES: {_hx_index:0,__enum__:"flixel.graphics.tile.FlxDrawItemType",toString:$estr}
	,TRIANGLES: {_hx_index:1,__enum__:"flixel.graphics.tile.FlxDrawItemType",toString:$estr}
};
var flixel_graphics_tile_FlxDrawQuadsItem = function() {
	flixel_graphics_tile_FlxDrawBaseItem.call(this);
	this.type = flixel_graphics_tile_FlxDrawItemType.TILES;
	this.rects = openfl_Vector.toFloatVector(null);
	this.transforms = openfl_Vector.toFloatVector(null);
	this.alphas = [];
};
$hxClasses["flixel.graphics.tile.FlxDrawQuadsItem"] = flixel_graphics_tile_FlxDrawQuadsItem;
flixel_graphics_tile_FlxDrawQuadsItem.__name__ = "flixel.graphics.tile.FlxDrawQuadsItem";
flixel_graphics_tile_FlxDrawQuadsItem.__super__ = flixel_graphics_tile_FlxDrawBaseItem;
flixel_graphics_tile_FlxDrawQuadsItem.prototype = $extend(flixel_graphics_tile_FlxDrawBaseItem.prototype,{
	shader: null
	,rects: null
	,transforms: null
	,alphas: null
	,colorMultipliers: null
	,colorOffsets: null
	,reset: function() {
		flixel_graphics_tile_FlxDrawBaseItem.prototype.reset.call(this);
		this.rects.set_length(0);
		this.transforms.set_length(0);
		this.alphas.splice(0,this.alphas.length);
		if(this.colorMultipliers != null) {
			this.colorMultipliers.splice(0,this.colorMultipliers.length);
		}
		if(this.colorOffsets != null) {
			this.colorOffsets.splice(0,this.colorOffsets.length);
		}
	}
	,dispose: function() {
		flixel_graphics_tile_FlxDrawBaseItem.prototype.dispose.call(this);
		this.rects = null;
		this.transforms = null;
		this.alphas = null;
		this.colorMultipliers = null;
		this.colorOffsets = null;
	}
	,addQuad: function(frame,matrix,transform) {
		var rect = frame.frame;
		this.rects.push(rect.x);
		this.rects.push(rect.y);
		this.rects.push(rect.width);
		this.rects.push(rect.height);
		this.transforms.push(matrix.a);
		this.transforms.push(matrix.b);
		this.transforms.push(matrix.c);
		this.transforms.push(matrix.d);
		this.transforms.push(matrix.tx);
		this.transforms.push(matrix.ty);
		this.alphas.push(transform != null ? transform.alphaMultiplier : 1.0);
		this.alphas.push(transform != null ? transform.alphaMultiplier : 1.0);
		this.alphas.push(transform != null ? transform.alphaMultiplier : 1.0);
		this.alphas.push(transform != null ? transform.alphaMultiplier : 1.0);
		if(this.colored || this.hasColorOffsets) {
			if(this.colorMultipliers == null) {
				this.colorMultipliers = [];
			}
			if(this.colorOffsets == null) {
				this.colorOffsets = [];
			}
			var _g = 0;
			while(_g < 4) {
				var i = _g++;
				if(transform != null) {
					this.colorMultipliers.push(transform.redMultiplier);
					this.colorMultipliers.push(transform.greenMultiplier);
					this.colorMultipliers.push(transform.blueMultiplier);
					this.colorOffsets.push(transform.redOffset);
					this.colorOffsets.push(transform.greenOffset);
					this.colorOffsets.push(transform.blueOffset);
					this.colorOffsets.push(transform.alphaOffset);
				} else {
					this.colorMultipliers.push(1);
					this.colorMultipliers.push(1);
					this.colorMultipliers.push(1);
					this.colorOffsets.push(0);
					this.colorOffsets.push(0);
					this.colorOffsets.push(0);
					this.colorOffsets.push(0);
				}
				this.colorMultipliers.push(1);
			}
		}
	}
	,render: function(camera) {
		if(this.rects.get_length() == 0) {
			return;
		}
		var shader = this.shader != null ? this.shader : this.graphics.shader;
		shader.bitmap.input = this.graphics.bitmap;
		shader.bitmap.filter = camera.antialiasing || this.antialiasing ? 4 : 5;
		shader.alpha.value = this.alphas;
		if(this.colored || this.hasColorOffsets) {
			shader.colorMultiplier.value = this.colorMultipliers;
			shader.colorOffset.value = this.colorOffsets;
		}
		var parameter = shader.hasTransform;
		if(parameter.value == null) {
			parameter.value = [];
		}
		parameter.value[0] = true;
		var parameter = shader.hasColorTransform;
		if(parameter.value == null) {
			parameter.value = [];
		}
		parameter.value[0] = this.colored || this.hasColorOffsets;
		camera.canvas.get_graphics().overrideBlendMode(this.blend);
		camera.canvas.get_graphics().beginShaderFill(shader);
		camera.canvas.get_graphics().drawQuads(this.rects,null,this.transforms);
		flixel_graphics_tile_FlxDrawBaseItem.prototype.render.call(this,camera);
	}
	,setParameterValue: function(parameter,value) {
		if(parameter.value == null) {
			parameter.value = [];
		}
		parameter.value[0] = value;
	}
	,__class__: flixel_graphics_tile_FlxDrawQuadsItem
});
var flixel_graphics_tile_FlxDrawTrianglesItem = function() {
	var _this = flixel_math_FlxRect._pool.get();
	_this.x = 0;
	_this.y = 0;
	_this.width = 0;
	_this.height = 0;
	_this._inPool = false;
	this.bounds = _this;
	this.colorsPosition = 0;
	this.indicesPosition = 0;
	this.verticesPosition = 0;
	this.colors = openfl_Vector.toIntVector(null);
	this.uvtData = openfl_Vector.toFloatVector(null);
	this.indices = openfl_Vector.toIntVector(null);
	this.vertices = openfl_Vector.toFloatVector(null);
	flixel_graphics_tile_FlxDrawBaseItem.call(this);
	this.type = flixel_graphics_tile_FlxDrawItemType.TRIANGLES;
};
$hxClasses["flixel.graphics.tile.FlxDrawTrianglesItem"] = flixel_graphics_tile_FlxDrawTrianglesItem;
flixel_graphics_tile_FlxDrawTrianglesItem.__name__ = "flixel.graphics.tile.FlxDrawTrianglesItem";
flixel_graphics_tile_FlxDrawTrianglesItem.inflateBounds = function(bounds,x,y) {
	if(x < bounds.x) {
		bounds.width += bounds.x - x;
		bounds.x = x;
	}
	if(y < bounds.y) {
		bounds.height += bounds.y - y;
		bounds.y = y;
	}
	if(x > bounds.x + bounds.width) {
		bounds.width = x - bounds.x;
	}
	if(y > bounds.y + bounds.height) {
		bounds.height = y - bounds.y;
	}
	return bounds;
};
flixel_graphics_tile_FlxDrawTrianglesItem.__super__ = flixel_graphics_tile_FlxDrawBaseItem;
flixel_graphics_tile_FlxDrawTrianglesItem.prototype = $extend(flixel_graphics_tile_FlxDrawBaseItem.prototype,{
	vertices: null
	,indices: null
	,uvtData: null
	,colors: null
	,verticesPosition: null
	,indicesPosition: null
	,colorsPosition: null
	,bounds: null
	,render: function(camera) {
		if(!flixel_FlxG.renderTile) {
			return;
		}
		if(this.get_numTriangles() <= 0) {
			return;
		}
		var tmp = camera.antialiasing || this.antialiasing;
		camera.canvas.get_graphics().beginBitmapFill(this.graphics.bitmap,null,true,tmp);
		camera.canvas.get_graphics().drawTriangles(this.vertices,this.indices,this.uvtData,1);
		camera.canvas.get_graphics().endFill();
		flixel_graphics_tile_FlxDrawBaseItem.prototype.render.call(this,camera);
	}
	,reset: function() {
		flixel_graphics_tile_FlxDrawBaseItem.prototype.reset.call(this);
		this.vertices.splice(0,this.vertices.get_length());
		this.indices.splice(0,this.indices.get_length());
		this.uvtData.splice(0,this.uvtData.get_length());
		this.colors.splice(0,this.colors.get_length());
		this.verticesPosition = 0;
		this.indicesPosition = 0;
		this.colorsPosition = 0;
	}
	,dispose: function() {
		flixel_graphics_tile_FlxDrawBaseItem.prototype.dispose.call(this);
		this.vertices = null;
		this.indices = null;
		this.uvtData = null;
		this.colors = null;
		this.bounds = null;
	}
	,addTriangles: function(vertices,indices,uvtData,colors,position,cameraBounds) {
		if(position == null) {
			position = flixel_graphics_tile_FlxDrawTrianglesItem.point.set();
		}
		if(cameraBounds == null) {
			var _this = flixel_graphics_tile_FlxDrawTrianglesItem.rect;
			var X = 0;
			var Y = 0;
			var Width = flixel_FlxG.width;
			var Height = flixel_FlxG.height;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			_this.x = X;
			_this.y = Y;
			_this.width = Width;
			_this.height = Height;
			cameraBounds = _this;
		}
		var verticesLength = vertices.get_length();
		var prevVerticesLength = this.vertices.get_length();
		var numberOfVertices = verticesLength / 2 | 0;
		var prevIndicesLength = this.indices.get_length();
		var prevUVTDataLength = this.uvtData.get_length();
		var prevColorsLength = this.colors.get_length();
		var prevNumberOfVertices = this.get_numVertices();
		var tempX;
		var tempY;
		var i = 0;
		var currentVertexPosition = prevVerticesLength;
		while(i < verticesLength) {
			tempX = position.x + vertices.get(i);
			tempY = position.y + vertices.get(i + 1);
			this.vertices.set(currentVertexPosition++,tempX);
			this.vertices.set(currentVertexPosition++,tempY);
			if(i == 0) {
				var _this = this.bounds;
				var X = tempX;
				var Y = tempY;
				var Width = 0;
				var Height = 0;
				if(Height == null) {
					Height = 0;
				}
				if(Width == null) {
					Width = 0;
				}
				if(Y == null) {
					Y = 0;
				}
				if(X == null) {
					X = 0;
				}
				_this.x = X;
				_this.y = Y;
				_this.width = Width;
				_this.height = Height;
			} else {
				var bounds = this.bounds;
				if(tempX < bounds.x) {
					bounds.width += bounds.x - tempX;
					bounds.x = tempX;
				}
				if(tempY < bounds.y) {
					bounds.height += bounds.y - tempY;
					bounds.y = tempY;
				}
				if(tempX > bounds.x + bounds.width) {
					bounds.width = tempX - bounds.x;
				}
				if(tempY > bounds.y + bounds.height) {
					bounds.height = tempY - bounds.y;
				}
			}
			i += 2;
		}
		var Rect = this.bounds;
		var result = Rect.x + Rect.width > cameraBounds.x && Rect.x < cameraBounds.x + cameraBounds.width && Rect.y + Rect.height > cameraBounds.y && Rect.y < cameraBounds.y + cameraBounds.height;
		if(Rect._weak) {
			if(!Rect._inPool) {
				Rect._inPool = true;
				Rect._weak = false;
				flixel_math_FlxRect._pool.putUnsafe(Rect);
			}
		}
		if(!result) {
			this.vertices.splice(this.vertices.get_length() - verticesLength,verticesLength);
		} else {
			var uvtDataLength = uvtData.get_length();
			var _g = 0;
			var _g1 = uvtDataLength;
			while(_g < _g1) {
				var i = _g++;
				this.uvtData.set(prevUVTDataLength + i,uvtData.get(i));
			}
			var indicesLength = indices.get_length();
			var _g = 0;
			var _g1 = indicesLength;
			while(_g < _g1) {
				var i = _g++;
				this.indices.set(prevIndicesLength + i,indices.get(i) + prevNumberOfVertices);
			}
			if(this.colored) {
				var _g = 0;
				var _g1 = numberOfVertices;
				while(_g < _g1) {
					var i = _g++;
					this.colors.set(prevColorsLength + i,colors.get(i));
				}
				this.colorsPosition += numberOfVertices;
			}
			this.verticesPosition += verticesLength;
			this.indicesPosition += indicesLength;
		}
		if(position._weak) {
			position.put();
		}
		if(cameraBounds._weak) {
			if(!cameraBounds._inPool) {
				cameraBounds._inPool = true;
				cameraBounds._weak = false;
				flixel_math_FlxRect._pool.putUnsafe(cameraBounds);
			}
		}
	}
	,addQuad: function(frame,matrix,transform) {
		var prevVerticesPos = this.verticesPosition;
		var prevIndicesPos = this.indicesPosition;
		var prevColorsPos = this.colorsPosition;
		var prevNumberOfVertices = this.get_numVertices();
		var point = flixel_math_FlxPoint._pool.get().set(0,0);
		point._inPool = false;
		var point1 = point;
		var x1 = point1.x * matrix.a + point1.y * matrix.c + matrix.tx;
		var y1 = point1.x * matrix.b + point1.y * matrix.d + matrix.ty;
		point1.set(x1,y1);
		this.vertices.set(prevVerticesPos,point1.x);
		this.vertices.set(prevVerticesPos + 1,point1.y);
		this.uvtData.set(prevVerticesPos,frame.uv.x);
		this.uvtData.set(prevVerticesPos + 1,frame.uv.y);
		point1.set(frame.frame.width,0);
		var x1 = point1.x * matrix.a + point1.y * matrix.c + matrix.tx;
		var y1 = point1.x * matrix.b + point1.y * matrix.d + matrix.ty;
		point1.set(x1,y1);
		this.vertices.set(prevVerticesPos + 2,point1.x);
		this.vertices.set(prevVerticesPos + 3,point1.y);
		this.uvtData.set(prevVerticesPos + 2,frame.uv.width);
		this.uvtData.set(prevVerticesPos + 3,frame.uv.y);
		point1.set(frame.frame.width,frame.frame.height);
		var x1 = point1.x * matrix.a + point1.y * matrix.c + matrix.tx;
		var y1 = point1.x * matrix.b + point1.y * matrix.d + matrix.ty;
		point1.set(x1,y1);
		this.vertices.set(prevVerticesPos + 4,point1.x);
		this.vertices.set(prevVerticesPos + 5,point1.y);
		this.uvtData.set(prevVerticesPos + 4,frame.uv.width);
		this.uvtData.set(prevVerticesPos + 5,frame.uv.height);
		point1.set(0,frame.frame.height);
		var x1 = point1.x * matrix.a + point1.y * matrix.c + matrix.tx;
		var y1 = point1.x * matrix.b + point1.y * matrix.d + matrix.ty;
		point1.set(x1,y1);
		this.vertices.set(prevVerticesPos + 6,point1.x);
		this.vertices.set(prevVerticesPos + 7,point1.y);
		point1.put();
		this.uvtData.set(prevVerticesPos + 6,frame.uv.x);
		this.uvtData.set(prevVerticesPos + 7,frame.uv.height);
		this.indices.set(prevIndicesPos,prevNumberOfVertices);
		this.indices.set(prevIndicesPos + 1,prevNumberOfVertices + 1);
		this.indices.set(prevIndicesPos + 2,prevNumberOfVertices + 2);
		this.indices.set(prevIndicesPos + 3,prevNumberOfVertices + 2);
		this.indices.set(prevIndicesPos + 4,prevNumberOfVertices + 3);
		this.indices.set(prevIndicesPos + 5,prevNumberOfVertices);
		if(this.colored) {
			var red = 1.0;
			var green = 1.0;
			var blue = 1.0;
			var alpha = 1.0;
			if(transform != null) {
				red = transform.redMultiplier;
				green = transform.greenMultiplier;
				blue = transform.blueMultiplier;
				alpha = transform.alphaMultiplier;
			}
			var Alpha = alpha;
			if(Alpha == null) {
				Alpha = 1;
			}
			var color = flixel_util_FlxColor._new();
			var Alpha1 = Alpha;
			if(Alpha1 == null) {
				Alpha1 = 1;
			}
			var Value = Math.round(red * 255);
			color &= -16711681;
			color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
			var Value = Math.round(green * 255);
			color &= -65281;
			color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
			var Value = Math.round(blue * 255);
			color &= -256;
			color |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
			var Value = Math.round(Alpha1 * 255);
			color &= 16777215;
			color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
			var color1 = color;
			this.colors.set(prevColorsPos,color1);
			this.colors.set(prevColorsPos + 1,color1);
			this.colors.set(prevColorsPos + 2,color1);
			this.colors.set(prevColorsPos + 3,color1);
			this.colorsPosition += 4;
		}
		this.verticesPosition += 8;
		this.indicesPosition += 6;
	}
	,get_numVertices: function() {
		return this.vertices.get_length() / 2 | 0;
	}
	,get_numTriangles: function() {
		return this.indices.get_length() / 3 | 0;
	}
	,__class__: flixel_graphics_tile_FlxDrawTrianglesItem
});
var openfl_display_Shader = function(code) {
	this.byteCode = code;
	this.precisionHint = 1;
	this.__glSourceDirty = true;
	this.__numPasses = 1;
	this.__data = openfl_display_ShaderData._new(code);
};
$hxClasses["openfl.display.Shader"] = openfl_display_Shader;
openfl_display_Shader.__name__ = "openfl.display.Shader";
openfl_display_Shader.prototype = {
	byteCode: null
	,glProgram: null
	,precisionHint: null
	,program: null
	,__alpha: null
	,__bitmap: null
	,__colorMultiplier: null
	,__colorOffset: null
	,__context: null
	,__data: null
	,__glFragmentSource: null
	,__glSourceDirty: null
	,__glVertexSource: null
	,__hasColorTransform: null
	,__inputBitmapData: null
	,__isGenerated: null
	,__matrix: null
	,__numPasses: null
	,__paramBool: null
	,__paramFloat: null
	,__paramInt: null
	,__position: null
	,__textureCoord: null
	,__texture: null
	,__textureSize: null
	,__clearUseArray: function() {
		var _g = 0;
		var _g1 = this.__paramBool;
		while(_g < _g1.length) {
			var parameter = _g1[_g];
			++_g;
			parameter.__useArray = false;
		}
		var _g = 0;
		var _g1 = this.__paramFloat;
		while(_g < _g1.length) {
			var parameter = _g1[_g];
			++_g;
			parameter.__useArray = false;
		}
		var _g = 0;
		var _g1 = this.__paramInt;
		while(_g < _g1.length) {
			var parameter = _g1[_g];
			++_g;
			parameter.__useArray = false;
		}
	}
	,__createGLShader: function(source,type) {
		var gl = this.__context.gl;
		var shader = gl.createShader(type);
		gl.shaderSource(shader,source);
		gl.compileShader(shader);
		if(gl.getShaderParameter(shader,gl.COMPILE_STATUS) == 0) {
			var message = type == gl.VERTEX_SHADER ? "Error compiling vertex shader" : "Error compiling fragment shader";
			message += "\n" + gl.getShaderInfoLog(shader);
			message += "\n" + source;
			lime_utils_Log.error(message,{ fileName : "openfl/display/Shader.hx", lineNumber : 329, className : "openfl.display.Shader", methodName : "__createGLShader"});
		}
		return shader;
	}
	,__createGLProgram: function(vertexSource,fragmentSource) {
		var gl = this.__context.gl;
		var vertexShader = this.__createGLShader(vertexSource,gl.VERTEX_SHADER);
		var fragmentShader = this.__createGLShader(fragmentSource,gl.FRAGMENT_SHADER);
		var program = gl.createProgram();
		var _g = 0;
		var _g1 = this.__paramFloat;
		while(_g < _g1.length) {
			var param = _g1[_g];
			++_g;
			if(param.name.indexOf("Position") > -1 && StringTools.startsWith(param.name,"openfl_")) {
				gl.bindAttribLocation(program,0,param.name);
				break;
			}
		}
		gl.attachShader(program,vertexShader);
		gl.attachShader(program,fragmentShader);
		gl.linkProgram(program);
		if(gl.getProgramParameter(program,gl.LINK_STATUS) == 0) {
			var message = "Unable to initialize the shader program";
			message += "\n" + gl.getProgramInfoLog(program);
			lime_utils_Log.error(message,{ fileName : "openfl/display/Shader.hx", lineNumber : 362, className : "openfl.display.Shader", methodName : "__createGLProgram"});
		}
		return program;
	}
	,__disable: function() {
		if(this.program != null) {
			this.__disableGL();
		}
	}
	,__disableGL: function() {
		var gl = this.__context.gl;
		var textureCount = 0;
		var _g = 0;
		var _g1 = this.__inputBitmapData;
		while(_g < _g1.length) {
			var input = _g1[_g];
			++_g;
			input.__disableGL(this.__context,textureCount);
			++textureCount;
		}
		var _g = 0;
		var _g1 = this.__paramBool;
		while(_g < _g1.length) {
			var parameter = _g1[_g];
			++_g;
			parameter.__disableGL(this.__context);
		}
		var _g = 0;
		var _g1 = this.__paramFloat;
		while(_g < _g1.length) {
			var parameter = _g1[_g];
			++_g;
			parameter.__disableGL(this.__context);
		}
		var _g = 0;
		var _g1 = this.__paramInt;
		while(_g < _g1.length) {
			var parameter = _g1[_g];
			++_g;
			parameter.__disableGL(this.__context);
		}
		this.__context.__bindGLArrayBuffer(null);
		if(this.__context.__context.type == "opengl") {
			gl.disable(gl.TEXTURE_2D);
		}
	}
	,__enable: function() {
		this.__init();
		if(this.program != null) {
			this.__enableGL();
		}
	}
	,__enableGL: function() {
		var textureCount = 0;
		var gl = this.__context.gl;
		var _g = 0;
		var _g1 = this.__inputBitmapData;
		while(_g < _g1.length) {
			var input = _g1[_g];
			++_g;
			gl.uniform1i(input.index,textureCount);
			++textureCount;
		}
		if(this.__context.__context.type == "opengl" && textureCount > 0) {
			gl.enable(gl.TEXTURE_2D);
		}
	}
	,__init: function() {
		if(this.__data == null) {
			this.__data = openfl_display_ShaderData._new(null);
		}
		if(this.__glFragmentSource != null && this.__glVertexSource != null && (this.program == null || this.__glSourceDirty)) {
			this.__initGL();
		}
	}
	,__initGL: function() {
		if(this.__glSourceDirty || this.__paramBool == null) {
			this.__glSourceDirty = false;
			this.program = null;
			this.__inputBitmapData = [];
			this.__paramBool = [];
			this.__paramFloat = [];
			this.__paramInt = [];
			this.__processGLData(this.get_glVertexSource(),"attribute");
			this.__processGLData(this.get_glVertexSource(),"uniform");
			this.__processGLData(this.get_glFragmentSource(),"uniform");
		}
		if(this.__context != null && this.program == null) {
			var gl = this.__context.gl;
			var prefix = "#ifdef GL_ES\n\t\t\t\t" + (this.precisionHint == 1 ? "#ifdef GL_FRAGMENT_PRECISION_HIGH\n\t\t\t\tprecision highp float;\n\t\t\t\t#else\n\t\t\t\tprecision mediump float;\n\t\t\t\t#endif" : "precision lowp float;") + "\n\t\t\t\t#endif\n\t\t\t\t";
			var vertex = prefix + this.get_glVertexSource();
			var fragment = prefix + this.get_glFragmentSource();
			var id = vertex + fragment;
			if(Object.prototype.hasOwnProperty.call(this.__context.__programs.h,id)) {
				this.program = this.__context.__programs.h[id];
			} else {
				this.program = this.__context.createProgram(1);
				this.program.__glProgram = this.__createGLProgram(vertex,fragment);
				this.__context.__programs.h[id] = this.program;
			}
			if(this.program != null) {
				this.glProgram = this.program.__glProgram;
				var _g = 0;
				var _g1 = this.__inputBitmapData;
				while(_g < _g1.length) {
					var input = _g1[_g];
					++_g;
					if(input.__isUniform) {
						input.index = gl.getUniformLocation(this.glProgram,input.name);
					} else {
						input.index = gl.getAttribLocation(this.glProgram,input.name);
					}
				}
				var _g = 0;
				var _g1 = this.__paramBool;
				while(_g < _g1.length) {
					var parameter = _g1[_g];
					++_g;
					if(parameter.__isUniform) {
						parameter.index = gl.getUniformLocation(this.glProgram,parameter.name);
					} else {
						parameter.index = gl.getAttribLocation(this.glProgram,parameter.name);
					}
				}
				var _g = 0;
				var _g1 = this.__paramFloat;
				while(_g < _g1.length) {
					var parameter = _g1[_g];
					++_g;
					if(parameter.__isUniform) {
						parameter.index = gl.getUniformLocation(this.glProgram,parameter.name);
					} else {
						parameter.index = gl.getAttribLocation(this.glProgram,parameter.name);
					}
				}
				var _g = 0;
				var _g1 = this.__paramInt;
				while(_g < _g1.length) {
					var parameter = _g1[_g];
					++_g;
					if(parameter.__isUniform) {
						parameter.index = gl.getUniformLocation(this.glProgram,parameter.name);
					} else {
						parameter.index = gl.getAttribLocation(this.glProgram,parameter.name);
					}
				}
			}
		}
	}
	,__processGLData: function(source,storageType) {
		var lastMatch = 0;
		var position;
		var regex;
		var name;
		var type;
		if(storageType == "uniform") {
			regex = new EReg("uniform ([A-Za-z0-9]+) ([A-Za-z0-9_]+)","");
		} else {
			regex = new EReg("attribute ([A-Za-z0-9]+) ([A-Za-z0-9_]+)","");
		}
		while(regex.matchSub(source,lastMatch)) {
			type = regex.matched(1);
			name = regex.matched(2);
			if(StringTools.startsWith(name,"gl_")) {
				continue;
			}
			var isUniform = storageType == "uniform";
			if(StringTools.startsWith(type,"sampler")) {
				var input = new openfl_display_ShaderInput();
				input.name = name;
				input.__isUniform = isUniform;
				this.__inputBitmapData.push(input);
				switch(name) {
				case "bitmap":
					this.__bitmap = input;
					break;
				case "openfl_Texture":
					this.__texture = input;
					break;
				default:
				}
				this.__data[name] = input;
				if(this.__isGenerated) {
					this[name] = input;
				}
			} else if(!Object.prototype.hasOwnProperty.call(this.__data,name) || Reflect.field(this.__data,name) == null) {
				var parameterType;
				switch(type) {
				case "bool":
					parameterType = 0;
					break;
				case "bvec2":
					parameterType = 1;
					break;
				case "bvec3":
					parameterType = 2;
					break;
				case "bvec4":
					parameterType = 3;
					break;
				case "dvec2":case "vec2":
					parameterType = 5;
					break;
				case "dvec3":case "vec3":
					parameterType = 6;
					break;
				case "double":case "float":
					parameterType = 4;
					break;
				case "ivec3":case "uvec3":
					parameterType = 10;
					break;
				case "ivec4":case "uvec4":
					parameterType = 11;
					break;
				case "mat2":case "mat2x2":
					parameterType = 12;
					break;
				case "mat2x3":
					parameterType = 13;
					break;
				case "mat2x4":
					parameterType = 14;
					break;
				case "mat3x2":
					parameterType = 15;
					break;
				case "mat3":case "mat3x3":
					parameterType = 16;
					break;
				case "mat3x4":
					parameterType = 17;
					break;
				case "mat4":case "mat4x4":
					parameterType = 20;
					break;
				case "mat4x2":
					parameterType = 18;
					break;
				case "mat4x3":
					parameterType = 19;
					break;
				case "int":case "uint":
					parameterType = 8;
					break;
				case "ivec2":case "uvec2":
					parameterType = 9;
					break;
				case "dvec4":case "vec4":
					parameterType = 7;
					break;
				default:
					parameterType = null;
				}
				var length;
				switch(parameterType) {
				case 1:case 5:case 9:
					length = 2;
					break;
				case 3:case 7:case 11:case 12:
					length = 4;
					break;
				case 2:case 6:case 10:
					length = 3;
					break;
				case 16:
					length = 9;
					break;
				case 20:
					length = 16;
					break;
				default:
					length = 1;
				}
				var arrayLength;
				switch(parameterType) {
				case 12:
					arrayLength = 2;
					break;
				case 16:
					arrayLength = 3;
					break;
				case 20:
					arrayLength = 4;
					break;
				default:
					arrayLength = 1;
				}
				switch(parameterType) {
				case 0:case 1:case 2:case 3:
					var parameter = new openfl_display_ShaderParameter();
					parameter.set_name(name);
					parameter.type = parameterType;
					parameter.__arrayLength = arrayLength;
					parameter.__isBool = true;
					parameter.__isUniform = isUniform;
					parameter.__length = length;
					this.__paramBool.push(parameter);
					if(name == "openfl_HasColorTransform") {
						this.__hasColorTransform = parameter;
					}
					this.__data[name] = parameter;
					if(this.__isGenerated) {
						this[name] = parameter;
					}
					break;
				case 8:case 9:case 10:case 11:
					var parameter1 = new openfl_display_ShaderParameter();
					parameter1.set_name(name);
					parameter1.type = parameterType;
					parameter1.__arrayLength = arrayLength;
					parameter1.__isInt = true;
					parameter1.__isUniform = isUniform;
					parameter1.__length = length;
					this.__paramInt.push(parameter1);
					this.__data[name] = parameter1;
					if(this.__isGenerated) {
						this[name] = parameter1;
					}
					break;
				default:
					var parameter2 = new openfl_display_ShaderParameter();
					parameter2.set_name(name);
					parameter2.type = parameterType;
					parameter2.__arrayLength = arrayLength;
					if(arrayLength > 0) {
						var elements = arrayLength * arrayLength;
						var array = null;
						var vector = null;
						var view = null;
						var buffer = null;
						var len = null;
						var this1;
						if(elements != null) {
							this1 = new Float32Array(elements);
						} else if(array != null) {
							this1 = new Float32Array(array);
						} else if(vector != null) {
							this1 = new Float32Array(vector.__array);
						} else if(view != null) {
							this1 = new Float32Array(view);
						} else if(buffer != null) {
							if(len == null) {
								this1 = new Float32Array(buffer,0);
							} else {
								this1 = new Float32Array(buffer,0,len);
							}
						} else {
							this1 = null;
						}
						parameter2.__uniformMatrix = this1;
					}
					parameter2.__isFloat = true;
					parameter2.__isUniform = isUniform;
					parameter2.__length = length;
					this.__paramFloat.push(parameter2);
					if(StringTools.startsWith(name,"openfl_")) {
						switch(name) {
						case "openfl_Alpha":
							this.__alpha = parameter2;
							break;
						case "openfl_ColorMultiplier":
							this.__colorMultiplier = parameter2;
							break;
						case "openfl_ColorOffset":
							this.__colorOffset = parameter2;
							break;
						case "openfl_Matrix":
							this.__matrix = parameter2;
							break;
						case "openfl_Position":
							this.__position = parameter2;
							break;
						case "openfl_TextureCoord":
							this.__textureCoord = parameter2;
							break;
						case "openfl_TextureSize":
							this.__textureSize = parameter2;
							break;
						default:
						}
					}
					this.__data[name] = parameter2;
					if(this.__isGenerated) {
						this[name] = parameter2;
					}
				}
			}
			position = regex.matchedPos();
			lastMatch = position.pos + position.len;
		}
	}
	,__update: function() {
		if(this.program != null) {
			this.__updateGL();
		}
	}
	,__updateFromBuffer: function(shaderBuffer,bufferOffset) {
		if(this.program != null) {
			this.__updateGLFromBuffer(shaderBuffer,bufferOffset);
		}
	}
	,__updateGL: function() {
		var textureCount = 0;
		var _g = 0;
		var _g1 = this.__inputBitmapData;
		while(_g < _g1.length) {
			var input = _g1[_g];
			++_g;
			input.__updateGL(this.__context,textureCount);
			++textureCount;
		}
		var _g = 0;
		var _g1 = this.__paramBool;
		while(_g < _g1.length) {
			var parameter = _g1[_g];
			++_g;
			parameter.__updateGL(this.__context);
		}
		var _g = 0;
		var _g1 = this.__paramFloat;
		while(_g < _g1.length) {
			var parameter = _g1[_g];
			++_g;
			parameter.__updateGL(this.__context);
		}
		var _g = 0;
		var _g1 = this.__paramInt;
		while(_g < _g1.length) {
			var parameter = _g1[_g];
			++_g;
			parameter.__updateGL(this.__context);
		}
	}
	,__updateGLFromBuffer: function(shaderBuffer,bufferOffset) {
		var textureCount = 0;
		var input;
		var inputData;
		var inputFilter;
		var inputMipFilter;
		var inputWrap;
		var _g = 0;
		var _g1 = shaderBuffer.inputCount;
		while(_g < _g1) {
			var i = _g++;
			input = shaderBuffer.inputRefs[i];
			inputData = shaderBuffer.inputs[i];
			inputFilter = shaderBuffer.inputFilter[i];
			inputMipFilter = shaderBuffer.inputMipFilter[i];
			inputWrap = shaderBuffer.inputWrap[i];
			if(inputData != null) {
				input.__updateGL(this.__context,textureCount,inputData,inputFilter,inputMipFilter,inputWrap);
				++textureCount;
			}
		}
		var gl = this.__context.gl;
		if(shaderBuffer.paramDataLength > 0) {
			if(shaderBuffer.paramDataBuffer == null) {
				shaderBuffer.paramDataBuffer = gl.createBuffer();
			}
			this.__context.__bindGLArrayBuffer(shaderBuffer.paramDataBuffer);
			lime_graphics_WebGLRenderContext.bufferData(gl,gl.ARRAY_BUFFER,shaderBuffer.paramData,gl.DYNAMIC_DRAW);
		} else {
			this.__context.__bindGLArrayBuffer(null);
		}
		var boolIndex = 0;
		var floatIndex = 0;
		var intIndex = 0;
		var boolCount = shaderBuffer.paramBoolCount;
		var floatCount = shaderBuffer.paramFloatCount;
		var paramData = shaderBuffer.paramData;
		var boolRef;
		var floatRef;
		var intRef;
		var hasOverride;
		var overrideBoolValue = null;
		var overrideFloatValue = null;
		var overrideIntValue = null;
		var _g = 0;
		var _g1 = shaderBuffer.paramCount;
		while(_g < _g1) {
			var i = _g++;
			hasOverride = false;
			if(i < boolCount) {
				boolRef = shaderBuffer.paramRefs_Bool[boolIndex];
				var _g2 = 0;
				var _g3 = shaderBuffer.overrideBoolCount;
				while(_g2 < _g3) {
					var j = _g2++;
					if(boolRef.name == shaderBuffer.overrideBoolNames[j]) {
						overrideBoolValue = shaderBuffer.overrideBoolValues[j];
						hasOverride = true;
						break;
					}
				}
				if(hasOverride) {
					boolRef.__updateGL(this.__context,overrideBoolValue);
				} else {
					boolRef.__updateGLFromBuffer(this.__context,paramData,shaderBuffer.paramPositions[i],shaderBuffer.paramLengths[i],bufferOffset);
				}
				++boolIndex;
			} else if(i < boolCount + floatCount) {
				floatRef = shaderBuffer.paramRefs_Float[floatIndex];
				var _g4 = 0;
				var _g5 = shaderBuffer.overrideFloatCount;
				while(_g4 < _g5) {
					var j1 = _g4++;
					if(floatRef.name == shaderBuffer.overrideFloatNames[j1]) {
						overrideFloatValue = shaderBuffer.overrideFloatValues[j1];
						hasOverride = true;
						break;
					}
				}
				if(hasOverride) {
					floatRef.__updateGL(this.__context,overrideFloatValue);
				} else {
					floatRef.__updateGLFromBuffer(this.__context,paramData,shaderBuffer.paramPositions[i],shaderBuffer.paramLengths[i],bufferOffset);
				}
				++floatIndex;
			} else {
				intRef = shaderBuffer.paramRefs_Int[intIndex];
				var _g6 = 0;
				var _g7 = shaderBuffer.overrideIntCount;
				while(_g6 < _g7) {
					var j2 = _g6++;
					if(intRef.name == shaderBuffer.overrideIntNames[j2]) {
						overrideIntValue = shaderBuffer.overrideIntValues[j2];
						hasOverride = true;
						break;
					}
				}
				if(hasOverride) {
					intRef.__updateGL(this.__context,overrideIntValue);
				} else {
					intRef.__updateGLFromBuffer(this.__context,paramData,shaderBuffer.paramPositions[i],shaderBuffer.paramLengths[i],bufferOffset);
				}
				++intIndex;
			}
		}
	}
	,get_data: function() {
		if(this.__glSourceDirty || this.__data == null) {
			this.__init();
		}
		return this.__data;
	}
	,set_data: function(value) {
		return this.__data = value;
	}
	,get_glFragmentSource: function() {
		return this.__glFragmentSource;
	}
	,set_glFragmentSource: function(value) {
		if(value != this.__glFragmentSource) {
			this.__glSourceDirty = true;
		}
		return this.__glFragmentSource = value;
	}
	,get_glVertexSource: function() {
		return this.__glVertexSource;
	}
	,set_glVertexSource: function(value) {
		if(value != this.__glVertexSource) {
			this.__glSourceDirty = true;
		}
		return this.__glVertexSource = value;
	}
	,__class__: openfl_display_Shader
	,__properties__: {set_glVertexSource:"set_glVertexSource",get_glVertexSource:"get_glVertexSource",set_glFragmentSource:"set_glFragmentSource",get_glFragmentSource:"get_glFragmentSource",set_data:"set_data",get_data:"get_data"}
};
var openfl_display_GraphicsShader = function(code) {
	if(this.__glFragmentSource == null) {
		this.__glFragmentSource = "varying float openfl_Alphav;\n\t\tvarying vec4 openfl_ColorMultiplierv;\n\t\tvarying vec4 openfl_ColorOffsetv;\n\t\tvarying vec2 openfl_TextureCoordv;\n\n\t\tuniform bool openfl_HasColorTransform;\n\t\tuniform vec2 openfl_TextureSize;\n\t\tuniform sampler2D bitmap;\n\n\t\tvoid main(void) {\n\n\t\t\tvec4 color = texture2D (bitmap, openfl_TextureCoordv);\n\n\t\tif (color.a == 0.0) {\n\n\t\t\tgl_FragColor = vec4 (0.0, 0.0, 0.0, 0.0);\n\n\t\t} else if (openfl_HasColorTransform) {\n\n\t\t\tcolor = vec4 (color.rgb / color.a, color.a);\n\n\t\t\tmat4 colorMultiplier = mat4 (0);\n\t\t\tcolorMultiplier[0][0] = openfl_ColorMultiplierv.x;\n\t\t\tcolorMultiplier[1][1] = openfl_ColorMultiplierv.y;\n\t\t\tcolorMultiplier[2][2] = openfl_ColorMultiplierv.z;\n\t\t\tcolorMultiplier[3][3] = 1.0; // openfl_ColorMultiplierv.w;\n\n\t\t\tcolor = clamp (openfl_ColorOffsetv + (color * colorMultiplier), 0.0, 1.0);\n\n\t\t\tif (color.a > 0.0) {\n\n\t\t\t\tgl_FragColor = vec4 (color.rgb * color.a * openfl_Alphav, color.a * openfl_Alphav);\n\n\t\t\t} else {\n\n\t\t\t\tgl_FragColor = vec4 (0.0, 0.0, 0.0, 0.0);\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tgl_FragColor = color * openfl_Alphav;\n\n\t\t}\n\n\t\t}";
	}
	if(this.__glVertexSource == null) {
		this.__glVertexSource = "attribute float openfl_Alpha;\n\t\tattribute vec4 openfl_ColorMultiplier;\n\t\tattribute vec4 openfl_ColorOffset;\n\t\tattribute vec4 openfl_Position;\n\t\tattribute vec2 openfl_TextureCoord;\n\n\t\tvarying float openfl_Alphav;\n\t\tvarying vec4 openfl_ColorMultiplierv;\n\t\tvarying vec4 openfl_ColorOffsetv;\n\t\tvarying vec2 openfl_TextureCoordv;\n\n\t\tuniform mat4 openfl_Matrix;\n\t\tuniform bool openfl_HasColorTransform;\n\t\tuniform vec2 openfl_TextureSize;\n\n\t\tvoid main(void) {\n\n\t\t\topenfl_Alphav = openfl_Alpha;\n\t\topenfl_TextureCoordv = openfl_TextureCoord;\n\n\t\tif (openfl_HasColorTransform) {\n\n\t\t\topenfl_ColorMultiplierv = openfl_ColorMultiplier;\n\t\t\topenfl_ColorOffsetv = openfl_ColorOffset / 255.0;\n\n\t\t}\n\n\t\tgl_Position = openfl_Matrix * openfl_Position;\n\n\t\t}";
	}
	openfl_display_Shader.call(this,code);
	this.__isGenerated = true;
	this.__initGL();
};
$hxClasses["openfl.display.GraphicsShader"] = openfl_display_GraphicsShader;
openfl_display_GraphicsShader.__name__ = "openfl.display.GraphicsShader";
openfl_display_GraphicsShader.__super__ = openfl_display_Shader;
openfl_display_GraphicsShader.prototype = $extend(openfl_display_Shader.prototype,{
	openfl_Alpha: null
	,openfl_ColorMultiplier: null
	,openfl_ColorOffset: null
	,openfl_Position: null
	,openfl_TextureCoord: null
	,openfl_Matrix: null
	,openfl_HasColorTransform: null
	,openfl_TextureSize: null
	,bitmap: null
	,__class__: openfl_display_GraphicsShader
});
var flixel_graphics_tile_FlxGraphicsShader = function() {
	if(this.__glFragmentSource == null) {
		this.__glFragmentSource = "\r\n\t\tvarying float openfl_Alphav;\n\t\tvarying vec4 openfl_ColorMultiplierv;\n\t\tvarying vec4 openfl_ColorOffsetv;\n\t\tvarying vec2 openfl_TextureCoordv;\n\n\t\tuniform bool openfl_HasColorTransform;\n\t\tuniform vec2 openfl_TextureSize;\n\t\tuniform sampler2D bitmap;\n\r\n\t\tuniform bool hasTransform;\r\n\t\tuniform bool hasColorTransform;\r\n\r\n\t\tvec4 flixel_texture2D(sampler2D bitmap, vec2 coord)\r\n\t\t{\r\n\t\t\tvec4 color = texture2D(bitmap, coord);\r\n\t\t\tif (!hasTransform)\r\n\t\t\t{\r\n\t\t\t\treturn color;\r\n\t\t\t}\r\n\r\n\t\t\tif (color.a == 0.0)\r\n\t\t\t{\r\n\t\t\t\treturn vec4(0.0, 0.0, 0.0, 0.0);\r\n\t\t\t}\r\n\r\n\t\t\tif (!hasColorTransform)\r\n\t\t\t{\r\n\t\t\t\treturn color * openfl_Alphav;\r\n\t\t\t}\r\n\r\n\t\t\tcolor = vec4(color.rgb / color.a, color.a);\r\n\r\n\t\t\tmat4 colorMultiplier = mat4(0);\r\n\t\t\tcolorMultiplier[0][0] = openfl_ColorMultiplierv.x;\r\n\t\t\tcolorMultiplier[1][1] = openfl_ColorMultiplierv.y;\r\n\t\t\tcolorMultiplier[2][2] = openfl_ColorMultiplierv.z;\r\n\t\t\tcolorMultiplier[3][3] = openfl_ColorMultiplierv.w;\r\n\r\n\t\t\tcolor = clamp(openfl_ColorOffsetv + (color * colorMultiplier), 0.0, 1.0);\r\n\r\n\t\t\tif (color.a > 0.0)\r\n\t\t\t{\r\n\t\t\t\treturn vec4(color.rgb * color.a * openfl_Alphav, color.a * openfl_Alphav);\r\n\t\t\t}\r\n\t\t\treturn vec4(0.0, 0.0, 0.0, 0.0);\r\n\t\t}\r\n\t\r\n\t\t\r\n\t\tvoid main(void)\r\n\t\t{\r\n\t\t\tgl_FragColor = flixel_texture2D(bitmap, openfl_TextureCoordv);\r\n\t\t}";
	}
	if(this.__glVertexSource == null) {
		this.__glVertexSource = "\r\n\t\tattribute float openfl_Alpha;\n\t\tattribute vec4 openfl_ColorMultiplier;\n\t\tattribute vec4 openfl_ColorOffset;\n\t\tattribute vec4 openfl_Position;\n\t\tattribute vec2 openfl_TextureCoord;\n\n\t\tvarying float openfl_Alphav;\n\t\tvarying vec4 openfl_ColorMultiplierv;\n\t\tvarying vec4 openfl_ColorOffsetv;\n\t\tvarying vec2 openfl_TextureCoordv;\n\n\t\tuniform mat4 openfl_Matrix;\n\t\tuniform bool openfl_HasColorTransform;\n\t\tuniform vec2 openfl_TextureSize;\n\r\n\t\t\r\n\t\tattribute float alpha;\r\n\t\tattribute vec4 colorMultiplier;\r\n\t\tattribute vec4 colorOffset;\r\n\t\tuniform bool hasColorTransform;\r\n\t\t\r\n\t\tvoid main(void)\r\n\t\t{\r\n\t\t\topenfl_Alphav = openfl_Alpha;\n\t\topenfl_TextureCoordv = openfl_TextureCoord;\n\n\t\tif (openfl_HasColorTransform) {\n\n\t\t\topenfl_ColorMultiplierv = openfl_ColorMultiplier;\n\t\t\topenfl_ColorOffsetv = openfl_ColorOffset / 255.0;\n\n\t\t}\n\n\t\tgl_Position = openfl_Matrix * openfl_Position;\n\r\n\t\t\t\r\n\t\t\topenfl_Alphav = openfl_Alpha * alpha;\r\n\t\t\t\r\n\t\t\tif (hasColorTransform)\r\n\t\t\t{\r\n\t\t\t\topenfl_ColorOffsetv = colorOffset / 255.0;\r\n\t\t\t\topenfl_ColorMultiplierv = colorMultiplier;\r\n\t\t\t}\r\n\t\t}";
	}
	openfl_display_GraphicsShader.call(this);
	this.__isGenerated = true;
	this.__initGL();
};
$hxClasses["flixel.graphics.tile.FlxGraphicsShader"] = flixel_graphics_tile_FlxGraphicsShader;
flixel_graphics_tile_FlxGraphicsShader.__name__ = "flixel.graphics.tile.FlxGraphicsShader";
flixel_graphics_tile_FlxGraphicsShader.__super__ = openfl_display_GraphicsShader;
flixel_graphics_tile_FlxGraphicsShader.prototype = $extend(openfl_display_GraphicsShader.prototype,{
	alpha: null
	,colorMultiplier: null
	,colorOffset: null
	,hasColorTransform: null
	,hasTransform: null
	,__class__: flixel_graphics_tile_FlxGraphicsShader
});
var flixel_group_FlxTypedGroupIterator = function(GroupMembers,filter) {
	this._groupMembers = GroupMembers;
	this._filter = filter;
	this._cursor = 0;
	this._length = this._groupMembers.length;
};
$hxClasses["flixel.group.FlxTypedGroupIterator"] = flixel_group_FlxTypedGroupIterator;
flixel_group_FlxTypedGroupIterator.__name__ = "flixel.group.FlxTypedGroupIterator";
flixel_group_FlxTypedGroupIterator.prototype = {
	_groupMembers: null
	,_filter: null
	,_cursor: null
	,_length: null
	,next: function() {
		if(this.hasNext()) {
			return this._groupMembers[this._cursor++];
		} else {
			return null;
		}
	}
	,hasNext: function() {
		while(this._cursor < this._length && (this._groupMembers[this._cursor] == null || this._filter != null && !this._filter(this._groupMembers[this._cursor]))) this._cursor++;
		return this._cursor < this._length;
	}
	,__class__: flixel_group_FlxTypedGroupIterator
};
var flixel_input_FlxAccelerometer = function() {
	this.z = 0;
	this.y = 0;
	this.x = 0;
	if(openfl_sensors_Accelerometer.get_isSupported()) {
		this._sensor = new openfl_sensors_Accelerometer();
		this._sensor.addEventListener("update",$bind(this,this.update));
	}
};
$hxClasses["flixel.input.FlxAccelerometer"] = flixel_input_FlxAccelerometer;
flixel_input_FlxAccelerometer.__name__ = "flixel.input.FlxAccelerometer";
flixel_input_FlxAccelerometer.prototype = {
	x: null
	,y: null
	,z: null
	,_sensor: null
	,get_isSupported: function() {
		return openfl_sensors_Accelerometer.get_isSupported();
	}
	,update: function(Event1) {
		this.x = Event1.accelerationX;
		this.y = Event1.accelerationY;
		this.z = Event1.accelerationZ;
		this.x /= 10;
		this.y /= 10;
		this.z /= 10;
	}
	,__class__: flixel_input_FlxAccelerometer
	,__properties__: {get_isSupported:"get_isSupported"}
};
var flixel_input_FlxBaseKeyList = function(status,keyManager) {
	this.status = status;
	this.keyManager = keyManager;
};
$hxClasses["flixel.input.FlxBaseKeyList"] = flixel_input_FlxBaseKeyList;
flixel_input_FlxBaseKeyList.__name__ = "flixel.input.FlxBaseKeyList";
flixel_input_FlxBaseKeyList.prototype = {
	status: null
	,keyManager: null
	,check: function(keyCode) {
		return this.keyManager.checkStatus(keyCode,this.status);
	}
	,get_ANY: function() {
		var _g = 0;
		var _g1 = this.keyManager._keyListArray;
		while(_g < _g1.length) {
			var key = _g1[_g];
			++_g;
			if(key != null && this.keyManager.checkStatus(key.ID,this.status)) {
				return true;
			}
		}
		return false;
	}
	,get_NONE: function() {
		var _g = 0;
		var _g1 = this.keyManager._keyListArray;
		while(_g < _g1.length) {
			var key = _g1[_g];
			++_g;
			if(key != null && this.keyManager.checkStatus(key.ID,this.status)) {
				return false;
			}
		}
		return true;
	}
	,__class__: flixel_input_FlxBaseKeyList
	,__properties__: {get_NONE:"get_NONE",get_ANY:"get_ANY"}
};
var flixel_input_IFlxInput = function() { };
$hxClasses["flixel.input.IFlxInput"] = flixel_input_IFlxInput;
flixel_input_IFlxInput.__name__ = "flixel.input.IFlxInput";
flixel_input_IFlxInput.__isInterface__ = true;
flixel_input_IFlxInput.prototype = {
	get_justReleased: null
	,get_released: null
	,get_pressed: null
	,get_justPressed: null
	,__class__: flixel_input_IFlxInput
	,__properties__: {get_justPressed:"get_justPressed",get_pressed:"get_pressed",get_released:"get_released",get_justReleased:"get_justReleased"}
};
var flixel_input_FlxInput = function(ID) {
	this.last = 0;
	this.current = 0;
	this.ID = ID;
};
$hxClasses["flixel.input.FlxInput"] = flixel_input_FlxInput;
flixel_input_FlxInput.__name__ = "flixel.input.FlxInput";
flixel_input_FlxInput.__interfaces__ = [flixel_input_IFlxInput];
flixel_input_FlxInput.prototype = {
	ID: null
	,current: null
	,last: null
	,press: function() {
		this.last = this.current;
		this.current = this.current == 1 || this.current == 2 ? 1 : 2;
	}
	,release: function() {
		this.last = this.current;
		this.current = this.current == 1 || this.current == 2 ? -1 : 0;
	}
	,update: function() {
		if(this.last == -1 && this.current == -1) {
			this.current = 0;
		} else if(this.last == 2 && this.current == 2) {
			this.current = 1;
		}
		this.last = this.current;
	}
	,reset: function() {
		this.current = 0;
		this.last = 0;
	}
	,hasState: function(state) {
		switch(state) {
		case -1:
			return this.current == -1;
		case 0:
			if(this.current != 0) {
				return this.current == -1;
			} else {
				return true;
			}
			break;
		case 1:
			if(this.current != 1) {
				return this.current == 2;
			} else {
				return true;
			}
			break;
		case 2:
			return this.current == 2;
		}
	}
	,get_justReleased: function() {
		return this.current == -1;
	}
	,get_released: function() {
		if(this.current != 0) {
			return this.current == -1;
		} else {
			return true;
		}
	}
	,get_pressed: function() {
		if(this.current != 1) {
			return this.current == 2;
		} else {
			return true;
		}
	}
	,get_justPressed: function() {
		return this.current == 2;
	}
	,__class__: flixel_input_FlxInput
	,__properties__: {get_justPressed:"get_justPressed",get_pressed:"get_pressed",get_released:"get_released",get_justReleased:"get_justReleased"}
};
var flixel_input_IFlxInputManager = function() { };
$hxClasses["flixel.input.IFlxInputManager"] = flixel_input_IFlxInputManager;
flixel_input_IFlxInputManager.__name__ = "flixel.input.IFlxInputManager";
flixel_input_IFlxInputManager.__isInterface__ = true;
flixel_input_IFlxInputManager.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_input_IFlxInputManager.prototype = {
	reset: null
	,update: null
	,onFocus: null
	,onFocusLost: null
	,__class__: flixel_input_IFlxInputManager
};
var flixel_input_FlxKeyManager = function(createKeyList) {
	this._keyListMap = new haxe_ds_IntMap();
	this._keyListArray = [];
	this.preventDefaultKeys = [];
	this.enabled = true;
	openfl_Lib.get_current().stage.addEventListener("keyDown",$bind(this,this.onKeyDown));
	openfl_Lib.get_current().stage.addEventListener("keyUp",$bind(this,this.onKeyUp));
	this.pressed = createKeyList(1,this);
	this.released = createKeyList(0,this);
	this.justPressed = createKeyList(2,this);
	this.justReleased = createKeyList(-1,this);
};
$hxClasses["flixel.input.FlxKeyManager"] = flixel_input_FlxKeyManager;
flixel_input_FlxKeyManager.__name__ = "flixel.input.FlxKeyManager";
flixel_input_FlxKeyManager.__interfaces__ = [flixel_input_IFlxInputManager];
flixel_input_FlxKeyManager.prototype = {
	enabled: null
	,preventDefaultKeys: null
	,pressed: null
	,justPressed: null
	,released: null
	,justReleased: null
	,_keyListArray: null
	,_keyListMap: null
	,anyPressed: function(KeyArray) {
		return this.checkKeyArrayState(KeyArray,1);
	}
	,anyJustPressed: function(KeyArray) {
		return this.checkKeyArrayState(KeyArray,2);
	}
	,anyJustReleased: function(KeyArray) {
		return this.checkKeyArrayState(KeyArray,-1);
	}
	,firstPressed: function() {
		var _g = 0;
		var _g1 = this._keyListArray;
		while(_g < _g1.length) {
			var key = _g1[_g];
			++_g;
			if(key != null && (key.current == 1 || key.current == 2)) {
				return key.ID;
			}
		}
		return -1;
	}
	,firstJustPressed: function() {
		var _g = 0;
		var _g1 = this._keyListArray;
		while(_g < _g1.length) {
			var key = _g1[_g];
			++_g;
			if(key != null && key.current == 2) {
				return key.ID;
			}
		}
		return -1;
	}
	,firstJustReleased: function() {
		var _g = 0;
		var _g1 = this._keyListArray;
		while(_g < _g1.length) {
			var key = _g1[_g];
			++_g;
			if(key != null && key.current == -1) {
				return key.ID;
			}
		}
		return -1;
	}
	,checkStatus: function(KeyCode,Status) {
		switch(KeyCode) {
		case -2:
			switch(Status) {
			case -1:
				return this.justReleased.get_ANY();
			case 0:
				return this.released.get_ANY();
			case 1:
				return this.pressed.get_ANY();
			case 2:
				return this.justPressed.get_ANY();
			}
			break;
		case -1:
			switch(Status) {
			case -1:
				return this.justReleased.get_NONE();
			case 0:
				return this.released.get_NONE();
			case 1:
				return this.pressed.get_NONE();
			case 2:
				return this.justPressed.get_NONE();
			}
			break;
		default:
			var key = this._keyListMap.h[KeyCode];
			if(key == null) {
				return false;
			}
			return key.hasState(Status);
		}
	}
	,getIsDown: function() {
		var keysDown = [];
		var _g = 0;
		var _g1 = this._keyListArray;
		while(_g < _g1.length) {
			var key = _g1[_g];
			++_g;
			if(key != null && (key.current == 1 || key.current == 2)) {
				keysDown.push(key);
			}
		}
		return keysDown;
	}
	,destroy: function() {
		this._keyListArray = null;
		this._keyListMap = null;
	}
	,reset: function() {
		var _g = 0;
		var _g1 = this._keyListArray;
		while(_g < _g1.length) {
			var key = _g1[_g];
			++_g;
			if(key != null) {
				key.release();
			}
		}
	}
	,update: function() {
		var _g = 0;
		var _g1 = this._keyListArray;
		while(_g < _g1.length) {
			var key = _g1[_g];
			++_g;
			if(key != null) {
				key.update();
			}
		}
	}
	,checkKeyArrayState: function(KeyArray,State) {
		if(KeyArray == null) {
			return false;
		}
		var _g = 0;
		while(_g < KeyArray.length) {
			var code = KeyArray[_g];
			++_g;
			if(this.checkStatus(code,State)) {
				return true;
			}
		}
		return false;
	}
	,onKeyUp: function(event) {
		var c = this.resolveKeyCode(event);
		this.handlePreventDefaultKeys(c,event);
		if(this.enabled) {
			var key = this._keyListMap.h[c];
			if(key != null) {
				key.release();
			}
		}
	}
	,onKeyDown: function(event) {
		var c = this.resolveKeyCode(event);
		this.handlePreventDefaultKeys(c,event);
		if(this.enabled) {
			var key = this._keyListMap.h[c];
			if(key != null) {
				key.press();
			}
		}
	}
	,handlePreventDefaultKeys: function(keyCode,event) {
		var key = this._keyListMap.h[keyCode];
		if(key != null && this.preventDefaultKeys != null && this.preventDefaultKeys.indexOf(key.ID) != -1) {
			event.stopImmediatePropagation();
			event.stopPropagation();
			event.preventDefault();
		}
	}
	,inKeyArray: function(KeyArray,Event1) {
		if(KeyArray == null) {
			return false;
		} else {
			var code = this.resolveKeyCode(Event1);
			var _g = 0;
			while(_g < KeyArray.length) {
				var key = KeyArray[_g];
				++_g;
				if(key == code || key == -2) {
					return true;
				}
			}
		}
		return false;
	}
	,resolveKeyCode: function(e) {
		return e.keyCode;
	}
	,updateKeyStates: function(KeyCode,Down) {
		var key = this._keyListMap.h[KeyCode];
		if(key != null) {
			if(Down) {
				key.press();
			} else {
				key.release();
			}
		}
	}
	,onFocus: function() {
	}
	,onFocusLost: function() {
		this.reset();
	}
	,getKey: function(KeyCode) {
		return this._keyListMap.h[KeyCode];
	}
	,__class__: flixel_input_FlxKeyManager
};
var flixel_input_FlxPointer = function() {
	this._globalScreenY = 0;
	this._globalScreenX = 0;
	this.screenY = 0;
	this.screenX = 0;
	this.y = 0;
	this.x = 0;
};
$hxClasses["flixel.input.FlxPointer"] = flixel_input_FlxPointer;
flixel_input_FlxPointer.__name__ = "flixel.input.FlxPointer";
flixel_input_FlxPointer.prototype = {
	x: null
	,y: null
	,screenX: null
	,screenY: null
	,_globalScreenX: null
	,_globalScreenY: null
	,getWorldPosition: function(Camera,point) {
		if(Camera == null) {
			Camera = flixel_FlxG.camera;
		}
		if(point == null) {
			var point1 = flixel_math_FlxPoint._pool.get().set(0,0);
			point1._inPool = false;
			point = point1;
		}
		this.getScreenPosition(Camera,flixel_input_FlxPointer._cachedPoint);
		point.set_x(flixel_input_FlxPointer._cachedPoint.x + Camera.scroll.x);
		point.set_y(flixel_input_FlxPointer._cachedPoint.y + Camera.scroll.y);
		return point;
	}
	,getScreenPosition: function(Camera,point) {
		if(Camera == null) {
			Camera = flixel_FlxG.camera;
		}
		if(point == null) {
			var point1 = flixel_math_FlxPoint._pool.get().set(0,0);
			point1._inPool = false;
			point = point1;
		}
		point.set_x((this._globalScreenX - Camera.x + 0.5 * Camera.width * (Camera.zoom - Camera.initialZoom)) / Camera.zoom);
		point.set_y((this._globalScreenY - Camera.y + 0.5 * Camera.height * (Camera.zoom - Camera.initialZoom)) / Camera.zoom);
		return point;
	}
	,getPositionInCameraView: function(Camera,point) {
		if(Camera == null) {
			Camera = flixel_FlxG.camera;
		}
		if(point == null) {
			var point1 = flixel_math_FlxPoint._pool.get().set(0,0);
			point1._inPool = false;
			point = point1;
		}
		point.set_x((this._globalScreenX - Camera.x) / Camera.zoom + Camera.viewOffsetX);
		point.set_y((this._globalScreenY - Camera.y) / Camera.zoom + Camera.viewOffsetY);
		return point;
	}
	,getPosition: function(point) {
		if(point == null) {
			var point1 = flixel_math_FlxPoint._pool.get().set(0,0);
			point1._inPool = false;
			point = point1;
		}
		return point.set(this.x,this.y);
	}
	,overlaps: function(ObjectOrGroup,Camera) {
		var _gthis = this;
		var result = false;
		var group = flixel_group_FlxTypedGroup.resolveGroup(ObjectOrGroup);
		if(group != null) {
			group.forEachExists(function(basic) {
				if(_gthis.overlaps(basic,Camera)) {
					result = true;
					return;
				}
			});
		} else {
			this.getPosition(flixel_input_FlxPointer._cachedPoint);
			var object = ObjectOrGroup;
			result = object.overlapsPoint(flixel_input_FlxPointer._cachedPoint,true,Camera);
		}
		return result;
	}
	,setGlobalScreenPositionUnsafe: function(newX,newY) {
		this._globalScreenX = newX / flixel_FlxG.scaleMode.scale.x | 0;
		this._globalScreenY = newY / flixel_FlxG.scaleMode.scale.y | 0;
		this.updatePositions();
	}
	,toString: function() {
		var value = this.x;
		var _this = flixel_util_LabelValuePair._pool.get();
		_this.label = "x";
		_this.value = value;
		var value = this.y;
		var _this1 = flixel_util_LabelValuePair._pool.get();
		_this1.label = "y";
		_this1.value = value;
		return flixel_util_FlxStringUtil.getDebugString([_this,_this1]);
	}
	,updatePositions: function() {
		this.getScreenPosition(flixel_FlxG.camera,flixel_input_FlxPointer._cachedPoint);
		this.screenX = flixel_input_FlxPointer._cachedPoint.x | 0;
		this.screenY = flixel_input_FlxPointer._cachedPoint.y | 0;
		this.getWorldPosition(flixel_FlxG.camera,flixel_input_FlxPointer._cachedPoint);
		this.x = flixel_input_FlxPointer._cachedPoint.x | 0;
		this.y = flixel_input_FlxPointer._cachedPoint.y | 0;
	}
	,__class__: flixel_input_FlxPointer
};
var flixel_input_FlxSwipe = function(ID,StartPosition,EndPosition,StartTimeInTicks) {
	this.ID = ID;
	this.startPosition = StartPosition;
	this.endPosition = EndPosition;
	this._startTimeInTicks = StartTimeInTicks;
	this._endTimeInTicks = flixel_FlxG.game.ticks;
};
$hxClasses["flixel.input.FlxSwipe"] = flixel_input_FlxSwipe;
flixel_input_FlxSwipe.__name__ = "flixel.input.FlxSwipe";
flixel_input_FlxSwipe.prototype = {
	ID: null
	,startPosition: null
	,endPosition: null
	,_startTimeInTicks: null
	,_endTimeInTicks: null
	,toString: function() {
		var value = this.ID;
		var _this = flixel_util_LabelValuePair._pool.get();
		_this.label = "ID";
		_this.value = value;
		var value = this.startPosition;
		var _this1 = flixel_util_LabelValuePair._pool.get();
		_this1.label = "start";
		_this1.value = value;
		var value = this.endPosition;
		var _this2 = flixel_util_LabelValuePair._pool.get();
		_this2.label = "end";
		_this2.value = value;
		var dx = this.startPosition.x - this.endPosition.x;
		var dy = this.startPosition.y - this.endPosition.y;
		var value = Math.sqrt(dx * dx + dy * dy);
		var _this3 = flixel_util_LabelValuePair._pool.get();
		_this3.label = "distance";
		_this3.value = value;
		var value = this.startPosition.angleBetween(this.endPosition);
		var _this4 = flixel_util_LabelValuePair._pool.get();
		_this4.label = "angle";
		_this4.value = value;
		var value = (this._endTimeInTicks - this._startTimeInTicks) / 1000;
		var _this5 = flixel_util_LabelValuePair._pool.get();
		_this5.label = "duration";
		_this5.value = value;
		return flixel_util_FlxStringUtil.getDebugString([_this,_this1,_this2,_this3,_this4,_this5]);
	}
	,get_distance: function() {
		var dx = this.startPosition.x - this.endPosition.x;
		var dy = this.startPosition.y - this.endPosition.y;
		return Math.sqrt(dx * dx + dy * dy);
	}
	,get_angle: function() {
		return this.startPosition.angleBetween(this.endPosition);
	}
	,get_duration: function() {
		return (this._endTimeInTicks - this._startTimeInTicks) / 1000;
	}
	,__class__: flixel_input_FlxSwipe
	,__properties__: {get_duration:"get_duration",get_angle:"get_angle",get_distance:"get_distance"}
};
var flixel_input_keyboard_FlxKey = {};
flixel_input_keyboard_FlxKey.fromString = function(s) {
	s = s.toUpperCase();
	if(Object.prototype.hasOwnProperty.call(flixel_input_keyboard_FlxKey.fromStringMap.h,s)) {
		return flixel_input_keyboard_FlxKey.fromStringMap.h[s];
	} else {
		return -1;
	}
};
flixel_input_keyboard_FlxKey.toString = function(this1) {
	return flixel_input_keyboard_FlxKey.toStringMap.h[this1];
};
var flixel_input_keyboard_FlxKeyList = function(status,keyManager) {
	flixel_input_FlxBaseKeyList.call(this,status,keyManager);
};
$hxClasses["flixel.input.keyboard.FlxKeyList"] = flixel_input_keyboard_FlxKeyList;
flixel_input_keyboard_FlxKeyList.__name__ = "flixel.input.keyboard.FlxKeyList";
flixel_input_keyboard_FlxKeyList.__super__ = flixel_input_FlxBaseKeyList;
flixel_input_keyboard_FlxKeyList.prototype = $extend(flixel_input_FlxBaseKeyList.prototype,{
	get_A: function() {
		return this.keyManager.checkStatus(65,this.status);
	}
	,get_B: function() {
		return this.keyManager.checkStatus(66,this.status);
	}
	,get_C: function() {
		return this.keyManager.checkStatus(67,this.status);
	}
	,get_D: function() {
		return this.keyManager.checkStatus(68,this.status);
	}
	,get_E: function() {
		return this.keyManager.checkStatus(69,this.status);
	}
	,get_F: function() {
		return this.keyManager.checkStatus(70,this.status);
	}
	,get_G: function() {
		return this.keyManager.checkStatus(71,this.status);
	}
	,get_H: function() {
		return this.keyManager.checkStatus(72,this.status);
	}
	,get_I: function() {
		return this.keyManager.checkStatus(73,this.status);
	}
	,get_J: function() {
		return this.keyManager.checkStatus(74,this.status);
	}
	,get_K: function() {
		return this.keyManager.checkStatus(75,this.status);
	}
	,get_L: function() {
		return this.keyManager.checkStatus(76,this.status);
	}
	,get_M: function() {
		return this.keyManager.checkStatus(77,this.status);
	}
	,get_N: function() {
		return this.keyManager.checkStatus(78,this.status);
	}
	,get_O: function() {
		return this.keyManager.checkStatus(79,this.status);
	}
	,get_P: function() {
		return this.keyManager.checkStatus(80,this.status);
	}
	,get_Q: function() {
		return this.keyManager.checkStatus(81,this.status);
	}
	,get_R: function() {
		return this.keyManager.checkStatus(82,this.status);
	}
	,get_S: function() {
		return this.keyManager.checkStatus(83,this.status);
	}
	,get_T: function() {
		return this.keyManager.checkStatus(84,this.status);
	}
	,get_U: function() {
		return this.keyManager.checkStatus(85,this.status);
	}
	,get_V: function() {
		return this.keyManager.checkStatus(86,this.status);
	}
	,get_W: function() {
		return this.keyManager.checkStatus(87,this.status);
	}
	,get_X: function() {
		return this.keyManager.checkStatus(88,this.status);
	}
	,get_Y: function() {
		return this.keyManager.checkStatus(89,this.status);
	}
	,get_Z: function() {
		return this.keyManager.checkStatus(90,this.status);
	}
	,get_ZERO: function() {
		return this.keyManager.checkStatus(48,this.status);
	}
	,get_ONE: function() {
		return this.keyManager.checkStatus(49,this.status);
	}
	,get_TWO: function() {
		return this.keyManager.checkStatus(50,this.status);
	}
	,get_THREE: function() {
		return this.keyManager.checkStatus(51,this.status);
	}
	,get_FOUR: function() {
		return this.keyManager.checkStatus(52,this.status);
	}
	,get_FIVE: function() {
		return this.keyManager.checkStatus(53,this.status);
	}
	,get_SIX: function() {
		return this.keyManager.checkStatus(54,this.status);
	}
	,get_SEVEN: function() {
		return this.keyManager.checkStatus(55,this.status);
	}
	,get_EIGHT: function() {
		return this.keyManager.checkStatus(56,this.status);
	}
	,get_NINE: function() {
		return this.keyManager.checkStatus(57,this.status);
	}
	,get_PAGEUP: function() {
		return this.keyManager.checkStatus(33,this.status);
	}
	,get_PAGEDOWN: function() {
		return this.keyManager.checkStatus(34,this.status);
	}
	,get_HOME: function() {
		return this.keyManager.checkStatus(36,this.status);
	}
	,get_END: function() {
		return this.keyManager.checkStatus(35,this.status);
	}
	,get_INSERT: function() {
		return this.keyManager.checkStatus(45,this.status);
	}
	,get_ESCAPE: function() {
		return this.keyManager.checkStatus(27,this.status);
	}
	,get_MINUS: function() {
		return this.keyManager.checkStatus(189,this.status);
	}
	,get_PLUS: function() {
		return this.keyManager.checkStatus(187,this.status);
	}
	,get_DELETE: function() {
		return this.keyManager.checkStatus(46,this.status);
	}
	,get_BACKSPACE: function() {
		return this.keyManager.checkStatus(8,this.status);
	}
	,get_LBRACKET: function() {
		return this.keyManager.checkStatus(219,this.status);
	}
	,get_RBRACKET: function() {
		return this.keyManager.checkStatus(221,this.status);
	}
	,get_BACKSLASH: function() {
		return this.keyManager.checkStatus(220,this.status);
	}
	,get_CAPSLOCK: function() {
		return this.keyManager.checkStatus(20,this.status);
	}
	,get_SEMICOLON: function() {
		return this.keyManager.checkStatus(186,this.status);
	}
	,get_QUOTE: function() {
		return this.keyManager.checkStatus(222,this.status);
	}
	,get_ENTER: function() {
		return this.keyManager.checkStatus(13,this.status);
	}
	,get_SHIFT: function() {
		return this.keyManager.checkStatus(16,this.status);
	}
	,get_COMMA: function() {
		return this.keyManager.checkStatus(188,this.status);
	}
	,get_PERIOD: function() {
		return this.keyManager.checkStatus(190,this.status);
	}
	,get_SLASH: function() {
		return this.keyManager.checkStatus(191,this.status);
	}
	,get_GRAVEACCENT: function() {
		return this.keyManager.checkStatus(192,this.status);
	}
	,get_CONTROL: function() {
		return this.keyManager.checkStatus(17,this.status);
	}
	,get_ALT: function() {
		return this.keyManager.checkStatus(18,this.status);
	}
	,get_SPACE: function() {
		return this.keyManager.checkStatus(32,this.status);
	}
	,get_UP: function() {
		return this.keyManager.checkStatus(38,this.status);
	}
	,get_DOWN: function() {
		return this.keyManager.checkStatus(40,this.status);
	}
	,get_LEFT: function() {
		return this.keyManager.checkStatus(37,this.status);
	}
	,get_RIGHT: function() {
		return this.keyManager.checkStatus(39,this.status);
	}
	,get_TAB: function() {
		return this.keyManager.checkStatus(9,this.status);
	}
	,get_PRINTSCREEN: function() {
		return this.keyManager.checkStatus(301,this.status);
	}
	,get_F1: function() {
		return this.keyManager.checkStatus(112,this.status);
	}
	,get_F2: function() {
		return this.keyManager.checkStatus(113,this.status);
	}
	,get_F3: function() {
		return this.keyManager.checkStatus(114,this.status);
	}
	,get_F4: function() {
		return this.keyManager.checkStatus(115,this.status);
	}
	,get_F5: function() {
		return this.keyManager.checkStatus(116,this.status);
	}
	,get_F6: function() {
		return this.keyManager.checkStatus(117,this.status);
	}
	,get_F7: function() {
		return this.keyManager.checkStatus(118,this.status);
	}
	,get_F8: function() {
		return this.keyManager.checkStatus(119,this.status);
	}
	,get_F9: function() {
		return this.keyManager.checkStatus(120,this.status);
	}
	,get_F10: function() {
		return this.keyManager.checkStatus(121,this.status);
	}
	,get_F11: function() {
		return this.keyManager.checkStatus(122,this.status);
	}
	,get_F12: function() {
		return this.keyManager.checkStatus(123,this.status);
	}
	,get_NUMPADONE: function() {
		return this.keyManager.checkStatus(97,this.status);
	}
	,get_NUMPADTWO: function() {
		return this.keyManager.checkStatus(98,this.status);
	}
	,get_NUMPADTHREE: function() {
		return this.keyManager.checkStatus(99,this.status);
	}
	,get_NUMPADFOUR: function() {
		return this.keyManager.checkStatus(100,this.status);
	}
	,get_NUMPADFIVE: function() {
		return this.keyManager.checkStatus(101,this.status);
	}
	,get_NUMPADSIX: function() {
		return this.keyManager.checkStatus(102,this.status);
	}
	,get_NUMPADSEVEN: function() {
		return this.keyManager.checkStatus(103,this.status);
	}
	,get_NUMPADEIGHT: function() {
		return this.keyManager.checkStatus(104,this.status);
	}
	,get_NUMPADNINE: function() {
		return this.keyManager.checkStatus(105,this.status);
	}
	,get_NUMPADZERO: function() {
		return this.keyManager.checkStatus(96,this.status);
	}
	,get_NUMPADMINUS: function() {
		return this.keyManager.checkStatus(109,this.status);
	}
	,get_NUMPADPLUS: function() {
		return this.keyManager.checkStatus(107,this.status);
	}
	,get_NUMPADPERIOD: function() {
		return this.keyManager.checkStatus(110,this.status);
	}
	,get_NUMPADMULTIPLY: function() {
		return this.keyManager.checkStatus(106,this.status);
	}
	,__class__: flixel_input_keyboard_FlxKeyList
	,__properties__: $extend(flixel_input_FlxBaseKeyList.prototype.__properties__,{get_NUMPADMULTIPLY:"get_NUMPADMULTIPLY",get_NUMPADPERIOD:"get_NUMPADPERIOD",get_NUMPADPLUS:"get_NUMPADPLUS",get_NUMPADMINUS:"get_NUMPADMINUS",get_NUMPADZERO:"get_NUMPADZERO",get_NUMPADNINE:"get_NUMPADNINE",get_NUMPADEIGHT:"get_NUMPADEIGHT",get_NUMPADSEVEN:"get_NUMPADSEVEN",get_NUMPADSIX:"get_NUMPADSIX",get_NUMPADFIVE:"get_NUMPADFIVE",get_NUMPADFOUR:"get_NUMPADFOUR",get_NUMPADTHREE:"get_NUMPADTHREE",get_NUMPADTWO:"get_NUMPADTWO",get_NUMPADONE:"get_NUMPADONE",get_F12:"get_F12",get_F11:"get_F11",get_F10:"get_F10",get_F9:"get_F9",get_F8:"get_F8",get_F7:"get_F7",get_F6:"get_F6",get_F5:"get_F5",get_F4:"get_F4",get_F3:"get_F3",get_F2:"get_F2",get_F1:"get_F1",get_PRINTSCREEN:"get_PRINTSCREEN",get_TAB:"get_TAB",get_RIGHT:"get_RIGHT",get_LEFT:"get_LEFT",get_DOWN:"get_DOWN",get_UP:"get_UP",get_SPACE:"get_SPACE",get_ALT:"get_ALT",get_CONTROL:"get_CONTROL",get_GRAVEACCENT:"get_GRAVEACCENT",get_SLASH:"get_SLASH",get_PERIOD:"get_PERIOD",get_COMMA:"get_COMMA",get_SHIFT:"get_SHIFT",get_ENTER:"get_ENTER",get_QUOTE:"get_QUOTE",get_SEMICOLON:"get_SEMICOLON",get_CAPSLOCK:"get_CAPSLOCK",get_BACKSLASH:"get_BACKSLASH",get_RBRACKET:"get_RBRACKET",get_LBRACKET:"get_LBRACKET",get_BACKSPACE:"get_BACKSPACE",get_DELETE:"get_DELETE",get_PLUS:"get_PLUS",get_MINUS:"get_MINUS",get_ESCAPE:"get_ESCAPE",get_INSERT:"get_INSERT",get_END:"get_END",get_HOME:"get_HOME",get_PAGEDOWN:"get_PAGEDOWN",get_PAGEUP:"get_PAGEUP",get_NINE:"get_NINE",get_EIGHT:"get_EIGHT",get_SEVEN:"get_SEVEN",get_SIX:"get_SIX",get_FIVE:"get_FIVE",get_FOUR:"get_FOUR",get_THREE:"get_THREE",get_TWO:"get_TWO",get_ONE:"get_ONE",get_ZERO:"get_ZERO",get_Z:"get_Z",get_Y:"get_Y",get_X:"get_X",get_W:"get_W",get_V:"get_V",get_U:"get_U",get_T:"get_T",get_S:"get_S",get_R:"get_R",get_Q:"get_Q",get_P:"get_P",get_O:"get_O",get_N:"get_N",get_M:"get_M",get_L:"get_L",get_K:"get_K",get_J:"get_J",get_I:"get_I",get_H:"get_H",get_G:"get_G",get_F:"get_F",get_E:"get_E",get_D:"get_D",get_C:"get_C",get_B:"get_B",get_A:"get_A"})
});
var flixel_input_keyboard_FlxKeyboard = function() {
	flixel_input_FlxKeyManager.call(this,function(status,keyManager) {
		return new flixel_input_keyboard_FlxKeyList(status,keyManager);
	});
	this.preventDefaultKeys = [38,40,37,39,32,9];
	var code = haxe_ds_StringMap.valueIterator(flixel_input_keyboard_FlxKey.fromStringMap.h);
	while(code.hasNext()) {
		var code1 = code.next();
		if(code1 != -2 && code1 != -1) {
			var input = new flixel_input_FlxInput(code1);
			this._keyListArray.push(input);
			this._keyListMap.h[code1] = input;
		}
	}
};
$hxClasses["flixel.input.keyboard.FlxKeyboard"] = flixel_input_keyboard_FlxKeyboard;
flixel_input_keyboard_FlxKeyboard.__name__ = "flixel.input.keyboard.FlxKeyboard";
flixel_input_keyboard_FlxKeyboard.__super__ = flixel_input_FlxKeyManager;
flixel_input_keyboard_FlxKeyboard.prototype = $extend(flixel_input_FlxKeyManager.prototype,{
	onKeyUp: function(event) {
		flixel_input_FlxKeyManager.prototype.onKeyUp.call(this,event);
	}
	,onKeyDown: function(event) {
		flixel_input_FlxKeyManager.prototype.onKeyDown.call(this,event);
	}
	,resolveKeyCode: function(e) {
		return e.keyCode;
	}
	,record: function() {
		var data = null;
		var _g = 0;
		var _g1 = this._keyListArray;
		while(_g < _g1.length) {
			var key = _g1[_g];
			++_g;
			if(key == null || (key.current == 0 || key.current == -1)) {
				continue;
			}
			if(data == null) {
				data = [];
			}
			data.push(new flixel_system_replay_CodeValuePair(key.ID,key.current));
		}
		return data;
	}
	,playback: function(Record) {
		var i = 0;
		var l = Record.length;
		while(i < l) {
			var o = Record[i++];
			var o2 = this._keyListMap.h[o.code];
			o2.current = o.value;
		}
	}
	,__class__: flixel_input_keyboard_FlxKeyboard
});
var flixel_input_mouse__$FlxMouse_GraphicCursor = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_input_mouse__$FlxMouse_GraphicCursor.preload != null) {
		this.__fromImage(flixel_input_mouse__$FlxMouse_GraphicCursor.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_input_mouse__$FlxMouse_GraphicCursor.resourceName),flixel_input_mouse__$FlxMouse_GraphicCursor.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_input_mouse__$FlxMouse_GraphicCursor.preload == null) {
				flixel_input_mouse__$FlxMouse_GraphicCursor.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.input.mouse._FlxMouse.GraphicCursor"] = flixel_input_mouse__$FlxMouse_GraphicCursor;
flixel_input_mouse__$FlxMouse_GraphicCursor.__name__ = "flixel.input.mouse._FlxMouse.GraphicCursor";
flixel_input_mouse__$FlxMouse_GraphicCursor.preload = null;
flixel_input_mouse__$FlxMouse_GraphicCursor.__super__ = openfl_display_BitmapData;
flixel_input_mouse__$FlxMouse_GraphicCursor.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_input_mouse__$FlxMouse_GraphicCursor
});
var flixel_input_mouse_FlxMouse = function(cursorContainer) {
	this._prevY = 0;
	this._prevX = 0;
	this._lastWheel = 0;
	this._lastY = 0;
	this._lastX = 0;
	this._visibleWhenFocusLost = true;
	this._wheelUsed = false;
	this._cursor = null;
	this.useSystemCursor = false;
	this.visible = true;
	this.wheel = 0;
	this.enabled = true;
	flixel_input_FlxPointer.call(this);
	this.cursorContainer = cursorContainer;
	this.cursorContainer.mouseChildren = false;
	this.cursorContainer.mouseEnabled = false;
	this._leftButton = new flixel_input_mouse_FlxMouseButton(-1);
	this._stage = openfl_Lib.get_current().stage;
	this._stage.addEventListener("mouseDown",($_=this._leftButton,$bind($_,$_.onDown)));
	this._stage.addEventListener("mouseUp",($_=this._leftButton,$bind($_,$_.onUp)));
	this._middleButton = new flixel_input_mouse_FlxMouseButton(-2);
	this._rightButton = new flixel_input_mouse_FlxMouseButton(-3);
	this._stage.addEventListener("middleMouseDown",($_=this._middleButton,$bind($_,$_.onDown)));
	this._stage.addEventListener("middleMouseUp",($_=this._middleButton,$bind($_,$_.onUp)));
	this._stage.addEventListener("rightMouseDown",($_=this._rightButton,$bind($_,$_.onDown)));
	this._stage.addEventListener("rightMouseUp",($_=this._rightButton,$bind($_,$_.onUp)));
	this._stage.addEventListener("mouseLeave",$bind(this,this.onMouseLeave));
	this._stage.addEventListener("mouseWheel",$bind(this,this.onMouseWheel));
	flixel_FlxG.signals.postGameStart.add($bind(this,this.onGameStart));
	openfl_ui_Mouse.hide();
};
$hxClasses["flixel.input.mouse.FlxMouse"] = flixel_input_mouse_FlxMouse;
flixel_input_mouse_FlxMouse.__name__ = "flixel.input.mouse.FlxMouse";
flixel_input_mouse_FlxMouse.__interfaces__ = [flixel_input_IFlxInputManager];
flixel_input_mouse_FlxMouse.__super__ = flixel_input_FlxPointer;
flixel_input_mouse_FlxMouse.prototype = $extend(flixel_input_FlxPointer.prototype,{
	enabled: null
	,wheel: null
	,cursorContainer: null
	,visible: null
	,useSystemCursor: null
	,_leftButton: null
	,_middleButton: null
	,_rightButton: null
	,_cursor: null
	,_cursorBitmapData: null
	,_wheelUsed: null
	,_visibleWhenFocusLost: null
	,_lastX: null
	,_lastY: null
	,_lastWheel: null
	,_lastLeftButtonState: null
	,_prevX: null
	,_prevY: null
	,_stage: null
	,load: function(Graphic,Scale,XOffset,YOffset) {
		if(YOffset == null) {
			YOffset = 0;
		}
		if(XOffset == null) {
			XOffset = 0;
		}
		if(Scale == null) {
			Scale = 1;
		}
		if(this._cursor != null) {
			flixel_util_FlxDestroyUtil.removeChild(this.cursorContainer,this._cursor);
		}
		if(Graphic == null) {
			Graphic = new flixel_input_mouse__$FlxMouse_GraphicCursor(0,0);
		}
		if(js_Boot.__instanceof(Graphic,Class)) {
			this._cursor = Type.createInstance(Graphic,[]);
		} else if(((Graphic) instanceof openfl_display_BitmapData)) {
			this._cursor = new openfl_display_Bitmap(Graphic);
		} else if(typeof(Graphic) == "string") {
			var id = Graphic;
			this._cursor = new openfl_display_Bitmap(openfl_utils_Assets.exists(id) ? openfl_utils_Assets.getBitmapData(id,false) : null);
		} else {
			this._cursor = new openfl_display_Bitmap(new flixel_input_mouse__$FlxMouse_GraphicCursor(0,0));
		}
		this._cursor.set_x(XOffset);
		this._cursor.set_y(YOffset);
		this._cursor.set_scaleX(Scale);
		this._cursor.set_scaleY(Scale);
		this.cursorContainer.addChild(this._cursor);
	}
	,unload: function() {
		if(this._cursor != null) {
			if(this.cursorContainer.get_visible()) {
				this.load();
			} else {
				this._cursor = flixel_util_FlxDestroyUtil.removeChild(this.cursorContainer,this._cursor);
			}
		}
	}
	,destroy: function() {
		if(this._stage != null) {
			this._stage.removeEventListener("mouseDown",($_=this._leftButton,$bind($_,$_.onDown)));
			this._stage.removeEventListener("mouseUp",($_=this._leftButton,$bind($_,$_.onUp)));
			this._stage.removeEventListener("middleMouseDown",($_=this._middleButton,$bind($_,$_.onDown)));
			this._stage.removeEventListener("middleMouseUp",($_=this._middleButton,$bind($_,$_.onUp)));
			this._stage.removeEventListener("rightMouseDown",($_=this._rightButton,$bind($_,$_.onDown)));
			this._stage.removeEventListener("rightMouseUp",($_=this._rightButton,$bind($_,$_.onUp)));
			this._stage.removeEventListener("mouseLeave",$bind(this,this.onMouseLeave));
			this._stage.removeEventListener("mouseWheel",$bind(this,this.onMouseWheel));
		}
		this.cursorContainer = null;
		this._cursor = null;
		this._leftButton = flixel_util_FlxDestroyUtil.destroy(this._leftButton);
		this._middleButton = flixel_util_FlxDestroyUtil.destroy(this._middleButton);
		this._rightButton = flixel_util_FlxDestroyUtil.destroy(this._rightButton);
		this._cursorBitmapData = flixel_util_FlxDestroyUtil.dispose(this._cursorBitmapData);
		flixel_FlxG.signals.postGameStart.remove($bind(this,this.onGameStart));
	}
	,reset: function() {
		this._leftButton.reset();
		this._middleButton.reset();
		this._rightButton.reset();
	}
	,update: function() {
		this._prevX = this.x;
		this._prevY = this.y;
		var newX = flixel_FlxG.game.get_mouseX();
		var newY = flixel_FlxG.game.get_mouseY();
		this._globalScreenX = newX / flixel_FlxG.scaleMode.scale.x | 0;
		this._globalScreenY = newY / flixel_FlxG.scaleMode.scale.y | 0;
		this.updatePositions();
		if(this.visible) {
			this.cursorContainer.set_x(flixel_FlxG.game.get_mouseX());
			this.cursorContainer.set_y(flixel_FlxG.game.get_mouseY());
		}
		this._leftButton.update();
		this._middleButton.update();
		this._rightButton.update();
		if(!this._wheelUsed) {
			this.wheel = 0;
		}
		this._wheelUsed = false;
	}
	,onFocus: function() {
		this.reset();
		this.set_useSystemCursor(this.useSystemCursor);
		this.set_visible(this._visibleWhenFocusLost);
	}
	,onFocusLost: function() {
		this._visibleWhenFocusLost = this.visible;
		if(this.visible) {
			this.set_visible(false);
		}
		openfl_ui_Mouse.show();
	}
	,onGameStart: function() {
		this.set_visible(this.visible);
	}
	,onMouseWheel: function(flashEvent) {
		if(this.enabled) {
			this._wheelUsed = true;
			this.wheel = flashEvent.delta;
		}
	}
	,onMouseLeave: function(_) {
		this._rightButton.onUp();
		this._middleButton.onUp();
	}
	,get_justMoved: function() {
		if(this._prevX == this.x) {
			return this._prevY != this.y;
		} else {
			return true;
		}
	}
	,get_pressed: function() {
		var _this = this._leftButton;
		if(_this.current != 1) {
			return _this.current == 2;
		} else {
			return true;
		}
	}
	,get_justPressed: function() {
		return this._leftButton.current == 2;
	}
	,get_justReleased: function() {
		return this._leftButton.current == -1;
	}
	,get_justPressedTimeInTicks: function() {
		return this._leftButton.justPressedTimeInTicks;
	}
	,get_pressedRight: function() {
		var _this = this._rightButton;
		if(_this.current != 1) {
			return _this.current == 2;
		} else {
			return true;
		}
	}
	,get_justPressedRight: function() {
		return this._rightButton.current == 2;
	}
	,get_justReleasedRight: function() {
		return this._rightButton.current == -1;
	}
	,get_justPressedTimeInTicksRight: function() {
		return this._rightButton.justPressedTimeInTicks;
	}
	,get_pressedMiddle: function() {
		var _this = this._middleButton;
		if(_this.current != 1) {
			return _this.current == 2;
		} else {
			return true;
		}
	}
	,get_justPressedMiddle: function() {
		return this._middleButton.current == 2;
	}
	,get_justReleasedMiddle: function() {
		return this._middleButton.current == -1;
	}
	,get_justPressedTimeInTicksMiddle: function() {
		return this._middleButton.justPressedTimeInTicks;
	}
	,showSystemCursor: function() {
		this.cursorContainer.set_visible(false);
		openfl_ui_Mouse.show();
	}
	,hideSystemCursor: function() {
		openfl_ui_Mouse.hide();
		if(this.visible) {
			this.cursorContainer.set_visible(true);
		}
	}
	,set_useSystemCursor: function(value) {
		if(value) {
			this.showSystemCursor();
		} else {
			this.hideSystemCursor();
		}
		return this.useSystemCursor = value;
	}
	,showCursor: function() {
		if(this.useSystemCursor) {
			openfl_ui_Mouse.show();
		} else {
			if(this._cursor == null) {
				this.load();
			}
			this.cursorContainer.set_visible(true);
			openfl_ui_Mouse.hide();
		}
	}
	,hideCursor: function() {
		this.cursorContainer.set_visible(false);
		openfl_ui_Mouse.hide();
	}
	,set_visible: function(value) {
		if(value) {
			this.showCursor();
		} else {
			this.hideCursor();
		}
		return this.visible = value;
	}
	,record: function() {
		if(this._lastX == this._globalScreenX && this._lastY == this._globalScreenY && this._lastLeftButtonState == this._leftButton.current && this._lastWheel == this.wheel) {
			return null;
		}
		this._lastX = this._globalScreenX;
		this._lastY = this._globalScreenY;
		this._lastLeftButtonState = this._leftButton.current;
		this._lastWheel = this.wheel;
		return new flixel_system_replay_MouseRecord(this._lastX,this._lastY,this._leftButton.current,this._lastWheel);
	}
	,playback: function(record) {
		if((this._lastLeftButtonState == 1 || this._lastLeftButtonState == 2) && (record.button == 0 || record.button == -1)) {
			this._stage.dispatchEvent(new openfl_events_MouseEvent("mouseUp",true,false,record.x,record.y));
		}
		this._lastLeftButtonState = this._leftButton.current = record.button;
		this.wheel = record.wheel;
		this._globalScreenX = record.x;
		this._globalScreenY = record.y;
		this.updatePositions();
	}
	,__class__: flixel_input_mouse_FlxMouse
	,__properties__: {get_justPressedTimeInTicksMiddle:"get_justPressedTimeInTicksMiddle",get_justReleasedMiddle:"get_justReleasedMiddle",get_justPressedMiddle:"get_justPressedMiddle",get_pressedMiddle:"get_pressedMiddle",get_justPressedTimeInTicksRight:"get_justPressedTimeInTicksRight",get_justReleasedRight:"get_justReleasedRight",get_justPressedRight:"get_justPressedRight",get_pressedRight:"get_pressedRight",get_justPressedTimeInTicks:"get_justPressedTimeInTicks",get_justReleased:"get_justReleased",get_justPressed:"get_justPressed",get_pressed:"get_pressed",get_justMoved:"get_justMoved",set_useSystemCursor:"set_useSystemCursor",set_visible:"set_visible"}
});
var flixel_input_mouse_FlxMouseButton = function(ID) {
	this.justPressedTimeInTicks = -1;
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	this.justPressedPosition = point;
	flixel_input_FlxInput.call(this,ID);
};
$hxClasses["flixel.input.mouse.FlxMouseButton"] = flixel_input_mouse_FlxMouseButton;
flixel_input_mouse_FlxMouseButton.__name__ = "flixel.input.mouse.FlxMouseButton";
flixel_input_mouse_FlxMouseButton.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_input_mouse_FlxMouseButton.getByID = function(id) {
	switch(id) {
	case -3:
		return flixel_FlxG.mouse._rightButton;
	case -2:
		return flixel_FlxG.mouse._middleButton;
	case -1:
		return flixel_FlxG.mouse._leftButton;
	}
};
flixel_input_mouse_FlxMouseButton.__super__ = flixel_input_FlxInput;
flixel_input_mouse_FlxMouseButton.prototype = $extend(flixel_input_FlxInput.prototype,{
	justPressedPosition: null
	,justPressedTimeInTicks: null
	,update: function() {
		flixel_input_FlxInput.prototype.update.call(this);
		if(this.current == 2) {
			this.justPressedPosition.set(flixel_FlxG.mouse.screenX,flixel_FlxG.mouse.screenY);
			this.justPressedTimeInTicks = flixel_FlxG.game.ticks;
		} else if(this.current == -1) {
			flixel_FlxG.swipes.push(new flixel_input_FlxSwipe(this.ID,this.justPressedPosition,flixel_FlxG.mouse.getScreenPosition(),this.justPressedTimeInTicks));
		}
	}
	,destroy: function() {
		this.justPressedPosition = flixel_util_FlxDestroyUtil.put(this.justPressedPosition);
	}
	,onDown: function(_) {
		if(flixel_FlxG.mouse.enabled) {
			this.press();
		}
	}
	,onUp: function(_) {
		if(flixel_FlxG.mouse.enabled) {
			this.release();
		}
	}
	,__class__: flixel_input_mouse_FlxMouseButton
});
var flixel_input_touch_FlxTouch = function(x,y,pointID) {
	if(pointID == null) {
		pointID = 0;
	}
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	this.justPressedTimeInTicks = -1;
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	this.justPressedPosition = point;
	this.flashPoint = new openfl_geom_Point();
	flixel_input_FlxPointer.call(this);
	this.input = new flixel_input_FlxInput(pointID);
	this.setXY(x,y);
};
$hxClasses["flixel.input.touch.FlxTouch"] = flixel_input_touch_FlxTouch;
flixel_input_touch_FlxTouch.__name__ = "flixel.input.touch.FlxTouch";
flixel_input_touch_FlxTouch.__interfaces__ = [flixel_input_IFlxInput,flixel_util_IFlxDestroyable];
flixel_input_touch_FlxTouch.__super__ = flixel_input_FlxPointer;
flixel_input_touch_FlxTouch.prototype = $extend(flixel_input_FlxPointer.prototype,{
	input: null
	,flashPoint: null
	,justPressedPosition: null
	,justPressedTimeInTicks: null
	,destroy: function() {
		this.input = null;
		this.justPressedPosition = flixel_util_FlxDestroyUtil.put(this.justPressedPosition);
		this.flashPoint = null;
	}
	,recycle: function(x,y,pointID) {
		this.setXY(x,y);
		this.input.ID = pointID;
		this.input.reset();
	}
	,update: function() {
		this.input.update();
		if(this.input.current == 2) {
			this.justPressedPosition.set(this.screenX,this.screenY);
			this.justPressedTimeInTicks = flixel_FlxG.game.ticks;
		} else if(this.input.current == -1) {
			flixel_FlxG.swipes.push(new flixel_input_FlxSwipe(this.input.ID,this.justPressedPosition,this.getScreenPosition(),this.justPressedTimeInTicks));
		}
	}
	,setXY: function(X,Y) {
		this.flashPoint.setTo(X,Y);
		this.flashPoint = flixel_FlxG.game.globalToLocal(this.flashPoint);
		this._globalScreenX = this.flashPoint.x / flixel_FlxG.scaleMode.scale.x | 0;
		this._globalScreenY = this.flashPoint.y / flixel_FlxG.scaleMode.scale.y | 0;
		this.updatePositions();
	}
	,get_touchPointID: function() {
		return this.input.ID;
	}
	,get_justReleased: function() {
		return this.input.current == -1;
	}
	,get_released: function() {
		var _this = this.input;
		if(_this.current != 0) {
			return _this.current == -1;
		} else {
			return true;
		}
	}
	,get_pressed: function() {
		var _this = this.input;
		if(_this.current != 1) {
			return _this.current == 2;
		} else {
			return true;
		}
	}
	,get_justPressed: function() {
		return this.input.current == 2;
	}
	,__class__: flixel_input_touch_FlxTouch
	,__properties__: {get_justPressed:"get_justPressed",get_pressed:"get_pressed",get_released:"get_released",get_justReleased:"get_justReleased",get_touchPointID:"get_touchPointID"}
});
var flixel_input_touch_FlxTouchManager = function() {
	this.list = [];
	this._inactiveTouches = [];
	this._touchesCache = new haxe_ds_IntMap();
	flixel_input_touch_FlxTouchManager.maxTouchPoints = openfl_ui_Multitouch.maxTouchPoints;
	openfl_ui_Multitouch.inputMode = 2;
	openfl_Lib.get_current().stage.addEventListener("touchBegin",$bind(this,this.handleTouchBegin));
	openfl_Lib.get_current().stage.addEventListener("touchEnd",$bind(this,this.handleTouchEnd));
	openfl_Lib.get_current().stage.addEventListener("touchMove",$bind(this,this.handleTouchMove));
};
$hxClasses["flixel.input.touch.FlxTouchManager"] = flixel_input_touch_FlxTouchManager;
flixel_input_touch_FlxTouchManager.__name__ = "flixel.input.touch.FlxTouchManager";
flixel_input_touch_FlxTouchManager.__interfaces__ = [flixel_input_IFlxInputManager];
flixel_input_touch_FlxTouchManager.prototype = {
	list: null
	,_inactiveTouches: null
	,_touchesCache: null
	,getByID: function(TouchPointID) {
		return this._touchesCache.h[TouchPointID];
	}
	,getFirst: function() {
		if(this.list[0] != null) {
			return this.list[0];
		} else {
			return null;
		}
	}
	,destroy: function() {
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var touch = _g1[_g];
			++_g;
			touch.destroy();
		}
		this.list = null;
		var _g = 0;
		var _g1 = this._inactiveTouches;
		while(_g < _g1.length) {
			var touch = _g1[_g];
			++_g;
			touch.destroy();
		}
		this._inactiveTouches = null;
		this._touchesCache = null;
	}
	,justStarted: function(TouchArray) {
		if(TouchArray == null) {
			TouchArray = [];
		}
		var touchLen = TouchArray.length;
		if(touchLen > 0) {
			TouchArray.splice(0,touchLen);
		}
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var touch = _g1[_g];
			++_g;
			if(touch.input.current == 2) {
				TouchArray.push(touch);
			}
		}
		return TouchArray;
	}
	,justReleased: function(TouchArray) {
		if(TouchArray == null) {
			TouchArray = [];
		}
		var touchLen = TouchArray.length;
		if(touchLen > 0) {
			TouchArray.splice(0,touchLen);
		}
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var touch = _g1[_g];
			++_g;
			if(touch.input.current == -1) {
				TouchArray.push(touch);
			}
		}
		return TouchArray;
	}
	,reset: function() {
		var key = this._touchesCache.keys();
		while(key.hasNext()) {
			var key1 = key.next();
			this._touchesCache.remove(key1);
		}
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var touch = _g1[_g];
			++_g;
			touch.input.reset();
			this._inactiveTouches.push(touch);
		}
		this.list.splice(0,this.list.length);
	}
	,handleTouchBegin: function(FlashEvent) {
		var touch = this._touchesCache.h[FlashEvent.touchPointID];
		if(touch != null) {
			touch.setXY(FlashEvent.stageX | 0,FlashEvent.stageY | 0);
		} else {
			touch = this.recycle(FlashEvent.stageX | 0,FlashEvent.stageY | 0,FlashEvent.touchPointID);
		}
		touch.input.press();
	}
	,handleTouchEnd: function(FlashEvent) {
		var touch = this._touchesCache.h[FlashEvent.touchPointID];
		if(touch != null) {
			touch.input.release();
		}
	}
	,handleTouchMove: function(FlashEvent) {
		var touch = this._touchesCache.h[FlashEvent.touchPointID];
		if(touch != null) {
			touch.setXY(FlashEvent.stageX | 0,FlashEvent.stageY | 0);
		}
	}
	,add: function(Touch1) {
		this.list.push(Touch1);
		this._touchesCache.h[Touch1.input.ID] = Touch1;
		return Touch1;
	}
	,recycle: function(X,Y,PointID) {
		if(this._inactiveTouches.length > 0) {
			var touch = this._inactiveTouches.pop();
			touch.recycle(X,Y,PointID);
			return this.add(touch);
		}
		return this.add(new flixel_input_touch_FlxTouch(X,Y,PointID));
	}
	,update: function() {
		var i = this.list.length - 1;
		var touch;
		while(i >= 0) {
			touch = this.list[i];
			var _this = touch.input;
			if((_this.current == 0 || _this.current == -1) && touch.input.current != -1) {
				touch.input.reset();
				this._touchesCache.remove(touch.input.ID);
				this.list.splice(i,1);
				this._inactiveTouches.push(touch);
			} else {
				touch.update();
			}
			--i;
		}
	}
	,onFocus: function() {
	}
	,onFocusLost: function() {
		this.reset();
	}
	,__class__: flixel_input_touch_FlxTouchManager
};
var flixel_math_FlxAngle = function() { };
$hxClasses["flixel.math.FlxAngle"] = flixel_math_FlxAngle;
flixel_math_FlxAngle.__name__ = "flixel.math.FlxAngle";
flixel_math_FlxAngle.__properties__ = {get_TO_RAD:"get_TO_RAD",get_TO_DEG:"get_TO_DEG"};
flixel_math_FlxAngle.wrapAngle = function(angle) {
	if(angle > 180) {
		angle = flixel_math_FlxAngle.wrapAngle(angle - 360);
	} else if(angle < -180) {
		angle = flixel_math_FlxAngle.wrapAngle(angle + 360);
	}
	return angle;
};
flixel_math_FlxAngle.asDegrees = function(radians) {
	return radians * (180 / Math.PI);
};
flixel_math_FlxAngle.asRadians = function(degrees) {
	return degrees * (Math.PI / 180);
};
flixel_math_FlxAngle.angleBetween = function(SpriteA,SpriteB,AsDegrees) {
	if(AsDegrees == null) {
		AsDegrees = false;
	}
	var dx = SpriteB.x + SpriteB.origin.x - (SpriteA.x + SpriteA.origin.x);
	var dy = SpriteB.y + SpriteB.origin.y - (SpriteA.y + SpriteA.origin.y);
	if(AsDegrees) {
		return Math.atan2(dy,dx) * (180 / Math.PI);
	} else {
		return Math.atan2(dy,dx);
	}
};
flixel_math_FlxAngle.angleBetweenPoint = function(Sprite,Target,AsDegrees) {
	if(AsDegrees == null) {
		AsDegrees = false;
	}
	var dx = Target.x - (Sprite.x + Sprite.origin.x);
	var dy = Target.y - (Sprite.y + Sprite.origin.y);
	if(Target._weak) {
		Target.put();
	}
	if(AsDegrees) {
		return Math.atan2(dy,dx) * (180 / Math.PI);
	} else {
		return Math.atan2(dy,dx);
	}
};
flixel_math_FlxAngle.angleBetweenMouse = function(Object1,AsDegrees) {
	if(AsDegrees == null) {
		AsDegrees = false;
	}
	if(Object1 == null) {
		return 0;
	}
	var p = Object1.getScreenPosition();
	var dx = flixel_FlxG.mouse.screenX - p.x;
	var dy = flixel_FlxG.mouse.screenY - p.y;
	p.put();
	if(AsDegrees) {
		return Math.atan2(dy,dx) * (180 / Math.PI);
	} else {
		return Math.atan2(dy,dx);
	}
};
flixel_math_FlxAngle.angleBetweenTouch = function(Object1,Touch1,AsDegrees) {
	if(AsDegrees == null) {
		AsDegrees = false;
	}
	var p = Object1.getScreenPosition();
	var dx = Touch1.screenX - p.x;
	var dy = Touch1.screenY - p.y;
	p.put();
	if(AsDegrees) {
		return Math.atan2(dy,dx) * (180 / Math.PI);
	} else {
		return Math.atan2(dy,dx);
	}
};
flixel_math_FlxAngle.angleFromFacing = function(FacingBitmask,AsDegrees) {
	if(AsDegrees == null) {
		AsDegrees = false;
	}
	var degrees;
	switch(FacingBitmask) {
	case 1:
		degrees = 180;
		break;
	case 16:
		degrees = 0;
		break;
	case 256:
		degrees = -90;
		break;
	case 4096:
		degrees = 90;
		break;
	default:
		var f = FacingBitmask;
		if(f == 257) {
			degrees = -135;
		} else {
			var f = FacingBitmask;
			if(f == 272) {
				degrees = -45;
			} else {
				var f = FacingBitmask;
				if(f == 4097) {
					degrees = 135;
				} else {
					var f = FacingBitmask;
					degrees = f == 4112 ? 45 : 0;
				}
			}
		}
	}
	if(AsDegrees) {
		return degrees;
	} else {
		return degrees * (Math.PI / 180);
	}
};
flixel_math_FlxAngle.getCartesianCoords = function(Radius,Angle,point) {
	var p = point;
	if(p == null) {
		var point = flixel_math_FlxPoint._pool.get().set(0,0);
		point._inPool = false;
		p = point;
	}
	p.set_x(Radius * Math.cos(Angle * (Math.PI / 180)));
	p.set_y(Radius * Math.sin(Angle * (Math.PI / 180)));
	return p;
};
flixel_math_FlxAngle.getPolarCoords = function(X,Y,point) {
	var p = point;
	if(p == null) {
		var point = flixel_math_FlxPoint._pool.get().set(0,0);
		point._inPool = false;
		p = point;
	}
	p.set_x(Math.sqrt(X * X + Y * Y));
	p.set_y(Math.atan2(Y,X) * (180 / Math.PI));
	return p;
};
flixel_math_FlxAngle.get_TO_DEG = function() {
	return 180 / Math.PI;
};
flixel_math_FlxAngle.get_TO_RAD = function() {
	return Math.PI / 180;
};
var flixel_math_FlxMath = function() { };
$hxClasses["flixel.math.FlxMath"] = flixel_math_FlxMath;
flixel_math_FlxMath.__name__ = "flixel.math.FlxMath";
flixel_math_FlxMath.roundDecimal = function(Value,Precision) {
	var mult = 1;
	var _g = 0;
	var _g1 = Precision;
	while(_g < _g1) {
		var i = _g++;
		mult *= 10;
	}
	return Math.round(Value * mult) / mult;
};
flixel_math_FlxMath.bound = function(Value,Min,Max) {
	var lowerBound = Min != null && Value < Min ? Min : Value;
	if(Max != null && lowerBound > Max) {
		return Max;
	} else {
		return lowerBound;
	}
};
flixel_math_FlxMath.lerp = function(a,b,ratio) {
	return a + ratio * (b - a);
};
flixel_math_FlxMath.inBounds = function(Value,Min,Max) {
	if(Min == null || Value >= Min) {
		if(Max != null) {
			return Value <= Max;
		} else {
			return true;
		}
	} else {
		return false;
	}
};
flixel_math_FlxMath.isOdd = function(n) {
	return ((n | 0) & 1) != 0;
};
flixel_math_FlxMath.isEven = function(n) {
	return ((n | 0) & 1) == 0;
};
flixel_math_FlxMath.numericComparison = function(a,b) {
	if(b > a) {
		return -1;
	} else if(a > b) {
		return 1;
	}
	return 0;
};
flixel_math_FlxMath.pointInCoordinates = function(pointX,pointY,rectX,rectY,rectWidth,rectHeight) {
	if(pointX >= rectX && pointX <= rectX + rectWidth) {
		if(pointY >= rectY && pointY <= rectY + rectHeight) {
			return true;
		}
	}
	return false;
};
flixel_math_FlxMath.pointInFlxRect = function(pointX,pointY,rect) {
	if(pointX >= rect.x && pointX <= rect.x + rect.width && pointY >= rect.y) {
		return pointY <= rect.y + rect.height;
	} else {
		return false;
	}
};
flixel_math_FlxMath.mouseInFlxRect = function(useWorldCoords,rect) {
	if(rect == null) {
		return true;
	}
	if(useWorldCoords) {
		return flixel_math_FlxMath.pointInFlxRect(Math.floor(flixel_FlxG.mouse.x),Math.floor(flixel_FlxG.mouse.y),rect);
	} else {
		return flixel_math_FlxMath.pointInFlxRect(flixel_FlxG.mouse.screenX,flixel_FlxG.mouse.screenY,rect);
	}
};
flixel_math_FlxMath.pointInRectangle = function(pointX,pointY,rect) {
	if(pointX >= rect.x && pointX <= rect.get_right() && pointY >= rect.y) {
		return pointY <= rect.get_bottom();
	} else {
		return false;
	}
};
flixel_math_FlxMath.maxAdd = function(value,amount,max,min) {
	if(min == null) {
		min = 0;
	}
	value += amount;
	if(value > max) {
		value = max;
	} else if(value <= min) {
		value = min;
	}
	return value;
};
flixel_math_FlxMath.wrap = function(value,min,max) {
	var range = max - min + 1;
	if(value < min) {
		value += range * ((min - value) / range + 1 | 0);
	}
	return min + (value - min) % range;
};
flixel_math_FlxMath.remapToRange = function(value,start1,stop1,start2,stop2) {
	return start2 + (value - start1) * ((stop2 - start2) / (stop1 - start1));
};
flixel_math_FlxMath.dotProduct = function(ax,ay,bx,by) {
	return ax * bx + ay * by;
};
flixel_math_FlxMath.vectorLength = function(dx,dy) {
	return Math.sqrt(dx * dx + dy * dy);
};
flixel_math_FlxMath.distanceBetween = function(SpriteA,SpriteB) {
	var dx = SpriteA.x + SpriteA.origin.x - (SpriteB.x + SpriteB.origin.x);
	var dy = SpriteA.y + SpriteA.origin.y - (SpriteB.y + SpriteB.origin.y);
	return Math.sqrt(dx * dx + dy * dy) | 0;
};
flixel_math_FlxMath.isDistanceWithin = function(SpriteA,SpriteB,Distance,IncludeEqual) {
	if(IncludeEqual == null) {
		IncludeEqual = false;
	}
	var dx = SpriteA.x + SpriteA.origin.x - (SpriteB.x + SpriteB.origin.x);
	var dy = SpriteA.y + SpriteA.origin.y - (SpriteB.y + SpriteB.origin.y);
	if(IncludeEqual) {
		return dx * dx + dy * dy <= Distance * Distance;
	} else {
		return dx * dx + dy * dy < Distance * Distance;
	}
};
flixel_math_FlxMath.distanceToPoint = function(Sprite,Target) {
	var dx = Sprite.x + Sprite.origin.x - Target.x;
	var dy = Sprite.y + Sprite.origin.y - Target.y;
	if(Target._weak) {
		Target.put();
	}
	return Math.sqrt(dx * dx + dy * dy) | 0;
};
flixel_math_FlxMath.isDistanceToPointWithin = function(Sprite,Target,Distance,IncludeEqual) {
	if(IncludeEqual == null) {
		IncludeEqual = false;
	}
	var dx = Sprite.x + Sprite.origin.x - Target.x;
	var dy = Sprite.y + Sprite.origin.y - Target.y;
	if(Target._weak) {
		Target.put();
	}
	if(IncludeEqual) {
		return dx * dx + dy * dy <= Distance * Distance;
	} else {
		return dx * dx + dy * dy < Distance * Distance;
	}
};
flixel_math_FlxMath.distanceToMouse = function(Sprite) {
	var dx = Sprite.x + Sprite.origin.x - flixel_FlxG.mouse.screenX;
	var dy = Sprite.y + Sprite.origin.y - flixel_FlxG.mouse.screenY;
	return Math.sqrt(dx * dx + dy * dy) | 0;
};
flixel_math_FlxMath.isDistanceToMouseWithin = function(Sprite,Distance,IncludeEqual) {
	if(IncludeEqual == null) {
		IncludeEqual = false;
	}
	var dx = Sprite.x + Sprite.origin.x - flixel_FlxG.mouse.screenX;
	var dy = Sprite.y + Sprite.origin.y - flixel_FlxG.mouse.screenY;
	if(IncludeEqual) {
		return dx * dx + dy * dy <= Distance * Distance;
	} else {
		return dx * dx + dy * dy < Distance * Distance;
	}
};
flixel_math_FlxMath.distanceToTouch = function(Sprite,Touch1) {
	var dx = Sprite.x + Sprite.origin.x - Touch1.screenX;
	var dy = Sprite.y + Sprite.origin.y - Touch1.screenY;
	return Math.sqrt(dx * dx + dy * dy) | 0;
};
flixel_math_FlxMath.isDistanceToTouchWithin = function(Sprite,Touch1,Distance,IncludeEqual) {
	if(IncludeEqual == null) {
		IncludeEqual = false;
	}
	var dx = Sprite.x + Sprite.origin.x - Touch1.screenX;
	var dy = Sprite.y + Sprite.origin.y - Touch1.screenY;
	if(IncludeEqual) {
		return dx * dx + dy * dy <= Distance * Distance;
	} else {
		return dx * dx + dy * dy < Distance * Distance;
	}
};
flixel_math_FlxMath.getDecimals = function(n) {
	var helperArray = (n == null ? "null" : "" + n).split(".");
	var decimals = 0;
	if(helperArray.length > 1) {
		decimals = helperArray[1].length;
	}
	return decimals;
};
flixel_math_FlxMath.equal = function(aValueA,aValueB,aDiff) {
	if(aDiff == null) {
		aDiff = 0.0000001;
	}
	return Math.abs(aValueA - aValueB) <= aDiff;
};
flixel_math_FlxMath.signOf = function(n) {
	if(n < 0) {
		return -1;
	} else {
		return 1;
	}
};
flixel_math_FlxMath.sameSign = function(a,b) {
	return (a < 0 ? -1 : 1) == (b < 0 ? -1 : 1);
};
flixel_math_FlxMath.fastSin = function(n) {
	n *= 0.3183098862;
	if(n > 1) {
		n -= Math.ceil(n) >> 1 << 1;
	} else if(n < -1) {
		n += Math.ceil(-n) >> 1 << 1;
	}
	if(n > 0) {
		return n * (3.1 + n * (0.5 + n * (-7.2 + n * 3.6)));
	} else {
		return n * (3.1 - n * (0.5 + n * (7.2 + n * 3.6)));
	}
};
flixel_math_FlxMath.fastCos = function(n) {
	var n1 = n + 1.570796327;
	n1 *= 0.3183098862;
	if(n1 > 1) {
		n1 -= Math.ceil(n1) >> 1 << 1;
	} else if(n1 < -1) {
		n1 += Math.ceil(-n1) >> 1 << 1;
	}
	if(n1 > 0) {
		return n1 * (3.1 + n1 * (0.5 + n1 * (-7.2 + n1 * 3.6)));
	} else {
		return n1 * (3.1 - n1 * (0.5 + n1 * (7.2 + n1 * 3.6)));
	}
};
flixel_math_FlxMath.sinh = function(n) {
	return (Math.exp(n) - Math.exp(-n)) / 2;
};
flixel_math_FlxMath.maxInt = function(a,b) {
	if(a > b) {
		return a;
	} else {
		return b;
	}
};
flixel_math_FlxMath.minInt = function(a,b) {
	if(a > b) {
		return b;
	} else {
		return a;
	}
};
flixel_math_FlxMath.absInt = function(n) {
	if(n > 0) {
		return n;
	} else {
		return -n;
	}
};
var flixel_math_FlxMatrix = function(a,b,c,d,tx,ty) {
	openfl_geom_Matrix.call(this,a,b,c,d,tx,ty);
};
$hxClasses["flixel.math.FlxMatrix"] = flixel_math_FlxMatrix;
flixel_math_FlxMatrix.__name__ = "flixel.math.FlxMatrix";
flixel_math_FlxMatrix.__super__ = openfl_geom_Matrix;
flixel_math_FlxMatrix.prototype = $extend(openfl_geom_Matrix.prototype,{
	rotateWithTrig: function(cos,sin) {
		var a1 = this.a * cos - this.b * sin;
		this.b = this.a * sin + this.b * cos;
		this.a = a1;
		var c1 = this.c * cos - this.d * sin;
		this.d = this.c * sin + this.d * cos;
		this.c = c1;
		var tx1 = this.tx * cos - this.ty * sin;
		this.ty = this.tx * sin + this.ty * cos;
		this.tx = tx1;
		return this;
	}
	,rotateBy180: function() {
		this.setTo(-this.a,-this.b,-this.c,-this.d,-this.tx,-this.ty);
		return this;
	}
	,rotateByPositive90: function() {
		this.setTo(-this.b,this.a,-this.d,this.c,-this.ty,this.tx);
		return this;
	}
	,rotateByNegative90: function() {
		this.setTo(this.b,-this.a,this.d,-this.c,this.ty,-this.tx);
		return this;
	}
	,transformX: function(px,py) {
		return px * this.a + py * this.c + this.tx;
	}
	,transformY: function(px,py) {
		return px * this.b + py * this.d + this.ty;
	}
	,__class__: flixel_math_FlxMatrix
});
var flixel_math_FlxCallbackPoint = function(setXCallback,setYCallback,setXYCallback) {
	flixel_math_FlxPoint.call(this);
	this._setXCallback = setXCallback;
	this._setYCallback = setXYCallback;
	this._setXYCallback = setXYCallback;
	if(this._setXCallback != null) {
		if(this._setYCallback == null) {
			this._setYCallback = setXCallback;
		}
		if(this._setXYCallback == null) {
			this._setXYCallback = setXCallback;
		}
	}
};
$hxClasses["flixel.math.FlxCallbackPoint"] = flixel_math_FlxCallbackPoint;
flixel_math_FlxCallbackPoint.__name__ = "flixel.math.FlxCallbackPoint";
flixel_math_FlxCallbackPoint.__super__ = flixel_math_FlxPoint;
flixel_math_FlxCallbackPoint.prototype = $extend(flixel_math_FlxPoint.prototype,{
	_setXCallback: null
	,_setYCallback: null
	,_setXYCallback: null
	,set: function(X,Y) {
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		flixel_math_FlxPoint.prototype.set.call(this,X,Y);
		if(this._setXYCallback != null) {
			this._setXYCallback(this);
		}
		return this;
	}
	,set_x: function(Value) {
		flixel_math_FlxPoint.prototype.set_x.call(this,Value);
		if(this._setXCallback != null) {
			this._setXCallback(this);
		}
		return Value;
	}
	,set_y: function(Value) {
		flixel_math_FlxPoint.prototype.set_y.call(this,Value);
		if(this._setYCallback != null) {
			this._setYCallback(this);
		}
		return Value;
	}
	,destroy: function() {
		flixel_math_FlxPoint.prototype.destroy.call(this);
		this._setXCallback = null;
		this._setYCallback = null;
		this._setXYCallback = null;
	}
	,put: function() {
	}
	,__class__: flixel_math_FlxCallbackPoint
});
var flixel_math_FlxVector = {};
flixel_math_FlxVector.__properties__ = {get_ly:"get_ly",get_lx:"get_lx",get_ry:"get_ry",get_rx:"get_rx",set_radians:"set_radians",get_radians:"get_radians",set_degrees:"set_degrees",get_degrees:"get_degrees",get_lengthSquared:"get_lengthSquared",set_length:"set_length",get_length:"get_length",get_dy:"get_dy",get_dx:"get_dx",set_y:"set_y",get_y:"get_y",set_x:"set_x",get_x:"get_x",get_pool:"get_pool"};
flixel_math_FlxVector.get = function(x,y) {
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	var X = x;
	var Y = y;
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	var point = flixel_math_FlxPoint._pool.get().set(X,Y);
	point._inPool = false;
	return point;
};
flixel_math_FlxVector.weak = function(x,y) {
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	var X = x;
	var Y = y;
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	var X1 = X;
	var Y1 = Y;
	if(Y1 == null) {
		Y1 = 0;
	}
	if(X1 == null) {
		X1 = 0;
	}
	var point = flixel_math_FlxPoint._pool.get().set(X1,Y1);
	point._inPool = false;
	var point1 = point;
	point1._weak = true;
	return point1;
};
flixel_math_FlxVector._new = function(x,y) {
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	var this1 = new flixel_math_FlxPoint(x,y);
	return this1;
};
flixel_math_FlxVector.set = function(this1,x,y) {
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	return this1.set(x,y);
};
flixel_math_FlxVector.add = function(this1,x,y) {
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	var X = x;
	var Y = y;
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	var _g = this1;
	_g.set_x(_g.x + X);
	var _g = this1;
	_g.set_y(_g.y + Y);
	return this1;
};
flixel_math_FlxVector.addPoint = function(this1,point) {
	return this1.addPoint(point);
};
flixel_math_FlxVector.subtract = function(this1,x,y) {
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	var X = x;
	var Y = y;
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	var _g = this1;
	_g.set_x(_g.x - X);
	var _g = this1;
	_g.set_y(_g.y - Y);
	return this1;
};
flixel_math_FlxVector.subtractPoint = function(this1,point) {
	return this1.subtractPoint(point);
};
flixel_math_FlxVector.scale = function(this1,k) {
	return this1.scale(k);
};
flixel_math_FlxVector.scaleNew = function(this1,k) {
	return flixel_math_FlxVector.clone(this1).scale(k);
};
flixel_math_FlxVector.addNew = function(this1,v) {
	return flixel_math_FlxVector.clone(this1).addPoint(v);
};
flixel_math_FlxVector.subtractNew = function(this1,v) {
	return flixel_math_FlxVector.clone(this1).subtractPoint(v);
};
flixel_math_FlxVector.copyFrom = function(this1,point) {
	this1.set_x(point.x);
	this1.set_y(point.y);
	if(point._weak) {
		point.put();
	}
	return this1;
};
flixel_math_FlxVector.copyFromFlash = function(this1,flashPoint) {
	this1.set_x(flashPoint.x);
	this1.set_y(flashPoint.y);
	return this1;
};
flixel_math_FlxVector.floor = function(this1) {
	this1.set_x(Math.floor(this1.x));
	this1.set_y(Math.floor(this1.y));
	return this1;
};
flixel_math_FlxVector.ceil = function(this1) {
	this1.set_x(Math.ceil(this1.x));
	this1.set_y(Math.ceil(this1.y));
	return this1;
};
flixel_math_FlxVector.round = function(this1) {
	this1.set_x(Math.round(this1.x));
	this1.set_y(Math.round(this1.y));
	return this1;
};
flixel_math_FlxVector.rotate = function(this1,pivot,angle) {
	return this1.rotate(pivot,angle);
};
flixel_math_FlxVector.transform = function(this1,matrix) {
	var x1 = this1.x * matrix.a + this1.y * matrix.c + matrix.tx;
	var y1 = this1.x * matrix.b + this1.y * matrix.d + matrix.ty;
	return this1.set(x1,y1);
};
flixel_math_FlxVector.dotProduct = function(this1,v) {
	var dp = this1.x * v.x + this1.y * v.y;
	if(v._weak) {
		v.put();
	}
	return dp;
};
flixel_math_FlxVector.dotProductWeak = function(this1,v) {
	return this1.x * v.x + this1.y * v.y;
};
flixel_math_FlxVector.dotProdWithNormalizing = function(this1,v) {
	var normalized = flixel_math_FlxVector.normalize(flixel_math_FlxVector.clone(v,flixel_math_FlxVector._vector1));
	if(v._weak) {
		v.put();
	}
	return this1.x * normalized.x + this1.y * normalized.y;
};
flixel_math_FlxVector.isPerpendicular = function(this1,v) {
	var dp = this1.x * v.x + this1.y * v.y;
	if(v._weak) {
		v.put();
	}
	return Math.abs(dp) < 9.9999999999999984e-015;
};
flixel_math_FlxVector.crossProductLength = function(this1,v) {
	var cp = this1.x * v.y - this1.y * v.x;
	if(v._weak) {
		v.put();
	}
	return cp;
};
flixel_math_FlxVector.crossProductLengthWeak = function(this1,v) {
	return this1.x * v.y - this1.y * v.x;
};
flixel_math_FlxVector.isParallel = function(this1,v) {
	var p = Math.abs(this1.x * v.y - this1.y * v.x) < 9.9999999999999984e-015;
	if(v._weak) {
		v.put();
	}
	return p;
};
flixel_math_FlxVector.isParallelWeak = function(this1,v) {
	return Math.abs(this1.x * v.y - this1.y * v.x) < 9.9999999999999984e-015;
};
flixel_math_FlxVector.isZero = function(this1) {
	if(Math.abs(this1.x) < 0.0000001) {
		return Math.abs(this1.y) < 0.0000001;
	} else {
		return false;
	}
};
flixel_math_FlxVector.zero = function(this1) {
	this1.set_x(this1.set_y(0));
	return this1;
};
flixel_math_FlxVector.normalize = function(this1) {
	if(Math.abs(this1.x) < 0.0000001 && Math.abs(this1.y) < 0.0000001) {
		return this1;
	}
	return this1.scale(1 / Math.sqrt(this1.x * this1.x + this1.y * this1.y));
};
flixel_math_FlxVector.isNormalized = function(this1) {
	return Math.abs(this1.x * this1.x + this1.y * this1.y - 1) < 9.9999999999999984e-015;
};
flixel_math_FlxVector.rotateByRadians = function(this1,rads) {
	var s = Math.sin(rads);
	var c = Math.cos(rads);
	var tempX = this1.x;
	this1.set_x(tempX * c - this1.y * s);
	this1.set_y(tempX * s + this1.y * c);
	return this1;
};
flixel_math_FlxVector.rotateByDegrees = function(this1,degs) {
	var rads = degs * (Math.PI / 180);
	var s = Math.sin(rads);
	var c = Math.cos(rads);
	var tempX = this1.x;
	this1.set_x(tempX * c - this1.y * s);
	this1.set_y(tempX * s + this1.y * c);
	return this1;
};
flixel_math_FlxVector.rotateWithTrig = function(this1,sin,cos) {
	var tempX = this1.x;
	this1.set_x(tempX * cos - this1.y * sin);
	this1.set_y(tempX * sin + this1.y * cos);
	return this1;
};
flixel_math_FlxVector.rightNormal = function(this1,vec) {
	if(vec == null) {
		var X = 0;
		var Y = 0;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		vec = point;
	}
	var x = -this1.y;
	var y = this1.x;
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	vec.set(x,y);
	return vec;
};
flixel_math_FlxVector.leftNormal = function(this1,vec) {
	if(vec == null) {
		var X = 0;
		var Y = 0;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		vec = point;
	}
	var x = this1.y;
	var y = -this1.x;
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	vec.set(x,y);
	return vec;
};
flixel_math_FlxVector.negate = function(this1) {
	var _g = this1;
	_g.set_x(_g.x * -1);
	var _g = this1;
	_g.set_y(_g.y * -1);
	return this1;
};
flixel_math_FlxVector.negateNew = function(this1) {
	var this2 = flixel_math_FlxVector.clone(this1);
	var _g = this2;
	_g.set_x(_g.x * -1);
	var _g = this2;
	_g.set_y(_g.y * -1);
	return this2;
};
flixel_math_FlxVector.projectTo = function(this1,v,proj) {
	var dp = this1.x * v.x + this1.y * v.y;
	var lenSq = v.x * v.x + v.y * v.y;
	if(proj == null) {
		var X = 0;
		var Y = 0;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		proj = point;
	}
	var x = dp * v.x / lenSq;
	var y = dp * v.y / lenSq;
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	proj.set(x,y);
	if(v._weak) {
		v.put();
	}
	return proj;
};
flixel_math_FlxVector.projectToNormalized = function(this1,v,proj) {
	var proj1 = proj;
	var dp = this1.x * v.x + this1.y * v.y;
	if(proj1 == null) {
		var X = 0;
		var Y = 0;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		proj1 = point;
	}
	var x = dp * v.x;
	var y = dp * v.y;
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	proj = proj1.set(x,y);
	if(v._weak) {
		v.put();
	}
	return proj;
};
flixel_math_FlxVector.projectToNormalizedWeak = function(this1,v,proj) {
	var dp = this1.x * v.x + this1.y * v.y;
	if(proj == null) {
		var X = 0;
		var Y = 0;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		proj = point;
	}
	var x = dp * v.x;
	var y = dp * v.y;
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	return proj.set(x,y);
};
flixel_math_FlxVector.perpProduct = function(this1,v) {
	var pp = this1.y * v.x + -this1.x * v.y;
	if(v._weak) {
		v.put();
	}
	return pp;
};
flixel_math_FlxVector.perpProductWeak = function(this1,v) {
	return this1.y * v.x + -this1.x * v.y;
};
flixel_math_FlxVector.ratio = function(this1,a,b,v) {
	var r;
	if(Math.abs(this1.x * v.y - this1.y * v.x) < 9.9999999999999984e-015) {
		r = NaN;
	} else if(this1.x * this1.x + this1.y * this1.y < 9.9999999999999984e-015 || v.x * v.x + v.y * v.y < 9.9999999999999984e-015) {
		r = NaN;
	} else {
		flixel_math_FlxVector._vector1 = flixel_math_FlxVector.clone(b,flixel_math_FlxVector._vector1);
		var _this = flixel_math_FlxVector._vector1;
		var _g = _this;
		_g.set_x(_g.x - a.x);
		var _g = _this;
		_g.set_y(_g.y - a.y);
		var this2 = flixel_math_FlxVector._vector1;
		r = (this2.y * v.x + -this2.x * v.y) / (this1.y * v.x + -this1.x * v.y);
	}
	if(a._weak) {
		a.put();
	}
	if(b._weak) {
		b.put();
	}
	if(v._weak) {
		v.put();
	}
	return r;
};
flixel_math_FlxVector.ratioWeak = function(this1,a,b,v) {
	if(Math.abs(this1.x * v.y - this1.y * v.x) < 9.9999999999999984e-015) {
		return NaN;
	}
	if(this1.x * this1.x + this1.y * this1.y < 9.9999999999999984e-015 || v.x * v.x + v.y * v.y < 9.9999999999999984e-015) {
		return NaN;
	}
	flixel_math_FlxVector._vector1 = flixel_math_FlxVector.clone(b,flixel_math_FlxVector._vector1);
	var _this = flixel_math_FlxVector._vector1;
	var _g = _this;
	_g.set_x(_g.x - a.x);
	var _g = _this;
	_g.set_y(_g.y - a.y);
	var this2 = flixel_math_FlxVector._vector1;
	return (this2.y * v.x + -this2.x * v.y) / (this1.y * v.x + -this1.x * v.y);
};
flixel_math_FlxVector.findIntersection = function(this1,a,b,v,intersection) {
	var t;
	if(Math.abs(this1.x * v.y - this1.y * v.x) < 9.9999999999999984e-015) {
		t = NaN;
	} else if(this1.x * this1.x + this1.y * this1.y < 9.9999999999999984e-015 || v.x * v.x + v.y * v.y < 9.9999999999999984e-015) {
		t = NaN;
	} else {
		flixel_math_FlxVector._vector1 = flixel_math_FlxVector.clone(b,flixel_math_FlxVector._vector1);
		var _this = flixel_math_FlxVector._vector1;
		var _g = _this;
		_g.set_x(_g.x - a.x);
		var _g = _this;
		_g.set_y(_g.y - a.y);
		var this2 = flixel_math_FlxVector._vector1;
		t = (this2.y * v.x + -this2.x * v.y) / (this1.y * v.x + -this1.x * v.y);
	}
	if(intersection == null) {
		var X = 0;
		var Y = 0;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		intersection = point;
	}
	if(isNaN(t)) {
		var x = NaN;
		var y = NaN;
		if(y == null) {
			y = 0;
		}
		if(x == null) {
			x = 0;
		}
		intersection.set(x,y);
	} else {
		var x = a.x + t * this1.x;
		var y = a.y + t * this1.y;
		if(y == null) {
			y = 0;
		}
		if(x == null) {
			x = 0;
		}
		intersection.set(x,y);
	}
	if(a._weak) {
		a.put();
	}
	if(b._weak) {
		b.put();
	}
	if(v._weak) {
		v.put();
	}
	return intersection;
};
flixel_math_FlxVector.findIntersectionInBounds = function(this1,a,b,v,intersection) {
	if(intersection == null) {
		var X = 0;
		var Y = 0;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		intersection = point;
	}
	var t1;
	if(Math.abs(this1.x * v.y - this1.y * v.x) < 9.9999999999999984e-015) {
		t1 = NaN;
	} else if(this1.x * this1.x + this1.y * this1.y < 9.9999999999999984e-015 || v.x * v.x + v.y * v.y < 9.9999999999999984e-015) {
		t1 = NaN;
	} else {
		flixel_math_FlxVector._vector1 = flixel_math_FlxVector.clone(b,flixel_math_FlxVector._vector1);
		var _this = flixel_math_FlxVector._vector1;
		var _g = _this;
		_g.set_x(_g.x - a.x);
		var _g = _this;
		_g.set_y(_g.y - a.y);
		var this2 = flixel_math_FlxVector._vector1;
		t1 = (this2.y * v.x + -this2.x * v.y) / (this1.y * v.x + -this1.x * v.y);
	}
	var t2;
	if(Math.abs(v.x * this1.y - v.y * this1.x) < 9.9999999999999984e-015) {
		t2 = NaN;
	} else if(v.x * v.x + v.y * v.y < 9.9999999999999984e-015 || this1.x * this1.x + this1.y * this1.y < 9.9999999999999984e-015) {
		t2 = NaN;
	} else {
		flixel_math_FlxVector._vector1 = flixel_math_FlxVector.clone(a,flixel_math_FlxVector._vector1);
		var _this = flixel_math_FlxVector._vector1;
		var _g = _this;
		_g.set_x(_g.x - b.x);
		var _g = _this;
		_g.set_y(_g.y - b.y);
		var this2 = flixel_math_FlxVector._vector1;
		t2 = (this2.y * this1.x + -this2.x * this1.y) / (v.y * this1.x + -v.x * this1.y);
	}
	if(!isNaN(t1) && !isNaN(t2) && t1 > 0 && t1 <= 1 && t2 > 0 && t2 <= 1) {
		var x = a.x + t1 * this1.x;
		var y = a.y + t1 * this1.y;
		if(y == null) {
			y = 0;
		}
		if(x == null) {
			x = 0;
		}
		intersection.set(x,y);
	} else {
		var x = NaN;
		var y = NaN;
		if(y == null) {
			y = 0;
		}
		if(x == null) {
			x = 0;
		}
		intersection.set(x,y);
	}
	if(a._weak) {
		a.put();
	}
	if(b._weak) {
		b.put();
	}
	if(v._weak) {
		v.put();
	}
	return intersection;
};
flixel_math_FlxVector.truncate = function(this1,max) {
	var l = Math.min(max,Math.sqrt(this1.x * this1.x + this1.y * this1.y));
	if(!(Math.abs(this1.x) < 0.0000001 && Math.abs(this1.y) < 0.0000001)) {
		var a = flixel_math_FlxVector.get_radians(this1);
		this1.set_x(l * Math.cos(a));
		this1.set_y(l * Math.sin(a));
	}
	return this1;
};
flixel_math_FlxVector.radiansBetween = function(this1,v) {
	var rads = Math.acos((this1.x * v.x + this1.y * v.y) / (Math.sqrt(this1.x * this1.x + this1.y * this1.y) * Math.sqrt(v.x * v.x + v.y * v.y)));
	if(v._weak) {
		v.put();
	}
	return rads;
};
flixel_math_FlxVector.degreesBetween = function(this1,v) {
	var rads = Math.acos((this1.x * v.x + this1.y * v.y) / (Math.sqrt(this1.x * this1.x + this1.y * this1.y) * Math.sqrt(v.x * v.x + v.y * v.y)));
	if(v._weak) {
		v.put();
	}
	return rads * (180 / Math.PI);
};
flixel_math_FlxVector.sign = function(this1,a,b) {
	var signFl = (a.x - this1.x) * (b.y - this1.y) - (a.y - this1.y) * (b.x - this1.x);
	if(a._weak) {
		a.put();
	}
	if(b._weak) {
		b.put();
	}
	if(signFl == 0) {
		return 0;
	}
	return Math.round(signFl / Math.abs(signFl));
};
flixel_math_FlxVector.dist = function(this1,v) {
	var dx = v.x - this1.x;
	var dy = v.y - this1.y;
	if(v._weak) {
		v.put();
	}
	return Math.sqrt(dx * dx + dy * dy);
};
flixel_math_FlxVector.distSquared = function(this1,v) {
	var dx = v.x - this1.x;
	var dy = v.y - this1.y;
	if(v._weak) {
		v.put();
	}
	return dx * dx + dy * dy;
};
flixel_math_FlxVector.bounce = function(this1,normal,bounceCoeff) {
	if(bounceCoeff == null) {
		bounceCoeff = 1;
	}
	var d = (1 + bounceCoeff) * (this1.x * normal.x + this1.y * normal.y);
	var _g = this1;
	_g.set_x(_g.x - d * normal.x);
	var _g = this1;
	_g.set_y(_g.y - d * normal.y);
	if(normal._weak) {
		normal.put();
	}
	return this1;
};
flixel_math_FlxVector.bounceWithFriction = function(this1,normal,bounceCoeff,friction) {
	if(friction == null) {
		friction = 0;
	}
	if(bounceCoeff == null) {
		bounceCoeff = 1;
	}
	var v = flixel_math_FlxVector.rightNormal(normal,flixel_math_FlxVector._vector3);
	var proj = flixel_math_FlxVector._vector1;
	var dp = this1.x * v.x + this1.y * v.y;
	if(proj == null) {
		var X = 0;
		var Y = 0;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		proj = point;
	}
	var x = dp * v.x;
	var y = dp * v.y;
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	var p1 = proj.set(x,y);
	var proj = flixel_math_FlxVector._vector2;
	var dp = this1.x * normal.x + this1.y * normal.y;
	if(proj == null) {
		var X = 0;
		var Y = 0;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		proj = point;
	}
	var x = dp * normal.x;
	var y = dp * normal.y;
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	var p2 = proj.set(x,y);
	var bounceX = -p2.x;
	var bounceY = -p2.y;
	var frictionX = p1.x;
	var frictionY = p1.y;
	this1.set_x(bounceX * bounceCoeff + frictionX * friction);
	this1.set_y(bounceY * bounceCoeff + frictionY * friction);
	if(normal._weak) {
		normal.put();
	}
	return this1;
};
flixel_math_FlxVector.isValid = function(this1) {
	var tmp;
	var tmp1;
	var f = this1.x;
	if(!isNaN(f)) {
		var f = this1.y;
		tmp1 = !isNaN(f);
	} else {
		tmp1 = false;
	}
	if(tmp1) {
		var f = this1.x;
		tmp = isFinite(f);
	} else {
		tmp = false;
	}
	if(tmp) {
		var f = this1.y;
		return isFinite(f);
	} else {
		return false;
	}
};
flixel_math_FlxVector.clone = function(this1,vec) {
	if(vec == null) {
		var X = 0;
		var Y = 0;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		vec = point;
	}
	vec.set_x(this1.x);
	vec.set_y(this1.y);
	return vec;
};
flixel_math_FlxVector.get_x = function(this1) {
	return this1.x;
};
flixel_math_FlxVector.set_x = function(this1,x) {
	return this1.set_x(x);
};
flixel_math_FlxVector.get_y = function(this1) {
	return this1.y;
};
flixel_math_FlxVector.set_y = function(this1,y) {
	return this1.set_y(y);
};
flixel_math_FlxVector.get_dx = function(this1) {
	if(Math.abs(this1.x) < 0.0000001 && Math.abs(this1.y) < 0.0000001) {
		return 0;
	}
	return this1.x / Math.sqrt(this1.x * this1.x + this1.y * this1.y);
};
flixel_math_FlxVector.get_dy = function(this1) {
	if(Math.abs(this1.x) < 0.0000001 && Math.abs(this1.y) < 0.0000001) {
		return 0;
	}
	return this1.y / Math.sqrt(this1.x * this1.x + this1.y * this1.y);
};
flixel_math_FlxVector.get_length = function(this1) {
	return Math.sqrt(this1.x * this1.x + this1.y * this1.y);
};
flixel_math_FlxVector.set_length = function(this1,l) {
	if(!(Math.abs(this1.x) < 0.0000001 && Math.abs(this1.y) < 0.0000001)) {
		var a = flixel_math_FlxVector.get_radians(this1);
		this1.set_x(l * Math.cos(a));
		this1.set_y(l * Math.sin(a));
	}
	return l;
};
flixel_math_FlxVector.get_lengthSquared = function(this1) {
	return this1.x * this1.x + this1.y * this1.y;
};
flixel_math_FlxVector.get_degrees = function(this1) {
	return flixel_math_FlxVector.get_radians(this1) * (180 / Math.PI);
};
flixel_math_FlxVector.set_degrees = function(this1,degs) {
	var rads = degs * (Math.PI / 180);
	var len = Math.sqrt(this1.x * this1.x + this1.y * this1.y);
	this1.set_x(len * Math.cos(rads));
	this1.set_y(len * Math.sin(rads));
	return degs;
};
flixel_math_FlxVector.get_radians = function(this1) {
	if(Math.abs(this1.x) < 0.0000001 && Math.abs(this1.y) < 0.0000001) {
		return 0;
	}
	return Math.atan2(this1.y,this1.x);
};
flixel_math_FlxVector.set_radians = function(this1,rads) {
	var len = Math.sqrt(this1.x * this1.x + this1.y * this1.y);
	this1.set_x(len * Math.cos(rads));
	this1.set_y(len * Math.sin(rads));
	return rads;
};
flixel_math_FlxVector.get_rx = function(this1) {
	return -this1.y;
};
flixel_math_FlxVector.get_ry = function(this1) {
	return this1.x;
};
flixel_math_FlxVector.get_lx = function(this1) {
	return this1.y;
};
flixel_math_FlxVector.get_ly = function(this1) {
	return -this1.x;
};
flixel_math_FlxVector.get_pool = function() {
	return flixel_math_FlxPoint.get_pool();
};
var flixel_math_FlxVelocity = function() { };
$hxClasses["flixel.math.FlxVelocity"] = flixel_math_FlxVelocity;
flixel_math_FlxVelocity.__name__ = "flixel.math.FlxVelocity";
flixel_math_FlxVelocity.moveTowardsObject = function(Source,Dest,Speed,MaxTime) {
	if(MaxTime == null) {
		MaxTime = 0;
	}
	if(Speed == null) {
		Speed = 60;
	}
	var a = flixel_math_FlxAngle.angleBetween(Source,Dest);
	if(MaxTime > 0) {
		var dx = Source.x + Source.origin.x - (Dest.x + Dest.origin.x);
		var dy = Source.y + Source.origin.y - (Dest.y + Dest.origin.y);
		var d = Math.sqrt(dx * dx + dy * dy) | 0;
		Speed = d / (MaxTime / 1000) | 0;
	}
	Source.velocity.set_x(Math.cos(a) * Speed);
	Source.velocity.set_y(Math.sin(a) * Speed);
};
flixel_math_FlxVelocity.accelerateTowardsObject = function(Source,Dest,Acceleration,MaxSpeed) {
	var a = flixel_math_FlxAngle.angleBetween(Source,Dest);
	var sinA = Math.sin(a);
	var cosA = Math.cos(a);
	Source.velocity.set(0,0);
	Source.acceleration.set(cosA * Acceleration,sinA * Acceleration);
	Source.maxVelocity.set(Math.abs(cosA * MaxSpeed),Math.abs(sinA * MaxSpeed));
};
flixel_math_FlxVelocity.moveTowardsMouse = function(Source,Speed,MaxTime) {
	if(MaxTime == null) {
		MaxTime = 0;
	}
	if(Speed == null) {
		Speed = 60;
	}
	var a = flixel_math_FlxAngle.angleBetweenMouse(Source);
	if(MaxTime > 0) {
		var dx = Source.x + Source.origin.x - flixel_FlxG.mouse.screenX;
		var dy = Source.y + Source.origin.y - flixel_FlxG.mouse.screenY;
		var d = Math.sqrt(dx * dx + dy * dy) | 0;
		Speed = d / (MaxTime / 1000) | 0;
	}
	Source.velocity.set_x(Math.cos(a) * Speed);
	Source.velocity.set_y(Math.sin(a) * Speed);
};
flixel_math_FlxVelocity.moveTowardsTouch = function(Source,Touch1,Speed,MaxTime) {
	if(MaxTime == null) {
		MaxTime = 0;
	}
	if(Speed == null) {
		Speed = 60;
	}
	var a = flixel_math_FlxAngle.angleBetweenTouch(Source,Touch1);
	if(MaxTime > 0) {
		var dx = Source.x + Source.origin.x - Touch1.screenX;
		var dy = Source.y + Source.origin.y - Touch1.screenY;
		var d = Math.sqrt(dx * dx + dy * dy) | 0;
		Speed = d / (MaxTime / 1000) | 0;
	}
	Source.velocity.set_x(Math.cos(a) * Speed);
	Source.velocity.set_y(Math.sin(a) * Speed);
};
flixel_math_FlxVelocity.accelerateTowardsMouse = function(Source,Acceleration,MaxSpeed) {
	var a = flixel_math_FlxAngle.angleBetweenMouse(Source);
	var sinA = Math.sin(a);
	var cosA = Math.cos(a);
	Source.velocity.set(0,0);
	Source.acceleration.set(cosA * Acceleration,sinA * Acceleration);
	Source.maxVelocity.set(Math.abs(cosA * MaxSpeed),Math.abs(sinA * MaxSpeed));
};
flixel_math_FlxVelocity.accelerateTowardsTouch = function(Source,Touch1,Acceleration,MaxSpeed) {
	var a = flixel_math_FlxAngle.angleBetweenTouch(Source,Touch1);
	var sinA = Math.sin(a);
	var cosA = Math.cos(a);
	Source.velocity.set(0,0);
	Source.acceleration.set(cosA * Acceleration,sinA * Acceleration);
	Source.maxVelocity.set(Math.abs(cosA * MaxSpeed),Math.abs(sinA * MaxSpeed));
};
flixel_math_FlxVelocity.moveTowardsPoint = function(Source,Target,Speed,MaxTime) {
	if(MaxTime == null) {
		MaxTime = 0;
	}
	if(Speed == null) {
		Speed = 60;
	}
	var a = flixel_math_FlxAngle.angleBetweenPoint(Source,Target);
	if(MaxTime > 0) {
		var dx = Source.x + Source.origin.x - Target.x;
		var dy = Source.y + Source.origin.y - Target.y;
		if(Target._weak) {
			Target.put();
		}
		var d = Math.sqrt(dx * dx + dy * dy) | 0;
		Speed = d / (MaxTime / 1000) | 0;
	}
	Source.velocity.set_x(Math.cos(a) * Speed);
	Source.velocity.set_y(Math.sin(a) * Speed);
	if(Target._weak) {
		Target.put();
	}
};
flixel_math_FlxVelocity.accelerateTowardsPoint = function(Source,Target,Acceleration,MaxSpeed) {
	var a = flixel_math_FlxAngle.angleBetweenPoint(Source,Target);
	var sinA = Math.sin(a);
	var cosA = Math.cos(a);
	Source.velocity.set(0,0);
	Source.acceleration.set(cosA * Acceleration,sinA * Acceleration);
	Source.maxVelocity.set(Math.abs(cosA * MaxSpeed),Math.abs(sinA * MaxSpeed));
	if(Target._weak) {
		Target.put();
	}
};
flixel_math_FlxVelocity.velocityFromAngle = function(Angle,Speed) {
	var a = Angle * (Math.PI / 180);
	var X = Math.cos(a) * Speed;
	var Y = Math.sin(a) * Speed;
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	var point = flixel_math_FlxPoint._pool.get().set(X,Y);
	point._inPool = false;
	return point;
};
flixel_math_FlxVelocity.velocityFromFacing = function(Parent,Speed) {
	var a = flixel_math_FlxAngle.angleFromFacing(Parent.facing);
	var X = Math.cos(a) * Speed;
	var Y = Math.sin(a) * Speed;
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	var point = flixel_math_FlxPoint._pool.get().set(X,Y);
	point._inPool = false;
	return point;
};
flixel_math_FlxVelocity.computeVelocity = function(Velocity,Acceleration,Drag,Max,Elapsed) {
	if(Acceleration != 0) {
		Velocity += Acceleration * Elapsed;
	} else if(Drag != 0) {
		var drag = Drag * Elapsed;
		if(Velocity - drag > 0) {
			Velocity -= drag;
		} else if(Velocity + drag < 0) {
			Velocity += drag;
		} else {
			Velocity = 0;
		}
	}
	if(Velocity != 0 && Max != 0) {
		if(Velocity > Max) {
			Velocity = Max;
		} else if(Velocity < -Max) {
			Velocity = -Max;
		}
	}
	return Velocity;
};
flixel_math_FlxVelocity.accelerateFromAngle = function(source,radians,acceleration,maxSpeed,resetVelocity) {
	if(resetVelocity == null) {
		resetVelocity = true;
	}
	var sinA = Math.sin(radians);
	var cosA = Math.cos(radians);
	if(resetVelocity) {
		source.velocity.set(0,0);
	}
	source.acceleration.set(cosA * acceleration,sinA * acceleration);
	source.maxVelocity.set(Math.abs(cosA * maxSpeed),Math.abs(sinA * maxSpeed));
};
var flixel_system_GraphicLogo = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system_GraphicLogo.preload != null) {
		this.__fromImage(flixel_system_GraphicLogo.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system_GraphicLogo.resourceName),flixel_system_GraphicLogo.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system_GraphicLogo.preload == null) {
				flixel_system_GraphicLogo.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system.GraphicLogo"] = flixel_system_GraphicLogo;
flixel_system_GraphicLogo.__name__ = "flixel.system.GraphicLogo";
flixel_system_GraphicLogo.preload = null;
flixel_system_GraphicLogo.__super__ = openfl_display_BitmapData;
flixel_system_GraphicLogo.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system_GraphicLogo
});
var flixel_system_GraphicVirtualInput = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system_GraphicVirtualInput.preload != null) {
		this.__fromImage(flixel_system_GraphicVirtualInput.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system_GraphicVirtualInput.resourceName),flixel_system_GraphicVirtualInput.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system_GraphicVirtualInput.preload == null) {
				flixel_system_GraphicVirtualInput.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system.GraphicVirtualInput"] = flixel_system_GraphicVirtualInput;
flixel_system_GraphicVirtualInput.__name__ = "flixel.system.GraphicVirtualInput";
flixel_system_GraphicVirtualInput.preload = null;
flixel_system_GraphicVirtualInput.__super__ = openfl_display_BitmapData;
flixel_system_GraphicVirtualInput.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system_GraphicVirtualInput
});
var haxe_io_Bytes = function(data) {
	this.length = data.byteLength;
	this.b = new Uint8Array(data);
	this.b.bufferValue = data;
	data.hxBytes = this;
	data.bytes = this.b;
};
$hxClasses["haxe.io.Bytes"] = haxe_io_Bytes;
haxe_io_Bytes.__name__ = "haxe.io.Bytes";
haxe_io_Bytes.alloc = function(length) {
	return new haxe_io_Bytes(new ArrayBuffer(length));
};
haxe_io_Bytes.ofString = function(s,encoding) {
	var a = [];
	var i = 0;
	while(i < s.length) {
		var c = s.charCodeAt(i++);
		if(55296 <= c && c <= 56319) {
			c = c - 55232 << 10 | s.charCodeAt(i++) & 1023;
		}
		if(c <= 127) {
			a.push(c);
		} else if(c <= 2047) {
			a.push(192 | c >> 6);
			a.push(128 | c & 63);
		} else if(c <= 65535) {
			a.push(224 | c >> 12);
			a.push(128 | c >> 6 & 63);
			a.push(128 | c & 63);
		} else {
			a.push(240 | c >> 18);
			a.push(128 | c >> 12 & 63);
			a.push(128 | c >> 6 & 63);
			a.push(128 | c & 63);
		}
	}
	return new haxe_io_Bytes(new Uint8Array(a).buffer);
};
haxe_io_Bytes.ofData = function(b) {
	var hb = b.hxBytes;
	if(hb != null) {
		return hb;
	}
	return new haxe_io_Bytes(b);
};
haxe_io_Bytes.ofHex = function(s) {
	if((s.length & 1) != 0) {
		throw haxe_Exception.thrown("Not a hex string (odd number of digits)");
	}
	var a = [];
	var i = 0;
	var len = s.length >> 1;
	while(i < len) {
		var high = s.charCodeAt(i * 2);
		var low = s.charCodeAt(i * 2 + 1);
		high = (high & 15) + ((high & 64) >> 6) * 9;
		low = (low & 15) + ((low & 64) >> 6) * 9;
		a.push((high << 4 | low) & 255);
		++i;
	}
	return new haxe_io_Bytes(new Uint8Array(a).buffer);
};
haxe_io_Bytes.fastGet = function(b,pos) {
	return b.bytes[pos];
};
haxe_io_Bytes.prototype = {
	length: null
	,b: null
	,data: null
	,get: function(pos) {
		return this.b[pos];
	}
	,set: function(pos,v) {
		this.b[pos] = v & 255;
	}
	,blit: function(pos,src,srcpos,len) {
		if(pos < 0 || srcpos < 0 || len < 0 || pos + len > this.length || srcpos + len > src.length) {
			throw haxe_Exception.thrown(haxe_io_Error.OutsideBounds);
		}
		if(srcpos == 0 && len == src.b.byteLength) {
			this.b.set(src.b,pos);
		} else {
			this.b.set(src.b.subarray(srcpos,srcpos + len),pos);
		}
	}
	,fill: function(pos,len,value) {
		var _g = 0;
		var _g1 = len;
		while(_g < _g1) {
			var i = _g++;
			this.b[pos++] = value & 255;
		}
	}
	,sub: function(pos,len) {
		if(pos < 0 || len < 0 || pos + len > this.length) {
			throw haxe_Exception.thrown(haxe_io_Error.OutsideBounds);
		}
		return new haxe_io_Bytes(this.b.buffer.slice(pos + this.b.byteOffset,pos + this.b.byteOffset + len));
	}
	,compare: function(other) {
		var b1 = this.b;
		var b2 = other.b;
		var len = this.length < other.length ? this.length : other.length;
		var _g = 0;
		var _g1 = len;
		while(_g < _g1) {
			var i = _g++;
			if(b1[i] != b2[i]) {
				return b1[i] - b2[i];
			}
		}
		return this.length - other.length;
	}
	,initData: function() {
		if(this.data == null) {
			this.data = new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength);
		}
	}
	,getDouble: function(pos) {
		if(this.data == null) {
			this.data = new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength);
		}
		return this.data.getFloat64(pos,true);
	}
	,getFloat: function(pos) {
		if(this.data == null) {
			this.data = new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength);
		}
		return this.data.getFloat32(pos,true);
	}
	,setDouble: function(pos,v) {
		if(this.data == null) {
			this.data = new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength);
		}
		this.data.setFloat64(pos,v,true);
	}
	,setFloat: function(pos,v) {
		if(this.data == null) {
			this.data = new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength);
		}
		this.data.setFloat32(pos,v,true);
	}
	,getUInt16: function(pos) {
		if(this.data == null) {
			this.data = new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength);
		}
		return this.data.getUint16(pos,true);
	}
	,setUInt16: function(pos,v) {
		if(this.data == null) {
			this.data = new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength);
		}
		this.data.setUint16(pos,v,true);
	}
	,getInt32: function(pos) {
		if(this.data == null) {
			this.data = new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength);
		}
		return this.data.getInt32(pos,true);
	}
	,setInt32: function(pos,v) {
		if(this.data == null) {
			this.data = new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength);
		}
		this.data.setInt32(pos,v,true);
	}
	,getInt64: function(pos) {
		var this1 = new haxe__$Int64__$_$_$Int64(this.getInt32(pos + 4),this.getInt32(pos));
		return this1;
	}
	,setInt64: function(pos,v) {
		this.setInt32(pos,v.low);
		this.setInt32(pos + 4,v.high);
	}
	,getString: function(pos,len,encoding) {
		if(pos < 0 || len < 0 || pos + len > this.length) {
			throw haxe_Exception.thrown(haxe_io_Error.OutsideBounds);
		}
		var s = "";
		var b = this.b;
		var fcc = _$String_String_$Impl_$.fromCharCode;
		var i = pos;
		var max = pos + len;
		while(i < max) {
			var c = b[i++];
			if(c < 128) {
				if(c == 0) {
					break;
				}
				s += fcc(c);
			} else if(c < 224) {
				s += fcc((c & 63) << 6 | b[i++] & 127);
			} else if(c < 240) {
				var c2 = b[i++];
				s += fcc((c & 31) << 12 | (c2 & 127) << 6 | b[i++] & 127);
			} else {
				var c21 = b[i++];
				var c3 = b[i++];
				var u = (c & 15) << 18 | (c21 & 127) << 12 | (c3 & 127) << 6 | b[i++] & 127;
				s += fcc((u >> 10) + 55232);
				s += fcc(u & 1023 | 56320);
			}
		}
		return s;
	}
	,readString: function(pos,len) {
		return this.getString(pos,len);
	}
	,toString: function() {
		return this.getString(0,this.length);
	}
	,toHex: function() {
		var s_b = "";
		var chars = [];
		var str = "0123456789abcdef";
		var _g = 0;
		var _g1 = str.length;
		while(_g < _g1) {
			var i = _g++;
			chars.push(HxOverrides.cca(str,i));
		}
		var _g = 0;
		var _g1 = this.length;
		while(_g < _g1) {
			var i = _g++;
			var c = this.b[i];
			s_b += String.fromCodePoint(chars[c >> 4]);
			s_b += String.fromCodePoint(chars[c & 15]);
		}
		return s_b;
	}
	,getData: function() {
		return this.b.bufferValue;
	}
	,__class__: haxe_io_Bytes
};
var openfl_utils_IDataOutput = function() { };
$hxClasses["openfl.utils.IDataOutput"] = openfl_utils_IDataOutput;
openfl_utils_IDataOutput.__name__ = "openfl.utils.IDataOutput";
openfl_utils_IDataOutput.__isInterface__ = true;
openfl_utils_IDataOutput.prototype = {
	get_endian: null
	,set_endian: null
	,objectEncoding: null
	,writeBoolean: null
	,writeByte: null
	,writeBytes: null
	,writeDouble: null
	,writeFloat: null
	,writeInt: null
	,writeMultiByte: null
	,writeObject: null
	,writeShort: null
	,writeUnsignedInt: null
	,writeUTF: null
	,writeUTFBytes: null
	,__class__: openfl_utils_IDataOutput
	,__properties__: {set_endian:"set_endian",get_endian:"get_endian"}
};
var openfl_utils_IDataInput = function() { };
$hxClasses["openfl.utils.IDataInput"] = openfl_utils_IDataInput;
openfl_utils_IDataInput.__name__ = "openfl.utils.IDataInput";
openfl_utils_IDataInput.__isInterface__ = true;
openfl_utils_IDataInput.prototype = {
	get_bytesAvailable: null
	,get_endian: null
	,set_endian: null
	,objectEncoding: null
	,readBoolean: null
	,readByte: null
	,readBytes: null
	,readDouble: null
	,readFloat: null
	,readInt: null
	,readMultiByte: null
	,readObject: null
	,readShort: null
	,readUnsignedByte: null
	,readUnsignedInt: null
	,readUnsignedShort: null
	,readUTF: null
	,readUTFBytes: null
	,__class__: openfl_utils_IDataInput
	,__properties__: {set_endian:"set_endian",get_endian:"get_endian",get_bytesAvailable:"get_bytesAvailable"}
};
var openfl_utils_ByteArrayData = function(length) {
	if(length == null) {
		length = 0;
	}
	var bytes = new haxe_io_Bytes(new ArrayBuffer(length));
	haxe_io_Bytes.call(this,bytes.b.buffer);
	this.__length = length;
	if(openfl_utils_ByteArrayData.__defaultEndian == null) {
		if(lime_system_System.get_endianness() == lime_system_Endian.LITTLE_ENDIAN) {
			openfl_utils_ByteArrayData.__defaultEndian = 1;
		} else {
			openfl_utils_ByteArrayData.__defaultEndian = 0;
		}
	}
	this.__endian = openfl_utils_ByteArrayData.__defaultEndian;
	this.objectEncoding = openfl_utils_ByteArrayData.defaultObjectEncoding;
	this.position = 0;
};
$hxClasses["openfl.utils.ByteArrayData"] = openfl_utils_ByteArrayData;
openfl_utils_ByteArrayData.__name__ = "openfl.utils.ByteArrayData";
openfl_utils_ByteArrayData.__interfaces__ = [openfl_utils_IDataOutput,openfl_utils_IDataInput];
openfl_utils_ByteArrayData.__properties__ = {set_defaultEndian:"set_defaultEndian",get_defaultEndian:"get_defaultEndian"};
openfl_utils_ByteArrayData.fromBytes = function(bytes) {
	var result = new openfl_utils_ByteArrayData();
	result.__fromBytes(bytes);
	return result;
};
openfl_utils_ByteArrayData.get_defaultEndian = function() {
	if(openfl_utils_ByteArrayData.__defaultEndian == null) {
		if(lime_system_System.get_endianness() == lime_system_Endian.LITTLE_ENDIAN) {
			openfl_utils_ByteArrayData.__defaultEndian = 1;
		} else {
			openfl_utils_ByteArrayData.__defaultEndian = 0;
		}
	}
	return openfl_utils_ByteArrayData.__defaultEndian;
};
openfl_utils_ByteArrayData.set_defaultEndian = function(value) {
	return openfl_utils_ByteArrayData.__defaultEndian = value;
};
openfl_utils_ByteArrayData.__super__ = haxe_io_Bytes;
openfl_utils_ByteArrayData.prototype = $extend(haxe_io_Bytes.prototype,{
	objectEncoding: null
	,position: null
	,__endian: null
	,__length: null
	,clear: function() {
		this.length = 0;
		this.position = 0;
	}
	,compress: function(algorithm) {
		if(algorithm == null) {
			algorithm = 2;
		}
		if(this.__length > this.length) {
			var cacheLength = this.length;
			this.length = this.__length;
			var data = new haxe_io_Bytes(new ArrayBuffer(cacheLength));
			data.blit(0,this,0,cacheLength);
			this.b = data.b;
			this.__length = data.length;
			this.data = data.data;
			this.length = cacheLength;
		}
		var limeBytes = this;
		var bytes;
		switch(algorithm) {
		case 0:
			bytes = lime_utils_Bytes.compress(limeBytes,lime_utils_CompressionAlgorithm.DEFLATE);
			break;
		case 1:
			bytes = lime_utils_Bytes.compress(limeBytes,lime_utils_CompressionAlgorithm.LZMA);
			break;
		default:
			bytes = lime_utils_Bytes.compress(limeBytes,lime_utils_CompressionAlgorithm.ZLIB);
		}
		if(bytes != null) {
			this.b = bytes.b;
			this.__length = bytes.length;
			this.data = bytes.data;
			this.length = this.__length;
			this.position = this.length;
		}
	}
	,deflate: function() {
		this.compress(0);
	}
	,inflate: function() {
		this.uncompress(0);
	}
	,readBoolean: function() {
		if(this.position < this.length) {
			return this.b[this.position++] != 0;
		} else {
			throw haxe_Exception.thrown(new openfl_errors_EOFError());
		}
	}
	,readByte: function() {
		var value = this.readUnsignedByte();
		if((value & 128) != 0) {
			return value - 256;
		} else {
			return value;
		}
	}
	,readBytes: function(bytes,offset,length) {
		if(length == null) {
			length = 0;
		}
		if(offset == null) {
			offset = 0;
		}
		if(length == 0) {
			length = this.length - this.position;
		}
		if(this.position + length > this.length) {
			throw haxe_Exception.thrown(new openfl_errors_EOFError());
		}
		if(bytes.length < offset + length) {
			bytes.__resize(offset + length);
		}
		bytes.blit(offset,this,this.position,length);
		this.position += length;
	}
	,readDouble: function() {
		if(this.__endian == 1) {
			if(this.position + 8 > this.length) {
				throw haxe_Exception.thrown(new openfl_errors_EOFError());
			}
			this.position += 8;
			return this.getDouble(this.position - 8);
		} else {
			var ch1 = this.readInt();
			var ch2 = this.readInt();
			return haxe_io_FPHelper.i64ToDouble(ch2,ch1);
		}
	}
	,readFloat: function() {
		if(this.__endian == 1) {
			if(this.position + 4 > this.length) {
				throw haxe_Exception.thrown(new openfl_errors_EOFError());
			}
			this.position += 4;
			return this.getFloat(this.position - 4);
		} else {
			return haxe_io_FPHelper.i32ToFloat(this.readInt());
		}
	}
	,readInt: function() {
		var ch1 = this.readUnsignedByte();
		var ch2 = this.readUnsignedByte();
		var ch3 = this.readUnsignedByte();
		var ch4 = this.readUnsignedByte();
		if(this.__endian == 1) {
			return ch4 << 24 | ch3 << 16 | ch2 << 8 | ch1;
		} else {
			return ch1 << 24 | ch2 << 16 | ch3 << 8 | ch4;
		}
	}
	,readMultiByte: function(length,charSet) {
		return this.readUTFBytes(length);
	}
	,readObject: function() {
		switch(this.objectEncoding) {
		case 10:
			var data = this.readUTF();
			return haxe_Unserializer.run(data);
		case 12:
			var data = this.readUTF();
			return JSON.parse(data);
		default:
			return null;
		}
	}
	,readShort: function() {
		var ch1 = this.readUnsignedByte();
		var ch2 = this.readUnsignedByte();
		var value;
		if(this.__endian == 1) {
			value = ch2 << 8 | ch1;
		} else {
			value = ch1 << 8 | ch2;
		}
		if((value & 32768) != 0) {
			return value - 65536;
		} else {
			return value;
		}
	}
	,readUnsignedByte: function() {
		if(this.position < this.length) {
			return this.b[this.position++];
		} else {
			throw haxe_Exception.thrown(new openfl_errors_EOFError());
		}
	}
	,readUnsignedInt: function() {
		var ch1 = this.readUnsignedByte();
		var ch2 = this.readUnsignedByte();
		var ch3 = this.readUnsignedByte();
		var ch4 = this.readUnsignedByte();
		if(this.__endian == 1) {
			return ch4 << 24 | ch3 << 16 | ch2 << 8 | ch1;
		} else {
			return ch1 << 24 | ch2 << 16 | ch3 << 8 | ch4;
		}
	}
	,readUnsignedShort: function() {
		var ch1 = this.readUnsignedByte();
		var ch2 = this.readUnsignedByte();
		if(this.__endian == 1) {
			return (ch2 << 8) + ch1;
		} else {
			return ch1 << 8 | ch2;
		}
	}
	,readUTF: function() {
		var bytesCount = this.readUnsignedShort();
		return this.readUTFBytes(bytesCount);
	}
	,readUTFBytes: function(length) {
		if(this.position + length > this.length) {
			throw haxe_Exception.thrown(new openfl_errors_EOFError());
		}
		this.position += length;
		return this.getString(this.position - length,length);
	}
	,uncompress: function(algorithm) {
		if(algorithm == null) {
			algorithm = 2;
		}
		if(this.__length > this.length) {
			var cacheLength = this.length;
			this.length = this.__length;
			var data = new haxe_io_Bytes(new ArrayBuffer(cacheLength));
			data.blit(0,this,0,cacheLength);
			this.b = data.b;
			this.__length = data.length;
			this.data = data.data;
			this.length = cacheLength;
		}
		var limeBytes = this;
		var bytes;
		switch(algorithm) {
		case 0:
			bytes = lime_utils_Bytes.decompress(limeBytes,lime_utils_CompressionAlgorithm.DEFLATE);
			break;
		case 1:
			bytes = lime_utils_Bytes.decompress(limeBytes,lime_utils_CompressionAlgorithm.LZMA);
			break;
		default:
			bytes = lime_utils_Bytes.decompress(limeBytes,lime_utils_CompressionAlgorithm.ZLIB);
		}
		if(bytes != null) {
			this.b = bytes.b;
			this.__length = bytes.length;
			this.data = bytes.data;
			this.length = this.__length;
		}
		this.position = 0;
	}
	,writeBoolean: function(value) {
		this.writeByte(value ? 1 : 0);
	}
	,writeByte: function(value) {
		this.__resize(this.position + 1);
		this.b[this.position++] = value & 255 & 255;
	}
	,writeBytes: function(bytes,offset,length) {
		if(length == null) {
			length = 0;
		}
		if(offset == null) {
			offset = 0;
		}
		if(openfl_utils_ByteArray.get_length(bytes) == 0) {
			return;
		}
		if(length == 0) {
			length = openfl_utils_ByteArray.get_length(bytes) - offset;
		}
		this.__resize(this.position + length);
		this.blit(this.position,bytes,offset,length);
		this.position = this.position + length;
	}
	,writeDouble: function(value) {
		var int64 = haxe_io_FPHelper.doubleToI64(value);
		if(this.__endian == 1) {
			this.writeInt(int64.low);
			this.writeInt(int64.high);
		} else {
			this.writeInt(int64.high);
			this.writeInt(int64.low);
		}
	}
	,writeFloat: function(value) {
		if(this.__endian == 1) {
			this.__resize(this.position + 4);
			this.setFloat(this.position,value);
			this.position += 4;
		} else {
			var int = haxe_io_FPHelper.floatToI32(value);
			this.writeInt(int);
		}
	}
	,writeInt: function(value) {
		this.__resize(this.position + 4);
		if(this.__endian == 1) {
			this.b[this.position++] = value & 255 & 255;
			this.b[this.position++] = value >> 8 & 255 & 255;
			this.b[this.position++] = value >> 16 & 255 & 255;
			this.b[this.position++] = value >> 24 & 255 & 255;
		} else {
			this.b[this.position++] = value >> 24 & 255 & 255;
			this.b[this.position++] = value >> 16 & 255 & 255;
			this.b[this.position++] = value >> 8 & 255 & 255;
			this.b[this.position++] = value & 255 & 255;
		}
	}
	,writeMultiByte: function(value,charSet) {
		this.writeUTFBytes(value);
	}
	,writeObject: function(object) {
		switch(this.objectEncoding) {
		case 10:
			var value = haxe_Serializer.run(object);
			this.writeUTF(value);
			break;
		case 12:
			var value = JSON.stringify(object);
			this.writeUTF(value);
			break;
		default:
			return;
		}
	}
	,writeShort: function(value) {
		this.__resize(this.position + 2);
		if(this.__endian == 1) {
			this.b[this.position++] = value & 255;
			this.b[this.position++] = value >> 8 & 255;
		} else {
			this.b[this.position++] = value >> 8 & 255;
			this.b[this.position++] = value & 255;
		}
	}
	,writeUnsignedInt: function(value) {
		this.writeInt(value);
	}
	,writeUTF: function(value) {
		var bytes = haxe_io_Bytes.ofString(value);
		this.writeShort(bytes.length);
		this.writeBytes(openfl_utils_ByteArray.fromBytes(bytes));
	}
	,writeUTFBytes: function(value) {
		var bytes = haxe_io_Bytes.ofString(value);
		this.writeBytes(openfl_utils_ByteArray.fromBytes(bytes));
	}
	,__fromBytes: function(bytes) {
		this.b = bytes.b;
		this.__length = bytes.length;
		this.data = bytes.data;
		this.length = bytes.length;
	}
	,__resize: function(size) {
		if(size > this.__length) {
			var bytes = new haxe_io_Bytes(new ArrayBuffer((size + 1) * 3 >> 1));
			if(this.__length > 0) {
				var cacheLength = this.length;
				this.length = this.__length;
				bytes.blit(0,this,0,this.__length);
				this.length = cacheLength;
			}
			this.b = bytes.b;
			this.__length = bytes.length;
			this.data = bytes.data;
		}
		if(this.length < size) {
			this.length = size;
		}
	}
	,__setData: function(bytes) {
		this.b = bytes.b;
		this.__length = bytes.length;
		this.data = bytes.data;
	}
	,get_bytesAvailable: function() {
		return this.length - this.position;
	}
	,get_endian: function() {
		return this.__endian;
	}
	,set_endian: function(value) {
		return this.__endian = value;
	}
	,__class__: openfl_utils_ByteArrayData
	,__properties__: {set_endian:"set_endian",get_endian:"get_endian",get_bytesAvailable:"get_bytesAvailable"}
});
var flixel_system_VirtualInputData = function(length) {
	if(length == null) {
		length = 0;
	}
	openfl_utils_ByteArrayData.call(this);
	var bytes = haxe_Resource.getBytes(flixel_system_VirtualInputData.resourceName);
	this.__fromBytes(bytes);
};
$hxClasses["flixel.system.VirtualInputData"] = flixel_system_VirtualInputData;
flixel_system_VirtualInputData.__name__ = "flixel.system.VirtualInputData";
flixel_system_VirtualInputData.__super__ = openfl_utils_ByteArrayData;
flixel_system_VirtualInputData.prototype = $extend(openfl_utils_ByteArrayData.prototype,{
	__class__: flixel_system_VirtualInputData
});
var flixel_system_FlxAssets = function() { };
$hxClasses["flixel.system.FlxAssets"] = flixel_system_FlxAssets;
flixel_system_FlxAssets.__name__ = "flixel.system.FlxAssets";
flixel_system_FlxAssets.drawLogo = function(graph) {
	graph.beginFill(47394);
	graph.moveTo(50,13);
	graph.lineTo(51,13);
	graph.lineTo(87,50);
	graph.lineTo(87,51);
	graph.lineTo(51,87);
	graph.lineTo(50,87);
	graph.lineTo(13,51);
	graph.lineTo(13,50);
	graph.lineTo(50,13);
	graph.endFill();
	graph.beginFill(16761138);
	graph.moveTo(0,0);
	graph.lineTo(25,0);
	graph.lineTo(50,13);
	graph.lineTo(13,50);
	graph.lineTo(0,25);
	graph.lineTo(0,0);
	graph.endFill();
	graph.beginFill(16066382);
	graph.moveTo(100,0);
	graph.lineTo(75,0);
	graph.lineTo(51,13);
	graph.lineTo(87,50);
	graph.lineTo(100,25);
	graph.lineTo(100,0);
	graph.endFill();
	graph.beginFill(3555839);
	graph.moveTo(0,100);
	graph.lineTo(25,100);
	graph.lineTo(50,87);
	graph.lineTo(13,51);
	graph.lineTo(0,75);
	graph.lineTo(0,100);
	graph.endFill();
	graph.beginFill(314875);
	graph.moveTo(100,100);
	graph.lineTo(75,100);
	graph.lineTo(51,87);
	graph.lineTo(87,51);
	graph.lineTo(100,75);
	graph.lineTo(100,100);
	graph.endFill();
};
flixel_system_FlxAssets.getBitmapData = function(id) {
	if(openfl_utils_Assets.exists(id)) {
		return openfl_utils_Assets.getBitmapData(id,false);
	}
	return null;
};
flixel_system_FlxAssets.getBitmapFromClass = function(source) {
	return Type.createInstance(source,[0,0]);
};
flixel_system_FlxAssets.resolveBitmapData = function(Graphic) {
	if(((Graphic) instanceof openfl_display_BitmapData)) {
		return Graphic;
	} else if(js_Boot.__instanceof(Graphic,Class)) {
		return Type.createInstance(Graphic,[0,0]);
	} else if(typeof(Graphic) == "string") {
		if(openfl_utils_Assets.exists(Graphic)) {
			return openfl_utils_Assets.getBitmapData(Graphic,false);
		} else {
			return null;
		}
	}
	return null;
};
flixel_system_FlxAssets.resolveKey = function(Graphic,Key) {
	if(Key != null) {
		return Key;
	}
	if(((Graphic) instanceof openfl_display_BitmapData)) {
		return Key;
	} else if(js_Boot.__instanceof(Graphic,Class)) {
		var _this = flixel_FlxG.bitmap;
		return Graphic.__name__;
	} else if(typeof(Graphic) == "string") {
		return Graphic;
	}
	return null;
};
flixel_system_FlxAssets.getSound = function(id) {
	var extension = "";
	extension = ".ogg";
	return openfl_utils_Assets.getSound(id + extension);
};
flixel_system_FlxAssets.getVirtualInputFrames = function() {
	var bitmapData = new flixel_system_GraphicVirtualInput(0,0);
	Reflect.setProperty(bitmapData,"width",399);
	Reflect.setProperty(bitmapData,"height",183);
	var graphic = flixel_graphics_FlxGraphic.fromBitmapData(bitmapData);
	return flixel_graphics_frames_FlxAtlasFrames.fromSpriteSheetPacker(graphic,Std.string(new flixel_system_VirtualInputData()));
};
var flixel_system_FlxBGSprite = function() {
	flixel_FlxSprite.call(this);
	this.makeGraphic(1,1,-1,true,flixel_FlxG.bitmap.getUniqueKey("bg_graphic_"));
	this.scrollFactor.set();
};
$hxClasses["flixel.system.FlxBGSprite"] = flixel_system_FlxBGSprite;
flixel_system_FlxBGSprite.__name__ = "flixel.system.FlxBGSprite";
flixel_system_FlxBGSprite.__super__ = flixel_FlxSprite;
flixel_system_FlxBGSprite.prototype = $extend(flixel_FlxSprite.prototype,{
	draw: function() {
		var _g = 0;
		var _g1 = this.get_cameras();
		while(_g < _g1.length) {
			var camera = _g1[_g];
			++_g;
			if(!camera.visible || !camera.exists) {
				continue;
			}
			this._matrix.identity();
			this._matrix.scale(camera.viewWidth,camera.viewHeight);
			camera.drawPixels(this.frame,null,this._matrix,this.colorTransform);
		}
	}
	,__class__: flixel_system_FlxBGSprite
});
var flixel_system__$FlxBasePreloader_DefaultPreloader = function() {
	openfl_display_Sprite.call(this);
	this.addEventListener("addedToStage",$bind(this,this.onAddedToStage));
};
$hxClasses["flixel.system._FlxBasePreloader.DefaultPreloader"] = flixel_system__$FlxBasePreloader_DefaultPreloader;
flixel_system__$FlxBasePreloader_DefaultPreloader.__name__ = "flixel.system._FlxBasePreloader.DefaultPreloader";
flixel_system__$FlxBasePreloader_DefaultPreloader.__super__ = openfl_display_Sprite;
flixel_system__$FlxBasePreloader_DefaultPreloader.prototype = $extend(openfl_display_Sprite.prototype,{
	onAddedToStage: function(_) {
		this.removeEventListener("addedToStage",$bind(this,this.onAddedToStage));
		this.onInit();
		this.onUpdate(this.get_loaderInfo().bytesLoaded,this.get_loaderInfo().bytesTotal);
		this.addEventListener("progress",$bind(this,this.onProgress));
		this.addEventListener("complete",$bind(this,this.onComplete));
	}
	,onComplete: function(event) {
		event.preventDefault();
		this.removeEventListener("progress",$bind(this,this.onProgress));
		this.removeEventListener("complete",$bind(this,this.onComplete));
		this.onLoaded();
	}
	,onProgress: function(event) {
		this.onUpdate(event.bytesLoaded | 0,event.bytesTotal | 0);
	}
	,onInit: function() {
	}
	,onLoaded: function() {
		this.dispatchEvent(new openfl_events_Event("unload"));
	}
	,onUpdate: function(bytesLoaded,bytesTotal) {
		var percentLoaded = 0.0;
		if(bytesTotal > 0) {
			percentLoaded = bytesLoaded / bytesTotal;
			if(percentLoaded > 1) {
				percentLoaded = 1;
			}
		}
	}
	,__class__: flixel_system__$FlxBasePreloader_DefaultPreloader
});
var flixel_system_FlxBasePreloader = function(MinDisplayTime,AllowedURLs) {
	if(MinDisplayTime == null) {
		MinDisplayTime = 0;
	}
	this._destroyed = false;
	this._urlChecked = false;
	this._loaded = false;
	this._percent = 0;
	this.siteLockBodyText = "It appears the website you are using is hosting an unauthorized copy of this game. " + "Storage or redistribution of this content, without the express permission of the " + "developer or other copyright holder, is prohibited under copyright law.\n\n" + "Thank you for your interest in this game! Please support the developer by " + "visiting the following website to play the game:";
	this.siteLockTitleText = "Sorry.";
	this.siteLockURLIndex = 0;
	this.minDisplayTime = 0;
	flixel_system__$FlxBasePreloader_DefaultPreloader.call(this);
	this.minDisplayTime = MinDisplayTime;
	if(AllowedURLs != null) {
		this.allowedURLs = AllowedURLs;
	} else {
		this.allowedURLs = [];
	}
	this._startTime = new Date().getTime();
};
$hxClasses["flixel.system.FlxBasePreloader"] = flixel_system_FlxBasePreloader;
flixel_system_FlxBasePreloader.__name__ = "flixel.system.FlxBasePreloader";
flixel_system_FlxBasePreloader.__super__ = flixel_system__$FlxBasePreloader_DefaultPreloader;
flixel_system_FlxBasePreloader.prototype = $extend(flixel_system__$FlxBasePreloader_DefaultPreloader.prototype,{
	minDisplayTime: null
	,allowedURLs: null
	,siteLockURLIndex: null
	,siteLockTitleText: null
	,siteLockBodyText: null
	,_percent: null
	,_width: null
	,_height: null
	,_loaded: null
	,_urlChecked: null
	,_destroyed: null
	,_startTime: null
	,create: function() {
	}
	,onInit: function() {
		flixel_system__$FlxBasePreloader_DefaultPreloader.prototype.onInit.call(this);
		openfl_Lib.get_current().stage.set_scaleMode(2);
		openfl_Lib.get_current().stage.align = 6;
		this.create();
		this.addEventListener("enterFrame",$bind(this,this.onEnterFrame));
		this.checkSiteLock();
	}
	,onUpdate: function(bytesLoaded,bytesTotal) {
		this._percent = bytesTotal != 0 ? bytesLoaded / bytesTotal : 0;
	}
	,onEnterFrame: function(E) {
		var time = new Date().getTime() - this._startTime;
		var min = this.minDisplayTime * 1000;
		var percent = this._percent;
		if(min > 0 && this._percent > time / min) {
			percent = time / min;
		}
		if(!this._destroyed) {
			this.update(percent);
		}
		if(this._loaded && (min <= 0 || time / min >= 1)) {
			this.removeEventListener("enterFrame",$bind(this,this.onEnterFrame));
			flixel_system__$FlxBasePreloader_DefaultPreloader.prototype.onLoaded.call(this);
			this.destroy();
			this._destroyed = true;
		}
	}
	,destroy: function() {
	}
	,update: function(Percent) {
	}
	,onLoaded: function() {
		this._loaded = true;
		this._percent = 1;
	}
	,createBitmap: function(bitmapDataClass,onLoad) {
		var bmp = new openfl_display_Bitmap();
		bmp.set_bitmapData(Type.createInstance(bitmapDataClass,[0,0,true,-1,function(_) {
			onLoad(bmp);
		}]));
		return bmp;
	}
	,loadBitmapData: function(bitmapDataClass,onLoad) {
		return Type.createInstance(bitmapDataClass,[0,0,true,-1,onLoad]);
	}
	,checkSiteLock: function() {
		if(this._urlChecked) {
			return;
		}
		if(!this.isHostUrlAllowed()) {
			this.removeChildren();
			this.removeEventListener("enterFrame",$bind(this,this.onEnterFrame));
			this.createSiteLockFailureScreen();
		} else {
			this._urlChecked = true;
		}
	}
	,createSiteLockFailureScreen: function() {
		this.addChild(this.createSiteLockFailureBackground(16777215,15066597));
		this.addChild(this.createSiteLockFailureIcon(15066597,0.9));
		this.addChild(this.createSiteLockFailureText(30));
	}
	,createSiteLockFailureBackground: function(innerColor,outerColor) {
		var shape = new openfl_display_Shape();
		var graphics = shape.get_graphics();
		graphics.clear();
		var fillMatrix = new openfl_geom_Matrix();
		fillMatrix.createGradientBox(1,1,0,-0.5,-0.5);
		var scaling = Math.max(this.stage.stageWidth,this.stage.stageHeight);
		fillMatrix.scale(scaling,scaling);
		fillMatrix.translate(0.5 * this.stage.stageWidth,0.5 * this.stage.stageHeight);
		graphics.beginGradientFill(1,[innerColor,outerColor],[1,1],[0,255],fillMatrix);
		graphics.drawRect(0,0,this.stage.stageWidth,this.stage.stageHeight);
		graphics.endFill();
		return shape;
	}
	,createSiteLockFailureIcon: function(color,scale) {
		var shape = new openfl_display_Shape();
		var graphics = shape.get_graphics();
		graphics.clear();
		graphics.beginFill(color);
		var array = [1,6,2,2,2,6,6,2,2,2,6,1,6,2,6,2,6,2,6,1,6,6,2,2,2,6,6];
		var vector = openfl_Vector.toIntVector(null);
		var _g = 0;
		var _g1 = array.length;
		while(_g < _g1) {
			var i = _g++;
			vector.set(i,array[i]);
		}
		var tmp = vector;
		var array = [120.0,0,164,0,200,35,200,79,200,130,160,130,160,79,160,57,142,40,120,40,97,40,79,57,79,79,80,130,40,130,40,79,40,35,75,0,120,0,220,140,231,140,240,148,240,160,240,300,240,311,231,320,220,320,20,320,8,320,0,311,0,300,0,160,0,148,8,140,20,140,120,190,108,190,100,198,100,210,100,217,104,223,110,227,110,270,130,270,130,227,135,223,140,217,140,210,140,198,131,190,120,190];
		var vector = openfl_Vector.toFloatVector(null);
		var _g = 0;
		var _g1 = array.length;
		while(_g < _g1) {
			var i = _g++;
			vector.set(i,array[i]);
		}
		graphics.drawPath(tmp,vector,1);
		graphics.endFill();
		var transformMatrix = new openfl_geom_Matrix();
		transformMatrix.translate(-0.5 * shape.get_width(),-0.5 * shape.get_height());
		var scaling = scale * Math.min(this.stage.stageWidth / shape.get_width(),this.stage.stageHeight / shape.get_height());
		transformMatrix.scale(scaling,scaling);
		transformMatrix.translate(0.5 * this.stage.stageWidth,0.5 * this.stage.stageHeight);
		shape.get_transform().set_matrix(transformMatrix);
		return shape;
	}
	,createSiteLockFailureText: function(margin) {
		var sprite = new openfl_display_Sprite();
		var bounds = new openfl_geom_Rectangle(0,0,this.stage.stageWidth,this.stage.stageHeight);
		bounds.inflate(-margin,-margin);
		var titleText = new openfl_text_TextField();
		var titleTextFormat = new openfl_text_TextFormat("_sans",33,3355443,true);
		titleTextFormat.align = 3;
		titleText.set_defaultTextFormat(titleTextFormat);
		titleText.set_selectable(false);
		titleText.set_width(bounds.width);
		titleText.set_text(this.siteLockTitleText);
		var bodyText = new openfl_text_TextField();
		var bodyTextFormat = new openfl_text_TextFormat("_sans",22,3355443);
		bodyTextFormat.align = 2;
		bodyText.set_defaultTextFormat(bodyTextFormat);
		bodyText.set_multiline(true);
		bodyText.set_wordWrap(true);
		bodyText.set_selectable(false);
		bodyText.set_width(bounds.width);
		bodyText.set_text(this.siteLockBodyText);
		var hyperlinkText = new openfl_text_TextField();
		var hyperlinkTextFormat = new openfl_text_TextFormat("_sans",22,7247820,true,false,true);
		hyperlinkTextFormat.align = 0;
		hyperlinkTextFormat.url = this.allowedURLs[this.siteLockURLIndex];
		hyperlinkText.set_defaultTextFormat(hyperlinkTextFormat);
		hyperlinkText.set_selectable(true);
		hyperlinkText.set_width(bounds.width);
		hyperlinkText.set_text(this.allowedURLs[this.siteLockURLIndex]);
		this.adjustSiteLockTextFields(titleText,bodyText,hyperlinkText);
		var gutterSize = 4;
		titleText.set_height(titleText.get_textHeight() + gutterSize);
		bodyText.set_height(bodyText.get_textHeight() + gutterSize);
		hyperlinkText.set_height(hyperlinkText.get_textHeight() + gutterSize);
		titleText.set_x(bodyText.set_x(hyperlinkText.set_x(bounds.get_left())));
		titleText.set_y(bounds.get_top());
		bodyText.set_y(titleText.get_y() + 2.0 * titleText.get_height());
		hyperlinkText.set_y(bodyText.get_y() + bodyText.get_height() + hyperlinkText.get_height());
		sprite.addChild(titleText);
		sprite.addChild(bodyText);
		sprite.addChild(hyperlinkText);
		return sprite;
	}
	,adjustSiteLockTextFields: function(titleText,bodyText,hyperlinkText) {
	}
	,goToMyURL: function(e) {
		if(this.allowedURLs[this.siteLockURLIndex] != "localhost") {
			var URL1 = this.allowedURLs[this.siteLockURLIndex];
			var prefix = "";
			if(!new EReg("^https?://","").match(URL1)) {
				prefix = "http://";
			}
			openfl_Lib.getURL(new openfl_net_URLRequest(prefix + URL1),"_blank");
		} else {
			openfl_Lib.getURL(new openfl_net_URLRequest(this.allowedURLs[this.siteLockURLIndex]));
		}
	}
	,isHostUrlAllowed: function() {
		if(this.allowedURLs.length == 0) {
			return true;
		}
		var homeURL = $global.location.href;
		var homeDomain = flixel_util_FlxStringUtil.getDomain(homeURL);
		var _g = 0;
		var _g1 = this.allowedURLs;
		while(_g < _g1.length) {
			var allowedURL = _g1[_g];
			++_g;
			var allowedDomain = flixel_util_FlxStringUtil.getDomain(allowedURL);
			if(allowedDomain == homeDomain) {
				return true;
			}
		}
		return false;
	}
	,__class__: flixel_system_FlxBasePreloader
});
var flixel_system_FlxLinkedList = function() {
	this.exists = true;
};
$hxClasses["flixel.system.FlxLinkedList"] = flixel_system_FlxLinkedList;
flixel_system_FlxLinkedList.__name__ = "flixel.system.FlxLinkedList";
flixel_system_FlxLinkedList.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_system_FlxLinkedList._cachedListsHead = null;
flixel_system_FlxLinkedList.recycle = function() {
	if(flixel_system_FlxLinkedList._cachedListsHead != null) {
		var cachedList = flixel_system_FlxLinkedList._cachedListsHead;
		flixel_system_FlxLinkedList._cachedListsHead = flixel_system_FlxLinkedList._cachedListsHead.next;
		flixel_system_FlxLinkedList._NUM_CACHED_FLX_LIST--;
		cachedList.exists = true;
		cachedList.next = null;
		return cachedList;
	} else {
		return new flixel_system_FlxLinkedList();
	}
};
flixel_system_FlxLinkedList.clearCache = function() {
	while(flixel_system_FlxLinkedList._cachedListsHead != null) {
		var node = flixel_system_FlxLinkedList._cachedListsHead;
		flixel_system_FlxLinkedList._cachedListsHead = flixel_system_FlxLinkedList._cachedListsHead.next;
		node.object = null;
		node.next = null;
	}
	flixel_system_FlxLinkedList._NUM_CACHED_FLX_LIST = 0;
};
flixel_system_FlxLinkedList.prototype = {
	object: null
	,next: null
	,exists: null
	,destroy: function() {
		if(!this.exists) {
			return;
		}
		this.object = null;
		if(this.next != null) {
			this.next.destroy();
		}
		this.exists = false;
		this.next = flixel_system_FlxLinkedList._cachedListsHead;
		flixel_system_FlxLinkedList._cachedListsHead = this;
		flixel_system_FlxLinkedList._NUM_CACHED_FLX_LIST++;
	}
	,__class__: flixel_system_FlxLinkedList
};
var flixel_system__$FlxPreloader_GraphicLogoLight = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system__$FlxPreloader_GraphicLogoLight.preload != null) {
		this.__fromImage(flixel_system__$FlxPreloader_GraphicLogoLight.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system__$FlxPreloader_GraphicLogoLight.resourceName),flixel_system__$FlxPreloader_GraphicLogoLight.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system__$FlxPreloader_GraphicLogoLight.preload == null) {
				flixel_system__$FlxPreloader_GraphicLogoLight.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system._FlxPreloader.GraphicLogoLight"] = flixel_system__$FlxPreloader_GraphicLogoLight;
flixel_system__$FlxPreloader_GraphicLogoLight.__name__ = "flixel.system._FlxPreloader.GraphicLogoLight";
flixel_system__$FlxPreloader_GraphicLogoLight.preload = null;
flixel_system__$FlxPreloader_GraphicLogoLight.__super__ = openfl_display_BitmapData;
flixel_system__$FlxPreloader_GraphicLogoLight.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system__$FlxPreloader_GraphicLogoLight
});
var flixel_system__$FlxPreloader_GraphicLogoCorners = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system__$FlxPreloader_GraphicLogoCorners.preload != null) {
		this.__fromImage(flixel_system__$FlxPreloader_GraphicLogoCorners.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system__$FlxPreloader_GraphicLogoCorners.resourceName),flixel_system__$FlxPreloader_GraphicLogoCorners.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system__$FlxPreloader_GraphicLogoCorners.preload == null) {
				flixel_system__$FlxPreloader_GraphicLogoCorners.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system._FlxPreloader.GraphicLogoCorners"] = flixel_system__$FlxPreloader_GraphicLogoCorners;
flixel_system__$FlxPreloader_GraphicLogoCorners.__name__ = "flixel.system._FlxPreloader.GraphicLogoCorners";
flixel_system__$FlxPreloader_GraphicLogoCorners.preload = null;
flixel_system__$FlxPreloader_GraphicLogoCorners.__super__ = openfl_display_BitmapData;
flixel_system__$FlxPreloader_GraphicLogoCorners.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system__$FlxPreloader_GraphicLogoCorners
});
var flixel_system_FlxPreloader = function(MinDisplayTime,AllowedURLs) {
	if(MinDisplayTime == null) {
		MinDisplayTime = 0;
	}
	flixel_system_FlxBasePreloader.call(this,MinDisplayTime,AllowedURLs);
};
$hxClasses["flixel.system.FlxPreloader"] = flixel_system_FlxPreloader;
flixel_system_FlxPreloader.__name__ = "flixel.system.FlxPreloader";
flixel_system_FlxPreloader.__super__ = flixel_system_FlxBasePreloader;
flixel_system_FlxPreloader.prototype = $extend(flixel_system_FlxBasePreloader.prototype,{
	_buffer: null
	,_bmpBar: null
	,_text: null
	,_logo: null
	,_logoGlow: null
	,create: function() {
		var _gthis = this;
		this._buffer = new openfl_display_Sprite();
		this._buffer.set_scaleX(this._buffer.set_scaleY(2));
		this.addChild(this._buffer);
		this._width = openfl_Lib.get_current().stage.stageWidth / this._buffer.get_scaleX() | 0;
		this._height = openfl_Lib.get_current().stage.stageHeight / this._buffer.get_scaleY() | 0;
		this._buffer.addChild(new openfl_display_Bitmap(new openfl_display_BitmapData(this._width,this._height,false,13406)));
		var logoLight = this.createBitmap(flixel_system__$FlxPreloader_GraphicLogoLight,function(logoLight) {
			logoLight.set_width(logoLight.set_height(_gthis._height));
			logoLight.set_x((_gthis._width - logoLight.get_width()) / 2);
		});
		logoLight.smoothing = true;
		this._buffer.addChild(logoLight);
		this._bmpBar = new openfl_display_Bitmap(new openfl_display_BitmapData(1,7,false,6253311));
		this._bmpBar.set_x(4);
		this._bmpBar.set_y(this._height - 11);
		this._buffer.addChild(this._bmpBar);
		this._text = new openfl_text_TextField();
		this._text.set_defaultTextFormat(new openfl_text_TextFormat(flixel_system_FlxAssets.FONT_DEFAULT,8,6253311));
		this._text.set_embedFonts(true);
		this._text.set_selectable(false);
		this._text.set_multiline(false);
		this._text.set_x(2);
		this._text.set_y(this._bmpBar.get_y() - 11);
		this._text.set_width(200);
		this._buffer.addChild(this._text);
		this._logo = new openfl_display_Sprite();
		flixel_system_FlxAssets.drawLogo(this._logo.get_graphics());
		this._logo.set_scaleX(this._logo.set_scaleY(this._height / 8 * 0.04));
		this._logo.set_x((this._width - this._logo.get_width()) / 2);
		this._logo.set_y((this._height - this._logo.get_height()) / 2);
		this._buffer.addChild(this._logo);
		this._logoGlow = new openfl_display_Sprite();
		flixel_system_FlxAssets.drawLogo(this._logoGlow.get_graphics());
		this._logoGlow.set_blendMode(12);
		this._logoGlow.set_scaleX(this._logoGlow.set_scaleY(this._height / 8 * 0.04));
		this._logoGlow.set_x((this._width - this._logoGlow.get_width()) / 2);
		this._logoGlow.set_y((this._height - this._logoGlow.get_height()) / 2);
		this._buffer.addChild(this._logoGlow);
		var corners = this.createBitmap(flixel_system__$FlxPreloader_GraphicLogoCorners,function(corners) {
			corners.set_width(_gthis._width);
			corners.set_height(_gthis.get_height());
		});
		corners.smoothing = true;
		this._buffer.addChild(corners);
		var bitmap = new openfl_display_Bitmap(new openfl_display_BitmapData(this._width,this._height,false,16777215));
		var i = 0;
		var j = 0;
		while(i < this._height) {
			j = 0;
			while(j < this._width) bitmap.get_bitmapData().setPixel(j++,i,0);
			i += 2;
		}
		bitmap.set_blendMode(11);
		bitmap.set_alpha(0.25);
		this._buffer.addChild(bitmap);
		flixel_system_FlxBasePreloader.prototype.create.call(this);
	}
	,destroy: function() {
		if(this._buffer != null) {
			this.removeChild(this._buffer);
		}
		this._buffer = null;
		this._bmpBar = null;
		this._text = null;
		this._logo = null;
		this._logoGlow = null;
		flixel_system_FlxBasePreloader.prototype.destroy.call(this);
	}
	,update: function(Percent) {
		this._bmpBar.set_scaleX(Percent * (this._width - 8));
		this._text.set_text(Std.string(flixel_FlxG.VERSION) + " " + (Percent * 100 | 0) + "%");
		if(Percent < 0.1) {
			this._logoGlow.set_alpha(0);
			this._logo.set_alpha(0);
		} else if(Percent < 0.15) {
			this._logoGlow.set_alpha(Math.random());
			this._logo.set_alpha(0);
		} else if(Percent < 0.2) {
			this._logoGlow.set_alpha(0);
			this._logo.set_alpha(0);
		} else if(Percent < 0.25) {
			this._logoGlow.set_alpha(0);
			this._logo.set_alpha(Math.random());
		} else if(Percent < 0.7) {
			this._logoGlow.set_alpha((Percent - 0.45) / 0.45);
			this._logo.set_alpha(1);
		} else if(Percent > 0.8 && Percent < 0.9) {
			this._logoGlow.set_alpha(1 - (Percent - 0.8) / 0.1);
			this._logo.set_alpha(0);
		} else if(Percent > 0.9) {
			this._buffer.set_alpha(1 - (Percent - 0.9) / 0.1);
		}
	}
	,__class__: flixel_system_FlxPreloader
});
var flixel_system_FlxQuadTree = function(X,Y,Width,Height,Parent) {
	flixel_math_FlxRect.call(this);
	var X1 = X;
	var Y1 = Y;
	var Width1 = Width;
	var Height1 = Height;
	if(Height1 == null) {
		Height1 = 0;
	}
	if(Width1 == null) {
		Width1 = 0;
	}
	if(Y1 == null) {
		Y1 = 0;
	}
	if(X1 == null) {
		X1 = 0;
	}
	this.x = X1;
	this.y = Y1;
	this.width = Width1;
	this.height = Height1;
	this.reset(X,Y,Width,Height,Parent);
};
$hxClasses["flixel.system.FlxQuadTree"] = flixel_system_FlxQuadTree;
flixel_system_FlxQuadTree.__name__ = "flixel.system.FlxQuadTree";
flixel_system_FlxQuadTree.divisions = null;
flixel_system_FlxQuadTree._min = null;
flixel_system_FlxQuadTree._object = null;
flixel_system_FlxQuadTree._objectLeftEdge = null;
flixel_system_FlxQuadTree._objectTopEdge = null;
flixel_system_FlxQuadTree._objectRightEdge = null;
flixel_system_FlxQuadTree._objectBottomEdge = null;
flixel_system_FlxQuadTree._list = null;
flixel_system_FlxQuadTree._useBothLists = null;
flixel_system_FlxQuadTree._processingCallback = null;
flixel_system_FlxQuadTree._notifyCallback = null;
flixel_system_FlxQuadTree._iterator = null;
flixel_system_FlxQuadTree._objectHullX = null;
flixel_system_FlxQuadTree._objectHullY = null;
flixel_system_FlxQuadTree._objectHullWidth = null;
flixel_system_FlxQuadTree._objectHullHeight = null;
flixel_system_FlxQuadTree._checkObjectHullX = null;
flixel_system_FlxQuadTree._checkObjectHullY = null;
flixel_system_FlxQuadTree._checkObjectHullWidth = null;
flixel_system_FlxQuadTree._checkObjectHullHeight = null;
flixel_system_FlxQuadTree._cachedTreesHead = null;
flixel_system_FlxQuadTree.recycle = function(X,Y,Width,Height,Parent) {
	if(flixel_system_FlxQuadTree._cachedTreesHead != null) {
		var cachedTree = flixel_system_FlxQuadTree._cachedTreesHead;
		flixel_system_FlxQuadTree._cachedTreesHead = flixel_system_FlxQuadTree._cachedTreesHead.next;
		flixel_system_FlxQuadTree._NUM_CACHED_QUAD_TREES--;
		cachedTree.reset(X,Y,Width,Height,Parent);
		return cachedTree;
	} else {
		return new flixel_system_FlxQuadTree(X,Y,Width,Height,Parent);
	}
};
flixel_system_FlxQuadTree.clearCache = function() {
	while(flixel_system_FlxQuadTree._cachedTreesHead != null) {
		var node = flixel_system_FlxQuadTree._cachedTreesHead;
		flixel_system_FlxQuadTree._cachedTreesHead = flixel_system_FlxQuadTree._cachedTreesHead.next;
		node.next = null;
	}
	flixel_system_FlxQuadTree._NUM_CACHED_QUAD_TREES = 0;
};
flixel_system_FlxQuadTree.__super__ = flixel_math_FlxRect;
flixel_system_FlxQuadTree.prototype = $extend(flixel_math_FlxRect.prototype,{
	exists: null
	,_canSubdivide: null
	,_headA: null
	,_tailA: null
	,_headB: null
	,_tailB: null
	,_northWestTree: null
	,_northEastTree: null
	,_southEastTree: null
	,_southWestTree: null
	,_leftEdge: null
	,_rightEdge: null
	,_topEdge: null
	,_bottomEdge: null
	,_halfWidth: null
	,_halfHeight: null
	,_midpointX: null
	,_midpointY: null
	,next: null
	,reset: function(X,Y,Width,Height,Parent) {
		this.exists = true;
		var X1 = X;
		var Y1 = Y;
		var Width1 = Width;
		var Height1 = Height;
		if(Height1 == null) {
			Height1 = 0;
		}
		if(Width1 == null) {
			Width1 = 0;
		}
		if(Y1 == null) {
			Y1 = 0;
		}
		if(X1 == null) {
			X1 = 0;
		}
		this.x = X1;
		this.y = Y1;
		this.width = Width1;
		this.height = Height1;
		this._headA = this._tailA = flixel_system_FlxLinkedList.recycle();
		this._headB = this._tailB = flixel_system_FlxLinkedList.recycle();
		if(Parent != null) {
			var iterator;
			var ot;
			if(Parent._headA.object != null) {
				iterator = Parent._headA;
				while(iterator != null) {
					if(this._tailA.object != null) {
						ot = this._tailA;
						this._tailA = flixel_system_FlxLinkedList.recycle();
						ot.next = this._tailA;
					}
					this._tailA.object = iterator.object;
					iterator = iterator.next;
				}
			}
			if(Parent._headB.object != null) {
				iterator = Parent._headB;
				while(iterator != null) {
					if(this._tailB.object != null) {
						ot = this._tailB;
						this._tailB = flixel_system_FlxLinkedList.recycle();
						ot.next = this._tailB;
					}
					this._tailB.object = iterator.object;
					iterator = iterator.next;
				}
			}
		} else {
			flixel_system_FlxQuadTree._min = Math.floor((this.width + this.height) / (2 * flixel_system_FlxQuadTree.divisions));
		}
		this._canSubdivide = this.width > flixel_system_FlxQuadTree._min || this.height > flixel_system_FlxQuadTree._min;
		this._northWestTree = null;
		this._northEastTree = null;
		this._southEastTree = null;
		this._southWestTree = null;
		this._leftEdge = this.x;
		this._rightEdge = this.x + this.width;
		this._halfWidth = this.width / 2;
		this._midpointX = this._leftEdge + this._halfWidth;
		this._topEdge = this.y;
		this._bottomEdge = this.y + this.height;
		this._halfHeight = this.height / 2;
		this._midpointY = this._topEdge + this._halfHeight;
	}
	,destroy: function() {
		this._headA = flixel_util_FlxDestroyUtil.destroy(this._headA);
		this._headB = flixel_util_FlxDestroyUtil.destroy(this._headB);
		this._tailA = flixel_util_FlxDestroyUtil.destroy(this._tailA);
		this._tailB = flixel_util_FlxDestroyUtil.destroy(this._tailB);
		this._northWestTree = flixel_util_FlxDestroyUtil.destroy(this._northWestTree);
		this._northEastTree = flixel_util_FlxDestroyUtil.destroy(this._northEastTree);
		this._southWestTree = flixel_util_FlxDestroyUtil.destroy(this._southWestTree);
		this._southEastTree = flixel_util_FlxDestroyUtil.destroy(this._southEastTree);
		flixel_system_FlxQuadTree._object = null;
		flixel_system_FlxQuadTree._processingCallback = null;
		flixel_system_FlxQuadTree._notifyCallback = null;
		this.exists = false;
		this.next = flixel_system_FlxQuadTree._cachedTreesHead;
		flixel_system_FlxQuadTree._cachedTreesHead = this;
		flixel_system_FlxQuadTree._NUM_CACHED_QUAD_TREES++;
		flixel_math_FlxRect.prototype.destroy.call(this);
	}
	,load: function(ObjectOrGroup1,ObjectOrGroup2,NotifyCallback,ProcessCallback) {
		this.add(ObjectOrGroup1,0);
		if(ObjectOrGroup2 != null) {
			this.add(ObjectOrGroup2,1);
			flixel_system_FlxQuadTree._useBothLists = true;
		} else {
			flixel_system_FlxQuadTree._useBothLists = false;
		}
		flixel_system_FlxQuadTree._notifyCallback = NotifyCallback;
		flixel_system_FlxQuadTree._processingCallback = ProcessCallback;
	}
	,add: function(ObjectOrGroup,list) {
		flixel_system_FlxQuadTree._list = list;
		var group = flixel_group_FlxTypedGroup.resolveGroup(ObjectOrGroup);
		if(group != null) {
			var i = 0;
			var basic;
			var members = group.members;
			var l = group.length;
			while(i < l) {
				basic = members[i++];
				if(basic != null && basic.exists) {
					group = flixel_group_FlxTypedGroup.resolveGroup(basic);
					if(group != null) {
						this.add(group,list);
					} else {
						flixel_system_FlxQuadTree._object = basic;
						if(flixel_system_FlxQuadTree._object.exists && flixel_system_FlxQuadTree._object.allowCollisions != 0) {
							flixel_system_FlxQuadTree._objectLeftEdge = flixel_system_FlxQuadTree._object.x;
							flixel_system_FlxQuadTree._objectTopEdge = flixel_system_FlxQuadTree._object.y;
							flixel_system_FlxQuadTree._objectRightEdge = flixel_system_FlxQuadTree._object.x + flixel_system_FlxQuadTree._object.get_width();
							flixel_system_FlxQuadTree._objectBottomEdge = flixel_system_FlxQuadTree._object.y + flixel_system_FlxQuadTree._object.get_height();
							this.addObject();
						}
					}
				}
			}
		} else {
			flixel_system_FlxQuadTree._object = ObjectOrGroup;
			if(flixel_system_FlxQuadTree._object.exists && flixel_system_FlxQuadTree._object.allowCollisions != 0) {
				flixel_system_FlxQuadTree._objectLeftEdge = flixel_system_FlxQuadTree._object.x;
				flixel_system_FlxQuadTree._objectTopEdge = flixel_system_FlxQuadTree._object.y;
				flixel_system_FlxQuadTree._objectRightEdge = flixel_system_FlxQuadTree._object.x + flixel_system_FlxQuadTree._object.get_width();
				flixel_system_FlxQuadTree._objectBottomEdge = flixel_system_FlxQuadTree._object.y + flixel_system_FlxQuadTree._object.get_height();
				this.addObject();
			}
		}
	}
	,addObject: function() {
		if(!this._canSubdivide || this._leftEdge >= flixel_system_FlxQuadTree._objectLeftEdge && this._rightEdge <= flixel_system_FlxQuadTree._objectRightEdge && this._topEdge >= flixel_system_FlxQuadTree._objectTopEdge && this._bottomEdge <= flixel_system_FlxQuadTree._objectBottomEdge) {
			this.addToList();
			return;
		}
		if(flixel_system_FlxQuadTree._objectLeftEdge > this._leftEdge && flixel_system_FlxQuadTree._objectRightEdge < this._midpointX) {
			if(flixel_system_FlxQuadTree._objectTopEdge > this._topEdge && flixel_system_FlxQuadTree._objectBottomEdge < this._midpointY) {
				if(this._northWestTree == null) {
					this._northWestTree = flixel_system_FlxQuadTree.recycle(this._leftEdge,this._topEdge,this._halfWidth,this._halfHeight,this);
				}
				this._northWestTree.addObject();
				return;
			}
			if(flixel_system_FlxQuadTree._objectTopEdge > this._midpointY && flixel_system_FlxQuadTree._objectBottomEdge < this._bottomEdge) {
				if(this._southWestTree == null) {
					this._southWestTree = flixel_system_FlxQuadTree.recycle(this._leftEdge,this._midpointY,this._halfWidth,this._halfHeight,this);
				}
				this._southWestTree.addObject();
				return;
			}
		}
		if(flixel_system_FlxQuadTree._objectLeftEdge > this._midpointX && flixel_system_FlxQuadTree._objectRightEdge < this._rightEdge) {
			if(flixel_system_FlxQuadTree._objectTopEdge > this._topEdge && flixel_system_FlxQuadTree._objectBottomEdge < this._midpointY) {
				if(this._northEastTree == null) {
					this._northEastTree = flixel_system_FlxQuadTree.recycle(this._midpointX,this._topEdge,this._halfWidth,this._halfHeight,this);
				}
				this._northEastTree.addObject();
				return;
			}
			if(flixel_system_FlxQuadTree._objectTopEdge > this._midpointY && flixel_system_FlxQuadTree._objectBottomEdge < this._bottomEdge) {
				if(this._southEastTree == null) {
					this._southEastTree = flixel_system_FlxQuadTree.recycle(this._midpointX,this._midpointY,this._halfWidth,this._halfHeight,this);
				}
				this._southEastTree.addObject();
				return;
			}
		}
		if(flixel_system_FlxQuadTree._objectRightEdge > this._leftEdge && flixel_system_FlxQuadTree._objectLeftEdge < this._midpointX && flixel_system_FlxQuadTree._objectBottomEdge > this._topEdge && flixel_system_FlxQuadTree._objectTopEdge < this._midpointY) {
			if(this._northWestTree == null) {
				this._northWestTree = flixel_system_FlxQuadTree.recycle(this._leftEdge,this._topEdge,this._halfWidth,this._halfHeight,this);
			}
			this._northWestTree.addObject();
		}
		if(flixel_system_FlxQuadTree._objectRightEdge > this._midpointX && flixel_system_FlxQuadTree._objectLeftEdge < this._rightEdge && flixel_system_FlxQuadTree._objectBottomEdge > this._topEdge && flixel_system_FlxQuadTree._objectTopEdge < this._midpointY) {
			if(this._northEastTree == null) {
				this._northEastTree = flixel_system_FlxQuadTree.recycle(this._midpointX,this._topEdge,this._halfWidth,this._halfHeight,this);
			}
			this._northEastTree.addObject();
		}
		if(flixel_system_FlxQuadTree._objectRightEdge > this._midpointX && flixel_system_FlxQuadTree._objectLeftEdge < this._rightEdge && flixel_system_FlxQuadTree._objectBottomEdge > this._midpointY && flixel_system_FlxQuadTree._objectTopEdge < this._bottomEdge) {
			if(this._southEastTree == null) {
				this._southEastTree = flixel_system_FlxQuadTree.recycle(this._midpointX,this._midpointY,this._halfWidth,this._halfHeight,this);
			}
			this._southEastTree.addObject();
		}
		if(flixel_system_FlxQuadTree._objectRightEdge > this._leftEdge && flixel_system_FlxQuadTree._objectLeftEdge < this._midpointX && flixel_system_FlxQuadTree._objectBottomEdge > this._midpointY && flixel_system_FlxQuadTree._objectTopEdge < this._bottomEdge) {
			if(this._southWestTree == null) {
				this._southWestTree = flixel_system_FlxQuadTree.recycle(this._leftEdge,this._midpointY,this._halfWidth,this._halfHeight,this);
			}
			this._southWestTree.addObject();
		}
	}
	,addToList: function() {
		var ot;
		if(flixel_system_FlxQuadTree._list == 0) {
			if(this._tailA.object != null) {
				ot = this._tailA;
				this._tailA = flixel_system_FlxLinkedList.recycle();
				ot.next = this._tailA;
			}
			this._tailA.object = flixel_system_FlxQuadTree._object;
		} else {
			if(this._tailB.object != null) {
				ot = this._tailB;
				this._tailB = flixel_system_FlxLinkedList.recycle();
				ot.next = this._tailB;
			}
			this._tailB.object = flixel_system_FlxQuadTree._object;
		}
		if(!this._canSubdivide) {
			return;
		}
		if(this._northWestTree != null) {
			this._northWestTree.addToList();
		}
		if(this._northEastTree != null) {
			this._northEastTree.addToList();
		}
		if(this._southEastTree != null) {
			this._southEastTree.addToList();
		}
		if(this._southWestTree != null) {
			this._southWestTree.addToList();
		}
	}
	,execute: function() {
		var overlapProcessed = false;
		if(this._headA.object != null) {
			var iterator = this._headA;
			while(iterator != null) {
				flixel_system_FlxQuadTree._object = iterator.object;
				if(flixel_system_FlxQuadTree._useBothLists) {
					flixel_system_FlxQuadTree._iterator = this._headB;
				} else {
					flixel_system_FlxQuadTree._iterator = iterator.next;
				}
				if(flixel_system_FlxQuadTree._object != null && flixel_system_FlxQuadTree._object.exists && flixel_system_FlxQuadTree._object.allowCollisions > 0 && flixel_system_FlxQuadTree._iterator != null && flixel_system_FlxQuadTree._iterator.object != null && this.overlapNode()) {
					overlapProcessed = true;
				}
				iterator = iterator.next;
			}
		}
		if(this._northWestTree != null && this._northWestTree.execute()) {
			overlapProcessed = true;
		}
		if(this._northEastTree != null && this._northEastTree.execute()) {
			overlapProcessed = true;
		}
		if(this._southEastTree != null && this._southEastTree.execute()) {
			overlapProcessed = true;
		}
		if(this._southWestTree != null && this._southWestTree.execute()) {
			overlapProcessed = true;
		}
		return overlapProcessed;
	}
	,overlapNode: function() {
		flixel_system_FlxQuadTree._objectHullX = flixel_system_FlxQuadTree._object.x < flixel_system_FlxQuadTree._object.last.x ? flixel_system_FlxQuadTree._object.x : flixel_system_FlxQuadTree._object.last.x;
		flixel_system_FlxQuadTree._objectHullY = flixel_system_FlxQuadTree._object.y < flixel_system_FlxQuadTree._object.last.y ? flixel_system_FlxQuadTree._object.y : flixel_system_FlxQuadTree._object.last.y;
		flixel_system_FlxQuadTree._objectHullWidth = flixel_system_FlxQuadTree._object.x - flixel_system_FlxQuadTree._object.last.x;
		flixel_system_FlxQuadTree._objectHullWidth = flixel_system_FlxQuadTree._object.get_width() + (flixel_system_FlxQuadTree._objectHullWidth > 0 ? flixel_system_FlxQuadTree._objectHullWidth : -flixel_system_FlxQuadTree._objectHullWidth);
		flixel_system_FlxQuadTree._objectHullHeight = flixel_system_FlxQuadTree._object.y - flixel_system_FlxQuadTree._object.last.y;
		flixel_system_FlxQuadTree._objectHullHeight = flixel_system_FlxQuadTree._object.get_height() + (flixel_system_FlxQuadTree._objectHullHeight > 0 ? flixel_system_FlxQuadTree._objectHullHeight : -flixel_system_FlxQuadTree._objectHullHeight);
		var overlapProcessed = false;
		var checkObject;
		while(flixel_system_FlxQuadTree._iterator != null) {
			checkObject = flixel_system_FlxQuadTree._iterator.object;
			if(flixel_system_FlxQuadTree._object == checkObject || !checkObject.exists || checkObject.allowCollisions <= 0) {
				flixel_system_FlxQuadTree._iterator = flixel_system_FlxQuadTree._iterator.next;
				continue;
			}
			flixel_system_FlxQuadTree._checkObjectHullX = checkObject.x < checkObject.last.x ? checkObject.x : checkObject.last.x;
			flixel_system_FlxQuadTree._checkObjectHullY = checkObject.y < checkObject.last.y ? checkObject.y : checkObject.last.y;
			flixel_system_FlxQuadTree._checkObjectHullWidth = checkObject.x - checkObject.last.x;
			flixel_system_FlxQuadTree._checkObjectHullWidth = checkObject.get_width() + (flixel_system_FlxQuadTree._checkObjectHullWidth > 0 ? flixel_system_FlxQuadTree._checkObjectHullWidth : -flixel_system_FlxQuadTree._checkObjectHullWidth);
			flixel_system_FlxQuadTree._checkObjectHullHeight = checkObject.y - checkObject.last.y;
			flixel_system_FlxQuadTree._checkObjectHullHeight = checkObject.get_height() + (flixel_system_FlxQuadTree._checkObjectHullHeight > 0 ? flixel_system_FlxQuadTree._checkObjectHullHeight : -flixel_system_FlxQuadTree._checkObjectHullHeight);
			if(flixel_system_FlxQuadTree._objectHullX + flixel_system_FlxQuadTree._objectHullWidth > flixel_system_FlxQuadTree._checkObjectHullX && flixel_system_FlxQuadTree._objectHullX < flixel_system_FlxQuadTree._checkObjectHullX + flixel_system_FlxQuadTree._checkObjectHullWidth && flixel_system_FlxQuadTree._objectHullY + flixel_system_FlxQuadTree._objectHullHeight > flixel_system_FlxQuadTree._checkObjectHullY && flixel_system_FlxQuadTree._objectHullY < flixel_system_FlxQuadTree._checkObjectHullY + flixel_system_FlxQuadTree._checkObjectHullHeight) {
				if(flixel_system_FlxQuadTree._processingCallback == null || flixel_system_FlxQuadTree._processingCallback(flixel_system_FlxQuadTree._object,checkObject)) {
					overlapProcessed = true;
					if(flixel_system_FlxQuadTree._notifyCallback != null) {
						flixel_system_FlxQuadTree._notifyCallback(flixel_system_FlxQuadTree._object,checkObject);
					}
				}
			}
			if(flixel_system_FlxQuadTree._iterator != null) {
				flixel_system_FlxQuadTree._iterator = flixel_system_FlxQuadTree._iterator.next;
			}
		}
		return overlapProcessed;
	}
	,__class__: flixel_system_FlxQuadTree
});
var flixel_system_FlxSound = function() {
	this._alreadyPaused = false;
	this._volumeAdjust = 1.0;
	this._length = 0;
	this._time = 0;
	this.loopTime = 0;
	flixel_FlxBasic.call(this);
	this.reset();
};
$hxClasses["flixel.system.FlxSound"] = flixel_system_FlxSound;
flixel_system_FlxSound.__name__ = "flixel.system.FlxSound";
flixel_system_FlxSound.__super__ = flixel_FlxBasic;
flixel_system_FlxSound.prototype = $extend(flixel_FlxBasic.prototype,{
	x: null
	,y: null
	,persist: null
	,name: null
	,artist: null
	,amplitude: null
	,amplitudeLeft: null
	,amplitudeRight: null
	,autoDestroy: null
	,onComplete: null
	,group: null
	,looped: null
	,loopTime: null
	,endTime: null
	,fadeTween: null
	,_sound: null
	,_channel: null
	,_transform: null
	,_paused: null
	,_volume: null
	,_time: null
	,_length: null
	,_volumeAdjust: null
	,_target: null
	,_radius: null
	,_proximityPan: null
	,_alreadyPaused: null
	,reset: function() {
		this.destroy();
		this.x = 0;
		this.y = 0;
		this._time = 0;
		this._paused = false;
		this._volume = 1.0;
		this._volumeAdjust = 1.0;
		this.looped = false;
		this.loopTime = 0.0;
		this.endTime = 0.0;
		this._target = null;
		this._radius = 0;
		this._proximityPan = false;
		this.set_visible(false);
		this.amplitude = 0;
		this.amplitudeLeft = 0;
		this.amplitudeRight = 0;
		this.autoDestroy = false;
		if(this._transform == null) {
			this._transform = new openfl_media_SoundTransform();
		}
		this._transform.pan = 0;
	}
	,destroy: function() {
		this._transform = null;
		this.set_exists(false);
		this.set_active(false);
		this._target = null;
		this.name = null;
		this.artist = null;
		if(this._channel != null) {
			this._channel.removeEventListener("soundComplete",$bind(this,this.stopped));
			this._channel.stop();
			this._channel = null;
		}
		if(this._sound != null) {
			this._sound.removeEventListener("id3",$bind(this,this.gotID3));
			this._sound = null;
		}
		this.onComplete = null;
		flixel_FlxBasic.prototype.destroy.call(this);
	}
	,update: function(elapsed) {
		if(this._channel == null) {
			return;
		}
		this._time = this._channel.get_position();
		var radialMultiplier = 1.0;
		if(this._target != null) {
			var targetPosition = this._target.getPosition();
			var X = this.x;
			var Y = this.y;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var X1 = X;
			var Y1 = Y;
			if(Y1 == null) {
				Y1 = 0;
			}
			if(X1 == null) {
				X1 = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X1,Y1);
			point._inPool = false;
			var point1 = point;
			point1._weak = true;
			radialMultiplier = targetPosition.distanceTo(point1) / this._radius;
			targetPosition.put();
			var lowerBound = radialMultiplier < 0 ? 0 : radialMultiplier;
			radialMultiplier = 1 - (lowerBound > 1 ? 1 : lowerBound);
			if(this._proximityPan) {
				var d = (this.x - this._target.x) / this._radius;
				var lowerBound = d < -1 ? -1 : d;
				this._transform.pan = lowerBound > 1 ? 1 : lowerBound;
			}
		}
		this._volumeAdjust = radialMultiplier;
		this.updateTransform();
		if(this._transform.volume > 0) {
			this.amplitudeLeft = this._channel.leftPeak / this._transform.volume;
			this.amplitudeRight = this._channel.rightPeak / this._transform.volume;
			this.amplitude = (this.amplitudeLeft + this.amplitudeRight) * 0.5;
		} else {
			this.amplitudeLeft = 0;
			this.amplitudeRight = 0;
			this.amplitude = 0;
		}
		if(this.endTime != null && this._time >= this.endTime) {
			this.stopped();
		}
	}
	,kill: function() {
		flixel_FlxBasic.prototype.kill.call(this);
		this.cleanup(false);
	}
	,loadEmbedded: function(EmbeddedSound,Looped,AutoDestroy,OnComplete) {
		if(AutoDestroy == null) {
			AutoDestroy = false;
		}
		if(Looped == null) {
			Looped = false;
		}
		if(EmbeddedSound == null) {
			return this;
		}
		this.cleanup(true);
		if(((EmbeddedSound) instanceof openfl_media_Sound)) {
			this._sound = EmbeddedSound;
		} else if(js_Boot.__instanceof(EmbeddedSound,Class)) {
			this._sound = Type.createInstance(EmbeddedSound,[]);
		} else if(typeof(EmbeddedSound) == "string") {
			if(openfl_utils_Assets.exists(EmbeddedSound,"SOUND") || openfl_utils_Assets.exists(EmbeddedSound,"MUSIC")) {
				this._sound = openfl_utils_Assets.getSound(EmbeddedSound);
			}
		}
		return this.init(Looped,AutoDestroy,OnComplete);
	}
	,loadStream: function(SoundURL,Looped,AutoDestroy,OnComplete,OnLoad) {
		if(AutoDestroy == null) {
			AutoDestroy = false;
		}
		if(Looped == null) {
			Looped = false;
		}
		var _gthis = this;
		this.cleanup(true);
		this._sound = new openfl_media_Sound();
		this._sound.addEventListener("id3",$bind(this,this.gotID3));
		var loadCallback = null;
		loadCallback = function(e) {
			e.target.removeEventListener(e.type,loadCallback);
			if(_gthis._sound == e.target) {
				_gthis._length = _gthis._sound.get_length();
				if(OnLoad != null) {
					OnLoad();
				}
			}
		};
		this._sound.addEventListener("complete",loadCallback,false,0,true);
		this._sound.load(new openfl_net_URLRequest(SoundURL));
		return this.init(Looped,AutoDestroy,OnComplete);
	}
	,init: function(Looped,AutoDestroy,OnComplete) {
		if(AutoDestroy == null) {
			AutoDestroy = false;
		}
		if(Looped == null) {
			Looped = false;
		}
		this.looped = Looped;
		this.autoDestroy = AutoDestroy;
		this.updateTransform();
		this.set_exists(true);
		this.onComplete = OnComplete;
		this._length = this._sound == null ? 0 : this._sound.get_length();
		this.endTime = this._length;
		return this;
	}
	,proximity: function(X,Y,TargetObject,Radius,Pan) {
		if(Pan == null) {
			Pan = true;
		}
		this.x = X;
		this.y = Y;
		this._target = TargetObject;
		this._radius = Radius;
		this._proximityPan = Pan;
		return this;
	}
	,play: function(ForceRestart,StartTime,EndTime) {
		if(StartTime == null) {
			StartTime = 0.0;
		}
		if(ForceRestart == null) {
			ForceRestart = false;
		}
		if(!this.exists) {
			return this;
		}
		if(ForceRestart) {
			this.cleanup(false,true);
		} else if(this._channel != null) {
			return this;
		}
		if(this._paused) {
			this.resume();
		} else {
			this.startSound(StartTime);
		}
		this.endTime = EndTime;
		return this;
	}
	,resume: function() {
		if(this._paused) {
			this.startSound(this._time);
		}
		return this;
	}
	,pause: function() {
		if(this._channel == null) {
			return this;
		}
		this._time = this._channel.get_position();
		this._paused = true;
		this.cleanup(false,false);
		return this;
	}
	,stop: function() {
		this.cleanup(this.autoDestroy,true);
		return this;
	}
	,fadeOut: function(Duration,To,onComplete) {
		if(To == null) {
			To = 0;
		}
		if(Duration == null) {
			Duration = 1;
		}
		if(this.fadeTween != null) {
			this.fadeTween.cancel();
		}
		this.fadeTween = flixel_tweens_FlxTween.num(this._volume,To,Duration,{ onComplete : onComplete},$bind(this,this.volumeTween));
		return this;
	}
	,fadeIn: function(Duration,From,To,onComplete) {
		if(To == null) {
			To = 1;
		}
		if(From == null) {
			From = 0;
		}
		if(Duration == null) {
			Duration = 1;
		}
		if(this._channel == null) {
			this.play();
		}
		if(this.fadeTween != null) {
			this.fadeTween.cancel();
		}
		this.fadeTween = flixel_tweens_FlxTween.num(From,To,Duration,{ onComplete : onComplete},$bind(this,this.volumeTween));
		return this;
	}
	,volumeTween: function(f) {
		this.set_volume(f);
	}
	,getActualVolume: function() {
		return this._volume * this._volumeAdjust;
	}
	,setPosition: function(X,Y) {
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		this.x = X;
		this.y = Y;
	}
	,updateTransform: function() {
		this._transform.volume = (flixel_FlxG.sound.muted ? 0 : 1) * flixel_FlxG.sound.volume * (this.group != null ? this.group.volume : 1) * this._volume * this._volumeAdjust;
		if(this._channel != null) {
			this._channel.set_soundTransform(this._transform);
		}
	}
	,startSound: function(StartTime) {
		if(this._sound == null) {
			return;
		}
		this._time = StartTime;
		this._paused = false;
		this._channel = this._sound.play(this._time,0,this._transform);
		if(this._channel != null) {
			this._channel.addEventListener("soundComplete",$bind(this,this.stopped));
			this.set_active(true);
		} else {
			this.set_exists(false);
			this.set_active(false);
		}
	}
	,stopped: function(_) {
		if(this.onComplete != null) {
			this.onComplete();
		}
		if(this.looped) {
			this.cleanup(false);
			this.play(false,this.loopTime,this.endTime);
		} else {
			this.cleanup(this.autoDestroy);
		}
	}
	,cleanup: function(destroySound,resetPosition) {
		if(resetPosition == null) {
			resetPosition = true;
		}
		if(destroySound) {
			this.reset();
			return;
		}
		if(this._channel != null) {
			this._channel.removeEventListener("soundComplete",$bind(this,this.stopped));
			this._channel.stop();
			this._channel = null;
		}
		this.set_active(false);
		if(resetPosition) {
			this._time = 0;
			this._paused = false;
		}
	}
	,gotID3: function(_) {
		this.name = this._sound.get_id3().songName;
		this.artist = this._sound.get_id3().artist;
		this._sound.removeEventListener("id3",$bind(this,this.gotID3));
	}
	,onFocus: function() {
		if(!this._alreadyPaused) {
			this.resume();
		}
	}
	,onFocusLost: function() {
		this._alreadyPaused = this._paused;
		this.pause();
	}
	,set_group: function(group) {
		if(this.group != group) {
			var oldGroup = this.group;
			this.group = group;
			if(oldGroup != null) {
				oldGroup.remove(this);
			}
			if(group != null) {
				group.add(this);
			}
			this.updateTransform();
		}
		return group;
	}
	,get_playing: function() {
		return this._channel != null;
	}
	,get_volume: function() {
		return this._volume;
	}
	,set_volume: function(Volume) {
		var lowerBound = Volume < 0 ? 0 : Volume;
		this._volume = lowerBound > 1 ? 1 : lowerBound;
		this.updateTransform();
		return Volume;
	}
	,get_pan: function() {
		return this._transform.pan;
	}
	,set_pan: function(pan) {
		return this._transform.pan = pan;
	}
	,get_time: function() {
		return this._time;
	}
	,set_time: function(time) {
		if(this._channel != null) {
			this.cleanup(false,true);
			this.startSound(time);
		}
		return this._time = time;
	}
	,get_length: function() {
		return this._length;
	}
	,toString: function() {
		var value = this._channel != null;
		var _this = flixel_util_LabelValuePair._pool.get();
		_this.label = "playing";
		_this.value = value;
		var value = this._time;
		var _this1 = flixel_util_LabelValuePair._pool.get();
		_this1.label = "time";
		_this1.value = value;
		var value = this._length;
		var _this2 = flixel_util_LabelValuePair._pool.get();
		_this2.label = "length";
		_this2.value = value;
		var value = this._volume;
		var _this3 = flixel_util_LabelValuePair._pool.get();
		_this3.label = "volume";
		_this3.value = value;
		return flixel_util_FlxStringUtil.getDebugString([_this,_this1,_this2,_this3]);
	}
	,__class__: flixel_system_FlxSound
	,__properties__: $extend(flixel_FlxBasic.prototype.__properties__,{set_group:"set_group",get_length:"get_length",set_time:"set_time",get_time:"get_time",set_volume:"set_volume",get_volume:"get_volume",get_playing:"get_playing",set_pan:"set_pan",get_pan:"get_pan"})
});
var flixel_system_FlxSoundGroup = function(volume) {
	if(volume == null) {
		volume = 1;
	}
	this.sounds = [];
	this.set_volume(volume);
};
$hxClasses["flixel.system.FlxSoundGroup"] = flixel_system_FlxSoundGroup;
flixel_system_FlxSoundGroup.__name__ = "flixel.system.FlxSoundGroup";
flixel_system_FlxSoundGroup.prototype = {
	sounds: null
	,volume: null
	,add: function(sound) {
		if(this.sounds.indexOf(sound) < 0) {
			this.sounds.push(sound);
			sound.set_group(this);
			return true;
		}
		return false;
	}
	,remove: function(sound) {
		if(this.sounds.indexOf(sound) >= 0) {
			sound.set_group(null);
			return HxOverrides.remove(this.sounds,sound);
		}
		return false;
	}
	,pause: function() {
		var _g = 0;
		var _g1 = this.sounds;
		while(_g < _g1.length) {
			var sound = _g1[_g];
			++_g;
			sound.pause();
		}
	}
	,resume: function() {
		var _g = 0;
		var _g1 = this.sounds;
		while(_g < _g1.length) {
			var sound = _g1[_g];
			++_g;
			sound.resume();
		}
	}
	,set_volume: function(volume) {
		this.volume = volume;
		var _g = 0;
		var _g1 = this.sounds;
		while(_g < _g1.length) {
			var sound = _g1[_g];
			++_g;
			sound.updateTransform();
		}
		return volume;
	}
	,__class__: flixel_system_FlxSoundGroup
	,__properties__: {set_volume:"set_volume"}
};
var flixel_system_FlxSplash = function(MaxSize) {
	this._curPart = 0;
	flixel_FlxState.call(this,MaxSize);
};
$hxClasses["flixel.system.FlxSplash"] = flixel_system_FlxSplash;
flixel_system_FlxSplash.__name__ = "flixel.system.FlxSplash";
flixel_system_FlxSplash.nextState = null;
flixel_system_FlxSplash.__super__ = flixel_FlxState;
flixel_system_FlxSplash.prototype = $extend(flixel_FlxState.prototype,{
	_sprite: null
	,_gfx: null
	,_text: null
	,_times: null
	,_colors: null
	,_functions: null
	,_curPart: null
	,_cachedBgColor: null
	,_cachedTimestep: null
	,_cachedAutoPause: null
	,create: function() {
		this._cachedBgColor = flixel_FlxG.cameras.get_bgColor();
		flixel_FlxG.cameras.set_bgColor(-16777216);
		this._cachedTimestep = flixel_FlxG.fixedTimestep;
		flixel_FlxG.fixedTimestep = false;
		this._cachedAutoPause = flixel_FlxG.autoPause;
		flixel_FlxG.autoPause = false;
		flixel_FlxG.keys.enabled = false;
		this._times = [0.041,0.184,0.334,0.495,0.636];
		this._colors = [47394,16761138,16066382,3555839,314875];
		this._functions = [$bind(this,this.drawGreen),$bind(this,this.drawYellow),$bind(this,this.drawRed),$bind(this,this.drawBlue),$bind(this,this.drawLightBlue)];
		var _g = 0;
		var _g1 = this._times;
		while(_g < _g1.length) {
			var time = _g1[_g];
			++_g;
			new flixel_util_FlxTimer().start(time,$bind(this,this.timerCallback));
		}
		var stageWidth = openfl_Lib.get_current().stage.stageWidth;
		var stageHeight = openfl_Lib.get_current().stage.stageHeight;
		this._sprite = new openfl_display_Sprite();
		openfl_Lib.get_current().stage.addChild(this._sprite);
		this._gfx = this._sprite.get_graphics();
		this._text = new openfl_text_TextField();
		this._text.set_selectable(false);
		this._text.set_embedFonts(true);
		var dtf = new openfl_text_TextFormat(flixel_system_FlxAssets.FONT_DEFAULT,16,16777215);
		dtf.align = 0;
		this._text.set_defaultTextFormat(dtf);
		this._text.set_text("HaxeFlixel");
		openfl_Lib.get_current().stage.addChild(this._text);
		this.onResize(stageWidth,stageHeight);
		if(!flixel_system_FlxSplash.muted) {
			var extension = "";
			extension = ".ogg";
			flixel_FlxG.sound.load(openfl_utils_Assets.getSound("flixel/sounds/flixel" + extension)).play();
		}
	}
	,destroy: function() {
		this._sprite = null;
		this._gfx = null;
		this._text = null;
		this._times = null;
		this._colors = null;
		this._functions = null;
		flixel_FlxState.prototype.destroy.call(this);
	}
	,onResize: function(Width,Height) {
		flixel_FlxState.prototype.onResize.call(this,Width,Height);
		this._sprite.set_x(Width / 2);
		this._sprite.set_y(Height / 2 - 20 * flixel_FlxG.game.get_scaleY());
		this._text.set_width(Width / flixel_FlxG.game.get_scaleX());
		this._text.set_x(0);
		this._text.set_y(this._sprite.get_y() + 80 * flixel_FlxG.game.get_scaleY());
		this._sprite.set_scaleX(this._text.set_scaleX(flixel_FlxG.game.get_scaleX()));
		this._sprite.set_scaleY(this._text.set_scaleY(flixel_FlxG.game.get_scaleY()));
	}
	,timerCallback: function(Timer) {
		this._functions[this._curPart]();
		this._text.set_textColor(this._colors[this._curPart]);
		this._text.set_text("HaxeFlixel");
		this._curPart++;
		if(this._curPart == 5) {
			flixel_tweens_FlxTween.tween(this._sprite,{ alpha : 0},3.0,{ ease : flixel_tweens_FlxEase.quadOut, onComplete : $bind(this,this.onComplete)});
			flixel_tweens_FlxTween.tween(this._text,{ alpha : 0},3.0,{ ease : flixel_tweens_FlxEase.quadOut});
		}
	}
	,drawGreen: function() {
		this._gfx.beginFill(47394);
		this._gfx.moveTo(0,-37);
		this._gfx.lineTo(1,-37);
		this._gfx.lineTo(37,0);
		this._gfx.lineTo(37,1);
		this._gfx.lineTo(1,37);
		this._gfx.lineTo(0,37);
		this._gfx.lineTo(-37,1);
		this._gfx.lineTo(-37,0);
		this._gfx.lineTo(0,-37);
		this._gfx.endFill();
	}
	,drawYellow: function() {
		this._gfx.beginFill(16761138);
		this._gfx.moveTo(-50,-50);
		this._gfx.lineTo(-25,-50);
		this._gfx.lineTo(0,-37);
		this._gfx.lineTo(-37,0);
		this._gfx.lineTo(-50,-25);
		this._gfx.lineTo(-50,-50);
		this._gfx.endFill();
	}
	,drawRed: function() {
		this._gfx.beginFill(16066382);
		this._gfx.moveTo(50,-50);
		this._gfx.lineTo(25,-50);
		this._gfx.lineTo(1,-37);
		this._gfx.lineTo(37,0);
		this._gfx.lineTo(50,-25);
		this._gfx.lineTo(50,-50);
		this._gfx.endFill();
	}
	,drawBlue: function() {
		this._gfx.beginFill(3555839);
		this._gfx.moveTo(-50,50);
		this._gfx.lineTo(-25,50);
		this._gfx.lineTo(0,37);
		this._gfx.lineTo(-37,1);
		this._gfx.lineTo(-50,25);
		this._gfx.lineTo(-50,50);
		this._gfx.endFill();
	}
	,drawLightBlue: function() {
		this._gfx.beginFill(314875);
		this._gfx.moveTo(50,50);
		this._gfx.lineTo(25,50);
		this._gfx.lineTo(1,37);
		this._gfx.lineTo(37,1);
		this._gfx.lineTo(50,25);
		this._gfx.lineTo(50,50);
		this._gfx.endFill();
	}
	,onComplete: function(Tween) {
		flixel_FlxG.cameras.set_bgColor(this._cachedBgColor);
		flixel_FlxG.fixedTimestep = this._cachedTimestep;
		flixel_FlxG.autoPause = this._cachedAutoPause;
		flixel_FlxG.keys.enabled = true;
		openfl_Lib.get_current().stage.removeChild(this._sprite);
		openfl_Lib.get_current().stage.removeChild(this._text);
		var nextState = Type.createInstance(flixel_system_FlxSplash.nextState,[]);
		if(flixel_FlxG.game._state.switchTo(nextState)) {
			flixel_FlxG.game._requestedState = nextState;
		}
		flixel_FlxG.game._gameJustStarted = true;
	}
	,__class__: flixel_system_FlxSplash
});
var flixel_system_debug_DebuggerUtil = function() { };
$hxClasses["flixel.system.debug.DebuggerUtil"] = flixel_system_debug_DebuggerUtil;
flixel_system_debug_DebuggerUtil.__name__ = "flixel.system.debug.DebuggerUtil";
flixel_system_debug_DebuggerUtil.createTextField = function(X,Y,Color,Size) {
	if(Size == null) {
		Size = 12;
	}
	if(Color == null) {
		Color = -1;
	}
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	return flixel_system_debug_DebuggerUtil.initTextField(new openfl_text_TextField(),X,Y,Color,Size);
};
flixel_system_debug_DebuggerUtil.initTextField = function(tf,X,Y,Color,Size) {
	if(Size == null) {
		Size = 12;
	}
	if(Color == null) {
		Color = -1;
	}
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	tf.set_x(X);
	tf.set_y(Y);
	tf.set_multiline(false);
	tf.set_wordWrap(false);
	tf.set_embedFonts(true);
	tf.set_selectable(false);
	tf.set_defaultTextFormat(new openfl_text_TextFormat(flixel_system_FlxAssets.FONT_DEBUGGER,Size,Color & 16777215));
	tf.set_alpha((Color >> 24 & 255) / 255);
	tf.set_autoSize(1);
	return tf;
};
flixel_system_debug_DebuggerUtil.fixSize = function(bitmapData) {
	Reflect.setProperty(bitmapData,"width",11);
	Reflect.setProperty(bitmapData,"height",11);
	return bitmapData;
};
var flixel_system_debug__$FlxDebugger_GraphicFlixel = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system_debug__$FlxDebugger_GraphicFlixel.preload != null) {
		this.__fromImage(flixel_system_debug__$FlxDebugger_GraphicFlixel.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system_debug__$FlxDebugger_GraphicFlixel.resourceName),flixel_system_debug__$FlxDebugger_GraphicFlixel.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system_debug__$FlxDebugger_GraphicFlixel.preload == null) {
				flixel_system_debug__$FlxDebugger_GraphicFlixel.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system.debug._FlxDebugger.GraphicFlixel"] = flixel_system_debug__$FlxDebugger_GraphicFlixel;
flixel_system_debug__$FlxDebugger_GraphicFlixel.__name__ = "flixel.system.debug._FlxDebugger.GraphicFlixel";
flixel_system_debug__$FlxDebugger_GraphicFlixel.preload = null;
flixel_system_debug__$FlxDebugger_GraphicFlixel.__super__ = openfl_display_BitmapData;
flixel_system_debug__$FlxDebugger_GraphicFlixel.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system_debug__$FlxDebugger_GraphicFlixel
});
var flixel_system_debug__$FlxDebugger_GraphicDrawDebug = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system_debug__$FlxDebugger_GraphicDrawDebug.preload != null) {
		this.__fromImage(flixel_system_debug__$FlxDebugger_GraphicDrawDebug.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system_debug__$FlxDebugger_GraphicDrawDebug.resourceName),flixel_system_debug__$FlxDebugger_GraphicDrawDebug.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system_debug__$FlxDebugger_GraphicDrawDebug.preload == null) {
				flixel_system_debug__$FlxDebugger_GraphicDrawDebug.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system.debug._FlxDebugger.GraphicDrawDebug"] = flixel_system_debug__$FlxDebugger_GraphicDrawDebug;
flixel_system_debug__$FlxDebugger_GraphicDrawDebug.__name__ = "flixel.system.debug._FlxDebugger.GraphicDrawDebug";
flixel_system_debug__$FlxDebugger_GraphicDrawDebug.preload = null;
flixel_system_debug__$FlxDebugger_GraphicDrawDebug.__super__ = openfl_display_BitmapData;
flixel_system_debug__$FlxDebugger_GraphicDrawDebug.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system_debug__$FlxDebugger_GraphicDrawDebug
});
var flixel_system_debug_GraphicLog = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system_debug_GraphicLog.preload != null) {
		this.__fromImage(flixel_system_debug_GraphicLog.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system_debug_GraphicLog.resourceName),flixel_system_debug_GraphicLog.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system_debug_GraphicLog.preload == null) {
				flixel_system_debug_GraphicLog.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system.debug.GraphicLog"] = flixel_system_debug_GraphicLog;
flixel_system_debug_GraphicLog.__name__ = "flixel.system.debug.GraphicLog";
flixel_system_debug_GraphicLog.preload = null;
flixel_system_debug_GraphicLog.__super__ = openfl_display_BitmapData;
flixel_system_debug_GraphicLog.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system_debug_GraphicLog
});
var flixel_system_debug_GraphicStats = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system_debug_GraphicStats.preload != null) {
		this.__fromImage(flixel_system_debug_GraphicStats.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system_debug_GraphicStats.resourceName),flixel_system_debug_GraphicStats.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system_debug_GraphicStats.preload == null) {
				flixel_system_debug_GraphicStats.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system.debug.GraphicStats"] = flixel_system_debug_GraphicStats;
flixel_system_debug_GraphicStats.__name__ = "flixel.system.debug.GraphicStats";
flixel_system_debug_GraphicStats.preload = null;
flixel_system_debug_GraphicStats.__super__ = openfl_display_BitmapData;
flixel_system_debug_GraphicStats.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system_debug_GraphicStats
});
var flixel_system_debug_GraphicWatch = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system_debug_GraphicWatch.preload != null) {
		this.__fromImage(flixel_system_debug_GraphicWatch.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system_debug_GraphicWatch.resourceName),flixel_system_debug_GraphicWatch.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system_debug_GraphicWatch.preload == null) {
				flixel_system_debug_GraphicWatch.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system.debug.GraphicWatch"] = flixel_system_debug_GraphicWatch;
flixel_system_debug_GraphicWatch.__name__ = "flixel.system.debug.GraphicWatch";
flixel_system_debug_GraphicWatch.preload = null;
flixel_system_debug_GraphicWatch.__super__ = openfl_display_BitmapData;
flixel_system_debug_GraphicWatch.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system_debug_GraphicWatch
});
var flixel_system_debug_GraphicBitmapLog = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system_debug_GraphicBitmapLog.preload != null) {
		this.__fromImage(flixel_system_debug_GraphicBitmapLog.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system_debug_GraphicBitmapLog.resourceName),flixel_system_debug_GraphicBitmapLog.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system_debug_GraphicBitmapLog.preload == null) {
				flixel_system_debug_GraphicBitmapLog.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system.debug.GraphicBitmapLog"] = flixel_system_debug_GraphicBitmapLog;
flixel_system_debug_GraphicBitmapLog.__name__ = "flixel.system.debug.GraphicBitmapLog";
flixel_system_debug_GraphicBitmapLog.preload = null;
flixel_system_debug_GraphicBitmapLog.__super__ = openfl_display_BitmapData;
flixel_system_debug_GraphicBitmapLog.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system_debug_GraphicBitmapLog
});
var flixel_system_debug_GraphicConsole = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system_debug_GraphicConsole.preload != null) {
		this.__fromImage(flixel_system_debug_GraphicConsole.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system_debug_GraphicConsole.resourceName),flixel_system_debug_GraphicConsole.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system_debug_GraphicConsole.preload == null) {
				flixel_system_debug_GraphicConsole.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system.debug.GraphicConsole"] = flixel_system_debug_GraphicConsole;
flixel_system_debug_GraphicConsole.__name__ = "flixel.system.debug.GraphicConsole";
flixel_system_debug_GraphicConsole.preload = null;
flixel_system_debug_GraphicConsole.__super__ = openfl_display_BitmapData;
flixel_system_debug_GraphicConsole.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system_debug_GraphicConsole
});
var flixel_system_debug_GraphicArrowLeft = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system_debug_GraphicArrowLeft.preload != null) {
		this.__fromImage(flixel_system_debug_GraphicArrowLeft.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system_debug_GraphicArrowLeft.resourceName),flixel_system_debug_GraphicArrowLeft.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system_debug_GraphicArrowLeft.preload == null) {
				flixel_system_debug_GraphicArrowLeft.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system.debug.GraphicArrowLeft"] = flixel_system_debug_GraphicArrowLeft;
flixel_system_debug_GraphicArrowLeft.__name__ = "flixel.system.debug.GraphicArrowLeft";
flixel_system_debug_GraphicArrowLeft.preload = null;
flixel_system_debug_GraphicArrowLeft.__super__ = openfl_display_BitmapData;
flixel_system_debug_GraphicArrowLeft.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system_debug_GraphicArrowLeft
});
var flixel_system_debug_GraphicArrowRight = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system_debug_GraphicArrowRight.preload != null) {
		this.__fromImage(flixel_system_debug_GraphicArrowRight.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system_debug_GraphicArrowRight.resourceName),flixel_system_debug_GraphicArrowRight.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system_debug_GraphicArrowRight.preload == null) {
				flixel_system_debug_GraphicArrowRight.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system.debug.GraphicArrowRight"] = flixel_system_debug_GraphicArrowRight;
flixel_system_debug_GraphicArrowRight.__name__ = "flixel.system.debug.GraphicArrowRight";
flixel_system_debug_GraphicArrowRight.preload = null;
flixel_system_debug_GraphicArrowRight.__super__ = openfl_display_BitmapData;
flixel_system_debug_GraphicArrowRight.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system_debug_GraphicArrowRight
});
var flixel_system_debug_GraphicCloseButton = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system_debug_GraphicCloseButton.preload != null) {
		this.__fromImage(flixel_system_debug_GraphicCloseButton.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system_debug_GraphicCloseButton.resourceName),flixel_system_debug_GraphicCloseButton.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system_debug_GraphicCloseButton.preload == null) {
				flixel_system_debug_GraphicCloseButton.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system.debug.GraphicCloseButton"] = flixel_system_debug_GraphicCloseButton;
flixel_system_debug_GraphicCloseButton.__name__ = "flixel.system.debug.GraphicCloseButton";
flixel_system_debug_GraphicCloseButton.preload = null;
flixel_system_debug_GraphicCloseButton.__super__ = openfl_display_BitmapData;
flixel_system_debug_GraphicCloseButton.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system_debug_GraphicCloseButton
});
var flixel_system_debug_GraphicInteractive = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system_debug_GraphicInteractive.preload != null) {
		this.__fromImage(flixel_system_debug_GraphicInteractive.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system_debug_GraphicInteractive.resourceName),flixel_system_debug_GraphicInteractive.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system_debug_GraphicInteractive.preload == null) {
				flixel_system_debug_GraphicInteractive.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system.debug.GraphicInteractive"] = flixel_system_debug_GraphicInteractive;
flixel_system_debug_GraphicInteractive.__name__ = "flixel.system.debug.GraphicInteractive";
flixel_system_debug_GraphicInteractive.preload = null;
flixel_system_debug_GraphicInteractive.__super__ = openfl_display_BitmapData;
flixel_system_debug_GraphicInteractive.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system_debug_GraphicInteractive
});
var flixel_system_debug_FlxDebugger = function() {
	openfl_display_Sprite.call(this);
};
$hxClasses["flixel.system.debug.FlxDebugger"] = flixel_system_debug_FlxDebugger;
flixel_system_debug_FlxDebugger.__name__ = "flixel.system.debug.FlxDebugger";
flixel_system_debug_FlxDebugger.__super__ = openfl_display_Sprite;
flixel_system_debug_FlxDebugger.prototype = $extend(openfl_display_Sprite.prototype,{
	__class__: flixel_system_debug_FlxDebugger
});
var flixel_system_debug_FlxDebuggerLayout = $hxEnums["flixel.system.debug.FlxDebuggerLayout"] = { __ename__ : "flixel.system.debug.FlxDebuggerLayout", __constructs__ : ["STANDARD","MICRO","BIG","TOP","LEFT","RIGHT"]
	,STANDARD: {_hx_index:0,__enum__:"flixel.system.debug.FlxDebuggerLayout",toString:$estr}
	,MICRO: {_hx_index:1,__enum__:"flixel.system.debug.FlxDebuggerLayout",toString:$estr}
	,BIG: {_hx_index:2,__enum__:"flixel.system.debug.FlxDebuggerLayout",toString:$estr}
	,TOP: {_hx_index:3,__enum__:"flixel.system.debug.FlxDebuggerLayout",toString:$estr}
	,LEFT: {_hx_index:4,__enum__:"flixel.system.debug.FlxDebuggerLayout",toString:$estr}
	,RIGHT: {_hx_index:5,__enum__:"flixel.system.debug.FlxDebuggerLayout",toString:$estr}
};
var flixel_system_debug_Tooltip = function() { };
$hxClasses["flixel.system.debug.Tooltip"] = flixel_system_debug_Tooltip;
flixel_system_debug_Tooltip.__name__ = "flixel.system.debug.Tooltip";
flixel_system_debug_Tooltip._container = null;
flixel_system_debug_Tooltip.init = function(container) {
	flixel_system_debug_Tooltip._container = container;
};
flixel_system_debug_Tooltip.add = function(element,text) {
	var tooltip = new flixel_system_debug_TooltipOverlay(element,text);
	flixel_system_debug_Tooltip._container.addChild(tooltip);
	flixel_system_debug_Tooltip._tooltips.push(tooltip);
	return tooltip;
};
flixel_system_debug_Tooltip.remove = function(element) {
	var removed = false;
	var _g = 0;
	var _g1 = flixel_system_debug_Tooltip._tooltips.length;
	while(_g < _g1) {
		var i = _g++;
		if(flixel_system_debug_Tooltip._tooltips[i] != null && flixel_system_debug_Tooltip._tooltips[i].owner == element) {
			var tooltip = flixel_system_debug_Tooltip._tooltips.splice(i,1)[0];
			tooltip.destroy();
			removed = true;
			break;
		}
	}
	return removed;
};
var flixel_system_debug_TooltipOverlay = function(target,text,width,height) {
	if(height == null) {
		height = 0;
	}
	if(width == null) {
		width = 0;
	}
	openfl_display_Sprite.call(this);
	this.owner = target;
	this.maxSize = new openfl_geom_Point(width,height);
	this._shadow = new openfl_display_Bitmap(new openfl_display_BitmapData(1,2,true,-16777216));
	this._background = new openfl_display_Bitmap(new openfl_display_BitmapData(1,1,true,-12961222));
	this.textField = flixel_system_debug_DebuggerUtil.createTextField(2,1);
	this.textField.set_alpha(0.8);
	this.textField.set_text(text);
	this.textField.set_wordWrap(true);
	this.addChild(this._shadow);
	this.addChild(this._background);
	this.addChild(this.textField);
	this.updateSize();
	this.setVisible(false);
	if(this.owner != null) {
		this.owner.addEventListener("mouseOver",$bind(this,this.handleMouseEvents));
		this.owner.addEventListener("mouseOut",$bind(this,this.handleMouseEvents));
	}
};
$hxClasses["flixel.system.debug.TooltipOverlay"] = flixel_system_debug_TooltipOverlay;
flixel_system_debug_TooltipOverlay.__name__ = "flixel.system.debug.TooltipOverlay";
flixel_system_debug_TooltipOverlay.__super__ = openfl_display_Sprite;
flixel_system_debug_TooltipOverlay.prototype = $extend(openfl_display_Sprite.prototype,{
	_width: null
	,_height: null
	,_background: null
	,_shadow: null
	,textField: null
	,owner: null
	,maxSize: null
	,destroy: function() {
		this._shadow = flixel_util_FlxDestroyUtil.removeChild(this,this._shadow);
		this._background = flixel_util_FlxDestroyUtil.removeChild(this,this._background);
		this.textField = flixel_util_FlxDestroyUtil.removeChild(this,this.textField);
		this.maxSize = null;
		if(this.owner != null) {
			this.owner.removeEventListener("mouseOver",$bind(this,this.handleMouseEvents));
			this.owner.removeEventListener("mouseOut",$bind(this,this.handleMouseEvents));
		}
		this.owner = null;
	}
	,resize: function(Width,Height) {
		this.maxSize.x = Math.abs(Width) | 0;
		this.maxSize.y = Math.abs(Height) | 0;
		this.updateSize();
	}
	,reposition: function(X,Y) {
		this.set_x(X);
		this.set_y(Y);
		this.ensureOnScreen();
	}
	,setVisible: function(Value) {
		this.set_visible(Value);
		if(this.get_visible()) {
			this.parent.addChild(this);
			this.ensureOnScreen();
		}
	}
	,setText: function(Text1) {
		this.textField.set_text(Text1);
		this.updateSize();
		this.ensureOnScreen();
	}
	,toggleVisible: function() {
		this.setVisible(!this.get_visible());
	}
	,putOnTop: function() {
		this.parent.addChild(this);
	}
	,update: function() {
	}
	,updateSize: function() {
		this._width = ((this.maxSize.x <= 0 ? this.textField.get_textWidth() : Math.abs(this.maxSize.x)) | 0) + 8;
		this._height = ((this.maxSize.y <= 0 ? this.textField.get_textHeight() : Math.abs(this.maxSize.y)) | 0) + 8;
		this._background.set_scaleX(this._width);
		this._background.set_scaleY(this._height);
		this._shadow.set_scaleX(this._width);
		this._shadow.set_y(this._height);
		this.textField.set_width(this._width);
	}
	,ensureOnScreen: function() {
		this.set_x(this.get_x() < 0 ? 0 : this.get_x());
		this.set_y(this.get_y() < 0 ? 0 : this.get_y());
		var offsetX = this.get_x() + this.get_width() >= openfl_Lib.get_current().stage.stageWidth ? openfl_Lib.get_current().stage.stageWidth - (this.get_x() + this.get_width()) : 0;
		var offsetY = this.get_y() + this.get_height() >= openfl_Lib.get_current().stage.stageHeight ? openfl_Lib.get_current().stage.stageHeight - (this.get_y() + this.get_height()) : 0;
		var _g = this;
		_g.set_x(_g.get_x() + offsetX);
		var _g = this;
		_g.set_y(_g.get_y() + offsetY);
	}
	,handleMouseEvents: function(event) {
		if(event.type == "mouseOver" && !this.get_visible()) {
			this.set_x(event.stageX + 10);
			this.set_y(event.stageY + 10);
			this.setVisible(true);
		} else if(event.type == "mouseOut") {
			this.setVisible(false);
		}
	}
	,__class__: flixel_system_debug_TooltipOverlay
});
var flixel_system_debug__$Window_GraphicWindowHandle = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system_debug__$Window_GraphicWindowHandle.preload != null) {
		this.__fromImage(flixel_system_debug__$Window_GraphicWindowHandle.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system_debug__$Window_GraphicWindowHandle.resourceName),flixel_system_debug__$Window_GraphicWindowHandle.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system_debug__$Window_GraphicWindowHandle.preload == null) {
				flixel_system_debug__$Window_GraphicWindowHandle.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system.debug._Window.GraphicWindowHandle"] = flixel_system_debug__$Window_GraphicWindowHandle;
flixel_system_debug__$Window_GraphicWindowHandle.__name__ = "flixel.system.debug._Window.GraphicWindowHandle";
flixel_system_debug__$Window_GraphicWindowHandle.preload = null;
flixel_system_debug__$Window_GraphicWindowHandle.__super__ = openfl_display_BitmapData;
flixel_system_debug__$Window_GraphicWindowHandle.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system_debug__$Window_GraphicWindowHandle
});
var flixel_system_debug_Window = function(Title,Icon,Width,Height,Resizable,Bounds,Closable,AlwaysOnTop) {
	if(AlwaysOnTop == null) {
		AlwaysOnTop = true;
	}
	if(Closable == null) {
		Closable = false;
	}
	if(Resizable == null) {
		Resizable = true;
	}
	if(Height == null) {
		Height = 0;
	}
	if(Width == null) {
		Width = 0;
	}
	openfl_display_Sprite.call(this);
	this.minSize = new openfl_geom_Point(50,30);
	this._width = Math.abs(Width) | 0;
	this._height = Math.abs(Height) | 0;
	this.updateBounds(Bounds);
	this._drag = new openfl_geom_Point();
	this._resizable = Resizable;
	this._closable = Closable;
	this._alwaysOnTop = AlwaysOnTop;
	this._shadow = new openfl_display_Bitmap(new openfl_display_BitmapData(1,2,true,-16777216));
	this._background = new openfl_display_Bitmap(new openfl_display_BitmapData(1,1,true,-580952225));
	this._header = new openfl_display_Bitmap(new openfl_display_BitmapData(1,15,true,-1157627904));
	this._background.set_y(this._header.get_height());
	this._title = flixel_system_debug_DebuggerUtil.createTextField(2,-1);
	this._title.set_alpha(0.8);
	this._title.set_text(Title);
	this.addChild(this._shadow);
	this.addChild(this._background);
	this.addChild(this._header);
	this.addChild(this._title);
	if(Icon != null) {
		flixel_system_debug_DebuggerUtil.fixSize(Icon);
		this._icon = new openfl_display_Bitmap(Icon);
		this._icon.set_x(5);
		this._icon.set_y(2);
		this._icon.set_alpha(0.8);
		this._title.set_x(this._icon.get_x() + this._icon.get_width() + 2);
		this.addChild(this._icon);
	}
	if(this._resizable) {
		this._handle = new openfl_display_Bitmap(flixel_system_debug_DebuggerUtil.fixSize(new flixel_system_debug__$Window_GraphicWindowHandle(0,0)));
		this.addChild(this._handle);
	}
	if(Closable) {
		this._closeButton = new flixel_system_ui_FlxSystemButton(new flixel_system_debug_GraphicCloseButton(0,0),$bind(this,this.close));
		this._closeButton.set_alpha(0.8);
		this.addChild(this._closeButton);
	} else {
		this._id = flixel_system_debug_Window.WINDOW_AMOUNT;
		this.loadSaveData();
		flixel_system_debug_Window.WINDOW_AMOUNT++;
	}
	if(this._width != 0 || this._height != 0) {
		this.updateSize();
	}
	this.bound();
	this.addEventListener("enterFrame",$bind(this,this.init));
};
$hxClasses["flixel.system.debug.Window"] = flixel_system_debug_Window;
flixel_system_debug_Window.__name__ = "flixel.system.debug.Window";
flixel_system_debug_Window.__super__ = openfl_display_Sprite;
flixel_system_debug_Window.prototype = $extend(openfl_display_Sprite.prototype,{
	minSize: null
	,maxSize: null
	,toggleButton: null
	,_width: null
	,_height: null
	,_bounds: null
	,_background: null
	,_header: null
	,_shadow: null
	,_title: null
	,_handle: null
	,_icon: null
	,_closeButton: null
	,_overHeader: null
	,_overHandle: null
	,_drag: null
	,_dragging: null
	,_resizing: null
	,_resizable: null
	,_closable: null
	,_alwaysOnTop: null
	,_id: null
	,destroy: function() {
		this.minSize = null;
		this.maxSize = null;
		this._bounds = null;
		if(this._shadow != null) {
			this.removeChild(this._shadow);
		}
		this._shadow = null;
		if(this._background != null) {
			this.removeChild(this._background);
		}
		this._background = null;
		if(this._header != null) {
			this.removeChild(this._header);
		}
		this._header = null;
		if(this._title != null) {
			this.removeChild(this._title);
		}
		this._title = null;
		if(this._handle != null) {
			this.removeChild(this._handle);
		}
		this._handle = null;
		this._drag = null;
		this._closeButton = flixel_util_FlxDestroyUtil.destroy(this._closeButton);
		var stage = openfl_Lib.get_current().stage;
		if(stage.hasEventListener("mouseMove")) {
			stage.removeEventListener("mouseMove",$bind(this,this.onMouseMove));
		}
		if(this.hasEventListener("mouseDown")) {
			this.removeEventListener("mouseDown",$bind(this,this.onMouseDown));
		}
		if(stage.hasEventListener("mouseUp")) {
			stage.removeEventListener("mouseUp",$bind(this,this.onMouseUp));
		}
	}
	,resize: function(Width,Height) {
		this._width = Math.abs(Width) | 0;
		this._height = Math.abs(Height) | 0;
		this.updateSize();
	}
	,reposition: function(X,Y) {
		this.set_x(X);
		this.set_y(Y);
		this.bound();
	}
	,updateBounds: function(Bounds) {
		this._bounds = Bounds;
		if(this._bounds != null) {
			this.maxSize = new openfl_geom_Point(this._bounds.width,this._bounds.height);
		} else {
			this.maxSize = new openfl_geom_Point(1.79e+308,1.79e+308);
		}
	}
	,setVisible: function(Value) {
		this.set_visible(Value);
		if(!this._closable) {
			flixel_FlxG.save.data.windowSettings[this._id] = this.get_visible();
			flixel_FlxG.save.flush();
		}
		if(this.toggleButton != null) {
			this.toggleButton.set_toggled(!this.get_visible());
		}
		if(this.get_visible() && this._alwaysOnTop) {
			this.parent.addChild(this);
		}
	}
	,toggleVisible: function() {
		this.setVisible(!this.get_visible());
	}
	,putOnTop: function() {
		this.parent.addChild(this);
	}
	,loadSaveData: function() {
		if(flixel_FlxG.save.data.windowSettings != null) {
			this.set_visible(flixel_FlxG.save.data.windowSettings[this._id]);
		} else {
			this.initSaveData();
			this.loadSaveData();
		}
	}
	,initSaveData: function() {
		var settings = [];
		settings[0] = true;
		settings[1] = true;
		settings[2] = true;
		settings[3] = true;
		settings[4] = true;
		settings[5] = true;
		settings[6] = true;
		settings[7] = true;
		settings[8] = true;
		settings[9] = true;
		flixel_FlxG.save.data.windowSettings = settings;
		flixel_FlxG.save.flush();
	}
	,update: function() {
	}
	,init: function(E) {
		if(this.stage == null) {
			return;
		}
		this.removeEventListener("enterFrame",$bind(this,this.init));
		this.stage.addEventListener("mouseMove",$bind(this,this.onMouseMove));
		this.stage.addEventListener("mouseUp",$bind(this,this.onMouseUp));
		this.addEventListener("mouseDown",$bind(this,this.onMouseDown));
	}
	,onMouseMove: function(E) {
		var mouseX = this.get_mouseX() < 0 ? 0 : this.get_mouseX();
		var mouseY = this.get_mouseY() < 0 ? 0 : this.get_mouseY();
		if(!this.parent.get_visible()) {
			this._overHandle = this._overHeader = false;
			return;
		}
		if(this._dragging) {
			this._overHeader = true;
			this.reposition(this.parent.get_mouseX() - this._drag.x,this.parent.get_mouseY() - this._drag.y);
		} else if(this._resizing) {
			this._overHandle = true;
			this.resize(mouseX - this._drag.x,mouseY - this._drag.y);
		} else if(mouseX >= 0 && mouseX <= this._width && mouseY >= 0 && mouseY <= this._height) {
			this._overHeader = mouseX <= this._header.get_width() && mouseY <= this._header.get_height();
			if(this._resizable) {
				this._overHandle = mouseX >= this._width - this._handle.get_width() && mouseY >= this._height - this._handle.get_height();
			}
		} else {
			this._overHandle = this._overHeader = false;
		}
	}
	,onMouseDown: function(E) {
		if(this._overHeader) {
			if(this._alwaysOnTop) {
				this.parent.addChild(this);
			}
			this._dragging = true;
			this._drag.x = this.get_mouseX();
			this._drag.y = this.get_mouseY();
		} else if(this._overHandle) {
			if(this._alwaysOnTop) {
				this.parent.addChild(this);
			}
			this._resizing = true;
			var tmp = this._width;
			var tmp1 = this.get_mouseX();
			this._drag.x = tmp - tmp1;
			var tmp = this._height;
			var tmp1 = this.get_mouseY();
			this._drag.y = tmp - tmp1;
		}
	}
	,onMouseUp: function(E) {
		this._dragging = false;
		this._resizing = false;
	}
	,bound: function() {
		if(this._bounds != null) {
			var Value = this.get_x();
			var Min = this._bounds.get_left();
			var Max = this._bounds.get_right() - this._width;
			var lowerBound = Min != null && Value < Min ? Min : Value;
			this.set_x(Max != null && lowerBound > Max ? Max : lowerBound);
			var Value = this.get_y();
			var Min = this._bounds.get_top();
			var Max = this._bounds.get_bottom() - this._height;
			var lowerBound = Min != null && Value < Min ? Min : Value;
			this.set_y(Max != null && lowerBound > Max ? Max : lowerBound);
		}
	}
	,updateSize: function() {
		var Value = this._width;
		var Min = this.minSize.x;
		var Max = this.maxSize.x;
		var lowerBound = Min != null && Value < Min ? Min : Value;
		this._width = (Max != null && lowerBound > Max ? Max : lowerBound) | 0;
		var Value = this._height;
		var Min = this.minSize.y;
		var Max = this.maxSize.y;
		var lowerBound = Min != null && Value < Min ? Min : Value;
		this._height = (Max != null && lowerBound > Max ? Max : lowerBound) | 0;
		this._header.set_scaleX(this._width);
		this._background.set_scaleX(this._width);
		this._background.set_scaleY(this._height - this._header.get_height());
		this._shadow.set_scaleX(this._width);
		this._shadow.set_y(this._height);
		this._title.set_width(this._width - 4);
		if(this._resizable) {
			this._handle.set_x(this._width - this._handle.get_width());
			this._handle.set_y(this._height - this._handle.get_height());
		}
		if(this._closeButton != null) {
			this._closeButton.set_x(this._width - this._closeButton.get_width() - 3);
			this._closeButton.set_y(3);
		}
	}
	,close: function() {
		this.destroy();
	}
	,__class__: flixel_system_debug_Window
});
var flixel_system_debug_completion_CompletionList = function(capacity) {
	this.upperVisibleIndex = 0;
	this.lowerVisibleIndex = 0;
	this.selectedIndex = 0;
	this.entries = [];
	openfl_display_Sprite.call(this);
	this.set_visible(false);
	this.upperVisibleIndex = capacity - 1;
	this.actualHeight = capacity * 20;
	this.createPopupEntries(capacity);
	this.createScrollBar();
	this.updateSelectedItem();
	openfl_Lib.get_current().stage.addEventListener("keyDown",$bind(this,this.onKeyDown));
};
$hxClasses["flixel.system.debug.completion.CompletionList"] = flixel_system_debug_completion_CompletionList;
flixel_system_debug_completion_CompletionList.__name__ = "flixel.system.debug.completion.CompletionList";
flixel_system_debug_completion_CompletionList.__super__ = openfl_display_Sprite;
flixel_system_debug_completion_CompletionList.prototype = $extend(openfl_display_Sprite.prototype,{
	completed: null
	,selectionChanged: null
	,closed: null
	,filter: null
	,items: null
	,entries: null
	,originalItems: null
	,selectedIndex: null
	,lowerVisibleIndex: null
	,upperVisibleIndex: null
	,scrollBar: null
	,actualHeight: null
	,show: function(x,items) {
		this.set_visible(true);
		this.set_x(x);
		this.originalItems = items;
		this.set_filter("");
		this.updateEntries();
	}
	,setY: function(y) {
		this.set_y(y - this.actualHeight);
	}
	,close: function() {
		this.set_visible(false);
		this.set_filter(null);
		if(this.closed != null) {
			this.closed();
		}
	}
	,createPopupEntries: function(amount) {
		var _g = 0;
		var _g1 = amount;
		while(_g < _g1) {
			var i = _g++;
			var entry = new flixel_system_debug_completion_CompletionListEntry();
			this.entries.push(entry);
			this.addChild(entry);
			entry.set_y(20 * i);
		}
	}
	,createScrollBar: function() {
		this.scrollBar = new flixel_system_debug_completion_CompletionListScrollBar(150,0,5,this.actualHeight);
		this.addChild(this.scrollBar);
	}
	,onKeyDown: function(e) {
		if(!this.get_visible()) {
			return;
		}
		switch(e.keyCode) {
		case 13:
			if(this.completed != null) {
				this.completed(this.items[this.selectedIndex]);
			}
			this.close();
			return;
		case 27:
			this.close();
			return;
		case 38:
			this.updateIndices(-1);
			break;
		case 40:
			this.updateIndices(1);
			break;
		}
		this.updateEntries();
	}
	,updateIndices: function(modifier) {
		this.selectedIndex = this.bound(this.selectedIndex + modifier);
		var Value = this.selectedIndex;
		var Min = this.lowerVisibleIndex;
		var Max = this.upperVisibleIndex;
		if((Min == null || Value >= Min) && (Max == null || Value <= Max)) {
			return;
		}
		this.lowerVisibleIndex = this.bound(this.lowerVisibleIndex + modifier);
		this.upperVisibleIndex = this.bound(this.upperVisibleIndex + modifier);
		var range = this.upperVisibleIndex - this.lowerVisibleIndex;
		if(range == this.items.length) {
			return;
		}
		if(this.lowerVisibleIndex == 0) {
			this.upperVisibleIndex = this.entries.length - 1;
		} else if(this.upperVisibleIndex == this.items.length - 1) {
			this.lowerVisibleIndex = this.items.length - this.entries.length;
		}
	}
	,bound: function(index) {
		var Max = this.items.length - 1;
		var lowerBound = index < 0 ? 0 : index;
		return (Max != null && lowerBound > Max ? Max : lowerBound) | 0;
	}
	,updateEntries: function() {
		this.updateLabels();
		this.updateSelectedItem();
		this.scrollBar.updateHandle(this.lowerVisibleIndex,this.items.length,this.entries.length);
	}
	,updateLabels: function() {
		var _g = 0;
		var _g1 = this.entries.length;
		while(_g < _g1) {
			var i = _g++;
			var selectedItem = this.items[this.lowerVisibleIndex + i];
			if(selectedItem == null) {
				selectedItem = "";
			}
			this.entries[i].setItem(selectedItem);
		}
	}
	,updateSelectedItem: function() {
		var _g = 0;
		var _g1 = this.entries;
		while(_g < _g1.length) {
			var entry = _g1[_g];
			++_g;
			entry.set_selected(false);
		}
		this.entries[this.selectedIndex - this.lowerVisibleIndex].set_selected(true);
		if(this.selectionChanged != null) {
			this.selectionChanged(this.items[this.selectedIndex]);
		}
	}
	,setItems: function(items) {
		if(items == null) {
			return;
		}
		if(items.length == 0) {
			this.close();
		}
		this.items = items;
		this.selectedIndex = 0;
		this.lowerVisibleIndex = 0;
		this.upperVisibleIndex = this.entries.length - 1;
		this.updateEntries();
	}
	,filterItems: function(filter) {
		if(filter == null) {
			filter = "";
		}
		var _g = [];
		var _g1 = 0;
		var _g2 = this.originalItems;
		while(_g1 < _g2.length) {
			var v = _g2[_g1];
			++_g1;
			if(v.toLowerCase().indexOf(filter.toLowerCase()) != -1) {
				_g.push(v);
			}
		}
		return this.sortItems(filter,_g);
	}
	,sortItems: function(filter,items) {
		var _gthis = this;
		if(filter == "") {
			return items;
		}
		items.sort(function(a,b) {
			var valueA = _gthis.startsWithExt(a,filter);
			var valueB = _gthis.startsWithExt(b,filter);
			if(valueA > valueB) {
				return -valueA;
			}
			if(valueB > valueA) {
				return valueB;
			}
			if(valueA == valueB) {
				return a.length - b.length | 0;
			}
			return 0;
		});
		return items;
	}
	,startsWithExt: function(s,start) {
		if(StringTools.startsWith(s,start)) {
			return 2;
		}
		var _this_r = new RegExp("^[_]+","".split("u").join(""));
		if(StringTools.startsWith(s.replace(_this_r,""),start)) {
			return 1;
		}
		return 0;
	}
	,set_filter: function(filter) {
		if(filter == this.filter) {
			return filter;
		}
		this.setItems(this.filterItems(filter));
		return this.filter = filter;
	}
	,__class__: flixel_system_debug_completion_CompletionList
	,__properties__: $extend(openfl_display_Sprite.prototype.__properties__,{set_filter:"set_filter"})
});
var flixel_system_debug_completion_CompletionListEntry = function() {
	this.selected = false;
	openfl_display_Sprite.call(this);
	this.initBitmapDatas();
	this.addChild(this.background = new openfl_display_Bitmap());
	this.background.set_bitmapData(flixel_system_debug_completion_CompletionListEntry.normalBitmapData);
	this.label = flixel_system_debug_DebuggerUtil.createTextField();
	this.label.set_x(4);
	this.addChild(this.label);
};
$hxClasses["flixel.system.debug.completion.CompletionListEntry"] = flixel_system_debug_completion_CompletionListEntry;
flixel_system_debug_completion_CompletionListEntry.__name__ = "flixel.system.debug.completion.CompletionListEntry";
flixel_system_debug_completion_CompletionListEntry.normalBitmapData = null;
flixel_system_debug_completion_CompletionListEntry.highlightBitmapData = null;
flixel_system_debug_completion_CompletionListEntry.__super__ = openfl_display_Sprite;
flixel_system_debug_completion_CompletionListEntry.prototype = $extend(openfl_display_Sprite.prototype,{
	selected: null
	,background: null
	,label: null
	,initBitmapDatas: function() {
		if(flixel_system_debug_completion_CompletionListEntry.normalBitmapData == null) {
			flixel_system_debug_completion_CompletionListEntry.normalBitmapData = new openfl_display_BitmapData(150,20,true,-10526881);
		}
		if(flixel_system_debug_completion_CompletionListEntry.highlightBitmapData == null) {
			flixel_system_debug_completion_CompletionListEntry.highlightBitmapData = new openfl_display_BitmapData(150,20,true,-9605779);
		}
	}
	,setItem: function(item) {
		this.label.set_text(item);
		if(this.label.get_width() > 150) {
			this.label.set_width(150);
			this.label.set_autoSize(2);
		}
	}
	,set_selected: function(selected) {
		if(selected == this.selected) {
			return selected;
		}
		this.background.set_bitmapData(selected ? flixel_system_debug_completion_CompletionListEntry.highlightBitmapData : flixel_system_debug_completion_CompletionListEntry.normalBitmapData);
		return this.selected = selected;
	}
	,__class__: flixel_system_debug_completion_CompletionListEntry
	,__properties__: $extend(openfl_display_Sprite.prototype.__properties__,{set_selected:"set_selected"})
});
var flixel_system_debug_completion_CompletionListScrollBar = function(x,y,width,height) {
	openfl_display_Sprite.call(this);
	this.set_x(x);
	this.set_y(y);
	this.addChild(new openfl_display_Bitmap(new openfl_display_BitmapData(width,height,true,-12303292)));
	this.handle = new openfl_display_Bitmap(new openfl_display_BitmapData(width,1,true,-14540254));
	this.addChild(this.handle);
};
$hxClasses["flixel.system.debug.completion.CompletionListScrollBar"] = flixel_system_debug_completion_CompletionListScrollBar;
flixel_system_debug_completion_CompletionListScrollBar.__name__ = "flixel.system.debug.completion.CompletionListScrollBar";
flixel_system_debug_completion_CompletionListScrollBar.__super__ = openfl_display_Sprite;
flixel_system_debug_completion_CompletionListScrollBar.prototype = $extend(openfl_display_Sprite.prototype,{
	handle: null
	,updateHandle: function(lower,items,entries) {
		this.handle.set_scaleY(Math.min(this.get_height() / items * entries,this.get_height()));
		this.handle.set_y(this.get_height() / items * lower);
		var tmp = this.handle;
		var Value = this.handle.get_y();
		var Max = this.get_height() - this.handle.get_scaleY();
		var lowerBound = Value < 0 ? 0 : Value;
		tmp.set_y(Max != null && lowerBound > Max ? Max : lowerBound);
	}
	,__class__: flixel_system_debug_completion_CompletionListScrollBar
});
var flixel_system_debug_console_ConsoleUtil = function() { };
$hxClasses["flixel.system.debug.console.ConsoleUtil"] = flixel_system_debug_console_ConsoleUtil;
flixel_system_debug_console_ConsoleUtil.__name__ = "flixel.system.debug.console.ConsoleUtil";
flixel_system_debug_console_ConsoleUtil.parser = null;
flixel_system_debug_console_ConsoleUtil.interp = null;
flixel_system_debug_console_ConsoleUtil.init = function() {
	flixel_system_debug_console_ConsoleUtil.parser = new hscript_Parser();
	flixel_system_debug_console_ConsoleUtil.parser.allowJSON = true;
	flixel_system_debug_console_ConsoleUtil.parser.allowTypes = true;
	flixel_system_debug_console_ConsoleUtil.interp = new flixel_system_debug_console__$ConsoleUtil_Interp();
};
flixel_system_debug_console_ConsoleUtil.parseCommand = function(Input) {
	if(StringTools.endsWith(Input,";")) {
		Input = HxOverrides.substr(Input,0,-1);
	}
	return flixel_system_debug_console_ConsoleUtil.parser.parseString(Input);
};
flixel_system_debug_console_ConsoleUtil.runCommand = function(Input) {
	return flixel_system_debug_console_ConsoleUtil.interp.expr(flixel_system_debug_console_ConsoleUtil.parseCommand(Input));
};
flixel_system_debug_console_ConsoleUtil.runExpr = function(expr) {
	return flixel_system_debug_console_ConsoleUtil.interp.expr(expr);
};
flixel_system_debug_console_ConsoleUtil.registerObject = function(ObjectAlias,AnyObject) {
	if(AnyObject == null || Reflect.isObject(AnyObject)) {
		flixel_system_debug_console_ConsoleUtil.interp.variables.h[ObjectAlias] = AnyObject;
	}
};
flixel_system_debug_console_ConsoleUtil.registerFunction = function(FunctionAlias,Function1) {
	if(Reflect.isFunction(Function1)) {
		flixel_system_debug_console_ConsoleUtil.interp.variables.h[FunctionAlias] = Function1;
	}
};
flixel_system_debug_console_ConsoleUtil.getFields = function(Object1) {
	var fields = [];
	if(js_Boot.__instanceof(Object1,Class)) {
		fields = Type.getClassFields(Object1);
	} else if(js_Boot.__instanceof(Object1,Enum)) {
		fields = Object1.__constructs__.slice();
	} else if(Reflect.isObject(Object1)) {
		fields = Type.getInstanceFields(js_Boot.getClass(Object1));
	}
	HxOverrides.remove(fields,"__constructs__");
	var filteredFields = [];
	var _g = 0;
	while(_g < fields.length) {
		var field = fields[_g];
		++_g;
		if(StringTools.startsWith(field,"get_") || StringTools.startsWith(field,"set_")) {
			var name = HxOverrides.substr(field,4,null);
			if(fields.indexOf(name) == -1 && filteredFields.indexOf(name) == -1) {
				filteredFields.push(name);
			}
		} else {
			filteredFields.push(field);
		}
	}
	return flixel_system_debug_console_ConsoleUtil.sortFields(filteredFields);
};
flixel_system_debug_console_ConsoleUtil.sortFields = function(fields) {
	var underscoreList = [];
	var _g = [];
	var _g1 = 0;
	var _g2 = fields;
	while(_g1 < _g2.length) {
		var v = _g2[_g1];
		++_g1;
		var fields1;
		if(StringTools.startsWith(v,"_")) {
			underscoreList.push(v);
			fields1 = false;
		} else {
			fields1 = true;
		}
		if(fields1) {
			_g.push(v);
		}
	}
	fields = _g;
	flixel_util_FlxStringUtil.sortAlphabetically(fields);
	flixel_util_FlxStringUtil.sortAlphabetically(underscoreList);
	return fields.concat(underscoreList);
};
flixel_system_debug_console_ConsoleUtil.log = function(Text1) {
	flixel_FlxG.log.advanced([Text1],flixel_system_debug_log_LogStyle.CONSOLE);
};
var hscript_Interp = function() {
	this.locals = new haxe_ds_StringMap();
	this.declared = [];
	this.resetVariables();
	this.initOps();
};
$hxClasses["hscript.Interp"] = hscript_Interp;
hscript_Interp.__name__ = "hscript.Interp";
hscript_Interp.prototype = {
	variables: null
	,locals: null
	,binops: null
	,depth: null
	,inTry: null
	,declared: null
	,returnValue: null
	,resetVariables: function() {
		var _gthis = this;
		this.variables = new haxe_ds_StringMap();
		this.variables.h["null"] = null;
		this.variables.h["true"] = true;
		this.variables.h["false"] = false;
		var this1 = this.variables;
		var value = Reflect.makeVarArgs(function(el) {
			var inf = _gthis.posInfos();
			var v = el.shift();
			if(el.length > 0) {
				inf.customParams = el;
			}
			haxe_Log.trace(Std.string(v),inf);
		});
		this1.h["trace"] = value;
	}
	,posInfos: function() {
		return { fileName : "hscript", lineNumber : 0};
	}
	,initOps: function() {
		var me = this;
		this.binops = new haxe_ds_StringMap();
		this.binops.h["+"] = function(e1,e2) {
			return me.expr(e1) + me.expr(e2);
		};
		this.binops.h["-"] = function(e1,e2) {
			return me.expr(e1) - me.expr(e2);
		};
		this.binops.h["*"] = function(e1,e2) {
			return me.expr(e1) * me.expr(e2);
		};
		this.binops.h["/"] = function(e1,e2) {
			return me.expr(e1) / me.expr(e2);
		};
		this.binops.h["%"] = function(e1,e2) {
			return me.expr(e1) % me.expr(e2);
		};
		this.binops.h["&"] = function(e1,e2) {
			return me.expr(e1) & me.expr(e2);
		};
		this.binops.h["|"] = function(e1,e2) {
			return me.expr(e1) | me.expr(e2);
		};
		this.binops.h["^"] = function(e1,e2) {
			return me.expr(e1) ^ me.expr(e2);
		};
		this.binops.h["<<"] = function(e1,e2) {
			return me.expr(e1) << me.expr(e2);
		};
		this.binops.h[">>"] = function(e1,e2) {
			return me.expr(e1) >> me.expr(e2);
		};
		this.binops.h[">>>"] = function(e1,e2) {
			return me.expr(e1) >>> me.expr(e2);
		};
		this.binops.h["=="] = function(e1,e2) {
			return me.expr(e1) == me.expr(e2);
		};
		this.binops.h["!="] = function(e1,e2) {
			return me.expr(e1) != me.expr(e2);
		};
		this.binops.h[">="] = function(e1,e2) {
			return me.expr(e1) >= me.expr(e2);
		};
		this.binops.h["<="] = function(e1,e2) {
			return me.expr(e1) <= me.expr(e2);
		};
		this.binops.h[">"] = function(e1,e2) {
			return me.expr(e1) > me.expr(e2);
		};
		this.binops.h["<"] = function(e1,e2) {
			return me.expr(e1) < me.expr(e2);
		};
		this.binops.h["||"] = function(e1,e2) {
			if(me.expr(e1) != true) {
				return me.expr(e2) == true;
			} else {
				return true;
			}
		};
		this.binops.h["&&"] = function(e1,e2) {
			if(me.expr(e1) == true) {
				return me.expr(e2) == true;
			} else {
				return false;
			}
		};
		this.binops.h["="] = $bind(this,this.assign);
		this.binops.h["..."] = function(e1,e2) {
			return new IntIterator(me.expr(e1),me.expr(e2));
		};
		this.assignOp("+=",function(v1,v2) {
			return v1 + v2;
		});
		this.assignOp("-=",function(v1,v2) {
			return v1 - v2;
		});
		this.assignOp("*=",function(v1,v2) {
			return v1 * v2;
		});
		this.assignOp("/=",function(v1,v2) {
			return v1 / v2;
		});
		this.assignOp("%=",function(v1,v2) {
			return v1 % v2;
		});
		this.assignOp("&=",function(v1,v2) {
			return v1 & v2;
		});
		this.assignOp("|=",function(v1,v2) {
			return v1 | v2;
		});
		this.assignOp("^=",function(v1,v2) {
			return v1 ^ v2;
		});
		this.assignOp("<<=",function(v1,v2) {
			return v1 << v2;
		});
		this.assignOp(">>=",function(v1,v2) {
			return v1 >> v2;
		});
		this.assignOp(">>>=",function(v1,v2) {
			return v1 >>> v2;
		});
	}
	,assign: function(e1,e2) {
		var v = this.expr(e2);
		switch(e1._hx_index) {
		case 1:
			var id = e1.v;
			var l = this.locals.h[id];
			if(l == null) {
				this.variables.h[id] = v;
			} else {
				l.r = v;
			}
			break;
		case 5:
			var f = e1.f;
			var e = e1.e;
			v = this.set(this.expr(e),f,v);
			break;
		case 16:
			var index = e1.index;
			var e = e1.e;
			var arr = this.expr(e);
			var index1 = this.expr(index);
			if(js_Boot.__implements(arr,haxe_IMap)) {
				(js_Boot.__cast(arr , haxe_IMap)).set(index1,v);
			} else {
				arr[index1] = v;
			}
			break;
		default:
			var e = hscript_Error.EInvalidOp("=");
			throw haxe_Exception.thrown(e);
		}
		return v;
	}
	,assignOp: function(op,fop) {
		var me = this;
		this.binops.h[op] = function(e1,e2) {
			return me.evalAssignOp(op,fop,e1,e2);
		};
	}
	,evalAssignOp: function(op,fop,e1,e2) {
		var v;
		switch(e1._hx_index) {
		case 1:
			var id = e1.v;
			var l = this.locals.h[id];
			v = fop(this.expr(e1),this.expr(e2));
			if(l == null) {
				this.variables.h[id] = v;
			} else {
				l.r = v;
			}
			break;
		case 5:
			var f = e1.f;
			var e = e1.e;
			var obj = this.expr(e);
			v = fop(this.get(obj,f),this.expr(e2));
			v = this.set(obj,f,v);
			break;
		case 16:
			var index = e1.index;
			var e = e1.e;
			var arr = this.expr(e);
			var index1 = this.expr(index);
			if(js_Boot.__implements(arr,haxe_IMap)) {
				v = fop((js_Boot.__cast(arr , haxe_IMap)).get(index1),this.expr(e2));
				(js_Boot.__cast(arr , haxe_IMap)).set(index1,v);
			} else {
				v = fop(arr[index1],this.expr(e2));
				arr[index1] = v;
			}
			break;
		default:
			var e = hscript_Error.EInvalidOp(op);
			throw haxe_Exception.thrown(e);
		}
		return v;
	}
	,increment: function(e,prefix,delta) {
		switch(e._hx_index) {
		case 1:
			var id = e.v;
			var l = this.locals.h[id];
			var v = l == null ? this.variables.h[id] : l.r;
			if(prefix) {
				v += delta;
				if(l == null) {
					this.variables.h[id] = v;
				} else {
					l.r = v;
				}
			} else if(l == null) {
				this.variables.h[id] = v + delta;
			} else {
				l.r = v + delta;
			}
			return v;
		case 5:
			var f = e.f;
			var e1 = e.e;
			var obj = this.expr(e1);
			var v = this.get(obj,f);
			if(prefix) {
				v += delta;
				this.set(obj,f,v);
			} else {
				this.set(obj,f,v + delta);
			}
			return v;
		case 16:
			var index = e.index;
			var e1 = e.e;
			var arr = this.expr(e1);
			var index1 = this.expr(index);
			if(js_Boot.__implements(arr,haxe_IMap)) {
				var v = (js_Boot.__cast(arr , haxe_IMap)).get(index1);
				if(prefix) {
					v += delta;
					(js_Boot.__cast(arr , haxe_IMap)).set(index1,v);
				} else {
					(js_Boot.__cast(arr , haxe_IMap)).set(index1,v + delta);
				}
				return v;
			} else {
				var v = arr[index1];
				if(prefix) {
					v += delta;
					arr[index1] = v;
				} else {
					arr[index1] = v + delta;
				}
				return v;
			}
			break;
		default:
			var e = hscript_Error.EInvalidOp(delta > 0 ? "++" : "--");
			throw haxe_Exception.thrown(e);
		}
	}
	,execute: function(expr) {
		this.depth = 0;
		this.locals = new haxe_ds_StringMap();
		this.declared = [];
		return this.exprReturn(expr);
	}
	,exprReturn: function(e) {
		try {
			return this.expr(e);
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var _g1 = haxe_Exception.caught(_g).unwrap();
			if(js_Boot.__instanceof(_g1,hscript__$Interp_Stop)) {
				var e = _g1;
				switch(e._hx_index) {
				case 0:
					throw haxe_Exception.thrown("Invalid break");
				case 1:
					throw haxe_Exception.thrown("Invalid continue");
				case 2:
					var v = this.returnValue;
					this.returnValue = null;
					return v;
				}
			} else {
				throw _g;
			}
		}
	}
	,duplicate: function(h) {
		var h2 = new haxe_ds_StringMap();
		var k = haxe_ds_StringMap.keysIterator(h.h);
		while(k.hasNext()) {
			var k1 = k.next();
			h2.h[k1] = h.h[k1];
		}
		return h2;
	}
	,restore: function(old) {
		while(this.declared.length > old) {
			var d = this.declared.pop();
			this.locals.h[d.n] = d.old;
		}
	}
	,error: function(e,rethrow) {
		if(rethrow == null) {
			rethrow = false;
		}
		if(rethrow) {
			throw haxe_Exception.thrown(e);
		} else {
			throw haxe_Exception.thrown(e);
		}
	}
	,rethrow: function(e) {
		throw haxe_Exception.thrown(e);
	}
	,resolve: function(id) {
		var l = this.locals.h[id];
		if(l != null) {
			return l.r;
		}
		var v = this.variables.h[id];
		if(v == null && !Object.prototype.hasOwnProperty.call(this.variables.h,id)) {
			var e = hscript_Error.EUnknownVariable(id);
			throw haxe_Exception.thrown(e);
		}
		return v;
	}
	,expr: function(e) {
		var _gthis = this;
		switch(e._hx_index) {
		case 0:
			var c = e.c;
			switch(c._hx_index) {
			case 0:
				var v = c.v;
				return v;
			case 1:
				var f = c.f;
				return f;
			case 2:
				var s = c.s;
				return s;
			}
			break;
		case 1:
			var id = e.v;
			return this.resolve(id);
		case 2:
			var _g = e.t;
			var e1 = e.e;
			var n = e.n;
			this.declared.push({ n : n, old : this.locals.h[n]});
			var this1 = this.locals;
			var value = e1 == null ? null : this.expr(e1);
			this1.h[n] = { r : value};
			return null;
		case 3:
			var e1 = e.e;
			return this.expr(e1);
		case 4:
			var exprs = e.e;
			var old = this.declared.length;
			var v = null;
			var _g = 0;
			while(_g < exprs.length) {
				var e1 = exprs[_g];
				++_g;
				v = this.expr(e1);
			}
			this.restore(old);
			return v;
		case 5:
			var f = e.f;
			var e1 = e.e;
			return this.get(this.expr(e1),f);
		case 6:
			var e2 = e.e2;
			var e1 = e.e1;
			var op = e.op;
			var fop = this.binops.h[op];
			if(fop == null) {
				var e3 = hscript_Error.EInvalidOp(op);
				throw haxe_Exception.thrown(e3);
			}
			return fop(e1,e2);
		case 7:
			var e1 = e.e;
			var prefix = e.prefix;
			var op = e.op;
			switch(op) {
			case "!":
				return this.expr(e1) != true;
			case "++":
				return this.increment(e1,prefix,1);
			case "-":
				return -this.expr(e1);
			case "--":
				return this.increment(e1,prefix,-1);
			case "~":
				return ~this.expr(e1);
			default:
				var e1 = hscript_Error.EInvalidOp(op);
				throw haxe_Exception.thrown(e1);
			}
			break;
		case 8:
			var params = e.params;
			var e1 = e.e;
			var args = [];
			var _g = 0;
			while(_g < params.length) {
				var p = params[_g];
				++_g;
				args.push(this.expr(p));
			}
			if(e1._hx_index == 5) {
				var f = e1.f;
				var e2 = e1.e;
				var obj = this.expr(e2);
				if(obj == null) {
					var e2 = hscript_Error.EInvalidAccess(f);
					throw haxe_Exception.thrown(e2);
				}
				return this.fcall(obj,f,args);
			} else {
				return this.call(null,this.expr(e1),args);
			}
			break;
		case 9:
			var e2 = e.e2;
			var e1 = e.e1;
			var econd = e.cond;
			if(this.expr(econd) == true) {
				return this.expr(e1);
			} else if(e2 == null) {
				return null;
			} else {
				return this.expr(e2);
			}
			break;
		case 10:
			var e1 = e.e;
			var econd = e.cond;
			this.whileLoop(econd,e1);
			return null;
		case 11:
			var e1 = e.e;
			var it = e.it;
			var v = e.v;
			this.forLoop(v,it,e1);
			return null;
		case 12:
			throw haxe_Exception.thrown(hscript__$Interp_Stop.SBreak);
		case 13:
			throw haxe_Exception.thrown(hscript__$Interp_Stop.SContinue);
		case 14:
			var _g = e.ret;
			var name = e.name;
			var fexpr = e.e;
			var params = e.args;
			var capturedLocals = this.duplicate(this.locals);
			var me = this;
			var hasOpt = false;
			var minParams = 0;
			var _g = 0;
			while(_g < params.length) {
				var p = params[_g];
				++_g;
				if(p.opt) {
					hasOpt = true;
				} else {
					minParams += 1;
				}
			}
			var f = function(args) {
				if((args == null ? 0 : args.length) != params.length) {
					if(args.length < minParams) {
						var str = "Invalid number of parameters. Got " + args.length + ", required " + minParams;
						if(name != null) {
							str += " for function '" + name + "'";
						}
						var e = hscript_Error.ECustom(str);
						throw haxe_Exception.thrown(e);
					}
					var args2 = [];
					var extraParams = args.length - minParams;
					var pos = 0;
					var _g = 0;
					while(_g < params.length) {
						var p = params[_g];
						++_g;
						if(p.opt) {
							if(extraParams > 0) {
								args2.push(args[pos++]);
								--extraParams;
							} else {
								args2.push(null);
							}
						} else {
							args2.push(args[pos++]);
						}
					}
					args = args2;
				}
				var old = me.locals;
				var depth = me.depth;
				me.depth++;
				me.locals = me.duplicate(capturedLocals);
				var _g = 0;
				var _g1 = params.length;
				while(_g < _g1) {
					var i = _g++;
					me.locals.h[params[i].name] = { r : args[i]};
				}
				var r = null;
				if(_gthis.inTry) {
					try {
						r = me.exprReturn(fexpr);
					} catch( _g ) {
						haxe_NativeStackTrace.lastError = _g;
						var e = haxe_Exception.caught(_g).unwrap();
						me.locals = old;
						me.depth = depth;
						throw haxe_Exception.thrown(e);
					}
				} else {
					r = me.exprReturn(fexpr);
				}
				me.locals = old;
				me.depth = depth;
				return r;
			};
			var f1 = Reflect.makeVarArgs(f);
			if(name != null) {
				if(this.depth == 0) {
					this.variables.h[name] = f1;
				} else {
					this.declared.push({ n : name, old : this.locals.h[name]});
					var ref = { r : f1};
					this.locals.h[name] = ref;
					capturedLocals.h[name] = ref;
				}
			}
			return f1;
		case 15:
			var e1 = e.e;
			this.returnValue = e1 == null ? null : this.expr(e1);
			throw haxe_Exception.thrown(hscript__$Interp_Stop.SReturn);
		case 16:
			var index = e.index;
			var e1 = e.e;
			var arr = this.expr(e1);
			var index1 = this.expr(index);
			if(js_Boot.__implements(arr,haxe_IMap)) {
				return (js_Boot.__cast(arr , haxe_IMap)).get(index1);
			} else {
				return arr[index1];
			}
			break;
		case 17:
			var arr = e.e;
			var tmp;
			if(arr.length > 0) {
				var _g = arr[0];
				if(_g._hx_index == 6) {
					var _g1 = _g.e2;
					var _g1 = _g.e1;
					tmp = _g.op == "=>";
				} else {
					tmp = false;
				}
			} else {
				tmp = false;
			}
			if(tmp) {
				var isAllString = true;
				var isAllInt = true;
				var isAllObject = true;
				var isAllEnum = true;
				var keys = [];
				var values = [];
				var _g = 0;
				while(_g < arr.length) {
					var e1 = arr[_g];
					++_g;
					if(e1._hx_index == 6) {
						if(e1.op == "=>") {
							var eValue = e1.e2;
							var eKey = e1.e1;
							var key = this.expr(eKey);
							var value = this.expr(eValue);
							isAllString = isAllString && typeof(key) == "string";
							isAllInt = isAllInt && (typeof(key) == "number" && ((key | 0) === key));
							isAllObject = isAllObject && Reflect.isObject(key);
							isAllEnum = isAllEnum && Reflect.isEnumValue(key);
							keys.push(key);
							values.push(value);
						} else {
							throw haxe_Exception.thrown("=> expected");
						}
					} else {
						throw haxe_Exception.thrown("=> expected");
					}
				}
				var map;
				if(isAllInt) {
					map = new haxe_ds_IntMap();
				} else if(isAllString) {
					map = new haxe_ds_StringMap();
				} else if(isAllEnum) {
					map = new haxe_ds_EnumValueMap();
				} else if(isAllObject) {
					map = new haxe_ds_ObjectMap();
				} else {
					throw haxe_Exception.thrown("Inconsistent key types");
				}
				var _g = 0;
				var _g1 = keys.length;
				while(_g < _g1) {
					var n = _g++;
					(js_Boot.__cast(map , haxe_IMap)).set(keys[n],values[n]);
				}
				return map;
			} else {
				var a = [];
				var _g = 0;
				while(_g < arr.length) {
					var e1 = arr[_g];
					++_g;
					a.push(this.expr(e1));
				}
				return a;
			}
			break;
		case 18:
			var params1 = e.params;
			var cl = e.cl;
			var a = [];
			var _g = 0;
			while(_g < params1.length) {
				var e1 = params1[_g];
				++_g;
				a.push(this.expr(e1));
			}
			return this.cnew(cl,a);
		case 19:
			var e1 = e.e;
			throw haxe_Exception.thrown(this.expr(e1));
		case 20:
			var _g = e.t;
			var ecatch = e.ecatch;
			var n = e.v;
			var e1 = e.e;
			var old = this.declared.length;
			var oldTry = this.inTry;
			try {
				this.inTry = true;
				var v = this.expr(e1);
				this.restore(old);
				this.inTry = oldTry;
				return v;
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				var _g1 = haxe_Exception.caught(_g).unwrap();
				if(js_Boot.__instanceof(_g1,hscript__$Interp_Stop)) {
					var err = _g1;
					this.inTry = oldTry;
					throw haxe_Exception.thrown(err);
				} else {
					var err = _g1;
					this.restore(old);
					this.inTry = oldTry;
					this.declared.push({ n : n, old : this.locals.h[n]});
					this.locals.h[n] = { r : err};
					var v = this.expr(ecatch);
					this.restore(old);
					return v;
				}
			}
			break;
		case 21:
			var fl = e.fl;
			var o = { };
			var _g = 0;
			while(_g < fl.length) {
				var f = fl[_g];
				++_g;
				this.set(o,f.name,this.expr(f.e));
			}
			return o;
		case 22:
			var e2 = e.e2;
			var e1 = e.e1;
			var econd = e.cond;
			if(this.expr(econd) == true) {
				return this.expr(e1);
			} else {
				return this.expr(e2);
			}
			break;
		case 23:
			var def = e.defaultExpr;
			var cases = e.cases;
			var e1 = e.e;
			var val = this.expr(e1);
			var match = false;
			var _g = 0;
			while(_g < cases.length) {
				var c = cases[_g];
				++_g;
				var _g1 = 0;
				var _g2 = c.values;
				while(_g1 < _g2.length) {
					var v = _g2[_g1];
					++_g1;
					if(this.expr(v) == val) {
						match = true;
						break;
					}
				}
				if(match) {
					val = this.expr(c.expr);
					break;
				}
			}
			if(!match) {
				val = def == null ? null : this.expr(def);
			}
			return val;
		case 24:
			var e1 = e.e;
			var econd = e.cond;
			this.doWhileLoop(econd,e1);
			return null;
		case 25:
			var _g = e.args;
			var _g = e.name;
			var e1 = e.e;
			return this.expr(e1);
		case 26:
			var _g = e.t;
			var e1 = e.e;
			return this.expr(e1);
		}
	}
	,doWhileLoop: function(econd,e) {
		var old = this.declared.length;
		_hx_loop1: while(true) {
			try {
				this.expr(e);
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				var _g1 = haxe_Exception.caught(_g).unwrap();
				if(js_Boot.__instanceof(_g1,hscript__$Interp_Stop)) {
					var err = _g1;
					switch(err._hx_index) {
					case 0:
						break _hx_loop1;
					case 1:
						break;
					case 2:
						throw haxe_Exception.thrown(err);
					}
				} else {
					throw _g;
				}
			}
			if(!(this.expr(econd) == true)) {
				break;
			}
		}
		this.restore(old);
	}
	,whileLoop: function(econd,e) {
		var old = this.declared.length;
		_hx_loop1: while(this.expr(econd) == true) try {
			this.expr(e);
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var _g1 = haxe_Exception.caught(_g).unwrap();
			if(js_Boot.__instanceof(_g1,hscript__$Interp_Stop)) {
				var err = _g1;
				switch(err._hx_index) {
				case 0:
					break _hx_loop1;
				case 1:
					break;
				case 2:
					throw haxe_Exception.thrown(err);
				}
			} else {
				throw _g;
			}
		}
		this.restore(old);
	}
	,makeIterator: function(v) {
		try {
			v = $getIterator(v);
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
		}
		if(v.hasNext == null || v.next == null) {
			var e = hscript_Error.EInvalidIterator(v);
			throw haxe_Exception.thrown(e);
		}
		return v;
	}
	,forLoop: function(n,it,e) {
		var old = this.declared.length;
		this.declared.push({ n : n, old : this.locals.h[n]});
		var it1 = this.makeIterator(this.expr(it));
		_hx_loop1: while(it1.hasNext()) {
			var this1 = this.locals;
			var value = { r : it1.next()};
			this1.h[n] = value;
			try {
				this.expr(e);
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				var _g1 = haxe_Exception.caught(_g).unwrap();
				if(js_Boot.__instanceof(_g1,hscript__$Interp_Stop)) {
					var err = _g1;
					switch(err._hx_index) {
					case 0:
						break _hx_loop1;
					case 1:
						break;
					case 2:
						throw haxe_Exception.thrown(err);
					}
				} else {
					throw _g;
				}
			}
		}
		this.restore(old);
	}
	,isMap: function(o) {
		return js_Boot.__implements(o,haxe_IMap);
	}
	,getMapValue: function(map,key) {
		return (js_Boot.__cast(map , haxe_IMap)).get(key);
	}
	,setMapValue: function(map,key,value) {
		(js_Boot.__cast(map , haxe_IMap)).set(key,value);
	}
	,get: function(o,f) {
		if(o == null) {
			var e = hscript_Error.EInvalidAccess(f);
			throw haxe_Exception.thrown(e);
		}
		return Reflect.getProperty(o,f);
	}
	,set: function(o,f,v) {
		if(o == null) {
			var e = hscript_Error.EInvalidAccess(f);
			throw haxe_Exception.thrown(e);
		}
		Reflect.setProperty(o,f,v);
		return v;
	}
	,fcall: function(o,f,args) {
		return this.call(o,this.get(o,f),args);
	}
	,call: function(o,f,args) {
		return f.apply(o,args);
	}
	,cnew: function(cl,args) {
		var c = $hxClasses[cl];
		if(c == null) {
			c = this.resolve(cl);
		}
		return Type.createInstance(c,args);
	}
	,__class__: hscript_Interp
};
var flixel_system_debug_console__$ConsoleUtil_Interp = function() {
	hscript_Interp.call(this);
};
$hxClasses["flixel.system.debug.console._ConsoleUtil.Interp"] = flixel_system_debug_console__$ConsoleUtil_Interp;
flixel_system_debug_console__$ConsoleUtil_Interp.__name__ = "flixel.system.debug.console._ConsoleUtil.Interp";
flixel_system_debug_console__$ConsoleUtil_Interp.__super__ = hscript_Interp;
flixel_system_debug_console__$ConsoleUtil_Interp.prototype = $extend(hscript_Interp.prototype,{
	getGlobals: function() {
		return this.toArray(haxe_ds_StringMap.keysIterator(this.locals.h)).concat(this.toArray(haxe_ds_StringMap.keysIterator(this.variables.h)));
	}
	,toArray: function(iterator) {
		var array = [];
		var element = iterator;
		while(element.hasNext()) {
			var element1 = element.next();
			array.push(element1);
		}
		return array;
	}
	,get: function(o,f) {
		if(o == null) {
			var e = hscript_Error.EInvalidAccess(f);
			throw haxe_Exception.thrown(e);
		}
		return Reflect.getProperty(o,f);
	}
	,set: function(o,f,v) {
		if(o == null) {
			var e = hscript_Error.EInvalidAccess(f);
			throw haxe_Exception.thrown(e);
		}
		Reflect.setProperty(o,f,v);
		return v;
	}
	,__class__: flixel_system_debug_console__$ConsoleUtil_Interp
});
var flixel_system_debug_interaction_Interaction = function(container) {
	this._flixelPointer = new flixel_input_FlxPointer();
	this._debuggerInteraction = false;
	this._keysUp = new haxe_ds_IntMap();
	this._keysDown = new haxe_ds_IntMap();
	this._turn = 2;
	this._tools = [];
	this.shouldDrawItemsSelection = true;
	this.pointerPressed = false;
	this.pointerJustReleased = false;
	this.pointerJustPressed = false;
	this.flixelPointer = new flixel_math_FlxPoint();
	this.selectedItems = new flixel_group_FlxTypedGroup();
	flixel_system_debug_Window.call(this,"Tools",new flixel_system_debug_GraphicInteractive(0,0),40,25,false);
	this.reposition(2,100);
	this._container = container;
	this._customCursor = new openfl_display_Sprite();
	this._customCursor.mouseEnabled = false;
	this._container.addChild(this._customCursor);
	this.addTool(new flixel_system_debug_interaction_tools_Pointer());
	this.addTool(new flixel_system_debug_interaction_tools_Mover());
	this.addTool(new flixel_system_debug_interaction_tools_Eraser());
	this.addTool(new flixel_system_debug_interaction_tools_Transform());
	flixel_FlxG.signals.postDraw.add($bind(this,this.postDraw));
	flixel_FlxG.debugger.visibilityChanged.add($bind(this,this.handleDebuggerVisibilityChanged));
	openfl_Lib.get_current().stage.addEventListener("mouseMove",$bind(this,this.updateMouse));
	openfl_Lib.get_current().stage.addEventListener("mouseDown",$bind(this,this.handleMouseClick));
	openfl_Lib.get_current().stage.addEventListener("mouseUp",$bind(this,this.handleMouseClick));
	openfl_Lib.get_current().stage.addEventListener("keyDown",$bind(this,this.handleKeyEvent));
	openfl_Lib.get_current().stage.addEventListener("keyUp",$bind(this,this.handleKeyEvent));
	this._container.addEventListener("mouseOver",$bind(this,this.handleMouseInDebugger));
	this._container.addEventListener("mouseOut",$bind(this,this.handleMouseInDebugger));
};
$hxClasses["flixel.system.debug.interaction.Interaction"] = flixel_system_debug_interaction_Interaction;
flixel_system_debug_interaction_Interaction.__name__ = "flixel.system.debug.interaction.Interaction";
flixel_system_debug_interaction_Interaction.__super__ = flixel_system_debug_Window;
flixel_system_debug_interaction_Interaction.prototype = $extend(flixel_system_debug_Window.prototype,{
	activeTool: null
	,selectedItems: null
	,flixelPointer: null
	,pointerJustPressed: null
	,pointerJustReleased: null
	,pointerPressed: null
	,shouldDrawItemsSelection: null
	,_container: null
	,_customCursor: null
	,_tools: null
	,_turn: null
	,_keysDown: null
	,_keysUp: null
	,_wasMouseVisible: null
	,_wasUsingSystemCursor: null
	,_debuggerInteraction: null
	,_flixelPointer: null
	,handleDebuggerVisibilityChanged: function() {
		if(flixel_FlxG.debugger.visible) {
			this.saveSystemCursorInfo();
		} else {
			this.restoreSystemCursor();
		}
	}
	,updateMouse: function(event) {
		if(event.stageX == null || event.stageY == null) {
			return;
		}
		var offsetX = 0.0;
		var offsetY = 0.0;
		if(this.activeTool != null) {
			var cursorIcon = this.activeTool.cursor;
			if(cursorIcon != null) {
				offsetX = cursorIcon.width / flixel_FlxG.scaleMode.scale.x / 2;
				offsetY = cursorIcon.height / flixel_FlxG.scaleMode.scale.y / 2;
			}
		}
		this._customCursor.set_x(event.stageX + offsetX);
		this._customCursor.set_y(event.stageY + offsetY);
		var _this = this._flixelPointer;
		_this._globalScreenX = event.stageX / flixel_FlxG.scaleMode.scale.x | 0;
		_this._globalScreenY = event.stageY / flixel_FlxG.scaleMode.scale.y | 0;
		_this.updatePositions();
		this.flixelPointer.set_x(this._flixelPointer.x + offsetX);
		this.flixelPointer.set_y(this._flixelPointer.y + offsetY);
	}
	,handleMouseClick: function(event) {
		if(event.type == "mouseDown" && this.belongsToDebugger(event.target)) {
			return;
		}
		this.pointerJustPressed = event.type == "mouseDown";
		this.pointerJustReleased = event.type == "mouseUp";
		if(this.pointerJustPressed) {
			this.pointerPressed = true;
		} else if(this.pointerJustReleased) {
			this.pointerPressed = false;
		}
	}
	,belongsToDebugger: function(object) {
		if(object == null) {
			return false;
		} else if(((object) instanceof flixel_system_debug_FlxDebugger)) {
			return true;
		}
		return this.belongsToDebugger(object.parent);
	}
	,handleMouseInDebugger: function(event) {
		if(!this.isActive()) {
			return;
		}
		if(event.type == "mouseOver") {
			this._debuggerInteraction = true;
		} else if(event.type == "mouseOut") {
			this._debuggerInteraction = false;
		}
		event.stopPropagation();
	}
	,handleKeyEvent: function(event) {
		if(event.type == "keyDown") {
			this._keysDown.h[event.keyCode] = true;
		} else if(event.type == "keyUp") {
			this._keysDown.h[event.keyCode] = false;
			this._keysUp.h[event.keyCode] = this._turn;
		}
	}
	,countToolsWithUIButton: function() {
		var count = 0;
		var _g = 0;
		var _g1 = this._tools;
		while(_g < _g1.length) {
			var tool = _g1[_g];
			++_g;
			if(tool.button != null) {
				++count;
			}
		}
		return count;
	}
	,addTool: function(tool) {
		tool.init(this);
		this._tools.push(tool);
		var button = tool.button;
		if(button == null) {
			return;
		}
		var buttonsPerLine = 2;
		var buttons = this.countToolsWithUIButton();
		var lines = Math.ceil(buttons / buttonsPerLine) | 0;
		var slot = buttons / lines | 0;
		button.set_x(-15 + slot * 25);
		button.set_y(20 * lines);
		this.addChild(button);
		this.resize(25 * Math.min(buttons,buttonsPerLine) + 10,25 * lines + 10);
	}
	,destroy: function() {
		flixel_FlxG.signals.postDraw.remove($bind(this,this.postDraw));
		flixel_FlxG.debugger.visibilityChanged.remove($bind(this,this.handleDebuggerVisibilityChanged));
		openfl_Lib.get_current().stage.removeEventListener("mouseMove",$bind(this,this.updateMouse));
		openfl_Lib.get_current().stage.removeEventListener("mouseDown",$bind(this,this.handleMouseClick));
		openfl_Lib.get_current().stage.removeEventListener("mouseUp",$bind(this,this.handleMouseClick));
		openfl_Lib.get_current().stage.removeEventListener("keyDown",$bind(this,this.handleKeyEvent));
		openfl_Lib.get_current().stage.removeEventListener("keyUp",$bind(this,this.handleKeyEvent));
		if(this._container != null) {
			this._container.removeEventListener("mouseOver",$bind(this,this.handleMouseInDebugger));
			this._container.removeEventListener("mouseOut",$bind(this,this.handleMouseInDebugger));
		}
		if(this._customCursor != null) {
			this._customCursor.parent.removeChild(this._customCursor);
			this._customCursor = null;
		}
		this._tools = flixel_util_FlxDestroyUtil.destroyArray(this._tools);
		this.selectedItems = flixel_util_FlxDestroyUtil.destroy(this.selectedItems);
		this.flixelPointer = flixel_util_FlxDestroyUtil.destroy(this.flixelPointer);
		this._keysDown = null;
		this._keysUp = null;
	}
	,isActive: function() {
		if(flixel_FlxG.debugger.visible) {
			return this.get_visible();
		} else {
			return false;
		}
	}
	,update: function() {
		if(!this.isActive()) {
			return;
		}
		this.updateCustomCursors();
		var _g = 0;
		var _g1 = this._tools;
		while(_g < _g1.length) {
			var tool = _g1[_g];
			++_g;
			tool.update();
		}
		this.pointerJustPressed = false;
		this.pointerJustReleased = false;
		this._turn++;
	}
	,postDraw: function() {
		if(!this.isActive()) {
			return;
		}
		var _g = 0;
		var _g1 = this._tools;
		while(_g < _g1.length) {
			var tool = _g1[_g];
			++_g;
			tool.draw();
		}
		if(this.shouldDrawItemsSelection) {
			this.drawItemsSelection();
		}
	}
	,getDebugGraphics: function() {
		if(flixel_FlxG.renderBlit) {
			flixel_util_FlxSpriteUtil.flashGfx.clear();
			return flixel_util_FlxSpriteUtil.flashGfx;
		}
		return null;
	}
	,drawItemsSelection: function() {
		var gfx = this.getDebugGraphics();
		if(gfx == null) {
			return;
		}
		var member = new flixel_group_FlxTypedGroupIterator(this.selectedItems.members,null);
		while(member.hasNext()) {
			var member1 = member.next();
			if(member1 != null && member1.scrollFactor != null && member1.isOnScreen()) {
				gfx.lineStyle(0.9,16711680);
				gfx.drawRect(member1.x - flixel_FlxG.camera.scroll.x,member1.y - flixel_FlxG.camera.scroll.y,member1.get_width(),member1.get_height());
			}
		}
		if(flixel_FlxG.renderBlit) {
			flixel_FlxG.camera.buffer.draw(flixel_util_FlxSpriteUtil.flashGfxSprite);
		}
	}
	,getTool: function(className) {
		var _g = 0;
		var _g1 = this._tools;
		while(_g < _g1.length) {
			var tool = _g1[_g];
			++_g;
			if(js_Boot.__instanceof(tool,className)) {
				return tool;
			}
		}
		return null;
	}
	,toggleVisible: function() {
		flixel_system_debug_Window.prototype.toggleVisible.call(this);
		if(!this.get_visible()) {
			this.setActiveTool(null);
			this.restoreSystemCursor();
		}
	}
	,registerCustomCursor: function(name,icon) {
		if(icon == null) {
			return;
		}
		var sprite = new openfl_display_Sprite();
		sprite.set_visible(false);
		sprite.set_name(name);
		sprite.addChild(new openfl_display_Bitmap(icon));
		this._customCursor.addChild(sprite);
	}
	,updateCustomCursors: function() {
		if(this.activeTool != null && !this._debuggerInteraction) {
			if(this.activeTool.cursor != null) {
				var cursorInUse = this.activeTool.cursorInUse == "" ? this.activeTool.getName() : this.activeTool.cursorInUse;
				var _g = 0;
				var _g1 = this._customCursor.get_numChildren();
				while(_g < _g1) {
					var i = _g++;
					var sprite = this._customCursor.getChildAt(i);
					sprite.set_visible(sprite.get_name() == cursorInUse);
				}
				if(flixel_FlxG.mouse.visible) {
					flixel_FlxG.mouse.set_visible(false);
				}
			} else {
				flixel_FlxG.mouse.set_useSystemCursor(true);
			}
		} else {
			flixel_FlxG.mouse.set_useSystemCursor(true);
		}
	}
	,saveSystemCursorInfo: function() {
		this._wasMouseVisible = flixel_FlxG.mouse.visible;
		this._wasUsingSystemCursor = flixel_FlxG.mouse.useSystemCursor;
	}
	,restoreSystemCursor: function() {
		flixel_FlxG.mouse.set_useSystemCursor(this._wasUsingSystemCursor);
		flixel_FlxG.mouse.set_visible(this._wasMouseVisible);
		this._customCursor.set_visible(false);
	}
	,setActiveTool: function(value) {
		if(this.activeTool != null) {
			this.activeTool.deactivate();
			this.activeTool.button.set_toggled(true);
		}
		if(this.activeTool == value) {
			value = null;
		}
		this.activeTool = value;
		if(this.activeTool != null) {
			this.setToolsCursorVisibility(true);
			this.activeTool.button.set_toggled(false);
			this.activeTool.activate();
			this.updateCustomCursors();
		} else {
			this.setSystemCursorVisibility(true);
		}
		flixel_FlxG.mouse.enabled = !this.isInUse();
	}
	,setSystemCursorVisibility: function(status) {
		flixel_FlxG.mouse.set_useSystemCursor(status);
		this._customCursor.set_visible(!status);
	}
	,setToolsCursorVisibility: function(status) {
		flixel_FlxG.mouse.set_useSystemCursor(false);
		this._customCursor.set_visible(status);
		if(status) {
			return;
		}
		var _g = 0;
		var _g1 = this._customCursor.get_numChildren();
		while(_g < _g1) {
			var i = _g++;
			this._customCursor.getChildAt(i).set_visible(false);
		}
	}
	,clearSelection: function() {
		this.selectedItems.clear();
	}
	,keyPressed: function(key) {
		return this._keysDown.h[key];
	}
	,keyJustPressed: function(key) {
		var value = this._keysUp.h[key] == null ? 0 : this._keysUp.h[key];
		return this._turn - value == 1;
	}
	,isInUse: function() {
		if(flixel_FlxG.debugger.visible && this.get_visible()) {
			return this.activeTool != null;
		} else {
			return false;
		}
	}
	,findItemsWithinState: function(items,state,area) {
		this.findItemsWithinArea(items,state.members,area);
		if(state.subState != null) {
			this.findItemsWithinState(items,state.subState,area);
		}
	}
	,findItemsWithinArea: function(items,members,area) {
		var i = members.length;
		while(i-- > 0) {
			var member = members[i];
			if(member == null || !member.visible || !member.exists) {
				continue;
			}
			var group = flixel_group_FlxTypedGroup.resolveGroup(member);
			if(group != null) {
				this.findItemsWithinArea(items,group.members,area);
			} else {
				var tmp;
				if(((member) instanceof flixel_FlxSprite)) {
					var Rect = (js_Boot.__cast(member , flixel_FlxSprite)).getHitbox();
					var result = Rect.x + Rect.width > area.x && Rect.x < area.x + area.width && Rect.y + Rect.height > area.y && Rect.y < area.y + area.height;
					if(Rect._weak) {
						if(!Rect._inPool) {
							Rect._inPool = true;
							Rect._weak = false;
							flixel_math_FlxRect._pool.putUnsafe(Rect);
						}
					}
					tmp = result;
				} else {
					tmp = false;
				}
				if(tmp) {
					items.push(member);
				}
			}
		}
	}
	,__class__: flixel_system_debug_interaction_Interaction
});
var flixel_system_debug_interaction_tools__$Eraser_GraphicEraserTool = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system_debug_interaction_tools__$Eraser_GraphicEraserTool.preload != null) {
		this.__fromImage(flixel_system_debug_interaction_tools__$Eraser_GraphicEraserTool.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system_debug_interaction_tools__$Eraser_GraphicEraserTool.resourceName),flixel_system_debug_interaction_tools__$Eraser_GraphicEraserTool.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system_debug_interaction_tools__$Eraser_GraphicEraserTool.preload == null) {
				flixel_system_debug_interaction_tools__$Eraser_GraphicEraserTool.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system.debug.interaction.tools._Eraser.GraphicEraserTool"] = flixel_system_debug_interaction_tools__$Eraser_GraphicEraserTool;
flixel_system_debug_interaction_tools__$Eraser_GraphicEraserTool.__name__ = "flixel.system.debug.interaction.tools._Eraser.GraphicEraserTool";
flixel_system_debug_interaction_tools__$Eraser_GraphicEraserTool.preload = null;
flixel_system_debug_interaction_tools__$Eraser_GraphicEraserTool.__super__ = openfl_display_BitmapData;
flixel_system_debug_interaction_tools__$Eraser_GraphicEraserTool.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system_debug_interaction_tools__$Eraser_GraphicEraserTool
});
var flixel_system_debug_interaction_tools_Tool = function() {
	this._name = "(Unknown tool)";
	this.cursorInUse = "";
	openfl_display_Sprite.call(this);
};
$hxClasses["flixel.system.debug.interaction.tools.Tool"] = flixel_system_debug_interaction_tools_Tool;
flixel_system_debug_interaction_tools_Tool.__name__ = "flixel.system.debug.interaction.tools.Tool";
flixel_system_debug_interaction_tools_Tool.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_system_debug_interaction_tools_Tool.__super__ = openfl_display_Sprite;
flixel_system_debug_interaction_tools_Tool.prototype = $extend(openfl_display_Sprite.prototype,{
	button: null
	,cursor: null
	,cursorInUse: null
	,_name: null
	,_shortcut: null
	,_brain: null
	,init: function(brain) {
		this._brain = brain;
		return this;
	}
	,update: function() {
	}
	,draw: function() {
	}
	,activate: function() {
	}
	,deactivate: function() {
	}
	,destroy: function() {
	}
	,isActive: function() {
		if(this._brain.activeTool == this) {
			return this._brain.get_visible();
		} else {
			return false;
		}
	}
	,setButton: function(Icon) {
		this.button = new flixel_system_ui_FlxSystemButton(Type.createInstance(Icon,[0,0]),$bind(this,this.onButtonClicked),true);
		this.button.set_toggled(true);
		var tooltip = this._name;
		if(this._shortcut != null) {
			tooltip += " (" + this._shortcut + ")";
		}
		flixel_system_debug_Tooltip.add(this.button,tooltip);
	}
	,setCursor: function(Icon) {
		this.cursor = Icon;
		this._brain.registerCustomCursor(this._name,this.cursor);
	}
	,setCursorInUse: function(customCursorName) {
		this.cursorInUse = customCursorName;
	}
	,useDefaultCursor: function() {
		if(this.cursorInUse != "") {
			this.cursorInUse = "";
		}
	}
	,onButtonClicked: function() {
		this._brain.setActiveTool(this);
	}
	,getName: function() {
		return this._name;
	}
	,__class__: flixel_system_debug_interaction_tools_Tool
});
var flixel_system_debug_interaction_tools_Eraser = function() {
	flixel_system_debug_interaction_tools_Tool.call(this);
};
$hxClasses["flixel.system.debug.interaction.tools.Eraser"] = flixel_system_debug_interaction_tools_Eraser;
flixel_system_debug_interaction_tools_Eraser.__name__ = "flixel.system.debug.interaction.tools.Eraser";
flixel_system_debug_interaction_tools_Eraser.__super__ = flixel_system_debug_interaction_tools_Tool;
flixel_system_debug_interaction_tools_Eraser.prototype = $extend(flixel_system_debug_interaction_tools_Tool.prototype,{
	init: function(Brain) {
		flixel_system_debug_interaction_tools_Tool.prototype.init.call(this,Brain);
		this._name = "Eraser";
		return this;
	}
	,update: function() {
		if(this._brain.keyJustPressed(46)) {
			this.doDeletion(this._brain.keyPressed(16));
		}
	}
	,activate: function() {
		this.doDeletion(this._brain.keyPressed(16));
		this._brain.setActiveTool(null);
	}
	,doDeletion: function(remove) {
		var selectedItems = this._brain.selectedItems;
		if(selectedItems != null) {
			this.findAndDelete(selectedItems,remove);
			selectedItems.clear();
		}
	}
	,findAndDelete: function(items,remove) {
		if(remove == null) {
			remove = false;
		}
		var member = new flixel_group_FlxTypedGroupIterator(items.members,null);
		while(member.hasNext()) {
			var member1 = member.next();
			if(member1 == null) {
				continue;
			}
			if(!((member1) instanceof flixel_group_FlxTypedGroup)) {
				member1.kill();
				if(remove) {
					this.removeFromMemory(member1,flixel_FlxG.game._state);
				}
			}
		}
	}
	,removeFromMemory: function(item,parentGroup) {
		var _g = 0;
		var _g1 = parentGroup.members;
		while(_g < _g1.length) {
			var member = _g1[_g];
			++_g;
			if(member == null) {
				continue;
			}
			if(((member) instanceof flixel_group_FlxTypedGroup)) {
				this.removeFromMemory(item,member);
			} else if(member == item) {
				parentGroup.remove(member);
			}
		}
	}
	,__class__: flixel_system_debug_interaction_tools_Eraser
});
var flixel_system_debug_interaction_tools__$Mover_GraphicMoverTool = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system_debug_interaction_tools__$Mover_GraphicMoverTool.preload != null) {
		this.__fromImage(flixel_system_debug_interaction_tools__$Mover_GraphicMoverTool.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system_debug_interaction_tools__$Mover_GraphicMoverTool.resourceName),flixel_system_debug_interaction_tools__$Mover_GraphicMoverTool.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system_debug_interaction_tools__$Mover_GraphicMoverTool.preload == null) {
				flixel_system_debug_interaction_tools__$Mover_GraphicMoverTool.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system.debug.interaction.tools._Mover.GraphicMoverTool"] = flixel_system_debug_interaction_tools__$Mover_GraphicMoverTool;
flixel_system_debug_interaction_tools__$Mover_GraphicMoverTool.__name__ = "flixel.system.debug.interaction.tools._Mover.GraphicMoverTool";
flixel_system_debug_interaction_tools__$Mover_GraphicMoverTool.preload = null;
flixel_system_debug_interaction_tools__$Mover_GraphicMoverTool.__super__ = openfl_display_BitmapData;
flixel_system_debug_interaction_tools__$Mover_GraphicMoverTool.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system_debug_interaction_tools__$Mover_GraphicMoverTool
});
var flixel_system_debug_interaction_tools_Mover = function() {
	this._dragging = false;
	flixel_system_debug_interaction_tools_Tool.call(this);
};
$hxClasses["flixel.system.debug.interaction.tools.Mover"] = flixel_system_debug_interaction_tools_Mover;
flixel_system_debug_interaction_tools_Mover.__name__ = "flixel.system.debug.interaction.tools.Mover";
flixel_system_debug_interaction_tools_Mover.__super__ = flixel_system_debug_interaction_tools_Tool;
flixel_system_debug_interaction_tools_Mover.prototype = $extend(flixel_system_debug_interaction_tools_Tool.prototype,{
	_dragging: null
	,_lastCursorPosition: null
	,init: function(brain) {
		flixel_system_debug_interaction_tools_Tool.prototype.init.call(this,brain);
		this._lastCursorPosition = new flixel_math_FlxPoint(brain.flixelPointer.x,brain.flixelPointer.x);
		this._name = "Mover";
		this._shortcut = "Shift";
		this.setButton(flixel_system_debug_interaction_tools__$Mover_GraphicMoverTool);
		this.setCursor(new flixel_system_debug_interaction_tools__$Mover_GraphicMoverTool(0,0));
		return this;
	}
	,update: function() {
		if(!this.isActive() && !this._brain.keyPressed(16)) {
			return;
		}
		if(this._brain.pointerPressed && !this._dragging) {
			this.startDragging();
		} else if(this._brain.pointerPressed && this._dragging) {
			this.doDragging();
		} else if(this._brain.pointerJustReleased) {
			this.stopDragging();
		}
		this._lastCursorPosition.set_x(this._brain.flixelPointer.x);
		this._lastCursorPosition.set_y(this._brain.flixelPointer.y);
	}
	,stopDragging: function() {
		this._dragging = false;
	}
	,startDragging: function() {
		if(this._dragging) {
			return;
		}
		this._dragging = true;
		if(!this.isActive() && ((this._brain.activeTool) instanceof flixel_system_debug_interaction_tools_Pointer)) {
			this._brain.activeTool.cancelSelection();
		}
	}
	,doDragging: function() {
		var dx = this._brain.flixelPointer.x - this._lastCursorPosition.x;
		var dy = this._brain.flixelPointer.y - this._lastCursorPosition.y;
		var _g = 0;
		var _g1 = this._brain.selectedItems.members;
		while(_g < _g1.length) {
			var member = _g1[_g];
			++_g;
			if(!((member) instanceof flixel_FlxObject)) {
				continue;
			}
			var object = member;
			if(object != null) {
				var _g2 = object;
				_g2.set_x(_g2.x + dx);
				var _g3 = object;
				_g3.set_y(_g3.y + dy);
			}
		}
	}
	,__class__: flixel_system_debug_interaction_tools_Mover
});
var flixel_system_debug_interaction_tools_GraphicCursorCross = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system_debug_interaction_tools_GraphicCursorCross.preload != null) {
		this.__fromImage(flixel_system_debug_interaction_tools_GraphicCursorCross.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system_debug_interaction_tools_GraphicCursorCross.resourceName),flixel_system_debug_interaction_tools_GraphicCursorCross.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system_debug_interaction_tools_GraphicCursorCross.preload == null) {
				flixel_system_debug_interaction_tools_GraphicCursorCross.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system.debug.interaction.tools.GraphicCursorCross"] = flixel_system_debug_interaction_tools_GraphicCursorCross;
flixel_system_debug_interaction_tools_GraphicCursorCross.__name__ = "flixel.system.debug.interaction.tools.GraphicCursorCross";
flixel_system_debug_interaction_tools_GraphicCursorCross.preload = null;
flixel_system_debug_interaction_tools_GraphicCursorCross.__super__ = openfl_display_BitmapData;
flixel_system_debug_interaction_tools_GraphicCursorCross.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system_debug_interaction_tools_GraphicCursorCross
});
var flixel_system_debug_interaction_tools_Pointer = function() {
	this._itemsInSelectionArea = [];
	this._selectionArea = new flixel_math_FlxRect();
	this._selectionCancelled = false;
	this._selectionHappening = false;
	this._selectionEndPoint = new flixel_math_FlxPoint();
	this._selectionStartPoint = new flixel_math_FlxPoint();
	flixel_system_debug_interaction_tools_Tool.call(this);
};
$hxClasses["flixel.system.debug.interaction.tools.Pointer"] = flixel_system_debug_interaction_tools_Pointer;
flixel_system_debug_interaction_tools_Pointer.__name__ = "flixel.system.debug.interaction.tools.Pointer";
flixel_system_debug_interaction_tools_Pointer.__super__ = flixel_system_debug_interaction_tools_Tool;
flixel_system_debug_interaction_tools_Pointer.prototype = $extend(flixel_system_debug_interaction_tools_Tool.prototype,{
	_selectionStartPoint: null
	,_selectionEndPoint: null
	,_selectionHappening: null
	,_selectionCancelled: null
	,_selectionArea: null
	,_itemsInSelectionArea: null
	,init: function(brain) {
		flixel_system_debug_interaction_tools_Tool.prototype.init.call(this,brain);
		this._name = "Pointer";
		this.setButton(flixel_system_debug_interaction_tools_GraphicCursorCross);
		this.setCursor(new flixel_system_debug_interaction_tools_GraphicCursorCross(0,0));
		return this;
	}
	,update: function() {
		if(!this.isActive()) {
			return;
		}
		if(this._brain.pointerJustPressed && !this._selectionHappening) {
			this.startSelection();
		}
		if(this._selectionHappening) {
			this._selectionEndPoint.set(this._brain.flixelPointer.x,this._brain.flixelPointer.y);
			this.calculateSelectionArea();
		}
		if(!this._brain.pointerJustReleased) {
			return;
		}
		if(this._selectionHappening) {
			this.stopSelection();
		}
		if(this._itemsInSelectionArea.length > 0) {
			this.handleItemAddition(this._itemsInSelectionArea);
		} else if(!this._brain.keyPressed(17) && !this._selectionCancelled) {
			this._brain.clearSelection();
		}
	}
	,calculateSelectionArea: function() {
		this._selectionArea.x = this._selectionStartPoint.x;
		this._selectionArea.y = this._selectionStartPoint.y;
		this._selectionArea.width = this._selectionEndPoint.x - this._selectionArea.x;
		this._selectionArea.height = this._selectionEndPoint.y - this._selectionArea.y;
		if(this._selectionArea.width < 0) {
			this._selectionArea.width *= -1;
			this._selectionArea.x -= this._selectionArea.width;
		}
		if(this._selectionArea.height < 0) {
			this._selectionArea.height *= -1;
			this._selectionArea.y -= this._selectionArea.height;
		}
	}
	,startSelection: function() {
		this._selectionHappening = true;
		this._selectionCancelled = false;
		this._selectionStartPoint.set(this._brain.flixelPointer.x,this._brain.flixelPointer.y);
		flixel_util_FlxArrayUtil.clearArray(this._itemsInSelectionArea);
		this.updateConsoleSelection();
	}
	,cancelSelection: function() {
		if(!this._selectionHappening) {
			return;
		}
		this._selectionCancelled = true;
		this.stopSelection(false);
	}
	,stopSelection: function(findItems) {
		if(findItems == null) {
			findItems = true;
		}
		if(!this._selectionHappening) {
			return;
		}
		this._selectionEndPoint.set(this._brain.flixelPointer.x,this._brain.flixelPointer.y);
		this.calculateSelectionArea();
		if(findItems) {
			this._brain.findItemsWithinState(this._itemsInSelectionArea,flixel_FlxG.game._state,this._selectionArea);
			this.updateConsoleSelection();
		}
		this._selectionHappening = false;
		var _this = this._selectionArea;
		var X = 0;
		var Y = 0;
		var Width = 0;
		var Height = 0;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
	}
	,updateConsoleSelection: function() {
	}
	,handleItemAddition: function(itemsInSelectionArea) {
		var adding = this._brain.keyPressed(17);
		var selectedItems = this._brain.selectedItems;
		if(itemsInSelectionArea.length == 0) {
			return;
		}
		if(!adding) {
			this._brain.clearSelection();
		}
		var _g = 0;
		while(_g < itemsInSelectionArea.length) {
			var item = itemsInSelectionArea[_g];
			++_g;
			if(selectedItems.members.indexOf(item) != -1 && adding) {
				selectedItems.remove(item);
			} else {
				selectedItems.add(item);
			}
		}
	}
	,draw: function() {
		var gfx = this._brain.getDebugGraphics();
		if(gfx == null) {
			return;
		}
		if(this._selectionHappening) {
			gfx.lineStyle(0.9,12255232);
			gfx.drawRect(this._selectionArea.x - flixel_FlxG.camera.scroll.x,this._selectionArea.y - flixel_FlxG.camera.scroll.y,this._selectionArea.width,this._selectionArea.height);
		}
		if(flixel_FlxG.renderBlit) {
			flixel_FlxG.camera.buffer.draw(flixel_util_FlxSpriteUtil.flashGfxSprite);
		}
	}
	,__class__: flixel_system_debug_interaction_tools_Pointer
});
var flixel_system_debug_interaction_tools__$Transform_GraphicTransformTool = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system_debug_interaction_tools__$Transform_GraphicTransformTool.preload != null) {
		this.__fromImage(flixel_system_debug_interaction_tools__$Transform_GraphicTransformTool.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system_debug_interaction_tools__$Transform_GraphicTransformTool.resourceName),flixel_system_debug_interaction_tools__$Transform_GraphicTransformTool.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system_debug_interaction_tools__$Transform_GraphicTransformTool.preload == null) {
				flixel_system_debug_interaction_tools__$Transform_GraphicTransformTool.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system.debug.interaction.tools._Transform.GraphicTransformTool"] = flixel_system_debug_interaction_tools__$Transform_GraphicTransformTool;
flixel_system_debug_interaction_tools__$Transform_GraphicTransformTool.__name__ = "flixel.system.debug.interaction.tools._Transform.GraphicTransformTool";
flixel_system_debug_interaction_tools__$Transform_GraphicTransformTool.preload = null;
flixel_system_debug_interaction_tools__$Transform_GraphicTransformTool.__super__ = openfl_display_BitmapData;
flixel_system_debug_interaction_tools__$Transform_GraphicTransformTool.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system_debug_interaction_tools__$Transform_GraphicTransformTool
});
var flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorDefault = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorDefault.preload != null) {
		this.__fromImage(flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorDefault.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorDefault.resourceName),flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorDefault.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorDefault.preload == null) {
				flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorDefault.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system.debug.interaction.tools._Transform.GraphicTransformCursorDefault"] = flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorDefault;
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorDefault.__name__ = "flixel.system.debug.interaction.tools._Transform.GraphicTransformCursorDefault";
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorDefault.preload = null;
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorDefault.__super__ = openfl_display_BitmapData;
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorDefault.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorDefault
});
var flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleY = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleY.preload != null) {
		this.__fromImage(flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleY.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleY.resourceName),flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleY.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleY.preload == null) {
				flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleY.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system.debug.interaction.tools._Transform.GraphicTransformCursorScaleY"] = flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleY;
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleY.__name__ = "flixel.system.debug.interaction.tools._Transform.GraphicTransformCursorScaleY";
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleY.preload = null;
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleY.__super__ = openfl_display_BitmapData;
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleY.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleY
});
var flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleX = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleX.preload != null) {
		this.__fromImage(flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleX.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleX.resourceName),flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleX.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleX.preload == null) {
				flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleX.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system.debug.interaction.tools._Transform.GraphicTransformCursorScaleX"] = flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleX;
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleX.__name__ = "flixel.system.debug.interaction.tools._Transform.GraphicTransformCursorScaleX";
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleX.preload = null;
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleX.__super__ = openfl_display_BitmapData;
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleX.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleX
});
var flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleXY = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleXY.preload != null) {
		this.__fromImage(flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleXY.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleXY.resourceName),flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleXY.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleXY.preload == null) {
				flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleXY.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system.debug.interaction.tools._Transform.GraphicTransformCursorScaleXY"] = flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleXY;
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleXY.__name__ = "flixel.system.debug.interaction.tools._Transform.GraphicTransformCursorScaleXY";
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleXY.preload = null;
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleXY.__super__ = openfl_display_BitmapData;
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleXY.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleXY
});
var flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorRotate = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorRotate.preload != null) {
		this.__fromImage(flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorRotate.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorRotate.resourceName),flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorRotate.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorRotate.preload == null) {
				flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorRotate.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system.debug.interaction.tools._Transform.GraphicTransformCursorRotate"] = flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorRotate;
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorRotate.__name__ = "flixel.system.debug.interaction.tools._Transform.GraphicTransformCursorRotate";
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorRotate.preload = null;
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorRotate.__super__ = openfl_display_BitmapData;
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorRotate.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorRotate
});
var flixel_system_debug_interaction_tools_Transform = function() {
	this._mouseCursor = new flixel_math_FlxPoint();
	this._targetArea = new flixel_math_FlxRect();
	this._markers = [];
	this._actionScaleDirection = new flixel_math_FlxPoint();
	this._actionStartPoint = new flixel_math_FlxPoint();
	this._actionTargetStartScale = new flixel_math_FlxPoint();
	flixel_system_debug_interaction_tools_Tool.call(this);
};
$hxClasses["flixel.system.debug.interaction.tools.Transform"] = flixel_system_debug_interaction_tools_Transform;
flixel_system_debug_interaction_tools_Transform.__name__ = "flixel.system.debug.interaction.tools.Transform";
flixel_system_debug_interaction_tools_Transform.__super__ = flixel_system_debug_interaction_tools_Tool;
flixel_system_debug_interaction_tools_Transform.prototype = $extend(flixel_system_debug_interaction_tools_Tool.prototype,{
	_actionTargetStartScale: null
	,_actionTargetStartAngle: null
	,_actionStartPoint: null
	,_actionHappening: null
	,_actionMarker: null
	,_actionScaleDirection: null
	,_tooltip: null
	,_markers: null
	,_target: null
	,_targetArea: null
	,_mouseCursor: null
	,init: function(brain) {
		var _gthis = this;
		flixel_system_debug_interaction_tools_Tool.prototype.init.call(this,brain);
		this._name = "Transform";
		this.setButton(flixel_system_debug_interaction_tools__$Transform_GraphicTransformTool);
		this.setCursor(new flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorDefault(0,0));
		brain.registerCustomCursor("transformRotate",new flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorRotate(0,0));
		brain.registerCustomCursor("transformScaleX",new flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleX(0,0));
		brain.registerCustomCursor("transformScaleY",new flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleY(0,0));
		brain.registerCustomCursor("transformScaleXY",new flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleXY(0,0));
		this._tooltip = flixel_system_debug_Tooltip.add(null,"");
		this._tooltip.textField.set_wordWrap(false);
		this._markers.push(new flixel_math_FlxPoint());
		this._markers.push(new flixel_math_FlxPoint());
		this._markers.push(new flixel_math_FlxPoint());
		this._markers.push(new flixel_math_FlxPoint());
		this.stopAction();
		flixel_FlxG.signals.preStateSwitch.add(function() {
			_gthis._target = null;
		});
		return this;
	}
	,updateTargetArea: function() {
		if(this._target == null) {
			var _this = this._targetArea;
			_this.x = 0;
			_this.y = 0;
			var _this = this._targetArea;
			_this.width = 0;
			_this.height = 0;
		} else {
			var _this = this._targetArea;
			_this.x = this._target.x - flixel_FlxG.camera.scroll.x;
			_this.y = this._target.y - flixel_FlxG.camera.scroll.y;
			var _this = this._targetArea;
			var Width = this._target.get_width();
			var Height = this._target.get_height();
			_this.width = Width;
			_this.height = Height;
		}
	}
	,startAction: function(whichMarker) {
		if(this._actionHappening) {
			return;
		}
		this._actionHappening = true;
		this._actionMarker = whichMarker;
		this._actionStartPoint.set(this._brain.flixelPointer.x - flixel_FlxG.camera.scroll.x,this._brain.flixelPointer.y - flixel_FlxG.camera.scroll.y);
		this._actionTargetStartAngle = flixel_math_FlxAngle.angleBetweenPoint(this._target,this._markers[0],true);
		this._actionTargetStartScale.set(this._target.scale.x,this._target.scale.y);
	}
	,stopAction: function() {
		this._actionHappening = false;
		this._actionMarker = -1;
		this._tooltip.setVisible(false);
	}
	,getCursorNameByMarker: function(marker) {
		switch(marker) {
		case 0:
			return "transformRotate";
		case 1:
			return "transformScaleX";
		case 2:
			return "transformScaleXY";
		case 3:
			return "transformScaleY";
		default:
			return "";
		}
	}
	,handleInteractionsWithMarkersUI: function() {
		if(this._actionHappening) {
			return;
		}
		var cursorName = "";
		var _g = 0;
		var _g1 = this._markers.length;
		while(_g < _g1) {
			var i = _g++;
			if(this._mouseCursor.distanceTo(this._markers[i]) <= 5.0) {
				cursorName = this.getCursorNameByMarker(i);
				if(this._brain.pointerJustPressed) {
					this.startAction(i);
					break;
				}
			}
		}
		if(cursorName != "") {
			this.setCursorInUse(cursorName);
		} else {
			this.useDefaultCursor();
		}
	}
	,formatFloat: function(number) {
		var value = flixel_math_FlxMath.roundDecimal(number,flixel_FlxG.debugger.precision);
		if(value == null) {
			return "null";
		} else {
			return "" + value;
		}
	}
	,showTooltip: function(text) {
		if(!this._tooltip.get_visible()) {
			this._tooltip.setVisible(true);
		}
		this._tooltip.set_x(this._target.x - flixel_FlxG.camera.scroll.x);
		this._tooltip.set_y(this._target.y - flixel_FlxG.camera.scroll.y);
		this._tooltip.setText(text);
	}
	,updateScaleActionDirection: function() {
		var deltaX = this._mouseCursor.x - this._actionStartPoint.x;
		var deltaY = this._mouseCursor.y - this._actionStartPoint.y;
		this._actionScaleDirection.set_x(deltaX >= 0 ? 1 : -1);
		this._actionScaleDirection.set_y(deltaY >= 0 ? 1 : -1);
	}
	,updateScaleAction: function() {
		this.updateScaleActionDirection();
		var deltaX = this._actionScaleDirection.x * Math.abs(this._mouseCursor.x - this._actionStartPoint.x) / 10.0;
		var deltaY = this._actionScaleDirection.y * Math.abs(this._mouseCursor.y - this._actionStartPoint.y) / 10.0;
		if(this._actionMarker == 1 || this._actionMarker == 2) {
			this._target.scale.set_x(this._actionTargetStartScale.x + deltaX);
		}
		if(this._actionMarker == 2 || this._actionMarker == 3) {
			this._target.scale.set_y(this._actionTargetStartScale.y + deltaY);
		}
		this._target.updateHitbox();
		var _this = this._target;
		_this.origin.set(_this.frameWidth * 0.5,_this.frameHeight * 0.5);
		this.showTooltip("w: " + this.formatFloat(this._target.get_width()) + "\nh: " + this.formatFloat(this._target.get_height()));
	}
	,updateRotateAction: function() {
		this._target.set_angle(flixel_math_FlxAngle.angleBetweenPoint(this._target,this._brain.flixelPointer,true) - this._actionTargetStartAngle);
		this.showTooltip("deg: " + this.formatFloat(this._target.angle) + "\nrad: " + this.formatFloat(this._target.angle * (Math.PI / 180)));
	}
	,updateAction: function() {
		if(!this._actionHappening || this._actionMarker < 0) {
			return;
		}
		if(this._actionMarker == 0) {
			this.updateRotateAction();
		} else {
			this.updateScaleAction();
		}
	}
	,updateMarkersPosition: function() {
		var topLeftX = this._targetArea.x - 5.0;
		var topLeftY = this._targetArea.y - 5.0;
		var width = this._targetArea.width + 10.;
		var height = this._targetArea.height + 10.;
		this._markers[0].set(topLeftX,topLeftY);
		this._markers[1].set(topLeftX + width,topLeftY);
		this._markers[2].set(topLeftX + width,topLeftY + height);
		this._markers[3].set(topLeftX,topLeftY + height);
		if(this._target.angle != 0) {
			this.updateMarkersRotation(width,height);
		}
	}
	,updateMarkersRotation: function(outlineWidth,outlineHeight) {
		var rotationAngleRad = this._target.angle * (Math.PI / 180);
		var originX = this._markers[0].x + outlineWidth / 2;
		var originY = this._markers[0].y + outlineHeight / 2;
		var n = rotationAngleRad + 1.570796327;
		n *= 0.3183098862;
		if(n > 1) {
			n -= Math.ceil(n) >> 1 << 1;
		} else if(n < -1) {
			n += Math.ceil(-n) >> 1 << 1;
		}
		var cos = n > 0 ? n * (3.1 + n * (0.5 + n * (-7.2 + n * 3.6))) : n * (3.1 - n * (0.5 + n * (7.2 + n * 3.6)));
		var n = rotationAngleRad;
		n *= 0.3183098862;
		if(n > 1) {
			n -= Math.ceil(n) >> 1 << 1;
		} else if(n < -1) {
			n += Math.ceil(-n) >> 1 << 1;
		}
		var sin = n > 0 ? n * (3.1 + n * (0.5 + n * (-7.2 + n * 3.6))) : n * (3.1 - n * (0.5 + n * (7.2 + n * 3.6)));
		var _g = 0;
		var _g1 = this._markers;
		while(_g < _g1.length) {
			var marker = _g1[_g];
			++_g;
			var rotatedX = (marker.x - originX) * cos - (marker.y - originY) * sin;
			var rotatedY = (marker.x - originX) * sin + (marker.y - originY) * cos;
			marker.set(rotatedX + originX,rotatedY + originY);
		}
	}
	,update: function() {
		if(!this.isActive() || this._target == null) {
			return;
		}
		this._mouseCursor.set_x(this._brain.flixelPointer.x - flixel_FlxG.camera.scroll.x);
		this._mouseCursor.set_y(this._brain.flixelPointer.y - flixel_FlxG.camera.scroll.y);
		this.updateTargetArea();
		this.updateMarkersPosition();
		this.handleInteractionsWithMarkersUI();
		if(this._actionHappening) {
			this.updateAction();
			if(this._brain.pointerJustReleased) {
				this.stopAction();
			}
		}
	}
	,drawTargetAreaOutline: function(gfx) {
		gfx.lineStyle(0.9,-65281,1.0,false,2,2);
		gfx.moveTo(this._markers[0].x,this._markers[0].y);
		var _g = 0;
		var _g1 = this._markers.length;
		while(_g < _g1) {
			var i = _g++;
			gfx.lineTo(this._markers[i].x,this._markers[i].y);
		}
		gfx.lineTo(this._markers[0].x,this._markers[0].y);
	}
	,drawMarkers: function(gfx) {
		gfx.lineStyle(0.9,-65281,1.0,false,2,2);
		gfx.beginFill(-65281);
		var _g = 0;
		var _g1 = this._markers.length;
		while(_g < _g1) {
			var i = _g++;
			if(i == 0) {
				gfx.drawCircle(this._markers[i].x,this._markers[i].y,2.7);
			} else {
				gfx.drawRect(this._markers[i].x - 1.5,this._markers[i].y - 1.5,3.0,3.0);
			}
		}
		gfx.endFill();
	}
	,draw: function() {
		var gfx = this._brain.getDebugGraphics();
		if(gfx == null || this._target == null || !this.isActive()) {
			return;
		}
		this.drawTargetAreaOutline(gfx);
		this.drawMarkers(gfx);
		if(flixel_FlxG.renderBlit) {
			flixel_FlxG.camera.buffer.draw(flixel_util_FlxSpriteUtil.flashGfxSprite);
		}
	}
	,activate: function() {
		this._target = null;
		if(this._brain.selectedItems.length == 0) {
			return;
		}
		var member = new flixel_group_FlxTypedGroupIterator(this._brain.selectedItems.members,null);
		while(member.hasNext()) {
			var member1 = member.next();
			if(member1 != null && member1.scrollFactor != null && member1.isOnScreen()) {
				this._target = member1;
				break;
			}
		}
		this._brain.shouldDrawItemsSelection = false;
	}
	,deactivate: function() {
		this._brain.shouldDrawItemsSelection = true;
	}
	,__class__: flixel_system_debug_interaction_tools_Transform
});
var flixel_system_debug_log_LogStyle = function(Prefix,Color,Size,Bold,Italic,Underlined,ErrorSound,OpenConsole,CallbackFunction) {
	if(OpenConsole == null) {
		OpenConsole = false;
	}
	if(Underlined == null) {
		Underlined = false;
	}
	if(Italic == null) {
		Italic = false;
	}
	if(Bold == null) {
		Bold = false;
	}
	if(Size == null) {
		Size = 12;
	}
	if(Color == null) {
		Color = "FFFFFF";
	}
	if(Prefix == null) {
		Prefix = "";
	}
	this.prefix = Prefix;
	this.color = Color;
	this.size = Size;
	this.bold = Bold;
	this.italic = Italic;
	this.underlined = Underlined;
	this.errorSound = ErrorSound;
	this.openConsole = OpenConsole;
	this.callbackFunction = CallbackFunction;
};
$hxClasses["flixel.system.debug.log.LogStyle"] = flixel_system_debug_log_LogStyle;
flixel_system_debug_log_LogStyle.__name__ = "flixel.system.debug.log.LogStyle";
flixel_system_debug_log_LogStyle.prototype = {
	prefix: null
	,color: null
	,size: null
	,bold: null
	,italic: null
	,underlined: null
	,errorSound: null
	,openConsole: null
	,callbackFunction: null
	,__class__: flixel_system_debug_log_LogStyle
};
var flixel_system_debug_stats__$Stats_GraphicMinimizeButton = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system_debug_stats__$Stats_GraphicMinimizeButton.preload != null) {
		this.__fromImage(flixel_system_debug_stats__$Stats_GraphicMinimizeButton.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system_debug_stats__$Stats_GraphicMinimizeButton.resourceName),flixel_system_debug_stats__$Stats_GraphicMinimizeButton.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system_debug_stats__$Stats_GraphicMinimizeButton.preload == null) {
				flixel_system_debug_stats__$Stats_GraphicMinimizeButton.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system.debug.stats._Stats.GraphicMinimizeButton"] = flixel_system_debug_stats__$Stats_GraphicMinimizeButton;
flixel_system_debug_stats__$Stats_GraphicMinimizeButton.__name__ = "flixel.system.debug.stats._Stats.GraphicMinimizeButton";
flixel_system_debug_stats__$Stats_GraphicMinimizeButton.preload = null;
flixel_system_debug_stats__$Stats_GraphicMinimizeButton.__super__ = openfl_display_BitmapData;
flixel_system_debug_stats__$Stats_GraphicMinimizeButton.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system_debug_stats__$Stats_GraphicMinimizeButton
});
var flixel_system_debug_stats__$Stats_GraphicMaximizeButton = function(width,height,transparent,fillRGBA,onload) {
	if(fillRGBA == null) {
		fillRGBA = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	openfl_display_BitmapData.call(this,0,0,transparent,fillRGBA);
	if(flixel_system_debug_stats__$Stats_GraphicMaximizeButton.preload != null) {
		this.__fromImage(flixel_system_debug_stats__$Stats_GraphicMaximizeButton.preload);
	} else {
		var _gthis = this;
		lime_graphics_Image.loadFromBase64(haxe_Resource.getString(flixel_system_debug_stats__$Stats_GraphicMaximizeButton.resourceName),flixel_system_debug_stats__$Stats_GraphicMaximizeButton.resourceType).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		}).onComplete(function(b) {
			if(flixel_system_debug_stats__$Stats_GraphicMaximizeButton.preload == null) {
				flixel_system_debug_stats__$Stats_GraphicMaximizeButton.preload = b.image;
			}
			if(onload != null && Reflect.isFunction(onload)) {
				onload(b);
			}
		});
	}
};
$hxClasses["flixel.system.debug.stats._Stats.GraphicMaximizeButton"] = flixel_system_debug_stats__$Stats_GraphicMaximizeButton;
flixel_system_debug_stats__$Stats_GraphicMaximizeButton.__name__ = "flixel.system.debug.stats._Stats.GraphicMaximizeButton";
flixel_system_debug_stats__$Stats_GraphicMaximizeButton.preload = null;
flixel_system_debug_stats__$Stats_GraphicMaximizeButton.__super__ = openfl_display_BitmapData;
flixel_system_debug_stats__$Stats_GraphicMaximizeButton.prototype = $extend(openfl_display_BitmapData.prototype,{
	__class__: flixel_system_debug_stats__$Stats_GraphicMaximizeButton
});
var flixel_system_debug_watch_Watch = function(Title,Icon,Width,Height,Resizable,Bounds,Closable,AlwaysOnTop) {
	flixel_system_debug_Window.call(this,Title,Icon,Width,Height,Resizable,Bounds,Closable,AlwaysOnTop);
};
$hxClasses["flixel.system.debug.watch.Watch"] = flixel_system_debug_watch_Watch;
flixel_system_debug_watch_Watch.__name__ = "flixel.system.debug.watch.Watch";
flixel_system_debug_watch_Watch.__super__ = flixel_system_debug_Window;
flixel_system_debug_watch_Watch.prototype = $extend(flixel_system_debug_Window.prototype,{
	__class__: flixel_system_debug_watch_Watch
});
var flixel_system_debug_watch_Tracker = function(Title,Icon,Width,Height,Resizable,Bounds,Closable,AlwaysOnTop) {
	flixel_system_debug_watch_Watch.call(this,Title,Icon,Width,Height,Resizable,Bounds,Closable,AlwaysOnTop);
};
$hxClasses["flixel.system.debug.watch.Tracker"] = flixel_system_debug_watch_Tracker;
flixel_system_debug_watch_Tracker.__name__ = "flixel.system.debug.watch.Tracker";
flixel_system_debug_watch_Tracker.__super__ = flixel_system_debug_watch_Watch;
flixel_system_debug_watch_Tracker.prototype = $extend(flixel_system_debug_watch_Watch.prototype,{
	__class__: flixel_system_debug_watch_Tracker
});
var flixel_system_debug_watch_TrackerProfile = function(ObjectClass,Variables,Extensions) {
	this.objectClass = ObjectClass;
	this.variables = Variables;
	this.extensions = Extensions;
};
$hxClasses["flixel.system.debug.watch.TrackerProfile"] = flixel_system_debug_watch_TrackerProfile;
flixel_system_debug_watch_TrackerProfile.__name__ = "flixel.system.debug.watch.TrackerProfile";
flixel_system_debug_watch_TrackerProfile.prototype = {
	objectClass: null
	,variables: null
	,extensions: null
	,toString: function() {
		var value = this.variables;
		var _this = flixel_util_LabelValuePair._pool.get();
		_this.label = "variables";
		_this.value = value;
		var value = this.extensions;
		var _this1 = flixel_util_LabelValuePair._pool.get();
		_this1.label = "extensions";
		_this1.value = value;
		return flixel_util_FlxStringUtil.getDebugString([_this,_this1]);
	}
	,__class__: flixel_system_debug_watch_TrackerProfile
};
var flixel_system_frontEnds_FlxBrowser = $hxEnums["flixel.system.frontEnds.FlxBrowser"] = { __ename__ : "flixel.system.frontEnds.FlxBrowser", __constructs__ : ["INTERNET_EXPLORER","CHROME","FIREFOX","SAFARI","OPERA","UNKNOWN"]
	,INTERNET_EXPLORER: {_hx_index:0,__enum__:"flixel.system.frontEnds.FlxBrowser",toString:$estr}
	,CHROME: {_hx_index:1,__enum__:"flixel.system.frontEnds.FlxBrowser",toString:$estr}
	,FIREFOX: {_hx_index:2,__enum__:"flixel.system.frontEnds.FlxBrowser",toString:$estr}
	,SAFARI: {_hx_index:3,__enum__:"flixel.system.frontEnds.FlxBrowser",toString:$estr}
	,OPERA: {_hx_index:4,__enum__:"flixel.system.frontEnds.FlxBrowser",toString:$estr}
	,UNKNOWN: {_hx_index:5,__enum__:"flixel.system.frontEnds.FlxBrowser",toString:$estr}
};
var flixel_system_frontEnds_FlxPlatform = $hxEnums["flixel.system.frontEnds.FlxPlatform"] = { __ename__ : "flixel.system.frontEnds.FlxPlatform", __constructs__ : ["WINDOWS","LINUX","MAC","ANDROID","BLACKBERRY","WINDOWS_PHONE","IOS","UNKNOWN"]
	,WINDOWS: {_hx_index:0,__enum__:"flixel.system.frontEnds.FlxPlatform",toString:$estr}
	,LINUX: {_hx_index:1,__enum__:"flixel.system.frontEnds.FlxPlatform",toString:$estr}
	,MAC: {_hx_index:2,__enum__:"flixel.system.frontEnds.FlxPlatform",toString:$estr}
	,ANDROID: {_hx_index:3,__enum__:"flixel.system.frontEnds.FlxPlatform",toString:$estr}
	,BLACKBERRY: {_hx_index:4,__enum__:"flixel.system.frontEnds.FlxPlatform",toString:$estr}
	,WINDOWS_PHONE: {_hx_index:5,__enum__:"flixel.system.frontEnds.FlxPlatform",toString:$estr}
	,IOS: ($_=function(device) { return {_hx_index:6,device:device,__enum__:"flixel.system.frontEnds.FlxPlatform",toString:$estr}; },$_.__params__ = ["device"],$_)
	,UNKNOWN: {_hx_index:7,__enum__:"flixel.system.frontEnds.FlxPlatform",toString:$estr}
};
var flixel_system_frontEnds_FlxIOSDevice = $hxEnums["flixel.system.frontEnds.FlxIOSDevice"] = { __ename__ : "flixel.system.frontEnds.FlxIOSDevice", __constructs__ : ["IPHONE","IPAD","IPOD"]
	,IPHONE: {_hx_index:0,__enum__:"flixel.system.frontEnds.FlxIOSDevice",toString:$estr}
	,IPAD: {_hx_index:1,__enum__:"flixel.system.frontEnds.FlxIOSDevice",toString:$estr}
	,IPOD: {_hx_index:2,__enum__:"flixel.system.frontEnds.FlxIOSDevice",toString:$estr}
};
var flixel_system_frontEnds_PluginFrontEnd = function() {
	this.list = [];
	this.add_flixel_util_FlxTimerManager(flixel_util_FlxTimer.globalManager = new flixel_util_FlxTimerManager());
	this.add_flixel_tweens_FlxTweenManager(flixel_tweens_FlxTween.globalManager = new flixel_tweens_FlxTweenManager());
};
$hxClasses["flixel.system.frontEnds.PluginFrontEnd"] = flixel_system_frontEnds_PluginFrontEnd;
flixel_system_frontEnds_PluginFrontEnd.__name__ = "flixel.system.frontEnds.PluginFrontEnd";
flixel_system_frontEnds_PluginFrontEnd.prototype = {
	add_flixel_tweens_FlxTweenManager: function(Plugin1) {
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var plugin = _g1[_g];
			++_g;
			if(flixel_util_FlxStringUtil.getClassName(Plugin1,true) == flixel_util_FlxStringUtil.getClassName(plugin,true)) {
				return Plugin1;
			}
		}
		this.list.push(Plugin1);
		return Plugin1;
	}
	,add_flixel_util_FlxTimerManager: function(Plugin1) {
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var plugin = _g1[_g];
			++_g;
			if(flixel_util_FlxStringUtil.getClassName(Plugin1,true) == flixel_util_FlxStringUtil.getClassName(plugin,true)) {
				return Plugin1;
			}
		}
		this.list.push(Plugin1);
		return Plugin1;
	}
	,list: null
	,get: function(ClassType) {
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var plugin = _g1[_g];
			++_g;
			if(js_Boot.__instanceof(plugin,ClassType)) {
				return plugin;
			}
		}
		return null;
	}
	,remove: function(Plugin1) {
		var i = this.list.length - 1;
		while(i >= 0) {
			if(this.list[i] == Plugin1) {
				this.list.splice(i,1);
				return Plugin1;
			}
			--i;
		}
		return Plugin1;
	}
	,removeType: function(ClassType) {
		var results = false;
		var i = this.list.length - 1;
		while(i >= 0) {
			if(js_Boot.__instanceof(this.list[i],ClassType)) {
				this.list.splice(i,1);
				results = true;
			}
			--i;
		}
		return results;
	}
	,update: function(elapsed) {
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var plugin = _g1[_g];
			++_g;
			if(plugin.exists && plugin.active) {
				plugin.update(elapsed);
			}
		}
	}
	,draw: function() {
		var _g = 0;
		var _g1 = this.list;
		while(_g < _g1.length) {
			var plugin = _g1[_g];
			++_g;
			if(plugin.exists && plugin.visible) {
				plugin.draw();
			}
		}
	}
	,__class__: flixel_system_frontEnds_PluginFrontEnd
};
var flixel_system_frontEnds_SoundFrontEnd = function() {
	this.volume = 1;
	this.list = new flixel_group_FlxTypedGroup();
	this.defaultSoundGroup = new flixel_system_FlxSoundGroup();
	this.defaultMusicGroup = new flixel_system_FlxSoundGroup();
	this.soundTrayEnabled = true;
	this.muteKeys = [48,96];
	this.volumeDownKeys = [189,109];
	this.volumeUpKeys = [187,107];
	this.muted = false;
	this.loadSavedPrefs();
};
$hxClasses["flixel.system.frontEnds.SoundFrontEnd"] = flixel_system_frontEnds_SoundFrontEnd;
flixel_system_frontEnds_SoundFrontEnd.__name__ = "flixel.system.frontEnds.SoundFrontEnd";
flixel_system_frontEnds_SoundFrontEnd.prototype = {
	music: null
	,muted: null
	,volumeHandler: null
	,volumeUpKeys: null
	,volumeDownKeys: null
	,muteKeys: null
	,soundTrayEnabled: null
	,defaultMusicGroup: null
	,defaultSoundGroup: null
	,list: null
	,volume: null
	,playMusic: function(Music,Volume,Looped,Group) {
		if(Looped == null) {
			Looped = true;
		}
		if(Volume == null) {
			Volume = 1;
		}
		if(this.music == null) {
			this.music = new flixel_system_FlxSound();
		} else if(this.music.active) {
			var _this = this.music;
			_this.cleanup(_this.autoDestroy,true);
		}
		this.music.loadEmbedded(Music,Looped);
		this.music.set_volume(Volume);
		this.music.persist = true;
		this.music.set_group(Group == null ? this.defaultMusicGroup : Group);
		this.music.play();
	}
	,load: function(EmbeddedSound,Volume,Looped,Group,AutoDestroy,AutoPlay,URL1,OnComplete,OnLoad) {
		if(AutoPlay == null) {
			AutoPlay = false;
		}
		if(AutoDestroy == null) {
			AutoDestroy = false;
		}
		if(Looped == null) {
			Looped = false;
		}
		if(Volume == null) {
			Volume = 1;
		}
		if(EmbeddedSound == null && URL1 == null) {
			return null;
		}
		var sound = this.list.recycle(flixel_system_FlxSound);
		if(EmbeddedSound != null) {
			sound.loadEmbedded(EmbeddedSound,Looped,AutoDestroy,OnComplete);
			this.loadHelper(sound,Volume,Group,AutoPlay);
			if(OnLoad != null && sound._sound != null) {
				OnLoad();
			}
		} else {
			var loadCallback = OnLoad;
			if(AutoPlay) {
				loadCallback = function() {
					sound.play();
					if(OnLoad != null) {
						OnLoad();
					}
				};
			}
			sound.loadStream(URL1,Looped,AutoDestroy,OnComplete,loadCallback);
			this.loadHelper(sound,Volume,Group);
		}
		return sound;
	}
	,loadHelper: function(sound,Volume,Group,AutoPlay) {
		if(AutoPlay == null) {
			AutoPlay = false;
		}
		sound.set_volume(Volume);
		if(AutoPlay) {
			sound.play();
		}
		sound.set_group(Group == null ? this.defaultSoundGroup : Group);
		return sound;
	}
	,cache: function(EmbeddedSound) {
		if(openfl_utils_Assets.exists(EmbeddedSound,"SOUND") || openfl_utils_Assets.exists(EmbeddedSound,"MUSIC")) {
			return openfl_utils_Assets.getSound(EmbeddedSound,true);
		}
		return null;
	}
	,cacheAll: function() {
		var _g = 0;
		var _g1 = openfl_utils_Assets.list("SOUND");
		while(_g < _g1.length) {
			var id = _g1[_g];
			++_g;
			if(openfl_utils_Assets.exists(id,"SOUND") || openfl_utils_Assets.exists(id,"MUSIC")) {
				openfl_utils_Assets.getSound(id,true);
			}
		}
	}
	,play: function(EmbeddedSound,Volume,Looped,Group,AutoDestroy,OnComplete) {
		if(AutoDestroy == null) {
			AutoDestroy = true;
		}
		if(Looped == null) {
			Looped = false;
		}
		if(Volume == null) {
			Volume = 1;
		}
		if(typeof(EmbeddedSound) == "string") {
			EmbeddedSound = openfl_utils_Assets.exists(EmbeddedSound,"SOUND") || openfl_utils_Assets.exists(EmbeddedSound,"MUSIC") ? openfl_utils_Assets.getSound(EmbeddedSound,true) : null;
		}
		var sound = this.list.recycle(flixel_system_FlxSound).loadEmbedded(EmbeddedSound,Looped,AutoDestroy,OnComplete);
		return this.loadHelper(sound,Volume,Group,true);
	}
	,stream: function(URL1,Volume,Looped,Group,AutoDestroy,OnComplete,OnLoad) {
		if(AutoDestroy == null) {
			AutoDestroy = true;
		}
		if(Looped == null) {
			Looped = false;
		}
		if(Volume == null) {
			Volume = 1;
		}
		return this.load(null,Volume,Looped,Group,AutoDestroy,true,URL1,OnComplete,OnLoad);
	}
	,pause: function() {
		if(this.music != null && this.music.exists && this.music.active) {
			this.music.pause();
		}
		var _g = 0;
		var _g1 = this.list.members;
		while(_g < _g1.length) {
			var sound = _g1[_g];
			++_g;
			if(sound != null && sound.exists && sound.active) {
				sound.pause();
			}
		}
	}
	,resume: function() {
		if(this.music != null && this.music.exists) {
			this.music.resume();
		}
		var _g = 0;
		var _g1 = this.list.members;
		while(_g < _g1.length) {
			var sound = _g1[_g];
			++_g;
			if(sound != null && sound.exists) {
				sound.resume();
			}
		}
	}
	,destroy: function(ForceDestroy) {
		if(ForceDestroy == null) {
			ForceDestroy = false;
		}
		if(this.music != null && (ForceDestroy || !this.music.persist)) {
			this.destroySound(this.music);
			this.music = null;
		}
		var _g = 0;
		var _g1 = this.list.members;
		while(_g < _g1.length) {
			var sound = _g1[_g];
			++_g;
			if(sound != null && (ForceDestroy || !sound.persist)) {
				this.destroySound(sound);
			}
		}
	}
	,destroySound: function(sound) {
		this.defaultMusicGroup.remove(sound);
		this.defaultSoundGroup.remove(sound);
		sound.destroy();
	}
	,toggleMuted: function() {
		this.muted = !this.muted;
		if(this.volumeHandler != null) {
			this.volumeHandler(this.muted ? 0 : this.volume);
		}
		this.showSoundTray();
	}
	,changeVolume: function(Amount) {
		this.muted = false;
		var _g = this;
		_g.set_volume(_g.volume + Amount);
		this.showSoundTray();
	}
	,showSoundTray: function() {
		if(flixel_FlxG.game.soundTray != null && this.soundTrayEnabled) {
			flixel_FlxG.game.soundTray.show();
		}
	}
	,update: function(elapsed) {
		if(this.music != null && this.music.active) {
			this.music.update(elapsed);
		}
		if(this.list != null && this.list.active) {
			this.list.update(elapsed);
		}
		if(flixel_FlxG.keys.checkKeyArrayState(this.muteKeys,-1)) {
			this.toggleMuted();
		} else if(flixel_FlxG.keys.checkKeyArrayState(this.volumeUpKeys,-1)) {
			this.changeVolume(0.1);
		} else if(flixel_FlxG.keys.checkKeyArrayState(this.volumeDownKeys,-1)) {
			this.changeVolume(-0.1);
		}
	}
	,onFocusLost: function() {
		if(this.music != null) {
			this.music.onFocusLost();
		}
		var _g = 0;
		var _g1 = this.list.members;
		while(_g < _g1.length) {
			var sound = _g1[_g];
			++_g;
			if(sound != null) {
				sound.onFocusLost();
			}
		}
	}
	,onFocus: function() {
		if(this.music != null) {
			this.music.onFocus();
		}
		var _g = 0;
		var _g1 = this.list.members;
		while(_g < _g1.length) {
			var sound = _g1[_g];
			++_g;
			if(sound != null) {
				sound.onFocus();
			}
		}
	}
	,loadSavedPrefs: function() {
		if(flixel_FlxG.save.data.volume != null) {
			this.set_volume(flixel_FlxG.save.data.volume);
		}
		if(flixel_FlxG.save.data.mute != null) {
			this.muted = flixel_FlxG.save.data.mute;
		}
	}
	,set_volume: function(Volume) {
		var lowerBound = Volume < 0 ? 0 : Volume;
		Volume = lowerBound > 1 ? 1 : lowerBound;
		if(this.volumeHandler != null) {
			var param = this.muted ? 0 : Volume;
			this.volumeHandler(param);
		}
		return this.volume = Volume;
	}
	,__class__: flixel_system_frontEnds_SoundFrontEnd
	,__properties__: {set_volume:"set_volume"}
};
var flixel_system_frontEnds_VCRFrontEnd = function() {
	this.stepRequested = false;
	this.paused = false;
};
$hxClasses["flixel.system.frontEnds.VCRFrontEnd"] = flixel_system_frontEnds_VCRFrontEnd;
flixel_system_frontEnds_VCRFrontEnd.__name__ = "flixel.system.frontEnds.VCRFrontEnd";
flixel_system_frontEnds_VCRFrontEnd.prototype = {
	paused: null
	,stepRequested: null
	,pause: function() {
		if(!this.paused) {
			if(!flixel_FlxG.mouse.useSystemCursor) {
				openfl_ui_Mouse.show();
			}
			this.paused = true;
		}
	}
	,resume: function() {
		if(this.paused) {
			if(!flixel_FlxG.mouse.useSystemCursor) {
				openfl_ui_Mouse.hide();
			}
			this.paused = false;
		}
	}
	,__class__: flixel_system_frontEnds_VCRFrontEnd
};
var flixel_system_macros_FlxMacroUtil = function() { };
$hxClasses["flixel.system.macros.FlxMacroUtil"] = flixel_system_macros_FlxMacroUtil;
flixel_system_macros_FlxMacroUtil.__name__ = "flixel.system.macros.FlxMacroUtil";
var flixel_system_replay_CodeValuePair = function(code,value) {
	this.code = code;
	this.value = value;
};
$hxClasses["flixel.system.replay.CodeValuePair"] = flixel_system_replay_CodeValuePair;
flixel_system_replay_CodeValuePair.__name__ = "flixel.system.replay.CodeValuePair";
flixel_system_replay_CodeValuePair.prototype = {
	code: null
	,value: null
	,__class__: flixel_system_replay_CodeValuePair
};
var flixel_system_replay_MouseRecord = function(x,y,button,wheel) {
	this.x = x;
	this.y = y;
	this.button = button;
	this.wheel = wheel;
};
$hxClasses["flixel.system.replay.MouseRecord"] = flixel_system_replay_MouseRecord;
flixel_system_replay_MouseRecord.__name__ = "flixel.system.replay.MouseRecord";
flixel_system_replay_MouseRecord.prototype = {
	x: null
	,y: null
	,button: null
	,wheel: null
	,__class__: flixel_system_replay_MouseRecord
};
var flixel_system_ui_FlxSoundTray = function() {
	this._defaultScale = 2.0;
	this._width = 80;
	openfl_display_Sprite.call(this);
	this.set_visible(false);
	this.set_scaleX(this._defaultScale);
	this.set_scaleY(this._defaultScale);
	var tmp = new openfl_display_Bitmap(new openfl_display_BitmapData(this._width,30,true,2130706432));
	this.screenCenter();
	this.addChild(tmp);
	var text = new openfl_text_TextField();
	text.set_width(tmp.get_width());
	text.set_height(tmp.get_height());
	text.set_multiline(true);
	text.set_wordWrap(true);
	text.set_selectable(false);
	var dtf = new openfl_text_TextFormat(flixel_system_FlxAssets.FONT_DEFAULT,10,16777215);
	dtf.align = 0;
	text.set_defaultTextFormat(dtf);
	this.addChild(text);
	text.set_text("VOLUME");
	text.set_y(16);
	var bx = 10;
	var by = 14;
	this._bars = [];
	var _g = 0;
	while(_g < 10) {
		var i = _g++;
		tmp = new openfl_display_Bitmap(new openfl_display_BitmapData(4,i + 1,false,-1));
		tmp.set_x(bx);
		tmp.set_y(by);
		this.addChild(tmp);
		this._bars.push(tmp);
		bx += 6;
		--by;
	}
	this.set_y(-this.get_height());
	this.set_visible(false);
};
$hxClasses["flixel.system.ui.FlxSoundTray"] = flixel_system_ui_FlxSoundTray;
flixel_system_ui_FlxSoundTray.__name__ = "flixel.system.ui.FlxSoundTray";
flixel_system_ui_FlxSoundTray.__super__ = openfl_display_Sprite;
flixel_system_ui_FlxSoundTray.prototype = $extend(openfl_display_Sprite.prototype,{
	active: null
	,_timer: null
	,_bars: null
	,_width: null
	,_defaultScale: null
	,update: function(MS) {
		if(this._timer > 0) {
			this._timer -= MS / 1000;
		} else if(this.get_y() > -this.get_height()) {
			var _g = this;
			_g.set_y(_g.get_y() - MS / 1000 * flixel_FlxG.height * 2);
			if(this.get_y() <= -this.get_height()) {
				this.set_visible(false);
				this.active = false;
				flixel_FlxG.save.data.mute = flixel_FlxG.sound.muted;
				flixel_FlxG.save.data.volume = flixel_FlxG.sound.volume;
				flixel_FlxG.save.flush();
			}
		}
	}
	,show: function(Silent) {
		if(Silent == null) {
			Silent = false;
		}
		if(!Silent) {
			var extension = "";
			extension = ".ogg";
			var sound = openfl_utils_Assets.getSound("flixel/sounds/beep" + extension);
			if(sound != null) {
				flixel_FlxG.sound.load(sound).play();
			}
		}
		this._timer = 1;
		this.set_y(0);
		this.set_visible(true);
		this.active = true;
		var globalVolume = Math.round(flixel_FlxG.sound.volume * 10);
		if(flixel_FlxG.sound.muted) {
			globalVolume = 0;
		}
		var _g = 0;
		var _g1 = this._bars.length;
		while(_g < _g1) {
			var i = _g++;
			if(i < globalVolume) {
				this._bars[i].set_alpha(1);
			} else {
				this._bars[i].set_alpha(0.5);
			}
		}
	}
	,screenCenter: function() {
		this.set_scaleX(this._defaultScale);
		this.set_scaleY(this._defaultScale);
		this.set_x(0.5 * (openfl_Lib.get_current().stage.stageWidth - this._width * this._defaultScale) - flixel_FlxG.game.get_x());
	}
	,__class__: flixel_system_ui_FlxSoundTray
});
var flixel_system_ui_FlxSystemButton = function(Icon,UpHandler,ToggleMode) {
	if(ToggleMode == null) {
		ToggleMode = false;
	}
	this._mouseDown = false;
	this.toggled = false;
	this.toggleMode = false;
	this.enabled = true;
	openfl_display_Sprite.call(this);
	if(Icon != null) {
		this.changeIcon(Icon);
	}
	this.upHandler = UpHandler;
	this.toggleMode = ToggleMode;
	this.addEventListener("mouseUp",$bind(this,this.onMouseUp));
	this.addEventListener("mouseDown",$bind(this,this.onMouseDown));
	this.addEventListener("mouseOut",$bind(this,this.onMouseOut));
	this.addEventListener("mouseOver",$bind(this,this.onMouseOver));
};
$hxClasses["flixel.system.ui.FlxSystemButton"] = flixel_system_ui_FlxSystemButton;
flixel_system_ui_FlxSystemButton.__name__ = "flixel.system.ui.FlxSystemButton";
flixel_system_ui_FlxSystemButton.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_system_ui_FlxSystemButton.__super__ = openfl_display_Sprite;
flixel_system_ui_FlxSystemButton.prototype = $extend(openfl_display_Sprite.prototype,{
	upHandler: null
	,enabled: null
	,toggleMode: null
	,toggled: null
	,_icon: null
	,_mouseDown: null
	,changeIcon: function(Icon) {
		if(this._icon != null) {
			this.removeChild(this._icon);
		}
		flixel_system_debug_DebuggerUtil.fixSize(Icon);
		this._icon = new openfl_display_Bitmap(Icon);
		this.addChild(this._icon);
	}
	,destroy: function() {
		this.removeEventListener("mouseUp",$bind(this,this.onMouseUp));
		this.removeEventListener("mouseDown",$bind(this,this.onMouseDown));
		this.removeEventListener("mouseOut",$bind(this,this.onMouseOut));
		this.removeEventListener("mouseOver",$bind(this,this.onMouseOver));
		this._icon = null;
		this.upHandler = null;
	}
	,onMouseUp: function(_) {
		if(this.enabled && this._mouseDown) {
			this.set_toggled(!this.toggled);
			this._mouseDown = false;
			if(this.upHandler != null) {
				this.upHandler();
			}
		}
	}
	,onMouseDown: function(_) {
		this._mouseDown = true;
	}
	,onMouseOver: function(_) {
		if(this.enabled) {
			var _g = this;
			_g.set_alpha(_g.get_alpha() - 0.2);
		}
	}
	,onMouseOut: function(_) {
		if(this.enabled) {
			var _g = this;
			_g.set_alpha(_g.get_alpha() + 0.2);
		}
	}
	,set_toggled: function(Value) {
		if(this.toggleMode) {
			this.set_alpha(Value ? 0.3 : 1);
		}
		return this.toggled = Value;
	}
	,__class__: flixel_system_ui_FlxSystemButton
	,__properties__: $extend(openfl_display_Sprite.prototype.__properties__,{set_toggled:"set_toggled"})
});
var flixel_text_FlxText = function(X,Y,FieldWidth,Text1,Size,EmbeddedFont) {
	if(EmbeddedFont == null) {
		EmbeddedFont = true;
	}
	if(Size == null) {
		Size = 8;
	}
	if(FieldWidth == null) {
		FieldWidth = 0;
	}
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	this._hasBorderAlpha = false;
	this._regen = true;
	this._formatRanges = [];
	this.borderQuality = 1;
	this.borderSize = 1;
	this.borderColor = 0;
	this.borderStyle = flixel_text_FlxTextBorderStyle.NONE;
	this.text = "";
	flixel_FlxSprite.call(this,X,Y);
	if(Text1 == null || Text1 == "") {
		this.set_text("");
		Text1 = " ";
	} else {
		this.set_text(Text1);
	}
	this.textField = new openfl_text_TextField();
	this.textField.set_selectable(false);
	this.textField.set_multiline(true);
	this.textField.set_wordWrap(true);
	this._defaultFormat = new openfl_text_TextFormat(null,Size,16777215);
	this.set_font(flixel_system_FlxAssets.FONT_DEFAULT);
	this._formatAdjusted = new openfl_text_TextFormat();
	this.textField.set_defaultTextFormat(this._defaultFormat);
	this.textField.set_text(Text1);
	this.set_fieldWidth(FieldWidth);
	this.textField.set_embedFonts(EmbeddedFont);
	this.textField.set_sharpness(100);
	this.textField.set_height(Text1.length <= 0 ? 1 : 10);
	this.set_allowCollisions(0);
	this.set_moves(false);
	this.drawFrame();
	var X = 1;
	var Y = 1;
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	var point = flixel_math_FlxPoint._pool.get().set(X,Y);
	point._inPool = false;
	this.shadowOffset = point;
};
$hxClasses["flixel.text.FlxText"] = flixel_text_FlxText;
flixel_text_FlxText.__name__ = "flixel.text.FlxText";
flixel_text_FlxText.__super__ = flixel_FlxSprite;
flixel_text_FlxText.prototype = $extend(flixel_FlxSprite.prototype,{
	text: null
	,borderStyle: null
	,borderColor: null
	,borderSize: null
	,borderQuality: null
	,textField: null
	,shadowOffset: null
	,_defaultFormat: null
	,_formatAdjusted: null
	,_formatRanges: null
	,_font: null
	,_regen: null
	,_borderPixels: null
	,_borderColorTransform: null
	,_hasBorderAlpha: null
	,destroy: function() {
		this.textField = null;
		this._font = null;
		this._defaultFormat = null;
		this._formatAdjusted = null;
		this.shadowOffset = flixel_util_FlxDestroyUtil.put(this.shadowOffset);
		flixel_FlxSprite.prototype.destroy.call(this);
	}
	,drawFrame: function(Force) {
		if(Force == null) {
			Force = false;
		}
		this._regen = this._regen || Force;
		flixel_FlxSprite.prototype.drawFrame.call(this,this._regen);
	}
	,stampOnAtlas: function(atlas) {
		this.regenGraphic();
		var node = atlas.addNode(this.graphic.bitmap,this.graphic.key);
		var result = node != null;
		if(node != null) {
			this.set_frames(node.getImageFrame());
		}
		return result;
	}
	,applyMarkup: function(input,rules) {
		if(rules == null || rules.length == 0) {
			return this;
		}
		this.clearFormats();
		var rangeStarts = [];
		var rangeEnds = [];
		var rulesToApply = [];
		var i = 0;
		var _g = 0;
		while(_g < rules.length) {
			var rule = rules[_g];
			++_g;
			if(rule.marker == null || rule.format == null) {
				continue;
			}
			var start = false;
			var markerLength = UnicodeString.get_length(rule.marker);
			if(input.indexOf(rule.marker) == -1) {
				continue;
			}
			var _g1 = 0;
			var _g2 = UnicodeString.get_length(input);
			while(_g1 < _g2) {
				var charIndex = _g1++;
				if(UnicodeString.substr(input,charIndex,markerLength) != rule.marker) {
					continue;
				}
				if(start) {
					start = false;
					rangeEnds.push(charIndex);
				} else {
					start = true;
					rangeStarts.push(charIndex);
					rulesToApply.push(rule);
				}
			}
			if(start) {
				rangeEnds.push(-1);
			}
			++i;
		}
		var _g = 0;
		while(_g < rules.length) {
			var rule = rules[_g];
			++_g;
			input = StringTools.replace(input,rule.marker,"");
		}
		var _g = 0;
		var _g1 = rangeStarts.length;
		while(_g < _g1) {
			var i = _g++;
			var delIndex = rangeStarts[i];
			var markerLength = UnicodeString.get_length(rulesToApply[i].marker);
			var _g2 = 0;
			var _g3 = rangeStarts.length;
			while(_g2 < _g3) {
				var j = _g2++;
				if(rangeStarts[j] > delIndex) {
					rangeStarts[j] -= markerLength;
				}
				if(rangeEnds[j] > delIndex) {
					rangeEnds[j] -= markerLength;
				}
			}
			delIndex = rangeEnds[i];
			var _g4 = 0;
			var _g5 = rangeStarts.length;
			while(_g4 < _g5) {
				var j1 = _g4++;
				if(rangeStarts[j1] > delIndex) {
					rangeStarts[j1] -= markerLength;
				}
				if(rangeEnds[j1] > delIndex) {
					rangeEnds[j1] -= markerLength;
				}
			}
		}
		this.set_text(input);
		var _g = 0;
		var _g1 = rangeStarts.length;
		while(_g < _g1) {
			var i = _g++;
			this.addFormat(rulesToApply[i].format,rangeStarts[i],rangeEnds[i]);
		}
		return this;
	}
	,addFormat: function(Format,Start,End) {
		if(End == null) {
			End = -1;
		}
		if(Start == null) {
			Start = -1;
		}
		this._formatRanges.push(new flixel_text__$FlxText_FlxTextFormatRange(Format,Start,End));
		this._formatRanges.sort(function(left,right) {
			if(left.range.start < right.range.start) {
				return -1;
			} else {
				return 1;
			}
		});
		this._regen = true;
		return this;
	}
	,removeFormat: function(Format,Start,End) {
		var i = this._formatRanges.length;
		while(i-- > 0) {
			var formatRange = this._formatRanges[i];
			if(formatRange.format != Format) {
				continue;
			}
			if(Start != null && End != null) {
				var range = formatRange.range;
				if(Start >= range.end || End <= range.start) {
					continue;
				}
				if(Start > range.start && End < range.end) {
					this.addFormat(formatRange.format,End + 1,range.end);
					range.end = Start;
					continue;
				}
				if(Start <= range.start && End < range.end) {
					range.start = End;
					continue;
				}
				if(Start > range.start && End >= range.end) {
					range.end = Start;
					continue;
				}
			}
			HxOverrides.remove(this._formatRanges,formatRange);
		}
		this._regen = true;
		return this;
	}
	,clearFormats: function() {
		this._formatRanges = [];
		this.textField.set_defaultTextFormat(this._defaultFormat);
		this.textField.setTextFormat(this._defaultFormat);
		this._regen = true;
		return this;
	}
	,setFormat: function(Font,Size,Color,Alignment,BorderStyle,BorderColor,EmbeddedFont) {
		if(EmbeddedFont == null) {
			EmbeddedFont = true;
		}
		if(BorderColor == null) {
			BorderColor = 0;
		}
		if(Color == null) {
			Color = -1;
		}
		if(Size == null) {
			Size = 8;
		}
		if(BorderStyle == null) {
			BorderStyle = flixel_text_FlxTextBorderStyle.NONE;
		}
		if(EmbeddedFont) {
			this.set_font(Font);
		} else if(Font != null) {
			this.set_systemFont(Font);
		}
		this.set_size(Size);
		this.set_color(Color);
		if(Alignment != null) {
			this.set_alignment(Alignment);
		}
		var Color = BorderColor;
		if(Color == null) {
			Color = 0;
		}
		this.set_borderStyle(BorderStyle);
		this.set_borderColor(Color);
		this.set_borderSize(1);
		this.set_borderQuality(1);
		this.textField.set_defaultTextFormat(this._defaultFormat);
		this.textField.setTextFormat(this._defaultFormat);
		this._regen = true;
		return this;
	}
	,setBorderStyle: function(Style,Color,Size,Quality) {
		if(Quality == null) {
			Quality = 1;
		}
		if(Size == null) {
			Size = 1;
		}
		if(Color == null) {
			Color = 0;
		}
		this.set_borderStyle(Style);
		this.set_borderColor(Color);
		this.set_borderSize(Size);
		this.set_borderQuality(Quality);
		return this;
	}
	,updateHitbox: function() {
		this.regenGraphic();
		flixel_FlxSprite.prototype.updateHitbox.call(this);
	}
	,set_fieldWidth: function(value) {
		if(this.textField == null) {
			return value;
		}
		if(value <= 0) {
			this.set_wordWrap(false);
			this.set_autoSize(true);
		} else {
			this.set_autoSize(false);
			this.set_wordWrap(true);
			this.textField.set_width(value);
		}
		this._regen = true;
		return value;
	}
	,get_fieldWidth: function() {
		if(this.textField != null) {
			return this.textField.get_width();
		} else {
			return 0;
		}
	}
	,set_autoSize: function(value) {
		if(this.textField != null) {
			this.textField.set_autoSize(value ? 1 : 2);
			this._regen = true;
		}
		return value;
	}
	,get_autoSize: function() {
		if(this.textField != null) {
			return this.textField.get_autoSize() != 2;
		} else {
			return false;
		}
	}
	,set_text: function(Text1) {
		this.text = Text1;
		if(this.textField != null) {
			var ot = this.textField.get_text();
			this.textField.set_text(Text1);
			this._regen = this.textField.get_text() != ot || this._regen;
		}
		return Text1;
	}
	,get_size: function() {
		return this._defaultFormat.size | 0;
	}
	,set_size: function(Size) {
		this._defaultFormat.size = Size;
		this.textField.set_defaultTextFormat(this._defaultFormat);
		this.textField.setTextFormat(this._defaultFormat);
		this._regen = true;
		return Size;
	}
	,set_color: function(Color) {
		if(this._defaultFormat.color == (Color & 16777215)) {
			return Color;
		}
		this._defaultFormat.color = Color & 16777215;
		this.color = Color;
		this.textField.set_defaultTextFormat(this._defaultFormat);
		this.textField.setTextFormat(this._defaultFormat);
		this._regen = true;
		return Color;
	}
	,get_font: function() {
		return this._font;
	}
	,set_font: function(Font) {
		this.textField.set_embedFonts(true);
		if(Font != null) {
			var newFontName = Font;
			if(openfl_utils_Assets.exists(Font,"FONT")) {
				newFontName = openfl_utils_Assets.getFont(Font).name;
			}
			this._defaultFormat.font = newFontName;
		} else {
			this._defaultFormat.font = flixel_system_FlxAssets.FONT_DEFAULT;
		}
		this.textField.set_defaultTextFormat(this._defaultFormat);
		this.textField.setTextFormat(this._defaultFormat);
		this._regen = true;
		return this._font = this._defaultFormat.font;
	}
	,get_embedded: function() {
		return this.textField.set_embedFonts(true);
	}
	,get_systemFont: function() {
		return this._defaultFormat.font;
	}
	,set_systemFont: function(Font) {
		this.textField.set_embedFonts(false);
		this._defaultFormat.font = Font;
		this.textField.set_defaultTextFormat(this._defaultFormat);
		this.textField.setTextFormat(this._defaultFormat);
		this._regen = true;
		return Font;
	}
	,get_bold: function() {
		return this._defaultFormat.bold;
	}
	,set_bold: function(value) {
		if(this._defaultFormat.bold != value) {
			this._defaultFormat.bold = value;
			this.textField.set_defaultTextFormat(this._defaultFormat);
			this.textField.setTextFormat(this._defaultFormat);
			this._regen = true;
		}
		return value;
	}
	,get_italic: function() {
		return this._defaultFormat.italic;
	}
	,set_italic: function(value) {
		if(this._defaultFormat.italic != value) {
			this._defaultFormat.italic = value;
			this.textField.set_defaultTextFormat(this._defaultFormat);
			this.textField.setTextFormat(this._defaultFormat);
			this._regen = true;
		}
		return value;
	}
	,get_wordWrap: function() {
		return this.textField.get_wordWrap();
	}
	,set_wordWrap: function(value) {
		if(this.textField.get_wordWrap() != value) {
			this.textField.set_wordWrap(value);
			this._regen = true;
		}
		return value;
	}
	,get_alignment: function() {
		return flixel_text_FlxTextAlign.fromOpenFL(this._defaultFormat.align);
	}
	,set_alignment: function(Alignment) {
		this._defaultFormat.align = flixel_text_FlxTextAlign.toOpenFL(Alignment);
		this.textField.set_defaultTextFormat(this._defaultFormat);
		this.textField.setTextFormat(this._defaultFormat);
		this._regen = true;
		return Alignment;
	}
	,set_borderStyle: function(style) {
		if(style != this.borderStyle) {
			this._regen = true;
		}
		return this.borderStyle = style;
	}
	,set_borderColor: function(Color) {
		if(this.borderColor != Color && this.borderStyle != flixel_text_FlxTextBorderStyle.NONE) {
			this._regen = true;
		}
		this._hasBorderAlpha = (Color >> 24 & 255) / 255 < 1;
		return this.borderColor = Color;
	}
	,set_borderSize: function(Value) {
		if(Value != this.borderSize && this.borderStyle != flixel_text_FlxTextBorderStyle.NONE) {
			this._regen = true;
		}
		return this.borderSize = Value;
	}
	,set_borderQuality: function(Value) {
		var lowerBound = Value < 0 ? 0 : Value;
		Value = lowerBound > 1 ? 1 : lowerBound;
		if(Value != this.borderQuality && this.borderStyle != flixel_text_FlxTextBorderStyle.NONE) {
			this._regen = true;
		}
		return this.borderQuality = Value;
	}
	,set_graphic: function(Value) {
		var oldGraphic = this.graphic;
		var graph = flixel_FlxSprite.prototype.set_graphic.call(this,Value);
		flixel_FlxG.bitmap.removeIfNoUse(oldGraphic);
		return graph;
	}
	,get_width: function() {
		this.regenGraphic();
		return flixel_FlxSprite.prototype.get_width.call(this);
	}
	,get_height: function() {
		this.regenGraphic();
		return flixel_FlxSprite.prototype.get_height.call(this);
	}
	,updateColorTransform: function() {
		if(this.colorTransform == null) {
			this.colorTransform = new openfl_geom_ColorTransform();
		}
		if(this.alpha != 1) {
			this.colorTransform.alphaMultiplier = this.alpha;
			this.useColorTransform = true;
		} else {
			this.colorTransform.alphaMultiplier = 1;
			this.useColorTransform = false;
		}
		this.dirty = true;
	}
	,regenGraphic: function() {
		if(this.textField == null || !this._regen) {
			return;
		}
		var oldWidth = 0;
		var oldHeight = 4;
		if(this.graphic != null) {
			oldWidth = this.graphic.width;
			oldHeight = this.graphic.height;
		}
		var newWidth = this.textField.get_width();
		var newHeight = this.textField.get_textHeight() + 4;
		if(this.textField.get_textHeight() == 0) {
			newHeight = oldHeight;
		}
		if(oldWidth != newWidth || oldHeight != newHeight) {
			this.set_height(newHeight);
			var key = flixel_FlxG.bitmap.getUniqueKey("text");
			this.makeGraphic(newWidth | 0,newHeight | 0,0,false,key);
			if(this._hasBorderAlpha) {
				this._borderPixels = this.graphic.bitmap.clone();
			}
			this.frameHeight = this.get_height() | 0;
			this.textField.set_height(this.get_height() * 1.2);
			this._flashRect.x = 0;
			this._flashRect.y = 0;
			this._flashRect.width = newWidth;
			this._flashRect.height = newHeight;
		} else {
			this.graphic.bitmap.fillRect(this._flashRect,0);
			if(this._hasBorderAlpha) {
				if(this._borderPixels == null) {
					this._borderPixels = new openfl_display_BitmapData(this.frameWidth,this.frameHeight,true);
				} else {
					this._borderPixels.fillRect(this._flashRect,0);
				}
			}
		}
		if(this.textField != null && this.textField.get_text() != null && this.textField.get_text().length > 0) {
			this.copyTextFormat(this._defaultFormat,this._formatAdjusted);
			this._matrix.identity();
			this.applyBorderStyle();
			if(this._hasBorderAlpha) {
				if(this._borderColorTransform == null) {
					this._borderColorTransform = new openfl_geom_ColorTransform();
				}
				this._borderColorTransform.alphaMultiplier = (this.borderColor >> 24 & 255) / 255;
				this._borderPixels.colorTransform(this._borderPixels.rect,this._borderColorTransform);
				this.graphic.bitmap.draw(this._borderPixels);
			}
			this.applyFormats(this._formatAdjusted,false);
			this.drawTextFieldTo(this.graphic.bitmap);
		}
		this._regen = false;
		this.set_frame(this.frame);
	}
	,drawTextFieldTo: function(graphic) {
		graphic.draw(this.textField,this._matrix);
	}
	,draw: function() {
		this.regenGraphic();
		flixel_FlxSprite.prototype.draw.call(this);
	}
	,calcFrame: function(RunOnCpp) {
		if(RunOnCpp == null) {
			RunOnCpp = false;
		}
		if(this.textField == null) {
			return;
		}
		if(flixel_FlxG.renderTile && !RunOnCpp) {
			return;
		}
		this.regenGraphic();
		flixel_FlxSprite.prototype.calcFrame.call(this,RunOnCpp);
	}
	,applyBorderStyle: function() {
		var iterations = this.borderSize * this.borderQuality | 0;
		if(iterations <= 0) {
			iterations = 1;
		}
		var delta = this.borderSize / iterations;
		switch(this.borderStyle._hx_index) {
		case 0:
			break;
		case 1:
			this.applyFormats(this._formatAdjusted,true);
			var _g = 0;
			var _g1 = iterations;
			while(_g < _g1) {
				var i = _g++;
				var graphic = this._hasBorderAlpha ? this._borderPixels : this.graphic.bitmap;
				this._matrix.translate(delta,delta);
				this.drawTextFieldTo(graphic);
			}
			this._matrix.translate(-this.shadowOffset.x * this.borderSize,-this.shadowOffset.y * this.borderSize);
			break;
		case 2:
			this.applyFormats(this._formatAdjusted,true);
			var curDelta = delta;
			var _g = 0;
			var _g1 = iterations;
			while(_g < _g1) {
				var i = _g++;
				var graphic = this._hasBorderAlpha ? this._borderPixels : this.graphic.bitmap;
				this._matrix.translate(-curDelta,-curDelta);
				this.drawTextFieldTo(graphic);
				var graphic1 = this._hasBorderAlpha ? this._borderPixels : this.graphic.bitmap;
				this._matrix.translate(curDelta,0);
				this.drawTextFieldTo(graphic1);
				var graphic2 = this._hasBorderAlpha ? this._borderPixels : this.graphic.bitmap;
				this._matrix.translate(curDelta,0);
				this.drawTextFieldTo(graphic2);
				var graphic3 = this._hasBorderAlpha ? this._borderPixels : this.graphic.bitmap;
				this._matrix.translate(0,curDelta);
				this.drawTextFieldTo(graphic3);
				var graphic4 = this._hasBorderAlpha ? this._borderPixels : this.graphic.bitmap;
				this._matrix.translate(0,curDelta);
				this.drawTextFieldTo(graphic4);
				var graphic5 = this._hasBorderAlpha ? this._borderPixels : this.graphic.bitmap;
				this._matrix.translate(-curDelta,0);
				this.drawTextFieldTo(graphic5);
				var graphic6 = this._hasBorderAlpha ? this._borderPixels : this.graphic.bitmap;
				this._matrix.translate(-curDelta,0);
				this.drawTextFieldTo(graphic6);
				var graphic7 = this._hasBorderAlpha ? this._borderPixels : this.graphic.bitmap;
				this._matrix.translate(0,-curDelta);
				this.drawTextFieldTo(graphic7);
				this._matrix.translate(curDelta,0);
				curDelta += delta;
			}
			break;
		case 3:
			this.applyFormats(this._formatAdjusted,true);
			var curDelta = delta;
			var _g = 0;
			var _g1 = iterations;
			while(_g < _g1) {
				var i = _g++;
				var graphic = this._hasBorderAlpha ? this._borderPixels : this.graphic.bitmap;
				this._matrix.translate(-curDelta,-curDelta);
				this.drawTextFieldTo(graphic);
				var graphic1 = this._hasBorderAlpha ? this._borderPixels : this.graphic.bitmap;
				this._matrix.translate(curDelta * 2,0);
				this.drawTextFieldTo(graphic1);
				var graphic2 = this._hasBorderAlpha ? this._borderPixels : this.graphic.bitmap;
				this._matrix.translate(0,curDelta * 2);
				this.drawTextFieldTo(graphic2);
				var graphic3 = this._hasBorderAlpha ? this._borderPixels : this.graphic.bitmap;
				this._matrix.translate(-curDelta * 2,0);
				this.drawTextFieldTo(graphic3);
				this._matrix.translate(curDelta,-curDelta);
				curDelta += delta;
			}
			break;
		}
	}
	,applyBorderTransparency: function() {
		if(!this._hasBorderAlpha) {
			return;
		}
		if(this._borderColorTransform == null) {
			this._borderColorTransform = new openfl_geom_ColorTransform();
		}
		this._borderColorTransform.alphaMultiplier = (this.borderColor >> 24 & 255) / 255;
		this._borderPixels.colorTransform(this._borderPixels.rect,this._borderColorTransform);
		this.graphic.bitmap.draw(this._borderPixels);
	}
	,copyTextWithOffset: function(x,y) {
		var graphic = this._hasBorderAlpha ? this._borderPixels : this.graphic.bitmap;
		this._matrix.translate(x,y);
		this.drawTextFieldTo(graphic);
	}
	,applyFormats: function(FormatAdjusted,UseBorderColor) {
		if(UseBorderColor == null) {
			UseBorderColor = false;
		}
		this.copyTextFormat(this._defaultFormat,FormatAdjusted,false);
		FormatAdjusted.color = UseBorderColor ? this.borderColor & 16777215 : this._defaultFormat.color;
		this.textField.setTextFormat(FormatAdjusted);
		var _g = 0;
		var _g1 = this._formatRanges;
		while(_g < _g1.length) {
			var formatRange = _g1[_g];
			++_g;
			if(this.textField.get_text().length - 1 < formatRange.range.start) {
				break;
			} else {
				var textFormat = formatRange.format.format;
				this.copyTextFormat(textFormat,FormatAdjusted,false);
				FormatAdjusted.color = UseBorderColor ? formatRange.format.borderColor & 16777215 : textFormat.color;
			}
			this.textField.setTextFormat(FormatAdjusted,formatRange.range.start,Math.min(formatRange.range.end,this.textField.get_text().length) | 0);
		}
	}
	,copyTextFormat: function(from,to,withAlign) {
		if(withAlign == null) {
			withAlign = true;
		}
		to.font = from.font;
		to.bold = from.bold;
		to.italic = from.italic;
		to.size = from.size;
		to.color = from.color;
		to.leading = from.leading;
		if(withAlign) {
			to.align = from.align;
		}
	}
	,dtfCopy: function() {
		var dtf = this.textField.get_defaultTextFormat();
		return new openfl_text_TextFormat(dtf.font,dtf.size,dtf.color,dtf.bold,dtf.italic,dtf.underline,dtf.url,dtf.target,dtf.align);
	}
	,updateDefaultFormat: function() {
		this.textField.set_defaultTextFormat(this._defaultFormat);
		this.textField.setTextFormat(this._defaultFormat);
		this._regen = true;
	}
	,set_frames: function(Frames) {
		flixel_FlxSprite.prototype.set_frames.call(this,Frames);
		this._regen = false;
		return Frames;
	}
	,__class__: flixel_text_FlxText
	,__properties__: $extend(flixel_FlxSprite.prototype.__properties__,{set_autoSize:"set_autoSize",get_autoSize:"get_autoSize",set_fieldWidth:"set_fieldWidth",get_fieldWidth:"get_fieldWidth",set_borderQuality:"set_borderQuality",set_borderSize:"set_borderSize",set_borderColor:"set_borderColor",set_borderStyle:"set_borderStyle",set_alignment:"set_alignment",get_alignment:"get_alignment",set_wordWrap:"set_wordWrap",get_wordWrap:"get_wordWrap",set_italic:"set_italic",get_italic:"get_italic",set_bold:"set_bold",get_bold:"get_bold",set_systemFont:"set_systemFont",get_systemFont:"get_systemFont",get_embedded:"get_embedded",set_font:"set_font",get_font:"get_font",set_size:"set_size",get_size:"get_size",set_text:"set_text"})
});
var flixel_text_FlxTextFormat = function(FontColor,Bold,Italic,BorderColor) {
	this.format = new openfl_text_TextFormat(null,null,FontColor,Bold,Italic);
	this.borderColor = BorderColor == null ? 0 : BorderColor;
};
$hxClasses["flixel.text.FlxTextFormat"] = flixel_text_FlxTextFormat;
flixel_text_FlxTextFormat.__name__ = "flixel.text.FlxTextFormat";
flixel_text_FlxTextFormat.prototype = {
	leading: null
	,borderColor: null
	,format: null
	,set_leading: function(value) {
		this.format.leading = value;
		return value;
	}
	,__class__: flixel_text_FlxTextFormat
	,__properties__: {set_leading:"set_leading"}
};
var flixel_text__$FlxText_FlxTextFormatRange = function(format,start,end) {
	this.range = new flixel_util_helpers_FlxRange(start,end);
	this.format = format;
};
$hxClasses["flixel.text._FlxText.FlxTextFormatRange"] = flixel_text__$FlxText_FlxTextFormatRange;
flixel_text__$FlxText_FlxTextFormatRange.__name__ = "flixel.text._FlxText.FlxTextFormatRange";
flixel_text__$FlxText_FlxTextFormatRange.prototype = {
	range: null
	,format: null
	,__class__: flixel_text__$FlxText_FlxTextFormatRange
};
var flixel_text_FlxTextFormatMarkerPair = function(format,marker) {
	this.format = format;
	this.marker = marker;
};
$hxClasses["flixel.text.FlxTextFormatMarkerPair"] = flixel_text_FlxTextFormatMarkerPair;
flixel_text_FlxTextFormatMarkerPair.__name__ = "flixel.text.FlxTextFormatMarkerPair";
flixel_text_FlxTextFormatMarkerPair.prototype = {
	format: null
	,marker: null
	,__class__: flixel_text_FlxTextFormatMarkerPair
};
var flixel_text_FlxTextBorderStyle = $hxEnums["flixel.text.FlxTextBorderStyle"] = { __ename__ : "flixel.text.FlxTextBorderStyle", __constructs__ : ["NONE","SHADOW","OUTLINE","OUTLINE_FAST"]
	,NONE: {_hx_index:0,__enum__:"flixel.text.FlxTextBorderStyle",toString:$estr}
	,SHADOW: {_hx_index:1,__enum__:"flixel.text.FlxTextBorderStyle",toString:$estr}
	,OUTLINE: {_hx_index:2,__enum__:"flixel.text.FlxTextBorderStyle",toString:$estr}
	,OUTLINE_FAST: {_hx_index:3,__enum__:"flixel.text.FlxTextBorderStyle",toString:$estr}
};
var flixel_text_FlxTextAlign = {};
flixel_text_FlxTextAlign.fromOpenFL = function(align) {
	switch(align) {
	case 0:
		return "center";
	case 2:
		return "justify";
	case 3:
		return "left";
	case 4:
		return "right";
	default:
		return "left";
	}
};
flixel_text_FlxTextAlign.toOpenFL = function(align) {
	switch(align) {
	case "center":
		return 0;
	case "justify":
		return 2;
	case "left":
		return 3;
	case "right":
		return 4;
	default:
		return 3;
	}
};
var flixel_tile_FlxBaseTilemap = function() {
	this._collideIndex = 0;
	this._drawIndex = 0;
	this._startingIndex = 0;
	this._tileObjects = [];
	this.totalTiles = 0;
	this.heightInTiles = 0;
	this.widthInTiles = 0;
	this.auto = flixel_tile_FlxTilemapAutoTiling.OFF;
	flixel_FlxObject.call(this);
	this.flixelType = 3;
	this.set_immovable(true);
	this.set_moves(false);
};
$hxClasses["flixel.tile.FlxBaseTilemap"] = flixel_tile_FlxBaseTilemap;
flixel_tile_FlxBaseTilemap.__name__ = "flixel.tile.FlxBaseTilemap";
flixel_tile_FlxBaseTilemap.__super__ = flixel_FlxObject;
flixel_tile_FlxBaseTilemap.prototype = $extend(flixel_FlxObject.prototype,{
	auto: null
	,widthInTiles: null
	,heightInTiles: null
	,totalTiles: null
	,customTileRemap: null
	,_randomIndices: null
	,_randomChoices: null
	,_randomLambda: null
	,_tileObjects: null
	,_startingIndex: null
	,_data: null
	,_drawIndex: null
	,_collideIndex: null
	,updateTile: function(Index) {
		throw haxe_Exception.thrown("updateTile must be implemented");
	}
	,cacheGraphics: function(TileWidth,TileHeight,TileGraphic) {
		throw haxe_Exception.thrown("cacheGraphics must be implemented");
	}
	,initTileObjects: function() {
		throw haxe_Exception.thrown("initTileObjects must be implemented");
	}
	,updateMap: function() {
		throw haxe_Exception.thrown("updateMap must be implemented");
	}
	,computeDimensions: function() {
		throw haxe_Exception.thrown("computeDimensions must be implemented");
	}
	,getTileIndexByCoords: function(Coord) {
		throw haxe_Exception.thrown("getTileIndexByCoords must be implemented");
	}
	,getTileCoordsByIndex: function(Index,Midpoint) {
		if(Midpoint == null) {
			Midpoint = true;
		}
		throw haxe_Exception.thrown("getTileCoordsByIndex must be implemented");
	}
	,ray: function(Start,End,Result,Resolution) {
		if(Resolution == null) {
			Resolution = 1;
		}
		throw haxe_Exception.thrown("ray must be implemented");
	}
	,overlapsWithCallback: function(Object1,Callback,FlipCallbackParams,Position) {
		if(FlipCallbackParams == null) {
			FlipCallbackParams = false;
		}
		throw haxe_Exception.thrown("overlapsWithCallback must be implemented");
	}
	,setDirty: function(Dirty) {
		if(Dirty == null) {
			Dirty = true;
		}
		throw haxe_Exception.thrown("setDirty must be implemented");
	}
	,destroy: function() {
		this._data = null;
		flixel_FlxObject.prototype.destroy.call(this);
	}
	,loadMapFromCSV: function(MapData,TileGraphic,TileWidth,TileHeight,AutoTile,StartingIndex,DrawIndex,CollideIndex) {
		if(CollideIndex == null) {
			CollideIndex = 1;
		}
		if(DrawIndex == null) {
			DrawIndex = 1;
		}
		if(StartingIndex == null) {
			StartingIndex = 0;
		}
		if(TileHeight == null) {
			TileHeight = 0;
		}
		if(TileWidth == null) {
			TileWidth = 0;
		}
		if(openfl_utils_Assets.exists(MapData)) {
			MapData = openfl_utils_Assets.getText(MapData);
		}
		this._data = [];
		var columns;
		var regex = new EReg("[ \t]*((\r\n)|\r|\n)[ \t]*","g");
		var lines = regex.split(MapData);
		var _g = [];
		var _g1 = 0;
		var _g2 = lines;
		while(_g1 < _g2.length) {
			var v = _g2[_g1];
			++_g1;
			if(v != "") {
				_g.push(v);
			}
		}
		var rows = _g;
		this.heightInTiles = rows.length;
		this.widthInTiles = 0;
		var row = 0;
		while(row < this.heightInTiles) {
			var rowString = rows[row];
			if(StringTools.endsWith(rowString,",")) {
				rowString = HxOverrides.substr(rowString,0,rowString.length - 1);
			}
			columns = rowString.split(",");
			if(columns.length == 0) {
				this.heightInTiles--;
				continue;
			}
			if(this.widthInTiles == 0) {
				this.widthInTiles = columns.length;
			}
			var column = 0;
			while(column < this.widthInTiles) {
				var columnString = columns[column];
				var curTile = Std.parseInt(columnString);
				if(curTile == null) {
					throw haxe_Exception.thrown("String in row " + row + ", column " + column + " is not a valid integer: \"" + columnString + "\"");
				}
				this._data.push(curTile);
				++column;
			}
			++row;
		}
		this.loadMapHelper(TileGraphic,TileWidth,TileHeight,AutoTile,StartingIndex,DrawIndex,CollideIndex);
		return this;
	}
	,loadMapFromArray: function(MapData,WidthInTiles,HeightInTiles,TileGraphic,TileWidth,TileHeight,AutoTile,StartingIndex,DrawIndex,CollideIndex) {
		if(CollideIndex == null) {
			CollideIndex = 1;
		}
		if(DrawIndex == null) {
			DrawIndex = 1;
		}
		if(StartingIndex == null) {
			StartingIndex = 0;
		}
		if(TileHeight == null) {
			TileHeight = 0;
		}
		if(TileWidth == null) {
			TileWidth = 0;
		}
		this.widthInTiles = WidthInTiles;
		this.heightInTiles = HeightInTiles;
		this._data = MapData.slice();
		this.loadMapHelper(TileGraphic,TileWidth,TileHeight,AutoTile,StartingIndex,DrawIndex,CollideIndex);
		return this;
	}
	,loadMapFrom2DArray: function(MapData,TileGraphic,TileWidth,TileHeight,AutoTile,StartingIndex,DrawIndex,CollideIndex) {
		if(CollideIndex == null) {
			CollideIndex = 1;
		}
		if(DrawIndex == null) {
			DrawIndex = 1;
		}
		if(StartingIndex == null) {
			StartingIndex = 0;
		}
		if(TileHeight == null) {
			TileHeight = 0;
		}
		if(TileWidth == null) {
			TileWidth = 0;
		}
		this.widthInTiles = MapData[0].length;
		this.heightInTiles = MapData.length;
		this._data = flixel_util_FlxArrayUtil.flatten2DArray_Int(MapData);
		this.loadMapHelper(TileGraphic,TileWidth,TileHeight,AutoTile,StartingIndex,DrawIndex,CollideIndex);
		return this;
	}
	,loadMapFromGraphic: function(MapGraphic,Invert,Scale,ColorMap,TileGraphic,TileWidth,TileHeight,AutoTile,StartingIndex,DrawIndex,CollideIndex) {
		if(CollideIndex == null) {
			CollideIndex = 1;
		}
		if(DrawIndex == null) {
			DrawIndex = 1;
		}
		if(StartingIndex == null) {
			StartingIndex = 0;
		}
		if(TileHeight == null) {
			TileHeight = 0;
		}
		if(TileWidth == null) {
			TileWidth = 0;
		}
		if(Scale == null) {
			Scale = 1;
		}
		if(Invert == null) {
			Invert = false;
		}
		var mapBitmap = flixel_system_FlxAssets.resolveBitmapData(MapGraphic);
		var mapData = flixel_util_FlxStringUtil.bitmapToCSV(mapBitmap,Invert,Scale,ColorMap);
		return this.loadMapFromCSV(mapData,TileGraphic,TileWidth,TileHeight,AutoTile,StartingIndex,DrawIndex,CollideIndex);
	}
	,loadMapHelper: function(TileGraphic,TileWidth,TileHeight,AutoTile,StartingIndex,DrawIndex,CollideIndex) {
		if(CollideIndex == null) {
			CollideIndex = 1;
		}
		if(DrawIndex == null) {
			DrawIndex = 1;
		}
		if(StartingIndex == null) {
			StartingIndex = 0;
		}
		if(TileHeight == null) {
			TileHeight = 0;
		}
		if(TileWidth == null) {
			TileWidth = 0;
		}
		var _g = 0;
		var _g1 = this._data.length;
		while(_g < _g1) {
			var i = _g++;
			if(this._data[i] < 0) {
				this._data[i] = 0;
			}
		}
		this.totalTiles = this._data.length;
		this.auto = AutoTile == null ? flixel_tile_FlxTilemapAutoTiling.OFF : AutoTile;
		this._startingIndex = StartingIndex <= 0 ? 0 : StartingIndex;
		if(this.auto != flixel_tile_FlxTilemapAutoTiling.OFF) {
			this._startingIndex = 1;
			DrawIndex = 1;
			CollideIndex = 1;
		}
		this._drawIndex = DrawIndex;
		this._collideIndex = CollideIndex;
		this.applyAutoTile();
		this.applyCustomRemap();
		this.randomizeIndices();
		this.cacheGraphics(TileWidth,TileHeight,TileGraphic);
		this.postGraphicLoad();
	}
	,postGraphicLoad: function() {
		this.initTileObjects();
		this.computeDimensions();
		this.updateMap();
	}
	,applyAutoTile: function() {
		if(this.auto != flixel_tile_FlxTilemapAutoTiling.OFF) {
			var i = 0;
			while(i < this.totalTiles) this.autoTile(i++);
		}
	}
	,applyCustomRemap: function() {
		var i = 0;
		if(this.customTileRemap != null) {
			while(i < this.totalTiles) {
				var oldIndex = this._data[i];
				var newIndex = oldIndex;
				if(oldIndex < this.customTileRemap.length) {
					newIndex = this.customTileRemap[oldIndex];
				}
				this._data[i] = newIndex;
				++i;
			}
		}
	}
	,randomizeIndices: function() {
		var i = 0;
		if(this._randomIndices != null) {
			var randLambda = this._randomLambda != null ? this._randomLambda : function() {
				return flixel_FlxG.random.float();
			};
			while(i < this.totalTiles) {
				var oldIndex = this._data[i];
				var j = 0;
				var newIndex = oldIndex;
				var _g = 0;
				var _g1 = this._randomIndices;
				while(_g < _g1.length) {
					var rand = _g1[_g];
					++_g;
					if(oldIndex == rand) {
						var k = randLambda() * this._randomChoices[j].length | 0;
						newIndex = this._randomChoices[j][k];
					}
					++j;
				}
				this._data[i] = newIndex;
				++i;
			}
		}
	}
	,autoTile: function(Index) {
		if(this._data[Index] == 0) {
			return;
		}
		if(this.auto == flixel_tile_FlxTilemapAutoTiling.FULL) {
			this.autoTileFull(Index);
			return;
		}
		this._data[Index] = 0;
		if(Index - this.widthInTiles < 0 || this._data[Index - this.widthInTiles] > 0) {
			this._data[Index] += 1;
		}
		if(Index % this.widthInTiles >= this.widthInTiles - 1 || this._data[Index + 1] > 0) {
			this._data[Index] += 2;
		}
		if((Index + this.widthInTiles | 0) >= this.totalTiles || this._data[Index + this.widthInTiles] > 0) {
			this._data[Index] += 4;
		}
		if(Index % this.widthInTiles <= 0 || this._data[Index - 1] > 0) {
			this._data[Index] += 8;
		}
		if(this.auto == flixel_tile_FlxTilemapAutoTiling.ALT && this._data[Index] == 15) {
			if(Index % this.widthInTiles > 0 && (Index + this.widthInTiles | 0) < this.totalTiles && this._data[Index + this.widthInTiles - 1] <= 0) {
				this._data[Index] = 1;
			}
			if(Index % this.widthInTiles > 0 && Index - this.widthInTiles >= 0 && this._data[Index - this.widthInTiles - 1] <= 0) {
				this._data[Index] = 2;
			}
			if(Index % this.widthInTiles < this.widthInTiles - 1 && Index - this.widthInTiles >= 0 && this._data[Index - this.widthInTiles + 1] <= 0) {
				this._data[Index] = 4;
			}
			if(Index % this.widthInTiles < this.widthInTiles - 1 && (Index + this.widthInTiles | 0) < this.totalTiles && this._data[Index + this.widthInTiles + 1] <= 0) {
				this._data[Index] = 8;
			}
		}
		this._data[Index] += 1;
	}
	,autoTileFull: function(Index) {
		this._data[Index] = 0;
		var wallUp = Index - this.widthInTiles < 0;
		var wallRight = Index % this.widthInTiles >= this.widthInTiles - 1;
		var wallDown = (Index + this.widthInTiles | 0) >= this.totalTiles;
		var wallLeft = Index % this.widthInTiles <= 0;
		var up = wallUp || this._data[Index - this.widthInTiles] > 0;
		var upRight = wallUp || wallRight || this._data[Index - this.widthInTiles + 1] > 0;
		var right = wallRight || this._data[Index + 1] > 0;
		var rightDown = wallRight || wallDown || this._data[Index + this.widthInTiles + 1] > 0;
		var down = wallDown || this._data[Index + this.widthInTiles] > 0;
		var downLeft = wallDown || wallLeft || this._data[Index + this.widthInTiles - 1] > 0;
		var left = wallLeft || this._data[Index - 1] > 0;
		var leftUp = wallLeft || wallUp || this._data[Index - this.widthInTiles - 1] > 0;
		if(up) {
			this._data[Index] += 1;
		}
		if(upRight && up && right) {
			this._data[Index] += 2;
		}
		if(right) {
			this._data[Index] += 4;
		}
		if(rightDown && right && down) {
			this._data[Index] += 8;
		}
		if(down) {
			this._data[Index] += 16;
		}
		if(downLeft && down && left) {
			this._data[Index] += 32;
		}
		if(left) {
			this._data[Index] += 64;
		}
		if(leftUp && left && up) {
			this._data[Index] += 128;
		}
		this._data[Index] -= flixel_tile_FlxBaseTilemap.offsetAutoTile[this._data[Index]] - 1;
	}
	,setCustomTileMappings: function(mappings,randomIndices,randomChoices,randomLambda) {
		this.customTileRemap = mappings;
		this._randomIndices = randomIndices;
		this._randomChoices = randomChoices;
		this._randomLambda = randomLambda;
		if(this._randomIndices != null && (this._randomChoices == null || this._randomChoices.length == 0)) {
			throw haxe_Exception.thrown("You must provide valid 'randomChoices' if you wish to randomize tilemap indices, please read documentation of 'setCustomTileMappings' function.");
		}
	}
	,getTile: function(X,Y) {
		return this._data[Y * this.widthInTiles + X];
	}
	,getTileByIndex: function(Index) {
		return this._data[Index];
	}
	,getTileCollisions: function(Index) {
		return this._tileObjects[Index].allowCollisions;
	}
	,getTileInstances: function(Index) {
		var array = null;
		var i = 0;
		var l = this.widthInTiles * this.heightInTiles;
		while(i < l) {
			if(this._data[i] == Index) {
				if(array == null) {
					array = [];
				}
				array.push(i);
			}
			++i;
		}
		return array;
	}
	,setTile: function(X,Y,Tile,UpdateGraphics) {
		if(UpdateGraphics == null) {
			UpdateGraphics = true;
		}
		if(X >= this.widthInTiles || Y >= this.heightInTiles) {
			return false;
		}
		return this.setTileByIndex(Y * this.widthInTiles + X,Tile,UpdateGraphics);
	}
	,setTileByIndex: function(Index,Tile,UpdateGraphics) {
		if(UpdateGraphics == null) {
			UpdateGraphics = true;
		}
		if(Index >= this._data.length) {
			return false;
		}
		var ok = true;
		this._data[Index] = Tile;
		if(!UpdateGraphics) {
			return ok;
		}
		this.setDirty();
		if(this.auto == flixel_tile_FlxTilemapAutoTiling.OFF) {
			this.updateTile(this._data[Index]);
			return ok;
		}
		var i;
		var row = (Index / this.widthInTiles | 0) - 1;
		var rowLength = row + 3;
		var column = Index % this.widthInTiles - 1;
		var columnHeight = column + 3;
		while(row < rowLength) {
			column = columnHeight - 3;
			while(column < columnHeight) {
				if(row >= 0 && row < this.heightInTiles && column >= 0 && column < this.widthInTiles) {
					i = row * this.widthInTiles + column;
					this.autoTile(i);
					this.updateTile(this._data[i]);
				}
				++column;
			}
			++row;
		}
		return ok;
	}
	,setTileProperties: function(Tile,AllowCollisions,Callback,CallbackFilter,Range1) {
		if(Range1 == null) {
			Range1 = 1;
		}
		if(AllowCollisions == null) {
			AllowCollisions = 4369;
		}
		if(Range1 <= 0) {
			Range1 = 1;
		}
		var tile;
		var i = Tile;
		var l = Tile + Range1;
		var maxIndex = this._tileObjects.length;
		if(l > maxIndex) {
			throw haxe_Exception.thrown("Index " + l + " exceeds the maximum tile index of " + maxIndex + ". Please verify the Tile (" + Tile + ") and Range (" + Range1 + ") parameters.");
		}
		while(i < l) {
			tile = this._tileObjects[i++];
			tile.set_allowCollisions(AllowCollisions);
			tile.callbackFunction = Callback;
			tile.filter = CallbackFilter;
		}
	}
	,getData: function(Simple) {
		if(Simple == null) {
			Simple = false;
		}
		if(!Simple) {
			return this._data;
		}
		var i = 0;
		var l = this._data.length;
		var data = [];
		flixel_util_FlxArrayUtil.setLength_Int(data,l);
		while(i < l) {
			data[i] = this._tileObjects[this._data[i]].allowCollisions > 0 ? 1 : 0;
			++i;
		}
		return data;
	}
	,findPath: function(Start,End,Simplify,RaySimplify,DiagonalPolicy) {
		if(DiagonalPolicy == null) {
			DiagonalPolicy = 2;
		}
		if(RaySimplify == null) {
			RaySimplify = false;
		}
		if(Simplify == null) {
			Simplify = true;
		}
		var startIndex = this.getTileIndexByCoords(Start);
		var endIndex = this.getTileIndexByCoords(End);
		if(startIndex < 0 || endIndex < 0) {
			return null;
		}
		if(this._tileObjects[this._data[startIndex]].allowCollisions > 0 || this._tileObjects[this._data[endIndex]].allowCollisions > 0) {
			return null;
		}
		var distances = this.computePathDistance(startIndex,endIndex,DiagonalPolicy);
		if(distances == null) {
			return null;
		}
		var points = [];
		this.walkPath(distances,endIndex,points);
		var node = points[points.length - 1];
		node.set_x(Start.x);
		node.set_y(Start.y);
		if(Start._weak) {
			Start.put();
		}
		node = points[0];
		node.set_x(End.x);
		node.set_y(End.y);
		if(End._weak) {
			End.put();
		}
		if(Simplify) {
			this.simplifyPath(points);
		}
		if(RaySimplify) {
			this.raySimplifyPath(points);
		}
		var path = [];
		var i = points.length - 1;
		while(i >= 0) {
			node = points[i--];
			if(node != null) {
				path.push(node);
			}
		}
		return path;
	}
	,computePathDistance: function(StartIndex,EndIndex,DiagonalPolicy,StopOnEnd) {
		if(StopOnEnd == null) {
			StopOnEnd = true;
		}
		var mapSize = this.widthInTiles * this.heightInTiles;
		var distances = [];
		flixel_util_FlxArrayUtil.setLength_Int(distances,mapSize);
		var i = 0;
		while(i < mapSize) {
			if(this._tileObjects[this._data[i]].allowCollisions != 0) {
				distances[i] = -2;
			} else {
				distances[i] = -1;
			}
			++i;
		}
		distances[StartIndex] = 0;
		var distance = 1;
		var neighbors = [StartIndex];
		var current;
		var currentIndex;
		var left;
		var right;
		var up;
		var down;
		var currentLength;
		var foundEnd = false;
		while(neighbors.length > 0) {
			current = neighbors;
			neighbors = [];
			i = 0;
			currentLength = current.length;
			while(i < currentLength) {
				currentIndex = current[i++];
				if(currentIndex == (EndIndex | 0)) {
					foundEnd = true;
					if(StopOnEnd) {
						neighbors = [];
						break;
					}
				}
				left = currentIndex % this.widthInTiles > 0;
				right = currentIndex % this.widthInTiles < this.widthInTiles - 1;
				up = currentIndex / this.widthInTiles > 0;
				down = currentIndex / this.widthInTiles < this.heightInTiles - 1;
				var index;
				if(up) {
					index = currentIndex - this.widthInTiles;
					if(distances[index] == -1) {
						distances[index] = distance;
						neighbors.push(index);
					}
				}
				if(right) {
					index = currentIndex + 1;
					if(distances[index] == -1) {
						distances[index] = distance;
						neighbors.push(index);
					}
				}
				if(down) {
					index = currentIndex + this.widthInTiles;
					if(distances[index] == -1) {
						distances[index] = distance;
						neighbors.push(index);
					}
				}
				if(left) {
					index = currentIndex - 1;
					if(distances[index] == -1) {
						distances[index] = distance;
						neighbors.push(index);
					}
				}
				if(DiagonalPolicy != 0) {
					var wideDiagonal = DiagonalPolicy == 2;
					if(up && right) {
						index = currentIndex - this.widthInTiles + 1;
						if(wideDiagonal && distances[index] == -1 && distances[currentIndex - this.widthInTiles] >= -1 && distances[currentIndex + 1] >= -1) {
							distances[index] = distance;
							neighbors.push(index);
						} else if(!wideDiagonal && distances[index] == -1) {
							distances[index] = distance;
							neighbors.push(index);
						}
					}
					if(right && down) {
						index = currentIndex + this.widthInTiles + 1;
						if(wideDiagonal && distances[index] == -1 && distances[currentIndex + this.widthInTiles] >= -1 && distances[currentIndex + 1] >= -1) {
							distances[index] = distance;
							neighbors.push(index);
						} else if(!wideDiagonal && distances[index] == -1) {
							distances[index] = distance;
							neighbors.push(index);
						}
					}
					if(left && down) {
						index = currentIndex + this.widthInTiles - 1;
						if(wideDiagonal && distances[index] == -1 && distances[currentIndex + this.widthInTiles] >= -1 && distances[currentIndex - 1] >= -1) {
							distances[index] = distance;
							neighbors.push(index);
						} else if(!wideDiagonal && distances[index] == -1) {
							distances[index] = distance;
							neighbors.push(index);
						}
					}
					if(up && left) {
						index = currentIndex - this.widthInTiles - 1;
						if(wideDiagonal && distances[index] == -1 && distances[currentIndex - this.widthInTiles] >= -1 && distances[currentIndex - 1] >= -1) {
							distances[index] = distance;
							neighbors.push(index);
						} else if(!wideDiagonal && distances[index] == -1) {
							distances[index] = distance;
							neighbors.push(index);
						}
					}
				}
			}
			++distance;
		}
		if(!foundEnd) {
			distances = null;
		}
		return distances;
	}
	,walkPath: function(Data,Start,Points) {
		Points.push(this.getTileCoordsByIndex(Start));
		if(Data[Start] == 0) {
			return;
		}
		var left = Start % this.widthInTiles > 0;
		var right = Start % this.widthInTiles < this.widthInTiles - 1;
		var up = Start / this.widthInTiles > 0;
		var down = Start / this.widthInTiles < this.heightInTiles - 1;
		var current = Data[Start];
		var i;
		if(up) {
			i = Start - this.widthInTiles;
			if(i >= 0 && Data[i] >= 0 && Data[i] < current) {
				this.walkPath(Data,i,Points);
				return;
			}
		}
		if(right) {
			i = Start + 1;
			if(i >= 0 && Data[i] >= 0 && Data[i] < current) {
				this.walkPath(Data,i,Points);
				return;
			}
		}
		if(down) {
			i = Start + this.widthInTiles;
			if(i >= 0 && Data[i] >= 0 && Data[i] < current) {
				this.walkPath(Data,i,Points);
				return;
			}
		}
		if(left) {
			i = Start - 1;
			if(i >= 0 && Data[i] >= 0 && Data[i] < current) {
				this.walkPath(Data,i,Points);
				return;
			}
		}
		if(up && right) {
			i = Start - this.widthInTiles + 1;
			if(i >= 0 && Data[i] >= 0 && Data[i] < current) {
				this.walkPath(Data,i,Points);
				return;
			}
		}
		if(right && down) {
			i = Start + this.widthInTiles + 1;
			if(i >= 0 && Data[i] >= 0 && Data[i] < current) {
				this.walkPath(Data,i,Points);
				return;
			}
		}
		if(left && down) {
			i = Start + this.widthInTiles - 1;
			if(i >= 0 && Data[i] >= 0 && Data[i] < current) {
				this.walkPath(Data,i,Points);
				return;
			}
		}
		if(up && left) {
			i = Start - this.widthInTiles - 1;
			if(i >= 0 && Data[i] >= 0 && Data[i] < current) {
				this.walkPath(Data,i,Points);
				return;
			}
		}
	}
	,simplifyPath: function(Points) {
		var deltaPrevious;
		var deltaNext;
		var last = Points[0];
		var node;
		var i = 1;
		var l = Points.length - 1;
		while(i < l) {
			node = Points[i];
			deltaPrevious = (node.x - last.x) / (node.y - last.y);
			deltaNext = (node.x - Points[i + 1].x) / (node.y - Points[i + 1].y);
			if(last.x == Points[i + 1].x || last.y == Points[i + 1].y || deltaPrevious == deltaNext) {
				Points[i] = null;
			} else {
				last = node;
			}
			++i;
		}
	}
	,raySimplifyPath: function(Points) {
		var source = Points[0];
		var lastIndex = -1;
		var node;
		var i = 1;
		var l = Points.length;
		while(i < l) {
			node = Points[i++];
			if(node == null) {
				continue;
			}
			if(this.ray(source,node,this._point)) {
				if(lastIndex >= 0) {
					Points[lastIndex] = null;
				}
			} else {
				source = Points[lastIndex];
			}
			lastIndex = i - 1;
		}
	}
	,overlaps: function(ObjectOrGroup,InScreenSpace,Camera) {
		if(InScreenSpace == null) {
			InScreenSpace = false;
		}
		var group = flixel_group_FlxTypedGroup.resolveGroup(ObjectOrGroup);
		if(group != null) {
			return flixel_group_FlxTypedGroup.overlaps($bind(this,this.tilemapOverlapsCallback),group,0,0,InScreenSpace,Camera);
		} else if(ObjectOrGroup.flixelType == 1 || ObjectOrGroup.flixelType == 3 ? this.overlapsWithCallback(ObjectOrGroup) : this.overlaps(ObjectOrGroup,false,null)) {
			return true;
		}
		return false;
	}
	,tilemapOverlapsCallback: function(ObjectOrGroup,X,Y,InScreenSpace,Camera) {
		if(InScreenSpace == null) {
			InScreenSpace = false;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		if(ObjectOrGroup.flixelType == 1 || ObjectOrGroup.flixelType == 3) {
			return this.overlapsWithCallback(ObjectOrGroup);
		} else {
			return this.overlaps(ObjectOrGroup,InScreenSpace,Camera);
		}
	}
	,overlapsAt: function(X,Y,ObjectOrGroup,InScreenSpace,Camera) {
		if(InScreenSpace == null) {
			InScreenSpace = false;
		}
		var group = flixel_group_FlxTypedGroup.resolveGroup(ObjectOrGroup);
		if(group != null) {
			return flixel_group_FlxTypedGroup.overlaps($bind(this,this.tilemapOverlapsAtCallback),group,X,Y,InScreenSpace,Camera);
		} else if(ObjectOrGroup.flixelType == 1 || ObjectOrGroup.flixelType == 3 ? this.overlapsWithCallback(ObjectOrGroup,null,false,this._point.set(X,Y)) : this.overlapsAt(X,Y,ObjectOrGroup,InScreenSpace,Camera)) {
			return true;
		}
		return false;
	}
	,tilemapOverlapsAtCallback: function(ObjectOrGroup,X,Y,InScreenSpace,Camera) {
		if(ObjectOrGroup.flixelType == 1 || ObjectOrGroup.flixelType == 3) {
			return this.overlapsWithCallback(ObjectOrGroup,null,false,this._point.set(X,Y));
		} else {
			return this.overlapsAt(X,Y,ObjectOrGroup,InScreenSpace,Camera);
		}
	}
	,overlapsPoint: function(WorldPoint,InScreenSpace,Camera) {
		if(InScreenSpace == null) {
			InScreenSpace = false;
		}
		if(InScreenSpace) {
			if(Camera == null) {
				Camera = flixel_FlxG.camera;
			}
			WorldPoint.subtractPoint(Camera.scroll);
			if(WorldPoint._weak) {
				WorldPoint.put();
			}
		}
		return this.tileAtPointAllowsCollisions(WorldPoint);
	}
	,tileAtPointAllowsCollisions: function(point) {
		var tileIndex = this.getTileIndexByCoords(point);
		if(tileIndex < 0 || tileIndex >= this._data.length) {
			return false;
		}
		return this._tileObjects[this._data[tileIndex]].allowCollisions > 0;
	}
	,getBounds: function(Bounds) {
		if(Bounds == null) {
			var _this = flixel_math_FlxRect._pool.get();
			var X = 0;
			var Y = 0;
			var Width = 0;
			var Height = 0;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			_this.x = X;
			_this.y = Y;
			_this.width = Width;
			_this.height = Height;
			var rect = _this;
			rect._inPool = false;
			Bounds = rect;
		}
		var X = this.x;
		var Y = this.y;
		var Width = this.get_width();
		var Height = this.get_height();
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		Bounds.x = X;
		Bounds.y = Y;
		Bounds.width = Width;
		Bounds.height = Height;
		return Bounds;
	}
	,__class__: flixel_tile_FlxBaseTilemap
});
var flixel_tile_FlxTilemapAutoTiling = $hxEnums["flixel.tile.FlxTilemapAutoTiling"] = { __ename__ : "flixel.tile.FlxTilemapAutoTiling", __constructs__ : ["OFF","AUTO","ALT","FULL"]
	,OFF: {_hx_index:0,__enum__:"flixel.tile.FlxTilemapAutoTiling",toString:$estr}
	,AUTO: {_hx_index:1,__enum__:"flixel.tile.FlxTilemapAutoTiling",toString:$estr}
	,ALT: {_hx_index:2,__enum__:"flixel.tile.FlxTilemapAutoTiling",toString:$estr}
	,FULL: {_hx_index:3,__enum__:"flixel.tile.FlxTilemapAutoTiling",toString:$estr}
};
var flixel_tile_FlxTileblock = function(X,Y,Width,Height) {
	flixel_FlxSprite.call(this,X,Y);
	this.makeGraphic(Width,Height,0,true);
	this.set_active(false);
	this.set_immovable(true);
	this.set_moves(false);
};
$hxClasses["flixel.tile.FlxTileblock"] = flixel_tile_FlxTileblock;
flixel_tile_FlxTileblock.__name__ = "flixel.tile.FlxTileblock";
flixel_tile_FlxTileblock.__super__ = flixel_FlxSprite;
flixel_tile_FlxTileblock.prototype = $extend(flixel_FlxSprite.prototype,{
	tileSprite: null
	,destroy: function() {
		this.tileSprite = flixel_util_FlxDestroyUtil.destroy(this.tileSprite);
		flixel_FlxSprite.prototype.destroy.call(this);
	}
	,loadFrames: function(tileFrames,empties) {
		if(empties == null) {
			empties = 0;
		}
		if(tileFrames == null) {
			return this;
		}
		this.tileSprite = this.tileSprite == null ? new flixel_FlxSprite() : this.tileSprite;
		this.tileSprite.set_frames(tileFrames);
		var spriteWidth = this.tileSprite.get_width() | 0;
		var spriteHeight = this.tileSprite.get_height() | 0;
		var total = this.tileSprite.numFrames + empties;
		var regen = false;
		if(this.get_width() % this.tileSprite.get_width() != 0) {
			this.set_width((this.get_width() / spriteWidth + 1 | 0) * spriteWidth);
			regen = true;
		}
		if(this.get_height() % this.tileSprite.get_height() != 0) {
			this.set_height((this.get_height() / spriteHeight + 1 | 0) * spriteHeight);
			regen = true;
		}
		if(regen) {
			this.makeGraphic(this.get_width() | 0,this.get_height() | 0,0,true);
		} else {
			flixel_util_FlxSpriteUtil.fill(this,0);
		}
		var row = 0;
		var column;
		var destinationX;
		var destinationY = 0;
		var widthInTiles = this.get_width() / spriteWidth | 0;
		var heightInTiles = this.get_height() / spriteHeight | 0;
		while(row < heightInTiles) {
			destinationX = 0;
			column = 0;
			while(column < widthInTiles) {
				if(flixel_FlxG.random.float() * total > empties) {
					this.tileSprite.animation.randomFrame();
					this.tileSprite.drawFrame();
					this.stamp(this.tileSprite,destinationX,destinationY);
				}
				destinationX += spriteWidth;
				++column;
			}
			destinationY += spriteHeight;
			++row;
		}
		this.dirty = true;
		return this;
	}
	,loadTiles: function(TileGraphic,TileWidth,TileHeight,Empties) {
		if(Empties == null) {
			Empties = 0;
		}
		if(TileHeight == null) {
			TileHeight = 0;
		}
		if(TileWidth == null) {
			TileWidth = 0;
		}
		if(TileGraphic == null) {
			return this;
		}
		var graph = flixel_FlxG.bitmap.add(TileGraphic);
		if(graph == null) {
			return this;
		}
		if(TileWidth == 0) {
			TileWidth = graph.height;
			if(TileWidth > graph.width) {
				TileWidth = graph.width;
			}
		}
		if(TileHeight == 0) {
			TileHeight = TileWidth;
			if(TileHeight > graph.height) {
				TileHeight = graph.height;
			}
		}
		var X = TileWidth;
		var Y = TileHeight;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		var tileFrames = flixel_graphics_frames_FlxTileFrames.fromGraphic(graph,point);
		return this.loadFrames(tileFrames,Empties);
	}
	,setTile: function(x,y,index) {
		this.tileSprite.animation.set_frameIndex(index);
		this.stamp(this.tileSprite,x * (this.tileSprite.get_width() | 0),y * (this.tileSprite.get_height() | 0));
		this.dirty = true;
	}
	,__class__: flixel_tile_FlxTileblock
});
var flixel_tweens_FlxEase = function() { };
$hxClasses["flixel.tweens.FlxEase"] = flixel_tweens_FlxEase;
flixel_tweens_FlxEase.__name__ = "flixel.tweens.FlxEase";
flixel_tweens_FlxEase.linear = function(t) {
	return t;
};
flixel_tweens_FlxEase.quadIn = function(t) {
	return t * t;
};
flixel_tweens_FlxEase.quadOut = function(t) {
	return -t * (t - 2);
};
flixel_tweens_FlxEase.quadInOut = function(t) {
	if(t <= .5) {
		return t * t * 2;
	} else {
		return 1 - --t * t * 2;
	}
};
flixel_tweens_FlxEase.cubeIn = function(t) {
	return t * t * t;
};
flixel_tweens_FlxEase.cubeOut = function(t) {
	return 1 + --t * t * t;
};
flixel_tweens_FlxEase.cubeInOut = function(t) {
	if(t <= .5) {
		return t * t * t * 4;
	} else {
		return 1 + --t * t * t * 4;
	}
};
flixel_tweens_FlxEase.quartIn = function(t) {
	return t * t * t * t;
};
flixel_tweens_FlxEase.quartOut = function(t) {
	return 1 - --t * t * t * t;
};
flixel_tweens_FlxEase.quartInOut = function(t) {
	if(t <= .5) {
		return t * t * t * t * 8;
	} else {
		t = t * 2 - 2;
		return (1 - t * t * t * t) / 2 + .5;
	}
};
flixel_tweens_FlxEase.quintIn = function(t) {
	return t * t * t * t * t;
};
flixel_tweens_FlxEase.quintOut = function(t) {
	return --t * t * t * t * t + 1;
};
flixel_tweens_FlxEase.quintInOut = function(t) {
	if((t *= 2) < 1) {
		return t * t * t * t * t / 2;
	} else {
		return ((t -= 2) * t * t * t * t + 2) / 2;
	}
};
flixel_tweens_FlxEase.smoothStepIn = function(t) {
	var t1 = t / 2;
	return 2 * (t1 * t1 * (t1 * -2 + 3));
};
flixel_tweens_FlxEase.smoothStepOut = function(t) {
	var t1 = t / 2 + 0.5;
	return 2 * (t1 * t1 * (t1 * -2 + 3)) - 1;
};
flixel_tweens_FlxEase.smoothStepInOut = function(t) {
	return t * t * (t * -2 + 3);
};
flixel_tweens_FlxEase.smootherStepIn = function(t) {
	var t1 = t / 2;
	return 2 * (t1 * t1 * t1 * (t1 * (t1 * 6 - 15) + 10));
};
flixel_tweens_FlxEase.smootherStepOut = function(t) {
	var t1 = t / 2 + 0.5;
	return 2 * (t1 * t1 * t1 * (t1 * (t1 * 6 - 15) + 10)) - 1;
};
flixel_tweens_FlxEase.smootherStepInOut = function(t) {
	return t * t * t * (t * (t * 6 - 15) + 10);
};
flixel_tweens_FlxEase.sineIn = function(t) {
	return -Math.cos(flixel_tweens_FlxEase.PI2 * t) + 1;
};
flixel_tweens_FlxEase.sineOut = function(t) {
	return Math.sin(flixel_tweens_FlxEase.PI2 * t);
};
flixel_tweens_FlxEase.sineInOut = function(t) {
	return -Math.cos(Math.PI * t) / 2 + .5;
};
flixel_tweens_FlxEase.bounceIn = function(t) {
	t = 1 - t;
	if(t < flixel_tweens_FlxEase.B1) {
		return 1 - 7.5625 * t * t;
	}
	if(t < flixel_tweens_FlxEase.B2) {
		return 1 - (7.5625 * (t - flixel_tweens_FlxEase.B3) * (t - flixel_tweens_FlxEase.B3) + .75);
	}
	if(t < flixel_tweens_FlxEase.B4) {
		return 1 - (7.5625 * (t - flixel_tweens_FlxEase.B5) * (t - flixel_tweens_FlxEase.B5) + .9375);
	}
	return 1 - (7.5625 * (t - flixel_tweens_FlxEase.B6) * (t - flixel_tweens_FlxEase.B6) + .984375);
};
flixel_tweens_FlxEase.bounceOut = function(t) {
	if(t < flixel_tweens_FlxEase.B1) {
		return 7.5625 * t * t;
	}
	if(t < flixel_tweens_FlxEase.B2) {
		return 7.5625 * (t - flixel_tweens_FlxEase.B3) * (t - flixel_tweens_FlxEase.B3) + .75;
	}
	if(t < flixel_tweens_FlxEase.B4) {
		return 7.5625 * (t - flixel_tweens_FlxEase.B5) * (t - flixel_tweens_FlxEase.B5) + .9375;
	}
	return 7.5625 * (t - flixel_tweens_FlxEase.B6) * (t - flixel_tweens_FlxEase.B6) + .984375;
};
flixel_tweens_FlxEase.bounceInOut = function(t) {
	if(t < .5) {
		t = 1 - t * 2;
		if(t < flixel_tweens_FlxEase.B1) {
			return (1 - 7.5625 * t * t) / 2;
		}
		if(t < flixel_tweens_FlxEase.B2) {
			return (1 - (7.5625 * (t - flixel_tweens_FlxEase.B3) * (t - flixel_tweens_FlxEase.B3) + .75)) / 2;
		}
		if(t < flixel_tweens_FlxEase.B4) {
			return (1 - (7.5625 * (t - flixel_tweens_FlxEase.B5) * (t - flixel_tweens_FlxEase.B5) + .9375)) / 2;
		}
		return (1 - (7.5625 * (t - flixel_tweens_FlxEase.B6) * (t - flixel_tweens_FlxEase.B6) + .984375)) / 2;
	}
	t = t * 2 - 1;
	if(t < flixel_tweens_FlxEase.B1) {
		return 7.5625 * t * t / 2 + .5;
	}
	if(t < flixel_tweens_FlxEase.B2) {
		return (7.5625 * (t - flixel_tweens_FlxEase.B3) * (t - flixel_tweens_FlxEase.B3) + .75) / 2 + .5;
	}
	if(t < flixel_tweens_FlxEase.B4) {
		return (7.5625 * (t - flixel_tweens_FlxEase.B5) * (t - flixel_tweens_FlxEase.B5) + .9375) / 2 + .5;
	}
	return (7.5625 * (t - flixel_tweens_FlxEase.B6) * (t - flixel_tweens_FlxEase.B6) + .984375) / 2 + .5;
};
flixel_tweens_FlxEase.circIn = function(t) {
	return -(Math.sqrt(1 - t * t) - 1);
};
flixel_tweens_FlxEase.circOut = function(t) {
	return Math.sqrt(1 - (t - 1) * (t - 1));
};
flixel_tweens_FlxEase.circInOut = function(t) {
	if(t <= .5) {
		return (Math.sqrt(1 - t * t * 4) - 1) / -2;
	} else {
		return (Math.sqrt(1 - (t * 2 - 2) * (t * 2 - 2)) + 1) / 2;
	}
};
flixel_tweens_FlxEase.expoIn = function(t) {
	return Math.pow(2,10 * (t - 1));
};
flixel_tweens_FlxEase.expoOut = function(t) {
	return -Math.pow(2,-10 * t) + 1;
};
flixel_tweens_FlxEase.expoInOut = function(t) {
	if(t < .5) {
		return Math.pow(2,10 * (t * 2 - 1)) / 2;
	} else {
		return (-Math.pow(2,-10 * (t * 2 - 1)) + 2) / 2;
	}
};
flixel_tweens_FlxEase.backIn = function(t) {
	return t * t * (2.70158 * t - 1.70158);
};
flixel_tweens_FlxEase.backOut = function(t) {
	return 1 - --t * t * (-2.70158 * t - 1.70158);
};
flixel_tweens_FlxEase.backInOut = function(t) {
	t *= 2;
	if(t < 1) {
		return t * t * (2.70158 * t - 1.70158) / 2;
	}
	--t;
	return (1 - --t * t * (-2.70158 * t - 1.70158)) / 2 + .5;
};
flixel_tweens_FlxEase.elasticIn = function(t) {
	return -(flixel_tweens_FlxEase.ELASTIC_AMPLITUDE * Math.pow(2,10 * --t) * Math.sin((t - flixel_tweens_FlxEase.ELASTIC_PERIOD / (2 * Math.PI) * Math.asin(1 / flixel_tweens_FlxEase.ELASTIC_AMPLITUDE)) * (2 * Math.PI) / flixel_tweens_FlxEase.ELASTIC_PERIOD));
};
flixel_tweens_FlxEase.elasticOut = function(t) {
	return flixel_tweens_FlxEase.ELASTIC_AMPLITUDE * Math.pow(2,-10 * t) * Math.sin((t - flixel_tweens_FlxEase.ELASTIC_PERIOD / (2 * Math.PI) * Math.asin(1 / flixel_tweens_FlxEase.ELASTIC_AMPLITUDE)) * (2 * Math.PI) / flixel_tweens_FlxEase.ELASTIC_PERIOD) + 1;
};
flixel_tweens_FlxEase.elasticInOut = function(t) {
	if(t < 0.5) {
		return -0.5 * (Math.pow(2,10 * (t -= 0.5)) * Math.sin((t - flixel_tweens_FlxEase.ELASTIC_PERIOD / 4) * (2 * Math.PI) / flixel_tweens_FlxEase.ELASTIC_PERIOD));
	}
	return Math.pow(2,-10 * (t -= 0.5)) * Math.sin((t - flixel_tweens_FlxEase.ELASTIC_PERIOD / 4) * (2 * Math.PI) / flixel_tweens_FlxEase.ELASTIC_PERIOD) * 0.5 + 1;
};
var flixel_tweens_FlxTween = function(Options,manager) {
	this._waitingForRestart = false;
	this._running = false;
	this._delayToUse = 0;
	this._secondsSinceStart = 0;
	this.loopDelay = 0;
	this.startDelay = 0;
	this.executions = 0;
	this.scale = 0;
	this.duration = 0;
	this.active = false;
	Options = this.resolveTweenOptions(Options);
	this.set_type(Options.type);
	this.onStart = Options.onStart;
	this.onUpdate = Options.onUpdate;
	this.onComplete = Options.onComplete;
	this.ease = Options.ease;
	this.setDelays(Options.startDelay,Options.loopDelay);
	this.manager = manager != null ? manager : flixel_tweens_FlxTween.globalManager;
};
$hxClasses["flixel.tweens.FlxTween"] = flixel_tweens_FlxTween;
flixel_tweens_FlxTween.__name__ = "flixel.tweens.FlxTween";
flixel_tweens_FlxTween.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_tweens_FlxTween.globalManager = null;
flixel_tweens_FlxTween.tween = function(Object1,Values,Duration,Options) {
	if(Duration == null) {
		Duration = 1;
	}
	return flixel_tweens_FlxTween.globalManager.tween(Object1,Values,Duration,Options);
};
flixel_tweens_FlxTween.num = function(FromValue,ToValue,Duration,Options,TweenFunction) {
	if(Duration == null) {
		Duration = 1;
	}
	return flixel_tweens_FlxTween.globalManager.num(FromValue,ToValue,Duration,Options,TweenFunction);
};
flixel_tweens_FlxTween.angle = function(Sprite,FromAngle,ToAngle,Duration,Options) {
	if(Duration == null) {
		Duration = 1;
	}
	return flixel_tweens_FlxTween.globalManager.angle(Sprite,FromAngle,ToAngle,Duration,Options);
};
flixel_tweens_FlxTween.color = function(Sprite,Duration,FromColor,ToColor,Options) {
	if(Duration == null) {
		Duration = 1;
	}
	return flixel_tweens_FlxTween.globalManager.color(Sprite,Duration,FromColor,ToColor,Options);
};
flixel_tweens_FlxTween.linearMotion = function(Object1,FromX,FromY,ToX,ToY,DurationOrSpeed,UseDuration,Options) {
	if(UseDuration == null) {
		UseDuration = true;
	}
	if(DurationOrSpeed == null) {
		DurationOrSpeed = 1;
	}
	return flixel_tweens_FlxTween.globalManager.linearMotion(Object1,FromX,FromY,ToX,ToY,DurationOrSpeed,UseDuration,Options);
};
flixel_tweens_FlxTween.quadMotion = function(Object1,FromX,FromY,ControlX,ControlY,ToX,ToY,DurationOrSpeed,UseDuration,Options) {
	if(UseDuration == null) {
		UseDuration = true;
	}
	if(DurationOrSpeed == null) {
		DurationOrSpeed = 1;
	}
	return flixel_tweens_FlxTween.globalManager.quadMotion(Object1,FromX,FromY,ControlX,ControlY,ToX,ToY,DurationOrSpeed,UseDuration,Options);
};
flixel_tweens_FlxTween.cubicMotion = function(Object1,FromX,FromY,aX,aY,bX,bY,ToX,ToY,Duration,Options) {
	if(Duration == null) {
		Duration = 1;
	}
	return flixel_tweens_FlxTween.globalManager.cubicMotion(Object1,FromX,FromY,aX,aY,bX,bY,ToX,ToY,Duration,Options);
};
flixel_tweens_FlxTween.circularMotion = function(Object1,CenterX,CenterY,Radius,Angle,Clockwise,DurationOrSpeed,UseDuration,Options) {
	if(UseDuration == null) {
		UseDuration = true;
	}
	if(DurationOrSpeed == null) {
		DurationOrSpeed = 1;
	}
	return flixel_tweens_FlxTween.globalManager.circularMotion(Object1,CenterX,CenterY,Radius,Angle,Clockwise,DurationOrSpeed,UseDuration,Options);
};
flixel_tweens_FlxTween.linearPath = function(Object1,Points,DurationOrSpeed,UseDuration,Options) {
	if(UseDuration == null) {
		UseDuration = true;
	}
	if(DurationOrSpeed == null) {
		DurationOrSpeed = 1;
	}
	return flixel_tweens_FlxTween.globalManager.linearPath(Object1,Points,DurationOrSpeed,UseDuration,Options);
};
flixel_tweens_FlxTween.quadPath = function(Object1,Points,DurationOrSpeed,UseDuration,Options) {
	if(UseDuration == null) {
		UseDuration = true;
	}
	if(DurationOrSpeed == null) {
		DurationOrSpeed = 1;
	}
	return flixel_tweens_FlxTween.globalManager.quadPath(Object1,Points,DurationOrSpeed,UseDuration,Options);
};
flixel_tweens_FlxTween.cancelTweensOf = function(Object1,FieldPaths) {
	flixel_tweens_FlxTween.globalManager.cancelTweensOf(Object1,FieldPaths);
};
flixel_tweens_FlxTween.completeTweensOf = function(Object1,FieldPaths) {
	flixel_tweens_FlxTween.globalManager.completeTweensOf(Object1,FieldPaths);
};
flixel_tweens_FlxTween.prototype = {
	manager: null
	,active: null
	,duration: null
	,ease: null
	,onStart: null
	,onUpdate: null
	,onComplete: null
	,type: null
	,finished: null
	,scale: null
	,backward: null
	,executions: null
	,startDelay: null
	,loopDelay: null
	,_secondsSinceStart: null
	,_delayToUse: null
	,_running: null
	,_waitingForRestart: null
	,_chainedTweens: null
	,_nextTweenInChain: null
	,resolveTweenOptions: function(Options) {
		if(Options == null) {
			Options = { type : 8};
		}
		if(Options.type == null) {
			Options.type = 8;
		}
		return Options;
	}
	,destroy: function() {
		this.onStart = null;
		this.onUpdate = null;
		this.onComplete = null;
		this.ease = null;
		this.manager = null;
		this._chainedTweens = null;
		this._nextTweenInChain = null;
	}
	,then: function(tween) {
		return this.addChainedTween(tween);
	}
	,wait: function(delay) {
		return this.addChainedTween(flixel_tweens_FlxTween.num(0,0,delay));
	}
	,addChainedTween: function(tween) {
		tween.setVarsOnEnd();
		tween.manager.remove(tween,false);
		if(this._chainedTweens == null) {
			this._chainedTweens = [];
		}
		this._chainedTweens.push(tween);
		return this;
	}
	,update: function(elapsed) {
		this._secondsSinceStart += elapsed;
		var delay = this.executions > 0 ? this.loopDelay : this.startDelay;
		if(this._secondsSinceStart < delay) {
			return;
		}
		this.scale = Math.max(this._secondsSinceStart - delay,0) / this.duration;
		if(this.ease != null) {
			this.scale = this.ease(this.scale);
		}
		if(this.backward) {
			this.scale = 1 - this.scale;
		}
		if(this._secondsSinceStart > delay && !this._running) {
			this._running = true;
			if(this.onStart != null) {
				this.onStart(this);
			}
		}
		if(this._secondsSinceStart >= this.duration + delay) {
			this.scale = this.backward ? 0 : 1;
			this.finished = true;
		} else if(this.onUpdate != null) {
			this.onUpdate(this);
		}
	}
	,start: function() {
		this._waitingForRestart = false;
		this._secondsSinceStart = 0;
		this._delayToUse = this.executions > 0 ? this.loopDelay : this.startDelay;
		if(this.duration == 0) {
			this.set_active(false);
			return this;
		}
		this.set_active(true);
		this._running = false;
		this.finished = false;
		return this;
	}
	,cancel: function() {
		this.onEnd();
		if(this.manager != null) {
			this.manager.remove(this);
		}
	}
	,cancelChain: function() {
		if(this._nextTweenInChain != null) {
			this._nextTweenInChain.cancelChain();
		}
		if(this._chainedTweens != null) {
			this._chainedTweens = null;
		}
		this.cancel();
	}
	,finish: function() {
		this.executions++;
		if(this.onComplete != null) {
			this.onComplete(this);
		}
		var type = this.type & ~16;
		if(type == 1 || type == 8) {
			this.onEnd();
			this._secondsSinceStart = this.duration + this.startDelay;
			if(type == 8 && this.manager != null) {
				this.manager.remove(this);
			}
		}
		if(type == 2 || type == 4) {
			this._secondsSinceStart = (this._secondsSinceStart - this._delayToUse) % this.duration + this._delayToUse;
			this.scale = Math.max(this._secondsSinceStart - this._delayToUse,0) / this.duration;
			if(this.ease != null && this.scale > 0 && this.scale < 1) {
				this.scale = this.ease(this.scale);
			}
			if(type == 4) {
				this.backward = !this.backward;
				if(this.backward) {
					this.scale = 1 - this.scale;
				}
			}
			this.restart();
		}
	}
	,onEnd: function() {
		this.setVarsOnEnd();
		this.processTweenChain();
	}
	,setVarsOnEnd: function() {
		this.set_active(false);
		this._running = false;
		this.finished = true;
	}
	,processTweenChain: function() {
		if(this._chainedTweens == null || this._chainedTweens.length <= 0) {
			return;
		}
		this._nextTweenInChain = this._chainedTweens.shift();
		this.doNextTween(this._nextTweenInChain);
		this._chainedTweens = null;
	}
	,doNextTween: function(tween) {
		if(!tween.active) {
			tween.start();
			this.manager.add_flixel_tweens_FlxTween(tween);
		}
		tween.setChain(this._chainedTweens);
	}
	,setChain: function(previousChain) {
		if(previousChain == null) {
			return;
		}
		if(this._chainedTweens == null) {
			this._chainedTweens = previousChain;
		} else {
			this._chainedTweens = this._chainedTweens.concat(previousChain);
		}
	}
	,restart: function() {
		if(this.active) {
			this.start();
		} else {
			this._waitingForRestart = true;
		}
	}
	,isTweenOf: function(Object1,Field) {
		return false;
	}
	,setDelays: function(StartDelay,LoopDelay) {
		this.set_startDelay(StartDelay != null ? StartDelay : 0);
		this.set_loopDelay(LoopDelay != null ? LoopDelay : 0);
		return this;
	}
	,set_startDelay: function(value) {
		var dly = Math.abs(value);
		if(this.executions == 0) {
			this._delayToUse = dly;
		}
		return this.startDelay = dly;
	}
	,set_loopDelay: function(value) {
		var dly = Math.abs(value);
		if(this.executions > 0) {
			this._secondsSinceStart = this.duration * (Math.max(this._secondsSinceStart - this._delayToUse,0) / this.duration) + Math.max(dly - this.loopDelay,0);
			this._delayToUse = dly;
		}
		return this.loopDelay = dly;
	}
	,get_percent: function() {
		return Math.max(this._secondsSinceStart - this._delayToUse,0) / this.duration;
	}
	,set_percent: function(value) {
		return this._secondsSinceStart = this.duration * value + this._delayToUse;
	}
	,set_type: function(value) {
		if(value == 0) {
			value = 8;
		} else if(value == 16) {
			value = 1 | 16;
		}
		this.backward = (value & 16) > 0;
		return this.type = value;
	}
	,set_active: function(active) {
		this.active = active;
		if(this._waitingForRestart) {
			this.restart();
		}
		return active;
	}
	,__class__: flixel_tweens_FlxTween
	,__properties__: {set_loopDelay:"set_loopDelay",set_startDelay:"set_startDelay",set_percent:"set_percent",get_percent:"get_percent",set_type:"set_type",set_active:"set_active"}
};
var flixel_tweens_FlxTweenManager = function() {
	this._tweens = [];
	flixel_FlxBasic.call(this);
	this.set_visible(false);
	flixel_FlxG.signals.preStateSwitch.add($bind(this,this.clear));
};
$hxClasses["flixel.tweens.FlxTweenManager"] = flixel_tweens_FlxTweenManager;
flixel_tweens_FlxTweenManager.__name__ = "flixel.tweens.FlxTweenManager";
flixel_tweens_FlxTweenManager.__super__ = flixel_FlxBasic;
flixel_tweens_FlxTweenManager.prototype = $extend(flixel_FlxBasic.prototype,{
	add_flixel_tweens_motion_QuadPath: function(Tween,Start) {
		if(Start == null) {
			Start = false;
		}
		if(Tween == null) {
			return null;
		}
		this._tweens.push(Tween);
		if(Start) {
			Tween.start();
		}
		return Tween;
	}
	,add_flixel_tweens_motion_LinearPath: function(Tween,Start) {
		if(Start == null) {
			Start = false;
		}
		if(Tween == null) {
			return null;
		}
		this._tweens.push(Tween);
		if(Start) {
			Tween.start();
		}
		return Tween;
	}
	,add_flixel_tweens_motion_CircularMotion: function(Tween,Start) {
		if(Start == null) {
			Start = false;
		}
		if(Tween == null) {
			return null;
		}
		this._tweens.push(Tween);
		if(Start) {
			Tween.start();
		}
		return Tween;
	}
	,add_flixel_tweens_motion_CubicMotion: function(Tween,Start) {
		if(Start == null) {
			Start = false;
		}
		if(Tween == null) {
			return null;
		}
		this._tweens.push(Tween);
		if(Start) {
			Tween.start();
		}
		return Tween;
	}
	,add_flixel_tweens_motion_QuadMotion: function(Tween,Start) {
		if(Start == null) {
			Start = false;
		}
		if(Tween == null) {
			return null;
		}
		this._tweens.push(Tween);
		if(Start) {
			Tween.start();
		}
		return Tween;
	}
	,add_flixel_tweens_misc_AngleTween: function(Tween,Start) {
		if(Start == null) {
			Start = false;
		}
		if(Tween == null) {
			return null;
		}
		this._tweens.push(Tween);
		if(Start) {
			Tween.start();
		}
		return Tween;
	}
	,add_flixel_tweens_motion_LinearMotion: function(Tween,Start) {
		if(Start == null) {
			Start = false;
		}
		if(Tween == null) {
			return null;
		}
		this._tweens.push(Tween);
		if(Start) {
			Tween.start();
		}
		return Tween;
	}
	,add_flixel_tweens_misc_ColorTween: function(Tween,Start) {
		if(Start == null) {
			Start = false;
		}
		if(Tween == null) {
			return null;
		}
		this._tweens.push(Tween);
		if(Start) {
			Tween.start();
		}
		return Tween;
	}
	,add_flixel_tweens_misc_VarTween: function(Tween,Start) {
		if(Start == null) {
			Start = false;
		}
		if(Tween == null) {
			return null;
		}
		this._tweens.push(Tween);
		if(Start) {
			Tween.start();
		}
		return Tween;
	}
	,add_flixel_tweens_misc_NumTween: function(Tween,Start) {
		if(Start == null) {
			Start = false;
		}
		if(Tween == null) {
			return null;
		}
		this._tweens.push(Tween);
		if(Start) {
			Tween.start();
		}
		return Tween;
	}
	,add_flixel_tweens_FlxTween: function(Tween,Start) {
		if(Start == null) {
			Start = false;
		}
		if(Tween == null) {
			return null;
		}
		this._tweens.push(Tween);
		if(Start) {
			Tween.start();
		}
		return Tween;
	}
	,_tweens: null
	,tween: function(Object1,Values,Duration,Options) {
		if(Duration == null) {
			Duration = 1;
		}
		var tween = new flixel_tweens_misc_VarTween(Options,this);
		tween.tween(Object1,Values,Duration);
		return this.add_flixel_tweens_misc_VarTween(tween);
	}
	,num: function(FromValue,ToValue,Duration,Options,TweenFunction) {
		if(Duration == null) {
			Duration = 1;
		}
		var tween = new flixel_tweens_misc_NumTween(Options,this);
		tween.tween(FromValue,ToValue,Duration,TweenFunction);
		return this.add_flixel_tweens_misc_NumTween(tween);
	}
	,angle: function(Sprite,FromAngle,ToAngle,Duration,Options) {
		if(Duration == null) {
			Duration = 1;
		}
		var tween = new flixel_tweens_misc_AngleTween(Options,this);
		tween.tween(FromAngle,ToAngle,Duration,Sprite);
		return this.add_flixel_tweens_misc_AngleTween(tween);
	}
	,color: function(Sprite,Duration,FromColor,ToColor,Options) {
		if(Duration == null) {
			Duration = 1;
		}
		var tween = new flixel_tweens_misc_ColorTween(Options,this);
		tween.tween(Duration,FromColor,ToColor,Sprite);
		return this.add_flixel_tweens_misc_ColorTween(tween);
	}
	,linearMotion: function(Object1,FromX,FromY,ToX,ToY,DurationOrSpeed,UseDuration,Options) {
		if(UseDuration == null) {
			UseDuration = true;
		}
		if(DurationOrSpeed == null) {
			DurationOrSpeed = 1;
		}
		var tween = new flixel_tweens_motion_LinearMotion(Options,this);
		tween.setObject(Object1);
		tween.setMotion(FromX,FromY,ToX,ToY,DurationOrSpeed,UseDuration);
		return this.add_flixel_tweens_motion_LinearMotion(tween);
	}
	,quadMotion: function(Object1,FromX,FromY,ControlX,ControlY,ToX,ToY,DurationOrSpeed,UseDuration,Options) {
		if(UseDuration == null) {
			UseDuration = true;
		}
		if(DurationOrSpeed == null) {
			DurationOrSpeed = 1;
		}
		var tween = new flixel_tweens_motion_QuadMotion(Options,this);
		tween.setObject(Object1);
		tween.setMotion(FromX,FromY,ControlX,ControlY,ToX,ToY,DurationOrSpeed,UseDuration);
		return this.add_flixel_tweens_motion_QuadMotion(tween);
	}
	,cubicMotion: function(Object1,FromX,FromY,aX,aY,bX,bY,ToX,ToY,Duration,Options) {
		if(Duration == null) {
			Duration = 1;
		}
		var tween = new flixel_tweens_motion_CubicMotion(Options,this);
		tween.setObject(Object1);
		tween.setMotion(FromX,FromY,aX,aY,bX,bY,ToX,ToY,Duration);
		return this.add_flixel_tweens_motion_CubicMotion(tween);
	}
	,circularMotion: function(Object1,CenterX,CenterY,Radius,Angle,Clockwise,DurationOrSpeed,UseDuration,Options) {
		if(UseDuration == null) {
			UseDuration = true;
		}
		if(DurationOrSpeed == null) {
			DurationOrSpeed = 1;
		}
		var tween = new flixel_tweens_motion_CircularMotion(Options,this);
		tween.setObject(Object1);
		tween.setMotion(CenterX,CenterY,Radius,Angle,Clockwise,DurationOrSpeed,UseDuration);
		return this.add_flixel_tweens_motion_CircularMotion(tween);
	}
	,linearPath: function(Object1,Points,DurationOrSpeed,UseDuration,Options) {
		if(UseDuration == null) {
			UseDuration = true;
		}
		if(DurationOrSpeed == null) {
			DurationOrSpeed = 1;
		}
		var tween = new flixel_tweens_motion_LinearPath(Options,this);
		if(Points != null) {
			var _g = 0;
			while(_g < Points.length) {
				var point = Points[_g];
				++_g;
				tween.addPoint(point.x,point.y);
			}
		}
		tween.setObject(Object1);
		tween.setMotion(DurationOrSpeed,UseDuration);
		return this.add_flixel_tweens_motion_LinearPath(tween);
	}
	,quadPath: function(Object1,Points,DurationOrSpeed,UseDuration,Options) {
		if(UseDuration == null) {
			UseDuration = true;
		}
		if(DurationOrSpeed == null) {
			DurationOrSpeed = 1;
		}
		var tween = new flixel_tweens_motion_QuadPath(Options,this);
		if(Points != null) {
			var _g = 0;
			while(_g < Points.length) {
				var point = Points[_g];
				++_g;
				tween.addPoint(point.x,point.y);
			}
		}
		tween.setObject(Object1);
		tween.setMotion(DurationOrSpeed,UseDuration);
		return this.add_flixel_tweens_motion_QuadPath(tween);
	}
	,destroy: function() {
		flixel_FlxBasic.prototype.destroy.call(this);
		flixel_FlxG.signals.preStateSwitch.remove($bind(this,this.clear));
	}
	,update: function(elapsed) {
		var finishedTweens = null;
		var _g = 0;
		var _g1 = this._tweens;
		while(_g < _g1.length) {
			var tween = _g1[_g];
			++_g;
			if(!tween.active) {
				continue;
			}
			tween.update(elapsed);
			if(tween.finished) {
				if(finishedTweens == null) {
					finishedTweens = [];
				}
				finishedTweens.push(tween);
			}
		}
		if(finishedTweens != null) {
			while(finishedTweens.length > 0) finishedTweens.shift().finish();
		}
	}
	,remove: function(Tween,Destroy) {
		if(Destroy == null) {
			Destroy = true;
		}
		if(Tween == null) {
			return null;
		}
		Tween.set_active(false);
		if(Destroy) {
			Tween.destroy();
		}
		var array = this._tweens;
		var index = array.indexOf(Tween);
		if(index != -1) {
			array[index] = array[array.length - 1];
			array.pop();
		}
		return Tween;
	}
	,clear: function() {
		var _g = 0;
		var _g1 = this._tweens;
		while(_g < _g1.length) {
			var tween = _g1[_g];
			++_g;
			if(tween != null) {
				tween.set_active(false);
				tween.destroy();
			}
		}
		this._tweens.splice(0,this._tweens.length);
	}
	,cancelTweensOf: function(Object1,FieldPaths) {
		this.forEachTweensOf(Object1,FieldPaths,function(tween) {
			tween.cancel();
		});
	}
	,completeTweensOf: function(Object1,FieldPaths) {
		this.forEachTweensOf(Object1,FieldPaths,function(tween) {
			if((tween.type & 2) == 0 && (tween.type & 4) == 0 && tween.active) {
				tween.update(1.79e+308);
			}
		});
	}
	,forEachTweensOf: function(Object1,FieldPaths,Function1) {
		if(Object1 == null) {
			throw haxe_Exception.thrown("Cannot cancel tween variables of an object that is null.");
		}
		if(FieldPaths == null || FieldPaths.length == 0) {
			var i = this._tweens.length;
			while(i-- > 0) {
				var tween = this._tweens[i];
				if(tween.isTweenOf(Object1)) {
					Function1(tween);
				}
			}
		} else {
			var propertyInfos = [];
			var _g = 0;
			while(_g < FieldPaths.length) {
				var fieldPath = FieldPaths[_g];
				++_g;
				var target = Object1;
				var path = fieldPath.split(".");
				var field = path.pop();
				var _g1 = 0;
				while(_g1 < path.length) {
					var component = path[_g1];
					++_g1;
					target = Reflect.getProperty(target,component);
					if(!Reflect.isObject(target)) {
						break;
					}
				}
				if(Reflect.isObject(target)) {
					propertyInfos.push({ object : target, field : field});
				}
			}
			var i = this._tweens.length;
			while(i-- > 0) {
				var tween = this._tweens[i];
				var _g = 0;
				while(_g < propertyInfos.length) {
					var info = propertyInfos[_g];
					++_g;
					if(tween.isTweenOf(info.object,info.field)) {
						Function1(tween);
						break;
					}
				}
			}
		}
	}
	,completeAll: function() {
		var _g = 0;
		var _g1 = this._tweens;
		while(_g < _g1.length) {
			var tween = _g1[_g];
			++_g;
			if((tween.type & 2) == 0 && (tween.type & 4) == 0 && tween.active) {
				tween.update(1.79e+308);
			}
		}
	}
	,forEach: function(Function1) {
		var _g = 0;
		var _g1 = this._tweens;
		while(_g < _g1.length) {
			var tween = _g1[_g];
			++_g;
			Function1(tween);
		}
	}
	,__class__: flixel_tweens_FlxTweenManager
});
var flixel_tweens_misc_AngleTween = function(Options,manager) {
	flixel_tweens_FlxTween.call(this,Options,manager);
};
$hxClasses["flixel.tweens.misc.AngleTween"] = flixel_tweens_misc_AngleTween;
flixel_tweens_misc_AngleTween.__name__ = "flixel.tweens.misc.AngleTween";
flixel_tweens_misc_AngleTween.__super__ = flixel_tweens_FlxTween;
flixel_tweens_misc_AngleTween.prototype = $extend(flixel_tweens_FlxTween.prototype,{
	angle: null
	,sprite: null
	,_start: null
	,_range: null
	,destroy: function() {
		flixel_tweens_FlxTween.prototype.destroy.call(this);
		this.sprite = null;
	}
	,tween: function(FromAngle,ToAngle,Duration,Sprite) {
		this._start = this.angle = FromAngle;
		this._range = ToAngle - this.angle;
		this.duration = Duration;
		this.sprite = Sprite;
		if(this.sprite != null) {
			this.sprite.set_angle(this.angle % 360);
		}
		this.start();
		return this;
	}
	,update: function(elapsed) {
		flixel_tweens_FlxTween.prototype.update.call(this,elapsed);
		this.angle = this._start + this._range * this.scale;
		if(this.sprite != null) {
			var spriteAngle = this.angle % 360;
			this.sprite.set_angle(spriteAngle);
		}
	}
	,isTweenOf: function(object,field) {
		if(this.sprite == object) {
			if(field != null) {
				return field == "angle";
			} else {
				return true;
			}
		} else {
			return false;
		}
	}
	,__class__: flixel_tweens_misc_AngleTween
});
var flixel_tweens_misc_ColorTween = function(Options,manager) {
	flixel_tweens_FlxTween.call(this,Options,manager);
};
$hxClasses["flixel.tweens.misc.ColorTween"] = flixel_tweens_misc_ColorTween;
flixel_tweens_misc_ColorTween.__name__ = "flixel.tweens.misc.ColorTween";
flixel_tweens_misc_ColorTween.__super__ = flixel_tweens_FlxTween;
flixel_tweens_misc_ColorTween.prototype = $extend(flixel_tweens_FlxTween.prototype,{
	color: null
	,startColor: null
	,endColor: null
	,sprite: null
	,destroy: function() {
		flixel_tweens_FlxTween.prototype.destroy.call(this);
		this.sprite = null;
	}
	,tween: function(Duration,FromColor,ToColor,Sprite) {
		this.color = this.startColor = FromColor;
		this.endColor = ToColor;
		this.duration = Duration;
		this.sprite = Sprite;
		this.start();
		return this;
	}
	,update: function(elapsed) {
		flixel_tweens_FlxTween.prototype.update.call(this,elapsed);
		var Color1 = this.startColor;
		var Color2 = this.endColor;
		var Factor = this.scale;
		if(Factor == null) {
			Factor = 0.5;
		}
		var r = ((Color2 >> 16 & 255) - (Color1 >> 16 & 255)) * Factor + (Color1 >> 16 & 255) | 0;
		var g = ((Color2 >> 8 & 255) - (Color1 >> 8 & 255)) * Factor + (Color1 >> 8 & 255) | 0;
		var b = ((Color2 & 255) - (Color1 & 255)) * Factor + (Color1 & 255) | 0;
		var a = ((Color2 >> 24 & 255) - (Color1 >> 24 & 255)) * Factor + (Color1 >> 24 & 255) | 0;
		var Alpha = a;
		if(Alpha == null) {
			Alpha = 255;
		}
		var color = flixel_util_FlxColor._new();
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 255;
		}
		color &= -16711681;
		color |= (r > 255 ? 255 : r < 0 ? 0 : r) << 16;
		color &= -65281;
		color |= (g > 255 ? 255 : g < 0 ? 0 : g) << 8;
		color &= -256;
		color |= b > 255 ? 255 : b < 0 ? 0 : b;
		color &= 16777215;
		color |= (Alpha1 > 255 ? 255 : Alpha1 < 0 ? 0 : Alpha1) << 24;
		this.color = color;
		if(this.sprite != null) {
			this.sprite.set_color(this.color);
			this.sprite.set_alpha((this.color >> 24 & 255) / 255);
		}
	}
	,isTweenOf: function(object,field) {
		if(this.sprite == object) {
			if(field != null) {
				return field == "color";
			} else {
				return true;
			}
		} else {
			return false;
		}
	}
	,__class__: flixel_tweens_misc_ColorTween
});
var flixel_tweens_misc_NumTween = function(Options,manager) {
	flixel_tweens_FlxTween.call(this,Options,manager);
};
$hxClasses["flixel.tweens.misc.NumTween"] = flixel_tweens_misc_NumTween;
flixel_tweens_misc_NumTween.__name__ = "flixel.tweens.misc.NumTween";
flixel_tweens_misc_NumTween.__super__ = flixel_tweens_FlxTween;
flixel_tweens_misc_NumTween.prototype = $extend(flixel_tweens_FlxTween.prototype,{
	value: null
	,_tweenFunction: null
	,_start: null
	,_range: null
	,destroy: function() {
		flixel_tweens_FlxTween.prototype.destroy.call(this);
		this._tweenFunction = null;
	}
	,tween: function(fromValue,toValue,duration,tweenFunction) {
		this._tweenFunction = tweenFunction;
		this._start = this.value = fromValue;
		this._range = toValue - this.value;
		this.duration = duration;
		this.start();
		return this;
	}
	,update: function(elapsed) {
		flixel_tweens_FlxTween.prototype.update.call(this,elapsed);
		this.value = this._start + this._range * this.scale;
		if(this._tweenFunction != null) {
			this._tweenFunction(this.value);
		}
	}
	,__class__: flixel_tweens_misc_NumTween
});
var flixel_tweens_misc_VarTween = function(options,manager) {
	flixel_tweens_FlxTween.call(this,options,manager);
};
$hxClasses["flixel.tweens.misc.VarTween"] = flixel_tweens_misc_VarTween;
flixel_tweens_misc_VarTween.__name__ = "flixel.tweens.misc.VarTween";
flixel_tweens_misc_VarTween.__super__ = flixel_tweens_FlxTween;
flixel_tweens_misc_VarTween.prototype = $extend(flixel_tweens_FlxTween.prototype,{
	_object: null
	,_properties: null
	,_propertyInfos: null
	,tween: function(object,properties,duration) {
		this._object = object;
		this._properties = properties;
		this._propertyInfos = [];
		this.duration = duration;
		this.start();
		this.initializeVars();
		return this;
	}
	,update: function(elapsed) {
		var delay = this.executions > 0 ? this.loopDelay : this.startDelay;
		if(this._secondsSinceStart < delay) {
			flixel_tweens_FlxTween.prototype.update.call(this,elapsed);
		} else {
			var f = this._propertyInfos[0].startValue;
			if(isNaN(f)) {
				this.setStartValues();
			}
			flixel_tweens_FlxTween.prototype.update.call(this,elapsed);
			if(this.active) {
				var _g = 0;
				var _g1 = this._propertyInfos;
				while(_g < _g1.length) {
					var info = _g1[_g];
					++_g;
					Reflect.setProperty(info.object,info.field,info.startValue + info.range * this.scale);
				}
			}
		}
	}
	,initializeVars: function() {
		var fieldPaths;
		if(Reflect.isObject(this._properties)) {
			fieldPaths = Reflect.fields(this._properties);
		} else {
			throw haxe_Exception.thrown("Unsupported properties container - use an object containing key/value pairs.");
		}
		var _g = 0;
		while(_g < fieldPaths.length) {
			var fieldPath = fieldPaths[_g];
			++_g;
			var target = this._object;
			var path = fieldPath.split(".");
			var field = path.pop();
			var _g1 = 0;
			while(_g1 < path.length) {
				var component = path[_g1];
				++_g1;
				target = Reflect.getProperty(target,component);
				if(!Reflect.isObject(target)) {
					throw haxe_Exception.thrown("The object does not have the property \"" + component + "\" in \"" + fieldPath + "\"");
				}
			}
			this._propertyInfos.push({ object : target, field : field, startValue : NaN, range : Reflect.getProperty(this._properties,fieldPath)});
		}
	}
	,setStartValues: function() {
		var _g = 0;
		var _g1 = this._propertyInfos;
		while(_g < _g1.length) {
			var info = _g1[_g];
			++_g;
			if(Reflect.getProperty(info.object,info.field) == null) {
				throw haxe_Exception.thrown("The object does not have the property \"" + info.field + "\"");
			}
			var value = Reflect.getProperty(info.object,info.field);
			if(isNaN(value)) {
				throw haxe_Exception.thrown("The property \"" + info.field + "\" is not numeric.");
			}
			info.startValue = value;
			info.range -= value;
		}
	}
	,destroy: function() {
		flixel_tweens_FlxTween.prototype.destroy.call(this);
		this._object = null;
		this._properties = null;
		this._propertyInfos = null;
	}
	,isTweenOf: function(object,field) {
		if(object == this._object && field == null) {
			return true;
		}
		var _g = 0;
		var _g1 = this._propertyInfos;
		while(_g < _g1.length) {
			var property = _g1[_g];
			++_g;
			if(object == property.object && (field == property.field || field == null)) {
				return true;
			}
		}
		return false;
	}
	,__class__: flixel_tweens_misc_VarTween
});
var flixel_tweens_motion_Motion = function(Options,manager) {
	this.y = 0;
	this.x = 0;
	flixel_tweens_FlxTween.call(this,Options,manager);
};
$hxClasses["flixel.tweens.motion.Motion"] = flixel_tweens_motion_Motion;
flixel_tweens_motion_Motion.__name__ = "flixel.tweens.motion.Motion";
flixel_tweens_motion_Motion.__super__ = flixel_tweens_FlxTween;
flixel_tweens_motion_Motion.prototype = $extend(flixel_tweens_FlxTween.prototype,{
	x: null
	,y: null
	,_object: null
	,_wasObjectImmovable: null
	,destroy: function() {
		flixel_tweens_FlxTween.prototype.destroy.call(this);
		this._object = null;
	}
	,setObject: function(object) {
		this._object = object;
		this._wasObjectImmovable = this._object.immovable;
		this._object.set_immovable(true);
		return this;
	}
	,update: function(elapsed) {
		flixel_tweens_FlxTween.prototype.update.call(this,elapsed);
		this.postUpdate();
	}
	,onEnd: function() {
		this._object.set_immovable(this._wasObjectImmovable);
		flixel_tweens_FlxTween.prototype.onEnd.call(this);
	}
	,postUpdate: function() {
		if(this._object != null) {
			this._object.setPosition(this.x,this.y);
		}
	}
	,isTweenOf: function(object,field) {
		if(this._object == object) {
			if(!(field == null || field == "x")) {
				return field == "y";
			} else {
				return true;
			}
		} else {
			return false;
		}
	}
	,__class__: flixel_tweens_motion_Motion
});
var flixel_tweens_motion_CircularMotion = function(Options,manager) {
	this._angleFinish = 0;
	this._angleStart = 0;
	this._radius = 0;
	this._centerY = 0;
	this._centerX = 0;
	this.angle = 0;
	flixel_tweens_motion_Motion.call(this,Options,manager);
};
$hxClasses["flixel.tweens.motion.CircularMotion"] = flixel_tweens_motion_CircularMotion;
flixel_tweens_motion_CircularMotion.__name__ = "flixel.tweens.motion.CircularMotion";
flixel_tweens_motion_CircularMotion.__super__ = flixel_tweens_motion_Motion;
flixel_tweens_motion_CircularMotion.prototype = $extend(flixel_tweens_motion_Motion.prototype,{
	angle: null
	,_centerX: null
	,_centerY: null
	,_radius: null
	,_angleStart: null
	,_angleFinish: null
	,setMotion: function(CenterX,CenterY,Radius,Angle,Clockwise,DurationOrSpeed,UseDuration) {
		if(UseDuration == null) {
			UseDuration = true;
		}
		this._centerX = CenterX;
		this._centerY = CenterY;
		this._radius = Radius;
		this.angle = this._angleStart = Angle * Math.PI / -180;
		this._angleFinish = Math.PI * 2 * (Clockwise ? 1 : -1);
		if(UseDuration) {
			this.duration = DurationOrSpeed;
		} else {
			this.duration = this._radius * (Math.PI * 2) / DurationOrSpeed;
		}
		this.start();
		return this;
	}
	,update: function(elapsed) {
		flixel_tweens_motion_Motion.prototype.update.call(this,elapsed);
		this.angle = this._angleStart + this._angleFinish * this.scale;
		this.x = this._centerX + Math.cos(this.angle) * this._radius;
		this.y = this._centerY + Math.sin(this.angle) * this._radius;
		if(this.finished) {
			this.postUpdate();
		}
	}
	,get_circumference: function() {
		return this._radius * (Math.PI * 2);
	}
	,__class__: flixel_tweens_motion_CircularMotion
	,__properties__: $extend(flixel_tweens_motion_Motion.prototype.__properties__,{get_circumference:"get_circumference"})
});
var flixel_tweens_motion_CubicMotion = function(Options,manager) {
	this._tt = 0;
	this._ttt = 0;
	this._bY = 0;
	this._bX = 0;
	this._aY = 0;
	this._aX = 0;
	this._toY = 0;
	this._toX = 0;
	this._fromY = 0;
	this._fromX = 0;
	flixel_tweens_motion_Motion.call(this,Options,manager);
};
$hxClasses["flixel.tweens.motion.CubicMotion"] = flixel_tweens_motion_CubicMotion;
flixel_tweens_motion_CubicMotion.__name__ = "flixel.tweens.motion.CubicMotion";
flixel_tweens_motion_CubicMotion.__super__ = flixel_tweens_motion_Motion;
flixel_tweens_motion_CubicMotion.prototype = $extend(flixel_tweens_motion_Motion.prototype,{
	_fromX: null
	,_fromY: null
	,_toX: null
	,_toY: null
	,_aX: null
	,_aY: null
	,_bX: null
	,_bY: null
	,_ttt: null
	,_tt: null
	,setMotion: function(fromX,fromY,aX,aY,bX,bY,toX,toY,duration) {
		this.x = this._fromX = fromX;
		this.y = this._fromY = fromY;
		this._aX = aX;
		this._aY = aY;
		this._bX = bX;
		this._bY = bY;
		this._toX = toX;
		this._toY = toY;
		this.duration = duration;
		this.start();
		return this;
	}
	,update: function(elapsed) {
		flixel_tweens_motion_Motion.prototype.update.call(this,elapsed);
		this.x = this.scale * this.scale * this.scale * (this._toX + 3 * (this._aX - this._bX) - this._fromX) + 3 * this.scale * this.scale * (this._fromX - 2 * this._aX + this._bX) + 3 * this.scale * (this._aX - this._fromX) + this._fromX;
		this.y = this.scale * this.scale * this.scale * (this._toY + 3 * (this._aY - this._bY) - this._fromY) + 3 * this.scale * this.scale * (this._fromY - 2 * this._aY + this._bY) + 3 * this.scale * (this._aY - this._fromY) + this._fromY;
		if(this.finished) {
			this.postUpdate();
		}
	}
	,__class__: flixel_tweens_motion_CubicMotion
});
var flixel_tweens_motion_LinearMotion = function(Options,manager) {
	this._distance = -1;
	this._moveY = 0;
	this._moveX = 0;
	this._fromY = 0;
	this._fromX = 0;
	flixel_tweens_motion_Motion.call(this,Options,manager);
};
$hxClasses["flixel.tweens.motion.LinearMotion"] = flixel_tweens_motion_LinearMotion;
flixel_tweens_motion_LinearMotion.__name__ = "flixel.tweens.motion.LinearMotion";
flixel_tweens_motion_LinearMotion.__super__ = flixel_tweens_motion_Motion;
flixel_tweens_motion_LinearMotion.prototype = $extend(flixel_tweens_motion_Motion.prototype,{
	_fromX: null
	,_fromY: null
	,_moveX: null
	,_moveY: null
	,_distance: null
	,setMotion: function(FromX,FromY,ToX,ToY,DurationOrSpeed,UseDuration) {
		if(UseDuration == null) {
			UseDuration = true;
		}
		this._distance = -1;
		this.x = this._fromX = FromX;
		this.y = this._fromY = FromY;
		this._moveX = ToX - FromX;
		this._moveY = ToY - FromY;
		if(UseDuration) {
			this.duration = DurationOrSpeed;
		} else {
			this.duration = this.get_distance() / DurationOrSpeed;
		}
		this.start();
		return this;
	}
	,update: function(elapsed) {
		flixel_tweens_motion_Motion.prototype.update.call(this,elapsed);
		this.x = this._fromX + this._moveX * this.scale;
		this.y = this._fromY + this._moveY * this.scale;
		if(this.x == this._fromX + this._moveX && this.y == this._fromY + this._moveY && this.active && this._secondsSinceStart >= this.duration) {
			this.finished = true;
		}
		if(this.finished) {
			this.postUpdate();
		}
	}
	,get_distance: function() {
		if(this._distance >= 0) {
			return this._distance;
		}
		return this._distance = Math.sqrt(this._moveX * this._moveX + this._moveY * this._moveY);
	}
	,__class__: flixel_tweens_motion_LinearMotion
	,__properties__: $extend(flixel_tweens_motion_Motion.prototype.__properties__,{get_distance:"get_distance"})
});
var flixel_tweens_motion_LinearPath = function(Options,manager) {
	this._index = 0;
	this._speed = 0;
	this.distance = 0;
	flixel_tweens_motion_Motion.call(this,Options,manager);
	this.points = [];
	this._pointD = [0];
	this._pointT = [0];
};
$hxClasses["flixel.tweens.motion.LinearPath"] = flixel_tweens_motion_LinearPath;
flixel_tweens_motion_LinearPath.__name__ = "flixel.tweens.motion.LinearPath";
flixel_tweens_motion_LinearPath.__super__ = flixel_tweens_motion_Motion;
flixel_tweens_motion_LinearPath.prototype = $extend(flixel_tweens_motion_Motion.prototype,{
	distance: null
	,points: null
	,_pointD: null
	,_pointT: null
	,_speed: null
	,_index: null
	,_last: null
	,_prevPoint: null
	,_nextPoint: null
	,destroy: function() {
		flixel_tweens_motion_Motion.prototype.destroy.call(this);
		var _g = 0;
		var _g1 = this.points;
		while(_g < _g1.length) {
			var point = _g1[_g];
			++_g;
			point = flixel_util_FlxDestroyUtil.put(point);
		}
		this._last = flixel_util_FlxDestroyUtil.put(this._last);
		this._prevPoint = flixel_util_FlxDestroyUtil.put(this._prevPoint);
		this._nextPoint = flixel_util_FlxDestroyUtil.put(this._nextPoint);
	}
	,setMotion: function(DurationOrSpeed,UseDuration) {
		if(UseDuration == null) {
			UseDuration = true;
		}
		this.updatePath();
		if(UseDuration) {
			this.duration = DurationOrSpeed;
			this._speed = this.distance / DurationOrSpeed;
		} else {
			this.duration = this.distance / DurationOrSpeed;
			this._speed = DurationOrSpeed;
		}
		this.start();
		return this;
	}
	,addPoint: function(x,y) {
		if(y == null) {
			y = 0;
		}
		if(x == null) {
			x = 0;
		}
		if(this._last != null) {
			this.distance += Math.sqrt((x - this._last.x) * (x - this._last.x) + (y - this._last.y) * (y - this._last.y));
			this._pointD[this.points.length] = this.distance;
		}
		var tmp = this.points;
		var tmp1 = this.points.length;
		var X = x;
		var Y = y;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		tmp[tmp1] = this._last = point;
		return this;
	}
	,getPoint: function(index) {
		if(index == null) {
			index = 0;
		}
		if(this.points.length == 0) {
			throw haxe_Exception.thrown("No points have been added to the path yet.");
		}
		return this.points[index % this.points.length];
	}
	,start: function() {
		this._index = this.backward ? this.points.length - 1 : 0;
		flixel_tweens_motion_Motion.prototype.start.call(this);
		return this;
	}
	,update: function(elapsed) {
		flixel_tweens_motion_Motion.prototype.update.call(this,elapsed);
		var td;
		var tt;
		if(this.points == null) {
			return;
		}
		if(!this.backward) {
			if(this._index < this.points.length - 1) {
				while(this.scale > this._pointT[this._index + 1]) {
					this._index++;
					if(this._index == this.points.length - 1) {
						this._index -= 1;
						break;
					}
				}
			}
			td = this._pointT[this._index];
			tt = this._pointT[this._index + 1] - td;
			td = (this.scale - td) / tt;
			this._prevPoint = this.points[this._index];
			this._nextPoint = this.points[this._index + 1];
			this.x = this._prevPoint.x + (this._nextPoint.x - this._prevPoint.x) * td;
			this.y = this._prevPoint.y + (this._nextPoint.y - this._prevPoint.y) * td;
		} else {
			if(this._index > 0) {
				while(this.scale < this._pointT[this._index - 1]) {
					this._index -= 1;
					if(this._index == 0) {
						this._index += 1;
						break;
					}
				}
			}
			td = this._pointT[this._index];
			tt = this._pointT[this._index - 1] - td;
			td = (this.scale - td) / tt;
			this._prevPoint = this.points[this._index];
			this._nextPoint = this.points[this._index - 1];
			this.x = this._prevPoint.x + (this._nextPoint.x - this._prevPoint.x) * td;
			this.y = this._prevPoint.y + (this._nextPoint.y - this._prevPoint.y) * td;
		}
		flixel_tweens_motion_Motion.prototype.postUpdate.call(this);
	}
	,updatePath: function() {
		if(this.points.length < 2) {
			throw haxe_Exception.thrown("A LinearPath must have at least 2 points to operate.");
		}
		if(this._pointD.length == this._pointT.length) {
			return;
		}
		var i = 0;
		while(i < this.points.length) this._pointT[i] = this._pointD[i++] / this.distance;
	}
	,__class__: flixel_tweens_motion_LinearPath
});
var flixel_tweens_motion_QuadMotion = function(Options,manager) {
	this._controlY = 0;
	this._controlX = 0;
	this._toY = 0;
	this._toX = 0;
	this._fromY = 0;
	this._fromX = 0;
	this._distance = -1;
	flixel_tweens_motion_Motion.call(this,Options,manager);
};
$hxClasses["flixel.tweens.motion.QuadMotion"] = flixel_tweens_motion_QuadMotion;
flixel_tweens_motion_QuadMotion.__name__ = "flixel.tweens.motion.QuadMotion";
flixel_tweens_motion_QuadMotion.__super__ = flixel_tweens_motion_Motion;
flixel_tweens_motion_QuadMotion.prototype = $extend(flixel_tweens_motion_Motion.prototype,{
	_distance: null
	,_fromX: null
	,_fromY: null
	,_toX: null
	,_toY: null
	,_controlX: null
	,_controlY: null
	,setMotion: function(FromX,FromY,ControlX,ControlY,ToX,ToY,DurationOrSpeed,UseDuration) {
		if(UseDuration == null) {
			UseDuration = true;
		}
		this._distance = -1;
		this.x = this._fromX = FromX;
		this.y = this._fromY = FromY;
		this._controlX = ControlX;
		this._controlY = ControlY;
		this._toX = ToX;
		this._toY = ToY;
		if(UseDuration) {
			this.duration = DurationOrSpeed;
		} else {
			this.duration = this.get_distance() / DurationOrSpeed;
		}
		this.start();
		return this;
	}
	,update: function(elapsed) {
		flixel_tweens_motion_Motion.prototype.update.call(this,elapsed);
		this.x = this._fromX * (1 - this.scale) * (1 - this.scale) + this._controlX * 2 * (1 - this.scale) * this.scale + this._toX * this.scale * this.scale;
		this.y = this._fromY * (1 - this.scale) * (1 - this.scale) + this._controlY * 2 * (1 - this.scale) * this.scale + this._toY * this.scale * this.scale;
		if(this.finished) {
			this.postUpdate();
		}
	}
	,get_distance: function() {
		if(this._distance >= 0) {
			return this._distance;
		}
		var point = flixel_math_FlxPoint._pool.get().set(0,0);
		point._inPool = false;
		var p1 = point;
		var point = flixel_math_FlxPoint._pool.get().set(0,0);
		point._inPool = false;
		var p2 = point;
		p1.set_x(this.x - 2 * this._controlX + this._toX);
		p1.set_y(this.y - 2 * this._controlY + this._toY);
		p2.set_x(2 * this._controlX - 2 * this.x);
		p2.set_y(2 * this._controlY - 2 * this.y);
		var a = 4 * (p1.x * p1.x + p1.y * p1.y);
		var b = 4 * (p1.x * p2.x + p1.y * p2.y);
		var c = p2.x * p2.x + p2.y * p2.y;
		var abc = 2 * Math.sqrt(a + b + c);
		var a2 = Math.sqrt(a);
		var a32 = 2 * a * a2;
		var c2 = 2 * Math.sqrt(c);
		var ba = b / a2;
		p1.put();
		p2.put();
		return (a32 * abc + a2 * b * (abc - c2) + (4 * c * a - b * b) * Math.log((2 * a2 + ba + abc) / (ba + c2))) / (4 * a32);
	}
	,__class__: flixel_tweens_motion_QuadMotion
	,__properties__: $extend(flixel_tweens_motion_Motion.prototype.__properties__,{get_distance:"get_distance"})
});
var flixel_tweens_motion_QuadPath = function(Options,manager) {
	this._updateCurve = true;
	this._numSegs = 0;
	this._index = 0;
	this._speed = 0;
	this._distance = 0;
	flixel_tweens_motion_Motion.call(this,Options,manager);
	this._points = [];
	this._curveT = [];
	this._curveD = [];
};
$hxClasses["flixel.tweens.motion.QuadPath"] = flixel_tweens_motion_QuadPath;
flixel_tweens_motion_QuadPath.__name__ = "flixel.tweens.motion.QuadPath";
flixel_tweens_motion_QuadPath.__super__ = flixel_tweens_motion_Motion;
flixel_tweens_motion_QuadPath.prototype = $extend(flixel_tweens_motion_Motion.prototype,{
	_points: null
	,_distance: null
	,_speed: null
	,_index: null
	,_numSegs: null
	,_updateCurve: null
	,_curveT: null
	,_curveD: null
	,_a: null
	,_b: null
	,_c: null
	,destroy: function() {
		flixel_tweens_motion_Motion.prototype.destroy.call(this);
		var _g = 0;
		var _g1 = this._points;
		while(_g < _g1.length) {
			var point = _g1[_g];
			++_g;
			point = flixel_util_FlxDestroyUtil.put(point);
		}
		this._a = flixel_util_FlxDestroyUtil.put(this._a);
		this._b = flixel_util_FlxDestroyUtil.put(this._b);
		this._c = flixel_util_FlxDestroyUtil.put(this._c);
	}
	,setMotion: function(DurationOrSpeed,UseDuration) {
		if(UseDuration == null) {
			UseDuration = true;
		}
		this.updatePath();
		if(UseDuration) {
			this.duration = DurationOrSpeed;
			this._speed = this._distance / DurationOrSpeed;
		} else {
			this.duration = this._distance / DurationOrSpeed;
			this._speed = DurationOrSpeed;
		}
		this.start();
		return this;
	}
	,addPoint: function(x,y) {
		if(y == null) {
			y = 0;
		}
		if(x == null) {
			x = 0;
		}
		this._updateCurve = true;
		var tmp = this._points;
		var X = x;
		var Y = y;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		tmp.push(point);
		return this;
	}
	,getPoint: function(index) {
		if(index == null) {
			index = 0;
		}
		if(this._points.length == 0) {
			throw haxe_Exception.thrown("No points have been added to the path yet.");
		}
		return this._points[index % this._points.length];
	}
	,start: function() {
		this._index = this.backward ? this._numSegs - 1 : 0;
		flixel_tweens_motion_Motion.prototype.start.call(this);
		return this;
	}
	,update: function(elapsed) {
		flixel_tweens_motion_Motion.prototype.update.call(this,elapsed);
		var td;
		var tt;
		if(!this.backward && this._points != null) {
			if(this._index < this._numSegs - 1) {
				while(this.scale > this._curveT[this._index + 1]) {
					this._index++;
					if(this._index == this._numSegs - 1) {
						break;
					}
				}
			}
			td = this._curveT[this._index];
			tt = this._curveT[this._index + 1] - td;
			td = (this.scale - td) / tt;
			this._a = this._points[this._index * 2];
			this._b = this._points[this._index * 2 + 1];
			this._c = this._points[this._index * 2 + 2];
			this.x = this._a.x * (1 - td) * (1 - td) + this._b.x * 2 * (1 - td) * td + this._c.x * td * td;
			this.y = this._a.y * (1 - td) * (1 - td) + this._b.y * 2 * (1 - td) * td + this._c.y * td * td;
		} else if(this._points != null) {
			if(this._index > 0) {
				while(this.scale < this._curveT[this._index]) {
					this._index--;
					if(this._index == 0) {
						break;
					}
				}
			}
			td = this._curveT[this._index + 1];
			tt = this._curveT[this._index] - td;
			td = (this.scale - td) / tt;
			this._a = this._points[this._index * 2 + 2];
			this._b = this._points[this._index * 2 + 1];
			this._c = this._points[this._index * 2];
			this.x = this._a.x * (1 - td) * (1 - td) + this._b.x * 2 * (1 - td) * td + this._c.x * td * td;
			this.y = this._a.y * (1 - td) * (1 - td) + this._b.y * 2 * (1 - td) * td + this._c.y * td * td;
		}
		flixel_tweens_motion_Motion.prototype.postUpdate.call(this);
	}
	,updatePath: function() {
		if((this._points.length - 1) % 2 != 0 || this._points.length < 3) {
			throw haxe_Exception.thrown("A QuadPath must have at least 3 points to operate and number of points must be a odd.");
		}
		if(!this._updateCurve) {
			return;
		}
		this._updateCurve = false;
		var i = 0;
		var j = 0;
		this._distance = 0;
		this._numSegs = (this._points.length - 1) / 2 | 0;
		while(i < this._numSegs) {
			j = i * 2;
			this._curveD[i] = this.getCurveLength(this._points[j],this._points[j + 1],this._points[j + 2]);
			this._distance += this._curveD[i++];
		}
		i = 0;
		var d = 0;
		while(i < this._numSegs) {
			d += this._curveD[i];
			this._curveT[i++] = d / this._distance;
		}
		this._curveT[this._numSegs - 1] = 1;
		this._curveT.unshift(0);
	}
	,getCurveLength: function(start,control,finish) {
		var point = flixel_math_FlxPoint._pool.get().set(0,0);
		point._inPool = false;
		var p1 = point;
		var point = flixel_math_FlxPoint._pool.get().set(0,0);
		point._inPool = false;
		var p2 = point;
		p1.set_x(start.x - 2 * control.x + finish.x);
		p1.set_y(start.y - 2 * control.y + finish.y);
		p2.set_x(2 * control.x - 2 * start.x);
		p2.set_y(2 * control.y - 2 * start.y);
		var a = 4 * (p1.x * p1.x + p1.y * p1.y);
		var b = 4 * (p1.x * p2.x + p1.y * p2.y);
		var c = p2.x * p2.x + p2.y * p2.y;
		var abc = 2 * Math.sqrt(a + b + c);
		var a2 = Math.sqrt(a);
		var a32 = 2 * a * a2;
		var c2 = 2 * Math.sqrt(c);
		var ba = b / a2;
		p1.put();
		p2.put();
		return (a32 * abc + a2 * b * (abc - c2) + (4 * c * a - b * b) * Math.log((2 * a2 + ba + abc) / (ba + c2))) / (4 * a32);
	}
	,__class__: flixel_tweens_motion_QuadPath
});
var flixel_ui_FlxBar = function(x,y,direction,width,height,parentRef,variable,min,max,showBorder) {
	if(showBorder == null) {
		showBorder = false;
	}
	if(max == null) {
		max = 100;
	}
	if(min == null) {
		min = 0;
	}
	if(variable == null) {
		variable = "";
	}
	if(height == null) {
		height = 10;
	}
	if(width == null) {
		width = 100;
	}
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	this._maxPercent = 100;
	this.numDivisions = 100;
	this.killOnEmpty = false;
	this.fixedPosition = true;
	flixel_FlxSprite.call(this,x,y);
	if(direction == null) {
		direction = flixel_ui_FlxBarFillDirection.LEFT_TO_RIGHT;
	}
	this.barWidth = width;
	this.barHeight = height;
	this._filledBarPoint = new openfl_geom_Point();
	this._filledBarRect = new openfl_geom_Rectangle();
	if(flixel_FlxG.renderBlit) {
		this._zeroOffset = new openfl_geom_Point();
		this._emptyBarRect = new openfl_geom_Rectangle();
		this.makeGraphic(width,height,0,true);
	} else {
		var _this = flixel_math_FlxRect._pool.get();
		var X = 0;
		var Y = 0;
		var Width = 0;
		var Height = 0;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		_this.x = X;
		_this.y = Y;
		_this.width = Width;
		_this.height = Height;
		var rect = _this;
		rect._inPool = false;
		this._filledFlxRect = rect;
	}
	if(parentRef != null) {
		this.parent = parentRef;
		this.parentVariable = variable;
	}
	this.set_fillDirection(direction);
	this.createFilledBar(-16756480,-16714752,showBorder);
	this.setRange(min,max);
};
$hxClasses["flixel.ui.FlxBar"] = flixel_ui_FlxBar;
flixel_ui_FlxBar.__name__ = "flixel.ui.FlxBar";
flixel_ui_FlxBar.__super__ = flixel_FlxSprite;
flixel_ui_FlxBar.prototype = $extend(flixel_FlxSprite.prototype,{
	fixedPosition: null
	,pxPerPercent: null
	,positionOffset: null
	,killOnEmpty: null
	,value: null
	,min: null
	,max: null
	,range: null
	,pct: null
	,numDivisions: null
	,emptyCallback: null
	,filledCallback: null
	,parent: null
	,parentVariable: null
	,barWidth: null
	,barHeight: null
	,frontFrames: null
	,fillDirection: null
	,_fillHorizontal: null
	,_frontFrame: null
	,_filledFlxRect: null
	,_emptyBar: null
	,_emptyBarRect: null
	,_filledBar: null
	,_zeroOffset: null
	,_filledBarRect: null
	,_filledBarPoint: null
	,_maxPercent: null
	,destroy: function() {
		this.positionOffset = flixel_util_FlxDestroyUtil.put(this.positionOffset);
		if(flixel_FlxG.renderBlit) {
			this._frontFrame = null;
			this._filledFlxRect = flixel_util_FlxDestroyUtil.put(this._filledFlxRect);
		} else {
			this._emptyBarRect = null;
			this._zeroOffset = null;
			this._emptyBar = flixel_util_FlxDestroyUtil.dispose(this._emptyBar);
			this._filledBar = flixel_util_FlxDestroyUtil.dispose(this._filledBar);
		}
		this._filledBarRect = null;
		this._filledBarPoint = null;
		this.parent = null;
		this.positionOffset = null;
		this.emptyCallback = null;
		this.filledCallback = null;
		flixel_FlxSprite.prototype.destroy.call(this);
	}
	,trackParent: function(offsetX,offsetY) {
		this.fixedPosition = false;
		var X = offsetX;
		var Y = offsetY;
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X,Y);
		point._inPool = false;
		this.positionOffset = point;
		if(Object.prototype.hasOwnProperty.call(this.parent,"scrollFactor")) {
			this.scrollFactor.set_x(this.parent.scrollFactor.x);
			this.scrollFactor.set_y(this.parent.scrollFactor.y);
		}
	}
	,setParent: function(parentRef,variable,track,offsetX,offsetY) {
		if(offsetY == null) {
			offsetY = 0;
		}
		if(offsetX == null) {
			offsetX = 0;
		}
		if(track == null) {
			track = false;
		}
		this.parent = parentRef;
		this.parentVariable = variable;
		if(track) {
			this.trackParent(offsetX,offsetY);
		}
		this.updateValueFromParent();
	}
	,stopTrackingParent: function(posX,posY) {
		this.fixedPosition = true;
		this.set_x(posX);
		this.set_y(posY);
	}
	,setCallbacks: function(onEmpty,onFilled,killOnEmpty) {
		if(killOnEmpty == null) {
			killOnEmpty = false;
		}
		this.emptyCallback = onEmpty != null ? onEmpty : this.emptyCallback;
		this.filledCallback = onFilled != null ? onFilled : this.filledCallback;
		this.killOnEmpty = killOnEmpty;
	}
	,setRange: function(min,max) {
		if(max <= min) {
			throw haxe_Exception.thrown("FlxBar: max cannot be less than or equal to min");
		}
		this.min = min;
		this.max = max;
		this.range = max - min;
		this.pct = this.range / this._maxPercent;
		this.pxPerPercent = this._fillHorizontal ? this.barWidth / this._maxPercent : this.barHeight / this._maxPercent;
		var f = this.get_value();
		if(!isNaN(f)) {
			this.set_value(Math.max(min,Math.min(this.get_value(),max)));
		} else {
			this.set_value(min);
		}
	}
	,createFilledBar: function(empty,fill,showBorder,border) {
		if(border == null) {
			border = -1;
		}
		if(showBorder == null) {
			showBorder = false;
		}
		this.createColoredEmptyBar(empty,showBorder,border);
		this.createColoredFilledBar(fill,showBorder,border);
		return this;
	}
	,createColoredEmptyBar: function(empty,showBorder,border) {
		if(border == null) {
			border = -1;
		}
		if(showBorder == null) {
			showBorder = false;
		}
		if(flixel_FlxG.renderTile) {
			var emptyKey = "empty: " + this.barWidth + "x" + this.barHeight + ":" + ("0x" + StringTools.hex(empty >> 24 & 255,2) + StringTools.hex(empty >> 16 & 255,2) + StringTools.hex(empty >> 8 & 255,2) + StringTools.hex(empty & 255,2));
			if(showBorder) {
				emptyKey += ",border: " + ("0x" + StringTools.hex(border >> 24 & 255,2) + StringTools.hex(border >> 16 & 255,2) + StringTools.hex(border >> 8 & 255,2) + StringTools.hex(border & 255,2));
			}
			if(flixel_FlxG.bitmap._cache.h[emptyKey] == null) {
				var emptyBar = null;
				if(showBorder) {
					emptyBar = new openfl_display_BitmapData(this.barWidth,this.barHeight,true,border);
					emptyBar.fillRect(new openfl_geom_Rectangle(1,1,this.barWidth - 2,this.barHeight - 2),empty);
				} else {
					emptyBar = new openfl_display_BitmapData(this.barWidth,this.barHeight,true,empty);
				}
				flixel_FlxG.bitmap.add(emptyBar,false,emptyKey);
			}
			this.set_frames(flixel_FlxG.bitmap._cache.h[emptyKey].get_imageFrame());
		} else {
			if(showBorder) {
				this._emptyBar = new openfl_display_BitmapData(this.barWidth,this.barHeight,true,border);
				this._emptyBar.fillRect(new openfl_geom_Rectangle(1,1,this.barWidth - 2,this.barHeight - 2),empty);
			} else {
				this._emptyBar = new openfl_display_BitmapData(this.barWidth,this.barHeight,true,empty);
			}
			this._emptyBarRect.setTo(0,0,this.barWidth,this.barHeight);
			this.updateEmptyBar();
		}
		return this;
	}
	,createColoredFilledBar: function(fill,showBorder,border) {
		if(border == null) {
			border = -1;
		}
		if(showBorder == null) {
			showBorder = false;
		}
		if(flixel_FlxG.renderTile) {
			var filledKey = "filled: " + this.barWidth + "x" + this.barHeight + ":" + ("0x" + StringTools.hex(fill >> 24 & 255,2) + StringTools.hex(fill >> 16 & 255,2) + StringTools.hex(fill >> 8 & 255,2) + StringTools.hex(fill & 255,2));
			if(showBorder) {
				filledKey += ",border: " + ("0x" + StringTools.hex(border >> 24 & 255,2) + StringTools.hex(border >> 16 & 255,2) + StringTools.hex(border >> 8 & 255,2) + StringTools.hex(border & 255,2));
			}
			if(flixel_FlxG.bitmap._cache.h[filledKey] == null) {
				var filledBar = null;
				if(showBorder) {
					filledBar = new openfl_display_BitmapData(this.barWidth,this.barHeight,true,border);
					filledBar.fillRect(new openfl_geom_Rectangle(1,1,this.barWidth - 2,this.barHeight - 2),fill);
				} else {
					filledBar = new openfl_display_BitmapData(this.barWidth,this.barHeight,true,fill);
				}
				flixel_FlxG.bitmap.add(filledBar,false,filledKey);
			}
			this.set_frontFrames(flixel_FlxG.bitmap._cache.h[filledKey].get_imageFrame());
		} else {
			if(showBorder) {
				this._filledBar = new openfl_display_BitmapData(this.barWidth,this.barHeight,true,border);
				this._filledBar.fillRect(new openfl_geom_Rectangle(1,1,this.barWidth - 2,this.barHeight - 2),fill);
			} else {
				this._filledBar = new openfl_display_BitmapData(this.barWidth,this.barHeight,true,fill);
			}
			this._filledBarRect.setTo(0,0,this.barWidth,this.barHeight);
			this.updateFilledBar();
		}
		return this;
	}
	,createGradientBar: function(empty,fill,chunkSize,rotation,showBorder,border) {
		if(border == null) {
			border = -1;
		}
		if(showBorder == null) {
			showBorder = false;
		}
		if(rotation == null) {
			rotation = 180;
		}
		if(chunkSize == null) {
			chunkSize = 1;
		}
		this.createGradientEmptyBar(empty,chunkSize,rotation,showBorder,border);
		this.createGradientFilledBar(fill,chunkSize,rotation,showBorder,border);
		return this;
	}
	,createGradientEmptyBar: function(empty,chunkSize,rotation,showBorder,border) {
		if(border == null) {
			border = -1;
		}
		if(showBorder == null) {
			showBorder = false;
		}
		if(rotation == null) {
			rotation = 180;
		}
		if(chunkSize == null) {
			chunkSize = 1;
		}
		if(flixel_FlxG.renderTile) {
			var emptyKey = "Gradient:" + this.barWidth + "x" + this.barHeight + ",colors:[";
			var _g = 0;
			while(_g < empty.length) {
				var col = empty[_g];
				++_g;
				emptyKey += "0x" + StringTools.hex(col >> 24 & 255,2) + StringTools.hex(col >> 16 & 255,2) + StringTools.hex(col >> 8 & 255,2) + StringTools.hex(col & 255,2) + ",";
			}
			emptyKey += "],chunkSize: " + chunkSize + ",rotation: " + rotation;
			if(showBorder) {
				emptyKey += ",border: " + ("0x" + StringTools.hex(border >> 24 & 255,2) + StringTools.hex(border >> 16 & 255,2) + StringTools.hex(border >> 8 & 255,2) + StringTools.hex(border & 255,2));
			}
			if(flixel_FlxG.bitmap._cache.h[emptyKey] == null) {
				var emptyBar = null;
				if(showBorder) {
					emptyBar = new openfl_display_BitmapData(this.barWidth,this.barHeight,true,border);
					flixel_util_FlxGradient.overlayGradientOnBitmapData(emptyBar,this.barWidth - 2,this.barHeight - 2,empty,1,1,chunkSize,rotation);
				} else {
					emptyBar = flixel_util_FlxGradient.createGradientBitmapData(this.barWidth,this.barHeight,empty,chunkSize,rotation);
				}
				flixel_FlxG.bitmap.add(emptyBar,false,emptyKey);
			}
			this.set_frames(flixel_FlxG.bitmap._cache.h[emptyKey].get_imageFrame());
		} else {
			if(showBorder) {
				this._emptyBar = new openfl_display_BitmapData(this.barWidth,this.barHeight,true,border);
				flixel_util_FlxGradient.overlayGradientOnBitmapData(this._emptyBar,this.barWidth - 2,this.barHeight - 2,empty,1,1,chunkSize,rotation);
			} else {
				this._emptyBar = flixel_util_FlxGradient.createGradientBitmapData(this.barWidth,this.barHeight,empty,chunkSize,rotation);
			}
			this._emptyBarRect.setTo(0,0,this.barWidth,this.barHeight);
			this.updateEmptyBar();
		}
		return this;
	}
	,createGradientFilledBar: function(fill,chunkSize,rotation,showBorder,border) {
		if(border == null) {
			border = -1;
		}
		if(showBorder == null) {
			showBorder = false;
		}
		if(rotation == null) {
			rotation = 180;
		}
		if(chunkSize == null) {
			chunkSize = 1;
		}
		if(flixel_FlxG.renderTile) {
			var filledKey = "Gradient:" + this.barWidth + "x" + this.barHeight + ",colors:[";
			var _g = 0;
			while(_g < fill.length) {
				var col = fill[_g];
				++_g;
				filledKey += "0x" + StringTools.hex(col >> 24 & 255,2) + StringTools.hex(col >> 16 & 255,2) + StringTools.hex(col >> 8 & 255,2) + StringTools.hex(col & 255,2) + ",";
			}
			filledKey += "],chunkSize: " + chunkSize + ",rotation: " + rotation;
			if(showBorder) {
				filledKey += ",border: " + ("0x" + StringTools.hex(border >> 24 & 255,2) + StringTools.hex(border >> 16 & 255,2) + StringTools.hex(border >> 8 & 255,2) + StringTools.hex(border & 255,2));
			}
			if(flixel_FlxG.bitmap._cache.h[filledKey] == null) {
				var filledBar = null;
				if(showBorder) {
					filledBar = new openfl_display_BitmapData(this.barWidth,this.barHeight,true,border);
					flixel_util_FlxGradient.overlayGradientOnBitmapData(filledBar,this.barWidth - 2,this.barHeight - 2,fill,1,1,chunkSize,rotation);
				} else {
					filledBar = flixel_util_FlxGradient.createGradientBitmapData(this.barWidth,this.barHeight,fill,chunkSize,rotation);
				}
				flixel_FlxG.bitmap.add(filledBar,false,filledKey);
			}
			this.set_frontFrames(flixel_FlxG.bitmap._cache.h[filledKey].get_imageFrame());
		} else {
			if(showBorder) {
				this._filledBar = new openfl_display_BitmapData(this.barWidth,this.barHeight,true,border);
				flixel_util_FlxGradient.overlayGradientOnBitmapData(this._filledBar,this.barWidth - 2,this.barHeight - 2,fill,1,1,chunkSize,rotation);
			} else {
				this._filledBar = flixel_util_FlxGradient.createGradientBitmapData(this.barWidth,this.barHeight,fill,chunkSize,rotation);
			}
			this._filledBarRect.setTo(0,0,this.barWidth,this.barHeight);
			this.updateFilledBar();
		}
		return this;
	}
	,createImageBar: function(empty,fill,emptyBackground,fillBackground) {
		if(fillBackground == null) {
			fillBackground = -16711936;
		}
		if(emptyBackground == null) {
			emptyBackground = -16777216;
		}
		this.createImageEmptyBar(empty,emptyBackground);
		this.createImageFilledBar(fill,fillBackground);
		return this;
	}
	,createImageEmptyBar: function(empty,emptyBackground) {
		if(emptyBackground == null) {
			emptyBackground = -16777216;
		}
		if(empty != null) {
			var emptyGraphic = flixel_FlxG.bitmap.add(empty);
			if(flixel_FlxG.renderTile) {
				this.set_frames(emptyGraphic.get_imageFrame());
			} else {
				this._emptyBar = emptyGraphic.bitmap.clone();
				this.barWidth = this._emptyBar.width;
				this.barHeight = this._emptyBar.height;
				this._emptyBarRect.setTo(0,0,this.barWidth,this.barHeight);
				if(this.graphic == null || (this.frame.sourceSize.x != this.barWidth || this.frame.sourceSize.y != this.barHeight)) {
					this.makeGraphic(this.barWidth,this.barHeight,0,true);
				}
				this.updateEmptyBar();
			}
		} else {
			this.createColoredEmptyBar(emptyBackground);
		}
		return this;
	}
	,createImageFilledBar: function(fill,fillBackground) {
		if(fillBackground == null) {
			fillBackground = -16711936;
		}
		if(fill != null) {
			var filledGraphic = flixel_FlxG.bitmap.add(fill);
			if(flixel_FlxG.renderTile) {
				this.set_frontFrames(filledGraphic.get_imageFrame());
			} else {
				this._filledBar = filledGraphic.bitmap.clone();
				this._filledBarRect.setTo(0,0,this.barWidth,this.barHeight);
				if(this.graphic == null || (this.frame.sourceSize.x != this.barWidth || this.frame.sourceSize.y != this.barHeight)) {
					this.makeGraphic(this.barWidth,this.barHeight,0,true);
				}
				this.pxPerPercent = this._fillHorizontal ? this.barWidth / this._maxPercent : this.barHeight / this._maxPercent;
				this.updateFilledBar();
			}
		} else {
			this.createColoredFilledBar(fillBackground);
		}
		return this;
	}
	,set_fillDirection: function(direction) {
		this.fillDirection = direction;
		switch(direction._hx_index) {
		case 2:case 3:case 6:case 7:
			this._fillHorizontal = false;
			break;
		case 0:case 1:case 4:case 5:
			this._fillHorizontal = true;
			break;
		}
		return this.fillDirection;
	}
	,updateValueFromParent: function() {
		this.set_value(Reflect.getProperty(this.parent,this.parentVariable));
	}
	,updateBar: function() {
		this.updateEmptyBar();
		this.updateFilledBar();
	}
	,updateEmptyBar: function() {
		if(flixel_FlxG.renderBlit) {
			this.get_pixels().copyPixels(this._emptyBar,this._emptyBarRect,this._zeroOffset);
			this.dirty = true;
		}
	}
	,updateFilledBar: function() {
		this._filledBarRect.width = this.barWidth;
		this._filledBarRect.height = this.barHeight;
		var fraction = (this.get_value() - this.min) / this.range;
		var percent = fraction * this._maxPercent;
		var maxScale = this._fillHorizontal ? this.barWidth : this.barHeight;
		var scaleInterval = maxScale / this.numDivisions;
		var interval = Math.round((fraction * maxScale / scaleInterval | 0) * scaleInterval);
		if(this._fillHorizontal) {
			this._filledBarRect.width = interval | 0;
		} else {
			this._filledBarRect.height = interval | 0;
		}
		if(percent > 0) {
			switch(this.fillDirection._hx_index) {
			case 1:
				this._filledBarRect.x = this.barWidth - this._filledBarRect.width;
				this._filledBarPoint.x = this.barWidth - this._filledBarRect.width;
				break;
			case 0:case 2:
				break;
			case 3:
				this._filledBarRect.y = this.barHeight - this._filledBarRect.height;
				this._filledBarPoint.y = this.barHeight - this._filledBarRect.height;
				break;
			case 4:
				this._filledBarRect.x = this.barWidth / 2 - this._filledBarRect.width / 2 | 0;
				this._filledBarPoint.x = this.barWidth / 2 - this._filledBarRect.width / 2 | 0;
				break;
			case 5:
				this._filledBarRect.width = maxScale - interval | 0;
				this._filledBarPoint.x = (this.barWidth - this._filledBarRect.width) / 2 | 0;
				break;
			case 6:
				this._filledBarRect.y = this.barHeight / 2 - this._filledBarRect.height / 2 | 0;
				this._filledBarPoint.y = this.barHeight / 2 - this._filledBarRect.height / 2 | 0;
				break;
			case 7:
				this._filledBarRect.height = maxScale - interval | 0;
				this._filledBarPoint.y = (this.barHeight - this._filledBarRect.height) / 2 | 0;
				break;
			}
			if(flixel_FlxG.renderBlit) {
				this.get_pixels().copyPixels(this._filledBar,this._filledBarRect,this._filledBarPoint,null,null,true);
			} else if(this.get_frontFrames() != null) {
				var _this = this._filledFlxRect;
				var FlashRect = this._filledBarRect;
				_this.x = FlashRect.x;
				_this.y = FlashRect.y;
				_this.width = FlashRect.width;
				_this.height = FlashRect.height;
				var _this1 = _this;
				_this1.x = Math.round(_this1.x);
				_this1.y = Math.round(_this1.y);
				_this1.width = Math.round(_this1.width);
				_this1.height = Math.round(_this1.height);
				if((percent | 0) > 0) {
					this._frontFrame = this.get_frontFrames().get_frame().clipTo(this._filledFlxRect,this._frontFrame);
				}
			}
		}
		if(flixel_FlxG.renderBlit) {
			this.dirty = true;
		}
	}
	,update: function(elapsed) {
		if(this.parent != null) {
			if(Reflect.getProperty(this.parent,this.parentVariable) != this.get_value()) {
				this.updateValueFromParent();
			}
			if(!this.fixedPosition) {
				this.set_x(this.parent.x + this.positionOffset.x);
				this.set_y(this.parent.y + this.positionOffset.y);
			}
		}
		flixel_FlxSprite.prototype.update.call(this,elapsed);
	}
	,draw: function() {
		flixel_FlxSprite.prototype.draw.call(this);
		if(!flixel_FlxG.renderTile) {
			return;
		}
		if(this.alpha == 0) {
			return;
		}
		if(this.get_percent() > 0 && this._frontFrame.type != 2) {
			var _g = 0;
			var _g1 = this.get_cameras();
			while(_g < _g1.length) {
				var camera = _g1[_g];
				++_g;
				if(!camera.visible || !camera.exists || !this.isOnScreen(camera)) {
					continue;
				}
				this.getScreenPosition(this._point,camera).subtractPoint(this.offset);
				this._frontFrame.prepareMatrix(this._matrix,0,this.flipX,this.flipY);
				this._matrix.translate(-this.origin.x,-this.origin.y);
				this._matrix.scale(this.scale.x,this.scale.y);
				if(this.angle != 0) {
					var _this = this._matrix;
					var cos = this._cosAngle;
					var sin = this._sinAngle;
					var a1 = _this.a * cos - _this.b * sin;
					_this.b = _this.a * sin + _this.b * cos;
					_this.a = a1;
					var c1 = _this.c * cos - _this.d * sin;
					_this.d = _this.c * sin + _this.d * cos;
					_this.c = c1;
					var tx1 = _this.tx * cos - _this.ty * sin;
					_this.ty = _this.tx * sin + _this.ty * cos;
					_this.tx = tx1;
				}
				var _this1 = this._point;
				var X = this.origin.x;
				var Y = this.origin.y;
				if(Y == null) {
					Y = 0;
				}
				if(X == null) {
					X = 0;
				}
				var _g2 = _this1;
				_g2.set_x(_g2.x + X);
				var _g3 = _this1;
				_g3.set_y(_g3.y + Y);
				if(this.isPixelPerfectRender(camera)) {
					var _this2 = this._point;
					_this2.set_x(Math.floor(_this2.x));
					_this2.set_y(Math.floor(_this2.y));
				}
				this._matrix.translate(this._point.x,this._point.y);
				camera.drawPixels(this._frontFrame,null,this._matrix,this.colorTransform,this.blend,this.antialiasing,this.shader);
			}
		}
	}
	,set_pixels: function(Pixels) {
		if(flixel_FlxG.renderTile) {
			return Pixels;
		} else {
			return flixel_FlxSprite.prototype.set_pixels.call(this,Pixels);
		}
	}
	,toString: function() {
		var value = this.min;
		var _this = flixel_util_LabelValuePair._pool.get();
		_this.label = "min";
		_this.value = value;
		var value = this.max;
		var _this1 = flixel_util_LabelValuePair._pool.get();
		_this1.label = "max";
		_this1.value = value;
		var value = this.range;
		var _this2 = flixel_util_LabelValuePair._pool.get();
		_this2.label = "range";
		_this2.value = value;
		var value = this.pct;
		var _this3 = flixel_util_LabelValuePair._pool.get();
		_this3.label = "%";
		_this3.value = value;
		var value = this.pxPerPercent;
		var _this4 = flixel_util_LabelValuePair._pool.get();
		_this4.label = "px/%";
		_this4.value = value;
		var value = this.get_value();
		var _this5 = flixel_util_LabelValuePair._pool.get();
		_this5.label = "value";
		_this5.value = value;
		return flixel_util_FlxStringUtil.getDebugString([_this,_this1,_this2,_this3,_this4,_this5]);
	}
	,get_percent: function() {
		if(this.get_value() > this.max) {
			return this._maxPercent;
		}
		return Math.floor((this.get_value() - this.min) / this.range * this._maxPercent);
	}
	,set_percent: function(newPct) {
		if(newPct >= 0 && newPct <= this._maxPercent) {
			this.set_value(this.pct * newPct);
		}
		return newPct;
	}
	,set_value: function(newValue) {
		this.value = Math.max(this.min,Math.min(newValue,this.max));
		if(this.get_value() == this.min && this.emptyCallback != null) {
			this.emptyCallback();
		}
		if(this.get_value() == this.max && this.filledCallback != null) {
			this.filledCallback();
		}
		if(this.get_value() == this.min && this.killOnEmpty) {
			this.kill();
		}
		this.updateBar();
		return newValue;
	}
	,get_value: function() {
		return this.value;
	}
	,set_numDivisions: function(newValue) {
		this.numDivisions = newValue > 0 ? newValue : 100;
		this.updateFilledBar();
		return newValue;
	}
	,get_frontFrames: function() {
		if(flixel_FlxG.renderTile) {
			return this.frontFrames;
		}
		return null;
	}
	,set_frontFrames: function(value) {
		if(flixel_FlxG.renderTile) {
			this.frontFrames = value;
			this._frontFrame = value != null ? value.get_frame().copyTo(this._frontFrame) : null;
		} else {
			this.createImageFilledBar(value.get_frame().paint());
		}
		return value;
	}
	,get_backFrames: function() {
		if(flixel_FlxG.renderTile) {
			return this.frames;
		}
		return null;
	}
	,set_backFrames: function(value) {
		if(flixel_FlxG.renderTile) {
			this.set_frames(value);
		} else {
			this.createImageEmptyBar(value.get_frame().paint());
		}
		return value;
	}
	,__class__: flixel_ui_FlxBar
	,__properties__: $extend(flixel_FlxSprite.prototype.__properties__,{set_fillDirection:"set_fillDirection",set_backFrames:"set_backFrames",get_backFrames:"get_backFrames",set_frontFrames:"set_frontFrames",get_frontFrames:"get_frontFrames",set_numDivisions:"set_numDivisions",set_value:"set_value",get_value:"get_value",set_percent:"set_percent",get_percent:"get_percent"})
});
var flixel_ui_FlxBarFillDirection = $hxEnums["flixel.ui.FlxBarFillDirection"] = { __ename__ : "flixel.ui.FlxBarFillDirection", __constructs__ : ["LEFT_TO_RIGHT","RIGHT_TO_LEFT","TOP_TO_BOTTOM","BOTTOM_TO_TOP","HORIZONTAL_INSIDE_OUT","HORIZONTAL_OUTSIDE_IN","VERTICAL_INSIDE_OUT","VERTICAL_OUTSIDE_IN"]
	,LEFT_TO_RIGHT: {_hx_index:0,__enum__:"flixel.ui.FlxBarFillDirection",toString:$estr}
	,RIGHT_TO_LEFT: {_hx_index:1,__enum__:"flixel.ui.FlxBarFillDirection",toString:$estr}
	,TOP_TO_BOTTOM: {_hx_index:2,__enum__:"flixel.ui.FlxBarFillDirection",toString:$estr}
	,BOTTOM_TO_TOP: {_hx_index:3,__enum__:"flixel.ui.FlxBarFillDirection",toString:$estr}
	,HORIZONTAL_INSIDE_OUT: {_hx_index:4,__enum__:"flixel.ui.FlxBarFillDirection",toString:$estr}
	,HORIZONTAL_OUTSIDE_IN: {_hx_index:5,__enum__:"flixel.ui.FlxBarFillDirection",toString:$estr}
	,VERTICAL_INSIDE_OUT: {_hx_index:6,__enum__:"flixel.ui.FlxBarFillDirection",toString:$estr}
	,VERTICAL_OUTSIDE_IN: {_hx_index:7,__enum__:"flixel.ui.FlxBarFillDirection",toString:$estr}
};
var flixel_ui_FlxTypedButton_$flixel_$text_$FlxText = function(X,Y,OnClick) {
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	this.lastStatus = -1;
	this.maxInputMovement = Infinity;
	this.mouseButtons = [-1];
	this.allowSwiping = true;
	this.statusAnimations = ["normal","highlight","pressed"];
	this.labelAlphas = [0.8,1.0,0.5];
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	var point1 = flixel_math_FlxPoint._pool.get().set(0,0);
	point1._inPool = false;
	var point2 = flixel_math_FlxPoint._pool.get().set(0,1);
	point2._inPool = false;
	this.labelOffsets = [point,point1,point2];
	flixel_FlxSprite.call(this,X,Y);
	this.loadDefaultGraphic();
	this.onUp = new flixel_ui__$FlxButton_FlxButtonEvent(OnClick);
	this.onDown = new flixel_ui__$FlxButton_FlxButtonEvent();
	this.onOver = new flixel_ui__$FlxButton_FlxButtonEvent();
	this.onOut = new flixel_ui__$FlxButton_FlxButtonEvent();
	this.set_status(0);
	this.scrollFactor.set();
	openfl_Lib.get_current().stage.addEventListener("mouseUp",$bind(this,this.onUpEventListener));
	this.input = new flixel_input_FlxInput(0);
};
$hxClasses["flixel.ui.FlxTypedButton_flixel_text_FlxText"] = flixel_ui_FlxTypedButton_$flixel_$text_$FlxText;
flixel_ui_FlxTypedButton_$flixel_$text_$FlxText.__name__ = "flixel.ui.FlxTypedButton_flixel_text_FlxText";
flixel_ui_FlxTypedButton_$flixel_$text_$FlxText.__interfaces__ = [flixel_input_IFlxInput];
flixel_ui_FlxTypedButton_$flixel_$text_$FlxText.__super__ = flixel_FlxSprite;
flixel_ui_FlxTypedButton_$flixel_$text_$FlxText.prototype = $extend(flixel_FlxSprite.prototype,{
	label: null
	,labelOffsets: null
	,labelAlphas: null
	,statusAnimations: null
	,allowSwiping: null
	,mouseButtons: null
	,maxInputMovement: null
	,status: null
	,onUp: null
	,onDown: null
	,onOver: null
	,onOut: null
	,_spriteLabel: null
	,input: null
	,currentInput: null
	,lastStatus: null
	,graphicLoaded: function() {
		flixel_FlxSprite.prototype.graphicLoaded.call(this);
		this.setupAnimation("normal",0);
		this.setupAnimation("highlight",1);
		this.setupAnimation("pressed",2);
	}
	,loadDefaultGraphic: function() {
		this.loadGraphic("flixel/images/ui/button.png",true,80,20);
	}
	,setupAnimation: function(animationName,frameIndex) {
		frameIndex = Math.min(frameIndex,this.animation._sprite.numFrames - 1) | 0;
		this.animation.add(animationName,[frameIndex]);
	}
	,destroy: function() {
		this.set_label(flixel_util_FlxDestroyUtil.destroy(this.label));
		this._spriteLabel = null;
		this.onUp = flixel_util_FlxDestroyUtil.destroy(this.onUp);
		this.onDown = flixel_util_FlxDestroyUtil.destroy(this.onDown);
		this.onOver = flixel_util_FlxDestroyUtil.destroy(this.onOver);
		this.onOut = flixel_util_FlxDestroyUtil.destroy(this.onOut);
		this.labelOffsets = flixel_util_FlxDestroyUtil.putArray(this.labelOffsets);
		this.labelAlphas = null;
		this.currentInput = null;
		this.input = null;
		openfl_Lib.get_current().stage.removeEventListener("mouseUp",$bind(this,this.onUpEventListener));
		flixel_FlxSprite.prototype.destroy.call(this);
	}
	,update: function(elapsed) {
		flixel_FlxSprite.prototype.update.call(this,elapsed);
		if(this.visible) {
			this.updateButton();
			if(this.lastStatus != this.status) {
				this.updateStatusAnimation();
				this.lastStatus = this.status;
			}
		}
		this.input.update();
	}
	,updateStatusAnimation: function() {
		this.animation.play(this.statusAnimations[this.status]);
	}
	,draw: function() {
		flixel_FlxSprite.prototype.draw.call(this);
		if(this._spriteLabel != null && this._spriteLabel.visible) {
			this._spriteLabel.set_cameras(this.get_cameras());
			this._spriteLabel.draw();
		}
	}
	,stampOnAtlas: function(atlas) {
		var buttonNode = atlas.addNode(this.graphic.bitmap,this.graphic.key);
		var result = buttonNode != null;
		if(buttonNode != null) {
			var buttonFrames = this.frames;
			var X = buttonFrames.tileSize.x;
			var Y = buttonFrames.tileSize.y;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			var tileSize = point;
			var tileFrames = buttonNode.getTileFrames(tileSize);
			this.set_frames(tileFrames);
		}
		if(result && this.label != null) {
			var labelNode = atlas.addNode(this.label.graphic.bitmap,this.label.graphic.key);
			result = result && labelNode != null;
			if(labelNode != null) {
				this.label.set_frames(labelNode.getImageFrame());
			}
		}
		return result;
	}
	,updateButton: function() {
		var overlapFound = this.checkMouseOverlap();
		if(!overlapFound) {
			overlapFound = this.checkTouchOverlap();
		}
		if(this.currentInput != null && this.currentInput.get_justReleased() && overlapFound) {
			this.onUpHandler();
		}
		if(this.status != 0 && (!overlapFound || this.currentInput != null && this.currentInput.get_justReleased())) {
			this.onOutHandler();
		}
	}
	,checkMouseOverlap: function() {
		var overlap = false;
		var _g = 0;
		var _g1 = this.get_cameras();
		while(_g < _g1.length) {
			var camera = _g1[_g];
			++_g;
			var _g2 = 0;
			var _g3 = this.mouseButtons;
			while(_g2 < _g3.length) {
				var buttonID = _g3[_g2];
				++_g2;
				var button = flixel_input_mouse_FlxMouseButton.getByID(buttonID);
				if(button != null && this.checkInput(flixel_FlxG.mouse,button,button.justPressedPosition,camera)) {
					overlap = true;
				}
			}
		}
		return overlap;
	}
	,checkTouchOverlap: function() {
		var overlap = false;
		var _g = 0;
		var _g1 = this.get_cameras();
		while(_g < _g1.length) {
			var camera = _g1[_g];
			++_g;
			var _g2 = 0;
			var _g3 = flixel_FlxG.touches.list;
			while(_g2 < _g3.length) {
				var touch = _g3[_g2];
				++_g2;
				if(this.checkInput(touch,touch,touch.justPressedPosition,camera)) {
					overlap = true;
				}
			}
		}
		return overlap;
	}
	,checkInput: function(pointer,input,justPressedPosition,camera) {
		var tmp;
		if(this.maxInputMovement != Infinity) {
			var X = 0;
			var Y = 0;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			var point1 = point;
			point1._weak = true;
			tmp = justPressedPosition.distanceTo(pointer.getScreenPosition(null,point1)) > this.maxInputMovement;
		} else {
			tmp = false;
		}
		if(tmp && input == this.currentInput) {
			this.currentInput = null;
		} else if(this.overlapsPoint(pointer.getWorldPosition(camera,this._point),true,camera)) {
			this.updateStatus(input);
			return true;
		}
		return false;
	}
	,updateStatus: function(input) {
		if(input.get_justPressed()) {
			this.currentInput = input;
			this.onDownHandler();
		} else if(this.status == 0) {
			if(this.allowSwiping && input.get_pressed()) {
				this.onDownHandler();
			} else {
				this.onOverHandler();
			}
		}
	}
	,updateLabelPosition: function() {
		if(this._spriteLabel != null) {
			this._spriteLabel.set_x((this.pixelPerfectPosition ? Math.floor(this.x) : this.x) + this.labelOffsets[this.status].x);
			this._spriteLabel.set_y((this.pixelPerfectPosition ? Math.floor(this.y) : this.y) + this.labelOffsets[this.status].y);
		}
	}
	,updateLabelAlpha: function() {
		if(this._spriteLabel != null && this.labelAlphas.length > this.status) {
			this._spriteLabel.set_alpha(this.alpha * this.labelAlphas[this.status]);
		}
	}
	,onUpEventListener: function(_) {
		if(this.visible && this.exists && this.active && this.status == 2) {
			this.onUpHandler();
		}
	}
	,onUpHandler: function() {
		this.set_status(0);
		this.input.release();
		this.currentInput = null;
		var _this = this.onUp;
		if(_this.callback != null) {
			_this.callback();
		}
		if(_this.sound != null) {
			_this.sound.play(true);
		}
	}
	,onDownHandler: function() {
		this.set_status(2);
		this.input.press();
		var _this = this.onDown;
		if(_this.callback != null) {
			_this.callback();
		}
		if(_this.sound != null) {
			_this.sound.play(true);
		}
	}
	,onOverHandler: function() {
		if(!flixel_FlxG.mouse.enabled) {
			this.set_status(0);
			return;
		}
		this.set_status(1);
		var _this = this.onOver;
		if(_this.callback != null) {
			_this.callback();
		}
		if(_this.sound != null) {
			_this.sound.play(true);
		}
	}
	,onOutHandler: function() {
		this.set_status(0);
		this.input.release();
		var _this = this.onOut;
		if(_this.callback != null) {
			_this.callback();
		}
		if(_this.sound != null) {
			_this.sound.play(true);
		}
	}
	,set_label: function(Value) {
		if(Value != null) {
			Value.scrollFactor.put();
			Value.scrollFactor = this.scrollFactor;
		}
		this.label = Value;
		this._spriteLabel = this.label;
		this.updateLabelPosition();
		return Value;
	}
	,set_status: function(Value) {
		this.status = Value;
		this.updateLabelAlpha();
		return this.status;
	}
	,set_alpha: function(Value) {
		flixel_FlxSprite.prototype.set_alpha.call(this,Value);
		this.updateLabelAlpha();
		return this.alpha;
	}
	,set_x: function(Value) {
		flixel_FlxSprite.prototype.set_x.call(this,Value);
		this.updateLabelPosition();
		return this.x;
	}
	,set_y: function(Value) {
		flixel_FlxSprite.prototype.set_y.call(this,Value);
		this.updateLabelPosition();
		return this.y;
	}
	,get_justReleased: function() {
		return this.input.current == -1;
	}
	,get_released: function() {
		var _this = this.input;
		if(_this.current != 0) {
			return _this.current == -1;
		} else {
			return true;
		}
	}
	,get_pressed: function() {
		var _this = this.input;
		if(_this.current != 1) {
			return _this.current == 2;
		} else {
			return true;
		}
	}
	,get_justPressed: function() {
		return this.input.current == 2;
	}
	,__class__: flixel_ui_FlxTypedButton_$flixel_$text_$FlxText
	,__properties__: $extend(flixel_FlxSprite.prototype.__properties__,{get_justPressed:"get_justPressed",get_pressed:"get_pressed",get_released:"get_released",get_justReleased:"get_justReleased",set_status:"set_status",set_label:"set_label"})
});
var flixel_ui_FlxButton = function(X,Y,Text1,OnClick) {
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	flixel_ui_FlxTypedButton_$flixel_$text_$FlxText.call(this,X,Y,OnClick);
	var _g = 0;
	var _g1 = this.labelOffsets;
	while(_g < _g1.length) {
		var point = _g1[_g];
		++_g;
		point.set(point.x - 1,point.y + 3);
	}
	if(Text1 != null) {
		this.set_label(new flixel_text_FlxText(this.x + this.labelOffsets[0].x,this.y + this.labelOffsets[0].y,80,Text1));
		this.label.setFormat(null,8,3355443,"center");
		this.label.set_alpha(this.labelAlphas[this.status]);
		this.label.drawFrame(true);
	}
};
$hxClasses["flixel.ui.FlxButton"] = flixel_ui_FlxButton;
flixel_ui_FlxButton.__name__ = "flixel.ui.FlxButton";
flixel_ui_FlxButton.__super__ = flixel_ui_FlxTypedButton_$flixel_$text_$FlxText;
flixel_ui_FlxButton.prototype = $extend(flixel_ui_FlxTypedButton_$flixel_$text_$FlxText.prototype,{
	resetHelpers: function() {
		flixel_ui_FlxTypedButton_$flixel_$text_$FlxText.prototype.resetHelpers.call(this);
		if(this.label != null) {
			var tmp = this.label;
			var tmp1 = this.get_width() | 0;
			tmp.set_fieldWidth(this.label.frameWidth = tmp1);
			this.label.set_size(this.label._defaultFormat.size | 0);
		}
	}
	,initLabel: function(Text1) {
		if(Text1 != null) {
			this.set_label(new flixel_text_FlxText(this.x + this.labelOffsets[0].x,this.y + this.labelOffsets[0].y,80,Text1));
			this.label.setFormat(null,8,3355443,"center");
			this.label.set_alpha(this.labelAlphas[this.status]);
			this.label.drawFrame(true);
		}
	}
	,get_text: function() {
		if(this.label != null) {
			return this.label.text;
		} else {
			return null;
		}
	}
	,set_text: function(Text1) {
		if(this.label == null) {
			if(Text1 != null) {
				this.set_label(new flixel_text_FlxText(this.x + this.labelOffsets[0].x,this.y + this.labelOffsets[0].y,80,Text1));
				this.label.setFormat(null,8,3355443,"center");
				this.label.set_alpha(this.labelAlphas[this.status]);
				this.label.drawFrame(true);
			}
		} else {
			this.label.set_text(Text1);
		}
		return Text1;
	}
	,__class__: flixel_ui_FlxButton
	,__properties__: $extend(flixel_ui_FlxTypedButton_$flixel_$text_$FlxText.prototype.__properties__,{set_text:"set_text",get_text:"get_text"})
});
var flixel_ui_FlxTypedButton = function(X,Y,OnClick) {
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	this.lastStatus = -1;
	this.maxInputMovement = Infinity;
	this.mouseButtons = [-1];
	this.allowSwiping = true;
	this.statusAnimations = ["normal","highlight","pressed"];
	this.labelAlphas = [0.8,1.0,0.5];
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	var point1 = flixel_math_FlxPoint._pool.get().set(0,0);
	point1._inPool = false;
	var point2 = flixel_math_FlxPoint._pool.get().set(0,1);
	point2._inPool = false;
	this.labelOffsets = [point,point1,point2];
	flixel_FlxSprite.call(this,X,Y);
	this.loadDefaultGraphic();
	this.onUp = new flixel_ui__$FlxButton_FlxButtonEvent(OnClick);
	this.onDown = new flixel_ui__$FlxButton_FlxButtonEvent();
	this.onOver = new flixel_ui__$FlxButton_FlxButtonEvent();
	this.onOut = new flixel_ui__$FlxButton_FlxButtonEvent();
	this.set_status(0);
	this.scrollFactor.set();
	openfl_Lib.get_current().stage.addEventListener("mouseUp",$bind(this,this.onUpEventListener));
	this.input = new flixel_input_FlxInput(0);
};
$hxClasses["flixel.ui.FlxTypedButton"] = flixel_ui_FlxTypedButton;
flixel_ui_FlxTypedButton.__name__ = "flixel.ui.FlxTypedButton";
flixel_ui_FlxTypedButton.__interfaces__ = [flixel_input_IFlxInput];
flixel_ui_FlxTypedButton.__super__ = flixel_FlxSprite;
flixel_ui_FlxTypedButton.prototype = $extend(flixel_FlxSprite.prototype,{
	label: null
	,labelOffsets: null
	,labelAlphas: null
	,statusAnimations: null
	,allowSwiping: null
	,mouseButtons: null
	,maxInputMovement: null
	,status: null
	,onUp: null
	,onDown: null
	,onOver: null
	,onOut: null
	,_spriteLabel: null
	,input: null
	,currentInput: null
	,lastStatus: null
	,graphicLoaded: function() {
		flixel_FlxSprite.prototype.graphicLoaded.call(this);
		this.setupAnimation("normal",0);
		this.setupAnimation("highlight",1);
		this.setupAnimation("pressed",2);
	}
	,loadDefaultGraphic: function() {
		this.loadGraphic("flixel/images/ui/button.png",true,80,20);
	}
	,setupAnimation: function(animationName,frameIndex) {
		frameIndex = Math.min(frameIndex,this.animation._sprite.numFrames - 1) | 0;
		this.animation.add(animationName,[frameIndex]);
	}
	,destroy: function() {
		this.set_label(flixel_util_FlxDestroyUtil.destroy(this.label));
		this._spriteLabel = null;
		this.onUp = flixel_util_FlxDestroyUtil.destroy(this.onUp);
		this.onDown = flixel_util_FlxDestroyUtil.destroy(this.onDown);
		this.onOver = flixel_util_FlxDestroyUtil.destroy(this.onOver);
		this.onOut = flixel_util_FlxDestroyUtil.destroy(this.onOut);
		this.labelOffsets = flixel_util_FlxDestroyUtil.putArray(this.labelOffsets);
		this.labelAlphas = null;
		this.currentInput = null;
		this.input = null;
		openfl_Lib.get_current().stage.removeEventListener("mouseUp",$bind(this,this.onUpEventListener));
		flixel_FlxSprite.prototype.destroy.call(this);
	}
	,update: function(elapsed) {
		flixel_FlxSprite.prototype.update.call(this,elapsed);
		if(this.visible) {
			this.updateButton();
			if(this.lastStatus != this.status) {
				this.updateStatusAnimation();
				this.lastStatus = this.status;
			}
		}
		this.input.update();
	}
	,updateStatusAnimation: function() {
		this.animation.play(this.statusAnimations[this.status]);
	}
	,draw: function() {
		flixel_FlxSprite.prototype.draw.call(this);
		if(this._spriteLabel != null && this._spriteLabel.visible) {
			this._spriteLabel.set_cameras(this.get_cameras());
			this._spriteLabel.draw();
		}
	}
	,stampOnAtlas: function(atlas) {
		var buttonNode = atlas.addNode(this.graphic.bitmap,this.graphic.key);
		var result = buttonNode != null;
		if(buttonNode != null) {
			var buttonFrames = this.frames;
			var X = buttonFrames.tileSize.x;
			var Y = buttonFrames.tileSize.y;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			var tileSize = point;
			var tileFrames = buttonNode.getTileFrames(tileSize);
			this.set_frames(tileFrames);
		}
		if(result && this.label != null) {
			var labelNode = atlas.addNode(this.label.graphic.bitmap,this.label.graphic.key);
			result = result && labelNode != null;
			if(labelNode != null) {
				this.label.set_frames(labelNode.getImageFrame());
			}
		}
		return result;
	}
	,updateButton: function() {
		var overlapFound = this.checkMouseOverlap();
		if(!overlapFound) {
			overlapFound = this.checkTouchOverlap();
		}
		if(this.currentInput != null && this.currentInput.get_justReleased() && overlapFound) {
			this.onUpHandler();
		}
		if(this.status != 0 && (!overlapFound || this.currentInput != null && this.currentInput.get_justReleased())) {
			this.onOutHandler();
		}
	}
	,checkMouseOverlap: function() {
		var overlap = false;
		var _g = 0;
		var _g1 = this.get_cameras();
		while(_g < _g1.length) {
			var camera = _g1[_g];
			++_g;
			var _g2 = 0;
			var _g3 = this.mouseButtons;
			while(_g2 < _g3.length) {
				var buttonID = _g3[_g2];
				++_g2;
				var button = flixel_input_mouse_FlxMouseButton.getByID(buttonID);
				if(button != null && this.checkInput(flixel_FlxG.mouse,button,button.justPressedPosition,camera)) {
					overlap = true;
				}
			}
		}
		return overlap;
	}
	,checkTouchOverlap: function() {
		var overlap = false;
		var _g = 0;
		var _g1 = this.get_cameras();
		while(_g < _g1.length) {
			var camera = _g1[_g];
			++_g;
			var _g2 = 0;
			var _g3 = flixel_FlxG.touches.list;
			while(_g2 < _g3.length) {
				var touch = _g3[_g2];
				++_g2;
				if(this.checkInput(touch,touch,touch.justPressedPosition,camera)) {
					overlap = true;
				}
			}
		}
		return overlap;
	}
	,checkInput: function(pointer,input,justPressedPosition,camera) {
		var tmp;
		if(this.maxInputMovement != Infinity) {
			var X = 0;
			var Y = 0;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			var point1 = point;
			point1._weak = true;
			tmp = justPressedPosition.distanceTo(pointer.getScreenPosition(null,point1)) > this.maxInputMovement;
		} else {
			tmp = false;
		}
		if(tmp && input == this.currentInput) {
			this.currentInput = null;
		} else if(this.overlapsPoint(pointer.getWorldPosition(camera,this._point),true,camera)) {
			this.updateStatus(input);
			return true;
		}
		return false;
	}
	,updateStatus: function(input) {
		if(input.get_justPressed()) {
			this.currentInput = input;
			this.onDownHandler();
		} else if(this.status == 0) {
			if(this.allowSwiping && input.get_pressed()) {
				this.onDownHandler();
			} else {
				this.onOverHandler();
			}
		}
	}
	,updateLabelPosition: function() {
		if(this._spriteLabel != null) {
			this._spriteLabel.set_x((this.pixelPerfectPosition ? Math.floor(this.x) : this.x) + this.labelOffsets[this.status].x);
			this._spriteLabel.set_y((this.pixelPerfectPosition ? Math.floor(this.y) : this.y) + this.labelOffsets[this.status].y);
		}
	}
	,updateLabelAlpha: function() {
		if(this._spriteLabel != null && this.labelAlphas.length > this.status) {
			this._spriteLabel.set_alpha(this.alpha * this.labelAlphas[this.status]);
		}
	}
	,onUpEventListener: function(_) {
		if(this.visible && this.exists && this.active && this.status == 2) {
			this.onUpHandler();
		}
	}
	,onUpHandler: function() {
		this.set_status(0);
		this.input.release();
		this.currentInput = null;
		var _this = this.onUp;
		if(_this.callback != null) {
			_this.callback();
		}
		if(_this.sound != null) {
			_this.sound.play(true);
		}
	}
	,onDownHandler: function() {
		this.set_status(2);
		this.input.press();
		var _this = this.onDown;
		if(_this.callback != null) {
			_this.callback();
		}
		if(_this.sound != null) {
			_this.sound.play(true);
		}
	}
	,onOverHandler: function() {
		if(!flixel_FlxG.mouse.enabled) {
			this.set_status(0);
			return;
		}
		this.set_status(1);
		var _this = this.onOver;
		if(_this.callback != null) {
			_this.callback();
		}
		if(_this.sound != null) {
			_this.sound.play(true);
		}
	}
	,onOutHandler: function() {
		this.set_status(0);
		this.input.release();
		var _this = this.onOut;
		if(_this.callback != null) {
			_this.callback();
		}
		if(_this.sound != null) {
			_this.sound.play(true);
		}
	}
	,set_label: function(Value) {
		if(Value != null) {
			Value.scrollFactor.put();
			Value.scrollFactor = this.scrollFactor;
		}
		this.label = Value;
		this._spriteLabel = this.label;
		this.updateLabelPosition();
		return Value;
	}
	,set_status: function(Value) {
		this.status = Value;
		this.updateLabelAlpha();
		return this.status;
	}
	,set_alpha: function(Value) {
		flixel_FlxSprite.prototype.set_alpha.call(this,Value);
		this.updateLabelAlpha();
		return this.alpha;
	}
	,set_x: function(Value) {
		flixel_FlxSprite.prototype.set_x.call(this,Value);
		this.updateLabelPosition();
		return this.x;
	}
	,set_y: function(Value) {
		flixel_FlxSprite.prototype.set_y.call(this,Value);
		this.updateLabelPosition();
		return this.y;
	}
	,get_justReleased: function() {
		return this.input.current == -1;
	}
	,get_released: function() {
		var _this = this.input;
		if(_this.current != 0) {
			return _this.current == -1;
		} else {
			return true;
		}
	}
	,get_pressed: function() {
		var _this = this.input;
		if(_this.current != 1) {
			return _this.current == 2;
		} else {
			return true;
		}
	}
	,get_justPressed: function() {
		return this.input.current == 2;
	}
	,__class__: flixel_ui_FlxTypedButton
	,__properties__: $extend(flixel_FlxSprite.prototype.__properties__,{get_justPressed:"get_justPressed",get_pressed:"get_pressed",get_released:"get_released",get_justReleased:"get_justReleased",set_status:"set_status",set_label:"set_label"})
});
var flixel_ui__$FlxButton_FlxButtonEvent = function(Callback,sound) {
	this.callback = Callback;
	this.sound = sound;
};
$hxClasses["flixel.ui._FlxButton.FlxButtonEvent"] = flixel_ui__$FlxButton_FlxButtonEvent;
flixel_ui__$FlxButton_FlxButtonEvent.__name__ = "flixel.ui._FlxButton.FlxButtonEvent";
flixel_ui__$FlxButton_FlxButtonEvent.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_ui__$FlxButton_FlxButtonEvent.prototype = {
	callback: null
	,sound: null
	,destroy: function() {
		this.callback = null;
		this.sound = flixel_util_FlxDestroyUtil.destroy(this.sound);
	}
	,fire: function() {
		if(this.callback != null) {
			this.callback();
		}
		if(this.sound != null) {
			this.sound.play(true);
		}
	}
	,__class__: flixel_ui__$FlxButton_FlxButtonEvent
};
var flixel_ui_FlxTypedButton_$flixel_$FlxSprite = function(X,Y,OnClick) {
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	this.lastStatus = -1;
	this.maxInputMovement = Infinity;
	this.mouseButtons = [-1];
	this.allowSwiping = true;
	this.statusAnimations = ["normal","highlight","pressed"];
	this.labelAlphas = [0.8,1.0,0.5];
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	var point1 = flixel_math_FlxPoint._pool.get().set(0,0);
	point1._inPool = false;
	var point2 = flixel_math_FlxPoint._pool.get().set(0,1);
	point2._inPool = false;
	this.labelOffsets = [point,point1,point2];
	flixel_FlxSprite.call(this,X,Y);
	this.loadDefaultGraphic();
	this.onUp = new flixel_ui__$FlxButton_FlxButtonEvent(OnClick);
	this.onDown = new flixel_ui__$FlxButton_FlxButtonEvent();
	this.onOver = new flixel_ui__$FlxButton_FlxButtonEvent();
	this.onOut = new flixel_ui__$FlxButton_FlxButtonEvent();
	this.set_status(0);
	this.scrollFactor.set();
	openfl_Lib.get_current().stage.addEventListener("mouseUp",$bind(this,this.onUpEventListener));
	this.input = new flixel_input_FlxInput(0);
};
$hxClasses["flixel.ui.FlxTypedButton_flixel_FlxSprite"] = flixel_ui_FlxTypedButton_$flixel_$FlxSprite;
flixel_ui_FlxTypedButton_$flixel_$FlxSprite.__name__ = "flixel.ui.FlxTypedButton_flixel_FlxSprite";
flixel_ui_FlxTypedButton_$flixel_$FlxSprite.__interfaces__ = [flixel_input_IFlxInput];
flixel_ui_FlxTypedButton_$flixel_$FlxSprite.__super__ = flixel_FlxSprite;
flixel_ui_FlxTypedButton_$flixel_$FlxSprite.prototype = $extend(flixel_FlxSprite.prototype,{
	label: null
	,labelOffsets: null
	,labelAlphas: null
	,statusAnimations: null
	,allowSwiping: null
	,mouseButtons: null
	,maxInputMovement: null
	,status: null
	,onUp: null
	,onDown: null
	,onOver: null
	,onOut: null
	,_spriteLabel: null
	,input: null
	,currentInput: null
	,lastStatus: null
	,graphicLoaded: function() {
		flixel_FlxSprite.prototype.graphicLoaded.call(this);
		this.setupAnimation("normal",0);
		this.setupAnimation("highlight",1);
		this.setupAnimation("pressed",2);
	}
	,loadDefaultGraphic: function() {
		this.loadGraphic("flixel/images/ui/button.png",true,80,20);
	}
	,setupAnimation: function(animationName,frameIndex) {
		frameIndex = Math.min(frameIndex,this.animation._sprite.numFrames - 1) | 0;
		this.animation.add(animationName,[frameIndex]);
	}
	,destroy: function() {
		this.set_label(flixel_util_FlxDestroyUtil.destroy(this.label));
		this._spriteLabel = null;
		this.onUp = flixel_util_FlxDestroyUtil.destroy(this.onUp);
		this.onDown = flixel_util_FlxDestroyUtil.destroy(this.onDown);
		this.onOver = flixel_util_FlxDestroyUtil.destroy(this.onOver);
		this.onOut = flixel_util_FlxDestroyUtil.destroy(this.onOut);
		this.labelOffsets = flixel_util_FlxDestroyUtil.putArray(this.labelOffsets);
		this.labelAlphas = null;
		this.currentInput = null;
		this.input = null;
		openfl_Lib.get_current().stage.removeEventListener("mouseUp",$bind(this,this.onUpEventListener));
		flixel_FlxSprite.prototype.destroy.call(this);
	}
	,update: function(elapsed) {
		flixel_FlxSprite.prototype.update.call(this,elapsed);
		if(this.visible) {
			this.updateButton();
			if(this.lastStatus != this.status) {
				this.updateStatusAnimation();
				this.lastStatus = this.status;
			}
		}
		this.input.update();
	}
	,updateStatusAnimation: function() {
		this.animation.play(this.statusAnimations[this.status]);
	}
	,draw: function() {
		flixel_FlxSprite.prototype.draw.call(this);
		if(this._spriteLabel != null && this._spriteLabel.visible) {
			this._spriteLabel.set_cameras(this.get_cameras());
			this._spriteLabel.draw();
		}
	}
	,stampOnAtlas: function(atlas) {
		var buttonNode = atlas.addNode(this.graphic.bitmap,this.graphic.key);
		var result = buttonNode != null;
		if(buttonNode != null) {
			var buttonFrames = this.frames;
			var X = buttonFrames.tileSize.x;
			var Y = buttonFrames.tileSize.y;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			var tileSize = point;
			var tileFrames = buttonNode.getTileFrames(tileSize);
			this.set_frames(tileFrames);
		}
		if(result && this.label != null) {
			var labelNode = atlas.addNode(this.label.graphic.bitmap,this.label.graphic.key);
			result = result && labelNode != null;
			if(labelNode != null) {
				this.label.set_frames(labelNode.getImageFrame());
			}
		}
		return result;
	}
	,updateButton: function() {
		var overlapFound = this.checkMouseOverlap();
		if(!overlapFound) {
			overlapFound = this.checkTouchOverlap();
		}
		if(this.currentInput != null && this.currentInput.get_justReleased() && overlapFound) {
			this.onUpHandler();
		}
		if(this.status != 0 && (!overlapFound || this.currentInput != null && this.currentInput.get_justReleased())) {
			this.onOutHandler();
		}
	}
	,checkMouseOverlap: function() {
		var overlap = false;
		var _g = 0;
		var _g1 = this.get_cameras();
		while(_g < _g1.length) {
			var camera = _g1[_g];
			++_g;
			var _g2 = 0;
			var _g3 = this.mouseButtons;
			while(_g2 < _g3.length) {
				var buttonID = _g3[_g2];
				++_g2;
				var button = flixel_input_mouse_FlxMouseButton.getByID(buttonID);
				if(button != null && this.checkInput(flixel_FlxG.mouse,button,button.justPressedPosition,camera)) {
					overlap = true;
				}
			}
		}
		return overlap;
	}
	,checkTouchOverlap: function() {
		var overlap = false;
		var _g = 0;
		var _g1 = this.get_cameras();
		while(_g < _g1.length) {
			var camera = _g1[_g];
			++_g;
			var _g2 = 0;
			var _g3 = flixel_FlxG.touches.list;
			while(_g2 < _g3.length) {
				var touch = _g3[_g2];
				++_g2;
				if(this.checkInput(touch,touch,touch.justPressedPosition,camera)) {
					overlap = true;
				}
			}
		}
		return overlap;
	}
	,checkInput: function(pointer,input,justPressedPosition,camera) {
		var tmp;
		if(this.maxInputMovement != Infinity) {
			var X = 0;
			var Y = 0;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			var point1 = point;
			point1._weak = true;
			tmp = justPressedPosition.distanceTo(pointer.getScreenPosition(null,point1)) > this.maxInputMovement;
		} else {
			tmp = false;
		}
		if(tmp && input == this.currentInput) {
			this.currentInput = null;
		} else if(this.overlapsPoint(pointer.getWorldPosition(camera,this._point),true,camera)) {
			this.updateStatus(input);
			return true;
		}
		return false;
	}
	,updateStatus: function(input) {
		if(input.get_justPressed()) {
			this.currentInput = input;
			this.onDownHandler();
		} else if(this.status == 0) {
			if(this.allowSwiping && input.get_pressed()) {
				this.onDownHandler();
			} else {
				this.onOverHandler();
			}
		}
	}
	,updateLabelPosition: function() {
		if(this._spriteLabel != null) {
			this._spriteLabel.set_x((this.pixelPerfectPosition ? Math.floor(this.x) : this.x) + this.labelOffsets[this.status].x);
			this._spriteLabel.set_y((this.pixelPerfectPosition ? Math.floor(this.y) : this.y) + this.labelOffsets[this.status].y);
		}
	}
	,updateLabelAlpha: function() {
		if(this._spriteLabel != null && this.labelAlphas.length > this.status) {
			this._spriteLabel.set_alpha(this.alpha * this.labelAlphas[this.status]);
		}
	}
	,onUpEventListener: function(_) {
		if(this.visible && this.exists && this.active && this.status == 2) {
			this.onUpHandler();
		}
	}
	,onUpHandler: function() {
		this.set_status(0);
		this.input.release();
		this.currentInput = null;
		var _this = this.onUp;
		if(_this.callback != null) {
			_this.callback();
		}
		if(_this.sound != null) {
			_this.sound.play(true);
		}
	}
	,onDownHandler: function() {
		this.set_status(2);
		this.input.press();
		var _this = this.onDown;
		if(_this.callback != null) {
			_this.callback();
		}
		if(_this.sound != null) {
			_this.sound.play(true);
		}
	}
	,onOverHandler: function() {
		if(!flixel_FlxG.mouse.enabled) {
			this.set_status(0);
			return;
		}
		this.set_status(1);
		var _this = this.onOver;
		if(_this.callback != null) {
			_this.callback();
		}
		if(_this.sound != null) {
			_this.sound.play(true);
		}
	}
	,onOutHandler: function() {
		this.set_status(0);
		this.input.release();
		var _this = this.onOut;
		if(_this.callback != null) {
			_this.callback();
		}
		if(_this.sound != null) {
			_this.sound.play(true);
		}
	}
	,set_label: function(Value) {
		if(Value != null) {
			Value.scrollFactor.put();
			Value.scrollFactor = this.scrollFactor;
		}
		this.label = Value;
		this._spriteLabel = this.label;
		this.updateLabelPosition();
		return Value;
	}
	,set_status: function(Value) {
		this.status = Value;
		this.updateLabelAlpha();
		return this.status;
	}
	,set_alpha: function(Value) {
		flixel_FlxSprite.prototype.set_alpha.call(this,Value);
		this.updateLabelAlpha();
		return this.alpha;
	}
	,set_x: function(Value) {
		flixel_FlxSprite.prototype.set_x.call(this,Value);
		this.updateLabelPosition();
		return this.x;
	}
	,set_y: function(Value) {
		flixel_FlxSprite.prototype.set_y.call(this,Value);
		this.updateLabelPosition();
		return this.y;
	}
	,get_justReleased: function() {
		return this.input.current == -1;
	}
	,get_released: function() {
		var _this = this.input;
		if(_this.current != 0) {
			return _this.current == -1;
		} else {
			return true;
		}
	}
	,get_pressed: function() {
		var _this = this.input;
		if(_this.current != 1) {
			return _this.current == 2;
		} else {
			return true;
		}
	}
	,get_justPressed: function() {
		return this.input.current == 2;
	}
	,__class__: flixel_ui_FlxTypedButton_$flixel_$FlxSprite
	,__properties__: $extend(flixel_FlxSprite.prototype.__properties__,{get_justPressed:"get_justPressed",get_pressed:"get_pressed",get_released:"get_released",get_justReleased:"get_justReleased",set_status:"set_status",set_label:"set_label"})
});
var flixel_ui_FlxSpriteButton = function(X,Y,Label,OnClick) {
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	flixel_ui_FlxTypedButton_$flixel_$FlxSprite.call(this,X,Y,OnClick);
	var _g = 0;
	var _g1 = this.labelOffsets;
	while(_g < _g1.length) {
		var point = _g1[_g];
		++_g;
		point.set(point.x - 1,point.y + 4);
	}
	this.set_label(Label);
};
$hxClasses["flixel.ui.FlxSpriteButton"] = flixel_ui_FlxSpriteButton;
flixel_ui_FlxSpriteButton.__name__ = "flixel.ui.FlxSpriteButton";
flixel_ui_FlxSpriteButton.__interfaces__ = [flixel_input_IFlxInput];
flixel_ui_FlxSpriteButton.__super__ = flixel_ui_FlxTypedButton_$flixel_$FlxSprite;
flixel_ui_FlxSpriteButton.prototype = $extend(flixel_ui_FlxTypedButton_$flixel_$FlxSprite.prototype,{
	createTextLabel: function(Text1,font,size,color,align) {
		if(align == null) {
			align = "center";
		}
		if(color == null) {
			color = 3355443;
		}
		if(size == null) {
			size = 8;
		}
		if(Text1 != null) {
			var text = new flixel_text_FlxText(0,0,this.frameWidth,Text1);
			text.setFormat(font,size,color,align);
			text.set_alpha(this.labelAlphas[this.status]);
			text.drawFrame(true);
			var labelBitmap = text.graphic.bitmap.clone();
			var labelKey = text.graphic.key;
			text.destroy();
			if(this.label == null) {
				this.set_label(new flixel_FlxSprite());
			}
			var labelGraphic = flixel_FlxG.bitmap.add(labelBitmap,false,labelKey);
			this.label.set_frames(flixel_graphics_frames_FlxImageFrame.fromGraphic(labelGraphic));
		}
		return this;
	}
	,__class__: flixel_ui_FlxSpriteButton
});
var flixel_util_FlxArrayUtil = function() { };
$hxClasses["flixel.util.FlxArrayUtil"] = flixel_util_FlxArrayUtil;
flixel_util_FlxArrayUtil.__name__ = "flixel.util.FlxArrayUtil";
flixel_util_FlxArrayUtil.setLength_Int = function(array,newLength) {
	if(newLength < 0) {
		return array;
	}
	var oldLength = array.length;
	var diff = newLength - oldLength;
	if(diff >= 0) {
		return array;
	}
	diff = -diff;
	var _g = 0;
	var _g1 = diff;
	while(_g < _g1) {
		var i = _g++;
		array.pop();
	}
	return array;
};
flixel_util_FlxArrayUtil.flatten2DArray_Int = function(array) {
	var result = [];
	var _g = 0;
	while(_g < array.length) {
		var innerArray = array[_g];
		++_g;
		var _g1 = 0;
		while(_g1 < innerArray.length) {
			var element = innerArray[_g1];
			++_g1;
			result.push(element);
		}
	}
	return result;
};
flixel_util_FlxArrayUtil.fastSplice_flixel_util_FlxTimer = function(array,element) {
	var index = array.indexOf(element);
	if(index != -1) {
		array[index] = array[array.length - 1];
		array.pop();
		return array;
	}
	return array;
};
flixel_util_FlxArrayUtil.fastSplice_flixel_tweens_FlxTween = function(array,element) {
	var index = array.indexOf(element);
	if(index != -1) {
		array[index] = array[array.length - 1];
		array.pop();
		return array;
	}
	return array;
};
flixel_util_FlxArrayUtil.swapAndPop_fastSplice_T = function(array,index) {
	array[index] = array[array.length - 1];
	array.pop();
	return array;
};
flixel_util_FlxArrayUtil.setLength_flixel_group_FlxTypedGroup_T = function(array,newLength) {
	if(newLength < 0) {
		return array;
	}
	var oldLength = array.length;
	var diff = newLength - oldLength;
	if(diff >= 0) {
		return array;
	}
	diff = -diff;
	var _g = 0;
	var _g1 = diff;
	while(_g < _g1) {
		var i = _g++;
		array.pop();
	}
	return array;
};
flixel_util_FlxArrayUtil.clearArray = function(array,recursive) {
	if(recursive == null) {
		recursive = false;
	}
	if(array == null) {
		return array;
	}
	if(recursive) {
		while(array.length > 0) {
			var thing = array.pop();
			if(((thing) instanceof Array)) {
				flixel_util_FlxArrayUtil.clearArray(array,recursive);
			}
		}
	} else {
		while(array.length > 0) array.pop();
	}
	return array;
};
flixel_util_FlxArrayUtil.equals = function(array1,array2) {
	if(array1 == null && array2 == null) {
		return true;
	}
	if(array1 == null && array2 != null) {
		return false;
	}
	if(array1 != null && array2 == null) {
		return false;
	}
	if(array1.length != array2.length) {
		return false;
	}
	var _g = 0;
	var _g1 = array1.length;
	while(_g < _g1) {
		var i = _g++;
		if(array1[i] != array2[i]) {
			return false;
		}
	}
	return true;
};
flixel_util_FlxArrayUtil.last = function(array) {
	if(array == null || array.length == 0) {
		return null;
	}
	return array[array.length - 1];
};
flixel_util_FlxArrayUtil.safePush = function(array,element) {
	if(array == null) {
		array = [];
	}
	array.push(element);
	return array;
};
flixel_util_FlxArrayUtil.contains = function(array,element) {
	return array.indexOf(element) != -1;
};
var flixel_util_FlxAxes = $hxEnums["flixel.util.FlxAxes"] = { __ename__ : "flixel.util.FlxAxes", __constructs__ : ["X","Y","XY"]
	,X: {_hx_index:0,__enum__:"flixel.util.FlxAxes",toString:$estr}
	,Y: {_hx_index:1,__enum__:"flixel.util.FlxAxes",toString:$estr}
	,XY: {_hx_index:2,__enum__:"flixel.util.FlxAxes",toString:$estr}
};
var flixel_util_FlxBitmapDataPool = function() { };
$hxClasses["flixel.util.FlxBitmapDataPool"] = flixel_util_FlxBitmapDataPool;
flixel_util_FlxBitmapDataPool.__name__ = "flixel.util.FlxBitmapDataPool";
flixel_util_FlxBitmapDataPool.__properties__ = {set_maxLength:"set_maxLength"};
flixel_util_FlxBitmapDataPool.get = function(w,h,transparent,fillColor,exactSize) {
	if(exactSize == null) {
		exactSize = false;
	}
	if(transparent == null) {
		transparent = true;
	}
	var res = null;
	var node = flixel_util_FlxBitmapDataPool._head;
	while(node != null) {
		var bmd = node.bmd;
		if(bmd.transparent == transparent && bmd.width >= w && bmd.height >= h && (!exactSize || exactSize && bmd.width == w && bmd.height == h)) {
			res = bmd;
			if(node.prev != null) {
				node.prev.next = node.next;
			}
			if(node.next != null) {
				node.next.prev = node.prev;
			}
			if(node == flixel_util_FlxBitmapDataPool._head) {
				flixel_util_FlxBitmapDataPool._head = node.next;
			}
			if(node == flixel_util_FlxBitmapDataPool._tail) {
				flixel_util_FlxBitmapDataPool._tail = node.prev;
			}
			node = null;
			flixel_util_FlxBitmapDataPool.$length--;
			break;
		}
		node = node.next;
	}
	if(res != null) {
		if(fillColor != null) {
			flixel_util_FlxBitmapDataPool._rect.x = 0;
			flixel_util_FlxBitmapDataPool._rect.y = 0;
			flixel_util_FlxBitmapDataPool._rect.width = w;
			flixel_util_FlxBitmapDataPool._rect.height = h;
			res.fillRect(flixel_util_FlxBitmapDataPool._rect,fillColor);
		}
	} else {
		res = new openfl_display_BitmapData(w,h,transparent,fillColor != null ? fillColor : -1);
	}
	return res;
};
flixel_util_FlxBitmapDataPool.put = function(bmd) {
	if(flixel_util_FlxBitmapDataPool.$length >= flixel_util_FlxBitmapDataPool.maxLength) {
		var last = flixel_util_FlxBitmapDataPool._tail;
		last.bmd.dispose();
		if(last.prev != null) {
			last.prev.next = null;
			flixel_util_FlxBitmapDataPool._tail = last.prev;
		}
		last = null;
		flixel_util_FlxBitmapDataPool.$length--;
	}
	var node = new flixel_util__$FlxBitmapDataPool_FlxBitmapDataPoolNode(bmd);
	node.next = flixel_util_FlxBitmapDataPool._head;
	if(flixel_util_FlxBitmapDataPool._head == null) {
		flixel_util_FlxBitmapDataPool._head = flixel_util_FlxBitmapDataPool._tail = node;
	} else {
		flixel_util_FlxBitmapDataPool._head = node;
		node.next.prev = node;
	}
	flixel_util_FlxBitmapDataPool.$length++;
};
flixel_util_FlxBitmapDataPool.clear = function() {
	var node = flixel_util_FlxBitmapDataPool._head;
	while(node != null) {
		var bmd = node.bmd;
		bmd.dispose();
		bmd = null;
		node = node.next;
	}
	flixel_util_FlxBitmapDataPool.$length = 0;
	flixel_util_FlxBitmapDataPool._head = flixel_util_FlxBitmapDataPool._tail = null;
};
flixel_util_FlxBitmapDataPool.set_maxLength = function(value) {
	if(flixel_util_FlxBitmapDataPool.maxLength != value) {
		var node = flixel_util_FlxBitmapDataPool._tail;
		while(node != null && flixel_util_FlxBitmapDataPool.$length > value) {
			var bmd = node.bmd;
			bmd.dispose();
			bmd = null;
			node = node.prev;
			flixel_util_FlxBitmapDataPool.$length--;
		}
	}
	return flixel_util_FlxBitmapDataPool.maxLength = value;
};
var flixel_util__$FlxBitmapDataPool_FlxBitmapDataPoolNode = function(bmd,prev,next) {
	this.bmd = bmd;
	this.prev = prev;
	this.next = next;
};
$hxClasses["flixel.util._FlxBitmapDataPool.FlxBitmapDataPoolNode"] = flixel_util__$FlxBitmapDataPool_FlxBitmapDataPoolNode;
flixel_util__$FlxBitmapDataPool_FlxBitmapDataPoolNode.__name__ = "flixel.util._FlxBitmapDataPool.FlxBitmapDataPoolNode";
flixel_util__$FlxBitmapDataPool_FlxBitmapDataPoolNode.prototype = {
	bmd: null
	,prev: null
	,next: null
	,__class__: flixel_util__$FlxBitmapDataPool_FlxBitmapDataPoolNode
};
var flixel_util_FlxBitmapDataUtil = function() { };
$hxClasses["flixel.util.FlxBitmapDataUtil"] = flixel_util_FlxBitmapDataUtil;
flixel_util_FlxBitmapDataUtil.__name__ = "flixel.util.FlxBitmapDataUtil";
flixel_util_FlxBitmapDataUtil.merge = function(sourceBitmapData,sourceRect,destBitmapData,destPoint,redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier) {
	if(destPoint.x >= destBitmapData.width || destPoint.y >= destBitmapData.height || sourceRect.x >= sourceBitmapData.width || sourceRect.y >= sourceBitmapData.height || sourceRect.x + sourceRect.width <= 0 || sourceRect.y + sourceRect.height <= 0) {
		return;
	}
	while(sourceRect.x + sourceRect.width > sourceBitmapData.width || sourceRect.y + sourceRect.height > sourceBitmapData.height || sourceRect.x < 0 || sourceRect.y < 0 || destPoint.x < 0 || destPoint.y < 0) {
		if(sourceRect.x + sourceRect.width > sourceBitmapData.width) {
			sourceRect.width = sourceBitmapData.width - sourceRect.x;
		}
		if(sourceRect.y + sourceRect.height > sourceBitmapData.height) {
			sourceRect.height = sourceBitmapData.height - sourceRect.y;
		}
		if(sourceRect.x < 0) {
			destPoint.x -= sourceRect.x;
			sourceRect.width += sourceRect.x;
			sourceRect.x = 0;
		}
		if(sourceRect.y < 0) {
			destPoint.y -= sourceRect.y;
			sourceRect.height += sourceRect.y;
			sourceRect.y = 0;
		}
		if(destPoint.x >= destBitmapData.width || destPoint.y >= destBitmapData.height) {
			return;
		}
		if(destPoint.x < 0) {
			sourceRect.x -= destPoint.x;
			sourceRect.width += destPoint.x;
			destPoint.x = 0;
		}
		if(destPoint.y < 0) {
			sourceRect.y -= destPoint.y;
			sourceRect.height += destPoint.y;
			destPoint.y = 0;
		}
	}
	if(sourceRect.width <= 0 || sourceRect.height <= 0) {
		return;
	}
	var startSourceX = Math.round(sourceRect.x);
	var startSourceY = Math.round(sourceRect.y);
	var width = Math.round(sourceRect.width);
	var height = Math.round(sourceRect.height);
	var sourceX = startSourceX;
	var sourceY = startSourceY;
	var destX = Math.round(destPoint.x);
	var destY = Math.round(destPoint.y);
	var currX = destX;
	var currY = destY;
	var sourceColor;
	var destColor;
	var resultRed;
	var resultGreen;
	var resultBlue;
	var resultAlpha;
	var resultColor = 0;
	destBitmapData.lock();
	var _g = 0;
	var _g1 = width;
	while(_g < _g1) {
		var i = _g++;
		var _g2 = 0;
		var _g3 = height;
		while(_g2 < _g3) {
			var j = _g2++;
			sourceX = startSourceX + i;
			sourceY = startSourceY + j;
			currX = destX + i;
			currY = destY + j;
			sourceColor = sourceBitmapData.getPixel32(sourceX,sourceY);
			destColor = destBitmapData.getPixel32(currX,currY);
			resultRed = ((sourceColor >> 16 & 255) * redMultiplier + (destColor >> 16 & 255) * (256 - redMultiplier)) / 256 | 0;
			resultGreen = ((sourceColor >> 8 & 255) * greenMultiplier + (destColor >> 8 & 255) * (256 - greenMultiplier)) / 256 | 0;
			resultBlue = ((sourceColor & 255) * blueMultiplier + (destColor & 255) * (256 - blueMultiplier)) / 256 | 0;
			resultAlpha = ((sourceColor >> 24 & 255) * alphaMultiplier + (destColor >> 24 & 255) * (256 - alphaMultiplier)) / 256 | 0;
			var Alpha = resultAlpha;
			if(Alpha == null) {
				Alpha = 255;
			}
			var color = flixel_util_FlxColor._new();
			var Alpha1 = Alpha;
			if(Alpha1 == null) {
				Alpha1 = 255;
			}
			color &= -16711681;
			color |= (resultRed > 255 ? 255 : resultRed < 0 ? 0 : resultRed) << 16;
			color &= -65281;
			color |= (resultGreen > 255 ? 255 : resultGreen < 0 ? 0 : resultGreen) << 8;
			color &= -256;
			color |= resultBlue > 255 ? 255 : resultBlue < 0 ? 0 : resultBlue;
			color &= 16777215;
			color |= (Alpha1 > 255 ? 255 : Alpha1 < 0 ? 0 : Alpha1) << 24;
			resultColor = color;
			destBitmapData.setPixel32(currX,currY,resultColor);
		}
	}
	destBitmapData.unlock();
};
flixel_util_FlxBitmapDataUtil.mergeColorComponent = function(source,dest,multiplier) {
	return (source * multiplier + dest * (256 - multiplier)) / 256 | 0;
};
flixel_util_FlxBitmapDataUtil.compare = function(Bitmap1,Bitmap2) {
	if(Bitmap1 == Bitmap2) {
		return 0;
	}
	if(Bitmap1.width != Bitmap2.width) {
		return -3;
	} else if(Bitmap1.height != Bitmap2.height) {
		return -4;
	} else {
		var width = Bitmap1.width;
		var height = Bitmap1.height;
		var result = new openfl_display_BitmapData(width,height,true,0);
		var identical = true;
		var _g = 0;
		var _g1 = width;
		while(_g < _g1) {
			var i = _g++;
			var _g2 = 0;
			var _g3 = height;
			while(_g2 < _g3) {
				var j = _g2++;
				var pixel1 = Bitmap1.getPixel32(i,j);
				var pixel2 = Bitmap2.getPixel32(i,j);
				if(pixel1 != pixel2) {
					identical = false;
					if((pixel1 & 16777215) != (pixel2 & 16777215)) {
						var diff = (pixel1 >> 16 & 255) - (pixel2 >> 16 & 255);
						var Red = diff >= 0 ? diff : 256 + diff;
						var diff1 = (pixel1 >> 8 & 255) - (pixel2 >> 8 & 255);
						var Green = diff1 >= 0 ? diff1 : 256 + diff1;
						var diff2 = (pixel1 & 255) - (pixel2 & 255);
						var Blue = diff2 >= 0 ? diff2 : 256 + diff2;
						var color = flixel_util_FlxColor._new();
						var Alpha = 255;
						if(Alpha == null) {
							Alpha = 255;
						}
						color &= -16711681;
						color |= (Red > 255 ? 255 : Red < 0 ? 0 : Red) << 16;
						color &= -65281;
						color |= (Green > 255 ? 255 : Green < 0 ? 0 : Green) << 8;
						color &= -256;
						color |= Blue > 255 ? 255 : Blue < 0 ? 0 : Blue;
						color &= 16777215;
						color |= (Alpha > 255 ? 255 : Alpha < 0 ? 0 : Alpha) << 24;
						result.setPixel32(i,j,color);
					} else {
						var alpha1 = pixel1 >> 24 & 255;
						var alpha2 = pixel2 >> 24 & 255;
						if(alpha1 != alpha2) {
							var diff3 = alpha1 - alpha2;
							var Alpha1 = diff3 >= 0 ? diff3 : 256 + diff3;
							if(Alpha1 == null) {
								Alpha1 = 255;
							}
							var color1 = flixel_util_FlxColor._new();
							var Alpha2 = Alpha1;
							if(Alpha2 == null) {
								Alpha2 = 255;
							}
							color1 &= -16711681;
							color1 |= 16711680;
							color1 &= -65281;
							color1 |= 65280;
							color1 &= -256;
							color1 |= 255;
							color1 &= 16777215;
							color1 |= (Alpha2 > 255 ? 255 : Alpha2 < 0 ? 0 : Alpha2) << 24;
							result.setPixel32(i,j,color1);
						}
					}
				}
			}
		}
		if(!identical) {
			return result;
		}
	}
	return 0;
};
flixel_util_FlxBitmapDataUtil.getDiff = function(value1,value2) {
	var diff = value1 - value2;
	if(diff >= 0) {
		return diff;
	} else {
		return 256 + diff;
	}
};
flixel_util_FlxBitmapDataUtil.getMemorySize = function(bitmapData) {
	return bitmapData.width * bitmapData.height * 4;
};
flixel_util_FlxBitmapDataUtil.replaceColor = function(bitmapData,color,newColor,fetchPositions,rect) {
	if(fetchPositions == null) {
		fetchPositions = false;
	}
	var positions = null;
	if(fetchPositions) {
		positions = [];
	}
	var startX = 0;
	var startY = 0;
	var columns = bitmapData.width;
	var rows = bitmapData.height;
	if(rect != null) {
		startX = rect.x | 0;
		startY = rect.y | 0;
		columns = rect.width | 0;
		rows = rect.height | 0;
	}
	columns = Math.max(columns,bitmapData.width) | 0;
	rows = Math.max(rows,bitmapData.height) | 0;
	var row = 0;
	var column = 0;
	var x;
	var y;
	var changed = false;
	bitmapData.lock();
	while(row < rows) {
		column = 0;
		while(column < columns) {
			x = startX + column;
			y = startY + row;
			if(bitmapData.getPixel32(x,y) == color) {
				bitmapData.setPixel32(x,y,newColor);
				changed = true;
				if(fetchPositions) {
					var X = x;
					var Y = y;
					if(Y == null) {
						Y = 0;
					}
					if(X == null) {
						X = 0;
					}
					var point = flixel_math_FlxPoint._pool.get().set(X,Y);
					point._inPool = false;
					positions.push(point);
				}
			}
			++column;
		}
		++row;
	}
	bitmapData.unlock();
	if(changed && positions == null) {
		positions = [];
	}
	return positions;
};
flixel_util_FlxBitmapDataUtil.addSpacesAndBorders = function(bitmapData,frameSize,spacing,border,region) {
	if(region == null) {
		var X = 0;
		var Y = 0;
		var Width = bitmapData.width;
		var Height = bitmapData.height;
		if(Height == null) {
			Height = 0;
		}
		if(Width == null) {
			Width = 0;
		}
		if(Y == null) {
			Y = 0;
		}
		if(X == null) {
			X = 0;
		}
		var _this = flixel_math_FlxRect._pool.get();
		var X1 = X;
		var Y1 = Y;
		var Width1 = Width;
		var Height1 = Height;
		if(Height1 == null) {
			Height1 = 0;
		}
		if(Width1 == null) {
			Width1 = 0;
		}
		if(Y1 == null) {
			Y1 = 0;
		}
		if(X1 == null) {
			X1 = 0;
		}
		_this.x = X1;
		_this.y = Y1;
		_this.width = Width1;
		_this.height = Height1;
		var rect = _this;
		rect._inPool = false;
		region = rect;
	}
	var frameWidth = region.width | 0;
	var frameHeight = region.height | 0;
	if(frameSize != null) {
		frameWidth = frameSize.x | 0;
		frameHeight = frameSize.y | 0;
	}
	var numHorizontalFrames = region.width / frameWidth | 0;
	var numVerticalFrames = region.height / frameHeight | 0;
	var spaceX = 0;
	var spaceY = 0;
	if(spacing != null) {
		spaceX = spacing.x | 0;
		spaceY = spacing.y | 0;
	}
	var borderX = 0;
	var borderY = 0;
	if(border != null) {
		borderX = border.x | 0;
		borderY = border.y | 0;
	}
	var result = new openfl_display_BitmapData(region.width + (numHorizontalFrames - 1) * spaceX + 2 * numHorizontalFrames * borderX | 0,region.height + (numVerticalFrames - 1) * spaceY + 2 * numVerticalFrames * borderY | 0,true,0);
	result.lock();
	var tempRect = new openfl_geom_Rectangle(0,0,frameWidth,frameHeight);
	var tempPoint = new openfl_geom_Point();
	var _g = 0;
	var _g1 = numHorizontalFrames;
	while(_g < _g1) {
		var i = _g++;
		tempPoint.x = i * (frameWidth + spaceX + 2 * borderX) + borderX;
		tempRect.x = i * frameWidth + region.x;
		var _g2 = 0;
		var _g3 = numVerticalFrames;
		while(_g2 < _g3) {
			var j = _g2++;
			tempPoint.y = j * (frameHeight + spaceY + 2 * borderY) + borderY;
			tempRect.y = j * frameHeight + region.y;
			result.copyPixels(bitmapData,tempRect,tempPoint);
		}
	}
	result.unlock();
	flixel_util_FlxBitmapDataUtil.copyBorderPixels(result,frameWidth,frameHeight,spaceX,spaceY,borderX,borderY,numHorizontalFrames,numVerticalFrames);
	return result;
};
flixel_util_FlxBitmapDataUtil.copyBorderPixels = function(bitmapData,frameWidth,frameHeight,spaceX,spaceY,borderX,borderY,horizontalFrames,verticalFrames) {
	var tempRect = new openfl_geom_Rectangle(0,0,1,bitmapData.height);
	var tempPoint = new openfl_geom_Point();
	bitmapData.lock();
	var _g = 0;
	var _g1 = horizontalFrames;
	while(_g < _g1) {
		var i = _g++;
		tempRect.x = i * (frameWidth + 2 * borderX + spaceX) + borderX;
		var _g2 = 0;
		var _g3 = borderX;
		while(_g2 < _g3) {
			var j = _g2++;
			tempPoint.x = tempRect.x - j - 1;
			bitmapData.copyPixels(bitmapData,tempRect,tempPoint);
		}
		tempRect.x += frameWidth - 1;
		var _g4 = 0;
		var _g5 = borderX;
		while(_g4 < _g5) {
			var j1 = _g4++;
			tempPoint.x = tempRect.x + j1 + 1;
			bitmapData.copyPixels(bitmapData,tempRect,tempPoint);
		}
	}
	tempPoint.setTo(0,0);
	tempRect.setTo(0,0,bitmapData.width,1);
	var _g = 0;
	var _g1 = verticalFrames;
	while(_g < _g1) {
		var i = _g++;
		tempRect.y = i * (frameHeight + 2 * borderY + spaceY) + borderY;
		var _g2 = 0;
		var _g3 = borderY;
		while(_g2 < _g3) {
			var j = _g2++;
			tempPoint.y = tempRect.y - j - 1;
			bitmapData.copyPixels(bitmapData,tempRect,tempPoint);
		}
		tempRect.y += frameHeight - 1;
		var _g4 = 0;
		var _g5 = borderY;
		while(_g4 < _g5) {
			var j1 = _g4++;
			tempPoint.y = tempRect.y + j1 + 1;
			bitmapData.copyPixels(bitmapData,tempRect,tempPoint);
		}
	}
	bitmapData.unlock();
	return bitmapData;
};
flixel_util_FlxBitmapDataUtil.generateRotations = function(brush,rotations,antiAliasing,autoBuffer) {
	if(autoBuffer == null) {
		autoBuffer = false;
	}
	if(antiAliasing == null) {
		antiAliasing = false;
	}
	if(rotations == null) {
		rotations = 16;
	}
	var brushWidth = brush.width;
	var brushHeight = brush.height;
	var max = brushHeight > brushWidth ? brushHeight : brushWidth;
	if(autoBuffer) {
		max = max * 1.5 | 0;
	}
	var rows = Math.sqrt(rotations) | 0;
	var columns = Math.ceil(rotations / rows);
	var bakedRotationAngle = 360 / rotations;
	var width = max * columns;
	var height = max * rows;
	var result = new openfl_display_BitmapData(width,height,true,0);
	var row = 0;
	var column = 0;
	var bakedAngle = 0;
	var halfBrushWidth = brushWidth * 0.5 | 0;
	var halfBrushHeight = brushHeight * 0.5 | 0;
	var midpointX = max * 0.5 | 0;
	var midpointY = max * 0.5 | 0;
	while(row < rows) {
		column = 0;
		while(column < columns) {
			flixel_util_FlxBitmapDataUtil.matrix.identity();
			flixel_util_FlxBitmapDataUtil.matrix.translate(-halfBrushWidth,-halfBrushHeight);
			flixel_util_FlxBitmapDataUtil.matrix.rotate(bakedAngle * (Math.PI / 180));
			flixel_util_FlxBitmapDataUtil.matrix.translate(max * column + midpointX,midpointY);
			bakedAngle += bakedRotationAngle;
			result.draw(brush,flixel_util_FlxBitmapDataUtil.matrix,null,null,null,antiAliasing);
			++column;
		}
		midpointY += max;
		++row;
	}
	return result;
};
var flixel_util_FlxCollision = function() { };
$hxClasses["flixel.util.FlxCollision"] = flixel_util_FlxCollision;
flixel_util_FlxCollision.__name__ = "flixel.util.FlxCollision";
flixel_util_FlxCollision.pixelPerfectCheck = function(Contact,Target,AlphaTolerance,Camera) {
	if(AlphaTolerance == null) {
		AlphaTolerance = 1;
	}
	var considerRotation = Contact.angle != 0 || Target.angle != 0;
	if(Camera == null) {
		Camera = flixel_FlxG.camera;
	}
	flixel_util_FlxCollision.pointA.set_x(Contact.x - (Camera.scroll.x * Contact.scrollFactor.x | 0) - Contact.offset.x);
	flixel_util_FlxCollision.pointA.set_y(Contact.y - (Camera.scroll.y * Contact.scrollFactor.y | 0) - Contact.offset.y);
	flixel_util_FlxCollision.pointB.set_x(Target.x - (Camera.scroll.x * Target.scrollFactor.x | 0) - Target.offset.x);
	flixel_util_FlxCollision.pointB.set_y(Target.y - (Camera.scroll.y * Target.scrollFactor.y | 0) - Target.offset.y);
	if(considerRotation) {
		Contact.origin.copyTo(flixel_util_FlxCollision.centerA);
		Target.origin.copyTo(flixel_util_FlxCollision.centerB);
		var this1 = flixel_util_FlxCollision.centerA;
		var lengthA = Math.sqrt(this1.x * this1.x + this1.y * this1.y);
		flixel_util_FlxCollision.boundsA.x = flixel_util_FlxCollision.pointA.x + flixel_util_FlxCollision.centerA.x - lengthA;
		flixel_util_FlxCollision.boundsA.y = flixel_util_FlxCollision.pointA.y + flixel_util_FlxCollision.centerA.y - lengthA;
		flixel_util_FlxCollision.boundsA.width = lengthA * 2;
		flixel_util_FlxCollision.boundsA.height = flixel_util_FlxCollision.boundsA.width;
		var this1 = flixel_util_FlxCollision.centerB;
		var lengthB = Math.sqrt(this1.x * this1.x + this1.y * this1.y);
		flixel_util_FlxCollision.boundsB.x = flixel_util_FlxCollision.pointB.x + flixel_util_FlxCollision.centerB.x - lengthB;
		flixel_util_FlxCollision.boundsB.y = flixel_util_FlxCollision.pointB.y + flixel_util_FlxCollision.centerB.y - lengthB;
		flixel_util_FlxCollision.boundsB.width = lengthB * 2;
		flixel_util_FlxCollision.boundsB.height = flixel_util_FlxCollision.boundsB.width;
	} else {
		flixel_util_FlxCollision.boundsA.x = flixel_util_FlxCollision.pointA.x;
		flixel_util_FlxCollision.boundsA.y = flixel_util_FlxCollision.pointA.y;
		flixel_util_FlxCollision.boundsA.width = Contact.frameWidth;
		flixel_util_FlxCollision.boundsA.height = Contact.frameHeight;
		flixel_util_FlxCollision.boundsB.x = flixel_util_FlxCollision.pointB.x;
		flixel_util_FlxCollision.boundsB.y = flixel_util_FlxCollision.pointB.y;
		flixel_util_FlxCollision.boundsB.width = Target.frameWidth;
		flixel_util_FlxCollision.boundsB.height = Target.frameHeight;
	}
	var _this = flixel_util_FlxCollision.intersect;
	_this.x = 0;
	_this.y = 0;
	_this.width = 0;
	_this.height = 0;
	flixel_util_FlxCollision.boundsA.intersection(flixel_util_FlxCollision.boundsB,_this);
	var _this = flixel_util_FlxCollision.intersect;
	if(_this.width == 0 || _this.height == 0 || flixel_util_FlxCollision.intersect.width < 1 || flixel_util_FlxCollision.intersect.height < 1) {
		return false;
	}
	flixel_util_FlxCollision.matrixA.identity();
	flixel_util_FlxCollision.matrixA.translate(-(flixel_util_FlxCollision.intersect.x - flixel_util_FlxCollision.boundsA.x),-(flixel_util_FlxCollision.intersect.y - flixel_util_FlxCollision.boundsA.y));
	flixel_util_FlxCollision.matrixB.identity();
	flixel_util_FlxCollision.matrixB.translate(-(flixel_util_FlxCollision.intersect.x - flixel_util_FlxCollision.boundsB.x),-(flixel_util_FlxCollision.intersect.y - flixel_util_FlxCollision.boundsB.y));
	Contact.drawFrame();
	Target.drawFrame();
	var testA = Contact.framePixels;
	var testB = Target.framePixels;
	var overlapWidth = flixel_util_FlxCollision.intersect.width | 0;
	var overlapHeight = flixel_util_FlxCollision.intersect.height | 0;
	if(considerRotation) {
		flixel_util_FlxCollision.testMatrix.identity();
		flixel_util_FlxCollision.testMatrix.translate(-Contact.origin.x,-Contact.origin.y);
		flixel_util_FlxCollision.testMatrix.rotate(Contact.angle * (Math.PI / 180));
		flixel_util_FlxCollision.testMatrix.translate(flixel_util_FlxCollision.boundsA.width / 2,flixel_util_FlxCollision.boundsA.height / 2);
		var testA2 = flixel_util_FlxBitmapDataPool.get(Math.floor(flixel_util_FlxCollision.boundsA.width),Math.floor(flixel_util_FlxCollision.boundsA.height),true,0,false);
		testA2.draw(testA,flixel_util_FlxCollision.testMatrix,null,null,null,false);
		testA = testA2;
		flixel_util_FlxCollision.testMatrix.identity();
		flixel_util_FlxCollision.testMatrix.translate(-Target.origin.x,-Target.origin.y);
		flixel_util_FlxCollision.testMatrix.rotate(Target.angle * (Math.PI / 180));
		flixel_util_FlxCollision.testMatrix.translate(flixel_util_FlxCollision.boundsB.width / 2,flixel_util_FlxCollision.boundsB.height / 2);
		var testB2 = flixel_util_FlxBitmapDataPool.get(Math.floor(flixel_util_FlxCollision.boundsB.width),Math.floor(flixel_util_FlxCollision.boundsB.height),true,0,false);
		testB2.draw(testB,flixel_util_FlxCollision.testMatrix,null,null,null,false);
		testB = testB2;
	}
	flixel_util_FlxCollision.boundsA.x = -flixel_util_FlxCollision.matrixA.tx | 0;
	flixel_util_FlxCollision.boundsA.y = -flixel_util_FlxCollision.matrixA.ty | 0;
	flixel_util_FlxCollision.boundsA.width = overlapWidth;
	flixel_util_FlxCollision.boundsA.height = overlapHeight;
	flixel_util_FlxCollision.boundsB.x = -flixel_util_FlxCollision.matrixB.tx | 0;
	flixel_util_FlxCollision.boundsB.y = -flixel_util_FlxCollision.matrixB.ty | 0;
	flixel_util_FlxCollision.boundsB.width = overlapWidth;
	flixel_util_FlxCollision.boundsB.height = overlapHeight;
	var _this = flixel_util_FlxCollision.boundsA;
	var FlashRect = flixel_util_FlxCollision.flashRect;
	if(FlashRect == null) {
		FlashRect = new openfl_geom_Rectangle();
	}
	FlashRect.x = _this.x;
	FlashRect.y = _this.y;
	FlashRect.width = _this.width;
	FlashRect.height = _this.height;
	var pixelsA = testA.getPixels(flixel_util_FlxCollision.flashRect);
	var _this = flixel_util_FlxCollision.boundsB;
	var FlashRect = flixel_util_FlxCollision.flashRect;
	if(FlashRect == null) {
		FlashRect = new openfl_geom_Rectangle();
	}
	FlashRect.x = _this.x;
	FlashRect.y = _this.y;
	FlashRect.width = _this.width;
	FlashRect.height = _this.height;
	var pixelsB = testB.getPixels(flixel_util_FlxCollision.flashRect);
	var hit = false;
	var alphaA = 0;
	var alphaB = 0;
	var overlapPixels = overlapWidth * overlapHeight;
	var alphaIdx = 0;
	var _g = 0;
	var _g1 = Math.ceil(overlapPixels / 2);
	while(_g < _g1) {
		var i = _g++;
		alphaIdx = i << 3;
		pixelsA.position = pixelsB.position = alphaIdx;
		alphaA = pixelsA.readUnsignedByte();
		alphaB = pixelsB.readUnsignedByte();
		if(alphaA >= AlphaTolerance && alphaB >= AlphaTolerance) {
			hit = true;
			break;
		}
	}
	if(!hit) {
		var _g = 0;
		var _g1 = overlapPixels >> 1;
		while(_g < _g1) {
			var i = _g++;
			alphaIdx = (i << 3) + 4;
			pixelsA.position = pixelsB.position = alphaIdx;
			alphaA = pixelsA.readUnsignedByte();
			alphaB = pixelsB.readUnsignedByte();
			if(alphaA >= AlphaTolerance && alphaB >= AlphaTolerance) {
				hit = true;
				break;
			}
		}
	}
	if(considerRotation) {
		flixel_util_FlxBitmapDataPool.put(testA);
		flixel_util_FlxBitmapDataPool.put(testB);
	}
	return hit;
};
flixel_util_FlxCollision.pixelPerfectPointCheck = function(PointX,PointY,Target,AlphaTolerance) {
	if(AlphaTolerance == null) {
		AlphaTolerance = 1;
	}
	if(!flixel_math_FlxMath.pointInCoordinates(PointX,PointY,Math.floor(Target.x),Math.floor(Target.y),Target.get_width() | 0,Target.get_height() | 0)) {
		return false;
	}
	if(flixel_FlxG.renderTile) {
		Target.drawFrame();
	}
	var test = Target.framePixels;
	var pixelAlpha = flixel_util_FlxColor._new(test.getPixel32(Math.floor(PointX - Target.x),Math.floor(PointY - Target.y))) >> 24 & 255;
	if(flixel_FlxG.renderTile) {
		pixelAlpha = pixelAlpha * Target.alpha | 0;
	}
	return pixelAlpha >= AlphaTolerance;
};
flixel_util_FlxCollision.createCameraWall = function(Camera,PlaceOutside,Thickness,AdjustWorldBounds) {
	if(AdjustWorldBounds == null) {
		AdjustWorldBounds = false;
	}
	if(PlaceOutside == null) {
		PlaceOutside = true;
	}
	var left = null;
	var right = null;
	var top = null;
	var bottom = null;
	if(PlaceOutside) {
		left = new flixel_tile_FlxTileblock(Math.floor(Camera.x - Thickness),Math.floor(Camera.y + Thickness),Thickness,Camera.height - Thickness * 2);
		right = new flixel_tile_FlxTileblock(Math.floor(Camera.x + Camera.width),Math.floor(Camera.y + Thickness),Thickness,Camera.height - Thickness * 2);
		top = new flixel_tile_FlxTileblock(Math.floor(Camera.x - Thickness),Math.floor(Camera.y - Thickness),Camera.width + Thickness * 2,Thickness);
		bottom = new flixel_tile_FlxTileblock(Math.floor(Camera.x - Thickness),Camera.height,Camera.width + Thickness * 2,Thickness);
		if(AdjustWorldBounds) {
			var _this = flixel_FlxG.worldBounds;
			var X = Camera.x - Thickness;
			var Y = Camera.y - Thickness;
			var Width = Camera.width + Thickness * 2;
			var Height = Camera.height + Thickness * 2;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			_this.x = X;
			_this.y = Y;
			_this.width = Width;
			_this.height = Height;
		}
	} else {
		left = new flixel_tile_FlxTileblock(Math.floor(Camera.x),Math.floor(Camera.y + Thickness),Thickness,Camera.height - Thickness * 2);
		right = new flixel_tile_FlxTileblock(Math.floor(Camera.x + Camera.width - Thickness),Math.floor(Camera.y + Thickness),Thickness,Camera.height - Thickness * 2);
		top = new flixel_tile_FlxTileblock(Math.floor(Camera.x),Math.floor(Camera.y),Camera.width,Thickness);
		bottom = new flixel_tile_FlxTileblock(Math.floor(Camera.x),Camera.height - Thickness,Camera.width,Thickness);
		if(AdjustWorldBounds) {
			var _this = flixel_FlxG.worldBounds;
			var X = Camera.x;
			var Y = Camera.y;
			var Width = Camera.width;
			var Height = Camera.height;
			if(Height == null) {
				Height = 0;
			}
			if(Width == null) {
				Width = 0;
			}
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			_this.x = X;
			_this.y = Y;
			_this.width = Width;
			_this.height = Height;
		}
	}
	var result = new flixel_group_FlxTypedGroup();
	result.add(left);
	result.add(right);
	result.add(top);
	result.add(bottom);
	return result;
};
var flixel_util_FlxColor = {};
flixel_util_FlxColor.__properties__ = {set_lightness:"set_lightness",get_lightness:"get_lightness",set_brightness:"set_brightness",get_brightness:"get_brightness",set_saturation:"set_saturation",get_saturation:"get_saturation",set_hue:"set_hue",get_hue:"get_hue",set_black:"set_black",get_black:"get_black",set_yellow:"set_yellow",get_yellow:"get_yellow",set_magenta:"set_magenta",get_magenta:"get_magenta",set_cyan:"set_cyan",get_cyan:"get_cyan",set_alphaFloat:"set_alphaFloat",get_alphaFloat:"get_alphaFloat",set_greenFloat:"set_greenFloat",get_greenFloat:"get_greenFloat",set_blueFloat:"set_blueFloat",get_blueFloat:"get_blueFloat",set_redFloat:"set_redFloat",get_redFloat:"get_redFloat",set_alpha:"set_alpha",get_alpha:"get_alpha",set_green:"set_green",get_green:"get_green",set_blue:"set_blue",get_blue:"get_blue",set_red:"set_red",get_red:"get_red"};
flixel_util_FlxColor.fromInt = function(Value) {
	return flixel_util_FlxColor._new(Value);
};
flixel_util_FlxColor.fromRGB = function(Red,Green,Blue,Alpha) {
	if(Alpha == null) {
		Alpha = 255;
	}
	var color = flixel_util_FlxColor._new();
	var Alpha1 = Alpha;
	if(Alpha1 == null) {
		Alpha1 = 255;
	}
	color &= -16711681;
	color |= (Red > 255 ? 255 : Red < 0 ? 0 : Red) << 16;
	color &= -65281;
	color |= (Green > 255 ? 255 : Green < 0 ? 0 : Green) << 8;
	color &= -256;
	color |= Blue > 255 ? 255 : Blue < 0 ? 0 : Blue;
	color &= 16777215;
	color |= (Alpha1 > 255 ? 255 : Alpha1 < 0 ? 0 : Alpha1) << 24;
	return color;
};
flixel_util_FlxColor.fromRGBFloat = function(Red,Green,Blue,Alpha) {
	if(Alpha == null) {
		Alpha = 1;
	}
	var color = flixel_util_FlxColor._new();
	var Alpha1 = Alpha;
	if(Alpha1 == null) {
		Alpha1 = 1;
	}
	var Value = Math.round(Red * 255);
	color &= -16711681;
	color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
	var Value = Math.round(Green * 255);
	color &= -65281;
	color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
	var Value = Math.round(Blue * 255);
	color &= -256;
	color |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
	var Value = Math.round(Alpha1 * 255);
	color &= 16777215;
	color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
	return color;
};
flixel_util_FlxColor.fromCMYK = function(Cyan,Magenta,Yellow,Black,Alpha) {
	if(Alpha == null) {
		Alpha = 1;
	}
	var color = flixel_util_FlxColor._new();
	var Alpha1 = Alpha;
	if(Alpha1 == null) {
		Alpha1 = 1;
	}
	var Value = (1 - Cyan) * (1 - Black);
	var Value1 = Math.round(Value * 255);
	color &= -16711681;
	color |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
	var Value = (1 - Magenta) * (1 - Black);
	var Value1 = Math.round(Value * 255);
	color &= -65281;
	color |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
	var Value = (1 - Yellow) * (1 - Black);
	var Value1 = Math.round(Value * 255);
	color &= -256;
	color |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
	var Value = Math.round(Alpha1 * 255);
	color &= 16777215;
	color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
	return color;
};
flixel_util_FlxColor.fromHSB = function(Hue,Saturation,Brightness,Alpha) {
	if(Alpha == null) {
		Alpha = 1;
	}
	var color = flixel_util_FlxColor._new();
	var chroma = Brightness * Saturation;
	var match = Brightness - chroma;
	var Hue1 = Hue;
	var Chroma = chroma;
	Hue1 %= 360;
	var hueD = Hue1 / 60;
	var mid = Chroma * (1 - Math.abs(hueD % 2 - 1)) + match;
	Chroma += match;
	switch(hueD | 0) {
	case 0:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(Chroma * 255);
		color &= -16711681;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(mid * 255);
		color &= -65281;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(match * 255);
		color &= -256;
		color |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		color &= 16777215;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 1:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(mid * 255);
		color &= -16711681;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(Chroma * 255);
		color &= -65281;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(match * 255);
		color &= -256;
		color |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		color &= 16777215;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 2:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(match * 255);
		color &= -16711681;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(Chroma * 255);
		color &= -65281;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(mid * 255);
		color &= -256;
		color |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		color &= 16777215;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 3:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(match * 255);
		color &= -16711681;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(mid * 255);
		color &= -65281;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(Chroma * 255);
		color &= -256;
		color |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		color &= 16777215;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 4:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(mid * 255);
		color &= -16711681;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(match * 255);
		color &= -65281;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(Chroma * 255);
		color &= -256;
		color |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		color &= 16777215;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 5:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(Chroma * 255);
		color &= -16711681;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(match * 255);
		color &= -65281;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(mid * 255);
		color &= -256;
		color |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		color &= 16777215;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	}
	return color;
};
flixel_util_FlxColor.fromHSL = function(Hue,Saturation,Lightness,Alpha) {
	if(Alpha == null) {
		Alpha = 1;
	}
	var color = flixel_util_FlxColor._new();
	var chroma = (1 - Math.abs(2 * Lightness - 1)) * Saturation;
	var match = Lightness - chroma / 2;
	var Hue1 = Hue;
	var Chroma = chroma;
	Hue1 %= 360;
	var hueD = Hue1 / 60;
	var mid = Chroma * (1 - Math.abs(hueD % 2 - 1)) + match;
	Chroma += match;
	switch(hueD | 0) {
	case 0:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(Chroma * 255);
		color &= -16711681;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(mid * 255);
		color &= -65281;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(match * 255);
		color &= -256;
		color |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		color &= 16777215;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 1:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(mid * 255);
		color &= -16711681;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(Chroma * 255);
		color &= -65281;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(match * 255);
		color &= -256;
		color |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		color &= 16777215;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 2:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(match * 255);
		color &= -16711681;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(Chroma * 255);
		color &= -65281;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(mid * 255);
		color &= -256;
		color |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		color &= 16777215;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 3:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(match * 255);
		color &= -16711681;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(mid * 255);
		color &= -65281;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(Chroma * 255);
		color &= -256;
		color |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		color &= 16777215;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 4:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(mid * 255);
		color &= -16711681;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(match * 255);
		color &= -65281;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(Chroma * 255);
		color &= -256;
		color |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		color &= 16777215;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 5:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(Chroma * 255);
		color &= -16711681;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(match * 255);
		color &= -65281;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(mid * 255);
		color &= -256;
		color |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		color &= 16777215;
		color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	}
	return color;
};
flixel_util_FlxColor.fromString = function(str) {
	var result = null;
	str = StringTools.trim(str);
	if(flixel_util_FlxColor.COLOR_REGEX.match(str)) {
		var hexColor = "0x" + flixel_util_FlxColor.COLOR_REGEX.matched(2);
		result = flixel_util_FlxColor._new(Std.parseInt(hexColor));
		if(hexColor.length == 8) {
			var Value = Math.round(255);
			result &= 16777215;
			result |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		}
	} else {
		str = str.toUpperCase();
		var key = haxe_ds_StringMap.keysIterator(flixel_util_FlxColor.colorLookup.h);
		while(key.hasNext()) {
			var key1 = key.next();
			if(key1.toUpperCase() == str) {
				result = flixel_util_FlxColor._new(flixel_util_FlxColor.colorLookup.h[key1]);
				break;
			}
		}
	}
	return result;
};
flixel_util_FlxColor.getHSBColorWheel = function(Alpha) {
	if(Alpha == null) {
		Alpha = 255;
	}
	var _g = [];
	var _g1 = 0;
	while(_g1 < 360) {
		var c = _g1++;
		_g.push(flixel_util_FlxColor.fromHSB(c,1.0,1.0,Alpha));
	}
	return _g;
};
flixel_util_FlxColor.interpolate = function(Color1,Color2,Factor) {
	if(Factor == null) {
		Factor = 0.5;
	}
	var r = ((Color2 >> 16 & 255) - (Color1 >> 16 & 255)) * Factor + (Color1 >> 16 & 255) | 0;
	var g = ((Color2 >> 8 & 255) - (Color1 >> 8 & 255)) * Factor + (Color1 >> 8 & 255) | 0;
	var b = ((Color2 & 255) - (Color1 & 255)) * Factor + (Color1 & 255) | 0;
	var a = ((Color2 >> 24 & 255) - (Color1 >> 24 & 255)) * Factor + (Color1 >> 24 & 255) | 0;
	var Alpha = a;
	if(Alpha == null) {
		Alpha = 255;
	}
	var color = flixel_util_FlxColor._new();
	var Alpha1 = Alpha;
	if(Alpha1 == null) {
		Alpha1 = 255;
	}
	color &= -16711681;
	color |= (r > 255 ? 255 : r < 0 ? 0 : r) << 16;
	color &= -65281;
	color |= (g > 255 ? 255 : g < 0 ? 0 : g) << 8;
	color &= -256;
	color |= b > 255 ? 255 : b < 0 ? 0 : b;
	color &= 16777215;
	color |= (Alpha1 > 255 ? 255 : Alpha1 < 0 ? 0 : Alpha1) << 24;
	return color;
};
flixel_util_FlxColor.gradient = function(Color1,Color2,Steps,Ease) {
	var output = [];
	if(Ease == null) {
		Ease = function(t) {
			return t;
		};
	}
	var _g = 0;
	var _g1 = Steps;
	while(_g < _g1) {
		var step = _g++;
		var Factor = Ease(step / (Steps - 1));
		if(Factor == null) {
			Factor = 0.5;
		}
		var r = ((Color2 >> 16 & 255) - (Color1 >> 16 & 255)) * Factor + (Color1 >> 16 & 255) | 0;
		var g = ((Color2 >> 8 & 255) - (Color1 >> 8 & 255)) * Factor + (Color1 >> 8 & 255) | 0;
		var b = ((Color2 & 255) - (Color1 & 255)) * Factor + (Color1 & 255) | 0;
		var a = ((Color2 >> 24 & 255) - (Color1 >> 24 & 255)) * Factor + (Color1 >> 24 & 255) | 0;
		var Alpha = a;
		if(Alpha == null) {
			Alpha = 255;
		}
		var color = flixel_util_FlxColor._new();
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 255;
		}
		color &= -16711681;
		color |= (r > 255 ? 255 : r < 0 ? 0 : r) << 16;
		color &= -65281;
		color |= (g > 255 ? 255 : g < 0 ? 0 : g) << 8;
		color &= -256;
		color |= b > 255 ? 255 : b < 0 ? 0 : b;
		color &= 16777215;
		color |= (Alpha1 > 255 ? 255 : Alpha1 < 0 ? 0 : Alpha1) << 24;
		output[step] = color;
	}
	return output;
};
flixel_util_FlxColor.multiply = function(lhs,rhs) {
	var Red = (lhs >> 16 & 255) / 255 * ((rhs >> 16 & 255) / 255);
	var Green = (lhs >> 8 & 255) / 255 * ((rhs >> 8 & 255) / 255);
	var Blue = (lhs & 255) / 255 * ((rhs & 255) / 255);
	var color = flixel_util_FlxColor._new();
	var Alpha = 1;
	if(Alpha == null) {
		Alpha = 1;
	}
	var Value = Math.round(Red * 255);
	color &= -16711681;
	color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
	var Value = Math.round(Green * 255);
	color &= -65281;
	color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
	var Value = Math.round(Blue * 255);
	color &= -256;
	color |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
	var Value = Math.round(Alpha * 255);
	color &= 16777215;
	color |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
	return color;
};
flixel_util_FlxColor.add = function(lhs,rhs) {
	var Red = (lhs >> 16 & 255) + (rhs >> 16 & 255);
	var Green = (lhs >> 8 & 255) + (rhs >> 8 & 255);
	var Blue = (lhs & 255) + (rhs & 255);
	var color = flixel_util_FlxColor._new();
	var Alpha = 255;
	if(Alpha == null) {
		Alpha = 255;
	}
	color &= -16711681;
	color |= (Red > 255 ? 255 : Red < 0 ? 0 : Red) << 16;
	color &= -65281;
	color |= (Green > 255 ? 255 : Green < 0 ? 0 : Green) << 8;
	color &= -256;
	color |= Blue > 255 ? 255 : Blue < 0 ? 0 : Blue;
	color &= 16777215;
	color |= (Alpha > 255 ? 255 : Alpha < 0 ? 0 : Alpha) << 24;
	return color;
};
flixel_util_FlxColor.subtract = function(lhs,rhs) {
	var Red = (lhs >> 16 & 255) - (rhs >> 16 & 255);
	var Green = (lhs >> 8 & 255) - (rhs >> 8 & 255);
	var Blue = (lhs & 255) - (rhs & 255);
	var color = flixel_util_FlxColor._new();
	var Alpha = 255;
	if(Alpha == null) {
		Alpha = 255;
	}
	color &= -16711681;
	color |= (Red > 255 ? 255 : Red < 0 ? 0 : Red) << 16;
	color &= -65281;
	color |= (Green > 255 ? 255 : Green < 0 ? 0 : Green) << 8;
	color &= -256;
	color |= Blue > 255 ? 255 : Blue < 0 ? 0 : Blue;
	color &= 16777215;
	color |= (Alpha > 255 ? 255 : Alpha < 0 ? 0 : Alpha) << 24;
	return color;
};
flixel_util_FlxColor.getComplementHarmony = function(this1) {
	return flixel_util_FlxColor.fromHSB(flixel_math_FlxMath.wrap((flixel_util_FlxColor.get_hue(this1) | 0) + 180,0,350),Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)),(Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)) - Math.min((this1 >> 16 & 255) / 255,Math.min((this1 >> 8 & 255) / 255,(this1 & 255) / 255))) / Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)),(this1 >> 24 & 255) / 255);
};
flixel_util_FlxColor.getAnalogousHarmony = function(this1,Threshold) {
	if(Threshold == null) {
		Threshold = 30;
	}
	var warmer = flixel_util_FlxColor.fromHSB(flixel_math_FlxMath.wrap((flixel_util_FlxColor.get_hue(this1) | 0) - Threshold,0,350),(Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)) - Math.min((this1 >> 16 & 255) / 255,Math.min((this1 >> 8 & 255) / 255,(this1 & 255) / 255))) / Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)),Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)),(this1 >> 24 & 255) / 255);
	var colder = flixel_util_FlxColor.fromHSB(flixel_math_FlxMath.wrap((flixel_util_FlxColor.get_hue(this1) | 0) + Threshold,0,350),(Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)) - Math.min((this1 >> 16 & 255) / 255,Math.min((this1 >> 8 & 255) / 255,(this1 & 255) / 255))) / Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)),Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)),(this1 >> 24 & 255) / 255);
	return { original : this1, warmer : warmer, colder : colder};
};
flixel_util_FlxColor.getSplitComplementHarmony = function(this1,Threshold) {
	if(Threshold == null) {
		Threshold = 30;
	}
	var oppositeHue = flixel_math_FlxMath.wrap((flixel_util_FlxColor.get_hue(this1) | 0) + 180,0,350);
	var warmer = flixel_util_FlxColor.fromHSB(flixel_math_FlxMath.wrap(oppositeHue - Threshold,0,350),(Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)) - Math.min((this1 >> 16 & 255) / 255,Math.min((this1 >> 8 & 255) / 255,(this1 & 255) / 255))) / Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)),Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)),(this1 >> 24 & 255) / 255);
	var colder = flixel_util_FlxColor.fromHSB(flixel_math_FlxMath.wrap(oppositeHue + Threshold,0,350),(Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)) - Math.min((this1 >> 16 & 255) / 255,Math.min((this1 >> 8 & 255) / 255,(this1 & 255) / 255))) / Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)),Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)),(this1 >> 24 & 255) / 255);
	return { original : this1, warmer : warmer, colder : colder};
};
flixel_util_FlxColor.getTriadicHarmony = function(this1) {
	var triadic1 = flixel_util_FlxColor.fromHSB(flixel_math_FlxMath.wrap((flixel_util_FlxColor.get_hue(this1) | 0) + 120,0,359),(Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)) - Math.min((this1 >> 16 & 255) / 255,Math.min((this1 >> 8 & 255) / 255,(this1 & 255) / 255))) / Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)),Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)),(this1 >> 24 & 255) / 255);
	var triadic2 = flixel_util_FlxColor.fromHSB(flixel_math_FlxMath.wrap((flixel_util_FlxColor.get_hue(triadic1) | 0) + 120,0,359),(Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)) - Math.min((this1 >> 16 & 255) / 255,Math.min((this1 >> 8 & 255) / 255,(this1 & 255) / 255))) / Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)),Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)),(this1 >> 24 & 255) / 255);
	return { color1 : this1, color2 : triadic1, color3 : triadic2};
};
flixel_util_FlxColor.to24Bit = function(this1) {
	return this1 & 16777215;
};
flixel_util_FlxColor.toHexString = function(this1,Alpha,Prefix) {
	if(Prefix == null) {
		Prefix = true;
	}
	if(Alpha == null) {
		Alpha = true;
	}
	var tmp = Alpha ? StringTools.hex(this1 >> 24 & 255,2) : "";
	return (Prefix ? "0x" : "") + tmp + StringTools.hex(this1 >> 16 & 255,2) + StringTools.hex(this1 >> 8 & 255,2) + StringTools.hex(this1 & 255,2);
};
flixel_util_FlxColor.toWebString = function(this1) {
	var Alpha = false;
	var Prefix = false;
	if(Prefix == null) {
		Prefix = true;
	}
	if(Alpha == null) {
		Alpha = true;
	}
	var tmp = Alpha ? StringTools.hex(this1 >> 24 & 255,2) : "";
	return "#" + ((Prefix ? "0x" : "") + tmp + StringTools.hex(this1 >> 16 & 255,2) + StringTools.hex(this1 >> 8 & 255,2) + StringTools.hex(this1 & 255,2));
};
flixel_util_FlxColor.getColorInfo = function(this1) {
	var result = "0x" + StringTools.hex(this1 >> 24 & 255,2) + StringTools.hex(this1 >> 16 & 255,2) + StringTools.hex(this1 >> 8 & 255,2) + StringTools.hex(this1 & 255,2) + "\n";
	result += "Alpha: " + (this1 >> 24 & 255) + " Red: " + (this1 >> 16 & 255) + " Green: " + (this1 >> 8 & 255) + " Blue: " + (this1 & 255) + "\n";
	result += "Hue: " + flixel_math_FlxMath.roundDecimal(flixel_util_FlxColor.get_hue(this1),2) + " Saturation: " + flixel_math_FlxMath.roundDecimal((Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)) - Math.min((this1 >> 16 & 255) / 255,Math.min((this1 >> 8 & 255) / 255,(this1 & 255) / 255))) / Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)),2) + " Brightness: " + flixel_math_FlxMath.roundDecimal(Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)),2) + " Lightness: " + flixel_math_FlxMath.roundDecimal((Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)) + Math.min((this1 >> 16 & 255) / 255,Math.min((this1 >> 8 & 255) / 255,(this1 & 255) / 255))) / 2,2);
	return result;
};
flixel_util_FlxColor.getDarkened = function(this1,Factor) {
	if(Factor == null) {
		Factor = 0.2;
	}
	var lowerBound = Factor < 0 ? 0 : Factor;
	Factor = lowerBound > 1 ? 1 : lowerBound;
	var output = this1;
	var Value = (Math.max((output >> 16 & 255) / 255,Math.max((output >> 8 & 255) / 255,(output & 255) / 255)) + Math.min((output >> 16 & 255) / 255,Math.min((output >> 8 & 255) / 255,(output & 255) / 255))) / 2 * (1 - Factor);
	var Hue = flixel_util_FlxColor.get_hue(output);
	var Alpha = (output >> 24 & 255) / 255;
	var chroma = (1 - Math.abs(2 * Value - 1)) * ((Math.max((output >> 16 & 255) / 255,Math.max((output >> 8 & 255) / 255,(output & 255) / 255)) - Math.min((output >> 16 & 255) / 255,Math.min((output >> 8 & 255) / 255,(output & 255) / 255))) / Math.max((output >> 16 & 255) / 255,Math.max((output >> 8 & 255) / 255,(output & 255) / 255)));
	var match = Value - chroma / 2;
	var Hue1 = Hue;
	var Chroma = chroma;
	Hue1 %= 360;
	var hueD = Hue1 / 60;
	var mid = Chroma * (1 - Math.abs(hueD % 2 - 1)) + match;
	Chroma += match;
	switch(hueD | 0) {
	case 0:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(Chroma * 255);
		output &= -16711681;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(mid * 255);
		output &= -65281;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(match * 255);
		output &= -256;
		output |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		output &= 16777215;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 1:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(mid * 255);
		output &= -16711681;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(Chroma * 255);
		output &= -65281;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(match * 255);
		output &= -256;
		output |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		output &= 16777215;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 2:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(match * 255);
		output &= -16711681;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(Chroma * 255);
		output &= -65281;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(mid * 255);
		output &= -256;
		output |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		output &= 16777215;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 3:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(match * 255);
		output &= -16711681;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(mid * 255);
		output &= -65281;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(Chroma * 255);
		output &= -256;
		output |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		output &= 16777215;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 4:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(mid * 255);
		output &= -16711681;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(match * 255);
		output &= -65281;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(Chroma * 255);
		output &= -256;
		output |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		output &= 16777215;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 5:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(Chroma * 255);
		output &= -16711681;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(match * 255);
		output &= -65281;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(mid * 255);
		output &= -256;
		output |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		output &= 16777215;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	}
	return output;
};
flixel_util_FlxColor.getLightened = function(this1,Factor) {
	if(Factor == null) {
		Factor = 0.2;
	}
	var lowerBound = Factor < 0 ? 0 : Factor;
	Factor = lowerBound > 1 ? 1 : lowerBound;
	var output = this1;
	var Value = (Math.max((output >> 16 & 255) / 255,Math.max((output >> 8 & 255) / 255,(output & 255) / 255)) + Math.min((output >> 16 & 255) / 255,Math.min((output >> 8 & 255) / 255,(output & 255) / 255))) / 2 + (1 - (Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)) + Math.min((this1 >> 16 & 255) / 255,Math.min((this1 >> 8 & 255) / 255,(this1 & 255) / 255))) / 2) * Factor;
	var Hue = flixel_util_FlxColor.get_hue(output);
	var Alpha = (output >> 24 & 255) / 255;
	var chroma = (1 - Math.abs(2 * Value - 1)) * ((Math.max((output >> 16 & 255) / 255,Math.max((output >> 8 & 255) / 255,(output & 255) / 255)) - Math.min((output >> 16 & 255) / 255,Math.min((output >> 8 & 255) / 255,(output & 255) / 255))) / Math.max((output >> 16 & 255) / 255,Math.max((output >> 8 & 255) / 255,(output & 255) / 255)));
	var match = Value - chroma / 2;
	var Hue1 = Hue;
	var Chroma = chroma;
	Hue1 %= 360;
	var hueD = Hue1 / 60;
	var mid = Chroma * (1 - Math.abs(hueD % 2 - 1)) + match;
	Chroma += match;
	switch(hueD | 0) {
	case 0:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(Chroma * 255);
		output &= -16711681;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(mid * 255);
		output &= -65281;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(match * 255);
		output &= -256;
		output |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		output &= 16777215;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 1:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(mid * 255);
		output &= -16711681;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(Chroma * 255);
		output &= -65281;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(match * 255);
		output &= -256;
		output |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		output &= 16777215;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 2:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(match * 255);
		output &= -16711681;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(Chroma * 255);
		output &= -65281;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(mid * 255);
		output &= -256;
		output |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		output &= 16777215;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 3:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(match * 255);
		output &= -16711681;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(mid * 255);
		output &= -65281;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(Chroma * 255);
		output &= -256;
		output |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		output &= 16777215;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 4:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(mid * 255);
		output &= -16711681;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(match * 255);
		output &= -65281;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(Chroma * 255);
		output &= -256;
		output |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		output &= 16777215;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 5:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(Chroma * 255);
		output &= -16711681;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(match * 255);
		output &= -65281;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(mid * 255);
		output &= -256;
		output |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		output &= 16777215;
		output |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	}
	return output;
};
flixel_util_FlxColor.getInverted = function(this1) {
	var oldAlpha = this1 >> 24 & 255;
	var lhs = -1;
	var Red = (lhs >> 16 & 255) - (this1 >> 16 & 255);
	var Green = (lhs >> 8 & 255) - (this1 >> 8 & 255);
	var Blue = (lhs & 255) - (this1 & 255);
	var color = flixel_util_FlxColor._new();
	var Alpha = 255;
	if(Alpha == null) {
		Alpha = 255;
	}
	color &= -16711681;
	color |= (Red > 255 ? 255 : Red < 0 ? 0 : Red) << 16;
	color &= -65281;
	color |= (Green > 255 ? 255 : Green < 0 ? 0 : Green) << 8;
	color &= -256;
	color |= Blue > 255 ? 255 : Blue < 0 ? 0 : Blue;
	color &= 16777215;
	color |= (Alpha > 255 ? 255 : Alpha < 0 ? 0 : Alpha) << 24;
	var output = color;
	output &= 16777215;
	output |= (oldAlpha > 255 ? 255 : oldAlpha < 0 ? 0 : oldAlpha) << 24;
	return output;
};
flixel_util_FlxColor.setRGB = function(this1,Red,Green,Blue,Alpha) {
	if(Alpha == null) {
		Alpha = 255;
	}
	this1 &= -16711681;
	this1 |= (Red > 255 ? 255 : Red < 0 ? 0 : Red) << 16;
	this1 &= -65281;
	this1 |= (Green > 255 ? 255 : Green < 0 ? 0 : Green) << 8;
	this1 &= -256;
	this1 |= Blue > 255 ? 255 : Blue < 0 ? 0 : Blue;
	this1 &= 16777215;
	this1 |= (Alpha > 255 ? 255 : Alpha < 0 ? 0 : Alpha) << 24;
	return this1;
};
flixel_util_FlxColor.setRGBFloat = function(this1,Red,Green,Blue,Alpha) {
	if(Alpha == null) {
		Alpha = 1;
	}
	var Value = Math.round(Red * 255);
	this1 &= -16711681;
	this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
	var Value = Math.round(Green * 255);
	this1 &= -65281;
	this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
	var Value = Math.round(Blue * 255);
	this1 &= -256;
	this1 |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
	var Value = Math.round(Alpha * 255);
	this1 &= 16777215;
	this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
	return this1;
};
flixel_util_FlxColor.setCMYK = function(this1,Cyan,Magenta,Yellow,Black,Alpha) {
	if(Alpha == null) {
		Alpha = 1;
	}
	var Value = (1 - Cyan) * (1 - Black);
	var Value1 = Math.round(Value * 255);
	this1 &= -16711681;
	this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
	var Value = (1 - Magenta) * (1 - Black);
	var Value1 = Math.round(Value * 255);
	this1 &= -65281;
	this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
	var Value = (1 - Yellow) * (1 - Black);
	var Value1 = Math.round(Value * 255);
	this1 &= -256;
	this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
	var Value = Math.round(Alpha * 255);
	this1 &= 16777215;
	this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
	return this1;
};
flixel_util_FlxColor.setHSB = function(this1,Hue,Saturation,Brightness,Alpha) {
	var chroma = Brightness * Saturation;
	var match = Brightness - chroma;
	var Hue1 = Hue;
	var Chroma = chroma;
	Hue1 %= 360;
	var hueD = Hue1 / 60;
	var mid = Chroma * (1 - Math.abs(hueD % 2 - 1)) + match;
	Chroma += match;
	switch(hueD | 0) {
	case 0:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(Chroma * 255);
		this1 &= -16711681;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(mid * 255);
		this1 &= -65281;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(match * 255);
		this1 &= -256;
		this1 |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 1:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(mid * 255);
		this1 &= -16711681;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(Chroma * 255);
		this1 &= -65281;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(match * 255);
		this1 &= -256;
		this1 |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 2:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(match * 255);
		this1 &= -16711681;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(Chroma * 255);
		this1 &= -65281;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(mid * 255);
		this1 &= -256;
		this1 |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 3:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(match * 255);
		this1 &= -16711681;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(mid * 255);
		this1 &= -65281;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(Chroma * 255);
		this1 &= -256;
		this1 |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 4:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(mid * 255);
		this1 &= -16711681;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(match * 255);
		this1 &= -65281;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(Chroma * 255);
		this1 &= -256;
		this1 |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 5:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(Chroma * 255);
		this1 &= -16711681;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(match * 255);
		this1 &= -65281;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(mid * 255);
		this1 &= -256;
		this1 |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	}
	return this1;
};
flixel_util_FlxColor.setHSL = function(this1,Hue,Saturation,Lightness,Alpha) {
	var chroma = (1 - Math.abs(2 * Lightness - 1)) * Saturation;
	var match = Lightness - chroma / 2;
	var Hue1 = Hue;
	var Chroma = chroma;
	Hue1 %= 360;
	var hueD = Hue1 / 60;
	var mid = Chroma * (1 - Math.abs(hueD % 2 - 1)) + match;
	Chroma += match;
	switch(hueD | 0) {
	case 0:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(Chroma * 255);
		this1 &= -16711681;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(mid * 255);
		this1 &= -65281;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(match * 255);
		this1 &= -256;
		this1 |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 1:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(mid * 255);
		this1 &= -16711681;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(Chroma * 255);
		this1 &= -65281;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(match * 255);
		this1 &= -256;
		this1 |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 2:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(match * 255);
		this1 &= -16711681;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(Chroma * 255);
		this1 &= -65281;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(mid * 255);
		this1 &= -256;
		this1 |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 3:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(match * 255);
		this1 &= -16711681;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(mid * 255);
		this1 &= -65281;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(Chroma * 255);
		this1 &= -256;
		this1 |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 4:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(mid * 255);
		this1 &= -16711681;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(match * 255);
		this1 &= -65281;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(Chroma * 255);
		this1 &= -256;
		this1 |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 5:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(Chroma * 255);
		this1 &= -16711681;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(match * 255);
		this1 &= -65281;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(mid * 255);
		this1 &= -256;
		this1 |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	}
	return this1;
};
flixel_util_FlxColor.setHSChromaMatch = function(this1,Hue,Saturation,Chroma,Match,Alpha) {
	Hue %= 360;
	var hueD = Hue / 60;
	var mid = Chroma * (1 - Math.abs(hueD % 2 - 1)) + Match;
	Chroma += Match;
	switch(hueD | 0) {
	case 0:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(Chroma * 255);
		this1 &= -16711681;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(mid * 255);
		this1 &= -65281;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(Match * 255);
		this1 &= -256;
		this1 |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 1:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(mid * 255);
		this1 &= -16711681;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(Chroma * 255);
		this1 &= -65281;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(Match * 255);
		this1 &= -256;
		this1 |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 2:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(Match * 255);
		this1 &= -16711681;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(Chroma * 255);
		this1 &= -65281;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(mid * 255);
		this1 &= -256;
		this1 |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 3:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(Match * 255);
		this1 &= -16711681;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(mid * 255);
		this1 &= -65281;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(Chroma * 255);
		this1 &= -256;
		this1 |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 4:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(mid * 255);
		this1 &= -16711681;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(Match * 255);
		this1 &= -65281;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(Chroma * 255);
		this1 &= -256;
		this1 |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	case 5:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value = Math.round(Chroma * 255);
		this1 &= -16711681;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
		var Value = Math.round(Match * 255);
		this1 &= -65281;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
		var Value = Math.round(mid * 255);
		this1 &= -256;
		this1 |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
		var Value = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
		break;
	}
	return this1;
};
flixel_util_FlxColor._new = function(Value) {
	if(Value == null) {
		Value = 0;
	}
	var this1 = Value;
	return this1;
};
flixel_util_FlxColor.getThis = function(this1) {
	return this1;
};
flixel_util_FlxColor.validate = function(this1) {
};
flixel_util_FlxColor.get_red = function(this1) {
	return this1 >> 16 & 255;
};
flixel_util_FlxColor.get_green = function(this1) {
	return this1 >> 8 & 255;
};
flixel_util_FlxColor.get_blue = function(this1) {
	return this1 & 255;
};
flixel_util_FlxColor.get_alpha = function(this1) {
	return this1 >> 24 & 255;
};
flixel_util_FlxColor.get_redFloat = function(this1) {
	return (this1 >> 16 & 255) / 255;
};
flixel_util_FlxColor.get_greenFloat = function(this1) {
	return (this1 >> 8 & 255) / 255;
};
flixel_util_FlxColor.get_blueFloat = function(this1) {
	return (this1 & 255) / 255;
};
flixel_util_FlxColor.get_alphaFloat = function(this1) {
	return (this1 >> 24 & 255) / 255;
};
flixel_util_FlxColor.set_red = function(this1,Value) {
	this1 &= -16711681;
	this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 16;
	return Value;
};
flixel_util_FlxColor.set_green = function(this1,Value) {
	this1 &= -65281;
	this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 8;
	return Value;
};
flixel_util_FlxColor.set_blue = function(this1,Value) {
	this1 &= -256;
	this1 |= Value > 255 ? 255 : Value < 0 ? 0 : Value;
	return Value;
};
flixel_util_FlxColor.set_alpha = function(this1,Value) {
	this1 &= 16777215;
	this1 |= (Value > 255 ? 255 : Value < 0 ? 0 : Value) << 24;
	return Value;
};
flixel_util_FlxColor.set_redFloat = function(this1,Value) {
	var Value1 = Math.round(Value * 255);
	this1 &= -16711681;
	this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
	return Value;
};
flixel_util_FlxColor.set_greenFloat = function(this1,Value) {
	var Value1 = Math.round(Value * 255);
	this1 &= -65281;
	this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
	return Value;
};
flixel_util_FlxColor.set_blueFloat = function(this1,Value) {
	var Value1 = Math.round(Value * 255);
	this1 &= -256;
	this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
	return Value;
};
flixel_util_FlxColor.set_alphaFloat = function(this1,Value) {
	var Value1 = Math.round(Value * 255);
	this1 &= 16777215;
	this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
	return Value;
};
flixel_util_FlxColor.get_cyan = function(this1) {
	return (1 - (this1 >> 16 & 255) / 255 - (1 - Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)))) / Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255));
};
flixel_util_FlxColor.get_magenta = function(this1) {
	return (1 - (this1 >> 8 & 255) / 255 - (1 - Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)))) / Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255));
};
flixel_util_FlxColor.get_yellow = function(this1) {
	return (1 - (this1 & 255) / 255 - (1 - Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)))) / Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255));
};
flixel_util_FlxColor.get_black = function(this1) {
	return 1 - Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255));
};
flixel_util_FlxColor.set_cyan = function(this1,Value) {
	var Magenta = (1 - (this1 >> 8 & 255) / 255 - (1 - Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)))) / Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255));
	var Yellow = (1 - (this1 & 255) / 255 - (1 - Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)))) / Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255));
	var Black = 1 - Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255));
	var Alpha = (this1 >> 24 & 255) / 255;
	if(Alpha == null) {
		Alpha = 1;
	}
	var Value1 = (1 - Value) * (1 - Black);
	var Value2 = Math.round(Value1 * 255);
	this1 &= -16711681;
	this1 |= (Value2 > 255 ? 255 : Value2 < 0 ? 0 : Value2) << 16;
	var Value1 = (1 - Magenta) * (1 - Black);
	var Value2 = Math.round(Value1 * 255);
	this1 &= -65281;
	this1 |= (Value2 > 255 ? 255 : Value2 < 0 ? 0 : Value2) << 8;
	var Value1 = (1 - Yellow) * (1 - Black);
	var Value2 = Math.round(Value1 * 255);
	this1 &= -256;
	this1 |= Value2 > 255 ? 255 : Value2 < 0 ? 0 : Value2;
	var Value1 = Math.round(Alpha * 255);
	this1 &= 16777215;
	this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
	return Value;
};
flixel_util_FlxColor.set_magenta = function(this1,Value) {
	var Yellow = (1 - (this1 & 255) / 255 - (1 - Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)))) / Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255));
	var Black = 1 - Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255));
	var Alpha = (this1 >> 24 & 255) / 255;
	if(Alpha == null) {
		Alpha = 1;
	}
	var Value1 = (1 - (1 - (this1 >> 16 & 255) / 255 - (1 - Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)))) / Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255))) * (1 - Black);
	var Value2 = Math.round(Value1 * 255);
	this1 &= -16711681;
	this1 |= (Value2 > 255 ? 255 : Value2 < 0 ? 0 : Value2) << 16;
	var Value1 = (1 - Value) * (1 - Black);
	var Value2 = Math.round(Value1 * 255);
	this1 &= -65281;
	this1 |= (Value2 > 255 ? 255 : Value2 < 0 ? 0 : Value2) << 8;
	var Value1 = (1 - Yellow) * (1 - Black);
	var Value2 = Math.round(Value1 * 255);
	this1 &= -256;
	this1 |= Value2 > 255 ? 255 : Value2 < 0 ? 0 : Value2;
	var Value1 = Math.round(Alpha * 255);
	this1 &= 16777215;
	this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
	return Value;
};
flixel_util_FlxColor.set_yellow = function(this1,Value) {
	var Magenta = (1 - (this1 >> 8 & 255) / 255 - (1 - Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)))) / Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255));
	var Black = 1 - Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255));
	var Alpha = (this1 >> 24 & 255) / 255;
	if(Alpha == null) {
		Alpha = 1;
	}
	var Value1 = (1 - (1 - (this1 >> 16 & 255) / 255 - (1 - Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)))) / Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255))) * (1 - Black);
	var Value2 = Math.round(Value1 * 255);
	this1 &= -16711681;
	this1 |= (Value2 > 255 ? 255 : Value2 < 0 ? 0 : Value2) << 16;
	var Value1 = (1 - Magenta) * (1 - Black);
	var Value2 = Math.round(Value1 * 255);
	this1 &= -65281;
	this1 |= (Value2 > 255 ? 255 : Value2 < 0 ? 0 : Value2) << 8;
	var Value1 = (1 - Value) * (1 - Black);
	var Value2 = Math.round(Value1 * 255);
	this1 &= -256;
	this1 |= Value2 > 255 ? 255 : Value2 < 0 ? 0 : Value2;
	var Value1 = Math.round(Alpha * 255);
	this1 &= 16777215;
	this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
	return Value;
};
flixel_util_FlxColor.set_black = function(this1,Value) {
	var Magenta = (1 - (this1 >> 8 & 255) / 255 - (1 - Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)))) / Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255));
	var Yellow = (1 - (this1 & 255) / 255 - (1 - Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)))) / Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255));
	var Alpha = (this1 >> 24 & 255) / 255;
	if(Alpha == null) {
		Alpha = 1;
	}
	var Value1 = (1 - (1 - (this1 >> 16 & 255) / 255 - (1 - Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)))) / Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255))) * (1 - Value);
	var Value2 = Math.round(Value1 * 255);
	this1 &= -16711681;
	this1 |= (Value2 > 255 ? 255 : Value2 < 0 ? 0 : Value2) << 16;
	var Value1 = (1 - Magenta) * (1 - Value);
	var Value2 = Math.round(Value1 * 255);
	this1 &= -65281;
	this1 |= (Value2 > 255 ? 255 : Value2 < 0 ? 0 : Value2) << 8;
	var Value1 = (1 - Yellow) * (1 - Value);
	var Value2 = Math.round(Value1 * 255);
	this1 &= -256;
	this1 |= Value2 > 255 ? 255 : Value2 < 0 ? 0 : Value2;
	var Value1 = Math.round(Alpha * 255);
	this1 &= 16777215;
	this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
	return Value;
};
flixel_util_FlxColor.get_hue = function(this1) {
	var hueRad = Math.atan2(Math.sqrt(3) * ((this1 >> 8 & 255) / 255 - (this1 & 255) / 255),2 * ((this1 >> 16 & 255) / 255) - (this1 >> 8 & 255) / 255 - (this1 & 255) / 255);
	var hue = 0;
	if(hueRad != 0) {
		hue = 180 / Math.PI * Math.atan2(Math.sqrt(3) * ((this1 >> 8 & 255) / 255 - (this1 & 255) / 255),2 * ((this1 >> 16 & 255) / 255) - (this1 >> 8 & 255) / 255 - (this1 & 255) / 255);
	}
	if(hue < 0) {
		return hue + 360;
	} else {
		return hue;
	}
};
flixel_util_FlxColor.get_brightness = function(this1) {
	return Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255));
};
flixel_util_FlxColor.get_saturation = function(this1) {
	return (Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)) - Math.min((this1 >> 16 & 255) / 255,Math.min((this1 >> 8 & 255) / 255,(this1 & 255) / 255))) / Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255));
};
flixel_util_FlxColor.get_lightness = function(this1) {
	return (Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)) + Math.min((this1 >> 16 & 255) / 255,Math.min((this1 >> 8 & 255) / 255,(this1 & 255) / 255))) / 2;
};
flixel_util_FlxColor.set_hue = function(this1,Value) {
	var Brightness = Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255));
	var Alpha = (this1 >> 24 & 255) / 255;
	var chroma = Brightness * ((Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)) - Math.min((this1 >> 16 & 255) / 255,Math.min((this1 >> 8 & 255) / 255,(this1 & 255) / 255))) / Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)));
	var match = Brightness - chroma;
	var Hue = Value;
	var Chroma = chroma;
	Hue %= 360;
	var hueD = Hue / 60;
	var mid = Chroma * (1 - Math.abs(hueD % 2 - 1)) + match;
	Chroma += match;
	switch(hueD | 0) {
	case 0:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value1 = Math.round(Chroma * 255);
		this1 &= -16711681;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
		var Value1 = Math.round(mid * 255);
		this1 &= -65281;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
		var Value1 = Math.round(match * 255);
		this1 &= -256;
		this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
		var Value1 = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
		break;
	case 1:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value1 = Math.round(mid * 255);
		this1 &= -16711681;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
		var Value1 = Math.round(Chroma * 255);
		this1 &= -65281;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
		var Value1 = Math.round(match * 255);
		this1 &= -256;
		this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
		var Value1 = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
		break;
	case 2:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value1 = Math.round(match * 255);
		this1 &= -16711681;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
		var Value1 = Math.round(Chroma * 255);
		this1 &= -65281;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
		var Value1 = Math.round(mid * 255);
		this1 &= -256;
		this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
		var Value1 = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
		break;
	case 3:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value1 = Math.round(match * 255);
		this1 &= -16711681;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
		var Value1 = Math.round(mid * 255);
		this1 &= -65281;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
		var Value1 = Math.round(Chroma * 255);
		this1 &= -256;
		this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
		var Value1 = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
		break;
	case 4:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value1 = Math.round(mid * 255);
		this1 &= -16711681;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
		var Value1 = Math.round(match * 255);
		this1 &= -65281;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
		var Value1 = Math.round(Chroma * 255);
		this1 &= -256;
		this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
		var Value1 = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
		break;
	case 5:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value1 = Math.round(Chroma * 255);
		this1 &= -16711681;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
		var Value1 = Math.round(match * 255);
		this1 &= -65281;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
		var Value1 = Math.round(mid * 255);
		this1 &= -256;
		this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
		var Value1 = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
		break;
	}
	return Value;
};
flixel_util_FlxColor.set_saturation = function(this1,Value) {
	var Hue = flixel_util_FlxColor.get_hue(this1);
	var Brightness = Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255));
	var Alpha = (this1 >> 24 & 255) / 255;
	var chroma = Brightness * Value;
	var match = Brightness - chroma;
	var Hue1 = Hue;
	var Chroma = chroma;
	Hue1 %= 360;
	var hueD = Hue1 / 60;
	var mid = Chroma * (1 - Math.abs(hueD % 2 - 1)) + match;
	Chroma += match;
	switch(hueD | 0) {
	case 0:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value1 = Math.round(Chroma * 255);
		this1 &= -16711681;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
		var Value1 = Math.round(mid * 255);
		this1 &= -65281;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
		var Value1 = Math.round(match * 255);
		this1 &= -256;
		this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
		var Value1 = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
		break;
	case 1:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value1 = Math.round(mid * 255);
		this1 &= -16711681;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
		var Value1 = Math.round(Chroma * 255);
		this1 &= -65281;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
		var Value1 = Math.round(match * 255);
		this1 &= -256;
		this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
		var Value1 = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
		break;
	case 2:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value1 = Math.round(match * 255);
		this1 &= -16711681;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
		var Value1 = Math.round(Chroma * 255);
		this1 &= -65281;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
		var Value1 = Math.round(mid * 255);
		this1 &= -256;
		this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
		var Value1 = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
		break;
	case 3:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value1 = Math.round(match * 255);
		this1 &= -16711681;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
		var Value1 = Math.round(mid * 255);
		this1 &= -65281;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
		var Value1 = Math.round(Chroma * 255);
		this1 &= -256;
		this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
		var Value1 = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
		break;
	case 4:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value1 = Math.round(mid * 255);
		this1 &= -16711681;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
		var Value1 = Math.round(match * 255);
		this1 &= -65281;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
		var Value1 = Math.round(Chroma * 255);
		this1 &= -256;
		this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
		var Value1 = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
		break;
	case 5:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value1 = Math.round(Chroma * 255);
		this1 &= -16711681;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
		var Value1 = Math.round(match * 255);
		this1 &= -65281;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
		var Value1 = Math.round(mid * 255);
		this1 &= -256;
		this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
		var Value1 = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
		break;
	}
	return Value;
};
flixel_util_FlxColor.set_brightness = function(this1,Value) {
	var Hue = flixel_util_FlxColor.get_hue(this1);
	var Alpha = (this1 >> 24 & 255) / 255;
	var chroma = Value * ((Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)) - Math.min((this1 >> 16 & 255) / 255,Math.min((this1 >> 8 & 255) / 255,(this1 & 255) / 255))) / Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)));
	var match = Value - chroma;
	var Hue1 = Hue;
	var Chroma = chroma;
	Hue1 %= 360;
	var hueD = Hue1 / 60;
	var mid = Chroma * (1 - Math.abs(hueD % 2 - 1)) + match;
	Chroma += match;
	switch(hueD | 0) {
	case 0:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value1 = Math.round(Chroma * 255);
		this1 &= -16711681;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
		var Value1 = Math.round(mid * 255);
		this1 &= -65281;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
		var Value1 = Math.round(match * 255);
		this1 &= -256;
		this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
		var Value1 = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
		break;
	case 1:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value1 = Math.round(mid * 255);
		this1 &= -16711681;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
		var Value1 = Math.round(Chroma * 255);
		this1 &= -65281;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
		var Value1 = Math.round(match * 255);
		this1 &= -256;
		this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
		var Value1 = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
		break;
	case 2:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value1 = Math.round(match * 255);
		this1 &= -16711681;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
		var Value1 = Math.round(Chroma * 255);
		this1 &= -65281;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
		var Value1 = Math.round(mid * 255);
		this1 &= -256;
		this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
		var Value1 = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
		break;
	case 3:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value1 = Math.round(match * 255);
		this1 &= -16711681;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
		var Value1 = Math.round(mid * 255);
		this1 &= -65281;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
		var Value1 = Math.round(Chroma * 255);
		this1 &= -256;
		this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
		var Value1 = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
		break;
	case 4:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value1 = Math.round(mid * 255);
		this1 &= -16711681;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
		var Value1 = Math.round(match * 255);
		this1 &= -65281;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
		var Value1 = Math.round(Chroma * 255);
		this1 &= -256;
		this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
		var Value1 = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
		break;
	case 5:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value1 = Math.round(Chroma * 255);
		this1 &= -16711681;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
		var Value1 = Math.round(match * 255);
		this1 &= -65281;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
		var Value1 = Math.round(mid * 255);
		this1 &= -256;
		this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
		var Value1 = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
		break;
	}
	return Value;
};
flixel_util_FlxColor.set_lightness = function(this1,Value) {
	var Hue = flixel_util_FlxColor.get_hue(this1);
	var Alpha = (this1 >> 24 & 255) / 255;
	var chroma = (1 - Math.abs(2 * Value - 1)) * ((Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)) - Math.min((this1 >> 16 & 255) / 255,Math.min((this1 >> 8 & 255) / 255,(this1 & 255) / 255))) / Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255)));
	var match = Value - chroma / 2;
	var Hue1 = Hue;
	var Chroma = chroma;
	Hue1 %= 360;
	var hueD = Hue1 / 60;
	var mid = Chroma * (1 - Math.abs(hueD % 2 - 1)) + match;
	Chroma += match;
	switch(hueD | 0) {
	case 0:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value1 = Math.round(Chroma * 255);
		this1 &= -16711681;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
		var Value1 = Math.round(mid * 255);
		this1 &= -65281;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
		var Value1 = Math.round(match * 255);
		this1 &= -256;
		this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
		var Value1 = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
		break;
	case 1:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value1 = Math.round(mid * 255);
		this1 &= -16711681;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
		var Value1 = Math.round(Chroma * 255);
		this1 &= -65281;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
		var Value1 = Math.round(match * 255);
		this1 &= -256;
		this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
		var Value1 = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
		break;
	case 2:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value1 = Math.round(match * 255);
		this1 &= -16711681;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
		var Value1 = Math.round(Chroma * 255);
		this1 &= -65281;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
		var Value1 = Math.round(mid * 255);
		this1 &= -256;
		this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
		var Value1 = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
		break;
	case 3:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value1 = Math.round(match * 255);
		this1 &= -16711681;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
		var Value1 = Math.round(mid * 255);
		this1 &= -65281;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
		var Value1 = Math.round(Chroma * 255);
		this1 &= -256;
		this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
		var Value1 = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
		break;
	case 4:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value1 = Math.round(mid * 255);
		this1 &= -16711681;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
		var Value1 = Math.round(match * 255);
		this1 &= -65281;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
		var Value1 = Math.round(Chroma * 255);
		this1 &= -256;
		this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
		var Value1 = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
		break;
	case 5:
		var Alpha1 = Alpha;
		if(Alpha1 == null) {
			Alpha1 = 1;
		}
		var Value1 = Math.round(Chroma * 255);
		this1 &= -16711681;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 16;
		var Value1 = Math.round(match * 255);
		this1 &= -65281;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 8;
		var Value1 = Math.round(mid * 255);
		this1 &= -256;
		this1 |= Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1;
		var Value1 = Math.round(Alpha1 * 255);
		this1 &= 16777215;
		this1 |= (Value1 > 255 ? 255 : Value1 < 0 ? 0 : Value1) << 24;
		break;
	}
	return Value;
};
flixel_util_FlxColor.maxColor = function(this1) {
	return Math.max((this1 >> 16 & 255) / 255,Math.max((this1 >> 8 & 255) / 255,(this1 & 255) / 255));
};
flixel_util_FlxColor.minColor = function(this1) {
	return Math.min((this1 >> 16 & 255) / 255,Math.min((this1 >> 8 & 255) / 255,(this1 & 255) / 255));
};
flixel_util_FlxColor.boundChannel = function(this1,Value) {
	if(Value > 255) {
		return 255;
	} else if(Value < 0) {
		return 0;
	} else {
		return Value;
	}
};
var flixel_util_FlxColorTransformUtil = function() { };
$hxClasses["flixel.util.FlxColorTransformUtil"] = flixel_util_FlxColorTransformUtil;
flixel_util_FlxColorTransformUtil.__name__ = "flixel.util.FlxColorTransformUtil";
flixel_util_FlxColorTransformUtil.setMultipliers = function(transform,red,green,blue,alpha) {
	transform.redMultiplier = red;
	transform.greenMultiplier = green;
	transform.blueMultiplier = blue;
	transform.alphaMultiplier = alpha;
	return transform;
};
flixel_util_FlxColorTransformUtil.setOffsets = function(transform,red,green,blue,alpha) {
	transform.redOffset = red;
	transform.greenOffset = green;
	transform.blueOffset = blue;
	transform.alphaOffset = alpha;
	return transform;
};
flixel_util_FlxColorTransformUtil.hasRGBMultipliers = function(transform) {
	if(!(transform.redMultiplier != 1 || transform.greenMultiplier != 1)) {
		return transform.blueMultiplier != 1;
	} else {
		return true;
	}
};
flixel_util_FlxColorTransformUtil.hasRGBAMultipliers = function(transform) {
	if(!flixel_util_FlxColorTransformUtil.hasRGBMultipliers(transform)) {
		return transform.alphaMultiplier != 1;
	} else {
		return true;
	}
};
flixel_util_FlxColorTransformUtil.hasRGBOffsets = function(transform) {
	if(!(transform.redOffset != 0 || transform.greenOffset != 0)) {
		return transform.blueOffset != 0;
	} else {
		return true;
	}
};
flixel_util_FlxColorTransformUtil.hasRGBAOffsets = function(transform) {
	if(!flixel_util_FlxColorTransformUtil.hasRGBOffsets(transform)) {
		return transform.alphaOffset != 0;
	} else {
		return true;
	}
};
var flixel_util_FlxDestroyUtil = function() { };
$hxClasses["flixel.util.FlxDestroyUtil"] = flixel_util_FlxDestroyUtil;
flixel_util_FlxDestroyUtil.__name__ = "flixel.util.FlxDestroyUtil";
flixel_util_FlxDestroyUtil.destroy = function(object) {
	if(object != null) {
		object.destroy();
	}
	return null;
};
flixel_util_FlxDestroyUtil.destroyArray = function(array) {
	if(array != null) {
		var _g = 0;
		while(_g < array.length) {
			var e = array[_g];
			++_g;
			flixel_util_FlxDestroyUtil.destroy(e);
		}
		array.splice(0,array.length);
	}
	return null;
};
flixel_util_FlxDestroyUtil.put = function(object) {
	if(object != null) {
		object.put();
	}
	return null;
};
flixel_util_FlxDestroyUtil.putArray = function(array) {
	if(array != null) {
		var _g = 0;
		while(_g < array.length) {
			var e = array[_g];
			++_g;
			flixel_util_FlxDestroyUtil.put(e);
		}
		array.splice(0,array.length);
	}
	return null;
};
flixel_util_FlxDestroyUtil.dispose = function(bitmapData) {
	if(bitmapData != null) {
		bitmapData.dispose();
	}
	return null;
};
flixel_util_FlxDestroyUtil.disposeIfNotEqual = function(bitmapData,width,height) {
	if(bitmapData != null && (bitmapData.width != width || bitmapData.height != height)) {
		bitmapData.dispose();
		return null;
	} else if(bitmapData != null) {
		return bitmapData;
	}
	return null;
};
flixel_util_FlxDestroyUtil.removeChild = function(parent,child) {
	if(parent != null && child != null && parent.contains(child)) {
		parent.removeChild(child);
	}
	return null;
};
var flixel_util_FlxGradient = function() { };
$hxClasses["flixel.util.FlxGradient"] = flixel_util_FlxGradient;
flixel_util_FlxGradient.__name__ = "flixel.util.FlxGradient";
flixel_util_FlxGradient.createGradientMatrix = function(width,height,colors,chunkSize,rotation) {
	if(rotation == null) {
		rotation = 90;
	}
	if(chunkSize == null) {
		chunkSize = 1;
	}
	var gradientMatrix = new openfl_geom_Matrix();
	var rot = rotation * (Math.PI / 180);
	gradientMatrix.createGradientBox(width,UInt.toFloat(height) / UInt.toFloat(chunkSize),rot,0,0);
	var alpha = [];
	var _g = 0;
	var _g1 = colors.length;
	while(_g < _g1) {
		var ai = _g++;
		alpha.push((colors[ai] >> 24 & 255) / 255);
	}
	var ratio = [];
	if(colors.length == 2) {
		ratio[0] = 0;
		ratio[1] = 255;
	} else {
		var spread = 255 / (colors.length - 1) | 0;
		ratio.push(0);
		var _g = 1;
		var _g1 = colors.length - 1;
		while(_g < _g1) {
			var ri = _g++;
			ratio.push(ri * spread);
		}
		ratio.push(255);
	}
	return { matrix : gradientMatrix, alpha : alpha, ratio : ratio};
};
flixel_util_FlxGradient.createGradientArray = function(width,height,colors,chunkSize,rotation,interpolate) {
	if(interpolate == null) {
		interpolate = true;
	}
	if(rotation == null) {
		rotation = 90;
	}
	if(chunkSize == null) {
		chunkSize = 1;
	}
	var data = flixel_util_FlxGradient.createGradientBitmapData(width,height,colors,chunkSize,rotation,interpolate);
	var result = [];
	var _g = 0;
	var _g1 = data.height;
	while(_g < _g1) {
		var y = _g++;
		result.push(data.getPixel32(0,y));
	}
	return result;
};
flixel_util_FlxGradient.createGradientFlxSprite = function(width,height,colors,chunkSize,rotation,interpolate) {
	if(interpolate == null) {
		interpolate = true;
	}
	if(rotation == null) {
		rotation = 90;
	}
	if(chunkSize == null) {
		chunkSize = 1;
	}
	var data = flixel_util_FlxGradient.createGradientBitmapData(width,height,colors,chunkSize,rotation,interpolate);
	var dest = new flixel_FlxSprite();
	dest.set_pixels(data);
	return dest;
};
flixel_util_FlxGradient.createGradientBitmapData = function(width,height,colors,chunkSize,rotation,interpolate) {
	if(interpolate == null) {
		interpolate = true;
	}
	if(rotation == null) {
		rotation = 90;
	}
	if(chunkSize == null) {
		chunkSize = 1;
	}
	if(UInt.gt(1,width)) {
		width = 1;
	}
	if(UInt.gt(1,height)) {
		height = 1;
	}
	var gradient = flixel_util_FlxGradient.createGradientMatrix(width,height,colors,chunkSize,rotation);
	var shape = new openfl_display_Shape();
	var interpolationMethod = interpolate ? 1 : 0;
	shape.get_graphics().beginGradientFill(0,colors,gradient.alpha,gradient.ratio,gradient.matrix,0,interpolationMethod,0);
	shape.get_graphics().drawRect(0,0,UInt.toFloat(width),UInt.toFloat(height) / UInt.toFloat(chunkSize));
	var data = new openfl_display_BitmapData(width,height,true,0);
	if(chunkSize == 1) {
		data.draw(shape);
	} else {
		var tempBitmap = new openfl_display_Bitmap(new openfl_display_BitmapData(width,UInt.toFloat(height) / UInt.toFloat(chunkSize) | 0,true,0));
		tempBitmap.get_bitmapData().draw(shape);
		tempBitmap.set_scaleY(UInt.toFloat(chunkSize));
		var sM = new openfl_geom_Matrix();
		sM.scale(tempBitmap.get_scaleX(),tempBitmap.get_scaleY());
		data.draw(tempBitmap,sM);
		var remainingRect = tempBitmap.get_height();
		var remainingRect1 = UInt.toFloat(width);
		var b = tempBitmap.get_height();
		var remainingRect2 = new openfl_geom_Rectangle(0,remainingRect,remainingRect1,UInt.toFloat(height) - b);
		data.fillRect(remainingRect2,colors[colors.length - 1]);
	}
	return data;
};
flixel_util_FlxGradient.overlayGradientOnFlxSprite = function(dest,width,height,colors,destX,destY,chunkSize,rotation,interpolate) {
	if(interpolate == null) {
		interpolate = true;
	}
	if(rotation == null) {
		rotation = 90;
	}
	if(chunkSize == null) {
		chunkSize = 1;
	}
	if(destY == null) {
		destY = 0;
	}
	if(destX == null) {
		destX = 0;
	}
	if(width > dest.get_width()) {
		width = dest.get_width() | 0;
	}
	if(height > dest.get_height()) {
		height = dest.get_height() | 0;
	}
	var source = flixel_util_FlxGradient.createGradientFlxSprite(width,height,colors,chunkSize,rotation,interpolate);
	dest.stamp(source,destX,destY);
	source.destroy();
	return dest;
};
flixel_util_FlxGradient.overlayGradientOnBitmapData = function(dest,width,height,colors,destX,destY,chunkSize,rotation,interpolate) {
	if(interpolate == null) {
		interpolate = true;
	}
	if(rotation == null) {
		rotation = 90;
	}
	if(chunkSize == null) {
		chunkSize = 1;
	}
	if(destY == null) {
		destY = 0;
	}
	if(destX == null) {
		destX = 0;
	}
	if(width > dest.width) {
		width = dest.width;
	}
	if(height > dest.height) {
		height = dest.height;
	}
	var source = flixel_util_FlxGradient.createGradientBitmapData(width,height,colors,chunkSize,rotation,interpolate);
	dest.copyPixels(source,new openfl_geom_Rectangle(0,0,source.width,source.height),new openfl_geom_Point(destX,destY),null,null,true);
	source.dispose();
	return dest;
};
var flixel_util_FlxHorizontalAlign = $hxEnums["flixel.util.FlxHorizontalAlign"] = { __ename__ : "flixel.util.FlxHorizontalAlign", __constructs__ : ["LEFT","CENTER","RIGHT"]
	,LEFT: {_hx_index:0,__enum__:"flixel.util.FlxHorizontalAlign",toString:$estr}
	,CENTER: {_hx_index:1,__enum__:"flixel.util.FlxHorizontalAlign",toString:$estr}
	,RIGHT: {_hx_index:2,__enum__:"flixel.util.FlxHorizontalAlign",toString:$estr}
};
var flixel_util_FlxPath = function(Nodes) {
	this._firstUpdate = false;
	this._wasObjectImmovable = null;
	this._autoRotate = false;
	this._inc = 1;
	this.finished = false;
	this.nodeIndex = 0;
	this.active = false;
	this.autoCenter = true;
	this.angle = 0;
	this.speed = 0;
	if(Nodes != null) {
		this._nodes = Nodes.slice();
	} else {
		this._nodes = [];
	}
};
$hxClasses["flixel.util.FlxPath"] = flixel_util_FlxPath;
flixel_util_FlxPath.__name__ = "flixel.util.FlxPath";
flixel_util_FlxPath.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_util_FlxPath.prototype = {
	_nodes: null
	,speed: null
	,angle: null
	,autoCenter: null
	,active: null
	,onComplete: null
	,nodeIndex: null
	,finished: null
	,_mode: null
	,_inc: null
	,_autoRotate: null
	,_wasObjectImmovable: null
	,_firstUpdate: null
	,object: null
	,reset: function() {
		this.autoCenter = true;
		return this;
	}
	,setProperties: function(Speed,Mode,AutoRotate) {
		if(AutoRotate == null) {
			AutoRotate = false;
		}
		if(Mode == null) {
			Mode = 0;
		}
		if(Speed == null) {
			Speed = 100;
		}
		this.speed = Math.abs(Speed);
		this._mode = Mode;
		this._autoRotate = AutoRotate;
		return this;
	}
	,start: function(Nodes,Speed,Mode,AutoRotate,NodesAsReference) {
		if(NodesAsReference == null) {
			NodesAsReference = false;
		}
		if(AutoRotate == null) {
			AutoRotate = false;
		}
		if(Mode == null) {
			Mode = 0;
		}
		if(Speed == null) {
			Speed = 100;
		}
		if(Nodes != null) {
			if(NodesAsReference) {
				this._nodes = Nodes;
			} else {
				this._nodes = Nodes.slice();
			}
		}
		this.setProperties(Speed,Mode,AutoRotate);
		if(this._nodes.length > 0) {
			this.restart();
		}
		return this;
	}
	,restart: function() {
		this.finished = false;
		this._firstUpdate = true;
		this.active = this._nodes.length > 0;
		if(!this.active) {
			return this;
		}
		if(this._mode == 1 || this._mode == 256) {
			this.nodeIndex = this._nodes.length - 1;
			this._inc = -1;
		} else {
			this.nodeIndex = 0;
			this._inc = 1;
		}
		return this;
	}
	,setNode: function(NodeIndex) {
		if(NodeIndex < 0) {
			NodeIndex = 0;
		} else if(NodeIndex > this._nodes.length - 1) {
			NodeIndex = this._nodes.length - 1;
		}
		this.nodeIndex = NodeIndex;
		this.advancePath();
		return this;
	}
	,update: function(elapsed) {
		if(this.object == null) {
			return;
		}
		if(this._firstUpdate) {
			this._wasObjectImmovable = this.object.immovable;
			this.object.set_immovable(true);
			this._firstUpdate = false;
		}
		flixel_util_FlxPath._point.set_x(this.object.x);
		flixel_util_FlxPath._point.set_y(this.object.y);
		if(this.autoCenter) {
			var _this = flixel_util_FlxPath._point;
			var X = this.object.get_width() * 0.5;
			var Y = this.object.get_height() * 0.5;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var _g = _this;
			_g.set_x(_g.x + X);
			var _g = _this;
			_g.set_y(_g.y + Y);
		}
		var node = this._nodes[this.nodeIndex];
		var deltaX = node.x - flixel_util_FlxPath._point.x;
		var deltaY = node.y - flixel_util_FlxPath._point.y;
		var horizontalOnly = (this._mode & 65536) > 0;
		var verticalOnly = (this._mode & 1048576) > 0;
		if(horizontalOnly) {
			if((deltaX > 0 ? deltaX : -deltaX) < this.speed * elapsed) {
				node = this.advancePath();
			}
		} else if(verticalOnly) {
			if((deltaY > 0 ? deltaY : -deltaY) < this.speed * elapsed) {
				node = this.advancePath();
			}
		} else if(Math.sqrt(deltaX * deltaX + deltaY * deltaY) < this.speed * elapsed) {
			node = this.advancePath();
		}
		if(this.object != null && this.speed != 0) {
			flixel_util_FlxPath._point.set_x(this.object.x);
			flixel_util_FlxPath._point.set_y(this.object.y);
			if(this.autoCenter) {
				var _this = flixel_util_FlxPath._point;
				var X = this.object.get_width() * 0.5;
				var Y = this.object.get_height() * 0.5;
				if(Y == null) {
					Y = 0;
				}
				if(X == null) {
					X = 0;
				}
				var _g = _this;
				_g.set_x(_g.x + X);
				var _g = _this;
				_g.set_y(_g.y + Y);
			}
			var _this = flixel_util_FlxPath._point;
			var result = Math.abs(_this.x - node.x) <= 0.0000001 && Math.abs(_this.y - node.y) <= 0.0000001;
			if(node._weak) {
				node.put();
			}
			if(!result) {
				this.calculateVelocity(node,horizontalOnly,verticalOnly);
			} else {
				this.object.velocity.set();
			}
			if(this._autoRotate) {
				this.object.angularVelocity = 0;
				this.object.angularAcceleration = 0;
				this.object.set_angle(this.angle);
			}
			if(this.finished) {
				this.cancel();
			}
		}
	}
	,calculateVelocity: function(node,horizontalOnly,verticalOnly) {
		if(horizontalOnly || flixel_util_FlxPath._point.y == node.y) {
			this.object.velocity.set_x(flixel_util_FlxPath._point.x < node.x ? this.speed : -this.speed);
			this.angle = this.object.velocity.x < 0 ? -90 : 90;
			if(!horizontalOnly) {
				this.object.velocity.set_y(0);
			}
		} else if(verticalOnly || flixel_util_FlxPath._point.x == node.x) {
			this.object.velocity.set_y(flixel_util_FlxPath._point.y < node.y ? this.speed : -this.speed);
			this.angle = this.object.velocity.y < 0 ? 0 : 180;
			if(!verticalOnly) {
				this.object.velocity.set_x(0);
			}
		} else {
			this.object.velocity.set_x(flixel_util_FlxPath._point.x < node.x ? this.speed : -this.speed);
			this.object.velocity.set_y(flixel_util_FlxPath._point.y < node.y ? this.speed : -this.speed);
			this.angle = flixel_util_FlxPath._point.angleBetween(node);
			this.object.velocity.set(0,-this.speed);
			var tmp = this.object.velocity;
			var X = 0;
			var Y = 0;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var X1 = X;
			var Y1 = Y;
			if(Y1 == null) {
				Y1 = 0;
			}
			if(X1 == null) {
				X1 = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X1,Y1);
			point._inPool = false;
			var point1 = point;
			point1._weak = true;
			tmp.rotate(point1,this.angle);
		}
	}
	,advancePath: function(Snap) {
		if(Snap == null) {
			Snap = true;
		}
		if(Snap) {
			var oldNode = this._nodes[this.nodeIndex];
			if(oldNode != null) {
				if((this._mode & 1048576) == 0) {
					this.object.set_x(oldNode.x);
					if(this.autoCenter) {
						var _g = this.object;
						_g.set_x(_g.x - this.object.get_width() * 0.5);
					}
				}
				if((this._mode & 65536) == 0) {
					this.object.set_y(oldNode.y);
					if(this.autoCenter) {
						var _g = this.object;
						_g.set_y(_g.y - this.object.get_height() * 0.5);
					}
				}
			}
		}
		var callComplete = false;
		this.nodeIndex += this._inc;
		if((this._mode & 1) > 0) {
			if(this.nodeIndex < 0) {
				this.nodeIndex = 0;
				callComplete = true;
				this.onEnd();
			}
		} else if((this._mode & 16) > 0) {
			if(this.nodeIndex >= this._nodes.length) {
				callComplete = true;
				this.nodeIndex = 0;
			}
		} else if((this._mode & 256) > 0) {
			if(this.nodeIndex < 0) {
				this.nodeIndex = this._nodes.length - 1;
				callComplete = true;
				if(this.nodeIndex < 0) {
					this.nodeIndex = 0;
				}
			}
		} else if((this._mode & 4096) > 0) {
			if(this._inc > 0) {
				if(this.nodeIndex >= this._nodes.length) {
					this.nodeIndex = this._nodes.length - 2;
					callComplete = true;
					if(this.nodeIndex < 0) {
						this.nodeIndex = 0;
					}
					this._inc = -this._inc;
				}
			} else if(this.nodeIndex < 0) {
				this.nodeIndex = 1;
				callComplete = true;
				if(this.nodeIndex >= this._nodes.length) {
					this.nodeIndex = this._nodes.length - 1;
				}
				if(this.nodeIndex < 0) {
					this.nodeIndex = 0;
				}
				this._inc = -this._inc;
			}
		} else if(this.nodeIndex >= this._nodes.length) {
			this.nodeIndex = this._nodes.length - 1;
			callComplete = true;
			this.onEnd();
		}
		if(callComplete && this.onComplete != null) {
			this.onComplete(this);
		}
		return this._nodes[this.nodeIndex];
	}
	,cancel: function() {
		this.onEnd();
		if(this.object != null) {
			this.object.velocity.set(0,0);
		}
		return this;
	}
	,onEnd: function() {
		this.finished = true;
		this.active = false;
		if(this._wasObjectImmovable != null) {
			this.object.set_immovable(this._wasObjectImmovable);
		}
		this._wasObjectImmovable = null;
	}
	,destroy: function() {
		flixel_util_FlxDestroyUtil.putArray(this._nodes);
		this._nodes = null;
		this.object = null;
		this.onComplete = null;
	}
	,add: function(X,Y) {
		var tmp = this._nodes;
		var X1 = X;
		var Y1 = Y;
		if(Y1 == null) {
			Y1 = 0;
		}
		if(X1 == null) {
			X1 = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X1,Y1);
		point._inPool = false;
		tmp.push(point);
		return this;
	}
	,addAt: function(X,Y,Index) {
		if(Index < 0) {
			return this;
		}
		var _this = this._nodes;
		var X1 = X;
		var Y1 = Y;
		if(Y1 == null) {
			Y1 = 0;
		}
		if(X1 == null) {
			X1 = 0;
		}
		var point = flixel_math_FlxPoint._pool.get().set(X1,Y1);
		point._inPool = false;
		_this.splice(Index,0,point);
		return this;
	}
	,addPoint: function(Node1,AsReference) {
		if(AsReference == null) {
			AsReference = false;
		}
		if(AsReference) {
			this._nodes.push(Node1);
		} else {
			var tmp = this._nodes;
			var X = Node1.x;
			var Y = Node1.y;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			tmp.push(point);
		}
		return this;
	}
	,addPointAt: function(Node1,Index,AsReference) {
		if(AsReference == null) {
			AsReference = false;
		}
		if(Index < 0) {
			return this;
		}
		if(AsReference) {
			this._nodes.splice(Index,0,Node1);
		} else {
			var _this = this._nodes;
			var X = Node1.x;
			var Y = Node1.y;
			if(Y == null) {
				Y = 0;
			}
			if(X == null) {
				X = 0;
			}
			var point = flixel_math_FlxPoint._pool.get().set(X,Y);
			point._inPool = false;
			_this.splice(Index,0,point);
		}
		return this;
	}
	,remove: function(Node1) {
		var index = this._nodes.indexOf(Node1);
		if(index >= 0) {
			return this._nodes.splice(index,1)[0];
		}
		return null;
	}
	,removeAt: function(Index) {
		if(this._nodes.length <= 0) {
			return null;
		}
		if(Index >= this._nodes.length - 1) {
			this._nodes.pop();
		}
		return this._nodes.splice(Index,1)[0];
	}
	,head: function() {
		if(this._nodes.length > 0) {
			return this._nodes[0];
		}
		return null;
	}
	,tail: function() {
		if(this._nodes.length > 0) {
			return this._nodes[this._nodes.length - 1];
		}
		return null;
	}
	,get_nodes: function() {
		return this._nodes;
	}
	,set_nodes: function(Nodes) {
		if(Nodes != null) {
			this._nodes = Nodes;
		}
		return this._nodes;
	}
	,__class__: flixel_util_FlxPath
	,__properties__: {set_nodes:"set_nodes",get_nodes:"get_nodes"}
};
var flixel_util_FlxPool = function(classObj) {
	this._count = 0;
	this._pool = [];
	this._class = classObj;
};
$hxClasses["flixel.util.FlxPool"] = flixel_util_FlxPool;
flixel_util_FlxPool.__name__ = "flixel.util.FlxPool";
flixel_util_FlxPool.__interfaces__ = [flixel_util_IFlxPool];
flixel_util_FlxPool.prototype = {
	_pool: null
	,_class: null
	,_count: null
	,get: function() {
		if(this._count == 0) {
			return Type.createInstance(this._class,[]);
		}
		return this._pool[--this._count];
	}
	,put: function(obj) {
		if(obj != null) {
			var i = this._pool.indexOf(obj);
			if(i == -1 || i >= this._count) {
				obj.destroy();
				this._pool[this._count++] = obj;
			}
		}
	}
	,putUnsafe: function(obj) {
		if(obj != null) {
			obj.destroy();
			this._pool[this._count++] = obj;
		}
	}
	,preAllocate: function(numObjects) {
		while(numObjects-- > 0) this._pool[this._count++] = Type.createInstance(this._class,[]);
	}
	,clear: function() {
		this._count = 0;
		var oldPool = this._pool;
		this._pool = [];
		return oldPool;
	}
	,get_length: function() {
		return this._count;
	}
	,__class__: flixel_util_FlxPool
	,__properties__: {get_length:"get_length"}
};
var flixel_util_FlxPool_$flixel_$util_$LabelValuePair = function(classObj) {
	this._count = 0;
	this._pool = [];
	this._class = classObj;
};
$hxClasses["flixel.util.FlxPool_flixel_util_LabelValuePair"] = flixel_util_FlxPool_$flixel_$util_$LabelValuePair;
flixel_util_FlxPool_$flixel_$util_$LabelValuePair.__name__ = "flixel.util.FlxPool_flixel_util_LabelValuePair";
flixel_util_FlxPool_$flixel_$util_$LabelValuePair.__interfaces__ = [flixel_util_IFlxPool];
flixel_util_FlxPool_$flixel_$util_$LabelValuePair.prototype = {
	_pool: null
	,_class: null
	,_count: null
	,get: function() {
		if(this._count == 0) {
			return Type.createInstance(this._class,[]);
		}
		return this._pool[--this._count];
	}
	,put: function(obj) {
		if(obj != null) {
			var i = this._pool.indexOf(obj);
			if(i == -1 || i >= this._count) {
				obj.label = null;
				obj.value = null;
				this._pool[this._count++] = obj;
			}
		}
	}
	,putUnsafe: function(obj) {
		if(obj != null) {
			obj.label = null;
			obj.value = null;
			this._pool[this._count++] = obj;
		}
	}
	,preAllocate: function(numObjects) {
		while(numObjects-- > 0) this._pool[this._count++] = Type.createInstance(this._class,[]);
	}
	,clear: function() {
		this._count = 0;
		var oldPool = this._pool;
		this._pool = [];
		return oldPool;
	}
	,get_length: function() {
		return this._count;
	}
	,__class__: flixel_util_FlxPool_$flixel_$util_$LabelValuePair
	,__properties__: {get_length:"get_length"}
};
var flixel_util_FlxSaveStatus = $hxEnums["flixel.util.FlxSaveStatus"] = { __ename__ : "flixel.util.FlxSaveStatus", __constructs__ : ["SUCCESS","PENDING","ERROR"]
	,SUCCESS: {_hx_index:0,__enum__:"flixel.util.FlxSaveStatus",toString:$estr}
	,PENDING: {_hx_index:1,__enum__:"flixel.util.FlxSaveStatus",toString:$estr}
	,ERROR: {_hx_index:2,__enum__:"flixel.util.FlxSaveStatus",toString:$estr}
};
var flixel_util_FlxTypedSignal = {};
flixel_util_FlxTypedSignal.__properties__ = {get_dispatch:"get_dispatch"};
flixel_util_FlxTypedSignal.add = function(this1,listener) {
	this1.add(listener);
};
flixel_util_FlxTypedSignal.addOnce = function(this1,listener) {
	this1.addOnce(listener);
};
flixel_util_FlxTypedSignal.remove = function(this1,listener) {
	this1.remove(listener);
};
flixel_util_FlxTypedSignal.has = function(this1,listener) {
	return this1.has(listener);
};
flixel_util_FlxTypedSignal.removeAll = function(this1) {
	this1.removeAll();
};
flixel_util_FlxTypedSignal.get_dispatch = function(this1) {
	return this1.dispatch;
};
flixel_util_FlxTypedSignal.toSignal0 = function(signal) {
	return new flixel_util__$FlxSignal_FlxSignal0();
};
flixel_util_FlxTypedSignal.toSignal1 = function(signal) {
	return new flixel_util__$FlxSignal_FlxSignal1();
};
flixel_util_FlxTypedSignal.toSignal2 = function(signal) {
	return new flixel_util__$FlxSignal_FlxSignal2();
};
flixel_util_FlxTypedSignal.toSignal3 = function(signal) {
	return new flixel_util__$FlxSignal_FlxSignal3();
};
flixel_util_FlxTypedSignal.toSignal4 = function(signal) {
	return new flixel_util__$FlxSignal_FlxSignal4();
};
var flixel_util__$FlxSignal_FlxSignalHandler = function(listener,dispatchOnce) {
	this.dispatchOnce = false;
	this.listener = listener;
	this.dispatchOnce = dispatchOnce;
};
$hxClasses["flixel.util._FlxSignal.FlxSignalHandler"] = flixel_util__$FlxSignal_FlxSignalHandler;
flixel_util__$FlxSignal_FlxSignalHandler.__name__ = "flixel.util._FlxSignal.FlxSignalHandler";
flixel_util__$FlxSignal_FlxSignalHandler.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_util__$FlxSignal_FlxSignalHandler.prototype = {
	listener: null
	,dispatchOnce: null
	,destroy: function() {
		this.listener = null;
	}
	,__class__: flixel_util__$FlxSignal_FlxSignalHandler
};
var flixel_util_IFlxSignal = function() { };
$hxClasses["flixel.util.IFlxSignal"] = flixel_util_IFlxSignal;
flixel_util_IFlxSignal.__name__ = "flixel.util.IFlxSignal";
flixel_util_IFlxSignal.__isInterface__ = true;
flixel_util_IFlxSignal.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_util_IFlxSignal.prototype = {
	dispatch: null
	,add: null
	,addOnce: null
	,remove: null
	,removeAll: null
	,has: null
	,__class__: flixel_util_IFlxSignal
};
var flixel_util__$FlxSignal_FlxBaseSignal = function() {
	this.processingListeners = false;
	this.handlers = [];
	this.pendingRemove = [];
};
$hxClasses["flixel.util._FlxSignal.FlxBaseSignal"] = flixel_util__$FlxSignal_FlxBaseSignal;
flixel_util__$FlxSignal_FlxBaseSignal.__name__ = "flixel.util._FlxSignal.FlxBaseSignal";
flixel_util__$FlxSignal_FlxBaseSignal.__interfaces__ = [flixel_util_IFlxSignal];
flixel_util__$FlxSignal_FlxBaseSignal.prototype = {
	dispatch: null
	,handlers: null
	,pendingRemove: null
	,processingListeners: null
	,add: function(listener) {
		if(listener != null) {
			this.registerListener(listener,false);
		}
	}
	,addOnce: function(listener) {
		if(listener != null) {
			this.registerListener(listener,true);
		}
	}
	,remove: function(listener) {
		if(listener != null) {
			var handler = this.getHandler(listener);
			if(handler != null) {
				if(this.processingListeners) {
					this.pendingRemove.push(handler);
				} else {
					HxOverrides.remove(this.handlers,handler);
					handler.destroy();
				}
			}
		}
	}
	,has: function(listener) {
		if(listener == null) {
			return false;
		}
		return this.getHandler(listener) != null;
	}
	,removeAll: function() {
		flixel_util_FlxDestroyUtil.destroyArray(this.handlers);
	}
	,destroy: function() {
		flixel_util_FlxDestroyUtil.destroyArray(this.handlers);
		this.handlers = null;
		this.pendingRemove = null;
	}
	,registerListener: function(listener,dispatchOnce) {
		var handler = this.getHandler(listener);
		if(handler == null) {
			handler = new flixel_util__$FlxSignal_FlxSignalHandler(listener,dispatchOnce);
			this.handlers.push(handler);
			return handler;
		} else if(handler.dispatchOnce != dispatchOnce) {
			throw haxe_Exception.thrown("You cannot addOnce() then add() the same listener without removing the relationship first.");
		} else {
			return handler;
		}
	}
	,getHandler: function(listener) {
		var _g = 0;
		var _g1 = this.handlers;
		while(_g < _g1.length) {
			var handler = _g1[_g];
			++_g;
			if(handler.listener == listener) {
				return handler;
			}
		}
		return null;
	}
	,__class__: flixel_util__$FlxSignal_FlxBaseSignal
};
var flixel_util__$FlxSignal_FlxSignal0 = function() {
	flixel_util__$FlxSignal_FlxBaseSignal.call(this);
	this.dispatch = $bind(this,this.dispatch0);
};
$hxClasses["flixel.util._FlxSignal.FlxSignal0"] = flixel_util__$FlxSignal_FlxSignal0;
flixel_util__$FlxSignal_FlxSignal0.__name__ = "flixel.util._FlxSignal.FlxSignal0";
flixel_util__$FlxSignal_FlxSignal0.__super__ = flixel_util__$FlxSignal_FlxBaseSignal;
flixel_util__$FlxSignal_FlxSignal0.prototype = $extend(flixel_util__$FlxSignal_FlxBaseSignal.prototype,{
	dispatch0: function() {
		this.processingListeners = true;
		var _g = 0;
		var _g1 = this.handlers;
		while(_g < _g1.length) {
			var handler = _g1[_g];
			++_g;
			handler.listener();
			if(handler.dispatchOnce) {
				this.remove(handler.listener);
			}
		}
		this.processingListeners = false;
		var _g = 0;
		var _g1 = this.pendingRemove;
		while(_g < _g1.length) {
			var handler = _g1[_g];
			++_g;
			this.remove(handler.listener);
		}
		if(this.pendingRemove.length > 0) {
			this.pendingRemove = [];
		}
	}
	,__class__: flixel_util__$FlxSignal_FlxSignal0
});
var flixel_util__$FlxSignal_FlxSignal1 = function() {
	flixel_util__$FlxSignal_FlxBaseSignal.call(this);
	this.dispatch = $bind(this,this.dispatch1);
};
$hxClasses["flixel.util._FlxSignal.FlxSignal1"] = flixel_util__$FlxSignal_FlxSignal1;
flixel_util__$FlxSignal_FlxSignal1.__name__ = "flixel.util._FlxSignal.FlxSignal1";
flixel_util__$FlxSignal_FlxSignal1.__super__ = flixel_util__$FlxSignal_FlxBaseSignal;
flixel_util__$FlxSignal_FlxSignal1.prototype = $extend(flixel_util__$FlxSignal_FlxBaseSignal.prototype,{
	dispatch1: function(value1) {
		this.processingListeners = true;
		var _g = 0;
		var _g1 = this.handlers;
		while(_g < _g1.length) {
			var handler = _g1[_g];
			++_g;
			handler.listener(value1);
			if(handler.dispatchOnce) {
				this.remove(handler.listener);
			}
		}
		this.processingListeners = false;
		var _g = 0;
		var _g1 = this.pendingRemove;
		while(_g < _g1.length) {
			var handler = _g1[_g];
			++_g;
			this.remove(handler.listener);
		}
		if(this.pendingRemove.length > 0) {
			this.pendingRemove = [];
		}
	}
	,__class__: flixel_util__$FlxSignal_FlxSignal1
});
var flixel_util__$FlxSignal_FlxSignal2 = function() {
	flixel_util__$FlxSignal_FlxBaseSignal.call(this);
	this.dispatch = $bind(this,this.dispatch2);
};
$hxClasses["flixel.util._FlxSignal.FlxSignal2"] = flixel_util__$FlxSignal_FlxSignal2;
flixel_util__$FlxSignal_FlxSignal2.__name__ = "flixel.util._FlxSignal.FlxSignal2";
flixel_util__$FlxSignal_FlxSignal2.__super__ = flixel_util__$FlxSignal_FlxBaseSignal;
flixel_util__$FlxSignal_FlxSignal2.prototype = $extend(flixel_util__$FlxSignal_FlxBaseSignal.prototype,{
	dispatch2: function(value1,value2) {
		this.processingListeners = true;
		var _g = 0;
		var _g1 = this.handlers;
		while(_g < _g1.length) {
			var handler = _g1[_g];
			++_g;
			handler.listener(value1,value2);
			if(handler.dispatchOnce) {
				this.remove(handler.listener);
			}
		}
		this.processingListeners = false;
		var _g = 0;
		var _g1 = this.pendingRemove;
		while(_g < _g1.length) {
			var handler = _g1[_g];
			++_g;
			this.remove(handler.listener);
		}
		if(this.pendingRemove.length > 0) {
			this.pendingRemove = [];
		}
	}
	,__class__: flixel_util__$FlxSignal_FlxSignal2
});
var flixel_util__$FlxSignal_FlxSignal3 = function() {
	flixel_util__$FlxSignal_FlxBaseSignal.call(this);
	this.dispatch = $bind(this,this.dispatch3);
};
$hxClasses["flixel.util._FlxSignal.FlxSignal3"] = flixel_util__$FlxSignal_FlxSignal3;
flixel_util__$FlxSignal_FlxSignal3.__name__ = "flixel.util._FlxSignal.FlxSignal3";
flixel_util__$FlxSignal_FlxSignal3.__super__ = flixel_util__$FlxSignal_FlxBaseSignal;
flixel_util__$FlxSignal_FlxSignal3.prototype = $extend(flixel_util__$FlxSignal_FlxBaseSignal.prototype,{
	dispatch3: function(value1,value2,value3) {
		this.processingListeners = true;
		var _g = 0;
		var _g1 = this.handlers;
		while(_g < _g1.length) {
			var handler = _g1[_g];
			++_g;
			handler.listener(value1,value2,value3);
			if(handler.dispatchOnce) {
				this.remove(handler.listener);
			}
		}
		this.processingListeners = false;
		var _g = 0;
		var _g1 = this.pendingRemove;
		while(_g < _g1.length) {
			var handler = _g1[_g];
			++_g;
			this.remove(handler.listener);
		}
		if(this.pendingRemove.length > 0) {
			this.pendingRemove = [];
		}
	}
	,__class__: flixel_util__$FlxSignal_FlxSignal3
});
var flixel_util__$FlxSignal_FlxSignal4 = function() {
	flixel_util__$FlxSignal_FlxBaseSignal.call(this);
	this.dispatch = $bind(this,this.dispatch4);
};
$hxClasses["flixel.util._FlxSignal.FlxSignal4"] = flixel_util__$FlxSignal_FlxSignal4;
flixel_util__$FlxSignal_FlxSignal4.__name__ = "flixel.util._FlxSignal.FlxSignal4";
flixel_util__$FlxSignal_FlxSignal4.__super__ = flixel_util__$FlxSignal_FlxBaseSignal;
flixel_util__$FlxSignal_FlxSignal4.prototype = $extend(flixel_util__$FlxSignal_FlxBaseSignal.prototype,{
	dispatch4: function(value1,value2,value3,value4) {
		this.processingListeners = true;
		var _g = 0;
		var _g1 = this.handlers;
		while(_g < _g1.length) {
			var handler = _g1[_g];
			++_g;
			handler.listener(value1,value2,value3,value4);
			if(handler.dispatchOnce) {
				this.remove(handler.listener);
			}
		}
		this.processingListeners = false;
		var _g = 0;
		var _g1 = this.pendingRemove;
		while(_g < _g1.length) {
			var handler = _g1[_g];
			++_g;
			this.remove(handler.listener);
		}
		if(this.pendingRemove.length > 0) {
			this.pendingRemove = [];
		}
	}
	,__class__: flixel_util__$FlxSignal_FlxSignal4
});
var flixel_util__$FlxSignal_Macro = function() { };
$hxClasses["flixel.util._FlxSignal.Macro"] = flixel_util__$FlxSignal_Macro;
flixel_util__$FlxSignal_Macro.__name__ = "flixel.util._FlxSignal.Macro";
var flixel_util_FlxSort = function() { };
$hxClasses["flixel.util.FlxSort"] = flixel_util_FlxSort;
flixel_util_FlxSort.__name__ = "flixel.util.FlxSort";
flixel_util_FlxSort.byY = function(Order,Obj1,Obj2) {
	var Value1 = Obj1.y;
	var Value2 = Obj2.y;
	var result = 0;
	if(Value1 < Value2) {
		result = Order;
	} else if(Value1 > Value2) {
		result = -Order;
	}
	return result;
};
flixel_util_FlxSort.byValues = function(Order,Value1,Value2) {
	var result = 0;
	if(Value1 < Value2) {
		result = Order;
	} else if(Value1 > Value2) {
		result = -Order;
	}
	return result;
};
var flixel_util_FlxSpriteUtil = function() { };
$hxClasses["flixel.util.FlxSpriteUtil"] = flixel_util_FlxSpriteUtil;
flixel_util_FlxSpriteUtil.__name__ = "flixel.util.FlxSpriteUtil";
flixel_util_FlxSpriteUtil.alphaMask = function(output,source,mask) {
	var data = flixel_system_FlxAssets.resolveBitmapData(source);
	var maskData = flixel_system_FlxAssets.resolveBitmapData(mask);
	if(data == null || maskData == null) {
		return null;
	}
	data = data.clone();
	data.copyChannel(maskData,new openfl_geom_Rectangle(0,0,data.width,data.height),new openfl_geom_Point(),8,8);
	output.set_pixels(data);
	return output;
};
flixel_util_FlxSpriteUtil.alphaMaskFlxSprite = function(sprite,mask,output) {
	sprite.drawFrame();
	var data = sprite.get_pixels().clone();
	data.copyChannel(mask.get_pixels(),new openfl_geom_Rectangle(0,0,sprite.get_width(),sprite.get_height()),new openfl_geom_Point(),8,8);
	output.set_pixels(data);
	return output;
};
flixel_util_FlxSpriteUtil.screenWrap = function(sprite,Left,Right,Top,Bottom) {
	if(Bottom == null) {
		Bottom = true;
	}
	if(Top == null) {
		Top = true;
	}
	if(Right == null) {
		Right = true;
	}
	if(Left == null) {
		Left = true;
	}
	if(Left && sprite.x + sprite.frameWidth / 2 <= 0) {
		sprite.set_x(flixel_FlxG.width);
	} else if(Right && sprite.x >= flixel_FlxG.width) {
		sprite.set_x(0);
	}
	if(Top && sprite.y + sprite.frameHeight / 2 <= 0) {
		sprite.set_y(flixel_FlxG.height);
	} else if(Bottom && sprite.y >= flixel_FlxG.height) {
		sprite.set_y(0);
	}
	return sprite;
};
flixel_util_FlxSpriteUtil.bound = function(sprite,MinX,MaxX,MinY,MaxY) {
	if(MaxY == null) {
		MaxY = 0;
	}
	if(MinY == null) {
		MinY = 0;
	}
	if(MaxX == null) {
		MaxX = 0;
	}
	if(MinX == null) {
		MinX = 0;
	}
	if(MaxX <= 0) {
		MaxX = flixel_FlxG.width;
	}
	if(MaxY <= 0) {
		MaxY = flixel_FlxG.height;
	}
	MaxX -= sprite.frameWidth;
	MaxY -= sprite.frameHeight;
	var Value = sprite.x;
	var lowerBound = MinX != null && Value < MinX ? MinX : Value;
	sprite.set_x(MaxX != null && lowerBound > MaxX ? MaxX : lowerBound);
	var Value = sprite.y;
	var lowerBound = MinY != null && Value < MinY ? MinY : Value;
	sprite.set_y(MaxY != null && lowerBound > MaxY ? MaxY : lowerBound);
	return sprite;
};
flixel_util_FlxSpriteUtil.space = function(objects,startX,startY,horizontalSpacing,verticalSpacing,spaceFromBounds,position) {
	if(spaceFromBounds == null) {
		spaceFromBounds = false;
	}
	var prevWidth = 0;
	var runningX = 0;
	if(horizontalSpacing != null) {
		if(spaceFromBounds) {
			prevWidth = objects[0].get_width();
		}
		runningX = startX;
	} else {
		runningX = objects[0].x;
	}
	var prevHeight = 0;
	var runningY = 0;
	if(verticalSpacing != null) {
		if(spaceFromBounds) {
			prevHeight = objects[0].get_height();
		}
		runningY = startY;
	} else {
		runningY = objects[0].y;
	}
	if(position != null) {
		position(objects[0],runningX,runningY);
	} else {
		objects[0].set_x(runningX);
		objects[0].set_y(runningY);
	}
	var curX = 0;
	var curY = 0;
	var _g = 1;
	var _g1 = objects.length;
	while(_g < _g1) {
		var i = _g++;
		var object = objects[i];
		if(horizontalSpacing != null) {
			curX = runningX + prevWidth + horizontalSpacing;
			runningX = curX;
		} else {
			curX = object.x;
		}
		if(verticalSpacing != null) {
			curY = runningY + prevHeight + verticalSpacing;
			runningY = curY;
		} else {
			curY = object.y;
		}
		if(position != null) {
			position(object,curX,curY);
		} else {
			object.set_x(curX);
			object.set_y(curY);
		}
		if(spaceFromBounds) {
			prevWidth = object.get_width();
			prevHeight = object.get_height();
		}
	}
};
flixel_util_FlxSpriteUtil.drawLine = function(sprite,StartX,StartY,EndX,EndY,lineStyle,drawStyle) {
	var lineStyle1 = lineStyle;
	if(lineStyle1 == null) {
		lineStyle1 = { thickness : 1, color : -1};
	}
	if(lineStyle1.thickness == null) {
		lineStyle1.thickness = 1;
	}
	if(lineStyle1.color == null) {
		lineStyle1.color = -1;
	}
	lineStyle = lineStyle1;
	flixel_util_FlxSpriteUtil.flashGfx.clear();
	if(lineStyle != null) {
		var color = lineStyle.color == null ? -16777216 : lineStyle.color;
		if(lineStyle.thickness == null) {
			lineStyle.thickness = 1;
		}
		if(lineStyle.pixelHinting == null) {
			lineStyle.pixelHinting = false;
		}
		if(lineStyle.miterLimit == null) {
			lineStyle.miterLimit = 3;
		}
		flixel_util_FlxSpriteUtil.flashGfx.lineStyle(lineStyle.thickness,color & 16777215,(color >> 24 & 255) / 255,lineStyle.pixelHinting,lineStyle.scaleMode,lineStyle.capsStyle,lineStyle.jointStyle,lineStyle.miterLimit);
	}
	if(0 != 0) {
		flixel_util_FlxSpriteUtil.flashGfx.beginFill(0,0.);
	}
	flixel_util_FlxSpriteUtil.flashGfx.moveTo(StartX,StartY);
	flixel_util_FlxSpriteUtil.flashGfx.lineTo(EndX,EndY);
	flixel_util_FlxSpriteUtil.flashGfx.endFill();
	flixel_util_FlxSpriteUtil.updateSpriteGraphic(sprite,drawStyle);
	return sprite;
};
flixel_util_FlxSpriteUtil.drawCurve = function(sprite,StartX,StartY,EndX,EndY,ControlX,ControlY,FillColor,lineStyle,drawStyle) {
	if(FillColor == null) {
		FillColor = 0;
	}
	var lineStyle1 = lineStyle;
	if(lineStyle1 == null) {
		lineStyle1 = { thickness : 1, color : -1};
	}
	if(lineStyle1.thickness == null) {
		lineStyle1.thickness = 1;
	}
	if(lineStyle1.color == null) {
		lineStyle1.color = -1;
	}
	lineStyle = lineStyle1;
	flixel_util_FlxSpriteUtil.flashGfx.clear();
	if(lineStyle != null) {
		var color = lineStyle.color == null ? -16777216 : lineStyle.color;
		if(lineStyle.thickness == null) {
			lineStyle.thickness = 1;
		}
		if(lineStyle.pixelHinting == null) {
			lineStyle.pixelHinting = false;
		}
		if(lineStyle.miterLimit == null) {
			lineStyle.miterLimit = 3;
		}
		flixel_util_FlxSpriteUtil.flashGfx.lineStyle(lineStyle.thickness,color & 16777215,(color >> 24 & 255) / 255,lineStyle.pixelHinting,lineStyle.scaleMode,lineStyle.capsStyle,lineStyle.jointStyle,lineStyle.miterLimit);
	}
	if(FillColor != 0) {
		flixel_util_FlxSpriteUtil.flashGfx.beginFill(FillColor & 16777215,(FillColor >> 24 & 255) / 255);
	}
	flixel_util_FlxSpriteUtil.flashGfx.moveTo(StartX,StartY);
	flixel_util_FlxSpriteUtil.flashGfx.curveTo(EndX,EndY,ControlX,ControlY);
	flixel_util_FlxSpriteUtil.flashGfx.endFill();
	flixel_util_FlxSpriteUtil.updateSpriteGraphic(sprite,drawStyle);
	return sprite;
};
flixel_util_FlxSpriteUtil.drawRect = function(sprite,X,Y,Width,Height,FillColor,lineStyle,drawStyle) {
	if(FillColor == null) {
		FillColor = -1;
	}
	flixel_util_FlxSpriteUtil.flashGfx.clear();
	if(lineStyle != null) {
		var color = lineStyle.color == null ? -16777216 : lineStyle.color;
		if(lineStyle.thickness == null) {
			lineStyle.thickness = 1;
		}
		if(lineStyle.pixelHinting == null) {
			lineStyle.pixelHinting = false;
		}
		if(lineStyle.miterLimit == null) {
			lineStyle.miterLimit = 3;
		}
		flixel_util_FlxSpriteUtil.flashGfx.lineStyle(lineStyle.thickness,color & 16777215,(color >> 24 & 255) / 255,lineStyle.pixelHinting,lineStyle.scaleMode,lineStyle.capsStyle,lineStyle.jointStyle,lineStyle.miterLimit);
	}
	if(FillColor != 0) {
		flixel_util_FlxSpriteUtil.flashGfx.beginFill(FillColor & 16777215,(FillColor >> 24 & 255) / 255);
	}
	flixel_util_FlxSpriteUtil.flashGfx.drawRect(X,Y,Width,Height);
	flixel_util_FlxSpriteUtil.flashGfx.endFill();
	flixel_util_FlxSpriteUtil.updateSpriteGraphic(sprite,drawStyle);
	return sprite;
};
flixel_util_FlxSpriteUtil.drawRoundRect = function(sprite,X,Y,Width,Height,EllipseWidth,EllipseHeight,FillColor,lineStyle,drawStyle) {
	if(FillColor == null) {
		FillColor = -1;
	}
	flixel_util_FlxSpriteUtil.flashGfx.clear();
	if(lineStyle != null) {
		var color = lineStyle.color == null ? -16777216 : lineStyle.color;
		if(lineStyle.thickness == null) {
			lineStyle.thickness = 1;
		}
		if(lineStyle.pixelHinting == null) {
			lineStyle.pixelHinting = false;
		}
		if(lineStyle.miterLimit == null) {
			lineStyle.miterLimit = 3;
		}
		flixel_util_FlxSpriteUtil.flashGfx.lineStyle(lineStyle.thickness,color & 16777215,(color >> 24 & 255) / 255,lineStyle.pixelHinting,lineStyle.scaleMode,lineStyle.capsStyle,lineStyle.jointStyle,lineStyle.miterLimit);
	}
	if(FillColor != 0) {
		flixel_util_FlxSpriteUtil.flashGfx.beginFill(FillColor & 16777215,(FillColor >> 24 & 255) / 255);
	}
	flixel_util_FlxSpriteUtil.flashGfx.drawRoundRect(X,Y,Width,Height,EllipseWidth,EllipseHeight);
	flixel_util_FlxSpriteUtil.flashGfx.endFill();
	flixel_util_FlxSpriteUtil.updateSpriteGraphic(sprite,drawStyle);
	return sprite;
};
flixel_util_FlxSpriteUtil.drawRoundRectComplex = function(sprite,X,Y,Width,Height,TopLeftRadius,TopRightRadius,BottomLeftRadius,BottomRightRadius,FillColor,lineStyle,drawStyle) {
	if(FillColor == null) {
		FillColor = -1;
	}
	flixel_util_FlxSpriteUtil.flashGfx.clear();
	if(lineStyle != null) {
		var color = lineStyle.color == null ? -16777216 : lineStyle.color;
		if(lineStyle.thickness == null) {
			lineStyle.thickness = 1;
		}
		if(lineStyle.pixelHinting == null) {
			lineStyle.pixelHinting = false;
		}
		if(lineStyle.miterLimit == null) {
			lineStyle.miterLimit = 3;
		}
		flixel_util_FlxSpriteUtil.flashGfx.lineStyle(lineStyle.thickness,color & 16777215,(color >> 24 & 255) / 255,lineStyle.pixelHinting,lineStyle.scaleMode,lineStyle.capsStyle,lineStyle.jointStyle,lineStyle.miterLimit);
	}
	if(FillColor != 0) {
		flixel_util_FlxSpriteUtil.flashGfx.beginFill(FillColor & 16777215,(FillColor >> 24 & 255) / 255);
	}
	flixel_util_FlxSpriteUtil.flashGfx.drawRoundRectComplex(X,Y,Width,Height,TopLeftRadius,TopRightRadius,BottomLeftRadius,BottomRightRadius);
	flixel_util_FlxSpriteUtil.flashGfx.endFill();
	flixel_util_FlxSpriteUtil.updateSpriteGraphic(sprite,drawStyle);
	return sprite;
};
flixel_util_FlxSpriteUtil.drawCircle = function(sprite,X,Y,Radius,FillColor,lineStyle,drawStyle) {
	if(FillColor == null) {
		FillColor = -1;
	}
	if(Radius == null) {
		Radius = -1;
	}
	if(Y == null) {
		Y = -1;
	}
	if(X == null) {
		X = -1;
	}
	if(X == -1 || Y == -1) {
		var midPoint = sprite.getGraphicMidpoint();
		if(X == -1) {
			X = midPoint.x - sprite.x;
		}
		if(Y == -1) {
			Y = midPoint.y - sprite.y;
		}
		midPoint.put();
	}
	if(Radius < 1) {
		var minVal = Math.min(sprite.frameWidth,sprite.frameHeight);
		Radius = minVal / 2;
	}
	flixel_util_FlxSpriteUtil.flashGfx.clear();
	if(lineStyle != null) {
		var color = lineStyle.color == null ? -16777216 : lineStyle.color;
		if(lineStyle.thickness == null) {
			lineStyle.thickness = 1;
		}
		if(lineStyle.pixelHinting == null) {
			lineStyle.pixelHinting = false;
		}
		if(lineStyle.miterLimit == null) {
			lineStyle.miterLimit = 3;
		}
		flixel_util_FlxSpriteUtil.flashGfx.lineStyle(lineStyle.thickness,color & 16777215,(color >> 24 & 255) / 255,lineStyle.pixelHinting,lineStyle.scaleMode,lineStyle.capsStyle,lineStyle.jointStyle,lineStyle.miterLimit);
	}
	if(FillColor != 0) {
		flixel_util_FlxSpriteUtil.flashGfx.beginFill(FillColor & 16777215,(FillColor >> 24 & 255) / 255);
	}
	flixel_util_FlxSpriteUtil.flashGfx.drawCircle(X,Y,Radius);
	flixel_util_FlxSpriteUtil.flashGfx.endFill();
	flixel_util_FlxSpriteUtil.updateSpriteGraphic(sprite,drawStyle);
	return sprite;
};
flixel_util_FlxSpriteUtil.drawEllipse = function(sprite,X,Y,Width,Height,FillColor,lineStyle,drawStyle) {
	if(FillColor == null) {
		FillColor = -1;
	}
	flixel_util_FlxSpriteUtil.flashGfx.clear();
	if(lineStyle != null) {
		var color = lineStyle.color == null ? -16777216 : lineStyle.color;
		if(lineStyle.thickness == null) {
			lineStyle.thickness = 1;
		}
		if(lineStyle.pixelHinting == null) {
			lineStyle.pixelHinting = false;
		}
		if(lineStyle.miterLimit == null) {
			lineStyle.miterLimit = 3;
		}
		flixel_util_FlxSpriteUtil.flashGfx.lineStyle(lineStyle.thickness,color & 16777215,(color >> 24 & 255) / 255,lineStyle.pixelHinting,lineStyle.scaleMode,lineStyle.capsStyle,lineStyle.jointStyle,lineStyle.miterLimit);
	}
	if(FillColor != 0) {
		flixel_util_FlxSpriteUtil.flashGfx.beginFill(FillColor & 16777215,(FillColor >> 24 & 255) / 255);
	}
	flixel_util_FlxSpriteUtil.flashGfx.drawEllipse(X,Y,Width,Height);
	flixel_util_FlxSpriteUtil.flashGfx.endFill();
	flixel_util_FlxSpriteUtil.updateSpriteGraphic(sprite,drawStyle);
	return sprite;
};
flixel_util_FlxSpriteUtil.drawTriangle = function(sprite,X,Y,Height,FillColor,lineStyle,drawStyle) {
	if(FillColor == null) {
		FillColor = -1;
	}
	flixel_util_FlxSpriteUtil.flashGfx.clear();
	if(lineStyle != null) {
		var color = lineStyle.color == null ? -16777216 : lineStyle.color;
		if(lineStyle.thickness == null) {
			lineStyle.thickness = 1;
		}
		if(lineStyle.pixelHinting == null) {
			lineStyle.pixelHinting = false;
		}
		if(lineStyle.miterLimit == null) {
			lineStyle.miterLimit = 3;
		}
		flixel_util_FlxSpriteUtil.flashGfx.lineStyle(lineStyle.thickness,color & 16777215,(color >> 24 & 255) / 255,lineStyle.pixelHinting,lineStyle.scaleMode,lineStyle.capsStyle,lineStyle.jointStyle,lineStyle.miterLimit);
	}
	if(FillColor != 0) {
		flixel_util_FlxSpriteUtil.flashGfx.beginFill(FillColor & 16777215,(FillColor >> 24 & 255) / 255);
	}
	flixel_util_FlxSpriteUtil.flashGfx.moveTo(X + Height / 2,Y);
	flixel_util_FlxSpriteUtil.flashGfx.lineTo(X + Height,Height + Y);
	flixel_util_FlxSpriteUtil.flashGfx.lineTo(X,Height + Y);
	flixel_util_FlxSpriteUtil.flashGfx.lineTo(X + Height / 2,Y);
	flixel_util_FlxSpriteUtil.flashGfx.endFill();
	flixel_util_FlxSpriteUtil.updateSpriteGraphic(sprite,drawStyle);
	return sprite;
};
flixel_util_FlxSpriteUtil.drawPolygon = function(sprite,Vertices,FillColor,lineStyle,drawStyle) {
	if(FillColor == null) {
		FillColor = -1;
	}
	flixel_util_FlxSpriteUtil.flashGfx.clear();
	if(lineStyle != null) {
		var color = lineStyle.color == null ? -16777216 : lineStyle.color;
		if(lineStyle.thickness == null) {
			lineStyle.thickness = 1;
		}
		if(lineStyle.pixelHinting == null) {
			lineStyle.pixelHinting = false;
		}
		if(lineStyle.miterLimit == null) {
			lineStyle.miterLimit = 3;
		}
		flixel_util_FlxSpriteUtil.flashGfx.lineStyle(lineStyle.thickness,color & 16777215,(color >> 24 & 255) / 255,lineStyle.pixelHinting,lineStyle.scaleMode,lineStyle.capsStyle,lineStyle.jointStyle,lineStyle.miterLimit);
	}
	if(FillColor != 0) {
		flixel_util_FlxSpriteUtil.flashGfx.beginFill(FillColor & 16777215,(FillColor >> 24 & 255) / 255);
	}
	var p = Vertices.shift();
	flixel_util_FlxSpriteUtil.flashGfx.moveTo(p.x,p.y);
	var _g = 0;
	while(_g < Vertices.length) {
		var p1 = Vertices[_g];
		++_g;
		flixel_util_FlxSpriteUtil.flashGfx.lineTo(p1.x,p1.y);
	}
	flixel_util_FlxSpriteUtil.flashGfx.endFill();
	flixel_util_FlxSpriteUtil.updateSpriteGraphic(sprite,drawStyle);
	Vertices.unshift(p);
	return sprite;
};
flixel_util_FlxSpriteUtil.beginDraw = function(FillColor,lineStyle) {
	flixel_util_FlxSpriteUtil.flashGfx.clear();
	if(lineStyle != null) {
		var color = lineStyle.color == null ? -16777216 : lineStyle.color;
		if(lineStyle.thickness == null) {
			lineStyle.thickness = 1;
		}
		if(lineStyle.pixelHinting == null) {
			lineStyle.pixelHinting = false;
		}
		if(lineStyle.miterLimit == null) {
			lineStyle.miterLimit = 3;
		}
		flixel_util_FlxSpriteUtil.flashGfx.lineStyle(lineStyle.thickness,color & 16777215,(color >> 24 & 255) / 255,lineStyle.pixelHinting,lineStyle.scaleMode,lineStyle.capsStyle,lineStyle.jointStyle,lineStyle.miterLimit);
	}
	if(FillColor != 0) {
		flixel_util_FlxSpriteUtil.flashGfx.beginFill(FillColor & 16777215,(FillColor >> 24 & 255) / 255);
	}
};
flixel_util_FlxSpriteUtil.endDraw = function(sprite,drawStyle) {
	flixel_util_FlxSpriteUtil.flashGfx.endFill();
	flixel_util_FlxSpriteUtil.updateSpriteGraphic(sprite,drawStyle);
	return sprite;
};
flixel_util_FlxSpriteUtil.updateSpriteGraphic = function(sprite,drawStyle) {
	if(drawStyle == null) {
		drawStyle = { smoothing : false};
	} else if(drawStyle.smoothing == null) {
		drawStyle.smoothing = false;
	}
	sprite.get_pixels().draw(flixel_util_FlxSpriteUtil.flashGfxSprite,drawStyle.matrix,drawStyle.colorTransform,drawStyle.blendMode,drawStyle.clipRect,drawStyle.smoothing);
	sprite.dirty = true;
	return sprite;
};
flixel_util_FlxSpriteUtil.setLineStyle = function(lineStyle) {
	if(lineStyle != null) {
		var color = lineStyle.color == null ? -16777216 : lineStyle.color;
		if(lineStyle.thickness == null) {
			lineStyle.thickness = 1;
		}
		if(lineStyle.pixelHinting == null) {
			lineStyle.pixelHinting = false;
		}
		if(lineStyle.miterLimit == null) {
			lineStyle.miterLimit = 3;
		}
		flixel_util_FlxSpriteUtil.flashGfx.lineStyle(lineStyle.thickness,color & 16777215,(color >> 24 & 255) / 255,lineStyle.pixelHinting,lineStyle.scaleMode,lineStyle.capsStyle,lineStyle.jointStyle,lineStyle.miterLimit);
	}
};
flixel_util_FlxSpriteUtil.getDefaultLineStyle = function(lineStyle) {
	if(lineStyle == null) {
		lineStyle = { thickness : 1, color : -1};
	}
	if(lineStyle.thickness == null) {
		lineStyle.thickness = 1;
	}
	if(lineStyle.color == null) {
		lineStyle.color = -1;
	}
	return lineStyle;
};
flixel_util_FlxSpriteUtil.fill = function(sprite,FillColor) {
	sprite.get_pixels().fillRect(sprite.get_pixels().rect,FillColor);
	if(sprite.get_pixels() != sprite.framePixels) {
		sprite.dirty = true;
	}
	return sprite;
};
flixel_util_FlxSpriteUtil.flicker = function(Object1,Duration,Interval,EndVisibility,ForceRestart,CompletionCallback,ProgressCallback) {
	if(ForceRestart == null) {
		ForceRestart = true;
	}
	if(EndVisibility == null) {
		EndVisibility = true;
	}
	if(Interval == null) {
		Interval = 0.04;
	}
	if(Duration == null) {
		Duration = 1;
	}
	return flixel_effects_FlxFlicker.flicker(Object1,Duration,Interval,EndVisibility,ForceRestart,CompletionCallback,ProgressCallback);
};
flixel_util_FlxSpriteUtil.isFlickering = function(Object1) {
	return flixel_effects_FlxFlicker.isFlickering(Object1);
};
flixel_util_FlxSpriteUtil.stopFlickering = function(Object1) {
	flixel_effects_FlxFlicker.stopFlickering(Object1);
	return Object1;
};
flixel_util_FlxSpriteUtil.fadeIn = function(sprite,Duration,ResetAlpha,OnComplete) {
	if(Duration == null) {
		Duration = 1;
	}
	if(ResetAlpha) {
		sprite.set_alpha(0);
	}
	var sprite1 = sprite;
	var tmp = function(f) {
		flixel_util_FlxSpriteUtil.alphaTween(sprite1,f);
	};
	flixel_tweens_FlxTween.num(sprite.alpha,1,Duration,{ onComplete : OnComplete},tmp);
	return sprite;
};
flixel_util_FlxSpriteUtil.fadeOut = function(sprite,Duration,OnComplete) {
	if(Duration == null) {
		Duration = 1;
	}
	var sprite1 = sprite;
	var tmp = function(f) {
		flixel_util_FlxSpriteUtil.alphaTween(sprite1,f);
	};
	flixel_tweens_FlxTween.num(sprite.alpha,0,Duration,{ onComplete : OnComplete},tmp);
	return sprite;
};
flixel_util_FlxSpriteUtil.alphaTween = function(sprite,f) {
	sprite.set_alpha(f);
};
var flixel_util_FlxStringUtil = function() { };
$hxClasses["flixel.util.FlxStringUtil"] = flixel_util_FlxStringUtil;
flixel_util_FlxStringUtil.__name__ = "flixel.util.FlxStringUtil";
flixel_util_FlxStringUtil.formatTicks = function(StartTicks,EndTicks) {
	return Math.abs(EndTicks - StartTicks) / 1000 + "s";
};
flixel_util_FlxStringUtil.formatTime = function(Seconds,ShowMS) {
	if(ShowMS == null) {
		ShowMS = false;
	}
	var timeString = (Seconds / 60 | 0) + ":";
	var timeStringHelper = (Seconds | 0) % 60;
	if(timeStringHelper < 10) {
		timeString += "0";
	}
	timeString += timeStringHelper;
	if(ShowMS) {
		timeString += ".";
		timeStringHelper = (Seconds - (Seconds | 0)) * 100 | 0;
		if(timeStringHelper < 10) {
			timeString += "0";
		}
		timeString += timeStringHelper;
	}
	return timeString;
};
flixel_util_FlxStringUtil.formatArray = function(AnyArray) {
	var string = "";
	if(AnyArray != null && AnyArray.length > 0) {
		string = Std.string(AnyArray[0]);
		var i = 1;
		var l = AnyArray.length;
		while(i < l) string += ", " + Std.string(AnyArray[i++]);
	}
	return string;
};
flixel_util_FlxStringUtil.formatStringMap = function(AnyMap) {
	var string = "";
	var key = haxe_ds_StringMap.keysIterator(AnyMap.h);
	while(key.hasNext()) {
		var key1 = key.next();
		string += key1 == null ? "null" : "" + key1;
		string += ", ";
	}
	return string.substring(0,string.length - 2);
};
flixel_util_FlxStringUtil.formatMoney = function(Amount,ShowDecimal,EnglishStyle) {
	if(EnglishStyle == null) {
		EnglishStyle = true;
	}
	if(ShowDecimal == null) {
		ShowDecimal = true;
	}
	var isNegative = Amount < 0;
	Amount = Math.abs(Amount);
	var string = "";
	var comma = "";
	var amount = Math.floor(Amount);
	while(amount > 0) {
		if(string.length > 0 && comma.length <= 0) {
			comma = EnglishStyle ? "," : ".";
		}
		var zeroes = "";
		var helper = amount - Math.floor(amount / 1000) * 1000;
		amount = Math.floor(amount / 1000);
		if(amount > 0) {
			if(helper < 100) {
				zeroes += "0";
			}
			if(helper < 10) {
				zeroes += "0";
			}
		}
		string = zeroes + helper + comma + string;
	}
	if(string == "") {
		string = "0";
	}
	if(ShowDecimal) {
		amount = Math.floor(Amount * 100) - Math.floor(Amount) * 100;
		string += EnglishStyle ? "." : ",";
		if(amount < 10) {
			string += "0";
		}
		string += amount;
	}
	if(isNegative) {
		string = "-" + string;
	}
	return string;
};
flixel_util_FlxStringUtil.formatBytes = function(Bytes,Precision) {
	if(Precision == null) {
		Precision = 2;
	}
	var units = ["Bytes","kB","MB","GB","TB","PB"];
	var curUnit = 0;
	while(Bytes >= 1024 && curUnit < units.length - 1) {
		Bytes /= 1024;
		++curUnit;
	}
	return flixel_math_FlxMath.roundDecimal(Bytes,Precision) + units[curUnit];
};
flixel_util_FlxStringUtil.filterDigits = function(Input) {
	var output_b = "";
	var _g = 0;
	var _g1 = Input.length;
	while(_g < _g1) {
		var i = _g++;
		var c = HxOverrides.cca(Input,i);
		if(c >= 48 && c <= 57) {
			output_b += String.fromCodePoint(c);
		}
	}
	return output_b;
};
flixel_util_FlxStringUtil.htmlFormat = function(Text1,Size,Color,Bold,Italic,Underlined) {
	if(Underlined == null) {
		Underlined = false;
	}
	if(Italic == null) {
		Italic = false;
	}
	if(Bold == null) {
		Bold = false;
	}
	if(Color == null) {
		Color = "FFFFFF";
	}
	if(Size == null) {
		Size = 12;
	}
	var prefix = "<font size='" + Size + "' color='#" + Color + "'>";
	var suffix = "</font>";
	if(Bold) {
		prefix = "<b>" + prefix;
		suffix += "</b>";
	}
	if(Italic) {
		prefix = "<i>" + prefix;
		suffix += "</i>";
	}
	if(Underlined) {
		prefix = "<u>" + prefix;
		suffix += "</u>";
	}
	return prefix + Text1 + suffix;
};
flixel_util_FlxStringUtil.getClassName = function(objectOrClass,simple) {
	if(simple == null) {
		simple = false;
	}
	var cl;
	if(js_Boot.__instanceof(objectOrClass,Class)) {
		cl = objectOrClass;
	} else {
		cl = js_Boot.getClass(objectOrClass);
	}
	return flixel_util_FlxStringUtil.formatPackage(cl.__name__,simple);
};
flixel_util_FlxStringUtil.getEnumName = function(enumValueOrEnum,simple) {
	if(simple == null) {
		simple = false;
	}
	var e;
	if(js_Boot.__instanceof(enumValueOrEnum,Enum)) {
		e = enumValueOrEnum;
	} else {
		e = Type.getEnum(enumValueOrEnum);
	}
	return flixel_util_FlxStringUtil.formatPackage(e.__ename__,simple);
};
flixel_util_FlxStringUtil.formatPackage = function(s,simple) {
	if(s == null) {
		return null;
	}
	s = StringTools.replace(s,"::",".");
	if(simple) {
		s = HxOverrides.substr(s,s.lastIndexOf(".") + 1,null);
	}
	return s;
};
flixel_util_FlxStringUtil.getHost = function(url) {
	var hostFromURL = new EReg("^(?:[a-z][a-z0-9+\\-.]*://)?(?:[a-z0-9\\-._~%!$&'()*+,;=]+@)?([a-z0-9\\-._~%]{3,}|\\[[a-f0-9:.]+\\])?(?::[0-9]+)?","i");
	if(hostFromURL.match(url)) {
		var host = hostFromURL.matched(1);
		if(host != null) {
			return decodeURIComponent(host.split("+").join(" ")).toLowerCase();
		} else {
			return "";
		}
	}
	return "";
};
flixel_util_FlxStringUtil.getDomain = function(url) {
	var host = flixel_util_FlxStringUtil.getHost(url);
	var isLocalhostOrIpAddress = new EReg("^(localhost|[0-9.]+|\\[[a-f0-9:.]+\\])$","i");
	var domainFromHost = new EReg("^(?:[a-z0-9\\-]+\\.)*([a-z0-9\\-]+\\.[a-z0-9\\-]+)$","i");
	if(!isLocalhostOrIpAddress.match(host) && domainFromHost.match(host)) {
		var domain = domainFromHost.matched(1);
		if(domain != null) {
			return domain.toLowerCase();
		} else {
			return "";
		}
	}
	return "";
};
flixel_util_FlxStringUtil.sameClassName = function(Obj1,Obj2,Simple) {
	if(Simple == null) {
		Simple = true;
	}
	return flixel_util_FlxStringUtil.getClassName(Obj1,Simple) == flixel_util_FlxStringUtil.getClassName(Obj2,Simple);
};
flixel_util_FlxStringUtil.toIntArray = function(Data) {
	if(Data != null && Data != "") {
		var strArray = Data.split(",");
		var iArray = [];
		var _g = 0;
		while(_g < strArray.length) {
			var str = strArray[_g];
			++_g;
			iArray.push(Std.parseInt(str));
		}
		return iArray;
	}
	return null;
};
flixel_util_FlxStringUtil.toFloatArray = function(Data) {
	if(Data != null && Data != "") {
		var strArray = Data.split(",");
		var fArray = [];
		var _g = 0;
		while(_g < strArray.length) {
			var str = strArray[_g];
			++_g;
			fArray.push(parseFloat(str));
		}
		return fArray;
	}
	return null;
};
flixel_util_FlxStringUtil.arrayToCSV = function(Data,Width,Invert) {
	if(Invert == null) {
		Invert = false;
	}
	var row = 0;
	var column;
	var csv = "";
	var height = Data.length / Width | 0;
	var index;
	var offset = 0;
	while(row < height) {
		column = 0;
		while(column < Width) {
			index = Data[offset];
			if(Invert) {
				if(index == 0) {
					index = 1;
				} else if(index == 1) {
					index = 0;
				}
			}
			if(column == 0) {
				if(row == 0) {
					csv += index;
				} else {
					csv += "\n" + index;
				}
			} else {
				csv += ", " + index;
			}
			++column;
			++offset;
		}
		++row;
	}
	return csv;
};
flixel_util_FlxStringUtil.bitmapToCSV = function(Bitmap,Invert,Scale,ColorMap) {
	if(Scale == null) {
		Scale = 1;
	}
	if(Invert == null) {
		Invert = false;
	}
	if(Scale < 1) {
		Scale = 1;
	}
	if(Scale > 1) {
		var bd = Bitmap;
		Bitmap = new openfl_display_BitmapData(Bitmap.width * Scale,Bitmap.height * Scale);
		var bdW = bd.width;
		var bdH = bd.height;
		var pCol = 0;
		var _g = 0;
		var _g1 = bdW;
		while(_g < _g1) {
			var i = _g++;
			var _g2 = 0;
			var _g3 = bdH;
			while(_g2 < _g3) {
				var j = _g2++;
				pCol = bd.getPixel(i,j);
				var _g4 = 0;
				var _g5 = Scale;
				while(_g4 < _g5) {
					var k = _g4++;
					var _g6 = 0;
					var _g7 = Scale;
					while(_g6 < _g7) {
						var m = _g6++;
						Bitmap.setPixel(i * Scale + k,j * Scale + m,pCol);
					}
				}
			}
		}
	}
	if(ColorMap != null) {
		var _g = 0;
		var _g1 = ColorMap.length;
		while(_g < _g1) {
			var i = _g++;
			ColorMap[i] = ColorMap[i] & 16777215;
		}
	}
	var row = 0;
	var column;
	var pixel;
	var csv = "";
	var bitmapWidth = Bitmap.width;
	var bitmapHeight = Bitmap.height;
	while(row < bitmapHeight) {
		column = 0;
		while(column < bitmapWidth) {
			pixel = Bitmap.getPixel(column,row);
			if(ColorMap != null) {
				pixel = ColorMap.indexOf(pixel);
			} else if(Invert && pixel > 0 || !Invert && pixel == 0) {
				pixel = 1;
			} else {
				pixel = 0;
			}
			if(column == 0) {
				if(row == 0) {
					csv += pixel;
				} else {
					csv += "\n" + pixel;
				}
			} else {
				csv += ", " + pixel;
			}
			++column;
		}
		++row;
	}
	return csv;
};
flixel_util_FlxStringUtil.imageToCSV = function(ImageFile,Invert,Scale,ColorMap) {
	if(Scale == null) {
		Scale = 1;
	}
	if(Invert == null) {
		Invert = false;
	}
	var tempBitmapData;
	if(typeof(ImageFile) == "string") {
		var id = ImageFile;
		tempBitmapData = openfl_utils_Assets.exists(id) ? openfl_utils_Assets.getBitmapData(id,false) : null;
	} else {
		tempBitmapData = Type.createInstance(ImageFile,[]).bitmapData;
	}
	return flixel_util_FlxStringUtil.bitmapToCSV(tempBitmapData,Invert,Scale,ColorMap);
};
flixel_util_FlxStringUtil.getDebugString = function(LabelValuePairs) {
	var output = "(";
	var _g = 0;
	while(_g < LabelValuePairs.length) {
		var pair = LabelValuePairs[_g];
		++_g;
		output += pair.label + ": ";
		var value = pair.value;
		if(typeof(value) == "number") {
			value = flixel_math_FlxMath.roundDecimal(value,flixel_FlxG.debugger.precision);
		}
		output += Std.string(value) + " | ";
		flixel_util_LabelValuePair._pool.put(pair);
	}
	output = StringTools.trim(HxOverrides.substr(output,0,output.length - 2));
	return output + ")";
};
flixel_util_FlxStringUtil.contains = function(s,str) {
	return s.indexOf(str) != -1;
};
flixel_util_FlxStringUtil.remove = function(s,sub) {
	return StringTools.replace(s,sub,"");
};
flixel_util_FlxStringUtil.insert = function(s,pos,insertion) {
	return s.substring(0,pos) + insertion + HxOverrides.substr(s,pos,null);
};
flixel_util_FlxStringUtil.sortAlphabetically = function(list) {
	list.sort(function(a,b) {
		a = a.toLowerCase();
		b = b.toLowerCase();
		if(a < b) {
			return -1;
		}
		if(a > b) {
			return 1;
		}
		return 0;
	});
	return list;
};
flixel_util_FlxStringUtil.isNullOrEmpty = function(s) {
	if(s != null) {
		return s.length == 0;
	} else {
		return true;
	}
};
var flixel_util_LabelValuePair = function() {
};
$hxClasses["flixel.util.LabelValuePair"] = flixel_util_LabelValuePair;
flixel_util_LabelValuePair.__name__ = "flixel.util.LabelValuePair";
flixel_util_LabelValuePair.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_util_LabelValuePair.weak = function(label,value) {
	var _this = flixel_util_LabelValuePair._pool.get();
	_this.label = label;
	_this.value = value;
	return _this;
};
flixel_util_LabelValuePair.prototype = {
	label: null
	,value: null
	,create: function(label,value) {
		this.label = label;
		this.value = value;
		return this;
	}
	,put: function() {
		flixel_util_LabelValuePair._pool.put(this);
	}
	,destroy: function() {
		this.label = null;
		this.value = null;
	}
	,__class__: flixel_util_LabelValuePair
};
var flixel_util_FlxTimer = function(manager) {
	this._inManager = false;
	this._loopsCounter = 0;
	this._timeCounter = 0;
	this.finished = false;
	this.active = false;
	this.loops = 0;
	this.time = 0;
	this.manager = manager != null ? manager : flixel_util_FlxTimer.globalManager;
};
$hxClasses["flixel.util.FlxTimer"] = flixel_util_FlxTimer;
flixel_util_FlxTimer.__name__ = "flixel.util.FlxTimer";
flixel_util_FlxTimer.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_util_FlxTimer.globalManager = null;
flixel_util_FlxTimer.prototype = {
	manager: null
	,time: null
	,loops: null
	,active: null
	,finished: null
	,onComplete: null
	,_timeCounter: null
	,_loopsCounter: null
	,_inManager: null
	,destroy: function() {
		this.onComplete = null;
	}
	,start: function(Time,OnComplete,Loops) {
		if(Loops == null) {
			Loops = 1;
		}
		if(Time == null) {
			Time = 1;
		}
		if(this.manager != null && !this._inManager) {
			this.manager.add(this);
			this._inManager = true;
		}
		this.active = true;
		this.finished = false;
		this.time = Math.abs(Time);
		if(Loops < 0) {
			Loops *= -1;
		}
		this.loops = Loops;
		this.onComplete = OnComplete;
		this._timeCounter = 0;
		this._loopsCounter = 0;
		return this;
	}
	,reset: function(NewTime) {
		if(NewTime == null) {
			NewTime = -1;
		}
		if(NewTime < 0) {
			NewTime = this.time;
		}
		this.start(NewTime,this.onComplete,this.loops);
		return this;
	}
	,cancel: function() {
		this.finished = true;
		this.active = false;
		if(this.manager != null && this._inManager) {
			this.manager.remove(this);
			this._inManager = false;
		}
	}
	,update: function(elapsed) {
		this._timeCounter += elapsed;
		while(this._timeCounter >= this.time && this.active && !this.finished) {
			this._timeCounter -= this.time;
			this._loopsCounter++;
			if(this.loops > 0 && this._loopsCounter >= this.loops) {
				this.finished = true;
			}
		}
	}
	,onLoopFinished: function() {
		if(this.finished) {
			this.cancel();
		}
		if(this.onComplete != null) {
			this.onComplete(this);
		}
	}
	,get_timeLeft: function() {
		return this.time - this._timeCounter;
	}
	,get_elapsedTime: function() {
		return this._timeCounter;
	}
	,get_loopsLeft: function() {
		return this.loops - this._loopsCounter;
	}
	,get_elapsedLoops: function() {
		return this._loopsCounter;
	}
	,get_progress: function() {
		if(this.time > 0) {
			return this._timeCounter / this.time;
		} else {
			return 0;
		}
	}
	,__class__: flixel_util_FlxTimer
	,__properties__: {get_progress:"get_progress",get_elapsedLoops:"get_elapsedLoops",get_loopsLeft:"get_loopsLeft",get_elapsedTime:"get_elapsedTime",get_timeLeft:"get_timeLeft"}
};
var flixel_util_FlxTimerManager = function() {
	this._timers = [];
	flixel_FlxBasic.call(this);
	this.set_visible(false);
	flixel_FlxG.signals.preStateSwitch.add($bind(this,this.clear));
};
$hxClasses["flixel.util.FlxTimerManager"] = flixel_util_FlxTimerManager;
flixel_util_FlxTimerManager.__name__ = "flixel.util.FlxTimerManager";
flixel_util_FlxTimerManager.__super__ = flixel_FlxBasic;
flixel_util_FlxTimerManager.prototype = $extend(flixel_FlxBasic.prototype,{
	_timers: null
	,destroy: function() {
		flixel_util_FlxArrayUtil.clearArray(this._timers);
		this._timers = null;
		flixel_FlxG.signals.preStateSwitch.remove($bind(this,this.clear));
		flixel_FlxBasic.prototype.destroy.call(this);
	}
	,update: function(elapsed) {
		var loopedTimers = null;
		var _g = 0;
		var _g1 = this._timers;
		while(_g < _g1.length) {
			var timer = _g1[_g];
			++_g;
			if(timer.active && !timer.finished && timer.time >= 0) {
				var timerLoops = timer._loopsCounter;
				timer.update(elapsed);
				if(timerLoops != timer._loopsCounter) {
					if(loopedTimers == null) {
						loopedTimers = [];
					}
					loopedTimers.push(timer);
				}
			}
		}
		if(loopedTimers != null) {
			while(loopedTimers.length > 0) loopedTimers.shift().onLoopFinished();
		}
	}
	,add: function(Timer) {
		this._timers.push(Timer);
	}
	,remove: function(Timer) {
		var array = this._timers;
		var index = array.indexOf(Timer);
		if(index != -1) {
			array[index] = array[array.length - 1];
			array.pop();
		}
	}
	,completeAll: function() {
		var timersToFinish = [];
		var _g = 0;
		var _g1 = this._timers;
		while(_g < _g1.length) {
			var timer = _g1[_g];
			++_g;
			if(timer.loops > 0 && timer.active) {
				timersToFinish.push(timer);
			}
		}
		var _g = 0;
		while(_g < timersToFinish.length) {
			var timer = timersToFinish[_g];
			++_g;
			while(!timer.finished) {
				timer.update(timer.time - timer._timeCounter);
				timer.onLoopFinished();
			}
		}
	}
	,clear: function() {
		flixel_util_FlxArrayUtil.clearArray(this._timers);
	}
	,forEach: function(Function1) {
		var _g = 0;
		var _g1 = this._timers;
		while(_g < _g1.length) {
			var timer = _g1[_g];
			++_g;
			Function1(timer);
		}
	}
	,__class__: flixel_util_FlxTimerManager
});
var flixel_util_FlxUnicodeUtil = function() { };
$hxClasses["flixel.util.FlxUnicodeUtil"] = flixel_util_FlxUnicodeUtil;
flixel_util_FlxUnicodeUtil.__name__ = "flixel.util.FlxUnicodeUtil";
flixel_util_FlxUnicodeUtil.uLength = function(s) {
	return UnicodeString.get_length(s);
};
flixel_util_FlxUnicodeUtil.uEquals = function(a,b) {
	return a == b;
};
flixel_util_FlxUnicodeUtil.uSub = function(s,pos,len) {
	return UnicodeString.substr(s,pos,len);
};
flixel_util_FlxUnicodeUtil.uCharCodeAt = function(s,index) {
	return UnicodeString.charCodeAt(s,index);
};
var flixel_util_UnicodeBuffer = {};
flixel_util_UnicodeBuffer._new = function(s) {
	if(s == null) {
		s = "";
	}
	var this1 = s;
	return this1;
};
flixel_util_UnicodeBuffer.addChar = function(this1,c) {
	var s = this1 + String.fromCodePoint(c);
	if(s == null) {
		s = "";
	}
	var this1 = s;
	return this1;
};
flixel_util_UnicodeBuffer.toString = function(this1) {
	return this1;
};
var flixel_util_FlxVerticalAlign = $hxEnums["flixel.util.FlxVerticalAlign"] = { __ename__ : "flixel.util.FlxVerticalAlign", __constructs__ : ["TOP","CENTER","BOTTOM"]
	,TOP: {_hx_index:0,__enum__:"flixel.util.FlxVerticalAlign",toString:$estr}
	,CENTER: {_hx_index:1,__enum__:"flixel.util.FlxVerticalAlign",toString:$estr}
	,BOTTOM: {_hx_index:2,__enum__:"flixel.util.FlxVerticalAlign",toString:$estr}
};
var flixel_util_helpers_FlxBounds = function(min,max) {
	this.active = true;
	this.min = min;
	this.max = max == null ? min : max;
};
$hxClasses["flixel.util.helpers.FlxBounds"] = flixel_util_helpers_FlxBounds;
flixel_util_helpers_FlxBounds.__name__ = "flixel.util.helpers.FlxBounds";
flixel_util_helpers_FlxBounds.prototype = {
	min: null
	,max: null
	,active: null
	,set: function(min,max) {
		this.min = min;
		this.max = max == null ? min : max;
		return this;
	}
	,equals: function(otherBounds) {
		if(this.min == otherBounds.min) {
			return this.max == otherBounds.max;
		} else {
			return false;
		}
	}
	,toString: function() {
		var value = this.min;
		var _this = flixel_util_LabelValuePair._pool.get();
		_this.label = "min";
		_this.value = value;
		var value = this.max;
		var _this1 = flixel_util_LabelValuePair._pool.get();
		_this1.label = "max";
		_this1.value = value;
		return flixel_util_FlxStringUtil.getDebugString([_this,_this1]);
	}
	,__class__: flixel_util_helpers_FlxBounds
};
var flixel_util_helpers_FlxPointRangeBounds = function(startMinX,startMinY,startMaxX,startMaxY,endMinX,endMinY,endMaxX,endMaxY) {
	this.active = true;
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	var point1 = flixel_math_FlxPoint._pool.get().set(0,0);
	point1._inPool = false;
	this.start = new flixel_util_helpers_FlxBounds(point,point1);
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	var point1 = flixel_math_FlxPoint._pool.get().set(0,0);
	point1._inPool = false;
	this.end = new flixel_util_helpers_FlxBounds(point,point1);
	this.set(startMinX,startMinY,startMaxX,startMaxY,endMinX,endMinY,endMaxX,endMaxY);
};
$hxClasses["flixel.util.helpers.FlxPointRangeBounds"] = flixel_util_helpers_FlxPointRangeBounds;
flixel_util_helpers_FlxPointRangeBounds.__name__ = "flixel.util.helpers.FlxPointRangeBounds";
flixel_util_helpers_FlxPointRangeBounds.__interfaces__ = [flixel_util_IFlxDestroyable];
flixel_util_helpers_FlxPointRangeBounds.prototype = {
	start: null
	,end: null
	,active: null
	,set: function(startMinX,startMinY,startMaxX,startMaxY,endMinX,endMinY,endMaxX,endMaxY) {
		this.start.min.set_x(startMinX);
		this.start.min.set_y(startMinY == null ? this.start.min.x : startMinY);
		this.start.max.set_x(startMaxX == null ? this.start.min.x : startMaxX);
		this.start.max.set_y(startMaxY == null ? this.start.min.y : startMaxY);
		this.end.min.set_x(endMinX == null ? this.start.min.x : endMinX);
		this.end.min.set_y(endMinY == null ? this.start.min.y : endMinY);
		this.end.max.set_x(endMaxX == null ? endMinX == null ? this.start.max.x : this.end.min.x : endMaxX);
		this.end.max.set_y(endMaxY == null ? endMinY == null ? this.start.max.y : this.end.min.y : endMaxY);
		return this;
	}
	,equals: function(OtherFlxPointRangeBounds) {
		var tmp;
		var tmp1;
		var _this = this.start.min;
		var point = OtherFlxPointRangeBounds.start.min;
		var result = Math.abs(_this.x - point.x) <= 0.0000001 && Math.abs(_this.y - point.y) <= 0.0000001;
		if(point._weak) {
			point.put();
		}
		if(result) {
			var _this = this.start.max;
			var point = OtherFlxPointRangeBounds.start.max;
			var result = Math.abs(_this.x - point.x) <= 0.0000001 && Math.abs(_this.y - point.y) <= 0.0000001;
			if(point._weak) {
				point.put();
			}
			tmp1 = result;
		} else {
			tmp1 = false;
		}
		if(tmp1) {
			var _this = this.end.min;
			var point = OtherFlxPointRangeBounds.end.min;
			var result = Math.abs(_this.x - point.x) <= 0.0000001 && Math.abs(_this.y - point.y) <= 0.0000001;
			if(point._weak) {
				point.put();
			}
			tmp = result;
		} else {
			tmp = false;
		}
		if(tmp) {
			var _this = this.end.max;
			var point = OtherFlxPointRangeBounds.end.max;
			var result = Math.abs(_this.x - point.x) <= 0.0000001 && Math.abs(_this.y - point.y) <= 0.0000001;
			if(point._weak) {
				point.put();
			}
			return result;
		} else {
			return false;
		}
	}
	,toString: function() {
		var value = this.start.min.x;
		var _this = flixel_util_LabelValuePair._pool.get();
		_this.label = "start.min.x";
		_this.value = value;
		var value = this.start.min.y;
		var _this1 = flixel_util_LabelValuePair._pool.get();
		_this1.label = "start.min.y";
		_this1.value = value;
		var value = this.start.max.x;
		var _this2 = flixel_util_LabelValuePair._pool.get();
		_this2.label = "start.max.x";
		_this2.value = value;
		var value = this.start.max.y;
		var _this3 = flixel_util_LabelValuePair._pool.get();
		_this3.label = "start.max.y";
		_this3.value = value;
		var value = this.end.min.x;
		var _this4 = flixel_util_LabelValuePair._pool.get();
		_this4.label = "end.min.x";
		_this4.value = value;
		var value = this.end.min.y;
		var _this5 = flixel_util_LabelValuePair._pool.get();
		_this5.label = "end.min.y";
		_this5.value = value;
		var value = this.end.max.x;
		var _this6 = flixel_util_LabelValuePair._pool.get();
		_this6.label = "end.max.x";
		_this6.value = value;
		var value = this.end.max.y;
		var _this7 = flixel_util_LabelValuePair._pool.get();
		_this7.label = "end.max.y";
		_this7.value = value;
		return flixel_util_FlxStringUtil.getDebugString([_this,_this1,_this2,_this3,_this4,_this5,_this6,_this7]);
	}
	,destroy: function() {
		this.start.min = flixel_util_FlxDestroyUtil.put(this.start.min);
		this.start.max = flixel_util_FlxDestroyUtil.put(this.start.max);
		this.end.min = flixel_util_FlxDestroyUtil.put(this.end.min);
		this.end.max = flixel_util_FlxDestroyUtil.put(this.end.max);
	}
	,__class__: flixel_util_helpers_FlxPointRangeBounds
};
var flixel_util_helpers_FlxRange = function(start,end) {
	this.active = true;
	this.start = start;
	this.end = end == null ? start : end;
};
$hxClasses["flixel.util.helpers.FlxRange"] = flixel_util_helpers_FlxRange;
flixel_util_helpers_FlxRange.__name__ = "flixel.util.helpers.FlxRange";
flixel_util_helpers_FlxRange.prototype = {
	start: null
	,end: null
	,active: null
	,set: function(start,end) {
		this.start = start;
		this.end = end == null ? start : end;
		return this;
	}
	,equals: function(OtherFlxRange) {
		if(this.start == OtherFlxRange.start) {
			return this.end == OtherFlxRange.end;
		} else {
			return false;
		}
	}
	,toString: function() {
		var value = this.start;
		var _this = flixel_util_LabelValuePair._pool.get();
		_this.label = "start";
		_this.value = value;
		var value = this.end;
		var _this1 = flixel_util_LabelValuePair._pool.get();
		_this1.label = "end";
		_this1.value = value;
		return flixel_util_FlxStringUtil.getDebugString([_this,_this1]);
	}
	,__class__: flixel_util_helpers_FlxRange
};
var flixel_util_helpers_FlxRangeBounds = function(startMin,startMax,endMin,endMax) {
	this.active = true;
	this.start = new flixel_util_helpers_FlxBounds(startMin,startMax == null ? startMin : startMax);
	this.end = new flixel_util_helpers_FlxBounds(endMin == null ? startMin : endMin,endMax == null ? this.start.max : endMax);
};
$hxClasses["flixel.util.helpers.FlxRangeBounds"] = flixel_util_helpers_FlxRangeBounds;
flixel_util_helpers_FlxRangeBounds.__name__ = "flixel.util.helpers.FlxRangeBounds";
flixel_util_helpers_FlxRangeBounds.prototype = {
	start: null
	,end: null
	,active: null
	,set: function(startMin,startMax,endMin,endMax) {
		this.start.min = startMin;
		this.start.max = startMax == null ? this.start.min : startMax;
		this.end.min = endMin == null ? this.start.min : endMin;
		this.end.max = endMax == null ? endMin == null ? this.start.max : this.end.min : endMax;
		return this;
	}
	,equals: function(OtherRangeBounds) {
		var _this = this.start;
		var otherBounds = OtherRangeBounds.start;
		if(_this.min == otherBounds.min && _this.max == otherBounds.max) {
			var _this = this.end;
			var otherBounds = OtherRangeBounds.end;
			if(_this.min == otherBounds.min) {
				return _this.max == otherBounds.max;
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
	,toString: function() {
		var value = this.start.min;
		var _this = flixel_util_LabelValuePair._pool.get();
		_this.label = "start.min";
		_this.value = value;
		var value = this.start.min;
		var _this1 = flixel_util_LabelValuePair._pool.get();
		_this1.label = "start.max";
		_this1.value = value;
		var value = this.end.min;
		var _this2 = flixel_util_LabelValuePair._pool.get();
		_this2.label = "end.min";
		_this2.value = value;
		var value = this.end.max;
		var _this3 = flixel_util_LabelValuePair._pool.get();
		_this3.label = "end.max";
		_this3.value = value;
		return flixel_util_FlxStringUtil.getDebugString([_this,_this1,_this2,_this3]);
	}
	,__class__: flixel_util_helpers_FlxRangeBounds
};
var haxe_StackItem = $hxEnums["haxe.StackItem"] = { __ename__ : "haxe.StackItem", __constructs__ : ["CFunction","Module","FilePos","Method","LocalFunction"]
	,CFunction: {_hx_index:0,__enum__:"haxe.StackItem",toString:$estr}
	,Module: ($_=function(m) { return {_hx_index:1,m:m,__enum__:"haxe.StackItem",toString:$estr}; },$_.__params__ = ["m"],$_)
	,FilePos: ($_=function(s,file,line,column) { return {_hx_index:2,s:s,file:file,line:line,column:column,__enum__:"haxe.StackItem",toString:$estr}; },$_.__params__ = ["s","file","line","column"],$_)
	,Method: ($_=function(classname,method) { return {_hx_index:3,classname:classname,method:method,__enum__:"haxe.StackItem",toString:$estr}; },$_.__params__ = ["classname","method"],$_)
	,LocalFunction: ($_=function(v) { return {_hx_index:4,v:v,__enum__:"haxe.StackItem",toString:$estr}; },$_.__params__ = ["v"],$_)
};
var haxe_CallStack = {};
haxe_CallStack.callStack = function() {
	return haxe_NativeStackTrace.toHaxe(haxe_NativeStackTrace.callStack());
};
haxe_CallStack.exceptionStack = function(fullStack) {
	if(fullStack == null) {
		fullStack = false;
	}
	var eStack = haxe_NativeStackTrace.toHaxe(haxe_NativeStackTrace.exceptionStack());
	return fullStack ? eStack : haxe_CallStack.subtract(eStack,haxe_CallStack.callStack());
};
haxe_CallStack.toString = function(stack) {
	var b = new StringBuf();
	var _g = 0;
	var _g1 = stack;
	while(_g < _g1.length) {
		var s = _g1[_g];
		++_g;
		b.b += "\nCalled from ";
		haxe_CallStack.itemToString(b,s);
	}
	return b.b;
};
haxe_CallStack.subtract = function(this1,stack) {
	var startIndex = -1;
	var i = -1;
	while(++i < this1.length) {
		var _g = 0;
		var _g1 = stack.length;
		while(_g < _g1) {
			var j = _g++;
			if(haxe_CallStack.equalItems(this1[i],stack[j])) {
				if(startIndex < 0) {
					startIndex = i;
				}
				++i;
				if(i >= this1.length) {
					break;
				}
			} else {
				startIndex = -1;
			}
		}
		if(startIndex >= 0) {
			break;
		}
	}
	if(startIndex >= 0) {
		return this1.slice(0,startIndex);
	} else {
		return this1;
	}
};
haxe_CallStack.equalItems = function(item1,item2) {
	if(item1 == null) {
		if(item2 == null) {
			return true;
		} else {
			return false;
		}
	} else {
		switch(item1._hx_index) {
		case 0:
			if(item2 == null) {
				return false;
			} else if(item2._hx_index == 0) {
				return true;
			} else {
				return false;
			}
			break;
		case 1:
			if(item2 == null) {
				return false;
			} else if(item2._hx_index == 1) {
				var m1 = item1.m;
				var m2 = item2.m;
				return m1 == m2;
			} else {
				return false;
			}
			break;
		case 2:
			if(item2 == null) {
				return false;
			} else if(item2._hx_index == 2) {
				var item11 = item1.s;
				var file1 = item1.file;
				var line1 = item1.line;
				var col1 = item1.column;
				var col2 = item2.column;
				var line2 = item2.line;
				var file2 = item2.file;
				var item21 = item2.s;
				if(file1 == file2 && line1 == line2 && col1 == col2) {
					return haxe_CallStack.equalItems(item11,item21);
				} else {
					return false;
				}
			} else {
				return false;
			}
			break;
		case 3:
			if(item2 == null) {
				return false;
			} else if(item2._hx_index == 3) {
				var class1 = item1.classname;
				var method1 = item1.method;
				var method2 = item2.method;
				var class2 = item2.classname;
				if(class1 == class2) {
					return method1 == method2;
				} else {
					return false;
				}
			} else {
				return false;
			}
			break;
		case 4:
			if(item2 == null) {
				return false;
			} else if(item2._hx_index == 4) {
				var v1 = item1.v;
				var v2 = item2.v;
				return v1 == v2;
			} else {
				return false;
			}
			break;
		}
	}
};
haxe_CallStack.itemToString = function(b,s) {
	switch(s._hx_index) {
	case 0:
		b.b += "a C function";
		break;
	case 1:
		var m = s.m;
		b.b += "module ";
		b.b += m == null ? "null" : "" + m;
		break;
	case 2:
		var col = s.column;
		var line = s.line;
		var file = s.file;
		var s1 = s.s;
		if(s1 != null) {
			haxe_CallStack.itemToString(b,s1);
			b.b += " (";
		}
		b.b += file == null ? "null" : "" + file;
		b.b += " line ";
		b.b += line == null ? "null" : "" + line;
		if(col != null) {
			b.b += " column ";
			b.b += col == null ? "null" : "" + col;
		}
		if(s1 != null) {
			b.b += ")";
		}
		break;
	case 3:
		var meth = s.method;
		var cname = s.classname;
		b.b += Std.string(cname == null ? "<unknown>" : cname);
		b.b += ".";
		b.b += meth == null ? "null" : "" + meth;
		break;
	case 4:
		var n = s.v;
		b.b += "local function #";
		b.b += n == null ? "null" : "" + n;
		break;
	}
};
var haxe_Exception = function(message,previous,native) {
	Error.call(this,message);
	this.message = message;
	this.__previousException = previous;
	this.__nativeException = native != null ? native : this;
	this.__skipStack = 0;
	var old = Error.prepareStackTrace;
	Error.prepareStackTrace = function(e) { return e.stack; }
	if(((native) instanceof Error)) {
		this.stack = native.stack;
	} else {
		var e = null;
		if(Error.captureStackTrace) {
			Error.captureStackTrace(this,haxe_Exception);
			e = this;
		} else {
			e = new Error();
			if(typeof(e.stack) == "undefined") {
				try { throw e; } catch(_) {}
				this.__skipStack++;
			}
		}
		this.stack = e.stack;
	}
	Error.prepareStackTrace = old;
};
$hxClasses["haxe.Exception"] = haxe_Exception;
haxe_Exception.__name__ = "haxe.Exception";
haxe_Exception.caught = function(value) {
	if(((value) instanceof haxe_Exception)) {
		return value;
	} else if(((value) instanceof Error)) {
		return new haxe_Exception(value.message,null,value);
	} else {
		return new haxe_ValueException(value,null,value);
	}
};
haxe_Exception.thrown = function(value) {
	if(((value) instanceof haxe_Exception)) {
		return value.get_native();
	} else if(((value) instanceof Error)) {
		return value;
	} else {
		var e = new haxe_ValueException(value);
		e.__skipStack++;
		return e;
	}
};
haxe_Exception.__super__ = Error;
haxe_Exception.prototype = $extend(Error.prototype,{
	__skipStack: null
	,__nativeException: null
	,__previousException: null
	,unwrap: function() {
		return this.__nativeException;
	}
	,__shiftStack: function() {
		this.__skipStack++;
	}
	,get_native: function() {
		return this.__nativeException;
	}
	,get_stack: function() {
		var _g = this.__exceptionStack;
		if(_g == null) {
			var value = haxe_NativeStackTrace.toHaxe(haxe_NativeStackTrace.normalize(this.stack),this.__skipStack);
			this.setProperty("__exceptionStack",value);
			return value;
		} else {
			var s = _g;
			return s;
		}
	}
	,setProperty: function(name,value) {
		try {
			Object.defineProperty(this,name,{ value : value});
		} catch( _g ) {
			this[name] = value;
		}
	}
	,__class__: haxe_Exception
	,__properties__: {get_native:"get_native",get_stack:"get_stack"}
});
var haxe__$Int64__$_$_$Int64 = function(high,low) {
	this.high = high;
	this.low = low;
};
$hxClasses["haxe._Int64.___Int64"] = haxe__$Int64__$_$_$Int64;
haxe__$Int64__$_$_$Int64.__name__ = "haxe._Int64.___Int64";
haxe__$Int64__$_$_$Int64.prototype = {
	high: null
	,low: null
	,__class__: haxe__$Int64__$_$_$Int64
};
var haxe_NativeStackTrace = function() { };
$hxClasses["haxe.NativeStackTrace"] = haxe_NativeStackTrace;
haxe_NativeStackTrace.__name__ = "haxe.NativeStackTrace";
haxe_NativeStackTrace.lastError = null;
haxe_NativeStackTrace.wrapCallSite = null;
haxe_NativeStackTrace.saveStack = function(e) {
	haxe_NativeStackTrace.lastError = e;
};
haxe_NativeStackTrace.callStack = function() {
	var e = new Error("");
	var stack = haxe_NativeStackTrace.tryHaxeStack(e);
	if(typeof(stack) == "undefined") {
		try {
			throw e;
		} catch( _g ) {
		}
		stack = e.stack;
	}
	return haxe_NativeStackTrace.normalize(stack,2);
};
haxe_NativeStackTrace.exceptionStack = function() {
	return haxe_NativeStackTrace.normalize(haxe_NativeStackTrace.tryHaxeStack(haxe_NativeStackTrace.lastError));
};
haxe_NativeStackTrace.toHaxe = function(s,skip) {
	if(skip == null) {
		skip = 0;
	}
	if(s == null) {
		return [];
	} else if(typeof(s) == "string") {
		var stack = s.split("\n");
		if(stack[0] == "Error") {
			stack.shift();
		}
		var m = [];
		var _g = 0;
		var _g1 = stack.length;
		while(_g < _g1) {
			var i = _g++;
			if(skip > i) {
				continue;
			}
			var line = stack[i];
			var matched = line.match(/^    at ([A-Za-z0-9_. ]+) \(([^)]+):([0-9]+):([0-9]+)\)$/);
			if(matched != null) {
				var path = matched[1].split(".");
				if(path[0] == "$hxClasses") {
					path.shift();
				}
				var meth = path.pop();
				var file = matched[2];
				var line1 = Std.parseInt(matched[3]);
				var column = Std.parseInt(matched[4]);
				m.push(haxe_StackItem.FilePos(meth == "Anonymous function" ? haxe_StackItem.LocalFunction() : meth == "Global code" ? null : haxe_StackItem.Method(path.join("."),meth),file,line1,column));
			} else {
				m.push(haxe_StackItem.Module(StringTools.trim(line)));
			}
		}
		return m;
	} else if(skip > 0 && Array.isArray(s)) {
		return s.slice(skip);
	} else {
		return s;
	}
};
haxe_NativeStackTrace.tryHaxeStack = function(e) {
	if(e == null) {
		return [];
	}
	var oldValue = Error.prepareStackTrace;
	Error.prepareStackTrace = haxe_NativeStackTrace.prepareHxStackTrace;
	var stack = e.stack;
	Error.prepareStackTrace = oldValue;
	return stack;
};
haxe_NativeStackTrace.prepareHxStackTrace = function(e,callsites) {
	var stack = [];
	var _g = 0;
	while(_g < callsites.length) {
		var site = callsites[_g];
		++_g;
		if(haxe_NativeStackTrace.wrapCallSite != null) {
			site = haxe_NativeStackTrace.wrapCallSite(site);
		}
		var method = null;
		var fullName = site.getFunctionName();
		if(fullName != null) {
			var idx = fullName.lastIndexOf(".");
			if(idx >= 0) {
				var className = fullName.substring(0,idx);
				var methodName = fullName.substring(idx + 1);
				method = haxe_StackItem.Method(className,methodName);
			} else {
				method = haxe_StackItem.Method(null,fullName);
			}
		}
		var fileName = site.getFileName();
		var fileAddr = fileName == null ? -1 : fileName.indexOf("file:");
		if(haxe_NativeStackTrace.wrapCallSite != null && fileAddr > 0) {
			fileName = fileName.substring(fileAddr + 6);
		}
		stack.push(haxe_StackItem.FilePos(method,fileName,site.getLineNumber(),site.getColumnNumber()));
	}
	return stack;
};
haxe_NativeStackTrace.normalize = function(stack,skipItems) {
	if(skipItems == null) {
		skipItems = 0;
	}
	if(Array.isArray(stack) && skipItems > 0) {
		return stack.slice(skipItems);
	} else if(typeof(stack) == "string") {
		switch(stack.substring(0,6)) {
		case "Error\n":case "Error:":
			++skipItems;
			break;
		default:
		}
		return haxe_NativeStackTrace.skipLines(stack,skipItems);
	} else {
		return stack;
	}
};
haxe_NativeStackTrace.skipLines = function(stack,skip,pos) {
	if(pos == null) {
		pos = 0;
	}
	if(skip > 0) {
		pos = stack.indexOf("\n",pos);
		if(pos < 0) {
			return "";
		} else {
			return haxe_NativeStackTrace.skipLines(stack,--skip,pos + 1);
		}
	} else {
		return stack.substring(pos);
	}
};
var haxe_Resource = function() { };
$hxClasses["haxe.Resource"] = haxe_Resource;
haxe_Resource.__name__ = "haxe.Resource";
haxe_Resource.content = null;
haxe_Resource.getString = function(name) {
	var _g = 0;
	var _g1 = haxe_Resource.content;
	while(_g < _g1.length) {
		var x = _g1[_g];
		++_g;
		if(x.name == name) {
			if(x.str != null) {
				return x.str;
			}
			var b = haxe_crypto_Base64.decode(x.data);
			return b.toString();
		}
	}
	return null;
};
haxe_Resource.getBytes = function(name) {
	var _g = 0;
	var _g1 = haxe_Resource.content;
	while(_g < _g1.length) {
		var x = _g1[_g];
		++_g;
		if(x.name == name) {
			if(x.str != null) {
				return haxe_io_Bytes.ofString(x.str);
			}
			return haxe_crypto_Base64.decode(x.data);
		}
	}
	return null;
};
var haxe_Serializer = function() {
	this.buf = new StringBuf();
	this.cache = [];
	this.useCache = haxe_Serializer.USE_CACHE;
	this.useEnumIndex = haxe_Serializer.USE_ENUM_INDEX;
	this.shash = new haxe_ds_StringMap();
	this.scount = 0;
};
$hxClasses["haxe.Serializer"] = haxe_Serializer;
haxe_Serializer.__name__ = "haxe.Serializer";
haxe_Serializer.run = function(v) {
	var s = new haxe_Serializer();
	s.serialize(v);
	return s.toString();
};
haxe_Serializer.prototype = {
	buf: null
	,cache: null
	,shash: null
	,scount: null
	,useCache: null
	,useEnumIndex: null
	,toString: function() {
		return this.buf.b;
	}
	,serializeString: function(s) {
		var x = this.shash.h[s];
		if(x != null) {
			this.buf.b += "R";
			this.buf.b += x == null ? "null" : "" + x;
			return;
		}
		this.shash.h[s] = this.scount++;
		this.buf.b += "y";
		s = encodeURIComponent(s);
		this.buf.b += Std.string(s.length);
		this.buf.b += ":";
		this.buf.b += s == null ? "null" : "" + s;
	}
	,serializeRef: function(v) {
		var vt = typeof(v);
		var _g = 0;
		var _g1 = this.cache.length;
		while(_g < _g1) {
			var i = _g++;
			var ci = this.cache[i];
			if(typeof(ci) == vt && ci == v) {
				this.buf.b += "r";
				this.buf.b += i == null ? "null" : "" + i;
				return true;
			}
		}
		this.cache.push(v);
		return false;
	}
	,serializeFields: function(v) {
		var _g = 0;
		var _g1 = Reflect.fields(v);
		while(_g < _g1.length) {
			var f = _g1[_g];
			++_g;
			this.serializeString(f);
			this.serialize(Reflect.field(v,f));
		}
		this.buf.b += "g";
	}
	,serialize: function(v) {
		var _g = Type.typeof(v);
		switch(_g._hx_index) {
		case 0:
			this.buf.b += "n";
			break;
		case 1:
			var v1 = v;
			if(v1 == 0) {
				this.buf.b += "z";
				return;
			}
			this.buf.b += "i";
			this.buf.b += v1 == null ? "null" : "" + v1;
			break;
		case 2:
			var v1 = v;
			if(isNaN(v1)) {
				this.buf.b += "k";
			} else if(!isFinite(v1)) {
				this.buf.b += v1 < 0 ? "m" : "p";
			} else {
				this.buf.b += "d";
				this.buf.b += v1 == null ? "null" : "" + v1;
			}
			break;
		case 3:
			this.buf.b += v ? "t" : "f";
			break;
		case 4:
			if(js_Boot.__instanceof(v,Class)) {
				var className = v.__name__;
				this.buf.b += "A";
				this.serializeString(className);
			} else if(js_Boot.__instanceof(v,Enum)) {
				this.buf.b += "B";
				this.serializeString(v.__ename__);
			} else {
				if(this.useCache && this.serializeRef(v)) {
					return;
				}
				this.buf.b += "o";
				this.serializeFields(v);
			}
			break;
		case 5:
			throw haxe_Exception.thrown("Cannot serialize function");
		case 6:
			var c = _g.c;
			if(c == String) {
				this.serializeString(v);
				return;
			}
			if(this.useCache && this.serializeRef(v)) {
				return;
			}
			switch(c) {
			case Array:
				var ucount = 0;
				this.buf.b += "a";
				var l = v["length"];
				var _g1 = 0;
				var _g2 = l;
				while(_g1 < _g2) {
					var i = _g1++;
					if(v[i] == null) {
						++ucount;
					} else {
						if(ucount > 0) {
							if(ucount == 1) {
								this.buf.b += "n";
							} else {
								this.buf.b += "u";
								this.buf.b += ucount == null ? "null" : "" + ucount;
							}
							ucount = 0;
						}
						this.serialize(v[i]);
					}
				}
				if(ucount > 0) {
					if(ucount == 1) {
						this.buf.b += "n";
					} else {
						this.buf.b += "u";
						this.buf.b += ucount == null ? "null" : "" + ucount;
					}
				}
				this.buf.b += "h";
				break;
			case Date:
				var d = v;
				this.buf.b += "v";
				this.buf.b += Std.string(d.getTime());
				break;
			case haxe_ds_IntMap:
				this.buf.b += "q";
				var v1 = v;
				var k = v1.keys();
				while(k.hasNext()) {
					var k1 = k.next();
					this.buf.b += ":";
					this.buf.b += k1 == null ? "null" : "" + k1;
					this.serialize(v1.h[k1]);
				}
				this.buf.b += "h";
				break;
			case haxe_ds_List:
				this.buf.b += "l";
				var v1 = v;
				var _g_head = v1.h;
				while(_g_head != null) {
					var val = _g_head.item;
					_g_head = _g_head.next;
					var i = val;
					this.serialize(i);
				}
				this.buf.b += "h";
				break;
			case haxe_ds_ObjectMap:
				this.buf.b += "M";
				var v1 = v;
				var k = v1.keys();
				while(k.hasNext()) {
					var k1 = k.next();
					var id = Reflect.field(k1,"__id__");
					Reflect.deleteField(k1,"__id__");
					this.serialize(k1);
					k1["__id__"] = id;
					this.serialize(v1.h[k1.__id__]);
				}
				this.buf.b += "h";
				break;
			case haxe_ds_StringMap:
				this.buf.b += "b";
				var v1 = v;
				var k = haxe_ds_StringMap.keysIterator(v1.h);
				while(k.hasNext()) {
					var k1 = k.next();
					this.serializeString(k1);
					this.serialize(v1.h[k1]);
				}
				this.buf.b += "h";
				break;
			case haxe_io_Bytes:
				var v1 = v;
				this.buf.b += "s";
				this.buf.b += Std.string(Math.ceil(v1.length * 8 / 6));
				this.buf.b += ":";
				var i = 0;
				var max = v1.length - 2;
				var b64 = haxe_Serializer.BASE64_CODES;
				if(b64 == null) {
					var this1 = new Array(haxe_Serializer.BASE64.length);
					b64 = this1;
					var _g1 = 0;
					var _g2 = haxe_Serializer.BASE64.length;
					while(_g1 < _g2) {
						var i1 = _g1++;
						b64[i1] = HxOverrides.cca(haxe_Serializer.BASE64,i1);
					}
					haxe_Serializer.BASE64_CODES = b64;
				}
				while(i < max) {
					var b1 = v1.b[i++];
					var b2 = v1.b[i++];
					var b3 = v1.b[i++];
					this.buf.b += String.fromCodePoint(b64[b1 >> 2]);
					this.buf.b += String.fromCodePoint(b64[(b1 << 4 | b2 >> 4) & 63]);
					this.buf.b += String.fromCodePoint(b64[(b2 << 2 | b3 >> 6) & 63]);
					this.buf.b += String.fromCodePoint(b64[b3 & 63]);
				}
				if(i == max) {
					var b1 = v1.b[i++];
					var b2 = v1.b[i++];
					this.buf.b += String.fromCodePoint(b64[b1 >> 2]);
					this.buf.b += String.fromCodePoint(b64[(b1 << 4 | b2 >> 4) & 63]);
					this.buf.b += String.fromCodePoint(b64[b2 << 2 & 63]);
				} else if(i == max + 1) {
					var b1 = v1.b[i++];
					this.buf.b += String.fromCodePoint(b64[b1 >> 2]);
					this.buf.b += String.fromCodePoint(b64[b1 << 4 & 63]);
				}
				break;
			default:
				if(this.useCache) {
					this.cache.pop();
				}
				if(v.hxSerialize != null) {
					this.buf.b += "C";
					this.serializeString(c.__name__);
					if(this.useCache) {
						this.cache.push(v);
					}
					v.hxSerialize(this);
					this.buf.b += "g";
				} else {
					this.buf.b += "c";
					this.serializeString(c.__name__);
					if(this.useCache) {
						this.cache.push(v);
					}
					this.serializeFields(v);
				}
			}
			break;
		case 7:
			var e = _g.e;
			if(this.useCache) {
				if(this.serializeRef(v)) {
					return;
				}
				this.cache.pop();
			}
			this.buf.b += Std.string(this.useEnumIndex ? "j" : "w");
			this.serializeString(e.__ename__);
			if(this.useEnumIndex) {
				this.buf.b += ":";
				this.buf.b += Std.string(v._hx_index);
			} else {
				var e = v;
				this.serializeString($hxEnums[e.__enum__].__constructs__[e._hx_index]);
			}
			this.buf.b += ":";
			var params = Type.enumParameters(v);
			this.buf.b += Std.string(params.length);
			var _g = 0;
			while(_g < params.length) {
				var p = params[_g];
				++_g;
				this.serialize(p);
			}
			if(this.useCache) {
				this.cache.push(v);
			}
			break;
		default:
			throw haxe_Exception.thrown("Cannot serialize " + Std.string(v));
		}
	}
	,__class__: haxe_Serializer
};
var haxe_Timer = function(time_ms) {
	var me = this;
	this.id = setInterval(function() {
		me.run();
	},time_ms);
};
$hxClasses["haxe.Timer"] = haxe_Timer;
haxe_Timer.__name__ = "haxe.Timer";
haxe_Timer.delay = function(f,time_ms) {
	var t = new haxe_Timer(time_ms);
	t.run = function() {
		t.stop();
		f();
	};
	return t;
};
haxe_Timer.measure = function(f,pos) {
	var t0 = new Date().getTime() / 1000;
	var r = f();
	haxe_Log.trace(new Date().getTime() / 1000 - t0 + "s",pos);
	return r;
};
haxe_Timer.stamp = function() {
	return new Date().getTime() / 1000;
};
haxe_Timer.prototype = {
	id: null
	,stop: function() {
		if(this.id == null) {
			return;
		}
		clearInterval(this.id);
		this.id = null;
	}
	,run: function() {
	}
	,__class__: haxe_Timer
};
var haxe__$Unserializer_DefaultResolver = function() {
};
$hxClasses["haxe._Unserializer.DefaultResolver"] = haxe__$Unserializer_DefaultResolver;
haxe__$Unserializer_DefaultResolver.__name__ = "haxe._Unserializer.DefaultResolver";
haxe__$Unserializer_DefaultResolver.prototype = {
	resolveClass: function(name) {
		return $hxClasses[name];
	}
	,resolveEnum: function(name) {
		return $hxEnums[name];
	}
	,__class__: haxe__$Unserializer_DefaultResolver
};
var haxe_Unserializer = function(buf) {
	this.buf = buf;
	this.length = buf.length;
	this.pos = 0;
	this.scache = [];
	this.cache = [];
	var r = haxe_Unserializer.DEFAULT_RESOLVER;
	if(r == null) {
		r = new haxe__$Unserializer_DefaultResolver();
		haxe_Unserializer.DEFAULT_RESOLVER = r;
	}
	this.resolver = r;
};
$hxClasses["haxe.Unserializer"] = haxe_Unserializer;
haxe_Unserializer.__name__ = "haxe.Unserializer";
haxe_Unserializer.initCodes = function() {
	var codes = [];
	var _g = 0;
	var _g1 = haxe_Unserializer.BASE64.length;
	while(_g < _g1) {
		var i = _g++;
		codes[haxe_Unserializer.BASE64.charCodeAt(i)] = i;
	}
	return codes;
};
haxe_Unserializer.run = function(v) {
	return new haxe_Unserializer(v).unserialize();
};
haxe_Unserializer.prototype = {
	buf: null
	,pos: null
	,length: null
	,cache: null
	,scache: null
	,resolver: null
	,setResolver: function(r) {
		if(r == null) {
			if(haxe__$Unserializer_NullResolver.instance == null) {
				haxe__$Unserializer_NullResolver.instance = new haxe__$Unserializer_NullResolver();
			}
			this.resolver = haxe__$Unserializer_NullResolver.instance;
		} else {
			this.resolver = r;
		}
	}
	,readDigits: function() {
		var k = 0;
		var s = false;
		var fpos = this.pos;
		while(true) {
			var c = this.buf.charCodeAt(this.pos);
			if(c != c) {
				break;
			}
			if(c == 45) {
				if(this.pos != fpos) {
					break;
				}
				s = true;
				this.pos++;
				continue;
			}
			if(c < 48 || c > 57) {
				break;
			}
			k = k * 10 + (c - 48);
			this.pos++;
		}
		if(s) {
			k *= -1;
		}
		return k;
	}
	,readFloat: function() {
		var p1 = this.pos;
		while(true) {
			var c = this.buf.charCodeAt(this.pos);
			if(c != c) {
				break;
			}
			if(c >= 43 && c < 58 || c == 101 || c == 69) {
				this.pos++;
			} else {
				break;
			}
		}
		return parseFloat(HxOverrides.substr(this.buf,p1,this.pos - p1));
	}
	,unserializeObject: function(o) {
		while(true) {
			if(this.pos >= this.length) {
				throw haxe_Exception.thrown("Invalid object");
			}
			if(this.buf.charCodeAt(this.pos) == 103) {
				break;
			}
			var k = this.unserialize();
			if(typeof(k) != "string") {
				throw haxe_Exception.thrown("Invalid object key");
			}
			var v = this.unserialize();
			o[k] = v;
		}
		this.pos++;
	}
	,unserializeEnum: function(edecl,tag) {
		if(this.buf.charCodeAt(this.pos++) != 58) {
			throw haxe_Exception.thrown("Invalid enum format");
		}
		var nargs = this.readDigits();
		if(nargs == 0) {
			return Type.createEnum(edecl,tag);
		}
		var args = [];
		while(nargs-- > 0) args.push(this.unserialize());
		return Type.createEnum(edecl,tag,args);
	}
	,unserialize: function() {
		switch(this.buf.charCodeAt(this.pos++)) {
		case 65:
			var name = this.unserialize();
			var cl = this.resolver.resolveClass(name);
			if(cl == null) {
				throw haxe_Exception.thrown("Class not found " + name);
			}
			return cl;
		case 66:
			var name = this.unserialize();
			var e = this.resolver.resolveEnum(name);
			if(e == null) {
				throw haxe_Exception.thrown("Enum not found " + name);
			}
			return e;
		case 67:
			var name = this.unserialize();
			var cl = this.resolver.resolveClass(name);
			if(cl == null) {
				throw haxe_Exception.thrown("Class not found " + name);
			}
			var o = Object.create(cl.prototype);
			this.cache.push(o);
			o.hxUnserialize(this);
			if(this.buf.charCodeAt(this.pos++) != 103) {
				throw haxe_Exception.thrown("Invalid custom data");
			}
			return o;
		case 77:
			var h = new haxe_ds_ObjectMap();
			this.cache.push(h);
			var buf = this.buf;
			while(this.buf.charCodeAt(this.pos) != 104) {
				var s = this.unserialize();
				h.set(s,this.unserialize());
			}
			this.pos++;
			return h;
		case 82:
			var n = this.readDigits();
			if(n < 0 || n >= this.scache.length) {
				throw haxe_Exception.thrown("Invalid string reference");
			}
			return this.scache[n];
		case 97:
			var buf = this.buf;
			var a = [];
			this.cache.push(a);
			while(true) {
				var c = this.buf.charCodeAt(this.pos);
				if(c == 104) {
					this.pos++;
					break;
				}
				if(c == 117) {
					this.pos++;
					var n = this.readDigits();
					a[a.length + n - 1] = null;
				} else {
					a.push(this.unserialize());
				}
			}
			return a;
		case 98:
			var h = new haxe_ds_StringMap();
			this.cache.push(h);
			var buf = this.buf;
			while(this.buf.charCodeAt(this.pos) != 104) {
				var s = this.unserialize();
				var value = this.unserialize();
				h.h[s] = value;
			}
			this.pos++;
			return h;
		case 99:
			var name = this.unserialize();
			var cl = this.resolver.resolveClass(name);
			if(cl == null) {
				throw haxe_Exception.thrown("Class not found " + name);
			}
			var o = Object.create(cl.prototype);
			this.cache.push(o);
			this.unserializeObject(o);
			return o;
		case 100:
			return this.readFloat();
		case 102:
			return false;
		case 105:
			return this.readDigits();
		case 106:
			var name = this.unserialize();
			var edecl = this.resolver.resolveEnum(name);
			if(edecl == null) {
				throw haxe_Exception.thrown("Enum not found " + name);
			}
			this.pos++;
			var index = this.readDigits();
			var tag = edecl.__constructs__.slice()[index];
			if(tag == null) {
				throw haxe_Exception.thrown("Unknown enum index " + name + "@" + index);
			}
			var e = this.unserializeEnum(edecl,tag);
			this.cache.push(e);
			return e;
		case 107:
			return NaN;
		case 108:
			var l = new haxe_ds_List();
			this.cache.push(l);
			var buf = this.buf;
			while(this.buf.charCodeAt(this.pos) != 104) l.add(this.unserialize());
			this.pos++;
			return l;
		case 109:
			return -Infinity;
		case 110:
			return null;
		case 111:
			var o = { };
			this.cache.push(o);
			this.unserializeObject(o);
			return o;
		case 112:
			return Infinity;
		case 113:
			var h = new haxe_ds_IntMap();
			this.cache.push(h);
			var buf = this.buf;
			var c = this.buf.charCodeAt(this.pos++);
			while(c == 58) {
				var i = this.readDigits();
				var value = this.unserialize();
				h.h[i] = value;
				c = this.buf.charCodeAt(this.pos++);
			}
			if(c != 104) {
				throw haxe_Exception.thrown("Invalid IntMap format");
			}
			return h;
		case 114:
			var n = this.readDigits();
			if(n < 0 || n >= this.cache.length) {
				throw haxe_Exception.thrown("Invalid reference");
			}
			return this.cache[n];
		case 115:
			var len = this.readDigits();
			var buf = this.buf;
			if(this.buf.charCodeAt(this.pos++) != 58 || this.length - this.pos < len) {
				throw haxe_Exception.thrown("Invalid bytes length");
			}
			var codes = haxe_Unserializer.CODES;
			if(codes == null) {
				codes = haxe_Unserializer.initCodes();
				haxe_Unserializer.CODES = codes;
			}
			var i = this.pos;
			var rest = len & 3;
			var size = (len >> 2) * 3 + (rest >= 2 ? rest - 1 : 0);
			var max = i + (len - rest);
			var bytes = new haxe_io_Bytes(new ArrayBuffer(size));
			var bpos = 0;
			while(i < max) {
				var c1 = codes[buf.charCodeAt(i++)];
				var c2 = codes[buf.charCodeAt(i++)];
				bytes.b[bpos++] = (c1 << 2 | c2 >> 4) & 255;
				var c3 = codes[buf.charCodeAt(i++)];
				bytes.b[bpos++] = (c2 << 4 | c3 >> 2) & 255;
				var c4 = codes[buf.charCodeAt(i++)];
				bytes.b[bpos++] = (c3 << 6 | c4) & 255;
			}
			if(rest >= 2) {
				var c1 = codes[buf.charCodeAt(i++)];
				var c2 = codes[buf.charCodeAt(i++)];
				bytes.b[bpos++] = (c1 << 2 | c2 >> 4) & 255;
				if(rest == 3) {
					var c3 = codes[buf.charCodeAt(i++)];
					bytes.b[bpos++] = (c2 << 4 | c3 >> 2) & 255;
				}
			}
			this.pos += len;
			this.cache.push(bytes);
			return bytes;
		case 116:
			return true;
		case 118:
			var d;
			if(this.buf.charCodeAt(this.pos) >= 48 && this.buf.charCodeAt(this.pos) <= 57 && this.buf.charCodeAt(this.pos + 1) >= 48 && this.buf.charCodeAt(this.pos + 1) <= 57 && this.buf.charCodeAt(this.pos + 2) >= 48 && this.buf.charCodeAt(this.pos + 2) <= 57 && this.buf.charCodeAt(this.pos + 3) >= 48 && this.buf.charCodeAt(this.pos + 3) <= 57 && this.buf.charCodeAt(this.pos + 4) == 45) {
				d = HxOverrides.strDate(HxOverrides.substr(this.buf,this.pos,19));
				this.pos += 19;
			} else {
				d = new Date(this.readFloat());
			}
			this.cache.push(d);
			return d;
		case 119:
			var name = this.unserialize();
			var edecl = this.resolver.resolveEnum(name);
			if(edecl == null) {
				throw haxe_Exception.thrown("Enum not found " + name);
			}
			var e = this.unserializeEnum(edecl,this.unserialize());
			this.cache.push(e);
			return e;
		case 120:
			throw haxe_Exception.thrown(this.unserialize());
		case 121:
			var len = this.readDigits();
			if(this.buf.charCodeAt(this.pos++) != 58 || this.length - this.pos < len) {
				throw haxe_Exception.thrown("Invalid string length");
			}
			var s = HxOverrides.substr(this.buf,this.pos,len);
			this.pos += len;
			s = decodeURIComponent(s.split("+").join(" "));
			this.scache.push(s);
			return s;
		case 122:
			return 0;
		default:
		}
		this.pos--;
		throw haxe_Exception.thrown("Invalid char " + this.buf.charAt(this.pos) + " at position " + this.pos);
	}
	,__class__: haxe_Unserializer
};
var haxe__$Unserializer_NullResolver = function() {
};
$hxClasses["haxe._Unserializer.NullResolver"] = haxe__$Unserializer_NullResolver;
haxe__$Unserializer_NullResolver.__name__ = "haxe._Unserializer.NullResolver";
haxe__$Unserializer_NullResolver.instance = null;
haxe__$Unserializer_NullResolver.prototype = {
	resolveClass: function(name) {
		return null;
	}
	,resolveEnum: function(name) {
		return null;
	}
	,__class__: haxe__$Unserializer_NullResolver
};
var haxe_ValueException = function(value,previous,native) {
	haxe_Exception.call(this,String(value),previous,native);
	this.value = value;
	this.__skipStack++;
};
$hxClasses["haxe.ValueException"] = haxe_ValueException;
haxe_ValueException.__name__ = "haxe.ValueException";
haxe_ValueException.__super__ = haxe_Exception;
haxe_ValueException.prototype = $extend(haxe_Exception.prototype,{
	value: null
	,unwrap: function() {
		return this.value;
	}
	,__class__: haxe_ValueException
});
var haxe_crypto_Adler32 = function() {
	this.a1 = 1;
	this.a2 = 0;
};
$hxClasses["haxe.crypto.Adler32"] = haxe_crypto_Adler32;
haxe_crypto_Adler32.__name__ = "haxe.crypto.Adler32";
haxe_crypto_Adler32.read = function(i) {
	var a = new haxe_crypto_Adler32();
	var a2a = i.readByte();
	var a2b = i.readByte();
	var a1a = i.readByte();
	var a1b = i.readByte();
	a.a1 = a1a << 8 | a1b;
	a.a2 = a2a << 8 | a2b;
	return a;
};
haxe_crypto_Adler32.prototype = {
	a1: null
	,a2: null
	,update: function(b,pos,len) {
		var a1 = this.a1;
		var a2 = this.a2;
		var _g = pos;
		var _g1 = pos + len;
		while(_g < _g1) {
			var p = _g++;
			var c = b.b[p];
			a1 = (a1 + c) % 65521;
			a2 = (a2 + a1) % 65521;
		}
		this.a1 = a1;
		this.a2 = a2;
	}
	,equals: function(a) {
		if(a.a1 == this.a1) {
			return a.a2 == this.a2;
		} else {
			return false;
		}
	}
	,__class__: haxe_crypto_Adler32
};
var haxe_crypto_Base64 = function() { };
$hxClasses["haxe.crypto.Base64"] = haxe_crypto_Base64;
haxe_crypto_Base64.__name__ = "haxe.crypto.Base64";
haxe_crypto_Base64.decode = function(str,complement) {
	if(complement == null) {
		complement = true;
	}
	if(complement) {
		while(HxOverrides.cca(str,str.length - 1) == 61) str = HxOverrides.substr(str,0,-1);
	}
	return new haxe_crypto_BaseCode(haxe_crypto_Base64.BYTES).decodeBytes(haxe_io_Bytes.ofString(str));
};
var haxe_crypto_BaseCode = function(base) {
	var len = base.length;
	var nbits = 1;
	while(len > 1 << nbits) ++nbits;
	if(nbits > 8 || len != 1 << nbits) {
		throw haxe_Exception.thrown("BaseCode : base length must be a power of two.");
	}
	this.base = base;
	this.nbits = nbits;
};
$hxClasses["haxe.crypto.BaseCode"] = haxe_crypto_BaseCode;
haxe_crypto_BaseCode.__name__ = "haxe.crypto.BaseCode";
haxe_crypto_BaseCode.prototype = {
	base: null
	,nbits: null
	,tbl: null
	,initTable: function() {
		var tbl = [];
		var _g = 0;
		while(_g < 256) {
			var i = _g++;
			tbl[i] = -1;
		}
		var _g = 0;
		var _g1 = this.base.length;
		while(_g < _g1) {
			var i = _g++;
			tbl[this.base.b[i]] = i;
		}
		this.tbl = tbl;
	}
	,decodeBytes: function(b) {
		var nbits = this.nbits;
		var base = this.base;
		if(this.tbl == null) {
			this.initTable();
		}
		var tbl = this.tbl;
		var size = b.length * nbits >> 3;
		var out = new haxe_io_Bytes(new ArrayBuffer(size));
		var buf = 0;
		var curbits = 0;
		var pin = 0;
		var pout = 0;
		while(pout < size) {
			while(curbits < 8) {
				curbits += nbits;
				buf <<= nbits;
				var i = tbl[b.b[pin++]];
				if(i == -1) {
					throw haxe_Exception.thrown("BaseCode : invalid encoded char");
				}
				buf |= i;
			}
			curbits -= 8;
			out.b[pout++] = buf >> curbits & 255 & 255;
		}
		return out;
	}
	,__class__: haxe_crypto_BaseCode
};
var haxe_crypto_Sha1 = function() {
};
$hxClasses["haxe.crypto.Sha1"] = haxe_crypto_Sha1;
haxe_crypto_Sha1.__name__ = "haxe.crypto.Sha1";
haxe_crypto_Sha1.encode = function(s) {
	var sh = new haxe_crypto_Sha1();
	var h = sh.doEncode(haxe_crypto_Sha1.str2blks(s));
	return sh.hex(h);
};
haxe_crypto_Sha1.str2blks = function(s) {
	var s1 = haxe_io_Bytes.ofString(s);
	var nblk = (s1.length + 8 >> 6) + 1;
	var blks = [];
	var _g = 0;
	var _g1 = nblk * 16;
	while(_g < _g1) {
		var i = _g++;
		blks[i] = 0;
	}
	var _g = 0;
	var _g1 = s1.length;
	while(_g < _g1) {
		var i = _g++;
		var p = i >> 2;
		blks[p] |= s1.b[i] << 24 - ((i & 3) << 3);
	}
	var i = s1.length;
	var p = i >> 2;
	blks[p] |= 128 << 24 - ((i & 3) << 3);
	blks[nblk * 16 - 1] = s1.length * 8;
	return blks;
};
haxe_crypto_Sha1.prototype = {
	doEncode: function(x) {
		var w = [];
		var a = 1732584193;
		var b = -271733879;
		var c = -1732584194;
		var d = 271733878;
		var e = -1009589776;
		var i = 0;
		while(i < x.length) {
			var olda = a;
			var oldb = b;
			var oldc = c;
			var oldd = d;
			var olde = e;
			var j = 0;
			while(j < 80) {
				if(j < 16) {
					w[j] = x[i + j];
				} else {
					var num = w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16];
					w[j] = num << 1 | num >>> 31;
				}
				var t = (a << 5 | a >>> 27) + this.ft(j,b,c,d) + e + w[j] + this.kt(j);
				e = d;
				d = c;
				c = b << 30 | b >>> 2;
				b = a;
				a = t;
				++j;
			}
			a += olda;
			b += oldb;
			c += oldc;
			d += oldd;
			e += olde;
			i += 16;
		}
		return [a,b,c,d,e];
	}
	,ft: function(t,b,c,d) {
		if(t < 20) {
			return b & c | ~b & d;
		}
		if(t < 40) {
			return b ^ c ^ d;
		}
		if(t < 60) {
			return b & c | b & d | c & d;
		}
		return b ^ c ^ d;
	}
	,kt: function(t) {
		if(t < 20) {
			return 1518500249;
		}
		if(t < 40) {
			return 1859775393;
		}
		if(t < 60) {
			return -1894007588;
		}
		return -899497514;
	}
	,hex: function(a) {
		var str = "";
		var _g = 0;
		while(_g < a.length) {
			var num = a[_g];
			++_g;
			str += StringTools.hex(num,8);
		}
		return str.toLowerCase();
	}
	,__class__: haxe_crypto_Sha1
};
var haxe_ds_ArraySort = function() { };
$hxClasses["haxe.ds.ArraySort"] = haxe_ds_ArraySort;
haxe_ds_ArraySort.__name__ = "haxe.ds.ArraySort";
haxe_ds_ArraySort.sort = function(a,cmp) {
	haxe_ds_ArraySort.rec(a,cmp,0,a.length);
};
haxe_ds_ArraySort.rec = function(a,cmp,from,to) {
	var middle = from + to >> 1;
	if(to - from < 12) {
		if(to <= from) {
			return;
		}
		var _g = from + 1;
		var _g1 = to;
		while(_g < _g1) {
			var i = _g++;
			var j = i;
			while(j > from) {
				if(cmp(a[j],a[j - 1]) < 0) {
					haxe_ds_ArraySort.swap(a,j - 1,j);
				} else {
					break;
				}
				--j;
			}
		}
		return;
	}
	haxe_ds_ArraySort.rec(a,cmp,from,middle);
	haxe_ds_ArraySort.rec(a,cmp,middle,to);
	haxe_ds_ArraySort.doMerge(a,cmp,from,middle,to,middle - from,to - middle);
};
haxe_ds_ArraySort.doMerge = function(a,cmp,from,pivot,to,len1,len2) {
	var first_cut;
	var second_cut;
	var len11;
	var len22;
	if(len1 == 0 || len2 == 0) {
		return;
	}
	if(len1 + len2 == 2) {
		if(cmp(a[pivot],a[from]) < 0) {
			haxe_ds_ArraySort.swap(a,pivot,from);
		}
		return;
	}
	if(len1 > len2) {
		len11 = len1 >> 1;
		first_cut = from + len11;
		second_cut = haxe_ds_ArraySort.lower(a,cmp,pivot,to,first_cut);
		len22 = second_cut - pivot;
	} else {
		len22 = len2 >> 1;
		second_cut = pivot + len22;
		first_cut = haxe_ds_ArraySort.upper(a,cmp,from,pivot,second_cut);
		len11 = first_cut - from;
	}
	haxe_ds_ArraySort.rotate(a,cmp,first_cut,pivot,second_cut);
	var new_mid = first_cut + len22;
	haxe_ds_ArraySort.doMerge(a,cmp,from,first_cut,new_mid,len11,len22);
	haxe_ds_ArraySort.doMerge(a,cmp,new_mid,second_cut,to,len1 - len11,len2 - len22);
};
haxe_ds_ArraySort.rotate = function(a,cmp,from,mid,to) {
	if(from == mid || mid == to) {
		return;
	}
	var n = haxe_ds_ArraySort.gcd(to - from,mid - from);
	while(n-- != 0) {
		var val = a[from + n];
		var shift = mid - from;
		var p1 = from + n;
		var p2 = from + n + shift;
		while(p2 != from + n) {
			a[p1] = a[p2];
			p1 = p2;
			if(to - p2 > shift) {
				p2 += shift;
			} else {
				p2 = from + (shift - (to - p2));
			}
		}
		a[p1] = val;
	}
};
haxe_ds_ArraySort.gcd = function(m,n) {
	while(n != 0) {
		var t = m % n;
		m = n;
		n = t;
	}
	return m;
};
haxe_ds_ArraySort.upper = function(a,cmp,from,to,val) {
	var len = to - from;
	var half;
	var mid;
	while(len > 0) {
		half = len >> 1;
		mid = from + half;
		if(cmp(a[val],a[mid]) < 0) {
			len = half;
		} else {
			from = mid + 1;
			len = len - half - 1;
		}
	}
	return from;
};
haxe_ds_ArraySort.lower = function(a,cmp,from,to,val) {
	var len = to - from;
	var half;
	var mid;
	while(len > 0) {
		half = len >> 1;
		mid = from + half;
		if(cmp(a[mid],a[val]) < 0) {
			from = mid + 1;
			len = len - half - 1;
		} else {
			len = half;
		}
	}
	return from;
};
haxe_ds_ArraySort.swap = function(a,i,j) {
	var tmp = a[i];
	a[i] = a[j];
	a[j] = tmp;
};
var haxe_ds_BalancedTree = function() {
};
$hxClasses["haxe.ds.BalancedTree"] = haxe_ds_BalancedTree;
haxe_ds_BalancedTree.__name__ = "haxe.ds.BalancedTree";
haxe_ds_BalancedTree.__interfaces__ = [haxe_IMap];
haxe_ds_BalancedTree.prototype = {
	root: null
	,set: function(key,value) {
		this.root = this.setLoop(key,value,this.root);
	}
	,get: function(key) {
		var node = this.root;
		while(node != null) {
			var c = this.compare(key,node.key);
			if(c == 0) {
				return node.value;
			}
			if(c < 0) {
				node = node.left;
			} else {
				node = node.right;
			}
		}
		return null;
	}
	,remove: function(key) {
		try {
			this.root = this.removeLoop(key,this.root);
			return true;
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			if(typeof(haxe_Exception.caught(_g).unwrap()) == "string") {
				return false;
			} else {
				throw _g;
			}
		}
	}
	,exists: function(key) {
		var node = this.root;
		while(node != null) {
			var c = this.compare(key,node.key);
			if(c == 0) {
				return true;
			} else if(c < 0) {
				node = node.left;
			} else {
				node = node.right;
			}
		}
		return false;
	}
	,setLoop: function(k,v,node) {
		if(node == null) {
			return new haxe_ds_TreeNode(null,k,v,null);
		}
		var c = this.compare(k,node.key);
		if(c == 0) {
			return new haxe_ds_TreeNode(node.left,k,v,node.right,node == null ? 0 : node._height);
		} else if(c < 0) {
			var nl = this.setLoop(k,v,node.left);
			return this.balance(nl,node.key,node.value,node.right);
		} else {
			var nr = this.setLoop(k,v,node.right);
			return this.balance(node.left,node.key,node.value,nr);
		}
	}
	,removeLoop: function(k,node) {
		if(node == null) {
			throw haxe_Exception.thrown("Not_found");
		}
		var c = this.compare(k,node.key);
		if(c == 0) {
			return this.merge(node.left,node.right);
		} else if(c < 0) {
			return this.balance(this.removeLoop(k,node.left),node.key,node.value,node.right);
		} else {
			return this.balance(node.left,node.key,node.value,this.removeLoop(k,node.right));
		}
	}
	,merge: function(t1,t2) {
		if(t1 == null) {
			return t2;
		}
		if(t2 == null) {
			return t1;
		}
		var t = this.minBinding(t2);
		return this.balance(t1,t.key,t.value,this.removeMinBinding(t2));
	}
	,minBinding: function(t) {
		if(t == null) {
			throw haxe_Exception.thrown("Not_found");
		} else if(t.left == null) {
			return t;
		} else {
			return this.minBinding(t.left);
		}
	}
	,removeMinBinding: function(t) {
		if(t.left == null) {
			return t.right;
		} else {
			return this.balance(this.removeMinBinding(t.left),t.key,t.value,t.right);
		}
	}
	,balance: function(l,k,v,r) {
		var hl = l == null ? 0 : l._height;
		var hr = r == null ? 0 : r._height;
		if(hl > hr + 2) {
			var _this = l.left;
			var _this1 = l.right;
			if((_this == null ? 0 : _this._height) >= (_this1 == null ? 0 : _this1._height)) {
				return new haxe_ds_TreeNode(l.left,l.key,l.value,new haxe_ds_TreeNode(l.right,k,v,r));
			} else {
				return new haxe_ds_TreeNode(new haxe_ds_TreeNode(l.left,l.key,l.value,l.right.left),l.right.key,l.right.value,new haxe_ds_TreeNode(l.right.right,k,v,r));
			}
		} else if(hr > hl + 2) {
			var _this = r.right;
			var _this1 = r.left;
			if((_this == null ? 0 : _this._height) > (_this1 == null ? 0 : _this1._height)) {
				return new haxe_ds_TreeNode(new haxe_ds_TreeNode(l,k,v,r.left),r.key,r.value,r.right);
			} else {
				return new haxe_ds_TreeNode(new haxe_ds_TreeNode(l,k,v,r.left.left),r.left.key,r.left.value,new haxe_ds_TreeNode(r.left.right,r.key,r.value,r.right));
			}
		} else {
			return new haxe_ds_TreeNode(l,k,v,r,(hl > hr ? hl : hr) + 1);
		}
	}
	,compare: function(k1,k2) {
		return Reflect.compare(k1,k2);
	}
	,__class__: haxe_ds_BalancedTree
};
var haxe_ds_TreeNode = function(l,k,v,r,h) {
	if(h == null) {
		h = -1;
	}
	this.left = l;
	this.key = k;
	this.value = v;
	this.right = r;
	if(h == -1) {
		var tmp;
		var _this = this.left;
		var _this1 = this.right;
		if((_this == null ? 0 : _this._height) > (_this1 == null ? 0 : _this1._height)) {
			var _this = this.left;
			tmp = _this == null ? 0 : _this._height;
		} else {
			var _this = this.right;
			tmp = _this == null ? 0 : _this._height;
		}
		this._height = tmp + 1;
	} else {
		this._height = h;
	}
};
$hxClasses["haxe.ds.TreeNode"] = haxe_ds_TreeNode;
haxe_ds_TreeNode.__name__ = "haxe.ds.TreeNode";
haxe_ds_TreeNode.prototype = {
	left: null
	,right: null
	,key: null
	,value: null
	,_height: null
	,__class__: haxe_ds_TreeNode
};
var haxe_ds_EnumValueMap = function() {
	haxe_ds_BalancedTree.call(this);
};
$hxClasses["haxe.ds.EnumValueMap"] = haxe_ds_EnumValueMap;
haxe_ds_EnumValueMap.__name__ = "haxe.ds.EnumValueMap";
haxe_ds_EnumValueMap.__interfaces__ = [haxe_IMap];
haxe_ds_EnumValueMap.__super__ = haxe_ds_BalancedTree;
haxe_ds_EnumValueMap.prototype = $extend(haxe_ds_BalancedTree.prototype,{
	compare: function(k1,k2) {
		var d = k1._hx_index - k2._hx_index;
		if(d != 0) {
			return d;
		}
		var p1 = Type.enumParameters(k1);
		var p2 = Type.enumParameters(k2);
		if(p1.length == 0 && p2.length == 0) {
			return 0;
		}
		return this.compareArgs(p1,p2);
	}
	,compareArgs: function(a1,a2) {
		var ld = a1.length - a2.length;
		if(ld != 0) {
			return ld;
		}
		var _g = 0;
		var _g1 = a1.length;
		while(_g < _g1) {
			var i = _g++;
			var d = this.compareArg(a1[i],a2[i]);
			if(d != 0) {
				return d;
			}
		}
		return 0;
	}
	,compareArg: function(v1,v2) {
		if(Reflect.isEnumValue(v1) && Reflect.isEnumValue(v2)) {
			return this.compare(v1,v2);
		} else if(((v1) instanceof Array) && ((v2) instanceof Array)) {
			return this.compareArgs(v1,v2);
		} else {
			return Reflect.compare(v1,v2);
		}
	}
	,__class__: haxe_ds_EnumValueMap
});
var haxe_ds_GenericCell = function(elt,next) {
	this.elt = elt;
	this.next = next;
};
$hxClasses["haxe.ds.GenericCell"] = haxe_ds_GenericCell;
haxe_ds_GenericCell.__name__ = "haxe.ds.GenericCell";
haxe_ds_GenericCell.prototype = {
	elt: null
	,next: null
	,__class__: haxe_ds_GenericCell
};
var haxe_ds_GenericStack = function() {
};
$hxClasses["haxe.ds.GenericStack"] = haxe_ds_GenericStack;
haxe_ds_GenericStack.__name__ = "haxe.ds.GenericStack";
haxe_ds_GenericStack.prototype = {
	head: null
	,__class__: haxe_ds_GenericStack
};
var haxe_ds_IntMap = function() {
	this.h = { };
};
$hxClasses["haxe.ds.IntMap"] = haxe_ds_IntMap;
haxe_ds_IntMap.__name__ = "haxe.ds.IntMap";
haxe_ds_IntMap.__interfaces__ = [haxe_IMap];
haxe_ds_IntMap.prototype = {
	h: null
	,set: function(key,value) {
		this.h[key] = value;
	}
	,get: function(key) {
		return this.h[key];
	}
	,exists: function(key) {
		return this.h.hasOwnProperty(key);
	}
	,remove: function(key) {
		if(!this.h.hasOwnProperty(key)) {
			return false;
		}
		delete(this.h[key]);
		return true;
	}
	,keys: function() {
		var a = [];
		for( var key in this.h ) if(this.h.hasOwnProperty(key)) a.push(key | 0);
		return new haxe_iterators_ArrayIterator(a);
	}
	,iterator: function() {
		return { ref : this.h, it : this.keys(), hasNext : function() {
			return this.it.hasNext();
		}, next : function() {
			var i = this.it.next();
			return this.ref[i];
		}};
	}
	,__class__: haxe_ds_IntMap
};
var haxe_ds__$List_ListNode = function(item,next) {
	this.item = item;
	this.next = next;
};
$hxClasses["haxe.ds._List.ListNode"] = haxe_ds__$List_ListNode;
haxe_ds__$List_ListNode.__name__ = "haxe.ds._List.ListNode";
haxe_ds__$List_ListNode.prototype = {
	item: null
	,next: null
	,__class__: haxe_ds__$List_ListNode
};
var haxe_ds__$List_ListIterator = function(head) {
	this.head = head;
};
$hxClasses["haxe.ds._List.ListIterator"] = haxe_ds__$List_ListIterator;
haxe_ds__$List_ListIterator.__name__ = "haxe.ds._List.ListIterator";
haxe_ds__$List_ListIterator.prototype = {
	head: null
	,hasNext: function() {
		return this.head != null;
	}
	,next: function() {
		var val = this.head.item;
		this.head = this.head.next;
		return val;
	}
	,__class__: haxe_ds__$List_ListIterator
};
var haxe_ds_StringMap = function() {
	this.h = Object.create(null);
};
$hxClasses["haxe.ds.StringMap"] = haxe_ds_StringMap;
haxe_ds_StringMap.__name__ = "haxe.ds.StringMap";
haxe_ds_StringMap.__interfaces__ = [haxe_IMap];
haxe_ds_StringMap.keysIterator = function(h) {
	var keys = Object.keys(h);
	var len = keys.length;
	var idx = 0;
	return { hasNext : function() {
		return idx < len;
	}, next : function() {
		idx += 1;
		return keys[idx - 1];
	}};
};
haxe_ds_StringMap.valueIterator = function(h) {
	var keys = Object.keys(h);
	var len = keys.length;
	var idx = 0;
	return { hasNext : function() {
		return idx < len;
	}, next : function() {
		idx += 1;
		return h[keys[idx - 1]];
	}};
};
haxe_ds_StringMap.prototype = {
	h: null
	,exists: function(key) {
		return Object.prototype.hasOwnProperty.call(this.h,key);
	}
	,get: function(key) {
		return this.h[key];
	}
	,set: function(key,value) {
		this.h[key] = value;
	}
	,remove: function(key) {
		if(Object.prototype.hasOwnProperty.call(this.h,key)) {
			delete(this.h[key]);
			return true;
		} else {
			return false;
		}
	}
	,__class__: haxe_ds_StringMap
};
var haxe_http_HttpBase = function(url) {
	this.url = url;
	this.headers = [];
	this.params = [];
	this.emptyOnData = $bind(this,this.onData);
};
$hxClasses["haxe.http.HttpBase"] = haxe_http_HttpBase;
haxe_http_HttpBase.__name__ = "haxe.http.HttpBase";
haxe_http_HttpBase.prototype = {
	url: null
	,responseBytes: null
	,responseAsString: null
	,postData: null
	,postBytes: null
	,headers: null
	,params: null
	,emptyOnData: null
	,setHeader: function(name,value) {
		var _g = 0;
		var _g1 = this.headers.length;
		while(_g < _g1) {
			var i = _g++;
			if(this.headers[i].name == name) {
				this.headers[i] = { name : name, value : value};
				return;
			}
		}
		this.headers.push({ name : name, value : value});
	}
	,setPostData: function(data) {
		this.postData = data;
		this.postBytes = null;
	}
	,onData: function(data) {
	}
	,onBytes: function(data) {
	}
	,onError: function(msg) {
	}
	,onStatus: function(status) {
	}
	,hasOnData: function() {
		return !Reflect.compareMethods($bind(this,this.onData),this.emptyOnData);
	}
	,success: function(data) {
		this.responseBytes = data;
		this.responseAsString = null;
		if(this.hasOnData()) {
			this.onData(this.get_responseData());
		}
		this.onBytes(this.responseBytes);
	}
	,get_responseData: function() {
		if(this.responseAsString == null && this.responseBytes != null) {
			this.responseAsString = this.responseBytes.getString(0,this.responseBytes.length,haxe_io_Encoding.UTF8);
		}
		return this.responseAsString;
	}
	,__class__: haxe_http_HttpBase
	,__properties__: {get_responseData:"get_responseData"}
};
var haxe_http_HttpJs = function(url) {
	this.async = true;
	this.withCredentials = false;
	haxe_http_HttpBase.call(this,url);
};
$hxClasses["haxe.http.HttpJs"] = haxe_http_HttpJs;
haxe_http_HttpJs.__name__ = "haxe.http.HttpJs";
haxe_http_HttpJs.__super__ = haxe_http_HttpBase;
haxe_http_HttpJs.prototype = $extend(haxe_http_HttpBase.prototype,{
	async: null
	,withCredentials: null
	,req: null
	,request: function(post) {
		var _gthis = this;
		this.responseAsString = null;
		this.responseBytes = null;
		var r = this.req = js_Browser.createXMLHttpRequest();
		var onreadystatechange = function(_) {
			if(r.readyState != 4) {
				return;
			}
			var s;
			try {
				s = r.status;
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				s = null;
			}
			if(s == 0 && typeof(window) != "undefined" && $global.location != null) {
				var protocol = $global.location.protocol.toLowerCase();
				var rlocalProtocol = new EReg("^(?:about|app|app-storage|.+-extension|file|res|widget):$","");
				var isLocal = rlocalProtocol.match(protocol);
				if(isLocal) {
					s = r.response != null ? 200 : 404;
				}
			}
			if(s == undefined) {
				s = null;
			}
			if(s != null) {
				_gthis.onStatus(s);
			}
			if(s != null && s >= 200 && s < 400) {
				_gthis.req = null;
				_gthis.success(haxe_io_Bytes.ofData(r.response));
			} else if(s == null || s == 0 && r.response == null) {
				_gthis.req = null;
				_gthis.onError("Failed to connect or resolve host");
			} else if(s == null) {
				_gthis.req = null;
				var onreadystatechange = r.response != null ? haxe_io_Bytes.ofData(r.response) : null;
				_gthis.responseBytes = onreadystatechange;
				_gthis.onError("Http Error #" + r.status);
			} else {
				switch(s) {
				case 12007:
					_gthis.req = null;
					_gthis.onError("Unknown host");
					break;
				case 12029:
					_gthis.req = null;
					_gthis.onError("Failed to connect to host");
					break;
				default:
					_gthis.req = null;
					var onreadystatechange = r.response != null ? haxe_io_Bytes.ofData(r.response) : null;
					_gthis.responseBytes = onreadystatechange;
					_gthis.onError("Http Error #" + r.status);
				}
			}
		};
		if(this.async) {
			r.onreadystatechange = onreadystatechange;
		}
		var uri;
		var _g = this.postBytes;
		var _g1 = this.postData;
		if(_g1 == null) {
			if(_g == null) {
				uri = null;
			} else {
				var bytes = _g;
				uri = new Blob([bytes.b.bufferValue]);
			}
		} else if(_g == null) {
			var str = _g1;
			uri = str;
		} else {
			uri = null;
		}
		if(uri != null) {
			post = true;
		} else {
			var _g = 0;
			var _g1 = this.params;
			while(_g < _g1.length) {
				var p = _g1[_g];
				++_g;
				if(uri == null) {
					uri = "";
				} else {
					uri = (uri == null ? "null" : Std.string(uri)) + "&";
				}
				var s = p.name;
				var value = (uri == null ? "null" : Std.string(uri)) + encodeURIComponent(s) + "=";
				var s1 = p.value;
				uri = value + encodeURIComponent(s1);
			}
		}
		try {
			if(post) {
				r.open("POST",this.url,this.async);
			} else if(uri != null) {
				var question = this.url.split("?").length <= 1;
				r.open("GET",this.url + (question ? "?" : "&") + (uri == null ? "null" : Std.string(uri)),this.async);
				uri = null;
			} else {
				r.open("GET",this.url,this.async);
			}
			r.responseType = "arraybuffer";
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			this.req = null;
			this.onError(e.toString());
			return;
		}
		r.withCredentials = this.withCredentials;
		if(!Lambda.exists(this.headers,function(h) {
			return h.name == "Content-Type";
		}) && post && this.postData == null) {
			r.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		}
		var _g = 0;
		var _g1 = this.headers;
		while(_g < _g1.length) {
			var h = _g1[_g];
			++_g;
			r.setRequestHeader(h.name,h.value);
		}
		r.send(uri);
		if(!this.async) {
			onreadystatechange(null);
		}
	}
	,__class__: haxe_http_HttpJs
});
var haxe_io_BytesBuffer = function() {
	this.pos = 0;
	this.size = 0;
};
$hxClasses["haxe.io.BytesBuffer"] = haxe_io_BytesBuffer;
haxe_io_BytesBuffer.__name__ = "haxe.io.BytesBuffer";
haxe_io_BytesBuffer.prototype = {
	buffer: null
	,view: null
	,u8: null
	,pos: null
	,size: null
	,addByte: function(byte) {
		if(this.pos == this.size) {
			this.grow(1);
		}
		this.view.setUint8(this.pos++,byte);
	}
	,add: function(src) {
		if(this.pos + src.length > this.size) {
			this.grow(src.length);
		}
		if(this.size == 0) {
			return;
		}
		var sub = new Uint8Array(src.b.buffer,src.b.byteOffset,src.length);
		this.u8.set(sub,this.pos);
		this.pos += src.length;
	}
	,addBytes: function(src,pos,len) {
		if(pos < 0 || len < 0 || pos + len > src.length) {
			throw haxe_Exception.thrown(haxe_io_Error.OutsideBounds);
		}
		if(this.pos + len > this.size) {
			this.grow(len);
		}
		if(this.size == 0) {
			return;
		}
		var sub = new Uint8Array(src.b.buffer,src.b.byteOffset + pos,len);
		this.u8.set(sub,this.pos);
		this.pos += len;
	}
	,grow: function(delta) {
		var req = this.pos + delta;
		var nsize = this.size == 0 ? 16 : this.size;
		while(nsize < req) nsize = nsize * 3 >> 1;
		var nbuf = new ArrayBuffer(nsize);
		var nu8 = new Uint8Array(nbuf);
		if(this.size > 0) {
			nu8.set(this.u8);
		}
		this.size = nsize;
		this.buffer = nbuf;
		this.u8 = nu8;
		this.view = new DataView(this.buffer);
	}
	,getBytes: function() {
		if(this.size == 0) {
			return new haxe_io_Bytes(new ArrayBuffer(0));
		}
		var b = new haxe_io_Bytes(this.buffer);
		b.length = this.pos;
		return b;
	}
	,__class__: haxe_io_BytesBuffer
};
var haxe_io_Input = function() { };
$hxClasses["haxe.io.Input"] = haxe_io_Input;
haxe_io_Input.__name__ = "haxe.io.Input";
haxe_io_Input.prototype = {
	bigEndian: null
	,readByte: function() {
		throw haxe_Exception.thrown("Not implemented");
	}
	,readBytes: function(s,pos,len) {
		var k = len;
		var b = s.b;
		if(pos < 0 || len < 0 || pos + len > s.length) {
			throw haxe_Exception.thrown(haxe_io_Error.OutsideBounds);
		}
		try {
			while(k > 0) {
				b[pos] = this.readByte();
				++pos;
				--k;
			}
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			if(!((haxe_Exception.caught(_g).unwrap()) instanceof haxe_io_Eof)) {
				throw _g;
			}
		}
		return len - k;
	}
	,readFullBytes: function(s,pos,len) {
		while(len > 0) {
			var k = this.readBytes(s,pos,len);
			if(k == 0) {
				throw haxe_Exception.thrown(haxe_io_Error.Blocked);
			}
			pos += k;
			len -= k;
		}
	}
	,read: function(nbytes) {
		var s = new haxe_io_Bytes(new ArrayBuffer(nbytes));
		var p = 0;
		while(nbytes > 0) {
			var k = this.readBytes(s,p,nbytes);
			if(k == 0) {
				throw haxe_Exception.thrown(haxe_io_Error.Blocked);
			}
			p += k;
			nbytes -= k;
		}
		return s;
	}
	,readInt16: function() {
		var ch1 = this.readByte();
		var ch2 = this.readByte();
		var n = this.bigEndian ? ch2 | ch1 << 8 : ch1 | ch2 << 8;
		if((n & 32768) != 0) {
			return n - 65536;
		}
		return n;
	}
	,readUInt16: function() {
		var ch1 = this.readByte();
		var ch2 = this.readByte();
		if(this.bigEndian) {
			return ch2 | ch1 << 8;
		} else {
			return ch1 | ch2 << 8;
		}
	}
	,readInt32: function() {
		var ch1 = this.readByte();
		var ch2 = this.readByte();
		var ch3 = this.readByte();
		var ch4 = this.readByte();
		if(this.bigEndian) {
			return ch4 | ch3 << 8 | ch2 << 16 | ch1 << 24;
		} else {
			return ch1 | ch2 << 8 | ch3 << 16 | ch4 << 24;
		}
	}
	,readString: function(len,encoding) {
		var b = new haxe_io_Bytes(new ArrayBuffer(len));
		this.readFullBytes(b,0,len);
		return b.getString(0,len,encoding);
	}
	,__class__: haxe_io_Input
};
var haxe_io_BytesInput = function(b,pos,len) {
	if(pos == null) {
		pos = 0;
	}
	if(len == null) {
		len = b.length - pos;
	}
	if(pos < 0 || len < 0 || pos + len > b.length) {
		throw haxe_Exception.thrown(haxe_io_Error.OutsideBounds);
	}
	this.b = b.b;
	this.pos = pos;
	this.len = len;
	this.totlen = len;
};
$hxClasses["haxe.io.BytesInput"] = haxe_io_BytesInput;
haxe_io_BytesInput.__name__ = "haxe.io.BytesInput";
haxe_io_BytesInput.__super__ = haxe_io_Input;
haxe_io_BytesInput.prototype = $extend(haxe_io_Input.prototype,{
	b: null
	,pos: null
	,len: null
	,totlen: null
	,readByte: function() {
		if(this.len == 0) {
			throw haxe_Exception.thrown(new haxe_io_Eof());
		}
		this.len--;
		return this.b[this.pos++];
	}
	,readBytes: function(buf,pos,len) {
		if(pos < 0 || len < 0 || pos + len > buf.length) {
			throw haxe_Exception.thrown(haxe_io_Error.OutsideBounds);
		}
		if(this.len == 0 && len > 0) {
			throw haxe_Exception.thrown(new haxe_io_Eof());
		}
		if(this.len < len) {
			len = this.len;
		}
		var b1 = this.b;
		var b2 = buf.b;
		var _g = 0;
		var _g1 = len;
		while(_g < _g1) {
			var i = _g++;
			b2[pos + i] = b1[this.pos + i];
		}
		this.pos += len;
		this.len -= len;
		return len;
	}
	,__class__: haxe_io_BytesInput
});
var haxe_io_Encoding = $hxEnums["haxe.io.Encoding"] = { __ename__ : "haxe.io.Encoding", __constructs__ : ["UTF8","RawNative"]
	,UTF8: {_hx_index:0,__enum__:"haxe.io.Encoding",toString:$estr}
	,RawNative: {_hx_index:1,__enum__:"haxe.io.Encoding",toString:$estr}
};
var haxe_io_Eof = function() {
};
$hxClasses["haxe.io.Eof"] = haxe_io_Eof;
haxe_io_Eof.__name__ = "haxe.io.Eof";
haxe_io_Eof.prototype = {
	toString: function() {
		return "Eof";
	}
	,__class__: haxe_io_Eof
};
var haxe_io_Error = $hxEnums["haxe.io.Error"] = { __ename__ : "haxe.io.Error", __constructs__ : ["Blocked","Overflow","OutsideBounds","Custom"]
	,Blocked: {_hx_index:0,__enum__:"haxe.io.Error",toString:$estr}
	,Overflow: {_hx_index:1,__enum__:"haxe.io.Error",toString:$estr}
	,OutsideBounds: {_hx_index:2,__enum__:"haxe.io.Error",toString:$estr}
	,Custom: ($_=function(e) { return {_hx_index:3,e:e,__enum__:"haxe.io.Error",toString:$estr}; },$_.__params__ = ["e"],$_)
};
var haxe_io_FPHelper = function() { };
$hxClasses["haxe.io.FPHelper"] = haxe_io_FPHelper;
haxe_io_FPHelper.__name__ = "haxe.io.FPHelper";
haxe_io_FPHelper.i32ToFloat = function(i) {
	haxe_io_FPHelper.helper.setInt32(0,i,true);
	return haxe_io_FPHelper.helper.getFloat32(0,true);
};
haxe_io_FPHelper.floatToI32 = function(f) {
	haxe_io_FPHelper.helper.setFloat32(0,f,true);
	return haxe_io_FPHelper.helper.getInt32(0,true);
};
haxe_io_FPHelper.i64ToDouble = function(low,high) {
	haxe_io_FPHelper.helper.setInt32(0,low,true);
	haxe_io_FPHelper.helper.setInt32(4,high,true);
	return haxe_io_FPHelper.helper.getFloat64(0,true);
};
haxe_io_FPHelper.doubleToI64 = function(v) {
	var i64 = haxe_io_FPHelper.i64tmp;
	haxe_io_FPHelper.helper.setFloat64(0,v,true);
	i64.low = haxe_io_FPHelper.helper.getInt32(0,true);
	i64.high = haxe_io_FPHelper.helper.getInt32(4,true);
	return i64;
};
var haxe_io_Path = function(path) {
	switch(path) {
	case ".":case "..":
		this.dir = path;
		this.file = "";
		return;
	}
	var c1 = path.lastIndexOf("/");
	var c2 = path.lastIndexOf("\\");
	if(c1 < c2) {
		this.dir = HxOverrides.substr(path,0,c2);
		path = HxOverrides.substr(path,c2 + 1,null);
		this.backslash = true;
	} else if(c2 < c1) {
		this.dir = HxOverrides.substr(path,0,c1);
		path = HxOverrides.substr(path,c1 + 1,null);
	} else {
		this.dir = null;
	}
	var cp = path.lastIndexOf(".");
	if(cp != -1) {
		this.ext = HxOverrides.substr(path,cp + 1,null);
		this.file = HxOverrides.substr(path,0,cp);
	} else {
		this.ext = null;
		this.file = path;
	}
};
$hxClasses["haxe.io.Path"] = haxe_io_Path;
haxe_io_Path.__name__ = "haxe.io.Path";
haxe_io_Path.directory = function(path) {
	var s = new haxe_io_Path(path);
	if(s.dir == null) {
		return "";
	}
	return s.dir;
};
haxe_io_Path.prototype = {
	dir: null
	,file: null
	,ext: null
	,backslash: null
	,__class__: haxe_io_Path
};
var haxe_iterators_ArrayIterator = function(array) {
	this.current = 0;
	this.array = array;
};
$hxClasses["haxe.iterators.ArrayIterator"] = haxe_iterators_ArrayIterator;
haxe_iterators_ArrayIterator.__name__ = "haxe.iterators.ArrayIterator";
haxe_iterators_ArrayIterator.prototype = {
	array: null
	,current: null
	,hasNext: function() {
		return this.current < this.array.length;
	}
	,next: function() {
		return this.array[this.current++];
	}
	,__class__: haxe_iterators_ArrayIterator
};
var haxe_xml__$Access_NodeAccess = {};
haxe_xml__$Access_NodeAccess.resolve = function(this1,name) {
	var x = this1.elementsNamed(name).next();
	if(x == null) {
		var xname;
		if(this1.nodeType == Xml.Document) {
			xname = "Document";
		} else {
			if(this1.nodeType != Xml.Element) {
				throw haxe_Exception.thrown("Bad node type, expected Element but found " + (this1.nodeType == null ? "null" : XmlType.toString(this1.nodeType)));
			}
			xname = this1.nodeName;
		}
		throw haxe_Exception.thrown(xname + " is missing element " + name);
	}
	if(x.nodeType != Xml.Document && x.nodeType != Xml.Element) {
		throw haxe_Exception.thrown("Invalid nodeType " + (x.nodeType == null ? "null" : XmlType.toString(x.nodeType)));
	}
	var this1 = x;
	return this1;
};
var haxe_xml__$Access_AttribAccess = {};
haxe_xml__$Access_AttribAccess.resolve = function(this1,name) {
	if(this1.nodeType == Xml.Document) {
		throw haxe_Exception.thrown("Cannot access document attribute " + name);
	}
	var v = this1.get(name);
	if(v == null) {
		if(this1.nodeType != Xml.Element) {
			throw haxe_Exception.thrown("Bad node type, expected Element but found " + (this1.nodeType == null ? "null" : XmlType.toString(this1.nodeType)));
		}
		throw haxe_Exception.thrown(this1.nodeName + " is missing attribute " + name);
	}
	return v;
};
var haxe_xml__$Access_HasAttribAccess = {};
haxe_xml__$Access_HasAttribAccess.resolve = function(this1,name) {
	if(this1.nodeType == Xml.Document) {
		throw haxe_Exception.thrown("Cannot access document attribute " + name);
	}
	return this1.exists(name);
};
var haxe_xml__$Access_NodeListAccess = {};
haxe_xml__$Access_NodeListAccess.resolve = function(this1,name) {
	var l = [];
	var x = this1.elementsNamed(name);
	while(x.hasNext()) {
		var x1 = x.next();
		if(x1.nodeType != Xml.Document && x1.nodeType != Xml.Element) {
			throw haxe_Exception.thrown("Invalid nodeType " + (x1.nodeType == null ? "null" : XmlType.toString(x1.nodeType)));
		}
		var this1 = x1;
		l.push(this1);
	}
	return l;
};
var haxe_xml_XmlParserException = function(message,xml,position) {
	this.xml = xml;
	this.message = message;
	this.position = position;
	this.lineNumber = 1;
	this.positionAtLine = 0;
	var _g = 0;
	var _g1 = position;
	while(_g < _g1) {
		var i = _g++;
		var c = xml.charCodeAt(i);
		if(c == 10) {
			this.lineNumber++;
			this.positionAtLine = 0;
		} else if(c != 13) {
			this.positionAtLine++;
		}
	}
};
$hxClasses["haxe.xml.XmlParserException"] = haxe_xml_XmlParserException;
haxe_xml_XmlParserException.__name__ = "haxe.xml.XmlParserException";
haxe_xml_XmlParserException.prototype = {
	message: null
	,lineNumber: null
	,positionAtLine: null
	,position: null
	,xml: null
	,toString: function() {
		var c = js_Boot.getClass(this);
		return c.__name__ + ": " + this.message + " at line " + this.lineNumber + " char " + this.positionAtLine;
	}
	,__class__: haxe_xml_XmlParserException
};
var haxe_xml_Parser = function() { };
$hxClasses["haxe.xml.Parser"] = haxe_xml_Parser;
haxe_xml_Parser.__name__ = "haxe.xml.Parser";
haxe_xml_Parser.parse = function(str,strict) {
	if(strict == null) {
		strict = false;
	}
	var doc = Xml.createDocument();
	haxe_xml_Parser.doParse(str,strict,0,doc);
	return doc;
};
haxe_xml_Parser.doParse = function(str,strict,p,parent) {
	if(p == null) {
		p = 0;
	}
	var xml = null;
	var state = 1;
	var next = 1;
	var aname = null;
	var start = 0;
	var nsubs = 0;
	var nbrackets = 0;
	var c = str.charCodeAt(p);
	var buf = new StringBuf();
	var escapeNext = 1;
	var attrValQuote = -1;
	while(c == c) {
		switch(state) {
		case 0:
			switch(c) {
			case 9:case 10:case 13:case 32:
				break;
			default:
				state = next;
				continue;
			}
			break;
		case 1:
			if(c == 60) {
				state = 0;
				next = 2;
			} else {
				start = p;
				state = 13;
				continue;
			}
			break;
		case 2:
			switch(c) {
			case 33:
				if(str.charCodeAt(p + 1) == 91) {
					p += 2;
					if(HxOverrides.substr(str,p,6).toUpperCase() != "CDATA[") {
						throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected <![CDATA[",str,p));
					}
					p += 5;
					state = 17;
					start = p + 1;
				} else if(str.charCodeAt(p + 1) == 68 || str.charCodeAt(p + 1) == 100) {
					if(HxOverrides.substr(str,p + 2,6).toUpperCase() != "OCTYPE") {
						throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected <!DOCTYPE",str,p));
					}
					p += 8;
					state = 16;
					start = p + 1;
				} else if(str.charCodeAt(p + 1) != 45 || str.charCodeAt(p + 2) != 45) {
					throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected <!--",str,p));
				} else {
					p += 2;
					state = 15;
					start = p + 1;
				}
				break;
			case 47:
				if(parent == null) {
					throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected node name",str,p));
				}
				start = p + 1;
				state = 0;
				next = 10;
				break;
			case 63:
				state = 14;
				start = p;
				break;
			default:
				state = 3;
				start = p;
				continue;
			}
			break;
		case 3:
			if(!(c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c == 58 || c == 46 || c == 95 || c == 45)) {
				if(p == start) {
					throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected node name",str,p));
				}
				xml = Xml.createElement(HxOverrides.substr(str,start,p - start));
				parent.addChild(xml);
				++nsubs;
				state = 0;
				next = 4;
				continue;
			}
			break;
		case 4:
			switch(c) {
			case 47:
				state = 11;
				break;
			case 62:
				state = 9;
				break;
			default:
				state = 5;
				start = p;
				continue;
			}
			break;
		case 5:
			if(!(c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c == 58 || c == 46 || c == 95 || c == 45)) {
				if(start == p) {
					throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected attribute name",str,p));
				}
				var tmp = HxOverrides.substr(str,start,p - start);
				aname = tmp;
				if(xml.exists(aname)) {
					throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Duplicate attribute [" + aname + "]",str,p));
				}
				state = 0;
				next = 6;
				continue;
			}
			break;
		case 6:
			if(c == 61) {
				state = 0;
				next = 7;
			} else {
				throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected =",str,p));
			}
			break;
		case 7:
			switch(c) {
			case 34:case 39:
				buf = new StringBuf();
				state = 8;
				start = p + 1;
				attrValQuote = c;
				break;
			default:
				throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected \"",str,p));
			}
			break;
		case 8:
			switch(c) {
			case 38:
				var len = p - start;
				buf.b += len == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len);
				state = 18;
				escapeNext = 8;
				start = p + 1;
				break;
			case 60:case 62:
				if(strict) {
					throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Invalid unescaped " + String.fromCodePoint(c) + " in attribute value",str,p));
				} else if(c == attrValQuote) {
					var len1 = p - start;
					buf.b += len1 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len1);
					var val = buf.b;
					buf = new StringBuf();
					xml.set(aname,val);
					state = 0;
					next = 4;
				}
				break;
			default:
				if(c == attrValQuote) {
					var len2 = p - start;
					buf.b += len2 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len2);
					var val1 = buf.b;
					buf = new StringBuf();
					xml.set(aname,val1);
					state = 0;
					next = 4;
				}
			}
			break;
		case 9:
			p = haxe_xml_Parser.doParse(str,strict,p,xml);
			start = p;
			state = 1;
			break;
		case 10:
			if(!(c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c == 58 || c == 46 || c == 95 || c == 45)) {
				if(start == p) {
					throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected node name",str,p));
				}
				var v = HxOverrides.substr(str,start,p - start);
				if(parent == null || parent.nodeType != 0) {
					throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Unexpected </" + v + ">, tag is not open",str,p));
				}
				if(parent.nodeType != Xml.Element) {
					throw haxe_Exception.thrown("Bad node type, expected Element but found " + (parent.nodeType == null ? "null" : XmlType.toString(parent.nodeType)));
				}
				if(v != parent.nodeName) {
					if(parent.nodeType != Xml.Element) {
						throw haxe_Exception.thrown("Bad node type, expected Element but found " + (parent.nodeType == null ? "null" : XmlType.toString(parent.nodeType)));
					}
					throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected </" + parent.nodeName + ">",str,p));
				}
				state = 0;
				next = 12;
				continue;
			}
			break;
		case 11:
			if(c == 62) {
				state = 1;
			} else {
				throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected >",str,p));
			}
			break;
		case 12:
			if(c == 62) {
				if(nsubs == 0) {
					parent.addChild(Xml.createPCData(""));
				}
				return p;
			} else {
				throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected >",str,p));
			}
			break;
		case 13:
			if(c == 60) {
				var len3 = p - start;
				buf.b += len3 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len3);
				var child = Xml.createPCData(buf.b);
				buf = new StringBuf();
				parent.addChild(child);
				++nsubs;
				state = 0;
				next = 2;
			} else if(c == 38) {
				var len4 = p - start;
				buf.b += len4 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len4);
				state = 18;
				escapeNext = 13;
				start = p + 1;
			}
			break;
		case 14:
			if(c == 63 && str.charCodeAt(p + 1) == 62) {
				++p;
				var str1 = HxOverrides.substr(str,start + 1,p - start - 2);
				parent.addChild(Xml.createProcessingInstruction(str1));
				++nsubs;
				state = 1;
			}
			break;
		case 15:
			if(c == 45 && str.charCodeAt(p + 1) == 45 && str.charCodeAt(p + 2) == 62) {
				parent.addChild(Xml.createComment(HxOverrides.substr(str,start,p - start)));
				++nsubs;
				p += 2;
				state = 1;
			}
			break;
		case 16:
			if(c == 91) {
				++nbrackets;
			} else if(c == 93) {
				--nbrackets;
			} else if(c == 62 && nbrackets == 0) {
				parent.addChild(Xml.createDocType(HxOverrides.substr(str,start,p - start)));
				++nsubs;
				state = 1;
			}
			break;
		case 17:
			if(c == 93 && str.charCodeAt(p + 1) == 93 && str.charCodeAt(p + 2) == 62) {
				var child1 = Xml.createCData(HxOverrides.substr(str,start,p - start));
				parent.addChild(child1);
				++nsubs;
				p += 2;
				state = 1;
			}
			break;
		case 18:
			if(c == 59) {
				var s = HxOverrides.substr(str,start,p - start);
				if(s.charCodeAt(0) == 35) {
					var c1 = s.charCodeAt(1) == 120 ? Std.parseInt("0" + HxOverrides.substr(s,1,s.length - 1)) : Std.parseInt(HxOverrides.substr(s,1,s.length - 1));
					buf.b += String.fromCodePoint(c1);
				} else if(!Object.prototype.hasOwnProperty.call(haxe_xml_Parser.escapes.h,s)) {
					if(strict) {
						throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Undefined entity: " + s,str,p));
					}
					buf.b += Std.string("&" + s + ";");
				} else {
					buf.b += Std.string(haxe_xml_Parser.escapes.h[s]);
				}
				start = p + 1;
				state = escapeNext;
			} else if(!(c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c == 58 || c == 46 || c == 95 || c == 45) && c != 35) {
				if(strict) {
					throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Invalid character in entity: " + String.fromCodePoint(c),str,p));
				}
				buf.b += String.fromCodePoint(38);
				var len5 = p - start;
				buf.b += len5 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len5);
				--p;
				start = p + 1;
				state = escapeNext;
			}
			break;
		}
		c = str.charCodeAt(++p);
	}
	if(state == 1) {
		start = p;
		state = 13;
	}
	if(state == 13) {
		if(parent.nodeType == 0) {
			if(parent.nodeType != Xml.Element) {
				throw haxe_Exception.thrown("Bad node type, expected Element but found " + (parent.nodeType == null ? "null" : XmlType.toString(parent.nodeType)));
			}
			throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Unclosed node <" + parent.nodeName + ">",str,p));
		}
		if(p != start || nsubs == 0) {
			var len = p - start;
			buf.b += len == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len);
			parent.addChild(Xml.createPCData(buf.b));
			++nsubs;
		}
		return p;
	}
	if(!strict && state == 18 && escapeNext == 13) {
		buf.b += String.fromCodePoint(38);
		var len = p - start;
		buf.b += len == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len);
		parent.addChild(Xml.createPCData(buf.b));
		++nsubs;
		return p;
	}
	throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Unexpected end",str,p));
};
var haxe_xml_Printer = function(pretty) {
	this.output = new StringBuf();
	this.pretty = pretty;
};
$hxClasses["haxe.xml.Printer"] = haxe_xml_Printer;
haxe_xml_Printer.__name__ = "haxe.xml.Printer";
haxe_xml_Printer.print = function(xml,pretty) {
	if(pretty == null) {
		pretty = false;
	}
	var printer = new haxe_xml_Printer(pretty);
	printer.writeNode(xml,"");
	return printer.output.b;
};
haxe_xml_Printer.prototype = {
	output: null
	,pretty: null
	,writeNode: function(value,tabs) {
		switch(value.nodeType) {
		case 0:
			this.output.b += Std.string(tabs + "<");
			if(value.nodeType != Xml.Element) {
				throw haxe_Exception.thrown("Bad node type, expected Element but found " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType)));
			}
			this.output.b += Std.string(value.nodeName);
			var attribute = value.attributes();
			while(attribute.hasNext()) {
				var attribute1 = attribute.next();
				this.output.b += Std.string(" " + attribute1 + "=\"");
				var input = StringTools.htmlEscape(value.get(attribute1),true);
				this.output.b += Std.string(input);
				this.output.b += "\"";
			}
			if(this.hasChildren(value)) {
				this.output.b += ">";
				if(this.pretty) {
					this.output.b += "\n";
				}
				if(value.nodeType != Xml.Document && value.nodeType != Xml.Element) {
					throw haxe_Exception.thrown("Bad node type, expected Element or Document but found " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType)));
				}
				var _g_current = 0;
				var _g_array = value.children;
				while(_g_current < _g_array.length) {
					var child = _g_array[_g_current++];
					this.writeNode(child,this.pretty ? tabs + "\t" : tabs);
				}
				this.output.b += Std.string(tabs + "</");
				if(value.nodeType != Xml.Element) {
					throw haxe_Exception.thrown("Bad node type, expected Element but found " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType)));
				}
				this.output.b += Std.string(value.nodeName);
				this.output.b += ">";
				if(this.pretty) {
					this.output.b += "\n";
				}
			} else {
				this.output.b += "/>";
				if(this.pretty) {
					this.output.b += "\n";
				}
			}
			break;
		case 1:
			if(value.nodeType == Xml.Document || value.nodeType == Xml.Element) {
				throw haxe_Exception.thrown("Bad node type, unexpected " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType)));
			}
			var nodeValue = value.nodeValue;
			if(nodeValue.length != 0) {
				var input = tabs + StringTools.htmlEscape(nodeValue);
				this.output.b += Std.string(input);
				if(this.pretty) {
					this.output.b += "\n";
				}
			}
			break;
		case 2:
			this.output.b += Std.string(tabs + "<![CDATA[");
			if(value.nodeType == Xml.Document || value.nodeType == Xml.Element) {
				throw haxe_Exception.thrown("Bad node type, unexpected " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType)));
			}
			this.output.b += Std.string(value.nodeValue);
			this.output.b += "]]>";
			if(this.pretty) {
				this.output.b += "\n";
			}
			break;
		case 3:
			if(value.nodeType == Xml.Document || value.nodeType == Xml.Element) {
				throw haxe_Exception.thrown("Bad node type, unexpected " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType)));
			}
			var commentContent = value.nodeValue;
			var _this_r = new RegExp("[\n\r\t]+","g".split("u").join(""));
			commentContent = commentContent.replace(_this_r,"");
			commentContent = "<!--" + commentContent + "-->";
			this.output.b += tabs == null ? "null" : "" + tabs;
			var input = StringTools.trim(commentContent);
			this.output.b += Std.string(input);
			if(this.pretty) {
				this.output.b += "\n";
			}
			break;
		case 4:
			if(value.nodeType == Xml.Document || value.nodeType == Xml.Element) {
				throw haxe_Exception.thrown("Bad node type, unexpected " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType)));
			}
			this.output.b += Std.string("<!DOCTYPE " + value.nodeValue + ">");
			if(this.pretty) {
				this.output.b += "\n";
			}
			break;
		case 5:
			if(value.nodeType == Xml.Document || value.nodeType == Xml.Element) {
				throw haxe_Exception.thrown("Bad node type, unexpected " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType)));
			}
			this.output.b += Std.string("<?" + value.nodeValue + "?>");
			if(this.pretty) {
				this.output.b += "\n";
			}
			break;
		case 6:
			if(value.nodeType != Xml.Document && value.nodeType != Xml.Element) {
				throw haxe_Exception.thrown("Bad node type, expected Element or Document but found " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType)));
			}
			var _g_current = 0;
			var _g_array = value.children;
			while(_g_current < _g_array.length) {
				var child = _g_array[_g_current++];
				this.writeNode(child,tabs);
			}
			break;
		}
	}
	,hasChildren: function(value) {
		if(value.nodeType != Xml.Document && value.nodeType != Xml.Element) {
			throw haxe_Exception.thrown("Bad node type, expected Element or Document but found " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType)));
		}
		var _g_current = 0;
		var _g_array = value.children;
		while(_g_current < _g_array.length) {
			var child = _g_array[_g_current++];
			switch(child.nodeType) {
			case 0:case 1:
				return true;
			case 2:case 3:
				if(child.nodeType == Xml.Document || child.nodeType == Xml.Element) {
					throw haxe_Exception.thrown("Bad node type, unexpected " + (child.nodeType == null ? "null" : XmlType.toString(child.nodeType)));
				}
				if(StringTools.ltrim(child.nodeValue).length != 0) {
					return true;
				}
				break;
			default:
			}
		}
		return false;
	}
	,__class__: haxe_xml_Printer
};
var haxe_zip_ExtraField = $hxEnums["haxe.zip.ExtraField"] = { __ename__ : "haxe.zip.ExtraField", __constructs__ : ["FUnknown","FInfoZipUnicodePath","FUtf8"]
	,FUnknown: ($_=function(tag,bytes) { return {_hx_index:0,tag:tag,bytes:bytes,__enum__:"haxe.zip.ExtraField",toString:$estr}; },$_.__params__ = ["tag","bytes"],$_)
	,FInfoZipUnicodePath: ($_=function(name,crc) { return {_hx_index:1,name:name,crc:crc,__enum__:"haxe.zip.ExtraField",toString:$estr}; },$_.__params__ = ["name","crc"],$_)
	,FUtf8: {_hx_index:2,__enum__:"haxe.zip.ExtraField",toString:$estr}
};
var haxe_zip_Huffman = $hxEnums["haxe.zip.Huffman"] = { __ename__ : "haxe.zip.Huffman", __constructs__ : ["Found","NeedBit","NeedBits"]
	,Found: ($_=function(i) { return {_hx_index:0,i:i,__enum__:"haxe.zip.Huffman",toString:$estr}; },$_.__params__ = ["i"],$_)
	,NeedBit: ($_=function(left,right) { return {_hx_index:1,left:left,right:right,__enum__:"haxe.zip.Huffman",toString:$estr}; },$_.__params__ = ["left","right"],$_)
	,NeedBits: ($_=function(n,table) { return {_hx_index:2,n:n,table:table,__enum__:"haxe.zip.Huffman",toString:$estr}; },$_.__params__ = ["n","table"],$_)
};
var haxe_zip_HuffTools = function() {
};
$hxClasses["haxe.zip.HuffTools"] = haxe_zip_HuffTools;
haxe_zip_HuffTools.__name__ = "haxe.zip.HuffTools";
haxe_zip_HuffTools.prototype = {
	treeDepth: function(t) {
		switch(t._hx_index) {
		case 0:
			var _g = t.i;
			return 0;
		case 1:
			var b = t.right;
			var a = t.left;
			var da = this.treeDepth(a);
			var db = this.treeDepth(b);
			return 1 + (da < db ? da : db);
		case 2:
			var _g = t.table;
			var _g = t.n;
			throw haxe_Exception.thrown("assert");
		}
	}
	,treeCompress: function(t) {
		var d = this.treeDepth(t);
		if(d == 0) {
			return t;
		}
		if(d == 1) {
			if(t._hx_index == 1) {
				var b = t.right;
				var a = t.left;
				return haxe_zip_Huffman.NeedBit(this.treeCompress(a),this.treeCompress(b));
			} else {
				throw haxe_Exception.thrown("assert");
			}
		}
		var size = 1 << d;
		var table = [];
		var _g = 0;
		var _g1 = size;
		while(_g < _g1) {
			var i = _g++;
			table.push(haxe_zip_Huffman.Found(-1));
		}
		this.treeWalk(table,0,0,d,t);
		return haxe_zip_Huffman.NeedBits(d,table);
	}
	,treeWalk: function(table,p,cd,d,t) {
		if(t._hx_index == 1) {
			var b = t.right;
			var a = t.left;
			if(d > 0) {
				this.treeWalk(table,p,cd + 1,d - 1,a);
				this.treeWalk(table,p | 1 << cd,cd + 1,d - 1,b);
			} else {
				table[p] = this.treeCompress(t);
			}
		} else {
			table[p] = this.treeCompress(t);
		}
	}
	,treeMake: function(bits,maxbits,v,len) {
		if(len > maxbits) {
			throw haxe_Exception.thrown("Invalid huffman");
		}
		var idx = v << 5 | len;
		if(bits.h.hasOwnProperty(idx)) {
			return haxe_zip_Huffman.Found(bits.h[idx]);
		}
		v <<= 1;
		++len;
		return haxe_zip_Huffman.NeedBit(this.treeMake(bits,maxbits,v,len),this.treeMake(bits,maxbits,v | 1,len));
	}
	,make: function(lengths,pos,nlengths,maxbits) {
		if(nlengths == 1) {
			return haxe_zip_Huffman.NeedBit(haxe_zip_Huffman.Found(0),haxe_zip_Huffman.Found(0));
		}
		var counts = [];
		var tmp = [];
		if(maxbits > 32) {
			throw haxe_Exception.thrown("Invalid huffman");
		}
		var _g = 0;
		var _g1 = maxbits;
		while(_g < _g1) {
			var i = _g++;
			counts.push(0);
			tmp.push(0);
		}
		var _g = 0;
		var _g1 = nlengths;
		while(_g < _g1) {
			var i = _g++;
			var p = lengths[i + pos];
			if(p >= maxbits) {
				throw haxe_Exception.thrown("Invalid huffman");
			}
			counts[p]++;
		}
		var code = 0;
		var _g = 1;
		var _g1 = maxbits - 1;
		while(_g < _g1) {
			var i = _g++;
			code = code + counts[i] << 1;
			tmp[i] = code;
		}
		var bits = new haxe_ds_IntMap();
		var _g = 0;
		var _g1 = nlengths;
		while(_g < _g1) {
			var i = _g++;
			var l = lengths[i + pos];
			if(l != 0) {
				var n = tmp[l - 1];
				tmp[l - 1] = n + 1;
				bits.h[n << 5 | l] = i;
			}
		}
		return this.treeCompress(haxe_zip_Huffman.NeedBit(this.treeMake(bits,maxbits,0,1),this.treeMake(bits,maxbits,1,1)));
	}
	,__class__: haxe_zip_HuffTools
};
var haxe_zip__$InflateImpl_Window = function(hasCrc) {
	this.buffer = new haxe_io_Bytes(new ArrayBuffer(65536));
	this.pos = 0;
	if(hasCrc) {
		this.crc = new haxe_crypto_Adler32();
	}
};
$hxClasses["haxe.zip._InflateImpl.Window"] = haxe_zip__$InflateImpl_Window;
haxe_zip__$InflateImpl_Window.__name__ = "haxe.zip._InflateImpl.Window";
haxe_zip__$InflateImpl_Window.prototype = {
	buffer: null
	,pos: null
	,crc: null
	,slide: function() {
		if(this.crc != null) {
			this.crc.update(this.buffer,0,32768);
		}
		var b = new haxe_io_Bytes(new ArrayBuffer(65536));
		this.pos -= 32768;
		b.blit(0,this.buffer,32768,this.pos);
		this.buffer = b;
	}
	,addBytes: function(b,p,len) {
		if(this.pos + len > 65536) {
			this.slide();
		}
		this.buffer.blit(this.pos,b,p,len);
		this.pos += len;
	}
	,addByte: function(c) {
		if(this.pos == 65536) {
			this.slide();
		}
		this.buffer.b[this.pos] = c & 255;
		this.pos++;
	}
	,getLastChar: function() {
		return this.buffer.b[this.pos - 1];
	}
	,available: function() {
		return this.pos;
	}
	,checksum: function() {
		if(this.crc != null) {
			this.crc.update(this.buffer,0,this.pos);
		}
		return this.crc;
	}
	,__class__: haxe_zip__$InflateImpl_Window
};
var haxe_zip__$InflateImpl_State = $hxEnums["haxe.zip._InflateImpl.State"] = { __ename__ : "haxe.zip._InflateImpl.State", __constructs__ : ["Head","Block","CData","Flat","Crc","Dist","DistOne","Done"]
	,Head: {_hx_index:0,__enum__:"haxe.zip._InflateImpl.State",toString:$estr}
	,Block: {_hx_index:1,__enum__:"haxe.zip._InflateImpl.State",toString:$estr}
	,CData: {_hx_index:2,__enum__:"haxe.zip._InflateImpl.State",toString:$estr}
	,Flat: {_hx_index:3,__enum__:"haxe.zip._InflateImpl.State",toString:$estr}
	,Crc: {_hx_index:4,__enum__:"haxe.zip._InflateImpl.State",toString:$estr}
	,Dist: {_hx_index:5,__enum__:"haxe.zip._InflateImpl.State",toString:$estr}
	,DistOne: {_hx_index:6,__enum__:"haxe.zip._InflateImpl.State",toString:$estr}
	,Done: {_hx_index:7,__enum__:"haxe.zip._InflateImpl.State",toString:$estr}
};
var haxe_zip_InflateImpl = function(i,header,crc) {
	if(crc == null) {
		crc = true;
	}
	if(header == null) {
		header = true;
	}
	this.isFinal = false;
	this.htools = new haxe_zip_HuffTools();
	this.huffman = this.buildFixedHuffman();
	this.huffdist = null;
	this.len = 0;
	this.dist = 0;
	this.state = header ? haxe_zip__$InflateImpl_State.Head : haxe_zip__$InflateImpl_State.Block;
	this.input = i;
	this.bits = 0;
	this.nbits = 0;
	this.needed = 0;
	this.output = null;
	this.outpos = 0;
	this.lengths = [];
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.window = new haxe_zip__$InflateImpl_Window(crc);
};
$hxClasses["haxe.zip.InflateImpl"] = haxe_zip_InflateImpl;
haxe_zip_InflateImpl.__name__ = "haxe.zip.InflateImpl";
haxe_zip_InflateImpl.prototype = {
	nbits: null
	,bits: null
	,state: null
	,isFinal: null
	,huffman: null
	,huffdist: null
	,htools: null
	,len: null
	,dist: null
	,needed: null
	,output: null
	,outpos: null
	,input: null
	,lengths: null
	,window: null
	,buildFixedHuffman: function() {
		if(haxe_zip_InflateImpl.FIXED_HUFFMAN != null) {
			return haxe_zip_InflateImpl.FIXED_HUFFMAN;
		}
		var a = [];
		var _g = 0;
		while(_g < 288) {
			var n = _g++;
			a.push(n <= 143 ? 8 : n <= 255 ? 9 : n <= 279 ? 7 : 8);
		}
		haxe_zip_InflateImpl.FIXED_HUFFMAN = this.htools.make(a,0,288,10);
		return haxe_zip_InflateImpl.FIXED_HUFFMAN;
	}
	,readBytes: function(b,pos,len) {
		this.needed = len;
		this.outpos = pos;
		this.output = b;
		if(len > 0) {
			while(this.inflateLoop()) {
			}
		}
		return len - this.needed;
	}
	,getBits: function(n) {
		while(this.nbits < n) {
			this.bits |= this.input.readByte() << this.nbits;
			this.nbits += 8;
		}
		var b = this.bits & (1 << n) - 1;
		this.nbits -= n;
		this.bits >>= n;
		return b;
	}
	,getBit: function() {
		if(this.nbits == 0) {
			this.nbits = 8;
			this.bits = this.input.readByte();
		}
		var b = (this.bits & 1) == 1;
		this.nbits--;
		this.bits >>= 1;
		return b;
	}
	,getRevBits: function(n) {
		if(n == 0) {
			return 0;
		} else if(this.getBit()) {
			return 1 << n - 1 | this.getRevBits(n - 1);
		} else {
			return this.getRevBits(n - 1);
		}
	}
	,resetBits: function() {
		this.bits = 0;
		this.nbits = 0;
	}
	,addBytes: function(b,p,len) {
		this.window.addBytes(b,p,len);
		this.output.blit(this.outpos,b,p,len);
		this.needed -= len;
		this.outpos += len;
	}
	,addByte: function(b) {
		this.window.addByte(b);
		this.output.b[this.outpos] = b & 255;
		this.needed--;
		this.outpos++;
	}
	,addDistOne: function(n) {
		var c = this.window.getLastChar();
		var _g = 0;
		var _g1 = n;
		while(_g < _g1) {
			var i = _g++;
			this.addByte(c);
		}
	}
	,addDist: function(d,len) {
		this.addBytes(this.window.buffer,this.window.pos - d,len);
	}
	,applyHuffman: function(h) {
		switch(h._hx_index) {
		case 0:
			var n = h.i;
			return n;
		case 1:
			var b = h.right;
			var a = h.left;
			return this.applyHuffman(this.getBit() ? b : a);
		case 2:
			var tbl = h.table;
			var n = h.n;
			return this.applyHuffman(tbl[this.getBits(n)]);
		}
	}
	,inflateLengths: function(a,max) {
		var i = 0;
		var prev = 0;
		while(i < max) {
			var n = this.applyHuffman(this.huffman);
			switch(n) {
			case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:
				prev = n;
				a[i] = n;
				++i;
				break;
			case 16:
				var end = i + 3 + this.getBits(2);
				if(end > max) {
					throw haxe_Exception.thrown("Invalid data");
				}
				while(i < end) {
					a[i] = prev;
					++i;
				}
				break;
			case 17:
				i += 3 + this.getBits(3);
				if(i > max) {
					throw haxe_Exception.thrown("Invalid data");
				}
				break;
			case 18:
				i += 11 + this.getBits(7);
				if(i > max) {
					throw haxe_Exception.thrown("Invalid data");
				}
				break;
			default:
				throw haxe_Exception.thrown("Invalid data");
			}
		}
	}
	,inflateLoop: function() {
		switch(this.state._hx_index) {
		case 0:
			var cmf = this.input.readByte();
			var cm = cmf & 15;
			var cinfo = cmf >> 4;
			if(cm != 8) {
				throw haxe_Exception.thrown("Invalid data");
			}
			var flg = this.input.readByte();
			var fdict = (flg & 32) != 0;
			if(((cmf << 8) + flg) % 31 != 0) {
				throw haxe_Exception.thrown("Invalid data");
			}
			if(fdict) {
				throw haxe_Exception.thrown("Unsupported dictionary");
			}
			this.state = haxe_zip__$InflateImpl_State.Block;
			return true;
		case 1:
			this.isFinal = this.getBit();
			switch(this.getBits(2)) {
			case 0:
				this.len = this.input.readUInt16();
				var nlen = this.input.readUInt16();
				if(nlen != 65535 - this.len) {
					throw haxe_Exception.thrown("Invalid data");
				}
				this.state = haxe_zip__$InflateImpl_State.Flat;
				var r = this.inflateLoop();
				this.resetBits();
				return r;
			case 1:
				this.huffman = this.buildFixedHuffman();
				this.huffdist = null;
				this.state = haxe_zip__$InflateImpl_State.CData;
				return true;
			case 2:
				var hlit = this.getBits(5) + 257;
				var hdist = this.getBits(5) + 1;
				var hclen = this.getBits(4) + 4;
				var _g = 0;
				var _g1 = hclen;
				while(_g < _g1) {
					var i = _g++;
					this.lengths[haxe_zip_InflateImpl.CODE_LENGTHS_POS[i]] = this.getBits(3);
				}
				var _g = hclen;
				var _g1 = 19;
				while(_g < _g1) {
					var i = _g++;
					this.lengths[haxe_zip_InflateImpl.CODE_LENGTHS_POS[i]] = 0;
				}
				this.huffman = this.htools.make(this.lengths,0,19,8);
				var lengths = [];
				var _g = 0;
				var _g1 = hlit + hdist;
				while(_g < _g1) {
					var i = _g++;
					lengths.push(0);
				}
				this.inflateLengths(lengths,hlit + hdist);
				this.huffdist = this.htools.make(lengths,hlit,hdist,16);
				this.huffman = this.htools.make(lengths,0,hlit,16);
				this.state = haxe_zip__$InflateImpl_State.CData;
				return true;
			default:
				throw haxe_Exception.thrown("Invalid data");
			}
			break;
		case 2:
			var n = this.applyHuffman(this.huffman);
			if(n < 256) {
				this.addByte(n);
				return this.needed > 0;
			} else if(n == 256) {
				this.state = this.isFinal ? haxe_zip__$InflateImpl_State.Crc : haxe_zip__$InflateImpl_State.Block;
				return true;
			} else {
				n -= 257;
				var extra_bits = haxe_zip_InflateImpl.LEN_EXTRA_BITS_TBL[n];
				if(extra_bits == -1) {
					throw haxe_Exception.thrown("Invalid data");
				}
				this.len = haxe_zip_InflateImpl.LEN_BASE_VAL_TBL[n] + this.getBits(extra_bits);
				var dist_code = this.huffdist == null ? this.getRevBits(5) : this.applyHuffman(this.huffdist);
				extra_bits = haxe_zip_InflateImpl.DIST_EXTRA_BITS_TBL[dist_code];
				if(extra_bits == -1) {
					throw haxe_Exception.thrown("Invalid data");
				}
				this.dist = haxe_zip_InflateImpl.DIST_BASE_VAL_TBL[dist_code] + this.getBits(extra_bits);
				if(this.dist > this.window.available()) {
					throw haxe_Exception.thrown("Invalid data");
				}
				this.state = this.dist == 1 ? haxe_zip__$InflateImpl_State.DistOne : haxe_zip__$InflateImpl_State.Dist;
				return true;
			}
			break;
		case 3:
			var rlen = this.len < this.needed ? this.len : this.needed;
			var bytes = this.input.read(rlen);
			this.len -= rlen;
			this.addBytes(bytes,0,rlen);
			if(this.len == 0) {
				this.state = this.isFinal ? haxe_zip__$InflateImpl_State.Crc : haxe_zip__$InflateImpl_State.Block;
			}
			return this.needed > 0;
		case 4:
			var calc = this.window.checksum();
			if(calc == null) {
				this.state = haxe_zip__$InflateImpl_State.Done;
				return true;
			}
			var crc = haxe_crypto_Adler32.read(this.input);
			if(!calc.equals(crc)) {
				throw haxe_Exception.thrown("Invalid CRC");
			}
			this.state = haxe_zip__$InflateImpl_State.Done;
			return true;
		case 5:
			while(this.len > 0 && this.needed > 0) {
				var rdist = this.len < this.dist ? this.len : this.dist;
				var rlen = this.needed < rdist ? this.needed : rdist;
				this.addDist(this.dist,rlen);
				this.len -= rlen;
			}
			if(this.len == 0) {
				this.state = haxe_zip__$InflateImpl_State.CData;
			}
			return this.needed > 0;
		case 6:
			var rlen = this.len < this.needed ? this.len : this.needed;
			this.addDistOne(rlen);
			this.len -= rlen;
			if(this.len == 0) {
				this.state = haxe_zip__$InflateImpl_State.CData;
			}
			return this.needed > 0;
		case 7:
			return false;
		}
	}
	,__class__: haxe_zip_InflateImpl
};
var haxe_zip_Reader = function(i) {
	this.i = i;
};
$hxClasses["haxe.zip.Reader"] = haxe_zip_Reader;
haxe_zip_Reader.__name__ = "haxe.zip.Reader";
haxe_zip_Reader.readZip = function(i) {
	var r = new haxe_zip_Reader(i);
	return r.read();
};
haxe_zip_Reader.unzip = function(f) {
	if(!f.compressed) {
		return f.data;
	}
	throw haxe_Exception.thrown("No uncompress support");
};
haxe_zip_Reader.prototype = {
	i: null
	,readZipDate: function() {
		var t = this.i.readUInt16();
		var hour = t >> 11 & 31;
		var min = t >> 5 & 63;
		var sec = t & 31;
		var d = this.i.readUInt16();
		var year = d >> 9;
		var month = d >> 5 & 15;
		var day = d & 31;
		return new Date(year + 1980,month - 1,day,hour,min,sec << 1);
	}
	,readExtraFields: function(length) {
		var fields = new haxe_ds_List();
		while(length > 0) {
			if(length < 4) {
				throw haxe_Exception.thrown("Invalid extra fields data");
			}
			var tag = this.i.readUInt16();
			var len = this.i.readUInt16();
			if(length < len) {
				throw haxe_Exception.thrown("Invalid extra fields data");
			}
			if(tag == 28789) {
				var version = this.i.readByte();
				if(version != 1) {
					var data = new haxe_io_BytesBuffer();
					data.addByte(version);
					data.add(this.i.read(len - 1));
					fields.add(haxe_zip_ExtraField.FUnknown(tag,data.getBytes()));
				} else {
					var crc = this.i.readInt32();
					var name = this.i.read(len - 5).toString();
					fields.add(haxe_zip_ExtraField.FInfoZipUnicodePath(name,crc));
				}
			} else {
				fields.add(haxe_zip_ExtraField.FUnknown(tag,this.i.read(len)));
			}
			length -= 4 + len;
		}
		return fields;
	}
	,readEntryHeader: function() {
		var i = this.i;
		var h = i.readInt32();
		if(h == 33639248 || h == 101010256) {
			return null;
		}
		if(h != 67324752) {
			throw haxe_Exception.thrown("Invalid Zip Data");
		}
		var version = i.readUInt16();
		var flags = i.readUInt16();
		var utf8 = (flags & 2048) != 0;
		var compression = i.readUInt16();
		var compressed = compression != 0;
		if(compressed && compression != 8) {
			throw haxe_Exception.thrown("Unsupported compression " + compression);
		}
		var mtime = this.readZipDate();
		var crc32 = i.readInt32();
		var csize = i.readInt32();
		var usize = i.readInt32();
		var fnamelen = i.readInt16();
		var elen = i.readInt16();
		var fname = i.readString(fnamelen);
		var fields = this.readExtraFields(elen);
		if(utf8) {
			fields.push(haxe_zip_ExtraField.FUtf8);
		}
		var data = null;
		if((flags & 8) != 0) {
			csize = -1;
		}
		return { fileName : fname, fileSize : usize, fileTime : mtime, compressed : compressed, dataSize : csize, data : data, crc32 : crc32, extraFields : fields};
	}
	,read: function() {
		var l = new haxe_ds_List();
		var buf = null;
		var tmp = null;
		while(true) {
			var e = this.readEntryHeader();
			if(e == null) {
				break;
			}
			if(e.dataSize < 0) {
				var bufSize = 65536;
				if(tmp == null) {
					tmp = new haxe_io_Bytes(new ArrayBuffer(bufSize));
				}
				var out = new haxe_io_BytesBuffer();
				var z = new haxe_zip_InflateImpl(this.i,false,false);
				while(true) {
					var n = z.readBytes(tmp,0,bufSize);
					out.addBytes(tmp,0,n);
					if(n < bufSize) {
						break;
					}
				}
				e.data = out.getBytes();
				e.crc32 = this.i.readInt32();
				if(e.crc32 == 134695760) {
					e.crc32 = this.i.readInt32();
				}
				e.dataSize = this.i.readInt32();
				e.fileSize = this.i.readInt32();
				e.dataSize = e.fileSize;
				e.compressed = false;
			} else {
				e.data = this.i.read(e.dataSize);
			}
			l.add(e);
		}
		return l;
	}
	,__class__: haxe_zip_Reader
};
var hscript_Const = $hxEnums["hscript.Const"] = { __ename__ : "hscript.Const", __constructs__ : ["CInt","CFloat","CString"]
	,CInt: ($_=function(v) { return {_hx_index:0,v:v,__enum__:"hscript.Const",toString:$estr}; },$_.__params__ = ["v"],$_)
	,CFloat: ($_=function(f) { return {_hx_index:1,f:f,__enum__:"hscript.Const",toString:$estr}; },$_.__params__ = ["f"],$_)
	,CString: ($_=function(s) { return {_hx_index:2,s:s,__enum__:"hscript.Const",toString:$estr}; },$_.__params__ = ["s"],$_)
};
var hscript_Expr = $hxEnums["hscript.Expr"] = { __ename__ : "hscript.Expr", __constructs__ : ["EConst","EIdent","EVar","EParent","EBlock","EField","EBinop","EUnop","ECall","EIf","EWhile","EFor","EBreak","EContinue","EFunction","EReturn","EArray","EArrayDecl","ENew","EThrow","ETry","EObject","ETernary","ESwitch","EDoWhile","EMeta","ECheckType"]
	,EConst: ($_=function(c) { return {_hx_index:0,c:c,__enum__:"hscript.Expr",toString:$estr}; },$_.__params__ = ["c"],$_)
	,EIdent: ($_=function(v) { return {_hx_index:1,v:v,__enum__:"hscript.Expr",toString:$estr}; },$_.__params__ = ["v"],$_)
	,EVar: ($_=function(n,t,e) { return {_hx_index:2,n:n,t:t,e:e,__enum__:"hscript.Expr",toString:$estr}; },$_.__params__ = ["n","t","e"],$_)
	,EParent: ($_=function(e) { return {_hx_index:3,e:e,__enum__:"hscript.Expr",toString:$estr}; },$_.__params__ = ["e"],$_)
	,EBlock: ($_=function(e) { return {_hx_index:4,e:e,__enum__:"hscript.Expr",toString:$estr}; },$_.__params__ = ["e"],$_)
	,EField: ($_=function(e,f) { return {_hx_index:5,e:e,f:f,__enum__:"hscript.Expr",toString:$estr}; },$_.__params__ = ["e","f"],$_)
	,EBinop: ($_=function(op,e1,e2) { return {_hx_index:6,op:op,e1:e1,e2:e2,__enum__:"hscript.Expr",toString:$estr}; },$_.__params__ = ["op","e1","e2"],$_)
	,EUnop: ($_=function(op,prefix,e) { return {_hx_index:7,op:op,prefix:prefix,e:e,__enum__:"hscript.Expr",toString:$estr}; },$_.__params__ = ["op","prefix","e"],$_)
	,ECall: ($_=function(e,params) { return {_hx_index:8,e:e,params:params,__enum__:"hscript.Expr",toString:$estr}; },$_.__params__ = ["e","params"],$_)
	,EIf: ($_=function(cond,e1,e2) { return {_hx_index:9,cond:cond,e1:e1,e2:e2,__enum__:"hscript.Expr",toString:$estr}; },$_.__params__ = ["cond","e1","e2"],$_)
	,EWhile: ($_=function(cond,e) { return {_hx_index:10,cond:cond,e:e,__enum__:"hscript.Expr",toString:$estr}; },$_.__params__ = ["cond","e"],$_)
	,EFor: ($_=function(v,it,e) { return {_hx_index:11,v:v,it:it,e:e,__enum__:"hscript.Expr",toString:$estr}; },$_.__params__ = ["v","it","e"],$_)
	,EBreak: {_hx_index:12,__enum__:"hscript.Expr",toString:$estr}
	,EContinue: {_hx_index:13,__enum__:"hscript.Expr",toString:$estr}
	,EFunction: ($_=function(args,e,name,ret) { return {_hx_index:14,args:args,e:e,name:name,ret:ret,__enum__:"hscript.Expr",toString:$estr}; },$_.__params__ = ["args","e","name","ret"],$_)
	,EReturn: ($_=function(e) { return {_hx_index:15,e:e,__enum__:"hscript.Expr",toString:$estr}; },$_.__params__ = ["e"],$_)
	,EArray: ($_=function(e,index) { return {_hx_index:16,e:e,index:index,__enum__:"hscript.Expr",toString:$estr}; },$_.__params__ = ["e","index"],$_)
	,EArrayDecl: ($_=function(e) { return {_hx_index:17,e:e,__enum__:"hscript.Expr",toString:$estr}; },$_.__params__ = ["e"],$_)
	,ENew: ($_=function(cl,params) { return {_hx_index:18,cl:cl,params:params,__enum__:"hscript.Expr",toString:$estr}; },$_.__params__ = ["cl","params"],$_)
	,EThrow: ($_=function(e) { return {_hx_index:19,e:e,__enum__:"hscript.Expr",toString:$estr}; },$_.__params__ = ["e"],$_)
	,ETry: ($_=function(e,v,t,ecatch) { return {_hx_index:20,e:e,v:v,t:t,ecatch:ecatch,__enum__:"hscript.Expr",toString:$estr}; },$_.__params__ = ["e","v","t","ecatch"],$_)
	,EObject: ($_=function(fl) { return {_hx_index:21,fl:fl,__enum__:"hscript.Expr",toString:$estr}; },$_.__params__ = ["fl"],$_)
	,ETernary: ($_=function(cond,e1,e2) { return {_hx_index:22,cond:cond,e1:e1,e2:e2,__enum__:"hscript.Expr",toString:$estr}; },$_.__params__ = ["cond","e1","e2"],$_)
	,ESwitch: ($_=function(e,cases,defaultExpr) { return {_hx_index:23,e:e,cases:cases,defaultExpr:defaultExpr,__enum__:"hscript.Expr",toString:$estr}; },$_.__params__ = ["e","cases","defaultExpr"],$_)
	,EDoWhile: ($_=function(cond,e) { return {_hx_index:24,cond:cond,e:e,__enum__:"hscript.Expr",toString:$estr}; },$_.__params__ = ["cond","e"],$_)
	,EMeta: ($_=function(name,args,e) { return {_hx_index:25,name:name,args:args,e:e,__enum__:"hscript.Expr",toString:$estr}; },$_.__params__ = ["name","args","e"],$_)
	,ECheckType: ($_=function(e,t) { return {_hx_index:26,e:e,t:t,__enum__:"hscript.Expr",toString:$estr}; },$_.__params__ = ["e","t"],$_)
};
var hscript_CType = $hxEnums["hscript.CType"] = { __ename__ : "hscript.CType", __constructs__ : ["CTPath","CTFun","CTAnon","CTParent","CTOpt","CTNamed"]
	,CTPath: ($_=function(path,params) { return {_hx_index:0,path:path,params:params,__enum__:"hscript.CType",toString:$estr}; },$_.__params__ = ["path","params"],$_)
	,CTFun: ($_=function(args,ret) { return {_hx_index:1,args:args,ret:ret,__enum__:"hscript.CType",toString:$estr}; },$_.__params__ = ["args","ret"],$_)
	,CTAnon: ($_=function(fields) { return {_hx_index:2,fields:fields,__enum__:"hscript.CType",toString:$estr}; },$_.__params__ = ["fields"],$_)
	,CTParent: ($_=function(t) { return {_hx_index:3,t:t,__enum__:"hscript.CType",toString:$estr}; },$_.__params__ = ["t"],$_)
	,CTOpt: ($_=function(t) { return {_hx_index:4,t:t,__enum__:"hscript.CType",toString:$estr}; },$_.__params__ = ["t"],$_)
	,CTNamed: ($_=function(n,t) { return {_hx_index:5,n:n,t:t,__enum__:"hscript.CType",toString:$estr}; },$_.__params__ = ["n","t"],$_)
};
var hscript_Error = $hxEnums["hscript.Error"] = { __ename__ : "hscript.Error", __constructs__ : ["EInvalidChar","EUnexpected","EUnterminatedString","EUnterminatedComment","EInvalidPreprocessor","EUnknownVariable","EInvalidIterator","EInvalidOp","EInvalidAccess","ECustom"]
	,EInvalidChar: ($_=function(c) { return {_hx_index:0,c:c,__enum__:"hscript.Error",toString:$estr}; },$_.__params__ = ["c"],$_)
	,EUnexpected: ($_=function(s) { return {_hx_index:1,s:s,__enum__:"hscript.Error",toString:$estr}; },$_.__params__ = ["s"],$_)
	,EUnterminatedString: {_hx_index:2,__enum__:"hscript.Error",toString:$estr}
	,EUnterminatedComment: {_hx_index:3,__enum__:"hscript.Error",toString:$estr}
	,EInvalidPreprocessor: ($_=function(msg) { return {_hx_index:4,msg:msg,__enum__:"hscript.Error",toString:$estr}; },$_.__params__ = ["msg"],$_)
	,EUnknownVariable: ($_=function(v) { return {_hx_index:5,v:v,__enum__:"hscript.Error",toString:$estr}; },$_.__params__ = ["v"],$_)
	,EInvalidIterator: ($_=function(v) { return {_hx_index:6,v:v,__enum__:"hscript.Error",toString:$estr}; },$_.__params__ = ["v"],$_)
	,EInvalidOp: ($_=function(op) { return {_hx_index:7,op:op,__enum__:"hscript.Error",toString:$estr}; },$_.__params__ = ["op"],$_)
	,EInvalidAccess: ($_=function(f) { return {_hx_index:8,f:f,__enum__:"hscript.Error",toString:$estr}; },$_.__params__ = ["f"],$_)
	,ECustom: ($_=function(msg) { return {_hx_index:9,msg:msg,__enum__:"hscript.Error",toString:$estr}; },$_.__params__ = ["msg"],$_)
};
var hscript_ModuleDecl = $hxEnums["hscript.ModuleDecl"] = { __ename__ : "hscript.ModuleDecl", __constructs__ : ["DPackage","DImport","DClass","DTypedef"]
	,DPackage: ($_=function(path) { return {_hx_index:0,path:path,__enum__:"hscript.ModuleDecl",toString:$estr}; },$_.__params__ = ["path"],$_)
	,DImport: ($_=function(path,everything) { return {_hx_index:1,path:path,everything:everything,__enum__:"hscript.ModuleDecl",toString:$estr}; },$_.__params__ = ["path","everything"],$_)
	,DClass: ($_=function(c) { return {_hx_index:2,c:c,__enum__:"hscript.ModuleDecl",toString:$estr}; },$_.__params__ = ["c"],$_)
	,DTypedef: ($_=function(c) { return {_hx_index:3,c:c,__enum__:"hscript.ModuleDecl",toString:$estr}; },$_.__params__ = ["c"],$_)
};
var hscript_FieldAccess = $hxEnums["hscript.FieldAccess"] = { __ename__ : "hscript.FieldAccess", __constructs__ : ["APublic","APrivate","AInline","AOverride","AStatic","AMacro"]
	,APublic: {_hx_index:0,__enum__:"hscript.FieldAccess",toString:$estr}
	,APrivate: {_hx_index:1,__enum__:"hscript.FieldAccess",toString:$estr}
	,AInline: {_hx_index:2,__enum__:"hscript.FieldAccess",toString:$estr}
	,AOverride: {_hx_index:3,__enum__:"hscript.FieldAccess",toString:$estr}
	,AStatic: {_hx_index:4,__enum__:"hscript.FieldAccess",toString:$estr}
	,AMacro: {_hx_index:5,__enum__:"hscript.FieldAccess",toString:$estr}
};
var hscript_FieldKind = $hxEnums["hscript.FieldKind"] = { __ename__ : "hscript.FieldKind", __constructs__ : ["KFunction","KVar"]
	,KFunction: ($_=function(f) { return {_hx_index:0,f:f,__enum__:"hscript.FieldKind",toString:$estr}; },$_.__params__ = ["f"],$_)
	,KVar: ($_=function(v) { return {_hx_index:1,v:v,__enum__:"hscript.FieldKind",toString:$estr}; },$_.__params__ = ["v"],$_)
};
var hscript__$Interp_Stop = $hxEnums["hscript._Interp.Stop"] = { __ename__ : "hscript._Interp.Stop", __constructs__ : ["SBreak","SContinue","SReturn"]
	,SBreak: {_hx_index:0,__enum__:"hscript._Interp.Stop",toString:$estr}
	,SContinue: {_hx_index:1,__enum__:"hscript._Interp.Stop",toString:$estr}
	,SReturn: {_hx_index:2,__enum__:"hscript._Interp.Stop",toString:$estr}
};
var hscript_Token = $hxEnums["hscript.Token"] = { __ename__ : "hscript.Token", __constructs__ : ["TEof","TConst","TId","TOp","TPOpen","TPClose","TBrOpen","TBrClose","TDot","TComma","TSemicolon","TBkOpen","TBkClose","TQuestion","TDoubleDot","TMeta","TPrepro"]
	,TEof: {_hx_index:0,__enum__:"hscript.Token",toString:$estr}
	,TConst: ($_=function(c) { return {_hx_index:1,c:c,__enum__:"hscript.Token",toString:$estr}; },$_.__params__ = ["c"],$_)
	,TId: ($_=function(s) { return {_hx_index:2,s:s,__enum__:"hscript.Token",toString:$estr}; },$_.__params__ = ["s"],$_)
	,TOp: ($_=function(s) { return {_hx_index:3,s:s,__enum__:"hscript.Token",toString:$estr}; },$_.__params__ = ["s"],$_)
	,TPOpen: {_hx_index:4,__enum__:"hscript.Token",toString:$estr}
	,TPClose: {_hx_index:5,__enum__:"hscript.Token",toString:$estr}
	,TBrOpen: {_hx_index:6,__enum__:"hscript.Token",toString:$estr}
	,TBrClose: {_hx_index:7,__enum__:"hscript.Token",toString:$estr}
	,TDot: {_hx_index:8,__enum__:"hscript.Token",toString:$estr}
	,TComma: {_hx_index:9,__enum__:"hscript.Token",toString:$estr}
	,TSemicolon: {_hx_index:10,__enum__:"hscript.Token",toString:$estr}
	,TBkOpen: {_hx_index:11,__enum__:"hscript.Token",toString:$estr}
	,TBkClose: {_hx_index:12,__enum__:"hscript.Token",toString:$estr}
	,TQuestion: {_hx_index:13,__enum__:"hscript.Token",toString:$estr}
	,TDoubleDot: {_hx_index:14,__enum__:"hscript.Token",toString:$estr}
	,TMeta: ($_=function(s) { return {_hx_index:15,s:s,__enum__:"hscript.Token",toString:$estr}; },$_.__params__ = ["s"],$_)
	,TPrepro: ($_=function(s) { return {_hx_index:16,s:s,__enum__:"hscript.Token",toString:$estr}; },$_.__params__ = ["s"],$_)
};
var hscript_Parser = function() {
	this.uid = 0;
	this.preprocesorValues = new haxe_ds_StringMap();
	this.line = 1;
	this.opChars = "+*/-=!><&|^%~";
	this.identChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";
	var priorities = [["%"],["*","/"],["+","-"],["<<",">>",">>>"],["|","&","^"],["==","!=",">","<",">=","<="],["..."],["&&"],["||"],["=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","&=","^=","=>"]];
	this.opPriority = new haxe_ds_StringMap();
	this.opRightAssoc = new haxe_ds_StringMap();
	this.unops = new haxe_ds_StringMap();
	var _g = 0;
	var _g1 = priorities.length;
	while(_g < _g1) {
		var i = _g++;
		var _g2 = 0;
		var _g3 = priorities[i];
		while(_g2 < _g3.length) {
			var x = _g3[_g2];
			++_g2;
			this.opPriority.h[x] = i;
			if(i == 9) {
				this.opRightAssoc.h[x] = true;
			}
		}
	}
	var x = "!";
	this.unops.h[x] = x == "++" || x == "--";
	var x = "++";
	this.unops.h[x] = x == "++" || x == "--";
	var x = "--";
	this.unops.h[x] = x == "++" || x == "--";
	var x = "-";
	this.unops.h[x] = x == "++" || x == "--";
	var x = "~";
	this.unops.h[x] = x == "++" || x == "--";
};
$hxClasses["hscript.Parser"] = hscript_Parser;
hscript_Parser.__name__ = "hscript.Parser";
hscript_Parser.prototype = {
	line: null
	,opChars: null
	,identChars: null
	,opPriority: null
	,opRightAssoc: null
	,unops: null
	,preprocesorValues: null
	,allowJSON: null
	,allowTypes: null
	,allowMetadata: null
	,resumeErrors: null
	,input: null
	,readPos: null
	,char: null
	,ops: null
	,idents: null
	,uid: null
	,tokens: null
	,error: function(err,pmin,pmax) {
		if(!this.resumeErrors) {
			throw haxe_Exception.thrown(err);
		}
	}
	,invalidChar: function(c) {
		if(!this.resumeErrors) {
			throw haxe_Exception.thrown(hscript_Error.EInvalidChar(c));
		}
	}
	,initParser: function(origin) {
		this.preprocStack = [];
		this.tokens = new haxe_ds_GenericStack();
		this.char = -1;
		this.ops = [];
		this.idents = [];
		this.uid = 0;
		var _g = 0;
		var _g1 = this.opChars.length;
		while(_g < _g1) {
			var i = _g++;
			this.ops[HxOverrides.cca(this.opChars,i)] = true;
		}
		var _g = 0;
		var _g1 = this.identChars.length;
		while(_g < _g1) {
			var i = _g++;
			this.idents[HxOverrides.cca(this.identChars,i)] = true;
		}
	}
	,parseString: function(s,origin) {
		if(origin == null) {
			origin = "hscript";
		}
		this.initParser(origin);
		this.input = s;
		this.readPos = 0;
		var a = [];
		while(true) {
			var tk = this.token();
			if(tk == hscript_Token.TEof) {
				break;
			}
			var _this = this.tokens;
			_this.head = new haxe_ds_GenericCell(tk,_this.head);
			this.parseFullExpr(a);
		}
		if(a.length == 1) {
			return a[0];
		} else {
			return hscript_Expr.EBlock(a);
		}
	}
	,unexpected: function(tk) {
		var err = hscript_Error.EUnexpected(this.tokenString(tk));
		if(!this.resumeErrors) {
			throw haxe_Exception.thrown(err);
		}
		return null;
	}
	,push: function(tk) {
		var _this = this.tokens;
		_this.head = new haxe_ds_GenericCell(tk,_this.head);
	}
	,ensure: function(tk) {
		var t = this.token();
		if(t != tk) {
			this.unexpected(t);
		}
	}
	,ensureToken: function(tk) {
		var t = this.token();
		if(!Type.enumEq(t,tk)) {
			this.unexpected(t);
		}
	}
	,maybe: function(tk) {
		var t = this.token();
		if(Type.enumEq(t,tk)) {
			return true;
		}
		var _this = this.tokens;
		_this.head = new haxe_ds_GenericCell(t,_this.head);
		return false;
	}
	,getIdent: function() {
		var tk = this.token();
		if(tk == null) {
			this.unexpected(tk);
			return null;
		} else if(tk._hx_index == 2) {
			var id = tk.s;
			return id;
		} else {
			this.unexpected(tk);
			return null;
		}
	}
	,expr: function(e) {
		return e;
	}
	,pmin: function(e) {
		return 0;
	}
	,pmax: function(e) {
		return 0;
	}
	,mk: function(e,pmin,pmax) {
		return e;
	}
	,isBlock: function(e) {
		if(e == null) {
			return false;
		}
		switch(e._hx_index) {
		case 2:
			var _g = e.n;
			var e1 = e.e;
			var t = e.t;
			if(e1 != null) {
				return this.isBlock(e1);
			} else if(t != null) {
				if(t == null) {
					return false;
				} else if(t._hx_index == 2) {
					var _g = t.fields;
					return true;
				} else {
					return false;
				}
			} else {
				return false;
			}
			break;
		case 4:
			var _g = e.e;
			return true;
		case 6:
			var _g = e.e1;
			var _g = e.op;
			var e1 = e.e2;
			return this.isBlock(e1);
		case 7:
			var _g = e.op;
			var e1 = e.e;
			var prefix = e.prefix;
			if(!prefix) {
				return this.isBlock(e1);
			} else {
				return false;
			}
			break;
		case 9:
			var _g = e.cond;
			var e2 = e.e2;
			var e1 = e.e1;
			if(e2 != null) {
				return this.isBlock(e2);
			} else {
				return this.isBlock(e1);
			}
			break;
		case 10:
			var _g = e.cond;
			var e1 = e.e;
			return this.isBlock(e1);
		case 11:
			var _g = e.it;
			var _g = e.v;
			var e1 = e.e;
			return this.isBlock(e1);
		case 14:
			var _g = e.ret;
			var _g = e.name;
			var _g = e.args;
			var e1 = e.e;
			return this.isBlock(e1);
		case 15:
			var e1 = e.e;
			if(e1 != null) {
				return this.isBlock(e1);
			} else {
				return false;
			}
			break;
		case 20:
			var _g = e.t;
			var _g = e.v;
			var _g = e.e;
			var e1 = e.ecatch;
			return this.isBlock(e1);
		case 21:
			var _g = e.fl;
			return true;
		case 23:
			var _g = e.defaultExpr;
			var _g = e.cases;
			var _g = e.e;
			return true;
		case 24:
			var _g = e.cond;
			var e1 = e.e;
			return this.isBlock(e1);
		case 25:
			var _g = e.args;
			var _g = e.name;
			var e1 = e.e;
			return this.isBlock(e1);
		default:
			return false;
		}
	}
	,parseFullExpr: function(exprs) {
		var e = this.parseExpr();
		exprs.push(e);
		var tk = this.token();
		while(true) {
			var tmp;
			if(tk == hscript_Token.TComma && e != null) {
				if(e._hx_index == 2) {
					var _g = e.e;
					var _g1 = e.t;
					var _g2 = e.n;
					tmp = true;
				} else {
					tmp = false;
				}
			} else {
				tmp = false;
			}
			if(!tmp) {
				break;
			}
			e = this.parseStructure("var");
			exprs.push(e);
			tk = this.token();
		}
		if(tk != hscript_Token.TSemicolon && tk != hscript_Token.TEof) {
			if(this.isBlock(e)) {
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(tk,_this.head);
			} else {
				this.unexpected(tk);
			}
		}
	}
	,parseObject: function(p1) {
		var fl = [];
		_hx_loop1: while(true) {
			var tk = this.token();
			var id = null;
			if(tk == null) {
				this.unexpected(tk);
				break;
			} else {
				switch(tk._hx_index) {
				case 1:
					var c = tk.c;
					if(!this.allowJSON) {
						this.unexpected(tk);
					}
					if(c._hx_index == 2) {
						var s = c.s;
						id = s;
					} else {
						this.unexpected(tk);
					}
					break;
				case 2:
					var i = tk.s;
					id = i;
					break;
				case 7:
					break _hx_loop1;
				default:
					this.unexpected(tk);
					break _hx_loop1;
				}
			}
			var t = this.token();
			if(t != hscript_Token.TDoubleDot) {
				this.unexpected(t);
			}
			fl.push({ name : id, e : this.parseExpr()});
			tk = this.token();
			if(tk == null) {
				this.unexpected(tk);
			} else {
				switch(tk._hx_index) {
				case 7:
					break _hx_loop1;
				case 9:
					break;
				default:
					this.unexpected(tk);
				}
			}
		}
		return this.parseExprNext(hscript_Expr.EObject(fl));
	}
	,parseExpr: function() {
		var tk = this.token();
		if(tk == null) {
			return this.unexpected(tk);
		} else {
			switch(tk._hx_index) {
			case 1:
				var c = tk.c;
				return this.parseExprNext(hscript_Expr.EConst(c));
			case 2:
				var id = tk.s;
				var e = this.parseStructure(id);
				if(e == null) {
					e = hscript_Expr.EIdent(id);
				}
				return this.parseExprNext(e);
			case 3:
				var op = tk.s;
				if(Object.prototype.hasOwnProperty.call(this.unops.h,op)) {
					var start = 0;
					var e = this.parseExpr();
					if(op == "-" && e != null) {
						if(e._hx_index == 0) {
							var _g = e.c;
							switch(_g._hx_index) {
							case 0:
								var i = _g.v;
								return hscript_Expr.EConst(hscript_Const.CInt(-i));
							case 1:
								var f = _g.f;
								return hscript_Expr.EConst(hscript_Const.CFloat(-f));
							default:
							}
						}
					}
					return this.makeUnop(op,e);
				}
				return this.unexpected(tk);
			case 4:
				var e = this.parseExpr();
				tk = this.token();
				if(tk != null) {
					switch(tk._hx_index) {
					case 5:
						return this.parseExprNext(hscript_Expr.EParent(e));
					case 9:
						if(e._hx_index == 1) {
							var v = e.v;
							return this.parseLambda([{ name : v}],0);
						}
						break;
					case 14:
						var t = this.parseType();
						tk = this.token();
						if(tk != null) {
							switch(tk._hx_index) {
							case 5:
								return this.parseExprNext(hscript_Expr.ECheckType(e,t));
							case 9:
								if(e._hx_index == 1) {
									var v = e.v;
									return this.parseLambda([{ name : v, t : t}],0);
								}
								break;
							default:
							}
						}
						break;
					default:
					}
				}
				return this.unexpected(tk);
			case 6:
				tk = this.token();
				if(tk == null) {
					var _this = this.tokens;
					_this.head = new haxe_ds_GenericCell(tk,_this.head);
				} else {
					switch(tk._hx_index) {
					case 1:
						var c = tk.c;
						if(this.allowJSON) {
							if(c._hx_index == 2) {
								var _g = c.s;
								var tk2 = this.token();
								var _this = this.tokens;
								_this.head = new haxe_ds_GenericCell(tk2,_this.head);
								var _this = this.tokens;
								_this.head = new haxe_ds_GenericCell(tk,_this.head);
								if(tk2 != null) {
									if(tk2._hx_index == 14) {
										return this.parseExprNext(this.parseObject(0));
									}
								}
							} else {
								var _this = this.tokens;
								_this.head = new haxe_ds_GenericCell(tk,_this.head);
							}
						} else {
							var _this = this.tokens;
							_this.head = new haxe_ds_GenericCell(tk,_this.head);
						}
						break;
					case 2:
						var _g = tk.s;
						var tk2 = this.token();
						var _this = this.tokens;
						_this.head = new haxe_ds_GenericCell(tk2,_this.head);
						var _this = this.tokens;
						_this.head = new haxe_ds_GenericCell(tk,_this.head);
						if(tk2 != null) {
							if(tk2._hx_index == 14) {
								return this.parseExprNext(this.parseObject(0));
							}
						}
						break;
					case 7:
						return this.parseExprNext(hscript_Expr.EObject([]));
					default:
						var _this = this.tokens;
						_this.head = new haxe_ds_GenericCell(tk,_this.head);
					}
				}
				var a = [];
				while(true) {
					this.parseFullExpr(a);
					tk = this.token();
					if(tk == hscript_Token.TBrClose || this.resumeErrors && tk == hscript_Token.TEof) {
						break;
					}
					var _this = this.tokens;
					_this.head = new haxe_ds_GenericCell(tk,_this.head);
				}
				return hscript_Expr.EBlock(a);
			case 11:
				var a = [];
				tk = this.token();
				while(tk != hscript_Token.TBkClose && (!this.resumeErrors || tk != hscript_Token.TEof)) {
					var _this = this.tokens;
					_this.head = new haxe_ds_GenericCell(tk,_this.head);
					a.push(this.parseExpr());
					tk = this.token();
					if(tk == hscript_Token.TComma) {
						tk = this.token();
					}
				}
				if(a.length == 1 && a[0] != null) {
					var _g = a[0];
					switch(_g._hx_index) {
					case 10:
						var _g1 = _g.e;
						var _g1 = _g.cond;
						var tmp = "__a_" + this.uid++;
						var e = hscript_Expr.EBlock([hscript_Expr.EVar(tmp,null,hscript_Expr.EArrayDecl([])),this.mapCompr(tmp,a[0]),hscript_Expr.EIdent(tmp)]);
						return this.parseExprNext(e);
					case 11:
						var _g1 = _g.e;
						var _g1 = _g.it;
						var _g1 = _g.v;
						var tmp = "__a_" + this.uid++;
						var e = hscript_Expr.EBlock([hscript_Expr.EVar(tmp,null,hscript_Expr.EArrayDecl([])),this.mapCompr(tmp,a[0]),hscript_Expr.EIdent(tmp)]);
						return this.parseExprNext(e);
					case 24:
						var _g1 = _g.e;
						var _g1 = _g.cond;
						var tmp = "__a_" + this.uid++;
						var e = hscript_Expr.EBlock([hscript_Expr.EVar(tmp,null,hscript_Expr.EArrayDecl([])),this.mapCompr(tmp,a[0]),hscript_Expr.EIdent(tmp)]);
						return this.parseExprNext(e);
					default:
					}
				}
				return this.parseExprNext(hscript_Expr.EArrayDecl(a));
			case 15:
				var id = tk.s;
				if(this.allowMetadata) {
					var args = this.parseMetaArgs();
					return hscript_Expr.EMeta(id,args,this.parseExpr());
				} else {
					return this.unexpected(tk);
				}
				break;
			default:
				return this.unexpected(tk);
			}
		}
	}
	,parseLambda: function(args,pmin) {
		_hx_loop1: while(true) {
			var id = this.getIdent();
			var t = this.maybe(hscript_Token.TDoubleDot) ? this.parseType() : null;
			args.push({ name : id, t : t});
			var tk = this.token();
			if(tk == null) {
				this.unexpected(tk);
				break;
			} else {
				switch(tk._hx_index) {
				case 5:
					break _hx_loop1;
				case 9:
					break;
				default:
					this.unexpected(tk);
					break _hx_loop1;
				}
			}
		}
		var t = this.token();
		if(!Type.enumEq(t,hscript_Token.TOp("->"))) {
			this.unexpected(t);
		}
		var eret = this.parseExpr();
		return hscript_Expr.EFunction(args,hscript_Expr.EReturn(eret));
	}
	,parseMetaArgs: function() {
		var tk = this.token();
		if(tk != hscript_Token.TPOpen) {
			var _this = this.tokens;
			_this.head = new haxe_ds_GenericCell(tk,_this.head);
			return null;
		}
		var args = [];
		tk = this.token();
		if(tk != hscript_Token.TPClose) {
			var _this = this.tokens;
			_this.head = new haxe_ds_GenericCell(tk,_this.head);
			_hx_loop1: while(true) {
				args.push(this.parseExpr());
				var _g = this.token();
				if(_g == null) {
					var tk = _g;
					this.unexpected(tk);
				} else {
					switch(_g._hx_index) {
					case 5:
						break _hx_loop1;
					case 9:
						break;
					default:
						var tk1 = _g;
						this.unexpected(tk1);
					}
				}
			}
		}
		return args;
	}
	,mapCompr: function(tmp,e) {
		if(e == null) {
			return null;
		}
		var edef;
		switch(e._hx_index) {
		case 3:
			var e2 = e.e;
			edef = hscript_Expr.EParent(this.mapCompr(tmp,e2));
			break;
		case 4:
			var _g = e.e;
			if(_g.length == 1) {
				var e1 = _g[0];
				edef = hscript_Expr.EBlock([this.mapCompr(tmp,e1)]);
			} else {
				edef = hscript_Expr.ECall(hscript_Expr.EField(hscript_Expr.EIdent(tmp),"push"),[e]);
			}
			break;
		case 9:
			var e2 = e.e2;
			var e1 = e.e1;
			var cond = e.cond;
			edef = e2 == null ? hscript_Expr.EIf(cond,this.mapCompr(tmp,e1),null) : hscript_Expr.ECall(hscript_Expr.EField(hscript_Expr.EIdent(tmp),"push"),[e]);
			break;
		case 10:
			var e2 = e.e;
			var cond = e.cond;
			edef = hscript_Expr.EWhile(cond,this.mapCompr(tmp,e2));
			break;
		case 11:
			var e2 = e.e;
			var it = e.it;
			var v = e.v;
			edef = hscript_Expr.EFor(v,it,this.mapCompr(tmp,e2));
			break;
		case 24:
			var e2 = e.e;
			var cond = e.cond;
			edef = hscript_Expr.EDoWhile(cond,this.mapCompr(tmp,e2));
			break;
		default:
			edef = hscript_Expr.ECall(hscript_Expr.EField(hscript_Expr.EIdent(tmp),"push"),[e]);
		}
		return edef;
	}
	,makeUnop: function(op,e) {
		if(e == null && this.resumeErrors) {
			return null;
		}
		switch(e._hx_index) {
		case 6:
			var e2 = e.e2;
			var e1 = e.e1;
			var bop = e.op;
			return hscript_Expr.EBinop(bop,this.makeUnop(op,e1),e2);
		case 22:
			var e3 = e.e2;
			var e2 = e.e1;
			var e1 = e.cond;
			return hscript_Expr.ETernary(this.makeUnop(op,e1),e2,e3);
		default:
			return hscript_Expr.EUnop(op,true,e);
		}
	}
	,makeBinop: function(op,e1,e) {
		if(e == null && this.resumeErrors) {
			return hscript_Expr.EBinop(op,e1,e);
		}
		switch(e._hx_index) {
		case 6:
			var e3 = e.e2;
			var e2 = e.e1;
			var op2 = e.op;
			if(this.opPriority.h[op] <= this.opPriority.h[op2] && !Object.prototype.hasOwnProperty.call(this.opRightAssoc.h,op)) {
				return hscript_Expr.EBinop(op2,this.makeBinop(op,e1,e2),e3);
			} else {
				return hscript_Expr.EBinop(op,e1,e);
			}
			break;
		case 22:
			var e4 = e.e2;
			var e3 = e.e1;
			var e2 = e.cond;
			if(Object.prototype.hasOwnProperty.call(this.opRightAssoc.h,op)) {
				return hscript_Expr.EBinop(op,e1,e);
			} else {
				return hscript_Expr.ETernary(this.makeBinop(op,e1,e2),e3,e4);
			}
			break;
		default:
			return hscript_Expr.EBinop(op,e1,e);
		}
	}
	,parseStructure: function(id) {
		switch(id) {
		case "break":
			return hscript_Expr.EBreak;
		case "continue":
			return hscript_Expr.EContinue;
		case "do":
			var e = this.parseExpr();
			var tk = this.token();
			if(tk == null) {
				this.unexpected(tk);
			} else if(tk._hx_index == 2) {
				if(tk.s != "while") {
					this.unexpected(tk);
				}
			} else {
				this.unexpected(tk);
			}
			var econd = this.parseExpr();
			return hscript_Expr.EDoWhile(econd,e);
		case "else":
			return this.unexpected(hscript_Token.TId(id));
		case "for":
			var t = this.token();
			if(t != hscript_Token.TPOpen) {
				this.unexpected(t);
			}
			var vname = this.getIdent();
			var t = this.token();
			if(!Type.enumEq(t,hscript_Token.TId("in"))) {
				this.unexpected(t);
			}
			var eiter = this.parseExpr();
			var t = this.token();
			if(t != hscript_Token.TPClose) {
				this.unexpected(t);
			}
			var e = this.parseExpr();
			return hscript_Expr.EFor(vname,eiter,e);
		case "function":
			var tk = this.token();
			var name = null;
			if(tk == null) {
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(tk,_this.head);
			} else if(tk._hx_index == 2) {
				var id = tk.s;
				name = id;
			} else {
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(tk,_this.head);
			}
			var inf = this.parseFunctionDecl();
			return hscript_Expr.EFunction(inf.args,inf.body,name,inf.ret);
		case "if":
			var t = this.token();
			if(t != hscript_Token.TPOpen) {
				this.unexpected(t);
			}
			var cond = this.parseExpr();
			var t = this.token();
			if(t != hscript_Token.TPClose) {
				this.unexpected(t);
			}
			var e1 = this.parseExpr();
			var e2 = null;
			var semic = false;
			var tk = this.token();
			if(tk == hscript_Token.TSemicolon) {
				semic = true;
				tk = this.token();
			}
			if(Type.enumEq(tk,hscript_Token.TId("else"))) {
				e2 = this.parseExpr();
			} else {
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(tk,_this.head);
				if(semic) {
					var _this = this.tokens;
					_this.head = new haxe_ds_GenericCell(hscript_Token.TSemicolon,_this.head);
				}
			}
			return hscript_Expr.EIf(cond,e1,e2);
		case "inline":
			if(!this.maybe(hscript_Token.TId("function"))) {
				this.unexpected(hscript_Token.TId("inline"));
			}
			return this.parseStructure("function");
		case "new":
			var a = [];
			a.push(this.getIdent());
			_hx_loop1: while(true) {
				var tk = this.token();
				if(tk == null) {
					this.unexpected(tk);
					break;
				} else {
					switch(tk._hx_index) {
					case 4:
						break _hx_loop1;
					case 8:
						a.push(this.getIdent());
						break;
					default:
						this.unexpected(tk);
						break _hx_loop1;
					}
				}
			}
			var args = this.parseExprList(hscript_Token.TPClose);
			return hscript_Expr.ENew(a.join("."),args);
		case "return":
			var tk = this.token();
			var _this = this.tokens;
			_this.head = new haxe_ds_GenericCell(tk,_this.head);
			var e = tk == hscript_Token.TSemicolon ? null : this.parseExpr();
			return hscript_Expr.EReturn(e);
		case "switch":
			var e = this.parseExpr();
			var def = null;
			var cases = [];
			var t = this.token();
			if(t != hscript_Token.TBrOpen) {
				this.unexpected(t);
			}
			_hx_loop2: while(true) {
				var tk = this.token();
				if(tk == null) {
					this.unexpected(tk);
					break;
				} else {
					switch(tk._hx_index) {
					case 2:
						switch(tk.s) {
						case "case":
							var c = { values : [], expr : null};
							cases.push(c);
							_hx_loop3: while(true) {
								var e1 = this.parseExpr();
								c.values.push(e1);
								tk = this.token();
								if(tk == null) {
									this.unexpected(tk);
									break;
								} else {
									switch(tk._hx_index) {
									case 9:
										break;
									case 14:
										break _hx_loop3;
									default:
										this.unexpected(tk);
										break _hx_loop3;
									}
								}
							}
							var exprs = [];
							_hx_loop4: while(true) {
								tk = this.token();
								var _this = this.tokens;
								_this.head = new haxe_ds_GenericCell(tk,_this.head);
								if(tk == null) {
									this.parseFullExpr(exprs);
								} else {
									switch(tk._hx_index) {
									case 0:
										if(this.resumeErrors) {
											break _hx_loop4;
										} else {
											this.parseFullExpr(exprs);
										}
										break;
									case 2:
										switch(tk.s) {
										case "case":case "default":
											break _hx_loop4;
										default:
											this.parseFullExpr(exprs);
										}
										break;
									case 7:
										break _hx_loop4;
									default:
										this.parseFullExpr(exprs);
									}
								}
							}
							c.expr = exprs.length == 1 ? exprs[0] : exprs.length == 0 ? hscript_Expr.EBlock([]) : hscript_Expr.EBlock(exprs);
							break;
						case "default":
							if(def != null) {
								this.unexpected(tk);
							}
							var t = this.token();
							if(t != hscript_Token.TDoubleDot) {
								this.unexpected(t);
							}
							var exprs1 = [];
							_hx_loop5: while(true) {
								tk = this.token();
								var _this1 = this.tokens;
								_this1.head = new haxe_ds_GenericCell(tk,_this1.head);
								if(tk == null) {
									this.parseFullExpr(exprs1);
								} else {
									switch(tk._hx_index) {
									case 0:
										if(this.resumeErrors) {
											break _hx_loop5;
										} else {
											this.parseFullExpr(exprs1);
										}
										break;
									case 2:
										switch(tk.s) {
										case "case":case "default":
											break _hx_loop5;
										default:
											this.parseFullExpr(exprs1);
										}
										break;
									case 7:
										break _hx_loop5;
									default:
										this.parseFullExpr(exprs1);
									}
								}
							}
							def = exprs1.length == 1 ? exprs1[0] : exprs1.length == 0 ? hscript_Expr.EBlock([]) : hscript_Expr.EBlock(exprs1);
							break;
						default:
							this.unexpected(tk);
							break _hx_loop2;
						}
						break;
					case 7:
						break _hx_loop2;
					default:
						this.unexpected(tk);
						break _hx_loop2;
					}
				}
			}
			return hscript_Expr.ESwitch(e,cases,def);
		case "throw":
			var e = this.parseExpr();
			return hscript_Expr.EThrow(e);
		case "try":
			var e = this.parseExpr();
			var t = this.token();
			if(!Type.enumEq(t,hscript_Token.TId("catch"))) {
				this.unexpected(t);
			}
			var t = this.token();
			if(t != hscript_Token.TPOpen) {
				this.unexpected(t);
			}
			var vname = this.getIdent();
			var t = this.token();
			if(t != hscript_Token.TDoubleDot) {
				this.unexpected(t);
			}
			var t = null;
			if(this.allowTypes) {
				t = this.parseType();
			} else {
				var t1 = this.token();
				if(!Type.enumEq(t1,hscript_Token.TId("Dynamic"))) {
					this.unexpected(t1);
				}
			}
			var t1 = this.token();
			if(t1 != hscript_Token.TPClose) {
				this.unexpected(t1);
			}
			var ec = this.parseExpr();
			return hscript_Expr.ETry(e,vname,t,ec);
		case "var":
			var ident = this.getIdent();
			var tk = this.token();
			var t = null;
			if(tk == hscript_Token.TDoubleDot && this.allowTypes) {
				t = this.parseType();
				tk = this.token();
			}
			var e = null;
			if(Type.enumEq(tk,hscript_Token.TOp("="))) {
				e = this.parseExpr();
			} else {
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(tk,_this.head);
			}
			return hscript_Expr.EVar(ident,t,e);
		case "while":
			var econd = this.parseExpr();
			var e = this.parseExpr();
			return hscript_Expr.EWhile(econd,e);
		default:
			return null;
		}
	}
	,parseExprNext: function(e1) {
		var tk = this.token();
		if(tk == null) {
			var _this = this.tokens;
			_this.head = new haxe_ds_GenericCell(tk,_this.head);
			return e1;
		} else {
			switch(tk._hx_index) {
			case 3:
				var op = tk.s;
				if(op == "->") {
					switch(e1._hx_index) {
					case 1:
						var i = e1.v;
						var eret = this.parseExpr();
						return hscript_Expr.EFunction([{ name : i}],hscript_Expr.EReturn(eret));
					case 3:
						var _hx_tmp = e1.e;
						if(_hx_tmp._hx_index == 1) {
							var i = _hx_tmp.v;
							var eret = this.parseExpr();
							return hscript_Expr.EFunction([{ name : i}],hscript_Expr.EReturn(eret));
						}
						break;
					case 26:
						var _hx_tmp = e1.e;
						if(_hx_tmp._hx_index == 1) {
							var t = e1.t;
							var i = _hx_tmp.v;
							var eret = this.parseExpr();
							return hscript_Expr.EFunction([{ name : i, t : t}],hscript_Expr.EReturn(eret));
						}
						break;
					default:
					}
					this.unexpected(tk);
				}
				if(this.unops.h[op]) {
					var tmp;
					if(!this.isBlock(e1)) {
						if(e1._hx_index == 3) {
							var _g = e1.e;
							tmp = true;
						} else {
							tmp = false;
						}
					} else {
						tmp = true;
					}
					if(tmp) {
						var _this = this.tokens;
						_this.head = new haxe_ds_GenericCell(tk,_this.head);
						return e1;
					}
					return this.parseExprNext(hscript_Expr.EUnop(op,false,e1));
				}
				return this.makeBinop(op,e1,this.parseExpr());
			case 4:
				return this.parseExprNext(hscript_Expr.ECall(e1,this.parseExprList(hscript_Token.TPClose)));
			case 8:
				var field = this.getIdent();
				return this.parseExprNext(hscript_Expr.EField(e1,field));
			case 11:
				var e2 = this.parseExpr();
				var t = this.token();
				if(t != hscript_Token.TBkClose) {
					this.unexpected(t);
				}
				return this.parseExprNext(hscript_Expr.EArray(e1,e2));
			case 13:
				var e2 = this.parseExpr();
				var t = this.token();
				if(t != hscript_Token.TDoubleDot) {
					this.unexpected(t);
				}
				var e3 = this.parseExpr();
				return hscript_Expr.ETernary(e1,e2,e3);
			default:
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(tk,_this.head);
				return e1;
			}
		}
	}
	,parseFunctionArgs: function() {
		var args = [];
		var tk = this.token();
		if(tk != hscript_Token.TPClose) {
			var done = false;
			while(!done) {
				var name = null;
				var opt = false;
				if(tk != null) {
					if(tk._hx_index == 13) {
						opt = true;
						tk = this.token();
					}
				}
				if(tk == null) {
					this.unexpected(tk);
					break;
				} else if(tk._hx_index == 2) {
					var id = tk.s;
					name = id;
				} else {
					this.unexpected(tk);
					break;
				}
				var arg = { name : name};
				args.push(arg);
				if(opt) {
					arg.opt = true;
				}
				if(this.allowTypes) {
					if(this.maybe(hscript_Token.TDoubleDot)) {
						arg.t = this.parseType();
					}
					if(this.maybe(hscript_Token.TOp("="))) {
						arg.value = this.parseExpr();
					}
				}
				tk = this.token();
				if(tk == null) {
					this.unexpected(tk);
				} else {
					switch(tk._hx_index) {
					case 5:
						done = true;
						break;
					case 9:
						tk = this.token();
						break;
					default:
						this.unexpected(tk);
					}
				}
			}
		}
		return args;
	}
	,parseFunctionDecl: function() {
		var t = this.token();
		if(t != hscript_Token.TPOpen) {
			this.unexpected(t);
		}
		var args = this.parseFunctionArgs();
		var ret = null;
		if(this.allowTypes) {
			var tk = this.token();
			if(tk != hscript_Token.TDoubleDot) {
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(tk,_this.head);
			} else {
				ret = this.parseType();
			}
		}
		return { args : args, ret : ret, body : this.parseExpr()};
	}
	,parsePath: function() {
		var path = [this.getIdent()];
		while(true) {
			var t = this.token();
			if(t != hscript_Token.TDot) {
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(t,_this.head);
				break;
			}
			path.push(this.getIdent());
		}
		return path;
	}
	,parseType: function() {
		var _gthis = this;
		var t = this.token();
		if(t == null) {
			return this.unexpected(t);
		} else {
			switch(t._hx_index) {
			case 2:
				var v = t.s;
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(t,_this.head);
				var path = this.parsePath();
				var params = null;
				t = this.token();
				if(t == null) {
					var _this = this.tokens;
					_this.head = new haxe_ds_GenericCell(t,_this.head);
				} else if(t._hx_index == 3) {
					var op = t.s;
					if(op == "<") {
						params = [];
						_hx_loop1: while(true) {
							params.push(this.parseType());
							t = this.token();
							if(t != null) {
								switch(t._hx_index) {
								case 3:
									var op = t.s;
									if(op == ">") {
										break _hx_loop1;
									}
									if(HxOverrides.cca(op,0) == 62) {
										var _this = this.tokens;
										_this.head = new haxe_ds_GenericCell(hscript_Token.TOp(HxOverrides.substr(op,1,null)),_this.head);
										break _hx_loop1;
									}
									break;
								case 9:
									continue;
								default:
								}
							}
							this.unexpected(t);
							break;
						}
					} else {
						var _this = this.tokens;
						_this.head = new haxe_ds_GenericCell(t,_this.head);
					}
				} else {
					var _this = this.tokens;
					_this.head = new haxe_ds_GenericCell(t,_this.head);
				}
				return this.parseTypeNext(hscript_CType.CTPath(path,params));
			case 4:
				var a = this.token();
				var b = this.token();
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(b,_this.head);
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(a,_this.head);
				var withReturn = function(args) {
					var _g = _gthis.token();
					if(_g == null) {
						var t = _g;
						_gthis.unexpected(t);
					} else if(_g._hx_index == 3) {
						if(_g.s != "->") {
							var t = _g;
							_gthis.unexpected(t);
						}
					} else {
						var t = _g;
						_gthis.unexpected(t);
					}
					return hscript_CType.CTFun(args,_gthis.parseType());
				};
				if(a == null) {
					var t1 = this.parseType();
					var _g = this.token();
					if(_g == null) {
						var t2 = _g;
						return this.unexpected(t2);
					} else {
						switch(_g._hx_index) {
						case 5:
							return this.parseTypeNext(hscript_CType.CTParent(t1));
						case 9:
							var args = [t1];
							while(true) {
								args.push(this.parseType());
								if(!this.maybe(hscript_Token.TComma)) {
									break;
								}
							}
							var t1 = this.token();
							if(t1 != hscript_Token.TPClose) {
								this.unexpected(t1);
							}
							return withReturn(args);
						default:
							var t1 = _g;
							return this.unexpected(t1);
						}
					}
				} else {
					switch(a._hx_index) {
					case 2:
						var _g = a.s;
						if(b == null) {
							var t1 = this.parseType();
							var _g = this.token();
							if(_g == null) {
								var t2 = _g;
								return this.unexpected(t2);
							} else {
								switch(_g._hx_index) {
								case 5:
									return this.parseTypeNext(hscript_CType.CTParent(t1));
								case 9:
									var args = [t1];
									while(true) {
										args.push(this.parseType());
										if(!this.maybe(hscript_Token.TComma)) {
											break;
										}
									}
									var t1 = this.token();
									if(t1 != hscript_Token.TPClose) {
										this.unexpected(t1);
									}
									return withReturn(args);
								default:
									var t1 = _g;
									return this.unexpected(t1);
								}
							}
						} else if(b._hx_index == 14) {
							var _g = [];
							var _g1 = 0;
							var _g2 = this.parseFunctionArgs();
							while(_g1 < _g2.length) {
								var arg = _g2[_g1];
								++_g1;
								var _g3 = arg.value;
								if(_g3 != null) {
									var v = _g3;
									if(!this.resumeErrors) {
										throw haxe_Exception.thrown(hscript_Error.ECustom("Default values not allowed in function types"));
									}
								}
								_g.push(hscript_CType.CTNamed(arg.name,arg.opt ? hscript_CType.CTOpt(arg.t) : arg.t));
							}
							var args = _g;
							return withReturn(args);
						} else {
							var t1 = this.parseType();
							var _g = this.token();
							if(_g == null) {
								var t2 = _g;
								return this.unexpected(t2);
							} else {
								switch(_g._hx_index) {
								case 5:
									return this.parseTypeNext(hscript_CType.CTParent(t1));
								case 9:
									var args = [t1];
									while(true) {
										args.push(this.parseType());
										if(!this.maybe(hscript_Token.TComma)) {
											break;
										}
									}
									var t1 = this.token();
									if(t1 != hscript_Token.TPClose) {
										this.unexpected(t1);
									}
									return withReturn(args);
								default:
									var t1 = _g;
									return this.unexpected(t1);
								}
							}
						}
						break;
					case 5:
						var _g = [];
						var _g1 = 0;
						var _g2 = this.parseFunctionArgs();
						while(_g1 < _g2.length) {
							var arg = _g2[_g1];
							++_g1;
							var _g3 = arg.value;
							if(_g3 != null) {
								var v = _g3;
								if(!this.resumeErrors) {
									throw haxe_Exception.thrown(hscript_Error.ECustom("Default values not allowed in function types"));
								}
							}
							_g.push(hscript_CType.CTNamed(arg.name,arg.opt ? hscript_CType.CTOpt(arg.t) : arg.t));
						}
						var args = _g;
						return withReturn(args);
					default:
						var t1 = this.parseType();
						var _g = this.token();
						if(_g == null) {
							var t2 = _g;
							return this.unexpected(t2);
						} else {
							switch(_g._hx_index) {
							case 5:
								return this.parseTypeNext(hscript_CType.CTParent(t1));
							case 9:
								var args = [t1];
								while(true) {
									args.push(this.parseType());
									if(!this.maybe(hscript_Token.TComma)) {
										break;
									}
								}
								var t1 = this.token();
								if(t1 != hscript_Token.TPClose) {
									this.unexpected(t1);
								}
								return withReturn(args);
							default:
								var t1 = _g;
								return this.unexpected(t1);
							}
						}
					}
				}
				break;
			case 6:
				var fields = [];
				var meta = null;
				_hx_loop8: while(true) {
					t = this.token();
					if(t == null) {
						this.unexpected(t);
						break;
					} else {
						switch(t._hx_index) {
						case 2:
							var _g = t.s;
							if(_g == "var") {
								var name = this.getIdent();
								var t1 = this.token();
								if(t1 != hscript_Token.TDoubleDot) {
									this.unexpected(t1);
								}
								fields.push({ name : name, t : this.parseType(), meta : meta});
								meta = null;
								var t2 = this.token();
								if(t2 != hscript_Token.TSemicolon) {
									this.unexpected(t2);
								}
							} else {
								var name1 = _g;
								var t3 = this.token();
								if(t3 != hscript_Token.TDoubleDot) {
									this.unexpected(t3);
								}
								fields.push({ name : name1, t : this.parseType(), meta : meta});
								t = this.token();
								if(t == null) {
									this.unexpected(t);
								} else {
									switch(t._hx_index) {
									case 7:
										break _hx_loop8;
									case 9:
										break;
									default:
										this.unexpected(t);
									}
								}
							}
							break;
						case 7:
							break _hx_loop8;
						case 15:
							var name2 = t.s;
							if(meta == null) {
								meta = [];
							}
							meta.push({ name : name2, params : this.parseMetaArgs()});
							break;
						default:
							this.unexpected(t);
							break _hx_loop8;
						}
					}
				}
				return this.parseTypeNext(hscript_CType.CTAnon(fields));
			default:
				return this.unexpected(t);
			}
		}
	}
	,parseTypeNext: function(t) {
		var tk = this.token();
		if(tk == null) {
			var _this = this.tokens;
			_this.head = new haxe_ds_GenericCell(tk,_this.head);
			return t;
		} else if(tk._hx_index == 3) {
			var op = tk.s;
			if(op != "->") {
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(tk,_this.head);
				return t;
			}
		} else {
			var _this = this.tokens;
			_this.head = new haxe_ds_GenericCell(tk,_this.head);
			return t;
		}
		var t2 = this.parseType();
		if(t2._hx_index == 1) {
			var _g = t2.ret;
			var args = t2.args;
			args.unshift(t);
			return t2;
		} else {
			return hscript_CType.CTFun([t],t2);
		}
	}
	,parseExprList: function(etk) {
		var args = [];
		var tk = this.token();
		if(tk == etk) {
			return args;
		}
		var _this = this.tokens;
		_this.head = new haxe_ds_GenericCell(tk,_this.head);
		while(true) {
			args.push(this.parseExpr());
			tk = this.token();
			if(tk == null) {
				if(tk == etk) {
					break;
				}
				this.unexpected(tk);
				break;
			} else if(tk._hx_index != 9) {
				if(tk == etk) {
					break;
				}
				this.unexpected(tk);
				break;
			}
		}
		return args;
	}
	,parseModule: function(content,origin) {
		if(origin == null) {
			origin = "hscript";
		}
		this.initParser(origin);
		this.input = content;
		this.readPos = 0;
		this.allowTypes = true;
		this.allowMetadata = true;
		var decls = [];
		while(true) {
			var tk = this.token();
			if(tk == hscript_Token.TEof) {
				break;
			}
			var _this = this.tokens;
			_this.head = new haxe_ds_GenericCell(tk,_this.head);
			decls.push(this.parseModuleDecl());
		}
		return decls;
	}
	,parseMetadata: function() {
		var meta = [];
		while(true) {
			var tk = this.token();
			if(tk == null) {
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(tk,_this.head);
				break;
			} else if(tk._hx_index == 15) {
				var name = tk.s;
				meta.push({ name : name, params : this.parseMetaArgs()});
			} else {
				var _this1 = this.tokens;
				_this1.head = new haxe_ds_GenericCell(tk,_this1.head);
				break;
			}
		}
		return meta;
	}
	,parseParams: function() {
		if(this.maybe(hscript_Token.TOp("<"))) {
			if(!this.resumeErrors) {
				throw haxe_Exception.thrown(hscript_Error.EInvalidOp("Unsupported class type parameters"));
			}
		}
		return { };
	}
	,parseModuleDecl: function() {
		var meta = this.parseMetadata();
		var ident = this.getIdent();
		var isPrivate = false;
		var isExtern = false;
		_hx_loop1: while(true) {
			switch(ident) {
			case "extern":
				isExtern = true;
				break;
			case "private":
				isPrivate = true;
				break;
			default:
				break _hx_loop1;
			}
			ident = this.getIdent();
		}
		switch(ident) {
		case "class":
			var name = this.getIdent();
			var params = this.parseParams();
			var extend = null;
			var implement = [];
			_hx_loop2: while(true) {
				var t = this.token();
				if(t == null) {
					var _this = this.tokens;
					_this.head = new haxe_ds_GenericCell(t,_this.head);
					break;
				} else if(t._hx_index == 2) {
					switch(t.s) {
					case "extends":
						extend = this.parseType();
						break;
					case "implements":
						implement.push(this.parseType());
						break;
					default:
						var _this1 = this.tokens;
						_this1.head = new haxe_ds_GenericCell(t,_this1.head);
						break _hx_loop2;
					}
				} else {
					var _this2 = this.tokens;
					_this2.head = new haxe_ds_GenericCell(t,_this2.head);
					break;
				}
			}
			var fields = [];
			var t = this.token();
			if(t != hscript_Token.TBrOpen) {
				this.unexpected(t);
			}
			while(!this.maybe(hscript_Token.TBrClose)) fields.push(this.parseField());
			return hscript_ModuleDecl.DClass({ name : name, meta : meta, params : params, extend : extend, implement : implement, fields : fields, isPrivate : isPrivate, isExtern : isExtern});
		case "import":
			var path = [this.getIdent()];
			var star = false;
			while(true) {
				var t = this.token();
				if(t != hscript_Token.TDot) {
					var _this = this.tokens;
					_this.head = new haxe_ds_GenericCell(t,_this.head);
					break;
				}
				t = this.token();
				if(t == null) {
					this.unexpected(t);
				} else {
					switch(t._hx_index) {
					case 2:
						var id = t.s;
						path.push(id);
						break;
					case 3:
						if(t.s == "*") {
							star = true;
						} else {
							this.unexpected(t);
						}
						break;
					default:
						this.unexpected(t);
					}
				}
			}
			var t = this.token();
			if(t != hscript_Token.TSemicolon) {
				this.unexpected(t);
			}
			return hscript_ModuleDecl.DImport(path,star);
		case "package":
			var path = this.parsePath();
			var t = this.token();
			if(t != hscript_Token.TSemicolon) {
				this.unexpected(t);
			}
			return hscript_ModuleDecl.DPackage(path);
		case "typedef":
			var name = this.getIdent();
			var params = this.parseParams();
			var t = this.token();
			if(!Type.enumEq(t,hscript_Token.TOp("="))) {
				this.unexpected(t);
			}
			var t = this.parseType();
			return hscript_ModuleDecl.DTypedef({ name : name, meta : meta, params : params, isPrivate : isPrivate, t : t});
		default:
			this.unexpected(hscript_Token.TId(ident));
		}
		return null;
	}
	,parseField: function() {
		var meta = this.parseMetadata();
		var access = [];
		_hx_loop1: while(true) {
			var id = this.getIdent();
			switch(id) {
			case "function":
				var name = this.getIdent();
				var inf = this.parseFunctionDecl();
				return { name : name, meta : meta, access : access, kind : hscript_FieldKind.KFunction({ args : inf.args, expr : inf.body, ret : inf.ret})};
			case "inline":
				access.push(hscript_FieldAccess.AInline);
				break;
			case "macro":
				access.push(hscript_FieldAccess.AMacro);
				break;
			case "override":
				access.push(hscript_FieldAccess.AOverride);
				break;
			case "private":
				access.push(hscript_FieldAccess.APrivate);
				break;
			case "public":
				access.push(hscript_FieldAccess.APublic);
				break;
			case "static":
				access.push(hscript_FieldAccess.AStatic);
				break;
			case "var":
				var name1 = this.getIdent();
				var get = null;
				var set = null;
				if(this.maybe(hscript_Token.TPOpen)) {
					get = this.getIdent();
					var t = this.token();
					if(t != hscript_Token.TComma) {
						this.unexpected(t);
					}
					set = this.getIdent();
					var t1 = this.token();
					if(t1 != hscript_Token.TPClose) {
						this.unexpected(t1);
					}
				}
				var type = this.maybe(hscript_Token.TDoubleDot) ? this.parseType() : null;
				var expr = this.maybe(hscript_Token.TOp("=")) ? this.parseExpr() : null;
				if(expr != null) {
					if(this.isBlock(expr)) {
						this.maybe(hscript_Token.TSemicolon);
					} else {
						var t2 = this.token();
						if(t2 != hscript_Token.TSemicolon) {
							this.unexpected(t2);
						}
					}
				} else {
					var tmp;
					if(type != null) {
						if(type == null) {
							tmp = false;
						} else if(type._hx_index == 2) {
							var _g = type.fields;
							tmp = true;
						} else {
							tmp = false;
						}
					} else {
						tmp = false;
					}
					if(tmp) {
						this.maybe(hscript_Token.TSemicolon);
					} else {
						var t3 = this.token();
						if(t3 != hscript_Token.TSemicolon) {
							this.unexpected(t3);
						}
					}
				}
				return { name : name1, meta : meta, access : access, kind : hscript_FieldKind.KVar({ get : get, set : set, type : type, expr : expr})};
			default:
				this.unexpected(hscript_Token.TId(id));
				break _hx_loop1;
			}
		}
		return null;
	}
	,readChar: function() {
		return this.input.charCodeAt(this.readPos++);
	}
	,readString: function(until) {
		var c = 0;
		var b_b = "";
		var esc = false;
		var old = this.line;
		var s = this.input;
		while(true) {
			var c = this.input.charCodeAt(this.readPos++);
			if(c != c) {
				this.line = old;
				if(!this.resumeErrors) {
					throw haxe_Exception.thrown(hscript_Error.EUnterminatedString);
				}
				break;
			}
			if(esc) {
				esc = false;
				switch(c) {
				case 34:case 39:case 92:
					b_b += String.fromCodePoint(c);
					break;
				case 47:
					if(this.allowJSON) {
						b_b += String.fromCodePoint(c);
					} else {
						this.invalidChar(c);
					}
					break;
				case 110:
					b_b += String.fromCodePoint(10);
					break;
				case 114:
					b_b += String.fromCodePoint(13);
					break;
				case 116:
					b_b += String.fromCodePoint(9);
					break;
				case 117:
					if(!this.allowJSON) {
						this.invalidChar(c);
					}
					var k = 0;
					var _g = 0;
					while(_g < 4) {
						var i = _g++;
						k <<= 4;
						var char = this.input.charCodeAt(this.readPos++);
						switch(char) {
						case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:
							k += char - 48;
							break;
						case 65:case 66:case 67:case 68:case 69:case 70:
							k += char - 55;
							break;
						case 97:case 98:case 99:case 100:case 101:case 102:
							k += char - 87;
							break;
						default:
							if(char != char) {
								this.line = old;
								if(!this.resumeErrors) {
									throw haxe_Exception.thrown(hscript_Error.EUnterminatedString);
								}
							}
							this.invalidChar(char);
						}
					}
					b_b += String.fromCodePoint(k);
					break;
				default:
					this.invalidChar(c);
				}
			} else if(c == 92) {
				esc = true;
			} else if(c == until) {
				break;
			} else {
				if(c == 10) {
					this.line++;
				}
				b_b += String.fromCodePoint(c);
			}
		}
		return b_b;
	}
	,token: function() {
		if(this.tokens.head != null) {
			var _this = this.tokens;
			var k = _this.head;
			if(k == null) {
				return null;
			} else {
				_this.head = k.next;
				return k.elt;
			}
		}
		var char;
		if(this.char < 0) {
			char = this.input.charCodeAt(this.readPos++);
		} else {
			char = this.char;
			this.char = -1;
		}
		while(true) {
			if(char != char) {
				this.char = char;
				return hscript_Token.TEof;
			}
			switch(char) {
			case 0:
				return hscript_Token.TEof;
			case 10:
				this.line++;
				break;
			case 9:case 13:case 32:
				break;
			case 35:
				char = this.input.charCodeAt(this.readPos++);
				if(this.idents[char]) {
					var id = String.fromCodePoint(char);
					while(true) {
						char = this.input.charCodeAt(this.readPos++);
						if(!this.idents[char]) {
							this.char = char;
							return this.preprocess(id);
						}
						id += String.fromCodePoint(char);
					}
				}
				this.invalidChar(char);
				break;
			case 34:case 39:
				return hscript_Token.TConst(hscript_Const.CString(this.readString(char)));
			case 40:
				return hscript_Token.TPOpen;
			case 41:
				return hscript_Token.TPClose;
			case 44:
				return hscript_Token.TComma;
			case 46:
				char = this.input.charCodeAt(this.readPos++);
				switch(char) {
				case 46:
					char = this.input.charCodeAt(this.readPos++);
					if(char != 46) {
						this.invalidChar(char);
					}
					return hscript_Token.TOp("...");
				case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:
					var n = char - 48;
					var exp = 1;
					while(true) {
						char = this.input.charCodeAt(this.readPos++);
						exp *= 10;
						switch(char) {
						case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:
							n = n * 10 + (char - 48);
							break;
						default:
							this.char = char;
							return hscript_Token.TConst(hscript_Const.CFloat(n / exp));
						}
					}
					break;
				default:
					this.char = char;
					return hscript_Token.TDot;
				}
				break;
			case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:
				var n1 = (char - 48) * 1.0;
				var exp1 = 0.;
				while(true) {
					char = this.input.charCodeAt(this.readPos++);
					exp1 *= 10;
					switch(char) {
					case 46:
						if(exp1 > 0) {
							if(exp1 == 10 && this.input.charCodeAt(this.readPos++) == 46) {
								var _this = this.tokens;
								_this.head = new haxe_ds_GenericCell(hscript_Token.TOp("..."),_this.head);
								var i = n1 | 0;
								return hscript_Token.TConst(i == n1 ? hscript_Const.CInt(i) : hscript_Const.CFloat(n1));
							}
							this.invalidChar(char);
						}
						exp1 = 1.;
						break;
					case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:
						n1 = n1 * 10 + (char - 48);
						break;
					case 69:case 101:
						var tk = this.token();
						var pow = null;
						if(tk == null) {
							var _this1 = this.tokens;
							_this1.head = new haxe_ds_GenericCell(tk,_this1.head);
						} else {
							switch(tk._hx_index) {
							case 1:
								var _g = tk.c;
								if(_g._hx_index == 0) {
									var e = _g.v;
									pow = e;
								} else {
									var _this2 = this.tokens;
									_this2.head = new haxe_ds_GenericCell(tk,_this2.head);
								}
								break;
							case 3:
								if(tk.s == "-") {
									tk = this.token();
									if(tk == null) {
										var _this3 = this.tokens;
										_this3.head = new haxe_ds_GenericCell(tk,_this3.head);
									} else if(tk._hx_index == 1) {
										var _g1 = tk.c;
										if(_g1._hx_index == 0) {
											var e1 = _g1.v;
											pow = -e1;
										} else {
											var _this4 = this.tokens;
											_this4.head = new haxe_ds_GenericCell(tk,_this4.head);
										}
									} else {
										var _this5 = this.tokens;
										_this5.head = new haxe_ds_GenericCell(tk,_this5.head);
									}
								} else {
									var _this6 = this.tokens;
									_this6.head = new haxe_ds_GenericCell(tk,_this6.head);
								}
								break;
							default:
								var _this7 = this.tokens;
								_this7.head = new haxe_ds_GenericCell(tk,_this7.head);
							}
						}
						if(pow == null) {
							this.invalidChar(char);
						}
						return hscript_Token.TConst(hscript_Const.CFloat(Math.pow(10,pow) / exp1 * n1 * 10));
					case 120:
						if(n1 > 0 || exp1 > 0) {
							this.invalidChar(char);
						}
						var n2 = 0;
						while(true) {
							char = this.input.charCodeAt(this.readPos++);
							switch(char) {
							case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:
								n2 = (n2 << 4) + char - 48;
								break;
							case 65:case 66:case 67:case 68:case 69:case 70:
								n2 = (n2 << 4) + (char - 55);
								break;
							case 97:case 98:case 99:case 100:case 101:case 102:
								n2 = (n2 << 4) + (char - 87);
								break;
							default:
								this.char = char;
								return hscript_Token.TConst(hscript_Const.CInt(n2));
							}
						}
						break;
					default:
						this.char = char;
						var i1 = n1 | 0;
						return hscript_Token.TConst(exp1 > 0 ? hscript_Const.CFloat(n1 * 10 / exp1) : i1 == n1 ? hscript_Const.CInt(i1) : hscript_Const.CFloat(n1));
					}
				}
				break;
			case 58:
				return hscript_Token.TDoubleDot;
			case 59:
				return hscript_Token.TSemicolon;
			case 61:
				char = this.input.charCodeAt(this.readPos++);
				if(char == 61) {
					return hscript_Token.TOp("==");
				} else if(char == 62) {
					return hscript_Token.TOp("=>");
				}
				this.char = char;
				return hscript_Token.TOp("=");
			case 63:
				return hscript_Token.TQuestion;
			case 64:
				char = this.input.charCodeAt(this.readPos++);
				if(this.idents[char] || char == 58) {
					var id1 = String.fromCodePoint(char);
					while(true) {
						char = this.input.charCodeAt(this.readPos++);
						if(!this.idents[char]) {
							this.char = char;
							return hscript_Token.TMeta(id1);
						}
						id1 += String.fromCodePoint(char);
					}
				}
				this.invalidChar(char);
				break;
			case 91:
				return hscript_Token.TBkOpen;
			case 93:
				return hscript_Token.TBkClose;
			case 123:
				return hscript_Token.TBrOpen;
			case 125:
				return hscript_Token.TBrClose;
			default:
				if(this.ops[char]) {
					var op = String.fromCodePoint(char);
					var prev = -1;
					while(true) {
						char = this.input.charCodeAt(this.readPos++);
						if(char != char) {
							char = 0;
						}
						if(!this.ops[char] || prev == 61) {
							if(HxOverrides.cca(op,0) == 47) {
								return this.tokenComment(op,char);
							}
							this.char = char;
							return hscript_Token.TOp(op);
						}
						prev = char;
						op += String.fromCodePoint(char);
					}
				}
				if(this.idents[char]) {
					var id2 = String.fromCodePoint(char);
					while(true) {
						char = this.input.charCodeAt(this.readPos++);
						if(char != char) {
							char = 0;
						}
						if(!this.idents[char]) {
							this.char = char;
							return hscript_Token.TId(id2);
						}
						id2 += String.fromCodePoint(char);
					}
				}
				this.invalidChar(char);
			}
			char = this.input.charCodeAt(this.readPos++);
		}
	}
	,preprocValue: function(id) {
		return this.preprocesorValues.h[id];
	}
	,preprocStack: null
	,parsePreproCond: function() {
		var tk = this.token();
		if(tk == null) {
			return this.unexpected(tk);
		} else {
			switch(tk._hx_index) {
			case 2:
				var id = tk.s;
				return hscript_Expr.EIdent(id);
			case 3:
				if(tk.s == "!") {
					return hscript_Expr.EUnop("!",true,this.parsePreproCond());
				} else {
					return this.unexpected(tk);
				}
				break;
			case 4:
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(hscript_Token.TPOpen,_this.head);
				return this.parseExpr();
			default:
				return this.unexpected(tk);
			}
		}
	}
	,evalPreproCond: function(e) {
		switch(e._hx_index) {
		case 1:
			var id = e.v;
			return this.preprocValue(id) != null;
		case 3:
			var e1 = e.e;
			return this.evalPreproCond(e1);
		case 6:
			var _g = e.e2;
			var _g1 = e.e1;
			switch(e.op) {
			case "&&":
				var e2 = _g;
				var e1 = _g1;
				if(this.evalPreproCond(e1)) {
					return this.evalPreproCond(e2);
				} else {
					return false;
				}
				break;
			case "||":
				var e2 = _g;
				var e1 = _g1;
				if(!this.evalPreproCond(e1)) {
					return this.evalPreproCond(e2);
				} else {
					return true;
				}
				break;
			default:
				if(!this.resumeErrors) {
					throw haxe_Exception.thrown(hscript_Error.EInvalidPreprocessor("Can't eval " + $hxEnums[e.__enum__].__constructs__[e._hx_index]));
				}
				return false;
			}
			break;
		case 7:
			var _g = e.prefix;
			if(e.op == "!") {
				var e1 = e.e;
				return !this.evalPreproCond(e1);
			} else {
				if(!this.resumeErrors) {
					throw haxe_Exception.thrown(hscript_Error.EInvalidPreprocessor("Can't eval " + $hxEnums[e.__enum__].__constructs__[e._hx_index]));
				}
				return false;
			}
			break;
		default:
			if(!this.resumeErrors) {
				throw haxe_Exception.thrown(hscript_Error.EInvalidPreprocessor("Can't eval " + $hxEnums[e.__enum__].__constructs__[e._hx_index]));
			}
			return false;
		}
	}
	,preprocess: function(id) {
		switch(id) {
		case "else":case "elseif":
			if(this.preprocStack.length > 0) {
				if(this.preprocStack[this.preprocStack.length - 1].r) {
					this.preprocStack[this.preprocStack.length - 1].r = false;
					this.skipTokens();
					return this.token();
				} else if(id == "else") {
					this.preprocStack.pop();
					this.preprocStack.push({ r : true});
					return this.token();
				} else {
					this.preprocStack.pop();
					return this.preprocess("if");
				}
			} else {
				return hscript_Token.TPrepro(id);
			}
			break;
		case "end":
			if(this.preprocStack.length > 0) {
				this.preprocStack.pop();
				return this.token();
			} else {
				return hscript_Token.TPrepro(id);
			}
			break;
		case "if":
			var e = this.parsePreproCond();
			if(this.evalPreproCond(e)) {
				this.preprocStack.push({ r : true});
				return this.token();
			}
			this.preprocStack.push({ r : false});
			this.skipTokens();
			return this.token();
		default:
			return hscript_Token.TPrepro(id);
		}
	}
	,skipTokens: function() {
		var spos = this.preprocStack.length - 1;
		var obj = this.preprocStack[spos];
		var pos = this.readPos;
		while(true) {
			var tk = this.token();
			if(tk == hscript_Token.TEof) {
				if(!this.resumeErrors) {
					throw haxe_Exception.thrown(hscript_Error.EInvalidPreprocessor("Unclosed"));
				}
			}
			if(this.preprocStack[spos] != obj) {
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(tk,_this.head);
				break;
			}
		}
	}
	,tokenComment: function(op,char) {
		var c = HxOverrides.cca(op,1);
		var s = this.input;
		if(c == 47) {
			while(char != 13 && char != 10) {
				char = this.input.charCodeAt(this.readPos++);
				if(char != char) {
					break;
				}
			}
			this.char = char;
			return this.token();
		}
		if(c == 42) {
			var old = this.line;
			if(op == "/**/") {
				this.char = char;
				return this.token();
			}
			while(true) {
				while(char != 42) {
					if(char == 10) {
						this.line++;
					}
					char = this.input.charCodeAt(this.readPos++);
					if(char != char) {
						this.line = old;
						if(!this.resumeErrors) {
							throw haxe_Exception.thrown(hscript_Error.EUnterminatedComment);
						}
						break;
					}
				}
				char = this.input.charCodeAt(this.readPos++);
				if(char != char) {
					this.line = old;
					if(!this.resumeErrors) {
						throw haxe_Exception.thrown(hscript_Error.EUnterminatedComment);
					}
					break;
				}
				if(char == 47) {
					break;
				}
			}
			return this.token();
		}
		this.char = char;
		return hscript_Token.TOp(op);
	}
	,constString: function(c) {
		switch(c._hx_index) {
		case 0:
			var v = c.v;
			if(v == null) {
				return "null";
			} else {
				return "" + v;
			}
			break;
		case 1:
			var f = c.f;
			if(f == null) {
				return "null";
			} else {
				return "" + f;
			}
			break;
		case 2:
			var s = c.s;
			return s;
		}
	}
	,tokenString: function(t) {
		switch(t._hx_index) {
		case 0:
			return "<eof>";
		case 1:
			var c = t.c;
			return this.constString(c);
		case 2:
			var s = t.s;
			return s;
		case 3:
			var s = t.s;
			return s;
		case 4:
			return "(";
		case 5:
			return ")";
		case 6:
			return "{";
		case 7:
			return "}";
		case 8:
			return ".";
		case 9:
			return ",";
		case 10:
			return ";";
		case 11:
			return "[";
		case 12:
			return "]";
		case 13:
			return "?";
		case 14:
			return ":";
		case 15:
			var id = t.s;
			return "@" + id;
		case 16:
			var id = t.s;
			return "#" + id;
		}
	}
	,__class__: hscript_Parser
};
var hscript_Tools = function() { };
$hxClasses["hscript.Tools"] = hscript_Tools;
hscript_Tools.__name__ = "hscript.Tools";
hscript_Tools.iter = function(e,f) {
	switch(e._hx_index) {
	case 0:
		var _g = e.c;
		break;
	case 1:
		var _g = e.v;
		break;
	case 2:
		var _g = e.t;
		var _g = e.n;
		var e1 = e.e;
		if(e1 != null) {
			f(e1);
		}
		break;
	case 3:
		var e1 = e.e;
		f(e1);
		break;
	case 4:
		var el = e.e;
		var _g = 0;
		while(_g < el.length) {
			var e1 = el[_g];
			++_g;
			f(e1);
		}
		break;
	case 5:
		var _g = e.f;
		var e1 = e.e;
		f(e1);
		break;
	case 6:
		var _g = e.op;
		var e2 = e.e2;
		var e1 = e.e1;
		f(e1);
		f(e2);
		break;
	case 7:
		var _g = e.prefix;
		var _g = e.op;
		var e1 = e.e;
		f(e1);
		break;
	case 8:
		var args = e.params;
		var e1 = e.e;
		f(e1);
		var _g = 0;
		while(_g < args.length) {
			var a = args[_g];
			++_g;
			f(a);
		}
		break;
	case 9:
		var e2 = e.e2;
		var e1 = e.e1;
		var c = e.cond;
		f(c);
		f(e1);
		if(e2 != null) {
			f(e2);
		}
		break;
	case 10:
		var e1 = e.e;
		var c = e.cond;
		f(c);
		f(e1);
		break;
	case 11:
		var _g = e.v;
		var e1 = e.e;
		var it = e.it;
		f(it);
		f(e1);
		break;
	case 12:case 13:
		break;
	case 14:
		var _g = e.ret;
		var _g = e.name;
		var _g = e.args;
		var e1 = e.e;
		f(e1);
		break;
	case 15:
		var e1 = e.e;
		if(e1 != null) {
			f(e1);
		}
		break;
	case 16:
		var i = e.index;
		var e1 = e.e;
		f(e1);
		f(i);
		break;
	case 17:
		var el = e.e;
		var _g = 0;
		while(_g < el.length) {
			var e1 = el[_g];
			++_g;
			f(e1);
		}
		break;
	case 18:
		var _g = e.cl;
		var el = e.params;
		var _g = 0;
		while(_g < el.length) {
			var e1 = el[_g];
			++_g;
			f(e1);
		}
		break;
	case 19:
		var e1 = e.e;
		f(e1);
		break;
	case 20:
		var _g = e.t;
		var _g = e.v;
		var c = e.ecatch;
		var e1 = e.e;
		f(e1);
		f(c);
		break;
	case 21:
		var fl = e.fl;
		var _g = 0;
		while(_g < fl.length) {
			var fi = fl[_g];
			++_g;
			f(fi.e);
		}
		break;
	case 22:
		var e2 = e.e2;
		var e1 = e.e1;
		var c = e.cond;
		f(c);
		f(e1);
		f(e2);
		break;
	case 23:
		var def = e.defaultExpr;
		var cases = e.cases;
		var e1 = e.e;
		f(e1);
		var _g = 0;
		while(_g < cases.length) {
			var c = cases[_g];
			++_g;
			var _g1 = 0;
			var _g2 = c.values;
			while(_g1 < _g2.length) {
				var v = _g2[_g1];
				++_g1;
				f(v);
			}
			f(c.expr);
		}
		if(def != null) {
			f(def);
		}
		break;
	case 24:
		var e1 = e.e;
		var c = e.cond;
		f(c);
		f(e1);
		break;
	case 25:
		var e1 = e.e;
		var args = e.args;
		var name = e.name;
		if(args != null) {
			var _g = 0;
			while(_g < args.length) {
				var a = args[_g];
				++_g;
				f(a);
			}
		}
		f(e1);
		break;
	case 26:
		var _g = e.t;
		var e1 = e.e;
		f(e1);
		break;
	}
};
hscript_Tools.map = function(e,f) {
	var edef;
	switch(e._hx_index) {
	case 0:
		var _g = e.c;
		edef = e;
		break;
	case 1:
		var _g = e.v;
		edef = e;
		break;
	case 2:
		var e1 = e.e;
		var t = e.t;
		var n = e.n;
		edef = hscript_Expr.EVar(n,t,e1 != null ? f(e1) : null);
		break;
	case 3:
		var e1 = e.e;
		edef = hscript_Expr.EParent(f(e1));
		break;
	case 4:
		var el = e.e;
		var _g = [];
		var _g1 = 0;
		while(_g1 < el.length) {
			var e1 = el[_g1];
			++_g1;
			_g.push(f(e1));
		}
		edef = hscript_Expr.EBlock(_g);
		break;
	case 5:
		var fi = e.f;
		var e1 = e.e;
		edef = hscript_Expr.EField(f(e1),fi);
		break;
	case 6:
		var e2 = e.e2;
		var e1 = e.e1;
		var op = e.op;
		edef = hscript_Expr.EBinop(op,f(e1),f(e2));
		break;
	case 7:
		var e1 = e.e;
		var pre = e.prefix;
		var op = e.op;
		edef = hscript_Expr.EUnop(op,pre,f(e1));
		break;
	case 8:
		var args = e.params;
		var e1 = e.e;
		var edef1 = f(e1);
		var _g = [];
		var _g1 = 0;
		while(_g1 < args.length) {
			var a = args[_g1];
			++_g1;
			_g.push(f(a));
		}
		edef = hscript_Expr.ECall(edef1,_g);
		break;
	case 9:
		var e2 = e.e2;
		var e1 = e.e1;
		var c = e.cond;
		edef = hscript_Expr.EIf(f(c),f(e1),e2 != null ? f(e2) : null);
		break;
	case 10:
		var e1 = e.e;
		var c = e.cond;
		edef = hscript_Expr.EWhile(f(c),f(e1));
		break;
	case 11:
		var e1 = e.e;
		var it = e.it;
		var v = e.v;
		edef = hscript_Expr.EFor(v,f(it),f(e1));
		break;
	case 12:case 13:
		edef = e;
		break;
	case 14:
		var t = e.ret;
		var name = e.name;
		var e1 = e.e;
		var args = e.args;
		edef = hscript_Expr.EFunction(args,f(e1),name,t);
		break;
	case 15:
		var e1 = e.e;
		edef = hscript_Expr.EReturn(e1 != null ? f(e1) : null);
		break;
	case 16:
		var i = e.index;
		var e1 = e.e;
		edef = hscript_Expr.EArray(f(e1),f(i));
		break;
	case 17:
		var el = e.e;
		var _g = [];
		var _g1 = 0;
		while(_g1 < el.length) {
			var e1 = el[_g1];
			++_g1;
			_g.push(f(e1));
		}
		edef = hscript_Expr.EArrayDecl(_g);
		break;
	case 18:
		var el = e.params;
		var cl = e.cl;
		var _g = [];
		var _g1 = 0;
		while(_g1 < el.length) {
			var e1 = el[_g1];
			++_g1;
			_g.push(f(e1));
		}
		edef = hscript_Expr.ENew(cl,_g);
		break;
	case 19:
		var e1 = e.e;
		edef = hscript_Expr.EThrow(f(e1));
		break;
	case 20:
		var c = e.ecatch;
		var t = e.t;
		var v = e.v;
		var e1 = e.e;
		edef = hscript_Expr.ETry(f(e1),v,t,f(c));
		break;
	case 21:
		var fl = e.fl;
		var _g = [];
		var _g1 = 0;
		while(_g1 < fl.length) {
			var fi = fl[_g1];
			++_g1;
			_g.push({ name : fi.name, e : f(fi.e)});
		}
		edef = hscript_Expr.EObject(_g);
		break;
	case 22:
		var e2 = e.e2;
		var e1 = e.e1;
		var c = e.cond;
		edef = hscript_Expr.ETernary(f(c),f(e1),f(e2));
		break;
	case 23:
		var def = e.defaultExpr;
		var cases = e.cases;
		var e1 = e.e;
		var edef1 = f(e1);
		var _g = [];
		var _g1 = 0;
		while(_g1 < cases.length) {
			var c = cases[_g1];
			++_g1;
			var _g2 = [];
			var _g3 = 0;
			var _g4 = c.values;
			while(_g3 < _g4.length) {
				var v = _g4[_g3];
				++_g3;
				_g2.push(f(v));
			}
			_g.push({ values : _g2, expr : f(c.expr)});
		}
		edef = hscript_Expr.ESwitch(edef1,_g,def == null ? null : f(def));
		break;
	case 24:
		var e1 = e.e;
		var c = e.cond;
		edef = hscript_Expr.EDoWhile(f(c),f(e1));
		break;
	case 25:
		var e1 = e.e;
		var args = e.args;
		var name = e.name;
		var edef1;
		if(args == null) {
			edef1 = null;
		} else {
			var _g = [];
			var _g1 = 0;
			while(_g1 < args.length) {
				var a = args[_g1];
				++_g1;
				_g.push(f(a));
			}
			edef1 = _g;
		}
		edef = hscript_Expr.EMeta(name,edef1,f(e1));
		break;
	case 26:
		var t = e.t;
		var e1 = e.e;
		edef = hscript_Expr.ECheckType(f(e1),t);
		break;
	}
	return edef;
};
hscript_Tools.expr = function(e) {
	return e;
};
hscript_Tools.mk = function(e,p) {
	return e;
};
var js_Browser = function() { };
$hxClasses["js.Browser"] = js_Browser;
js_Browser.__name__ = "js.Browser";
js_Browser.getLocalStorage = function() {
	try {
		var s = window.localStorage;
		s.getItem("");
		if(s.length == 0) {
			var key = "_hx_" + Math.random();
			s.setItem(key,key);
			s.removeItem(key);
		}
		return s;
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		return null;
	}
};
js_Browser.createXMLHttpRequest = function() {
	if(typeof XMLHttpRequest != "undefined") {
		return new XMLHttpRequest();
	}
	if(typeof ActiveXObject != "undefined") {
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
	throw haxe_Exception.thrown("Unable to create XMLHttpRequest object.");
};
var js_html__$CanvasElement_CanvasUtil = function() { };
$hxClasses["js.html._CanvasElement.CanvasUtil"] = js_html__$CanvasElement_CanvasUtil;
js_html__$CanvasElement_CanvasUtil.__name__ = "js.html._CanvasElement.CanvasUtil";
js_html__$CanvasElement_CanvasUtil.getContextWebGL = function(canvas,attribs) {
	var name = "webgl";
	var ctx = canvas.getContext(name,attribs);
	if(ctx != null) {
		return ctx;
	}
	var name = "experimental-webgl";
	var ctx = canvas.getContext(name,attribs);
	if(ctx != null) {
		return ctx;
	}
	return null;
};
var js_lib__$ArrayBuffer_ArrayBufferCompat = function() { };
$hxClasses["js.lib._ArrayBuffer.ArrayBufferCompat"] = js_lib__$ArrayBuffer_ArrayBufferCompat;
js_lib__$ArrayBuffer_ArrayBufferCompat.__name__ = "js.lib._ArrayBuffer.ArrayBufferCompat";
js_lib__$ArrayBuffer_ArrayBufferCompat.sliceImpl = function(begin,end) {
	var u = new Uint8Array(this,begin,end == null ? null : end - begin);
	var resultArray = new Uint8Array(u.byteLength);
	resultArray.set(u);
	return resultArray.buffer;
};
var lime__$internal_backend_html5_GameDeviceData = function() {
	this.connected = true;
	this.buttons = [];
	this.axes = [];
};
$hxClasses["lime._internal.backend.html5.GameDeviceData"] = lime__$internal_backend_html5_GameDeviceData;
lime__$internal_backend_html5_GameDeviceData.__name__ = "lime._internal.backend.html5.GameDeviceData";
lime__$internal_backend_html5_GameDeviceData.prototype = {
	connected: null
	,id: null
	,isGamepad: null
	,buttons: null
	,axes: null
	,__class__: lime__$internal_backend_html5_GameDeviceData
};
var lime__$internal_backend_html5_HTML5AudioSource = function(parent) {
	this.parent = parent;
	this.id = -1;
	this.gain = 1;
	this.position = new lime_math_Vector4();
};
$hxClasses["lime._internal.backend.html5.HTML5AudioSource"] = lime__$internal_backend_html5_HTML5AudioSource;
lime__$internal_backend_html5_HTML5AudioSource.__name__ = "lime._internal.backend.html5.HTML5AudioSource";
lime__$internal_backend_html5_HTML5AudioSource.prototype = {
	completed: null
	,gain: null
	,id: null
	,length: null
	,loops: null
	,parent: null
	,playing: null
	,position: null
	,dispose: function() {
	}
	,init: function() {
	}
	,play: function() {
		if(this.playing || this.parent.buffer == null || this.parent.buffer.__srcHowl == null) {
			return;
		}
		this.playing = true;
		var time = this.getCurrentTime();
		this.completed = false;
		var cacheVolume = this.parent.buffer.__srcHowl._volume;
		this.parent.buffer.__srcHowl._volume = this.parent.get_gain();
		this.id = this.parent.buffer.__srcHowl.play();
		this.parent.buffer.__srcHowl._volume = cacheVolume;
		this.setPosition(this.parent.get_position());
		this.parent.buffer.__srcHowl.on("end",$bind(this,this.howl_onEnd),this.id);
		this.setCurrentTime(time);
	}
	,pause: function() {
		this.playing = false;
		if(this.parent.buffer != null && this.parent.buffer.__srcHowl != null) {
			this.parent.buffer.__srcHowl.pause(this.id);
		}
	}
	,stop: function() {
		this.playing = false;
		if(this.parent.buffer != null && this.parent.buffer.__srcHowl != null) {
			this.parent.buffer.__srcHowl.stop(this.id);
			this.parent.buffer.__srcHowl.off("end",$bind(this,this.howl_onEnd),this.id);
		}
	}
	,howl_onEnd: function() {
		this.playing = false;
		if(this.loops > 0) {
			this.loops--;
			this.stop();
			this.play();
			return;
		} else if(this.parent.buffer != null && this.parent.buffer.__srcHowl != null) {
			this.parent.buffer.__srcHowl.stop(this.id);
			this.parent.buffer.__srcHowl.off("end",$bind(this,this.howl_onEnd),this.id);
		}
		this.completed = true;
		this.parent.onComplete.dispatch();
	}
	,getCurrentTime: function() {
		if(this.id == -1) {
			return 0;
		}
		if(this.completed) {
			return this.getLength();
		} else if(this.parent.buffer != null && this.parent.buffer.__srcHowl != null) {
			var time = (this.parent.buffer.__srcHowl.seek(this.id) * 1000 | 0) - this.parent.offset;
			if(time < 0) {
				return 0;
			}
			return time;
		}
		return 0;
	}
	,setCurrentTime: function(value) {
		if(this.parent.buffer != null && this.parent.buffer.__srcHowl != null) {
			var pos = (value + this.parent.offset) / 1000;
			if(pos < 0) {
				pos = 0;
			}
			this.parent.buffer.__srcHowl.seek(pos,this.id);
		}
		return value;
	}
	,getGain: function() {
		return this.gain;
	}
	,setGain: function(value) {
		if(this.parent.buffer != null && this.parent.buffer.__srcHowl != null && this.id != -1) {
			this.parent.buffer.__srcHowl.volume(value,this.id);
		}
		return this.gain = value;
	}
	,getLength: function() {
		if(this.length != 0) {
			return this.length;
		}
		if(this.parent.buffer != null && this.parent.buffer.__srcHowl != null) {
			return this.parent.buffer.__srcHowl.duration() * 1000 | 0;
		}
		return 0;
	}
	,setLength: function(value) {
		return this.length = value;
	}
	,getLoops: function() {
		return this.loops;
	}
	,setLoops: function(value) {
		return this.loops = value;
	}
	,getPosition: function() {
		return this.position;
	}
	,setPosition: function(value) {
		this.position.x = value.x;
		this.position.y = value.y;
		this.position.z = value.z;
		this.position.w = value.w;
		if(this.parent.buffer.__srcHowl != null && this.parent.buffer.__srcHowl.pos != null) {
			this.parent.buffer.__srcHowl.pos(this.position.x,this.position.y,this.position.z,this.id);
		}
		return this.position;
	}
	,__class__: lime__$internal_backend_html5_HTML5AudioSource
};
var lime__$internal_backend_html5_HTML5HTTPRequest = function() {
	this.validStatus0 = new EReg("Tizen","gi").match(window.navigator.userAgent);
};
$hxClasses["lime._internal.backend.html5.HTML5HTTPRequest"] = lime__$internal_backend_html5_HTML5HTTPRequest;
lime__$internal_backend_html5_HTML5HTTPRequest.__name__ = "lime._internal.backend.html5.HTML5HTTPRequest";
lime__$internal_backend_html5_HTML5HTTPRequest.originElement = null;
lime__$internal_backend_html5_HTML5HTTPRequest.originHostname = null;
lime__$internal_backend_html5_HTML5HTTPRequest.originPort = null;
lime__$internal_backend_html5_HTML5HTTPRequest.originProtocol = null;
lime__$internal_backend_html5_HTML5HTTPRequest.supportsImageProgress = null;
lime__$internal_backend_html5_HTML5HTTPRequest.loadImage = function(uri) {
	var promise = new lime_app_Promise();
	if(lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests < lime__$internal_backend_html5_HTML5HTTPRequest.requestLimit) {
		lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests++;
		lime__$internal_backend_html5_HTML5HTTPRequest.__loadImage(uri,promise,0);
	} else {
		lime__$internal_backend_html5_HTML5HTTPRequest.requestQueue.add({ instance : null, uri : uri, promise : promise, type : "IMAGE", options : 0});
	}
	return promise.future;
};
lime__$internal_backend_html5_HTML5HTTPRequest.loadImageFromBytes = function(bytes,type) {
	var uri = URL.createObjectURL(new Blob([bytes.b.bufferValue],{ type : type}));
	if(uri != null) {
		var promise = new lime_app_Promise();
		if(lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests < lime__$internal_backend_html5_HTML5HTTPRequest.requestLimit) {
			lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests++;
			lime__$internal_backend_html5_HTML5HTTPRequest.__loadImage(uri,promise,1);
		} else {
			lime__$internal_backend_html5_HTML5HTTPRequest.requestQueue.add({ instance : null, uri : uri, promise : promise, type : "IMAGE", options : 1});
		}
		return promise.future;
	} else {
		return lime__$internal_backend_html5_HTML5HTTPRequest.loadImage("data:" + type + ";base64," + lime__$internal_format_Base64.encode(bytes));
	}
};
lime__$internal_backend_html5_HTML5HTTPRequest.processQueue = function() {
	if(lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests < lime__$internal_backend_html5_HTML5HTTPRequest.requestLimit && lime__$internal_backend_html5_HTML5HTTPRequest.requestQueue.length > 0) {
		lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests++;
		var queueItem = lime__$internal_backend_html5_HTML5HTTPRequest.requestQueue.pop();
		switch(queueItem.type) {
		case "BINARY":
			queueItem.instance.__loadData(queueItem.uri,queueItem.promise);
			break;
		case "IMAGE":
			lime__$internal_backend_html5_HTML5HTTPRequest.__loadImage(queueItem.uri,queueItem.promise,queueItem.options);
			break;
		case "TEXT":
			queueItem.instance.__loadText(queueItem.uri,queueItem.promise);
			break;
		default:
			lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests--;
		}
	}
};
lime__$internal_backend_html5_HTML5HTTPRequest.__createBlobURIFromBytes = function(bytes,type) {
	return URL.createObjectURL(new Blob([bytes.b.bufferValue],{ type : type}));
};
lime__$internal_backend_html5_HTML5HTTPRequest.__fixHostname = function(hostname) {
	if(hostname == null) {
		return "";
	} else {
		return hostname;
	}
};
lime__$internal_backend_html5_HTML5HTTPRequest.__fixPort = function(port,protocol) {
	if(port == null || port == "") {
		switch(protocol) {
		case "ftp:":
			return "21";
		case "gopher:":
			return "70";
		case "http:":
			return "80";
		case "https:":
			return "443";
		case "ws:":
			return "80";
		case "wss:":
			return "443";
		default:
			return "";
		}
	}
	return port;
};
lime__$internal_backend_html5_HTML5HTTPRequest.__fixProtocol = function(protocol) {
	if(protocol == null || protocol == "") {
		return "http:";
	} else {
		return protocol;
	}
};
lime__$internal_backend_html5_HTML5HTTPRequest.__isInMemoryURI = function(uri) {
	if(!StringTools.startsWith(uri,"data:")) {
		return StringTools.startsWith(uri,"blob:");
	} else {
		return true;
	}
};
lime__$internal_backend_html5_HTML5HTTPRequest.__isSameOrigin = function(path) {
	if(path == null || path == "") {
		return true;
	}
	if(lime__$internal_backend_html5_HTML5HTTPRequest.__isInMemoryURI(path)) {
		return true;
	}
	if(lime__$internal_backend_html5_HTML5HTTPRequest.originElement == null) {
		lime__$internal_backend_html5_HTML5HTTPRequest.originElement = window.document.createElement("a");
		lime__$internal_backend_html5_HTML5HTTPRequest.originHostname = lime__$internal_backend_html5_HTML5HTTPRequest.__fixHostname($global.location.hostname);
		lime__$internal_backend_html5_HTML5HTTPRequest.originProtocol = lime__$internal_backend_html5_HTML5HTTPRequest.__fixProtocol($global.location.protocol);
		lime__$internal_backend_html5_HTML5HTTPRequest.originPort = lime__$internal_backend_html5_HTML5HTTPRequest.__fixPort($global.location.port,lime__$internal_backend_html5_HTML5HTTPRequest.originProtocol);
	}
	var a = lime__$internal_backend_html5_HTML5HTTPRequest.originElement;
	a.href = path;
	if(a.hostname == "") {
		a.href = a.href;
	}
	var hostname = lime__$internal_backend_html5_HTML5HTTPRequest.__fixHostname(a.hostname);
	var protocol = lime__$internal_backend_html5_HTML5HTTPRequest.__fixProtocol(a.protocol);
	var port = lime__$internal_backend_html5_HTML5HTTPRequest.__fixPort(a.port,protocol);
	var sameHost = hostname == "" || hostname == lime__$internal_backend_html5_HTML5HTTPRequest.originHostname;
	var samePort = port == "" || port == lime__$internal_backend_html5_HTML5HTTPRequest.originPort;
	if(protocol != "file:" && sameHost) {
		return samePort;
	} else {
		return false;
	}
};
lime__$internal_backend_html5_HTML5HTTPRequest.__loadImage = function(uri,promise,options) {
	var image = new Image();
	if(!lime__$internal_backend_html5_HTML5HTTPRequest.__isSameOrigin(uri)) {
		image.crossOrigin = "Anonymous";
	}
	if(lime__$internal_backend_html5_HTML5HTTPRequest.supportsImageProgress == null) {
		lime__$internal_backend_html5_HTML5HTTPRequest.supportsImageProgress = 'onprogress' in image;
	}
	if(lime__$internal_backend_html5_HTML5HTTPRequest.supportsImageProgress || lime__$internal_backend_html5_HTML5HTTPRequest.__isInMemoryURI(uri)) {
		image.addEventListener("load",function(event) {
			lime__$internal_backend_html5_HTML5HTTPRequest.__revokeBlobURI(uri,options);
			var buffer = new lime_graphics_ImageBuffer(null,image.width,image.height);
			buffer.__srcImage = image;
			lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests--;
			lime__$internal_backend_html5_HTML5HTTPRequest.processQueue();
			promise.complete(new lime_graphics_Image(buffer));
		},false);
		image.addEventListener("progress",function(event) {
			promise.progress(event.loaded,event.total);
		},false);
		image.addEventListener("error",function(event) {
			lime__$internal_backend_html5_HTML5HTTPRequest.__revokeBlobURI(uri,options);
			lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests--;
			lime__$internal_backend_html5_HTML5HTTPRequest.processQueue();
			promise.error(event.detail);
		},false);
		image.src = uri;
	} else {
		var request = new XMLHttpRequest();
		request.onload = function(_) {
			lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests--;
			lime__$internal_backend_html5_HTML5HTTPRequest.processQueue();
			var img = new lime_graphics_Image();
			img.__fromBytes(haxe_io_Bytes.ofData(request.response),function(img) {
				promise.complete(img);
			});
		};
		request.onerror = function(event) {
			promise.error(event.message);
		};
		request.onprogress = function(event) {
			if(event.lengthComputable) {
				promise.progress(event.loaded,event.total);
			}
		};
		request.open("GET",uri,true);
		request.responseType = "arraybuffer";
		request.overrideMimeType("text/plain; charset=x-user-defined");
		request.send(null);
	}
};
lime__$internal_backend_html5_HTML5HTTPRequest.__revokeBlobURI = function(uri,options) {
	if((options & 1) != 0) {
		URL.revokeObjectURL(uri);
	}
};
lime__$internal_backend_html5_HTML5HTTPRequest.prototype = {
	binary: null
	,parent: null
	,request: null
	,validStatus0: null
	,cancel: function() {
		if(this.request != null) {
			this.request.abort();
		}
	}
	,init: function(parent) {
		this.parent = parent;
	}
	,load: function(uri,progress,readyStateChange) {
		this.request = new XMLHttpRequest();
		if(this.parent.method == "POST") {
			this.request.upload.addEventListener("progress",progress,false);
		} else {
			this.request.addEventListener("progress",progress,false);
		}
		this.request.onreadystatechange = readyStateChange;
		var query = "";
		if(this.parent.data == null) {
			var key = haxe_ds_StringMap.keysIterator(this.parent.formData.h);
			while(key.hasNext()) {
				var key1 = key.next();
				if(query.length > 0) {
					query += "&";
				}
				var value = this.parent.formData.h[key1];
				if(key1.indexOf("[]") > -1 && ((value) instanceof Array)) {
					var _g = [];
					var x = $getIterator(value);
					while(x.hasNext()) {
						var x1 = x.next();
						_g.push(encodeURIComponent(x1));
					}
					var arrayValue = _g.join("&amp;" + key1 + "=");
					query += encodeURIComponent(key1) + "=" + arrayValue;
				} else {
					var query1 = encodeURIComponent(key1) + "=";
					var s = Std.string(value);
					query += query1 + encodeURIComponent(s);
				}
			}
			if(this.parent.method == "GET" && query != "") {
				if(uri.indexOf("?") > -1) {
					uri += "&" + query;
				} else {
					uri += "?" + query;
				}
				query = "";
			}
		}
		this.request.open(Std.string(this.parent.method),uri,true);
		if(this.parent.timeout > 0) {
			this.request.timeout = this.parent.timeout;
		}
		if(this.binary) {
			this.request.responseType = "arraybuffer";
		}
		var contentType = null;
		var _g = 0;
		var _g1 = this.parent.headers;
		while(_g < _g1.length) {
			var header = _g1[_g];
			++_g;
			if(header.name == "Content-Type") {
				contentType = header.value;
			} else {
				this.request.setRequestHeader(header.name,header.value);
			}
		}
		if(this.parent.contentType != null) {
			contentType = this.parent.contentType;
		}
		if(contentType == null) {
			if(this.parent.data != null) {
				contentType = "application/octet-stream";
			} else if(query != "") {
				contentType = "application/x-www-form-urlencoded";
			}
		}
		if(contentType != null) {
			this.request.setRequestHeader("Content-Type",contentType);
		}
		if(this.parent.withCredentials) {
			this.request.withCredentials = true;
		}
		if(this.parent.data != null) {
			this.request.send(this.parent.data.b.bufferValue);
		} else {
			this.request.send(query);
		}
	}
	,loadData: function(uri) {
		var promise = new lime_app_Promise();
		if(lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests < lime__$internal_backend_html5_HTML5HTTPRequest.requestLimit) {
			lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests++;
			this.__loadData(uri,promise);
		} else {
			lime__$internal_backend_html5_HTML5HTTPRequest.requestQueue.add({ instance : this, uri : uri, promise : promise, type : "BINARY", options : 0});
		}
		return promise.future;
	}
	,loadText: function(uri) {
		var promise = new lime_app_Promise();
		if(lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests < lime__$internal_backend_html5_HTML5HTTPRequest.requestLimit) {
			lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests++;
			this.__loadText(uri,promise);
		} else {
			lime__$internal_backend_html5_HTML5HTTPRequest.requestQueue.add({ instance : this, uri : uri, promise : promise, type : "TEXT", options : 0});
		}
		return promise.future;
	}
	,processResponse: function() {
		if(this.parent.enableResponseHeaders) {
			this.parent.responseHeaders = [];
			var name;
			var value;
			var _g = 0;
			var _g1 = this.request.getAllResponseHeaders().split("\n");
			while(_g < _g1.length) {
				var line = _g1[_g];
				++_g;
				name = StringTools.trim(HxOverrides.substr(line,0,line.indexOf(":")));
				value = StringTools.trim(HxOverrides.substr(line,line.indexOf(":") + 1,null));
				if(name != "") {
					this.parent.responseHeaders.push(new lime_net_HTTPRequestHeader(name,value));
				}
			}
		}
		this.parent.responseStatus = this.request.status;
	}
	,__loadData: function(uri,promise) {
		var _gthis = this;
		var progress = function(event) {
			promise.progress(event.loaded,event.total);
		};
		var readyStateChange = function(event) {
			if(_gthis.request.readyState != 4) {
				return;
			}
			if(_gthis.request.status != null && (_gthis.request.status >= 200 && _gthis.request.status < 400 || _gthis.validStatus0 && _gthis.request.status == 0)) {
				var bytes = null;
				if(_gthis.request.responseType == "") {
					if(_gthis.request.responseText != null) {
						bytes = haxe_io_Bytes.ofString(_gthis.request.responseText);
					}
				} else if(_gthis.request.response != null) {
					bytes = haxe_io_Bytes.ofData(_gthis.request.response);
				}
				_gthis.processResponse();
				promise.complete(bytes);
			} else {
				_gthis.processResponse();
				promise.error(_gthis.request.status);
			}
			_gthis.request = null;
			lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests--;
			lime__$internal_backend_html5_HTML5HTTPRequest.processQueue();
		};
		this.binary = true;
		this.load(uri,progress,readyStateChange);
	}
	,__loadText: function(uri,promise) {
		var _gthis = this;
		var progress = function(event) {
			promise.progress(event.loaded,event.total);
		};
		var readyStateChange = function(event) {
			if(_gthis.request.readyState != 4) {
				return;
			}
			if(_gthis.request.status != null && (_gthis.request.status >= 200 && _gthis.request.status <= 400 || _gthis.validStatus0 && _gthis.request.status == 0)) {
				_gthis.processResponse();
				promise.complete(_gthis.request.responseText);
			} else {
				_gthis.processResponse();
				promise.error(_gthis.request.status);
			}
			_gthis.request = null;
			lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests--;
			lime__$internal_backend_html5_HTML5HTTPRequest.processQueue();
		};
		this.binary = false;
		this.load(uri,progress,readyStateChange);
	}
	,__class__: lime__$internal_backend_html5_HTML5HTTPRequest
};
var lime__$internal_backend_html5_HTML5Window = function(parent) {
	this.unusedTouchesPool = new haxe_ds_List();
	this.scale = 1.0;
	this.currentTouches = new haxe_ds_IntMap();
	this.parent = parent;
	this.cursor = lime_ui_MouseCursor.DEFAULT;
	this.cacheMouseX = 0;
	this.cacheMouseY = 0;
	var attributes = parent.__attributes;
	if(!Object.prototype.hasOwnProperty.call(attributes,"context")) {
		attributes.context = { };
	}
	this.renderType = attributes.context.type;
	if(Object.prototype.hasOwnProperty.call(attributes,"element")) {
		parent.element = attributes.element;
	}
	var element = parent.element;
	if(Object.prototype.hasOwnProperty.call(attributes,"allowHighDPI") && attributes.allowHighDPI && this.renderType != "dom") {
		this.scale = window.devicePixelRatio;
	}
	parent.__scale = this.scale;
	this.setWidth = Object.prototype.hasOwnProperty.call(attributes,"width") ? attributes.width : 0;
	this.setHeight = Object.prototype.hasOwnProperty.call(attributes,"height") ? attributes.height : 0;
	parent.__width = this.setWidth;
	parent.__height = this.setHeight;
	parent.id = lime__$internal_backend_html5_HTML5Window.windowID++;
	if(((element) instanceof HTMLCanvasElement)) {
		this.canvas = element;
	} else if(this.renderType == "dom") {
		this.div = window.document.createElement("div");
	} else {
		this.canvas = window.document.createElement("canvas");
	}
	if(this.canvas != null) {
		var style = this.canvas.style;
		style.setProperty("-webkit-transform","translateZ(0)",null);
		style.setProperty("transform","translateZ(0)",null);
	} else if(this.div != null) {
		var style = this.div.style;
		style.setProperty("-webkit-transform","translate3D(0,0,0)",null);
		style.setProperty("transform","translate3D(0,0,0)",null);
		style.position = "relative";
		style.overflow = "hidden";
		style.setProperty("-webkit-user-select","none",null);
		style.setProperty("-moz-user-select","none",null);
		style.setProperty("-ms-user-select","none",null);
		style.setProperty("-o-user-select","none",null);
	}
	if(parent.__width == 0 && parent.__height == 0) {
		if(element != null) {
			parent.__width = element.clientWidth;
			parent.__height = element.clientHeight;
		} else {
			parent.__width = window.innerWidth;
			parent.__height = window.innerHeight;
		}
		this.cacheElementWidth = parent.__width;
		this.cacheElementHeight = parent.__height;
		this.resizeElement = true;
	}
	if(this.canvas != null) {
		this.canvas.width = Math.round(parent.__width * this.scale);
		this.canvas.height = Math.round(parent.__height * this.scale);
		this.canvas.style.width = parent.__width + "px";
		this.canvas.style.height = parent.__height + "px";
	} else {
		this.div.style.width = parent.__width + "px";
		this.div.style.height = parent.__height + "px";
	}
	if(Object.prototype.hasOwnProperty.call(attributes,"resizable") && attributes.resizable || !Object.prototype.hasOwnProperty.call(attributes,"width") && this.setWidth == 0 && this.setHeight == 0) {
		parent.__resizable = true;
	}
	this.updateSize();
	if(element != null) {
		if(this.canvas != null) {
			if(element != this.canvas) {
				element.appendChild(this.canvas);
			}
		} else {
			element.appendChild(this.div);
		}
		var events = ["mousedown","mouseenter","mouseleave","mousemove","mouseup","wheel"];
		var _g = 0;
		while(_g < events.length) {
			var event = events[_g];
			++_g;
			element.addEventListener(event,$bind(this,this.handleMouseEvent),true);
		}
		element.addEventListener("contextmenu",$bind(this,this.handleContextMenuEvent),true);
		element.addEventListener("dragstart",$bind(this,this.handleDragEvent),true);
		element.addEventListener("dragover",$bind(this,this.handleDragEvent),true);
		element.addEventListener("drop",$bind(this,this.handleDragEvent),true);
		element.addEventListener("touchstart",$bind(this,this.handleTouchEvent),true);
		element.addEventListener("touchmove",$bind(this,this.handleTouchEvent),true);
		element.addEventListener("touchend",$bind(this,this.handleTouchEvent),true);
		element.addEventListener("touchcancel",$bind(this,this.handleTouchEvent),true);
		element.addEventListener("gamepadconnected",$bind(this,this.handleGamepadEvent),true);
		element.addEventListener("gamepaddisconnected",$bind(this,this.handleGamepadEvent),true);
	}
	this.createContext();
	if(parent.context.type == "webgl") {
		this.canvas.addEventListener("webglcontextlost",$bind(this,this.handleContextEvent),false);
		this.canvas.addEventListener("webglcontextrestored",$bind(this,this.handleContextEvent),false);
	}
};
$hxClasses["lime._internal.backend.html5.HTML5Window"] = lime__$internal_backend_html5_HTML5Window;
lime__$internal_backend_html5_HTML5Window.__name__ = "lime._internal.backend.html5.HTML5Window";
lime__$internal_backend_html5_HTML5Window.textArea = null;
lime__$internal_backend_html5_HTML5Window.textInput = null;
lime__$internal_backend_html5_HTML5Window.prototype = {
	canvas: null
	,div: null
	,cacheElementHeight: null
	,cacheElementWidth: null
	,cacheMouseX: null
	,cacheMouseY: null
	,cursor: null
	,currentTouches: null
	,isFullscreen: null
	,parent: null
	,primaryTouch: null
	,renderType: null
	,requestedFullscreen: null
	,resizeElement: null
	,scale: null
	,setHeight: null
	,setWidth: null
	,textInputEnabled: null
	,unusedTouchesPool: null
	,alert: function(message,title) {
		if(message != null) {
			window.alert(Std.string(message));
		}
	}
	,close: function() {
		this.parent.application.__removeWindow(this.parent);
	}
	,createContext: function() {
		var context = new lime_graphics_RenderContext();
		var contextAttributes = this.parent.__attributes.context;
		context.window = this.parent;
		context.attributes = contextAttributes;
		if(this.div != null) {
			context.dom = this.div;
			context.type = "dom";
			context.version = "";
		} else if(this.canvas != null) {
			var webgl = null;
			var forceCanvas = this.renderType == "canvas";
			var forceWebGL = this.renderType == "opengl" || this.renderType == "opengles" || this.renderType == "webgl";
			var allowWebGL2 = !Object.prototype.hasOwnProperty.call(contextAttributes,"version") || contextAttributes.version != "1";
			var isWebGL2 = false;
			if(forceWebGL || !forceCanvas && (!Object.prototype.hasOwnProperty.call(contextAttributes,"hardware") || contextAttributes.hardware)) {
				var transparentBackground = Object.prototype.hasOwnProperty.call(contextAttributes,"background") && contextAttributes.background == null;
				var colorDepth = Object.prototype.hasOwnProperty.call(contextAttributes,"colorDepth") ? contextAttributes.colorDepth : 16;
				var options = Object.prototype.hasOwnProperty.call(contextAttributes,"antialiasing") && contextAttributes.antialiasing > 0;
				var options1 = Object.prototype.hasOwnProperty.call(contextAttributes,"depth") ? contextAttributes.depth : true;
				var options2 = Object.prototype.hasOwnProperty.call(contextAttributes,"stencil") && contextAttributes.stencil;
				var options3 = { alpha : transparentBackground || colorDepth > 16, antialias : options, depth : options1, premultipliedAlpha : true, stencil : options2, preserveDrawingBuffer : false, failIfMajorPerformanceCaveat : true};
				var glContextType = ["webgl","experimental-webgl"];
				if(allowWebGL2) {
					glContextType.unshift("webgl2");
				}
				var _g = 0;
				while(_g < glContextType.length) {
					var name = glContextType[_g];
					++_g;
					webgl = this.canvas.getContext(name,options3);
					if(webgl != null && name == "webgl2") {
						isWebGL2 = true;
					}
					if(webgl != null) {
						break;
					}
				}
			}
			if(webgl == null) {
				context.canvas2D = this.canvas.getContext("2d");
				context.type = "canvas";
				context.version = "";
			} else {
				context.webgl = lime_graphics_WebGLRenderContext.fromWebGL2RenderContext(webgl);
				if(isWebGL2) {
					context.webgl2 = webgl;
				}
				if(lime_graphics_opengl_GL.context == null) {
					lime_graphics_opengl_GL.context = webgl;
					lime_graphics_opengl_GL.type = "webgl";
					lime_graphics_opengl_GL.version = isWebGL2 ? 2 : 1;
				}
				context.type = "webgl";
				context.version = isWebGL2 ? "2" : "1";
			}
		}
		this.parent.context = context;
	}
	,focus: function() {
	}
	,getCursor: function() {
		return this.cursor;
	}
	,getDisplay: function() {
		return lime_system_System.getDisplay(0);
	}
	,getDisplayMode: function() {
		return lime_system_System.getDisplay(0).currentMode;
	}
	,getFrameRate: function() {
		if(this.parent.application == null) {
			return 0;
		}
		if(this.parent.application.__backend.framePeriod < 0) {
			return 60;
		} else if(this.parent.application.__backend.framePeriod == 1000) {
			return 0;
		} else {
			return 1000 / this.parent.application.__backend.framePeriod;
		}
	}
	,getMouseLock: function() {
		return false;
	}
	,getTextInputEnabled: function() {
		return this.textInputEnabled;
	}
	,handleContextEvent: function(event) {
		switch(event.type) {
		case "webglcontextlost":
			if(event.cancelable) {
				event.preventDefault();
			}
			var tmp = lime_graphics_opengl_GL.context != null;
			this.parent.context = null;
			this.parent.onRenderContextLost.dispatch();
			break;
		case "webglcontextrestored":
			this.createContext();
			this.parent.onRenderContextRestored.dispatch(this.parent.context);
			break;
		default:
		}
	}
	,handleContextMenuEvent: function(event) {
		if((this.parent.onMouseUp.canceled || this.parent.onMouseDown.canceled) && event.cancelable) {
			event.preventDefault();
		}
	}
	,handleCutOrCopyEvent: function(event) {
		event.clipboardData.setData("text/plain",lime_system_Clipboard.get_text());
		if(event.cancelable) {
			event.preventDefault();
		}
	}
	,handleDragEvent: function(event) {
		switch(event.type) {
		case "dragover":
			event.preventDefault();
			return false;
		case "dragstart":
			if((js_Boot.__cast(event.target , HTMLElement)).nodeName.toLowerCase() == "img" && event.cancelable) {
				event.preventDefault();
				return false;
			}
			break;
		case "drop":
			if(event.dataTransfer != null && event.dataTransfer.files.length > 0) {
				this.parent.onDropFile.dispatch(event.dataTransfer.files);
				event.preventDefault();
				return false;
			}
			break;
		}
		return true;
	}
	,handleFocusEvent: function(event) {
		var _gthis = this;
		if(this.textInputEnabled) {
			if(event.relatedTarget == null || this.isDescendent(event.relatedTarget)) {
				haxe_Timer.delay(function() {
					if(_gthis.textInputEnabled) {
						lime__$internal_backend_html5_HTML5Window.textInput.focus();
					}
				},20);
			}
		}
	}
	,handleFullscreenEvent: function(event) {
		var fullscreenElement = document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement;
		if(fullscreenElement != null) {
			this.isFullscreen = true;
			this.parent.__fullscreen = true;
			if(this.requestedFullscreen) {
				this.requestedFullscreen = false;
				this.parent.onFullscreen.dispatch();
			}
		} else {
			this.isFullscreen = false;
			this.parent.__fullscreen = false;
			this.parent.onRestore.dispatch();
			var changeEvents = ["fullscreenchange","mozfullscreenchange","webkitfullscreenchange","MSFullscreenChange"];
			var errorEvents = ["fullscreenerror","mozfullscreenerror","webkitfullscreenerror","MSFullscreenError"];
			var _g = 0;
			var _g1 = changeEvents.length;
			while(_g < _g1) {
				var i = _g++;
				window.document.removeEventListener(changeEvents[i],$bind(this,this.handleFullscreenEvent),false);
				window.document.removeEventListener(errorEvents[i],$bind(this,this.handleFullscreenEvent),false);
			}
		}
	}
	,handleGamepadEvent: function(event) {
		switch(event.type) {
		case "gamepadconnected":
			lime_ui_Joystick.__connect(event.gamepad.index);
			if(event.gamepad.mapping == "standard") {
				lime_ui_Gamepad.__connect(event.gamepad.index);
			}
			break;
		case "gamepaddisconnected":
			lime_ui_Joystick.__disconnect(event.gamepad.index);
			lime_ui_Gamepad.__disconnect(event.gamepad.index);
			break;
		default:
		}
	}
	,handleInputEvent: function(event) {
		if(lime__$internal_backend_html5_HTML5Window.textInput.value != lime__$internal_backend_html5_HTML5Window.dummyCharacter) {
			var value = StringTools.replace(lime__$internal_backend_html5_HTML5Window.textInput.value,lime__$internal_backend_html5_HTML5Window.dummyCharacter,"");
			if(value.length > 0) {
				this.parent.onTextInput.dispatch(value);
			}
			lime__$internal_backend_html5_HTML5Window.textInput.value = lime__$internal_backend_html5_HTML5Window.dummyCharacter;
		}
	}
	,handleMouseEvent: function(event) {
		var x = 0.0;
		var y = 0.0;
		if(event.type != "wheel") {
			if(this.parent.element != null) {
				if(this.canvas != null) {
					var rect = this.canvas.getBoundingClientRect();
					x = (event.clientX - rect.left) * (this.parent.__width / rect.width);
					y = (event.clientY - rect.top) * (this.parent.__height / rect.height);
				} else if(this.div != null) {
					var rect = this.div.getBoundingClientRect();
					x = event.clientX - rect.left;
					y = event.clientY - rect.top;
				} else {
					var rect = this.parent.element.getBoundingClientRect();
					x = (event.clientX - rect.left) * (this.parent.__width / rect.width);
					y = (event.clientY - rect.top) * (this.parent.__height / rect.height);
				}
			} else {
				x = event.clientX;
				y = event.clientY;
			}
			switch(event.type) {
			case "mousedown":
				if(event.currentTarget == this.parent.element) {
					window.addEventListener("mouseup",$bind(this,this.handleMouseEvent));
				}
				this.parent.onMouseDown.dispatch(x,y,event.button);
				if(this.parent.onMouseDown.canceled && event.cancelable) {
					event.preventDefault();
				}
				break;
			case "mouseenter":
				if(event.target == this.parent.element) {
					this.parent.onEnter.dispatch();
					if(this.parent.onEnter.canceled && event.cancelable) {
						event.preventDefault();
					}
				}
				break;
			case "mouseleave":
				if(event.target == this.parent.element) {
					this.parent.onLeave.dispatch();
					if(this.parent.onLeave.canceled && event.cancelable) {
						event.preventDefault();
					}
				}
				break;
			case "mousemove":
				if(x != this.cacheMouseX || y != this.cacheMouseY) {
					this.parent.onMouseMove.dispatch(x,y);
					this.parent.onMouseMoveRelative.dispatch(x - this.cacheMouseX,y - this.cacheMouseY);
					if((this.parent.onMouseMove.canceled || this.parent.onMouseMoveRelative.canceled) && event.cancelable) {
						event.preventDefault();
					}
				}
				break;
			case "mouseup":
				window.removeEventListener("mouseup",$bind(this,this.handleMouseEvent));
				if(event.currentTarget == this.parent.element) {
					event.stopPropagation();
				}
				this.parent.onMouseUp.dispatch(x,y,event.button);
				if(this.parent.onMouseUp.canceled && event.cancelable) {
					event.preventDefault();
				}
				break;
			default:
			}
			this.cacheMouseX = x;
			this.cacheMouseY = y;
		} else {
			var deltaMode;
			switch(event.deltaMode) {
			case 0:
				deltaMode = lime_ui_MouseWheelMode.PIXELS;
				break;
			case 1:
				deltaMode = lime_ui_MouseWheelMode.LINES;
				break;
			case 2:
				deltaMode = lime_ui_MouseWheelMode.PAGES;
				break;
			default:
				deltaMode = lime_ui_MouseWheelMode.UNKNOWN;
			}
			this.parent.onMouseWheel.dispatch(event.deltaX,-event.deltaY,deltaMode);
			if(this.parent.onMouseWheel.canceled && event.cancelable) {
				event.preventDefault();
			}
		}
	}
	,handlePasteEvent: function(event) {
		if(event.clipboardData.types.indexOf("text/plain") > -1) {
			var text = event.clipboardData.getData("text/plain");
			lime_system_Clipboard.set_text(text);
			if(this.textInputEnabled) {
				this.parent.onTextInput.dispatch(text);
			}
			if(event.cancelable) {
				event.preventDefault();
			}
		}
	}
	,handleResizeEvent: function(event) {
		this.primaryTouch = null;
		this.updateSize();
	}
	,handleTouchEvent: function(event) {
		if(event.cancelable) {
			event.preventDefault();
		}
		var rect = null;
		if(this.parent.element != null) {
			if(this.canvas != null) {
				rect = this.canvas.getBoundingClientRect();
			} else if(this.div != null) {
				rect = this.div.getBoundingClientRect();
			} else {
				rect = this.parent.element.getBoundingClientRect();
			}
		}
		var windowWidth = this.setWidth;
		var windowHeight = this.setHeight;
		if(windowWidth == 0 || windowHeight == 0) {
			if(rect != null) {
				windowWidth = rect.width;
				windowHeight = rect.height;
			} else {
				windowWidth = 1;
				windowHeight = 1;
			}
		}
		var touch;
		var x;
		var y;
		var cacheX;
		var cacheY;
		var _g = 0;
		var _g1 = event.changedTouches;
		while(_g < _g1.length) {
			var data = _g1[_g];
			++_g;
			x = 0.0;
			y = 0.0;
			if(rect != null) {
				x = (data.clientX - rect.left) * (windowWidth / rect.width);
				y = (data.clientY - rect.top) * (windowHeight / rect.height);
			} else {
				x = data.clientX;
				y = data.clientY;
			}
			if(event.type == "touchstart") {
				touch = this.unusedTouchesPool.pop();
				if(touch == null) {
					touch = new lime_ui_Touch(x / windowWidth,y / windowHeight,data.identifier,0,0,data.force,this.parent.id);
				} else {
					touch.x = x / windowWidth;
					touch.y = y / windowHeight;
					touch.id = data.identifier;
					touch.dx = 0;
					touch.dy = 0;
					touch.pressure = data.force;
					touch.device = this.parent.id;
				}
				this.currentTouches.h[data.identifier] = touch;
				lime_ui_Touch.onStart.dispatch(touch);
				if(this.primaryTouch == null) {
					this.primaryTouch = touch;
				}
				if(touch == this.primaryTouch) {
					this.parent.onMouseDown.dispatch(x,y,0);
				}
			} else {
				touch = this.currentTouches.h[data.identifier];
				if(touch != null) {
					cacheX = touch.x;
					cacheY = touch.y;
					touch.x = x / windowWidth;
					touch.y = y / windowHeight;
					touch.dx = touch.x - cacheX;
					touch.dy = touch.y - cacheY;
					touch.pressure = data.force;
					switch(event.type) {
					case "touchcancel":
						lime_ui_Touch.onCancel.dispatch(touch);
						this.currentTouches.remove(data.identifier);
						this.unusedTouchesPool.add(touch);
						if(touch == this.primaryTouch) {
							this.primaryTouch = null;
						}
						break;
					case "touchend":
						lime_ui_Touch.onEnd.dispatch(touch);
						this.currentTouches.remove(data.identifier);
						this.unusedTouchesPool.add(touch);
						if(touch == this.primaryTouch) {
							this.parent.onMouseUp.dispatch(x,y,0);
							this.primaryTouch = null;
						}
						break;
					case "touchmove":
						lime_ui_Touch.onMove.dispatch(touch);
						if(touch == this.primaryTouch) {
							this.parent.onMouseMove.dispatch(x,y);
						}
						break;
					default:
					}
				}
			}
		}
	}
	,isDescendent: function(node) {
		if(node == this.parent.element) {
			return true;
		}
		while(node != null) {
			if(node.parentNode == this.parent.element) {
				return true;
			}
			node = node.parentNode;
		}
		return false;
	}
	,move: function(x,y) {
	}
	,readPixels: function(rect) {
		if(this.canvas != null) {
			var stageRect = new lime_math_Rectangle(0,0,this.canvas.width,this.canvas.height);
			if(rect == null) {
				rect = stageRect;
			} else {
				rect.intersection(stageRect,rect);
			}
			if(rect.width > 0 && rect.height > 0) {
				var canvas2 = window.document.createElement("canvas");
				canvas2.width = rect.width | 0;
				canvas2.height = rect.height | 0;
				var context = canvas2.getContext("2d");
				context.drawImage(this.canvas,-rect.x,-rect.y);
				return lime_graphics_Image.fromCanvas(canvas2);
			}
		}
		return null;
	}
	,resize: function(width,height) {
	}
	,setBorderless: function(value) {
		return value;
	}
	,setClipboard: function(value) {
		if(lime__$internal_backend_html5_HTML5Window.textArea == null) {
			lime__$internal_backend_html5_HTML5Window.textArea = window.document.createElement("textarea");
			lime__$internal_backend_html5_HTML5Window.textArea.style.height = "0px";
			lime__$internal_backend_html5_HTML5Window.textArea.style.left = "-100px";
			lime__$internal_backend_html5_HTML5Window.textArea.style.opacity = "0";
			lime__$internal_backend_html5_HTML5Window.textArea.style.position = "fixed";
			lime__$internal_backend_html5_HTML5Window.textArea.style.top = "-100px";
			lime__$internal_backend_html5_HTML5Window.textArea.style.width = "0px";
			window.document.body.appendChild(lime__$internal_backend_html5_HTML5Window.textArea);
		}
		lime__$internal_backend_html5_HTML5Window.textArea.value = value;
		lime__$internal_backend_html5_HTML5Window.textArea.focus();
		lime__$internal_backend_html5_HTML5Window.textArea.select();
		if(window.document.queryCommandEnabled("copy")) {
			window.document.execCommand("copy");
		}
	}
	,setCursor: function(value) {
		if(this.cursor != value) {
			if(value == null) {
				this.parent.element.style.cursor = "none";
			} else {
				var tmp;
				switch(value._hx_index) {
				case 0:
					tmp = "default";
					break;
				case 1:
					tmp = "crosshair";
					break;
				case 3:
					tmp = "move";
					break;
				case 4:
					tmp = "pointer";
					break;
				case 5:
					tmp = "nesw-resize";
					break;
				case 6:
					tmp = "ns-resize";
					break;
				case 7:
					tmp = "nwse-resize";
					break;
				case 8:
					tmp = "ew-resize";
					break;
				case 9:
					tmp = "text";
					break;
				case 10:
					tmp = "wait";
					break;
				case 11:
					tmp = "wait";
					break;
				default:
					tmp = "auto";
				}
				this.parent.element.style.cursor = tmp;
			}
			this.cursor = value;
		}
		return this.cursor;
	}
	,setDisplayMode: function(value) {
		return value;
	}
	,setFrameRate: function(value) {
		if(this.parent.application != null) {
			if(value >= 60) {
				if(this.parent == this.parent.application.__window) {
					this.parent.application.__backend.framePeriod = -1;
				}
			} else if(value > 0) {
				if(this.parent == this.parent.application.__window) {
					this.parent.application.__backend.framePeriod = 1000 / value;
				}
			} else if(this.parent == this.parent.application.__window) {
				this.parent.application.__backend.framePeriod = 1000;
			}
		}
		return value;
	}
	,setFullscreen: function(value) {
		if(value) {
			if(!this.requestedFullscreen && !this.isFullscreen) {
				this.requestedFullscreen = true;
				if(($_=this.parent.element,$bind($_,$_.requestFullscreen))) {
					document.addEventListener("fullscreenchange",$bind(this,this.handleFullscreenEvent),false);
					document.addEventListener("fullscreenerror",$bind(this,this.handleFullscreenEvent),false);
					this.parent.element.requestFullscreen();
				} else if(this.parent.element.mozRequestFullScreen) {
					document.addEventListener("mozfullscreenchange",$bind(this,this.handleFullscreenEvent),false);
					document.addEventListener("mozfullscreenerror",$bind(this,this.handleFullscreenEvent),false);
					this.parent.element.mozRequestFullScreen();
				} else if(this.parent.element.webkitRequestFullscreen) {
					document.addEventListener("webkitfullscreenchange",$bind(this,this.handleFullscreenEvent),false);
					document.addEventListener("webkitfullscreenerror",$bind(this,this.handleFullscreenEvent),false);
					this.parent.element.webkitRequestFullscreen();
				} else if(this.parent.element.msRequestFullscreen) {
					document.addEventListener("MSFullscreenChange",$bind(this,this.handleFullscreenEvent),false);
					document.addEventListener("MSFullscreenError",$bind(this,this.handleFullscreenEvent),false);
					this.parent.element.msRequestFullscreen();
				}
			}
		} else if(this.isFullscreen) {
			this.requestedFullscreen = false;
			if(document.exitFullscreen) {
				document.exitFullscreen();
			} else if(document.mozCancelFullScreen) {
				document.mozCancelFullScreen();
			} else if(document.webkitExitFullscreen) {
				document.webkitExitFullscreen();
			} else if(document.msExitFullscreen) {
				document.msExitFullscreen();
			}
		}
		return value;
	}
	,setIcon: function(image) {
		lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image);
		var link = window.document.querySelector("link[rel*='icon']");
		if(link == null) {
			link = window.document.createElement("link");
		}
		link.type = "image/x-icon";
		link.rel = "shortcut icon";
		link.href = image.buffer.get_src().toDataURL("image/x-icon");
		window.document.getElementsByTagName("head")[0].appendChild(link);
	}
	,setMaximized: function(value) {
		return false;
	}
	,setMinimized: function(value) {
		return false;
	}
	,setMouseLock: function(value) {
	}
	,setResizable: function(value) {
		return value;
	}
	,setTextInputEnabled: function(value) {
		if(value) {
			if(lime__$internal_backend_html5_HTML5Window.textInput == null) {
				lime__$internal_backend_html5_HTML5Window.textInput = window.document.createElement("input");
				lime__$internal_backend_html5_HTML5Window.textInput.type = "text";
				lime__$internal_backend_html5_HTML5Window.textInput.style.position = "absolute";
				lime__$internal_backend_html5_HTML5Window.textInput.style.opacity = "0";
				lime__$internal_backend_html5_HTML5Window.textInput.style.color = "transparent";
				lime__$internal_backend_html5_HTML5Window.textInput.value = lime__$internal_backend_html5_HTML5Window.dummyCharacter;
				lime__$internal_backend_html5_HTML5Window.textInput.autocapitalize = "off";
				lime__$internal_backend_html5_HTML5Window.textInput.autocorrect = "off";
				lime__$internal_backend_html5_HTML5Window.textInput.autocomplete = "off";
				lime__$internal_backend_html5_HTML5Window.textInput.style.left = "0px";
				lime__$internal_backend_html5_HTML5Window.textInput.style.top = "50%";
				if(new EReg("(iPad|iPhone|iPod).*OS 8_","gi").match(window.navigator.userAgent)) {
					lime__$internal_backend_html5_HTML5Window.textInput.style.fontSize = "0px";
					lime__$internal_backend_html5_HTML5Window.textInput.style.width = "0px";
					lime__$internal_backend_html5_HTML5Window.textInput.style.height = "0px";
				} else {
					lime__$internal_backend_html5_HTML5Window.textInput.style.width = "1px";
					lime__$internal_backend_html5_HTML5Window.textInput.style.height = "1px";
				}
				lime__$internal_backend_html5_HTML5Window.textInput.style.pointerEvents = "none";
				lime__$internal_backend_html5_HTML5Window.textInput.style.zIndex = "-10000000";
			}
			if(lime__$internal_backend_html5_HTML5Window.textInput.parentNode == null) {
				this.parent.element.appendChild(lime__$internal_backend_html5_HTML5Window.textInput);
			}
			if(!this.textInputEnabled) {
				lime__$internal_backend_html5_HTML5Window.textInput.addEventListener("input",$bind(this,this.handleInputEvent),true);
				lime__$internal_backend_html5_HTML5Window.textInput.addEventListener("blur",$bind(this,this.handleFocusEvent),true);
				lime__$internal_backend_html5_HTML5Window.textInput.addEventListener("cut",$bind(this,this.handleCutOrCopyEvent),true);
				lime__$internal_backend_html5_HTML5Window.textInput.addEventListener("copy",$bind(this,this.handleCutOrCopyEvent),true);
				lime__$internal_backend_html5_HTML5Window.textInput.addEventListener("paste",$bind(this,this.handlePasteEvent),true);
			}
			lime__$internal_backend_html5_HTML5Window.textInput.focus();
			lime__$internal_backend_html5_HTML5Window.textInput.select();
		} else if(lime__$internal_backend_html5_HTML5Window.textInput != null) {
			lime__$internal_backend_html5_HTML5Window.textInput.removeEventListener("input",$bind(this,this.handleInputEvent),true);
			lime__$internal_backend_html5_HTML5Window.textInput.removeEventListener("blur",$bind(this,this.handleFocusEvent),true);
			lime__$internal_backend_html5_HTML5Window.textInput.removeEventListener("cut",$bind(this,this.handleCutOrCopyEvent),true);
			lime__$internal_backend_html5_HTML5Window.textInput.removeEventListener("copy",$bind(this,this.handleCutOrCopyEvent),true);
			lime__$internal_backend_html5_HTML5Window.textInput.removeEventListener("paste",$bind(this,this.handlePasteEvent),true);
			lime__$internal_backend_html5_HTML5Window.textInput.blur();
		}
		return this.textInputEnabled = value;
	}
	,setTitle: function(value) {
		if(value != null) {
			window.document.title = value;
		}
		return value;
	}
	,updateSize: function() {
		if(!this.parent.__resizable) {
			return;
		}
		var elementWidth;
		var elementHeight;
		if(this.parent.element != null) {
			elementWidth = this.parent.element.clientWidth;
			elementHeight = this.parent.element.clientHeight;
		} else {
			elementWidth = window.innerWidth;
			elementHeight = window.innerHeight;
		}
		if(elementWidth != this.cacheElementWidth || elementHeight != this.cacheElementHeight) {
			this.cacheElementWidth = elementWidth;
			this.cacheElementHeight = elementHeight;
			var stretch = this.resizeElement || this.setWidth == 0 && this.setHeight == 0;
			if(this.parent.element != null && (this.div == null || this.div != null && stretch)) {
				if(stretch) {
					if(this.parent.__width != elementWidth || this.parent.__height != elementHeight) {
						this.parent.__width = elementWidth;
						this.parent.__height = elementHeight;
						if(this.canvas != null) {
							if(this.parent.element != this.canvas) {
								this.canvas.width = Math.round(elementWidth * this.scale);
								this.canvas.height = Math.round(elementHeight * this.scale);
								this.canvas.style.width = elementWidth + "px";
								this.canvas.style.height = elementHeight + "px";
							}
						} else {
							this.div.style.width = elementWidth + "px";
							this.div.style.height = elementHeight + "px";
						}
						this.parent.onResize.dispatch(elementWidth,elementHeight);
					}
				} else {
					var scaleX = this.setWidth != 0 ? elementWidth / this.setWidth : 1;
					var scaleY = this.setHeight != 0 ? elementHeight / this.setHeight : 1;
					var targetWidth = elementWidth;
					var targetHeight = elementHeight;
					var marginLeft = 0;
					var marginTop = 0;
					if(scaleX < scaleY) {
						targetHeight = Math.floor(this.setHeight * scaleX);
						marginTop = Math.floor((elementHeight - targetHeight) / 2);
					} else {
						targetWidth = Math.floor(this.setWidth * scaleY);
						marginLeft = Math.floor((elementWidth - targetWidth) / 2);
					}
					if(this.canvas != null) {
						if(this.parent.element != this.canvas) {
							this.canvas.style.width = targetWidth + "px";
							this.canvas.style.height = targetHeight + "px";
							this.canvas.style.marginLeft = marginLeft + "px";
							this.canvas.style.marginTop = marginTop + "px";
						}
					} else {
						this.div.style.width = targetWidth + "px";
						this.div.style.height = targetHeight + "px";
						this.div.style.marginLeft = marginLeft + "px";
						this.div.style.marginTop = marginTop + "px";
					}
				}
			}
		}
	}
	,warpMouse: function(x,y) {
	}
	,__class__: lime__$internal_backend_html5_HTML5Window
};
var lime__$internal_backend_native_NativeCFFI = function() { };
$hxClasses["lime._internal.backend.native.NativeCFFI"] = lime__$internal_backend_native_NativeCFFI;
lime__$internal_backend_native_NativeCFFI.__name__ = "lime._internal.backend.native.NativeCFFI";
var lime__$internal_format_BMP = function() { };
$hxClasses["lime._internal.format.BMP"] = lime__$internal_format_BMP;
lime__$internal_format_BMP.__name__ = "lime._internal.format.BMP";
lime__$internal_format_BMP.encode = function(image,type) {
	if(image.get_premultiplied() || image.get_format() != 0) {
		image = image.clone();
		image.set_premultiplied(false);
		image.set_format(0);
	}
	if(type == null) {
		type = lime__$internal_format_BMPType.RGB;
	}
	var fileHeaderLength = 14;
	var infoHeaderLength = 40;
	var pixelValuesLength = image.width * image.height * 4;
	if(type != null) {
		switch(type._hx_index) {
		case 0:
			pixelValuesLength = (image.width * 3 + image.width * 3 % 4) * image.height;
			break;
		case 1:
			infoHeaderLength = 108;
			break;
		case 2:
			fileHeaderLength = 0;
			pixelValuesLength += image.width * image.height;
			break;
		}
	}
	var data = new haxe_io_Bytes(new ArrayBuffer(fileHeaderLength + infoHeaderLength + pixelValuesLength));
	var position = 0;
	if(fileHeaderLength > 0) {
		data.b[position++] = 66;
		data.b[position++] = 77;
		data.setInt32(position,data.length);
		position += 4;
		data.setUInt16(position,0);
		position += 2;
		data.setUInt16(position,0);
		position += 2;
		data.setInt32(position,fileHeaderLength + infoHeaderLength);
		position += 4;
	}
	data.setInt32(position,infoHeaderLength);
	position += 4;
	data.setInt32(position,image.width);
	position += 4;
	data.setInt32(position,type == lime__$internal_format_BMPType.ICO ? image.height * 2 : image.height);
	position += 4;
	data.setUInt16(position,1);
	position += 2;
	data.setUInt16(position,type == lime__$internal_format_BMPType.RGB ? 24 : 32);
	position += 2;
	data.setInt32(position,type == lime__$internal_format_BMPType.BITFIELD ? 3 : 0);
	position += 4;
	data.setInt32(position,pixelValuesLength);
	position += 4;
	data.setInt32(position,11824);
	position += 4;
	data.setInt32(position,11824);
	position += 4;
	data.setInt32(position,0);
	position += 4;
	data.setInt32(position,0);
	position += 4;
	if(type == lime__$internal_format_BMPType.BITFIELD) {
		data.setInt32(position,16711680);
		position += 4;
		data.setInt32(position,65280);
		position += 4;
		data.setInt32(position,255);
		position += 4;
		data.setInt32(position,-16777216);
		position += 4;
		data.b[position++] = 32;
		data.b[position++] = 110;
		data.b[position++] = 105;
		data.b[position++] = 87;
		var _g = 0;
		while(_g < 48) {
			var i = _g++;
			data.b[position++] = 0;
		}
	}
	var pixels = image.getPixels(new lime_math_Rectangle(0,0,image.width,image.height),1);
	var readPosition = 0;
	var a;
	var r;
	var g;
	var b;
	if(type != null) {
		switch(type._hx_index) {
		case 0:
			var _g = 0;
			var _g1 = image.height;
			while(_g < _g1) {
				var y = _g++;
				readPosition = (image.height - 1 - y) * 4 * image.width;
				var _g2 = 0;
				var _g3 = image.width;
				while(_g2 < _g3) {
					var x = _g2++;
					a = pixels.b[readPosition++];
					r = pixels.b[readPosition++];
					g = pixels.b[readPosition++];
					b = pixels.b[readPosition++];
					data.b[position++] = b & 255;
					data.b[position++] = g & 255;
					data.b[position++] = r & 255;
				}
				var _g4 = 0;
				var _g5 = image.width * 3 % 4;
				while(_g4 < _g5) {
					var i = _g4++;
					data.b[position++] = 0;
				}
			}
			break;
		case 1:
			var _g = 0;
			var _g1 = image.height;
			while(_g < _g1) {
				var y = _g++;
				readPosition = (image.height - 1 - y) * 4 * image.width;
				var _g2 = 0;
				var _g3 = image.width;
				while(_g2 < _g3) {
					var x = _g2++;
					a = pixels.b[readPosition++];
					r = pixels.b[readPosition++];
					g = pixels.b[readPosition++];
					b = pixels.b[readPosition++];
					data.b[position++] = b & 255;
					data.b[position++] = g & 255;
					data.b[position++] = r & 255;
					data.b[position++] = a & 255;
				}
			}
			break;
		case 2:
			var andMask = new haxe_io_Bytes(new ArrayBuffer(image.width * image.height));
			var maskPosition = 0;
			var _g = 0;
			var _g1 = image.height;
			while(_g < _g1) {
				var y = _g++;
				readPosition = (image.height - 1 - y) * 4 * image.width;
				var _g2 = 0;
				var _g3 = image.width;
				while(_g2 < _g3) {
					var x = _g2++;
					a = pixels.b[readPosition++];
					r = pixels.b[readPosition++];
					g = pixels.b[readPosition++];
					b = pixels.b[readPosition++];
					data.b[position++] = b & 255;
					data.b[position++] = g & 255;
					data.b[position++] = r & 255;
					data.b[position++] = a & 255;
					andMask.b[maskPosition++] = 0;
				}
			}
			data.blit(position,andMask,0,image.width * image.height);
			break;
		}
	}
	return data;
};
var lime__$internal_format_BMPType = $hxEnums["lime._internal.format.BMPType"] = { __ename__ : "lime._internal.format.BMPType", __constructs__ : ["RGB","BITFIELD","ICO"]
	,RGB: {_hx_index:0,__enum__:"lime._internal.format.BMPType",toString:$estr}
	,BITFIELD: {_hx_index:1,__enum__:"lime._internal.format.BMPType",toString:$estr}
	,ICO: {_hx_index:2,__enum__:"lime._internal.format.BMPType",toString:$estr}
};
var lime__$internal_format_Base64 = function() { };
$hxClasses["lime._internal.format.Base64"] = lime__$internal_format_Base64;
lime__$internal_format_Base64.__name__ = "lime._internal.format.Base64";
lime__$internal_format_Base64.decode = function(source) {
	return haxe_crypto_Base64.decode(source);
};
lime__$internal_format_Base64.encode = function(source) {
	var result = [];
	var dictionary = lime__$internal_format_Base64.DICTIONARY;
	var extendedDictionary = lime__$internal_format_Base64.EXTENDED_DICTIONARY;
	var numBytes = source.length;
	var numInputTriplets = Math.floor(numBytes / 3);
	var numChunksToWrite = numInputTriplets * 2;
	result.length = Math.ceil(numBytes / 3) * 2;
	var numBytesRead = 0;
	var numChunksWritten = 0;
	var inputTriplet;
	while(numChunksWritten < numChunksToWrite) {
		inputTriplet = source.b[numBytesRead] << 16 | source.b[numBytesRead + 1] << 8 | source.b[numBytesRead + 2];
		result[numChunksWritten] = extendedDictionary[inputTriplet >> 12 & 4095];
		result[numChunksWritten + 1] = extendedDictionary[inputTriplet & 4095];
		numBytesRead += 3;
		numChunksWritten += 2;
	}
	switch(numBytes - numInputTriplets * 3) {
	case 1:
		inputTriplet = source.b[numBytesRead] << 16;
		result[numChunksWritten] = extendedDictionary[inputTriplet >> 12 & 4095];
		result[numChunksWritten + 1] = "==";
		break;
	case 2:
		inputTriplet = source.b[numBytesRead] << 16 | source.b[numBytesRead + 1] << 8;
		result[numChunksWritten] = extendedDictionary[inputTriplet >> 12 & 4095];
		result[numChunksWritten + 1] = dictionary[inputTriplet >> 6 & 63] + "=";
		break;
	default:
	}
	return result.join("");
};
var lime__$internal_format_Deflate = function() { };
$hxClasses["lime._internal.format.Deflate"] = lime__$internal_format_Deflate;
lime__$internal_format_Deflate.__name__ = "lime._internal.format.Deflate";
lime__$internal_format_Deflate.compress = function(bytes) {
	var data = pako.deflateRaw(bytes.b.bufferValue);
	return haxe_io_Bytes.ofData(data);
};
lime__$internal_format_Deflate.decompress = function(bytes) {
	var data = pako.inflateRaw(bytes.b.bufferValue);
	return haxe_io_Bytes.ofData(data);
};
var lime__$internal_format_GZip = function() { };
$hxClasses["lime._internal.format.GZip"] = lime__$internal_format_GZip;
lime__$internal_format_GZip.__name__ = "lime._internal.format.GZip";
lime__$internal_format_GZip.compress = function(bytes) {
	var data = pako.gzip(bytes.b.bufferValue);
	return haxe_io_Bytes.ofData(data);
};
lime__$internal_format_GZip.decompress = function(bytes) {
	var data = pako.ungzip(bytes.b.bufferValue);
	return haxe_io_Bytes.ofData(data);
};
var lime__$internal_format_JPEG = function() { };
$hxClasses["lime._internal.format.JPEG"] = lime__$internal_format_JPEG;
lime__$internal_format_JPEG.__name__ = "lime._internal.format.JPEG";
lime__$internal_format_JPEG.decodeBytes = function(bytes,decodeData) {
	if(decodeData == null) {
		decodeData = true;
	}
	return null;
};
lime__$internal_format_JPEG.decodeFile = function(path,decodeData) {
	if(decodeData == null) {
		decodeData = true;
	}
	return null;
};
lime__$internal_format_JPEG.encode = function(image,quality) {
	if(image.get_premultiplied() || image.get_format() != 0) {
		image = image.clone();
		image.set_premultiplied(false);
		image.set_format(0);
	}
	lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image,false);
	if(image.buffer.__srcCanvas != null) {
		var data = image.buffer.__srcCanvas.toDataURL("image/jpeg",quality / 100);
		var buffer = window.atob(data.split(";base64,")[1]);
		var bytes = new haxe_io_Bytes(new ArrayBuffer(buffer.length));
		var _g = 0;
		var _g1 = buffer.length;
		while(_g < _g1) {
			var i = _g++;
			bytes.b[i] = HxOverrides.cca(buffer,i) & 255;
		}
		return bytes;
	}
	return null;
};
var lime__$internal_format_LZMA = function() { };
$hxClasses["lime._internal.format.LZMA"] = lime__$internal_format_LZMA;
lime__$internal_format_LZMA.__name__ = "lime._internal.format.LZMA";
lime__$internal_format_LZMA.compress = function(bytes) {
	return null;
};
lime__$internal_format_LZMA.decompress = function(bytes) {
	return null;
};
var lime__$internal_format_PNG = function() { };
$hxClasses["lime._internal.format.PNG"] = lime__$internal_format_PNG;
lime__$internal_format_PNG.__name__ = "lime._internal.format.PNG";
lime__$internal_format_PNG.decodeBytes = function(bytes,decodeData) {
	if(decodeData == null) {
		decodeData = true;
	}
	return null;
};
lime__$internal_format_PNG.decodeFile = function(path,decodeData) {
	if(decodeData == null) {
		decodeData = true;
	}
	return null;
};
lime__$internal_format_PNG.encode = function(image) {
	if(image.get_premultiplied() || image.get_format() != 0) {
		image = image.clone();
		image.set_premultiplied(false);
		image.set_format(0);
	}
	lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image,false);
	if(image.buffer.__srcCanvas != null) {
		var data = image.buffer.__srcCanvas.toDataURL("image/png");
		var buffer = window.atob(data.split(";base64,")[1]);
		var bytes = new haxe_io_Bytes(new ArrayBuffer(buffer.length));
		var _g = 0;
		var _g1 = buffer.length;
		while(_g < _g1) {
			var i = _g++;
			bytes.b[i] = HxOverrides.cca(buffer,i) & 255;
		}
		return bytes;
	}
	return null;
};
var lime__$internal_format_Zlib = function() { };
$hxClasses["lime._internal.format.Zlib"] = lime__$internal_format_Zlib;
lime__$internal_format_Zlib.__name__ = "lime._internal.format.Zlib";
lime__$internal_format_Zlib.compress = function(bytes) {
	var data = pako.deflate(bytes.b.bufferValue);
	return haxe_io_Bytes.ofData(data);
};
lime__$internal_format_Zlib.decompress = function(bytes) {
	var data = pako.inflate(bytes.b.bufferValue);
	return haxe_io_Bytes.ofData(data);
};
var lime__$internal_graphics_ImageCanvasUtil = function() { };
$hxClasses["lime._internal.graphics.ImageCanvasUtil"] = lime__$internal_graphics_ImageCanvasUtil;
lime__$internal_graphics_ImageCanvasUtil.__name__ = "lime._internal.graphics.ImageCanvasUtil";
lime__$internal_graphics_ImageCanvasUtil.colorTransform = function(image,rect,colorMatrix) {
	lime__$internal_graphics_ImageCanvasUtil.convertToData(image);
	lime__$internal_graphics_ImageDataUtil.colorTransform(image,rect,colorMatrix);
};
lime__$internal_graphics_ImageCanvasUtil.convertToCanvas = function(image,clear) {
	if(clear == null) {
		clear = false;
	}
	var buffer = image.buffer;
	if(buffer.__srcImage != null) {
		if(buffer.__srcCanvas == null) {
			lime__$internal_graphics_ImageCanvasUtil.createCanvas(image,buffer.__srcImage.width,buffer.__srcImage.height);
			buffer.__srcContext.drawImage(buffer.__srcImage,0,0);
		}
		buffer.__srcImage = null;
	} else if(buffer.__srcCanvas == null && buffer.data != null) {
		image.set_transparent(true);
		lime__$internal_graphics_ImageCanvasUtil.createCanvas(image,buffer.width,buffer.height);
		lime__$internal_graphics_ImageCanvasUtil.createImageData(image);
		buffer.__srcContext.putImageData(buffer.__srcImageData,0,0);
	} else if(image.type == lime_graphics_ImageType.DATA && buffer.__srcImageData != null && image.dirty) {
		buffer.__srcContext.putImageData(buffer.__srcImageData,0,0);
		image.dirty = false;
	}
	if(clear) {
		buffer.data = null;
		buffer.__srcImageData = null;
	} else if(buffer.data == null && buffer.__srcImageData != null) {
		buffer.data = buffer.__srcImageData.data;
	}
	image.type = lime_graphics_ImageType.CANVAS;
};
lime__$internal_graphics_ImageCanvasUtil.convertToData = function(image,clear) {
	if(clear == null) {
		clear = false;
	}
	var buffer = image.buffer;
	if(buffer.__srcImage != null) {
		lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image);
	}
	if(buffer.__srcCanvas != null && buffer.data == null) {
		lime__$internal_graphics_ImageCanvasUtil.createImageData(image);
		if(image.type == lime_graphics_ImageType.CANVAS) {
			image.dirty = false;
		}
	} else if(image.type == lime_graphics_ImageType.CANVAS && buffer.__srcCanvas != null && image.dirty) {
		if(buffer.__srcImageData == null) {
			lime__$internal_graphics_ImageCanvasUtil.createImageData(image);
		} else {
			buffer.__srcImageData = buffer.__srcContext.getImageData(0,0,buffer.width,buffer.height);
			var elements = buffer.__srcImageData.data.buffer;
			var array = null;
			var vector = null;
			var view = null;
			var buffer1 = null;
			var len = null;
			var this1;
			if(elements != null) {
				this1 = new Uint8Array(elements);
			} else if(array != null) {
				this1 = new Uint8Array(array);
			} else if(vector != null) {
				this1 = new Uint8Array(vector.__array);
			} else if(view != null) {
				this1 = new Uint8Array(view);
			} else if(buffer1 != null) {
				if(len == null) {
					this1 = new Uint8Array(buffer1,0);
				} else {
					this1 = new Uint8Array(buffer1,0,len);
				}
			} else {
				this1 = null;
			}
			buffer.data = this1;
		}
		image.dirty = false;
	}
	if(clear) {
		image.buffer.__srcCanvas = null;
		image.buffer.__srcContext = null;
	}
	image.type = lime_graphics_ImageType.DATA;
};
lime__$internal_graphics_ImageCanvasUtil.copyChannel = function(image,sourceImage,sourceRect,destPoint,sourceChannel,destChannel) {
	lime__$internal_graphics_ImageCanvasUtil.convertToData(sourceImage);
	lime__$internal_graphics_ImageCanvasUtil.convertToData(image);
	lime__$internal_graphics_ImageDataUtil.copyChannel(image,sourceImage,sourceRect,destPoint,sourceChannel,destChannel);
};
lime__$internal_graphics_ImageCanvasUtil.copyPixels = function(image,sourceImage,sourceRect,destPoint,alphaImage,alphaPoint,mergeAlpha) {
	if(mergeAlpha == null) {
		mergeAlpha = false;
	}
	if(destPoint == null || destPoint.x >= image.width || destPoint.y >= image.height || sourceRect == null || sourceRect.width < 1 || sourceRect.height < 1) {
		return;
	}
	if(alphaImage != null && alphaImage.get_transparent()) {
		if(alphaPoint == null) {
			alphaPoint = new lime_math_Vector2();
		}
		var tempData = sourceImage.clone();
		tempData.copyChannel(alphaImage,new lime_math_Rectangle(sourceRect.x + alphaPoint.x,sourceRect.y + alphaPoint.y,sourceRect.width,sourceRect.height),new lime_math_Vector2(sourceRect.x,sourceRect.y),lime_graphics_ImageChannel.ALPHA,lime_graphics_ImageChannel.ALPHA);
		sourceImage = tempData;
	}
	lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image,true);
	if(!mergeAlpha) {
		if(image.get_transparent() && sourceImage.get_transparent()) {
			image.buffer.__srcContext.clearRect(destPoint.x + image.offsetX,destPoint.y + image.offsetY,sourceRect.width + image.offsetX,sourceRect.height + image.offsetY);
		}
	}
	lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(sourceImage);
	if(sourceImage.buffer.get_src() != null) {
		image.buffer.__srcContext.globalCompositeOperation = "source-over";
		image.buffer.__srcContext.drawImage(sourceImage.buffer.get_src(),sourceRect.x + sourceImage.offsetX | 0,sourceRect.y + sourceImage.offsetY | 0,sourceRect.width | 0,sourceRect.height | 0,destPoint.x + image.offsetX | 0,destPoint.y + image.offsetY | 0,sourceRect.width | 0,sourceRect.height | 0);
	}
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageCanvasUtil.createCanvas = function(image,width,height) {
	var buffer = image.buffer;
	if(buffer.__srcCanvas == null) {
		buffer.__srcCanvas = window.document.createElement("canvas");
		buffer.__srcCanvas.width = width;
		buffer.__srcCanvas.height = height;
		if(!image.get_transparent()) {
			if(!image.get_transparent()) {
				buffer.__srcCanvas.setAttribute("moz-opaque","true");
			}
			buffer.__srcContext = buffer.__srcCanvas.getContext ("2d", { alpha: false });
		} else {
			buffer.__srcContext = buffer.__srcCanvas.getContext("2d");
		}
	}
};
lime__$internal_graphics_ImageCanvasUtil.createImageData = function(image) {
	var buffer = image.buffer;
	if(buffer.__srcImageData == null) {
		if(buffer.data == null) {
			buffer.__srcImageData = buffer.__srcContext.getImageData(0,0,buffer.width,buffer.height);
		} else {
			buffer.__srcImageData = buffer.__srcContext.createImageData(buffer.width,buffer.height);
			buffer.__srcImageData.data.set(buffer.data);
		}
		var elements = buffer.__srcImageData.data.buffer;
		var array = null;
		var vector = null;
		var view = null;
		var buffer1 = null;
		var len = null;
		var this1;
		if(elements != null) {
			this1 = new Uint8Array(elements);
		} else if(array != null) {
			this1 = new Uint8Array(array);
		} else if(vector != null) {
			this1 = new Uint8Array(vector.__array);
		} else if(view != null) {
			this1 = new Uint8Array(view);
		} else if(buffer1 != null) {
			if(len == null) {
				this1 = new Uint8Array(buffer1,0);
			} else {
				this1 = new Uint8Array(buffer1,0,len);
			}
		} else {
			this1 = null;
		}
		buffer.data = this1;
	}
};
lime__$internal_graphics_ImageCanvasUtil.fillRect = function(image,rect,color,format) {
	lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image);
	var r;
	var g;
	var b;
	var a;
	if(format == 1) {
		r = color >> 16 & 255;
		g = color >> 8 & 255;
		b = color & 255;
		a = image.get_transparent() ? color >> 24 & 255 : 255;
	} else {
		r = color >> 24 & 255;
		g = color >> 16 & 255;
		b = color >> 8 & 255;
		a = image.get_transparent() ? color & 255 : 255;
	}
	if(rect.x == 0 && rect.y == 0 && rect.width == image.width && rect.height == image.height) {
		if(image.get_transparent() && a == 0) {
			image.buffer.__srcCanvas.width = image.buffer.width;
			return;
		}
	}
	if(a < 255) {
		image.buffer.__srcContext.clearRect(rect.x + image.offsetX,rect.y + image.offsetY,rect.width + image.offsetX,rect.height + image.offsetY);
	}
	if(a > 0) {
		image.buffer.__srcContext.fillStyle = "rgba(" + r + ", " + g + ", " + b + ", " + a / 255 + ")";
		image.buffer.__srcContext.fillRect(rect.x + image.offsetX,rect.y + image.offsetY,rect.width + image.offsetX,rect.height + image.offsetY);
	}
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageCanvasUtil.floodFill = function(image,x,y,color,format) {
	lime__$internal_graphics_ImageCanvasUtil.convertToData(image);
	lime__$internal_graphics_ImageDataUtil.floodFill(image,x,y,color,format);
};
lime__$internal_graphics_ImageCanvasUtil.getPixel = function(image,x,y,format) {
	lime__$internal_graphics_ImageCanvasUtil.convertToData(image);
	return lime__$internal_graphics_ImageDataUtil.getPixel(image,x,y,format);
};
lime__$internal_graphics_ImageCanvasUtil.getPixel32 = function(image,x,y,format) {
	lime__$internal_graphics_ImageCanvasUtil.convertToData(image);
	return lime__$internal_graphics_ImageDataUtil.getPixel32(image,x,y,format);
};
lime__$internal_graphics_ImageCanvasUtil.getPixels = function(image,rect,format) {
	lime__$internal_graphics_ImageCanvasUtil.convertToData(image);
	return lime__$internal_graphics_ImageDataUtil.getPixels(image,rect,format);
};
lime__$internal_graphics_ImageCanvasUtil.merge = function(image,sourceImage,sourceRect,destPoint,redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier) {
	lime__$internal_graphics_ImageCanvasUtil.convertToData(sourceImage);
	lime__$internal_graphics_ImageCanvasUtil.convertToData(image);
	lime__$internal_graphics_ImageDataUtil.merge(image,sourceImage,sourceRect,destPoint,redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier);
};
lime__$internal_graphics_ImageCanvasUtil.resize = function(image,newWidth,newHeight) {
	var buffer = image.buffer;
	if(buffer.__srcCanvas == null) {
		lime__$internal_graphics_ImageCanvasUtil.createCanvas(image,newWidth,newHeight);
		buffer.__srcContext.drawImage(buffer.get_src(),0,0,newWidth,newHeight);
	} else {
		lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image,true);
		var sourceCanvas = buffer.__srcCanvas;
		buffer.__srcCanvas = null;
		lime__$internal_graphics_ImageCanvasUtil.createCanvas(image,newWidth,newHeight);
		buffer.__srcContext.drawImage(sourceCanvas,0,0,newWidth,newHeight);
	}
	buffer.__srcImageData = null;
	buffer.data = null;
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageCanvasUtil.scroll = function(image,x,y) {
	if(x % image.width == 0 && y % image.height == 0) {
		return;
	}
	var copy = image.clone();
	lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image,true);
	image.buffer.__srcContext.clearRect(x,y,image.width,image.height);
	image.buffer.__srcContext.drawImage(copy.get_src(),x,y);
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageCanvasUtil.setPixel = function(image,x,y,color,format) {
	lime__$internal_graphics_ImageCanvasUtil.convertToData(image);
	lime__$internal_graphics_ImageDataUtil.setPixel(image,x,y,color,format);
};
lime__$internal_graphics_ImageCanvasUtil.setPixel32 = function(image,x,y,color,format) {
	lime__$internal_graphics_ImageCanvasUtil.convertToData(image);
	lime__$internal_graphics_ImageDataUtil.setPixel32(image,x,y,color,format);
};
lime__$internal_graphics_ImageCanvasUtil.setPixels = function(image,rect,bytePointer,format,endian) {
	lime__$internal_graphics_ImageCanvasUtil.convertToData(image);
	lime__$internal_graphics_ImageDataUtil.setPixels(image,rect,bytePointer,format,endian);
};
lime__$internal_graphics_ImageCanvasUtil.sync = function(image,clear) {
	if(image == null) {
		return;
	}
	if(image.type == lime_graphics_ImageType.CANVAS && (image.buffer.__srcCanvas != null || image.buffer.data != null)) {
		lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image,clear);
	} else if(image.type == lime_graphics_ImageType.DATA) {
		lime__$internal_graphics_ImageCanvasUtil.convertToData(image,clear);
	}
};
var lime__$internal_graphics_ImageDataUtil = function() { };
$hxClasses["lime._internal.graphics.ImageDataUtil"] = lime__$internal_graphics_ImageDataUtil;
lime__$internal_graphics_ImageDataUtil.__name__ = "lime._internal.graphics.ImageDataUtil";
lime__$internal_graphics_ImageDataUtil.displaceMap = function(target,source,map,mapPoint,componentX,componentY,smooth) {
	var targetData = target.buffer.data;
	var sourceData = source.buffer.data;
	var mapData = map.buffer.data;
	var targetFormat = target.buffer.format;
	var sourceFormat = source.buffer.format;
	var mapFormat = map.buffer.format;
	var targetPremultiplied = target.get_premultiplied();
	var sourcePremultiplied = source.get_premultiplied();
	var mapPremultiplied = map.get_premultiplied();
	var sourceView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(source);
	var mapView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(map);
	var row;
	var sourceOffset;
	var sourcePixel;
	var mapPixel;
	var targetPixel;
	var mapPixelX;
	var mapPixelY;
	var mapPixelA;
	var s1;
	var s2;
	var s3;
	var s4;
	var mPointXFloor;
	var mPointYFloor;
	var disOffsetXFloor;
	var disOffsetYFloor;
	var disX;
	var disY;
	var _g = 0;
	var _g1 = sourceView.height;
	while(_g < _g1) {
		var y = _g++;
		row = sourceView.byteOffset + sourceView.stride * y;
		var _g2 = 0;
		var _g3 = sourceView.width;
		while(_g2 < _g3) {
			var x = _g2++;
			sourceOffset = row + x * 4;
			mPointXFloor = mapPoint.x | 0;
			mPointYFloor = mapPoint.y | 0;
			if(smooth) {
				var offset = sourceView.byteOffset + sourceView.stride * (y - mPointYFloor + 1) + (x - mPointXFloor) * 4;
				var format = mapFormat;
				var premultiplied = mapPremultiplied;
				if(premultiplied == null) {
					premultiplied = false;
				}
				if(format == null) {
					format = 0;
				}
				switch(format) {
				case 0:
					s1 = (mapData[offset] & 255) << 24 | (mapData[offset + 1] & 255) << 16 | (mapData[offset + 2] & 255) << 8 | mapData[offset + 3] & 255;
					break;
				case 1:
					s1 = (mapData[offset + 1] & 255) << 24 | (mapData[offset + 2] & 255) << 16 | (mapData[offset + 3] & 255) << 8 | mapData[offset] & 255;
					break;
				case 2:
					s1 = (mapData[offset + 2] & 255) << 24 | (mapData[offset + 1] & 255) << 16 | (mapData[offset] & 255) << 8 | mapData[offset + 3] & 255;
					break;
				}
				if(premultiplied) {
					if((s1 & 255) != 0 && (s1 & 255) != 255) {
						lime_math_RGBA.unmult = 255.0 / (s1 & 255);
						s1 = (lime_math_RGBA.__clamp[Math.round((s1 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((s1 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((s1 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | s1 & 255 & 255;
					}
				}
				var offset1 = sourceView.byteOffset + sourceView.stride * (y - mPointYFloor) + (x - mPointXFloor + 1) * 4;
				var format1 = mapFormat;
				var premultiplied1 = mapPremultiplied;
				if(premultiplied1 == null) {
					premultiplied1 = false;
				}
				if(format1 == null) {
					format1 = 0;
				}
				switch(format1) {
				case 0:
					s2 = (mapData[offset1] & 255) << 24 | (mapData[offset1 + 1] & 255) << 16 | (mapData[offset1 + 2] & 255) << 8 | mapData[offset1 + 3] & 255;
					break;
				case 1:
					s2 = (mapData[offset1 + 1] & 255) << 24 | (mapData[offset1 + 2] & 255) << 16 | (mapData[offset1 + 3] & 255) << 8 | mapData[offset1] & 255;
					break;
				case 2:
					s2 = (mapData[offset1 + 2] & 255) << 24 | (mapData[offset1 + 1] & 255) << 16 | (mapData[offset1] & 255) << 8 | mapData[offset1 + 3] & 255;
					break;
				}
				if(premultiplied1) {
					if((s2 & 255) != 0 && (s2 & 255) != 255) {
						lime_math_RGBA.unmult = 255.0 / (s2 & 255);
						s2 = (lime_math_RGBA.__clamp[Math.round((s2 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((s2 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((s2 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | s2 & 255 & 255;
					}
				}
				var offset2 = sourceView.byteOffset + sourceView.stride * (y - mPointYFloor + 1) + (x - mPointXFloor + 1) * 4;
				var format2 = mapFormat;
				var premultiplied2 = mapPremultiplied;
				if(premultiplied2 == null) {
					premultiplied2 = false;
				}
				if(format2 == null) {
					format2 = 0;
				}
				switch(format2) {
				case 0:
					s3 = (mapData[offset2] & 255) << 24 | (mapData[offset2 + 1] & 255) << 16 | (mapData[offset2 + 2] & 255) << 8 | mapData[offset2 + 3] & 255;
					break;
				case 1:
					s3 = (mapData[offset2 + 1] & 255) << 24 | (mapData[offset2 + 2] & 255) << 16 | (mapData[offset2 + 3] & 255) << 8 | mapData[offset2] & 255;
					break;
				case 2:
					s3 = (mapData[offset2 + 2] & 255) << 24 | (mapData[offset2 + 1] & 255) << 16 | (mapData[offset2] & 255) << 8 | mapData[offset2 + 3] & 255;
					break;
				}
				if(premultiplied2) {
					if((s3 & 255) != 0 && (s3 & 255) != 255) {
						lime_math_RGBA.unmult = 255.0 / (s3 & 255);
						s3 = (lime_math_RGBA.__clamp[Math.round((s3 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((s3 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((s3 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | s3 & 255 & 255;
					}
				}
				var offset3 = sourceView.byteOffset + sourceView.stride * (y - mPointYFloor) + (x - mPointXFloor) * 4;
				var format3 = mapFormat;
				var premultiplied3 = mapPremultiplied;
				if(premultiplied3 == null) {
					premultiplied3 = false;
				}
				if(format3 == null) {
					format3 = 0;
				}
				switch(format3) {
				case 0:
					s4 = (mapData[offset3] & 255) << 24 | (mapData[offset3 + 1] & 255) << 16 | (mapData[offset3 + 2] & 255) << 8 | mapData[offset3 + 3] & 255;
					break;
				case 1:
					s4 = (mapData[offset3 + 1] & 255) << 24 | (mapData[offset3 + 2] & 255) << 16 | (mapData[offset3 + 3] & 255) << 8 | mapData[offset3] & 255;
					break;
				case 2:
					s4 = (mapData[offset3 + 2] & 255) << 24 | (mapData[offset3 + 1] & 255) << 16 | (mapData[offset3] & 255) << 8 | mapData[offset3 + 3] & 255;
					break;
				}
				if(premultiplied3) {
					if((s4 & 255) != 0 && (s4 & 255) != 255) {
						lime_math_RGBA.unmult = 255.0 / (s4 & 255);
						s4 = (lime_math_RGBA.__clamp[Math.round((s4 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((s4 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((s4 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | s4 & 255 & 255;
					}
				}
				mapPixel = lime__$internal_graphics_ImageDataUtil.bilinear(s1,s2,s3,s4,mapPoint.x - mPointXFloor,mapPoint.y - mPointYFloor);
			} else {
				var offset4 = mapView.byteOffset + mapView.stride * (y - mPointYFloor) + (x - mPointXFloor) * 4;
				var format4 = mapFormat;
				var premultiplied4 = mapPremultiplied;
				if(premultiplied4 == null) {
					premultiplied4 = false;
				}
				if(format4 == null) {
					format4 = 0;
				}
				switch(format4) {
				case 0:
					mapPixel = (mapData[offset4] & 255) << 24 | (mapData[offset4 + 1] & 255) << 16 | (mapData[offset4 + 2] & 255) << 8 | mapData[offset4 + 3] & 255;
					break;
				case 1:
					mapPixel = (mapData[offset4 + 1] & 255) << 24 | (mapData[offset4 + 2] & 255) << 16 | (mapData[offset4 + 3] & 255) << 8 | mapData[offset4] & 255;
					break;
				case 2:
					mapPixel = (mapData[offset4 + 2] & 255) << 24 | (mapData[offset4 + 1] & 255) << 16 | (mapData[offset4] & 255) << 8 | mapData[offset4 + 3] & 255;
					break;
				}
				if(premultiplied4) {
					if((mapPixel & 255) != 0 && (mapPixel & 255) != 255) {
						lime_math_RGBA.unmult = 255.0 / (mapPixel & 255);
						mapPixel = (lime_math_RGBA.__clamp[Math.round((mapPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((mapPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((mapPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | mapPixel & 255 & 255;
					}
				}
			}
			mapPixelA = (mapPixel & 255) / 255.0;
			mapPixelX = ((mapPixel >>> 24 & 255) - 128) / 255.0 * mapPixelA;
			mapPixelY = ((mapPixel >>> 16 & 255) - 128) / 255.0 * mapPixelA;
			disX = mapPixelX * componentX.x + mapPixelY * componentY.x;
			disY = mapPixelX * componentX.y + mapPixelY * componentY.y;
			disOffsetXFloor = Math.floor(disX * sourceView.width);
			disOffsetYFloor = Math.floor(disY * sourceView.height);
			if(smooth) {
				var offset5 = sourceView.byteOffset + sourceView.stride * (y + disOffsetYFloor + 1) + (x + disOffsetXFloor) * 4;
				var format5 = sourceFormat;
				var premultiplied5 = sourcePremultiplied;
				if(premultiplied5 == null) {
					premultiplied5 = false;
				}
				if(format5 == null) {
					format5 = 0;
				}
				switch(format5) {
				case 0:
					s1 = (sourceData[offset5] & 255) << 24 | (sourceData[offset5 + 1] & 255) << 16 | (sourceData[offset5 + 2] & 255) << 8 | sourceData[offset5 + 3] & 255;
					break;
				case 1:
					s1 = (sourceData[offset5 + 1] & 255) << 24 | (sourceData[offset5 + 2] & 255) << 16 | (sourceData[offset5 + 3] & 255) << 8 | sourceData[offset5] & 255;
					break;
				case 2:
					s1 = (sourceData[offset5 + 2] & 255) << 24 | (sourceData[offset5 + 1] & 255) << 16 | (sourceData[offset5] & 255) << 8 | sourceData[offset5 + 3] & 255;
					break;
				}
				if(premultiplied5) {
					if((s1 & 255) != 0 && (s1 & 255) != 255) {
						lime_math_RGBA.unmult = 255.0 / (s1 & 255);
						s1 = (lime_math_RGBA.__clamp[Math.round((s1 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((s1 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((s1 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | s1 & 255 & 255;
					}
				}
				var offset6 = sourceView.byteOffset + sourceView.stride * (y + disOffsetYFloor) + (x + disOffsetXFloor + 1) * 4;
				var format6 = sourceFormat;
				var premultiplied6 = sourcePremultiplied;
				if(premultiplied6 == null) {
					premultiplied6 = false;
				}
				if(format6 == null) {
					format6 = 0;
				}
				switch(format6) {
				case 0:
					s2 = (sourceData[offset6] & 255) << 24 | (sourceData[offset6 + 1] & 255) << 16 | (sourceData[offset6 + 2] & 255) << 8 | sourceData[offset6 + 3] & 255;
					break;
				case 1:
					s2 = (sourceData[offset6 + 1] & 255) << 24 | (sourceData[offset6 + 2] & 255) << 16 | (sourceData[offset6 + 3] & 255) << 8 | sourceData[offset6] & 255;
					break;
				case 2:
					s2 = (sourceData[offset6 + 2] & 255) << 24 | (sourceData[offset6 + 1] & 255) << 16 | (sourceData[offset6] & 255) << 8 | sourceData[offset6 + 3] & 255;
					break;
				}
				if(premultiplied6) {
					if((s2 & 255) != 0 && (s2 & 255) != 255) {
						lime_math_RGBA.unmult = 255.0 / (s2 & 255);
						s2 = (lime_math_RGBA.__clamp[Math.round((s2 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((s2 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((s2 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | s2 & 255 & 255;
					}
				}
				var offset7 = sourceView.byteOffset + sourceView.stride * (y + disOffsetYFloor + 1) + (x + disOffsetXFloor + 1) * 4;
				var format7 = sourceFormat;
				var premultiplied7 = sourcePremultiplied;
				if(premultiplied7 == null) {
					premultiplied7 = false;
				}
				if(format7 == null) {
					format7 = 0;
				}
				switch(format7) {
				case 0:
					s3 = (sourceData[offset7] & 255) << 24 | (sourceData[offset7 + 1] & 255) << 16 | (sourceData[offset7 + 2] & 255) << 8 | sourceData[offset7 + 3] & 255;
					break;
				case 1:
					s3 = (sourceData[offset7 + 1] & 255) << 24 | (sourceData[offset7 + 2] & 255) << 16 | (sourceData[offset7 + 3] & 255) << 8 | sourceData[offset7] & 255;
					break;
				case 2:
					s3 = (sourceData[offset7 + 2] & 255) << 24 | (sourceData[offset7 + 1] & 255) << 16 | (sourceData[offset7] & 255) << 8 | sourceData[offset7 + 3] & 255;
					break;
				}
				if(premultiplied7) {
					if((s3 & 255) != 0 && (s3 & 255) != 255) {
						lime_math_RGBA.unmult = 255.0 / (s3 & 255);
						s3 = (lime_math_RGBA.__clamp[Math.round((s3 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((s3 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((s3 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | s3 & 255 & 255;
					}
				}
				var offset8 = sourceView.byteOffset + sourceView.stride * (y + disOffsetYFloor) + (x + disOffsetXFloor) * 4;
				var format8 = sourceFormat;
				var premultiplied8 = sourcePremultiplied;
				if(premultiplied8 == null) {
					premultiplied8 = false;
				}
				if(format8 == null) {
					format8 = 0;
				}
				switch(format8) {
				case 0:
					s4 = (sourceData[offset8] & 255) << 24 | (sourceData[offset8 + 1] & 255) << 16 | (sourceData[offset8 + 2] & 255) << 8 | sourceData[offset8 + 3] & 255;
					break;
				case 1:
					s4 = (sourceData[offset8 + 1] & 255) << 24 | (sourceData[offset8 + 2] & 255) << 16 | (sourceData[offset8 + 3] & 255) << 8 | sourceData[offset8] & 255;
					break;
				case 2:
					s4 = (sourceData[offset8 + 2] & 255) << 24 | (sourceData[offset8 + 1] & 255) << 16 | (sourceData[offset8] & 255) << 8 | sourceData[offset8 + 3] & 255;
					break;
				}
				if(premultiplied8) {
					if((s4 & 255) != 0 && (s4 & 255) != 255) {
						lime_math_RGBA.unmult = 255.0 / (s4 & 255);
						s4 = (lime_math_RGBA.__clamp[Math.round((s4 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((s4 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((s4 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | s4 & 255 & 255;
					}
				}
				sourcePixel = lime__$internal_graphics_ImageDataUtil.bilinear(s1,s2,s3,s4,disX * sourceView.width - disOffsetXFloor,disY * sourceView.height - disOffsetYFloor);
			} else {
				var offset9 = sourceView.byteOffset + sourceView.stride * (y + disOffsetYFloor) + (x + disOffsetXFloor) * 4;
				var format9 = sourceFormat;
				var premultiplied9 = sourcePremultiplied;
				if(premultiplied9 == null) {
					premultiplied9 = false;
				}
				if(format9 == null) {
					format9 = 0;
				}
				switch(format9) {
				case 0:
					sourcePixel = (sourceData[offset9] & 255) << 24 | (sourceData[offset9 + 1] & 255) << 16 | (sourceData[offset9 + 2] & 255) << 8 | sourceData[offset9 + 3] & 255;
					break;
				case 1:
					sourcePixel = (sourceData[offset9 + 1] & 255) << 24 | (sourceData[offset9 + 2] & 255) << 16 | (sourceData[offset9 + 3] & 255) << 8 | sourceData[offset9] & 255;
					break;
				case 2:
					sourcePixel = (sourceData[offset9 + 2] & 255) << 24 | (sourceData[offset9 + 1] & 255) << 16 | (sourceData[offset9] & 255) << 8 | sourceData[offset9 + 3] & 255;
					break;
				}
				if(premultiplied9) {
					if((sourcePixel & 255) != 0 && (sourcePixel & 255) != 255) {
						lime_math_RGBA.unmult = 255.0 / (sourcePixel & 255);
						sourcePixel = (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | sourcePixel & 255 & 255;
					}
				}
			}
			var format10 = targetFormat;
			var premultiplied10 = targetPremultiplied;
			if(premultiplied10 == null) {
				premultiplied10 = false;
			}
			if(format10 == null) {
				format10 = 0;
			}
			if(premultiplied10) {
				if((sourcePixel & 255) == 0) {
					if(sourcePixel != 0) {
						sourcePixel = 0;
					}
				} else if((sourcePixel & 255) != 255) {
					lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[sourcePixel & 255];
					sourcePixel = ((sourcePixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((sourcePixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((sourcePixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | sourcePixel & 255 & 255;
				}
			}
			switch(format10) {
			case 0:
				targetData[sourceOffset] = sourcePixel >>> 24 & 255;
				targetData[sourceOffset + 1] = sourcePixel >>> 16 & 255;
				targetData[sourceOffset + 2] = sourcePixel >>> 8 & 255;
				targetData[sourceOffset + 3] = sourcePixel & 255;
				break;
			case 1:
				targetData[sourceOffset] = sourcePixel & 255;
				targetData[sourceOffset + 1] = sourcePixel >>> 24 & 255;
				targetData[sourceOffset + 2] = sourcePixel >>> 16 & 255;
				targetData[sourceOffset + 3] = sourcePixel >>> 8 & 255;
				break;
			case 2:
				targetData[sourceOffset] = sourcePixel >>> 8 & 255;
				targetData[sourceOffset + 1] = sourcePixel >>> 16 & 255;
				targetData[sourceOffset + 2] = sourcePixel >>> 24 & 255;
				targetData[sourceOffset + 3] = sourcePixel & 255;
				break;
			}
		}
	}
	target.dirty = true;
	target.version++;
};
lime__$internal_graphics_ImageDataUtil.bilinear = function(s1,s2,s3,s4,su,sv) {
	return lime__$internal_graphics_ImageDataUtil.lerpRGBA(lime__$internal_graphics_ImageDataUtil.lerpRGBA(s4,s2,su),lime__$internal_graphics_ImageDataUtil.lerpRGBA(s1,s3,su),sv);
};
lime__$internal_graphics_ImageDataUtil.lerpRGBA = function(v0,v1,x) {
	var this1 = 0;
	var result = this1;
	var value = Math.floor(lime__$internal_graphics_ImageDataUtil.lerp(v0 >>> 24 & 255,v1 >>> 24 & 255,x));
	result = (value & 255) << 24 | (result >>> 16 & 255 & 255) << 16 | (result >>> 8 & 255 & 255) << 8 | result & 255 & 255;
	var value = Math.floor(lime__$internal_graphics_ImageDataUtil.lerp(v0 >>> 16 & 255,v1 >>> 16 & 255,x));
	result = (result >>> 24 & 255 & 255) << 24 | (value & 255) << 16 | (result >>> 8 & 255 & 255) << 8 | result & 255 & 255;
	var value = Math.floor(lime__$internal_graphics_ImageDataUtil.lerp(v0 >>> 8 & 255,v1 >>> 8 & 255,x));
	result = (result >>> 24 & 255 & 255) << 24 | (result >>> 16 & 255 & 255) << 16 | (value & 255) << 8 | result & 255 & 255;
	var value = Math.floor(lime__$internal_graphics_ImageDataUtil.lerp(v0 & 255,v1 & 255,x));
	result = (result >>> 24 & 255 & 255) << 24 | (result >>> 16 & 255 & 255) << 16 | (result >>> 8 & 255 & 255) << 8 | value & 255;
	return result;
};
lime__$internal_graphics_ImageDataUtil.lerp4f = function(v0,v1,x) {
	return new lime_math_Vector4(lime__$internal_graphics_ImageDataUtil.lerp(v0.x,v1.x,x),lime__$internal_graphics_ImageDataUtil.lerp(v0.y,v1.y,x),lime__$internal_graphics_ImageDataUtil.lerp(v0.z,v1.z,x),lime__$internal_graphics_ImageDataUtil.lerp(v0.w,v1.w,x));
};
lime__$internal_graphics_ImageDataUtil.lerp = function(v0,v1,x) {
	return (1.0 - x) * v0 + x * v1;
};
lime__$internal_graphics_ImageDataUtil.colorTransform = function(image,rect,colorMatrix) {
	var data = image.buffer.data;
	if(data == null) {
		return;
	}
	var format = image.buffer.format;
	var premultiplied = image.buffer.premultiplied;
	var dataView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(image,rect);
	var alphaTable = lime_math_ColorMatrix.getAlphaTable(colorMatrix);
	var redTable = lime_math_ColorMatrix.getRedTable(colorMatrix);
	var greenTable = lime_math_ColorMatrix.getGreenTable(colorMatrix);
	var blueTable = lime_math_ColorMatrix.getBlueTable(colorMatrix);
	var row;
	var offset;
	var pixel;
	var _g = 0;
	var _g1 = dataView.height;
	while(_g < _g1) {
		var y = _g++;
		row = dataView.byteOffset + dataView.stride * y;
		var _g2 = 0;
		var _g3 = dataView.width;
		while(_g2 < _g3) {
			var x = _g2++;
			offset = row + x * 4;
			var format1 = format;
			var premultiplied1 = premultiplied;
			if(premultiplied1 == null) {
				premultiplied1 = false;
			}
			if(format1 == null) {
				format1 = 0;
			}
			switch(format1) {
			case 0:
				pixel = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255;
				break;
			case 1:
				pixel = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255;
				break;
			case 2:
				pixel = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255;
				break;
			}
			if(premultiplied1) {
				if((pixel & 255) != 0 && (pixel & 255) != 255) {
					lime_math_RGBA.unmult = 255.0 / (pixel & 255);
					pixel = (lime_math_RGBA.__clamp[Math.round((pixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | pixel & 255 & 255;
				}
			}
			pixel = (redTable[pixel >>> 24 & 255] & 255) << 24 | (greenTable[pixel >>> 16 & 255] & 255) << 16 | (blueTable[pixel >>> 8 & 255] & 255) << 8 | alphaTable[pixel & 255] & 255;
			var format2 = format;
			var premultiplied2 = premultiplied;
			if(premultiplied2 == null) {
				premultiplied2 = false;
			}
			if(format2 == null) {
				format2 = 0;
			}
			if(premultiplied2) {
				if((pixel & 255) == 0) {
					if(pixel != 0) {
						pixel = 0;
					}
				} else if((pixel & 255) != 255) {
					lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[pixel & 255];
					pixel = ((pixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((pixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((pixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | pixel & 255 & 255;
				}
			}
			switch(format2) {
			case 0:
				data[offset] = pixel >>> 24 & 255;
				data[offset + 1] = pixel >>> 16 & 255;
				data[offset + 2] = pixel >>> 8 & 255;
				data[offset + 3] = pixel & 255;
				break;
			case 1:
				data[offset] = pixel & 255;
				data[offset + 1] = pixel >>> 24 & 255;
				data[offset + 2] = pixel >>> 16 & 255;
				data[offset + 3] = pixel >>> 8 & 255;
				break;
			case 2:
				data[offset] = pixel >>> 8 & 255;
				data[offset + 1] = pixel >>> 16 & 255;
				data[offset + 2] = pixel >>> 24 & 255;
				data[offset + 3] = pixel & 255;
				break;
			}
		}
	}
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.copyChannel = function(image,sourceImage,sourceRect,destPoint,sourceChannel,destChannel) {
	var destIdx;
	switch(destChannel._hx_index) {
	case 0:
		destIdx = 0;
		break;
	case 1:
		destIdx = 1;
		break;
	case 2:
		destIdx = 2;
		break;
	case 3:
		destIdx = 3;
		break;
	}
	var srcIdx;
	switch(sourceChannel._hx_index) {
	case 0:
		srcIdx = 0;
		break;
	case 1:
		srcIdx = 1;
		break;
	case 2:
		srcIdx = 2;
		break;
	case 3:
		srcIdx = 3;
		break;
	}
	var srcData = sourceImage.buffer.data;
	var destData = image.buffer.data;
	if(srcData == null || destData == null) {
		return;
	}
	var srcView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(sourceImage,sourceRect);
	var destView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(image,new lime_math_Rectangle(destPoint.x,destPoint.y,srcView.width,srcView.height));
	var srcFormat = sourceImage.buffer.format;
	var destFormat = image.buffer.format;
	var srcPremultiplied = sourceImage.buffer.premultiplied;
	var destPremultiplied = image.buffer.premultiplied;
	var srcPosition;
	var destPosition;
	var srcPixel;
	var destPixel;
	var value = 0;
	var _g = 0;
	var _g1 = destView.height;
	while(_g < _g1) {
		var y = _g++;
		srcPosition = srcView.byteOffset + srcView.stride * y;
		destPosition = destView.byteOffset + destView.stride * y;
		var _g2 = 0;
		var _g3 = destView.width;
		while(_g2 < _g3) {
			var x = _g2++;
			var format = srcFormat;
			var premultiplied = srcPremultiplied;
			if(premultiplied == null) {
				premultiplied = false;
			}
			if(format == null) {
				format = 0;
			}
			switch(format) {
			case 0:
				srcPixel = (srcData[srcPosition] & 255) << 24 | (srcData[srcPosition + 1] & 255) << 16 | (srcData[srcPosition + 2] & 255) << 8 | srcData[srcPosition + 3] & 255;
				break;
			case 1:
				srcPixel = (srcData[srcPosition + 1] & 255) << 24 | (srcData[srcPosition + 2] & 255) << 16 | (srcData[srcPosition + 3] & 255) << 8 | srcData[srcPosition] & 255;
				break;
			case 2:
				srcPixel = (srcData[srcPosition + 2] & 255) << 24 | (srcData[srcPosition + 1] & 255) << 16 | (srcData[srcPosition] & 255) << 8 | srcData[srcPosition + 3] & 255;
				break;
			}
			if(premultiplied) {
				if((srcPixel & 255) != 0 && (srcPixel & 255) != 255) {
					lime_math_RGBA.unmult = 255.0 / (srcPixel & 255);
					srcPixel = (lime_math_RGBA.__clamp[Math.round((srcPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((srcPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((srcPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | srcPixel & 255 & 255;
				}
			}
			var format1 = destFormat;
			var premultiplied1 = destPremultiplied;
			if(premultiplied1 == null) {
				premultiplied1 = false;
			}
			if(format1 == null) {
				format1 = 0;
			}
			switch(format1) {
			case 0:
				destPixel = (destData[destPosition] & 255) << 24 | (destData[destPosition + 1] & 255) << 16 | (destData[destPosition + 2] & 255) << 8 | destData[destPosition + 3] & 255;
				break;
			case 1:
				destPixel = (destData[destPosition + 1] & 255) << 24 | (destData[destPosition + 2] & 255) << 16 | (destData[destPosition + 3] & 255) << 8 | destData[destPosition] & 255;
				break;
			case 2:
				destPixel = (destData[destPosition + 2] & 255) << 24 | (destData[destPosition + 1] & 255) << 16 | (destData[destPosition] & 255) << 8 | destData[destPosition + 3] & 255;
				break;
			}
			if(premultiplied1) {
				if((destPixel & 255) != 0 && (destPixel & 255) != 255) {
					lime_math_RGBA.unmult = 255.0 / (destPixel & 255);
					destPixel = (lime_math_RGBA.__clamp[Math.round((destPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((destPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((destPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | destPixel & 255 & 255;
				}
			}
			switch(srcIdx) {
			case 0:
				value = srcPixel >>> 24 & 255;
				break;
			case 1:
				value = srcPixel >>> 16 & 255;
				break;
			case 2:
				value = srcPixel >>> 8 & 255;
				break;
			case 3:
				value = srcPixel & 255;
				break;
			}
			switch(destIdx) {
			case 0:
				destPixel = (value & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | destPixel & 255 & 255;
				break;
			case 1:
				destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (value & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | destPixel & 255 & 255;
				break;
			case 2:
				destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (value & 255) << 8 | destPixel & 255 & 255;
				break;
			case 3:
				destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | value & 255;
				break;
			}
			var format2 = destFormat;
			var premultiplied2 = destPremultiplied;
			if(premultiplied2 == null) {
				premultiplied2 = false;
			}
			if(format2 == null) {
				format2 = 0;
			}
			if(premultiplied2) {
				if((destPixel & 255) == 0) {
					if(destPixel != 0) {
						destPixel = 0;
					}
				} else if((destPixel & 255) != 255) {
					lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[destPixel & 255];
					destPixel = ((destPixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((destPixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((destPixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | destPixel & 255 & 255;
				}
			}
			switch(format2) {
			case 0:
				destData[destPosition] = destPixel >>> 24 & 255;
				destData[destPosition + 1] = destPixel >>> 16 & 255;
				destData[destPosition + 2] = destPixel >>> 8 & 255;
				destData[destPosition + 3] = destPixel & 255;
				break;
			case 1:
				destData[destPosition] = destPixel & 255;
				destData[destPosition + 1] = destPixel >>> 24 & 255;
				destData[destPosition + 2] = destPixel >>> 16 & 255;
				destData[destPosition + 3] = destPixel >>> 8 & 255;
				break;
			case 2:
				destData[destPosition] = destPixel >>> 8 & 255;
				destData[destPosition + 1] = destPixel >>> 16 & 255;
				destData[destPosition + 2] = destPixel >>> 24 & 255;
				destData[destPosition + 3] = destPixel & 255;
				break;
			}
			srcPosition += 4;
			destPosition += 4;
		}
	}
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.copyPixels = function(image,sourceImage,sourceRect,destPoint,alphaImage,alphaPoint,mergeAlpha) {
	if(mergeAlpha == null) {
		mergeAlpha = false;
	}
	if(image.width == sourceImage.width && image.height == sourceImage.height && sourceRect.width == sourceImage.width && sourceRect.height == sourceImage.height && sourceRect.x == 0 && sourceRect.y == 0 && destPoint.x == 0 && destPoint.y == 0 && alphaImage == null && alphaPoint == null && mergeAlpha == false && image.get_format() == sourceImage.get_format()) {
		image.buffer.data.set(sourceImage.buffer.data);
	} else {
		var sourceData = sourceImage.buffer.data;
		var destData = image.buffer.data;
		if(sourceData == null || destData == null) {
			return;
		}
		var sourceView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(sourceImage,sourceRect);
		var destRect = new lime_math_Rectangle(destPoint.x,destPoint.y,sourceView.width,sourceView.height);
		var destView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(image,destRect);
		var sourceFormat = sourceImage.buffer.format;
		var destFormat = image.buffer.format;
		var sourcePosition;
		var destPosition;
		var sourceAlpha;
		var destAlpha;
		var oneMinusSourceAlpha;
		var blendAlpha;
		var sourcePixel;
		var destPixel;
		var sourcePremultiplied = sourceImage.buffer.premultiplied;
		var destPremultiplied = image.buffer.premultiplied;
		var sourceBytesPerPixel = sourceImage.buffer.bitsPerPixel / 8 | 0;
		var destBytesPerPixel = image.buffer.bitsPerPixel / 8 | 0;
		var useAlphaImage = alphaImage != null && alphaImage.get_transparent();
		var blend = mergeAlpha || useAlphaImage && !image.get_transparent() || !mergeAlpha && !image.get_transparent() && sourceImage.get_transparent();
		if(!useAlphaImage) {
			if(blend) {
				var _g = 0;
				var _g1 = destView.height;
				while(_g < _g1) {
					var y = _g++;
					sourcePosition = sourceView.byteOffset + sourceView.stride * y;
					destPosition = destView.byteOffset + destView.stride * y;
					var _g2 = 0;
					var _g3 = destView.width;
					while(_g2 < _g3) {
						var x = _g2++;
						var format = sourceFormat;
						var premultiplied = sourcePremultiplied;
						if(premultiplied == null) {
							premultiplied = false;
						}
						if(format == null) {
							format = 0;
						}
						switch(format) {
						case 0:
							sourcePixel = (sourceData[sourcePosition] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition + 2] & 255) << 8 | sourceData[sourcePosition + 3] & 255;
							break;
						case 1:
							sourcePixel = (sourceData[sourcePosition + 1] & 255) << 24 | (sourceData[sourcePosition + 2] & 255) << 16 | (sourceData[sourcePosition + 3] & 255) << 8 | sourceData[sourcePosition] & 255;
							break;
						case 2:
							sourcePixel = (sourceData[sourcePosition + 2] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition] & 255) << 8 | sourceData[sourcePosition + 3] & 255;
							break;
						}
						if(premultiplied) {
							if((sourcePixel & 255) != 0 && (sourcePixel & 255) != 255) {
								lime_math_RGBA.unmult = 255.0 / (sourcePixel & 255);
								sourcePixel = (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | sourcePixel & 255 & 255;
							}
						}
						var format1 = destFormat;
						var premultiplied1 = destPremultiplied;
						if(premultiplied1 == null) {
							premultiplied1 = false;
						}
						if(format1 == null) {
							format1 = 0;
						}
						switch(format1) {
						case 0:
							destPixel = (destData[destPosition] & 255) << 24 | (destData[destPosition + 1] & 255) << 16 | (destData[destPosition + 2] & 255) << 8 | destData[destPosition + 3] & 255;
							break;
						case 1:
							destPixel = (destData[destPosition + 1] & 255) << 24 | (destData[destPosition + 2] & 255) << 16 | (destData[destPosition + 3] & 255) << 8 | destData[destPosition] & 255;
							break;
						case 2:
							destPixel = (destData[destPosition + 2] & 255) << 24 | (destData[destPosition + 1] & 255) << 16 | (destData[destPosition] & 255) << 8 | destData[destPosition + 3] & 255;
							break;
						}
						if(premultiplied1) {
							if((destPixel & 255) != 0 && (destPixel & 255) != 255) {
								lime_math_RGBA.unmult = 255.0 / (destPixel & 255);
								destPixel = (lime_math_RGBA.__clamp[Math.round((destPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((destPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((destPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | destPixel & 255 & 255;
							}
						}
						sourceAlpha = (sourcePixel & 255) / 255.0;
						destAlpha = (destPixel & 255) / 255.0;
						oneMinusSourceAlpha = 1 - sourceAlpha;
						blendAlpha = sourceAlpha + destAlpha * oneMinusSourceAlpha;
						if(blendAlpha == 0) {
							destPixel = 0;
						} else {
							var value = lime_math_RGBA.__clamp[Math.round(((sourcePixel >>> 24 & 255) * sourceAlpha + (destPixel >>> 24 & 255) * destAlpha * oneMinusSourceAlpha) / blendAlpha)];
							destPixel = (value & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | destPixel & 255 & 255;
							var value1 = lime_math_RGBA.__clamp[Math.round(((sourcePixel >>> 16 & 255) * sourceAlpha + (destPixel >>> 16 & 255) * destAlpha * oneMinusSourceAlpha) / blendAlpha)];
							destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (value1 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | destPixel & 255 & 255;
							var value2 = lime_math_RGBA.__clamp[Math.round(((sourcePixel >>> 8 & 255) * sourceAlpha + (destPixel >>> 8 & 255) * destAlpha * oneMinusSourceAlpha) / blendAlpha)];
							destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (value2 & 255) << 8 | destPixel & 255 & 255;
							var value3 = lime_math_RGBA.__clamp[Math.round(blendAlpha * 255.0)];
							destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | value3 & 255;
						}
						var format2 = destFormat;
						var premultiplied2 = destPremultiplied;
						if(premultiplied2 == null) {
							premultiplied2 = false;
						}
						if(format2 == null) {
							format2 = 0;
						}
						if(premultiplied2) {
							if((destPixel & 255) == 0) {
								if(destPixel != 0) {
									destPixel = 0;
								}
							} else if((destPixel & 255) != 255) {
								lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[destPixel & 255];
								destPixel = ((destPixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((destPixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((destPixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | destPixel & 255 & 255;
							}
						}
						switch(format2) {
						case 0:
							destData[destPosition] = destPixel >>> 24 & 255;
							destData[destPosition + 1] = destPixel >>> 16 & 255;
							destData[destPosition + 2] = destPixel >>> 8 & 255;
							destData[destPosition + 3] = destPixel & 255;
							break;
						case 1:
							destData[destPosition] = destPixel & 255;
							destData[destPosition + 1] = destPixel >>> 24 & 255;
							destData[destPosition + 2] = destPixel >>> 16 & 255;
							destData[destPosition + 3] = destPixel >>> 8 & 255;
							break;
						case 2:
							destData[destPosition] = destPixel >>> 8 & 255;
							destData[destPosition + 1] = destPixel >>> 16 & 255;
							destData[destPosition + 2] = destPixel >>> 24 & 255;
							destData[destPosition + 3] = destPixel & 255;
							break;
						}
						sourcePosition += 4;
						destPosition += 4;
					}
				}
			} else if(sourceFormat == destFormat && sourcePremultiplied == destPremultiplied && sourceBytesPerPixel == destBytesPerPixel) {
				var _g = 0;
				var _g1 = destView.height;
				while(_g < _g1) {
					var y = _g++;
					sourcePosition = sourceView.byteOffset + sourceView.stride * y;
					destPosition = destView.byteOffset + destView.stride * y;
					destData.set(sourceData.subarray(sourcePosition,sourcePosition + destView.width * destBytesPerPixel),destPosition);
				}
			} else {
				var _g = 0;
				var _g1 = destView.height;
				while(_g < _g1) {
					var y = _g++;
					sourcePosition = sourceView.byteOffset + sourceView.stride * y;
					destPosition = destView.byteOffset + destView.stride * y;
					var _g2 = 0;
					var _g3 = destView.width;
					while(_g2 < _g3) {
						var x = _g2++;
						var format = sourceFormat;
						var premultiplied = sourcePremultiplied;
						if(premultiplied == null) {
							premultiplied = false;
						}
						if(format == null) {
							format = 0;
						}
						switch(format) {
						case 0:
							sourcePixel = (sourceData[sourcePosition] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition + 2] & 255) << 8 | sourceData[sourcePosition + 3] & 255;
							break;
						case 1:
							sourcePixel = (sourceData[sourcePosition + 1] & 255) << 24 | (sourceData[sourcePosition + 2] & 255) << 16 | (sourceData[sourcePosition + 3] & 255) << 8 | sourceData[sourcePosition] & 255;
							break;
						case 2:
							sourcePixel = (sourceData[sourcePosition + 2] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition] & 255) << 8 | sourceData[sourcePosition + 3] & 255;
							break;
						}
						if(premultiplied) {
							if((sourcePixel & 255) != 0 && (sourcePixel & 255) != 255) {
								lime_math_RGBA.unmult = 255.0 / (sourcePixel & 255);
								sourcePixel = (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | sourcePixel & 255 & 255;
							}
						}
						var format1 = destFormat;
						var premultiplied1 = destPremultiplied;
						if(premultiplied1 == null) {
							premultiplied1 = false;
						}
						if(format1 == null) {
							format1 = 0;
						}
						if(premultiplied1) {
							if((sourcePixel & 255) == 0) {
								if(sourcePixel != 0) {
									sourcePixel = 0;
								}
							} else if((sourcePixel & 255) != 255) {
								lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[sourcePixel & 255];
								sourcePixel = ((sourcePixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((sourcePixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((sourcePixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | sourcePixel & 255 & 255;
							}
						}
						switch(format1) {
						case 0:
							destData[destPosition] = sourcePixel >>> 24 & 255;
							destData[destPosition + 1] = sourcePixel >>> 16 & 255;
							destData[destPosition + 2] = sourcePixel >>> 8 & 255;
							destData[destPosition + 3] = sourcePixel & 255;
							break;
						case 1:
							destData[destPosition] = sourcePixel & 255;
							destData[destPosition + 1] = sourcePixel >>> 24 & 255;
							destData[destPosition + 2] = sourcePixel >>> 16 & 255;
							destData[destPosition + 3] = sourcePixel >>> 8 & 255;
							break;
						case 2:
							destData[destPosition] = sourcePixel >>> 8 & 255;
							destData[destPosition + 1] = sourcePixel >>> 16 & 255;
							destData[destPosition + 2] = sourcePixel >>> 24 & 255;
							destData[destPosition + 3] = sourcePixel & 255;
							break;
						}
						sourcePosition += 4;
						destPosition += 4;
					}
				}
			}
		} else {
			var alphaData = alphaImage.buffer.data;
			var alphaFormat = alphaImage.buffer.format;
			var alphaPosition;
			var alphaPixel;
			var alphaView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(alphaImage,new lime_math_Rectangle(sourceView.x + (alphaPoint == null ? 0 : alphaPoint.x),sourceView.y + (alphaPoint == null ? 0 : alphaPoint.y),sourceView.width,sourceView.height));
			destView.clip(destPoint.x | 0,destPoint.y | 0,alphaView.width,alphaView.height);
			if(blend) {
				var _g = 0;
				var _g1 = destView.height;
				while(_g < _g1) {
					var y = _g++;
					sourcePosition = sourceView.byteOffset + sourceView.stride * y;
					destPosition = destView.byteOffset + destView.stride * y;
					alphaPosition = alphaView.byteOffset + alphaView.stride * y;
					var _g2 = 0;
					var _g3 = destView.width;
					while(_g2 < _g3) {
						var x = _g2++;
						var format = sourceFormat;
						var premultiplied = sourcePremultiplied;
						if(premultiplied == null) {
							premultiplied = false;
						}
						if(format == null) {
							format = 0;
						}
						switch(format) {
						case 0:
							sourcePixel = (sourceData[sourcePosition] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition + 2] & 255) << 8 | sourceData[sourcePosition + 3] & 255;
							break;
						case 1:
							sourcePixel = (sourceData[sourcePosition + 1] & 255) << 24 | (sourceData[sourcePosition + 2] & 255) << 16 | (sourceData[sourcePosition + 3] & 255) << 8 | sourceData[sourcePosition] & 255;
							break;
						case 2:
							sourcePixel = (sourceData[sourcePosition + 2] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition] & 255) << 8 | sourceData[sourcePosition + 3] & 255;
							break;
						}
						if(premultiplied) {
							if((sourcePixel & 255) != 0 && (sourcePixel & 255) != 255) {
								lime_math_RGBA.unmult = 255.0 / (sourcePixel & 255);
								sourcePixel = (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | sourcePixel & 255 & 255;
							}
						}
						var format1 = destFormat;
						var premultiplied1 = destPremultiplied;
						if(premultiplied1 == null) {
							premultiplied1 = false;
						}
						if(format1 == null) {
							format1 = 0;
						}
						switch(format1) {
						case 0:
							destPixel = (destData[destPosition] & 255) << 24 | (destData[destPosition + 1] & 255) << 16 | (destData[destPosition + 2] & 255) << 8 | destData[destPosition + 3] & 255;
							break;
						case 1:
							destPixel = (destData[destPosition + 1] & 255) << 24 | (destData[destPosition + 2] & 255) << 16 | (destData[destPosition + 3] & 255) << 8 | destData[destPosition] & 255;
							break;
						case 2:
							destPixel = (destData[destPosition + 2] & 255) << 24 | (destData[destPosition + 1] & 255) << 16 | (destData[destPosition] & 255) << 8 | destData[destPosition + 3] & 255;
							break;
						}
						if(premultiplied1) {
							if((destPixel & 255) != 0 && (destPixel & 255) != 255) {
								lime_math_RGBA.unmult = 255.0 / (destPixel & 255);
								destPixel = (lime_math_RGBA.__clamp[Math.round((destPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((destPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((destPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | destPixel & 255 & 255;
							}
						}
						var format2 = alphaFormat;
						var premultiplied2 = false;
						if(premultiplied2 == null) {
							premultiplied2 = false;
						}
						if(format2 == null) {
							format2 = 0;
						}
						switch(format2) {
						case 0:
							alphaPixel = (alphaData[alphaPosition] & 255) << 24 | (alphaData[alphaPosition + 1] & 255) << 16 | (alphaData[alphaPosition + 2] & 255) << 8 | alphaData[alphaPosition + 3] & 255;
							break;
						case 1:
							alphaPixel = (alphaData[alphaPosition + 1] & 255) << 24 | (alphaData[alphaPosition + 2] & 255) << 16 | (alphaData[alphaPosition + 3] & 255) << 8 | alphaData[alphaPosition] & 255;
							break;
						case 2:
							alphaPixel = (alphaData[alphaPosition + 2] & 255) << 24 | (alphaData[alphaPosition + 1] & 255) << 16 | (alphaData[alphaPosition] & 255) << 8 | alphaData[alphaPosition + 3] & 255;
							break;
						}
						if(premultiplied2) {
							if((alphaPixel & 255) != 0 && (alphaPixel & 255) != 255) {
								lime_math_RGBA.unmult = 255.0 / (alphaPixel & 255);
								alphaPixel = (lime_math_RGBA.__clamp[Math.round((alphaPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((alphaPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((alphaPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | alphaPixel & 255 & 255;
							}
						}
						sourceAlpha = (alphaPixel & 255) / 255.0 * ((sourcePixel & 255) / 255.0);
						if(sourceAlpha > 0) {
							destAlpha = (destPixel & 255) / 255.0;
							oneMinusSourceAlpha = 1 - sourceAlpha;
							blendAlpha = sourceAlpha + destAlpha * oneMinusSourceAlpha;
							var value = lime_math_RGBA.__clamp[Math.round(((sourcePixel >>> 24 & 255) * sourceAlpha + (destPixel >>> 24 & 255) * destAlpha * oneMinusSourceAlpha) / blendAlpha)];
							destPixel = (value & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | destPixel & 255 & 255;
							var value1 = lime_math_RGBA.__clamp[Math.round(((sourcePixel >>> 16 & 255) * sourceAlpha + (destPixel >>> 16 & 255) * destAlpha * oneMinusSourceAlpha) / blendAlpha)];
							destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (value1 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | destPixel & 255 & 255;
							var value2 = lime_math_RGBA.__clamp[Math.round(((sourcePixel >>> 8 & 255) * sourceAlpha + (destPixel >>> 8 & 255) * destAlpha * oneMinusSourceAlpha) / blendAlpha)];
							destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (value2 & 255) << 8 | destPixel & 255 & 255;
							var value3 = lime_math_RGBA.__clamp[Math.round(blendAlpha * 255.0)];
							destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | value3 & 255;
							var format3 = destFormat;
							var premultiplied3 = destPremultiplied;
							if(premultiplied3 == null) {
								premultiplied3 = false;
							}
							if(format3 == null) {
								format3 = 0;
							}
							if(premultiplied3) {
								if((destPixel & 255) == 0) {
									if(destPixel != 0) {
										destPixel = 0;
									}
								} else if((destPixel & 255) != 255) {
									lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[destPixel & 255];
									destPixel = ((destPixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((destPixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((destPixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | destPixel & 255 & 255;
								}
							}
							switch(format3) {
							case 0:
								destData[destPosition] = destPixel >>> 24 & 255;
								destData[destPosition + 1] = destPixel >>> 16 & 255;
								destData[destPosition + 2] = destPixel >>> 8 & 255;
								destData[destPosition + 3] = destPixel & 255;
								break;
							case 1:
								destData[destPosition] = destPixel & 255;
								destData[destPosition + 1] = destPixel >>> 24 & 255;
								destData[destPosition + 2] = destPixel >>> 16 & 255;
								destData[destPosition + 3] = destPixel >>> 8 & 255;
								break;
							case 2:
								destData[destPosition] = destPixel >>> 8 & 255;
								destData[destPosition + 1] = destPixel >>> 16 & 255;
								destData[destPosition + 2] = destPixel >>> 24 & 255;
								destData[destPosition + 3] = destPixel & 255;
								break;
							}
						}
						sourcePosition += 4;
						destPosition += 4;
						alphaPosition += 4;
					}
				}
			} else {
				var _g = 0;
				var _g1 = destView.height;
				while(_g < _g1) {
					var y = _g++;
					sourcePosition = sourceView.byteOffset + sourceView.stride * y;
					destPosition = destView.byteOffset + destView.stride * y;
					alphaPosition = alphaView.byteOffset + alphaView.stride * y;
					var _g2 = 0;
					var _g3 = destView.width;
					while(_g2 < _g3) {
						var x = _g2++;
						var format = sourceFormat;
						var premultiplied = sourcePremultiplied;
						if(premultiplied == null) {
							premultiplied = false;
						}
						if(format == null) {
							format = 0;
						}
						switch(format) {
						case 0:
							sourcePixel = (sourceData[sourcePosition] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition + 2] & 255) << 8 | sourceData[sourcePosition + 3] & 255;
							break;
						case 1:
							sourcePixel = (sourceData[sourcePosition + 1] & 255) << 24 | (sourceData[sourcePosition + 2] & 255) << 16 | (sourceData[sourcePosition + 3] & 255) << 8 | sourceData[sourcePosition] & 255;
							break;
						case 2:
							sourcePixel = (sourceData[sourcePosition + 2] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition] & 255) << 8 | sourceData[sourcePosition + 3] & 255;
							break;
						}
						if(premultiplied) {
							if((sourcePixel & 255) != 0 && (sourcePixel & 255) != 255) {
								lime_math_RGBA.unmult = 255.0 / (sourcePixel & 255);
								sourcePixel = (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | sourcePixel & 255 & 255;
							}
						}
						var format1 = alphaFormat;
						var premultiplied1 = false;
						if(premultiplied1 == null) {
							premultiplied1 = false;
						}
						if(format1 == null) {
							format1 = 0;
						}
						switch(format1) {
						case 0:
							alphaPixel = (alphaData[alphaPosition] & 255) << 24 | (alphaData[alphaPosition + 1] & 255) << 16 | (alphaData[alphaPosition + 2] & 255) << 8 | alphaData[alphaPosition + 3] & 255;
							break;
						case 1:
							alphaPixel = (alphaData[alphaPosition + 1] & 255) << 24 | (alphaData[alphaPosition + 2] & 255) << 16 | (alphaData[alphaPosition + 3] & 255) << 8 | alphaData[alphaPosition] & 255;
							break;
						case 2:
							alphaPixel = (alphaData[alphaPosition + 2] & 255) << 24 | (alphaData[alphaPosition + 1] & 255) << 16 | (alphaData[alphaPosition] & 255) << 8 | alphaData[alphaPosition + 3] & 255;
							break;
						}
						if(premultiplied1) {
							if((alphaPixel & 255) != 0 && (alphaPixel & 255) != 255) {
								lime_math_RGBA.unmult = 255.0 / (alphaPixel & 255);
								alphaPixel = (lime_math_RGBA.__clamp[Math.round((alphaPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((alphaPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((alphaPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | alphaPixel & 255 & 255;
							}
						}
						var value = Math.round((sourcePixel & 255) * ((alphaPixel & 255) / 255));
						sourcePixel = (sourcePixel >>> 24 & 255 & 255) << 24 | (sourcePixel >>> 16 & 255 & 255) << 16 | (sourcePixel >>> 8 & 255 & 255) << 8 | value & 255;
						var format2 = destFormat;
						var premultiplied2 = destPremultiplied;
						if(premultiplied2 == null) {
							premultiplied2 = false;
						}
						if(format2 == null) {
							format2 = 0;
						}
						if(premultiplied2) {
							if((sourcePixel & 255) == 0) {
								if(sourcePixel != 0) {
									sourcePixel = 0;
								}
							} else if((sourcePixel & 255) != 255) {
								lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[sourcePixel & 255];
								sourcePixel = ((sourcePixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((sourcePixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((sourcePixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | sourcePixel & 255 & 255;
							}
						}
						switch(format2) {
						case 0:
							destData[destPosition] = sourcePixel >>> 24 & 255;
							destData[destPosition + 1] = sourcePixel >>> 16 & 255;
							destData[destPosition + 2] = sourcePixel >>> 8 & 255;
							destData[destPosition + 3] = sourcePixel & 255;
							break;
						case 1:
							destData[destPosition] = sourcePixel & 255;
							destData[destPosition + 1] = sourcePixel >>> 24 & 255;
							destData[destPosition + 2] = sourcePixel >>> 16 & 255;
							destData[destPosition + 3] = sourcePixel >>> 8 & 255;
							break;
						case 2:
							destData[destPosition] = sourcePixel >>> 8 & 255;
							destData[destPosition + 1] = sourcePixel >>> 16 & 255;
							destData[destPosition + 2] = sourcePixel >>> 24 & 255;
							destData[destPosition + 3] = sourcePixel & 255;
							break;
						}
						sourcePosition += 4;
						destPosition += 4;
						alphaPosition += 4;
					}
				}
			}
		}
	}
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.fillRect = function(image,rect,color,format) {
	var fillColor;
	switch(format) {
	case 1:
		var argb = color;
		var this1 = 0;
		var rgba = this1;
		rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255;
		fillColor = rgba;
		break;
	case 2:
		var bgra = color;
		var this1 = 0;
		var rgba = this1;
		rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255;
		fillColor = rgba;
		break;
	default:
		fillColor = color;
	}
	if(!image.get_transparent()) {
		fillColor = (fillColor >>> 24 & 255 & 255) << 24 | (fillColor >>> 16 & 255 & 255) << 16 | (fillColor >>> 8 & 255 & 255) << 8 | 255;
	}
	var data = image.buffer.data;
	if(data == null) {
		return;
	}
	var format = image.buffer.format;
	var premultiplied = image.buffer.premultiplied;
	if(premultiplied) {
		if((fillColor & 255) == 0) {
			if(fillColor != 0) {
				fillColor = 0;
			}
		} else if((fillColor & 255) != 255) {
			lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[fillColor & 255];
			fillColor = ((fillColor >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((fillColor >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((fillColor >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | fillColor & 255 & 255;
		}
	}
	var dataView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(image,rect);
	var row;
	var _g = 0;
	var _g1 = dataView.height;
	while(_g < _g1) {
		var y = _g++;
		row = dataView.byteOffset + dataView.stride * y;
		var _g2 = 0;
		var _g3 = dataView.width;
		while(_g2 < _g3) {
			var x = _g2++;
			var offset = row + x * 4;
			var format1 = format;
			var premultiplied = false;
			if(premultiplied == null) {
				premultiplied = false;
			}
			if(format1 == null) {
				format1 = 0;
			}
			if(premultiplied) {
				if((fillColor & 255) == 0) {
					if(fillColor != 0) {
						fillColor = 0;
					}
				} else if((fillColor & 255) != 255) {
					lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[fillColor & 255];
					fillColor = ((fillColor >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((fillColor >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((fillColor >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | fillColor & 255 & 255;
				}
			}
			switch(format1) {
			case 0:
				data[offset] = fillColor >>> 24 & 255;
				data[offset + 1] = fillColor >>> 16 & 255;
				data[offset + 2] = fillColor >>> 8 & 255;
				data[offset + 3] = fillColor & 255;
				break;
			case 1:
				data[offset] = fillColor & 255;
				data[offset + 1] = fillColor >>> 24 & 255;
				data[offset + 2] = fillColor >>> 16 & 255;
				data[offset + 3] = fillColor >>> 8 & 255;
				break;
			case 2:
				data[offset] = fillColor >>> 8 & 255;
				data[offset + 1] = fillColor >>> 16 & 255;
				data[offset + 2] = fillColor >>> 24 & 255;
				data[offset + 3] = fillColor & 255;
				break;
			}
		}
	}
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.floodFill = function(image,x,y,color,format) {
	var data = image.buffer.data;
	if(data == null) {
		return;
	}
	if(format == 1) {
		color = (color & 16777215) << 8 | color >> 24 & 255;
	}
	var format = image.buffer.format;
	var premultiplied = image.buffer.premultiplied;
	var fillColor = color;
	var hitColor;
	var offset = (y + image.offsetY) * (image.buffer.width * 4) + (x + image.offsetX) * 4;
	var format1 = format;
	var premultiplied1 = premultiplied;
	if(premultiplied1 == null) {
		premultiplied1 = false;
	}
	if(format1 == null) {
		format1 = 0;
	}
	switch(format1) {
	case 0:
		hitColor = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255;
		break;
	case 1:
		hitColor = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255;
		break;
	case 2:
		hitColor = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255;
		break;
	}
	if(premultiplied1) {
		if((hitColor & 255) != 0 && (hitColor & 255) != 255) {
			lime_math_RGBA.unmult = 255.0 / (hitColor & 255);
			hitColor = (lime_math_RGBA.__clamp[Math.round((hitColor >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((hitColor >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((hitColor >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | hitColor & 255 & 255;
		}
	}
	if(!image.get_transparent()) {
		fillColor = (fillColor >>> 24 & 255 & 255) << 24 | (fillColor >>> 16 & 255 & 255) << 16 | (fillColor >>> 8 & 255 & 255) << 8 | 255;
		hitColor = (hitColor >>> 24 & 255 & 255) << 24 | (hitColor >>> 16 & 255 & 255) << 16 | (hitColor >>> 8 & 255 & 255) << 8 | 255;
	}
	if(fillColor == hitColor) {
		return;
	}
	if(premultiplied) {
		if((fillColor & 255) == 0) {
			if(fillColor != 0) {
				fillColor = 0;
			}
		} else if((fillColor & 255) != 255) {
			lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[fillColor & 255];
			fillColor = ((fillColor >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((fillColor >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((fillColor >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | fillColor & 255 & 255;
		}
	}
	var dx = [0,-1,1,0];
	var dy = [-1,0,0,1];
	var minX = -image.offsetX;
	var minY = -image.offsetY;
	var maxX = minX + image.width;
	var maxY = minY + image.height;
	var queue = [];
	queue.push(x);
	queue.push(y);
	var curPointX;
	var curPointY;
	var nextPointX;
	var nextPointY;
	var nextPointOffset;
	var readColor;
	while(queue.length > 0) {
		curPointY = queue.pop();
		curPointX = queue.pop();
		var _g = 0;
		while(_g < 4) {
			var i = _g++;
			nextPointX = curPointX + dx[i];
			nextPointY = curPointY + dy[i];
			if(nextPointX < minX || nextPointY < minY || nextPointX >= maxX || nextPointY >= maxY) {
				continue;
			}
			nextPointOffset = (nextPointY * image.width + nextPointX) * 4;
			var format1 = format;
			var premultiplied1 = premultiplied;
			if(premultiplied1 == null) {
				premultiplied1 = false;
			}
			if(format1 == null) {
				format1 = 0;
			}
			switch(format1) {
			case 0:
				readColor = (data[nextPointOffset] & 255) << 24 | (data[nextPointOffset + 1] & 255) << 16 | (data[nextPointOffset + 2] & 255) << 8 | data[nextPointOffset + 3] & 255;
				break;
			case 1:
				readColor = (data[nextPointOffset + 1] & 255) << 24 | (data[nextPointOffset + 2] & 255) << 16 | (data[nextPointOffset + 3] & 255) << 8 | data[nextPointOffset] & 255;
				break;
			case 2:
				readColor = (data[nextPointOffset + 2] & 255) << 24 | (data[nextPointOffset + 1] & 255) << 16 | (data[nextPointOffset] & 255) << 8 | data[nextPointOffset + 3] & 255;
				break;
			}
			if(premultiplied1) {
				if((readColor & 255) != 0 && (readColor & 255) != 255) {
					lime_math_RGBA.unmult = 255.0 / (readColor & 255);
					readColor = (lime_math_RGBA.__clamp[Math.round((readColor >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((readColor >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((readColor >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | readColor & 255 & 255;
				}
			}
			if(readColor == hitColor) {
				var format2 = format;
				var premultiplied2 = false;
				if(premultiplied2 == null) {
					premultiplied2 = false;
				}
				if(format2 == null) {
					format2 = 0;
				}
				if(premultiplied2) {
					if((fillColor & 255) == 0) {
						if(fillColor != 0) {
							fillColor = 0;
						}
					} else if((fillColor & 255) != 255) {
						lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[fillColor & 255];
						fillColor = ((fillColor >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((fillColor >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((fillColor >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | fillColor & 255 & 255;
					}
				}
				switch(format2) {
				case 0:
					data[nextPointOffset] = fillColor >>> 24 & 255;
					data[nextPointOffset + 1] = fillColor >>> 16 & 255;
					data[nextPointOffset + 2] = fillColor >>> 8 & 255;
					data[nextPointOffset + 3] = fillColor & 255;
					break;
				case 1:
					data[nextPointOffset] = fillColor & 255;
					data[nextPointOffset + 1] = fillColor >>> 24 & 255;
					data[nextPointOffset + 2] = fillColor >>> 16 & 255;
					data[nextPointOffset + 3] = fillColor >>> 8 & 255;
					break;
				case 2:
					data[nextPointOffset] = fillColor >>> 8 & 255;
					data[nextPointOffset + 1] = fillColor >>> 16 & 255;
					data[nextPointOffset + 2] = fillColor >>> 24 & 255;
					data[nextPointOffset + 3] = fillColor & 255;
					break;
				}
				queue.push(nextPointX);
				queue.push(nextPointY);
			}
		}
	}
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.gaussianBlur = function(image,sourceImage,sourceRect,destPoint,blurX,blurY,quality,strength,color) {
	if(strength == null) {
		strength = 1;
	}
	if(quality == null) {
		quality = 1;
	}
	if(blurY == null) {
		blurY = 4;
	}
	if(blurX == null) {
		blurX = 4;
	}
	var imagePremultiplied = image.get_premultiplied();
	if(imagePremultiplied) {
		image.set_premultiplied(false);
	}
	lime__$internal_graphics_StackBlur.blur(image,sourceImage,sourceRect,destPoint,blurX,blurY,quality);
	image.dirty = true;
	image.version++;
	if(imagePremultiplied) {
		image.set_premultiplied(true);
	}
	return image;
};
lime__$internal_graphics_ImageDataUtil.getColorBoundsRect = function(image,mask,color,findColor,format) {
	var left = image.width + 1;
	var right = 0;
	var top = image.height + 1;
	var bottom = 0;
	var _color;
	var _mask;
	switch(format) {
	case 1:
		var argb = color;
		var this1 = 0;
		var rgba = this1;
		rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255;
		_color = rgba;
		var argb = mask;
		var this1 = 0;
		var rgba = this1;
		rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255;
		_mask = rgba;
		break;
	case 2:
		var bgra = color;
		var this1 = 0;
		var rgba = this1;
		rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255;
		_color = rgba;
		var bgra = mask;
		var this1 = 0;
		var rgba = this1;
		rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255;
		_mask = rgba;
		break;
	default:
		_color = color;
		_mask = mask;
	}
	if(!image.get_transparent()) {
		_color = (_color >>> 24 & 255 & 255) << 24 | (_color >>> 16 & 255 & 255) << 16 | (_color >>> 8 & 255 & 255) << 8 | 255;
		_mask = (_mask >>> 24 & 255 & 255) << 24 | (_mask >>> 16 & 255 & 255) << 16 | (_mask >>> 8 & 255 & 255) << 8 | 255;
	}
	var pixel;
	var hit;
	var _g = 0;
	var _g1 = image.width;
	while(_g < _g1) {
		var x = _g++;
		hit = false;
		var _g2 = 0;
		var _g3 = image.height;
		while(_g2 < _g3) {
			var y = _g2++;
			pixel = image.getPixel32(x,y,0);
			hit = findColor ? (pixel & _mask) == _color : (pixel & _mask) != _color;
			if(hit) {
				if(x < left) {
					left = x;
				}
				break;
			}
		}
		if(hit) {
			break;
		}
	}
	var ix;
	var _g = 0;
	var _g1 = image.width;
	while(_g < _g1) {
		var x = _g++;
		ix = image.width - 1 - x;
		hit = false;
		var _g2 = 0;
		var _g3 = image.height;
		while(_g2 < _g3) {
			var y = _g2++;
			pixel = image.getPixel32(ix,y,0);
			hit = findColor ? (pixel & _mask) == _color : (pixel & _mask) != _color;
			if(hit) {
				if(ix > right) {
					right = ix;
				}
				break;
			}
		}
		if(hit) {
			break;
		}
	}
	var _g = 0;
	var _g1 = image.height;
	while(_g < _g1) {
		var y = _g++;
		hit = false;
		var _g2 = 0;
		var _g3 = image.width;
		while(_g2 < _g3) {
			var x = _g2++;
			pixel = image.getPixel32(x,y,0);
			hit = findColor ? (pixel & _mask) == _color : (pixel & _mask) != _color;
			if(hit) {
				if(y < top) {
					top = y;
				}
				break;
			}
		}
		if(hit) {
			break;
		}
	}
	var iy;
	var _g = 0;
	var _g1 = image.height;
	while(_g < _g1) {
		var y = _g++;
		iy = image.height - 1 - y;
		hit = false;
		var _g2 = 0;
		var _g3 = image.width;
		while(_g2 < _g3) {
			var x = _g2++;
			pixel = image.getPixel32(x,iy,0);
			hit = findColor ? (pixel & _mask) == _color : (pixel & _mask) != _color;
			if(hit) {
				if(iy > bottom) {
					bottom = iy;
				}
				break;
			}
		}
		if(hit) {
			break;
		}
	}
	var w = right - left;
	var h = bottom - top;
	if(w > 0) {
		++w;
	}
	if(h > 0) {
		++h;
	}
	if(w < 0) {
		w = 0;
	}
	if(h < 0) {
		h = 0;
	}
	if(left == right) {
		w = 1;
	}
	if(top == bottom) {
		h = 1;
	}
	if(left > image.width) {
		left = 0;
	}
	if(top > image.height) {
		top = 0;
	}
	return new lime_math_Rectangle(left,top,w,h);
};
lime__$internal_graphics_ImageDataUtil.getPixel = function(image,x,y,format) {
	var pixel;
	var data = image.buffer.data;
	var offset = 4 * (y + image.offsetY) * image.buffer.width + (x + image.offsetX) * 4;
	var format1 = image.buffer.format;
	var premultiplied = image.buffer.premultiplied;
	if(premultiplied == null) {
		premultiplied = false;
	}
	if(format1 == null) {
		format1 = 0;
	}
	switch(format1) {
	case 0:
		pixel = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255;
		break;
	case 1:
		pixel = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255;
		break;
	case 2:
		pixel = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255;
		break;
	}
	if(premultiplied) {
		if((pixel & 255) != 0 && (pixel & 255) != 255) {
			lime_math_RGBA.unmult = 255.0 / (pixel & 255);
			pixel = (lime_math_RGBA.__clamp[Math.round((pixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | pixel & 255 & 255;
		}
	}
	pixel = (pixel >>> 24 & 255 & 255) << 24 | (pixel >>> 16 & 255 & 255) << 16 | (pixel >>> 8 & 255 & 255) << 8 | 0;
	switch(format) {
	case 1:
		var this1 = 0;
		var argb = this1;
		argb = (pixel & 255 & 255) << 24 | (pixel >>> 24 & 255 & 255) << 16 | (pixel >>> 16 & 255 & 255) << 8 | pixel >>> 8 & 255 & 255;
		return argb;
	case 2:
		var this1 = 0;
		var bgra = this1;
		bgra = (pixel >>> 8 & 255 & 255) << 24 | (pixel >>> 16 & 255 & 255) << 16 | (pixel >>> 24 & 255 & 255) << 8 | pixel & 255 & 255;
		return bgra;
	default:
		return pixel;
	}
};
lime__$internal_graphics_ImageDataUtil.getPixel32 = function(image,x,y,format) {
	var pixel;
	var data = image.buffer.data;
	var offset = 4 * (y + image.offsetY) * image.buffer.width + (x + image.offsetX) * 4;
	var format1 = image.buffer.format;
	var premultiplied = image.buffer.premultiplied;
	if(premultiplied == null) {
		premultiplied = false;
	}
	if(format1 == null) {
		format1 = 0;
	}
	switch(format1) {
	case 0:
		pixel = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255;
		break;
	case 1:
		pixel = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255;
		break;
	case 2:
		pixel = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255;
		break;
	}
	if(premultiplied) {
		if((pixel & 255) != 0 && (pixel & 255) != 255) {
			lime_math_RGBA.unmult = 255.0 / (pixel & 255);
			pixel = (lime_math_RGBA.__clamp[Math.round((pixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | pixel & 255 & 255;
		}
	}
	switch(format) {
	case 1:
		var this1 = 0;
		var argb = this1;
		argb = (pixel & 255 & 255) << 24 | (pixel >>> 24 & 255 & 255) << 16 | (pixel >>> 16 & 255 & 255) << 8 | pixel >>> 8 & 255 & 255;
		return argb;
	case 2:
		var this1 = 0;
		var bgra = this1;
		bgra = (pixel >>> 8 & 255 & 255) << 24 | (pixel >>> 16 & 255 & 255) << 16 | (pixel >>> 24 & 255 & 255) << 8 | pixel & 255 & 255;
		return bgra;
	default:
		return pixel;
	}
};
lime__$internal_graphics_ImageDataUtil.getPixels = function(image,rect,format) {
	if(image.buffer.data == null) {
		return null;
	}
	var length = rect.width * rect.height | 0;
	var bytes = new haxe_io_Bytes(new ArrayBuffer(length * 4));
	var data = image.buffer.data;
	var sourceFormat = image.buffer.format;
	var premultiplied = image.buffer.premultiplied;
	var dataView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(image,rect);
	var position;
	var argb;
	var bgra;
	var pixel;
	var destPosition = 0;
	var _g = 0;
	var _g1 = dataView.height;
	while(_g < _g1) {
		var y = _g++;
		position = dataView.byteOffset + dataView.stride * y;
		var _g2 = 0;
		var _g3 = dataView.width;
		while(_g2 < _g3) {
			var x = _g2++;
			var format1 = sourceFormat;
			var premultiplied1 = premultiplied;
			if(premultiplied1 == null) {
				premultiplied1 = false;
			}
			if(format1 == null) {
				format1 = 0;
			}
			switch(format1) {
			case 0:
				pixel = (data[position] & 255) << 24 | (data[position + 1] & 255) << 16 | (data[position + 2] & 255) << 8 | data[position + 3] & 255;
				break;
			case 1:
				pixel = (data[position + 1] & 255) << 24 | (data[position + 2] & 255) << 16 | (data[position + 3] & 255) << 8 | data[position] & 255;
				break;
			case 2:
				pixel = (data[position + 2] & 255) << 24 | (data[position + 1] & 255) << 16 | (data[position] & 255) << 8 | data[position + 3] & 255;
				break;
			}
			if(premultiplied1) {
				if((pixel & 255) != 0 && (pixel & 255) != 255) {
					lime_math_RGBA.unmult = 255.0 / (pixel & 255);
					pixel = (lime_math_RGBA.__clamp[Math.round((pixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | pixel & 255 & 255;
				}
			}
			switch(format) {
			case 1:
				var this1 = 0;
				var argb1 = this1;
				argb1 = (pixel & 255 & 255) << 24 | (pixel >>> 24 & 255 & 255) << 16 | (pixel >>> 16 & 255 & 255) << 8 | pixel >>> 8 & 255 & 255;
				argb = argb1;
				pixel = argb;
				break;
			case 2:
				var this2 = 0;
				var bgra1 = this2;
				bgra1 = (pixel >>> 8 & 255 & 255) << 24 | (pixel >>> 16 & 255 & 255) << 16 | (pixel >>> 24 & 255 & 255) << 8 | pixel & 255 & 255;
				bgra = bgra1;
				pixel = bgra;
				break;
			default:
			}
			bytes.b[destPosition++] = pixel >>> 24 & 255 & 255;
			bytes.b[destPosition++] = pixel >>> 16 & 255 & 255;
			bytes.b[destPosition++] = pixel >>> 8 & 255 & 255;
			bytes.b[destPosition++] = pixel & 255 & 255;
			position += 4;
		}
	}
	return bytes;
};
lime__$internal_graphics_ImageDataUtil.merge = function(image,sourceImage,sourceRect,destPoint,redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier) {
	if(image.buffer.data == null || sourceImage.buffer.data == null) {
		return;
	}
	var sourceView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(sourceImage,sourceRect);
	var destView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(image,new lime_math_Rectangle(destPoint.x,destPoint.y,sourceView.width,sourceView.height));
	var sourceData = sourceImage.buffer.data;
	var destData = image.buffer.data;
	var sourceFormat = sourceImage.buffer.format;
	var destFormat = image.buffer.format;
	var sourcePremultiplied = sourceImage.buffer.premultiplied;
	var destPremultiplied = image.buffer.premultiplied;
	var sourcePosition;
	var destPosition;
	var sourcePixel;
	var destPixel;
	var _g = 0;
	var _g1 = destView.height;
	while(_g < _g1) {
		var y = _g++;
		sourcePosition = sourceView.byteOffset + sourceView.stride * y;
		destPosition = destView.byteOffset + destView.stride * y;
		var _g2 = 0;
		var _g3 = destView.width;
		while(_g2 < _g3) {
			var x = _g2++;
			var format = sourceFormat;
			var premultiplied = sourcePremultiplied;
			if(premultiplied == null) {
				premultiplied = false;
			}
			if(format == null) {
				format = 0;
			}
			switch(format) {
			case 0:
				sourcePixel = (sourceData[sourcePosition] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition + 2] & 255) << 8 | sourceData[sourcePosition + 3] & 255;
				break;
			case 1:
				sourcePixel = (sourceData[sourcePosition + 1] & 255) << 24 | (sourceData[sourcePosition + 2] & 255) << 16 | (sourceData[sourcePosition + 3] & 255) << 8 | sourceData[sourcePosition] & 255;
				break;
			case 2:
				sourcePixel = (sourceData[sourcePosition + 2] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition] & 255) << 8 | sourceData[sourcePosition + 3] & 255;
				break;
			}
			if(premultiplied) {
				if((sourcePixel & 255) != 0 && (sourcePixel & 255) != 255) {
					lime_math_RGBA.unmult = 255.0 / (sourcePixel & 255);
					sourcePixel = (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | sourcePixel & 255 & 255;
				}
			}
			var format1 = destFormat;
			var premultiplied1 = destPremultiplied;
			if(premultiplied1 == null) {
				premultiplied1 = false;
			}
			if(format1 == null) {
				format1 = 0;
			}
			switch(format1) {
			case 0:
				destPixel = (destData[destPosition] & 255) << 24 | (destData[destPosition + 1] & 255) << 16 | (destData[destPosition + 2] & 255) << 8 | destData[destPosition + 3] & 255;
				break;
			case 1:
				destPixel = (destData[destPosition + 1] & 255) << 24 | (destData[destPosition + 2] & 255) << 16 | (destData[destPosition + 3] & 255) << 8 | destData[destPosition] & 255;
				break;
			case 2:
				destPixel = (destData[destPosition + 2] & 255) << 24 | (destData[destPosition + 1] & 255) << 16 | (destData[destPosition] & 255) << 8 | destData[destPosition + 3] & 255;
				break;
			}
			if(premultiplied1) {
				if((destPixel & 255) != 0 && (destPixel & 255) != 255) {
					lime_math_RGBA.unmult = 255.0 / (destPixel & 255);
					destPixel = (lime_math_RGBA.__clamp[Math.round((destPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((destPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((destPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | destPixel & 255 & 255;
				}
			}
			var value = ((sourcePixel >>> 24 & 255) * redMultiplier + (destPixel >>> 24 & 255) * (256 - redMultiplier)) / 256 | 0;
			destPixel = (value & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | destPixel & 255 & 255;
			var value1 = ((sourcePixel >>> 16 & 255) * greenMultiplier + (destPixel >>> 16 & 255) * (256 - greenMultiplier)) / 256 | 0;
			destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (value1 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | destPixel & 255 & 255;
			var value2 = ((sourcePixel >>> 8 & 255) * blueMultiplier + (destPixel >>> 8 & 255) * (256 - blueMultiplier)) / 256 | 0;
			destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (value2 & 255) << 8 | destPixel & 255 & 255;
			var value3 = ((sourcePixel & 255) * alphaMultiplier + (destPixel & 255) * (256 - alphaMultiplier)) / 256 | 0;
			destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | value3 & 255;
			var format2 = destFormat;
			var premultiplied2 = destPremultiplied;
			if(premultiplied2 == null) {
				premultiplied2 = false;
			}
			if(format2 == null) {
				format2 = 0;
			}
			if(premultiplied2) {
				if((destPixel & 255) == 0) {
					if(destPixel != 0) {
						destPixel = 0;
					}
				} else if((destPixel & 255) != 255) {
					lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[destPixel & 255];
					destPixel = ((destPixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((destPixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((destPixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | destPixel & 255 & 255;
				}
			}
			switch(format2) {
			case 0:
				destData[destPosition] = destPixel >>> 24 & 255;
				destData[destPosition + 1] = destPixel >>> 16 & 255;
				destData[destPosition + 2] = destPixel >>> 8 & 255;
				destData[destPosition + 3] = destPixel & 255;
				break;
			case 1:
				destData[destPosition] = destPixel & 255;
				destData[destPosition + 1] = destPixel >>> 24 & 255;
				destData[destPosition + 2] = destPixel >>> 16 & 255;
				destData[destPosition + 3] = destPixel >>> 8 & 255;
				break;
			case 2:
				destData[destPosition] = destPixel >>> 8 & 255;
				destData[destPosition + 1] = destPixel >>> 16 & 255;
				destData[destPosition + 2] = destPixel >>> 24 & 255;
				destData[destPosition + 3] = destPixel & 255;
				break;
			}
			sourcePosition += 4;
			destPosition += 4;
		}
	}
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.multiplyAlpha = function(image) {
	var data = image.buffer.data;
	if(data == null || !image.buffer.transparent) {
		return;
	}
	var format = image.buffer.format;
	var length = data.length / 4 | 0;
	var pixel;
	var _g = 0;
	var _g1 = length;
	while(_g < _g1) {
		var i = _g++;
		var offset = i * 4;
		var format1 = format;
		var premultiplied = false;
		if(premultiplied == null) {
			premultiplied = false;
		}
		if(format1 == null) {
			format1 = 0;
		}
		switch(format1) {
		case 0:
			pixel = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255;
			break;
		case 1:
			pixel = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255;
			break;
		case 2:
			pixel = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255;
			break;
		}
		if(premultiplied) {
			if((pixel & 255) != 0 && (pixel & 255) != 255) {
				lime_math_RGBA.unmult = 255.0 / (pixel & 255);
				pixel = (lime_math_RGBA.__clamp[Math.round((pixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | pixel & 255 & 255;
			}
		}
		var offset1 = i * 4;
		var format2 = format;
		var premultiplied1 = true;
		if(premultiplied1 == null) {
			premultiplied1 = false;
		}
		if(format2 == null) {
			format2 = 0;
		}
		if(premultiplied1) {
			if((pixel & 255) == 0) {
				if(pixel != 0) {
					pixel = 0;
				}
			} else if((pixel & 255) != 255) {
				lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[pixel & 255];
				pixel = ((pixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((pixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((pixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | pixel & 255 & 255;
			}
		}
		switch(format2) {
		case 0:
			data[offset1] = pixel >>> 24 & 255;
			data[offset1 + 1] = pixel >>> 16 & 255;
			data[offset1 + 2] = pixel >>> 8 & 255;
			data[offset1 + 3] = pixel & 255;
			break;
		case 1:
			data[offset1] = pixel & 255;
			data[offset1 + 1] = pixel >>> 24 & 255;
			data[offset1 + 2] = pixel >>> 16 & 255;
			data[offset1 + 3] = pixel >>> 8 & 255;
			break;
		case 2:
			data[offset1] = pixel >>> 8 & 255;
			data[offset1 + 1] = pixel >>> 16 & 255;
			data[offset1 + 2] = pixel >>> 24 & 255;
			data[offset1 + 3] = pixel & 255;
			break;
		}
	}
	image.buffer.premultiplied = true;
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.resize = function(image,newWidth,newHeight) {
	var buffer = image.buffer;
	if(buffer.width == newWidth && buffer.height == newHeight) {
		return;
	}
	var elements = newWidth * newHeight * 4;
	var array = null;
	var vector = null;
	var view = null;
	var buffer1 = null;
	var len = null;
	var this1;
	if(elements != null) {
		this1 = new Uint8Array(elements);
	} else if(array != null) {
		this1 = new Uint8Array(array);
	} else if(vector != null) {
		this1 = new Uint8Array(vector.__array);
	} else if(view != null) {
		this1 = new Uint8Array(view);
	} else if(buffer1 != null) {
		if(len == null) {
			this1 = new Uint8Array(buffer1,0);
		} else {
			this1 = new Uint8Array(buffer1,0,len);
		}
	} else {
		this1 = null;
	}
	var newBuffer = new lime_graphics_ImageBuffer(this1,newWidth,newHeight);
	var imageWidth = image.width;
	var imageHeight = image.height;
	var data = image.get_data();
	var newData = newBuffer.data;
	var sourceIndex;
	var sourceIndexX;
	var sourceIndexY;
	var sourceIndexXY;
	var index;
	var sourceX;
	var sourceY;
	var u;
	var v;
	var uRatio;
	var vRatio;
	var uOpposite;
	var vOpposite;
	var _g = 0;
	var _g1 = newHeight;
	while(_g < _g1) {
		var y = _g++;
		var _g2 = 0;
		var _g3 = newWidth;
		while(_g2 < _g3) {
			var x = _g2++;
			u = (x + 0.5) / newWidth * imageWidth - 0.5;
			v = (y + 0.5) / newHeight * imageHeight - 0.5;
			sourceX = u | 0;
			sourceY = v | 0;
			sourceIndex = (sourceY * imageWidth + sourceX) * 4;
			sourceIndexX = sourceX < imageWidth - 1 ? sourceIndex + 4 : sourceIndex;
			sourceIndexY = sourceY < imageHeight - 1 ? sourceIndex + imageWidth * 4 : sourceIndex;
			sourceIndexXY = sourceIndexX != sourceIndex ? sourceIndexY + 4 : sourceIndexY;
			index = (y * newWidth + x) * 4;
			uRatio = u - sourceX;
			vRatio = v - sourceY;
			uOpposite = 1 - uRatio;
			vOpposite = 1 - vRatio;
			newData[index] = (UInt.toFloat(data[sourceIndex]) * uOpposite + UInt.toFloat(data[sourceIndexX]) * uRatio) * vOpposite + (UInt.toFloat(data[sourceIndexY]) * uOpposite + UInt.toFloat(data[sourceIndexXY]) * uRatio) * vRatio | 0;
			newData[index + 1] = (UInt.toFloat(data[sourceIndex + 1]) * uOpposite + UInt.toFloat(data[sourceIndexX + 1]) * uRatio) * vOpposite + (UInt.toFloat(data[sourceIndexY + 1]) * uOpposite + UInt.toFloat(data[sourceIndexXY + 1]) * uRatio) * vRatio | 0;
			newData[index + 2] = (UInt.toFloat(data[sourceIndex + 2]) * uOpposite + UInt.toFloat(data[sourceIndexX + 2]) * uRatio) * vOpposite + (UInt.toFloat(data[sourceIndexY + 2]) * uOpposite + UInt.toFloat(data[sourceIndexXY + 2]) * uRatio) * vRatio | 0;
			if(data[sourceIndexX + 3] == 0 || data[sourceIndexY + 3] == 0 || data[sourceIndexXY + 3] == 0) {
				newData[index + 3] = 0;
			} else {
				newData[index + 3] = data[sourceIndex + 3];
			}
		}
	}
	buffer.data = newBuffer.data;
	buffer.width = newWidth;
	buffer.height = newHeight;
	buffer.__srcImage = null;
	buffer.__srcImageData = null;
	buffer.__srcCanvas = null;
	buffer.__srcContext = null;
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.resizeBuffer = function(image,newWidth,newHeight) {
	var buffer = image.buffer;
	var data = image.get_data();
	var elements = newWidth * newHeight * 4;
	var array = null;
	var vector = null;
	var view = null;
	var buffer1 = null;
	var len = null;
	var this1;
	if(elements != null) {
		this1 = new Uint8Array(elements);
	} else if(array != null) {
		this1 = new Uint8Array(array);
	} else if(vector != null) {
		this1 = new Uint8Array(vector.__array);
	} else if(view != null) {
		this1 = new Uint8Array(view);
	} else if(buffer1 != null) {
		if(len == null) {
			this1 = new Uint8Array(buffer1,0);
		} else {
			this1 = new Uint8Array(buffer1,0,len);
		}
	} else {
		this1 = null;
	}
	var newData = this1;
	var sourceIndex;
	var index;
	var _g = 0;
	var _g1 = buffer.height;
	while(_g < _g1) {
		var y = _g++;
		var _g2 = 0;
		var _g3 = buffer.width;
		while(_g2 < _g3) {
			var x = _g2++;
			sourceIndex = (y * buffer.width + x) * 4;
			index = (y * newWidth + x) * 4;
			newData[index] = data[sourceIndex];
			newData[index + 1] = data[sourceIndex + 1];
			newData[index + 2] = data[sourceIndex + 2];
			newData[index + 3] = data[sourceIndex + 3];
		}
	}
	buffer.data = newData;
	buffer.width = newWidth;
	buffer.height = newHeight;
	buffer.__srcImage = null;
	buffer.__srcImageData = null;
	buffer.__srcCanvas = null;
	buffer.__srcContext = null;
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.setFormat = function(image,format) {
	var data = image.buffer.data;
	if(data == null) {
		return;
	}
	var index;
	var a16;
	var length = data.length / 4 | 0;
	var r1;
	var g1;
	var b1;
	var a1;
	var r2;
	var g2;
	var b2;
	var a2;
	var r;
	var g;
	var b;
	var a;
	switch(image.get_format()) {
	case 0:
		r1 = 0;
		g1 = 1;
		b1 = 2;
		a1 = 3;
		break;
	case 1:
		r1 = 1;
		g1 = 2;
		b1 = 3;
		a1 = 0;
		break;
	case 2:
		r1 = 2;
		g1 = 1;
		b1 = 0;
		a1 = 3;
		break;
	}
	switch(format) {
	case 0:
		r2 = 0;
		g2 = 1;
		b2 = 2;
		a2 = 3;
		break;
	case 1:
		r2 = 1;
		g2 = 2;
		b2 = 3;
		a2 = 0;
		break;
	case 2:
		r2 = 2;
		g2 = 1;
		b2 = 0;
		a2 = 3;
		break;
	}
	var _g = 0;
	var _g1 = length;
	while(_g < _g1) {
		var i = _g++;
		index = i * 4;
		r = data[index + r1];
		g = data[index + g1];
		b = data[index + b1];
		a = data[index + a1];
		data[index + r2] = r;
		data[index + g2] = g;
		data[index + b2] = b;
		data[index + a2] = a;
	}
	image.buffer.format = format;
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.setPixel = function(image,x,y,color,format) {
	var pixel;
	switch(format) {
	case 1:
		var argb = color;
		var this1 = 0;
		var rgba = this1;
		rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255;
		pixel = rgba;
		break;
	case 2:
		var bgra = color;
		var this1 = 0;
		var rgba = this1;
		rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255;
		pixel = rgba;
		break;
	default:
		pixel = color;
	}
	var this1 = 0;
	var source = this1;
	var data = image.buffer.data;
	var offset = 4 * (y + image.offsetY) * image.buffer.width + (x + image.offsetX) * 4;
	var format = image.buffer.format;
	var premultiplied = image.buffer.premultiplied;
	if(premultiplied == null) {
		premultiplied = false;
	}
	if(format == null) {
		format = 0;
	}
	switch(format) {
	case 0:
		source = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255;
		break;
	case 1:
		source = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255;
		break;
	case 2:
		source = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255;
		break;
	}
	if(premultiplied) {
		if((source & 255) != 0 && (source & 255) != 255) {
			lime_math_RGBA.unmult = 255.0 / (source & 255);
			source = (lime_math_RGBA.__clamp[Math.round((source >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((source >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((source >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | source & 255 & 255;
		}
	}
	var value = source & 255;
	pixel = (pixel >>> 24 & 255 & 255) << 24 | (pixel >>> 16 & 255 & 255) << 16 | (pixel >>> 8 & 255 & 255) << 8 | value & 255;
	var data = image.buffer.data;
	var offset = 4 * (y + image.offsetY) * image.buffer.width + (x + image.offsetX) * 4;
	var format = image.buffer.format;
	var premultiplied = image.buffer.premultiplied;
	if(premultiplied == null) {
		premultiplied = false;
	}
	if(format == null) {
		format = 0;
	}
	if(premultiplied) {
		if((pixel & 255) == 0) {
			if(pixel != 0) {
				pixel = 0;
			}
		} else if((pixel & 255) != 255) {
			lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[pixel & 255];
			pixel = ((pixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((pixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((pixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | pixel & 255 & 255;
		}
	}
	switch(format) {
	case 0:
		data[offset] = pixel >>> 24 & 255;
		data[offset + 1] = pixel >>> 16 & 255;
		data[offset + 2] = pixel >>> 8 & 255;
		data[offset + 3] = pixel & 255;
		break;
	case 1:
		data[offset] = pixel & 255;
		data[offset + 1] = pixel >>> 24 & 255;
		data[offset + 2] = pixel >>> 16 & 255;
		data[offset + 3] = pixel >>> 8 & 255;
		break;
	case 2:
		data[offset] = pixel >>> 8 & 255;
		data[offset + 1] = pixel >>> 16 & 255;
		data[offset + 2] = pixel >>> 24 & 255;
		data[offset + 3] = pixel & 255;
		break;
	}
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.setPixel32 = function(image,x,y,color,format) {
	var pixel;
	switch(format) {
	case 1:
		var argb = color;
		var this1 = 0;
		var rgba = this1;
		rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255;
		pixel = rgba;
		break;
	case 2:
		var bgra = color;
		var this1 = 0;
		var rgba = this1;
		rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255;
		pixel = rgba;
		break;
	default:
		pixel = color;
	}
	if(!image.get_transparent()) {
		pixel = (pixel >>> 24 & 255 & 255) << 24 | (pixel >>> 16 & 255 & 255) << 16 | (pixel >>> 8 & 255 & 255) << 8 | 255;
	}
	var data = image.buffer.data;
	var offset = 4 * (y + image.offsetY) * image.buffer.width + (x + image.offsetX) * 4;
	var format = image.buffer.format;
	var premultiplied = image.buffer.premultiplied;
	if(premultiplied == null) {
		premultiplied = false;
	}
	if(format == null) {
		format = 0;
	}
	if(premultiplied) {
		if((pixel & 255) == 0) {
			if(pixel != 0) {
				pixel = 0;
			}
		} else if((pixel & 255) != 255) {
			lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[pixel & 255];
			pixel = ((pixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((pixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((pixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | pixel & 255 & 255;
		}
	}
	switch(format) {
	case 0:
		data[offset] = pixel >>> 24 & 255;
		data[offset + 1] = pixel >>> 16 & 255;
		data[offset + 2] = pixel >>> 8 & 255;
		data[offset + 3] = pixel & 255;
		break;
	case 1:
		data[offset] = pixel & 255;
		data[offset + 1] = pixel >>> 24 & 255;
		data[offset + 2] = pixel >>> 16 & 255;
		data[offset + 3] = pixel >>> 8 & 255;
		break;
	case 2:
		data[offset] = pixel >>> 8 & 255;
		data[offset + 1] = pixel >>> 16 & 255;
		data[offset + 2] = pixel >>> 24 & 255;
		data[offset + 3] = pixel & 255;
		break;
	}
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.setPixels = function(image,rect,bytePointer,format,endian) {
	if(image.buffer.data == null) {
		return;
	}
	var data = image.buffer.data;
	var sourceFormat = image.buffer.format;
	var premultiplied = image.buffer.premultiplied;
	var dataView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(image,rect);
	var row;
	var color;
	var pixel;
	var transparent = image.get_transparent();
	var bytes = bytePointer.bytes;
	var dataPosition = bytePointer.offset;
	var littleEndian = endian != lime_system_Endian.BIG_ENDIAN;
	var _g = 0;
	var _g1 = dataView.height;
	while(_g < _g1) {
		var y = _g++;
		row = dataView.byteOffset + dataView.stride * y;
		var _g2 = 0;
		var _g3 = dataView.width;
		while(_g2 < _g3) {
			var x = _g2++;
			if(littleEndian) {
				color = bytes.getInt32(dataPosition);
			} else {
				color = bytes.b[dataPosition + 3] | bytes.b[dataPosition + 2] << 8 | bytes.b[dataPosition + 1] << 16 | bytes.b[dataPosition] << 24;
			}
			dataPosition += 4;
			switch(format) {
			case 1:
				var argb = color;
				var this1 = 0;
				var rgba = this1;
				rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255;
				pixel = rgba;
				break;
			case 2:
				var bgra = color;
				var this2 = 0;
				var rgba1 = this2;
				rgba1 = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255;
				pixel = rgba1;
				break;
			default:
				pixel = color;
			}
			if(!transparent) {
				pixel = (pixel >>> 24 & 255 & 255) << 24 | (pixel >>> 16 & 255 & 255) << 16 | (pixel >>> 8 & 255 & 255) << 8 | 255;
			}
			var offset = row + x * 4;
			var format1 = sourceFormat;
			var premultiplied1 = premultiplied;
			if(premultiplied1 == null) {
				premultiplied1 = false;
			}
			if(format1 == null) {
				format1 = 0;
			}
			if(premultiplied1) {
				if((pixel & 255) == 0) {
					if(pixel != 0) {
						pixel = 0;
					}
				} else if((pixel & 255) != 255) {
					lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[pixel & 255];
					pixel = ((pixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((pixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((pixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | pixel & 255 & 255;
				}
			}
			switch(format1) {
			case 0:
				data[offset] = pixel >>> 24 & 255;
				data[offset + 1] = pixel >>> 16 & 255;
				data[offset + 2] = pixel >>> 8 & 255;
				data[offset + 3] = pixel & 255;
				break;
			case 1:
				data[offset] = pixel & 255;
				data[offset + 1] = pixel >>> 24 & 255;
				data[offset + 2] = pixel >>> 16 & 255;
				data[offset + 3] = pixel >>> 8 & 255;
				break;
			case 2:
				data[offset] = pixel >>> 8 & 255;
				data[offset + 1] = pixel >>> 16 & 255;
				data[offset + 2] = pixel >>> 24 & 255;
				data[offset + 3] = pixel & 255;
				break;
			}
		}
	}
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.threshold = function(image,sourceImage,sourceRect,destPoint,operation,threshold,color,mask,copySource,format) {
	var _color;
	var _mask;
	var _threshold;
	switch(format) {
	case 1:
		var argb = color;
		var this1 = 0;
		var rgba = this1;
		rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255;
		_color = rgba;
		var argb = mask;
		var this1 = 0;
		var rgba = this1;
		rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255;
		_mask = rgba;
		var argb = threshold;
		var this1 = 0;
		var rgba = this1;
		rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255;
		_threshold = rgba;
		break;
	case 2:
		var bgra = color;
		var this1 = 0;
		var rgba = this1;
		rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255;
		_color = rgba;
		var bgra = mask;
		var this1 = 0;
		var rgba = this1;
		rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255;
		_mask = rgba;
		var bgra = threshold;
		var this1 = 0;
		var rgba = this1;
		rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255;
		_threshold = rgba;
		break;
	default:
		_color = color;
		_mask = mask;
		_threshold = threshold;
	}
	var _operation;
	switch(operation) {
	case "!=":
		_operation = 0;
		break;
	case "<":
		_operation = 2;
		break;
	case "<=":
		_operation = 3;
		break;
	case "==":
		_operation = 1;
		break;
	case ">":
		_operation = 4;
		break;
	case ">=":
		_operation = 5;
		break;
	default:
		_operation = -1;
	}
	if(_operation == -1) {
		return 0;
	}
	var srcData = sourceImage.buffer.data;
	var destData = image.buffer.data;
	if(srcData == null || destData == null) {
		return 0;
	}
	var hits = 0;
	var srcView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(sourceImage,sourceRect);
	var destView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(image,new lime_math_Rectangle(destPoint.x,destPoint.y,srcView.width,srcView.height));
	var srcFormat = sourceImage.buffer.format;
	var destFormat = image.buffer.format;
	var srcPremultiplied = sourceImage.buffer.premultiplied;
	var destPremultiplied = image.buffer.premultiplied;
	var srcPosition;
	var destPosition;
	var srcPixel;
	var destPixel;
	var pixelMask;
	var test;
	var value;
	var _g = 0;
	var _g1 = destView.height;
	while(_g < _g1) {
		var y = _g++;
		srcPosition = srcView.byteOffset + srcView.stride * y;
		destPosition = destView.byteOffset + destView.stride * y;
		var _g2 = 0;
		var _g3 = destView.width;
		while(_g2 < _g3) {
			var x = _g2++;
			var format = srcFormat;
			var premultiplied = srcPremultiplied;
			if(premultiplied == null) {
				premultiplied = false;
			}
			if(format == null) {
				format = 0;
			}
			switch(format) {
			case 0:
				srcPixel = (srcData[srcPosition] & 255) << 24 | (srcData[srcPosition + 1] & 255) << 16 | (srcData[srcPosition + 2] & 255) << 8 | srcData[srcPosition + 3] & 255;
				break;
			case 1:
				srcPixel = (srcData[srcPosition + 1] & 255) << 24 | (srcData[srcPosition + 2] & 255) << 16 | (srcData[srcPosition + 3] & 255) << 8 | srcData[srcPosition] & 255;
				break;
			case 2:
				srcPixel = (srcData[srcPosition + 2] & 255) << 24 | (srcData[srcPosition + 1] & 255) << 16 | (srcData[srcPosition] & 255) << 8 | srcData[srcPosition + 3] & 255;
				break;
			}
			if(premultiplied) {
				if((srcPixel & 255) != 0 && (srcPixel & 255) != 255) {
					lime_math_RGBA.unmult = 255.0 / (srcPixel & 255);
					srcPixel = (lime_math_RGBA.__clamp[Math.round((srcPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((srcPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((srcPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | srcPixel & 255 & 255;
				}
			}
			pixelMask = srcPixel & _mask;
			var tmp1 = pixelMask >>> 24 & 255;
			var tmp2 = _threshold >>> 24 & 255;
			if(tmp1 != tmp2) {
				value = UInt.gt(tmp1,tmp2) ? 1 : -1;
			} else {
				tmp1 = pixelMask >>> 16 & 255;
				tmp2 = _threshold >>> 16 & 255;
				if(tmp1 != tmp2) {
					value = UInt.gt(tmp1,tmp2) ? 1 : -1;
				} else {
					tmp1 = pixelMask >>> 8 & 255;
					tmp2 = _threshold >>> 8 & 255;
					if(tmp1 != tmp2) {
						value = UInt.gt(tmp1,tmp2) ? 1 : -1;
					} else {
						tmp1 = pixelMask & 255;
						tmp2 = _threshold & 255;
						value = tmp1 != tmp2 ? UInt.gt(tmp1,tmp2) ? 1 : -1 : 0;
					}
				}
			}
			switch(_operation) {
			case 0:
				test = value != 0;
				break;
			case 1:
				test = value == 0;
				break;
			case 2:
				test = value == -1;
				break;
			case 3:
				test = value == 0 || value == -1;
				break;
			case 4:
				test = value == 1;
				break;
			case 5:
				test = value == 0 || value == 1;
				break;
			default:
				test = false;
			}
			if(test) {
				var format1 = destFormat;
				var premultiplied1 = destPremultiplied;
				if(premultiplied1 == null) {
					premultiplied1 = false;
				}
				if(format1 == null) {
					format1 = 0;
				}
				if(premultiplied1) {
					if((_color & 255) == 0) {
						if(_color != 0) {
							_color = 0;
						}
					} else if((_color & 255) != 255) {
						lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[_color & 255];
						_color = ((_color >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((_color >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((_color >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | _color & 255 & 255;
					}
				}
				switch(format1) {
				case 0:
					destData[destPosition] = _color >>> 24 & 255;
					destData[destPosition + 1] = _color >>> 16 & 255;
					destData[destPosition + 2] = _color >>> 8 & 255;
					destData[destPosition + 3] = _color & 255;
					break;
				case 1:
					destData[destPosition] = _color & 255;
					destData[destPosition + 1] = _color >>> 24 & 255;
					destData[destPosition + 2] = _color >>> 16 & 255;
					destData[destPosition + 3] = _color >>> 8 & 255;
					break;
				case 2:
					destData[destPosition] = _color >>> 8 & 255;
					destData[destPosition + 1] = _color >>> 16 & 255;
					destData[destPosition + 2] = _color >>> 24 & 255;
					destData[destPosition + 3] = _color & 255;
					break;
				}
				++hits;
			} else if(copySource) {
				var format2 = destFormat;
				var premultiplied2 = destPremultiplied;
				if(premultiplied2 == null) {
					premultiplied2 = false;
				}
				if(format2 == null) {
					format2 = 0;
				}
				if(premultiplied2) {
					if((srcPixel & 255) == 0) {
						if(srcPixel != 0) {
							srcPixel = 0;
						}
					} else if((srcPixel & 255) != 255) {
						lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[srcPixel & 255];
						srcPixel = ((srcPixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((srcPixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((srcPixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | srcPixel & 255 & 255;
					}
				}
				switch(format2) {
				case 0:
					destData[destPosition] = srcPixel >>> 24 & 255;
					destData[destPosition + 1] = srcPixel >>> 16 & 255;
					destData[destPosition + 2] = srcPixel >>> 8 & 255;
					destData[destPosition + 3] = srcPixel & 255;
					break;
				case 1:
					destData[destPosition] = srcPixel & 255;
					destData[destPosition + 1] = srcPixel >>> 24 & 255;
					destData[destPosition + 2] = srcPixel >>> 16 & 255;
					destData[destPosition + 3] = srcPixel >>> 8 & 255;
					break;
				case 2:
					destData[destPosition] = srcPixel >>> 8 & 255;
					destData[destPosition + 1] = srcPixel >>> 16 & 255;
					destData[destPosition + 2] = srcPixel >>> 24 & 255;
					destData[destPosition + 3] = srcPixel & 255;
					break;
				}
			}
			srcPosition += 4;
			destPosition += 4;
		}
	}
	if(hits > 0) {
		image.dirty = true;
		image.version++;
	}
	return hits;
};
lime__$internal_graphics_ImageDataUtil.unmultiplyAlpha = function(image) {
	var data = image.buffer.data;
	if(data == null) {
		return;
	}
	var format = image.buffer.format;
	var length = data.length / 4 | 0;
	var pixel;
	var _g = 0;
	var _g1 = length;
	while(_g < _g1) {
		var i = _g++;
		var offset = i * 4;
		var format1 = format;
		var premultiplied = true;
		if(premultiplied == null) {
			premultiplied = false;
		}
		if(format1 == null) {
			format1 = 0;
		}
		switch(format1) {
		case 0:
			pixel = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255;
			break;
		case 1:
			pixel = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255;
			break;
		case 2:
			pixel = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255;
			break;
		}
		if(premultiplied) {
			if((pixel & 255) != 0 && (pixel & 255) != 255) {
				lime_math_RGBA.unmult = 255.0 / (pixel & 255);
				pixel = (lime_math_RGBA.__clamp[Math.round((pixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | pixel & 255 & 255;
			}
		}
		var offset1 = i * 4;
		var format2 = format;
		var premultiplied1 = false;
		if(premultiplied1 == null) {
			premultiplied1 = false;
		}
		if(format2 == null) {
			format2 = 0;
		}
		if(premultiplied1) {
			if((pixel & 255) == 0) {
				if(pixel != 0) {
					pixel = 0;
				}
			} else if((pixel & 255) != 255) {
				lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[pixel & 255];
				pixel = ((pixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((pixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((pixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | pixel & 255 & 255;
			}
		}
		switch(format2) {
		case 0:
			data[offset1] = pixel >>> 24 & 255;
			data[offset1 + 1] = pixel >>> 16 & 255;
			data[offset1 + 2] = pixel >>> 8 & 255;
			data[offset1 + 3] = pixel & 255;
			break;
		case 1:
			data[offset1] = pixel & 255;
			data[offset1 + 1] = pixel >>> 24 & 255;
			data[offset1 + 2] = pixel >>> 16 & 255;
			data[offset1 + 3] = pixel >>> 8 & 255;
			break;
		case 2:
			data[offset1] = pixel >>> 8 & 255;
			data[offset1 + 1] = pixel >>> 16 & 255;
			data[offset1 + 2] = pixel >>> 24 & 255;
			data[offset1 + 3] = pixel & 255;
			break;
		}
	}
	image.buffer.premultiplied = false;
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.__boxBlur = function(imgA,imgB,w,h,bx,by) {
	imgB.set(imgA);
	var bx1 = bx | 0;
	var by1 = by | 0;
	lime__$internal_graphics_ImageDataUtil.__boxBlurH(imgB,imgA,w,h,bx1,0);
	lime__$internal_graphics_ImageDataUtil.__boxBlurH(imgB,imgA,w,h,bx1,1);
	lime__$internal_graphics_ImageDataUtil.__boxBlurH(imgB,imgA,w,h,bx1,2);
	lime__$internal_graphics_ImageDataUtil.__boxBlurH(imgB,imgA,w,h,bx1,3);
	var iarr = 1 / (by1 + by1 + 1);
	var ws = w * 4;
	var ti;
	var li;
	var ri;
	var fv;
	var lv;
	var val;
	var _g = 0;
	var _g1 = w;
	while(_g < _g1) {
		var i = _g++;
		ti = i * 4;
		li = ti;
		ri = ti + by1 * ws;
		fv = imgA[ti];
		lv = imgA[ti + ws * (h - 1)];
		val = (by1 + 1) * fv;
		var _g2 = 0;
		var _g3 = by1;
		while(_g2 < _g3) {
			var j = _g2++;
			val = val + imgA[ti + j * ws];
		}
		var _g4 = 0;
		var _g5 = by1 + 1;
		while(_g4 < _g5) {
			var j1 = _g4++;
			val = val + (imgA[ri] - fv);
			imgB[ti] = Math.round(UInt.toFloat(val) * iarr);
			ri += ws;
			ti += ws;
		}
		var _g6 = by1 + 1;
		var _g7 = h - by1;
		while(_g6 < _g7) {
			var j2 = _g6++;
			val = val + (imgA[ri] - imgA[li]);
			imgB[ti] = Math.round(UInt.toFloat(val) * iarr);
			li += ws;
			ri += ws;
			ti += ws;
		}
		var _g8 = h - by1;
		var _g9 = h;
		while(_g8 < _g9) {
			var j3 = _g8++;
			val = val + (lv - imgA[li]);
			imgB[ti] = Math.round(UInt.toFloat(val) * iarr);
			li += ws;
			ti += ws;
		}
	}
	var iarr = 1 / (by1 + by1 + 1);
	var ws = w * 4;
	var ti;
	var li;
	var ri;
	var fv;
	var lv;
	var val;
	var _g = 0;
	var _g1 = w;
	while(_g < _g1) {
		var i = _g++;
		ti = i * 4 + 1;
		li = ti;
		ri = ti + by1 * ws;
		fv = imgA[ti];
		lv = imgA[ti + ws * (h - 1)];
		val = (by1 + 1) * fv;
		var _g2 = 0;
		var _g3 = by1;
		while(_g2 < _g3) {
			var j = _g2++;
			val = val + imgA[ti + j * ws];
		}
		var _g4 = 0;
		var _g5 = by1 + 1;
		while(_g4 < _g5) {
			var j1 = _g4++;
			val = val + (imgA[ri] - fv);
			imgB[ti] = Math.round(UInt.toFloat(val) * iarr);
			ri += ws;
			ti += ws;
		}
		var _g6 = by1 + 1;
		var _g7 = h - by1;
		while(_g6 < _g7) {
			var j2 = _g6++;
			val = val + (imgA[ri] - imgA[li]);
			imgB[ti] = Math.round(UInt.toFloat(val) * iarr);
			li += ws;
			ri += ws;
			ti += ws;
		}
		var _g8 = h - by1;
		var _g9 = h;
		while(_g8 < _g9) {
			var j3 = _g8++;
			val = val + (lv - imgA[li]);
			imgB[ti] = Math.round(UInt.toFloat(val) * iarr);
			li += ws;
			ti += ws;
		}
	}
	var iarr = 1 / (by1 + by1 + 1);
	var ws = w * 4;
	var ti;
	var li;
	var ri;
	var fv;
	var lv;
	var val;
	var _g = 0;
	var _g1 = w;
	while(_g < _g1) {
		var i = _g++;
		ti = i * 4 + 2;
		li = ti;
		ri = ti + by1 * ws;
		fv = imgA[ti];
		lv = imgA[ti + ws * (h - 1)];
		val = (by1 + 1) * fv;
		var _g2 = 0;
		var _g3 = by1;
		while(_g2 < _g3) {
			var j = _g2++;
			val = val + imgA[ti + j * ws];
		}
		var _g4 = 0;
		var _g5 = by1 + 1;
		while(_g4 < _g5) {
			var j1 = _g4++;
			val = val + (imgA[ri] - fv);
			imgB[ti] = Math.round(UInt.toFloat(val) * iarr);
			ri += ws;
			ti += ws;
		}
		var _g6 = by1 + 1;
		var _g7 = h - by1;
		while(_g6 < _g7) {
			var j2 = _g6++;
			val = val + (imgA[ri] - imgA[li]);
			imgB[ti] = Math.round(UInt.toFloat(val) * iarr);
			li += ws;
			ri += ws;
			ti += ws;
		}
		var _g8 = h - by1;
		var _g9 = h;
		while(_g8 < _g9) {
			var j3 = _g8++;
			val = val + (lv - imgA[li]);
			imgB[ti] = Math.round(UInt.toFloat(val) * iarr);
			li += ws;
			ti += ws;
		}
	}
	var iarr = 1 / (by1 + by1 + 1);
	var ws = w * 4;
	var ti;
	var li;
	var ri;
	var fv;
	var lv;
	var val;
	var _g = 0;
	var _g1 = w;
	while(_g < _g1) {
		var i = _g++;
		ti = i * 4 + 3;
		li = ti;
		ri = ti + by1 * ws;
		fv = imgA[ti];
		lv = imgA[ti + ws * (h - 1)];
		val = (by1 + 1) * fv;
		var _g2 = 0;
		var _g3 = by1;
		while(_g2 < _g3) {
			var j = _g2++;
			val = val + imgA[ti + j * ws];
		}
		var _g4 = 0;
		var _g5 = by1 + 1;
		while(_g4 < _g5) {
			var j1 = _g4++;
			val = val + (imgA[ri] - fv);
			imgB[ti] = Math.round(UInt.toFloat(val) * iarr);
			ri += ws;
			ti += ws;
		}
		var _g6 = by1 + 1;
		var _g7 = h - by1;
		while(_g6 < _g7) {
			var j2 = _g6++;
			val = val + (imgA[ri] - imgA[li]);
			imgB[ti] = Math.round(UInt.toFloat(val) * iarr);
			li += ws;
			ri += ws;
			ti += ws;
		}
		var _g8 = h - by1;
		var _g9 = h;
		while(_g8 < _g9) {
			var j3 = _g8++;
			val = val + (lv - imgA[li]);
			imgB[ti] = Math.round(UInt.toFloat(val) * iarr);
			li += ws;
			ti += ws;
		}
	}
};
lime__$internal_graphics_ImageDataUtil.__boxBlurH = function(imgA,imgB,w,h,r,off) {
	var iarr = 1 / (r + r + 1);
	var ti;
	var li;
	var ri;
	var fv;
	var lv;
	var val;
	var _g = 0;
	var _g1 = h;
	while(_g < _g1) {
		var i = _g++;
		ti = i * w;
		li = ti;
		ri = ti + r;
		fv = imgA[ti * 4 + off];
		lv = imgA[(ti + w - 1) * 4 + off];
		val = (r + 1) * fv;
		var _g2 = 0;
		var _g3 = r;
		while(_g2 < _g3) {
			var j = _g2++;
			val = val + imgA[(ti + j) * 4 + off];
		}
		var _g4 = 0;
		var _g5 = r + 1;
		while(_g4 < _g5) {
			var j1 = _g4++;
			val = val + (imgA[ri * 4 + off] - fv);
			imgB[ti * 4 + off] = Math.round(UInt.toFloat(val) * iarr);
			++ri;
			++ti;
		}
		var _g6 = r + 1;
		var _g7 = w - r;
		while(_g6 < _g7) {
			var j2 = _g6++;
			val = val + (imgA[ri * 4 + off] - imgA[li * 4 + off]);
			imgB[ti * 4 + off] = Math.round(UInt.toFloat(val) * iarr);
			++ri;
			++li;
			++ti;
		}
		var _g8 = w - r;
		var _g9 = w;
		while(_g8 < _g9) {
			var j3 = _g8++;
			val = val + (lv - imgA[li * 4 + off]);
			imgB[ti * 4 + off] = Math.round(UInt.toFloat(val) * iarr);
			++li;
			++ti;
		}
	}
};
lime__$internal_graphics_ImageDataUtil.__boxBlurT = function(imgA,imgB,w,h,r,off) {
	var iarr = 1 / (r + r + 1);
	var ws = w * 4;
	var ti;
	var li;
	var ri;
	var fv;
	var lv;
	var val;
	var _g = 0;
	var _g1 = w;
	while(_g < _g1) {
		var i = _g++;
		ti = i * 4 + off;
		li = ti;
		ri = ti + r * ws;
		fv = imgA[ti];
		lv = imgA[ti + ws * (h - 1)];
		val = (r + 1) * fv;
		var _g2 = 0;
		var _g3 = r;
		while(_g2 < _g3) {
			var j = _g2++;
			val = val + imgA[ti + j * ws];
		}
		var _g4 = 0;
		var _g5 = r + 1;
		while(_g4 < _g5) {
			var j1 = _g4++;
			val = val + (imgA[ri] - fv);
			imgB[ti] = Math.round(UInt.toFloat(val) * iarr);
			ri += ws;
			ti += ws;
		}
		var _g6 = r + 1;
		var _g7 = h - r;
		while(_g6 < _g7) {
			var j2 = _g6++;
			val = val + (imgA[ri] - imgA[li]);
			imgB[ti] = Math.round(UInt.toFloat(val) * iarr);
			li += ws;
			ri += ws;
			ti += ws;
		}
		var _g8 = h - r;
		var _g9 = h;
		while(_g8 < _g9) {
			var j3 = _g8++;
			val = val + (lv - imgA[li]);
			imgB[ti] = Math.round(UInt.toFloat(val) * iarr);
			li += ws;
			ti += ws;
		}
	}
};
lime__$internal_graphics_ImageDataUtil.__calculateSourceOffset = function(sourceRect,destPoint,destX,destY) {
	var sourceX = destX - (destPoint.x | 0);
	var sourceY = destY - (destPoint.y | 0);
	var offset = 0;
	if(sourceX < 0 || sourceY < 0 || sourceX >= sourceRect.width || sourceY >= sourceRect.height) {
		offset = -1;
	} else {
		offset = 4 * (sourceY * (sourceRect.width | 0) + sourceX);
	}
	return offset;
};
lime__$internal_graphics_ImageDataUtil.__getBoxesForGaussianBlur = function(sigma,n) {
	var wIdeal = Math.sqrt(12 * sigma * sigma / n + 1);
	var wl = Math.floor(wIdeal);
	if(wl % 2 == 0) {
		--wl;
	}
	var wu = wl + 2;
	var mIdeal = (12 * sigma * sigma - n * wl * wl - 4 * n * wl - 3 * n) / (-4 * wl - 4);
	var m = Math.round(mIdeal);
	var sizes = [];
	var _g = 0;
	var _g1 = n;
	while(_g < _g1) {
		var i = _g++;
		sizes.push(i < m ? wl : wu);
	}
	return sizes;
};
lime__$internal_graphics_ImageDataUtil.__pixelCompare = function(n1,n2) {
	var tmp1 = n1 >>> 24 & 255;
	var tmp2 = n2 >>> 24 & 255;
	if(tmp1 != tmp2) {
		if(UInt.gt(tmp1,tmp2)) {
			return 1;
		} else {
			return -1;
		}
	} else {
		tmp1 = n1 >>> 16 & 255;
		tmp2 = n2 >>> 16 & 255;
		if(tmp1 != tmp2) {
			if(UInt.gt(tmp1,tmp2)) {
				return 1;
			} else {
				return -1;
			}
		} else {
			tmp1 = n1 >>> 8 & 255;
			tmp2 = n2 >>> 8 & 255;
			if(tmp1 != tmp2) {
				if(UInt.gt(tmp1,tmp2)) {
					return 1;
				} else {
					return -1;
				}
			} else {
				tmp1 = n1 & 255;
				tmp2 = n2 & 255;
				if(tmp1 != tmp2) {
					if(UInt.gt(tmp1,tmp2)) {
						return 1;
					} else {
						return -1;
					}
				} else {
					return 0;
				}
			}
		}
	}
};
lime__$internal_graphics_ImageDataUtil.__translatePixel = function(imgB,sourceRect,destRect,destPoint,destX,destY,strength) {
	var d = 4 * (destY * (destRect.width | 0) + destX);
	var s = lime__$internal_graphics_ImageDataUtil.__calculateSourceOffset(sourceRect,destPoint,destX,destY);
	if(s < 0) {
		imgB[d] = imgB[d + 1] = imgB[d + 2] = imgB[d + 3] = 0;
	} else {
		imgB[d] = imgB[s];
		imgB[d + 1] = imgB[s + 1];
		imgB[d + 2] = imgB[s + 2];
		var a = UInt.toFloat(imgB[s + 3]) * strength | 0;
		imgB[d + 3] = a < 0 ? 0 : a > 255 ? 255 : a;
	}
};
var lime__$internal_graphics__$ImageDataUtil_ImageDataView = function(image,rect) {
	this.image = image;
	if(rect == null) {
		this.rect = image.get_rect();
	} else {
		if(rect.x < 0) {
			rect.x = 0;
		}
		if(rect.y < 0) {
			rect.y = 0;
		}
		if(rect.x + rect.width > image.width) {
			rect.width = image.width - rect.x;
		}
		if(rect.y + rect.height > image.height) {
			rect.height = image.height - rect.y;
		}
		if(rect.width < 0) {
			rect.width = 0;
		}
		if(rect.height < 0) {
			rect.height = 0;
		}
		this.rect = rect;
	}
	this.stride = image.buffer.get_stride();
	this.__update();
};
$hxClasses["lime._internal.graphics._ImageDataUtil.ImageDataView"] = lime__$internal_graphics__$ImageDataUtil_ImageDataView;
lime__$internal_graphics__$ImageDataUtil_ImageDataView.__name__ = "lime._internal.graphics._ImageDataUtil.ImageDataView";
lime__$internal_graphics__$ImageDataUtil_ImageDataView.prototype = {
	x: null
	,y: null
	,height: null
	,width: null
	,byteOffset: null
	,image: null
	,rect: null
	,stride: null
	,tempRect: null
	,clip: function(x,y,width,height) {
		if(this.tempRect == null) {
			this.tempRect = new lime_math_Rectangle();
		}
		this.tempRect.setTo(x,y,width,height);
		this.rect.intersection(this.tempRect,this.rect);
		this.__update();
	}
	,hasRow: function(y) {
		if(y >= 0) {
			return y < this.height;
		} else {
			return false;
		}
	}
	,offset: function(x,y) {
		if(x < 0) {
			this.rect.x += x;
			if(this.rect.x < 0) {
				this.rect.x = 0;
			}
		} else {
			this.rect.x += x;
			this.rect.width -= x;
		}
		if(y < 0) {
			this.rect.y += y;
			if(this.rect.y < 0) {
				this.rect.y = 0;
			}
		} else {
			this.rect.y += y;
			this.rect.height -= y;
		}
		this.__update();
	}
	,row: function(y) {
		return this.byteOffset + this.stride * y;
	}
	,__update: function() {
		this.x = Math.ceil(this.rect.x);
		this.y = Math.ceil(this.rect.y);
		this.width = Math.floor(this.rect.width);
		this.height = Math.floor(this.rect.height);
		this.byteOffset = this.stride * (this.y + this.image.offsetY) + (this.x + this.image.offsetX) * 4;
	}
	,__class__: lime__$internal_graphics__$ImageDataUtil_ImageDataView
};
var lime__$internal_graphics_StackBlur = function() { };
$hxClasses["lime._internal.graphics.StackBlur"] = lime__$internal_graphics_StackBlur;
lime__$internal_graphics_StackBlur.__name__ = "lime._internal.graphics.StackBlur";
lime__$internal_graphics_StackBlur.blur = function(dest,source,sourceRect,destPoint,blurX,blurY,quality) {
	dest.copyPixels(source,sourceRect,destPoint);
	lime__$internal_graphics_StackBlur.__stackBlurCanvasRGBA(dest,sourceRect.width | 0,sourceRect.height | 0,blurX,blurY,quality);
};
lime__$internal_graphics_StackBlur.__stackBlurCanvasRGBA = function(image,width,height,blurX,blurY,quality) {
	var radiusX = Math.round(blurX) >> 1;
	var radiusY = Math.round(blurY) >> 1;
	if(lime__$internal_graphics_StackBlur.MUL_TABLE == null) {
		return;
	}
	if(radiusX >= lime__$internal_graphics_StackBlur.MUL_TABLE.length) {
		radiusX = lime__$internal_graphics_StackBlur.MUL_TABLE.length - 1;
	}
	if(radiusY >= lime__$internal_graphics_StackBlur.MUL_TABLE.length) {
		radiusY = lime__$internal_graphics_StackBlur.MUL_TABLE.length - 1;
	}
	if(radiusX < 0 || radiusY < 0) {
		return;
	}
	var iterations = quality;
	if(iterations < 1) {
		iterations = 1;
	}
	if(iterations > 3) {
		iterations = 3;
	}
	var px = image.get_data();
	var x;
	var y;
	var i;
	var p;
	var yp;
	var yi;
	var yw;
	var r;
	var g;
	var b;
	var a;
	var pr;
	var pg;
	var pb;
	var pa;
	var f;
	var divx = radiusX + radiusX + 1;
	var divy = radiusY + radiusY + 1;
	var w = width;
	var h = height;
	var w1 = w - 1;
	var h1 = h - 1;
	var rxp1 = radiusX + 1;
	var ryp1 = radiusY + 1;
	var ssx = new lime__$internal_graphics_BlurStack();
	var sx = ssx;
	var _g = 1;
	var _g1 = divx;
	while(_g < _g1) {
		var i1 = _g++;
		sx = sx.n = new lime__$internal_graphics_BlurStack();
	}
	sx.n = ssx;
	var ssy = new lime__$internal_graphics_BlurStack();
	var sy = ssy;
	var _g = 1;
	var _g1 = divy;
	while(_g < _g1) {
		var i1 = _g++;
		sy = sy.n = new lime__$internal_graphics_BlurStack();
	}
	sy.n = ssy;
	var si = null;
	var mtx = lime__$internal_graphics_StackBlur.MUL_TABLE[radiusX];
	var stx = lime__$internal_graphics_StackBlur.SHG_TABLE[radiusX];
	var mty = lime__$internal_graphics_StackBlur.MUL_TABLE[radiusY];
	var sty = lime__$internal_graphics_StackBlur.SHG_TABLE[radiusY];
	while(iterations > 0) {
		--iterations;
		yi = 0;
		yw = yi;
		var ms = mtx;
		var ss = stx;
		y = h;
		while(true) {
			pr = px[yi];
			r = rxp1 * pr;
			pg = px[yi + 1];
			g = rxp1 * pg;
			pb = px[yi + 2];
			b = rxp1 * pb;
			pa = px[yi + 3];
			a = rxp1 * pa;
			sx = ssx;
			i = rxp1;
			while(true) {
				sx.r = pr;
				sx.g = pg;
				sx.b = pb;
				sx.a = pa;
				sx = sx.n;
				if(!(--i > -1)) {
					break;
				}
			}
			var _g = 1;
			var _g1 = rxp1;
			while(_g < _g1) {
				var i1 = _g++;
				p = yi + ((w1 < i1 ? w1 : i1) << 2);
				r += sx.r = px[p];
				g += sx.g = px[p + 1];
				b += sx.b = px[p + 2];
				a += sx.a = px[p + 3];
				sx = sx.n;
			}
			si = ssx;
			var _g2 = 0;
			var _g3 = w;
			while(_g2 < _g3) {
				var x = _g2++;
				px[yi++] = r * ms >>> ss;
				px[yi++] = g * ms >>> ss;
				px[yi++] = b * ms >>> ss;
				px[yi++] = a * ms >>> ss;
				p = x + radiusX + 1;
				p = yw + (p < w1 ? p : w1) << 2;
				r -= si.r - (si.r = px[p]);
				g -= si.g - (si.g = px[p + 1]);
				b -= si.b - (si.b = px[p + 2]);
				a -= si.a - (si.a = px[p + 3]);
				si = si.n;
			}
			yw += w;
			if(!(--y > 0)) {
				break;
			}
		}
		ms = mty;
		ss = sty;
		var _g4 = 0;
		var _g5 = w;
		while(_g4 < _g5) {
			var x1 = _g4++;
			yi = x1 << 2;
			pr = px[yi];
			r = ryp1 * pr;
			pg = px[yi + 1];
			g = ryp1 * pg;
			pb = px[yi + 2];
			b = ryp1 * pb;
			pa = px[yi + 3];
			a = ryp1 * pa;
			sy = ssy;
			var _g6 = 0;
			var _g7 = ryp1;
			while(_g6 < _g7) {
				var i2 = _g6++;
				sy.r = pr;
				sy.g = pg;
				sy.b = pb;
				sy.a = pa;
				sy = sy.n;
			}
			yp = w;
			var _g8 = 1;
			var _g9 = radiusY + 1;
			while(_g8 < _g9) {
				var i3 = _g8++;
				yi = yp + x1 << 2;
				r += sy.r = px[yi];
				g += sy.g = px[yi + 1];
				b += sy.b = px[yi + 2];
				a += sy.a = px[yi + 3];
				sy = sy.n;
				if(i3 < h1) {
					yp += w;
				}
			}
			yi = x1;
			si = ssy;
			if(iterations > 0) {
				var _g10 = 0;
				var _g11 = h;
				while(_g10 < _g11) {
					var y1 = _g10++;
					p = yi << 2;
					pa = a * ms >>> ss;
					px[p + 3] = pa;
					if(pa > 0) {
						px[p] = r * ms >>> ss;
						px[p + 1] = g * ms >>> ss;
						px[p + 2] = b * ms >>> ss;
					} else {
						px[p] = px[p + 1] = px[p + 2] = 0;
					}
					p = y1 + ryp1;
					p = x1 + (p < h1 ? p : h1) * w << 2;
					r -= si.r - (si.r = px[p]);
					g -= si.g - (si.g = px[p + 1]);
					b -= si.b - (si.b = px[p + 2]);
					a -= si.a - (si.a = px[p + 3]);
					si = si.n;
					yi += w;
				}
			} else {
				var _g12 = 0;
				var _g13 = h;
				while(_g12 < _g13) {
					var y2 = _g12++;
					p = yi << 2;
					pa = a * ms >>> ss;
					px[p + 3] = pa;
					if(pa > 0) {
						f = 255 / pa;
						pr = (r * ms >>> ss) * f | 0;
						pg = (g * ms >>> ss) * f | 0;
						pb = (b * ms >>> ss) * f | 0;
						px[p] = pr > 255 ? 255 : pr;
						px[p + 1] = pg > 255 ? 255 : pg;
						px[p + 2] = pb > 255 ? 255 : pb;
					} else {
						px[p] = px[p + 1] = px[p + 2] = 0;
					}
					p = y2 + ryp1;
					p = x1 + (p < h1 ? p : h1) * w << 2;
					r -= si.r - (si.r = px[p]);
					g -= si.g - (si.g = px[p + 1]);
					b -= si.b - (si.b = px[p + 2]);
					a -= si.a - (si.a = px[p + 3]);
					si = si.n;
					yi += w;
				}
			}
		}
	}
};
var lime__$internal_graphics_BlurStack = function() {
	this.r = 0;
	this.g = 0;
	this.b = 0;
	this.a = 0;
	this.n = null;
};
$hxClasses["lime._internal.graphics.BlurStack"] = lime__$internal_graphics_BlurStack;
lime__$internal_graphics_BlurStack.__name__ = "lime._internal.graphics.BlurStack";
lime__$internal_graphics_BlurStack.prototype = {
	r: null
	,g: null
	,b: null
	,a: null
	,n: null
	,__class__: lime__$internal_graphics_BlurStack
};
var lime__$internal_macros_AssetsMacro = function() { };
$hxClasses["lime._internal.macros.AssetsMacro"] = lime__$internal_macros_AssetsMacro;
lime__$internal_macros_AssetsMacro.__name__ = "lime._internal.macros.AssetsMacro";
var lime_app_Event = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app.Event"] = lime_app_Event;
lime_app_Event.__name__ = "lime.app.Event";
lime_app_Event.prototype = {
	canceled: null
	,__listeners: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,dispatch: null
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(Reflect.compareMethods(l,listener)) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(Reflect.compareMethods(this.__listeners[i],listener)) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,__class__: lime_app_Event
};
var lime_app_Future = function(work,async) {
	if(async == null) {
		async = false;
	}
	if(work != null) {
		if(async) {
			var promise = new lime_app_Promise();
			promise.future = this;
			lime_app__$Future_FutureWork.queue({ promise : promise, work : work});
		} else {
			try {
				this.value = work();
				this.isComplete = true;
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				var e = haxe_Exception.caught(_g).unwrap();
				this.error = e;
				this.isError = true;
			}
		}
	}
};
$hxClasses["lime.app.Future"] = lime_app_Future;
lime_app_Future.__name__ = "lime.app.Future";
lime_app_Future.ofEvents = function(onComplete,onError,onProgress) {
	var promise = new lime_app_Promise();
	onComplete.add(function(data) {
		promise.complete(data);
	},true);
	if(onError != null) {
		onError.add(function(error) {
			promise.error(error);
		},true);
	}
	if(onProgress != null) {
		onProgress.add(function(progress,total) {
			promise.progress(progress,total);
		},true);
	}
	return promise.future;
};
lime_app_Future.withError = function(error) {
	var future = new lime_app_Future();
	future.isError = true;
	future.error = error;
	return future;
};
lime_app_Future.withValue = function(value) {
	var future = new lime_app_Future();
	future.isComplete = true;
	future.value = value;
	return future;
};
lime_app_Future.prototype = {
	error: null
	,isComplete: null
	,isError: null
	,value: null
	,__completeListeners: null
	,__errorListeners: null
	,__progressListeners: null
	,onComplete: function(listener) {
		if(listener != null) {
			if(this.isComplete) {
				listener(this.value);
			} else if(!this.isError) {
				if(this.__completeListeners == null) {
					this.__completeListeners = [];
				}
				this.__completeListeners.push(listener);
			}
		}
		return this;
	}
	,onError: function(listener) {
		if(listener != null) {
			if(this.isError) {
				listener(this.error);
			} else if(!this.isComplete) {
				if(this.__errorListeners == null) {
					this.__errorListeners = [];
				}
				this.__errorListeners.push(listener);
			}
		}
		return this;
	}
	,onProgress: function(listener) {
		if(listener != null) {
			if(this.__progressListeners == null) {
				this.__progressListeners = [];
			}
			this.__progressListeners.push(listener);
		}
		return this;
	}
	,ready: function(waitTime) {
		if(waitTime == null) {
			waitTime = -1;
		}
		if(this.isComplete || this.isError) {
			return this;
		} else {
			lime_utils_Log.warn("Cannot block thread in JavaScript",{ fileName : "lime/app/Future.hx", lineNumber : 209, className : "lime.app.Future", methodName : "ready"});
			return this;
		}
	}
	,result: function(waitTime) {
		if(waitTime == null) {
			waitTime = -1;
		}
		this.ready(waitTime);
		if(this.isComplete) {
			return this.value;
		} else {
			return null;
		}
	}
	,then: function(next) {
		if(this.isComplete) {
			return next(this.value);
		} else if(this.isError) {
			var future = new lime_app_Future();
			future.isError = true;
			future.error = this.error;
			return future;
		} else {
			var promise = new lime_app_Promise();
			this.onError($bind(promise,promise.error));
			this.onProgress($bind(promise,promise.progress));
			this.onComplete(function(val) {
				var future = next(val);
				future.onError($bind(promise,promise.error));
				future.onComplete($bind(promise,promise.complete));
			});
			return promise.future;
		}
	}
	,__class__: lime_app_Future
};
var lime_app__$Future_FutureWork = function() { };
$hxClasses["lime.app._Future.FutureWork"] = lime_app__$Future_FutureWork;
lime_app__$Future_FutureWork.__name__ = "lime.app._Future.FutureWork";
lime_app__$Future_FutureWork.threadPool = null;
lime_app__$Future_FutureWork.queue = function(state) {
	if(lime_app__$Future_FutureWork.threadPool == null) {
		lime_app__$Future_FutureWork.threadPool = new lime_system_ThreadPool();
		lime_app__$Future_FutureWork.threadPool.doWork.add(lime_app__$Future_FutureWork.threadPool_doWork);
		lime_app__$Future_FutureWork.threadPool.onComplete.add(lime_app__$Future_FutureWork.threadPool_onComplete);
		lime_app__$Future_FutureWork.threadPool.onError.add(lime_app__$Future_FutureWork.threadPool_onError);
	}
	lime_app__$Future_FutureWork.threadPool.queue(state);
};
lime_app__$Future_FutureWork.threadPool_doWork = function(state) {
	try {
		var result = state.work();
		lime_app__$Future_FutureWork.threadPool.sendComplete({ promise : state.promise, result : result});
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		var e = haxe_Exception.caught(_g).unwrap();
		lime_app__$Future_FutureWork.threadPool.sendError({ promise : state.promise, error : e});
	}
};
lime_app__$Future_FutureWork.threadPool_onComplete = function(state) {
	state.promise.complete(state.result);
};
lime_app__$Future_FutureWork.threadPool_onError = function(state) {
	state.promise.error(state.error);
};
var lime_app_Promise = function() {
	this.future = new lime_app_Future();
};
$hxClasses["lime.app.Promise"] = lime_app_Promise;
lime_app_Promise.__name__ = "lime.app.Promise";
lime_app_Promise.prototype = {
	future: null
	,isComplete: null
	,isError: null
	,complete: function(data) {
		if(!this.future.isError) {
			this.future.isComplete = true;
			this.future.value = data;
			if(this.future.__completeListeners != null) {
				var _g = 0;
				var _g1 = this.future.__completeListeners;
				while(_g < _g1.length) {
					var listener = _g1[_g];
					++_g;
					listener(data);
				}
				this.future.__completeListeners = null;
			}
		}
		return this;
	}
	,completeWith: function(future) {
		future.onComplete($bind(this,this.complete));
		future.onError($bind(this,this.error));
		future.onProgress($bind(this,this.progress));
		return this;
	}
	,error: function(msg) {
		if(!this.future.isComplete) {
			this.future.isError = true;
			this.future.error = msg;
			if(this.future.__errorListeners != null) {
				var _g = 0;
				var _g1 = this.future.__errorListeners;
				while(_g < _g1.length) {
					var listener = _g1[_g];
					++_g;
					listener(msg);
				}
				this.future.__errorListeners = null;
			}
		}
		return this;
	}
	,progress: function(progress,total) {
		if(!this.future.isError && !this.future.isComplete) {
			if(this.future.__progressListeners != null) {
				var _g = 0;
				var _g1 = this.future.__progressListeners;
				while(_g < _g1.length) {
					var listener = _g1[_g];
					++_g;
					listener(progress,total);
				}
			}
		}
		return this;
	}
	,get_isComplete: function() {
		return this.future.isComplete;
	}
	,get_isError: function() {
		return this.future.isError;
	}
	,__class__: lime_app_Promise
	,__properties__: {get_isError:"get_isError",get_isComplete:"get_isComplete"}
};
var lime_app__$Event_$Dynamic_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_Dynamic_Void"] = lime_app__$Event_$Dynamic_$Void;
lime_app__$Event_$Dynamic_$Void.__name__ = "lime.app._Event_Dynamic_Void";
lime_app__$Event_$Dynamic_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(Reflect.compareMethods(l,listener)) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(Reflect.compareMethods(this.__listeners[i],listener)) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,__listeners: null
	,dispatch: function(a) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$Dynamic_$Void
};
var lime_app__$Event_$Float_$Float_$Float_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_Float_Float_Float_Void"] = lime_app__$Event_$Float_$Float_$Float_$Void;
lime_app__$Event_$Float_$Float_$Float_$Void.__name__ = "lime.app._Event_Float_Float_Float_Void";
lime_app__$Event_$Float_$Float_$Float_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(Reflect.compareMethods(l,listener)) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(Reflect.compareMethods(this.__listeners[i],listener)) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,__listeners: null
	,dispatch: function(a,a1,a2) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a,a1,a2);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$Float_$Float_$Float_$Void
};
var lime_app__$Event_$Float_$Float_$Int_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_Float_Float_Int_Void"] = lime_app__$Event_$Float_$Float_$Int_$Void;
lime_app__$Event_$Float_$Float_$Int_$Void.__name__ = "lime.app._Event_Float_Float_Int_Void";
lime_app__$Event_$Float_$Float_$Int_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(Reflect.compareMethods(l,listener)) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(Reflect.compareMethods(this.__listeners[i],listener)) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,__listeners: null
	,dispatch: function(a,a1,a2) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a,a1,a2);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$Float_$Float_$Int_$Void
};
var lime_app__$Event_$Float_$Float_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_Float_Float_Void"] = lime_app__$Event_$Float_$Float_$Void;
lime_app__$Event_$Float_$Float_$Void.__name__ = "lime.app._Event_Float_Float_Void";
lime_app__$Event_$Float_$Float_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(Reflect.compareMethods(l,listener)) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(Reflect.compareMethods(this.__listeners[i],listener)) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,__listeners: null
	,dispatch: function(a,a1) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a,a1);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$Float_$Float_$Void
};
var lime_app__$Event_$Float_$Float_$lime_$ui_$MouseButton_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_Float_Float_lime_ui_MouseButton_Void"] = lime_app__$Event_$Float_$Float_$lime_$ui_$MouseButton_$Void;
lime_app__$Event_$Float_$Float_$lime_$ui_$MouseButton_$Void.__name__ = "lime.app._Event_Float_Float_lime_ui_MouseButton_Void";
lime_app__$Event_$Float_$Float_$lime_$ui_$MouseButton_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(Reflect.compareMethods(l,listener)) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(Reflect.compareMethods(this.__listeners[i],listener)) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,__listeners: null
	,dispatch: function(a,a1,a2) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a,a1,a2);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$Float_$Float_$lime_$ui_$MouseButton_$Void
};
var lime_app__$Event_$Float_$Float_$lime_$ui_$MouseWheelMode_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_Float_Float_lime_ui_MouseWheelMode_Void"] = lime_app__$Event_$Float_$Float_$lime_$ui_$MouseWheelMode_$Void;
lime_app__$Event_$Float_$Float_$lime_$ui_$MouseWheelMode_$Void.__name__ = "lime.app._Event_Float_Float_lime_ui_MouseWheelMode_Void";
lime_app__$Event_$Float_$Float_$lime_$ui_$MouseWheelMode_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(Reflect.compareMethods(l,listener)) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(Reflect.compareMethods(this.__listeners[i],listener)) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,__listeners: null
	,dispatch: function(a,a1,a2) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a,a1,a2);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$Float_$Float_$lime_$ui_$MouseWheelMode_$Void
};
var lime_app__$Event_$Int_$Float_$Float_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_Int_Float_Float_Void"] = lime_app__$Event_$Int_$Float_$Float_$Void;
lime_app__$Event_$Int_$Float_$Float_$Void.__name__ = "lime.app._Event_Int_Float_Float_Void";
lime_app__$Event_$Int_$Float_$Float_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(Reflect.compareMethods(l,listener)) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(Reflect.compareMethods(this.__listeners[i],listener)) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,__listeners: null
	,dispatch: function(a,a1,a2) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a,a1,a2);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$Int_$Float_$Float_$Void
};
var lime_app__$Event_$Int_$Float_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_Int_Float_Void"] = lime_app__$Event_$Int_$Float_$Void;
lime_app__$Event_$Int_$Float_$Void.__name__ = "lime.app._Event_Int_Float_Void";
lime_app__$Event_$Int_$Float_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(Reflect.compareMethods(l,listener)) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(Reflect.compareMethods(this.__listeners[i],listener)) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,__listeners: null
	,dispatch: function(a,a1) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a,a1);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$Int_$Float_$Void
};
var lime_app__$Event_$Int_$Int_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_Int_Int_Void"] = lime_app__$Event_$Int_$Int_$Void;
lime_app__$Event_$Int_$Int_$Void.__name__ = "lime.app._Event_Int_Int_Void";
lime_app__$Event_$Int_$Int_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(Reflect.compareMethods(l,listener)) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(Reflect.compareMethods(this.__listeners[i],listener)) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,__listeners: null
	,dispatch: function(a,a1) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a,a1);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$Int_$Int_$Void
};
var lime_app__$Event_$Int_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_Int_Void"] = lime_app__$Event_$Int_$Void;
lime_app__$Event_$Int_$Void.__name__ = "lime.app._Event_Int_Void";
lime_app__$Event_$Int_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(Reflect.compareMethods(l,listener)) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(Reflect.compareMethods(this.__listeners[i],listener)) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,__listeners: null
	,dispatch: function(a) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$Int_$Void
};
var lime_app__$Event_$Int_$lime_$ui_$JoystickHatPosition_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_Int_lime_ui_JoystickHatPosition_Void"] = lime_app__$Event_$Int_$lime_$ui_$JoystickHatPosition_$Void;
lime_app__$Event_$Int_$lime_$ui_$JoystickHatPosition_$Void.__name__ = "lime.app._Event_Int_lime_ui_JoystickHatPosition_Void";
lime_app__$Event_$Int_$lime_$ui_$JoystickHatPosition_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(Reflect.compareMethods(l,listener)) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(Reflect.compareMethods(this.__listeners[i],listener)) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,__listeners: null
	,dispatch: function(a,a1) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a,a1);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$Int_$lime_$ui_$JoystickHatPosition_$Void
};
var lime_app__$Event_$String_$Int_$Int_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_String_Int_Int_Void"] = lime_app__$Event_$String_$Int_$Int_$Void;
lime_app__$Event_$String_$Int_$Int_$Void.__name__ = "lime.app._Event_String_Int_Int_Void";
lime_app__$Event_$String_$Int_$Int_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(Reflect.compareMethods(l,listener)) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(Reflect.compareMethods(this.__listeners[i],listener)) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,__listeners: null
	,dispatch: function(a,a1,a2) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a,a1,a2);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$String_$Int_$Int_$Void
};
var lime_app__$Event_$String_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_String_Void"] = lime_app__$Event_$String_$Void;
lime_app__$Event_$String_$Void.__name__ = "lime.app._Event_String_Void";
lime_app__$Event_$String_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(Reflect.compareMethods(l,listener)) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(Reflect.compareMethods(this.__listeners[i],listener)) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,__listeners: null
	,dispatch: function(a) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$String_$Void
};
var lime_app__$Event_$Void_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_Void_Void"] = lime_app__$Event_$Void_$Void;
lime_app__$Event_$Void_$Void.__name__ = "lime.app._Event_Void_Void";
lime_app__$Event_$Void_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(Reflect.compareMethods(l,listener)) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(Reflect.compareMethods(this.__listeners[i],listener)) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,__listeners: null
	,dispatch: function() {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i]();
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$Void_$Void
};
var lime_app__$Event_$lime_$graphics_$RenderContext_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_lime_graphics_RenderContext_Void"] = lime_app__$Event_$lime_$graphics_$RenderContext_$Void;
lime_app__$Event_$lime_$graphics_$RenderContext_$Void.__name__ = "lime.app._Event_lime_graphics_RenderContext_Void";
lime_app__$Event_$lime_$graphics_$RenderContext_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(Reflect.compareMethods(l,listener)) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(Reflect.compareMethods(this.__listeners[i],listener)) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,__listeners: null
	,dispatch: function(a) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$lime_$graphics_$RenderContext_$Void
};
var lime_app__$Event_$lime_$ui_$GamepadAxis_$Float_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_lime_ui_GamepadAxis_Float_Void"] = lime_app__$Event_$lime_$ui_$GamepadAxis_$Float_$Void;
lime_app__$Event_$lime_$ui_$GamepadAxis_$Float_$Void.__name__ = "lime.app._Event_lime_ui_GamepadAxis_Float_Void";
lime_app__$Event_$lime_$ui_$GamepadAxis_$Float_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(Reflect.compareMethods(l,listener)) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(Reflect.compareMethods(this.__listeners[i],listener)) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,__listeners: null
	,dispatch: function(a,a1) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a,a1);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$lime_$ui_$GamepadAxis_$Float_$Void
};
var lime_app__$Event_$lime_$ui_$GamepadButton_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_lime_ui_GamepadButton_Void"] = lime_app__$Event_$lime_$ui_$GamepadButton_$Void;
lime_app__$Event_$lime_$ui_$GamepadButton_$Void.__name__ = "lime.app._Event_lime_ui_GamepadButton_Void";
lime_app__$Event_$lime_$ui_$GamepadButton_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(Reflect.compareMethods(l,listener)) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(Reflect.compareMethods(this.__listeners[i],listener)) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,__listeners: null
	,dispatch: function(a) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$lime_$ui_$GamepadButton_$Void
};
var lime_app__$Event_$lime_$ui_$Gamepad_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_lime_ui_Gamepad_Void"] = lime_app__$Event_$lime_$ui_$Gamepad_$Void;
lime_app__$Event_$lime_$ui_$Gamepad_$Void.__name__ = "lime.app._Event_lime_ui_Gamepad_Void";
lime_app__$Event_$lime_$ui_$Gamepad_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(Reflect.compareMethods(l,listener)) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(Reflect.compareMethods(this.__listeners[i],listener)) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,__listeners: null
	,dispatch: function(a) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$lime_$ui_$Gamepad_$Void
};
var lime_app__$Event_$lime_$ui_$Joystick_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_lime_ui_Joystick_Void"] = lime_app__$Event_$lime_$ui_$Joystick_$Void;
lime_app__$Event_$lime_$ui_$Joystick_$Void.__name__ = "lime.app._Event_lime_ui_Joystick_Void";
lime_app__$Event_$lime_$ui_$Joystick_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(Reflect.compareMethods(l,listener)) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(Reflect.compareMethods(this.__listeners[i],listener)) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,__listeners: null
	,dispatch: function(a) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$lime_$ui_$Joystick_$Void
};
var lime_app__$Event_$lime_$ui_$KeyCode_$lime_$ui_$KeyModifier_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_lime_ui_KeyCode_lime_ui_KeyModifier_Void"] = lime_app__$Event_$lime_$ui_$KeyCode_$lime_$ui_$KeyModifier_$Void;
lime_app__$Event_$lime_$ui_$KeyCode_$lime_$ui_$KeyModifier_$Void.__name__ = "lime.app._Event_lime_ui_KeyCode_lime_ui_KeyModifier_Void";
lime_app__$Event_$lime_$ui_$KeyCode_$lime_$ui_$KeyModifier_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(Reflect.compareMethods(l,listener)) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(Reflect.compareMethods(this.__listeners[i],listener)) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,__listeners: null
	,dispatch: function(a,a1) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a,a1);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$lime_$ui_$KeyCode_$lime_$ui_$KeyModifier_$Void
};
var lime_app__$Event_$lime_$ui_$Touch_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_lime_ui_Touch_Void"] = lime_app__$Event_$lime_$ui_$Touch_$Void;
lime_app__$Event_$lime_$ui_$Touch_$Void.__name__ = "lime.app._Event_lime_ui_Touch_Void";
lime_app__$Event_$lime_$ui_$Touch_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(Reflect.compareMethods(l,listener)) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(Reflect.compareMethods(this.__listeners[i],listener)) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,__listeners: null
	,dispatch: function(a) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$lime_$ui_$Touch_$Void
};
var lime_app__$Event_$lime_$ui_$Window_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_lime_ui_Window_Void"] = lime_app__$Event_$lime_$ui_$Window_$Void;
lime_app__$Event_$lime_$ui_$Window_$Void.__name__ = "lime.app._Event_lime_ui_Window_Void";
lime_app__$Event_$lime_$ui_$Window_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(Reflect.compareMethods(l,listener)) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(Reflect.compareMethods(this.__listeners[i],listener)) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,__listeners: null
	,dispatch: function(a) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$lime_$ui_$Window_$Void
};
var lime_app__$Event_$ofEvents_$T_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_ofEvents_T_Void"] = lime_app__$Event_$ofEvents_$T_$Void;
lime_app__$Event_$ofEvents_$T_$Void.__name__ = "lime.app._Event_ofEvents_T_Void";
lime_app__$Event_$ofEvents_$T_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(Reflect.compareMethods(l,listener)) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(Reflect.compareMethods(this.__listeners[i],listener)) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,__listeners: null
	,dispatch: function(a) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$ofEvents_$T_$Void
};
var lime_graphics_CairoRenderContext = {};
lime_graphics_CairoRenderContext.fromRenderContext = function(context) {
	return context.cairo;
};
var lime_graphics_Canvas2DRenderContext = {};
lime_graphics_Canvas2DRenderContext.fromRenderContext = function(context) {
	return context.canvas2D;
};
var lime_graphics_DOMRenderContext = {};
lime_graphics_DOMRenderContext.fromRenderContext = function(context) {
	return context.dom;
};
var lime_graphics_FlashRenderContext = {};
lime_graphics_FlashRenderContext.fromRenderContext = function(context) {
	return null;
};
var lime_graphics_Image = function(buffer,offsetX,offsetY,width,height,color,type) {
	if(height == null) {
		height = -1;
	}
	if(width == null) {
		width = -1;
	}
	if(offsetY == null) {
		offsetY = 0;
	}
	if(offsetX == null) {
		offsetX = 0;
	}
	this.offsetX = offsetX;
	this.offsetY = offsetY;
	this.width = width;
	this.height = height;
	this.version = 0;
	if(type == null) {
		type = lime_graphics_ImageType.CANVAS;
	}
	this.type = type;
	if(buffer == null) {
		if(width > 0 && height > 0) {
			switch(this.type._hx_index) {
			case 0:
				this.buffer = new lime_graphics_ImageBuffer(null,width,height);
				lime__$internal_graphics_ImageCanvasUtil.createCanvas(this,width,height);
				if(color != null && color != 0) {
					this.fillRect(new lime_math_Rectangle(0,0,width,height),color);
				}
				break;
			case 1:
				var elements = width * height * 4;
				var array = null;
				var vector = null;
				var view = null;
				var buffer1 = null;
				var len = null;
				var this1;
				if(elements != null) {
					this1 = new Uint8Array(elements);
				} else if(array != null) {
					this1 = new Uint8Array(array);
				} else if(vector != null) {
					this1 = new Uint8Array(vector.__array);
				} else if(view != null) {
					this1 = new Uint8Array(view);
				} else if(buffer1 != null) {
					if(len == null) {
						this1 = new Uint8Array(buffer1,0);
					} else {
						this1 = new Uint8Array(buffer1,0,len);
					}
				} else {
					this1 = null;
				}
				this.buffer = new lime_graphics_ImageBuffer(this1,width,height);
				if(color != null && color != 0) {
					this.fillRect(new lime_math_Rectangle(0,0,width,height),color);
				}
				break;
			case 2:
				break;
			default:
			}
		}
	} else {
		this.__fromImageBuffer(buffer);
	}
};
$hxClasses["lime.graphics.Image"] = lime_graphics_Image;
lime_graphics_Image.__name__ = "lime.graphics.Image";
lime_graphics_Image.fromBase64 = function(base64,type) {
	if(base64 == null) {
		return null;
	}
	var image = new lime_graphics_Image();
	image.__fromBase64(base64,type);
	return image;
};
lime_graphics_Image.fromBitmapData = function(bitmapData) {
	if(bitmapData == null) {
		return null;
	}
	return bitmapData.image;
};
lime_graphics_Image.fromBytes = function(bytes) {
	if(bytes == null) {
		return null;
	}
	var image = new lime_graphics_Image();
	if(image.__fromBytes(bytes)) {
		return image;
	} else {
		return null;
	}
};
lime_graphics_Image.fromCanvas = function(canvas) {
	if(canvas == null) {
		return null;
	}
	var buffer = new lime_graphics_ImageBuffer(null,canvas.width,canvas.height);
	buffer.set_src(canvas);
	var image = new lime_graphics_Image(buffer);
	image.type = lime_graphics_ImageType.CANVAS;
	return image;
};
lime_graphics_Image.fromFile = function(path) {
	if(path == null) {
		return null;
	}
	var image = new lime_graphics_Image();
	if(image.__fromFile(path)) {
		return image;
	} else {
		return null;
	}
};
lime_graphics_Image.fromImageElement = function(image) {
	if(image == null) {
		return null;
	}
	var buffer = new lime_graphics_ImageBuffer(null,image.width,image.height);
	buffer.set_src(image);
	var _image = new lime_graphics_Image(buffer);
	_image.type = lime_graphics_ImageType.CANVAS;
	return _image;
};
lime_graphics_Image.loadFromBase64 = function(base64,type) {
	if(base64 == null || type == null) {
		return lime_app_Future.withValue(null);
	}
	return lime__$internal_backend_html5_HTML5HTTPRequest.loadImage("data:" + type + ";base64," + base64);
};
lime_graphics_Image.loadFromBytes = function(bytes) {
	if(bytes == null) {
		return lime_app_Future.withValue(null);
	}
	var type = "";
	if(lime_graphics_Image.__isPNG(bytes)) {
		type = "image/png";
	} else if(lime_graphics_Image.__isJPG(bytes)) {
		type = "image/jpeg";
	} else if(lime_graphics_Image.__isGIF(bytes)) {
		type = "image/gif";
	} else if(lime_graphics_Image.__isWebP(bytes)) {
		type = "image/webp";
	} else {
		return lime_app_Future.withValue(null);
	}
	return lime__$internal_backend_html5_HTML5HTTPRequest.loadImageFromBytes(bytes,type);
};
lime_graphics_Image.loadFromFile = function(path) {
	if(path == null) {
		return lime_app_Future.withValue(null);
	}
	return lime__$internal_backend_html5_HTML5HTTPRequest.loadImage(path);
};
lime_graphics_Image.__isGIF = function(bytes) {
	if(bytes == null || bytes.length < 6) {
		return false;
	}
	var header = bytes.getString(0,6);
	if(header != "GIF87a") {
		return header == "GIF89a";
	} else {
		return true;
	}
};
lime_graphics_Image.__isJPG = function(bytes) {
	if(bytes == null || bytes.length < 4) {
		return false;
	}
	if(bytes.b[0] == 255 && bytes.b[1] == 216 && bytes.b[bytes.length - 2] == 255) {
		return bytes.b[bytes.length - 1] == 217;
	} else {
		return false;
	}
};
lime_graphics_Image.__isPNG = function(bytes) {
	if(bytes == null || bytes.length < 8) {
		return false;
	}
	if(bytes.b[0] == 137 && bytes.b[1] == 80 && bytes.b[2] == 78 && bytes.b[3] == 71 && bytes.b[4] == 13 && bytes.b[5] == 10 && bytes.b[6] == 26) {
		return bytes.b[7] == 10;
	} else {
		return false;
	}
};
lime_graphics_Image.__isWebP = function(bytes) {
	if(bytes == null || bytes.length < 16) {
		return false;
	}
	if(bytes.getString(0,4) == "RIFF") {
		return bytes.getString(8,4) == "WEBP";
	} else {
		return false;
	}
};
lime_graphics_Image.prototype = {
	buffer: null
	,dirty: null
	,height: null
	,offsetX: null
	,offsetY: null
	,rect: null
	,type: null
	,version: null
	,width: null
	,x: null
	,y: null
	,clone: function() {
		if(this.buffer != null) {
			if(this.type == lime_graphics_ImageType.CANVAS) {
				lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(this);
			} else {
				lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			}
			var image = new lime_graphics_Image(this.buffer.clone(),this.offsetX,this.offsetY,this.width,this.height,null,this.type);
			image.version = this.version;
			return image;
		} else {
			return new lime_graphics_Image(null,this.offsetX,this.offsetY,this.width,this.height,null,this.type);
		}
	}
	,colorTransform: function(rect,colorMatrix) {
		rect = this.__clipRect(rect);
		if(this.buffer == null || rect == null) {
			return;
		}
		switch(this.type._hx_index) {
		case 0:
			lime__$internal_graphics_ImageCanvasUtil.colorTransform(this,rect,colorMatrix);
			break;
		case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			lime__$internal_graphics_ImageDataUtil.colorTransform(this,rect,colorMatrix);
			break;
		case 2:
			rect.offset(this.offsetX,this.offsetY);
			this.buffer.__srcBitmapData.colorTransform(rect.__toFlashRectangle(),lime_math_ColorMatrix.__toFlashColorTransform(colorMatrix));
			break;
		default:
		}
	}
	,copyChannel: function(sourceImage,sourceRect,destPoint,sourceChannel,destChannel) {
		sourceRect = this.__clipRect(sourceRect);
		if(this.buffer == null || sourceRect == null) {
			return;
		}
		if(destChannel == lime_graphics_ImageChannel.ALPHA && !this.get_transparent()) {
			return;
		}
		if(sourceRect.width <= 0 || sourceRect.height <= 0) {
			return;
		}
		if(sourceRect.x + sourceRect.width > sourceImage.width) {
			sourceRect.width = sourceImage.width - sourceRect.x;
		}
		if(sourceRect.y + sourceRect.height > sourceImage.height) {
			sourceRect.height = sourceImage.height - sourceRect.y;
		}
		switch(this.type._hx_index) {
		case 0:
			lime__$internal_graphics_ImageCanvasUtil.copyChannel(this,sourceImage,sourceRect,destPoint,sourceChannel,destChannel);
			break;
		case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			lime__$internal_graphics_ImageCanvasUtil.convertToData(sourceImage);
			lime__$internal_graphics_ImageDataUtil.copyChannel(this,sourceImage,sourceRect,destPoint,sourceChannel,destChannel);
			break;
		case 2:
			var srcChannel;
			switch(sourceChannel._hx_index) {
			case 0:
				srcChannel = 1;
				break;
			case 1:
				srcChannel = 2;
				break;
			case 2:
				srcChannel = 4;
				break;
			case 3:
				srcChannel = 8;
				break;
			}
			var dstChannel;
			switch(destChannel._hx_index) {
			case 0:
				dstChannel = 1;
				break;
			case 1:
				dstChannel = 2;
				break;
			case 2:
				dstChannel = 4;
				break;
			case 3:
				dstChannel = 8;
				break;
			}
			sourceRect.offset(sourceImage.offsetX,sourceImage.offsetY);
			destPoint.offset(this.offsetX,this.offsetY);
			this.buffer.__srcBitmapData.copyChannel(sourceImage.buffer.get_src(),sourceRect.__toFlashRectangle(),destPoint.__toFlashPoint(),srcChannel,dstChannel);
			break;
		default:
		}
	}
	,copyPixels: function(sourceImage,sourceRect,destPoint,alphaImage,alphaPoint,mergeAlpha) {
		if(mergeAlpha == null) {
			mergeAlpha = false;
		}
		if(this.buffer == null || sourceImage == null) {
			return;
		}
		if(sourceRect.width <= 0 || sourceRect.height <= 0) {
			return;
		}
		if(this.width <= 0 || this.height <= 0) {
			return;
		}
		if(sourceRect.x + sourceRect.width > sourceImage.width) {
			sourceRect.width = sourceImage.width - sourceRect.x;
		}
		if(sourceRect.y + sourceRect.height > sourceImage.height) {
			sourceRect.height = sourceImage.height - sourceRect.y;
		}
		if(sourceRect.x < 0) {
			sourceRect.width += sourceRect.x;
			sourceRect.x = 0;
		}
		if(sourceRect.y < 0) {
			sourceRect.height += sourceRect.y;
			sourceRect.y = 0;
		}
		if(destPoint.x + sourceRect.width > this.width) {
			sourceRect.width = this.width - destPoint.x;
		}
		if(destPoint.y + sourceRect.height > this.height) {
			sourceRect.height = this.height - destPoint.y;
		}
		if(destPoint.x < 0) {
			sourceRect.width += destPoint.x;
			sourceRect.x -= destPoint.x;
			destPoint.x = 0;
		}
		if(destPoint.y < 0) {
			sourceRect.height += destPoint.y;
			sourceRect.y -= destPoint.y;
			destPoint.y = 0;
		}
		if(sourceImage == this && destPoint.x < sourceRect.get_right() && destPoint.y < sourceRect.get_bottom()) {
			sourceImage = this.clone();
		}
		if(alphaImage == sourceImage && (alphaPoint == null || alphaPoint.x == 0 && alphaPoint.y == 0)) {
			alphaImage = null;
			alphaPoint = null;
		}
		switch(this.type._hx_index) {
		case 0:
			if(alphaImage != null) {
				lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
				lime__$internal_graphics_ImageCanvasUtil.convertToData(sourceImage);
				if(alphaImage != null) {
					lime__$internal_graphics_ImageCanvasUtil.convertToData(alphaImage);
				}
				lime__$internal_graphics_ImageDataUtil.copyPixels(this,sourceImage,sourceRect,destPoint,alphaImage,alphaPoint,mergeAlpha);
			} else {
				lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(this);
				lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(sourceImage);
				lime__$internal_graphics_ImageCanvasUtil.copyPixels(this,sourceImage,sourceRect,destPoint,alphaImage,alphaPoint,mergeAlpha);
			}
			break;
		case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			lime__$internal_graphics_ImageCanvasUtil.convertToData(sourceImage);
			if(alphaImage != null) {
				lime__$internal_graphics_ImageCanvasUtil.convertToData(alphaImage);
			}
			lime__$internal_graphics_ImageDataUtil.copyPixels(this,sourceImage,sourceRect,destPoint,alphaImage,alphaPoint,mergeAlpha);
			break;
		case 2:
			sourceRect.offset(sourceImage.offsetX,sourceImage.offsetY);
			destPoint.offset(this.offsetX,this.offsetY);
			if(alphaImage != null && alphaPoint != null) {
				alphaPoint.offset(alphaImage.offsetX,alphaImage.offsetY);
			}
			this.buffer.__srcBitmapData.copyPixels(sourceImage.buffer.__srcBitmapData,sourceRect.__toFlashRectangle(),destPoint.__toFlashPoint(),alphaImage != null ? alphaImage.buffer.get_src() : null,alphaPoint != null ? alphaPoint.__toFlashPoint() : null,mergeAlpha);
			break;
		default:
		}
	}
	,encode: function(format,quality) {
		if(quality == null) {
			quality = 90;
		}
		if(format == null) {
			return lime__$internal_format_PNG.encode(this);
		} else {
			switch(format._hx_index) {
			case 0:
				return lime__$internal_format_BMP.encode(this);
			case 1:
				return lime__$internal_format_JPEG.encode(this,quality);
			case 2:
				return lime__$internal_format_PNG.encode(this);
			}
		}
	}
	,fillRect: function(rect,color,format) {
		rect = this.__clipRect(rect);
		if(this.buffer == null || rect == null) {
			return;
		}
		switch(this.type._hx_index) {
		case 0:
			lime__$internal_graphics_ImageCanvasUtil.fillRect(this,rect,color,format);
			break;
		case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			if(this.buffer.data.length == 0) {
				return;
			}
			lime__$internal_graphics_ImageDataUtil.fillRect(this,rect,color,format);
			break;
		case 2:
			rect.offset(this.offsetX,this.offsetY);
			var argb;
			if(format == null) {
				var rgba = color;
				var this1 = 0;
				var argb1 = this1;
				argb1 = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
				argb = argb1;
			} else {
				switch(format) {
				case 1:
					argb = color;
					break;
				case 2:
					var bgra = color;
					var this1 = 0;
					var argb1 = this1;
					argb1 = (bgra & 255 & 255) << 24 | (bgra >>> 8 & 255 & 255) << 16 | (bgra >>> 16 & 255 & 255) << 8 | bgra >>> 24 & 255 & 255;
					argb = argb1;
					break;
				default:
					var rgba = color;
					var this1 = 0;
					var argb1 = this1;
					argb1 = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
					argb = argb1;
				}
			}
			this.buffer.__srcBitmapData.fillRect(rect.__toFlashRectangle(),argb);
			break;
		default:
		}
	}
	,floodFill: function(x,y,color,format) {
		if(this.buffer == null) {
			return;
		}
		switch(this.type._hx_index) {
		case 0:
			lime__$internal_graphics_ImageCanvasUtil.floodFill(this,x,y,color,format);
			break;
		case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			lime__$internal_graphics_ImageDataUtil.floodFill(this,x,y,color,format);
			break;
		case 2:
			var argb;
			if(format == null) {
				var rgba = color;
				var this1 = 0;
				var argb1 = this1;
				argb1 = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
				argb = argb1;
			} else {
				switch(format) {
				case 1:
					argb = color;
					break;
				case 2:
					var bgra = color;
					var this1 = 0;
					var argb1 = this1;
					argb1 = (bgra & 255 & 255) << 24 | (bgra >>> 8 & 255 & 255) << 16 | (bgra >>> 16 & 255 & 255) << 8 | bgra >>> 24 & 255 & 255;
					argb = argb1;
					break;
				default:
					var rgba = color;
					var this1 = 0;
					var argb1 = this1;
					argb1 = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
					argb = argb1;
				}
			}
			this.buffer.__srcBitmapData.floodFill(x + this.offsetX,y + this.offsetY,argb);
			break;
		default:
		}
	}
	,getColorBoundsRect: function(mask,color,findColor,format) {
		if(findColor == null) {
			findColor = true;
		}
		if(this.buffer == null) {
			return null;
		}
		switch(this.type._hx_index) {
		case 0:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			return lime__$internal_graphics_ImageDataUtil.getColorBoundsRect(this,mask,color,findColor,format);
		case 1:
			return lime__$internal_graphics_ImageDataUtil.getColorBoundsRect(this,mask,color,findColor,format);
		case 2:
			var rect = this.buffer.__srcBitmapData.getColorBoundsRect(mask,color,findColor);
			return new lime_math_Rectangle(rect.x,rect.y,rect.width,rect.height);
		default:
			return null;
		}
	}
	,getPixel: function(x,y,format) {
		if(this.buffer == null || x < 0 || y < 0 || x >= this.width || y >= this.height) {
			return 0;
		}
		switch(this.type._hx_index) {
		case 0:
			return lime__$internal_graphics_ImageCanvasUtil.getPixel(this,x,y,format);
		case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			return lime__$internal_graphics_ImageDataUtil.getPixel(this,x,y,format);
		case 2:
			var color = this.buffer.__srcBitmapData.getPixel(x + this.offsetX,y + this.offsetY);
			if(format == null) {
				var this1 = 0;
				var rgba = this1;
				rgba = (color >>> 16 & 255 & 255) << 24 | (color >>> 8 & 255 & 255) << 16 | (color & 255 & 255) << 8 | color >>> 24 & 255 & 255;
				var rgba1 = rgba;
				return rgba1;
			} else {
				switch(format) {
				case 1:
					return color;
				case 2:
					var this1 = 0;
					var bgra = this1;
					bgra = (color & 255 & 255) << 24 | (color >>> 8 & 255 & 255) << 16 | (color >>> 16 & 255 & 255) << 8 | color >>> 24 & 255 & 255;
					var bgra1 = bgra;
					return bgra1;
				default:
					var this1 = 0;
					var rgba = this1;
					rgba = (color >>> 16 & 255 & 255) << 24 | (color >>> 8 & 255 & 255) << 16 | (color & 255 & 255) << 8 | color >>> 24 & 255 & 255;
					var rgba1 = rgba;
					return rgba1;
				}
			}
			break;
		default:
			return 0;
		}
	}
	,getPixel32: function(x,y,format) {
		if(this.buffer == null || x < 0 || y < 0 || x >= this.width || y >= this.height) {
			return 0;
		}
		switch(this.type._hx_index) {
		case 0:
			return lime__$internal_graphics_ImageCanvasUtil.getPixel32(this,x,y,format);
		case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			return lime__$internal_graphics_ImageDataUtil.getPixel32(this,x,y,format);
		case 2:
			var color = this.buffer.__srcBitmapData.getPixel32(x + this.offsetX,y + this.offsetY);
			if(format == null) {
				var this1 = 0;
				var rgba = this1;
				rgba = (color >>> 16 & 255 & 255) << 24 | (color >>> 8 & 255 & 255) << 16 | (color & 255 & 255) << 8 | color >>> 24 & 255 & 255;
				var rgba1 = rgba;
				return rgba1;
			} else {
				switch(format) {
				case 1:
					return color;
				case 2:
					var this1 = 0;
					var bgra = this1;
					bgra = (color & 255 & 255) << 24 | (color >>> 8 & 255 & 255) << 16 | (color >>> 16 & 255 & 255) << 8 | color >>> 24 & 255 & 255;
					var bgra1 = bgra;
					return bgra1;
				default:
					var this1 = 0;
					var rgba = this1;
					rgba = (color >>> 16 & 255 & 255) << 24 | (color >>> 8 & 255 & 255) << 16 | (color & 255 & 255) << 8 | color >>> 24 & 255 & 255;
					var rgba1 = rgba;
					return rgba1;
				}
			}
			break;
		default:
			return 0;
		}
	}
	,getPixels: function(rect,format) {
		if(this.buffer == null) {
			return null;
		}
		switch(this.type._hx_index) {
		case 0:
			return lime__$internal_graphics_ImageCanvasUtil.getPixels(this,rect,format);
		case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			return lime__$internal_graphics_ImageDataUtil.getPixels(this,rect,format);
		case 2:
			return null;
		default:
			return null;
		}
	}
	,merge: function(sourceImage,sourceRect,destPoint,redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier) {
		if(this.buffer == null || sourceImage == null) {
			return;
		}
		switch(this.type._hx_index) {
		case 0:
			lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(this);
			lime__$internal_graphics_ImageCanvasUtil.merge(this,sourceImage,sourceRect,destPoint,redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier);
			break;
		case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			lime__$internal_graphics_ImageCanvasUtil.convertToData(sourceImage);
			lime__$internal_graphics_ImageDataUtil.merge(this,sourceImage,sourceRect,destPoint,redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier);
			break;
		case 2:
			sourceRect.offset(this.offsetX,this.offsetY);
			this.buffer.__srcBitmapData.merge(sourceImage.buffer.__srcBitmapData,sourceRect.__toFlashRectangle(),destPoint.__toFlashPoint(),redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier);
			break;
		default:
			return;
		}
	}
	,resize: function(newWidth,newHeight) {
		switch(this.type._hx_index) {
		case 0:
			lime__$internal_graphics_ImageCanvasUtil.resize(this,newWidth,newHeight);
			break;
		case 1:
			lime__$internal_graphics_ImageDataUtil.resize(this,newWidth,newHeight);
			break;
		case 2:
			break;
		default:
		}
		this.buffer.width = newWidth;
		this.buffer.height = newHeight;
		this.offsetX = 0;
		this.offsetY = 0;
		this.width = newWidth;
		this.height = newHeight;
	}
	,scroll: function(x,y) {
		if(this.buffer == null) {
			return;
		}
		switch(this.type._hx_index) {
		case 0:
			lime__$internal_graphics_ImageCanvasUtil.scroll(this,x,y);
			break;
		case 1:
			this.copyPixels(this,this.get_rect(),new lime_math_Vector2(x,y));
			break;
		case 2:
			this.buffer.__srcBitmapData.scroll(x + this.offsetX,y + this.offsetX);
			break;
		default:
		}
	}
	,setPixel: function(x,y,color,format) {
		if(this.buffer == null || x < 0 || y < 0 || x >= this.width || y >= this.height) {
			return;
		}
		switch(this.type._hx_index) {
		case 0:
			lime__$internal_graphics_ImageCanvasUtil.setPixel(this,x,y,color,format);
			break;
		case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			lime__$internal_graphics_ImageDataUtil.setPixel(this,x,y,color,format);
			break;
		case 2:
			var argb;
			if(format == null) {
				var rgba = color;
				var this1 = 0;
				var argb1 = this1;
				argb1 = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
				argb = argb1;
			} else {
				switch(format) {
				case 1:
					argb = color;
					break;
				case 2:
					var bgra = color;
					var this1 = 0;
					var argb1 = this1;
					argb1 = (bgra & 255 & 255) << 24 | (bgra >>> 8 & 255 & 255) << 16 | (bgra >>> 16 & 255 & 255) << 8 | bgra >>> 24 & 255 & 255;
					argb = argb1;
					break;
				default:
					var rgba = color;
					var this1 = 0;
					var argb1 = this1;
					argb1 = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
					argb = argb1;
				}
			}
			this.buffer.__srcBitmapData.setPixel(x + this.offsetX,y + this.offsetX,argb);
			break;
		default:
		}
	}
	,setPixel32: function(x,y,color,format) {
		if(this.buffer == null || x < 0 || y < 0 || x >= this.width || y >= this.height) {
			return;
		}
		switch(this.type._hx_index) {
		case 0:
			lime__$internal_graphics_ImageCanvasUtil.setPixel32(this,x,y,color,format);
			break;
		case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			lime__$internal_graphics_ImageDataUtil.setPixel32(this,x,y,color,format);
			break;
		case 2:
			var argb;
			if(format == null) {
				var rgba = color;
				var this1 = 0;
				var argb1 = this1;
				argb1 = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
				argb = argb1;
			} else {
				switch(format) {
				case 1:
					argb = color;
					break;
				case 2:
					var bgra = color;
					var this1 = 0;
					var argb1 = this1;
					argb1 = (bgra & 255 & 255) << 24 | (bgra >>> 8 & 255 & 255) << 16 | (bgra >>> 16 & 255 & 255) << 8 | bgra >>> 24 & 255 & 255;
					argb = argb1;
					break;
				default:
					var rgba = color;
					var this1 = 0;
					var argb1 = this1;
					argb1 = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
					argb = argb1;
				}
			}
			this.buffer.__srcBitmapData.setPixel32(x + this.offsetX,y + this.offsetY,argb);
			break;
		default:
		}
	}
	,setPixels: function(rect,bytePointer,format,endian) {
		rect = this.__clipRect(rect);
		if(this.buffer == null || rect == null) {
			return;
		}
		if(endian == null) {
			endian = lime_system_Endian.BIG_ENDIAN;
		}
		switch(this.type._hx_index) {
		case 0:
			lime__$internal_graphics_ImageCanvasUtil.setPixels(this,rect,bytePointer,format,endian);
			break;
		case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			lime__$internal_graphics_ImageDataUtil.setPixels(this,rect,bytePointer,format,endian);
			break;
		case 2:
			break;
		default:
		}
	}
	,threshold: function(sourceImage,sourceRect,destPoint,operation,threshold,color,mask,copySource,format) {
		if(copySource == null) {
			copySource = false;
		}
		if(mask == null) {
			mask = -1;
		}
		if(color == null) {
			color = 0;
		}
		if(this.buffer == null || sourceImage == null || sourceRect == null) {
			return 0;
		}
		switch(this.type._hx_index) {
		case 0:case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			lime__$internal_graphics_ImageCanvasUtil.convertToData(sourceImage);
			return lime__$internal_graphics_ImageDataUtil.threshold(this,sourceImage,sourceRect,destPoint,operation,threshold,color,mask,copySource,format);
		case 2:
			var _color;
			if(format == null) {
				var rgba = color;
				var this1 = 0;
				var argb = this1;
				argb = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
				_color = argb;
			} else {
				switch(format) {
				case 1:
					_color = color;
					break;
				case 2:
					var bgra = color;
					var this1 = 0;
					var argb = this1;
					argb = (bgra & 255 & 255) << 24 | (bgra >>> 8 & 255 & 255) << 16 | (bgra >>> 16 & 255 & 255) << 8 | bgra >>> 24 & 255 & 255;
					_color = argb;
					break;
				default:
					var rgba = color;
					var this1 = 0;
					var argb = this1;
					argb = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
					_color = argb;
				}
			}
			var _mask;
			if(format == null) {
				var rgba = mask;
				var this1 = 0;
				var argb = this1;
				argb = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
				_mask = argb;
			} else {
				switch(format) {
				case 1:
					_mask = mask;
					break;
				case 2:
					var bgra = mask;
					var this1 = 0;
					var argb = this1;
					argb = (bgra & 255 & 255) << 24 | (bgra >>> 8 & 255 & 255) << 16 | (bgra >>> 16 & 255 & 255) << 8 | bgra >>> 24 & 255 & 255;
					_mask = argb;
					break;
				default:
					var rgba = mask;
					var this1 = 0;
					var argb = this1;
					argb = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
					_mask = argb;
				}
			}
			sourceRect.offset(sourceImage.offsetX,sourceImage.offsetY);
			destPoint.offset(this.offsetX,this.offsetY);
			return this.buffer.__srcBitmapData.threshold(sourceImage.buffer.get_src(),sourceRect.__toFlashRectangle(),destPoint.__toFlashPoint(),operation,threshold,_color,_mask,copySource);
		default:
		}
		return 0;
	}
	,__clipRect: function(r) {
		if(r == null) {
			return null;
		}
		if(r.x < 0) {
			r.width -= -r.x;
			r.x = 0;
			if(r.x + r.width <= 0) {
				return null;
			}
		}
		if(r.y < 0) {
			r.height -= -r.y;
			r.y = 0;
			if(r.y + r.height <= 0) {
				return null;
			}
		}
		if(r.x + r.width >= this.width) {
			r.width -= r.x + r.width - this.width;
			if(r.width <= 0) {
				return null;
			}
		}
		if(r.y + r.height >= this.height) {
			r.height -= r.y + r.height - this.height;
			if(r.height <= 0) {
				return null;
			}
		}
		return r;
	}
	,__fromBase64: function(base64,type,onload) {
		var _gthis = this;
		var image = new Image();
		var image_onLoaded = function(event) {
			_gthis.buffer = new lime_graphics_ImageBuffer(null,image.width,image.height);
			_gthis.buffer.__srcImage = image;
			_gthis.offsetX = 0;
			_gthis.offsetY = 0;
			_gthis.width = _gthis.buffer.width;
			_gthis.height = _gthis.buffer.height;
			if(onload != null) {
				onload(_gthis);
			}
		};
		image.addEventListener("load",image_onLoaded,false);
		image.src = "data:" + type + ";base64," + base64;
	}
	,__fromBytes: function(bytes,onload) {
		var type = "";
		if(lime_graphics_Image.__isPNG(bytes)) {
			type = "image/png";
		} else if(lime_graphics_Image.__isJPG(bytes)) {
			type = "image/jpeg";
		} else if(lime_graphics_Image.__isGIF(bytes)) {
			type = "image/gif";
		} else {
			return false;
		}
		this.__fromBase64(lime__$internal_format_Base64.encode(bytes),type,onload);
		return true;
	}
	,__fromFile: function(path,onload,onerror) {
		var _gthis = this;
		var image = new Image();
		if(!lime__$internal_backend_html5_HTML5HTTPRequest.__isSameOrigin(path)) {
			image.crossOrigin = "Anonymous";
		}
		image.onload = function(_) {
			_gthis.buffer = new lime_graphics_ImageBuffer(null,image.width,image.height);
			_gthis.buffer.__srcImage = image;
			_gthis.width = image.width;
			_gthis.height = image.height;
			if(onload != null) {
				onload(_gthis);
			}
		};
		image.onerror = function(_) {
			if(onerror != null) {
				onerror();
			}
		};
		image.src = path;
		var image1 = image.complete;
		return true;
	}
	,__fromImageBuffer: function(buffer) {
		this.buffer = buffer;
		if(buffer != null) {
			if(this.width == -1) {
				this.width = buffer.width;
			}
			if(this.height == -1) {
				this.height = buffer.height;
			}
		}
	}
	,get_data: function() {
		if(this.buffer.data == null && this.buffer.width > 0 && this.buffer.height > 0) {
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
		}
		return this.buffer.data;
	}
	,set_data: function(value) {
		return this.buffer.data = value;
	}
	,get_format: function() {
		return this.buffer.format;
	}
	,set_format: function(value) {
		if(this.buffer.format != value) {
			if(this.type._hx_index == 1) {
				lime__$internal_graphics_ImageDataUtil.setFormat(this,value);
			}
		}
		return this.buffer.format = value;
	}
	,get_powerOfTwo: function() {
		if(this.buffer.width != 0 && (this.buffer.width & ~this.buffer.width + 1) == this.buffer.width) {
			if(this.buffer.height != 0) {
				return (this.buffer.height & ~this.buffer.height + 1) == this.buffer.height;
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
	,set_powerOfTwo: function(value) {
		if(value != this.get_powerOfTwo()) {
			var newWidth = 1;
			var newHeight = 1;
			while(newWidth < this.buffer.width) newWidth <<= 1;
			while(newHeight < this.buffer.height) newHeight <<= 1;
			if(newWidth == this.buffer.width && newHeight == this.buffer.height) {
				return value;
			}
			switch(this.type._hx_index) {
			case 0:
				lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
				lime__$internal_graphics_ImageDataUtil.resizeBuffer(this,newWidth,newHeight);
				break;
			case 1:
				lime__$internal_graphics_ImageDataUtil.resizeBuffer(this,newWidth,newHeight);
				break;
			case 2:
				break;
			default:
			}
		}
		return value;
	}
	,get_premultiplied: function() {
		return this.buffer.premultiplied;
	}
	,set_premultiplied: function(value) {
		if(value && !this.buffer.premultiplied) {
			switch(this.type._hx_index) {
			case 0:case 1:
				lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
				lime__$internal_graphics_ImageDataUtil.multiplyAlpha(this);
				break;
			default:
			}
		} else if(!value && this.buffer.premultiplied) {
			if(this.type._hx_index == 1) {
				lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
				lime__$internal_graphics_ImageDataUtil.unmultiplyAlpha(this);
			}
		}
		return value;
	}
	,get_rect: function() {
		return new lime_math_Rectangle(0,0,this.width,this.height);
	}
	,get_src: function() {
		if(this.buffer.__srcCanvas == null && (this.buffer.data != null || this.type == lime_graphics_ImageType.DATA)) {
			lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(this);
		}
		return this.buffer.get_src();
	}
	,set_src: function(value) {
		return this.buffer.set_src(value);
	}
	,get_transparent: function() {
		if(this.buffer == null) {
			return false;
		}
		return this.buffer.transparent;
	}
	,set_transparent: function(value) {
		if(this.buffer == null) {
			return false;
		}
		return this.buffer.transparent = value;
	}
	,__class__: lime_graphics_Image
	,__properties__: {set_transparent:"set_transparent",get_transparent:"get_transparent",set_src:"set_src",get_src:"get_src",get_rect:"get_rect",set_premultiplied:"set_premultiplied",get_premultiplied:"get_premultiplied",set_powerOfTwo:"set_powerOfTwo",get_powerOfTwo:"get_powerOfTwo",set_format:"set_format",get_format:"get_format",set_data:"set_data",get_data:"get_data"}
};
var lime_graphics_ImageBuffer = function(data,width,height,bitsPerPixel,format) {
	if(bitsPerPixel == null) {
		bitsPerPixel = 32;
	}
	if(height == null) {
		height = 0;
	}
	if(width == null) {
		width = 0;
	}
	this.data = data;
	this.width = width;
	this.height = height;
	this.bitsPerPixel = bitsPerPixel;
	this.format = format == null ? 0 : format;
	this.premultiplied = false;
	this.transparent = true;
};
$hxClasses["lime.graphics.ImageBuffer"] = lime_graphics_ImageBuffer;
lime_graphics_ImageBuffer.__name__ = "lime.graphics.ImageBuffer";
lime_graphics_ImageBuffer.prototype = {
	bitsPerPixel: null
	,data: null
	,format: null
	,height: null
	,premultiplied: null
	,transparent: null
	,width: null
	,__srcBitmapData: null
	,__srcCanvas: null
	,__srcContext: null
	,__srcCustom: null
	,__srcImage: null
	,__srcImageData: null
	,clone: function() {
		var buffer = new lime_graphics_ImageBuffer(this.data,this.width,this.height,this.bitsPerPixel);
		if(this.data != null) {
			var elements = this.data.byteLength;
			var array = null;
			var vector = null;
			var view = null;
			var buffer1 = null;
			var len = null;
			var this1;
			if(elements != null) {
				this1 = new Uint8Array(elements);
			} else if(array != null) {
				this1 = new Uint8Array(array);
			} else if(vector != null) {
				this1 = new Uint8Array(vector.__array);
			} else if(view != null) {
				this1 = new Uint8Array(view);
			} else if(buffer1 != null) {
				if(len == null) {
					this1 = new Uint8Array(buffer1,0);
				} else {
					this1 = new Uint8Array(buffer1,0,len);
				}
			} else {
				this1 = null;
			}
			buffer.data = this1;
			var elements = null;
			var array = null;
			var vector = null;
			var view = this.data;
			var buffer1 = null;
			var len = null;
			var this1;
			if(elements != null) {
				this1 = new Uint8Array(elements);
			} else if(array != null) {
				this1 = new Uint8Array(array);
			} else if(vector != null) {
				this1 = new Uint8Array(vector.__array);
			} else if(view != null) {
				this1 = new Uint8Array(view);
			} else if(buffer1 != null) {
				if(len == null) {
					this1 = new Uint8Array(buffer1,0);
				} else {
					this1 = new Uint8Array(buffer1,0,len);
				}
			} else {
				this1 = null;
			}
			var copy = this1;
			buffer.data.set(copy);
		} else if(this.__srcImageData != null) {
			buffer.__srcCanvas = window.document.createElement("canvas");
			buffer.__srcContext = buffer.__srcCanvas.getContext("2d");
			buffer.__srcCanvas.width = this.__srcImageData.width;
			buffer.__srcCanvas.height = this.__srcImageData.height;
			buffer.__srcImageData = buffer.__srcContext.createImageData(this.__srcImageData.width,this.__srcImageData.height);
			var copy = new Uint8ClampedArray(this.__srcImageData.data);
			buffer.__srcImageData.data.set(copy);
		} else if(this.__srcCanvas != null) {
			buffer.__srcCanvas = window.document.createElement("canvas");
			buffer.__srcContext = buffer.__srcCanvas.getContext("2d");
			buffer.__srcCanvas.width = this.__srcCanvas.width;
			buffer.__srcCanvas.height = this.__srcCanvas.height;
			buffer.__srcContext.drawImage(this.__srcCanvas,0,0);
		} else {
			buffer.__srcImage = this.__srcImage;
		}
		buffer.bitsPerPixel = this.bitsPerPixel;
		buffer.format = this.format;
		buffer.premultiplied = this.premultiplied;
		buffer.transparent = this.transparent;
		return buffer;
	}
	,get_src: function() {
		if(this.__srcImage != null) {
			return this.__srcImage;
		}
		return this.__srcCanvas;
	}
	,set_src: function(value) {
		if(((value) instanceof Image)) {
			this.__srcImage = value;
		} else if(((value) instanceof HTMLCanvasElement)) {
			this.__srcCanvas = value;
			this.__srcContext = this.__srcCanvas.getContext("2d");
		}
		return value;
	}
	,get_stride: function() {
		return this.width * (this.bitsPerPixel / 8 | 0);
	}
	,__class__: lime_graphics_ImageBuffer
	,__properties__: {get_stride:"get_stride",set_src:"set_src",get_src:"get_src"}
};
var lime_graphics_ImageChannel = $hxEnums["lime.graphics.ImageChannel"] = { __ename__ : "lime.graphics.ImageChannel", __constructs__ : ["RED","GREEN","BLUE","ALPHA"]
	,RED: {_hx_index:0,__enum__:"lime.graphics.ImageChannel",toString:$estr}
	,GREEN: {_hx_index:1,__enum__:"lime.graphics.ImageChannel",toString:$estr}
	,BLUE: {_hx_index:2,__enum__:"lime.graphics.ImageChannel",toString:$estr}
	,ALPHA: {_hx_index:3,__enum__:"lime.graphics.ImageChannel",toString:$estr}
};
var lime_graphics_ImageFileFormat = $hxEnums["lime.graphics.ImageFileFormat"] = { __ename__ : "lime.graphics.ImageFileFormat", __constructs__ : ["BMP","JPEG","PNG"]
	,BMP: {_hx_index:0,__enum__:"lime.graphics.ImageFileFormat",toString:$estr}
	,JPEG: {_hx_index:1,__enum__:"lime.graphics.ImageFileFormat",toString:$estr}
	,PNG: {_hx_index:2,__enum__:"lime.graphics.ImageFileFormat",toString:$estr}
};
var lime_graphics_ImageType = $hxEnums["lime.graphics.ImageType"] = { __ename__ : "lime.graphics.ImageType", __constructs__ : ["CANVAS","DATA","FLASH","CUSTOM"]
	,CANVAS: {_hx_index:0,__enum__:"lime.graphics.ImageType",toString:$estr}
	,DATA: {_hx_index:1,__enum__:"lime.graphics.ImageType",toString:$estr}
	,FLASH: {_hx_index:2,__enum__:"lime.graphics.ImageType",toString:$estr}
	,CUSTOM: {_hx_index:3,__enum__:"lime.graphics.ImageType",toString:$estr}
};
var lime_graphics_OpenGLES2RenderContext = {};
lime_graphics_OpenGLES2RenderContext.fromGL = function(gl) {
	return null;
};
lime_graphics_OpenGLES2RenderContext.fromOpenGLES3RenderContext = function(gl) {
	return null;
};
lime_graphics_OpenGLES2RenderContext.fromRenderContext = function(context) {
	return null;
};
lime_graphics_OpenGLES2RenderContext.fromWebGLRenderContext = function(gl) {
	return null;
};
var lime_graphics_OpenGLES3RenderContext = {};
lime_graphics_OpenGLES3RenderContext.fromRenderContext = function(context) {
	return null;
};
lime_graphics_OpenGLES3RenderContext.fromGL = function(gl) {
	return null;
};
lime_graphics_OpenGLES3RenderContext.fromOpenGLES2RenderContext = function(context) {
	return null;
};
lime_graphics_OpenGLES3RenderContext.fromWebGLRenderContext = function(context) {
	return null;
};
lime_graphics_OpenGLES3RenderContext.fromWebGL2RenderContext = function(context) {
	return null;
};
var lime_graphics_OpenGLRenderContext = {};
lime_graphics_OpenGLRenderContext.fromRenderContext = function(context) {
	return null;
};
var lime_graphics_RenderContext = function() {
};
$hxClasses["lime.graphics.RenderContext"] = lime_graphics_RenderContext;
lime_graphics_RenderContext.__name__ = "lime.graphics.RenderContext";
lime_graphics_RenderContext.prototype = {
	attributes: null
	,cairo: null
	,canvas2D: null
	,dom: null
	,flash: null
	,gl: null
	,gles2: null
	,gles3: null
	,type: null
	,version: null
	,webgl: null
	,webgl2: null
	,window: null
	,__class__: lime_graphics_RenderContext
};
var lime_graphics_WebGL2RenderContext = {};
lime_graphics_WebGL2RenderContext.bufferData = function(this1,target,srcData,usage,srcOffset,length) {
	if(srcOffset != null) {
		this1.bufferData(target,srcData,usage,srcOffset,length);
	} else {
		this1.bufferData(target,srcData,usage);
	}
};
lime_graphics_WebGL2RenderContext.bufferSubData = function(this1,target,dstByteOffset,srcData,srcOffset,length) {
	if(srcOffset != null) {
		this1.bufferSubData(target,dstByteOffset,srcData,srcOffset,length);
	} else {
		this1.bufferSubData(target,dstByteOffset,srcData);
	}
};
lime_graphics_WebGL2RenderContext.compressedTexImage2D = function(this1,target,level,internalformat,width,height,border,srcData,srcOffset,srcLengthOverride) {
	if(srcOffset != null) {
		this1.compressedTexImage2D(target,level,internalformat,width,height,border,srcData,srcOffset,srcLengthOverride);
	} else {
		this1.compressedTexImage2D(target,level,internalformat,width,height,border,srcData);
	}
};
lime_graphics_WebGL2RenderContext.compressedTexSubImage2D = function(this1,target,level,xoffset,yoffset,width,height,format,srcData,srcOffset,srcLengthOverride) {
	if(srcOffset != null) {
		this1.compressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,srcData,srcOffset,srcLengthOverride);
	} else {
		this1.compressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,srcData);
	}
};
lime_graphics_WebGL2RenderContext.getBufferSubData = function(this1,target,srcByteOffset,dstData,srcOffset,length) {
	if(srcOffset != null) {
		this1.getBufferSubData(target,srcByteOffset,dstData,srcOffset,length);
	} else {
		this1.getBufferSubData(target,srcByteOffset,dstData);
	}
};
lime_graphics_WebGL2RenderContext.readPixels = function(this1,x,y,width,height,format,type,pixels,dstOffset) {
	if(dstOffset != null) {
		this1.readPixels(x,y,width,height,format,type,pixels,dstOffset);
	} else {
		this1.readPixels(x,y,width,height,format,type,pixels);
	}
};
lime_graphics_WebGL2RenderContext.texImage2D = function(this1,target,level,internalformat,width,height,border,format,type,srcData,srcOffset) {
	if(srcOffset != null) {
		this1.texImage2D(target,level,internalformat,width,height,border,format,type,srcData,srcOffset);
	} else if(format != null) {
		this1.texImage2D(target,level,internalformat,width,height,border,format,type,srcData);
	} else {
		this1.texImage2D(target,level,internalformat,width,height,border);
	}
};
lime_graphics_WebGL2RenderContext.texSubImage2D = function(this1,target,level,xoffset,yoffset,width,height,format,type,srcData,srcOffset) {
	if(srcOffset != null) {
		this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,srcData,srcOffset);
	} else if(type != null) {
		this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,srcData);
	} else {
		this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format);
	}
};
lime_graphics_WebGL2RenderContext.uniform1fv = function(this1,location,data,srcOffset,srcLength) {
	if(srcOffset != null) {
		this1.uniform1fv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform1fv(location,data);
	}
};
lime_graphics_WebGL2RenderContext.uniform1iv = function(this1,location,data,srcOffset,srcLength) {
	if(srcOffset != null) {
		this1.uniform1iv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform1iv(location,data);
	}
};
lime_graphics_WebGL2RenderContext.uniform2fv = function(this1,location,data,srcOffset,srcLength) {
	if(srcOffset != null) {
		this1.uniform2fv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform2fv(location,data);
	}
};
lime_graphics_WebGL2RenderContext.uniform2iv = function(this1,location,data,srcOffset,srcLength) {
	if(srcOffset != null) {
		this1.uniform2iv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform2iv(location,data);
	}
};
lime_graphics_WebGL2RenderContext.uniform3fv = function(this1,location,data,srcOffset,srcLength) {
	if(srcOffset != null) {
		this1.uniform3fv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform3fv(location,data);
	}
};
lime_graphics_WebGL2RenderContext.uniform3iv = function(this1,location,data,srcOffset,srcLength) {
	if(srcOffset != null) {
		this1.uniform3iv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform3iv(location,data);
	}
};
lime_graphics_WebGL2RenderContext.uniform4fv = function(this1,location,data,srcOffset,srcLength) {
	if(srcOffset != null) {
		this1.uniform4fv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform4fv(location,data);
	}
};
lime_graphics_WebGL2RenderContext.uniform4iv = function(this1,location,data,srcOffset,srcLength) {
	if(srcOffset != null) {
		this1.uniform4iv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform4iv(location,data);
	}
};
lime_graphics_WebGL2RenderContext.uniformMatrix2fv = function(this1,location,transpose,data,srcOffset,srcLength) {
	if(srcOffset != null) {
		this1.uniformMatrix2fv(location,transpose,data,srcOffset,srcLength);
	} else {
		this1.uniformMatrix2fv(location,transpose,data);
	}
};
lime_graphics_WebGL2RenderContext.uniformMatrix3fv = function(this1,location,transpose,data,srcOffset,srcLength) {
	if(srcOffset != null) {
		this1.uniformMatrix3fv(location,transpose,data,srcOffset,srcLength);
	} else {
		this1.uniformMatrix3fv(location,transpose,data);
	}
};
lime_graphics_WebGL2RenderContext.uniformMatrix4fv = function(this1,location,transpose,data,srcOffset,srcLength) {
	if(srcOffset != null) {
		this1.uniformMatrix4fv(location,transpose,data,srcOffset,srcLength);
	} else {
		this1.uniformMatrix4fv(location,transpose,data);
	}
};
lime_graphics_WebGL2RenderContext.fromGL = function(gl) {
	return null;
};
lime_graphics_WebGL2RenderContext.fromRenderContext = function(context) {
	return context.webgl2;
};
lime_graphics_WebGL2RenderContext.toWebGLRenderContext = function(gl) {
	return gl;
};
var lime_graphics_WebGLRenderContext = {};
lime_graphics_WebGLRenderContext.bufferData = function(this1,target,srcData,usage) {
	var srcOffset = null;
	if(srcOffset != null) {
		this1.bufferData(target,srcData,usage,srcOffset,null);
	} else {
		this1.bufferData(target,srcData,usage);
	}
};
lime_graphics_WebGLRenderContext.bufferSubData = function(this1,target,offset,srcData) {
	var srcOffset = null;
	if(srcOffset != null) {
		this1.bufferSubData(target,offset,srcData,srcOffset,null);
	} else {
		this1.bufferSubData(target,offset,srcData);
	}
};
lime_graphics_WebGLRenderContext.compressedTexImage2D = function(this1,target,level,internalformat,width,height,border,srcData) {
	var srcOffset = null;
	if(srcOffset != null) {
		this1.compressedTexImage2D(target,level,internalformat,width,height,border,srcData,srcOffset,null);
	} else {
		this1.compressedTexImage2D(target,level,internalformat,width,height,border,srcData);
	}
};
lime_graphics_WebGLRenderContext.compressedTexSubImage2D = function(this1,target,level,xoffset,yoffset,width,height,format,srcData) {
	var srcOffset = null;
	if(srcOffset != null) {
		this1.compressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,srcData,srcOffset,null);
	} else {
		this1.compressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,srcData);
	}
};
lime_graphics_WebGLRenderContext.readPixels = function(this1,x,y,width,height,format,type,pixels) {
	var dstOffset = null;
	if(dstOffset != null) {
		this1.readPixels(x,y,width,height,format,type,pixels,dstOffset);
	} else {
		this1.readPixels(x,y,width,height,format,type,pixels);
	}
};
lime_graphics_WebGLRenderContext.texImage2D = function(this1,target,level,internalformat,width,height,border,format,type,srcData) {
	var srcOffset = null;
	if(srcOffset != null) {
		this1.texImage2D(target,level,internalformat,width,height,border,format,type,srcData,srcOffset);
	} else if(format != null) {
		this1.texImage2D(target,level,internalformat,width,height,border,format,type,srcData);
	} else {
		this1.texImage2D(target,level,internalformat,width,height,border);
	}
};
lime_graphics_WebGLRenderContext.texSubImage2D = function(this1,target,level,xoffset,yoffset,width,height,format,type,srcData) {
	var srcOffset = null;
	if(srcOffset != null) {
		this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,srcData,srcOffset);
	} else if(type != null) {
		this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,srcData);
	} else {
		this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format);
	}
};
lime_graphics_WebGLRenderContext.uniformMatrix2fv = function(this1,location,transpose,v) {
	var data = v;
	var srcOffset = null;
	if(srcOffset != null) {
		this1.uniformMatrix2fv(location,transpose,data,srcOffset,null);
	} else {
		this1.uniformMatrix2fv(location,transpose,data);
	}
};
lime_graphics_WebGLRenderContext.uniformMatrix3fv = function(this1,location,transpose,v) {
	var data = v;
	var srcOffset = null;
	if(srcOffset != null) {
		this1.uniformMatrix3fv(location,transpose,data,srcOffset,null);
	} else {
		this1.uniformMatrix3fv(location,transpose,data);
	}
};
lime_graphics_WebGLRenderContext.uniformMatrix4fv = function(this1,location,transpose,v) {
	var data = v;
	var srcOffset = null;
	if(srcOffset != null) {
		this1.uniformMatrix4fv(location,transpose,data,srcOffset,null);
	} else {
		this1.uniformMatrix4fv(location,transpose,data);
	}
};
lime_graphics_WebGLRenderContext.fromWebGL2RenderContext = function(gl) {
	return gl;
};
lime_graphics_WebGLRenderContext.fromRenderContext = function(context) {
	return context.webgl;
};
lime_graphics_WebGLRenderContext.fromGL = function(gl) {
	return lime_graphics_opengl_GL.context;
};
var lime_graphics_cairo_Cairo = function(surface) {
	var tmp = surface != null;
};
$hxClasses["lime.graphics.cairo.Cairo"] = lime_graphics_cairo_Cairo;
lime_graphics_cairo_Cairo.__name__ = "lime.graphics.cairo.Cairo";
lime_graphics_cairo_Cairo.__properties__ = {get_versionString:"get_versionString",get_version:"get_version"};
lime_graphics_cairo_Cairo.version = null;
lime_graphics_cairo_Cairo.versionString = null;
lime_graphics_cairo_Cairo.get_version = function() {
	return 0;
};
lime_graphics_cairo_Cairo.get_versionString = function() {
	return "";
};
lime_graphics_cairo_Cairo.prototype = {
	target: null
	,userData: null
	,handle: null
	,arc: function(xc,yc,radius,angle1,angle2) {
	}
	,arcNegative: function(xc,yc,radius,angle1,angle2) {
	}
	,clip: function() {
	}
	,clipExtents: function(x1,y1,x2,y2) {
	}
	,clipPreserve: function() {
	}
	,closePath: function() {
	}
	,copyPage: function() {
	}
	,curveTo: function(x1,y1,x2,y2,x3,y3) {
	}
	,fill: function() {
	}
	,fillExtents: function(x1,y1,x2,y2) {
	}
	,fillPreserve: function() {
	}
	,getOperator: function() {
		return 0;
	}
	,identityMatrix: function() {
	}
	,inClip: function(x,y) {
		return false;
	}
	,inFill: function(x,y) {
		return false;
	}
	,inStroke: function(x,y) {
		return false;
	}
	,lineTo: function(x,y) {
	}
	,mask: function(pattern) {
	}
	,maskSurface: function(surface,x,y) {
	}
	,moveTo: function(x,y) {
	}
	,newPath: function() {
	}
	,paint: function() {
	}
	,paintWithAlpha: function(alpha) {
	}
	,popGroup: function() {
		return null;
	}
	,popGroupToSource: function() {
	}
	,pushGroup: function() {
	}
	,pushGroupWithContent: function(content) {
	}
	,recreate: function(surface) {
	}
	,rectangle: function(x,y,width,height) {
	}
	,relCurveTo: function(dx1,dy1,dx2,dy2,dx3,dy3) {
	}
	,relLineTo: function(dx,dy) {
	}
	,relMoveTo: function(dx,dy) {
	}
	,resetClip: function() {
	}
	,restore: function() {
	}
	,rotate: function(amount) {
	}
	,save: function() {
	}
	,scale: function(x,y) {
	}
	,setFontSize: function(size) {
	}
	,setOperator: function(value) {
		return value;
	}
	,setSourceRGB: function(r,g,b) {
	}
	,setSourceRGBA: function(r,g,b,a) {
	}
	,setSourceSurface: function(surface,x,y) {
	}
	,showGlyphs: function(glyphs) {
	}
	,showPage: function() {
	}
	,showText: function(utf8) {
	}
	,status: function() {
		return 0;
	}
	,stroke: function() {
	}
	,strokeExtents: function(x1,y1,x2,y2) {
	}
	,strokePreserve: function() {
	}
	,textPath: function(utf8) {
	}
	,transform: function(matrix) {
	}
	,translate: function(x,y) {
	}
	,get_antialias: function() {
		return 0;
	}
	,set_antialias: function(value) {
		return value;
	}
	,get_currentPoint: function() {
		return null;
	}
	,get_dash: function() {
		return [];
	}
	,set_dash: function(value) {
		return value;
	}
	,get_dashCount: function() {
		return 0;
	}
	,get_fillRule: function() {
		return 0;
	}
	,set_fillRule: function(value) {
		return value;
	}
	,get_fontFace: function() {
		return 0;
	}
	,set_fontFace: function(value) {
		return value;
	}
	,get_fontOptions: function() {
		return null;
	}
	,set_fontOptions: function(value) {
		return value;
	}
	,get_groupTarget: function() {
		return 0;
	}
	,get_hasCurrentPoint: function() {
		return false;
	}
	,get_lineCap: function() {
		return 0;
	}
	,set_lineCap: function(value) {
		return value;
	}
	,get_lineJoin: function() {
		return 0;
	}
	,set_lineJoin: function(value) {
		return value;
	}
	,get_lineWidth: function() {
		return 0;
	}
	,set_lineWidth: function(value) {
		return value;
	}
	,get_matrix: function() {
		return null;
	}
	,set_matrix: function(value) {
		return value;
	}
	,get_miterLimit: function() {
		return 0;
	}
	,set_miterLimit: function(value) {
		return value;
	}
	,get_source: function() {
		return 0;
	}
	,set_source: function(value) {
		return value;
	}
	,get_target: function() {
		return 0;
	}
	,get_tolerance: function() {
		return 0;
	}
	,set_tolerance: function(value) {
		return value;
	}
	,__class__: lime_graphics_cairo_Cairo
	,__properties__: {set_tolerance:"set_tolerance",get_tolerance:"get_tolerance",get_target:"get_target",set_source:"set_source",get_source:"get_source",set_miterLimit:"set_miterLimit",get_miterLimit:"get_miterLimit",set_matrix:"set_matrix",get_matrix:"get_matrix",set_lineWidth:"set_lineWidth",get_lineWidth:"get_lineWidth",set_lineJoin:"set_lineJoin",get_lineJoin:"get_lineJoin",set_lineCap:"set_lineCap",get_lineCap:"get_lineCap",get_hasCurrentPoint:"get_hasCurrentPoint",get_groupTarget:"get_groupTarget",set_fontOptions:"set_fontOptions",get_fontOptions:"get_fontOptions",set_fontFace:"set_fontFace",get_fontFace:"get_fontFace",set_fillRule:"set_fillRule",get_fillRule:"get_fillRule",get_dashCount:"get_dashCount",set_dash:"set_dash",get_dash:"get_dash",get_currentPoint:"get_currentPoint",set_antialias:"set_antialias",get_antialias:"get_antialias"}
};
var lime_graphics_cairo_CairoFTFontFace = {};
lime_graphics_cairo_CairoFTFontFace._new = function() {
	var this1 = 0;
	return this1;
};
lime_graphics_cairo_CairoFTFontFace.create = function(face,loadFlags) {
	return 0;
};
var lime_graphics_cairo_CairoFontFace = {};
lime_graphics_cairo_CairoFontFace._new = function() {
	var this1 = null;
	return this1;
};
lime_graphics_cairo_CairoFontFace.status = function(this1) {
	return 0;
};
var lime_graphics_cairo_CairoFontOptions = {};
lime_graphics_cairo_CairoFontOptions.__properties__ = {set_subpixelOrder:"set_subpixelOrder",get_subpixelOrder:"get_subpixelOrder",set_hintStyle:"set_hintStyle",get_hintStyle:"get_hintStyle",set_hintMetrics:"set_hintMetrics",get_hintMetrics:"get_hintMetrics",set_antialias:"set_antialias",get_antialias:"get_antialias"};
lime_graphics_cairo_CairoFontOptions._new = function() {
	var this1 = null;
	return this1;
};
lime_graphics_cairo_CairoFontOptions.get_antialias = function(this1) {
	return 0;
};
lime_graphics_cairo_CairoFontOptions.set_antialias = function(this1,value) {
	return value;
};
lime_graphics_cairo_CairoFontOptions.get_hintMetrics = function(this1) {
	return 0;
};
lime_graphics_cairo_CairoFontOptions.set_hintMetrics = function(this1,value) {
	return value;
};
lime_graphics_cairo_CairoFontOptions.get_hintStyle = function(this1) {
	return 0;
};
lime_graphics_cairo_CairoFontOptions.set_hintStyle = function(this1,value) {
	return value;
};
lime_graphics_cairo_CairoFontOptions.get_subpixelOrder = function(this1) {
	return 0;
};
lime_graphics_cairo_CairoFontOptions.set_subpixelOrder = function(this1,value) {
	return value;
};
var lime_graphics_cairo_CairoGlyph = function(index,x,y) {
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	this.index = index;
	this.x = x;
	this.y = y;
};
$hxClasses["lime.graphics.cairo.CairoGlyph"] = lime_graphics_cairo_CairoGlyph;
lime_graphics_cairo_CairoGlyph.__name__ = "lime.graphics.cairo.CairoGlyph";
lime_graphics_cairo_CairoGlyph.prototype = {
	index: null
	,x: null
	,y: null
	,__class__: lime_graphics_cairo_CairoGlyph
};
var lime_graphics_cairo_CairoImageSurface = {};
lime_graphics_cairo_CairoImageSurface.__properties__ = {get_width:"get_width",get_stride:"get_stride",get_height:"get_height",get_format:"get_format",get_data:"get_data"};
lime_graphics_cairo_CairoImageSurface._new = function(format,width,height) {
	var this1 = 0;
	return this1;
};
lime_graphics_cairo_CairoImageSurface.create = function(data,format,width,height,stride) {
	return 0;
};
lime_graphics_cairo_CairoImageSurface.fromImage = function(image) {
	return null;
};
lime_graphics_cairo_CairoImageSurface.get_data = function(this1) {
	return lime_utils_DataPointer.fromFloat(0);
};
lime_graphics_cairo_CairoImageSurface.get_format = function(this1) {
	return 0;
};
lime_graphics_cairo_CairoImageSurface.get_height = function(this1) {
	return 0;
};
lime_graphics_cairo_CairoImageSurface.get_stride = function(this1) {
	return 0;
};
lime_graphics_cairo_CairoImageSurface.get_width = function(this1) {
	return 0;
};
var lime_graphics_cairo_CairoPattern = {};
lime_graphics_cairo_CairoPattern.__properties__ = {set_matrix:"set_matrix",get_matrix:"get_matrix",set_filter:"set_filter",get_filter:"get_filter",set_extend:"set_extend",get_extend:"get_extend",get_colorStopCount:"get_colorStopCount"};
lime_graphics_cairo_CairoPattern._new = function(handle) {
	var this1 = handle;
	return this1;
};
lime_graphics_cairo_CairoPattern.addColorStopRGB = function(this1,offset,r,g,b) {
};
lime_graphics_cairo_CairoPattern.addColorStopRGBA = function(this1,offset,r,g,b,a) {
};
lime_graphics_cairo_CairoPattern.createForSurface = function(surface) {
	return 0;
};
lime_graphics_cairo_CairoPattern.createLinear = function(x0,y0,x1,y1) {
	return 0;
};
lime_graphics_cairo_CairoPattern.createRadial = function(cx0,cy0,radius0,cx1,cy1,radius1) {
	return 0;
};
lime_graphics_cairo_CairoPattern.createRGB = function(r,g,b) {
	return 0;
};
lime_graphics_cairo_CairoPattern.createRGBA = function(r,g,b,a) {
	return 0;
};
lime_graphics_cairo_CairoPattern.get_colorStopCount = function(this1) {
	return 0;
};
lime_graphics_cairo_CairoPattern.get_extend = function(this1) {
	return 0;
};
lime_graphics_cairo_CairoPattern.set_extend = function(this1,value) {
	return value;
};
lime_graphics_cairo_CairoPattern.get_filter = function(this1) {
	return 0;
};
lime_graphics_cairo_CairoPattern.set_filter = function(this1,value) {
	return value;
};
lime_graphics_cairo_CairoPattern.get_matrix = function(this1) {
	return null;
};
lime_graphics_cairo_CairoPattern.set_matrix = function(this1,value) {
	return value;
};
var lime_graphics_cairo_CairoSurface = {};
lime_graphics_cairo_CairoSurface.flush = function(this1) {
};
var lime_graphics_opengl_GL = function() { };
$hxClasses["lime.graphics.opengl.GL"] = lime_graphics_opengl_GL;
lime_graphics_opengl_GL.__name__ = "lime.graphics.opengl.GL";
lime_graphics_opengl_GL.context = null;
lime_graphics_opengl_GL.type = null;
lime_graphics_opengl_GL.version = null;
lime_graphics_opengl_GL.activeTexture = function(texture) {
	lime_graphics_opengl_GL.context.activeTexture(texture);
};
lime_graphics_opengl_GL.attachShader = function(program,shader) {
	lime_graphics_opengl_GL.context.attachShader(program,shader);
};
lime_graphics_opengl_GL.beginQuery = function(target,query) {
	lime_graphics_opengl_GL.context.beginQuery(target,query);
};
lime_graphics_opengl_GL.beginTransformFeedback = function(primitiveNode) {
	lime_graphics_opengl_GL.context.beginTransformFeedback(primitiveNode);
};
lime_graphics_opengl_GL.bindAttribLocation = function(program,index,name) {
	lime_graphics_opengl_GL.context.bindAttribLocation(program,index,name);
};
lime_graphics_opengl_GL.bindBuffer = function(target,buffer) {
	lime_graphics_opengl_GL.context.bindBuffer(target,buffer);
};
lime_graphics_opengl_GL.bindBufferBase = function(target,index,buffer) {
	lime_graphics_opengl_GL.context.bindBufferBase(target,index,buffer);
};
lime_graphics_opengl_GL.bindBufferRange = function(target,index,buffer,offset,size) {
	lime_graphics_opengl_GL.context.bindBufferRange(target,index,buffer,offset,lime_utils_DataPointer.fromFloat(size));
};
lime_graphics_opengl_GL.bindFramebuffer = function(target,framebuffer) {
	lime_graphics_opengl_GL.context.bindFramebuffer(target,framebuffer);
};
lime_graphics_opengl_GL.bindRenderbuffer = function(target,renderbuffer) {
	lime_graphics_opengl_GL.context.bindRenderbuffer(target,renderbuffer);
};
lime_graphics_opengl_GL.bindSampler = function(unit,sampler) {
	lime_graphics_opengl_GL.context.bindSampler(unit,sampler);
};
lime_graphics_opengl_GL.bindTexture = function(target,texture) {
	lime_graphics_opengl_GL.context.bindTexture(target,texture);
};
lime_graphics_opengl_GL.bindTransformFeedback = function(target,transformFeedback) {
	lime_graphics_opengl_GL.context.bindTransformFeedback(target,transformFeedback);
};
lime_graphics_opengl_GL.bindVertexArray = function(vertexArray) {
	lime_graphics_opengl_GL.context.bindVertexArray(vertexArray);
};
lime_graphics_opengl_GL.blitFramebuffer = function(srcX0,srcY0,srcX1,srcY1,dstX0,dstY0,dstX1,dstY1,mask,filter) {
	lime_graphics_opengl_GL.context.blitFramebuffer(srcX0,srcY0,srcX1,srcY1,dstX0,dstY0,dstX1,dstY1,mask,filter);
};
lime_graphics_opengl_GL.blendColor = function(red,green,blue,alpha) {
	lime_graphics_opengl_GL.context.blendColor(red,green,blue,alpha);
};
lime_graphics_opengl_GL.blendEquation = function(mode) {
	lime_graphics_opengl_GL.context.blendEquation(mode);
};
lime_graphics_opengl_GL.blendEquationSeparate = function(modeRGB,modeAlpha) {
	lime_graphics_opengl_GL.context.blendEquationSeparate(modeRGB,modeAlpha);
};
lime_graphics_opengl_GL.blendFunc = function(sfactor,dfactor) {
	lime_graphics_opengl_GL.context.blendFunc(sfactor,dfactor);
};
lime_graphics_opengl_GL.blendFuncSeparate = function(srcRGB,dstRGB,srcAlpha,dstAlpha) {
	lime_graphics_opengl_GL.context.blendFuncSeparate(srcRGB,dstRGB,srcAlpha,dstAlpha);
};
lime_graphics_opengl_GL.bufferDataWEBGL = function(target,srcData,usage,srcOffset,length) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.bufferData(target,srcData,usage,srcOffset,length);
	} else {
		this1.bufferData(target,srcData,usage);
	}
};
lime_graphics_opengl_GL.bufferSubDataWEBGL = function(target,dstByteOffset,srcData,srcOffset,length) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.bufferSubData(target,dstByteOffset,srcData,srcOffset,length);
	} else {
		this1.bufferSubData(target,dstByteOffset,srcData);
	}
};
lime_graphics_opengl_GL.checkFramebufferStatus = function(target) {
	return lime_graphics_opengl_GL.context.checkFramebufferStatus(target);
};
lime_graphics_opengl_GL.clear = function(mask) {
	lime_graphics_opengl_GL.context.clear(mask);
};
lime_graphics_opengl_GL.clearBufferfi = function(buffer,drawbuffer,depth,stencil) {
	lime_graphics_opengl_GL.context.clearBufferfi(buffer,drawbuffer,depth,stencil);
};
lime_graphics_opengl_GL.clearBufferfvWEBGL = function(buffer,drawbuffer,values,srcOffset) {
	lime_graphics_opengl_GL.context.clearBufferfv(buffer,drawbuffer,values,srcOffset);
};
lime_graphics_opengl_GL.clearBufferivWEBGL = function(buffer,drawbuffer,values,srcOffset) {
	lime_graphics_opengl_GL.context.clearBufferiv(buffer,drawbuffer,values,srcOffset);
};
lime_graphics_opengl_GL.clearBufferuivWEBGL = function(buffer,drawbuffer,values,srcOffset) {
	lime_graphics_opengl_GL.context.clearBufferuiv(buffer,drawbuffer,values,srcOffset);
};
lime_graphics_opengl_GL.clearColor = function(red,green,blue,alpha) {
	lime_graphics_opengl_GL.context.clearColor(red,green,blue,alpha);
};
lime_graphics_opengl_GL.clearDepth = function(depth) {
	lime_graphics_opengl_GL.context.clearDepth(depth);
};
lime_graphics_opengl_GL.clearStencil = function(s) {
	lime_graphics_opengl_GL.context.clearStencil(s);
};
lime_graphics_opengl_GL.clientWaitSync = function(sync,flags,timeout) {
	return lime_graphics_opengl_GL.context.clientWaitSync(sync,flags,timeout);
};
lime_graphics_opengl_GL.colorMask = function(red,green,blue,alpha) {
	lime_graphics_opengl_GL.context.colorMask(red,green,blue,alpha);
};
lime_graphics_opengl_GL.compileShader = function(shader) {
	lime_graphics_opengl_GL.context.compileShader(shader);
};
lime_graphics_opengl_GL.compressedTexImage2DWEBGL = function(target,level,internalformat,width,height,border,srcData,srcOffset,srcLengthOverride) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.compressedTexImage2D(target,level,internalformat,width,height,border,srcData,srcOffset,srcLengthOverride);
	} else {
		this1.compressedTexImage2D(target,level,internalformat,width,height,border,srcData);
	}
};
lime_graphics_opengl_GL.compressedTexImage3DWEBGL = function(target,level,internalformat,width,height,depth,border,srcData,srcOffset,srcLengthOverride) {
	lime_graphics_opengl_GL.context.compressedTexImage3D(target,level,internalformat,width,height,depth,border,srcData,srcOffset,srcLengthOverride);
};
lime_graphics_opengl_GL.compressedTexSubImage2DWEBGL = function(target,level,xoffset,yoffset,width,height,format,srcData,srcOffset,srcLengthOverride) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.compressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,srcData,srcOffset,srcLengthOverride);
	} else {
		this1.compressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,srcData);
	}
};
lime_graphics_opengl_GL.compressedTexSubImage3DWEBGL = function(target,level,xoffset,yoffset,zoffset,width,height,depth,format,srcData,srcOffset,srcLengthOverride) {
	lime_graphics_opengl_GL.context.compressedTexSubImage3D(target,level,xoffset,yoffset,zoffset,width,height,depth,format,srcData,srcOffset,srcLengthOverride);
};
lime_graphics_opengl_GL.copyTexImage2D = function(target,level,internalformat,x,y,width,height,border) {
	lime_graphics_opengl_GL.context.copyTexImage2D(target,level,internalformat,x,y,width,height,border);
};
lime_graphics_opengl_GL.copyTexSubImage2D = function(target,level,xoffset,yoffset,x,y,width,height) {
	lime_graphics_opengl_GL.context.copyTexSubImage2D(target,level,xoffset,yoffset,x,y,width,height);
};
lime_graphics_opengl_GL.copyTexSubImage3D = function(target,level,xoffset,yoffset,zoffset,x,y,width,height) {
	lime_graphics_opengl_GL.context.copyTexSubImage3D(target,level,xoffset,yoffset,zoffset,x,y,width,height);
};
lime_graphics_opengl_GL.createBuffer = function() {
	return lime_graphics_opengl_GL.context.createBuffer();
};
lime_graphics_opengl_GL.createFramebuffer = function() {
	return lime_graphics_opengl_GL.context.createFramebuffer();
};
lime_graphics_opengl_GL.createProgram = function() {
	return lime_graphics_opengl_GL.context.createProgram();
};
lime_graphics_opengl_GL.createQuery = function() {
	return lime_graphics_opengl_GL.context.createQuery();
};
lime_graphics_opengl_GL.createRenderbuffer = function() {
	return lime_graphics_opengl_GL.context.createRenderbuffer();
};
lime_graphics_opengl_GL.createSampler = function() {
	return lime_graphics_opengl_GL.context.createSampler();
};
lime_graphics_opengl_GL.createShader = function(type) {
	return lime_graphics_opengl_GL.context.createShader(type);
};
lime_graphics_opengl_GL.createTexture = function() {
	return lime_graphics_opengl_GL.context.createTexture();
};
lime_graphics_opengl_GL.createTransformFeedback = function() {
	return lime_graphics_opengl_GL.context.createTransformFeedback();
};
lime_graphics_opengl_GL.createVertexArray = function() {
	return lime_graphics_opengl_GL.context.createVertexArray();
};
lime_graphics_opengl_GL.cullFace = function(mode) {
	lime_graphics_opengl_GL.context.cullFace(mode);
};
lime_graphics_opengl_GL.deleteBuffer = function(buffer) {
	lime_graphics_opengl_GL.context.deleteBuffer(buffer);
};
lime_graphics_opengl_GL.deleteFramebuffer = function(framebuffer) {
	lime_graphics_opengl_GL.context.deleteFramebuffer(framebuffer);
};
lime_graphics_opengl_GL.deleteProgram = function(program) {
	lime_graphics_opengl_GL.context.deleteProgram(program);
};
lime_graphics_opengl_GL.deleteQuery = function(query) {
	lime_graphics_opengl_GL.context.deleteQuery(query);
};
lime_graphics_opengl_GL.deleteRenderbuffer = function(renderbuffer) {
	lime_graphics_opengl_GL.context.deleteRenderbuffer(renderbuffer);
};
lime_graphics_opengl_GL.deleteSampler = function(sampler) {
	lime_graphics_opengl_GL.context.deleteSampler(sampler);
};
lime_graphics_opengl_GL.deleteShader = function(shader) {
	lime_graphics_opengl_GL.context.deleteShader(shader);
};
lime_graphics_opengl_GL.deleteSync = function(sync) {
	lime_graphics_opengl_GL.context.deleteSync(sync);
};
lime_graphics_opengl_GL.deleteTexture = function(texture) {
	lime_graphics_opengl_GL.context.deleteTexture(texture);
};
lime_graphics_opengl_GL.deleteTransformFeedback = function(transformFeedback) {
	lime_graphics_opengl_GL.context.deleteTransformFeedback(transformFeedback);
};
lime_graphics_opengl_GL.deleteVertexArray = function(vertexArray) {
	lime_graphics_opengl_GL.context.deleteVertexArray(vertexArray);
};
lime_graphics_opengl_GL.depthFunc = function(func) {
	lime_graphics_opengl_GL.context.depthFunc(func);
};
lime_graphics_opengl_GL.depthMask = function(flag) {
	lime_graphics_opengl_GL.context.depthMask(flag);
};
lime_graphics_opengl_GL.depthRange = function(zNear,zFar) {
	lime_graphics_opengl_GL.context.depthRange(zNear,zFar);
};
lime_graphics_opengl_GL.detachShader = function(program,shader) {
	lime_graphics_opengl_GL.context.detachShader(program,shader);
};
lime_graphics_opengl_GL.disable = function(cap) {
	lime_graphics_opengl_GL.context.disable(cap);
};
lime_graphics_opengl_GL.disableVertexAttribArray = function(index) {
	lime_graphics_opengl_GL.context.disableVertexAttribArray(index);
};
lime_graphics_opengl_GL.drawArrays = function(mode,first,count) {
	lime_graphics_opengl_GL.context.drawArrays(mode,first,count);
};
lime_graphics_opengl_GL.drawArraysInstanced = function(mode,first,count,instanceCount) {
	lime_graphics_opengl_GL.context.drawArraysInstanced(mode,first,count,instanceCount);
};
lime_graphics_opengl_GL.drawBuffers = function(buffers) {
	lime_graphics_opengl_GL.context.drawBuffers(buffers);
};
lime_graphics_opengl_GL.drawElements = function(mode,count,type,offset) {
	lime_graphics_opengl_GL.context.drawElements(mode,count,type,offset);
};
lime_graphics_opengl_GL.drawElementsInstanced = function(mode,count,type,offset,instanceCount) {
	lime_graphics_opengl_GL.context.drawElementsInstanced(mode,count,type,offset,instanceCount);
};
lime_graphics_opengl_GL.drawRangeElements = function(mode,start,end,count,type,offset) {
	lime_graphics_opengl_GL.context.drawRangeElements(mode,start,end,count,type,offset);
};
lime_graphics_opengl_GL.enable = function(cap) {
	lime_graphics_opengl_GL.context.enable(cap);
};
lime_graphics_opengl_GL.enableVertexAttribArray = function(index) {
	lime_graphics_opengl_GL.context.enableVertexAttribArray(index);
};
lime_graphics_opengl_GL.endQuery = function(target) {
	lime_graphics_opengl_GL.context.endQuery(target);
};
lime_graphics_opengl_GL.endTransformFeedback = function() {
	lime_graphics_opengl_GL.context.endTransformFeedback();
};
lime_graphics_opengl_GL.fenceSync = function(condition,flags) {
	return lime_graphics_opengl_GL.context.fenceSync(condition,flags);
};
lime_graphics_opengl_GL.finish = function() {
	lime_graphics_opengl_GL.context.finish();
};
lime_graphics_opengl_GL.flush = function() {
	lime_graphics_opengl_GL.context.flush();
};
lime_graphics_opengl_GL.framebufferRenderbuffer = function(target,attachment,renderbuffertarget,renderbuffer) {
	lime_graphics_opengl_GL.context.framebufferRenderbuffer(target,attachment,renderbuffertarget,renderbuffer);
};
lime_graphics_opengl_GL.framebufferTexture2D = function(target,attachment,textarget,texture,level) {
	lime_graphics_opengl_GL.context.framebufferTexture2D(target,attachment,textarget,texture,level);
};
lime_graphics_opengl_GL.framebufferTextureLayer = function(target,attachment,texture,level,layer) {
	lime_graphics_opengl_GL.context.framebufferTextureLayer(target,attachment,texture,level,layer);
};
lime_graphics_opengl_GL.frontFace = function(mode) {
	lime_graphics_opengl_GL.context.frontFace(mode);
};
lime_graphics_opengl_GL.generateMipmap = function(target) {
	lime_graphics_opengl_GL.context.generateMipmap(target);
};
lime_graphics_opengl_GL.getActiveAttrib = function(program,index) {
	return lime_graphics_opengl_GL.context.getActiveAttrib(program,index);
};
lime_graphics_opengl_GL.getActiveUniform = function(program,index) {
	return lime_graphics_opengl_GL.context.getActiveUniform(program,index);
};
lime_graphics_opengl_GL.getActiveUniformBlockName = function(program,uniformBlockIndex) {
	return lime_graphics_opengl_GL.context.getActiveUniformBlockName(program,uniformBlockIndex);
};
lime_graphics_opengl_GL.getActiveUniformBlockParameter = function(program,uniformBlockIndex,pname) {
	return lime_graphics_opengl_GL.context.getActiveUniformBlockParameter(program,uniformBlockIndex,pname);
};
lime_graphics_opengl_GL.getActiveUniforms = function(program,uniformIndices,pname) {
	return lime_graphics_opengl_GL.context.getActiveUniforms(program,uniformIndices,pname);
};
lime_graphics_opengl_GL.getAttachedShaders = function(program) {
	return lime_graphics_opengl_GL.context.getAttachedShaders(program);
};
lime_graphics_opengl_GL.getAttribLocation = function(program,name) {
	return lime_graphics_opengl_GL.context.getAttribLocation(program,name);
};
lime_graphics_opengl_GL.getBufferParameter = function(target,pname) {
	return lime_graphics_opengl_GL.context.getBufferParameter(target,pname);
};
lime_graphics_opengl_GL.getBufferSubDataWEBGL = function(target,srcByteOffset,dstData,srcOffset,length) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.getBufferSubData(target,srcByteOffset,dstData,srcOffset,length);
	} else {
		this1.getBufferSubData(target,srcByteOffset,dstData);
	}
};
lime_graphics_opengl_GL.getContextAttributes = function() {
	return lime_graphics_opengl_GL.context.getContextAttributes();
};
lime_graphics_opengl_GL.getError = function() {
	return lime_graphics_opengl_GL.context.getError();
};
lime_graphics_opengl_GL.getExtension = function(name) {
	return lime_graphics_opengl_GL.context.getExtension(name);
};
lime_graphics_opengl_GL.getFragDataLocation = function(program,name) {
	return lime_graphics_opengl_GL.context.getFragDataLocation(program,name);
};
lime_graphics_opengl_GL.getFramebufferAttachmentParameter = function(target,attachment,pname) {
	return lime_graphics_opengl_GL.context.getFramebufferAttachmentParameter(target,attachment,pname);
};
lime_graphics_opengl_GL.getIndexedParameter = function(target,index) {
	return lime_graphics_opengl_GL.context.getIndexedParameter(target,index);
};
lime_graphics_opengl_GL.getInternalformatParameter = function(target,internalformat,pname) {
	return lime_graphics_opengl_GL.context.getInternalformatParameter(target,internalformat,pname);
};
lime_graphics_opengl_GL.getParameter = function(pname) {
	return lime_graphics_opengl_GL.context.getParameter(pname);
};
lime_graphics_opengl_GL.getProgramInfoLog = function(program) {
	return lime_graphics_opengl_GL.context.getProgramInfoLog(program);
};
lime_graphics_opengl_GL.getProgramParameter = function(program,pname) {
	return lime_graphics_opengl_GL.context.getProgramParameter(program,pname);
};
lime_graphics_opengl_GL.getQuery = function(target,pname) {
	return lime_graphics_opengl_GL.context.getQuery(target,pname);
};
lime_graphics_opengl_GL.getQueryParameter = function(query,pname) {
	return lime_graphics_opengl_GL.context.getQueryParameter(query,pname);
};
lime_graphics_opengl_GL.getRenderbufferParameter = function(target,pname) {
	return lime_graphics_opengl_GL.context.getRenderbufferParameter(target,pname);
};
lime_graphics_opengl_GL.getSamplerParameter = function(sampler,pname) {
	return lime_graphics_opengl_GL.context.getSamplerParameter(sampler,pname);
};
lime_graphics_opengl_GL.getShaderInfoLog = function(shader) {
	return lime_graphics_opengl_GL.context.getShaderInfoLog(shader);
};
lime_graphics_opengl_GL.getShaderParameter = function(shader,pname) {
	return lime_graphics_opengl_GL.context.getShaderParameter(shader,pname);
};
lime_graphics_opengl_GL.getShaderPrecisionFormat = function(shadertype,precisiontype) {
	return lime_graphics_opengl_GL.context.getShaderPrecisionFormat(shadertype,precisiontype);
};
lime_graphics_opengl_GL.getShaderSource = function(shader) {
	return lime_graphics_opengl_GL.context.getShaderSource(shader);
};
lime_graphics_opengl_GL.getSupportedExtensions = function() {
	return lime_graphics_opengl_GL.context.getSupportedExtensions();
};
lime_graphics_opengl_GL.getSyncParameter = function(sync,pname) {
	return lime_graphics_opengl_GL.context.getSyncParameter(sync,pname);
};
lime_graphics_opengl_GL.getTexParameter = function(target,pname) {
	return lime_graphics_opengl_GL.context.getTexParameter(target,pname);
};
lime_graphics_opengl_GL.getTransformFeedbackVarying = function(program,index) {
	return lime_graphics_opengl_GL.context.getTransformFeedbackVarying(program,index);
};
lime_graphics_opengl_GL.getUniform = function(program,location) {
	return lime_graphics_opengl_GL.context.getUniform(program,location);
};
lime_graphics_opengl_GL.getUniformBlockIndex = function(program,uniformBlockName) {
	return lime_graphics_opengl_GL.context.getUniformBlockIndex(program,uniformBlockName);
};
lime_graphics_opengl_GL.getUniformIndices = function(program,uniformNames) {
	return lime_graphics_opengl_GL.context.getUniformIndices(program,uniformNames);
};
lime_graphics_opengl_GL.getUniformLocation = function(program,name) {
	return lime_graphics_opengl_GL.context.getUniformLocation(program,name);
};
lime_graphics_opengl_GL.getVertexAttrib = function(index,pname) {
	return lime_graphics_opengl_GL.context.getVertexAttrib(index,pname);
};
lime_graphics_opengl_GL.getVertexAttribOffset = function(index,pname) {
	return lime_utils_DataPointer.fromFloat(lime_graphics_opengl_GL.context.getVertexAttribOffset(index,pname));
};
lime_graphics_opengl_GL.hint = function(target,mode) {
	lime_graphics_opengl_GL.context.hint(target,mode);
};
lime_graphics_opengl_GL.invalidateFramebuffer = function(target,attachments) {
	lime_graphics_opengl_GL.context.invalidateFramebuffer(target,attachments);
};
lime_graphics_opengl_GL.invalidateSubFramebuffer = function(target,attachments,x,y,width,height) {
	lime_graphics_opengl_GL.context.invalidateSubFramebuffer(target,attachments,x,y,width,height);
};
lime_graphics_opengl_GL.isBuffer = function(buffer) {
	return lime_graphics_opengl_GL.context.isBuffer(buffer);
};
lime_graphics_opengl_GL.isContextLost = function() {
	return lime_graphics_opengl_GL.context.isContextLost();
};
lime_graphics_opengl_GL.isEnabled = function(cap) {
	return lime_graphics_opengl_GL.context.isEnabled(cap);
};
lime_graphics_opengl_GL.isFramebuffer = function(framebuffer) {
	return lime_graphics_opengl_GL.context.isFramebuffer(framebuffer);
};
lime_graphics_opengl_GL.isProgram = function(program) {
	return lime_graphics_opengl_GL.context.isProgram(program);
};
lime_graphics_opengl_GL.isQuery = function(query) {
	return lime_graphics_opengl_GL.context.isQuery(query);
};
lime_graphics_opengl_GL.isRenderbuffer = function(renderbuffer) {
	return lime_graphics_opengl_GL.context.isRenderbuffer(renderbuffer);
};
lime_graphics_opengl_GL.isSampler = function(sampler) {
	return lime_graphics_opengl_GL.context.isSampler(sampler);
};
lime_graphics_opengl_GL.isShader = function(shader) {
	return lime_graphics_opengl_GL.context.isShader(shader);
};
lime_graphics_opengl_GL.isSync = function(sync) {
	return lime_graphics_opengl_GL.context.isSync(sync);
};
lime_graphics_opengl_GL.isTexture = function(texture) {
	return lime_graphics_opengl_GL.context.isTexture(texture);
};
lime_graphics_opengl_GL.isTransformFeedback = function(transformFeedback) {
	return lime_graphics_opengl_GL.context.isTransformFeedback(transformFeedback);
};
lime_graphics_opengl_GL.isVertexArray = function(vertexArray) {
	return lime_graphics_opengl_GL.context.isVertexArray(vertexArray);
};
lime_graphics_opengl_GL.lineWidth = function(width) {
	lime_graphics_opengl_GL.context.lineWidth(width);
};
lime_graphics_opengl_GL.linkProgram = function(program) {
	lime_graphics_opengl_GL.context.linkProgram(program);
};
lime_graphics_opengl_GL.pauseTransformFeedback = function() {
	lime_graphics_opengl_GL.context.pauseTransformFeedback();
};
lime_graphics_opengl_GL.pixelStorei = function(pname,param) {
	lime_graphics_opengl_GL.context.pixelStorei(pname,param);
};
lime_graphics_opengl_GL.polygonOffset = function(factor,units) {
	lime_graphics_opengl_GL.context.polygonOffset(factor,units);
};
lime_graphics_opengl_GL.readBuffer = function(src) {
	lime_graphics_opengl_GL.context.readBuffer(src);
};
lime_graphics_opengl_GL.readPixelsWEBGL = function(x,y,width,height,format,type,pixels,dstOffset) {
	var this1 = lime_graphics_opengl_GL.context;
	if(dstOffset != null) {
		this1.readPixels(x,y,width,height,format,type,pixels,dstOffset);
	} else {
		this1.readPixels(x,y,width,height,format,type,pixels);
	}
};
lime_graphics_opengl_GL.renderbufferStorage = function(target,internalformat,width,height) {
	lime_graphics_opengl_GL.context.renderbufferStorage(target,internalformat,width,height);
};
lime_graphics_opengl_GL.renderbufferStorageMultisample = function(target,samples,internalformat,width,height) {
	lime_graphics_opengl_GL.context.renderbufferStorageMultisample(target,samples,internalformat,width,height);
};
lime_graphics_opengl_GL.resumeTransformFeedback = function() {
	lime_graphics_opengl_GL.context.resumeTransformFeedback();
};
lime_graphics_opengl_GL.sampleCoverage = function(value,invert) {
	lime_graphics_opengl_GL.context.sampleCoverage(value,invert);
};
lime_graphics_opengl_GL.samplerParameterf = function(sampler,pname,param) {
	lime_graphics_opengl_GL.context.samplerParameterf(sampler,pname,param);
};
lime_graphics_opengl_GL.samplerParameteri = function(sampler,pname,param) {
	lime_graphics_opengl_GL.context.samplerParameteri(sampler,pname,param);
};
lime_graphics_opengl_GL.scissor = function(x,y,width,height) {
	lime_graphics_opengl_GL.context.scissor(x,y,width,height);
};
lime_graphics_opengl_GL.shaderSource = function(shader,source) {
	lime_graphics_opengl_GL.context.shaderSource(shader,source);
};
lime_graphics_opengl_GL.stencilFunc = function(func,ref,mask) {
	lime_graphics_opengl_GL.context.stencilFunc(func,ref,mask);
};
lime_graphics_opengl_GL.stencilFuncSeparate = function(face,func,ref,mask) {
	lime_graphics_opengl_GL.context.stencilFuncSeparate(face,func,ref,mask);
};
lime_graphics_opengl_GL.stencilMask = function(mask) {
	lime_graphics_opengl_GL.context.stencilMask(mask);
};
lime_graphics_opengl_GL.stencilMaskSeparate = function(face,mask) {
	lime_graphics_opengl_GL.context.stencilMaskSeparate(face,mask);
};
lime_graphics_opengl_GL.stencilOp = function(fail,zfail,zpass) {
	lime_graphics_opengl_GL.context.stencilOp(fail,zfail,zpass);
};
lime_graphics_opengl_GL.stencilOpSeparate = function(face,fail,zfail,zpass) {
	lime_graphics_opengl_GL.context.stencilOpSeparate(face,fail,zfail,zpass);
};
lime_graphics_opengl_GL.texImage2DWEBGL = function(target,level,internalformat,width,height,border,format,type,srcData,srcOffset) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.texImage2D(target,level,internalformat,width,height,border,format,type,srcData,srcOffset);
	} else if(format != null) {
		this1.texImage2D(target,level,internalformat,width,height,border,format,type,srcData);
	} else {
		this1.texImage2D(target,level,internalformat,width,height,border);
	}
};
lime_graphics_opengl_GL.texImage3DWEBGL = function(target,level,internalformat,width,height,depth,border,format,type,srcData,srcOffset) {
	lime_graphics_opengl_GL.context.texImage3D(target,level,internalformat,width,height,depth,border,format,type,srcData,srcOffset);
};
lime_graphics_opengl_GL.texStorage2D = function(target,level,internalformat,width,height) {
	lime_graphics_opengl_GL.context.texStorage2D(target,level,internalformat,width,height);
};
lime_graphics_opengl_GL.texStorage3D = function(target,level,internalformat,width,height,depth) {
	lime_graphics_opengl_GL.context.texStorage3D(target,level,internalformat,width,height,depth);
};
lime_graphics_opengl_GL.texParameterf = function(target,pname,param) {
	lime_graphics_opengl_GL.context.texParameterf(target,pname,param);
};
lime_graphics_opengl_GL.texParameteri = function(target,pname,param) {
	lime_graphics_opengl_GL.context.texParameteri(target,pname,param);
};
lime_graphics_opengl_GL.texSubImage2DWEBGL = function(target,level,xoffset,yoffset,width,height,format,type,srcData,srcOffset) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,srcData,srcOffset);
	} else if(type != null) {
		this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,srcData);
	} else {
		this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format);
	}
};
lime_graphics_opengl_GL.texSubImage3DWEBGL = function(target,level,xoffset,yoffset,zoffset,width,height,depth,format,type,source,srcOffset) {
	lime_graphics_opengl_GL.context.texSubImage3D(target,level,xoffset,yoffset,zoffset,width,height,depth,format,type,source,srcOffset);
};
lime_graphics_opengl_GL.transformFeedbackVaryings = function(program,varyings,bufferMode) {
	lime_graphics_opengl_GL.context.transformFeedbackVaryings(program,varyings,bufferMode);
};
lime_graphics_opengl_GL.uniform1f = function(location,v0) {
	lime_graphics_opengl_GL.context.uniform1f(location,v0);
};
lime_graphics_opengl_GL.uniform1fvWEBGL = function(location,data,srcOffset,srcLength) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.uniform1fv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform1fv(location,data);
	}
};
lime_graphics_opengl_GL.uniform1i = function(location,v0) {
	lime_graphics_opengl_GL.context.uniform1i(location,v0);
};
lime_graphics_opengl_GL.uniform1ivWEBGL = function(location,data,srcOffset,srcLength) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.uniform1iv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform1iv(location,data);
	}
};
lime_graphics_opengl_GL.uniform1ui = function(location,v0) {
	lime_graphics_opengl_GL.context.uniform1ui(location,v0);
};
lime_graphics_opengl_GL.uniform1uivWEBGL = function(location,data,srcOffset,srcLength) {
	lime_graphics_opengl_GL.context.uniform1uiv(location,data,srcOffset,srcLength);
};
lime_graphics_opengl_GL.uniform2f = function(location,v0,v1) {
	lime_graphics_opengl_GL.context.uniform2f(location,v0,v1);
};
lime_graphics_opengl_GL.uniform2fvWEBGL = function(location,data,srcOffset,srcLength) {
	lime_graphics_WebGL2RenderContext.uniform2fv(lime_graphics_opengl_GL.context,location,data,srcOffset,srcLength);
};
lime_graphics_opengl_GL.uniform2i = function(location,x,y) {
	lime_graphics_opengl_GL.context.uniform2i(location,x,y);
};
lime_graphics_opengl_GL.uniform2ivWEBGL = function(location,data,srcOffset,srcLength) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.uniform2iv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform2iv(location,data);
	}
};
lime_graphics_opengl_GL.uniform2ui = function(location,x,y) {
	lime_graphics_opengl_GL.context.uniform2ui(location,x,y);
};
lime_graphics_opengl_GL.uniform2uivWEBGL = function(location,data,srcOffset,srcLength) {
	lime_graphics_opengl_GL.context.uniform2uiv(location,data,srcOffset,srcLength);
};
lime_graphics_opengl_GL.uniform3f = function(location,v0,v1,v2) {
	lime_graphics_opengl_GL.context.uniform3f(location,v0,v1,v2);
};
lime_graphics_opengl_GL.uniform3fvWEBGL = function(location,data,srcOffset,srcLength) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.uniform3fv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform3fv(location,data);
	}
};
lime_graphics_opengl_GL.uniform3i = function(location,v0,v1,v2) {
	lime_graphics_opengl_GL.context.uniform3i(location,v0,v1,v2);
};
lime_graphics_opengl_GL.uniform3ivWEBGL = function(location,data,srcOffset,srcLength) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.uniform3iv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform3iv(location,data);
	}
};
lime_graphics_opengl_GL.uniform3ui = function(location,v0,v1,v2) {
	lime_graphics_opengl_GL.context.uniform3ui(location,v0,v1,v2);
};
lime_graphics_opengl_GL.uniform3uivWEBGL = function(location,data,srcOffset,srcLength) {
	lime_graphics_opengl_GL.context.uniform3uiv(location,data,srcOffset,srcLength);
};
lime_graphics_opengl_GL.uniform4f = function(location,v0,v1,v2,v3) {
	lime_graphics_opengl_GL.context.uniform4f(location,v0,v1,v2,v3);
};
lime_graphics_opengl_GL.uniform4fvWEBGL = function(location,data,srcOffset,srcLength) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.uniform4fv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform4fv(location,data);
	}
};
lime_graphics_opengl_GL.uniform4i = function(location,v0,v1,v2,v3) {
	lime_graphics_opengl_GL.context.uniform4i(location,v0,v1,v2,v3);
};
lime_graphics_opengl_GL.uniform4ivWEBGL = function(location,data,srcOffset,srcLength) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.uniform4iv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform4iv(location,data);
	}
};
lime_graphics_opengl_GL.uniform4ui = function(location,v0,v1,v2,v3) {
	lime_graphics_opengl_GL.context.uniform4ui(location,v0,v1,v2,v3);
};
lime_graphics_opengl_GL.uniform4uivWEBGL = function(location,data,srcOffset,srcLength) {
	lime_graphics_opengl_GL.context.uniform4uiv(location,data,srcOffset,srcLength);
};
lime_graphics_opengl_GL.uniformBlockBinding = function(program,uniformBlockIndex,uniformBlockBinding) {
	lime_graphics_opengl_GL.context.uniformBlockBinding(program,uniformBlockIndex,uniformBlockBinding);
};
lime_graphics_opengl_GL.uniformMatrix2fvWEBGL = function(location,transpose,v,srcOffset,srcLength) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.uniformMatrix2fv(location,transpose,v,srcOffset,srcLength);
	} else {
		this1.uniformMatrix2fv(location,transpose,v);
	}
};
lime_graphics_opengl_GL.uniformMatrix2x3fvWEBGL = function(location,transpose,v,srcOffset,srcLength) {
	lime_graphics_opengl_GL.context.uniformMatrix2x3fv(location,transpose,v,srcOffset,srcLength);
};
lime_graphics_opengl_GL.uniformMatrix2x4fvWEBGL = function(location,transpose,v,srcOffset,srcLength) {
	lime_graphics_opengl_GL.context.uniformMatrix2x4fv(location,transpose,v,srcOffset,srcLength);
};
lime_graphics_opengl_GL.uniformMatrix3fvWEBGL = function(location,transpose,v,srcOffset,srcLength) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.uniformMatrix3fv(location,transpose,v,srcOffset,srcLength);
	} else {
		this1.uniformMatrix3fv(location,transpose,v);
	}
};
lime_graphics_opengl_GL.uniformMatrix3x2fvWEBGL = function(location,transpose,v,srcOffset,srcLength) {
	lime_graphics_opengl_GL.context.uniformMatrix3x2fv(location,transpose,v,srcOffset,srcLength);
};
lime_graphics_opengl_GL.uniformMatrix3x4fvWEBGL = function(location,transpose,v,srcOffset,srcLength) {
	lime_graphics_opengl_GL.context.uniformMatrix3x4fv(location,transpose,v,srcOffset,srcLength);
};
lime_graphics_opengl_GL.uniformMatrix4fvWEBGL = function(location,transpose,v,srcOffset,srcLength) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.uniformMatrix4fv(location,transpose,v,srcOffset,srcLength);
	} else {
		this1.uniformMatrix4fv(location,transpose,v);
	}
};
lime_graphics_opengl_GL.uniformMatrix4x2fvWEBGL = function(location,transpose,v,srcOffset,srcLength) {
	lime_graphics_opengl_GL.context.uniformMatrix4x2fv(location,transpose,v,srcOffset,srcLength);
};
lime_graphics_opengl_GL.uniformMatrix4x3fvWEBGL = function(location,transpose,v,srcOffset,srcLength) {
	lime_graphics_opengl_GL.context.uniformMatrix4x3fv(location,transpose,v,srcOffset,srcLength);
};
lime_graphics_opengl_GL.useProgram = function(program) {
	lime_graphics_opengl_GL.context.useProgram(program);
};
lime_graphics_opengl_GL.validateProgram = function(program) {
	lime_graphics_opengl_GL.context.validateProgram(program);
};
lime_graphics_opengl_GL.vertexAttrib1f = function(index,v0) {
	lime_graphics_opengl_GL.context.vertexAttrib1f(index,v0);
};
lime_graphics_opengl_GL.vertexAttrib1fv = function(index,v) {
	lime_graphics_opengl_GL.context.vertexAttrib1fv(index,v);
};
lime_graphics_opengl_GL.vertexAttrib1fvWEBGL = function(index,v) {
	lime_graphics_opengl_GL.context.vertexAttrib1fv(index,v);
};
lime_graphics_opengl_GL.vertexAttrib2f = function(index,v0,v1) {
	lime_graphics_opengl_GL.context.vertexAttrib2f(index,v0,v1);
};
lime_graphics_opengl_GL.vertexAttrib2fv = function(index,v) {
	lime_graphics_opengl_GL.context.vertexAttrib2fv(index,v);
};
lime_graphics_opengl_GL.vertexAttrib2fvWEBGL = function(index,v) {
	lime_graphics_opengl_GL.context.vertexAttrib2fv(index,v);
};
lime_graphics_opengl_GL.vertexAttrib3f = function(index,v0,v1,v2) {
	lime_graphics_opengl_GL.context.vertexAttrib3f(index,v0,v1,v2);
};
lime_graphics_opengl_GL.vertexAttrib3fv = function(index,v) {
	lime_graphics_opengl_GL.context.vertexAttrib3fv(index,v);
};
lime_graphics_opengl_GL.vertexAttrib3fvWEBGL = function(index,v) {
	lime_graphics_opengl_GL.context.vertexAttrib3fv(index,v);
};
lime_graphics_opengl_GL.vertexAttrib4f = function(index,v0,v1,v2,v3) {
	lime_graphics_opengl_GL.context.vertexAttrib4f(index,v0,v1,v2,v3);
};
lime_graphics_opengl_GL.vertexAttrib4fv = function(index,v) {
	lime_graphics_opengl_GL.context.vertexAttrib4fv(index,v);
};
lime_graphics_opengl_GL.vertexAttrib4fvWEBGL = function(index,v) {
	lime_graphics_opengl_GL.context.vertexAttrib4fv(index,v);
};
lime_graphics_opengl_GL.vertexAttribDivisor = function(index,divisor) {
	lime_graphics_opengl_GL.context.vertexAttribDivisor(index,divisor);
};
lime_graphics_opengl_GL.vertexAttribI4i = function(index,v0,v1,v2,v3) {
	lime_graphics_opengl_GL.context.vertexAttribI4i(index,v0,v1,v2,v3);
};
lime_graphics_opengl_GL.vertexAttribI4iv = function(index,v) {
	lime_graphics_opengl_GL.context.vertexAttribI4iv(index,v);
};
lime_graphics_opengl_GL.vertexAttribI4ivWEBGL = function(index,v) {
	lime_graphics_opengl_GL.context.vertexAttribI4iv(index,v);
};
lime_graphics_opengl_GL.vertexAttribI4ui = function(index,v0,v1,v2,v3) {
	lime_graphics_opengl_GL.context.vertexAttribI4ui(index,v0,v1,v2,v3);
};
lime_graphics_opengl_GL.vertexAttribI4uiv = function(index,v) {
	lime_graphics_opengl_GL.context.vertexAttribI4uiv(index,v);
};
lime_graphics_opengl_GL.vertexAttribI4uivWEBGL = function(index,v) {
	lime_graphics_opengl_GL.context.vertexAttribI4uiv(index,v);
};
lime_graphics_opengl_GL.vertexAttribIPointer = function(index,size,type,stride,offset) {
	lime_graphics_opengl_GL.context.vertexAttribIPointer(index,size,type,stride,offset);
};
lime_graphics_opengl_GL.vertexAttribPointer = function(index,size,type,normalized,stride,offset) {
	lime_graphics_opengl_GL.context.vertexAttribPointer(index,size,type,normalized,stride,offset);
};
lime_graphics_opengl_GL.viewport = function(x,y,width,height) {
	lime_graphics_opengl_GL.context.viewport(x,y,width,height);
};
lime_graphics_opengl_GL.waitSync = function(sync,flags,timeout) {
	lime_graphics_opengl_GL.context.waitSync(sync,flags,timeout);
};
lime_graphics_opengl_GL.__getObjectID = function(object) {
	if(object == null) {
		return 0;
	} else {
		return object.id;
	}
};
var lime_graphics_opengl_GLProgram = {};
lime_graphics_opengl_GLProgram.fromSources = function(gl,vertexSource,fragmentSource) {
	var vertexShader = lime_graphics_opengl_GLShader.fromSource(gl,vertexSource,gl.VERTEX_SHADER);
	var fragmentShader = lime_graphics_opengl_GLShader.fromSource(gl,fragmentSource,gl.FRAGMENT_SHADER);
	var program = gl.createProgram();
	gl.attachShader(program,vertexShader);
	gl.attachShader(program,fragmentShader);
	gl.linkProgram(program);
	if(gl.getProgramParameter(program,35714) == 0) {
		var message = "Unable to initialize the shader program";
		message += "\n" + lime_graphics_opengl_GL.context.getProgramInfoLog(program);
		lime_utils_Log.error(message,{ fileName : "lime/graphics/opengl/GLProgram.hx", lineNumber : 39, className : "lime.graphics.opengl._GLProgram.GLProgram_Impl_", methodName : "fromSources"});
	}
	return program;
};
var lime_graphics_opengl_GLShader = {};
lime_graphics_opengl_GLShader.fromSource = function(gl,source,type) {
	var shader = gl.createShader(type);
	gl.shaderSource(shader,source);
	gl.compileShader(shader);
	if(gl.getShaderParameter(shader,gl.COMPILE_STATUS) == 0) {
		var message;
		if(type == gl.VERTEX_SHADER) {
			message = "Error compiling vertex shader";
		} else if(type == gl.FRAGMENT_SHADER) {
			message = "Error compiling fragment shader";
		} else {
			message = "Error compiling unknown shader type";
		}
		message += "\n" + gl.getShaderInfoLog(shader);
		lime_utils_Log.error(message,{ fileName : "lime/graphics/opengl/GLShader.hx", lineNumber : 40, className : "lime.graphics.opengl._GLShader.GLShader_Impl_", methodName : "fromSource"});
	}
	return shader;
};
var lime_graphics_opengl_ext_KHR_$debug = function() {
	this.STACK_UNDERFLOW = 1284;
	this.STACK_OVERFLOW = 1283;
	this.CONTEXT_FLAG_DEBUG_BIT = 2;
	this.DEBUG_OUTPUT = 37600;
	this.DEBUG_SEVERITY_LOW = 37192;
	this.DEBUG_SEVERITY_MEDIUM = 37191;
	this.DEBUG_SEVERITY_HIGH = 37190;
	this.DEBUG_LOGGED_MESSAGES = 37189;
	this.MAX_DEBUG_LOGGED_MESSAGES = 37188;
	this.MAX_DEBUG_MESSAGE_LENGTH = 37187;
	this.MAX_LABEL_LENGTH = 33512;
	this.SAMPLER = 33510;
	this.QUERY = 33507;
	this.PROGRAM = 33506;
	this.SHADER = 33505;
	this.BUFFER = 33504;
	this.DEBUG_GROUP_STACK_DEPTH = 33389;
	this.MAX_DEBUG_GROUP_STACK_DEPTH = 33388;
	this.DEBUG_SEVERITY_NOTIFICATION = 33387;
	this.DEBUG_TYPE_POP_GROUP = 33386;
	this.DEBUG_TYPE_PUSH_GROUP = 33385;
	this.DEBUG_TYPE_MARKER = 33384;
	this.DEBUG_TYPE_OTHER = 33361;
	this.DEBUG_TYPE_PERFORMANCE = 33360;
	this.DEBUG_TYPE_PORTABILITY = 33359;
	this.DEBUG_TYPE_UNDEFINED_BEHAVIOR = 33358;
	this.DEBUG_TYPE_DEPRECATED_BEHAVIOR = 33357;
	this.DEBUG_TYPE_ERROR = 33356;
	this.DEBUG_SOURCE_OTHER = 33355;
	this.DEBUG_SOURCE_APPLICATION = 33354;
	this.DEBUG_SOURCE_THIRD_PARTY = 33353;
	this.DEBUG_SOURCE_SHADER_COMPILER = 33352;
	this.DEBUG_SOURCE_WINDOW_SYSTEM = 33351;
	this.DEBUG_SOURCE_API = 33350;
	this.DEBUG_CALLBACK_USER_PARAM = 33349;
	this.DEBUG_CALLBACK_FUNCTION = 33348;
	this.DEBUG_NEXT_LOGGED_MESSAGE_LENGTH = 33347;
	this.DEBUG_OUTPUT_SYNCHRONOUS = 33346;
};
$hxClasses["lime.graphics.opengl.ext.KHR_debug"] = lime_graphics_opengl_ext_KHR_$debug;
lime_graphics_opengl_ext_KHR_$debug.__name__ = "lime.graphics.opengl.ext.KHR_debug";
lime_graphics_opengl_ext_KHR_$debug.prototype = {
	DEBUG_OUTPUT_SYNCHRONOUS: null
	,DEBUG_NEXT_LOGGED_MESSAGE_LENGTH: null
	,DEBUG_CALLBACK_FUNCTION: null
	,DEBUG_CALLBACK_USER_PARAM: null
	,DEBUG_SOURCE_API: null
	,DEBUG_SOURCE_WINDOW_SYSTEM: null
	,DEBUG_SOURCE_SHADER_COMPILER: null
	,DEBUG_SOURCE_THIRD_PARTY: null
	,DEBUG_SOURCE_APPLICATION: null
	,DEBUG_SOURCE_OTHER: null
	,DEBUG_TYPE_ERROR: null
	,DEBUG_TYPE_DEPRECATED_BEHAVIOR: null
	,DEBUG_TYPE_UNDEFINED_BEHAVIOR: null
	,DEBUG_TYPE_PORTABILITY: null
	,DEBUG_TYPE_PERFORMANCE: null
	,DEBUG_TYPE_OTHER: null
	,DEBUG_TYPE_MARKER: null
	,DEBUG_TYPE_PUSH_GROUP: null
	,DEBUG_TYPE_POP_GROUP: null
	,DEBUG_SEVERITY_NOTIFICATION: null
	,MAX_DEBUG_GROUP_STACK_DEPTH: null
	,DEBUG_GROUP_STACK_DEPTH: null
	,BUFFER: null
	,SHADER: null
	,PROGRAM: null
	,QUERY: null
	,SAMPLER: null
	,MAX_LABEL_LENGTH: null
	,MAX_DEBUG_MESSAGE_LENGTH: null
	,MAX_DEBUG_LOGGED_MESSAGES: null
	,DEBUG_LOGGED_MESSAGES: null
	,DEBUG_SEVERITY_HIGH: null
	,DEBUG_SEVERITY_MEDIUM: null
	,DEBUG_SEVERITY_LOW: null
	,DEBUG_OUTPUT: null
	,CONTEXT_FLAG_DEBUG_BIT: null
	,STACK_OVERFLOW: null
	,STACK_UNDERFLOW: null
	,__class__: lime_graphics_opengl_ext_KHR_$debug
};
var lime_math_ARGB = {};
lime_math_ARGB.__properties__ = {set_r:"set_r",get_r:"get_r",set_g:"set_g",get_g:"get_g",set_b:"set_b",get_b:"get_b",set_a:"set_a",get_a:"get_a"};
lime_math_ARGB.a16 = null;
lime_math_ARGB.unmult = null;
lime_math_ARGB._new = function(argb) {
	if(argb == null) {
		argb = 0;
	}
	var this1 = argb;
	return this1;
};
lime_math_ARGB.create = function(a,r,g,b) {
	var this1 = 0;
	var argb = this1;
	argb = (a & 255) << 24 | (r & 255) << 16 | (g & 255) << 8 | b & 255;
	return argb;
};
lime_math_ARGB.multiplyAlpha = function(this1) {
	if((this1 >>> 24 & 255) == 0) {
		this1 = 0;
	} else if((this1 >>> 24 & 255) != 255) {
		lime_math_ARGB.a16 = lime_math_RGBA.__alpha16[this1 >>> 24 & 255];
		this1 = (this1 >>> 24 & 255 & 255) << 24 | ((this1 >>> 16 & 255) * lime_math_ARGB.a16 >> 16 & 255) << 16 | ((this1 >>> 8 & 255) * lime_math_ARGB.a16 >> 16 & 255) << 8 | (this1 & 255) * lime_math_ARGB.a16 >> 16 & 255;
	}
};
lime_math_ARGB.readUInt8 = function(this1,data,offset,format,premultiplied) {
	if(premultiplied == null) {
		premultiplied = false;
	}
	if(format == null) {
		format = 0;
	}
	switch(format) {
	case 0:
		this1 = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255;
		break;
	case 1:
		this1 = (data[offset + 2] & 255) << 24 | (data[offset + 3] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 1] & 255;
		break;
	case 2:
		this1 = (data[offset + 1] & 255) << 24 | (data[offset] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset + 2] & 255;
		break;
	}
	if(premultiplied) {
		if((this1 >>> 24 & 255) != 0 && (this1 >>> 24 & 255) != 255) {
			lime_math_ARGB.unmult = 255.0 / (this1 >>> 24 & 255);
			this1 = (this1 >>> 24 & 255 & 255) << 24 | (lime_math_RGBA.__clamp[Math.floor((this1 >>> 16 & 255) * lime_math_ARGB.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.floor((this1 >>> 8 & 255) * lime_math_ARGB.unmult)] & 255) << 8 | lime_math_RGBA.__clamp[Math.floor((this1 & 255) * lime_math_ARGB.unmult)] & 255;
		}
	}
};
lime_math_ARGB.set = function(this1,a,r,g,b) {
	this1 = (a & 255) << 24 | (r & 255) << 16 | (g & 255) << 8 | b & 255;
};
lime_math_ARGB.unmultiplyAlpha = function(this1) {
	if((this1 >>> 24 & 255) != 0 && (this1 >>> 24 & 255) != 255) {
		lime_math_ARGB.unmult = 255.0 / (this1 >>> 24 & 255);
		this1 = (this1 >>> 24 & 255 & 255) << 24 | (lime_math_RGBA.__clamp[Math.floor((this1 >>> 16 & 255) * lime_math_ARGB.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.floor((this1 >>> 8 & 255) * lime_math_ARGB.unmult)] & 255) << 8 | lime_math_RGBA.__clamp[Math.floor((this1 & 255) * lime_math_ARGB.unmult)] & 255;
	}
};
lime_math_ARGB.writeUInt8 = function(this1,data,offset,format,premultiplied) {
	if(premultiplied == null) {
		premultiplied = false;
	}
	if(format == null) {
		format = 0;
	}
	if(premultiplied) {
		if((this1 >>> 24 & 255) == 0) {
			this1 = 0;
		} else if((this1 >>> 24 & 255) != 255) {
			lime_math_ARGB.a16 = lime_math_RGBA.__alpha16[this1 >>> 24 & 255];
			this1 = (this1 >>> 24 & 255 & 255) << 24 | ((this1 >>> 16 & 255) * lime_math_ARGB.a16 >> 16 & 255) << 16 | ((this1 >>> 8 & 255) * lime_math_ARGB.a16 >> 16 & 255) << 8 | (this1 & 255) * lime_math_ARGB.a16 >> 16 & 255;
		}
	}
	switch(format) {
	case 0:
		data[offset] = this1 >>> 16 & 255;
		data[offset + 1] = this1 >>> 8 & 255;
		data[offset + 2] = this1 & 255;
		data[offset + 3] = this1 >>> 24 & 255;
		break;
	case 1:
		data[offset] = this1 >>> 24 & 255;
		data[offset + 1] = this1 >>> 16 & 255;
		data[offset + 2] = this1 >>> 8 & 255;
		data[offset + 3] = this1 & 255;
		break;
	case 2:
		data[offset] = this1 & 255;
		data[offset + 1] = this1 >>> 8 & 255;
		data[offset + 2] = this1 >>> 16 & 255;
		data[offset + 3] = this1 >>> 24 & 255;
		break;
	}
};
lime_math_ARGB.__fromBGRA = function(bgra) {
	var this1 = 0;
	var argb = this1;
	argb = (bgra & 255 & 255) << 24 | (bgra >>> 8 & 255 & 255) << 16 | (bgra >>> 16 & 255 & 255) << 8 | bgra >>> 24 & 255 & 255;
	return argb;
};
lime_math_ARGB.__fromRGBA = function(rgba) {
	var this1 = 0;
	var argb = this1;
	argb = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
	return argb;
};
lime_math_ARGB.get_a = function(this1) {
	return this1 >>> 24 & 255;
};
lime_math_ARGB.set_a = function(this1,value) {
	this1 = (value & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | this1 & 255 & 255;
	return value;
};
lime_math_ARGB.get_b = function(this1) {
	return this1 & 255;
};
lime_math_ARGB.set_b = function(this1,value) {
	this1 = (this1 >>> 24 & 255 & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | value & 255;
	return value;
};
lime_math_ARGB.get_g = function(this1) {
	return this1 >>> 8 & 255;
};
lime_math_ARGB.set_g = function(this1,value) {
	this1 = (this1 >>> 24 & 255 & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (value & 255) << 8 | this1 & 255 & 255;
	return value;
};
lime_math_ARGB.get_r = function(this1) {
	return this1 >>> 16 & 255;
};
lime_math_ARGB.set_r = function(this1,value) {
	this1 = (this1 >>> 24 & 255 & 255) << 24 | (value & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | this1 & 255 & 255;
	return value;
};
var lime_math_BGRA = {};
lime_math_BGRA.__properties__ = {set_r:"set_r",get_r:"get_r",set_g:"set_g",get_g:"get_g",set_b:"set_b",get_b:"get_b",set_a:"set_a",get_a:"get_a"};
lime_math_BGRA.a16 = null;
lime_math_BGRA.unmult = null;
lime_math_BGRA._new = function(bgra) {
	if(bgra == null) {
		bgra = 0;
	}
	var this1 = bgra;
	return this1;
};
lime_math_BGRA.create = function(b,g,r,a) {
	var this1 = 0;
	var bgra = this1;
	bgra = (b & 255) << 24 | (g & 255) << 16 | (r & 255) << 8 | a & 255;
	return bgra;
};
lime_math_BGRA.multiplyAlpha = function(this1) {
	if((this1 & 255) == 0) {
		this1 = 0;
	} else if((this1 & 255) != 255) {
		lime_math_BGRA.a16 = lime_math_RGBA.__alpha16[this1 & 255];
		this1 = ((this1 >>> 24 & 255) * lime_math_BGRA.a16 >> 16 & 255) << 24 | ((this1 >>> 16 & 255) * lime_math_BGRA.a16 >> 16 & 255) << 16 | ((this1 >>> 8 & 255) * lime_math_BGRA.a16 >> 16 & 255) << 8 | this1 & 255 & 255;
	}
};
lime_math_BGRA.readUInt8 = function(this1,data,offset,format,premultiplied) {
	if(premultiplied == null) {
		premultiplied = false;
	}
	if(format == null) {
		format = 0;
	}
	switch(format) {
	case 0:
		this1 = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255;
		break;
	case 1:
		this1 = (data[offset + 3] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 1] & 255) << 8 | data[offset] & 255;
		break;
	case 2:
		this1 = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255;
		break;
	}
	if(premultiplied) {
		if((this1 & 255) != 0 && (this1 & 255) != 255) {
			lime_math_BGRA.unmult = 255.0 / (this1 & 255);
			this1 = (lime_math_RGBA.__clamp[Math.floor((this1 >>> 24 & 255) * lime_math_BGRA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.floor((this1 >>> 16 & 255) * lime_math_BGRA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.floor((this1 >>> 8 & 255) * lime_math_BGRA.unmult)] & 255) << 8 | this1 & 255 & 255;
		}
	}
};
lime_math_BGRA.set = function(this1,b,g,r,a) {
	this1 = (b & 255) << 24 | (g & 255) << 16 | (r & 255) << 8 | a & 255;
};
lime_math_BGRA.unmultiplyAlpha = function(this1) {
	if((this1 & 255) != 0 && (this1 & 255) != 255) {
		lime_math_BGRA.unmult = 255.0 / (this1 & 255);
		this1 = (lime_math_RGBA.__clamp[Math.floor((this1 >>> 24 & 255) * lime_math_BGRA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.floor((this1 >>> 16 & 255) * lime_math_BGRA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.floor((this1 >>> 8 & 255) * lime_math_BGRA.unmult)] & 255) << 8 | this1 & 255 & 255;
	}
};
lime_math_BGRA.writeUInt8 = function(this1,data,offset,format,premultiplied) {
	if(premultiplied == null) {
		premultiplied = false;
	}
	if(format == null) {
		format = 0;
	}
	if(premultiplied) {
		if((this1 & 255) == 0) {
			this1 = 0;
		} else if((this1 & 255) != 255) {
			lime_math_BGRA.a16 = lime_math_RGBA.__alpha16[this1 & 255];
			this1 = ((this1 >>> 24 & 255) * lime_math_BGRA.a16 >> 16 & 255) << 24 | ((this1 >>> 16 & 255) * lime_math_BGRA.a16 >> 16 & 255) << 16 | ((this1 >>> 8 & 255) * lime_math_BGRA.a16 >> 16 & 255) << 8 | this1 & 255 & 255;
		}
	}
	switch(format) {
	case 0:
		data[offset] = this1 >>> 8 & 255;
		data[offset + 1] = this1 >>> 16 & 255;
		data[offset + 2] = this1 >>> 24 & 255;
		data[offset + 3] = this1 & 255;
		break;
	case 1:
		data[offset] = this1 & 255;
		data[offset + 1] = this1 >>> 8 & 255;
		data[offset + 2] = this1 >>> 16 & 255;
		data[offset + 3] = this1 >>> 24 & 255;
		break;
	case 2:
		data[offset] = this1 >>> 24 & 255;
		data[offset + 1] = this1 >>> 16 & 255;
		data[offset + 2] = this1 >>> 8 & 255;
		data[offset + 3] = this1 & 255;
		break;
	}
};
lime_math_BGRA.__fromARGB = function(argb) {
	var this1 = 0;
	var bgra = this1;
	bgra = (argb & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb >>> 16 & 255 & 255) << 8 | argb >>> 24 & 255 & 255;
	return bgra;
};
lime_math_BGRA.__fromRGBA = function(rgba) {
	var this1 = 0;
	var bgra = this1;
	bgra = (rgba >>> 8 & 255 & 255) << 24 | (rgba >>> 16 & 255 & 255) << 16 | (rgba >>> 24 & 255 & 255) << 8 | rgba & 255 & 255;
	return bgra;
};
lime_math_BGRA.get_a = function(this1) {
	return this1 & 255;
};
lime_math_BGRA.set_a = function(this1,value) {
	this1 = (this1 >>> 24 & 255 & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | value & 255;
	return value;
};
lime_math_BGRA.get_b = function(this1) {
	return this1 >>> 24 & 255;
};
lime_math_BGRA.set_b = function(this1,value) {
	this1 = (value & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | this1 & 255 & 255;
	return value;
};
lime_math_BGRA.get_g = function(this1) {
	return this1 >>> 16 & 255;
};
lime_math_BGRA.set_g = function(this1,value) {
	this1 = (this1 >>> 24 & 255 & 255) << 24 | (value & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | this1 & 255 & 255;
	return value;
};
lime_math_BGRA.get_r = function(this1) {
	return this1 >>> 8 & 255;
};
lime_math_BGRA.set_r = function(this1,value) {
	this1 = (this1 >>> 24 & 255 & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (value & 255) << 8 | this1 & 255 & 255;
	return value;
};
var lime_math_ColorMatrix = {};
lime_math_ColorMatrix.__properties__ = {set_redOffset:"set_redOffset",get_redOffset:"get_redOffset",set_redMultiplier:"set_redMultiplier",get_redMultiplier:"get_redMultiplier",set_greenOffset:"set_greenOffset",get_greenOffset:"get_greenOffset",set_greenMultiplier:"set_greenMultiplier",get_greenMultiplier:"get_greenMultiplier",set_color:"set_color",get_color:"get_color",set_blueOffset:"set_blueOffset",get_blueOffset:"get_blueOffset",set_blueMultiplier:"set_blueMultiplier",get_blueMultiplier:"get_blueMultiplier",set_alphaOffset:"set_alphaOffset",get_alphaOffset:"get_alphaOffset",set_alphaMultiplier:"set_alphaMultiplier",get_alphaMultiplier:"get_alphaMultiplier"};
lime_math_ColorMatrix.__alphaTable = null;
lime_math_ColorMatrix.__blueTable = null;
lime_math_ColorMatrix.__greenTable = null;
lime_math_ColorMatrix.__redTable = null;
lime_math_ColorMatrix._new = function(data) {
	var this1;
	if(data != null && data.length == 20) {
		this1 = data;
	} else {
		var elements = null;
		var array = lime_math_ColorMatrix.__identity;
		var vector = null;
		var view = null;
		var buffer = null;
		var len = null;
		var this2;
		if(elements != null) {
			this2 = new Float32Array(elements);
		} else if(array != null) {
			this2 = new Float32Array(array);
		} else if(vector != null) {
			this2 = new Float32Array(vector.__array);
		} else if(view != null) {
			this2 = new Float32Array(view);
		} else if(buffer != null) {
			if(len == null) {
				this2 = new Float32Array(buffer,0);
			} else {
				this2 = new Float32Array(buffer,0,len);
			}
		} else {
			this2 = null;
		}
		this1 = this2;
	}
	return this1;
};
lime_math_ColorMatrix.clone = function(this1) {
	var elements = null;
	var array = null;
	var vector = null;
	var view = lime_utils_Float32Array.toArrayBufferView(this1);
	var buffer = null;
	var len = null;
	var this1;
	if(elements != null) {
		this1 = new Float32Array(elements);
	} else if(array != null) {
		this1 = new Float32Array(array);
	} else if(vector != null) {
		this1 = new Float32Array(vector.__array);
	} else if(view != null) {
		this1 = new Float32Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Float32Array(buffer,0);
		} else {
			this1 = new Float32Array(buffer,0,len);
		}
	} else {
		this1 = null;
	}
	return lime_math_ColorMatrix._new(this1);
};
lime_math_ColorMatrix.concat = function(this1,second) {
	this1[0] += second[0];
	this1[6] += second[6];
	this1[12] += second[12];
	this1[18] += second[18];
};
lime_math_ColorMatrix.copyFrom = function(this1,other) {
	this1.set(other);
};
lime_math_ColorMatrix.identity = function(this1) {
	this1[0] = 1;
	this1[1] = 0;
	this1[2] = 0;
	this1[3] = 0;
	this1[4] = 0;
	this1[5] = 0;
	this1[6] = 1;
	this1[7] = 0;
	this1[8] = 0;
	this1[9] = 0;
	this1[10] = 0;
	this1[11] = 0;
	this1[12] = 1;
	this1[13] = 0;
	this1[14] = 0;
	this1[15] = 0;
	this1[16] = 0;
	this1[17] = 0;
	this1[18] = 1;
	this1[19] = 0;
};
lime_math_ColorMatrix.getAlphaTable = function(this1) {
	if(lime_math_ColorMatrix.__alphaTable == null) {
		var array = null;
		var vector = null;
		var view = null;
		var buffer = null;
		var len = null;
		var this2 = new Uint8Array(256);
		lime_math_ColorMatrix.__alphaTable = this2;
	}
	var value;
	lime_math_ColorMatrix.__alphaTable[0] = 0;
	var _g = 1;
	while(_g < 256) {
		var i = _g++;
		value = Math.floor(i * this1[18] + this1[19] * 255);
		if(value > 255) {
			value = 255;
		}
		if(value < 0) {
			value = 0;
		}
		lime_math_ColorMatrix.__alphaTable[i] = value;
	}
	return lime_math_ColorMatrix.__alphaTable;
};
lime_math_ColorMatrix.getBlueTable = function(this1) {
	if(lime_math_ColorMatrix.__blueTable == null) {
		var array = null;
		var vector = null;
		var view = null;
		var buffer = null;
		var len = null;
		var this2 = new Uint8Array(256);
		lime_math_ColorMatrix.__blueTable = this2;
	}
	var value;
	var _g = 0;
	while(_g < 256) {
		var i = _g++;
		value = Math.floor(i * this1[12] + this1[14] * 255);
		if(value > 255) {
			value = 255;
		}
		if(value < 0) {
			value = 0;
		}
		lime_math_ColorMatrix.__blueTable[i] = value;
	}
	return lime_math_ColorMatrix.__blueTable;
};
lime_math_ColorMatrix.getGreenTable = function(this1) {
	if(lime_math_ColorMatrix.__greenTable == null) {
		var array = null;
		var vector = null;
		var view = null;
		var buffer = null;
		var len = null;
		var this2 = new Uint8Array(256);
		lime_math_ColorMatrix.__greenTable = this2;
	}
	var value;
	var _g = 0;
	while(_g < 256) {
		var i = _g++;
		value = Math.floor(i * this1[6] + this1[9] * 255);
		if(value > 255) {
			value = 255;
		}
		if(value < 0) {
			value = 0;
		}
		lime_math_ColorMatrix.__greenTable[i] = value;
	}
	return lime_math_ColorMatrix.__greenTable;
};
lime_math_ColorMatrix.getRedTable = function(this1) {
	if(lime_math_ColorMatrix.__redTable == null) {
		var array = null;
		var vector = null;
		var view = null;
		var buffer = null;
		var len = null;
		var this2 = new Uint8Array(256);
		lime_math_ColorMatrix.__redTable = this2;
	}
	var value;
	var _g = 0;
	while(_g < 256) {
		var i = _g++;
		value = Math.floor(i * this1[0] + this1[4] * 255);
		if(value > 255) {
			value = 255;
		}
		if(value < 0) {
			value = 0;
		}
		lime_math_ColorMatrix.__redTable[i] = value;
	}
	return lime_math_ColorMatrix.__redTable;
};
lime_math_ColorMatrix.__toFlashColorTransform = function(this1) {
	return null;
};
lime_math_ColorMatrix.get_alphaMultiplier = function(this1) {
	return this1[18];
};
lime_math_ColorMatrix.set_alphaMultiplier = function(this1,value) {
	return this1[18] = value;
};
lime_math_ColorMatrix.get_alphaOffset = function(this1) {
	return this1[19] * 255;
};
lime_math_ColorMatrix.set_alphaOffset = function(this1,value) {
	return this1[19] = value / 255;
};
lime_math_ColorMatrix.get_blueMultiplier = function(this1) {
	return this1[12];
};
lime_math_ColorMatrix.set_blueMultiplier = function(this1,value) {
	return this1[12] = value;
};
lime_math_ColorMatrix.get_blueOffset = function(this1) {
	return this1[14] * 255;
};
lime_math_ColorMatrix.set_blueOffset = function(this1,value) {
	return this1[14] = value / 255;
};
lime_math_ColorMatrix.get_color = function(this1) {
	return (this1[4] * 255 | 0) << 16 | (this1[9] * 255 | 0) << 8 | (this1[14] * 255 | 0);
};
lime_math_ColorMatrix.set_color = function(this1,value) {
	this1[4] = (value >> 16 & 255) / 255;
	this1[9] = (value >> 8 & 255) / 255;
	this1[14] = (value & 255) / 255;
	this1[0] = 0;
	this1[6] = 0;
	this1[12] = 0;
	return lime_math_ColorMatrix.get_color(this1);
};
lime_math_ColorMatrix.get_greenMultiplier = function(this1) {
	return this1[6];
};
lime_math_ColorMatrix.set_greenMultiplier = function(this1,value) {
	return this1[6] = value;
};
lime_math_ColorMatrix.get_greenOffset = function(this1) {
	return this1[9] * 255;
};
lime_math_ColorMatrix.set_greenOffset = function(this1,value) {
	return this1[9] = value / 255;
};
lime_math_ColorMatrix.get_redMultiplier = function(this1) {
	return this1[0];
};
lime_math_ColorMatrix.set_redMultiplier = function(this1,value) {
	return this1[0] = value;
};
lime_math_ColorMatrix.get_redOffset = function(this1) {
	return this1[4] * 255;
};
lime_math_ColorMatrix.set_redOffset = function(this1,value) {
	return this1[4] = value / 255;
};
lime_math_ColorMatrix.get = function(this1,index) {
	return this1[index];
};
lime_math_ColorMatrix.set = function(this1,index,value) {
	return this1[index] = value;
};
var lime_math_Matrix4 = {};
lime_math_Matrix4.__properties__ = {set_position:"set_position",get_position:"get_position",get_determinant:"get_determinant"};
lime_math_Matrix4._new = function(data) {
	var this1;
	if(data != null && data.length == 16) {
		this1 = data;
	} else {
		var elements = null;
		var array = lime_math_Matrix4.__identity;
		var vector = null;
		var view = null;
		var buffer = null;
		var len = null;
		var this2;
		if(elements != null) {
			this2 = new Float32Array(elements);
		} else if(array != null) {
			this2 = new Float32Array(array);
		} else if(vector != null) {
			this2 = new Float32Array(vector.__array);
		} else if(view != null) {
			this2 = new Float32Array(view);
		} else if(buffer != null) {
			if(len == null) {
				this2 = new Float32Array(buffer,0);
			} else {
				this2 = new Float32Array(buffer,0,len);
			}
		} else {
			this2 = null;
		}
		this1 = this2;
	}
	return this1;
};
lime_math_Matrix4.append = function(this1,lhs) {
	var m111 = this1[0];
	var m121 = this1[4];
	var m131 = this1[8];
	var m141 = this1[12];
	var m112 = this1[1];
	var m122 = this1[5];
	var m132 = this1[9];
	var m142 = this1[13];
	var m113 = this1[2];
	var m123 = this1[6];
	var m133 = this1[10];
	var m143 = this1[14];
	var m114 = this1[3];
	var m124 = this1[7];
	var m134 = this1[11];
	var m144 = this1[15];
	var m211 = lime_math_Matrix4.get(lhs,0);
	var m221 = lime_math_Matrix4.get(lhs,4);
	var m231 = lime_math_Matrix4.get(lhs,8);
	var m241 = lime_math_Matrix4.get(lhs,12);
	var m212 = lime_math_Matrix4.get(lhs,1);
	var m222 = lime_math_Matrix4.get(lhs,5);
	var m232 = lime_math_Matrix4.get(lhs,9);
	var m242 = lime_math_Matrix4.get(lhs,13);
	var m213 = lime_math_Matrix4.get(lhs,2);
	var m223 = lime_math_Matrix4.get(lhs,6);
	var m233 = lime_math_Matrix4.get(lhs,10);
	var m243 = lime_math_Matrix4.get(lhs,14);
	var m214 = lime_math_Matrix4.get(lhs,3);
	var m224 = lime_math_Matrix4.get(lhs,7);
	var m234 = lime_math_Matrix4.get(lhs,11);
	var m244 = lime_math_Matrix4.get(lhs,15);
	this1[0] = m111 * m211 + m112 * m221 + m113 * m231 + m114 * m241;
	this1[1] = m111 * m212 + m112 * m222 + m113 * m232 + m114 * m242;
	this1[2] = m111 * m213 + m112 * m223 + m113 * m233 + m114 * m243;
	this1[3] = m111 * m214 + m112 * m224 + m113 * m234 + m114 * m244;
	this1[4] = m121 * m211 + m122 * m221 + m123 * m231 + m124 * m241;
	this1[5] = m121 * m212 + m122 * m222 + m123 * m232 + m124 * m242;
	this1[6] = m121 * m213 + m122 * m223 + m123 * m233 + m124 * m243;
	this1[7] = m121 * m214 + m122 * m224 + m123 * m234 + m124 * m244;
	this1[8] = m131 * m211 + m132 * m221 + m133 * m231 + m134 * m241;
	this1[9] = m131 * m212 + m132 * m222 + m133 * m232 + m134 * m242;
	this1[10] = m131 * m213 + m132 * m223 + m133 * m233 + m134 * m243;
	this1[11] = m131 * m214 + m132 * m224 + m133 * m234 + m134 * m244;
	this1[12] = m141 * m211 + m142 * m221 + m143 * m231 + m144 * m241;
	this1[13] = m141 * m212 + m142 * m222 + m143 * m232 + m144 * m242;
	this1[14] = m141 * m213 + m142 * m223 + m143 * m233 + m144 * m243;
	this1[15] = m141 * m214 + m142 * m224 + m143 * m234 + m144 * m244;
};
lime_math_Matrix4.appendRotation = function(this1,degrees,axis,pivotPoint) {
	var m = lime_math_Matrix4.__getAxisRotation(this1,axis.x,axis.y,axis.z,degrees);
	if(pivotPoint != null) {
		var p = pivotPoint;
		lime_math_Matrix4.appendTranslation(m,p.x,p.y,p.z);
	}
	lime_math_Matrix4.append(this1,m);
};
lime_math_Matrix4.appendScale = function(this1,xScale,yScale,zScale) {
	var elements = null;
	var array = [xScale,0.0,0.0,0.0,0.0,yScale,0.0,0.0,0.0,0.0,zScale,0.0,0.0,0.0,0.0,1.0];
	var vector = null;
	var view = null;
	var buffer = null;
	var len = null;
	var this2;
	if(elements != null) {
		this2 = new Float32Array(elements);
	} else if(array != null) {
		this2 = new Float32Array(array);
	} else if(vector != null) {
		this2 = new Float32Array(vector.__array);
	} else if(view != null) {
		this2 = new Float32Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this2 = new Float32Array(buffer,0);
		} else {
			this2 = new Float32Array(buffer,0,len);
		}
	} else {
		this2 = null;
	}
	lime_math_Matrix4.append(this1,lime_math_Matrix4._new(this2));
};
lime_math_Matrix4.appendTranslation = function(this1,x,y,z) {
	this1[12] += x;
	this1[13] += y;
	this1[14] += z;
};
lime_math_Matrix4.clone = function(this1) {
	var elements = null;
	var array = null;
	var vector = null;
	var view = lime_utils_Float32Array.toArrayBufferView(this1);
	var buffer = null;
	var len = null;
	var this1;
	if(elements != null) {
		this1 = new Float32Array(elements);
	} else if(array != null) {
		this1 = new Float32Array(array);
	} else if(vector != null) {
		this1 = new Float32Array(vector.__array);
	} else if(view != null) {
		this1 = new Float32Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Float32Array(buffer,0);
		} else {
			this1 = new Float32Array(buffer,0,len);
		}
	} else {
		this1 = null;
	}
	return lime_math_Matrix4._new(this1);
};
lime_math_Matrix4.copyColumnFrom = function(this1,column,vector) {
	switch(column) {
	case 0:
		this1[0] = vector.x;
		this1[1] = vector.y;
		this1[2] = vector.z;
		this1[3] = vector.w;
		break;
	case 1:
		this1[4] = vector.x;
		this1[5] = vector.y;
		this1[6] = vector.z;
		this1[7] = vector.w;
		break;
	case 2:
		this1[8] = vector.x;
		this1[9] = vector.y;
		this1[10] = vector.z;
		this1[11] = vector.w;
		break;
	case 3:
		this1[12] = vector.x;
		this1[13] = vector.y;
		this1[14] = vector.z;
		this1[15] = vector.w;
		break;
	default:
		lime_utils_Log.error("Column " + column + " out of bounds [0, ..., 3]",{ fileName : "lime/math/Matrix4.hx", lineNumber : 187, className : "lime.math._Matrix4.Matrix4_Impl_", methodName : "copyColumnFrom"});
	}
};
lime_math_Matrix4.copyColumnTo = function(this1,column,vector) {
	switch(column) {
	case 0:
		vector.x = this1[0];
		vector.y = this1[1];
		vector.z = this1[2];
		vector.w = this1[3];
		break;
	case 1:
		vector.x = this1[4];
		vector.y = this1[5];
		vector.z = this1[6];
		vector.w = this1[7];
		break;
	case 2:
		vector.x = this1[8];
		vector.y = this1[9];
		vector.z = this1[10];
		vector.w = this1[11];
		break;
	case 3:
		vector.x = this1[12];
		vector.y = this1[13];
		vector.z = this1[14];
		vector.w = this1[15];
		break;
	default:
		lime_utils_Log.error("Column " + column + " out of bounds [0, ..., 3]",{ fileName : "lime/math/Matrix4.hx", lineNumber : 225, className : "lime.math._Matrix4.Matrix4_Impl_", methodName : "copyColumnTo"});
	}
};
lime_math_Matrix4.copyFrom = function(this1,other) {
	this1.set(other);
};
lime_math_Matrix4.copyRowFrom = function(this1,row,vector) {
	switch(row) {
	case 0:
		this1[0] = vector.x;
		this1[4] = vector.y;
		this1[8] = vector.z;
		this1[12] = vector.w;
		break;
	case 1:
		this1[1] = vector.x;
		this1[5] = vector.y;
		this1[9] = vector.z;
		this1[13] = vector.w;
		break;
	case 2:
		this1[2] = vector.x;
		this1[6] = vector.y;
		this1[10] = vector.z;
		this1[14] = vector.w;
		break;
	case 3:
		this1[3] = vector.x;
		this1[7] = vector.y;
		this1[11] = vector.z;
		this1[15] = vector.w;
		break;
	default:
		lime_utils_Log.error("Row " + row + " out of bounds [0, ..., 3]",{ fileName : "lime/math/Matrix4.hx", lineNumber : 272, className : "lime.math._Matrix4.Matrix4_Impl_", methodName : "copyRowFrom"});
	}
};
lime_math_Matrix4.copyRowTo = function(this1,row,vector) {
	switch(row) {
	case 0:
		vector.x = this1[0];
		vector.y = this1[4];
		vector.z = this1[8];
		vector.w = this1[12];
		break;
	case 1:
		vector.x = this1[1];
		vector.y = this1[5];
		vector.z = this1[9];
		vector.w = this1[13];
		break;
	case 2:
		vector.x = this1[2];
		vector.y = this1[6];
		vector.z = this1[10];
		vector.w = this1[14];
		break;
	case 3:
		vector.x = this1[3];
		vector.y = this1[7];
		vector.z = this1[11];
		vector.w = this1[15];
		break;
	default:
		lime_utils_Log.error("Row " + row + " out of bounds [0, ..., 3]",{ fileName : "lime/math/Matrix4.hx", lineNumber : 310, className : "lime.math._Matrix4.Matrix4_Impl_", methodName : "copyRowTo"});
	}
};
lime_math_Matrix4.create2D = function(this1,a,b,c,d,tx,ty) {
	if(ty == null) {
		ty = 0;
	}
	if(tx == null) {
		tx = 0;
	}
	this1[0] = a;
	this1[1] = b;
	this1[2] = 0;
	this1[3] = 0;
	this1[4] = c;
	this1[5] = d;
	this1[6] = 0;
	this1[7] = 0;
	this1[8] = 0;
	this1[9] = 0;
	this1[10] = 1;
	this1[11] = 0;
	this1[12] = tx;
	this1[13] = ty;
	this1[14] = 0;
	this1[15] = 1;
};
lime_math_Matrix4.createOrtho = function(this1,left,right,bottom,top,zNear,zFar) {
	var sx = 1.0 / (right - left);
	var sy = 1.0 / (top - bottom);
	var sz = 1.0 / (zFar - zNear);
	this1[0] = 2 * sx;
	this1[1] = 0;
	this1[2] = 0;
	this1[3] = 0;
	this1[4] = 0;
	this1[5] = 2 * sy;
	this1[6] = 0;
	this1[7] = 0;
	this1[8] = 0;
	this1[9] = 0;
	this1[10] = -2 * sz;
	this1[11] = 0;
	this1[12] = -(left + right) * sx;
	this1[13] = -(bottom + top) * sy;
	this1[14] = -(zNear + zFar) * sz;
	this1[15] = 1;
};
lime_math_Matrix4.deltaTransformVector = function(this1,v,result) {
	if(result == null) {
		result = new lime_math_Vector4();
	}
	var x = v.x;
	var y = v.y;
	var z = v.z;
	result.x = x * this1[0] + y * this1[4] + z * this1[8] + this1[3];
	result.y = x * this1[1] + y * this1[5] + z * this1[9] + this1[7];
	result.z = x * this1[2] + y * this1[6] + z * this1[10] + this1[11];
	return result;
};
lime_math_Matrix4.fromMatrix3 = function(matrix3) {
	var mat = lime_math_Matrix4._new();
	lime_math_Matrix4.create2D(mat,matrix3.a,matrix3.b,matrix3.c,matrix3.d,matrix3.tx,matrix3.ty);
	return mat;
};
lime_math_Matrix4.identity = function(this1) {
	this1[0] = 1;
	this1[1] = 0;
	this1[2] = 0;
	this1[3] = 0;
	this1[4] = 0;
	this1[5] = 1;
	this1[6] = 0;
	this1[7] = 0;
	this1[8] = 0;
	this1[9] = 0;
	this1[10] = 1;
	this1[11] = 0;
	this1[12] = 0;
	this1[13] = 0;
	this1[14] = 0;
	this1[15] = 1;
};
lime_math_Matrix4.interpolate = function(thisMat,toMat,percent,result) {
	if(result == null) {
		result = lime_math_Matrix4._new();
	}
	var _g = 0;
	while(_g < 16) {
		var i = _g++;
		lime_math_Matrix4.set(result,i,lime_math_Matrix4.get(thisMat,i) + (lime_math_Matrix4.get(toMat,i) - lime_math_Matrix4.get(thisMat,i)) * percent);
	}
	return result;
};
lime_math_Matrix4.interpolateTo = function(this1,toMat,percent) {
	var _g = 0;
	while(_g < 16) {
		var i = _g++;
		this1[i] += (lime_math_Matrix4.get(toMat,i) - this1[i]) * percent;
	}
};
lime_math_Matrix4.invert = function(this1) {
	var d = lime_math_Matrix4.get_determinant(this1);
	var invertable = Math.abs(d) > 0.00000000001;
	if(invertable) {
		d = 1 / d;
		var m11 = this1[0];
		var m21 = this1[4];
		var m31 = this1[8];
		var m41 = this1[12];
		var m12 = this1[1];
		var m22 = this1[5];
		var m32 = this1[9];
		var m42 = this1[13];
		var m13 = this1[2];
		var m23 = this1[6];
		var m33 = this1[10];
		var m43 = this1[14];
		var m14 = this1[3];
		var m24 = this1[7];
		var m34 = this1[11];
		var m44 = this1[15];
		this1[0] = d * (m22 * (m33 * m44 - m43 * m34) - m32 * (m23 * m44 - m43 * m24) + m42 * (m23 * m34 - m33 * m24));
		this1[1] = -d * (m12 * (m33 * m44 - m43 * m34) - m32 * (m13 * m44 - m43 * m14) + m42 * (m13 * m34 - m33 * m14));
		this1[2] = d * (m12 * (m23 * m44 - m43 * m24) - m22 * (m13 * m44 - m43 * m14) + m42 * (m13 * m24 - m23 * m14));
		this1[3] = -d * (m12 * (m23 * m34 - m33 * m24) - m22 * (m13 * m34 - m33 * m14) + m32 * (m13 * m24 - m23 * m14));
		this1[4] = -d * (m21 * (m33 * m44 - m43 * m34) - m31 * (m23 * m44 - m43 * m24) + m41 * (m23 * m34 - m33 * m24));
		this1[5] = d * (m11 * (m33 * m44 - m43 * m34) - m31 * (m13 * m44 - m43 * m14) + m41 * (m13 * m34 - m33 * m14));
		this1[6] = -d * (m11 * (m23 * m44 - m43 * m24) - m21 * (m13 * m44 - m43 * m14) + m41 * (m13 * m24 - m23 * m14));
		this1[7] = d * (m11 * (m23 * m34 - m33 * m24) - m21 * (m13 * m34 - m33 * m14) + m31 * (m13 * m24 - m23 * m14));
		this1[8] = d * (m21 * (m32 * m44 - m42 * m34) - m31 * (m22 * m44 - m42 * m24) + m41 * (m22 * m34 - m32 * m24));
		this1[9] = -d * (m11 * (m32 * m44 - m42 * m34) - m31 * (m12 * m44 - m42 * m14) + m41 * (m12 * m34 - m32 * m14));
		this1[10] = d * (m11 * (m22 * m44 - m42 * m24) - m21 * (m12 * m44 - m42 * m14) + m41 * (m12 * m24 - m22 * m14));
		this1[11] = -d * (m11 * (m22 * m34 - m32 * m24) - m21 * (m12 * m34 - m32 * m14) + m31 * (m12 * m24 - m22 * m14));
		this1[12] = -d * (m21 * (m32 * m43 - m42 * m33) - m31 * (m22 * m43 - m42 * m23) + m41 * (m22 * m33 - m32 * m23));
		this1[13] = d * (m11 * (m32 * m43 - m42 * m33) - m31 * (m12 * m43 - m42 * m13) + m41 * (m12 * m33 - m32 * m13));
		this1[14] = -d * (m11 * (m22 * m43 - m42 * m23) - m21 * (m12 * m43 - m42 * m13) + m41 * (m12 * m23 - m22 * m13));
		this1[15] = d * (m11 * (m22 * m33 - m32 * m23) - m21 * (m12 * m33 - m32 * m13) + m31 * (m12 * m23 - m22 * m13));
	}
	return invertable;
};
lime_math_Matrix4.pointAt = function(this1,pos,at,up) {
	if(at == null) {
		at = new lime_math_Vector4(0,0,1);
	}
	if(up == null) {
		up = new lime_math_Vector4(0,1,0);
	}
	var result = null;
	if(result == null) {
		result = new lime_math_Vector4();
	}
	result.x = pos.x - at.x;
	result.y = pos.y - at.y;
	result.z = pos.z - at.z;
	var dir = result;
	var vup = new lime_math_Vector4(up.x,up.y,up.z,up.w);
	var l = Math.sqrt(dir.x * dir.x + dir.y * dir.y + dir.z * dir.z);
	if(l != 0) {
		dir.x /= l;
		dir.y /= l;
		dir.z /= l;
	}
	var l = Math.sqrt(vup.x * vup.x + vup.y * vup.y + vup.z * vup.z);
	if(l != 0) {
		vup.x /= l;
		vup.y /= l;
		vup.z /= l;
	}
	var dir2 = new lime_math_Vector4(dir.x,dir.y,dir.z,dir.w);
	var s = vup.x * dir.x + vup.y * dir.y + vup.z * dir.z;
	dir2.x *= s;
	dir2.y *= s;
	dir2.z *= s;
	var result = null;
	if(result == null) {
		result = new lime_math_Vector4();
	}
	result.x = vup.x - dir2.x;
	result.y = vup.y - dir2.y;
	result.z = vup.z - dir2.z;
	vup = result;
	if(Math.sqrt(vup.x * vup.x + vup.y * vup.y + vup.z * vup.z) > 0) {
		var l = Math.sqrt(vup.x * vup.x + vup.y * vup.y + vup.z * vup.z);
		if(l != 0) {
			vup.x /= l;
			vup.y /= l;
			vup.z /= l;
		}
	} else if(dir.x != 0) {
		vup = new lime_math_Vector4(-dir.y,dir.x,0);
	} else {
		vup = new lime_math_Vector4(1,0,0);
	}
	var result = null;
	if(result == null) {
		result = new lime_math_Vector4();
	}
	var ya = vup.z * dir.x - vup.x * dir.z;
	var za = vup.x * dir.y - vup.y * dir.x;
	result.x = vup.y * dir.z - vup.z * dir.y;
	result.y = ya;
	result.z = za;
	result.w = 1;
	var right = result;
	var l = Math.sqrt(right.x * right.x + right.y * right.y + right.z * right.z);
	if(l != 0) {
		right.x /= l;
		right.y /= l;
		right.z /= l;
	}
	this1[0] = right.x;
	this1[4] = right.y;
	this1[8] = right.z;
	this1[12] = 0.0;
	this1[1] = vup.x;
	this1[5] = vup.y;
	this1[9] = vup.z;
	this1[13] = 0.0;
	this1[2] = dir.x;
	this1[6] = dir.y;
	this1[10] = dir.z;
	this1[14] = 0.0;
	this1[3] = pos.x;
	this1[7] = pos.y;
	this1[11] = pos.z;
	this1[15] = 1.0;
};
lime_math_Matrix4.prepend = function(this1,rhs) {
	var m111 = lime_math_Matrix4.get(rhs,0);
	var m121 = lime_math_Matrix4.get(rhs,4);
	var m131 = lime_math_Matrix4.get(rhs,8);
	var m141 = lime_math_Matrix4.get(rhs,12);
	var m112 = lime_math_Matrix4.get(rhs,1);
	var m122 = lime_math_Matrix4.get(rhs,5);
	var m132 = lime_math_Matrix4.get(rhs,9);
	var m142 = lime_math_Matrix4.get(rhs,13);
	var m113 = lime_math_Matrix4.get(rhs,2);
	var m123 = lime_math_Matrix4.get(rhs,6);
	var m133 = lime_math_Matrix4.get(rhs,10);
	var m143 = lime_math_Matrix4.get(rhs,14);
	var m114 = lime_math_Matrix4.get(rhs,3);
	var m124 = lime_math_Matrix4.get(rhs,7);
	var m134 = lime_math_Matrix4.get(rhs,11);
	var m144 = lime_math_Matrix4.get(rhs,15);
	var m211 = this1[0];
	var m221 = this1[4];
	var m231 = this1[8];
	var m241 = this1[12];
	var m212 = this1[1];
	var m222 = this1[5];
	var m232 = this1[9];
	var m242 = this1[13];
	var m213 = this1[2];
	var m223 = this1[6];
	var m233 = this1[10];
	var m243 = this1[14];
	var m214 = this1[3];
	var m224 = this1[7];
	var m234 = this1[11];
	var m244 = this1[15];
	this1[0] = m111 * m211 + m112 * m221 + m113 * m231 + m114 * m241;
	this1[1] = m111 * m212 + m112 * m222 + m113 * m232 + m114 * m242;
	this1[2] = m111 * m213 + m112 * m223 + m113 * m233 + m114 * m243;
	this1[3] = m111 * m214 + m112 * m224 + m113 * m234 + m114 * m244;
	this1[4] = m121 * m211 + m122 * m221 + m123 * m231 + m124 * m241;
	this1[5] = m121 * m212 + m122 * m222 + m123 * m232 + m124 * m242;
	this1[6] = m121 * m213 + m122 * m223 + m123 * m233 + m124 * m243;
	this1[7] = m121 * m214 + m122 * m224 + m123 * m234 + m124 * m244;
	this1[8] = m131 * m211 + m132 * m221 + m133 * m231 + m134 * m241;
	this1[9] = m131 * m212 + m132 * m222 + m133 * m232 + m134 * m242;
	this1[10] = m131 * m213 + m132 * m223 + m133 * m233 + m134 * m243;
	this1[11] = m131 * m214 + m132 * m224 + m133 * m234 + m134 * m244;
	this1[12] = m141 * m211 + m142 * m221 + m143 * m231 + m144 * m241;
	this1[13] = m141 * m212 + m142 * m222 + m143 * m232 + m144 * m242;
	this1[14] = m141 * m213 + m142 * m223 + m143 * m233 + m144 * m243;
	this1[15] = m141 * m214 + m142 * m224 + m143 * m234 + m144 * m244;
};
lime_math_Matrix4.prependRotation = function(this1,degrees,axis,pivotPoint) {
	var m = lime_math_Matrix4.__getAxisRotation(this1,axis.x,axis.y,axis.z,degrees);
	if(pivotPoint != null) {
		var p = pivotPoint;
		lime_math_Matrix4.appendTranslation(m,p.x,p.y,p.z);
	}
	lime_math_Matrix4.prepend(this1,m);
};
lime_math_Matrix4.prependScale = function(this1,xScale,yScale,zScale) {
	var elements = null;
	var array = [xScale,0.0,0.0,0.0,0.0,yScale,0.0,0.0,0.0,0.0,zScale,0.0,0.0,0.0,0.0,1.0];
	var vector = null;
	var view = null;
	var buffer = null;
	var len = null;
	var this2;
	if(elements != null) {
		this2 = new Float32Array(elements);
	} else if(array != null) {
		this2 = new Float32Array(array);
	} else if(vector != null) {
		this2 = new Float32Array(vector.__array);
	} else if(view != null) {
		this2 = new Float32Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this2 = new Float32Array(buffer,0);
		} else {
			this2 = new Float32Array(buffer,0,len);
		}
	} else {
		this2 = null;
	}
	lime_math_Matrix4.prepend(this1,lime_math_Matrix4._new(this2));
};
lime_math_Matrix4.prependTranslation = function(this1,x,y,z) {
	var m = lime_math_Matrix4._new();
	lime_math_Matrix4.set_position(m,new lime_math_Vector4(x,y,z));
	lime_math_Matrix4.prepend(this1,m);
};
lime_math_Matrix4.transformVector = function(this1,v,result) {
	if(result == null) {
		result = new lime_math_Vector4();
	}
	var x = v.x;
	var y = v.y;
	var z = v.z;
	result.x = x * this1[0] + y * this1[4] + z * this1[8] + this1[12];
	result.y = x * this1[1] + y * this1[5] + z * this1[9] + this1[13];
	result.z = x * this1[2] + y * this1[6] + z * this1[10] + this1[14];
	result.w = x * this1[3] + y * this1[7] + z * this1[11] + this1[15];
	return result;
};
lime_math_Matrix4.transformVectors = function(this1,ain,aout) {
	var i = 0;
	var x;
	var y;
	var z;
	while(i + 3 <= ain.length) {
		x = ain[i];
		y = ain[i + 1];
		z = ain[i + 2];
		aout[i] = x * this1[0] + y * this1[4] + z * this1[8] + this1[12];
		aout[i + 1] = x * this1[1] + y * this1[5] + z * this1[9] + this1[13];
		aout[i + 2] = x * this1[2] + y * this1[6] + z * this1[10] + this1[14];
		i += 3;
	}
};
lime_math_Matrix4.transpose = function(this1) {
	var temp = this1[1];
	this1[1] = this1[4];
	this1[4] = temp;
	var temp = this1[2];
	this1[2] = this1[8];
	this1[8] = temp;
	var temp = this1[3];
	this1[3] = this1[12];
	this1[12] = temp;
	var temp = this1[6];
	this1[6] = this1[9];
	this1[9] = temp;
	var temp = this1[7];
	this1[7] = this1[13];
	this1[13] = temp;
	var temp = this1[11];
	this1[11] = this1[14];
	this1[14] = temp;
};
lime_math_Matrix4.__getAxisRotation = function(this1,x,y,z,degrees) {
	var m = lime_math_Matrix4._new();
	var a1 = new lime_math_Vector4(x,y,z);
	var rad = -degrees * (Math.PI / 180);
	var c = Math.cos(rad);
	var s = Math.sin(rad);
	var t = 1.0 - c;
	lime_math_Matrix4.set(m,0,c + a1.x * a1.x * t);
	lime_math_Matrix4.set(m,5,c + a1.y * a1.y * t);
	lime_math_Matrix4.set(m,10,c + a1.z * a1.z * t);
	var tmp1 = a1.x * a1.y * t;
	var tmp2 = a1.z * s;
	lime_math_Matrix4.set(m,4,tmp1 + tmp2);
	lime_math_Matrix4.set(m,1,tmp1 - tmp2);
	tmp1 = a1.x * a1.z * t;
	tmp2 = a1.y * s;
	lime_math_Matrix4.set(m,8,tmp1 - tmp2);
	lime_math_Matrix4.set(m,2,tmp1 + tmp2);
	tmp1 = a1.y * a1.z * t;
	tmp2 = a1.x * s;
	lime_math_Matrix4.set(m,9,tmp1 + tmp2);
	lime_math_Matrix4.set(m,6,tmp1 - tmp2);
	return m;
};
lime_math_Matrix4.__swap = function(this1,a,b) {
	var temp = this1[a];
	this1[a] = this1[b];
	this1[b] = temp;
};
lime_math_Matrix4.get_determinant = function(this1) {
	return (this1[0] * this1[5] - this1[4] * this1[1]) * (this1[10] * this1[15] - this1[14] * this1[11]) - (this1[0] * this1[9] - this1[8] * this1[1]) * (this1[6] * this1[15] - this1[14] * this1[7]) + (this1[0] * this1[13] - this1[12] * this1[1]) * (this1[6] * this1[11] - this1[10] * this1[7]) + (this1[4] * this1[9] - this1[8] * this1[5]) * (this1[2] * this1[15] - this1[14] * this1[3]) - (this1[4] * this1[13] - this1[12] * this1[5]) * (this1[2] * this1[11] - this1[10] * this1[3]) + (this1[8] * this1[13] - this1[12] * this1[9]) * (this1[2] * this1[7] - this1[6] * this1[3]);
};
lime_math_Matrix4.get_position = function(this1) {
	return new lime_math_Vector4(this1[12],this1[13],this1[14]);
};
lime_math_Matrix4.set_position = function(this1,val) {
	this1[12] = val.x;
	this1[13] = val.y;
	this1[14] = val.z;
	return val;
};
lime_math_Matrix4.get = function(this1,index) {
	return this1[index];
};
lime_math_Matrix4.set = function(this1,index,value) {
	this1[index] = value;
	return value;
};
var lime_math_RGBA = {};
lime_math_RGBA.__properties__ = {set_r:"set_r",get_r:"get_r",set_g:"set_g",get_g:"get_g",set_b:"set_b",get_b:"get_b",set_a:"set_a",get_a:"get_a"};
lime_math_RGBA.__alpha16 = null;
lime_math_RGBA.__clamp = null;
lime_math_RGBA.a16 = null;
lime_math_RGBA.unmult = null;
lime_math_RGBA._new = function(rgba) {
	if(rgba == null) {
		rgba = 0;
	}
	var this1 = rgba;
	return this1;
};
lime_math_RGBA.create = function(r,g,b,a) {
	var this1 = 0;
	var rgba = this1;
	rgba = (r & 255) << 24 | (g & 255) << 16 | (b & 255) << 8 | a & 255;
	return rgba;
};
lime_math_RGBA.multiplyAlpha = function(this1) {
	if((this1 & 255) == 0) {
		if(this1 != 0) {
			this1 = 0;
		}
	} else if((this1 & 255) != 255) {
		lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[this1 & 255];
		this1 = ((this1 >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((this1 >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((this1 >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | this1 & 255 & 255;
	}
};
lime_math_RGBA.readUInt8 = function(this1,data,offset,format,premultiplied) {
	if(premultiplied == null) {
		premultiplied = false;
	}
	if(format == null) {
		format = 0;
	}
	switch(format) {
	case 0:
		this1 = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255;
		break;
	case 1:
		this1 = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255;
		break;
	case 2:
		this1 = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255;
		break;
	}
	if(premultiplied) {
		if((this1 & 255) != 0 && (this1 & 255) != 255) {
			lime_math_RGBA.unmult = 255.0 / (this1 & 255);
			this1 = (lime_math_RGBA.__clamp[Math.round((this1 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((this1 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((this1 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | this1 & 255 & 255;
		}
	}
};
lime_math_RGBA.set = function(this1,r,g,b,a) {
	this1 = (r & 255) << 24 | (g & 255) << 16 | (b & 255) << 8 | a & 255;
};
lime_math_RGBA.unmultiplyAlpha = function(this1) {
	if((this1 & 255) != 0 && (this1 & 255) != 255) {
		lime_math_RGBA.unmult = 255.0 / (this1 & 255);
		this1 = (lime_math_RGBA.__clamp[Math.round((this1 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((this1 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((this1 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | this1 & 255 & 255;
	}
};
lime_math_RGBA.writeUInt8 = function(this1,data,offset,format,premultiplied) {
	if(premultiplied == null) {
		premultiplied = false;
	}
	if(format == null) {
		format = 0;
	}
	if(premultiplied) {
		if((this1 & 255) == 0) {
			if(this1 != 0) {
				this1 = 0;
			}
		} else if((this1 & 255) != 255) {
			lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[this1 & 255];
			this1 = ((this1 >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((this1 >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((this1 >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | this1 & 255 & 255;
		}
	}
	switch(format) {
	case 0:
		data[offset] = this1 >>> 24 & 255;
		data[offset + 1] = this1 >>> 16 & 255;
		data[offset + 2] = this1 >>> 8 & 255;
		data[offset + 3] = this1 & 255;
		break;
	case 1:
		data[offset] = this1 & 255;
		data[offset + 1] = this1 >>> 24 & 255;
		data[offset + 2] = this1 >>> 16 & 255;
		data[offset + 3] = this1 >>> 8 & 255;
		break;
	case 2:
		data[offset] = this1 >>> 8 & 255;
		data[offset + 1] = this1 >>> 16 & 255;
		data[offset + 2] = this1 >>> 24 & 255;
		data[offset + 3] = this1 & 255;
		break;
	}
};
lime_math_RGBA.__fromARGB = function(argb) {
	var this1 = 0;
	var rgba = this1;
	rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255;
	return rgba;
};
lime_math_RGBA.__fromBGRA = function(bgra) {
	var this1 = 0;
	var rgba = this1;
	rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255;
	return rgba;
};
lime_math_RGBA.get_a = function(this1) {
	return this1 & 255;
};
lime_math_RGBA.set_a = function(this1,value) {
	this1 = (this1 >>> 24 & 255 & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | value & 255;
	return value;
};
lime_math_RGBA.get_b = function(this1) {
	return this1 >>> 8 & 255;
};
lime_math_RGBA.set_b = function(this1,value) {
	this1 = (this1 >>> 24 & 255 & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (value & 255) << 8 | this1 & 255 & 255;
	return value;
};
lime_math_RGBA.get_g = function(this1) {
	return this1 >>> 16 & 255;
};
lime_math_RGBA.set_g = function(this1,value) {
	this1 = (this1 >>> 24 & 255 & 255) << 24 | (value & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | this1 & 255 & 255;
	return value;
};
lime_math_RGBA.get_r = function(this1) {
	return this1 >>> 24 & 255;
};
lime_math_RGBA.set_r = function(this1,value) {
	this1 = (value & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | this1 & 255 & 255;
	return value;
};
var lime_math_Rectangle = function(x,y,width,height) {
	if(height == null) {
		height = 0;
	}
	if(width == null) {
		width = 0;
	}
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	this.x = x;
	this.y = y;
	this.width = width;
	this.height = height;
};
$hxClasses["lime.math.Rectangle"] = lime_math_Rectangle;
lime_math_Rectangle.__name__ = "lime.math.Rectangle";
lime_math_Rectangle.prototype = {
	height: null
	,width: null
	,x: null
	,y: null
	,clone: function() {
		return new lime_math_Rectangle(this.x,this.y,this.width,this.height);
	}
	,contains: function(x,y) {
		if(x >= this.x && y >= this.y && x < this.get_right()) {
			return y < this.get_bottom();
		} else {
			return false;
		}
	}
	,containsPoint: function(point) {
		return this.containsVector(point);
	}
	,containsRect: function(rect) {
		if(rect.width <= 0 || rect.height <= 0) {
			if(rect.x > this.x && rect.y > this.y && rect.get_right() < this.get_right()) {
				return rect.get_bottom() < this.get_bottom();
			} else {
				return false;
			}
		} else if(rect.x >= this.x && rect.y >= this.y && rect.get_right() <= this.get_right()) {
			return rect.get_bottom() <= this.get_bottom();
		} else {
			return false;
		}
	}
	,containsVector: function(vector) {
		return this.contains(vector.x,vector.y);
	}
	,copyFrom: function(sourceRect) {
		this.x = sourceRect.x;
		this.y = sourceRect.y;
		this.width = sourceRect.width;
		this.height = sourceRect.height;
	}
	,equals: function(toCompare) {
		if(toCompare != null && this.x == toCompare.x && this.y == toCompare.y && this.width == toCompare.width) {
			return this.height == toCompare.height;
		} else {
			return false;
		}
	}
	,inflate: function(dx,dy) {
		this.x -= dx;
		this.width += dx * 2;
		this.y -= dy;
		this.height += dy * 2;
	}
	,inflateVector: function(vector) {
		this.inflate(vector.x,vector.y);
	}
	,intersection: function(toIntersect,result) {
		if(result == null) {
			result = new lime_math_Rectangle();
		}
		var x0 = this.x < toIntersect.x ? toIntersect.x : this.x;
		var x1 = this.get_right() > toIntersect.get_right() ? toIntersect.get_right() : this.get_right();
		if(x1 <= x0) {
			result.setEmpty();
			return result;
		}
		var y0 = this.y < toIntersect.y ? toIntersect.y : this.y;
		var y1 = this.get_bottom() > toIntersect.get_bottom() ? toIntersect.get_bottom() : this.get_bottom();
		if(y1 <= y0) {
			result.setEmpty();
			return result;
		}
		result.x = x0;
		result.y = y0;
		result.width = x1 - x0;
		result.height = y1 - y0;
		return result;
	}
	,intersects: function(toIntersect) {
		var x0 = this.x < toIntersect.x ? toIntersect.x : this.x;
		var x1 = this.get_right() > toIntersect.get_right() ? toIntersect.get_right() : this.get_right();
		if(x1 <= x0) {
			return false;
		}
		var y0 = this.y < toIntersect.y ? toIntersect.y : this.y;
		var y1 = this.get_bottom() > toIntersect.get_bottom() ? toIntersect.get_bottom() : this.get_bottom();
		return y1 > y0;
	}
	,isEmpty: function() {
		if(!(this.width <= 0)) {
			return this.height <= 0;
		} else {
			return true;
		}
	}
	,offset: function(dx,dy) {
		this.x += dx;
		this.y += dy;
	}
	,offsetVector: function(vector) {
		this.x += vector.x;
		this.y += vector.y;
	}
	,setEmpty: function() {
		this.x = this.y = this.width = this.height = 0;
	}
	,setTo: function(xa,ya,widtha,heighta) {
		this.x = xa;
		this.y = ya;
		this.width = widtha;
		this.height = heighta;
	}
	,union: function(toUnion,result) {
		if(result == null) {
			result = new lime_math_Rectangle();
		}
		if(this.width == 0 || this.height == 0) {
			result.copyFrom(toUnion);
		} else if(toUnion.width == 0 || toUnion.height == 0) {
			result.copyFrom(this);
		} else {
			var x0 = this.x > toUnion.x ? toUnion.x : this.x;
			var x1 = this.get_right() < toUnion.get_right() ? toUnion.get_right() : this.get_right();
			var y0 = this.y > toUnion.y ? toUnion.y : this.y;
			var y1 = this.get_bottom() < toUnion.get_bottom() ? toUnion.get_bottom() : this.get_bottom();
			result.setTo(x0,y0,x1 - x0,y1 - y0);
		}
		return result;
	}
	,__toFlashRectangle: function() {
		return null;
	}
	,get_bottom: function() {
		return this.y + this.height;
	}
	,set_bottom: function(b) {
		this.height = b - this.y;
		return b;
	}
	,get_bottomRight: function() {
		return new lime_math_Vector2(this.x + this.width,this.y + this.height);
	}
	,set_bottomRight: function(p) {
		this.width = p.x - this.x;
		this.height = p.y - this.y;
		return p.clone();
	}
	,get_left: function() {
		return this.x;
	}
	,set_left: function(l) {
		this.width -= l - this.x;
		this.x = l;
		return l;
	}
	,get_right: function() {
		return this.x + this.width;
	}
	,set_right: function(r) {
		this.width = r - this.x;
		return r;
	}
	,get_size: function() {
		return new lime_math_Vector2(this.width,this.height);
	}
	,set_size: function(p) {
		this.width = p.x;
		this.height = p.y;
		return p.clone();
	}
	,get_top: function() {
		return this.y;
	}
	,set_top: function(t) {
		this.height -= t - this.y;
		this.y = t;
		return t;
	}
	,get_topLeft: function() {
		return new lime_math_Vector2(this.x,this.y);
	}
	,set_topLeft: function(p) {
		this.x = p.x;
		this.y = p.y;
		return p.clone();
	}
	,__class__: lime_math_Rectangle
	,__properties__: {set_topLeft:"set_topLeft",get_topLeft:"get_topLeft",set_top:"set_top",get_top:"get_top",set_size:"set_size",get_size:"get_size",set_right:"set_right",get_right:"get_right",set_left:"set_left",get_left:"get_left",set_bottomRight:"set_bottomRight",get_bottomRight:"get_bottomRight",set_bottom:"set_bottom",get_bottom:"get_bottom"}
};
var lime_math_Vector4 = function(x,y,z,w) {
	if(w == null) {
		w = 0.;
	}
	if(z == null) {
		z = 0.;
	}
	if(y == null) {
		y = 0.;
	}
	if(x == null) {
		x = 0.;
	}
	this.w = w;
	this.x = x;
	this.y = y;
	this.z = z;
};
$hxClasses["lime.math.Vector4"] = lime_math_Vector4;
lime_math_Vector4.__name__ = "lime.math.Vector4";
lime_math_Vector4.__properties__ = {get_Z_AXIS:"get_Z_AXIS",get_Y_AXIS:"get_Y_AXIS",get_X_AXIS:"get_X_AXIS"};
lime_math_Vector4.angleBetween = function(a,b) {
	var a0 = new lime_math_Vector4(a.x,a.y,a.z,a.w);
	var l = Math.sqrt(a0.x * a0.x + a0.y * a0.y + a0.z * a0.z);
	if(l != 0) {
		a0.x /= l;
		a0.y /= l;
		a0.z /= l;
	}
	var b0 = new lime_math_Vector4(b.x,b.y,b.z,b.w);
	var l = Math.sqrt(b0.x * b0.x + b0.y * b0.y + b0.z * b0.z);
	if(l != 0) {
		b0.x /= l;
		b0.y /= l;
		b0.z /= l;
	}
	return Math.acos(a0.x * b0.x + a0.y * b0.y + a0.z * b0.z);
};
lime_math_Vector4.distance = function(pt1,pt2) {
	var x = pt2.x - pt1.x;
	var y = pt2.y - pt1.y;
	var z = pt2.z - pt1.z;
	return Math.sqrt(x * x + y * y + z * z);
};
lime_math_Vector4.distanceSquared = function(pt1,pt2) {
	var x = pt2.x - pt1.x;
	var y = pt2.y - pt1.y;
	var z = pt2.z - pt1.z;
	return x * x + y * y + z * z;
};
lime_math_Vector4.get_X_AXIS = function() {
	return new lime_math_Vector4(1,0,0);
};
lime_math_Vector4.get_Y_AXIS = function() {
	return new lime_math_Vector4(0,1,0);
};
lime_math_Vector4.get_Z_AXIS = function() {
	return new lime_math_Vector4(0,0,1);
};
lime_math_Vector4.prototype = {
	w: null
	,x: null
	,y: null
	,z: null
	,add: function(a,result) {
		if(result == null) {
			result = new lime_math_Vector4();
		}
		result.x = this.x + a.x;
		result.y = this.y + a.y;
		result.z = this.z + a.z;
		return result;
	}
	,clone: function() {
		return new lime_math_Vector4(this.x,this.y,this.z,this.w);
	}
	,copyFrom: function(sourceVector4) {
		this.x = sourceVector4.x;
		this.y = sourceVector4.y;
		this.z = sourceVector4.z;
	}
	,crossProduct: function(a,result) {
		if(result == null) {
			result = new lime_math_Vector4();
		}
		var ya = this.z * a.x - this.x * a.z;
		var za = this.x * a.y - this.y * a.x;
		result.x = this.y * a.z - this.z * a.y;
		result.y = ya;
		result.z = za;
		result.w = 1;
		return result;
	}
	,decrementBy: function(a) {
		this.x -= a.x;
		this.y -= a.y;
		this.z -= a.z;
	}
	,dotProduct: function(a) {
		return this.x * a.x + this.y * a.y + this.z * a.z;
	}
	,equals: function(toCompare,allFour) {
		if(allFour == null) {
			allFour = false;
		}
		if(this.x == toCompare.x && this.y == toCompare.y && this.z == toCompare.z) {
			if(!(!allFour)) {
				return this.w == toCompare.w;
			} else {
				return true;
			}
		} else {
			return false;
		}
	}
	,incrementBy: function(a) {
		this.x += a.x;
		this.y += a.y;
		this.z += a.z;
	}
	,nearEquals: function(toCompare,tolerance,allFour) {
		if(allFour == null) {
			allFour = false;
		}
		if(Math.abs(this.x - toCompare.x) < tolerance && Math.abs(this.y - toCompare.y) < tolerance && Math.abs(this.z - toCompare.z) < tolerance) {
			if(!(!allFour)) {
				return Math.abs(this.w - toCompare.w) < tolerance;
			} else {
				return true;
			}
		} else {
			return false;
		}
	}
	,negate: function() {
		this.x *= -1;
		this.y *= -1;
		this.z *= -1;
	}
	,normalize: function() {
		var l = Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
		if(l != 0) {
			this.x /= l;
			this.y /= l;
			this.z /= l;
		}
		return l;
	}
	,project: function() {
		this.x /= this.w;
		this.y /= this.w;
		this.z /= this.w;
	}
	,scaleBy: function(s) {
		this.x *= s;
		this.y *= s;
		this.z *= s;
	}
	,setTo: function(xa,ya,za) {
		this.x = xa;
		this.y = ya;
		this.z = za;
	}
	,subtract: function(a,result) {
		if(result == null) {
			result = new lime_math_Vector4();
		}
		result.x = this.x - a.x;
		result.y = this.y - a.y;
		result.z = this.z - a.z;
		return result;
	}
	,toString: function() {
		return "Vector4(" + this.x + ", " + this.y + ", " + this.z + ")";
	}
	,get_length: function() {
		return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
	}
	,get_lengthSquared: function() {
		return this.x * this.x + this.y * this.y + this.z * this.z;
	}
	,__class__: lime_math_Vector4
	,__properties__: {get_lengthSquared:"get_lengthSquared",get_length:"get_length"}
};
var lime_media_AudioBuffer = function() {
};
$hxClasses["lime.media.AudioBuffer"] = lime_media_AudioBuffer;
lime_media_AudioBuffer.__name__ = "lime.media.AudioBuffer";
lime_media_AudioBuffer.fromBase64 = function(base64String) {
	if(base64String == null) {
		return null;
	}
	if(base64String.indexOf(",") == -1) {
		base64String = "data:" + lime_media_AudioBuffer.__getCodec(lime__$internal_format_Base64.decode(base64String)) + ";base64," + base64String;
	}
	var audioBuffer = new lime_media_AudioBuffer();
	audioBuffer.set_src(new Howl({ src : [base64String], html5 : true, preload : false}));
	return audioBuffer;
};
lime_media_AudioBuffer.fromBytes = function(bytes) {
	if(bytes == null) {
		return null;
	}
	var audioBuffer = new lime_media_AudioBuffer();
	audioBuffer.set_src(new Howl({ src : ["data:" + lime_media_AudioBuffer.__getCodec(bytes) + ";base64," + lime__$internal_format_Base64.encode(bytes)], html5 : true, preload : false}));
	return audioBuffer;
};
lime_media_AudioBuffer.fromFile = function(path) {
	if(path == null) {
		return null;
	}
	var audioBuffer = new lime_media_AudioBuffer();
	audioBuffer.__srcHowl = new Howl({ src : [path], preload : false});
	return audioBuffer;
};
lime_media_AudioBuffer.fromFiles = function(paths) {
	var audioBuffer = new lime_media_AudioBuffer();
	audioBuffer.__srcHowl = new Howl({ src : paths, preload : false});
	return audioBuffer;
};
lime_media_AudioBuffer.fromVorbisFile = function(vorbisFile) {
	return null;
};
lime_media_AudioBuffer.loadFromFile = function(path) {
	var promise = new lime_app_Promise();
	var audioBuffer = lime_media_AudioBuffer.fromFile(path);
	if(audioBuffer != null) {
		if(audioBuffer != null) {
			audioBuffer.__srcHowl.on("load",function() {
				promise.complete(audioBuffer);
			});
			audioBuffer.__srcHowl.on("loaderror",function(id,msg) {
				promise.error(msg);
			});
			audioBuffer.__srcHowl.load();
		}
	} else {
		promise.error(null);
	}
	return promise.future;
};
lime_media_AudioBuffer.loadFromFiles = function(paths) {
	var promise = new lime_app_Promise();
	var audioBuffer = lime_media_AudioBuffer.fromFiles(paths);
	if(audioBuffer != null) {
		audioBuffer.__srcHowl.on("load",function() {
			promise.complete(audioBuffer);
		});
		audioBuffer.__srcHowl.on("loaderror",function() {
			promise.error(null);
		});
		audioBuffer.__srcHowl.load();
	} else {
		promise.error(null);
	}
	return promise.future;
};
lime_media_AudioBuffer.__getCodec = function(bytes) {
	var signature = bytes.getString(0,4);
	switch(signature) {
	case "OggS":
		return "audio/ogg";
	case "RIFF":
		if(bytes.getString(8,4) == "WAVE") {
			return "audio/wav";
		} else {
			var _g = bytes.b[2];
			var _g1 = bytes.b[1];
			switch(bytes.b[0]) {
			case 73:
				if(_g1 == 68) {
					if(_g == 51) {
						return "audio/mp3";
					}
				}
				break;
			case 255:
				switch(_g1) {
				case 243:case 250:case 251:
					return "audio/mp3";
				default:
				}
				break;
			default:
			}
		}
		break;
	case "fLaC":
		return "audio/flac";
	default:
		var _g = bytes.b[2];
		var _g1 = bytes.b[1];
		switch(bytes.b[0]) {
		case 73:
			if(_g1 == 68) {
				if(_g == 51) {
					return "audio/mp3";
				}
			}
			break;
		case 255:
			switch(_g1) {
			case 243:case 250:case 251:
				return "audio/mp3";
			default:
			}
			break;
		default:
		}
	}
	lime_utils_Log.error("Unsupported sound format",{ fileName : "lime/media/AudioBuffer.hx", lineNumber : 362, className : "lime.media.AudioBuffer", methodName : "__getCodec"});
	return null;
};
lime_media_AudioBuffer.prototype = {
	bitsPerSample: null
	,channels: null
	,data: null
	,sampleRate: null
	,__srcAudio: null
	,__srcBuffer: null
	,__srcCustom: null
	,__srcHowl: null
	,__srcSound: null
	,__srcVorbisFile: null
	,dispose: function() {
		this.__srcHowl.unload();
	}
	,get_src: function() {
		return this.__srcHowl;
	}
	,set_src: function(value) {
		return this.__srcHowl = value;
	}
	,__class__: lime_media_AudioBuffer
	,__properties__: {set_src:"set_src",get_src:"get_src"}
};
var lime_media_AudioContext = function(type) {
	if(type != "custom") {
		if(type == null || type == "web") {
			try {
				window.AudioContext = window.AudioContext || window.webkitAudioContext;
				this.web = new window.AudioContext ();
				this.type = "web";
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
			}
		}
		if(this.web == null && type != "web") {
			this.html5 = new lime_media_HTML5AudioContext();
			this.type = "html5";
		}
	} else {
		this.type = "custom";
	}
};
$hxClasses["lime.media.AudioContext"] = lime_media_AudioContext;
lime_media_AudioContext.__name__ = "lime.media.AudioContext";
lime_media_AudioContext.prototype = {
	custom: null
	,flash: null
	,html5: null
	,openal: null
	,type: null
	,web: null
	,__class__: lime_media_AudioContext
};
var lime_media_AudioManager = function() { };
$hxClasses["lime.media.AudioManager"] = lime_media_AudioManager;
lime_media_AudioManager.__name__ = "lime.media.AudioManager";
lime_media_AudioManager.context = null;
lime_media_AudioManager.init = function(context) {
	if(lime_media_AudioManager.context == null) {
		if(context == null) {
			lime_media_AudioManager.context = new lime_media_AudioContext();
			context = lime_media_AudioManager.context;
			if(context.type == "openal") {
				var alc = context.openal;
				var device = alc.openDevice();
				var ctx = alc.createContext(device);
				alc.makeContextCurrent(ctx);
				alc.processContext(ctx);
			}
		}
		lime_media_AudioManager.context = context;
	}
};
lime_media_AudioManager.resume = function() {
	if(lime_media_AudioManager.context != null && lime_media_AudioManager.context.type == "openal") {
		var alc = lime_media_AudioManager.context.openal;
		var currentContext = alc.getCurrentContext();
		if(currentContext != null) {
			var device = alc.getContextsDevice(currentContext);
			alc.resumeDevice(device);
			alc.processContext(currentContext);
		}
	}
};
lime_media_AudioManager.shutdown = function() {
	if(lime_media_AudioManager.context != null && lime_media_AudioManager.context.type == "openal") {
		var alc = lime_media_AudioManager.context.openal;
		var currentContext = alc.getCurrentContext();
		if(currentContext != null) {
			var device = alc.getContextsDevice(currentContext);
			alc.makeContextCurrent(null);
			alc.destroyContext(currentContext);
			if(device != null) {
				alc.closeDevice(device);
			}
		}
	}
	lime_media_AudioManager.context = null;
};
lime_media_AudioManager.suspend = function() {
	if(lime_media_AudioManager.context != null && lime_media_AudioManager.context.type == "openal") {
		var alc = lime_media_AudioManager.context.openal;
		var currentContext = alc.getCurrentContext();
		if(currentContext != null) {
			alc.suspendContext(currentContext);
			var device = alc.getContextsDevice(currentContext);
			if(device != null) {
				alc.pauseDevice(device);
			}
		}
	}
};
var lime_media_AudioSource = function(buffer,offset,length,loops) {
	if(loops == null) {
		loops = 0;
	}
	if(offset == null) {
		offset = 0;
	}
	this.onComplete = new lime_app__$Event_$Void_$Void();
	this.buffer = buffer;
	this.offset = offset;
	this.__backend = new lime__$internal_backend_html5_HTML5AudioSource(this);
	if(length != null && length != 0) {
		this.set_length(length);
	}
	this.set_loops(loops);
	if(buffer != null) {
		this.init();
	}
};
$hxClasses["lime.media.AudioSource"] = lime_media_AudioSource;
lime_media_AudioSource.__name__ = "lime.media.AudioSource";
lime_media_AudioSource.prototype = {
	onComplete: null
	,buffer: null
	,offset: null
	,__backend: null
	,dispose: function() {
		this.__backend.dispose();
	}
	,init: function() {
		this.__backend.init();
	}
	,play: function() {
		this.__backend.play();
	}
	,pause: function() {
		this.__backend.pause();
	}
	,stop: function() {
		this.__backend.stop();
	}
	,get_currentTime: function() {
		return this.__backend.getCurrentTime();
	}
	,set_currentTime: function(value) {
		return this.__backend.setCurrentTime(value);
	}
	,get_gain: function() {
		return this.__backend.getGain();
	}
	,set_gain: function(value) {
		return this.__backend.setGain(value);
	}
	,get_length: function() {
		return this.__backend.getLength();
	}
	,set_length: function(value) {
		return this.__backend.setLength(value);
	}
	,get_loops: function() {
		return this.__backend.getLoops();
	}
	,set_loops: function(value) {
		return this.__backend.setLoops(value);
	}
	,get_position: function() {
		return this.__backend.getPosition();
	}
	,set_position: function(value) {
		return this.__backend.setPosition(value);
	}
	,__class__: lime_media_AudioSource
	,__properties__: {set_position:"set_position",get_position:"get_position",set_loops:"set_loops",get_loops:"get_loops",set_length:"set_length",get_length:"get_length",set_gain:"set_gain",get_gain:"get_gain",set_currentTime:"set_currentTime",get_currentTime:"get_currentTime"}
};
var lime_media_FlashAudioContext = function() {
};
$hxClasses["lime.media.FlashAudioContext"] = lime_media_FlashAudioContext;
lime_media_FlashAudioContext.__name__ = "lime.media.FlashAudioContext";
lime_media_FlashAudioContext.prototype = {
	createBuffer: function(stream,context) {
		return null;
	}
	,getBytesLoaded: function(buffer) {
		return 0;
	}
	,getBytesTotal: function(buffer) {
		return 0;
	}
	,getID3: function(buffer) {
		return null;
	}
	,getIsBuffering: function(buffer) {
		return false;
	}
	,getIsURLInaccessible: function(buffer) {
		return false;
	}
	,getLength: function(buffer) {
		return 0;
	}
	,getURL: function(buffer) {
		return null;
	}
	,close: function(buffer) {
	}
	,extract: function(buffer,target,length,startPosition) {
		if(startPosition == null) {
			startPosition = -1;
		}
		return 0;
	}
	,load: function(buffer,stream,context) {
	}
	,loadCompressedDataFromByteArray: function(buffer,bytes,bytesLength) {
	}
	,loadPCMFromByteArray: function(buffer,bytes,samples,format,stereo,sampleRate) {
		if(sampleRate == null) {
			sampleRate = 44100;
		}
		if(stereo == null) {
			stereo = true;
		}
	}
	,play: function(buffer,startTime,loops,sndTransform) {
		if(loops == null) {
			loops = 0;
		}
		if(startTime == null) {
			startTime = 0;
		}
		return null;
	}
	,__class__: lime_media_FlashAudioContext
};
var lime_media_HTML5AudioContext = function() {
	this.NETWORK_NO_SOURCE = 3;
	this.NETWORK_LOADING = 2;
	this.NETWORK_IDLE = 1;
	this.NETWORK_EMPTY = 0;
	this.HAVE_NOTHING = 0;
	this.HAVE_METADATA = 1;
	this.HAVE_FUTURE_DATA = 3;
	this.HAVE_ENOUGH_DATA = 4;
	this.HAVE_CURRENT_DATA = 2;
};
$hxClasses["lime.media.HTML5AudioContext"] = lime_media_HTML5AudioContext;
lime_media_HTML5AudioContext.__name__ = "lime.media.HTML5AudioContext";
lime_media_HTML5AudioContext.prototype = {
	HAVE_CURRENT_DATA: null
	,HAVE_ENOUGH_DATA: null
	,HAVE_FUTURE_DATA: null
	,HAVE_METADATA: null
	,HAVE_NOTHING: null
	,NETWORK_EMPTY: null
	,NETWORK_IDLE: null
	,NETWORK_LOADING: null
	,NETWORK_NO_SOURCE: null
	,canPlayType: function(buffer,type) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.canPlayType(type);
		}
		return null;
	}
	,createBuffer: function(urlString) {
		var buffer = new lime_media_AudioBuffer();
		buffer.__srcAudio = new Audio();
		buffer.__srcAudio.src = urlString;
		return buffer;
	}
	,getAutoplay: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.autoplay;
		}
		return false;
	}
	,getBuffered: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.buffered;
		}
		return null;
	}
	,getCurrentSrc: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.currentSrc;
		}
		return null;
	}
	,getCurrentTime: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.currentTime;
		}
		return 0;
	}
	,getDefaultPlaybackRate: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.defaultPlaybackRate;
		}
		return 1;
	}
	,getDuration: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.duration;
		}
		return 0;
	}
	,getEnded: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.ended;
		}
		return false;
	}
	,getError: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.error;
		}
		return null;
	}
	,getLoop: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.loop;
		}
		return false;
	}
	,getMuted: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.muted;
		}
		return false;
	}
	,getNetworkState: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.networkState;
		}
		return 0;
	}
	,getPaused: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.paused;
		}
		return false;
	}
	,getPlaybackRate: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.playbackRate;
		}
		return 1;
	}
	,getPlayed: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.played;
		}
		return null;
	}
	,getPreload: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.preload;
		}
		return null;
	}
	,getReadyState: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.readyState;
		}
		return 0;
	}
	,getSeekable: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.seekable;
		}
		return null;
	}
	,getSeeking: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.seeking;
		}
		return false;
	}
	,getSrc: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.src;
		}
		return null;
	}
	,getStartTime: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.playbackRate;
		}
		return 0;
	}
	,getVolume: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.volume;
		}
		return 1;
	}
	,load: function(buffer) {
		if(buffer.__srcAudio != null) {
			buffer.__srcAudio.load();
		}
	}
	,pause: function(buffer) {
		if(buffer.__srcAudio != null) {
			buffer.__srcAudio.pause();
		}
	}
	,play: function(buffer) {
		if(buffer.__srcAudio != null) {
			buffer.__srcAudio.play();
		}
	}
	,setAutoplay: function(buffer,value) {
		if(buffer.__srcAudio != null) {
			buffer.__srcAudio.autoplay = value;
		}
	}
	,setCurrentTime: function(buffer,value) {
		if(buffer.__srcAudio != null) {
			buffer.__srcAudio.currentTime = value;
		}
	}
	,setDefaultPlaybackRate: function(buffer,value) {
		if(buffer.__srcAudio != null) {
			buffer.__srcAudio.defaultPlaybackRate = value;
		}
	}
	,setLoop: function(buffer,value) {
		if(buffer.__srcAudio != null) {
			buffer.__srcAudio.loop = value;
		}
	}
	,setMuted: function(buffer,value) {
		if(buffer.__srcAudio != null) {
			buffer.__srcAudio.muted = value;
		}
	}
	,setPlaybackRate: function(buffer,value) {
		if(buffer.__srcAudio != null) {
			buffer.__srcAudio.playbackRate = value;
		}
	}
	,setPreload: function(buffer,value) {
		if(buffer.__srcAudio != null) {
			buffer.__srcAudio.preload = value;
		}
	}
	,setSrc: function(buffer,value) {
		if(buffer.__srcAudio != null) {
			buffer.__srcAudio.src = value;
		}
	}
	,setVolume: function(buffer,value) {
		if(buffer.__srcAudio != null) {
			buffer.__srcAudio.volume = value;
		}
	}
	,__class__: lime_media_HTML5AudioContext
};
var lime_media_OpenALAudioContext = function() {
	this.ALL_DEVICES_SPECIFIER = 4115;
	this.DEFAULT_ALL_DEVICES_SPECIFIER = 4114;
	this.ENUMERATE_ALL_EXT = 1;
	this.DEVICE_SPECIFIER = 4101;
	this.DEFAULT_DEVICE_SPECIFIER = 4100;
	this.ALL_ATTRIBUTES = 4099;
	this.ATTRIBUTES_SIZE = 4098;
	this.INVALID_CONTEXT = 40962;
	this.INVALID_DEVICE = 40961;
	this.STEREO_SOURCES = 4113;
	this.MONO_SOURCES = 4112;
	this.SYNC = 4105;
	this.REFRESH = 4104;
	this.EXPONENT_DISTANCE_CLAMPED = 53254;
	this.EXPONENT_DISTANCE = 53253;
	this.LINEAR_DISTANCE_CLAMPED = 53252;
	this.LINEAR_DISTANCE = 53251;
	this.INVERSE_DISTANCE_CLAMPED = 53250;
	this.INVERSE_DISTANCE = 53249;
	this.DISTANCE_MODEL = 53248;
	this.DOPPLER_VELOCITY = 49153;
	this.SPEED_OF_SOUND = 49155;
	this.DOPPLER_FACTOR = 49152;
	this.EXTENSIONS = 45060;
	this.RENDERER = 45059;
	this.VERSION = 45058;
	this.VENDOR = 45057;
	this.OUT_OF_MEMORY = 40965;
	this.INVALID_OPERATION = 40964;
	this.INVALID_VALUE = 40963;
	this.INVALID_ENUM = 40962;
	this.INVALID_NAME = 40961;
	this.NO_ERROR = 0;
	this.SIZE = 8196;
	this.CHANNELS = 8195;
	this.BITS = 8194;
	this.FREQUENCY = 8193;
	this.FORMAT_STEREO16 = 4355;
	this.FORMAT_STEREO8 = 4354;
	this.FORMAT_MONO16 = 4353;
	this.FORMAT_MONO8 = 4352;
	this.UNDETERMINED = 4144;
	this.STREAMING = 4137;
	this.STATIC = 4136;
	this.SOURCE_TYPE = 4135;
	this.BYTE_OFFSET = 4134;
	this.SAMPLE_OFFSET = 4133;
	this.SEC_OFFSET = 4132;
	this.MAX_DISTANCE = 4131;
	this.CONE_OUTER_GAIN = 4130;
	this.ROLLOFF_FACTOR = 4129;
	this.REFERENCE_DISTANCE = 4128;
	this.BUFFERS_PROCESSED = 4118;
	this.BUFFERS_QUEUED = 4117;
	this.STOPPED = 4116;
	this.PAUSED = 4115;
	this.PLAYING = 4114;
	this.INITIAL = 4113;
	this.SOURCE_STATE = 4112;
	this.ORIENTATION = 4111;
	this.MAX_GAIN = 4110;
	this.MIN_GAIN = 4109;
	this.GAIN = 4106;
	this.BUFFER = 4105;
	this.LOOPING = 4103;
	this.VELOCITY = 4102;
	this.DIRECTION = 4101;
	this.POSITION = 4100;
	this.PITCH = 4099;
	this.CONE_OUTER_ANGLE = 4098;
	this.CONE_INNER_ANGLE = 4097;
	this.SOURCE_RELATIVE = 514;
	this.TRUE = 1;
	this.FALSE = 0;
	this.NONE = 0;
};
$hxClasses["lime.media.OpenALAudioContext"] = lime_media_OpenALAudioContext;
lime_media_OpenALAudioContext.__name__ = "lime.media.OpenALAudioContext";
lime_media_OpenALAudioContext.prototype = {
	NONE: null
	,FALSE: null
	,TRUE: null
	,SOURCE_RELATIVE: null
	,CONE_INNER_ANGLE: null
	,CONE_OUTER_ANGLE: null
	,PITCH: null
	,POSITION: null
	,DIRECTION: null
	,VELOCITY: null
	,LOOPING: null
	,BUFFER: null
	,GAIN: null
	,MIN_GAIN: null
	,MAX_GAIN: null
	,ORIENTATION: null
	,SOURCE_STATE: null
	,INITIAL: null
	,PLAYING: null
	,PAUSED: null
	,STOPPED: null
	,BUFFERS_QUEUED: null
	,BUFFERS_PROCESSED: null
	,REFERENCE_DISTANCE: null
	,ROLLOFF_FACTOR: null
	,CONE_OUTER_GAIN: null
	,MAX_DISTANCE: null
	,SEC_OFFSET: null
	,SAMPLE_OFFSET: null
	,BYTE_OFFSET: null
	,SOURCE_TYPE: null
	,STATIC: null
	,STREAMING: null
	,UNDETERMINED: null
	,FORMAT_MONO8: null
	,FORMAT_MONO16: null
	,FORMAT_STEREO8: null
	,FORMAT_STEREO16: null
	,FREQUENCY: null
	,BITS: null
	,CHANNELS: null
	,SIZE: null
	,NO_ERROR: null
	,INVALID_NAME: null
	,INVALID_ENUM: null
	,INVALID_VALUE: null
	,INVALID_OPERATION: null
	,OUT_OF_MEMORY: null
	,VENDOR: null
	,VERSION: null
	,RENDERER: null
	,EXTENSIONS: null
	,DOPPLER_FACTOR: null
	,SPEED_OF_SOUND: null
	,DOPPLER_VELOCITY: null
	,DISTANCE_MODEL: null
	,INVERSE_DISTANCE: null
	,INVERSE_DISTANCE_CLAMPED: null
	,LINEAR_DISTANCE: null
	,LINEAR_DISTANCE_CLAMPED: null
	,EXPONENT_DISTANCE: null
	,EXPONENT_DISTANCE_CLAMPED: null
	,REFRESH: null
	,SYNC: null
	,MONO_SOURCES: null
	,STEREO_SOURCES: null
	,INVALID_DEVICE: null
	,INVALID_CONTEXT: null
	,ATTRIBUTES_SIZE: null
	,ALL_ATTRIBUTES: null
	,DEFAULT_DEVICE_SPECIFIER: null
	,DEVICE_SPECIFIER: null
	,ENUMERATE_ALL_EXT: null
	,DEFAULT_ALL_DEVICES_SPECIFIER: null
	,ALL_DEVICES_SPECIFIER: null
	,bufferData: function(buffer,format,data,size,freq) {
		lime_media_openal_AL.bufferData(buffer,format,data,size,freq);
	}
	,buffer3f: function(buffer,param,value1,value2,value3) {
		lime_media_openal_AL.buffer3f(buffer,param,value1,value2,value3);
	}
	,buffer3i: function(buffer,param,value1,value2,value3) {
		lime_media_openal_AL.buffer3i(buffer,param,value1,value2,value3);
	}
	,bufferf: function(buffer,param,value) {
		lime_media_openal_AL.bufferf(buffer,param,value);
	}
	,bufferfv: function(buffer,param,values) {
		lime_media_openal_AL.bufferfv(buffer,param,values);
	}
	,bufferi: function(buffer,param,value) {
		lime_media_openal_AL.bufferi(buffer,param,value);
	}
	,bufferiv: function(buffer,param,values) {
		lime_media_openal_AL.bufferiv(buffer,param,values);
	}
	,closeDevice: function(device) {
		return lime_media_openal_ALC.closeDevice(device);
	}
	,createContext: function(device,attrlist) {
		return lime_media_openal_ALC.createContext(device,attrlist);
	}
	,createBuffer: function() {
		return lime_media_openal_AL.createBuffer();
	}
	,createSource: function() {
		return lime_media_openal_AL.createSource();
	}
	,deleteBuffer: function(buffer) {
		lime_media_openal_AL.deleteBuffer(buffer);
	}
	,deleteBuffers: function(buffers) {
		lime_media_openal_AL.deleteBuffers(buffers);
	}
	,deleteSource: function(source) {
		lime_media_openal_AL.deleteSource(source);
	}
	,deleteSources: function(sources) {
		lime_media_openal_AL.deleteSources(sources);
	}
	,destroyContext: function(context) {
		if(context == null) {
			return;
		}
		lime_media_openal_ALC.destroyContext(context);
	}
	,disable: function(capability) {
		lime_media_openal_AL.disable(capability);
	}
	,distanceModel: function(distanceModel) {
		lime_media_openal_AL.distanceModel(distanceModel);
	}
	,dopplerFactor: function(value) {
		lime_media_openal_AL.dopplerFactor(value);
	}
	,dopplerVelocity: function(value) {
		lime_media_openal_AL.dopplerVelocity(value);
	}
	,enable: function(capability) {
		lime_media_openal_AL.enable(capability);
	}
	,genSource: function() {
		return this.createSource();
	}
	,genSources: function(n) {
		return lime_media_openal_AL.genSources(n);
	}
	,genBuffer: function() {
		return this.createBuffer();
	}
	,genBuffers: function(n) {
		return lime_media_openal_AL.genBuffers(n);
	}
	,getBoolean: function(param) {
		return lime_media_openal_AL.getBoolean(param);
	}
	,getBooleanv: function(param,count) {
		if(count == null) {
			count = 1;
		}
		return lime_media_openal_AL.getBooleanv(param,count);
	}
	,getBuffer3f: function(buffer,param) {
		return lime_media_openal_AL.getBuffer3f(buffer,param);
	}
	,getBuffer3i: function(buffer,param) {
		return lime_media_openal_AL.getBuffer3i(buffer,param);
	}
	,getBufferf: function(buffer,param) {
		return lime_media_openal_AL.getBufferf(buffer,param);
	}
	,getBufferfv: function(buffer,param,count) {
		if(count == null) {
			count = 1;
		}
		return lime_media_openal_AL.getBufferfv(buffer,param,count);
	}
	,getBufferi: function(buffer,param) {
		return lime_media_openal_AL.getBufferi(buffer,param);
	}
	,getBufferiv: function(buffer,param,count) {
		if(count == null) {
			count = 1;
		}
		return lime_media_openal_AL.getBufferiv(buffer,param,count);
	}
	,getContextsDevice: function(context) {
		if(context == null) {
			return null;
		}
		return lime_media_openal_ALC.getContextsDevice(context);
	}
	,getCurrentContext: function() {
		return lime_media_openal_ALC.getCurrentContext();
	}
	,getDouble: function(param) {
		return lime_media_openal_AL.getDouble(param);
	}
	,getDoublev: function(param,count) {
		if(count == null) {
			count = 1;
		}
		return lime_media_openal_AL.getDoublev(param,count);
	}
	,getEnumValue: function(ename) {
		return lime_media_openal_AL.getEnumValue(ename);
	}
	,getError: function(device) {
		if(device == null) {
			return lime_media_openal_AL.getError();
		} else {
			return lime_media_openal_ALC.getError(device);
		}
	}
	,getErrorString: function(device) {
		if(device == null) {
			return lime_media_openal_AL.getErrorString();
		} else {
			return lime_media_openal_ALC.getErrorString(device);
		}
	}
	,getFloat: function(param) {
		return lime_media_openal_AL.getFloat(param);
	}
	,getFloatv: function(param,count) {
		if(count == null) {
			count = 1;
		}
		return lime_media_openal_AL.getFloatv(param,count);
	}
	,getInteger: function(param) {
		return lime_media_openal_AL.getInteger(param);
	}
	,getIntegerv: function(param,count,device) {
		if(count == null) {
			count = 1;
		}
		if(device == null) {
			return lime_media_openal_AL.getIntegerv(param,count);
		} else {
			return lime_media_openal_ALC.getIntegerv(device,param,count);
		}
	}
	,getListener3f: function(param) {
		return lime_media_openal_AL.getListener3f(param);
	}
	,getListener3i: function(param) {
		return lime_media_openal_AL.getListener3i(param);
	}
	,getListenerf: function(param) {
		return lime_media_openal_AL.getListenerf(param);
	}
	,getListenerfv: function(param,count) {
		if(count == null) {
			count = 1;
		}
		return lime_media_openal_AL.getListenerfv(param,count);
	}
	,getListeneri: function(param) {
		return lime_media_openal_AL.getListeneri(param);
	}
	,getListeneriv: function(param,count) {
		if(count == null) {
			count = 1;
		}
		return lime_media_openal_AL.getListeneriv(param,count);
	}
	,getProcAddress: function(fname) {
		return lime_media_openal_AL.getProcAddress(fname);
	}
	,getSource3f: function(source,param) {
		return lime_media_openal_AL.getSource3f(source,param);
	}
	,getSourcef: function(source,param) {
		return lime_media_openal_AL.getSourcef(source,param);
	}
	,getSource3i: function(source,param) {
		return lime_media_openal_AL.getSource3i(source,param);
	}
	,getSourcefv: function(source,param,count) {
		if(count == null) {
			count = 1;
		}
		return lime_media_openal_AL.getSourcefv(source,param);
	}
	,getSourcei: function(source,param) {
		return lime_media_openal_AL.getSourcei(source,param);
	}
	,getSourceiv: function(source,param,count) {
		if(count == null) {
			count = 1;
		}
		return lime_media_openal_AL.getSourceiv(source,param,count);
	}
	,getString: function(param,device) {
		if(device == null) {
			return lime_media_openal_AL.getString(param);
		} else {
			return lime_media_openal_ALC.getString(device,param);
		}
	}
	,isBuffer: function(buffer) {
		return lime_media_openal_AL.isBuffer(buffer);
	}
	,isEnabled: function(capability) {
		return lime_media_openal_AL.isEnabled(capability);
	}
	,isExtensionPresent: function(extname) {
		return lime_media_openal_AL.isExtensionPresent(extname);
	}
	,isSource: function(source) {
		return lime_media_openal_AL.isSource(source);
	}
	,listener3f: function(param,value1,value2,value3) {
		lime_media_openal_AL.listener3f(param,value1,value2,value3);
	}
	,listener3i: function(param,value1,value2,value3) {
		lime_media_openal_AL.listener3i(param,value1,value2,value3);
	}
	,listenerf: function(param,value) {
		lime_media_openal_AL.listenerf(param,value);
	}
	,listenerfv: function(param,values) {
		lime_media_openal_AL.listenerfv(param,values);
	}
	,listeneri: function(param,value) {
		lime_media_openal_AL.listeneri(param,value);
	}
	,listeneriv: function(param,values) {
		lime_media_openal_AL.listeneriv(param,values);
	}
	,makeContextCurrent: function(context) {
		return lime_media_openal_ALC.makeContextCurrent(context);
	}
	,openDevice: function(deviceName) {
		return lime_media_openal_ALC.openDevice(deviceName);
	}
	,pauseDevice: function(device) {
		lime_media_openal_ALC.pauseDevice(device);
	}
	,processContext: function(context) {
		lime_media_openal_ALC.processContext(context);
	}
	,resumeDevice: function(device) {
		lime_media_openal_ALC.resumeDevice(device);
	}
	,source3f: function(source,param,value1,value2,value3) {
		lime_media_openal_AL.source3f(source,param,value1,value2,value3);
	}
	,source3i: function(source,param,value1,value2,value3) {
		lime_media_openal_AL.source3i(source,param,value1,value2,value3);
	}
	,sourcef: function(source,param,value) {
		lime_media_openal_AL.sourcef(source,param,value);
	}
	,sourcefv: function(source,param,values) {
		lime_media_openal_AL.sourcefv(source,param,values);
	}
	,sourcei: function(source,param,value) {
		lime_media_openal_AL.sourcei(source,param,value);
	}
	,sourceiv: function(source,param,values) {
		lime_media_openal_AL.sourceiv(source,param,values);
	}
	,sourcePlay: function(source) {
		lime_media_openal_AL.sourcePlay(source);
	}
	,sourcePlayv: function(sources) {
		lime_media_openal_AL.sourcePlayv(sources);
	}
	,sourceStop: function(source) {
		lime_media_openal_AL.sourceStop(source);
	}
	,sourceStopv: function(sources) {
		lime_media_openal_AL.sourceStopv(sources);
	}
	,sourceRewind: function(source) {
		lime_media_openal_AL.sourceRewind(source);
	}
	,sourceRewindv: function(sources) {
		lime_media_openal_AL.sourceRewindv(sources);
	}
	,sourcePause: function(source) {
		lime_media_openal_AL.sourcePause(source);
	}
	,sourcePausev: function(sources) {
		lime_media_openal_AL.sourcePausev(sources);
	}
	,sourceQueueBuffer: function(source,buffer) {
		lime_media_openal_AL.sourceQueueBuffer(source,buffer);
	}
	,sourceQueueBuffers: function(source,nb,buffers) {
		lime_media_openal_AL.sourceQueueBuffers(source,nb,buffers);
	}
	,sourceUnqueueBuffer: function(source) {
		return lime_media_openal_AL.sourceUnqueueBuffer(source);
	}
	,sourceUnqueueBuffers: function(source,nb) {
		return lime_media_openal_AL.sourceUnqueueBuffers(source,nb);
	}
	,speedOfSound: function(value) {
		lime_media_openal_AL.speedOfSound(value);
	}
	,suspendContext: function(context) {
		lime_media_openal_ALC.suspendContext(context);
	}
	,__class__: lime_media_OpenALAudioContext
};
var lime_media_openal_AL = function() { };
$hxClasses["lime.media.openal.AL"] = lime_media_openal_AL;
lime_media_openal_AL.__name__ = "lime.media.openal.AL";
lime_media_openal_AL.removeDirectFilter = function(source) {
};
lime_media_openal_AL.removeSend = function(source,index) {
};
lime_media_openal_AL.auxf = function(aux,param,value) {
};
lime_media_openal_AL.auxfv = function(aux,param,values) {
};
lime_media_openal_AL.auxi = function(aux,param,value) {
};
lime_media_openal_AL.auxiv = function(aux,param,values) {
};
lime_media_openal_AL.bufferData = function(buffer,format,data,size,freq) {
};
lime_media_openal_AL.buffer3f = function(buffer,param,value1,value2,value3) {
};
lime_media_openal_AL.buffer3i = function(buffer,param,value1,value2,value3) {
};
lime_media_openal_AL.bufferf = function(buffer,param,value) {
};
lime_media_openal_AL.bufferfv = function(buffer,param,values) {
};
lime_media_openal_AL.bufferi = function(buffer,param,value) {
};
lime_media_openal_AL.bufferiv = function(buffer,param,values) {
};
lime_media_openal_AL.createAux = function() {
	return null;
};
lime_media_openal_AL.createBuffer = function() {
	return null;
};
lime_media_openal_AL.createEffect = function() {
	return null;
};
lime_media_openal_AL.createFilter = function() {
	return null;
};
lime_media_openal_AL.createSource = function() {
	return null;
};
lime_media_openal_AL.deleteBuffer = function(buffer) {
};
lime_media_openal_AL.deleteBuffers = function(buffers) {
};
lime_media_openal_AL.deleteSource = function(source) {
};
lime_media_openal_AL.deleteSources = function(sources) {
};
lime_media_openal_AL.disable = function(capability) {
};
lime_media_openal_AL.distanceModel = function(distanceModel) {
};
lime_media_openal_AL.dopplerFactor = function(value) {
};
lime_media_openal_AL.dopplerVelocity = function(value) {
};
lime_media_openal_AL.effectf = function(effect,param,value) {
};
lime_media_openal_AL.effectfv = function(effect,param,values) {
};
lime_media_openal_AL.effecti = function(effect,param,value) {
};
lime_media_openal_AL.effectiv = function(effect,param,values) {
};
lime_media_openal_AL.enable = function(capability) {
};
lime_media_openal_AL.genSource = function() {
	return null;
};
lime_media_openal_AL.genSources = function(n) {
	return null;
};
lime_media_openal_AL.genBuffer = function() {
	return null;
};
lime_media_openal_AL.genBuffers = function(n) {
	return null;
};
lime_media_openal_AL.getBoolean = function(param) {
	return false;
};
lime_media_openal_AL.getBooleanv = function(param,count) {
	if(count == null) {
		count = 1;
	}
	return null;
};
lime_media_openal_AL.getBuffer3f = function(buffer,param) {
	return null;
};
lime_media_openal_AL.getBuffer3i = function(buffer,param) {
	return null;
};
lime_media_openal_AL.getBufferf = function(buffer,param) {
	return 0;
};
lime_media_openal_AL.getBufferfv = function(buffer,param,count) {
	if(count == null) {
		count = 1;
	}
	return null;
};
lime_media_openal_AL.getBufferi = function(buffer,param) {
	return 0;
};
lime_media_openal_AL.getBufferiv = function(buffer,param,count) {
	if(count == null) {
		count = 1;
	}
	return null;
};
lime_media_openal_AL.getDouble = function(param) {
	return 0;
};
lime_media_openal_AL.getDoublev = function(param,count) {
	if(count == null) {
		count = 1;
	}
	return null;
};
lime_media_openal_AL.getEnumValue = function(ename) {
	return 0;
};
lime_media_openal_AL.getError = function() {
	return 0;
};
lime_media_openal_AL.getErrorString = function() {
	switch(lime_media_openal_AL.getError()) {
	case 40961:
		return "INVALID_NAME: Invalid parameter name";
	case 40962:
		return "INVALID_ENUM: Invalid enum value";
	case 40963:
		return "INVALID_VALUE: Invalid parameter value";
	case 40964:
		return "INVALID_OPERATION: Illegal operation or call";
	case 40965:
		return "OUT_OF_MEMORY: OpenAL has run out of memory";
	default:
		return "";
	}
};
lime_media_openal_AL.getFilteri = function(filter,param) {
	return 0;
};
lime_media_openal_AL.getFloat = function(param) {
	return 0;
};
lime_media_openal_AL.getFloatv = function(param,count) {
	if(count == null) {
		count = 1;
	}
	return null;
};
lime_media_openal_AL.getInteger = function(param) {
	return 0;
};
lime_media_openal_AL.getIntegerv = function(param,count) {
	if(count == null) {
		count = 1;
	}
	return null;
};
lime_media_openal_AL.getListener3f = function(param) {
	return null;
};
lime_media_openal_AL.getListener3i = function(param) {
	return null;
};
lime_media_openal_AL.getListenerf = function(param) {
	return 0;
};
lime_media_openal_AL.getListenerfv = function(param,count) {
	if(count == null) {
		count = 1;
	}
	return null;
};
lime_media_openal_AL.getListeneri = function(param) {
	return 0;
};
lime_media_openal_AL.getListeneriv = function(param,count) {
	if(count == null) {
		count = 1;
	}
	return null;
};
lime_media_openal_AL.getParameter = function(param) {
	return null;
};
lime_media_openal_AL.getProcAddress = function(fname) {
	return null;
};
lime_media_openal_AL.getSource3f = function(source,param) {
	return null;
};
lime_media_openal_AL.getSourcef = function(source,param) {
	return 0;
};
lime_media_openal_AL.getSource3i = function(source,param) {
	return null;
};
lime_media_openal_AL.getSourcefv = function(source,param,count) {
	if(count == null) {
		count = 1;
	}
	return null;
};
lime_media_openal_AL.getSourcei = function(source,param) {
	return 0;
};
lime_media_openal_AL.getSourceiv = function(source,param,count) {
	if(count == null) {
		count = 1;
	}
	return null;
};
lime_media_openal_AL.getString = function(param) {
	return null;
};
lime_media_openal_AL.isBuffer = function(buffer) {
	return false;
};
lime_media_openal_AL.isEnabled = function(capability) {
	return false;
};
lime_media_openal_AL.isExtensionPresent = function(extname) {
	return false;
};
lime_media_openal_AL.isAux = function(aux) {
	return false;
};
lime_media_openal_AL.isEffect = function(effect) {
	return false;
};
lime_media_openal_AL.isFilter = function(filter) {
	return false;
};
lime_media_openal_AL.isSource = function(source) {
	return false;
};
lime_media_openal_AL.listener3f = function(param,value1,value2,value3) {
};
lime_media_openal_AL.listener3i = function(param,value1,value2,value3) {
};
lime_media_openal_AL.listenerf = function(param,value) {
};
lime_media_openal_AL.listenerfv = function(param,values) {
};
lime_media_openal_AL.listeneri = function(param,value) {
};
lime_media_openal_AL.listeneriv = function(param,values) {
};
lime_media_openal_AL.source3f = function(source,param,value1,value2,value3) {
};
lime_media_openal_AL.source3i = function(source,param,value1,value2,value3) {
};
lime_media_openal_AL.sourcef = function(source,param,value) {
};
lime_media_openal_AL.sourcefv = function(source,param,values) {
};
lime_media_openal_AL.sourcei = function(source,param,value) {
};
lime_media_openal_AL.filteri = function(filter,param,value) {
};
lime_media_openal_AL.filterf = function(filter,param,value) {
};
lime_media_openal_AL.sourceiv = function(source,param,values) {
};
lime_media_openal_AL.sourcePlay = function(source) {
};
lime_media_openal_AL.sourcePlayv = function(sources) {
};
lime_media_openal_AL.sourceStop = function(source) {
};
lime_media_openal_AL.sourceStopv = function(sources) {
};
lime_media_openal_AL.sourceRewind = function(source) {
};
lime_media_openal_AL.sourceRewindv = function(sources) {
};
lime_media_openal_AL.sourcePause = function(source) {
};
lime_media_openal_AL.sourcePausev = function(sources) {
};
lime_media_openal_AL.sourceQueueBuffer = function(source,buffer) {
};
lime_media_openal_AL.sourceQueueBuffers = function(source,nb,buffers) {
};
lime_media_openal_AL.sourceUnqueueBuffer = function(source) {
	return 0;
};
lime_media_openal_AL.sourceUnqueueBuffers = function(source,nb) {
	return null;
};
lime_media_openal_AL.speedOfSound = function(value) {
};
var lime_media_openal_ALAuxiliaryEffectSlot = {};
lime_media_openal_ALAuxiliaryEffectSlot._new = function(handle) {
	var this1 = handle;
	return this1;
};
var lime_media_openal_ALBuffer = {};
lime_media_openal_ALBuffer._new = function(handle) {
	var this1 = handle;
	return this1;
};
var lime_media_openal_ALC = function() { };
$hxClasses["lime.media.openal.ALC"] = lime_media_openal_ALC;
lime_media_openal_ALC.__name__ = "lime.media.openal.ALC";
lime_media_openal_ALC.closeDevice = function(device) {
	return false;
};
lime_media_openal_ALC.createContext = function(device,attrlist) {
	return null;
};
lime_media_openal_ALC.destroyContext = function(context) {
};
lime_media_openal_ALC.getContextsDevice = function(context) {
	return null;
};
lime_media_openal_ALC.getCurrentContext = function() {
	return null;
};
lime_media_openal_ALC.getError = function(device) {
	return 0;
};
lime_media_openal_ALC.getErrorString = function(device) {
	switch(lime_media_openal_ALC.getError(device)) {
	case 40961:
		return "INVALID_DEVICE: Invalid device (or no device?)";
	case 40962:
		return "INVALID_CONTEXT: Invalid context (or no context?)";
	case 40963:
		return "INVALID_ENUM: Invalid enum value";
	case 40964:
		return "INVALID_VALUE: Invalid param value";
	case 40965:
		return "OUT_OF_MEMORY: OpenAL has run out of memory";
	default:
		return "";
	}
};
lime_media_openal_ALC.getIntegerv = function(device,param,size) {
	return null;
};
lime_media_openal_ALC.getString = function(device,param) {
	return null;
};
lime_media_openal_ALC.makeContextCurrent = function(context) {
	return false;
};
lime_media_openal_ALC.openDevice = function(deviceName) {
	return null;
};
lime_media_openal_ALC.pauseDevice = function(device) {
};
lime_media_openal_ALC.processContext = function(context) {
};
lime_media_openal_ALC.resumeDevice = function(device) {
};
lime_media_openal_ALC.suspendContext = function(context) {
};
var lime_media_openal_ALContext = {};
lime_media_openal_ALContext._new = function(handle) {
	var this1 = handle;
	return this1;
};
var lime_media_openal_ALDevice = {};
lime_media_openal_ALDevice._new = function(handle) {
	var this1 = handle;
	return this1;
};
var lime_media_openal_ALEffect = {};
lime_media_openal_ALEffect._new = function(handle) {
	var this1 = handle;
	return this1;
};
var lime_media_openal_ALFilter = {};
lime_media_openal_ALFilter._new = function(handle) {
	var this1 = handle;
	return this1;
};
var lime_media_openal_ALSource = {};
lime_media_openal_ALSource._new = function(handle) {
	var this1 = handle;
	return this1;
};
var lime_media_vorbis_VorbisComment = function() {
};
$hxClasses["lime.media.vorbis.VorbisComment"] = lime_media_vorbis_VorbisComment;
lime_media_vorbis_VorbisComment.__name__ = "lime.media.vorbis.VorbisComment";
lime_media_vorbis_VorbisComment.prototype = {
	userComments: null
	,vendor: null
	,__class__: lime_media_vorbis_VorbisComment
};
var lime_media_vorbis_VorbisFile = function(handle) {
	this.handle = handle;
};
$hxClasses["lime.media.vorbis.VorbisFile"] = lime_media_vorbis_VorbisFile;
lime_media_vorbis_VorbisFile.__name__ = "lime.media.vorbis.VorbisFile";
lime_media_vorbis_VorbisFile.fromBytes = function(bytes) {
	return null;
};
lime_media_vorbis_VorbisFile.fromFile = function(path) {
	return null;
};
lime_media_vorbis_VorbisFile.prototype = {
	bitstream: null
	,handle: null
	,bitrate: function(bitstream) {
		if(bitstream == null) {
			bitstream = -1;
		}
		return 0;
	}
	,bitrateInstant: function() {
		return 0;
	}
	,clear: function() {
	}
	,comment: function(bitstream) {
		if(bitstream == null) {
			bitstream = -1;
		}
		return null;
	}
	,crosslap: function(other) {
		return 0;
	}
	,info: function(bitstream) {
		if(bitstream == null) {
			bitstream = -1;
		}
		return null;
	}
	,pcmSeek: function(pos) {
		return 0;
	}
	,pcmSeekLap: function(pos) {
		return 0;
	}
	,pcmSeekPage: function(pos) {
		return 0;
	}
	,pcmSeekPageLap: function(pos) {
		return 0;
	}
	,pcmTell: function() {
		var this1 = new haxe__$Int64__$_$_$Int64(0,0);
		return this1;
	}
	,pcmTotal: function(bitstream) {
		if(bitstream == null) {
			bitstream = -1;
		}
		var this1 = new haxe__$Int64__$_$_$Int64(0,0);
		return this1;
	}
	,rawSeek: function(pos) {
		return 0;
	}
	,rawSeekLap: function(pos) {
		return 0;
	}
	,rawTell: function() {
		var this1 = new haxe__$Int64__$_$_$Int64(0,0);
		return this1;
	}
	,rawTotal: function(bitstream) {
		if(bitstream == null) {
			bitstream = -1;
		}
		var this1 = new haxe__$Int64__$_$_$Int64(0,0);
		return this1;
	}
	,read: function(buffer,position,length,bigEndianPacking,wordSize,signed) {
		if(signed == null) {
			signed = true;
		}
		if(wordSize == null) {
			wordSize = 2;
		}
		if(bigEndianPacking == null) {
			bigEndianPacking = false;
		}
		if(length == null) {
			length = 4096;
		}
		return 0;
	}
	,readFloat: function(pcmChannels,samples) {
		return 0;
	}
	,seekable: function() {
		return false;
	}
	,serialNumber: function(bitstream) {
		if(bitstream == null) {
			bitstream = -1;
		}
		return 0;
	}
	,streams: function() {
		return 0;
	}
	,timeSeek: function(s) {
		return 0;
	}
	,timeSeekLap: function(s) {
		return 0;
	}
	,timeSeekPage: function(s) {
		return 0;
	}
	,timeSeekPageLap: function(s) {
		return 0;
	}
	,timeTell: function() {
		return 0;
	}
	,timeTotal: function(bitstream) {
		if(bitstream == null) {
			bitstream = -1;
		}
		return 0;
	}
	,__class__: lime_media_vorbis_VorbisFile
};
var lime_media_vorbis_VorbisInfo = function() {
};
$hxClasses["lime.media.vorbis.VorbisInfo"] = lime_media_vorbis_VorbisInfo;
lime_media_vorbis_VorbisInfo.__name__ = "lime.media.vorbis.VorbisInfo";
lime_media_vorbis_VorbisInfo.prototype = {
	bitrateLower: null
	,bitrateNominal: null
	,bitrateUpper: null
	,channels: null
	,rate: null
	,version: null
	,__class__: lime_media_vorbis_VorbisInfo
};
var lime_net__$IHTTPRequest = function() { };
$hxClasses["lime.net._IHTTPRequest"] = lime_net__$IHTTPRequest;
lime_net__$IHTTPRequest.__name__ = "lime.net._IHTTPRequest";
lime_net__$IHTTPRequest.__isInterface__ = true;
lime_net__$IHTTPRequest.prototype = {
	contentType: null
	,data: null
	,enableResponseHeaders: null
	,followRedirects: null
	,formData: null
	,headers: null
	,method: null
	,responseHeaders: null
	,responseStatus: null
	,timeout: null
	,uri: null
	,userAgent: null
	,withCredentials: null
	,cancel: null
	,__class__: lime_net__$IHTTPRequest
};
var lime_net__$HTTPRequest_AbstractHTTPRequest = function(uri) {
	this.uri = uri;
	this.contentType = "application/x-www-form-urlencoded";
	this.followRedirects = true;
	this.enableResponseHeaders = false;
	this.formData = new haxe_ds_StringMap();
	this.headers = [];
	this.method = "GET";
	this.timeout = 30000;
	this.withCredentials = false;
	this.__backend = new lime__$internal_backend_html5_HTML5HTTPRequest();
	this.__backend.init(this);
};
$hxClasses["lime.net._HTTPRequest.AbstractHTTPRequest"] = lime_net__$HTTPRequest_AbstractHTTPRequest;
lime_net__$HTTPRequest_AbstractHTTPRequest.__name__ = "lime.net._HTTPRequest.AbstractHTTPRequest";
lime_net__$HTTPRequest_AbstractHTTPRequest.__interfaces__ = [lime_net__$IHTTPRequest];
lime_net__$HTTPRequest_AbstractHTTPRequest.prototype = {
	contentType: null
	,data: null
	,enableResponseHeaders: null
	,followRedirects: null
	,formData: null
	,headers: null
	,method: null
	,responseData: null
	,responseHeaders: null
	,responseStatus: null
	,timeout: null
	,uri: null
	,userAgent: null
	,withCredentials: null
	,__backend: null
	,cancel: function() {
		this.__backend.cancel();
	}
	,load: function(uri) {
		return null;
	}
	,__class__: lime_net__$HTTPRequest_AbstractHTTPRequest
};
var lime_net_HTTPRequest = function(uri) {
	lime_net__$HTTPRequest_AbstractHTTPRequest.call(this,uri);
};
$hxClasses["lime.net.HTTPRequest"] = lime_net_HTTPRequest;
lime_net_HTTPRequest.__name__ = "lime.net.HTTPRequest";
lime_net_HTTPRequest.__super__ = lime_net__$HTTPRequest_AbstractHTTPRequest;
lime_net_HTTPRequest.prototype = $extend(lime_net__$HTTPRequest_AbstractHTTPRequest.prototype,{
	__class__: lime_net_HTTPRequest
});
var lime_net__$HTTPRequest_$Bytes = function(uri) {
	lime_net__$HTTPRequest_AbstractHTTPRequest.call(this,uri);
};
$hxClasses["lime.net._HTTPRequest_Bytes"] = lime_net__$HTTPRequest_$Bytes;
lime_net__$HTTPRequest_$Bytes.__name__ = "lime.net._HTTPRequest_Bytes";
lime_net__$HTTPRequest_$Bytes.__super__ = lime_net__$HTTPRequest_AbstractHTTPRequest;
lime_net__$HTTPRequest_$Bytes.prototype = $extend(lime_net__$HTTPRequest_AbstractHTTPRequest.prototype,{
	fromBytes: function(bytes) {
		return bytes;
	}
	,load: function(uri) {
		var _gthis = this;
		if(uri != null) {
			this.uri = uri;
		}
		var promise = new lime_app_Promise();
		var future = this.__backend.loadData(this.uri);
		future.onProgress($bind(promise,promise.progress));
		future.onError($bind(promise,promise.error));
		future.onComplete(function(bytes) {
			_gthis.responseData = _gthis.fromBytes(bytes);
			promise.complete(_gthis.responseData);
		});
		return promise.future;
	}
	,__class__: lime_net__$HTTPRequest_$Bytes
});
var lime_net__$HTTPRequest_$String = function(uri) {
	lime_net__$HTTPRequest_AbstractHTTPRequest.call(this,uri);
};
$hxClasses["lime.net._HTTPRequest_String"] = lime_net__$HTTPRequest_$String;
lime_net__$HTTPRequest_$String.__name__ = "lime.net._HTTPRequest_String";
lime_net__$HTTPRequest_$String.__super__ = lime_net__$HTTPRequest_AbstractHTTPRequest;
lime_net__$HTTPRequest_$String.prototype = $extend(lime_net__$HTTPRequest_AbstractHTTPRequest.prototype,{
	load: function(uri) {
		var _gthis = this;
		if(uri != null) {
			this.uri = uri;
		}
		var promise = new lime_app_Promise();
		var future = this.__backend.loadText(this.uri);
		future.onProgress($bind(promise,promise.progress));
		future.onError($bind(promise,promise.error));
		future.onComplete(function(text) {
			_gthis.responseData = text;
			promise.complete(_gthis.responseData);
		});
		return promise.future;
	}
	,__class__: lime_net__$HTTPRequest_$String
});
var lime_net_HTTPRequestHeader = function(name,value) {
	if(value == null) {
		value = "";
	}
	this.name = name;
	this.value = value;
};
$hxClasses["lime.net.HTTPRequestHeader"] = lime_net_HTTPRequestHeader;
lime_net_HTTPRequestHeader.__name__ = "lime.net.HTTPRequestHeader";
lime_net_HTTPRequestHeader.prototype = {
	name: null
	,value: null
	,__class__: lime_net_HTTPRequestHeader
};
var lime_net__$HTTPRequest_$lime_$text_$Font = function(uri) {
	lime_net__$HTTPRequest_$Bytes.call(this,uri);
};
$hxClasses["lime.net._HTTPRequest_lime_text_Font"] = lime_net__$HTTPRequest_$lime_$text_$Font;
lime_net__$HTTPRequest_$lime_$text_$Font.__name__ = "lime.net._HTTPRequest_lime_text_Font";
lime_net__$HTTPRequest_$lime_$text_$Font.__super__ = lime_net__$HTTPRequest_$Bytes;
lime_net__$HTTPRequest_$lime_$text_$Font.prototype = $extend(lime_net__$HTTPRequest_$Bytes.prototype,{
	fromBytes: function(bytes) {
		return lime_text_Font.fromBytes(bytes);
	}
	,__class__: lime_net__$HTTPRequest_$lime_$text_$Font
});
var lime_net__$HTTPRequest_$lime_$utils_$Bytes = function(uri) {
	lime_net__$HTTPRequest_$Bytes.call(this,uri);
};
$hxClasses["lime.net._HTTPRequest_lime_utils_Bytes"] = lime_net__$HTTPRequest_$lime_$utils_$Bytes;
lime_net__$HTTPRequest_$lime_$utils_$Bytes.__name__ = "lime.net._HTTPRequest_lime_utils_Bytes";
lime_net__$HTTPRequest_$lime_$utils_$Bytes.__super__ = lime_net__$HTTPRequest_$Bytes;
lime_net__$HTTPRequest_$lime_$utils_$Bytes.prototype = $extend(lime_net__$HTTPRequest_$Bytes.prototype,{
	fromBytes: function(bytes) {
		return lime_utils_Bytes.fromBytes(bytes);
	}
	,__class__: lime_net__$HTTPRequest_$lime_$utils_$Bytes
});
var lime_net__$HTTPRequest_$openfl_$utils_$ByteArray = function(uri) {
	lime_net__$HTTPRequest_$Bytes.call(this,uri);
};
$hxClasses["lime.net._HTTPRequest_openfl_utils_ByteArray"] = lime_net__$HTTPRequest_$openfl_$utils_$ByteArray;
lime_net__$HTTPRequest_$openfl_$utils_$ByteArray.__name__ = "lime.net._HTTPRequest_openfl_utils_ByteArray";
lime_net__$HTTPRequest_$openfl_$utils_$ByteArray.__super__ = lime_net__$HTTPRequest_$Bytes;
lime_net__$HTTPRequest_$openfl_$utils_$ByteArray.prototype = $extend(lime_net__$HTTPRequest_$Bytes.prototype,{
	fromBytes: function(bytes) {
		return openfl_utils_ByteArray.fromBytes(bytes);
	}
	,__class__: lime_net__$HTTPRequest_$openfl_$utils_$ByteArray
});
var lime_system_CFFI = function() { };
$hxClasses["lime.system.CFFI"] = lime_system_CFFI;
lime_system_CFFI.__name__ = "lime.system.CFFI";
lime_system_CFFI.available = null;
lime_system_CFFI.enabled = null;
lime_system_CFFI.load = function(library,method,args,lazy) {
	if(lazy == null) {
		lazy = false;
	}
	if(args == null) {
		args = 0;
	}
	if(!lime_system_CFFI.enabled) {
		return Reflect.makeVarArgs(function(__) {
			return { };
		});
	}
	var result = null;
	return result;
};
lime_system_CFFI.__findHaxelib = function(library) {
	return "";
};
lime_system_CFFI.__loaderTrace = function(message) {
};
lime_system_CFFI.__sysName = function() {
	return null;
};
lime_system_CFFI.__tryLoad = function(name,library,func,args) {
	return null;
};
var lime_system_CFFIPointer = {};
lime_system_CFFIPointer._new = function(handle) {
	var this1 = handle;
	return this1;
};
lime_system_CFFIPointer.get = function(this1) {
	var tmp = this1 != null;
	return 0;
};
lime_system_CFFIPointer.equals = function(a,b) {
	return lime_system_CFFIPointer.get(a) == b;
};
lime_system_CFFIPointer.equalsPointer = function(a,b) {
	return lime_system_CFFIPointer.get(a) == lime_system_CFFIPointer.get(b);
};
lime_system_CFFIPointer.greaterThan = function(a,b) {
	return lime_system_CFFIPointer.get(a) > b;
};
lime_system_CFFIPointer.greaterThanPointer = function(a,b) {
	return lime_system_CFFIPointer.get(a) > lime_system_CFFIPointer.get(b);
};
lime_system_CFFIPointer.greaterThanOrEqual = function(a,b) {
	return lime_system_CFFIPointer.get(a) >= b;
};
lime_system_CFFIPointer.greaterThanOrEqualPointer = function(a,b) {
	return lime_system_CFFIPointer.get(a) >= lime_system_CFFIPointer.get(b);
};
lime_system_CFFIPointer.lessThan = function(a,b) {
	return lime_system_CFFIPointer.get(a) < b;
};
lime_system_CFFIPointer.lessThanPointer = function(a,b) {
	return lime_system_CFFIPointer.get(a) < lime_system_CFFIPointer.get(b);
};
lime_system_CFFIPointer.lessThanOrEqual = function(a,b) {
	return lime_system_CFFIPointer.get(a) <= b;
};
lime_system_CFFIPointer.lessThanOrEqualPointer = function(a,b) {
	return lime_system_CFFIPointer.get(a) <= lime_system_CFFIPointer.get(b);
};
lime_system_CFFIPointer.notEquals = function(a,b) {
	return lime_system_CFFIPointer.get(a) != b;
};
lime_system_CFFIPointer.notEqualsPointer = function(a,b) {
	return lime_system_CFFIPointer.get(a) != lime_system_CFFIPointer.get(b);
};
var lime_system_Clipboard = function() { };
$hxClasses["lime.system.Clipboard"] = lime_system_Clipboard;
lime_system_Clipboard.__name__ = "lime.system.Clipboard";
lime_system_Clipboard.__properties__ = {set_text:"set_text",get_text:"get_text"};
lime_system_Clipboard._text = null;
lime_system_Clipboard.__update = function() {
	var cacheText = lime_system_Clipboard._text;
	lime_system_Clipboard._text = null;
	if(lime_system_Clipboard._text != cacheText) {
		lime_system_Clipboard.onUpdate.dispatch();
	}
};
lime_system_Clipboard.get_text = function() {
	lime_system_Clipboard.__update();
	return lime_system_Clipboard._text;
};
lime_system_Clipboard.set_text = function(value) {
	var cacheText = lime_system_Clipboard._text;
	lime_system_Clipboard._text = value;
	var $window = lime_app_Application.current.__window;
	if($window != null) {
		$window.__backend.setClipboard(value);
	}
	if(lime_system_Clipboard._text != cacheText) {
		lime_system_Clipboard.onUpdate.dispatch();
	}
	return value;
};
var lime_system_Display = function() {
};
$hxClasses["lime.system.Display"] = lime_system_Display;
lime_system_Display.__name__ = "lime.system.Display";
lime_system_Display.prototype = {
	bounds: null
	,currentMode: null
	,id: null
	,dpi: null
	,name: null
	,supportedModes: null
	,__class__: lime_system_Display
};
var lime_system_DisplayMode = function(width,height,refreshRate,pixelFormat) {
	this.width = width;
	this.height = height;
	this.refreshRate = refreshRate;
	this.pixelFormat = pixelFormat;
};
$hxClasses["lime.system.DisplayMode"] = lime_system_DisplayMode;
lime_system_DisplayMode.__name__ = "lime.system.DisplayMode";
lime_system_DisplayMode.prototype = {
	height: null
	,pixelFormat: null
	,refreshRate: null
	,width: null
	,__class__: lime_system_DisplayMode
};
var lime_system_Endian = $hxEnums["lime.system.Endian"] = { __ename__ : "lime.system.Endian", __constructs__ : ["LITTLE_ENDIAN","BIG_ENDIAN"]
	,LITTLE_ENDIAN: {_hx_index:0,__enum__:"lime.system.Endian",toString:$estr}
	,BIG_ENDIAN: {_hx_index:1,__enum__:"lime.system.Endian",toString:$estr}
};
var lime_system_Sensor = function(type,id) {
	this.onUpdate = new lime_app__$Event_$Float_$Float_$Float_$Void();
	this.type = type;
	this.id = id;
};
$hxClasses["lime.system.Sensor"] = lime_system_Sensor;
lime_system_Sensor.__name__ = "lime.system.Sensor";
lime_system_Sensor.getSensors = function(type) {
	if(type == null) {
		return lime_system_Sensor.sensors.slice();
	} else {
		var result = [];
		var _g = 0;
		var _g1 = lime_system_Sensor.sensors;
		while(_g < _g1.length) {
			var sensor = _g1[_g];
			++_g;
			if(sensor.type == type) {
				result.push(sensor);
			}
		}
		return result;
	}
};
lime_system_Sensor.registerSensor = function(type,id) {
	var sensor = new lime_system_Sensor(type,id);
	lime_system_Sensor.sensors.push(sensor);
	lime_system_Sensor.sensorByID.h[id] = sensor;
	return sensor;
};
lime_system_Sensor.prototype = {
	id: null
	,onUpdate: null
	,type: null
	,__class__: lime_system_Sensor
};
var lime_system_SensorType = $hxEnums["lime.system.SensorType"] = { __ename__ : "lime.system.SensorType", __constructs__ : ["ACCELEROMETER"]
	,ACCELEROMETER: {_hx_index:0,__enum__:"lime.system.SensorType",toString:$estr}
};
var lime_system_System = function() { };
$hxClasses["lime.system.System"] = lime_system_System;
lime_system_System.__name__ = "lime.system.System";
lime_system_System.__properties__ = {get_userDirectory:"get_userDirectory",get_platformVersion:"get_platformVersion",get_platformName:"get_platformName",get_platformLabel:"get_platformLabel",get_numDisplays:"get_numDisplays",get_fontsDirectory:"get_fontsDirectory",get_endianness:"get_endianness",get_documentsDirectory:"get_documentsDirectory",get_deviceVendor:"get_deviceVendor",get_deviceModel:"get_deviceModel",get_desktopDirectory:"get_desktopDirectory",get_applicationStorageDirectory:"get_applicationStorageDirectory",get_applicationDirectory:"get_applicationDirectory",set_allowScreenTimeout:"set_allowScreenTimeout",get_allowScreenTimeout:"get_allowScreenTimeout"};
lime_system_System.disableCFFI = null;
lime_system_System.__applicationDirectory = null;
lime_system_System.__applicationEntryPoint = null;
lime_system_System.__applicationStorageDirectory = null;
lime_system_System.__desktopDirectory = null;
lime_system_System.__deviceModel = null;
lime_system_System.__deviceVendor = null;
lime_system_System.__documentsDirectory = null;
lime_system_System.__endianness = null;
lime_system_System.__fontsDirectory = null;
lime_system_System.__platformLabel = null;
lime_system_System.__platformName = null;
lime_system_System.__platformVersion = null;
lime_system_System.__userDirectory = null;
lime_system_System.embed = $hx_exports["lime"]["embed"] = function(projectName,element,width,height,config) {
	if(lime_system_System.__applicationEntryPoint == null) {
		return;
	}
	if(Object.prototype.hasOwnProperty.call(lime_system_System.__applicationEntryPoint.h,projectName)) {
		var htmlElement = null;
		if(typeof(element) == "string") {
			htmlElement = window.document.getElementById(element);
		} else if(element == null) {
			htmlElement = window.document.createElement("div");
		} else {
			htmlElement = element;
		}
		if(htmlElement == null) {
			window.console.log("[lime.embed] ERROR: Cannot find target element: " + Std.string(element));
			return;
		}
		if(width == null) {
			width = 0;
		}
		if(height == null) {
			height = 0;
		}
		if(config == null) {
			config = { };
		}
		if(Object.prototype.hasOwnProperty.call(config,"background") && typeof(config.background) == "string") {
			var background = StringTools.replace(Std.string(config.background),"#","");
			if(background.indexOf("0x") > -1) {
				config.background = Std.parseInt(background);
			} else {
				config.background = Std.parseInt("0x" + background);
			}
		}
		config.element = htmlElement;
		config.width = width;
		config.height = height;
		lime_system_System.__applicationEntryPoint.h[projectName](config);
	}
};
lime_system_System.exit = function(code) {
};
lime_system_System.getDisplay = function(id) {
	if(id == 0) {
		var display = new lime_system_Display();
		display.id = 0;
		display.name = "Generic Display";
		display.dpi = 96 * window.devicePixelRatio;
		display.currentMode = new lime_system_DisplayMode(window.screen.width,window.screen.height,60,1);
		display.supportedModes = [display.currentMode];
		display.bounds = new lime_math_Rectangle(0,0,display.currentMode.width,display.currentMode.height);
		return display;
	}
	return null;
};
lime_system_System.getTimer = function() {
	return window.performance.now() | 0;
};
lime_system_System.load = function(library,method,args,lazy) {
	if(lazy == null) {
		lazy = false;
	}
	if(args == null) {
		args = 0;
	}
	return lime_system_CFFI.load(library,method,args,lazy);
};
lime_system_System.openFile = function(path) {
	if(path != null) {
		window.open(path,"_blank");
	}
};
lime_system_System.openURL = function(url,target) {
	if(target == null) {
		target = "_blank";
	}
	if(url != null) {
		window.open(url,target);
	}
};
lime_system_System.__copyMissingFields = function(target,source) {
	if(source == null || target == null) {
		return;
	}
	var _g = 0;
	var _g1 = Reflect.fields(source);
	while(_g < _g1.length) {
		var field = _g1[_g];
		++_g;
		if(!Object.prototype.hasOwnProperty.call(target,field)) {
			target[field] = Reflect.field(source,field);
		}
	}
};
lime_system_System.__getDirectory = function(type) {
	return null;
};
lime_system_System.__parseBool = function(value) {
	return value == "true";
};
lime_system_System.__registerEntryPoint = function(projectName,entryPoint) {
	if(lime_system_System.__applicationEntryPoint == null) {
		lime_system_System.__applicationEntryPoint = new haxe_ds_StringMap();
	}
	lime_system_System.__applicationEntryPoint.h[projectName] = entryPoint;
};
lime_system_System.__runProcess = function(command,args) {
	return null;
};
lime_system_System.get_allowScreenTimeout = function() {
	return true;
};
lime_system_System.set_allowScreenTimeout = function(value) {
	return true;
};
lime_system_System.get_applicationDirectory = function() {
	if(lime_system_System.__applicationDirectory == null) {
		lime_system_System.__applicationDirectory = lime_system_System.__getDirectory(0);
	}
	return lime_system_System.__applicationDirectory;
};
lime_system_System.get_applicationStorageDirectory = function() {
	if(lime_system_System.__applicationStorageDirectory == null) {
		lime_system_System.__applicationStorageDirectory = lime_system_System.__getDirectory(1);
	}
	return lime_system_System.__applicationStorageDirectory;
};
lime_system_System.get_deviceModel = function() {
	var tmp = lime_system_System.__deviceModel == null;
	return lime_system_System.__deviceModel;
};
lime_system_System.get_deviceVendor = function() {
	var tmp = lime_system_System.__deviceVendor == null;
	return lime_system_System.__deviceVendor;
};
lime_system_System.get_desktopDirectory = function() {
	if(lime_system_System.__desktopDirectory == null) {
		lime_system_System.__desktopDirectory = lime_system_System.__getDirectory(2);
	}
	return lime_system_System.__desktopDirectory;
};
lime_system_System.get_documentsDirectory = function() {
	if(lime_system_System.__documentsDirectory == null) {
		lime_system_System.__documentsDirectory = lime_system_System.__getDirectory(3);
	}
	return lime_system_System.__documentsDirectory;
};
lime_system_System.get_endianness = function() {
	if(lime_system_System.__endianness == null) {
		var arrayBuffer = new ArrayBuffer(2);
		var elements = null;
		var array = null;
		var vector = null;
		var view = null;
		var len = null;
		var this1;
		if(elements != null) {
			this1 = new Uint8Array(elements);
		} else if(array != null) {
			this1 = new Uint8Array(array);
		} else if(vector != null) {
			this1 = new Uint8Array(vector.__array);
		} else if(view != null) {
			this1 = new Uint8Array(view);
		} else if(arrayBuffer != null) {
			if(len == null) {
				this1 = new Uint8Array(arrayBuffer,0);
			} else {
				this1 = new Uint8Array(arrayBuffer,0,len);
			}
		} else {
			this1 = null;
		}
		var uint8Array = this1;
		var elements = null;
		var array = null;
		var vector = null;
		var view = null;
		var len = null;
		var this1;
		if(elements != null) {
			this1 = new Uint16Array(elements);
		} else if(array != null) {
			this1 = new Uint16Array(array);
		} else if(vector != null) {
			this1 = new Uint16Array(vector.__array);
		} else if(view != null) {
			this1 = new Uint16Array(view);
		} else if(arrayBuffer != null) {
			if(len == null) {
				this1 = new Uint16Array(arrayBuffer,0);
			} else {
				this1 = new Uint16Array(arrayBuffer,0,len);
			}
		} else {
			this1 = null;
		}
		var uint16array = this1;
		uint8Array[0] = 170;
		uint8Array[1] = 187;
		if(uint16array[0] == 43707) {
			lime_system_System.__endianness = lime_system_Endian.BIG_ENDIAN;
		} else {
			lime_system_System.__endianness = lime_system_Endian.LITTLE_ENDIAN;
		}
	}
	return lime_system_System.__endianness;
};
lime_system_System.get_fontsDirectory = function() {
	if(lime_system_System.__fontsDirectory == null) {
		lime_system_System.__fontsDirectory = lime_system_System.__getDirectory(4);
	}
	return lime_system_System.__fontsDirectory;
};
lime_system_System.get_numDisplays = function() {
	return 1;
};
lime_system_System.get_platformLabel = function() {
	if(lime_system_System.__platformLabel == null) {
		var name = lime_system_System.get_platformName();
		var version = lime_system_System.get_platformVersion();
		if(name != null && version != null) {
			lime_system_System.__platformLabel = name + " " + version;
		} else if(name != null) {
			lime_system_System.__platformLabel = name;
		}
	}
	return lime_system_System.__platformLabel;
};
lime_system_System.get_platformName = function() {
	if(lime_system_System.__platformName == null) {
		lime_system_System.__platformName = "HTML5";
	}
	return lime_system_System.__platformName;
};
lime_system_System.get_platformVersion = function() {
	var tmp = lime_system_System.__platformVersion == null;
	return lime_system_System.__platformVersion;
};
lime_system_System.get_userDirectory = function() {
	if(lime_system_System.__userDirectory == null) {
		lime_system_System.__userDirectory = lime_system_System.__getDirectory(5);
	}
	return lime_system_System.__userDirectory;
};
var lime_system_ThreadPool = function(minThreads,maxThreads) {
	if(maxThreads == null) {
		maxThreads = 1;
	}
	if(minThreads == null) {
		minThreads = 0;
	}
	this.onRun = new lime_app__$Event_$Dynamic_$Void();
	this.onProgress = new lime_app__$Event_$Dynamic_$Void();
	this.onError = new lime_app__$Event_$Dynamic_$Void();
	this.onComplete = new lime_app__$Event_$Dynamic_$Void();
	this.doWork = new lime_app__$Event_$Dynamic_$Void();
	this.minThreads = minThreads;
	this.maxThreads = maxThreads;
	this.currentThreads = 0;
};
$hxClasses["lime.system.ThreadPool"] = lime_system_ThreadPool;
lime_system_ThreadPool.__name__ = "lime.system.ThreadPool";
lime_system_ThreadPool.prototype = {
	currentThreads: null
	,doWork: null
	,maxThreads: null
	,minThreads: null
	,onComplete: null
	,onError: null
	,onProgress: null
	,onRun: null
	,queue: function(state) {
		this.runWork(state);
	}
	,sendComplete: function(state) {
		this.onComplete.dispatch(state);
	}
	,sendError: function(state) {
		this.onError.dispatch(state);
	}
	,sendProgress: function(state) {
		this.onProgress.dispatch(state);
	}
	,runWork: function(state) {
		this.onRun.dispatch(state);
		this.doWork.dispatch(state);
	}
	,__class__: lime_system_ThreadPool
};
var lime_system__$ThreadPool_ThreadPoolMessageType = $hxEnums["lime.system._ThreadPool.ThreadPoolMessageType"] = { __ename__ : "lime.system._ThreadPool.ThreadPoolMessageType", __constructs__ : ["COMPLETE","ERROR","EXIT","PROGRESS","WORK"]
	,COMPLETE: {_hx_index:0,__enum__:"lime.system._ThreadPool.ThreadPoolMessageType",toString:$estr}
	,ERROR: {_hx_index:1,__enum__:"lime.system._ThreadPool.ThreadPoolMessageType",toString:$estr}
	,EXIT: {_hx_index:2,__enum__:"lime.system._ThreadPool.ThreadPoolMessageType",toString:$estr}
	,PROGRESS: {_hx_index:3,__enum__:"lime.system._ThreadPool.ThreadPoolMessageType",toString:$estr}
	,WORK: {_hx_index:4,__enum__:"lime.system._ThreadPool.ThreadPoolMessageType",toString:$estr}
};
var lime_system__$ThreadPool_ThreadPoolMessage = function(type,state) {
	this.type = type;
	this.state = state;
};
$hxClasses["lime.system._ThreadPool.ThreadPoolMessage"] = lime_system__$ThreadPool_ThreadPoolMessage;
lime_system__$ThreadPool_ThreadPoolMessage.__name__ = "lime.system._ThreadPool.ThreadPoolMessage";
lime_system__$ThreadPool_ThreadPoolMessage.prototype = {
	state: null
	,type: null
	,__class__: lime_system__$ThreadPool_ThreadPoolMessage
};
var lime_text_Glyph = {};
lime_text_Glyph._new = function(i) {
	var this1 = i;
	return this1;
};
var lime_text_GlyphMetrics = function() {
};
$hxClasses["lime.text.GlyphMetrics"] = lime_text_GlyphMetrics;
lime_text_GlyphMetrics.__name__ = "lime.text.GlyphMetrics";
lime_text_GlyphMetrics.prototype = {
	advance: null
	,height: null
	,horizontalBearing: null
	,verticalBearing: null
	,__class__: lime_text_GlyphMetrics
};
var lime_text_harfbuzz_HB = function() { };
$hxClasses["lime.text.harfbuzz.HB"] = lime_text_harfbuzz_HB;
lime_text_harfbuzz_HB.__name__ = "lime.text.harfbuzz.HB";
lime_text_harfbuzz_HB.shape = function(font,buffer,features) {
};
var lime_text_harfbuzz_HBBlob = {};
lime_text_harfbuzz_HBBlob.__properties__ = {get_length:"get_length",get_immutable:"get_immutable",get_dataWritable:"get_dataWritable",get_data:"get_data",get_empty:"get_empty"};
lime_text_harfbuzz_HBBlob._new = function(data,length,memoryMode) {
	var this1 = null;
	return this1;
};
lime_text_harfbuzz_HBBlob.createSubBlob = function(this1,offset,length) {
	return null;
};
lime_text_harfbuzz_HBBlob.makeImmutable = function(this1) {
};
lime_text_harfbuzz_HBBlob.get_data = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBBlob.get_dataWritable = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBBlob.get_empty = function() {
	return null;
};
lime_text_harfbuzz_HBBlob.get_immutable = function(this1) {
	return false;
};
lime_text_harfbuzz_HBBlob.get_length = function(this1) {
	return 0;
};
var lime_text_harfbuzz_HBBuffer = {};
lime_text_harfbuzz_HBBuffer.__properties__ = {set_segmentProperties:"set_segmentProperties",get_segmentProperties:"get_segmentProperties",set_script:"set_script",get_script:"get_script",set_replacementCodepoint:"set_replacementCodepoint",get_replacementCodepoint:"get_replacementCodepoint",set_length:"set_length",get_length:"get_length",set_language:"set_language",get_language:"get_language",set_flags:"set_flags",get_flags:"get_flags",set_direction:"set_direction",get_direction:"get_direction",set_contentType:"set_contentType",get_contentType:"get_contentType",set_clusterLevel:"set_clusterLevel",get_clusterLevel:"get_clusterLevel",get_allocationSuccessful:"get_allocationSuccessful"};
lime_text_harfbuzz_HBBuffer._new = function() {
	var this1 = null;
	return this1;
};
lime_text_harfbuzz_HBBuffer.add = function(this1,codepoint,cluster) {
};
lime_text_harfbuzz_HBBuffer.addCodepoints = function(this1,text,textLength,itemOffset,itemLength) {
};
lime_text_harfbuzz_HBBuffer.addUTF8 = function(this1,text,itemOffset,itemLength) {
};
lime_text_harfbuzz_HBBuffer.addUTF16 = function(this1,text,textLength,itemOffset,itemLength) {
};
lime_text_harfbuzz_HBBuffer.addUTF32 = function(this1,text,textLength,itemOffset,itemLength) {
};
lime_text_harfbuzz_HBBuffer.clearContents = function(this1) {
};
lime_text_harfbuzz_HBBuffer.getGlyphInfo = function(this1) {
	return null;
};
lime_text_harfbuzz_HBBuffer.getGlyphPositions = function(this1) {
	return null;
};
lime_text_harfbuzz_HBBuffer.guessSegmentProperties = function(this1) {
};
lime_text_harfbuzz_HBBuffer.normalizeGlyphs = function(this1) {
};
lime_text_harfbuzz_HBBuffer.preallocate = function(this1,size) {
	return false;
};
lime_text_harfbuzz_HBBuffer.reset = function(this1) {
};
lime_text_harfbuzz_HBBuffer.reverse = function(this1) {
};
lime_text_harfbuzz_HBBuffer.reverseClusters = function(this1) {
};
lime_text_harfbuzz_HBBuffer.get_allocationSuccessful = function(this1) {
	return false;
};
lime_text_harfbuzz_HBBuffer.get_clusterLevel = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBBuffer.set_clusterLevel = function(this1,value) {
	return value;
};
lime_text_harfbuzz_HBBuffer.get_contentType = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBBuffer.set_contentType = function(this1,value) {
	return value;
};
lime_text_harfbuzz_HBBuffer.get_direction = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBBuffer.set_direction = function(this1,value) {
	return value;
};
lime_text_harfbuzz_HBBuffer.get_empty = function() {
	return null;
};
lime_text_harfbuzz_HBBuffer.get_flags = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBBuffer.set_flags = function(this1,value) {
	return value;
};
lime_text_harfbuzz_HBBuffer.get_language = function(this1) {
	return null;
};
lime_text_harfbuzz_HBBuffer.set_language = function(this1,value) {
	return value;
};
lime_text_harfbuzz_HBBuffer.get_length = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBBuffer.set_length = function(this1,value) {
	return value;
};
lime_text_harfbuzz_HBBuffer.get_replacementCodepoint = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBBuffer.set_replacementCodepoint = function(this1,value) {
	return value;
};
lime_text_harfbuzz_HBBuffer.get_script = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBBuffer.set_script = function(this1,value) {
	return value;
};
lime_text_harfbuzz_HBBuffer.get_segmentProperties = function(this1) {
	return null;
};
lime_text_harfbuzz_HBBuffer.set_segmentProperties = function(this1,value) {
	return value;
};
var lime_text_harfbuzz_HBFTFont = {};
lime_text_harfbuzz_HBFTFont.__properties__ = {set_loadFlags:"set_loadFlags",get_loadFlags:"get_loadFlags"};
lime_text_harfbuzz_HBFTFont._new = function(font) {
	var this1;
	if(font.src != null) {
		this1 = null;
	} else {
		this1 = null;
	}
	return this1;
};
lime_text_harfbuzz_HBFTFont.get_loadFlags = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBFTFont.set_loadFlags = function(this1,value) {
	return value;
};
var lime_text_harfbuzz_HBFace = {};
lime_text_harfbuzz_HBFace.__properties__ = {set_upem:"set_upem",get_upem:"get_upem",set_index:"set_index",get_index:"get_index",get_immutable:"get_immutable",set_glyphCount:"set_glyphCount",get_glyphCount:"get_glyphCount",get_empty:"get_empty"};
lime_text_harfbuzz_HBFace._new = function(blob,index) {
	var this1 = null;
	return this1;
};
lime_text_harfbuzz_HBFace.get_empty = function() {
	return null;
};
lime_text_harfbuzz_HBFace.get_glyphCount = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBFace.set_glyphCount = function(this1,value) {
	return value;
};
lime_text_harfbuzz_HBFace.get_immutable = function(this1) {
	return false;
};
lime_text_harfbuzz_HBFace.get_index = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBFace.set_index = function(this1,value) {
	return value;
};
lime_text_harfbuzz_HBFace.get_upem = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBFace.set_upem = function(this1,value) {
	return value;
};
var lime_text_harfbuzz_HBFeature = function() {
};
$hxClasses["lime.text.harfbuzz.HBFeature"] = lime_text_harfbuzz_HBFeature;
lime_text_harfbuzz_HBFeature.__name__ = "lime.text.harfbuzz.HBFeature";
lime_text_harfbuzz_HBFeature.prototype = {
	__class__: lime_text_harfbuzz_HBFeature
};
var lime_text_harfbuzz_HBFont = {};
lime_text_harfbuzz_HBFont.__properties__ = {set_scale:"set_scale",get_scale:"get_scale",set_ppem:"set_ppem",get_ppem:"get_ppem",get_parent:"get_parent",get_immutable:"get_immutable",get_face:"get_face",get_empty:"get_empty"};
lime_text_harfbuzz_HBFont._new = function(face) {
	var this1 = null;
	return this1;
};
lime_text_harfbuzz_HBFont.addGlyphOriginForDirection = function(this1,glyph,direction,x,y) {
};
lime_text_harfbuzz_HBFont.createSubFont = function(this1) {
	return null;
};
lime_text_harfbuzz_HBFont.getGlyphAdvanceForDirection = function(this1,glyph,direction) {
	return null;
};
lime_text_harfbuzz_HBFont.getGlyphKerningForDirection = function(this1,glyph,firstGlyph,secondGlyph,direction) {
	return null;
};
lime_text_harfbuzz_HBFont.getGlyphOriginForDirection = function(this1,glyph,direction) {
	return null;
};
lime_text_harfbuzz_HBFont.glyphFromString = function(this1,s) {
	return 0;
};
lime_text_harfbuzz_HBFont.glyphToString = function(this1,codepoint) {
	return null;
};
lime_text_harfbuzz_HBFont.makeImmutable = function(this1) {
};
lime_text_harfbuzz_HBFont.subtractGlyphOriginForDirection = function(this1,glyph,direction,x,y) {
};
lime_text_harfbuzz_HBFont.get_empty = function() {
	return null;
};
lime_text_harfbuzz_HBFont.get_face = function(this1) {
	return null;
};
lime_text_harfbuzz_HBFont.get_immutable = function(this1) {
	return false;
};
lime_text_harfbuzz_HBFont.get_parent = function(this1) {
	return null;
};
lime_text_harfbuzz_HBFont.get_ppem = function(this1) {
	return null;
};
lime_text_harfbuzz_HBFont.set_ppem = function(this1,value) {
	return value;
};
lime_text_harfbuzz_HBFont.get_scale = function(this1) {
	return null;
};
lime_text_harfbuzz_HBFont.set_scale = function(this1,value) {
	return value;
};
var lime_text_harfbuzz_HBGlyphInfo = function() {
};
$hxClasses["lime.text.harfbuzz.HBGlyphInfo"] = lime_text_harfbuzz_HBGlyphInfo;
lime_text_harfbuzz_HBGlyphInfo.__name__ = "lime.text.harfbuzz.HBGlyphInfo";
lime_text_harfbuzz_HBGlyphInfo.prototype = {
	codepoint: null
	,mask: null
	,cluster: null
	,__class__: lime_text_harfbuzz_HBGlyphInfo
};
var lime_text_harfbuzz_HBGlyphPosition = function() {
};
$hxClasses["lime.text.harfbuzz.HBGlyphPosition"] = lime_text_harfbuzz_HBGlyphPosition;
lime_text_harfbuzz_HBGlyphPosition.__name__ = "lime.text.harfbuzz.HBGlyphPosition";
lime_text_harfbuzz_HBGlyphPosition.prototype = {
	xAdvance: null
	,xOffset: null
	,yAdvance: null
	,yOffset: null
	,__class__: lime_text_harfbuzz_HBGlyphPosition
};
var lime_text_harfbuzz_HBLanguage = {};
lime_text_harfbuzz_HBLanguage._new = function(language) {
	var this1 = null;
	return this1;
};
lime_text_harfbuzz_HBLanguage.toString = function(this1) {
	return null;
};
lime_text_harfbuzz_HBLanguage.fromString = function(value) {
	return lime_text_harfbuzz_HBLanguage._new(value);
};
var lime_text_harfbuzz_HBSegmentProperties = function() {
};
$hxClasses["lime.text.harfbuzz.HBSegmentProperties"] = lime_text_harfbuzz_HBSegmentProperties;
lime_text_harfbuzz_HBSegmentProperties.__name__ = "lime.text.harfbuzz.HBSegmentProperties";
lime_text_harfbuzz_HBSegmentProperties.prototype = {
	__class__: lime_text_harfbuzz_HBSegmentProperties
};
var lime_ui_Gamepad = function(id) {
	this.onDisconnect = new lime_app__$Event_$Void_$Void();
	this.onButtonUp = new lime_app__$Event_$lime_$ui_$GamepadButton_$Void();
	this.onButtonDown = new lime_app__$Event_$lime_$ui_$GamepadButton_$Void();
	this.onAxisMove = new lime_app__$Event_$lime_$ui_$GamepadAxis_$Float_$Void();
	this.id = id;
	this.connected = true;
};
$hxClasses["lime.ui.Gamepad"] = lime_ui_Gamepad;
lime_ui_Gamepad.__name__ = "lime.ui.Gamepad";
lime_ui_Gamepad.addMappings = function(mappings) {
};
lime_ui_Gamepad.__connect = function(id) {
	if(!lime_ui_Gamepad.devices.h.hasOwnProperty(id)) {
		var gamepad = new lime_ui_Gamepad(id);
		lime_ui_Gamepad.devices.h[id] = gamepad;
		lime_ui_Gamepad.onConnect.dispatch(gamepad);
	}
};
lime_ui_Gamepad.__disconnect = function(id) {
	var gamepad = lime_ui_Gamepad.devices.h[id];
	if(gamepad != null) {
		gamepad.connected = false;
	}
	lime_ui_Gamepad.devices.remove(id);
	if(gamepad != null) {
		gamepad.onDisconnect.dispatch();
	}
};
lime_ui_Gamepad.prototype = {
	connected: null
	,id: null
	,onAxisMove: null
	,onButtonDown: null
	,onButtonUp: null
	,onDisconnect: null
	,get_guid: function() {
		var devices = lime_ui_Joystick.__getDeviceData();
		return devices[this.id].id;
	}
	,get_name: function() {
		var devices = lime_ui_Joystick.__getDeviceData();
		return devices[this.id].id;
	}
	,__class__: lime_ui_Gamepad
	,__properties__: {get_name:"get_name",get_guid:"get_guid"}
};
var lime_ui_GamepadAxis = {};
lime_ui_GamepadAxis.toString = function(this1) {
	switch(this1) {
	case 0:
		return "LEFT_X";
	case 1:
		return "LEFT_Y";
	case 2:
		return "RIGHT_X";
	case 3:
		return "RIGHT_Y";
	case 4:
		return "TRIGGER_LEFT";
	case 5:
		return "TRIGGER_RIGHT";
	default:
		return "UNKNOWN (" + this1 + ")";
	}
};
var lime_ui_GamepadButton = {};
lime_ui_GamepadButton.toString = function(this1) {
	switch(this1) {
	case 0:
		return "A";
	case 1:
		return "B";
	case 2:
		return "X";
	case 3:
		return "Y";
	case 4:
		return "BACK";
	case 5:
		return "GUIDE";
	case 6:
		return "START";
	case 7:
		return "LEFT_STICK";
	case 8:
		return "RIGHT_STICK";
	case 9:
		return "LEFT_SHOULDER";
	case 10:
		return "RIGHT_SHOULDER";
	case 11:
		return "DPAD_UP";
	case 12:
		return "DPAD_DOWN";
	case 13:
		return "DPAD_LEFT";
	case 14:
		return "DPAD_RIGHT";
	default:
		return "UNKNOWN (" + this1 + ")";
	}
};
var lime_ui_Joystick = function(id) {
	this.onTrackballMove = new lime_app__$Event_$Int_$Float_$Float_$Void();
	this.onHatMove = new lime_app__$Event_$Int_$lime_$ui_$JoystickHatPosition_$Void();
	this.onDisconnect = new lime_app__$Event_$Void_$Void();
	this.onButtonUp = new lime_app__$Event_$Int_$Void();
	this.onButtonDown = new lime_app__$Event_$Int_$Void();
	this.onAxisMove = new lime_app__$Event_$Int_$Float_$Void();
	this.id = id;
	this.connected = true;
};
$hxClasses["lime.ui.Joystick"] = lime_ui_Joystick;
lime_ui_Joystick.__name__ = "lime.ui.Joystick";
lime_ui_Joystick.__connect = function(id) {
	if(!lime_ui_Joystick.devices.h.hasOwnProperty(id)) {
		var joystick = new lime_ui_Joystick(id);
		lime_ui_Joystick.devices.h[id] = joystick;
		lime_ui_Joystick.onConnect.dispatch(joystick);
	}
};
lime_ui_Joystick.__disconnect = function(id) {
	var joystick = lime_ui_Joystick.devices.h[id];
	if(joystick != null) {
		joystick.connected = false;
	}
	lime_ui_Joystick.devices.remove(id);
	if(joystick != null) {
		joystick.onDisconnect.dispatch();
	}
};
lime_ui_Joystick.__getDeviceData = function() {
	if(navigator.getGamepads) {
		return navigator.getGamepads();
	} else if(navigator.webkitGetGamepads) {
		return navigator.webkitGetGamepads();
	} else {
		return null;
	}
};
lime_ui_Joystick.prototype = {
	connected: null
	,id: null
	,onAxisMove: null
	,onButtonDown: null
	,onButtonUp: null
	,onDisconnect: null
	,onHatMove: null
	,onTrackballMove: null
	,get_guid: function() {
		var devices = lime_ui_Joystick.__getDeviceData();
		return devices[this.id].id;
	}
	,get_name: function() {
		var devices = lime_ui_Joystick.__getDeviceData();
		return devices[this.id].id;
	}
	,get_numAxes: function() {
		var devices = lime_ui_Joystick.__getDeviceData();
		return devices[this.id].axes.length;
	}
	,get_numButtons: function() {
		var devices = lime_ui_Joystick.__getDeviceData();
		return devices[this.id].buttons.length;
	}
	,get_numHats: function() {
		return 0;
	}
	,get_numTrackballs: function() {
		return 0;
	}
	,__class__: lime_ui_Joystick
	,__properties__: {get_numTrackballs:"get_numTrackballs",get_numHats:"get_numHats",get_numButtons:"get_numButtons",get_numAxes:"get_numAxes",get_name:"get_name",get_guid:"get_guid"}
};
var lime_ui_JoystickHatPosition = {};
lime_ui_JoystickHatPosition.__properties__ = {set_up:"set_up",get_up:"get_up",set_right:"set_right",get_right:"get_right",set_left:"set_left",get_left:"get_left",set_down:"set_down",get_down:"get_down",set_center:"set_center",get_center:"get_center"};
lime_ui_JoystickHatPosition._new = function(value) {
	var this1 = value;
	return this1;
};
lime_ui_JoystickHatPosition.get_center = function(this1) {
	return this1 == 0;
};
lime_ui_JoystickHatPosition.set_center = function(this1,value) {
	if(value) {
		this1 = 0;
	}
	return value;
};
lime_ui_JoystickHatPosition.get_down = function(this1) {
	return (this1 & 4) > 0;
};
lime_ui_JoystickHatPosition.set_down = function(this1,value) {
	if(value) {
		this1 |= 4;
	} else {
		this1 &= 268435455 - 4;
	}
	return value;
};
lime_ui_JoystickHatPosition.get_left = function(this1) {
	return (this1 & 8) > 0;
};
lime_ui_JoystickHatPosition.set_left = function(this1,value) {
	if(value) {
		this1 |= 8;
	} else {
		this1 &= 268435455 - 8;
	}
	return value;
};
lime_ui_JoystickHatPosition.get_right = function(this1) {
	return (this1 & 2) > 0;
};
lime_ui_JoystickHatPosition.set_right = function(this1,value) {
	if(value) {
		this1 |= 2;
	} else {
		this1 &= 268435455 - 2;
	}
	return value;
};
lime_ui_JoystickHatPosition.get_up = function(this1) {
	return (this1 & 1) > 0;
};
lime_ui_JoystickHatPosition.set_up = function(this1,value) {
	if(value) {
		this1 |= 1;
	} else {
		this1 &= 268435455 - 1;
	}
	return value;
};
var lime_ui_KeyCode = {};
lime_ui_KeyCode.fromScanCode = function(scanCode) {
	return 0;
};
lime_ui_KeyCode.toScanCode = function(keyCode) {
	return 0;
};
lime_ui_KeyCode.gt = function(a,b) {
	return a > b;
};
lime_ui_KeyCode.gte = function(a,b) {
	return a >= b;
};
lime_ui_KeyCode.lt = function(a,b) {
	return a < b;
};
lime_ui_KeyCode.lte = function(a,b) {
	return a <= b;
};
lime_ui_KeyCode.plus = function(a,b) {
	return a + b;
};
var lime_ui_KeyModifier = {};
lime_ui_KeyModifier.__properties__ = {set_shiftKey:"set_shiftKey",get_shiftKey:"get_shiftKey",set_numLock:"set_numLock",get_numLock:"get_numLock",set_metaKey:"set_metaKey",get_metaKey:"get_metaKey",set_ctrlKey:"set_ctrlKey",get_ctrlKey:"get_ctrlKey",set_capsLock:"set_capsLock",get_capsLock:"get_capsLock",set_altKey:"set_altKey",get_altKey:"get_altKey"};
lime_ui_KeyModifier.get_altKey = function(this1) {
	if((this1 & 256) <= 0) {
		return (this1 & 512) > 0;
	} else {
		return true;
	}
};
lime_ui_KeyModifier.set_altKey = function(this1,value) {
	if(value) {
		this1 |= 768;
	} else {
		this1 &= 268435455 - 768;
	}
	return value;
};
lime_ui_KeyModifier.get_capsLock = function(this1) {
	if((this1 & 8192) <= 0) {
		return (this1 & 8192) > 0;
	} else {
		return true;
	}
};
lime_ui_KeyModifier.set_capsLock = function(this1,value) {
	if(value) {
		this1 |= 8192;
	} else {
		this1 &= 268435455 - 8192;
	}
	return value;
};
lime_ui_KeyModifier.get_ctrlKey = function(this1) {
	if((this1 & 64) <= 0) {
		return (this1 & 128) > 0;
	} else {
		return true;
	}
};
lime_ui_KeyModifier.set_ctrlKey = function(this1,value) {
	if(value) {
		this1 |= 192;
	} else {
		this1 &= 268435455 - 192;
	}
	return value;
};
lime_ui_KeyModifier.get_metaKey = function(this1) {
	if((this1 & 1024) <= 0) {
		return (this1 & 2048) > 0;
	} else {
		return true;
	}
};
lime_ui_KeyModifier.set_metaKey = function(this1,value) {
	if(value) {
		this1 |= 3072;
	} else {
		this1 &= 268435455 - 3072;
	}
	return value;
};
lime_ui_KeyModifier.get_numLock = function(this1) {
	if((this1 & 4096) <= 0) {
		return (this1 & 4096) > 0;
	} else {
		return true;
	}
};
lime_ui_KeyModifier.set_numLock = function(this1,value) {
	if(value) {
		this1 |= 4096;
	} else {
		this1 &= 268435455 - 4096;
	}
	return value;
};
lime_ui_KeyModifier.get_shiftKey = function(this1) {
	if((this1 & 1) <= 0) {
		return (this1 & 2) > 0;
	} else {
		return true;
	}
};
lime_ui_KeyModifier.set_shiftKey = function(this1,value) {
	if(value) {
		this1 |= 3;
	} else {
		this1 &= 268435455 - 3;
	}
	return value;
};
var lime_ui_MouseCursor = $hxEnums["lime.ui.MouseCursor"] = { __ename__ : "lime.ui.MouseCursor", __constructs__ : ["ARROW","CROSSHAIR","DEFAULT","MOVE","POINTER","RESIZE_NESW","RESIZE_NS","RESIZE_NWSE","RESIZE_WE","TEXT","WAIT","WAIT_ARROW","CUSTOM"]
	,ARROW: {_hx_index:0,__enum__:"lime.ui.MouseCursor",toString:$estr}
	,CROSSHAIR: {_hx_index:1,__enum__:"lime.ui.MouseCursor",toString:$estr}
	,DEFAULT: {_hx_index:2,__enum__:"lime.ui.MouseCursor",toString:$estr}
	,MOVE: {_hx_index:3,__enum__:"lime.ui.MouseCursor",toString:$estr}
	,POINTER: {_hx_index:4,__enum__:"lime.ui.MouseCursor",toString:$estr}
	,RESIZE_NESW: {_hx_index:5,__enum__:"lime.ui.MouseCursor",toString:$estr}
	,RESIZE_NS: {_hx_index:6,__enum__:"lime.ui.MouseCursor",toString:$estr}
	,RESIZE_NWSE: {_hx_index:7,__enum__:"lime.ui.MouseCursor",toString:$estr}
	,RESIZE_WE: {_hx_index:8,__enum__:"lime.ui.MouseCursor",toString:$estr}
	,TEXT: {_hx_index:9,__enum__:"lime.ui.MouseCursor",toString:$estr}
	,WAIT: {_hx_index:10,__enum__:"lime.ui.MouseCursor",toString:$estr}
	,WAIT_ARROW: {_hx_index:11,__enum__:"lime.ui.MouseCursor",toString:$estr}
	,CUSTOM: {_hx_index:12,__enum__:"lime.ui.MouseCursor",toString:$estr}
};
var lime_ui_MouseWheelMode = $hxEnums["lime.ui.MouseWheelMode"] = { __ename__ : "lime.ui.MouseWheelMode", __constructs__ : ["PIXELS","LINES","PAGES","UNKNOWN"]
	,PIXELS: {_hx_index:0,__enum__:"lime.ui.MouseWheelMode",toString:$estr}
	,LINES: {_hx_index:1,__enum__:"lime.ui.MouseWheelMode",toString:$estr}
	,PAGES: {_hx_index:2,__enum__:"lime.ui.MouseWheelMode",toString:$estr}
	,UNKNOWN: {_hx_index:3,__enum__:"lime.ui.MouseWheelMode",toString:$estr}
};
var lime_ui_ScanCode = {};
lime_ui_ScanCode.fromKeyCode = function(keyCode) {
	return lime_ui_KeyCode.toScanCode(keyCode);
};
lime_ui_ScanCode.toKeyCode = function(scanCode) {
	return lime_ui_KeyCode.fromScanCode(scanCode);
};
lime_ui_ScanCode.gt = function(a,b) {
	return a > b;
};
lime_ui_ScanCode.gte = function(a,b) {
	return a >= b;
};
lime_ui_ScanCode.lt = function(a,b) {
	return a < b;
};
lime_ui_ScanCode.lte = function(a,b) {
	return a <= b;
};
lime_ui_ScanCode.plus = function(a,b) {
	return a + b;
};
var lime_ui_Touch = function(x,y,id,dx,dy,pressure,device) {
	this.x = x;
	this.y = y;
	this.id = id;
	this.dx = dx;
	this.dy = dy;
	this.pressure = pressure;
	this.device = device;
};
$hxClasses["lime.ui.Touch"] = lime_ui_Touch;
lime_ui_Touch.__name__ = "lime.ui.Touch";
lime_ui_Touch.prototype = {
	device: null
	,dx: null
	,dy: null
	,id: null
	,pressure: null
	,x: null
	,y: null
	,__class__: lime_ui_Touch
};
var lime_ui_Window = function(application,attributes) {
	this.onTextInput = new lime_app__$Event_$String_$Void();
	this.onTextEdit = new lime_app__$Event_$String_$Int_$Int_$Void();
	this.onRestore = new lime_app__$Event_$Void_$Void();
	this.onResize = new lime_app__$Event_$Int_$Int_$Void();
	this.onRenderContextRestored = new lime_app__$Event_$lime_$graphics_$RenderContext_$Void();
	this.onRenderContextLost = new lime_app__$Event_$Void_$Void();
	this.onRender = new lime_app__$Event_$lime_$graphics_$RenderContext_$Void();
	this.onMove = new lime_app__$Event_$Float_$Float_$Void();
	this.onMouseWheel = new lime_app__$Event_$Float_$Float_$lime_$ui_$MouseWheelMode_$Void();
	this.onMouseUp = new lime_app__$Event_$Float_$Float_$Int_$Void();
	this.onMouseMoveRelative = new lime_app__$Event_$Float_$Float_$Void();
	this.onMouseMove = new lime_app__$Event_$Float_$Float_$Void();
	this.onMouseDown = new lime_app__$Event_$Float_$Float_$lime_$ui_$MouseButton_$Void();
	this.onMinimize = new lime_app__$Event_$Void_$Void();
	this.onMaximize = new lime_app__$Event_$Void_$Void();
	this.onLeave = new lime_app__$Event_$Void_$Void();
	this.onKeyUp = new lime_app__$Event_$lime_$ui_$KeyCode_$lime_$ui_$KeyModifier_$Void();
	this.onKeyDown = new lime_app__$Event_$lime_$ui_$KeyCode_$lime_$ui_$KeyModifier_$Void();
	this.onFullscreen = new lime_app__$Event_$Void_$Void();
	this.onFocusOut = new lime_app__$Event_$Void_$Void();
	this.onFocusIn = new lime_app__$Event_$Void_$Void();
	this.onExpose = new lime_app__$Event_$Void_$Void();
	this.onEnter = new lime_app__$Event_$Void_$Void();
	this.onDropFile = new lime_app__$Event_$String_$Void();
	this.onDeactivate = new lime_app__$Event_$Void_$Void();
	this.onClose = new lime_app__$Event_$Void_$Void();
	this.onActivate = new lime_app__$Event_$Void_$Void();
	this.application = application;
	this.__attributes = attributes != null ? attributes : { };
	if(Object.prototype.hasOwnProperty.call(this.__attributes,"parameters")) {
		this.parameters = this.__attributes.parameters;
	}
	this.__width = 0;
	this.__height = 0;
	this.__fullscreen = false;
	this.__scale = 1;
	this.__x = 0;
	this.__y = 0;
	this.__title = "";
	this.id = -1;
	this.__backend = new lime__$internal_backend_html5_HTML5Window(this);
};
$hxClasses["lime.ui.Window"] = lime_ui_Window;
lime_ui_Window.__name__ = "lime.ui.Window";
lime_ui_Window.prototype = {
	application: null
	,context: null
	,display: null
	,element: null
	,hidden: null
	,id: null
	,onActivate: null
	,onClose: null
	,onDeactivate: null
	,onDropFile: null
	,onEnter: null
	,onExpose: null
	,onFocusIn: null
	,onFocusOut: null
	,onFullscreen: null
	,onKeyDown: null
	,onKeyUp: null
	,onLeave: null
	,onMaximize: null
	,onMinimize: null
	,onMouseDown: null
	,onMouseMove: null
	,onMouseMoveRelative: null
	,onMouseUp: null
	,onMouseWheel: null
	,onMove: null
	,onRender: null
	,onRenderContextLost: null
	,onRenderContextRestored: null
	,onResize: null
	,onRestore: null
	,onTextEdit: null
	,onTextInput: null
	,parameters: null
	,scale: null
	,stage: null
	,__attributes: null
	,__backend: null
	,__borderless: null
	,__fullscreen: null
	,__height: null
	,__hidden: null
	,__maximized: null
	,__minimized: null
	,__resizable: null
	,__scale: null
	,__title: null
	,__width: null
	,__x: null
	,__y: null
	,alert: function(message,title) {
		this.__backend.alert(message,title);
	}
	,close: function() {
		this.__backend.close();
	}
	,focus: function() {
		this.__backend.focus();
	}
	,move: function(x,y) {
		this.__backend.move(x,y);
		this.__x = x;
		this.__y = y;
	}
	,readPixels: function(rect) {
		return this.__backend.readPixels(rect);
	}
	,resize: function(width,height) {
		this.__backend.resize(width,height);
		this.__width = width;
		this.__height = height;
	}
	,setIcon: function(image) {
		if(image == null) {
			return;
		}
		this.__backend.setIcon(image);
	}
	,toString: function() {
		return "[object Window]";
	}
	,warpMouse: function(x,y) {
		this.__backend.warpMouse(x,y);
	}
	,get_cursor: function() {
		return this.__backend.getCursor();
	}
	,set_cursor: function(value) {
		return this.__backend.setCursor(value);
	}
	,get_display: function() {
		return this.__backend.getDisplay();
	}
	,get_displayMode: function() {
		return this.__backend.getDisplayMode();
	}
	,set_displayMode: function(value) {
		return this.__backend.setDisplayMode(value);
	}
	,get_borderless: function() {
		return this.__borderless;
	}
	,set_borderless: function(value) {
		return this.__borderless = this.__backend.setBorderless(value);
	}
	,get_frameRate: function() {
		return this.__backend.getFrameRate();
	}
	,set_frameRate: function(value) {
		return this.__backend.setFrameRate(value);
	}
	,get_fullscreen: function() {
		return this.__fullscreen;
	}
	,set_fullscreen: function(value) {
		return this.__fullscreen = this.__backend.setFullscreen(value);
	}
	,get_height: function() {
		return this.__height;
	}
	,set_height: function(value) {
		this.resize(this.__width,value);
		return this.__height;
	}
	,get_hidden: function() {
		return this.__hidden;
	}
	,get_maximized: function() {
		return this.__maximized;
	}
	,set_maximized: function(value) {
		this.__minimized = false;
		return this.__maximized = this.__backend.setMaximized(value);
	}
	,get_minimized: function() {
		return this.__minimized;
	}
	,set_minimized: function(value) {
		this.__maximized = false;
		return this.__minimized = this.__backend.setMinimized(value);
	}
	,get_mouseLock: function() {
		return this.__backend.getMouseLock();
	}
	,set_mouseLock: function(value) {
		this.__backend.setMouseLock(value);
		return value;
	}
	,get_resizable: function() {
		return this.__resizable;
	}
	,set_resizable: function(value) {
		this.__resizable = this.__backend.setResizable(value);
		return this.__resizable;
	}
	,get_scale: function() {
		return this.__scale;
	}
	,get_textInputEnabled: function() {
		return this.__backend.getTextInputEnabled();
	}
	,set_textInputEnabled: function(value) {
		return this.__backend.setTextInputEnabled(value);
	}
	,get_title: function() {
		return this.__title;
	}
	,set_title: function(value) {
		return this.__title = this.__backend.setTitle(value);
	}
	,get_width: function() {
		return this.__width;
	}
	,set_width: function(value) {
		this.resize(value,this.__height);
		return this.__width;
	}
	,get_x: function() {
		return this.__x;
	}
	,set_x: function(value) {
		this.move(value,this.__y);
		return this.__x;
	}
	,get_y: function() {
		return this.__y;
	}
	,set_y: function(value) {
		this.move(this.__x,value);
		return this.__y;
	}
	,__class__: lime_ui_Window
	,__properties__: {set_y:"set_y",get_y:"get_y",set_x:"set_x",get_x:"get_x",set_width:"set_width",get_width:"get_width",set_title:"set_title",get_title:"get_title",set_textInputEnabled:"set_textInputEnabled",get_textInputEnabled:"get_textInputEnabled",get_scale:"get_scale",set_resizable:"set_resizable",get_resizable:"get_resizable",set_mouseLock:"set_mouseLock",get_mouseLock:"get_mouseLock",set_minimized:"set_minimized",get_minimized:"get_minimized",set_maximized:"set_maximized",get_maximized:"get_maximized",get_hidden:"get_hidden",set_height:"set_height",get_height:"get_height",set_fullscreen:"set_fullscreen",get_fullscreen:"get_fullscreen",set_frameRate:"set_frameRate",get_frameRate:"get_frameRate",set_displayMode:"set_displayMode",get_displayMode:"get_displayMode",get_display:"get_display",set_cursor:"set_cursor",get_cursor:"get_cursor",set_borderless:"set_borderless",get_borderless:"get_borderless"}
};
var lime_utils_TAError = $hxEnums["lime.utils.TAError"] = { __ename__ : "lime.utils.TAError", __constructs__ : ["RangeError"]
	,RangeError: {_hx_index:0,__enum__:"lime.utils.TAError",toString:$estr}
};
var lime_utils_AssetBundle = function() {
	this.data = new haxe_ds_StringMap();
	this.paths = [];
};
$hxClasses["lime.utils.AssetBundle"] = lime_utils_AssetBundle;
lime_utils_AssetBundle.__name__ = "lime.utils.AssetBundle";
lime_utils_AssetBundle.fromBytes = function(bytes) {
	var input = new haxe_io_BytesInput(bytes);
	return lime_utils_AssetBundle.__extractBundle(input);
};
lime_utils_AssetBundle.fromFile = function(path) {
	return null;
};
lime_utils_AssetBundle.loadFromBytes = function(bytes) {
	return lime_app_Future.withValue(lime_utils_AssetBundle.fromBytes(bytes));
};
lime_utils_AssetBundle.loadFromFile = function(path) {
	return lime_utils_Bytes.loadFromFile(path).then(lime_utils_AssetBundle.loadFromBytes);
};
lime_utils_AssetBundle.__extractBundle = function(input) {
	var entries = haxe_zip_Reader.readZip(input);
	var bundle = new lime_utils_AssetBundle();
	var _g_head = entries.h;
	while(_g_head != null) {
		var val = _g_head.item;
		_g_head = _g_head.next;
		var entry = val;
		if(entry.compressed) {
			var bytes = entry.data;
			var this1 = bundle.data;
			var key = entry.fileName;
			var value = lime_utils_Bytes.decompress(bytes,lime_utils_CompressionAlgorithm.DEFLATE);
			this1.h[key] = value;
		} else {
			bundle.data.h[entry.fileName] = entry.data;
		}
		bundle.paths.push(entry.fileName);
	}
	return bundle;
};
lime_utils_AssetBundle.prototype = {
	data: null
	,paths: null
	,__class__: lime_utils_AssetBundle
};
var lime_utils_AssetCache = function() {
	this.enabled = true;
	this.audio = new haxe_ds_StringMap();
	this.font = new haxe_ds_StringMap();
	this.image = new haxe_ds_StringMap();
	this.version = 580786;
};
$hxClasses["lime.utils.AssetCache"] = lime_utils_AssetCache;
lime_utils_AssetCache.__name__ = "lime.utils.AssetCache";
lime_utils_AssetCache.prototype = {
	audio: null
	,enabled: null
	,image: null
	,font: null
	,version: null
	,exists: function(id,type) {
		if(type == "IMAGE" || type == null) {
			if(Object.prototype.hasOwnProperty.call(this.image.h,id)) {
				return true;
			}
		}
		if(type == "FONT" || type == null) {
			if(Object.prototype.hasOwnProperty.call(this.font.h,id)) {
				return true;
			}
		}
		if(type == "SOUND" || type == "MUSIC" || type == null) {
			if(Object.prototype.hasOwnProperty.call(this.audio.h,id)) {
				return true;
			}
		}
		return false;
	}
	,set: function(id,type,asset) {
		switch(type) {
		case "FONT":
			this.font.h[id] = asset;
			break;
		case "IMAGE":
			if(!((asset) instanceof lime_graphics_Image)) {
				throw haxe_Exception.thrown("Cannot cache non-Image asset: " + Std.string(asset) + " as Image");
			}
			this.image.h[id] = asset;
			break;
		case "MUSIC":case "SOUND":
			if(!((asset) instanceof lime_media_AudioBuffer)) {
				throw haxe_Exception.thrown("Cannot cache non-AudioBuffer asset: " + Std.string(asset) + " as AudioBuffer");
			}
			this.audio.h[id] = asset;
			break;
		default:
			throw haxe_Exception.thrown(type + " assets are not cachable");
		}
	}
	,clear: function(prefix) {
		if(prefix == null) {
			this.audio = new haxe_ds_StringMap();
			this.font = new haxe_ds_StringMap();
			this.image = new haxe_ds_StringMap();
		} else {
			var keys = haxe_ds_StringMap.keysIterator(this.audio.h);
			var key = keys;
			while(key.hasNext()) {
				var key1 = key.next();
				if(StringTools.startsWith(key1,prefix)) {
					var _this = this.audio;
					if(Object.prototype.hasOwnProperty.call(_this.h,key1)) {
						delete(_this.h[key1]);
					}
				}
			}
			var keys = haxe_ds_StringMap.keysIterator(this.font.h);
			var key = keys;
			while(key.hasNext()) {
				var key1 = key.next();
				if(StringTools.startsWith(key1,prefix)) {
					var _this = this.font;
					if(Object.prototype.hasOwnProperty.call(_this.h,key1)) {
						delete(_this.h[key1]);
					}
				}
			}
			var keys = haxe_ds_StringMap.keysIterator(this.image.h);
			var key = keys;
			while(key.hasNext()) {
				var key1 = key.next();
				if(StringTools.startsWith(key1,prefix)) {
					var _this = this.image;
					if(Object.prototype.hasOwnProperty.call(_this.h,key1)) {
						delete(_this.h[key1]);
					}
				}
			}
		}
	}
	,__class__: lime_utils_AssetCache
};
var lime_utils_AssetLibrary = function() {
	this.types = new haxe_ds_StringMap();
	this.sizes = new haxe_ds_StringMap();
	this.preload = new haxe_ds_StringMap();
	this.paths = new haxe_ds_StringMap();
	this.pathGroups = new haxe_ds_StringMap();
	this.classTypes = new haxe_ds_StringMap();
	this.cachedText = new haxe_ds_StringMap();
	this.cachedImages = new haxe_ds_StringMap();
	this.cachedFonts = new haxe_ds_StringMap();
	this.cachedBytes = new haxe_ds_StringMap();
	this.cachedAudioBuffers = new haxe_ds_StringMap();
	this.onChange = new lime_app__$Event_$Void_$Void();
	this.bytesLoaded = 0;
	this.bytesTotal = 0;
};
$hxClasses["lime.utils.AssetLibrary"] = lime_utils_AssetLibrary;
lime_utils_AssetLibrary.__name__ = "lime.utils.AssetLibrary";
lime_utils_AssetLibrary.fromBytes = function(bytes,rootPath) {
	return lime_utils_AssetLibrary.fromManifest(lime_utils_AssetManifest.fromBytes(bytes,rootPath));
};
lime_utils_AssetLibrary.fromFile = function(path,rootPath) {
	return lime_utils_AssetLibrary.fromManifest(lime_utils_AssetManifest.fromFile(path,rootPath));
};
lime_utils_AssetLibrary.fromBundle = function(bundle) {
	if(Object.prototype.hasOwnProperty.call(bundle.data.h,"library.json")) {
		var manifest = lime_utils_AssetManifest.fromBytes(bundle.data.h["library.json"]);
		if(manifest != null) {
			var library = null;
			if(manifest.libraryType == null) {
				library = new lime_utils_AssetLibrary();
			} else {
				var name = manifest.libraryType;
				var libraryClass = $hxClasses[name];
				if(libraryClass != null) {
					library = Type.createInstance(libraryClass,manifest.libraryArgs);
				} else {
					lime_utils_Log.warn("Could not find library type: " + manifest.libraryType,{ fileName : "lime/utils/AssetLibrary.hx", lineNumber : 122, className : "lime.utils.AssetLibrary", methodName : "fromBundle"});
					return null;
				}
			}
			library.__fromBundle(bundle,manifest);
			return library;
		}
	} else {
		var library = new lime_utils_AssetLibrary();
		library.__fromBundle(bundle);
		return library;
	}
	return null;
};
lime_utils_AssetLibrary.fromManifest = function(manifest) {
	if(manifest == null) {
		return null;
	}
	var library = null;
	if(manifest.libraryType == null) {
		library = new lime_utils_AssetLibrary();
	} else {
		var name = manifest.libraryType;
		var libraryClass = $hxClasses[name];
		if(libraryClass != null) {
			library = Type.createInstance(libraryClass,manifest.libraryArgs);
		} else {
			lime_utils_Log.warn("Could not find library type: " + manifest.libraryType,{ fileName : "lime/utils/AssetLibrary.hx", lineNumber : 160, className : "lime.utils.AssetLibrary", methodName : "fromManifest"});
			return null;
		}
	}
	library.__fromManifest(manifest);
	return library;
};
lime_utils_AssetLibrary.loadFromBytes = function(bytes,rootPath) {
	return lime_utils_AssetManifest.loadFromBytes(bytes,rootPath).then(function(manifest) {
		return lime_utils_AssetLibrary.loadFromManifest(manifest);
	});
};
lime_utils_AssetLibrary.loadFromFile = function(path,rootPath) {
	return lime_utils_AssetManifest.loadFromFile(path,rootPath).then(function(manifest) {
		return lime_utils_AssetLibrary.loadFromManifest(manifest);
	});
};
lime_utils_AssetLibrary.loadFromManifest = function(manifest) {
	var library = lime_utils_AssetLibrary.fromManifest(manifest);
	if(library != null) {
		return library.load();
	} else {
		return lime_app_Future.withError("Could not load asset manifest");
	}
};
lime_utils_AssetLibrary.prototype = {
	onChange: null
	,assetsLoaded: null
	,assetsTotal: null
	,bytesLoaded: null
	,bytesLoadedCache: null
	,bytesTotal: null
	,cachedAudioBuffers: null
	,cachedBytes: null
	,cachedFonts: null
	,cachedImages: null
	,cachedText: null
	,classTypes: null
	,loaded: null
	,pathGroups: null
	,paths: null
	,preload: null
	,promise: null
	,sizes: null
	,types: null
	,exists: function(id,type) {
		var requestedType = type != null ? js_Boot.__cast(type , String) : null;
		var assetType = this.types.h[id];
		if(assetType != null) {
			if(assetType == requestedType || (requestedType == "SOUND" || requestedType == "MUSIC") && (assetType == "MUSIC" || assetType == "SOUND")) {
				return true;
			}
			if(requestedType == "BINARY" || requestedType == null || assetType == "BINARY" && requestedType == "TEXT") {
				return true;
			}
		}
		return false;
	}
	,getAsset: function(id,type) {
		switch(type) {
		case "BINARY":
			return this.getBytes(id);
		case "FONT":
			return this.getFont(id);
		case "IMAGE":
			return this.getImage(id);
		case "MUSIC":case "SOUND":
			return this.getAudioBuffer(id);
		case "TEMPLATE":
			throw haxe_Exception.thrown("Not sure how to get template: " + id);
		case "TEXT":
			return this.getText(id);
		default:
			throw haxe_Exception.thrown("Unknown asset type: " + type);
		}
	}
	,getAudioBuffer: function(id) {
		if(Object.prototype.hasOwnProperty.call(this.cachedAudioBuffers.h,id)) {
			return this.cachedAudioBuffers.h[id];
		} else if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) {
			return lime_media_AudioBuffer.fromBytes(js_Boot.__cast(Type.createInstance(this.classTypes.h[id],[]) , haxe_io_Bytes));
		} else {
			return lime_media_AudioBuffer.fromFile(this.paths.h[id]);
		}
	}
	,getBytes: function(id) {
		if(Object.prototype.hasOwnProperty.call(this.cachedBytes.h,id)) {
			return this.cachedBytes.h[id];
		} else if(Object.prototype.hasOwnProperty.call(this.cachedText.h,id)) {
			var bytes = lime_utils_Bytes.ofString(this.cachedText.h[id]);
			this.cachedBytes.h[id] = bytes;
			return bytes;
		} else if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) {
			return js_Boot.__cast(Type.createInstance(this.classTypes.h[id],[]) , haxe_io_Bytes);
		} else {
			return lime_utils_Bytes.fromFile(this.paths.h[id]);
		}
	}
	,getFont: function(id) {
		if(Object.prototype.hasOwnProperty.call(this.cachedFonts.h,id)) {
			return this.cachedFonts.h[id];
		} else if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) {
			return js_Boot.__cast(Type.createInstance(this.classTypes.h[id],[]) , lime_text_Font);
		} else {
			return lime_text_Font.fromFile(this.paths.h[id]);
		}
	}
	,getImage: function(id) {
		if(Object.prototype.hasOwnProperty.call(this.cachedImages.h,id)) {
			return this.cachedImages.h[id];
		} else if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) {
			return js_Boot.__cast(Type.createInstance(this.classTypes.h[id],[]) , lime_graphics_Image);
		} else {
			return lime_graphics_Image.fromFile(this.paths.h[id]);
		}
	}
	,getPath: function(id) {
		if(Object.prototype.hasOwnProperty.call(this.paths.h,id)) {
			return this.paths.h[id];
		} else if(Object.prototype.hasOwnProperty.call(this.pathGroups.h,id)) {
			return this.pathGroups.h[id][0];
		} else {
			return null;
		}
	}
	,getText: function(id) {
		if(Object.prototype.hasOwnProperty.call(this.cachedText.h,id)) {
			return this.cachedText.h[id];
		} else {
			var bytes = this.getBytes(id);
			if(bytes == null) {
				return null;
			} else {
				return bytes.getString(0,bytes.length);
			}
		}
	}
	,isLocal: function(id,type) {
		if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) {
			return true;
		}
		var requestedType = type != null ? js_Boot.__cast(type , String) : null;
		if(requestedType == null) {
			if(!Object.prototype.hasOwnProperty.call(this.cachedBytes.h,id)) {
				return Object.prototype.hasOwnProperty.call(this.cachedText.h,id);
			} else {
				return true;
			}
		} else {
			switch(requestedType) {
			case "FONT":
				return Object.prototype.hasOwnProperty.call(this.cachedFonts.h,id);
			case "IMAGE":
				return Object.prototype.hasOwnProperty.call(this.cachedImages.h,id);
			case "MUSIC":case "SOUND":
				return Object.prototype.hasOwnProperty.call(this.cachedAudioBuffers.h,id);
			default:
				if(!Object.prototype.hasOwnProperty.call(this.cachedBytes.h,id)) {
					return Object.prototype.hasOwnProperty.call(this.cachedText.h,id);
				} else {
					return true;
				}
			}
		}
	}
	,list: function(type) {
		var requestedType = type != null ? js_Boot.__cast(type , String) : null;
		var items = [];
		var id = haxe_ds_StringMap.keysIterator(this.types.h);
		while(id.hasNext()) {
			var id1 = id.next();
			if(requestedType == null || this.exists(id1,type)) {
				items.push(id1);
			}
		}
		return items;
	}
	,loadAsset: function(id,type) {
		switch(type) {
		case "BINARY":
			return this.loadBytes(id);
		case "FONT":
			return this.loadFont(id);
		case "IMAGE":
			return this.loadImage(id);
		case "MUSIC":case "SOUND":
			return this.loadAudioBuffer(id);
		case "TEMPLATE":
			throw haxe_Exception.thrown("Not sure how to load template: " + id);
		case "TEXT":
			return this.loadText(id);
		default:
			throw haxe_Exception.thrown("Unknown asset type: " + type);
		}
	}
	,load: function() {
		if(this.loaded) {
			return lime_app_Future.withValue(this);
		}
		if(this.promise == null) {
			this.promise = new lime_app_Promise();
			this.bytesLoadedCache = new haxe_ds_StringMap();
			this.assetsLoaded = 0;
			this.assetsTotal = 1;
			var id = haxe_ds_StringMap.keysIterator(this.preload.h);
			while(id.hasNext()) {
				var id1 = id.next();
				if(!this.preload.h[id1]) {
					continue;
				}
				lime_utils_Log.verbose("Preloading asset: " + id1 + " [" + this.types.h[id1] + "]",{ fileName : "lime/utils/AssetLibrary.hx", lineNumber : 405, className : "lime.utils.AssetLibrary", methodName : "load"});
				var _g = this.types.h[id1];
				if(_g != null) {
					switch(_g) {
					case "BINARY":
						this.assetsTotal++;
						var future = this.loadBytes(id1);
						future.onProgress((function(id,_g) {
							return function(bytesLoaded,bytesTotal) {
								_g[0](id[0],bytesLoaded,bytesTotal);
							};
						})([id1],[$bind(this,this.load_onProgress)]));
						future.onError((function(id,_g) {
							return function(message) {
								_g[0](id[0],message);
							};
						})([id1],[$bind(this,this.load_onError)]));
						future.onComplete((function(id,_g) {
							return function(bytes) {
								_g[0](id[0],bytes);
							};
						})([id1],[$bind(this,this.loadBytes_onComplete)]));
						break;
					case "FONT":
						this.assetsTotal++;
						var future1 = this.loadFont(id1);
						future1.onProgress((function(id,_g) {
							return function(bytesLoaded,bytesTotal) {
								_g[0](id[0],bytesLoaded,bytesTotal);
							};
						})([id1],[$bind(this,this.load_onProgress)]));
						future1.onError((function(id,_g) {
							return function(message) {
								_g[0](id[0],message);
							};
						})([id1],[$bind(this,this.load_onError)]));
						future1.onComplete((function(id,_g) {
							return function(font) {
								_g[0](id[0],font);
							};
						})([id1],[$bind(this,this.loadFont_onComplete)]));
						break;
					case "IMAGE":
						this.assetsTotal++;
						var future2 = this.loadImage(id1);
						future2.onProgress((function(id,_g) {
							return function(bytesLoaded,bytesTotal) {
								_g[0](id[0],bytesLoaded,bytesTotal);
							};
						})([id1],[$bind(this,this.load_onProgress)]));
						future2.onError((function(id,_g) {
							return function(message) {
								_g[0](id[0],message);
							};
						})([id1],[$bind(this,this.load_onError)]));
						future2.onComplete((function(id,_g) {
							return function(image) {
								_g[0](id[0],image);
							};
						})([id1],[$bind(this,this.loadImage_onComplete)]));
						break;
					case "MUSIC":case "SOUND":
						this.assetsTotal++;
						var future3 = this.loadAudioBuffer(id1);
						future3.onProgress((function(id,_g) {
							return function(bytesLoaded,bytesTotal) {
								_g[0](id[0],bytesLoaded,bytesTotal);
							};
						})([id1],[$bind(this,this.load_onProgress)]));
						future3.onError((function(id,_g) {
							return function(message) {
								_g[0](id[0],message);
							};
						})([id1],[$bind(this,this.loadAudioBuffer_onError)]));
						future3.onComplete((function(id,_g) {
							return function(audioBuffer) {
								_g[0](id[0],audioBuffer);
							};
						})([id1],[$bind(this,this.loadAudioBuffer_onComplete)]));
						break;
					case "TEXT":
						this.assetsTotal++;
						var future4 = this.loadText(id1);
						future4.onProgress((function(id,_g) {
							return function(bytesLoaded,bytesTotal) {
								_g[0](id[0],bytesLoaded,bytesTotal);
							};
						})([id1],[$bind(this,this.load_onProgress)]));
						future4.onError((function(id,_g) {
							return function(message) {
								_g[0](id[0],message);
							};
						})([id1],[$bind(this,this.load_onError)]));
						future4.onComplete((function(id,_g) {
							return function(text) {
								_g[0](id[0],text);
							};
						})([id1],[$bind(this,this.loadText_onComplete)]));
						break;
					default:
					}
				}
			}
			this.__assetLoaded(null);
		}
		return this.promise.future;
	}
	,loadAudioBuffer: function(id) {
		if(Object.prototype.hasOwnProperty.call(this.cachedAudioBuffers.h,id)) {
			return lime_app_Future.withValue(this.cachedAudioBuffers.h[id]);
		} else if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) {
			return lime_app_Future.withValue(Type.createInstance(this.classTypes.h[id],[]));
		} else if(Object.prototype.hasOwnProperty.call(this.pathGroups.h,id)) {
			return lime_media_AudioBuffer.loadFromFiles(this.pathGroups.h[id]);
		} else {
			return lime_media_AudioBuffer.loadFromFile(this.paths.h[id]);
		}
	}
	,loadBytes: function(id) {
		if(Object.prototype.hasOwnProperty.call(this.cachedBytes.h,id)) {
			return lime_app_Future.withValue(this.cachedBytes.h[id]);
		} else if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) {
			return lime_app_Future.withValue(Type.createInstance(this.classTypes.h[id],[]));
		} else {
			return lime_utils_Bytes.loadFromFile(this.paths.h[id]);
		}
	}
	,loadFont: function(id) {
		if(Object.prototype.hasOwnProperty.call(this.cachedFonts.h,id)) {
			return lime_app_Future.withValue(this.cachedFonts.h[id]);
		} else if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) {
			var font = Type.createInstance(this.classTypes.h[id],[]);
			return font.__loadFromName(font.name);
		} else {
			return lime_text_Font.loadFromName(this.paths.h[id]);
		}
	}
	,loadImage: function(id) {
		var _gthis = this;
		if(Object.prototype.hasOwnProperty.call(this.cachedImages.h,id)) {
			return lime_app_Future.withValue(this.cachedImages.h[id]);
		} else if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) {
			return lime_app_Future.withValue(Type.createInstance(this.classTypes.h[id],[]));
		} else if(Object.prototype.hasOwnProperty.call(this.cachedBytes.h,id)) {
			return lime_graphics_Image.loadFromBytes(this.cachedBytes.h[id]).then(function(image) {
				var _this = _gthis.cachedBytes;
				if(Object.prototype.hasOwnProperty.call(_this.h,id)) {
					delete(_this.h[id]);
				}
				_gthis.cachedImages.h[id] = image;
				return lime_app_Future.withValue(image);
			});
		} else {
			return lime_graphics_Image.loadFromFile(this.paths.h[id]);
		}
	}
	,loadText: function(id) {
		if(Object.prototype.hasOwnProperty.call(this.cachedText.h,id)) {
			return lime_app_Future.withValue(this.cachedText.h[id]);
		} else if(Object.prototype.hasOwnProperty.call(this.cachedBytes.h,id) || Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) {
			var bytes = this.getBytes(id);
			if(bytes == null) {
				return lime_app_Future.withValue(null);
			} else {
				var text = bytes.getString(0,bytes.length);
				this.cachedText.h[id] = text;
				return lime_app_Future.withValue(text);
			}
		} else {
			var request = new lime_net__$HTTPRequest_$String();
			return request.load(this.paths.h[id]);
		}
	}
	,unload: function() {
	}
	,__assetLoaded: function(id) {
		this.assetsLoaded++;
		if(id != null) {
			lime_utils_Log.verbose("Loaded asset: " + id + " [" + this.types.h[id] + "] (" + (this.assetsLoaded - 1) + "/" + (this.assetsTotal - 1) + ")",{ fileName : "lime/utils/AssetLibrary.hx", lineNumber : 619, className : "lime.utils.AssetLibrary", methodName : "__assetLoaded"});
		}
		if(id != null) {
			var size = Object.prototype.hasOwnProperty.call(this.sizes.h,id) ? this.sizes.h[id] : 0;
			if(!Object.prototype.hasOwnProperty.call(this.bytesLoadedCache.h,id)) {
				this.bytesLoaded += size;
			} else {
				var cache = this.bytesLoadedCache.h[id];
				if(cache < size) {
					this.bytesLoaded += size - cache;
				}
			}
			this.bytesLoadedCache.h[id] = size;
		}
		if(this.assetsLoaded < this.assetsTotal) {
			this.promise.progress(this.bytesLoaded,this.bytesTotal);
		} else {
			this.loaded = true;
			this.promise.progress(this.bytesTotal,this.bytesTotal);
			this.promise.complete(this);
		}
	}
	,__cacheBreak: function(path) {
		return lime_utils_Assets.__cacheBreak(path);
	}
	,__fromBundle: function(bundle,manifest) {
		if(manifest != null) {
			var id;
			var data;
			var type;
			var _g = 0;
			var _g1 = manifest.assets;
			while(_g < _g1.length) {
				var asset = _g1[_g];
				++_g;
				id = Object.prototype.hasOwnProperty.call(asset,"id") ? asset.id : asset.path;
				data = bundle.data.h[asset.path];
				if(Object.prototype.hasOwnProperty.call(asset,"type")) {
					type = asset.type;
					if(type == "TEXT") {
						this.cachedText.h[id] = data != null ? Std.string(data) : null;
					} else {
						this.cachedBytes.h[id] = data;
					}
					this.types.h[id] = asset.type;
				} else {
					this.cachedBytes.h[id] = data;
					this.types.h[id] = "BINARY";
				}
			}
		} else {
			var _g = 0;
			var _g1 = bundle.paths;
			while(_g < _g1.length) {
				var path = _g1[_g];
				++_g;
				this.cachedBytes.h[path] = bundle.data.h[path];
				this.types.h[path] = "BINARY";
			}
		}
	}
	,__fromManifest: function(manifest) {
		var hasSize = manifest.version >= 2;
		var size;
		var id;
		var pathGroup;
		var classRef;
		var basePath = manifest.rootPath;
		if(basePath == null) {
			basePath = "";
		}
		if(basePath != "") {
			basePath += "/";
		}
		var _g = 0;
		var _g1 = manifest.assets;
		while(_g < _g1.length) {
			var asset = _g1[_g];
			++_g;
			size = hasSize && Object.prototype.hasOwnProperty.call(asset,"size") ? asset.size : 100;
			id = Object.prototype.hasOwnProperty.call(asset,"id") ? asset.id : asset.path;
			if(Object.prototype.hasOwnProperty.call(asset,"path")) {
				var this1 = this.paths;
				var value = this.__cacheBreak(this.__resolvePath(basePath + Std.string(Reflect.field(asset,"path"))));
				this1.h[id] = value;
			}
			if(Object.prototype.hasOwnProperty.call(asset,"pathGroup")) {
				pathGroup = Reflect.field(asset,"pathGroup");
				var _g2 = 0;
				var _g3 = pathGroup.length;
				while(_g2 < _g3) {
					var i = _g2++;
					pathGroup[i] = this.__cacheBreak(this.__resolvePath(basePath + pathGroup[i]));
				}
				this.pathGroups.h[id] = pathGroup;
			}
			this.sizes.h[id] = size;
			this.types.h[id] = asset.type;
			if(Object.prototype.hasOwnProperty.call(asset,"preload")) {
				this.preload.h[id] = Reflect.field(asset,"preload");
			}
			if(Object.prototype.hasOwnProperty.call(asset,"className")) {
				var name = Reflect.field(asset,"className");
				classRef = $hxClasses[name];
				this.classTypes.h[id] = classRef;
			}
		}
		this.bytesTotal = 0;
		var _g = 0;
		var _g1 = manifest.assets;
		while(_g < _g1.length) {
			var asset = _g1[_g];
			++_g;
			id = Object.prototype.hasOwnProperty.call(asset,"id") ? asset.id : asset.path;
			if(Object.prototype.hasOwnProperty.call(this.preload.h,id) && this.preload.h[id] && Object.prototype.hasOwnProperty.call(this.sizes.h,id)) {
				this.bytesTotal += this.sizes.h[id];
			}
		}
	}
	,__resolvePath: function(path) {
		path = StringTools.replace(path,"\\","/");
		var colonIdx = path.indexOf(":");
		if(StringTools.startsWith(path,"http") && colonIdx > 0) {
			var lastSlashIdx = colonIdx + 3;
			var httpSection = HxOverrides.substr(path,0,lastSlashIdx);
			path = httpSection + StringTools.replace(HxOverrides.substr(path,lastSlashIdx,null),"//","/");
		} else {
			path = StringTools.replace(path,"//","/");
		}
		if(path.indexOf("./") > -1) {
			var split = path.split("/");
			var newPath = [];
			var _g = 0;
			var _g1 = split.length;
			while(_g < _g1) {
				var i = _g++;
				if(split[i] == "..") {
					if(i == 0 || newPath[i - 1] == "..") {
						newPath.push("..");
					} else {
						newPath.pop();
					}
				} else if(split[i] == ".") {
					if(i == 0) {
						newPath.push(".");
					}
				} else {
					newPath.push(split[i]);
				}
			}
			path = newPath.join("/");
		}
		return path;
	}
	,loadAudioBuffer_onComplete: function(id,audioBuffer) {
		this.cachedAudioBuffers.h[id] = audioBuffer;
		if(Object.prototype.hasOwnProperty.call(this.pathGroups.h,id)) {
			var pathGroup = this.pathGroups.h[id];
			var otherID = haxe_ds_StringMap.keysIterator(this.pathGroups.h);
			while(otherID.hasNext()) {
				var otherID1 = otherID.next();
				if(otherID1 == id) {
					continue;
				}
				var _g = 0;
				while(_g < pathGroup.length) {
					var path = pathGroup[_g];
					++_g;
					if(this.pathGroups.h[otherID1].indexOf(path) > -1) {
						this.cachedAudioBuffers.h[otherID1] = audioBuffer;
						break;
					}
				}
			}
		}
		this.__assetLoaded(id);
	}
	,loadAudioBuffer_onError: function(id,message) {
		if(message != null && message != "") {
			lime_utils_Log.warn("Could not load \"" + id + "\": " + Std.string(message),{ fileName : "lime/utils/AssetLibrary.hx", lineNumber : 865, className : "lime.utils.AssetLibrary", methodName : "loadAudioBuffer_onError"});
		} else {
			lime_utils_Log.warn("Could not load \"" + id + "\"",{ fileName : "lime/utils/AssetLibrary.hx", lineNumber : 869, className : "lime.utils.AssetLibrary", methodName : "loadAudioBuffer_onError"});
		}
		this.loadAudioBuffer_onComplete(id,new lime_media_AudioBuffer());
	}
	,loadBytes_onComplete: function(id,bytes) {
		this.cachedBytes.h[id] = bytes;
		this.__assetLoaded(id);
	}
	,loadFont_onComplete: function(id,font) {
		this.cachedFonts.h[id] = font;
		this.__assetLoaded(id);
	}
	,loadImage_onComplete: function(id,image) {
		this.cachedImages.h[id] = image;
		this.__assetLoaded(id);
	}
	,loadText_onComplete: function(id,text) {
		this.cachedText.h[id] = text;
		this.__assetLoaded(id);
	}
	,load_onError: function(id,message) {
		if(message != null && message != "") {
			this.promise.error("Error loading asset \"" + id + "\": " + Std.string(message));
		} else {
			this.promise.error("Error loading asset \"" + id + "\"");
		}
	}
	,load_onProgress: function(id,bytesLoaded,bytesTotal) {
		if(bytesLoaded > 0) {
			var size = this.sizes.h[id];
			var percent;
			if(bytesTotal > 0) {
				percent = bytesLoaded / bytesTotal;
				if(percent > 1) {
					percent = 1;
				}
				bytesLoaded = Math.floor(percent * size);
			} else if(bytesLoaded > size) {
				bytesLoaded = size;
			}
			if(Object.prototype.hasOwnProperty.call(this.bytesLoadedCache.h,id)) {
				var cache = this.bytesLoadedCache.h[id];
				if(bytesLoaded != cache) {
					this.bytesLoaded += bytesLoaded - cache;
				}
			} else {
				this.bytesLoaded += bytesLoaded;
			}
			this.bytesLoadedCache.h[id] = bytesLoaded;
			this.promise.progress(this.bytesLoaded,this.bytesTotal);
		}
	}
	,__class__: lime_utils_AssetLibrary
};
var lime_utils_AssetManifest = function() {
	this.assets = [];
	this.libraryArgs = [];
	this.version = 2;
};
$hxClasses["lime.utils.AssetManifest"] = lime_utils_AssetManifest;
lime_utils_AssetManifest.__name__ = "lime.utils.AssetManifest";
lime_utils_AssetManifest.fromBytes = function(bytes,rootPath) {
	if(bytes != null) {
		return lime_utils_AssetManifest.parse(bytes.getString(0,bytes.length),rootPath);
	} else {
		return null;
	}
};
lime_utils_AssetManifest.fromFile = function(path,rootPath) {
	path = lime_utils_AssetManifest.__resolvePath(path);
	rootPath = lime_utils_AssetManifest.__resolveRootPath(rootPath,path);
	if(path == null) {
		return null;
	}
	return lime_utils_AssetManifest.fromBytes(lime_utils_Bytes.fromFile(path),rootPath);
};
lime_utils_AssetManifest.loadFromBytes = function(bytes,rootPath) {
	return lime_app_Future.withValue(lime_utils_AssetManifest.fromBytes(bytes,rootPath));
};
lime_utils_AssetManifest.loadFromFile = function(path,rootPath) {
	path = lime_utils_AssetManifest.__resolvePath(path);
	rootPath = lime_utils_AssetManifest.__resolveRootPath(rootPath,path);
	if(path == null) {
		return null;
	}
	return lime_utils_Bytes.loadFromFile(path).then(function(bytes) {
		return lime_app_Future.withValue(lime_utils_AssetManifest.fromBytes(bytes,rootPath));
	});
};
lime_utils_AssetManifest.parse = function(data,rootPath) {
	if(data == null || data == "") {
		return null;
	}
	var manifestData = JSON.parse(data);
	var manifest = new lime_utils_AssetManifest();
	if(Object.prototype.hasOwnProperty.call(manifestData,"name")) {
		manifest.name = manifestData.name;
	}
	if(Object.prototype.hasOwnProperty.call(manifestData,"libraryType")) {
		manifest.libraryType = manifestData.libraryType;
	}
	if(Object.prototype.hasOwnProperty.call(manifestData,"libraryArgs")) {
		manifest.libraryArgs = manifestData.libraryArgs;
	}
	if(Object.prototype.hasOwnProperty.call(manifestData,"assets")) {
		var assets = manifestData.assets;
		if(Object.prototype.hasOwnProperty.call(manifestData,"version") && manifestData.version <= 2) {
			manifest.assets = haxe_Unserializer.run(assets);
		} else {
			manifest.assets = assets;
		}
	}
	if(Object.prototype.hasOwnProperty.call(manifestData,"rootPath")) {
		manifest.rootPath = manifestData.rootPath;
	}
	if(rootPath != null && rootPath != "") {
		if(manifest.rootPath == null || manifest.rootPath == "") {
			manifest.rootPath = rootPath;
		} else {
			manifest.rootPath = rootPath + "/" + manifest.rootPath;
		}
	}
	return manifest;
};
lime_utils_AssetManifest.__resolvePath = function(path) {
	if(path == null) {
		return null;
	}
	var queryIndex = path.indexOf("?");
	var basePath;
	if(queryIndex > -1) {
		basePath = HxOverrides.substr(path,0,queryIndex);
	} else {
		basePath = path;
	}
	basePath = StringTools.replace(basePath,"\\","/");
	while(StringTools.endsWith(basePath,"/")) basePath = HxOverrides.substr(basePath,0,basePath.length - 1);
	if(StringTools.endsWith(basePath,".bundle")) {
		if(queryIndex > -1) {
			return basePath + "/library.json" + HxOverrides.substr(path,queryIndex,null);
		} else {
			return basePath + "/library.json";
		}
	} else {
		return path;
	}
};
lime_utils_AssetManifest.__resolveRootPath = function(rootPath,path) {
	if(rootPath != null) {
		return rootPath;
	}
	var queryIndex = path.indexOf("?");
	if(queryIndex > -1) {
		rootPath = HxOverrides.substr(path,0,queryIndex);
	} else {
		rootPath = path;
	}
	rootPath = StringTools.replace(rootPath,"\\","/");
	while(StringTools.endsWith(rootPath,"/")) {
		if(rootPath == "/") {
			return rootPath;
		}
		rootPath = HxOverrides.substr(rootPath,0,rootPath.length - 1);
	}
	if(StringTools.endsWith(rootPath,".bundle")) {
		return rootPath;
	} else {
		return haxe_io_Path.directory(rootPath);
	}
};
lime_utils_AssetManifest.prototype = {
	assets: null
	,libraryArgs: null
	,libraryType: null
	,name: null
	,rootPath: null
	,version: null
	,serialize: function() {
		var manifestData = { };
		manifestData.version = this.version;
		manifestData.libraryType = this.libraryType;
		manifestData.libraryArgs = this.libraryArgs;
		manifestData.name = this.name;
		manifestData.assets = haxe_Serializer.run(this.assets);
		manifestData.rootPath = this.rootPath;
		return JSON.stringify(manifestData);
	}
	,__class__: lime_utils_AssetManifest
};
var lime_utils_Assets = function() { };
$hxClasses["lime.utils.Assets"] = lime_utils_Assets;
lime_utils_Assets.__name__ = "lime.utils.Assets";
lime_utils_Assets.exists = function(id,type) {
	if(type == null) {
		type = "BINARY";
	}
	var id1 = id;
	var colonIndex = id1.indexOf(":");
	var symbol_libraryName = id1.substring(0,colonIndex);
	var symbol_symbolName = id1.substring(colonIndex + 1);
	var symbol_library = lime_utils_Assets.getLibrary(symbol_libraryName);
	if(symbol_library != null) {
		return symbol_library.exists(symbol_symbolName,type);
	}
	return false;
};
lime_utils_Assets.getAsset = function(id,type,useCache) {
	if(useCache && lime_utils_Assets.cache.enabled) {
		switch(type) {
		case "BINARY":case "TEXT":
			useCache = false;
			break;
		case "FONT":
			var font = lime_utils_Assets.cache.font.h[id];
			if(font != null) {
				return font;
			}
			break;
		case "IMAGE":
			var image = lime_utils_Assets.cache.image.h[id];
			if(lime_utils_Assets.isValidImage(image)) {
				return image;
			}
			break;
		case "MUSIC":case "SOUND":
			var audio = lime_utils_Assets.cache.audio.h[id];
			if(lime_utils_Assets.isValidAudio(audio)) {
				return audio;
			}
			break;
		case "TEMPLATE":
			throw haxe_Exception.thrown("Not sure how to get template: " + id);
		default:
			return null;
		}
	}
	var id1 = id;
	var colonIndex = id1.indexOf(":");
	var symbol_libraryName = id1.substring(0,colonIndex);
	var symbol_symbolName = id1.substring(colonIndex + 1);
	var symbol_library = lime_utils_Assets.getLibrary(symbol_libraryName);
	if(symbol_library != null) {
		if(symbol_library.exists(symbol_symbolName,type)) {
			if(symbol_library.isLocal(symbol_symbolName,type)) {
				var asset = symbol_library.getAsset(symbol_symbolName,type);
				if(useCache && lime_utils_Assets.cache.enabled) {
					lime_utils_Assets.cache.set(id,type,asset);
				}
				return asset;
			} else {
				lime_utils_Log.error(type + " asset \"" + id + "\" exists, but only asynchronously",{ fileName : "lime/utils/Assets.hx", lineNumber : 133, className : "lime.utils.Assets", methodName : "getAsset"});
			}
		} else {
			lime_utils_Log.error("There is no " + type + " asset with an ID of \"" + id + "\"",{ fileName : "lime/utils/Assets.hx", lineNumber : 138, className : "lime.utils.Assets", methodName : "getAsset"});
		}
	} else {
		lime_utils_Log.error(lime_utils_Assets.__libraryNotFound(symbol_libraryName),{ fileName : "lime/utils/Assets.hx", lineNumber : 143, className : "lime.utils.Assets", methodName : "getAsset"});
	}
	return null;
};
lime_utils_Assets.getAudioBuffer = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	return lime_utils_Assets.getAsset(id,"SOUND",useCache);
};
lime_utils_Assets.getBytes = function(id) {
	return lime_utils_Assets.getAsset(id,"BINARY",false);
};
lime_utils_Assets.getFont = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	return lime_utils_Assets.getAsset(id,"FONT",useCache);
};
lime_utils_Assets.getImage = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	return lime_utils_Assets.getAsset(id,"IMAGE",useCache);
};
lime_utils_Assets.getLibrary = function(name) {
	if(name == null || name == "") {
		name = "default";
	}
	return lime_utils_Assets.libraries.h[name];
};
lime_utils_Assets.getPath = function(id) {
	var id1 = id;
	var colonIndex = id1.indexOf(":");
	var symbol_libraryName = id1.substring(0,colonIndex);
	var symbol_symbolName = id1.substring(colonIndex + 1);
	var symbol_library = lime_utils_Assets.getLibrary(symbol_libraryName);
	if(symbol_library != null) {
		if(symbol_library.exists(symbol_symbolName,null)) {
			return symbol_library.getPath(symbol_symbolName);
		} else {
			lime_utils_Log.error("There is no asset with an ID of \"" + id + "\"",{ fileName : "lime/utils/Assets.hx", lineNumber : 224, className : "lime.utils.Assets", methodName : "getPath"});
		}
	} else {
		lime_utils_Log.error(lime_utils_Assets.__libraryNotFound(symbol_libraryName),{ fileName : "lime/utils/Assets.hx", lineNumber : 229, className : "lime.utils.Assets", methodName : "getPath"});
	}
	return null;
};
lime_utils_Assets.getText = function(id) {
	return lime_utils_Assets.getAsset(id,"TEXT",false);
};
lime_utils_Assets.hasLibrary = function(name) {
	if(name == null || name == "") {
		name = "default";
	}
	return Object.prototype.hasOwnProperty.call(lime_utils_Assets.libraries.h,name);
};
lime_utils_Assets.isLocal = function(id,type,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	if(useCache && lime_utils_Assets.cache.enabled) {
		if(lime_utils_Assets.cache.exists(id,type)) {
			return true;
		}
	}
	var id1 = id;
	var colonIndex = id1.indexOf(":");
	var symbol_libraryName = id1.substring(0,colonIndex);
	var symbol_symbolName = id1.substring(colonIndex + 1);
	var symbol_library = lime_utils_Assets.getLibrary(symbol_libraryName);
	if(symbol_library != null) {
		return symbol_library.isLocal(symbol_symbolName,type);
	} else {
		return false;
	}
};
lime_utils_Assets.isValidAudio = function(buffer) {
	return buffer != null;
};
lime_utils_Assets.isValidImage = function(image) {
	if(image != null) {
		return image.buffer != null;
	} else {
		return false;
	}
};
lime_utils_Assets.list = function(type) {
	var items = [];
	var library = haxe_ds_StringMap.valueIterator(lime_utils_Assets.libraries.h);
	while(library.hasNext()) {
		var library1 = library.next();
		var libraryItems = library1.list(type);
		if(libraryItems != null) {
			items = items.concat(libraryItems);
		}
	}
	return items;
};
lime_utils_Assets.loadAsset = function(id,type,useCache) {
	if(useCache && lime_utils_Assets.cache.enabled) {
		switch(type) {
		case "BINARY":case "TEXT":
			useCache = false;
			break;
		case "FONT":
			var font = lime_utils_Assets.cache.font.h[id];
			if(font != null) {
				return lime_app_Future.withValue(font);
			}
			break;
		case "IMAGE":
			var image = lime_utils_Assets.cache.image.h[id];
			if(lime_utils_Assets.isValidImage(image)) {
				return lime_app_Future.withValue(image);
			}
			break;
		case "MUSIC":case "SOUND":
			var audio = lime_utils_Assets.cache.audio.h[id];
			if(lime_utils_Assets.isValidAudio(audio)) {
				return lime_app_Future.withValue(audio);
			}
			break;
		case "TEMPLATE":
			throw haxe_Exception.thrown("Not sure how to get template: " + id);
		default:
			return null;
		}
	}
	var id1 = id;
	var colonIndex = id1.indexOf(":");
	var symbol_libraryName = id1.substring(0,colonIndex);
	var symbol_symbolName = id1.substring(colonIndex + 1);
	var symbol_library = lime_utils_Assets.getLibrary(symbol_libraryName);
	if(symbol_library != null) {
		if(symbol_library.exists(symbol_symbolName,type)) {
			var future = symbol_library.loadAsset(symbol_symbolName,type);
			if(useCache && lime_utils_Assets.cache.enabled) {
				future.onComplete(function(asset) {
					lime_utils_Assets.cache.set(id,type,asset);
				});
			}
			return future;
		} else {
			return lime_app_Future.withError("There is no " + type + " asset with an ID of \"" + id + "\"");
		}
	} else {
		return lime_app_Future.withError(lime_utils_Assets.__libraryNotFound(symbol_libraryName));
	}
};
lime_utils_Assets.loadAudioBuffer = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	return lime_utils_Assets.loadAsset(id,"SOUND",useCache);
};
lime_utils_Assets.loadBytes = function(id) {
	return lime_utils_Assets.loadAsset(id,"BINARY",false);
};
lime_utils_Assets.loadFont = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	return lime_utils_Assets.loadAsset(id,"FONT",useCache);
};
lime_utils_Assets.loadImage = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	return lime_utils_Assets.loadAsset(id,"IMAGE",useCache);
};
lime_utils_Assets.loadLibrary = function(id) {
	var promise = new lime_app_Promise();
	var library = lime_utils_Assets.getLibrary(id);
	if(library != null) {
		return library.load();
	}
	var path = id;
	var rootPath = null;
	if(Object.prototype.hasOwnProperty.call(lime_utils_Assets.bundlePaths.h,id)) {
		lime_utils_AssetBundle.loadFromFile(lime_utils_Assets.bundlePaths.h[id]).onComplete(function(bundle) {
			if(bundle == null) {
				promise.error("Cannot load bundle for library \"" + id + "\"");
				return;
			}
			var library = lime_utils_AssetLibrary.fromBundle(bundle);
			if(library == null) {
				promise.error("Cannot open library \"" + id + "\"");
			} else {
				lime_utils_Assets.libraries.h[id] = library;
				library.onChange.add(($_=lime_utils_Assets.onChange,$bind($_,$_.dispatch)));
				promise.completeWith(library.load());
			}
		}).onError(function(_) {
			promise.error("There is no asset library with an ID of \"" + id + "\"");
		});
	} else {
		if(Object.prototype.hasOwnProperty.call(lime_utils_Assets.libraryPaths.h,id)) {
			path = lime_utils_Assets.libraryPaths.h[id];
			rootPath = haxe_io_Path.directory(path);
		} else {
			if(StringTools.endsWith(path,".bundle")) {
				rootPath = path;
				path += "/library.json";
			} else {
				rootPath = haxe_io_Path.directory(path);
			}
			path = lime_utils_Assets.__cacheBreak(path);
		}
		lime_utils_AssetManifest.loadFromFile(path,rootPath).onComplete(function(manifest) {
			if(manifest == null) {
				promise.error("Cannot parse asset manifest for library \"" + id + "\"");
				return;
			}
			var library = lime_utils_AssetLibrary.fromManifest(manifest);
			if(library == null) {
				promise.error("Cannot open library \"" + id + "\"");
			} else {
				lime_utils_Assets.libraries.h[id] = library;
				library.onChange.add(($_=lime_utils_Assets.onChange,$bind($_,$_.dispatch)));
				promise.completeWith(library.load());
			}
		}).onError(function(_) {
			promise.error("There is no asset library with an ID of \"" + id + "\"");
		});
	}
	return promise.future;
};
lime_utils_Assets.loadText = function(id) {
	return lime_utils_Assets.loadAsset(id,"TEXT",false);
};
lime_utils_Assets.registerLibrary = function(name,library) {
	if(Object.prototype.hasOwnProperty.call(lime_utils_Assets.libraries.h,name)) {
		if(lime_utils_Assets.libraries.h[name] == library) {
			return;
		} else {
			lime_utils_Assets.unloadLibrary(name);
		}
	}
	if(library != null) {
		library.onChange.add(lime_utils_Assets.library_onChange);
	}
	lime_utils_Assets.libraries.h[name] = library;
};
lime_utils_Assets.unloadLibrary = function(name) {
	if(name == null || name == "") {
		name = "default";
	}
	var library = lime_utils_Assets.libraries.h[name];
	if(library != null) {
		lime_utils_Assets.cache.clear(name + ":");
		library.onChange.remove(lime_utils_Assets.library_onChange);
		library.unload();
	}
	var _this = lime_utils_Assets.libraries;
	if(Object.prototype.hasOwnProperty.call(_this.h,name)) {
		delete(_this.h[name]);
	}
};
lime_utils_Assets.__cacheBreak = function(path) {
	if(lime_utils_Assets.cache.version > 0) {
		if(path.indexOf("?") > -1) {
			path += "&" + lime_utils_Assets.cache.version;
		} else {
			path += "?" + lime_utils_Assets.cache.version;
		}
	}
	return path;
};
lime_utils_Assets.__libraryNotFound = function(name) {
	if(name == null || name == "") {
		name = "default";
	}
	if(lime_app_Application.current != null && lime_app_Application.current.__preloader != null && !lime_app_Application.current.__preloader.complete) {
		return "There is no asset library named \"" + name + "\", or it is not yet preloaded";
	} else {
		return "There is no asset library named \"" + name + "\"";
	}
};
lime_utils_Assets.library_onChange = function() {
	lime_utils_Assets.cache.clear();
	lime_utils_Assets.onChange.dispatch();
};
var lime_utils__$Assets_LibrarySymbol = function(id) {
	var colonIndex = id.indexOf(":");
	this.libraryName = id.substring(0,colonIndex);
	this.symbolName = id.substring(colonIndex + 1);
	this.library = lime_utils_Assets.getLibrary(this.libraryName);
};
$hxClasses["lime.utils._Assets.LibrarySymbol"] = lime_utils__$Assets_LibrarySymbol;
lime_utils__$Assets_LibrarySymbol.__name__ = "lime.utils._Assets.LibrarySymbol";
lime_utils__$Assets_LibrarySymbol.prototype = {
	library: null
	,libraryName: null
	,symbolName: null
	,isLocal: function(type) {
		return this.library.isLocal(this.symbolName,type);
	}
	,exists: function(type) {
		return this.library.exists(this.symbolName,type);
	}
	,__class__: lime_utils__$Assets_LibrarySymbol
};
var lime_utils_BytePointer = {};
lime_utils_BytePointer._new = function(bytes,offset) {
	if(offset == null) {
		offset = 0;
	}
	var this1 = new lime_utils_BytePointerData(bytes,offset);
	return this1;
};
lime_utils_BytePointer.set = function(this1,bytes,bufferView,buffer,offset) {
	if(buffer != null) {
		bytes = haxe_io_Bytes.ofData(buffer);
	}
	if(bytes != null || bufferView == null) {
		this1.bytes = bytes;
		this1.offset = offset != null ? offset : 0;
	} else {
		this1.bytes = haxe_io_Bytes.ofData(bufferView.buffer);
		this1.offset = offset != null ? bufferView.byteOffset + offset : bufferView.byteOffset;
	}
};
lime_utils_BytePointer.__arrayGet = function(this1,index) {
	if(this1.bytes != null) {
		return this1.bytes.b[index + this1.offset];
	} else {
		return 0;
	}
};
lime_utils_BytePointer.__arraySet = function(this1,index,value) {
	if(this1.bytes == null) {
		this1.bytes.b[index + this1.offset] = value & 255;
	}
	return value;
};
lime_utils_BytePointer.fromArrayBufferView = function(arrayBufferView) {
	if(arrayBufferView == null) {
		return null;
	}
	return new lime_utils_BytePointerData(haxe_io_Bytes.ofData(arrayBufferView.buffer),arrayBufferView.byteOffset);
};
lime_utils_BytePointer.fromArrayBuffer = function(buffer) {
	if(buffer == null) {
		return null;
	}
	return new lime_utils_BytePointerData(haxe_io_Bytes.ofData(buffer),0);
};
lime_utils_BytePointer.fromBytes = function(bytes) {
	return new lime_utils_BytePointerData(bytes,0);
};
lime_utils_BytePointer.fromBytesData = function(bytesData) {
	if(bytesData == null) {
		return new lime_utils_BytePointerData(null,0);
	} else {
		return new lime_utils_BytePointerData(haxe_io_Bytes.ofData(bytesData),0);
	}
};
lime_utils_BytePointer.fromFile = function(path) {
	return new lime_utils_BytePointerData(lime_utils_Bytes.fromFile(path),0);
};
lime_utils_BytePointer.fromLimeBytes = function(bytes) {
	return new lime_utils_BytePointerData(bytes,0);
};
lime_utils_BytePointer.toUInt8Array = function(bytePointer) {
	var elements = null;
	var array = null;
	var vector = null;
	var view = null;
	var buffer = bytePointer.bytes.b.bufferValue;
	var byteoffset = bytePointer.offset / 8 | 0;
	var len = null;
	if(byteoffset == null) {
		byteoffset = 0;
	}
	var this1;
	if(elements != null) {
		this1 = new Uint8Array(elements);
	} else if(array != null) {
		this1 = new Uint8Array(array);
	} else if(vector != null) {
		this1 = new Uint8Array(vector.__array);
	} else if(view != null) {
		this1 = new Uint8Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Uint8Array(buffer,byteoffset);
		} else {
			this1 = new Uint8Array(buffer,byteoffset,len);
		}
	} else {
		this1 = null;
	}
	return this1;
};
lime_utils_BytePointer.toUInt8ClampedArray = function(bytePointer) {
	if(bytePointer == null || bytePointer.bytes == null) {
		return null;
	}
	var elements = null;
	var array = null;
	var vector = null;
	var view = null;
	var buffer = bytePointer.bytes.b.bufferValue;
	var byteoffset = bytePointer.offset / 8 | 0;
	var len = null;
	if(byteoffset == null) {
		byteoffset = 0;
	}
	var this1;
	if(elements != null) {
		this1 = new Uint8ClampedArray(elements);
	} else if(array != null) {
		this1 = new Uint8ClampedArray(array);
	} else if(vector != null) {
		this1 = new Uint8ClampedArray(vector.__array);
	} else if(view != null) {
		this1 = new Uint8ClampedArray(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Uint8ClampedArray(buffer,byteoffset);
		} else {
			this1 = new Uint8ClampedArray(buffer,byteoffset,len);
		}
	} else {
		this1 = null;
	}
	return this1;
};
lime_utils_BytePointer.toInt8Array = function(bytePointer) {
	if(bytePointer == null || bytePointer.bytes == null) {
		return null;
	}
	var elements = null;
	var array = null;
	var vector = null;
	var view = null;
	var buffer = bytePointer.bytes.b.bufferValue;
	var byteoffset = bytePointer.offset / 8 | 0;
	var len = null;
	if(byteoffset == null) {
		byteoffset = 0;
	}
	var this1;
	if(elements != null) {
		this1 = new Int8Array(elements);
	} else if(array != null) {
		this1 = new Int8Array(array);
	} else if(vector != null) {
		this1 = new Int8Array(vector.__array);
	} else if(view != null) {
		this1 = new Int8Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Int8Array(buffer,byteoffset);
		} else {
			this1 = new Int8Array(buffer,byteoffset,len);
		}
	} else {
		this1 = null;
	}
	return this1;
};
lime_utils_BytePointer.toUInt16Array = function(bytePointer) {
	if(bytePointer == null || bytePointer.bytes == null) {
		return null;
	}
	var elements = null;
	var array = null;
	var vector = null;
	var view = null;
	var buffer = bytePointer.bytes.b.bufferValue;
	var byteoffset = bytePointer.offset / 16 | 0;
	var len = null;
	if(byteoffset == null) {
		byteoffset = 0;
	}
	var this1;
	if(elements != null) {
		this1 = new Uint16Array(elements);
	} else if(array != null) {
		this1 = new Uint16Array(array);
	} else if(vector != null) {
		this1 = new Uint16Array(vector.__array);
	} else if(view != null) {
		this1 = new Uint16Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Uint16Array(buffer,byteoffset);
		} else {
			this1 = new Uint16Array(buffer,byteoffset,len);
		}
	} else {
		this1 = null;
	}
	return this1;
};
lime_utils_BytePointer.toInt16Array = function(bytePointer) {
	if(bytePointer == null || bytePointer.bytes == null) {
		return null;
	}
	var elements = null;
	var array = null;
	var vector = null;
	var view = null;
	var buffer = bytePointer.bytes.b.bufferValue;
	var byteoffset = bytePointer.offset / 16 | 0;
	var len = null;
	if(byteoffset == null) {
		byteoffset = 0;
	}
	var this1;
	if(elements != null) {
		this1 = new Int16Array(elements);
	} else if(array != null) {
		this1 = new Int16Array(array);
	} else if(vector != null) {
		this1 = new Int16Array(vector.__array);
	} else if(view != null) {
		this1 = new Int16Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Int16Array(buffer,byteoffset);
		} else {
			this1 = new Int16Array(buffer,byteoffset,len);
		}
	} else {
		this1 = null;
	}
	return this1;
};
lime_utils_BytePointer.toUInt32Array = function(bytePointer) {
	if(bytePointer == null || bytePointer.bytes == null) {
		return null;
	}
	var elements = null;
	var array = null;
	var vector = null;
	var view = null;
	var buffer = bytePointer.bytes.b.bufferValue;
	var byteoffset = bytePointer.offset / 32 | 0;
	var len = null;
	if(byteoffset == null) {
		byteoffset = 0;
	}
	var this1;
	if(elements != null) {
		this1 = new Uint32Array(elements);
	} else if(array != null) {
		this1 = new Uint32Array(array);
	} else if(vector != null) {
		this1 = new Uint32Array(vector.__array);
	} else if(view != null) {
		this1 = new Uint32Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Uint32Array(buffer,byteoffset);
		} else {
			this1 = new Uint32Array(buffer,byteoffset,len);
		}
	} else {
		this1 = null;
	}
	return this1;
};
lime_utils_BytePointer.toInt32Array = function(bytePointer) {
	if(bytePointer == null || bytePointer.bytes == null) {
		return null;
	}
	var elements = null;
	var array = null;
	var vector = null;
	var view = null;
	var buffer = bytePointer.bytes.b.bufferValue;
	var byteoffset = bytePointer.offset / 32 | 0;
	var len = null;
	if(byteoffset == null) {
		byteoffset = 0;
	}
	var this1;
	if(elements != null) {
		this1 = new Int32Array(elements);
	} else if(array != null) {
		this1 = new Int32Array(array);
	} else if(vector != null) {
		this1 = new Int32Array(vector.__array);
	} else if(view != null) {
		this1 = new Int32Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Int32Array(buffer,byteoffset);
		} else {
			this1 = new Int32Array(buffer,byteoffset,len);
		}
	} else {
		this1 = null;
	}
	return this1;
};
lime_utils_BytePointer.toFloat32Array = function(bytePointer) {
	if(bytePointer == null || bytePointer.bytes == null) {
		return null;
	}
	var elements = null;
	var array = null;
	var vector = null;
	var view = null;
	var buffer = bytePointer.bytes.b.bufferValue;
	var byteoffset = bytePointer.offset / 32 | 0;
	var len = null;
	if(byteoffset == null) {
		byteoffset = 0;
	}
	var this1;
	if(elements != null) {
		this1 = new Float32Array(elements);
	} else if(array != null) {
		this1 = new Float32Array(array);
	} else if(vector != null) {
		this1 = new Float32Array(vector.__array);
	} else if(view != null) {
		this1 = new Float32Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Float32Array(buffer,byteoffset);
		} else {
			this1 = new Float32Array(buffer,byteoffset,len);
		}
	} else {
		this1 = null;
	}
	return this1;
};
lime_utils_BytePointer.toFloat64Array = function(bytePointer) {
	if(bytePointer == null || bytePointer.bytes == null) {
		return null;
	}
	var elements = null;
	var array = null;
	var vector = null;
	var view = null;
	var buffer = bytePointer.bytes.b.bufferValue;
	var byteoffset = bytePointer.offset / 64 | 0;
	var len = null;
	if(byteoffset == null) {
		byteoffset = 0;
	}
	var this1;
	if(elements != null) {
		this1 = new Float64Array(elements);
	} else if(array != null) {
		this1 = new Float64Array(array);
	} else if(vector != null) {
		this1 = new Float64Array(vector.__array);
	} else if(view != null) {
		this1 = new Float64Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Float64Array(buffer,byteoffset);
		} else {
			this1 = new Float64Array(buffer,byteoffset,len);
		}
	} else {
		this1 = null;
	}
	return this1;
};
var lime_utils_BytePointerData = function(bytes,offset) {
	this.bytes = bytes;
	this.offset = offset;
};
$hxClasses["lime.utils.BytePointerData"] = lime_utils_BytePointerData;
lime_utils_BytePointerData.__name__ = "lime.utils.BytePointerData";
lime_utils_BytePointerData.prototype = {
	bytes: null
	,offset: null
	,__class__: lime_utils_BytePointerData
};
var lime_utils_Bytes = {};
lime_utils_Bytes._new = function(length,bytesData) {
	var this1 = new haxe_io_Bytes(bytesData);
	return this1;
};
lime_utils_Bytes.alloc = function(length) {
	return new haxe_io_Bytes(new ArrayBuffer(length));
};
lime_utils_Bytes.compress = function(this1,algorithm) {
	switch(algorithm._hx_index) {
	case 0:
		return lime__$internal_format_Deflate.compress(this1);
	case 1:
		return lime__$internal_format_GZip.compress(this1);
	case 2:
		return lime__$internal_format_LZMA.compress(this1);
	case 3:
		return lime__$internal_format_Zlib.compress(this1);
	}
};
lime_utils_Bytes.decompress = function(this1,algorithm) {
	switch(algorithm._hx_index) {
	case 0:
		return lime__$internal_format_Deflate.decompress(this1);
	case 1:
		return lime__$internal_format_GZip.decompress(this1);
	case 2:
		return lime__$internal_format_LZMA.decompress(this1);
	case 3:
		return lime__$internal_format_Zlib.decompress(this1);
	}
};
lime_utils_Bytes.fastGet = function(b,pos) {
	return b.bytes[pos];
};
lime_utils_Bytes.fromBytes = function(bytes) {
	if(bytes == null) {
		return null;
	}
	return lime_utils_Bytes._new(bytes.length,bytes.b.bufferValue);
};
lime_utils_Bytes.fromFile = function(path) {
	return null;
};
lime_utils_Bytes.loadFromBytes = function(bytes) {
	return lime_app_Future.withValue(lime_utils_Bytes.fromBytes(bytes));
};
lime_utils_Bytes.loadFromFile = function(path) {
	var request = new lime_net__$HTTPRequest_$lime_$utils_$Bytes();
	return request.load(path);
};
lime_utils_Bytes.ofData = function(b) {
	var bytes = haxe_io_Bytes.ofData(b);
	return lime_utils_Bytes._new(bytes.length,bytes.b.bufferValue);
};
lime_utils_Bytes.ofString = function(s) {
	var bytes = haxe_io_Bytes.ofString(s);
	return lime_utils_Bytes._new(bytes.length,bytes.b.bufferValue);
};
var lime_utils_CompressionAlgorithm = $hxEnums["lime.utils.CompressionAlgorithm"] = { __ename__ : "lime.utils.CompressionAlgorithm", __constructs__ : ["DEFLATE","GZIP","LZMA","ZLIB"]
	,DEFLATE: {_hx_index:0,__enum__:"lime.utils.CompressionAlgorithm",toString:$estr}
	,GZIP: {_hx_index:1,__enum__:"lime.utils.CompressionAlgorithm",toString:$estr}
	,LZMA: {_hx_index:2,__enum__:"lime.utils.CompressionAlgorithm",toString:$estr}
	,ZLIB: {_hx_index:3,__enum__:"lime.utils.CompressionAlgorithm",toString:$estr}
};
var lime_utils_DataPointer = {};
lime_utils_DataPointer._new = function(data) {
	var this1 = data;
	return this1;
};
lime_utils_DataPointer.fromFloat = function(value) {
	return value;
};
lime_utils_DataPointer.fromBytesPointer = function(pointer) {
	return lime_utils_DataPointer.fromFloat(0);
};
lime_utils_DataPointer.fromArrayBufferView = function(arrayBufferView) {
	return lime_utils_DataPointer.fromFloat(0);
};
lime_utils_DataPointer.fromArrayBuffer = function(buffer) {
	return lime_utils_DataPointer.fromFloat(0);
};
lime_utils_DataPointer.fromBytes = function(bytes) {
	return lime_utils_DataPointer.fromFloat(0);
};
lime_utils_DataPointer.fromBytesData = function(bytesData) {
	return lime_utils_DataPointer.fromFloat(0);
};
lime_utils_DataPointer.fromLimeBytes = function(bytes) {
	return lime_utils_DataPointer.fromBytes(bytes);
};
lime_utils_DataPointer.fromCFFIPointer = function(pointer) {
	return lime_utils_DataPointer.fromFloat(0);
};
lime_utils_DataPointer.fromFile = function(path) {
	return lime_utils_DataPointer.fromFloat(0);
};
lime_utils_DataPointer.__withOffset = function(data,offset) {
	return lime_utils_DataPointer.fromFloat(0);
};
lime_utils_DataPointer.equals = function(a,b) {
	return a == b;
};
lime_utils_DataPointer.equalsPointer = function(a,b) {
	return a == b;
};
lime_utils_DataPointer.greaterThan = function(a,b) {
	return a > b;
};
lime_utils_DataPointer.greaterThanPointer = function(a,b) {
	return lime_system_CFFIPointer.get(a) > lime_system_CFFIPointer.get(b);
};
lime_utils_DataPointer.greaterThanOrEqual = function(a,b) {
	return a >= b;
};
lime_utils_DataPointer.greaterThanOrEqualPointer = function(a,b) {
	return lime_system_CFFIPointer.get(a) >= lime_system_CFFIPointer.get(b);
};
lime_utils_DataPointer.lessThan = function(a,b) {
	return a < b;
};
lime_utils_DataPointer.lessThanPointer = function(a,b) {
	return lime_system_CFFIPointer.get(a) < lime_system_CFFIPointer.get(b);
};
lime_utils_DataPointer.lessThanOrEqual = function(a,b) {
	return a <= b;
};
lime_utils_DataPointer.lessThanOrEqualPointer = function(a,b) {
	return lime_system_CFFIPointer.get(a) <= lime_system_CFFIPointer.get(b);
};
lime_utils_DataPointer.notEquals = function(a,b) {
	return a != b;
};
lime_utils_DataPointer.notEqualsPointer = function(a,b) {
	return a != b;
};
lime_utils_DataPointer.plus = function(a,b) {
	return lime_utils_DataPointer.__withOffset(a,b);
};
lime_utils_DataPointer.plusPointer = function(a,b) {
	return lime_utils_DataPointer.__withOffset(a,b | 0);
};
lime_utils_DataPointer.minus = function(a,b) {
	return lime_utils_DataPointer.__withOffset(a,-b);
};
lime_utils_DataPointer.minusPointer = function(a,b) {
	return lime_utils_DataPointer.__withOffset(a,-(b | 0));
};
var lime_utils_Float32Array = {};
lime_utils_Float32Array.toArrayBufferView = function(this1) {
	return this1;
};
lime_utils_Float32Array.fromBytes = function(bytes,byteOffset,len) {
	if(byteOffset == null) {
		byteOffset = 0;
	}
	if(byteOffset == null) {
		return new Float32Array(bytes.b.bufferValue);
	}
	if(len == null) {
		return new Float32Array(bytes.b.bufferValue,byteOffset);
	}
	return new Float32Array(bytes.b.bufferValue,byteOffset,len);
};
lime_utils_Float32Array.toBytes = function(this1) {
	return new haxe_io_Bytes(new Uint8Array(this1.buffer));
};
lime_utils_Float32Array.toString = function(this1) {
	if(this1 != null) {
		return "Float32Array [byteLength:" + this1.byteLength + ", length:" + this1.length + "]";
	} else {
		return null;
	}
};
var lime_utils_Float64Array = {};
lime_utils_Float64Array.toArrayBufferView = function(this1) {
	return this1;
};
lime_utils_Float64Array.fromBytes = function(bytes,byteOffset,len) {
	if(byteOffset == null) {
		byteOffset = 0;
	}
	if(byteOffset == null) {
		return new Float64Array(bytes.b.bufferValue);
	}
	if(len == null) {
		return new Float64Array(bytes.b.bufferValue,byteOffset);
	}
	return new Float64Array(bytes.b.bufferValue,byteOffset,len);
};
lime_utils_Float64Array.toBytes = function(this1) {
	return new haxe_io_Bytes(new Uint8Array(this1.buffer));
};
lime_utils_Float64Array.toString = function(this1) {
	if(this1 != null) {
		return "Float64Array [byteLength:" + this1.byteLength + ", length:" + this1.length + "]";
	} else {
		return null;
	}
};
var lime_utils_Int16Array = {};
lime_utils_Int16Array.toArrayBufferView = function(this1) {
	return this1;
};
lime_utils_Int16Array.fromBytes = function(bytes,byteOffset,len) {
	if(byteOffset == null) {
		byteOffset = 0;
	}
	if(byteOffset == null) {
		return new Int16Array(bytes.b.bufferValue);
	}
	if(len == null) {
		return new Int16Array(bytes.b.bufferValue,byteOffset);
	}
	return new Int16Array(bytes.b.bufferValue,byteOffset,len);
};
lime_utils_Int16Array.toBytes = function(this1) {
	return new haxe_io_Bytes(new Uint8Array(this1.buffer));
};
lime_utils_Int16Array.toString = function(this1) {
	if(this1 != null) {
		return "Int16Array [byteLength:" + this1.byteLength + ", length:" + this1.length + "]";
	} else {
		return null;
	}
};
var lime_utils_Int32Array = {};
lime_utils_Int32Array.toArrayBufferView = function(this1) {
	return this1;
};
lime_utils_Int32Array.fromBytes = function(bytes,byteOffset,len) {
	if(byteOffset == null) {
		byteOffset = 0;
	}
	if(byteOffset == null) {
		return new Int32Array(bytes.b.bufferValue);
	}
	if(len == null) {
		return new Int32Array(bytes.b.bufferValue,byteOffset);
	}
	return new Int32Array(bytes.b.bufferValue,byteOffset,len);
};
lime_utils_Int32Array.toBytes = function(this1) {
	return new haxe_io_Bytes(new Uint8Array(this1.buffer));
};
lime_utils_Int32Array.toString = function(this1) {
	if(this1 != null) {
		return "Int32Array [byteLength:" + this1.byteLength + ", length:" + this1.length + "]";
	} else {
		return null;
	}
};
var lime_utils_Int8Array = {};
lime_utils_Int8Array.toArrayBufferView = function(this1) {
	return this1;
};
lime_utils_Int8Array.fromBytes = function(bytes,byteOffset,len) {
	if(byteOffset == null) {
		byteOffset = 0;
	}
	return new Int8Array(bytes.b.bufferValue,byteOffset,len);
};
lime_utils_Int8Array.toBytes = function(this1) {
	return new haxe_io_Bytes(new Uint8Array(this1.buffer));
};
lime_utils_Int8Array.toString = function(this1) {
	if(this1 != null) {
		return "Int8Array [byteLength:" + this1.byteLength + ", length:" + this1.length + "]";
	} else {
		return null;
	}
};
var lime_utils_Log = function() { };
$hxClasses["lime.utils.Log"] = lime_utils_Log;
lime_utils_Log.__name__ = "lime.utils.Log";
lime_utils_Log.level = null;
lime_utils_Log.debug = function(message,info) {
	if(lime_utils_Log.level >= 4) {
		console.debug("[" + info.className + "] " + Std.string(message));
	}
};
lime_utils_Log.error = function(message,info) {
	if(lime_utils_Log.level >= 1) {
		var message1 = "[" + info.className + "] ERROR: " + Std.string(message);
		if(lime_utils_Log.throwErrors) {
			throw haxe_Exception.thrown(message1);
		} else {
			console.error(message1);
		}
	}
};
lime_utils_Log.info = function(message,info) {
	if(lime_utils_Log.level >= 3) {
		console.info("[" + info.className + "] " + Std.string(message));
	}
};
lime_utils_Log.print = function(message) {
	console.log(message);
};
lime_utils_Log.println = function(message) {
	console.log(message);
};
lime_utils_Log.verbose = function(message,info) {
	if(lime_utils_Log.level >= 5) {
		var message1 = "[" + info.className + "] " + Std.string(message);
		console.log(message1);
	}
};
lime_utils_Log.warn = function(message,info) {
	if(lime_utils_Log.level >= 2) {
		console.warn("[" + info.className + "] WARNING: " + Std.string(message));
	}
};
var lime_utils_LogLevel = {};
lime_utils_LogLevel.gt = function(a,b) {
	return a > b;
};
lime_utils_LogLevel.gte = function(a,b) {
	return a >= b;
};
lime_utils_LogLevel.lt = function(a,b) {
	return a < b;
};
lime_utils_LogLevel.lte = function(a,b) {
	return a <= b;
};
var lime_utils_Preloader = function() {
	this.bytesTotalCache = new haxe_ds_StringMap();
	this.bytesLoadedCache2 = new haxe_ds_StringMap();
	this.bytesLoadedCache = new haxe_ds_ObjectMap();
	this.onProgress = new lime_app__$Event_$Int_$Int_$Void();
	this.onComplete = new lime_app__$Event_$Void_$Void();
	this.bytesLoaded = 0;
	this.bytesTotal = 0;
	this.libraries = [];
	this.libraryNames = [];
	this.onProgress.add($bind(this,this.update));
};
$hxClasses["lime.utils.Preloader"] = lime_utils_Preloader;
lime_utils_Preloader.__name__ = "lime.utils.Preloader";
lime_utils_Preloader.prototype = {
	complete: null
	,onComplete: null
	,onProgress: null
	,bytesLoaded: null
	,bytesLoadedCache: null
	,bytesLoadedCache2: null
	,bytesTotal: null
	,bytesTotalCache: null
	,initLibraryNames: null
	,libraries: null
	,libraryNames: null
	,loadedLibraries: null
	,loadedStage: null
	,preloadComplete: null
	,preloadStarted: null
	,simulateProgress: null
	,addLibrary: function(library) {
		this.libraries.push(library);
	}
	,addLibraryName: function(name) {
		if(this.libraryNames.indexOf(name) == -1) {
			this.libraryNames.push(name);
		}
	}
	,load: function() {
		var _gthis = this;
		var _g = 0;
		var _g1 = this.libraries;
		while(_g < _g1.length) {
			var library = _g1[_g];
			++_g;
			this.bytesTotal += library.bytesTotal;
		}
		this.loadedLibraries = -1;
		this.preloadStarted = false;
		var _g = 0;
		var _g1 = this.libraries;
		while(_g < _g1.length) {
			var library = [_g1[_g]];
			++_g;
			lime_utils_Log.verbose("Preloading asset library",{ fileName : "lime/utils/Preloader.hx", lineNumber : 132, className : "lime.utils.Preloader", methodName : "load"});
			library[0].load().onProgress((function(library) {
				return function(loaded,total) {
					if(_gthis.bytesLoadedCache.h.__keys__[library[0].__id__] == null) {
						_gthis.bytesLoaded += loaded;
					} else {
						_gthis.bytesLoaded += loaded - _gthis.bytesLoadedCache.h[library[0].__id__];
					}
					_gthis.bytesLoadedCache.set(library[0],loaded);
					if(!_gthis.simulateProgress) {
						_gthis.onProgress.dispatch(_gthis.bytesLoaded,_gthis.bytesTotal);
					}
				};
			})(library)).onComplete((function(library) {
				return function(_) {
					if(_gthis.bytesLoadedCache.h.__keys__[library[0].__id__] == null) {
						_gthis.bytesLoaded += library[0].bytesTotal;
					} else {
						_gthis.bytesLoaded += library[0].bytesTotal - _gthis.bytesLoadedCache.h[library[0].__id__];
					}
					_gthis.loadedAssetLibrary();
				};
			})(library)).onError((function() {
				return function(e) {
					lime_utils_Log.error(e,{ fileName : "lime/utils/Preloader.hx", lineNumber : 168, className : "lime.utils.Preloader", methodName : "load"});
				};
			})());
		}
		var _g = 0;
		var _g1 = this.libraryNames;
		while(_g < _g1.length) {
			var name = _g1[_g];
			++_g;
			this.bytesTotal += 200;
		}
		this.loadedLibraries++;
		this.preloadStarted = true;
		this.updateProgress();
	}
	,loadedAssetLibrary: function(name) {
		this.loadedLibraries++;
		var current = this.loadedLibraries;
		if(!this.preloadStarted) {
			++current;
		}
		var totalLibraries = this.libraries.length + this.libraryNames.length;
		if(name != null) {
			lime_utils_Log.verbose("Loaded asset library: " + name + " [" + current + "/" + totalLibraries + "]",{ fileName : "lime/utils/Preloader.hx", lineNumber : 195, className : "lime.utils.Preloader", methodName : "loadedAssetLibrary"});
		} else {
			lime_utils_Log.verbose("Loaded asset library [" + current + "/" + totalLibraries + "]",{ fileName : "lime/utils/Preloader.hx", lineNumber : 199, className : "lime.utils.Preloader", methodName : "loadedAssetLibrary"});
		}
		this.updateProgress();
	}
	,start: function() {
		if(this.complete || this.simulateProgress || !this.preloadComplete) {
			return;
		}
		this.complete = true;
		this.onComplete.dispatch();
	}
	,update: function(loaded,total) {
	}
	,updateProgress: function() {
		var _gthis = this;
		if(!this.simulateProgress) {
			this.onProgress.dispatch(this.bytesLoaded,this.bytesTotal);
		}
		if(this.loadedLibraries == this.libraries.length && !this.initLibraryNames) {
			this.initLibraryNames = true;
			var _g = 0;
			var _g1 = this.libraryNames;
			while(_g < _g1.length) {
				var name = [_g1[_g]];
				++_g;
				lime_utils_Log.verbose("Preloading asset library: " + name[0],{ fileName : "lime/utils/Preloader.hx", lineNumber : 236, className : "lime.utils.Preloader", methodName : "updateProgress"});
				lime_utils_Assets.loadLibrary(name[0]).onProgress((function(name) {
					return function(loaded,total) {
						if(total > 0) {
							if(!Object.prototype.hasOwnProperty.call(_gthis.bytesTotalCache.h,name[0])) {
								_gthis.bytesTotalCache.h[name[0]] = total;
								_gthis.bytesTotal += total - 200;
							}
							if(loaded > total) {
								loaded = total;
							}
							if(!Object.prototype.hasOwnProperty.call(_gthis.bytesLoadedCache2.h,name[0])) {
								_gthis.bytesLoaded += loaded;
							} else {
								_gthis.bytesLoaded += loaded - _gthis.bytesLoadedCache2.h[name[0]];
							}
							_gthis.bytesLoadedCache2.h[name[0]] = loaded;
							if(!_gthis.simulateProgress) {
								_gthis.onProgress.dispatch(_gthis.bytesLoaded,_gthis.bytesTotal);
							}
						}
					};
				})(name)).onComplete((function(name) {
					return function(library) {
						var total = 200;
						if(Object.prototype.hasOwnProperty.call(_gthis.bytesTotalCache.h,name[0])) {
							total = _gthis.bytesTotalCache.h[name[0]];
						}
						if(!Object.prototype.hasOwnProperty.call(_gthis.bytesLoadedCache2.h,name[0])) {
							_gthis.bytesLoaded += total;
						} else {
							_gthis.bytesLoaded += total - _gthis.bytesLoadedCache2.h[name[0]];
						}
						_gthis.loadedAssetLibrary(name[0]);
					};
				})(name)).onError((function() {
					return function(e) {
						lime_utils_Log.error(e,{ fileName : "lime/utils/Preloader.hx", lineNumber : 290, className : "lime.utils.Preloader", methodName : "updateProgress"});
					};
				})());
			}
		}
		if(!this.simulateProgress && this.loadedLibraries == this.libraries.length + this.libraryNames.length) {
			if(!this.preloadComplete) {
				this.preloadComplete = true;
				lime_utils_Log.verbose("Preload complete",{ fileName : "lime/utils/Preloader.hx", lineNumber : 301, className : "lime.utils.Preloader", methodName : "updateProgress"});
			}
			this.start();
		}
	}
	,__class__: lime_utils_Preloader
};
var lime_utils_UInt16Array = {};
lime_utils_UInt16Array.toArrayBufferView = function(this1) {
	return this1;
};
lime_utils_UInt16Array.fromBytes = function(bytes,byteOffset,len) {
	if(byteOffset == null) {
		byteOffset = 0;
	}
	if(byteOffset == null) {
		return new Uint16Array(bytes.b.bufferValue);
	}
	if(len == null) {
		return new Uint16Array(bytes.b.bufferValue,byteOffset);
	}
	return new Uint16Array(bytes.b.bufferValue,byteOffset,len);
};
lime_utils_UInt16Array.toBytes = function(this1) {
	return new haxe_io_Bytes(new Uint8Array(this1.buffer));
};
lime_utils_UInt16Array.toString = function(this1) {
	if(this1 != null) {
		return "UInt16Array [byteLength:" + this1.byteLength + ", length:" + this1.length + "]";
	} else {
		return null;
	}
};
var lime_utils_UInt32Array = {};
lime_utils_UInt32Array.toArrayBufferView = function(this1) {
	return this1;
};
lime_utils_UInt32Array.fromBytes = function(bytes,byteOffset,len) {
	if(byteOffset == null) {
		byteOffset = 0;
	}
	if(byteOffset == null) {
		return new Uint32Array(bytes.b.bufferValue);
	}
	if(len == null) {
		return new Uint32Array(bytes.b.bufferValue,byteOffset);
	}
	return new Uint32Array(bytes.b.bufferValue,byteOffset,len);
};
lime_utils_UInt32Array.toBytes = function(this1) {
	return new haxe_io_Bytes(new Uint8Array(this1.buffer));
};
lime_utils_UInt32Array.toString = function(this1) {
	if(this1 != null) {
		return "UInt32Array [byteLength:" + this1.byteLength + ", length:" + this1.length + "]";
	} else {
		return null;
	}
};
var lime_utils_UInt8Array = {};
lime_utils_UInt8Array.toArrayBufferView = function(this1) {
	return this1;
};
lime_utils_UInt8Array.fromBytes = function(bytes,byteOffset,len) {
	if(byteOffset == null) {
		return new Uint8Array(bytes.b.bufferValue);
	}
	if(len == null) {
		return new Uint8Array(bytes.b.bufferValue,byteOffset);
	}
	return new Uint8Array(bytes.b.bufferValue,byteOffset,len);
};
lime_utils_UInt8Array.toBytes = function(this1) {
	return new haxe_io_Bytes(new Uint8Array(this1.buffer));
};
lime_utils_UInt8Array.toString = function(this1) {
	if(this1 != null) {
		return "UInt8Array [byteLength:" + this1.byteLength + ", length:" + this1.length + "]";
	} else {
		return null;
	}
};
var lime_utils_UInt8ClampedArray = {};
lime_utils_UInt8ClampedArray.toArrayBufferView = function(this1) {
	return this1;
};
lime_utils_UInt8ClampedArray.fromBytes = function(bytes,byteOffset,len) {
	if(byteOffset == null) {
		byteOffset = 0;
	}
	if(byteOffset == null) {
		return new Uint8ClampedArray(bytes.b.bufferValue);
	}
	if(len == null) {
		return new Uint8ClampedArray(bytes.b.bufferValue,byteOffset);
	}
	return new Uint8ClampedArray(bytes.b.bufferValue,byteOffset,len);
};
lime_utils_UInt8ClampedArray.toBytes = function(this1) {
	return new haxe_io_Bytes(new Uint8Array(this1.buffer));
};
lime_utils_UInt8ClampedArray.toString = function(this1) {
	if(this1 != null) {
		return "UInt8ClampedArray [byteLength:" + this1.byteLength + ", length:" + this1.length + "]";
	} else {
		return null;
	}
};
lime_utils_UInt8ClampedArray._clamp = function(_in) {
	var _out = _in | 0;
	if(_out > 255) {
		_out = 255;
	}
	if(_out < 0) {
		return 0;
	} else {
		return _out;
	}
};
var openfl_Lib = function() { };
$hxClasses["openfl.Lib"] = openfl_Lib;
openfl_Lib.__name__ = "openfl.Lib";
openfl_Lib.__properties__ = {get_current:"get_current",get_application:"get_application"};
openfl_Lib.as = function(v,c) {
	if(js_Boot.__instanceof(v,c)) {
		return v;
	} else {
		return null;
	}
};
openfl_Lib.attach = function(name) {
	return new openfl_display_MovieClip();
};
openfl_Lib.clearInterval = function(id) {
	if(openfl_Lib.__timers.h.hasOwnProperty(id)) {
		var timer = openfl_Lib.__timers.h[id];
		timer.stop();
		openfl_Lib.__timers.remove(id);
	}
};
openfl_Lib.clearTimeout = function(id) {
	if(openfl_Lib.__timers.h.hasOwnProperty(id)) {
		var timer = openfl_Lib.__timers.h[id];
		timer.stop();
		openfl_Lib.__timers.remove(id);
	}
};
openfl_Lib.getDefinitionByName = function(name) {
	if(name == null) {
		return null;
	}
	return $hxClasses[name];
};
openfl_Lib.getQualifiedClassName = function(value) {
	if(value == null) {
		return null;
	}
	var ref = js_Boot.__instanceof(value,Class) ? value : js_Boot.getClass(value);
	if(ref == null) {
		if(typeof(value) == "boolean" || value == Bool) {
			return "Bool";
		} else if(typeof(value) == "number" && ((value | 0) === value) || value == Int) {
			return "Int";
		} else if(typeof(value) == "number" || value == Float) {
			return "Float";
		} else {
			return null;
		}
	}
	return ref.__name__;
};
openfl_Lib.getQualifiedSuperclassName = function(value) {
	if(value == null) {
		return null;
	}
	var ref = js_Boot.__instanceof(value,Class) ? value : js_Boot.getClass(value);
	if(ref == null) {
		return null;
	}
	var parentRef = ref.__super__;
	if(parentRef == null) {
		return null;
	}
	return parentRef.__name__;
};
openfl_Lib.getTimer = function() {
	return lime_system_System.getTimer();
};
openfl_Lib.getURL = function(request,target) {
	openfl_Lib.navigateToURL(request,target);
};
openfl_Lib.navigateToURL = function(request,$window) {
	if($window == null) {
		$window = "_blank";
	}
	var uri = request.url;
	if(Type.typeof(request.data) == ValueType.TObject) {
		var query = "";
		var fields = Reflect.fields(request.data);
		var _g = 0;
		while(_g < fields.length) {
			var field = fields[_g];
			++_g;
			if(query.length > 0) {
				query += "&";
			}
			var query1 = encodeURIComponent(field) + "=";
			var s = Std.string(Reflect.field(request.data,field));
			query += query1 + encodeURIComponent(s);
		}
		if(uri.indexOf("?") > -1) {
			uri += "&" + query;
		} else {
			uri += "?" + query;
		}
	}
	lime_system_System.openURL(uri,$window);
};
openfl_Lib.notImplemented = function(posInfo) {
	var api = posInfo.className + "." + posInfo.methodName;
	if(!Object.prototype.hasOwnProperty.call(openfl_Lib.__sentWarnings.h,api)) {
		openfl_Lib.__sentWarnings.h[api] = true;
		lime_utils_Log.warn(posInfo.methodName + " is not implemented",posInfo);
	}
};
openfl_Lib.preventDefaultTouchMove = function() {
	window.document.addEventListener("touchmove",function(evt) {
		evt.preventDefault();
	},false);
};
openfl_Lib.sendToURL = function(request) {
	var urlLoader = new openfl_net_URLLoader();
	urlLoader.load(request);
};
openfl_Lib.setInterval = function(closure,delay,args) {
	var id = ++openfl_Lib.__lastTimerID;
	var timer = new haxe_Timer(delay);
	openfl_Lib.__timers.h[id] = timer;
	timer.run = function() {
		closure.apply(closure,args == null ? [] : args);
	};
	return id;
};
openfl_Lib.setTimeout = function(closure,delay,args) {
	var id = ++openfl_Lib.__lastTimerID;
	var this1 = openfl_Lib.__timers;
	var v = haxe_Timer.delay(function() {
		closure.apply(closure,args == null ? [] : args);
	},delay);
	this1.h[id] = v;
	return id;
};
openfl_Lib.trace = function(arg) {
	haxe_Log.trace(arg,{ fileName : "openfl/Lib.hx", lineNumber : 260, className : "openfl.Lib", methodName : "trace"});
};
openfl_Lib.get_application = function() {
	return openfl__$internal_Lib.application;
};
openfl_Lib.get_current = function() {
	if(openfl__$internal_Lib.current == null) {
		openfl__$internal_Lib.current = new openfl_display_MovieClip();
	}
	return openfl__$internal_Lib.current;
};
var openfl__$Vector_IVector = function() { };
$hxClasses["openfl._Vector.IVector"] = openfl__$Vector_IVector;
openfl__$Vector_IVector.__name__ = "openfl._Vector.IVector";
openfl__$Vector_IVector.__isInterface__ = true;
openfl__$Vector_IVector.prototype = {
	get_length: null
	,set_length: null
	,fixed: null
	,concat: null
	,copy: null
	,filter: null
	,get: null
	,indexOf: null
	,insertAt: null
	,iterator: null
	,join: null
	,lastIndexOf: null
	,pop: null
	,push: null
	,removeAt: null
	,reverse: null
	,set: null
	,shift: null
	,slice: null
	,sort: null
	,splice: null
	,toString: null
	,unshift: null
	,__class__: openfl__$Vector_IVector
	,__properties__: {set_length:"set_length",get_length:"get_length"}
};
var openfl__$Vector_BoolVector = function(length,fixed,array) {
	if(fixed == null) {
		fixed = false;
	}
	if(length == null) {
		length = 0;
	}
	if(array == null) {
		array = [];
	}
	this.__array = array;
	if(length > 0) {
		this.set_length(length);
	}
	this.fixed = fixed;
};
$hxClasses["openfl._Vector.BoolVector"] = openfl__$Vector_BoolVector;
openfl__$Vector_BoolVector.__name__ = "openfl._Vector.BoolVector";
openfl__$Vector_BoolVector.__interfaces__ = [openfl__$Vector_IVector];
openfl__$Vector_BoolVector.prototype = {
	fixed: null
	,__array: null
	,concat: function(a) {
		if(a == null) {
			return new openfl__$Vector_BoolVector(0,false,this.__array.slice());
		} else {
			var other = a;
			if(other.__array.length > 0) {
				return new openfl__$Vector_BoolVector(0,false,this.__array.concat(other.__array));
			} else {
				return new openfl__$Vector_BoolVector(0,false,this.__array.slice());
			}
		}
	}
	,copy: function() {
		return new openfl__$Vector_BoolVector(0,this.fixed,this.__array.slice());
	}
	,filter: function(callback) {
		var tmp = this.fixed;
		var _g = [];
		var _g1 = 0;
		var _g2 = this.__array;
		while(_g1 < _g2.length) {
			var v = _g2[_g1];
			++_g1;
			if(callback(v)) {
				_g.push(v);
			}
		}
		return new openfl__$Vector_BoolVector(0,tmp,_g);
	}
	,get: function(index) {
		if(index >= this.__array.length) {
			return false;
		} else {
			return this.__array[index];
		}
	}
	,indexOf: function(x,from) {
		if(from == null) {
			from = 0;
		}
		var _g = from;
		var _g1 = this.__array.length;
		while(_g < _g1) {
			var i = _g++;
			if(this.__array[i] == x) {
				return i;
			}
		}
		return -1;
	}
	,insertAt: function(index,element) {
		if(!this.fixed || index < this.__array.length) {
			this.__array.splice(index,0,element);
		}
	}
	,iterator: function() {
		return new haxe_iterators_ArrayIterator(this.__array);
	}
	,join: function(sep) {
		if(sep == null) {
			sep = ",";
		}
		return this.__array.join(sep);
	}
	,lastIndexOf: function(x,from) {
		var i = from == null || from >= this.__array.length ? this.__array.length - 1 : from;
		while(i >= 0) {
			if(this.__array[i] == x) {
				return i;
			}
			--i;
		}
		return -1;
	}
	,pop: function() {
		if(!this.fixed) {
			return this.__array.pop();
		} else {
			return null;
		}
	}
	,push: function(x) {
		if(!this.fixed) {
			return this.__array.push(x);
		} else {
			return this.__array.length;
		}
	}
	,removeAt: function(index) {
		if(!this.fixed || index < this.__array.length) {
			return this.__array.splice(index,1)[0];
		}
		return false;
	}
	,reverse: function() {
		this.__array.reverse();
		return this;
	}
	,set: function(index,value) {
		if(!this.fixed || index < this.__array.length) {
			return this.__array[index] = value;
		} else {
			return value;
		}
	}
	,shift: function() {
		if(!this.fixed) {
			return this.__array.shift();
		} else {
			return null;
		}
	}
	,slice: function(startIndex,endIndex) {
		if(startIndex == null) {
			startIndex = 0;
		}
		if(endIndex == null) {
			endIndex = 16777215;
		}
		return new openfl__$Vector_BoolVector(0,false,this.__array.slice(startIndex,endIndex));
	}
	,sort: function(f) {
		this.__array.sort(f);
	}
	,splice: function(pos,len) {
		return new openfl__$Vector_BoolVector(0,false,this.__array.splice(pos,len));
	}
	,toJSON: function() {
		return this.__array;
	}
	,toString: function() {
		if(this.__array != null) {
			return this.__array.toString();
		} else {
			return null;
		}
	}
	,unshift: function(x) {
		if(!this.fixed) {
			this.__array.unshift(x);
		}
	}
	,get_length: function() {
		return this.__array.length;
	}
	,set_length: function(value) {
		if(!this.fixed) {
			var currentLength = this.__array.length;
			if(value < 0) {
				value = 0;
			}
			if(value > currentLength) {
				var _g = currentLength;
				var _g1 = value;
				while(_g < _g1) {
					var i = _g++;
					this.__array[i] = false;
				}
			} else {
				while(this.__array.length > value) this.__array.pop();
			}
		}
		return this.__array.length;
	}
	,__class__: openfl__$Vector_BoolVector
	,__properties__: {set_length:"set_length",get_length:"get_length"}
};
var openfl__$Vector_FloatVector = function(length,fixed,array,forceCopy) {
	if(forceCopy == null) {
		forceCopy = false;
	}
	if(fixed == null) {
		fixed = false;
	}
	if(length == null) {
		length = 0;
	}
	if(forceCopy) {
		this.__array = [];
		if(array != null) {
			var _g = 0;
			var _g1 = array.length;
			while(_g < _g1) {
				var i = _g++;
				this.__array[i] = array[i];
			}
		}
	} else {
		if(array == null) {
			array = [];
		}
		this.__array = array;
	}
	if(length > 0) {
		this.set_length(length);
	}
	this.fixed = fixed;
};
$hxClasses["openfl._Vector.FloatVector"] = openfl__$Vector_FloatVector;
openfl__$Vector_FloatVector.__name__ = "openfl._Vector.FloatVector";
openfl__$Vector_FloatVector.__interfaces__ = [openfl__$Vector_IVector];
openfl__$Vector_FloatVector.prototype = {
	fixed: null
	,__array: null
	,concat: function(a) {
		if(a == null) {
			return new openfl__$Vector_FloatVector(0,false,this.__array.slice());
		} else {
			var other = a;
			if(other.__array.length > 0) {
				return new openfl__$Vector_FloatVector(0,false,this.__array.concat(other.__array));
			} else {
				return new openfl__$Vector_FloatVector(0,false,this.__array.slice());
			}
		}
	}
	,copy: function() {
		return new openfl__$Vector_FloatVector(0,this.fixed,this.__array.slice());
	}
	,filter: function(callback) {
		var tmp = this.fixed;
		var _g = [];
		var _g1 = 0;
		var _g2 = this.__array;
		while(_g1 < _g2.length) {
			var v = _g2[_g1];
			++_g1;
			if(callback(v)) {
				_g.push(v);
			}
		}
		return new openfl__$Vector_FloatVector(0,tmp,_g);
	}
	,get: function(index) {
		return this.__array[index];
	}
	,indexOf: function(x,from) {
		if(from == null) {
			from = 0;
		}
		var _g = from;
		var _g1 = this.__array.length;
		while(_g < _g1) {
			var i = _g++;
			if(this.__array[i] == x) {
				return i;
			}
		}
		return -1;
	}
	,insertAt: function(index,element) {
		if(!this.fixed || index < this.__array.length) {
			this.__array.splice(index,0,element);
		}
	}
	,iterator: function() {
		return new haxe_iterators_ArrayIterator(this.__array);
	}
	,join: function(sep) {
		if(sep == null) {
			sep = ",";
		}
		return this.__array.join(sep);
	}
	,lastIndexOf: function(x,from) {
		var i = from == null || from >= this.__array.length ? this.__array.length - 1 : from;
		while(i >= 0) {
			if(this.__array[i] == x) {
				return i;
			}
			--i;
		}
		return -1;
	}
	,pop: function() {
		if(!this.fixed) {
			return this.__array.pop();
		} else {
			return null;
		}
	}
	,push: function(x) {
		if(!this.fixed) {
			return this.__array.push(x);
		} else {
			return this.__array.length;
		}
	}
	,removeAt: function(index) {
		if(!this.fixed || index < this.__array.length) {
			return this.__array.splice(index,1)[0];
		}
		return 0;
	}
	,reverse: function() {
		this.__array.reverse();
		return this;
	}
	,set: function(index,value) {
		if(!this.fixed || index < this.__array.length) {
			return this.__array[index] = value;
		} else {
			return value;
		}
	}
	,shift: function() {
		if(!this.fixed) {
			return this.__array.shift();
		} else {
			return null;
		}
	}
	,slice: function(startIndex,endIndex) {
		if(startIndex == null) {
			startIndex = 0;
		}
		if(endIndex == null) {
			endIndex = 16777215;
		}
		return new openfl__$Vector_FloatVector(0,false,this.__array.slice(startIndex,endIndex));
	}
	,sort: function(f) {
		this.__array.sort(f);
	}
	,splice: function(pos,len) {
		return new openfl__$Vector_FloatVector(0,false,this.__array.splice(pos,len));
	}
	,toJSON: function() {
		return this.__array;
	}
	,toString: function() {
		if(this.__array != null) {
			return this.__array.toString();
		} else {
			return null;
		}
	}
	,unshift: function(x) {
		if(!this.fixed) {
			this.__array.unshift(x);
		}
	}
	,get_length: function() {
		return this.__array.length;
	}
	,set_length: function(value) {
		if(value != this.__array.length && !this.fixed) {
			var currentLength = this.__array.length;
			if(value < 0) {
				value = 0;
			}
			if(value > currentLength) {
				var _g = currentLength;
				var _g1 = value;
				while(_g < _g1) {
					var i = _g++;
					this.__array[i] = 0;
				}
			} else {
				while(this.__array.length > value) this.__array.pop();
			}
		}
		return this.__array.length;
	}
	,__class__: openfl__$Vector_FloatVector
	,__properties__: {set_length:"set_length",get_length:"get_length"}
};
var openfl__$Vector_FunctionVector = function(length,fixed,array) {
	if(fixed == null) {
		fixed = false;
	}
	if(length == null) {
		length = 0;
	}
	if(array == null) {
		array = [];
	}
	this.__array = array;
	if(length > 0) {
		this.set_length(length);
	}
	this.fixed = fixed;
};
$hxClasses["openfl._Vector.FunctionVector"] = openfl__$Vector_FunctionVector;
openfl__$Vector_FunctionVector.__name__ = "openfl._Vector.FunctionVector";
openfl__$Vector_FunctionVector.__interfaces__ = [openfl__$Vector_IVector];
openfl__$Vector_FunctionVector.prototype = {
	fixed: null
	,__array: null
	,concat: function(a) {
		if(a == null) {
			return new openfl__$Vector_FunctionVector(0,false,this.__array.slice());
		} else {
			var other = a;
			if(other.__array.length > 0) {
				return new openfl__$Vector_FunctionVector(0,false,this.__array.concat(other.__array));
			} else {
				return new openfl__$Vector_FunctionVector(0,false,this.__array.slice());
			}
		}
	}
	,copy: function() {
		return new openfl__$Vector_FunctionVector(0,this.fixed,this.__array.slice());
	}
	,filter: function(callback) {
		var tmp = this.fixed;
		var _g = [];
		var _g1 = 0;
		var _g2 = this.__array;
		while(_g1 < _g2.length) {
			var v = _g2[_g1];
			++_g1;
			if(callback(v)) {
				_g.push(v);
			}
		}
		return new openfl__$Vector_FunctionVector(0,tmp,_g);
	}
	,get: function(index) {
		if(index >= this.__array.length) {
			return null;
		} else {
			return this.__array[index];
		}
	}
	,indexOf: function(x,from) {
		if(from == null) {
			from = 0;
		}
		var _g = from;
		var _g1 = this.__array.length;
		while(_g < _g1) {
			var i = _g++;
			if(Reflect.compareMethods(this.__array[i],x)) {
				return i;
			}
		}
		return -1;
	}
	,insertAt: function(index,element) {
		if(!this.fixed || index < this.__array.length) {
			this.__array.splice(index,0,element);
		}
	}
	,iterator: function() {
		return new haxe_iterators_ArrayIterator(this.__array);
	}
	,join: function(sep) {
		if(sep == null) {
			sep = ",";
		}
		return this.__array.join(sep);
	}
	,lastIndexOf: function(x,from) {
		var i = from == null || from >= this.__array.length ? this.__array.length - 1 : from;
		while(i >= 0) {
			if(Reflect.compareMethods(this.__array[i],x)) {
				return i;
			}
			--i;
		}
		return -1;
	}
	,pop: function() {
		if(!this.fixed) {
			return this.__array.pop();
		} else {
			return null;
		}
	}
	,push: function(x) {
		if(!this.fixed) {
			return this.__array.push(x);
		} else {
			return this.__array.length;
		}
	}
	,removeAt: function(index) {
		if(!this.fixed || index < this.__array.length) {
			return this.__array.splice(index,1)[0];
		}
		return null;
	}
	,reverse: function() {
		this.__array.reverse();
		return this;
	}
	,set: function(index,value) {
		if(!this.fixed || index < this.__array.length) {
			return this.__array[index] = value;
		} else {
			return value;
		}
	}
	,shift: function() {
		if(!this.fixed) {
			return this.__array.shift();
		} else {
			return null;
		}
	}
	,slice: function(startIndex,endIndex) {
		if(startIndex == null) {
			startIndex = 0;
		}
		if(endIndex == null) {
			endIndex = 16777215;
		}
		return new openfl__$Vector_FunctionVector(0,false,this.__array.slice(startIndex,endIndex));
	}
	,sort: function(f) {
		this.__array.sort(f);
	}
	,splice: function(pos,len) {
		return new openfl__$Vector_FunctionVector(0,false,this.__array.splice(pos,len));
	}
	,toJSON: function() {
		return this.__array;
	}
	,toString: function() {
		if(this.__array != null) {
			return this.__array.toString();
		} else {
			return null;
		}
	}
	,unshift: function(x) {
		if(!this.fixed) {
			this.__array.unshift(x);
		}
	}
	,get_length: function() {
		return this.__array.length;
	}
	,set_length: function(value) {
		if(!this.fixed) {
			var currentLength = this.__array.length;
			if(value < 0) {
				value = 0;
			}
			if(value > currentLength) {
				var _g = currentLength;
				var _g1 = value;
				while(_g < _g1) {
					var i = _g++;
					this.__array[i] = null;
				}
			} else {
				while(this.__array.length > value) this.__array.pop();
			}
		}
		return this.__array.length;
	}
	,__class__: openfl__$Vector_FunctionVector
	,__properties__: {set_length:"set_length",get_length:"get_length"}
};
var openfl__$Vector_IntVector = function(length,fixed,array) {
	if(fixed == null) {
		fixed = false;
	}
	if(length == null) {
		length = 0;
	}
	if(array == null) {
		array = [];
	}
	this.__array = array;
	if(length > 0) {
		this.set_length(length);
	}
	this.fixed = fixed;
};
$hxClasses["openfl._Vector.IntVector"] = openfl__$Vector_IntVector;
openfl__$Vector_IntVector.__name__ = "openfl._Vector.IntVector";
openfl__$Vector_IntVector.__interfaces__ = [openfl__$Vector_IVector];
openfl__$Vector_IntVector.prototype = {
	fixed: null
	,__array: null
	,concat: function(a) {
		if(a == null) {
			return new openfl__$Vector_IntVector(0,false,this.__array.slice());
		} else {
			var other = a;
			if(other.__array.length > 0) {
				return new openfl__$Vector_IntVector(0,false,this.__array.concat(other.__array));
			} else {
				return new openfl__$Vector_IntVector(0,false,this.__array.slice());
			}
		}
	}
	,copy: function() {
		return new openfl__$Vector_IntVector(0,this.fixed,this.__array.slice());
	}
	,filter: function(callback) {
		var tmp = this.fixed;
		var _g = [];
		var _g1 = 0;
		var _g2 = this.__array;
		while(_g1 < _g2.length) {
			var v = _g2[_g1];
			++_g1;
			if(callback(v)) {
				_g.push(v);
			}
		}
		return new openfl__$Vector_IntVector(0,tmp,_g);
	}
	,get: function(index) {
		return this.__array[index];
	}
	,indexOf: function(x,from) {
		if(from == null) {
			from = 0;
		}
		var _g = from;
		var _g1 = this.__array.length;
		while(_g < _g1) {
			var i = _g++;
			if(this.__array[i] == x) {
				return i;
			}
		}
		return -1;
	}
	,insertAt: function(index,element) {
		if(!this.fixed || index < this.__array.length) {
			this.__array.splice(index,0,element);
		}
	}
	,iterator: function() {
		return new haxe_iterators_ArrayIterator(this.__array);
	}
	,join: function(sep) {
		if(sep == null) {
			sep = ",";
		}
		return this.__array.join(sep);
	}
	,lastIndexOf: function(x,from) {
		var i = from == null || from >= this.__array.length ? this.__array.length - 1 : from;
		while(i >= 0) {
			if(this.__array[i] == x) {
				return i;
			}
			--i;
		}
		return -1;
	}
	,pop: function() {
		if(!this.fixed) {
			return this.__array.pop();
		} else {
			return null;
		}
	}
	,push: function(x) {
		if(!this.fixed) {
			return this.__array.push(x);
		} else {
			return this.__array.length;
		}
	}
	,removeAt: function(index) {
		if(!this.fixed || index < this.__array.length) {
			return this.__array.splice(index,1)[0];
		}
		return 0;
	}
	,reverse: function() {
		this.__array.reverse();
		return this;
	}
	,set: function(index,value) {
		if(!this.fixed || index < this.__array.length) {
			return this.__array[index] = value;
		} else {
			return value;
		}
	}
	,shift: function() {
		if(!this.fixed) {
			return this.__array.shift();
		} else {
			return null;
		}
	}
	,slice: function(startIndex,endIndex) {
		if(startIndex == null) {
			startIndex = 0;
		}
		if(endIndex == null) {
			endIndex = 16777215;
		}
		return new openfl__$Vector_IntVector(0,false,this.__array.slice(startIndex,endIndex));
	}
	,sort: function(f) {
		this.__array.sort(f);
	}
	,splice: function(pos,len) {
		return new openfl__$Vector_IntVector(0,false,this.__array.splice(pos,len));
	}
	,toJSON: function() {
		return this.__array;
	}
	,toString: function() {
		if(this.__array != null) {
			return this.__array.toString();
		} else {
			return null;
		}
	}
	,unshift: function(x) {
		if(!this.fixed) {
			this.__array.unshift(x);
		}
	}
	,get_length: function() {
		return this.__array.length;
	}
	,set_length: function(value) {
		if(!this.fixed) {
			var currentLength = this.__array.length;
			if(value < 0) {
				value = 0;
			}
			if(value > currentLength) {
				var _g = currentLength;
				var _g1 = value;
				while(_g < _g1) {
					var i = _g++;
					this.__array[i] = 0;
				}
			} else {
				while(this.__array.length > value) this.__array.pop();
			}
		}
		return this.__array.length;
	}
	,__class__: openfl__$Vector_IntVector
	,__properties__: {set_length:"set_length",get_length:"get_length"}
};
var openfl__$Vector_ObjectVector = function(length,fixed,array,forceCopy) {
	if(forceCopy == null) {
		forceCopy = false;
	}
	if(fixed == null) {
		fixed = false;
	}
	if(length == null) {
		length = 0;
	}
	if(forceCopy) {
		this.__array = [];
		if(array != null) {
			var _g = 0;
			var _g1 = array.length;
			while(_g < _g1) {
				var i = _g++;
				this.__array[i] = array[i];
			}
		}
	} else {
		if(array == null) {
			array = [];
		}
		this.__array = array;
	}
	if(length > 0) {
		this.set_length(length);
	}
	this.fixed = fixed;
};
$hxClasses["openfl._Vector.ObjectVector"] = openfl__$Vector_ObjectVector;
openfl__$Vector_ObjectVector.__name__ = "openfl._Vector.ObjectVector";
openfl__$Vector_ObjectVector.__interfaces__ = [openfl__$Vector_IVector];
openfl__$Vector_ObjectVector.prototype = {
	fixed: null
	,__array: null
	,concat: function(a) {
		if(a == null) {
			return new openfl__$Vector_ObjectVector(0,false,this.__array.slice());
		} else {
			var other = a;
			if(other.__array.length > 0) {
				return new openfl__$Vector_ObjectVector(0,false,this.__array.concat(other.__array));
			} else {
				return new openfl__$Vector_ObjectVector(0,false,this.__array.slice());
			}
		}
	}
	,copy: function() {
		return new openfl__$Vector_ObjectVector(0,this.fixed,this.__array.slice());
	}
	,filter: function(callback) {
		var tmp = this.fixed;
		var _g = [];
		var _g1 = 0;
		var _g2 = this.__array;
		while(_g1 < _g2.length) {
			var v = _g2[_g1];
			++_g1;
			if(callback(v)) {
				_g.push(v);
			}
		}
		return new openfl__$Vector_ObjectVector(0,tmp,_g);
	}
	,get: function(index) {
		return this.__array[index];
	}
	,indexOf: function(x,from) {
		if(from == null) {
			from = 0;
		}
		var _g = from;
		var _g1 = this.__array.length;
		while(_g < _g1) {
			var i = _g++;
			if(this.__array[i] == x) {
				return i;
			}
		}
		return -1;
	}
	,insertAt: function(index,element) {
		if(!this.fixed || index < this.__array.length) {
			this.__array.splice(index,0,element);
		}
	}
	,iterator: function() {
		return new haxe_iterators_ArrayIterator(this.__array);
	}
	,join: function(sep) {
		if(sep == null) {
			sep = ",";
		}
		return this.__array.join(sep);
	}
	,lastIndexOf: function(x,from) {
		var i = from == null || from >= this.__array.length ? this.__array.length - 1 : from;
		while(i >= 0) {
			if(this.__array[i] == x) {
				return i;
			}
			--i;
		}
		return -1;
	}
	,pop: function() {
		if(!this.fixed) {
			return this.__array.pop();
		} else {
			return null;
		}
	}
	,push: function(x) {
		if(!this.fixed) {
			return this.__array.push(x);
		} else {
			return this.__array.length;
		}
	}
	,removeAt: function(index) {
		if(!this.fixed || index < this.__array.length) {
			return this.__array.splice(index,1)[0];
		}
		return null;
	}
	,reverse: function() {
		this.__array.reverse();
		return this;
	}
	,set: function(index,value) {
		if(!this.fixed || index < this.__array.length) {
			return this.__array[index] = value;
		} else {
			return value;
		}
	}
	,shift: function() {
		if(!this.fixed) {
			return this.__array.shift();
		} else {
			return null;
		}
	}
	,slice: function(startIndex,endIndex) {
		if(startIndex == null) {
			startIndex = 0;
		}
		if(endIndex == null) {
			endIndex = 16777215;
		}
		return new openfl__$Vector_ObjectVector(0,false,this.__array.slice(startIndex,endIndex));
	}
	,sort: function(f) {
		this.__array.sort(f);
	}
	,splice: function(pos,len) {
		return new openfl__$Vector_ObjectVector(0,false,this.__array.splice(pos,len));
	}
	,toJSON: function() {
		return this.__array;
	}
	,toString: function() {
		if(this.__array != null) {
			return this.__array.toString();
		} else {
			return null;
		}
	}
	,unshift: function(x) {
		if(!this.fixed) {
			this.__array.unshift(x);
		}
	}
	,get_length: function() {
		return this.__array.length;
	}
	,set_length: function(value) {
		if(!this.fixed) {
			var currentLength = this.__array.length;
			if(value < 0) {
				value = 0;
			}
			if(value > currentLength) {
				var _g = currentLength;
				var _g1 = value;
				while(_g < _g1) {
					var i = _g++;
					this.__array.push(null);
				}
			} else {
				while(this.__array.length > value) this.__array.pop();
			}
		}
		return this.__array.length;
	}
	,__class__: openfl__$Vector_ObjectVector
	,__properties__: {set_length:"set_length",get_length:"get_length"}
};
var openfl__$internal_Lib = function() { };
$hxClasses["openfl._internal.Lib"] = openfl__$internal_Lib;
openfl__$internal_Lib.__name__ = "openfl._internal.Lib";
openfl__$internal_Lib.application = null;
openfl__$internal_Lib.current = null;
openfl__$internal_Lib.notImplemented = function(posInfo) {
	var api = posInfo.className + "." + posInfo.methodName;
	if(!Object.prototype.hasOwnProperty.call(openfl__$internal_Lib.__sentWarnings.h,api)) {
		openfl__$internal_Lib.__sentWarnings.h[api] = true;
		lime_utils_Log.warn(posInfo.methodName + " is not implemented",posInfo);
	}
};
var openfl__$internal_formats_html_HTMLParser = function() { };
$hxClasses["openfl._internal.formats.html.HTMLParser"] = openfl__$internal_formats_html_HTMLParser;
openfl__$internal_formats_html_HTMLParser.__name__ = "openfl._internal.formats.html.HTMLParser";
openfl__$internal_formats_html_HTMLParser.parse = function(value,textFormat,textFormatRanges) {
	value = value.replace(openfl__$internal_formats_html_HTMLParser.__regexBreakTag.r,"\n");
	value = value.replace(openfl__$internal_formats_html_HTMLParser.__regexEntities[0].r,"\"");
	value = value.replace(openfl__$internal_formats_html_HTMLParser.__regexEntities[1].r,"'");
	value = value.replace(openfl__$internal_formats_html_HTMLParser.__regexEntities[2].r,"&");
	value = value.replace(openfl__$internal_formats_html_HTMLParser.__regexEntities[5].r," ");
	var segments = value.split("<");
	if(segments.length == 1) {
		value = value.replace(openfl__$internal_formats_html_HTMLParser.__regexHTMLTag.r,"");
		if(textFormatRanges.get_length() > 1) {
			textFormatRanges.splice(1,textFormatRanges.get_length() - 1);
		}
		value = value.replace(openfl__$internal_formats_html_HTMLParser.__regexEntities[3].r,"<");
		value = value.replace(openfl__$internal_formats_html_HTMLParser.__regexEntities[4].r,">");
		var range = textFormatRanges.get(0);
		range.format = textFormat;
		range.start = 0;
		range.end = value.length;
		return value;
	} else {
		textFormatRanges.splice(0,textFormatRanges.get_length());
		value = "";
		var segment;
		var _g = 0;
		var _g1 = segments.length;
		while(_g < _g1) {
			var i = _g++;
			segment = segments[i];
			segment = segment.replace(openfl__$internal_formats_html_HTMLParser.__regexEntities[3].r,"<");
			segment = segment.replace(openfl__$internal_formats_html_HTMLParser.__regexEntities[4].r,">");
			segments[i] = segment;
		}
		var formatStack = [textFormat.clone()];
		var tagStack = [];
		var sub;
		var noLineBreak = false;
		var _g = 0;
		while(_g < segments.length) {
			var segment = segments[_g];
			++_g;
			if(segment == "") {
				continue;
			}
			var isClosingTag = HxOverrides.substr(segment,0,1) == "/";
			var tagEndIndex = segment.indexOf(">");
			var start = tagEndIndex + 1;
			var spaceIndex = segment.indexOf(" ");
			var tagName = segment.substring(isClosingTag ? 1 : 0,spaceIndex > -1 && spaceIndex < tagEndIndex ? spaceIndex : tagEndIndex);
			var format;
			if(isClosingTag) {
				if(tagStack.length == 0 || tagName.toLowerCase() != tagStack[tagStack.length - 1].toLowerCase()) {
					lime_utils_Log.info("Invalid HTML, unexpected closing tag ignored: " + tagName,{ fileName : "openfl/_internal/formats/html/HTMLParser.hx", lineNumber : 97, className : "openfl._internal.formats.html.HTMLParser", methodName : "parse"});
					continue;
				}
				tagStack.pop();
				formatStack.pop();
				format = formatStack[formatStack.length - 1].clone();
				if(tagName.toLowerCase() == "p" && textFormatRanges.get_length() > 0) {
					value += "\n";
					noLineBreak = true;
				}
				if(start < segment.length) {
					sub = HxOverrides.substr(segment,start,null);
					textFormatRanges.push(new openfl_text__$internal_TextFormatRange(format,value.length,value.length + sub.length));
					value += sub;
					noLineBreak = false;
				}
			} else {
				format = formatStack[formatStack.length - 1].clone();
				if(tagEndIndex > -1) {
					switch(tagName.toLowerCase()) {
					case "a":
						if(openfl__$internal_formats_html_HTMLParser.__regexHref.match(segment)) {
							format.url = openfl__$internal_formats_html_HTMLParser.__getAttributeMatch(openfl__$internal_formats_html_HTMLParser.__regexHref);
						}
						break;
					case "b":
						format.bold = true;
						break;
					case "em":case "i":
						format.italic = true;
						break;
					case "font":
						if(openfl__$internal_formats_html_HTMLParser.__regexFace.match(segment)) {
							format.font = openfl__$internal_formats_html_HTMLParser.__getAttributeMatch(openfl__$internal_formats_html_HTMLParser.__regexFace);
						}
						if(openfl__$internal_formats_html_HTMLParser.__regexColor.match(segment)) {
							format.color = Std.parseInt("0x" + openfl__$internal_formats_html_HTMLParser.__getAttributeMatch(openfl__$internal_formats_html_HTMLParser.__regexColor));
						}
						if(openfl__$internal_formats_html_HTMLParser.__regexSize.match(segment)) {
							var sizeAttr = openfl__$internal_formats_html_HTMLParser.__getAttributeMatch(openfl__$internal_formats_html_HTMLParser.__regexSize);
							var firstChar = HxOverrides.cca(sizeAttr,0);
							if(firstChar == 43 || firstChar == 45) {
								var parentFormat = formatStack.length >= 2 ? formatStack[formatStack.length - 2] : textFormat;
								format.size = parentFormat.size + Std.parseInt(sizeAttr);
							} else {
								format.size = Std.parseInt(sizeAttr);
							}
						}
						break;
					case "p":
						if(textFormatRanges.get_length() > 0 && !noLineBreak) {
							value += "\n";
						}
						if(openfl__$internal_formats_html_HTMLParser.__regexAlign.match(segment)) {
							var align = openfl__$internal_formats_html_HTMLParser.__getAttributeMatch(openfl__$internal_formats_html_HTMLParser.__regexAlign).toLowerCase();
							format.align = openfl_text_TextFormatAlign.fromString(align);
						}
						break;
					case "textformat":
						if(openfl__$internal_formats_html_HTMLParser.__regexBlockIndent.match(segment)) {
							format.blockIndent = Std.parseInt(openfl__$internal_formats_html_HTMLParser.__getAttributeMatch(openfl__$internal_formats_html_HTMLParser.__regexBlockIndent));
						}
						if(openfl__$internal_formats_html_HTMLParser.__regexIndent.match(segment)) {
							format.indent = Std.parseInt(openfl__$internal_formats_html_HTMLParser.__getAttributeMatch(openfl__$internal_formats_html_HTMLParser.__regexIndent));
						}
						if(openfl__$internal_formats_html_HTMLParser.__regexLeading.match(segment)) {
							format.leading = Std.parseInt(openfl__$internal_formats_html_HTMLParser.__getAttributeMatch(openfl__$internal_formats_html_HTMLParser.__regexLeading));
						}
						if(openfl__$internal_formats_html_HTMLParser.__regexLeftMargin.match(segment)) {
							format.leftMargin = Std.parseInt(openfl__$internal_formats_html_HTMLParser.__getAttributeMatch(openfl__$internal_formats_html_HTMLParser.__regexLeftMargin));
						}
						if(openfl__$internal_formats_html_HTMLParser.__regexRightMargin.match(segment)) {
							format.rightMargin = Std.parseInt(openfl__$internal_formats_html_HTMLParser.__getAttributeMatch(openfl__$internal_formats_html_HTMLParser.__regexRightMargin));
						}
						if(openfl__$internal_formats_html_HTMLParser.__regexTabStops.match(segment)) {
							var values = openfl__$internal_formats_html_HTMLParser.__getAttributeMatch(openfl__$internal_formats_html_HTMLParser.__regexTabStops).split(" ");
							var tabStops = [];
							var _g1 = 0;
							while(_g1 < values.length) {
								var stop = values[_g1];
								++_g1;
								tabStops.push(Std.parseInt(stop));
							}
							format.tabStops = tabStops;
						}
						break;
					case "u":
						format.underline = true;
						break;
					}
					formatStack.push(format);
					tagStack.push(tagName);
					if(start < segment.length) {
						sub = segment.substring(start);
						textFormatRanges.push(new openfl_text__$internal_TextFormatRange(format,value.length,value.length + sub.length));
						value += sub;
						noLineBreak = false;
					}
				} else {
					textFormatRanges.push(new openfl_text__$internal_TextFormatRange(format,value.length,value.length + segment.length));
					value += segment;
					noLineBreak = false;
				}
			}
		}
		if(textFormatRanges.get_length() == 0) {
			textFormatRanges.push(new openfl_text__$internal_TextFormatRange(formatStack[0],0,0));
		}
	}
	return value;
};
openfl__$internal_formats_html_HTMLParser.__getAttributeMatch = function(regex) {
	if(regex.matched(2) != null) {
		return regex.matched(2);
	} else {
		return regex.matched(3);
	}
};
var openfl__$internal_utils_TouchData = function() {
	this.rollOutStack = [];
};
$hxClasses["openfl._internal.utils.TouchData"] = openfl__$internal_utils_TouchData;
openfl__$internal_utils_TouchData.__name__ = "openfl._internal.utils.TouchData";
openfl__$internal_utils_TouchData.prototype = {
	rollOutStack: null
	,touch: null
	,touchDownTarget: null
	,touchOverTarget: null
	,reset: function() {
		this.touch = null;
		this.touchDownTarget = null;
		this.touchOverTarget = null;
		this.rollOutStack.splice(0,this.rollOutStack.length);
	}
	,__class__: openfl__$internal_utils_TouchData
};
var openfl_display_Application = function() {
	lime_app_Application.call(this);
	if(openfl__$internal_Lib.application == null) {
		openfl__$internal_Lib.application = this;
	}
	if(openfl__$internal_Lib.current == null) {
		openfl__$internal_Lib.current = new openfl_display_MovieClip();
	}
	openfl__$internal_Lib.current.__loaderInfo = openfl_display_LoaderInfo.create(null);
	openfl__$internal_Lib.current.__loaderInfo.content = openfl__$internal_Lib.current;
};
$hxClasses["openfl.display.Application"] = openfl_display_Application;
openfl_display_Application.__name__ = "openfl.display.Application";
openfl_display_Application.__super__ = lime_app_Application;
openfl_display_Application.prototype = $extend(lime_app_Application.prototype,{
	createWindow: function(attributes) {
		var $window = new openfl_display_Window(this,attributes);
		this.__windows.push($window);
		this.__windowByID.h[$window.id] = $window;
		var _g = $bind(this,this.__onWindowClose);
		var window1 = $window;
		var tmp = function() {
			_g(window1);
		};
		$window.onClose.add(tmp,false,-10000);
		if(this.__window == null) {
			this.__window = $window;
			$window.onActivate.add($bind(this,this.onWindowActivate));
			$window.onRenderContextLost.add($bind(this,this.onRenderContextLost));
			$window.onRenderContextRestored.add($bind(this,this.onRenderContextRestored));
			$window.onDeactivate.add($bind(this,this.onWindowDeactivate));
			$window.onDropFile.add($bind(this,this.onWindowDropFile));
			$window.onEnter.add($bind(this,this.onWindowEnter));
			$window.onExpose.add($bind(this,this.onWindowExpose));
			$window.onFocusIn.add($bind(this,this.onWindowFocusIn));
			$window.onFocusOut.add($bind(this,this.onWindowFocusOut));
			$window.onFullscreen.add($bind(this,this.onWindowFullscreen));
			$window.onKeyDown.add($bind(this,this.onKeyDown));
			$window.onKeyUp.add($bind(this,this.onKeyUp));
			$window.onLeave.add($bind(this,this.onWindowLeave));
			$window.onMinimize.add($bind(this,this.onWindowMinimize));
			$window.onMouseDown.add($bind(this,this.onMouseDown));
			$window.onMouseMove.add($bind(this,this.onMouseMove));
			$window.onMouseMoveRelative.add($bind(this,this.onMouseMoveRelative));
			$window.onMouseUp.add($bind(this,this.onMouseUp));
			$window.onMouseWheel.add($bind(this,this.onMouseWheel));
			$window.onMove.add($bind(this,this.onWindowMove));
			$window.onRender.add($bind(this,this.render));
			$window.onResize.add($bind(this,this.onWindowResize));
			$window.onRestore.add($bind(this,this.onWindowRestore));
			$window.onTextEdit.add($bind(this,this.onTextEdit));
			$window.onTextInput.add($bind(this,this.onTextInput));
			this.onWindowCreate();
		}
		this.onCreateWindow.dispatch($window);
		return $window;
	}
	,__class__: openfl_display_Application
});
var openfl_display_Bitmap = function(bitmapData,pixelSnapping,smoothing) {
	if(smoothing == null) {
		smoothing = false;
	}
	openfl_display_DisplayObject.call(this);
	this.__bitmapData = bitmapData;
	this.pixelSnapping = pixelSnapping;
	this.smoothing = smoothing;
	if(pixelSnapping == null) {
		this.pixelSnapping = 1;
	}
};
$hxClasses["openfl.display.Bitmap"] = openfl_display_Bitmap;
openfl_display_Bitmap.__name__ = "openfl.display.Bitmap";
openfl_display_Bitmap.__super__ = openfl_display_DisplayObject;
openfl_display_Bitmap.prototype = $extend(openfl_display_DisplayObject.prototype,{
	pixelSnapping: null
	,smoothing: null
	,__image: null
	,__bitmapData: null
	,__imageVersion: null
	,__enterFrame: function(deltaTime) {
		if(this.__bitmapData != null && this.__bitmapData.image != null && this.__bitmapData.image.version != this.__imageVersion) {
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
	}
	,__getBounds: function(rect,matrix) {
		var bounds = openfl_geom_Rectangle.__pool.get();
		if(this.__bitmapData != null) {
			bounds.setTo(0,0,this.__bitmapData.width,this.__bitmapData.height);
		} else {
			bounds.setTo(0,0,0,0);
		}
		bounds.__transform(bounds,matrix);
		rect.__expand(bounds.x,bounds.y,bounds.width,bounds.height);
		openfl_geom_Rectangle.__pool.release(bounds);
	}
	,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) {
		if(!hitObject.get_visible() || this.__isMask || this.__bitmapData == null) {
			return false;
		}
		if(this.get_mask() != null && !this.get_mask().__hitTestMask(x,y)) {
			return false;
		}
		this.__getRenderTransform();
		var _this = this.__renderTransform;
		var norm = _this.a * _this.d - _this.b * _this.c;
		var px = norm == 0 ? -_this.tx : 1.0 / norm * (_this.c * (_this.ty - y) + _this.d * (x - _this.tx));
		var _this = this.__renderTransform;
		var norm = _this.a * _this.d - _this.b * _this.c;
		var py = norm == 0 ? -_this.ty : 1.0 / norm * (_this.a * (y - _this.ty) + _this.b * (_this.tx - x));
		if(px > 0 && py > 0 && px <= this.__bitmapData.width && py <= this.__bitmapData.height) {
			if(this.__scrollRect != null && !this.__scrollRect.contains(px,py)) {
				return false;
			}
			if(stack != null && !interactiveOnly) {
				stack.push(hitObject);
			}
			return true;
		}
		return false;
	}
	,__hitTestMask: function(x,y) {
		if(this.__bitmapData == null) {
			return false;
		}
		this.__getRenderTransform();
		var _this = this.__renderTransform;
		var norm = _this.a * _this.d - _this.b * _this.c;
		var px = norm == 0 ? -_this.tx : 1.0 / norm * (_this.c * (_this.ty - y) + _this.d * (x - _this.tx));
		var _this = this.__renderTransform;
		var norm = _this.a * _this.d - _this.b * _this.c;
		var py = norm == 0 ? -_this.ty : 1.0 / norm * (_this.a * (y - _this.ty) + _this.b * (_this.tx - x));
		if(px > 0 && py > 0 && px <= this.__bitmapData.width && py <= this.__bitmapData.height) {
			return true;
		}
		return false;
	}
	,__renderCairo: function(renderer) {
	}
	,__renderCairoMask: function(renderer) {
		renderer.cairo.rectangle(0,0,this.get_width(),this.get_height());
	}
	,__renderCanvas: function(renderer) {
		this.__updateCacheBitmap(renderer,false);
		if(this.__bitmapData != null && this.__bitmapData.image != null) {
			this.__imageVersion = this.__bitmapData.image.version;
		}
		if(this.__cacheBitmap != null && !this.__isCacheBitmapRender) {
			var bitmap = this.__cacheBitmap;
			if(bitmap.__renderable) {
				var alpha = renderer.__getAlpha(bitmap.__worldAlpha);
				if(alpha > 0 && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) {
					var context = renderer.context;
					renderer.__setBlendMode(bitmap.__worldBlendMode);
					renderer.__pushMaskObject(bitmap,false);
					lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(bitmap.__bitmapData.image);
					context.globalAlpha = alpha;
					var scrollRect = bitmap.__scrollRect;
					renderer.setTransform(bitmap.__renderTransform,context);
					if(!renderer.__allowSmoothing || !bitmap.smoothing) {
						context.imageSmoothingEnabled = false;
					}
					if(scrollRect == null) {
						context.drawImage(bitmap.__bitmapData.image.get_src(),0,0,bitmap.__bitmapData.image.width,bitmap.__bitmapData.image.height);
					} else {
						context.drawImage(bitmap.__bitmapData.image.get_src(),scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height);
					}
					if(!renderer.__allowSmoothing || !bitmap.smoothing) {
						context.imageSmoothingEnabled = true;
					}
					renderer.__popMaskObject(bitmap,false);
				}
			}
		} else {
			if(!(this.opaqueBackground == null && this.__graphics == null)) {
				if(this.__renderable) {
					var alpha = renderer.__getAlpha(this.__worldAlpha);
					if(!(alpha <= 0)) {
						if(this.opaqueBackground != null && !this.__isCacheBitmapRender && this.get_width() > 0 && this.get_height() > 0) {
							renderer.__setBlendMode(this.__worldBlendMode);
							renderer.__pushMaskObject(this);
							var context = renderer.context;
							renderer.setTransform(this.__renderTransform,context);
							var color = this.opaqueBackground;
							context.fillStyle = "rgb(" + (color >>> 16 & 255) + "," + (color >>> 8 & 255) + "," + (color & 255) + ")";
							context.fillRect(0,0,this.get_width(),this.get_height());
							renderer.__popMaskObject(this);
						}
						if(this.__graphics != null) {
							if(this.__renderable) {
								var alpha = renderer.__getAlpha(this.__worldAlpha);
								if(!(alpha <= 0)) {
									var graphics = this.__graphics;
									if(graphics != null) {
										openfl_display__$internal_CanvasGraphics.render(graphics,renderer);
										var width = graphics.__width;
										var height = graphics.__height;
										var canvas = graphics.__canvas;
										if(canvas != null && graphics.__visible && width >= 1 && height >= 1) {
											var transform = graphics.__worldTransform;
											var context = renderer.context;
											var scrollRect = this.__scrollRect;
											var scale9Grid = this.__worldScale9Grid;
											if(scrollRect == null || scrollRect.width > 0 && scrollRect.height > 0) {
												renderer.__setBlendMode(this.__worldBlendMode);
												renderer.__pushMaskObject(this);
												context.globalAlpha = alpha;
												if(scale9Grid != null && transform.b == 0 && transform.c == 0) {
													context.setTransform(1,0,0,1,transform.tx,transform.ty);
													var bounds = graphics.__bounds;
													var scaleX = graphics.__renderTransform.a;
													var scaleY = graphics.__renderTransform.d;
													var renderScaleX = transform.a;
													var renderScaleY = transform.d;
													var left = Math.max(1,Math.round(scale9Grid.x * scaleX));
													var top = Math.round(scale9Grid.y * scaleY);
													var right = Math.max(1,Math.round((bounds.get_right() - scale9Grid.get_right()) * scaleX));
													var bottom = Math.round((bounds.get_bottom() - scale9Grid.get_bottom()) * scaleY);
													var centerWidth = Math.round(scale9Grid.width * scaleX);
													var centerHeight = Math.round(scale9Grid.height * scaleY);
													var renderLeft = Math.round(scale9Grid.x * renderScaleX);
													var renderTop = Math.round(scale9Grid.y * renderScaleY);
													var renderRight = Math.round((bounds.get_right() - scale9Grid.get_right()) * renderScaleX);
													var renderBottom = Math.round((bounds.get_bottom() - scale9Grid.get_bottom()) * renderScaleY);
													var renderCenterWidth = Math.round(width * renderScaleX) - renderLeft - renderRight;
													var renderCenterHeight = Math.round(height * renderScaleY) - renderTop - renderBottom;
													renderer.applySmoothing(context,false);
													if(centerWidth != 0 && centerHeight != 0) {
														context.drawImage(canvas,0,0,left,top,0,0,renderLeft,renderTop);
														context.drawImage(canvas,left,0,centerWidth,top,renderLeft,0,renderCenterWidth,renderTop);
														context.drawImage(canvas,left + centerWidth,0,right,top,renderLeft + renderCenterWidth,0,renderRight,renderTop);
														context.drawImage(canvas,0,top,left,centerHeight,0,renderTop,renderLeft,renderCenterHeight);
														context.drawImage(canvas,left,top,centerWidth,centerHeight,renderLeft,renderTop,renderCenterWidth,renderCenterHeight);
														context.drawImage(canvas,left + centerWidth,top,right,centerHeight,renderLeft + renderCenterWidth,renderTop,renderRight,renderCenterHeight);
														context.drawImage(canvas,0,top + centerHeight,left,bottom,0,renderTop + renderCenterHeight,renderLeft,renderBottom);
														context.drawImage(canvas,left,top + centerHeight,centerWidth,bottom,renderLeft,renderTop + renderCenterHeight,renderCenterWidth,renderBottom);
														context.drawImage(canvas,left + centerWidth,top + centerHeight,right,bottom,renderLeft + renderCenterWidth,renderTop + renderCenterHeight,renderRight,renderBottom);
													} else if(centerWidth == 0 && centerHeight != 0) {
														var renderWidth = renderLeft + renderCenterWidth + renderRight;
														context.drawImage(canvas,0,0,width,top,0,0,renderWidth,renderTop);
														context.drawImage(canvas,0,top,width,centerHeight,0,renderTop,renderWidth,renderCenterHeight);
														context.drawImage(canvas,0,top + centerHeight,width,bottom,0,renderTop + renderCenterHeight,renderWidth,renderBottom);
													} else if(centerHeight == 0 && centerWidth != 0) {
														var renderHeight = renderTop + renderCenterHeight + renderBottom;
														context.drawImage(canvas,0,0,left,height,0,0,renderLeft,renderHeight);
														context.drawImage(canvas,left,0,centerWidth,height,renderLeft,0,renderCenterWidth,renderHeight);
														context.drawImage(canvas,left + centerWidth,0,right,height,renderLeft + renderCenterWidth,0,renderRight,renderHeight);
													}
												} else {
													renderer.setTransform(transform,context);
													if(renderer.__isDOM) {
														var reverseScale = 1 / renderer.pixelRatio;
														context.scale(reverseScale,reverseScale);
													}
													context.drawImage(canvas,0,0,width,height);
												}
												renderer.__popMaskObject(this);
											}
										}
									}
								}
							}
						}
					}
				}
			}
			if(this.__renderable) {
				var alpha = renderer.__getAlpha(this.__worldAlpha);
				if(alpha > 0 && this.__bitmapData != null && this.__bitmapData.__isValid && this.__bitmapData.readable) {
					var context = renderer.context;
					renderer.__setBlendMode(this.__worldBlendMode);
					renderer.__pushMaskObject(this,false);
					lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(this.__bitmapData.image);
					context.globalAlpha = alpha;
					var scrollRect = this.__scrollRect;
					renderer.setTransform(this.__renderTransform,context);
					if(!renderer.__allowSmoothing || !this.smoothing) {
						context.imageSmoothingEnabled = false;
					}
					if(scrollRect == null) {
						context.drawImage(this.__bitmapData.image.get_src(),0,0,this.__bitmapData.image.width,this.__bitmapData.image.height);
					} else {
						context.drawImage(this.__bitmapData.image.get_src(),scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height);
					}
					if(!renderer.__allowSmoothing || !this.smoothing) {
						context.imageSmoothingEnabled = true;
					}
					renderer.__popMaskObject(this,false);
				}
			}
		}
		this.__renderEvent(renderer);
	}
	,__renderCanvasMask: function(renderer) {
		renderer.context.rect(0,0,this.get_width(),this.get_height());
	}
	,__renderDOM: function(renderer) {
		this.__updateCacheBitmap(renderer,false);
		if(this.__cacheBitmap != null && !this.__isCacheBitmapRender) {
			this.__renderDOMClear(renderer);
			this.__cacheBitmap.stage = this.stage;
			var bitmap = this.__cacheBitmap;
			if(bitmap.stage != null && bitmap.__worldVisible && bitmap.__renderable && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) {
				renderer.__pushMaskObject(bitmap);
				if(bitmap.__bitmapData.image.buffer.__srcImage != null) {
					openfl_display__$internal_DOMBitmap.renderImage(bitmap,renderer);
				} else {
					openfl_display__$internal_DOMBitmap.renderCanvas(bitmap,renderer);
				}
				renderer.__popMaskObject(bitmap);
			} else {
				openfl_display__$internal_DOMBitmap.clear(bitmap,renderer);
			}
		} else {
			var tmp = this.opaqueBackground != null && !this.__isCacheBitmapRender && this.get_width() > 0 && this.get_height() > 0;
			var graphics = this.__graphics;
			if(this.stage != null && this.__worldVisible && this.__renderable && graphics != null) {
				openfl_display__$internal_CanvasGraphics.render(graphics,renderer.__canvasRenderer);
				if(graphics.__softwareDirty || this.__worldAlphaChanged || this.__canvas != graphics.__canvas) {
					if(graphics.__canvas != null) {
						if(this.__canvas != graphics.__canvas) {
							if(this.__canvas != null) {
								renderer.element.removeChild(this.__canvas);
							}
							this.__canvas = graphics.__canvas;
							this.__context = graphics.__context;
							renderer.__initializeElement(this,this.__canvas);
						}
					} else {
						openfl_display__$internal_DOMShape.clear(this,renderer);
					}
				}
				if(this.__canvas != null) {
					renderer.__pushMaskObject(this);
					var cacheTransform = this.__renderTransform;
					this.__renderTransform = graphics.__worldTransform;
					if(graphics.__transformDirty) {
						graphics.__transformDirty = false;
						this.__renderTransformChanged = true;
					}
					renderer.__updateClip(this);
					renderer.__applyStyle(this,true,true,true);
					this.__renderTransform = cacheTransform;
					renderer.__popMaskObject(this);
				}
			} else {
				openfl_display__$internal_DOMShape.clear(this,renderer);
			}
			if(this.stage != null && this.__worldVisible && this.__renderable && this.__bitmapData != null && this.__bitmapData.__isValid && this.__bitmapData.readable) {
				renderer.__pushMaskObject(this);
				if(this.__bitmapData.image.buffer.__srcImage != null) {
					openfl_display__$internal_DOMBitmap.renderImage(this,renderer);
				} else {
					openfl_display__$internal_DOMBitmap.renderCanvas(this,renderer);
				}
				renderer.__popMaskObject(this);
			} else {
				openfl_display__$internal_DOMBitmap.clear(this,renderer);
			}
		}
		this.__renderEvent(renderer);
	}
	,__renderDOMClear: function(renderer) {
		openfl_display__$internal_DOMBitmap.clear(this,renderer);
	}
	,__renderGL: function(renderer) {
		this.__updateCacheBitmap(renderer,false);
		if(this.__bitmapData != null && this.__bitmapData.image != null) {
			this.__imageVersion = this.__bitmapData.image.version;
		}
		if(this.__cacheBitmap != null && !this.__isCacheBitmapRender) {
			openfl_display__$internal_Context3DBitmap.render(this.__cacheBitmap,renderer);
		} else {
			if(!(this.opaqueBackground == null && this.__graphics == null)) {
				if(!(!this.__renderable || this.__worldAlpha <= 0)) {
					if(this.opaqueBackground != null && !this.__isCacheBitmapRender && this.get_width() > 0 && this.get_height() > 0) {
						renderer.__setBlendMode(this.__worldBlendMode);
						renderer.__pushMaskObject(this);
						var context = renderer.__context3D;
						var rect = openfl_geom_Rectangle.__pool.get();
						rect.setTo(0,0,this.get_width(),this.get_height());
						renderer.__pushMaskRect(rect,this.__renderTransform);
						var color = this.opaqueBackground;
						context.clear((color >>> 16 & 255) / 255,(color >>> 8 & 255) / 255,(color & 255) / 255,1,0,0,1);
						renderer.__popMaskRect();
						renderer.__popMaskObject(this);
						openfl_geom_Rectangle.__pool.release(rect);
					}
					if(this.__graphics != null) {
						openfl_display__$internal_Context3DShape.render(this,renderer);
					}
				}
			}
			openfl_display__$internal_Context3DBitmap.render(this,renderer);
		}
		this.__renderEvent(renderer);
	}
	,__renderGLMask: function(renderer) {
		openfl_display__$internal_Context3DBitmap.renderMask(this,renderer);
	}
	,__updateCacheBitmap: function(renderer,force) {
		if(this.__bitmapData == null || this.__filters == null && renderer.__type == "opengl" && this.__cacheBitmap == null) {
			return false;
		}
		return openfl_display_DisplayObject.prototype.__updateCacheBitmap.call(this,renderer,this.__bitmapData.image != null && this.__bitmapData.image.version != this.__imageVersion);
	}
	,get_bitmapData: function() {
		return this.__bitmapData;
	}
	,set_bitmapData: function(value) {
		this.__bitmapData = value;
		this.smoothing = false;
		if(!this.__renderDirty) {
			this.__renderDirty = true;
			this.__setParentRenderDirty();
		}
		var tmp = this.__filters != null;
		this.__imageVersion = -1;
		return this.__bitmapData;
	}
	,set_height: function(value) {
		if(this.__bitmapData != null) {
			this.set_scaleY(value / this.__bitmapData.height);
		} else {
			this.set_scaleY(0);
		}
		return value;
	}
	,set_width: function(value) {
		if(this.__bitmapData != null) {
			this.set_scaleX(value / this.__bitmapData.width);
		} else {
			this.set_scaleX(0);
		}
		return value;
	}
	,__class__: openfl_display_Bitmap
	,__properties__: $extend(openfl_display_DisplayObject.prototype.__properties__,{set_bitmapData:"set_bitmapData",get_bitmapData:"get_bitmapData"})
});
var openfl_display_BlendMode = {};
openfl_display_BlendMode.fromString = function(value) {
	switch(value) {
	case "add":
		return 0;
	case "alpha":
		return 1;
	case "darken":
		return 2;
	case "difference":
		return 3;
	case "erase":
		return 4;
	case "hardlight":
		return 5;
	case "invert":
		return 6;
	case "layer":
		return 7;
	case "lighten":
		return 8;
	case "multiply":
		return 9;
	case "normal":
		return 10;
	case "overlay":
		return 11;
	case "screen":
		return 12;
	case "shader":
		return 13;
	case "subtract":
		return 14;
	default:
		return null;
	}
};
openfl_display_BlendMode.toString = function(this1) {
	switch(this1) {
	case 0:
		return "add";
	case 1:
		return "alpha";
	case 2:
		return "darken";
	case 3:
		return "difference";
	case 4:
		return "erase";
	case 5:
		return "hardlight";
	case 6:
		return "invert";
	case 7:
		return "layer";
	case 8:
		return "lighten";
	case 9:
		return "multiply";
	case 10:
		return "normal";
	case 11:
		return "overlay";
	case 12:
		return "screen";
	case 13:
		return "shader";
	case 14:
		return "subtract";
	default:
		return null;
	}
};
var openfl_display_DisplayObjectRenderer = function() {
	openfl_events_EventDispatcher.call(this);
	this.__allowSmoothing = true;
	this.__tempColorTransform = new openfl_geom_ColorTransform();
	this.__worldAlpha = 1;
};
$hxClasses["openfl.display.DisplayObjectRenderer"] = openfl_display_DisplayObjectRenderer;
openfl_display_DisplayObjectRenderer.__name__ = "openfl.display.DisplayObjectRenderer";
openfl_display_DisplayObjectRenderer.__super__ = openfl_events_EventDispatcher;
openfl_display_DisplayObjectRenderer.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	__allowSmoothing: null
	,__blendMode: null
	,__cleared: null
	,__context: null
	,__overrideBlendMode: null
	,__roundPixels: null
	,__stage: null
	,__tempColorTransform: null
	,__transparent: null
	,__type: null
	,__worldAlpha: null
	,__worldColorTransform: null
	,__worldTransform: null
	,__clear: function() {
	}
	,__getAlpha: function(value) {
		return value * this.__worldAlpha;
	}
	,__getColorTransform: function(value) {
		if(this.__worldColorTransform != null) {
			this.__tempColorTransform.__copyFrom(this.__worldColorTransform);
			this.__tempColorTransform.__combine(value);
			return this.__tempColorTransform;
		} else {
			return value;
		}
	}
	,__popMask: function() {
	}
	,__popMaskObject: function(object,handleScrollRect) {
		if(handleScrollRect == null) {
			handleScrollRect = true;
		}
	}
	,__popMaskRect: function() {
	}
	,__pushMask: function(mask) {
	}
	,__pushMaskObject: function(object,handleScrollRect) {
		if(handleScrollRect == null) {
			handleScrollRect = true;
		}
	}
	,__pushMaskRect: function(rect,transform) {
	}
	,__render: function(object) {
	}
	,__resize: function(width,height) {
	}
	,__setBlendMode: function(value) {
	}
	,__class__: openfl_display_DisplayObjectRenderer
});
var openfl_display_CairoRenderer = function(cairo) {
	openfl_display_DisplayObjectRenderer.call(this);
};
$hxClasses["openfl.display.CairoRenderer"] = openfl_display_CairoRenderer;
openfl_display_CairoRenderer.__name__ = "openfl.display.CairoRenderer";
openfl_display_CairoRenderer.__super__ = openfl_display_DisplayObjectRenderer;
openfl_display_CairoRenderer.prototype = $extend(openfl_display_DisplayObjectRenderer.prototype,{
	cairo: null
	,__matrix: null
	,__matrix3: null
	,applyMatrix: function(transform,cairo) {
		if(cairo == null) {
			cairo = this.cairo;
		}
		this.__matrix.copyFrom(transform);
		if(this.cairo == cairo && this.__worldTransform != null) {
			this.__matrix.concat(this.__worldTransform);
		}
		this.__matrix3.a = this.__matrix.a;
		this.__matrix3.b = this.__matrix.b;
		this.__matrix3.c = this.__matrix.c;
		this.__matrix3.d = this.__matrix.d;
		if(this.__roundPixels) {
			this.__matrix3.tx = Math.round(this.__matrix.tx);
			this.__matrix3.ty = Math.round(this.__matrix.ty);
		} else {
			this.__matrix3.tx = this.__matrix.tx;
			this.__matrix3.ty = this.__matrix.ty;
		}
		cairo.set_matrix(this.__matrix3);
	}
	,__clear: function() {
		if(this.cairo == null) {
			return;
		}
		this.cairo.identityMatrix();
		if(this.__stage != null && this.__stage.__clearBeforeRender) {
			var cacheBlendMode = this.__blendMode;
			this.__setBlendMode(10);
			this.cairo.setSourceRGB(this.__stage.__colorSplit[0],this.__stage.__colorSplit[1],this.__stage.__colorSplit[2]);
			this.cairo.paint();
			this.__setBlendMode(cacheBlendMode);
		}
	}
	,__popMask: function() {
		this.cairo.restore();
	}
	,__popMaskObject: function(object,handleScrollRect) {
		if(handleScrollRect == null) {
			handleScrollRect = true;
		}
		if(!object.__isCacheBitmapRender && object.__mask != null) {
			this.__popMask();
		}
		if(handleScrollRect && object.__scrollRect != null) {
			this.__popMaskRect();
		}
	}
	,__popMaskRect: function() {
		this.cairo.restore();
	}
	,__pushMask: function(mask) {
		this.cairo.save();
		this.applyMatrix(mask.__renderTransform,this.cairo);
		this.cairo.newPath();
		mask.__renderCairoMask(this);
		this.cairo.clip();
	}
	,__pushMaskObject: function(object,handleScrollRect) {
		if(handleScrollRect == null) {
			handleScrollRect = true;
		}
		if(handleScrollRect && object.__scrollRect != null) {
			this.__pushMaskRect(object.__scrollRect,object.__renderTransform);
		}
		if(!object.__isCacheBitmapRender && object.__mask != null) {
			this.__pushMask(object.__mask);
		}
	}
	,__pushMaskRect: function(rect,transform) {
		this.cairo.save();
		this.applyMatrix(transform,this.cairo);
		this.cairo.newPath();
		this.cairo.rectangle(rect.x,rect.y,rect.width,rect.height);
		this.cairo.clip();
	}
	,__render: function(object) {
		if(this.cairo == null) {
			return;
		}
		object.__renderCairo(this);
	}
	,__setBlendMode: function(value) {
		if(this.__overrideBlendMode != null) {
			value = this.__overrideBlendMode;
		}
		if(this.__blendMode == value) {
			return;
		}
		this.__blendMode = value;
		this.__setBlendModeCairo(this.cairo,value);
	}
	,__setBlendModeCairo: function(cairo,value) {
		switch(value) {
		case 0:
			cairo.setOperator(12);
			break;
		case 2:
			cairo.setOperator(17);
			break;
		case 3:
			cairo.setOperator(23);
			break;
		case 5:
			cairo.setOperator(21);
			break;
		case 7:
			cairo.setOperator(2);
			break;
		case 8:
			cairo.setOperator(18);
			break;
		case 9:
			cairo.setOperator(14);
			break;
		case 11:
			cairo.setOperator(16);
			break;
		case 12:
			cairo.setOperator(15);
			break;
		default:
			cairo.setOperator(2);
		}
	}
	,__class__: openfl_display_CairoRenderer
});
var openfl_display_CanvasRenderer = function(context) {
	this.pixelRatio = 1;
	openfl_display_DisplayObjectRenderer.call(this);
	this.context = context;
	this.__tempMatrix = new openfl_geom_Matrix();
	this.__type = "canvas";
};
$hxClasses["openfl.display.CanvasRenderer"] = openfl_display_CanvasRenderer;
openfl_display_CanvasRenderer.__name__ = "openfl.display.CanvasRenderer";
openfl_display_CanvasRenderer.__super__ = openfl_display_DisplayObjectRenderer;
openfl_display_CanvasRenderer.prototype = $extend(openfl_display_DisplayObjectRenderer.prototype,{
	context: null
	,pixelRatio: null
	,__isDOM: null
	,__tempMatrix: null
	,applySmoothing: function(context,value) {
		context.imageSmoothingEnabled = value;
	}
	,setTransform: function(transform,context) {
		if(context == null) {
			context = this.context;
		} else if(this.context == context && this.__worldTransform != null) {
			this.__tempMatrix.copyFrom(transform);
			this.__tempMatrix.concat(this.__worldTransform);
			transform = this.__tempMatrix;
		}
		if(this.__roundPixels) {
			context.setTransform(transform.a,transform.b,transform.c,transform.d,transform.tx | 0,transform.ty | 0);
		} else {
			context.setTransform(transform.a,transform.b,transform.c,transform.d,transform.tx,transform.ty);
		}
	}
	,__clear: function() {
		if(this.__stage != null) {
			var cacheBlendMode = this.__blendMode;
			this.__blendMode = null;
			this.__setBlendMode(10);
			this.context.setTransform(1,0,0,1,0,0);
			this.context.globalAlpha = 1;
			if(!this.__stage.__transparent && this.__stage.__clearBeforeRender) {
				this.context.fillStyle = this.__stage.__colorString;
				this.context.fillRect(0,0,this.__stage.stageWidth * this.__stage.window.__scale,this.__stage.stageHeight * this.__stage.window.__scale);
			} else if(this.__stage.__transparent && this.__stage.__clearBeforeRender) {
				this.context.clearRect(0,0,this.__stage.stageWidth * this.__stage.window.__scale,this.__stage.stageHeight * this.__stage.window.__scale);
			}
			this.__setBlendMode(cacheBlendMode);
		}
	}
	,__popMask: function() {
		this.context.restore();
	}
	,__popMaskObject: function(object,handleScrollRect) {
		if(handleScrollRect == null) {
			handleScrollRect = true;
		}
		if(!object.__isCacheBitmapRender && object.__mask != null) {
			this.__popMask();
		}
		if(handleScrollRect && object.__scrollRect != null) {
			this.__popMaskRect();
		}
	}
	,__popMaskRect: function() {
		this.context.restore();
	}
	,__pushMask: function(mask) {
		this.context.save();
		this.setTransform(mask.__renderTransform,this.context);
		this.context.beginPath();
		mask.__renderCanvasMask(this);
		this.context.closePath();
		this.context.clip();
	}
	,__pushMaskObject: function(object,handleScrollRect) {
		if(handleScrollRect == null) {
			handleScrollRect = true;
		}
		if(handleScrollRect && object.__scrollRect != null) {
			this.__pushMaskRect(object.__scrollRect,object.__renderTransform);
		}
		if(!object.__isCacheBitmapRender && object.__mask != null) {
			this.__pushMask(object.__mask);
		}
	}
	,__pushMaskRect: function(rect,transform) {
		this.context.save();
		this.setTransform(transform,this.context);
		this.context.beginPath();
		this.context.rect(rect.x,rect.y,rect.width,rect.height);
		this.context.clip();
	}
	,__render: function(object) {
		object.__renderCanvas(this);
	}
	,__setBlendMode: function(value) {
		if(this.__overrideBlendMode != null) {
			value = this.__overrideBlendMode;
		}
		if(this.__blendMode == value) {
			return;
		}
		this.__blendMode = value;
		this.__setBlendModeContext(this.context,value);
	}
	,__setBlendModeContext: function(context,value) {
		switch(value) {
		case 0:
			context.globalCompositeOperation = "lighter";
			break;
		case 2:
			context.globalCompositeOperation = "darken";
			break;
		case 3:
			context.globalCompositeOperation = "difference";
			break;
		case 5:
			context.globalCompositeOperation = "hard-light";
			break;
		case 8:
			context.globalCompositeOperation = "lighten";
			break;
		case 9:
			context.globalCompositeOperation = "multiply";
			break;
		case 11:
			context.globalCompositeOperation = "overlay";
			break;
		case 12:
			context.globalCompositeOperation = "screen";
			break;
		default:
			context.globalCompositeOperation = "source-over";
		}
	}
	,__class__: openfl_display_CanvasRenderer
});
var openfl_display_CapsStyle = {};
openfl_display_CapsStyle.fromInt = function(value) {
	return value;
};
openfl_display_CapsStyle.fromString = function(value) {
	switch(value) {
	case "none":
		return 0;
	case "round":
		return 1;
	case "square":
		return 2;
	default:
		return null;
	}
};
openfl_display_CapsStyle.toInt = function(this1) {
	return this1;
};
openfl_display_CapsStyle.toString = function(this1) {
	switch(this1) {
	case 0:
		return "none";
	case 1:
		return "round";
	case 2:
		return "square";
	default:
		return null;
	}
};
var openfl_display_DOMRenderer = function(element) {
	this.pixelRatio = 1;
	openfl_display_DisplayObjectRenderer.call(this);
	this.element = element;
	openfl_display_DisplayObject.__supportDOM = true;
	var prefix = (function () {
		  var styles = window.getComputedStyle(document.documentElement, ''),
			pre = (Array.prototype.slice
			  .call(styles)
			  .join('')
			  .match(/-(moz|webkit|ms)-/) || (styles.OLink === '' && ['', 'o'])
			)[1],
			dom = ('WebKit|Moz|MS|O').match(new RegExp('(' + pre + ')', 'i'))[1];
		  return {
			dom: dom,
			lowercase: pre,
			css: '-' + pre + '-',
			js: pre[0].toUpperCase() + pre.substr(1)
		  };
		})();
	this.__vendorPrefix = prefix.lowercase;
	this.__transformProperty = prefix.lowercase == "webkit" ? "-webkit-transform" : "transform";
	this.__transformOriginProperty = prefix.lowercase == "webkit" ? "-webkit-transform-origin" : "transform-origin";
	this.__clipRects = [];
	this.__numClipRects = 0;
	this.__z = 0;
	this.__type = "dom";
	this.__canvasRenderer = new openfl_display_CanvasRenderer(null);
	this.__canvasRenderer.__isDOM = true;
};
$hxClasses["openfl.display.DOMRenderer"] = openfl_display_DOMRenderer;
openfl_display_DOMRenderer.__name__ = "openfl.display.DOMRenderer";
openfl_display_DOMRenderer.__super__ = openfl_display_DisplayObjectRenderer;
openfl_display_DOMRenderer.prototype = $extend(openfl_display_DisplayObjectRenderer.prototype,{
	element: null
	,pixelRatio: null
	,__canvasRenderer: null
	,__clipRects: null
	,__currentClipRect: null
	,__numClipRects: null
	,__transformOriginProperty: null
	,__transformProperty: null
	,__vendorPrefix: null
	,__z: null
	,applyStyle: function(parent,childElement) {
		if(parent != null && childElement != null) {
			if(parent.__style == null || childElement.parentElement != this.element) {
				this.__initializeElement(parent,childElement);
			}
			parent.__style = childElement.style;
			this.__updateClip(parent);
			this.__applyStyle(parent,true,true,true);
		}
	}
	,clearStyle: function(childElement) {
		if(childElement != null && childElement.parentElement == this.element) {
			this.element.removeChild(childElement);
		}
	}
	,__applyStyle: function(displayObject,setTransform,setAlpha,setClip) {
		var style = displayObject.__style;
		if(setTransform && displayObject.__renderTransformChanged) {
			var _this = displayObject.__renderTransform;
			var roundPixels = this.__roundPixels;
			if(roundPixels == null) {
				roundPixels = false;
			}
			style.setProperty(this.__transformProperty,roundPixels ? "matrix3d(" + _this.a + ", " + _this.b + ", 0, 0, " + _this.c + ", " + _this.d + ", 0, 0, 0, 0, 1, 0, " + (_this.tx | 0) + ", " + (_this.ty | 0) + ", 0, 1)" : "matrix3d(" + _this.a + ", " + _this.b + ", 0, 0, " + _this.c + ", " + _this.d + ", 0, 0, 0, 0, 1, 0, " + _this.tx + ", " + _this.ty + ", 0, 1)",null);
		}
		if(displayObject.__worldZ != ++this.__z) {
			displayObject.__worldZ = this.__z;
			style.setProperty("z-index",displayObject.__worldZ == null ? "null" : "" + displayObject.__worldZ,null);
		}
		if(setAlpha && displayObject.__worldAlphaChanged) {
			if(displayObject.__worldAlpha < 1) {
				style.setProperty("opacity",displayObject.__worldAlpha == null ? "null" : "" + displayObject.__worldAlpha,null);
			} else {
				style.removeProperty("opacity");
			}
		}
		if(setClip && displayObject.__worldClipChanged) {
			if(displayObject.__worldClip == null) {
				style.removeProperty("clip");
			} else {
				var clip = displayObject.__worldClip;
				style.setProperty("clip","rect(" + clip.y + "px, " + clip.get_right() + "px, " + clip.get_bottom() + "px, " + clip.x + "px)",null);
			}
		}
	}
	,__initializeElement: function(displayObject,element) {
		var style = displayObject.__style = element.style;
		style.setProperty("position","absolute",null);
		style.setProperty("top","0",null);
		style.setProperty("left","0",null);
		style.setProperty(this.__transformOriginProperty,"0 0 0",null);
		this.element.appendChild(element);
		displayObject.__worldAlphaChanged = true;
		displayObject.__renderTransformChanged = true;
		displayObject.__worldVisibleChanged = true;
		displayObject.__worldClipChanged = true;
		displayObject.__worldClip = null;
		displayObject.__worldZ = -1;
	}
	,__popMask: function() {
		this.__popMaskRect();
	}
	,__popMaskObject: function(object,handleScrollRect) {
		if(handleScrollRect == null) {
			handleScrollRect = true;
		}
		if(object.__mask != null) {
			this.__popMask();
		}
		if(handleScrollRect && object.__scrollRect != null) {
			this.__popMaskRect();
		}
	}
	,__popMaskRect: function() {
		if(this.__numClipRects > 0) {
			this.__numClipRects--;
			if(this.__numClipRects > 0) {
				this.__currentClipRect = this.__clipRects[this.__numClipRects - 1];
			} else {
				this.__currentClipRect = null;
			}
		}
	}
	,__pushMask: function(mask) {
		this.__pushMaskRect(mask.getBounds(mask),mask.__renderTransform);
	}
	,__pushMaskObject: function(object,handleScrollRect) {
		if(handleScrollRect == null) {
			handleScrollRect = true;
		}
		if(handleScrollRect && object.__scrollRect != null) {
			this.__pushMaskRect(object.__scrollRect,object.__renderTransform);
		}
		if(object.__mask != null) {
			this.__pushMask(object.__mask);
		}
	}
	,__pushMaskRect: function(rect,transform) {
		if(this.__numClipRects == this.__clipRects.length) {
			this.__clipRects[this.__numClipRects] = new openfl_geom_Rectangle();
		}
		var clipRect = this.__clipRects[this.__numClipRects];
		rect.__transform(clipRect,transform);
		if(this.__numClipRects > 0) {
			var parentClipRect = this.__clipRects[this.__numClipRects - 1];
			clipRect.__contract(parentClipRect.x,parentClipRect.y,parentClipRect.width,parentClipRect.height);
		}
		if(clipRect.height < 0) {
			clipRect.height = 0;
		}
		if(clipRect.width < 0) {
			clipRect.width = 0;
		}
		this.__currentClipRect = clipRect;
		this.__numClipRects++;
	}
	,__render: function(object) {
		if(!this.__stage.__transparent) {
			this.element.style.background = this.__stage.__colorString;
		} else {
			this.element.style.background = "none";
		}
		this.__z = 1;
		object.__renderDOM(this);
	}
	,__setBlendMode: function(value) {
		if(this.__overrideBlendMode != null) {
			value = this.__overrideBlendMode;
		}
		if(this.__blendMode == value) {
			return;
		}
		this.__blendMode = value;
	}
	,__updateClip: function(displayObject) {
		if(this.__currentClipRect == null) {
			displayObject.__worldClipChanged = displayObject.__worldClip != null;
			displayObject.__worldClip = null;
		} else {
			if(displayObject.__worldClip == null) {
				displayObject.__worldClip = new openfl_geom_Rectangle();
			}
			var clip = openfl_geom_Rectangle.__pool.get();
			var matrix = openfl_geom_Matrix.__pool.get();
			matrix.copyFrom(displayObject.__renderTransform);
			matrix.invert();
			this.__currentClipRect.__transform(clip,matrix);
			if(clip.equals(displayObject.__worldClip)) {
				displayObject.__worldClipChanged = false;
			} else {
				displayObject.__worldClip.copyFrom(clip);
				displayObject.__worldClipChanged = true;
			}
			openfl_geom_Rectangle.__pool.release(clip);
			openfl_geom_Matrix.__pool.release(matrix);
		}
	}
	,__class__: openfl_display_DOMRenderer
});
var openfl_display_DisplayObjectShader = function(code) {
	if(this.__glFragmentSource == null) {
		this.__glFragmentSource = "varying float openfl_Alphav;\n\t\tvarying vec4 openfl_ColorMultiplierv;\n\t\tvarying vec4 openfl_ColorOffsetv;\n\t\tvarying vec2 openfl_TextureCoordv;\n\n\t\tuniform bool openfl_HasColorTransform;\n\t\tuniform sampler2D openfl_Texture;\n\t\tuniform vec2 openfl_TextureSize;\n\n\t\tvoid main(void) {\n\n\t\t\tvec4 color = texture2D (openfl_Texture, openfl_TextureCoordv);\n\n\t\tif (color.a == 0.0) {\n\n\t\t\tgl_FragColor = vec4 (0.0, 0.0, 0.0, 0.0);\n\n\t\t} else if (openfl_HasColorTransform) {\n\n\t\t\tcolor = vec4 (color.rgb / color.a, color.a);\n\n\t\t\tmat4 colorMultiplier = mat4 (0);\n\t\t\tcolorMultiplier[0][0] = openfl_ColorMultiplierv.x;\n\t\t\tcolorMultiplier[1][1] = openfl_ColorMultiplierv.y;\n\t\t\tcolorMultiplier[2][2] = openfl_ColorMultiplierv.z;\n\t\t\tcolorMultiplier[3][3] = 1.0; // openfl_ColorMultiplierv.w;\n\n\t\t\tcolor = clamp (openfl_ColorOffsetv + (color * colorMultiplier), 0.0, 1.0);\n\n\t\t\tif (color.a > 0.0) {\n\n\t\t\t\tgl_FragColor = vec4 (color.rgb * color.a * openfl_Alphav, color.a * openfl_Alphav);\n\n\t\t\t} else {\n\n\t\t\t\tgl_FragColor = vec4 (0.0, 0.0, 0.0, 0.0);\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tgl_FragColor = color * openfl_Alphav;\n\n\t\t}\n\n\t\t}";
	}
	if(this.__glVertexSource == null) {
		this.__glVertexSource = "attribute float openfl_Alpha;\n\t\tattribute vec4 openfl_ColorMultiplier;\n\t\tattribute vec4 openfl_ColorOffset;\n\t\tattribute vec4 openfl_Position;\n\t\tattribute vec2 openfl_TextureCoord;\n\n\t\tvarying float openfl_Alphav;\n\t\tvarying vec4 openfl_ColorMultiplierv;\n\t\tvarying vec4 openfl_ColorOffsetv;\n\t\tvarying vec2 openfl_TextureCoordv;\n\n\t\tuniform mat4 openfl_Matrix;\n\t\tuniform bool openfl_HasColorTransform;\n\t\tuniform vec2 openfl_TextureSize;\n\n\t\tvoid main(void) {\n\n\t\t\topenfl_Alphav = openfl_Alpha;\n\t\topenfl_TextureCoordv = openfl_TextureCoord;\n\n\t\tif (openfl_HasColorTransform) {\n\n\t\t\topenfl_ColorMultiplierv = openfl_ColorMultiplier;\n\t\t\topenfl_ColorOffsetv = openfl_ColorOffset / 255.0;\n\n\t\t}\n\n\t\tgl_Position = openfl_Matrix * openfl_Position;\n\n\t\t}";
	}
	openfl_display_Shader.call(this,code);
	this.__isGenerated = true;
	this.__initGL();
};
$hxClasses["openfl.display.DisplayObjectShader"] = openfl_display_DisplayObjectShader;
openfl_display_DisplayObjectShader.__name__ = "openfl.display.DisplayObjectShader";
openfl_display_DisplayObjectShader.__super__ = openfl_display_Shader;
openfl_display_DisplayObjectShader.prototype = $extend(openfl_display_Shader.prototype,{
	openfl_Alpha: null
	,openfl_ColorMultiplier: null
	,openfl_ColorOffset: null
	,openfl_Position: null
	,openfl_TextureCoord: null
	,openfl_Matrix: null
	,openfl_HasColorTransform: null
	,openfl_TextureSize: null
	,openfl_Texture: null
	,__class__: openfl_display_DisplayObjectShader
});
var openfl_display_FrameLabel = function(name,frame) {
	openfl_events_EventDispatcher.call(this);
	this.name = name;
	this.frame = frame;
};
$hxClasses["openfl.display.FrameLabel"] = openfl_display_FrameLabel;
openfl_display_FrameLabel.__name__ = "openfl.display.FrameLabel";
openfl_display_FrameLabel.__super__ = openfl_events_EventDispatcher;
openfl_display_FrameLabel.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	frame: null
	,name: null
	,__class__: openfl_display_FrameLabel
});
var openfl_display_FrameScript = function(script,frame) {
	this.script = script;
	this.frame = frame;
};
$hxClasses["openfl.display.FrameScript"] = openfl_display_FrameScript;
openfl_display_FrameScript.__name__ = "openfl.display.FrameScript";
openfl_display_FrameScript.prototype = {
	frame: null
	,script: null
	,__class__: openfl_display_FrameScript
};
var openfl_display_GradientType = {};
openfl_display_GradientType.fromInt = function(value) {
	return value;
};
openfl_display_GradientType.fromString = function(value) {
	switch(value) {
	case "linear":
		return 0;
	case "radial":
		return 1;
	default:
		return null;
	}
};
openfl_display_GradientType.toInt = function(this1) {
	return this1;
};
openfl_display_GradientType.toString = function(this1) {
	switch(this1) {
	case 0:
		return "linear";
	case 1:
		return "radial";
	default:
		return null;
	}
};
var openfl_display_Graphics = function(owner) {
	this.__dirty = true;
	this.__owner = owner;
	this.__commands = new openfl_display__$internal_DrawCommandBuffer();
	this.__strokePadding = 0;
	this.__positionX = 0;
	this.__positionY = 0;
	this.__renderTransform = new openfl_geom_Matrix();
	this.__usedShaderBuffers = new haxe_ds_List();
	this.__worldTransform = new openfl_geom_Matrix();
	this.__width = 0;
	this.__height = 0;
	this.__shaderBufferPool = new lime_utils_ObjectPool(function() {
		return new openfl_display__$internal_ShaderBuffer();
	});
	this.moveTo(0,0);
};
$hxClasses["openfl.display.Graphics"] = openfl_display_Graphics;
openfl_display_Graphics.__name__ = "openfl.display.Graphics";
openfl_display_Graphics.prototype = {
	__bounds: null
	,__commands: null
	,__dirty: null
	,__hardwareDirty: null
	,__height: null
	,__managed: null
	,__positionX: null
	,__positionY: null
	,__quadBuffer: null
	,__renderTransform: null
	,__shaderBufferPool: null
	,__softwareDirty: null
	,__strokePadding: null
	,__transformDirty: null
	,__triangleIndexBuffer: null
	,__triangleIndexBufferCount: null
	,__triangleIndexBufferData: null
	,__usedShaderBuffers: null
	,__vertexBuffer: null
	,__vertexBufferCount: null
	,__vertexBufferCountUVT: null
	,__vertexBufferData: null
	,__vertexBufferDataUVT: null
	,__vertexBufferUVT: null
	,__visible: null
	,__owner: null
	,__width: null
	,__worldTransform: null
	,__canvas: null
	,__context: null
	,__bitmap: null
	,beginBitmapFill: function(bitmap,matrix,repeat,smooth) {
		if(smooth == null) {
			smooth = false;
		}
		if(repeat == null) {
			repeat = true;
		}
		this.__commands.beginBitmapFill(bitmap,matrix != null ? matrix.clone() : null,repeat,smooth);
		this.__visible = true;
	}
	,beginFill: function(color,alpha) {
		if(alpha == null) {
			alpha = 1;
		}
		if(color == null) {
			color = 0;
		}
		this.__commands.beginFill(color & 16777215,alpha);
		if(alpha > 0) {
			this.__visible = true;
		}
	}
	,beginGradientFill: function(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio) {
		if(focalPointRatio == null) {
			focalPointRatio = 0;
		}
		if(interpolationMethod == null) {
			interpolationMethod = 1;
		}
		if(spreadMethod == null) {
			spreadMethod = 0;
		}
		if(colors == null || colors.length == 0) {
			return;
		}
		if(alphas == null) {
			alphas = [];
			var _g = 0;
			var _g1 = colors.length;
			while(_g < _g1) {
				var i = _g++;
				alphas.push(1);
			}
		}
		if(ratios == null) {
			ratios = [];
			var _g = 0;
			var _g1 = colors.length;
			while(_g < _g1) {
				var i = _g++;
				ratios.push(Math.ceil(i / colors.length * 255));
			}
		}
		if(alphas.length < colors.length || ratios.length < colors.length) {
			return;
		}
		this.__commands.beginGradientFill(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio);
		var _g = 0;
		while(_g < alphas.length) {
			var alpha = alphas[_g];
			++_g;
			if(alpha > 0) {
				this.__visible = true;
				break;
			}
		}
	}
	,beginShaderFill: function(shader,matrix) {
		if(shader != null) {
			var shaderBuffer = this.__shaderBufferPool.get();
			this.__usedShaderBuffers.add(shaderBuffer);
			shaderBuffer.update(shader);
			this.__commands.beginShaderFill(shaderBuffer);
		}
	}
	,clear: function() {
		var _g_head = this.__usedShaderBuffers.h;
		while(_g_head != null) {
			var val = _g_head.item;
			_g_head = _g_head.next;
			var shaderBuffer = val;
			this.__shaderBufferPool.release(shaderBuffer);
		}
		this.__usedShaderBuffers.clear();
		this.__commands.clear();
		this.__strokePadding = 0;
		if(this.__bounds != null) {
			this.set___dirty(true);
			this.__transformDirty = true;
			this.__bounds = null;
		}
		this.__visible = false;
		this.__positionX = 0;
		this.__positionY = 0;
		this.moveTo(0,0);
	}
	,copyFrom: function(sourceGraphics) {
		this.__bounds = sourceGraphics.__bounds != null ? sourceGraphics.__bounds.clone() : null;
		this.__commands = sourceGraphics.__commands.copy();
		this.set___dirty(true);
		this.__strokePadding = sourceGraphics.__strokePadding;
		this.__positionX = sourceGraphics.__positionX;
		this.__positionY = sourceGraphics.__positionY;
		this.__transformDirty = true;
		this.__visible = sourceGraphics.__visible;
	}
	,cubicCurveTo: function(controlX1,controlY1,controlX2,controlY2,anchorX,anchorY) {
		this.__inflateBounds(this.__positionX - this.__strokePadding,this.__positionY - this.__strokePadding);
		this.__inflateBounds(this.__positionX + this.__strokePadding,this.__positionY + this.__strokePadding);
		var ix1 = anchorX;
		var ix2 = anchorX;
		if(!((controlX1 < anchorX && controlX1 > this.__positionX || controlX1 > anchorX && controlX1 < this.__positionX) && (controlX2 < anchorX && controlX2 > this.__positionX || controlX2 > anchorX && controlX2 < this.__positionX))) {
			var u = 2 * this.__positionX - 4 * controlX1 + 2 * controlX2;
			var v = controlX1 - this.__positionX;
			var w = -this.__positionX + 3 * controlX1 + anchorX - 3 * controlX2;
			var t1 = (-u + Math.sqrt(u * u - 4 * v * w)) / (2 * w);
			var t2 = (-u - Math.sqrt(u * u - 4 * v * w)) / (2 * w);
			if(t1 > 0 && t1 < 1) {
				ix1 = this.__calculateBezierCubicPoint(t1,this.__positionX,controlX1,controlX2,anchorX);
			}
			if(t2 > 0 && t2 < 1) {
				ix2 = this.__calculateBezierCubicPoint(t2,this.__positionX,controlX1,controlX2,anchorX);
			}
		}
		var iy1 = anchorY;
		var iy2 = anchorY;
		if(!((controlY1 < anchorY && controlY1 > this.__positionX || controlY1 > anchorY && controlY1 < this.__positionX) && (controlY2 < anchorY && controlY2 > this.__positionX || controlY2 > anchorY && controlY2 < this.__positionX))) {
			var u = 2 * this.__positionX - 4 * controlY1 + 2 * controlY2;
			var v = controlY1 - this.__positionX;
			var w = -this.__positionX + 3 * controlY1 + anchorY - 3 * controlY2;
			var t1 = (-u + Math.sqrt(u * u - 4 * v * w)) / (2 * w);
			var t2 = (-u - Math.sqrt(u * u - 4 * v * w)) / (2 * w);
			if(t1 > 0 && t1 < 1) {
				iy1 = this.__calculateBezierCubicPoint(t1,this.__positionX,controlY1,controlY2,anchorY);
			}
			if(t2 > 0 && t2 < 1) {
				iy2 = this.__calculateBezierCubicPoint(t2,this.__positionX,controlY1,controlY2,anchorY);
			}
		}
		this.__inflateBounds(ix1 - this.__strokePadding,iy1 - this.__strokePadding);
		this.__inflateBounds(ix1 + this.__strokePadding,iy1 + this.__strokePadding);
		this.__inflateBounds(ix2 - this.__strokePadding,iy2 - this.__strokePadding);
		this.__inflateBounds(ix2 + this.__strokePadding,iy2 + this.__strokePadding);
		this.__positionX = anchorX;
		this.__positionY = anchorY;
		this.__inflateBounds(this.__positionX - this.__strokePadding,this.__positionY - this.__strokePadding);
		this.__inflateBounds(this.__positionX + this.__strokePadding,this.__positionY + this.__strokePadding);
		this.__commands.cubicCurveTo(controlX1,controlY1,controlX2,controlY2,anchorX,anchorY);
		this.set___dirty(true);
	}
	,curveTo: function(controlX,controlY,anchorX,anchorY) {
		this.__inflateBounds(this.__positionX - this.__strokePadding,this.__positionY - this.__strokePadding);
		this.__inflateBounds(this.__positionX + this.__strokePadding,this.__positionY + this.__strokePadding);
		var ix;
		var iy;
		if(controlX < anchorX && controlX > this.__positionX || controlX > anchorX && controlX < this.__positionX) {
			ix = anchorX;
		} else {
			var tx = (this.__positionX - controlX) / (this.__positionX - 2 * controlX + anchorX);
			ix = this.__calculateBezierQuadPoint(tx,this.__positionX,controlX,anchorX);
		}
		if(controlY < anchorY && controlY > this.__positionY || controlY > anchorY && controlY < this.__positionY) {
			iy = anchorY;
		} else {
			var ty = (this.__positionY - controlY) / (this.__positionY - 2 * controlY + anchorY);
			iy = this.__calculateBezierQuadPoint(ty,this.__positionY,controlY,anchorY);
		}
		this.__inflateBounds(ix - this.__strokePadding,iy - this.__strokePadding);
		this.__inflateBounds(ix + this.__strokePadding,iy + this.__strokePadding);
		this.__positionX = anchorX;
		this.__positionY = anchorY;
		this.__commands.curveTo(controlX,controlY,anchorX,anchorY);
		this.set___dirty(true);
	}
	,drawCircle: function(x,y,radius) {
		if(radius <= 0) {
			return;
		}
		this.__inflateBounds(x - radius - this.__strokePadding,y - radius - this.__strokePadding);
		this.__inflateBounds(x + radius + this.__strokePadding,y + radius + this.__strokePadding);
		this.__commands.drawCircle(x,y,radius);
		this.set___dirty(true);
	}
	,drawEllipse: function(x,y,width,height) {
		if(width <= 0 || height <= 0) {
			return;
		}
		this.__inflateBounds(x - this.__strokePadding,y - this.__strokePadding);
		this.__inflateBounds(x + width + this.__strokePadding,y + height + this.__strokePadding);
		this.__commands.drawEllipse(x,y,width,height);
		this.set___dirty(true);
	}
	,drawGraphicsData: function(graphicsData) {
		var fill;
		var bitmapFill;
		var gradientFill;
		var shaderFill;
		var stroke;
		var path;
		var trianglePath;
		var quadPath;
		var graphics = graphicsData.iterator();
		while(graphics.hasNext()) {
			var graphics1 = graphics.next();
			switch(graphics1.__graphicsDataType) {
			case 0:
				stroke = graphics1;
				if(stroke.fill != null) {
					var thickness = stroke.thickness;
					if(isNaN(thickness)) {
						thickness = null;
					}
					switch(stroke.fill.__graphicsFillType) {
					case 0:
						fill = stroke.fill;
						this.lineStyle(thickness,fill.color,fill.alpha,stroke.pixelHinting,stroke.scaleMode,stroke.caps,stroke.joints,stroke.miterLimit);
						break;
					case 1:
						gradientFill = stroke.fill;
						this.lineStyle(thickness,0,1,stroke.pixelHinting,stroke.scaleMode,stroke.caps,stroke.joints,stroke.miterLimit);
						this.lineGradientStyle(gradientFill.type,gradientFill.colors,gradientFill.alphas,gradientFill.ratios,gradientFill.matrix,gradientFill.spreadMethod,gradientFill.interpolationMethod,gradientFill.focalPointRatio);
						break;
					case 2:
						bitmapFill = stroke.fill;
						this.lineStyle(thickness,0,1,stroke.pixelHinting,stroke.scaleMode,stroke.caps,stroke.joints,stroke.miterLimit);
						this.lineBitmapStyle(bitmapFill.bitmapData,bitmapFill.matrix,bitmapFill.repeat,bitmapFill.smooth);
						break;
					default:
					}
				} else {
					this.lineStyle();
				}
				break;
			case 1:
				fill = graphics1;
				this.beginFill(fill.color,fill.alpha);
				break;
			case 2:
				gradientFill = graphics1;
				this.beginGradientFill(gradientFill.type,gradientFill.colors,gradientFill.alphas,gradientFill.ratios,gradientFill.matrix,gradientFill.spreadMethod,gradientFill.interpolationMethod,gradientFill.focalPointRatio);
				break;
			case 3:
				path = graphics1;
				this.drawPath(path.commands,path.data,path.winding);
				break;
			case 4:
				bitmapFill = graphics1;
				this.beginBitmapFill(bitmapFill.bitmapData,bitmapFill.matrix,bitmapFill.repeat,bitmapFill.smooth);
				break;
			case 5:
				this.endFill();
				break;
			case 6:
				quadPath = graphics1;
				this.drawQuads(quadPath.rects,quadPath.indices,quadPath.transforms);
				break;
			case 7:
				trianglePath = graphics1;
				this.drawTriangles(trianglePath.vertices,trianglePath.indices,trianglePath.uvtData,trianglePath.culling);
				break;
			case 8:
				shaderFill = graphics1;
				this.beginShaderFill(shaderFill.shader,shaderFill.matrix);
				break;
			}
		}
	}
	,drawPath: function(commands,data,winding) {
		if(winding == null) {
			winding = 0;
		}
		var dataIndex = 0;
		if(winding == 1) {
			this.__commands.windingNonZero();
		}
		var command = commands.iterator();
		_hx_loop1: while(command.hasNext()) {
			var command1 = command.next();
			switch(command1) {
			case 1:
				this.moveTo(data.get(dataIndex),data.get(dataIndex + 1));
				dataIndex += 2;
				break;
			case 2:
				this.lineTo(data.get(dataIndex),data.get(dataIndex + 1));
				dataIndex += 2;
				break;
			case 3:
				this.curveTo(data.get(dataIndex),data.get(dataIndex + 1),data.get(dataIndex + 2),data.get(dataIndex + 3));
				dataIndex += 4;
				break;
			case 4:
				this.moveTo(data.get(dataIndex + 2),data.get(dataIndex + 3));
				break _hx_loop1;
			case 5:
				this.lineTo(data.get(dataIndex + 2),data.get(dataIndex + 3));
				break _hx_loop1;
			case 6:
				this.cubicCurveTo(data.get(dataIndex),data.get(dataIndex + 1),data.get(dataIndex + 2),data.get(dataIndex + 3),data.get(dataIndex + 4),data.get(dataIndex + 5));
				dataIndex += 6;
				break;
			default:
			}
		}
	}
	,drawQuads: function(rects,indices,transforms) {
		if(rects == null) {
			return;
		}
		var hasIndices = indices != null;
		var transformABCD = false;
		var transformXY = false;
		var length = hasIndices ? indices.get_length() : Math.floor(rects.get_length() / 4);
		if(length == 0) {
			return;
		}
		if(transforms != null) {
			if(transforms.get_length() >= length * 6) {
				transformABCD = true;
				transformXY = true;
			} else if(transforms.get_length() >= length * 4) {
				transformABCD = true;
			} else if(transforms.get_length() >= length * 2) {
				transformXY = true;
			}
		}
		var tileRect = openfl_geom_Rectangle.__pool.get();
		var tileTransform = openfl_geom_Matrix.__pool.get();
		var minX = Infinity;
		var minY = Infinity;
		var maxX = -Infinity;
		var maxY = -Infinity;
		var ri;
		var ti;
		var _g = 0;
		var _g1 = length;
		while(_g < _g1) {
			var i = _g++;
			ri = hasIndices ? indices.get(i) * 4 : i * 4;
			if(ri < 0) {
				continue;
			}
			tileRect.setTo(0,0,rects.get(ri + 2),rects.get(ri + 3));
			if(tileRect.width <= 0 || tileRect.height <= 0) {
				continue;
			}
			if(transformABCD && transformXY) {
				ti = i * 6;
				tileTransform.setTo(transforms.get(ti),transforms.get(ti + 1),transforms.get(ti + 2),transforms.get(ti + 3),transforms.get(ti + 4),transforms.get(ti + 5));
			} else if(transformABCD) {
				ti = i * 4;
				tileTransform.setTo(transforms.get(ti),transforms.get(ti + 1),transforms.get(ti + 2),transforms.get(ti + 3),tileRect.x,tileRect.y);
			} else if(transformXY) {
				ti = i * 2;
				tileTransform.tx = transforms.get(ti);
				tileTransform.ty = transforms.get(ti + 1);
			} else {
				tileTransform.tx = tileRect.x;
				tileTransform.ty = tileRect.y;
			}
			tileRect.__transform(tileRect,tileTransform);
			if(minX > tileRect.x) {
				minX = tileRect.x;
			}
			if(minY > tileRect.y) {
				minY = tileRect.y;
			}
			if(maxX < tileRect.get_right()) {
				maxX = tileRect.get_right();
			}
			if(maxY < tileRect.get_bottom()) {
				maxY = tileRect.get_bottom();
			}
		}
		this.__inflateBounds(minX,minY);
		this.__inflateBounds(maxX,maxY);
		this.__commands.drawQuads(rects,indices,transforms);
		this.set___dirty(true);
		this.__visible = true;
		openfl_geom_Rectangle.__pool.release(tileRect);
		openfl_geom_Matrix.__pool.release(tileTransform);
	}
	,drawRect: function(x,y,width,height) {
		if(width == 0 && height == 0) {
			return;
		}
		var xSign = width < 0 ? -1 : 1;
		var ySign = height < 0 ? -1 : 1;
		this.__inflateBounds(x - this.__strokePadding * xSign,y - this.__strokePadding * ySign);
		this.__inflateBounds(x + width + this.__strokePadding * xSign,y + height + this.__strokePadding * ySign);
		this.__commands.drawRect(x,y,width,height);
		this.set___dirty(true);
	}
	,drawRoundRect: function(x,y,width,height,ellipseWidth,ellipseHeight) {
		if(width == 0 && height == 0) {
			return;
		}
		var xSign = width < 0 ? -1 : 1;
		var ySign = height < 0 ? -1 : 1;
		this.__inflateBounds(x - this.__strokePadding * xSign,y - this.__strokePadding * ySign);
		this.__inflateBounds(x + width + this.__strokePadding * xSign,y + height + this.__strokePadding * ySign);
		this.__commands.drawRoundRect(x,y,width,height,ellipseWidth,ellipseHeight);
		this.set___dirty(true);
	}
	,drawRoundRectComplex: function(x,y,width,height,topLeftRadius,topRightRadius,bottomLeftRadius,bottomRightRadius) {
		if(width <= 0 || height <= 0) {
			return;
		}
		this.__inflateBounds(x - this.__strokePadding,y - this.__strokePadding);
		this.__inflateBounds(x + width + this.__strokePadding,y + height + this.__strokePadding);
		var xw = x + width;
		var yh = y + height;
		var minSize = width < height ? width * 2 : height * 2;
		if(!(topLeftRadius < minSize)) {
			topLeftRadius = minSize;
		}
		if(!(topRightRadius < minSize)) {
			topRightRadius = minSize;
		}
		if(!(bottomLeftRadius < minSize)) {
			bottomLeftRadius = minSize;
		}
		if(!(bottomRightRadius < minSize)) {
			bottomRightRadius = minSize;
		}
		var anchor = 1 - Math.sin(45 * (Math.PI / 180));
		var control = 1 - Math.tan(22.5 * (Math.PI / 180));
		var a = bottomRightRadius * anchor;
		var s = bottomRightRadius * control;
		this.moveTo(xw,yh - bottomRightRadius);
		this.curveTo(xw,yh - s,xw - a,yh - a);
		this.curveTo(xw - s,yh,xw - bottomRightRadius,yh);
		a = bottomLeftRadius * anchor;
		s = bottomLeftRadius * control;
		this.lineTo(x + bottomLeftRadius,yh);
		this.curveTo(x + s,yh,x + a,yh - a);
		this.curveTo(x,yh - s,x,yh - bottomLeftRadius);
		a = topLeftRadius * anchor;
		s = topLeftRadius * control;
		this.lineTo(x,y + topLeftRadius);
		this.curveTo(x,y + s,x + a,y + a);
		this.curveTo(x + s,y,x + topLeftRadius,y);
		a = topRightRadius * anchor;
		s = topRightRadius * control;
		this.lineTo(xw - topRightRadius,y);
		this.curveTo(xw - s,y,xw - a,y + a);
		this.curveTo(xw,y + s,xw,y + topRightRadius);
		this.lineTo(xw,yh - bottomRightRadius);
		this.set___dirty(true);
	}
	,drawTriangles: function(vertices,indices,uvtData,culling) {
		if(culling == null) {
			culling = 1;
		}
		if(vertices == null || vertices.get_length() == 0) {
			return;
		}
		var vertLength = vertices.get_length() / 2 | 0;
		if(indices == null) {
			if(vertLength % 3 != 0) {
				throw haxe_Exception.thrown(new openfl_errors_ArgumentError("Not enough vertices to close a triangle."));
			}
			indices = openfl_Vector.toIntVector(null);
			var _g = 0;
			var _g1 = vertLength;
			while(_g < _g1) {
				var i = _g++;
				indices.push(i);
			}
		}
		if(culling == null) {
			culling = 1;
		}
		var x;
		var y;
		var minX = Infinity;
		var minY = Infinity;
		var maxX = -Infinity;
		var maxY = -Infinity;
		var _g = 0;
		var _g1 = vertLength;
		while(_g < _g1) {
			var i = _g++;
			x = vertices.get(i * 2);
			y = vertices.get(i * 2 + 1);
			if(minX > x) {
				minX = x;
			}
			if(minY > y) {
				minY = y;
			}
			if(maxX < x) {
				maxX = x;
			}
			if(maxY < y) {
				maxY = y;
			}
		}
		this.__inflateBounds(minX,minY);
		this.__inflateBounds(maxX,maxY);
		this.__commands.drawTriangles(vertices,indices,uvtData,culling);
		this.set___dirty(true);
		this.__visible = true;
	}
	,endFill: function() {
		this.__commands.endFill();
	}
	,lineBitmapStyle: function(bitmap,matrix,repeat,smooth) {
		if(smooth == null) {
			smooth = false;
		}
		if(repeat == null) {
			repeat = true;
		}
		this.__commands.lineBitmapStyle(bitmap,matrix != null ? matrix.clone() : null,repeat,smooth);
	}
	,lineGradientStyle: function(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio) {
		if(focalPointRatio == null) {
			focalPointRatio = 0;
		}
		if(interpolationMethod == null) {
			interpolationMethod = 1;
		}
		if(spreadMethod == null) {
			spreadMethod = 0;
		}
		this.__commands.lineGradientStyle(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio);
	}
	,lineStyle: function(thickness,color,alpha,pixelHinting,scaleMode,caps,joints,miterLimit) {
		if(miterLimit == null) {
			miterLimit = 3;
		}
		if(scaleMode == null) {
			scaleMode = 2;
		}
		if(pixelHinting == null) {
			pixelHinting = false;
		}
		if(alpha == null) {
			alpha = 1;
		}
		if(color == null) {
			color = 0;
		}
		if(thickness != null) {
			if(joints == 1) {
				if(thickness > this.__strokePadding) {
					this.__strokePadding = thickness;
				}
			} else if(thickness / 2 > this.__strokePadding) {
				this.__strokePadding = thickness / 2;
			}
		}
		this.__commands.lineStyle(thickness,color,alpha,pixelHinting,scaleMode,caps,joints,miterLimit);
		if(thickness != null) {
			this.__visible = true;
		}
	}
	,lineTo: function(x,y) {
		if(!isFinite(x) || !isFinite(y)) {
			return;
		}
		this.__inflateBounds(this.__positionX - this.__strokePadding,this.__positionY - this.__strokePadding);
		this.__inflateBounds(this.__positionX + this.__strokePadding,this.__positionY + this.__strokePadding);
		this.__positionX = x;
		this.__positionY = y;
		this.__inflateBounds(this.__positionX - this.__strokePadding,this.__positionY - this.__strokePadding);
		this.__inflateBounds(this.__positionX + this.__strokePadding * 2,this.__positionY + this.__strokePadding);
		this.__commands.lineTo(x,y);
		this.set___dirty(true);
	}
	,moveTo: function(x,y) {
		this.__positionX = x;
		this.__positionY = y;
		this.__commands.moveTo(x,y);
	}
	,overrideBlendMode: function(blendMode) {
		if(blendMode == null) {
			blendMode = 10;
		}
		this.__commands.overrideBlendMode(blendMode);
	}
	,readGraphicsData: function(recurse) {
		if(recurse == null) {
			recurse = true;
		}
		var graphicsData = openfl_Vector.toObjectVector(null);
		this.__owner.__readGraphicsData(graphicsData,recurse);
		return graphicsData;
	}
	,__calculateBezierCubicPoint: function(t,p1,p2,p3,p4) {
		var iT = 1 - t;
		return p1 * (iT * iT * iT) + 3 * p2 * t * (iT * iT) + 3 * p3 * iT * (t * t) + p4 * (t * t * t);
	}
	,__calculateBezierQuadPoint: function(t,p1,p2,p3) {
		var iT = 1 - t;
		return iT * iT * p1 + 2 * iT * t * p2 + t * t * p3;
	}
	,__cleanup: function() {
		if(this.__bounds != null && this.__canvas != null) {
			this.set___dirty(true);
			this.__transformDirty = true;
		}
		this.__bitmap = null;
		this.__canvas = null;
		this.__context = null;
	}
	,__getBounds: function(rect,matrix) {
		if(this.__bounds == null) {
			return;
		}
		var bounds = openfl_geom_Rectangle.__pool.get();
		this.__bounds.__transform(bounds,matrix);
		rect.__expand(bounds.x,bounds.y,bounds.width,bounds.height);
		openfl_geom_Rectangle.__pool.release(bounds);
	}
	,__hitTest: function(x,y,shapeFlag,matrix) {
		if(this.__bounds == null) {
			return false;
		}
		var norm = matrix.a * matrix.d - matrix.b * matrix.c;
		var px = norm == 0 ? -matrix.tx : 1.0 / norm * (matrix.c * (matrix.ty - y) + matrix.d * (x - matrix.tx));
		var norm = matrix.a * matrix.d - matrix.b * matrix.c;
		var py = norm == 0 ? -matrix.ty : 1.0 / norm * (matrix.a * (y - matrix.ty) + matrix.b * (matrix.tx - x));
		if(px > this.__bounds.x && py > this.__bounds.y && this.__bounds.contains(px,py)) {
			if(shapeFlag) {
				return openfl_display__$internal_CanvasGraphics.hitTest(this,px,py);
			}
			return true;
		}
		return false;
	}
	,__inflateBounds: function(x,y) {
		if(this.__bounds == null) {
			this.__bounds = new openfl_geom_Rectangle(x,y,0,0);
			this.__transformDirty = true;
			return;
		}
		if(x < this.__bounds.x) {
			this.__bounds.width += this.__bounds.x - x;
			this.__bounds.x = x;
			this.__transformDirty = true;
		}
		if(y < this.__bounds.y) {
			this.__bounds.height += this.__bounds.y - y;
			this.__bounds.y = y;
			this.__transformDirty = true;
		}
		if(x > this.__bounds.x + this.__bounds.width) {
			this.__bounds.width = x - this.__bounds.x;
		}
		if(y > this.__bounds.y + this.__bounds.height) {
			this.__bounds.height = y - this.__bounds.y;
		}
	}
	,__readGraphicsData: function(graphicsData) {
		var data = new openfl_display__$internal_DrawCommandReader(this.__commands);
		var path = null;
		var stroke;
		var _g = 0;
		var _g1 = this.__commands.types;
		while(_g < _g1.length) {
			var type = _g1[_g];
			++_g;
			switch(type._hx_index) {
			case 4:case 5:case 6:case 7:case 9:case 10:case 17:case 18:
				if(path == null) {
					path = new openfl_display_GraphicsPath();
				}
				break;
			default:
				if(path != null) {
					graphicsData.push(path);
					path = null;
				}
			}
			switch(type._hx_index) {
			case 0:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL;
				var this1 = data;
				var c = this1;
				graphicsData.push(new openfl_display_GraphicsBitmapFill(c.buffer.o[c.oPos],c.buffer.o[c.oPos + 1],c.buffer.b[c.bPos],c.buffer.b[c.bPos + 1]));
				break;
			case 1:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.BEGIN_FILL;
				var this2 = data;
				var c1 = this2;
				graphicsData.push(new openfl_display_GraphicsSolidFill(c1.buffer.i[c1.iPos],1));
				break;
			case 2:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL;
				var this3 = data;
				var c2 = this3;
				graphicsData.push(new openfl_display_GraphicsGradientFill(c2.buffer.o[c2.oPos],c2.buffer.ii[c2.iiPos],c2.buffer.ff[c2.ffPos],c2.buffer.ii[c2.iiPos + 1],c2.buffer.o[c2.oPos + 1],c2.buffer.o[c2.oPos + 2],c2.buffer.o[c2.oPos + 3],c2.buffer.f[c2.fPos]));
				break;
			case 3:
				break;
			case 4:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO;
				var this4 = data;
				var c3 = this4;
				path.cubicCurveTo(c3.buffer.f[c3.fPos],c3.buffer.f[c3.fPos + 1],c3.buffer.f[c3.fPos + 2],c3.buffer.f[c3.fPos + 3],c3.buffer.f[c3.fPos + 4],c3.buffer.f[c3.fPos + 5]);
				break;
			case 5:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.CURVE_TO;
				var this5 = data;
				var c4 = this5;
				path.curveTo(c4.buffer.f[c4.fPos],c4.buffer.f[c4.fPos + 1],c4.buffer.f[c4.fPos + 2],c4.buffer.f[c4.fPos + 3]);
				break;
			case 6:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_CIRCLE;
				var this6 = data;
				var c5 = this6;
				path.__drawCircle(c5.buffer.f[c5.fPos],c5.buffer.f[c5.fPos + 1],c5.buffer.f[c5.fPos + 2]);
				break;
			case 7:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE;
				var this7 = data;
				var c6 = this7;
				path.__drawEllipse(c6.buffer.f[c6.fPos],c6.buffer.f[c6.fPos + 1],c6.buffer.f[c6.fPos + 2],c6.buffer.f[c6.fPos + 3]);
				break;
			case 9:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_RECT;
				var this8 = data;
				var c7 = this8;
				path.__drawRect(c7.buffer.f[c7.fPos],c7.buffer.f[c7.fPos + 1],c7.buffer.f[c7.fPos + 2],c7.buffer.f[c7.fPos + 3]);
				break;
			case 10:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT;
				var this9 = data;
				var c8 = this9;
				path.__drawRoundRect(c8.buffer.f[c8.fPos],c8.buffer.f[c8.fPos + 1],c8.buffer.f[c8.fPos + 2],c8.buffer.f[c8.fPos + 3],c8.buffer.f[c8.fPos + 4],c8.buffer.o[c8.oPos] != null ? c8.buffer.o[c8.oPos] : c8.buffer.f[c8.fPos + 4]);
				break;
			case 13:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.END_FILL;
				var this10 = data;
				graphicsData.push(new openfl_display_GraphicsEndFill());
				break;
			case 14:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_BITMAP_STYLE;
				var this11 = data;
				var c9 = this11;
				path = null;
				break;
			case 15:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_GRADIENT_STYLE;
				var this12 = data;
				var c10 = this12;
				break;
			case 16:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_STYLE;
				var this13 = data;
				var c11 = this13;
				stroke = new openfl_display_GraphicsStroke(c11.buffer.o[c11.oPos],c11.buffer.b[c11.bPos],c11.buffer.o[c11.oPos + 1],c11.buffer.o[c11.oPos + 2],c11.buffer.o[c11.oPos + 3],c11.buffer.f[c11.fPos + 1]);
				stroke.fill = new openfl_display_GraphicsSolidFill(c11.buffer.i[c11.iPos],c11.buffer.f[c11.fPos]);
				graphicsData.push(stroke);
				break;
			case 17:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_TO;
				var this14 = data;
				var c12 = this14;
				path.lineTo(c12.buffer.f[c12.fPos],c12.buffer.f[c12.fPos + 1]);
				break;
			case 18:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.MOVE_TO;
				var this15 = data;
				var c13 = this15;
				path.moveTo(c13.buffer.f[c13.fPos],c13.buffer.f[c13.fPos + 1]);
				break;
			default:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = type;
			}
		}
		if(path != null) {
			graphicsData.push(path);
		}
	}
	,__update: function(displayMatrix) {
		if(this.__bounds == null || this.__bounds.width <= 0 || this.__bounds.height <= 0) {
			return;
		}
		var parentTransform = this.__owner.__renderTransform;
		var scaleX = 1.0;
		var scaleY = 1.0;
		if(parentTransform != null) {
			if(parentTransform.b == 0) {
				scaleX = Math.abs(parentTransform.a);
			} else {
				scaleX = Math.sqrt(parentTransform.a * parentTransform.a + parentTransform.b * parentTransform.b);
			}
			if(parentTransform.c == 0) {
				scaleY = Math.abs(parentTransform.d);
			} else {
				scaleY = Math.sqrt(parentTransform.c * parentTransform.c + parentTransform.d * parentTransform.d);
			}
		} else {
			return;
		}
		if(displayMatrix != null) {
			if(displayMatrix.b == 0) {
				scaleX *= displayMatrix.a;
			} else {
				scaleX *= Math.sqrt(displayMatrix.a * displayMatrix.a + displayMatrix.b * displayMatrix.b);
			}
			if(displayMatrix.c == 0) {
				scaleY *= displayMatrix.d;
			} else {
				scaleY *= Math.sqrt(displayMatrix.c * displayMatrix.c + displayMatrix.d * displayMatrix.d);
			}
		}
		var width = this.__bounds.width * scaleX;
		var height = this.__bounds.height * scaleY;
		if(width < 1 || height < 1) {
			if(this.__width >= 1 || this.__height >= 1) {
				this.set___dirty(true);
			}
			this.__width = 0;
			this.__height = 0;
			return;
		}
		if(openfl_display_Graphics.maxTextureWidth != null && width > openfl_display_Graphics.maxTextureWidth) {
			width = openfl_display_Graphics.maxTextureWidth;
			scaleX = openfl_display_Graphics.maxTextureWidth / this.__bounds.width;
		}
		if(openfl_display_Graphics.maxTextureWidth != null && height > openfl_display_Graphics.maxTextureHeight) {
			height = openfl_display_Graphics.maxTextureHeight;
			scaleY = openfl_display_Graphics.maxTextureHeight / this.__bounds.height;
		}
		this.__renderTransform.a = width / this.__bounds.width;
		this.__renderTransform.d = height / this.__bounds.height;
		var inverseA = 1 / this.__renderTransform.a;
		var inverseD = 1 / this.__renderTransform.d;
		this.__worldTransform.a = inverseA * parentTransform.a;
		this.__worldTransform.b = inverseA * parentTransform.b;
		this.__worldTransform.c = inverseD * parentTransform.c;
		this.__worldTransform.d = inverseD * parentTransform.d;
		var x = this.__bounds.x;
		var y = this.__bounds.y;
		var tx = x * parentTransform.a + y * parentTransform.c + parentTransform.tx;
		var ty = x * parentTransform.b + y * parentTransform.d + parentTransform.ty;
		this.__worldTransform.tx = Math.round(tx);
		this.__worldTransform.ty = Math.round(ty);
		var _this = this.__worldTransform;
		var norm = _this.a * _this.d - _this.b * _this.c;
		this.__renderTransform.tx = norm == 0 ? -_this.tx : 1.0 / norm * (_this.c * (_this.ty - ty) + _this.d * (tx - _this.tx));
		var _this = this.__worldTransform;
		var norm = _this.a * _this.d - _this.b * _this.c;
		this.__renderTransform.ty = norm == 0 ? -_this.ty : 1.0 / norm * (_this.a * (ty - _this.ty) + _this.b * (_this.tx - tx));
		var newWidth = Math.ceil(width + 1.0);
		var newHeight = Math.ceil(height + 1.0);
		if(newWidth != this.__width || newHeight != this.__height) {
			this.set___dirty(true);
		}
		this.__width = newWidth;
		this.__height = newHeight;
	}
	,set___dirty: function(value) {
		if(value && this.__owner != null) {
			var _this = this.__owner;
			if(!_this.__renderDirty) {
				_this.__renderDirty = true;
				_this.__setParentRenderDirty();
			}
		}
		if(value) {
			this.__softwareDirty = true;
			this.__hardwareDirty = true;
		}
		return this.__dirty = value;
	}
	,__class__: openfl_display_Graphics
	,__properties__: {set___dirty:"set___dirty"}
};
var openfl_display_IGraphicsFill = function() { };
$hxClasses["openfl.display.IGraphicsFill"] = openfl_display_IGraphicsFill;
openfl_display_IGraphicsFill.__name__ = "openfl.display.IGraphicsFill";
openfl_display_IGraphicsFill.__isInterface__ = true;
openfl_display_IGraphicsFill.prototype = {
	__graphicsFillType: null
	,__class__: openfl_display_IGraphicsFill
};
var openfl_display_IGraphicsData = function() { };
$hxClasses["openfl.display.IGraphicsData"] = openfl_display_IGraphicsData;
openfl_display_IGraphicsData.__name__ = "openfl.display.IGraphicsData";
openfl_display_IGraphicsData.__isInterface__ = true;
openfl_display_IGraphicsData.prototype = {
	__graphicsDataType: null
	,__class__: openfl_display_IGraphicsData
};
var openfl_display_GraphicsBitmapFill = function(bitmapData,matrix,repeat,smooth) {
	if(smooth == null) {
		smooth = false;
	}
	if(repeat == null) {
		repeat = true;
	}
	this.bitmapData = bitmapData;
	this.matrix = matrix;
	this.repeat = repeat;
	this.smooth = smooth;
	this.__graphicsDataType = 4;
	this.__graphicsFillType = 2;
};
$hxClasses["openfl.display.GraphicsBitmapFill"] = openfl_display_GraphicsBitmapFill;
openfl_display_GraphicsBitmapFill.__name__ = "openfl.display.GraphicsBitmapFill";
openfl_display_GraphicsBitmapFill.__interfaces__ = [openfl_display_IGraphicsFill,openfl_display_IGraphicsData];
openfl_display_GraphicsBitmapFill.prototype = {
	bitmapData: null
	,matrix: null
	,repeat: null
	,smooth: null
	,__graphicsDataType: null
	,__graphicsFillType: null
	,__class__: openfl_display_GraphicsBitmapFill
};
var openfl_display_GraphicsEndFill = function() {
	this.__graphicsDataType = 5;
	this.__graphicsFillType = 3;
};
$hxClasses["openfl.display.GraphicsEndFill"] = openfl_display_GraphicsEndFill;
openfl_display_GraphicsEndFill.__name__ = "openfl.display.GraphicsEndFill";
openfl_display_GraphicsEndFill.__interfaces__ = [openfl_display_IGraphicsFill,openfl_display_IGraphicsData];
openfl_display_GraphicsEndFill.prototype = {
	__graphicsDataType: null
	,__graphicsFillType: null
	,__class__: openfl_display_GraphicsEndFill
};
var openfl_display_GraphicsGradientFill = function(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio) {
	if(focalPointRatio == null) {
		focalPointRatio = 0;
	}
	if(type == null) {
		type = 0;
	}
	if(spreadMethod == null) {
		spreadMethod = 0;
	}
	if(interpolationMethod == null) {
		interpolationMethod = 1;
	}
	this.type = type;
	this.colors = colors;
	this.alphas = alphas;
	this.ratios = ratios;
	this.matrix = matrix;
	this.spreadMethod = spreadMethod;
	this.interpolationMethod = interpolationMethod;
	this.focalPointRatio = focalPointRatio;
	this.__graphicsDataType = 2;
	this.__graphicsFillType = 1;
};
$hxClasses["openfl.display.GraphicsGradientFill"] = openfl_display_GraphicsGradientFill;
openfl_display_GraphicsGradientFill.__name__ = "openfl.display.GraphicsGradientFill";
openfl_display_GraphicsGradientFill.__interfaces__ = [openfl_display_IGraphicsFill,openfl_display_IGraphicsData];
openfl_display_GraphicsGradientFill.prototype = {
	alphas: null
	,colors: null
	,focalPointRatio: null
	,interpolationMethod: null
	,matrix: null
	,ratios: null
	,spreadMethod: null
	,type: null
	,__graphicsDataType: null
	,__graphicsFillType: null
	,__class__: openfl_display_GraphicsGradientFill
};
var openfl_display_IGraphicsPath = function() { };
$hxClasses["openfl.display.IGraphicsPath"] = openfl_display_IGraphicsPath;
openfl_display_IGraphicsPath.__name__ = "openfl.display.IGraphicsPath";
openfl_display_IGraphicsPath.__isInterface__ = true;
var openfl_display_GraphicsPath = function(commands,data,winding) {
	if(winding == null) {
		winding = 0;
	}
	this.commands = commands;
	this.data = data;
	this.winding = winding;
	this.__graphicsDataType = 3;
};
$hxClasses["openfl.display.GraphicsPath"] = openfl_display_GraphicsPath;
openfl_display_GraphicsPath.__name__ = "openfl.display.GraphicsPath";
openfl_display_GraphicsPath.__interfaces__ = [openfl_display_IGraphicsPath,openfl_display_IGraphicsData];
openfl_display_GraphicsPath.prototype = {
	commands: null
	,data: null
	,winding: null
	,__graphicsDataType: null
	,cubicCurveTo: function(controlX1,controlY1,controlX2,controlY2,anchorX,anchorY) {
		if(this.commands == null) {
			this.commands = openfl_Vector.toIntVector(null);
		}
		if(this.data == null) {
			this.data = openfl_Vector.toFloatVector(null);
		}
		this.commands.push(6);
		this.data.push(controlX1);
		this.data.push(controlY1);
		this.data.push(controlX2);
		this.data.push(controlY2);
		this.data.push(anchorX);
		this.data.push(anchorY);
	}
	,curveTo: function(controlX,controlY,anchorX,anchorY) {
		if(this.commands == null) {
			this.commands = openfl_Vector.toIntVector(null);
		}
		if(this.data == null) {
			this.data = openfl_Vector.toFloatVector(null);
		}
		this.commands.push(3);
		this.data.push(controlX);
		this.data.push(controlY);
		this.data.push(anchorX);
		this.data.push(anchorY);
	}
	,lineTo: function(x,y) {
		if(this.commands == null) {
			this.commands = openfl_Vector.toIntVector(null);
		}
		if(this.data == null) {
			this.data = openfl_Vector.toFloatVector(null);
		}
		this.commands.push(2);
		this.data.push(x);
		this.data.push(y);
	}
	,moveTo: function(x,y) {
		if(this.commands == null) {
			this.commands = openfl_Vector.toIntVector(null);
		}
		if(this.data == null) {
			this.data = openfl_Vector.toFloatVector(null);
		}
		this.commands.push(1);
		this.data.push(x);
		this.data.push(y);
	}
	,wideLineTo: function(x,y) {
		if(this.commands == null) {
			this.commands = openfl_Vector.toIntVector(null);
		}
		if(this.data == null) {
			this.data = openfl_Vector.toFloatVector(null);
		}
		this.commands.push(2);
		this.data.push(x);
		this.data.push(y);
	}
	,wideMoveTo: function(x,y) {
		if(this.commands == null) {
			this.commands = openfl_Vector.toIntVector(null);
		}
		if(this.data == null) {
			this.data = openfl_Vector.toFloatVector(null);
		}
		this.commands.push(1);
		this.data.push(x);
		this.data.push(y);
	}
	,__drawCircle: function(x,y,radius) {
		this.__drawRoundRect(x - radius,y - radius,radius * 2,radius * 2,radius * 2,radius * 2);
	}
	,__drawEllipse: function(x,y,width,height) {
		this.__drawRoundRect(x,y,width,height,width,height);
	}
	,__drawRect: function(x,y,width,height) {
		this.moveTo(x,y);
		this.lineTo(x + width,y);
		this.lineTo(x + width,y + height);
		this.lineTo(x,y + height);
		this.lineTo(x,y);
	}
	,__drawRoundRect: function(x,y,width,height,ellipseWidth,ellipseHeight) {
		ellipseWidth *= 0.5;
		ellipseHeight *= 0.5;
		if(ellipseWidth > width / 2) {
			ellipseWidth = width / 2;
		}
		if(ellipseHeight > height / 2) {
			ellipseHeight = height / 2;
		}
		var xe = x + width;
		var ye = y + height;
		var cx1 = -ellipseWidth + ellipseWidth * 0.70710678118654752440084436210485;
		var cx2 = -ellipseWidth + ellipseWidth * 0.4142135623730950488016887242097;
		var cy1 = -ellipseHeight + ellipseHeight * 0.70710678118654752440084436210485;
		var cy2 = -ellipseHeight + ellipseHeight * 0.4142135623730950488016887242097;
		this.moveTo(xe,ye - ellipseHeight);
		this.curveTo(xe,ye + cy2,xe + cx1,ye + cy1);
		this.curveTo(xe + cx2,ye,xe - ellipseWidth,ye);
		this.lineTo(x + ellipseWidth,ye);
		this.curveTo(x - cx2,ye,x - cx1,ye + cy1);
		this.curveTo(x,ye + cy2,x,ye - ellipseHeight);
		this.lineTo(x,y + ellipseHeight);
		this.curveTo(x,y - cy2,x - cx1,y - cy1);
		this.curveTo(x - cx2,y,x + ellipseWidth,y);
		this.lineTo(xe - ellipseWidth,y);
		this.curveTo(xe + cx2,y,xe + cx1,y - cy1);
		this.curveTo(xe,y - cy2,xe,y + ellipseHeight);
		this.lineTo(xe,ye - ellipseHeight);
	}
	,__class__: openfl_display_GraphicsPath
};
var openfl_display_GraphicsPathWinding = {};
openfl_display_GraphicsPathWinding.fromString = function(value) {
	switch(value) {
	case "evenOdd":
		return 0;
	case "nonZero":
		return 1;
	default:
		return null;
	}
};
openfl_display_GraphicsPathWinding.toString = function(this1) {
	switch(this1) {
	case 0:
		return "evenOdd";
	case 1:
		return "nonZero";
	default:
		return null;
	}
};
var openfl_display_GraphicsQuadPath = function(rects,indices,transforms) {
	this.rects = rects;
	this.indices = indices;
	this.transforms = transforms;
	this.__graphicsDataType = 6;
};
$hxClasses["openfl.display.GraphicsQuadPath"] = openfl_display_GraphicsQuadPath;
openfl_display_GraphicsQuadPath.__name__ = "openfl.display.GraphicsQuadPath";
openfl_display_GraphicsQuadPath.__interfaces__ = [openfl_display_IGraphicsPath,openfl_display_IGraphicsData];
openfl_display_GraphicsQuadPath.prototype = {
	indices: null
	,rects: null
	,transforms: null
	,__graphicsDataType: null
	,__class__: openfl_display_GraphicsQuadPath
};
var openfl_display_GraphicsShaderFill = function(shader,matrix) {
	this.shader = shader;
	this.matrix = matrix;
	this.__graphicsDataType = 8;
	this.__graphicsFillType = 4;
};
$hxClasses["openfl.display.GraphicsShaderFill"] = openfl_display_GraphicsShaderFill;
openfl_display_GraphicsShaderFill.__name__ = "openfl.display.GraphicsShaderFill";
openfl_display_GraphicsShaderFill.__interfaces__ = [openfl_display_IGraphicsFill,openfl_display_IGraphicsData];
openfl_display_GraphicsShaderFill.prototype = {
	matrix: null
	,shader: null
	,__graphicsDataType: null
	,__graphicsFillType: null
	,__class__: openfl_display_GraphicsShaderFill
};
var openfl_display_GraphicsSolidFill = function(color,alpha) {
	if(alpha == null) {
		alpha = 1;
	}
	if(color == null) {
		color = 0;
	}
	this.alpha = alpha;
	this.color = color;
	this.__graphicsDataType = 1;
	this.__graphicsFillType = 0;
};
$hxClasses["openfl.display.GraphicsSolidFill"] = openfl_display_GraphicsSolidFill;
openfl_display_GraphicsSolidFill.__name__ = "openfl.display.GraphicsSolidFill";
openfl_display_GraphicsSolidFill.__interfaces__ = [openfl_display_IGraphicsFill,openfl_display_IGraphicsData];
openfl_display_GraphicsSolidFill.prototype = {
	alpha: null
	,color: null
	,__graphicsDataType: null
	,__graphicsFillType: null
	,__class__: openfl_display_GraphicsSolidFill
};
var openfl_display_IGraphicsStroke = function() { };
$hxClasses["openfl.display.IGraphicsStroke"] = openfl_display_IGraphicsStroke;
openfl_display_IGraphicsStroke.__name__ = "openfl.display.IGraphicsStroke";
openfl_display_IGraphicsStroke.__isInterface__ = true;
var openfl_display_GraphicsStroke = function(thickness,pixelHinting,scaleMode,caps,joints,miterLimit,fill) {
	if(miterLimit == null) {
		miterLimit = 3;
	}
	if(joints == null) {
		joints = 2;
	}
	if(caps == null) {
		caps = 0;
	}
	if(scaleMode == null) {
		scaleMode = 2;
	}
	if(pixelHinting == null) {
		pixelHinting = false;
	}
	if(thickness == null) {
		thickness = NaN;
	}
	this.caps = caps;
	this.fill = fill;
	this.joints = joints;
	this.miterLimit = miterLimit;
	this.pixelHinting = pixelHinting;
	this.scaleMode = scaleMode;
	this.thickness = thickness;
	this.__graphicsDataType = 0;
};
$hxClasses["openfl.display.GraphicsStroke"] = openfl_display_GraphicsStroke;
openfl_display_GraphicsStroke.__name__ = "openfl.display.GraphicsStroke";
openfl_display_GraphicsStroke.__interfaces__ = [openfl_display_IGraphicsStroke,openfl_display_IGraphicsData];
openfl_display_GraphicsStroke.prototype = {
	caps: null
	,fill: null
	,joints: null
	,miterLimit: null
	,pixelHinting: null
	,scaleMode: null
	,thickness: null
	,__graphicsDataType: null
	,__class__: openfl_display_GraphicsStroke
};
var openfl_display_GraphicsTrianglePath = function(vertices,indices,uvtData,culling) {
	if(culling == null) {
		culling = 1;
	}
	this.vertices = vertices;
	this.indices = indices;
	this.uvtData = uvtData;
	this.culling = culling;
	this.__graphicsDataType = 7;
};
$hxClasses["openfl.display.GraphicsTrianglePath"] = openfl_display_GraphicsTrianglePath;
openfl_display_GraphicsTrianglePath.__name__ = "openfl.display.GraphicsTrianglePath";
openfl_display_GraphicsTrianglePath.__interfaces__ = [openfl_display_IGraphicsPath,openfl_display_IGraphicsData];
openfl_display_GraphicsTrianglePath.prototype = {
	culling: null
	,indices: null
	,uvtData: null
	,vertices: null
	,__graphicsDataType: null
	,__class__: openfl_display_GraphicsTrianglePath
};
var openfl_display_InterpolationMethod = {};
openfl_display_InterpolationMethod.fromInt = function(value) {
	return value;
};
openfl_display_InterpolationMethod.fromString = function(value) {
	switch(value) {
	case "linearRGB":
		return 0;
	case "rgb":
		return 1;
	default:
		return null;
	}
};
openfl_display_InterpolationMethod.toInt = function(this1) {
	return this1;
};
openfl_display_InterpolationMethod.toString = function(this1) {
	switch(this1) {
	case 0:
		return "linearRGB";
	case 1:
		return "rgb";
	default:
		return null;
	}
};
var openfl_display_JPEGEncoderOptions = function(quality) {
	if(quality == null) {
		quality = 80;
	}
	this.quality = quality;
};
$hxClasses["openfl.display.JPEGEncoderOptions"] = openfl_display_JPEGEncoderOptions;
openfl_display_JPEGEncoderOptions.__name__ = "openfl.display.JPEGEncoderOptions";
openfl_display_JPEGEncoderOptions.prototype = {
	quality: null
	,__class__: openfl_display_JPEGEncoderOptions
};
var openfl_display_JointStyle = {};
openfl_display_JointStyle.fromInt = function(value) {
	return value;
};
openfl_display_JointStyle.fromString = function(value) {
	switch(value) {
	case "bevel":
		return 0;
	case "miter":
		return 1;
	case "round":
		return 2;
	default:
		return null;
	}
};
openfl_display_JointStyle.toInt = function(this1) {
	return this1;
};
openfl_display_JointStyle.toString = function(this1) {
	switch(this1) {
	case 0:
		return "bevel";
	case 1:
		return "miter";
	case 2:
		return "round";
	default:
		return null;
	}
};
var openfl_display_LineScaleMode = {};
openfl_display_LineScaleMode.fromInt = function(value) {
	return value;
};
openfl_display_LineScaleMode.fromString = function(value) {
	switch(value) {
	case "horizontal":
		return 0;
	case "none":
		return 1;
	case "normal":
		return 2;
	case "vertical":
		return 3;
	default:
		return null;
	}
};
openfl_display_LineScaleMode.toInt = function(this1) {
	return this1;
};
openfl_display_LineScaleMode.toString = function(this1) {
	switch(this1) {
	case 0:
		return "horizontal";
	case 1:
		return "none";
	case 2:
		return "normal";
	case 3:
		return "vertical";
	default:
		return null;
	}
};
var openfl_display_Loader = function() {
	openfl_display_DisplayObjectContainer.call(this);
	this.contentLoaderInfo = openfl_display_LoaderInfo.create(this);
	this.uncaughtErrorEvents = this.contentLoaderInfo.uncaughtErrorEvents;
	this.__unloaded = true;
};
$hxClasses["openfl.display.Loader"] = openfl_display_Loader;
openfl_display_Loader.__name__ = "openfl.display.Loader";
openfl_display_Loader.__super__ = openfl_display_DisplayObjectContainer;
openfl_display_Loader.prototype = $extend(openfl_display_DisplayObjectContainer.prototype,{
	content: null
	,contentLoaderInfo: null
	,uncaughtErrorEvents: null
	,__library: null
	,__path: null
	,__unloaded: null
	,close: function() {
		openfl__$internal_Lib.notImplemented({ fileName : "openfl/display/Loader.hx", lineNumber : 66, className : "openfl.display.Loader", methodName : "close"});
	}
	,load: function(request,context) {
		this.unload();
		this.contentLoaderInfo.loaderURL = openfl_Lib.get_current().get_loaderInfo().url;
		this.contentLoaderInfo.url = request.url;
		this.__unloaded = false;
		if(request.contentType == null || request.contentType == "") {
			var extension = "";
			this.__path = request.url;
			var queryIndex = this.__path.indexOf("?");
			if(queryIndex > -1) {
				this.__path = this.__path.substring(0,queryIndex);
			}
			while(StringTools.endsWith(this.__path,"/")) this.__path = this.__path.substring(0,this.__path.length - 1);
			if(StringTools.endsWith(this.__path,".bundle")) {
				this.__path += "/library.json";
				if(queryIndex > -1) {
					request.url = this.__path + request.url.substring(queryIndex);
				} else {
					request.url = this.__path;
				}
			}
			var extIndex = this.__path.lastIndexOf(".");
			if(extIndex > -1) {
				extension = this.__path.substring(extIndex + 1);
			}
			var tmp;
			switch(extension) {
			case "gif":
				tmp = "image/gif";
				break;
			case "jpeg":case "jpg":
				tmp = "image/jpeg";
				break;
			case "js":
				tmp = "application/javascript";
				break;
			case "json":
				tmp = "application/json";
				break;
			case "png":
				tmp = "image/png";
				break;
			case "swf":
				tmp = "application/x-shockwave-flash";
				break;
			default:
				tmp = "application/x-www-form-urlencoded";
			}
			this.contentLoaderInfo.contentType = tmp;
		} else {
			this.contentLoaderInfo.contentType = request.contentType;
		}
		if(this.contentLoaderInfo.contentType.indexOf("image/") > -1 && request.method == "GET" && (request.requestHeaders == null || request.requestHeaders.length == 0) && request.userAgent == null) {
			openfl_display_BitmapData.loadFromFile(request.url).onComplete($bind(this,this.BitmapData_onLoad)).onError($bind(this,this.BitmapData_onError)).onProgress($bind(this,this.BitmapData_onProgress));
			return;
		}
		var loader = new openfl_net_URLLoader();
		loader.dataFormat = 0;
		if(this.contentLoaderInfo.contentType.indexOf("/json") > -1 || this.contentLoaderInfo.contentType.indexOf("/javascript") > -1 || this.contentLoaderInfo.contentType.indexOf("/ecmascript") > -1) {
			loader.dataFormat = 1;
		}
		loader.addEventListener("complete",$bind(this,this.loader_onComplete));
		loader.addEventListener("ioError",$bind(this,this.loader_onError));
		loader.addEventListener("progress",$bind(this,this.loader_onProgress));
		loader.load(request);
	}
	,loadBytes: function(buffer,context) {
		openfl_display_BitmapData.loadFromBytes(buffer).onComplete($bind(this,this.BitmapData_onLoad)).onError($bind(this,this.BitmapData_onError));
	}
	,unload: function() {
		if(!this.__unloaded) {
			if(this.content != null && this.content.parent == this) {
				openfl_display_DisplayObjectContainer.prototype.removeChild.call(this,this.content);
			}
			if(this.__library != null) {
				openfl_utils_Assets.unloadLibrary(this.contentLoaderInfo.url);
				this.__library = null;
			}
			this.content = null;
			this.contentLoaderInfo.url = null;
			this.contentLoaderInfo.contentType = null;
			this.contentLoaderInfo.content = null;
			this.contentLoaderInfo.bytesLoaded = 0;
			this.contentLoaderInfo.bytesTotal = 0;
			this.contentLoaderInfo.width = 0;
			this.contentLoaderInfo.height = 0;
			this.__unloaded = true;
			this.contentLoaderInfo.dispatchEvent(new openfl_events_Event("unload"));
		}
	}
	,unloadAndStop: function(gc) {
		if(gc == null) {
			gc = true;
		}
		if(this.content != null) {
			this.content.__stopAllMovieClips();
		}
		var _g = 0;
		var _g1 = this.get_numChildren();
		while(_g < _g1) {
			var i = _g++;
			this.getChildAt(i).__stopAllMovieClips();
		}
		this.unload();
		var gc1 = gc;
	}
	,__dispatchError: function(text) {
		var event = new openfl_events_IOErrorEvent("ioError");
		event.text = text;
		this.contentLoaderInfo.dispatchEvent(event);
	}
	,__setContent: function(content,width,height) {
		this.content = content;
		this.contentLoaderInfo.content = content;
		this.contentLoaderInfo.width = width;
		this.contentLoaderInfo.height = height;
		if(content != null) {
			openfl_display_DisplayObjectContainer.prototype.addChildAt.call(this,content,0);
		}
	}
	,BitmapData_onError: function(error) {
		this.__dispatchError(Std.string(error));
	}
	,BitmapData_onLoad: function(bitmapData) {
		if(bitmapData == null) {
			this.__dispatchError("Unknown error");
			return;
		}
		this.__setContent(new openfl_display_Bitmap(bitmapData),bitmapData.width,bitmapData.height);
		this.contentLoaderInfo.dispatchEvent(new openfl_events_Event("complete"));
	}
	,BitmapData_onProgress: function(bytesLoaded,bytesTotal) {
		var event = new openfl_events_ProgressEvent("progress");
		event.bytesLoaded = bytesLoaded;
		event.bytesTotal = bytesTotal;
		this.contentLoaderInfo.dispatchEvent(event);
	}
	,loader_onComplete: function(event) {
		var _gthis = this;
		var loader = event.target;
		if(this.contentLoaderInfo.contentType != null && this.contentLoaderInfo.contentType.indexOf("/json") > -1) {
			var manifest = lime_utils_AssetManifest.parse(loader.data,haxe_io_Path.directory(this.__path));
			if(manifest == null) {
				this.__dispatchError("Cannot parse asset manifest");
				return;
			}
			var library = lime_utils_AssetLibrary.fromManifest(manifest);
			if(library == null) {
				this.__dispatchError("Cannot open library");
				return;
			}
			if(((library) instanceof openfl_utils_AssetLibrary)) {
				library.load().onComplete(function(_) {
					_gthis.__library = library;
					openfl_utils_Assets.registerLibrary(_gthis.contentLoaderInfo.url,_gthis.__library);
					if(manifest.name != null && !openfl_utils_Assets.hasLibrary(manifest.name)) {
						openfl_utils_Assets.registerLibrary(manifest.name,_gthis.__library);
					}
					var clip = _gthis.__library.getMovieClip("");
					_gthis.__setContent(clip,clip.get_width() | 0,clip.get_height() | 0);
					_gthis.contentLoaderInfo.dispatchEvent(new openfl_events_Event("complete"));
				}).onError(function(e) {
					_gthis.__dispatchError(e);
				});
			}
		} else if(this.contentLoaderInfo.contentType != null && (this.contentLoaderInfo.contentType.indexOf("/javascript") > -1 || this.contentLoaderInfo.contentType.indexOf("/ecmascript") > -1)) {
			this.__setContent(new openfl_display_Sprite(),0,0);
			eval("(function () {" + Std.string(loader.data) + "})()");
			this.contentLoaderInfo.dispatchEvent(new openfl_events_Event("complete"));
		} else {
			this.contentLoaderInfo.bytes = loader.data;
			openfl_display_BitmapData.loadFromBytes(loader.data).onComplete($bind(this,this.BitmapData_onLoad)).onError($bind(this,this.BitmapData_onError));
		}
	}
	,loader_onError: function(event) {
		event.target = this.contentLoaderInfo;
		this.contentLoaderInfo.dispatchEvent(event);
	}
	,loader_onProgress: function(event) {
		event.target = this.contentLoaderInfo;
		this.contentLoaderInfo.dispatchEvent(event);
	}
	,__class__: openfl_display_Loader
});
var openfl_display_LoaderInfo = function() {
	openfl_events_EventDispatcher.call(this);
	this.applicationDomain = openfl_system_ApplicationDomain.currentDomain;
	this.bytesLoaded = 0;
	this.bytesTotal = 0;
	this.childAllowsParent = true;
	this.parameters = { };
};
$hxClasses["openfl.display.LoaderInfo"] = openfl_display_LoaderInfo;
openfl_display_LoaderInfo.__name__ = "openfl.display.LoaderInfo";
openfl_display_LoaderInfo.create = function(loader) {
	var loaderInfo = new openfl_display_LoaderInfo();
	loaderInfo.uncaughtErrorEvents = new openfl_events_UncaughtErrorEvents();
	if(loader != null) {
		loaderInfo.loader = loader;
	} else {
		loaderInfo.url = openfl_display_LoaderInfo.__rootURL;
	}
	return loaderInfo;
};
openfl_display_LoaderInfo.__super__ = openfl_events_EventDispatcher;
openfl_display_LoaderInfo.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	applicationDomain: null
	,bytes: null
	,bytesLoaded: null
	,bytesTotal: null
	,childAllowsParent: null
	,content: null
	,contentType: null
	,frameRate: null
	,height: null
	,loader: null
	,loaderURL: null
	,parameters: null
	,parentAllowsChild: null
	,sameDomain: null
	,sharedEvents: null
	,uncaughtErrorEvents: null
	,url: null
	,width: null
	,__completed: null
	,__complete: function() {
		if(!this.__completed) {
			if(this.bytesLoaded < this.bytesTotal) {
				this.bytesLoaded = this.bytesTotal;
			}
			this.__update(this.bytesLoaded,this.bytesTotal);
			this.__completed = true;
			this.dispatchEvent(new openfl_events_Event("complete"));
		}
	}
	,__update: function(bytesLoaded,bytesTotal) {
		this.bytesLoaded = bytesLoaded;
		this.bytesTotal = bytesTotal;
		this.dispatchEvent(new openfl_events_ProgressEvent("progress",false,false,bytesLoaded,bytesTotal));
	}
	,__class__: openfl_display_LoaderInfo
});
var openfl_display_MovieClip = function() {
	openfl_display_Sprite.call(this);
	this.__enabled = true;
	if(openfl_display_MovieClip.__constructor != null) {
		var method = openfl_display_MovieClip.__constructor;
		openfl_display_MovieClip.__constructor = null;
		method(this);
	}
};
$hxClasses["openfl.display.MovieClip"] = openfl_display_MovieClip;
openfl_display_MovieClip.__name__ = "openfl.display.MovieClip";
openfl_display_MovieClip.__constructor = null;
openfl_display_MovieClip.fromTimeline = function(timeline) {
	var movieClip = new openfl_display_MovieClip();
	movieClip.attachTimeline(timeline);
	return movieClip;
};
openfl_display_MovieClip.__super__ = openfl_display_Sprite;
openfl_display_MovieClip.prototype = $extend(openfl_display_Sprite.prototype,{
	__enabled: null
	,__hasDown: null
	,__hasOver: null
	,__hasUp: null
	,__mouseIsDown: null
	,__scene: null
	,__timeline: null
	,addFrameScript: function(index,method) {
		if(this.__timeline != null) {
			this.__timeline.__addFrameScript(index,method);
		}
	}
	,attachTimeline: function(timeline) {
		this.__timeline = timeline;
		if(timeline != null) {
			timeline.__attachMovieClip(this);
			this.play();
		}
	}
	,gotoAndPlay: function(frame,scene) {
		if(this.__timeline != null) {
			this.__timeline.__gotoAndPlay(frame,scene);
		}
	}
	,gotoAndStop: function(frame,scene) {
		if(this.__timeline != null) {
			this.__timeline.__gotoAndStop(frame,scene);
		}
	}
	,nextFrame: function() {
		if(this.__timeline != null) {
			this.__timeline.__nextFrame();
		}
	}
	,nextScene: function() {
		if(this.__timeline != null) {
			this.__timeline.__nextScene();
		}
	}
	,play: function() {
		if(this.__timeline != null) {
			this.__timeline.__play();
		}
	}
	,prevFrame: function() {
		if(this.__timeline != null) {
			this.__timeline.__prevFrame();
		}
	}
	,prevScene: function() {
		if(this.__timeline != null) {
			this.__timeline.__prevScene();
		}
	}
	,stop: function() {
		if(this.__timeline != null) {
			this.__timeline.__stop();
		}
	}
	,__enterFrame: function(deltaTime) {
		if(this.__timeline != null) {
			this.__timeline.__enterFrame(deltaTime);
		}
		var _g = 0;
		var _g1 = this.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			child.__enterFrame(deltaTime);
		}
	}
	,__stopAllMovieClips: function() {
		openfl_display_Sprite.prototype.__stopAllMovieClips.call(this);
		this.stop();
	}
	,__tabTest: function(stack) {
		if(!this.__enabled) {
			return;
		}
		openfl_display_Sprite.prototype.__tabTest.call(this,stack);
	}
	,__onMouseDown: function(event) {
		if(this.__enabled && this.__hasDown) {
			this.gotoAndStop("_down");
		}
		this.__mouseIsDown = true;
		this.stage.addEventListener("mouseUp",$bind(this,this.__onMouseUp),true);
	}
	,__onMouseUp: function(event) {
		this.__mouseIsDown = false;
		if(this.stage != null) {
			this.stage.removeEventListener("mouseUp",$bind(this,this.__onMouseUp));
		}
		if(!this.__buttonMode) {
			return;
		}
		if(event.target == this && this.__enabled && this.__hasOver) {
			this.gotoAndStop("_over");
		} else if(this.__enabled && this.__hasUp) {
			this.gotoAndStop("_up");
		}
	}
	,__onRollOut: function(event) {
		if(!this.__enabled) {
			return;
		}
		if(this.__mouseIsDown && this.__hasOver) {
			this.gotoAndStop("_over");
		} else if(this.__hasUp) {
			this.gotoAndStop("_up");
		}
	}
	,__onRollOver: function(event) {
		if(this.__enabled && this.__hasOver) {
			this.gotoAndStop("_over");
		}
	}
	,set_buttonMode: function(value) {
		if(this.__buttonMode != value) {
			if(value) {
				this.__hasDown = false;
				this.__hasOver = false;
				this.__hasUp = false;
				var _g = 0;
				var _g1 = this.get_currentLabels();
				while(_g < _g1.length) {
					var frameLabel = _g1[_g];
					++_g;
					switch(frameLabel.name) {
					case "_down":
						this.__hasDown = true;
						break;
					case "_over":
						this.__hasOver = true;
						break;
					case "_up":
						this.__hasUp = true;
						break;
					default:
					}
				}
				if(this.__hasDown || this.__hasOver || this.__hasUp) {
					this.addEventListener("rollOver",$bind(this,this.__onRollOver));
					this.addEventListener("rollOut",$bind(this,this.__onRollOut));
					this.addEventListener("mouseDown",$bind(this,this.__onMouseDown));
				}
			} else {
				this.removeEventListener("rollOver",$bind(this,this.__onRollOver));
				this.removeEventListener("rollOut",$bind(this,this.__onRollOut));
				this.removeEventListener("mouseDown",$bind(this,this.__onMouseDown));
			}
			this.__buttonMode = value;
		}
		return value;
	}
	,get_currentFrame: function() {
		if(this.__timeline != null) {
			return this.__timeline.__currentFrame;
		} else {
			return 1;
		}
	}
	,get_currentFrameLabel: function() {
		if(this.__timeline != null) {
			return this.__timeline.__currentFrameLabel;
		} else {
			return null;
		}
	}
	,get_currentLabel: function() {
		if(this.__timeline != null) {
			return this.__timeline.__currentLabel;
		} else {
			return null;
		}
	}
	,get_currentLabels: function() {
		if(this.__timeline != null) {
			return this.__timeline.__currentLabels.slice();
		} else {
			return [];
		}
	}
	,get_currentScene: function() {
		if(this.__timeline != null) {
			return this.__timeline.__currentScene;
		} else {
			if(this.__scene == null) {
				this.__scene = new openfl_display_Scene("",[],1);
			}
			return this.__scene;
		}
	}
	,get_enabled: function() {
		return this.__enabled;
	}
	,set_enabled: function(value) {
		return this.__enabled = value;
	}
	,get_framesLoaded: function() {
		if(this.__timeline != null) {
			return this.__timeline.__framesLoaded;
		} else {
			return 1;
		}
	}
	,get_isPlaying: function() {
		if(this.__timeline != null) {
			return this.__timeline.__isPlaying;
		} else {
			return false;
		}
	}
	,get_scenes: function() {
		if(this.__timeline != null) {
			return this.__timeline.scenes.slice();
		} else {
			return [this.get_currentScene()];
		}
	}
	,get_totalFrames: function() {
		if(this.__timeline != null) {
			return this.__timeline.__totalFrames;
		} else {
			return 1;
		}
	}
	,__class__: openfl_display_MovieClip
	,__properties__: $extend(openfl_display_Sprite.prototype.__properties__,{get_totalFrames:"get_totalFrames",get_scenes:"get_scenes",get_isPlaying:"get_isPlaying",get_framesLoaded:"get_framesLoaded",set_enabled:"set_enabled",get_enabled:"get_enabled",get_currentScene:"get_currentScene",get_currentLabels:"get_currentLabels",get_currentLabel:"get_currentLabel",get_currentFrameLabel:"get_currentFrameLabel",get_currentFrame:"get_currentFrame"})
});
var openfl_display_OpenGLRenderer = function(context,defaultRenderTarget) {
	openfl_display_DisplayObjectRenderer.call(this);
	this.__context3D = context;
	this.__context = context.__context;
	this.gl = context.__context.webgl;
	this.__gl = this.gl;
	this.__defaultRenderTarget = defaultRenderTarget;
	this.__flipped = this.__defaultRenderTarget == null;
	if(openfl_display_Graphics.maxTextureWidth == null) {
		openfl_display_Graphics.maxTextureWidth = openfl_display_Graphics.maxTextureHeight = this.__gl.getParameter(this.__gl.MAX_TEXTURE_SIZE);
	}
	this.__matrix = lime_math_Matrix4._new();
	this.__values = [];
	this.__softwareRenderer = new openfl_display_CanvasRenderer(null);
	this.__type = "opengl";
	this.__setBlendMode(10);
	this.__context3D.__setGLBlend(true);
	this.__clipRects = [];
	this.__maskObjects = [];
	this.__numClipRects = 0;
	this.__projection = lime_math_Matrix4._new();
	this.__projectionFlipped = lime_math_Matrix4._new();
	this.__stencilReference = 0;
	this.__tempRect = new openfl_geom_Rectangle();
	this.__defaultDisplayShader = new openfl_display_DisplayObjectShader();
	this.__defaultGraphicsShader = new openfl_display_GraphicsShader();
	this.__defaultShader = this.__defaultDisplayShader;
	this.__initShader(this.__defaultShader);
	this.__scrollRectMasks = new lime_utils_ObjectPool(function() {
		return new openfl_display_Shape();
	});
	this.__maskShader = new openfl_display__$internal_Context3DMaskShader();
};
$hxClasses["openfl.display.OpenGLRenderer"] = openfl_display_OpenGLRenderer;
openfl_display_OpenGLRenderer.__name__ = "openfl.display.OpenGLRenderer";
openfl_display_OpenGLRenderer.__super__ = openfl_display_DisplayObjectRenderer;
openfl_display_OpenGLRenderer.prototype = $extend(openfl_display_DisplayObjectRenderer.prototype,{
	gl: null
	,__context3D: null
	,__clipRects: null
	,__currentDisplayShader: null
	,__currentGraphicsShader: null
	,__currentRenderTarget: null
	,__currentShader: null
	,__currentShaderBuffer: null
	,__defaultDisplayShader: null
	,__defaultGraphicsShader: null
	,__defaultRenderTarget: null
	,__defaultShader: null
	,__displayHeight: null
	,__displayWidth: null
	,__flipped: null
	,__gl: null
	,__height: null
	,__maskShader: null
	,__matrix: null
	,__maskObjects: null
	,__numClipRects: null
	,__offsetX: null
	,__offsetY: null
	,__projection: null
	,__projectionFlipped: null
	,__scrollRectMasks: null
	,__softwareRenderer: null
	,__stencilReference: null
	,__tempRect: null
	,__updatedStencil: null
	,__upscaled: null
	,__values: null
	,__width: null
	,applyAlpha: function(alpha) {
		openfl_display_OpenGLRenderer.__alphaValue[0] = alpha;
		if(this.__currentShaderBuffer != null) {
			this.__currentShaderBuffer.addFloatOverride("openfl_Alpha",openfl_display_OpenGLRenderer.__alphaValue);
		} else if(this.__currentShader != null) {
			if(this.__currentShader.__alpha != null) {
				this.__currentShader.__alpha.value = openfl_display_OpenGLRenderer.__alphaValue;
			}
		}
	}
	,applyBitmapData: function(bitmapData,smooth,repeat) {
		if(repeat == null) {
			repeat = false;
		}
		if(this.__currentShaderBuffer != null) {
			if(bitmapData != null) {
				openfl_display_OpenGLRenderer.__textureSizeValue[0] = bitmapData.__textureWidth;
				openfl_display_OpenGLRenderer.__textureSizeValue[1] = bitmapData.__textureHeight;
				this.__currentShaderBuffer.addFloatOverride("openfl_TextureSize",openfl_display_OpenGLRenderer.__textureSizeValue);
			}
		} else if(this.__currentShader != null) {
			if(this.__currentShader.__bitmap != null) {
				this.__currentShader.__bitmap.input = bitmapData;
				this.__currentShader.__bitmap.filter = smooth && this.__allowSmoothing ? 4 : 5;
				this.__currentShader.__bitmap.mipFilter = 2;
				this.__currentShader.__bitmap.wrap = repeat ? 2 : 0;
			}
			if(this.__currentShader.__texture != null) {
				this.__currentShader.__texture.input = bitmapData;
				this.__currentShader.__texture.filter = smooth && this.__allowSmoothing ? 4 : 5;
				this.__currentShader.__texture.mipFilter = 2;
				this.__currentShader.__texture.wrap = repeat ? 2 : 0;
			}
			if(this.__currentShader.__textureSize != null) {
				if(bitmapData != null) {
					openfl_display_OpenGLRenderer.__textureSizeValue[0] = bitmapData.__textureWidth;
					openfl_display_OpenGLRenderer.__textureSizeValue[1] = bitmapData.__textureHeight;
					this.__currentShader.__textureSize.value = openfl_display_OpenGLRenderer.__textureSizeValue;
				} else {
					this.__currentShader.__textureSize.value = null;
				}
			}
		}
	}
	,applyColorTransform: function(colorTransform) {
		var enabled = colorTransform != null && !colorTransform.__isDefault(true);
		this.applyHasColorTransform(enabled);
		if(enabled) {
			colorTransform.__setArrays(openfl_display_OpenGLRenderer.__colorMultipliersValue,openfl_display_OpenGLRenderer.__colorOffsetsValue);
			if(this.__currentShaderBuffer != null) {
				this.__currentShaderBuffer.addFloatOverride("openfl_ColorMultiplier",openfl_display_OpenGLRenderer.__colorMultipliersValue);
				this.__currentShaderBuffer.addFloatOverride("openfl_ColorOffset",openfl_display_OpenGLRenderer.__colorOffsetsValue);
			} else if(this.__currentShader != null) {
				if(this.__currentShader.__colorMultiplier != null) {
					this.__currentShader.__colorMultiplier.value = openfl_display_OpenGLRenderer.__colorMultipliersValue;
				}
				if(this.__currentShader.__colorOffset != null) {
					this.__currentShader.__colorOffset.value = openfl_display_OpenGLRenderer.__colorOffsetsValue;
				}
			}
		} else if(this.__currentShaderBuffer != null) {
			this.__currentShaderBuffer.addFloatOverride("openfl_ColorMultiplier",openfl_display_OpenGLRenderer.__emptyColorValue);
			this.__currentShaderBuffer.addFloatOverride("openfl_ColorOffset",openfl_display_OpenGLRenderer.__emptyColorValue);
		} else if(this.__currentShader != null) {
			if(this.__currentShader.__colorMultiplier != null) {
				this.__currentShader.__colorMultiplier.value = openfl_display_OpenGLRenderer.__emptyColorValue;
			}
			if(this.__currentShader.__colorOffset != null) {
				this.__currentShader.__colorOffset.value = openfl_display_OpenGLRenderer.__emptyColorValue;
			}
		}
	}
	,applyHasColorTransform: function(enabled) {
		openfl_display_OpenGLRenderer.__hasColorTransformValue[0] = enabled;
		if(this.__currentShaderBuffer != null) {
			this.__currentShaderBuffer.addBoolOverride("openfl_HasColorTransform",openfl_display_OpenGLRenderer.__hasColorTransformValue);
		} else if(this.__currentShader != null) {
			if(this.__currentShader.__hasColorTransform != null) {
				this.__currentShader.__hasColorTransform.value = openfl_display_OpenGLRenderer.__hasColorTransformValue;
			}
		}
	}
	,applyMatrix: function(matrix) {
		if(this.__currentShaderBuffer != null) {
			this.__currentShaderBuffer.addFloatOverride("openfl_Matrix",matrix);
		} else if(this.__currentShader != null) {
			if(this.__currentShader.__matrix != null) {
				this.__currentShader.__matrix.value = matrix;
			}
		}
	}
	,getMatrix: function(transform) {
		if(this.gl != null) {
			var values = this.__getMatrix(transform,1);
			lime_math_Matrix4.set(this.__matrix,0,values[0]);
			lime_math_Matrix4.set(this.__matrix,1,values[1]);
			lime_math_Matrix4.set(this.__matrix,2,values[2]);
			lime_math_Matrix4.set(this.__matrix,3,values[3]);
			lime_math_Matrix4.set(this.__matrix,4,values[4]);
			lime_math_Matrix4.set(this.__matrix,5,values[5]);
			lime_math_Matrix4.set(this.__matrix,6,values[6]);
			lime_math_Matrix4.set(this.__matrix,7,values[7]);
			lime_math_Matrix4.set(this.__matrix,8,values[8]);
			lime_math_Matrix4.set(this.__matrix,9,values[9]);
			lime_math_Matrix4.set(this.__matrix,10,values[10]);
			lime_math_Matrix4.set(this.__matrix,11,values[11]);
			lime_math_Matrix4.set(this.__matrix,12,values[12]);
			lime_math_Matrix4.set(this.__matrix,13,values[13]);
			lime_math_Matrix4.set(this.__matrix,14,values[14]);
			lime_math_Matrix4.set(this.__matrix,15,values[15]);
			return this.__matrix;
		} else {
			lime_math_Matrix4.identity(this.__matrix);
			lime_math_Matrix4.set(this.__matrix,0,transform.a);
			lime_math_Matrix4.set(this.__matrix,1,transform.b);
			lime_math_Matrix4.set(this.__matrix,4,transform.c);
			lime_math_Matrix4.set(this.__matrix,5,transform.d);
			lime_math_Matrix4.set(this.__matrix,12,transform.tx);
			lime_math_Matrix4.set(this.__matrix,13,transform.ty);
			return this.__matrix;
		}
	}
	,setShader: function(shader) {
		this.__currentShaderBuffer = null;
		if(this.__currentShader == shader) {
			return;
		}
		var tmp = this.__currentShader != null;
		if(shader == null) {
			this.__currentShader = null;
			this.__context3D.setProgram(null);
			return;
		} else {
			this.__currentShader = shader;
			this.__initShader(shader);
			this.__context3D.setProgram(shader.program);
			this.__context3D.__flushGLProgram();
			this.__currentShader.__enable();
			this.__context3D.__state.shader = shader;
		}
	}
	,setViewport: function() {
		this.__gl.viewport(this.__offsetX,this.__offsetY,this.__displayWidth,this.__displayHeight);
	}
	,updateShader: function() {
		if(this.__currentShader != null) {
			if(this.__currentShader.__position != null) {
				this.__currentShader.__position.__useArray = true;
			}
			if(this.__currentShader.__textureCoord != null) {
				this.__currentShader.__textureCoord.__useArray = true;
			}
			this.__context3D.setProgram(this.__currentShader.program);
			this.__context3D.__flushGLProgram();
			this.__context3D.__flushGLTextures();
			this.__currentShader.__update();
		}
	}
	,useAlphaArray: function() {
		if(this.__currentShader != null) {
			if(this.__currentShader.__alpha != null) {
				this.__currentShader.__alpha.__useArray = true;
			}
		}
	}
	,useColorTransformArray: function() {
		if(this.__currentShader != null) {
			if(this.__currentShader.__colorMultiplier != null) {
				this.__currentShader.__colorMultiplier.__useArray = true;
			}
			if(this.__currentShader.__colorOffset != null) {
				this.__currentShader.__colorOffset.__useArray = true;
			}
		}
	}
	,__cleanup: function() {
		if(this.__stencilReference > 0) {
			this.__stencilReference = 0;
			this.__context3D.setStencilActions();
			this.__context3D.setStencilReferenceValue(0,0,0);
		}
		if(this.__numClipRects > 0) {
			this.__numClipRects = 0;
			this.__scissorRect();
		}
	}
	,__clear: function() {
		if(this.__stage == null || this.__stage.__transparent) {
			this.__context3D.clear(0,0,0,0,0,0,1);
		} else {
			this.__context3D.clear(this.__stage.__colorSplit[0],this.__stage.__colorSplit[1],this.__stage.__colorSplit[2],1,0,0,1);
		}
		this.__cleared = true;
	}
	,__clearShader: function() {
		if(this.__currentShader != null) {
			if(this.__currentShaderBuffer == null) {
				if(this.__currentShader.__bitmap != null) {
					this.__currentShader.__bitmap.input = null;
				}
			} else {
				this.__currentShaderBuffer.clearOverride();
			}
			if(this.__currentShader.__texture != null) {
				this.__currentShader.__texture.input = null;
			}
			if(this.__currentShader.__textureSize != null) {
				this.__currentShader.__textureSize.value = null;
			}
			if(this.__currentShader.__hasColorTransform != null) {
				this.__currentShader.__hasColorTransform.value = null;
			}
			if(this.__currentShader.__position != null) {
				this.__currentShader.__position.value = null;
			}
			if(this.__currentShader.__matrix != null) {
				this.__currentShader.__matrix.value = null;
			}
			this.__currentShader.__clearUseArray();
		}
	}
	,__copyShader: function(other) {
		this.__currentShader = other.__currentShader;
		this.__currentShaderBuffer = other.__currentShaderBuffer;
		this.__currentDisplayShader = other.__currentDisplayShader;
		this.__currentGraphicsShader = other.__currentGraphicsShader;
	}
	,__getMatrix: function(transform,pixelSnapping) {
		var _matrix = openfl_geom_Matrix.__pool.get();
		_matrix.copyFrom(transform);
		_matrix.concat(this.__worldTransform);
		if(pixelSnapping == 0 || pixelSnapping == 1 && _matrix.b == 0 && _matrix.c == 0 && (_matrix.a < 1.001 && _matrix.a > 0.999) && (_matrix.d < 1.001 && _matrix.d > 0.999)) {
			_matrix.tx = Math.round(_matrix.tx);
			_matrix.ty = Math.round(_matrix.ty);
		}
		lime_math_Matrix4.identity(this.__matrix);
		lime_math_Matrix4.set(this.__matrix,0,_matrix.a);
		lime_math_Matrix4.set(this.__matrix,1,_matrix.b);
		lime_math_Matrix4.set(this.__matrix,4,_matrix.c);
		lime_math_Matrix4.set(this.__matrix,5,_matrix.d);
		lime_math_Matrix4.set(this.__matrix,12,_matrix.tx);
		lime_math_Matrix4.set(this.__matrix,13,_matrix.ty);
		lime_math_Matrix4.append(this.__matrix,this.__flipped ? this.__projectionFlipped : this.__projection);
		this.__values[0] = lime_math_Matrix4.get(this.__matrix,0);
		this.__values[1] = lime_math_Matrix4.get(this.__matrix,1);
		this.__values[2] = lime_math_Matrix4.get(this.__matrix,2);
		this.__values[3] = lime_math_Matrix4.get(this.__matrix,3);
		this.__values[4] = lime_math_Matrix4.get(this.__matrix,4);
		this.__values[5] = lime_math_Matrix4.get(this.__matrix,5);
		this.__values[6] = lime_math_Matrix4.get(this.__matrix,6);
		this.__values[7] = lime_math_Matrix4.get(this.__matrix,7);
		this.__values[8] = lime_math_Matrix4.get(this.__matrix,8);
		this.__values[9] = lime_math_Matrix4.get(this.__matrix,9);
		this.__values[10] = lime_math_Matrix4.get(this.__matrix,10);
		this.__values[11] = lime_math_Matrix4.get(this.__matrix,11);
		this.__values[12] = lime_math_Matrix4.get(this.__matrix,12);
		this.__values[13] = lime_math_Matrix4.get(this.__matrix,13);
		this.__values[14] = lime_math_Matrix4.get(this.__matrix,14);
		this.__values[15] = lime_math_Matrix4.get(this.__matrix,15);
		openfl_geom_Matrix.__pool.release(_matrix);
		return this.__values;
	}
	,__initShader: function(shader) {
		if(shader != null) {
			if(shader.__context == null) {
				shader.__context = this.__context3D;
				shader.__init();
			}
			return shader;
		}
		return this.__defaultShader;
	}
	,__initDisplayShader: function(shader) {
		if(shader != null) {
			if(shader.__context == null) {
				shader.__context = this.__context3D;
				shader.__init();
			}
			return shader;
		}
		return this.__defaultDisplayShader;
	}
	,__initGraphicsShader: function(shader) {
		if(shader != null) {
			if(shader.__context == null) {
				shader.__context = this.__context3D;
				shader.__init();
			}
			return shader;
		}
		return this.__defaultGraphicsShader;
	}
	,__initShaderBuffer: function(shaderBuffer) {
		if(shaderBuffer != null) {
			return this.__initGraphicsShader(shaderBuffer.shader);
		}
		return this.__defaultGraphicsShader;
	}
	,__popMask: function() {
		if(this.__stencilReference == 0) {
			return;
		}
		var mask = this.__maskObjects.pop();
		if(this.__stencilReference > 1) {
			this.__context3D.setStencilActions(2,1,0,0,5);
			this.__context3D.setStencilReferenceValue(this.__stencilReference,255,255);
			this.__context3D.setColorMask(false,false,false,false);
			mask.__renderGLMask(this);
			this.__stencilReference--;
			this.__context3D.setStencilActions(2,1,5,5,5);
			this.__context3D.setStencilReferenceValue(this.__stencilReference,255,0);
			this.__context3D.setColorMask(true,true,true,true);
		} else {
			this.__stencilReference = 0;
			this.__context3D.setStencilActions();
			this.__context3D.setStencilReferenceValue(0,0,0);
		}
	}
	,__popMaskObject: function(object,handleScrollRect) {
		if(handleScrollRect == null) {
			handleScrollRect = true;
		}
		if(object.__mask != null) {
			this.__popMask();
		}
		if(handleScrollRect && object.__scrollRect != null) {
			if(object.__renderTransform.b != 0 || object.__renderTransform.c != 0) {
				this.__scrollRectMasks.release(this.__maskObjects[this.__maskObjects.length - 1]);
				this.__popMask();
			} else {
				this.__popMaskRect();
			}
		}
	}
	,__popMaskRect: function() {
		if(this.__numClipRects > 0) {
			this.__numClipRects--;
			if(this.__numClipRects > 0) {
				this.__scissorRect(this.__clipRects[this.__numClipRects - 1]);
			} else {
				this.__scissorRect();
			}
		}
	}
	,__pushMask: function(mask) {
		if(this.__stencilReference == 0) {
			this.__context3D.clear(0,0,0,0,0,0,4);
			this.__updatedStencil = true;
		}
		this.__context3D.setStencilActions(2,1,2,5,5);
		this.__context3D.setStencilReferenceValue(this.__stencilReference,255,255);
		this.__context3D.setColorMask(false,false,false,false);
		mask.__renderGLMask(this);
		this.__maskObjects.push(mask);
		this.__stencilReference++;
		this.__context3D.setStencilActions(2,1,5,5,5);
		this.__context3D.setStencilReferenceValue(this.__stencilReference,255,0);
		this.__context3D.setColorMask(true,true,true,true);
	}
	,__pushMaskObject: function(object,handleScrollRect) {
		if(handleScrollRect == null) {
			handleScrollRect = true;
		}
		if(handleScrollRect && object.__scrollRect != null) {
			if(object.__renderTransform.b != 0 || object.__renderTransform.c != 0) {
				var shape = this.__scrollRectMasks.get();
				shape.get_graphics().clear();
				shape.get_graphics().beginFill(65280);
				shape.get_graphics().drawRect(object.__scrollRect.x,object.__scrollRect.y,object.__scrollRect.width,object.__scrollRect.height);
				shape.__renderTransform.copyFrom(object.__renderTransform);
				this.__pushMask(shape);
			} else {
				this.__pushMaskRect(object.__scrollRect,object.__renderTransform);
			}
		}
		if(object.__mask != null) {
			this.__pushMask(object.__mask);
		}
	}
	,__pushMaskRect: function(rect,transform) {
		if(this.__numClipRects == this.__clipRects.length) {
			this.__clipRects[this.__numClipRects] = new openfl_geom_Rectangle();
		}
		var _matrix = openfl_geom_Matrix.__pool.get();
		_matrix.copyFrom(transform);
		_matrix.concat(this.__worldTransform);
		var clipRect = this.__clipRects[this.__numClipRects];
		rect.__transform(clipRect,_matrix);
		if(this.__numClipRects > 0) {
			var parentClipRect = this.__clipRects[this.__numClipRects - 1];
			clipRect.__contract(parentClipRect.x,parentClipRect.y,parentClipRect.width,parentClipRect.height);
		}
		if(clipRect.height < 0) {
			clipRect.height = 0;
		}
		if(clipRect.width < 0) {
			clipRect.width = 0;
		}
		openfl_geom_Matrix.__pool.release(_matrix);
		this.__scissorRect(clipRect);
		this.__numClipRects++;
	}
	,__render: function(object) {
		this.__context3D.setColorMask(true,true,true,true);
		this.__context3D.setCulling(3);
		this.__context3D.setDepthTest(false,0);
		this.__context3D.setStencilActions();
		this.__context3D.setStencilReferenceValue(0,0,0);
		this.__context3D.setScissorRectangle(null);
		this.__blendMode = null;
		this.__setBlendMode(10);
		if(this.__defaultRenderTarget == null) {
			openfl_display_OpenGLRenderer.__scissorRectangle.setTo(this.__offsetX,this.__offsetY,this.__displayWidth,this.__displayHeight);
			this.__context3D.setScissorRectangle(openfl_display_OpenGLRenderer.__scissorRectangle);
			this.__upscaled = this.__worldTransform.a != 1 || this.__worldTransform.d != 1;
			object.__renderGL(this);
			if(this.__offsetX > 0 || this.__offsetY > 0) {
				if(this.__offsetX > 0) {
					openfl_display_OpenGLRenderer.__scissorRectangle.setTo(0,0,this.__offsetX,this.__height);
					this.__context3D.setScissorRectangle(openfl_display_OpenGLRenderer.__scissorRectangle);
					this.__context3D.__flushGL();
					this.__gl.clearColor(0,0,0,1);
					this.__gl.clear(this.__gl.COLOR_BUFFER_BIT);
					openfl_display_OpenGLRenderer.__scissorRectangle.setTo(this.__offsetX + this.__displayWidth,0,this.__width,this.__height);
					this.__context3D.setScissorRectangle(openfl_display_OpenGLRenderer.__scissorRectangle);
					this.__context3D.__flushGL();
					this.__gl.clearColor(0,0,0,1);
					this.__gl.clear(this.__gl.COLOR_BUFFER_BIT);
				}
				if(this.__offsetY > 0) {
					openfl_display_OpenGLRenderer.__scissorRectangle.setTo(0,0,this.__width,this.__offsetY);
					this.__context3D.setScissorRectangle(openfl_display_OpenGLRenderer.__scissorRectangle);
					this.__context3D.__flushGL();
					this.__gl.clearColor(0,0,0,1);
					this.__gl.clear(this.__gl.COLOR_BUFFER_BIT);
					openfl_display_OpenGLRenderer.__scissorRectangle.setTo(0,this.__offsetY + this.__displayHeight,this.__width,this.__height);
					this.__context3D.setScissorRectangle(openfl_display_OpenGLRenderer.__scissorRectangle);
					this.__context3D.__flushGL();
					this.__gl.clearColor(0,0,0,1);
					this.__gl.clear(this.__gl.COLOR_BUFFER_BIT);
				}
				this.__context3D.setScissorRectangle(null);
			}
		} else {
			openfl_display_OpenGLRenderer.__scissorRectangle.setTo(this.__offsetX,this.__offsetY,this.__displayWidth,this.__displayHeight);
			this.__context3D.setScissorRectangle(openfl_display_OpenGLRenderer.__scissorRectangle);
			var cacheMask = object.__mask;
			var cacheScrollRect = object.__scrollRect;
			object.__mask = null;
			object.__scrollRect = null;
			object.__renderGL(this);
			object.__mask = cacheMask;
			object.__scrollRect = cacheScrollRect;
		}
		this.__context3D.present();
	}
	,__renderFilterPass: function(source,shader,smooth,clear) {
		if(clear == null) {
			clear = true;
		}
		if(source == null || shader == null) {
			return;
		}
		if(this.__defaultRenderTarget == null) {
			return;
		}
		var cacheRTT = this.__context3D.__state.renderToTexture;
		var cacheRTTDepthStencil = this.__context3D.__state.renderToTextureDepthStencil;
		var cacheRTTAntiAlias = this.__context3D.__state.renderToTextureAntiAlias;
		var cacheRTTSurfaceSelector = this.__context3D.__state.renderToTextureSurfaceSelector;
		this.__context3D.setRenderToTexture(this.__defaultRenderTarget.getTexture(this.__context3D),false);
		if(clear) {
			this.__context3D.clear(0,0,0,0,0,0,1);
		}
		var shader1 = this.__initShader(shader);
		this.setShader(shader1);
		this.applyAlpha(1);
		this.applyBitmapData(source,smooth);
		this.applyColorTransform(null);
		this.applyMatrix(this.__getMatrix(source.__renderTransform,1));
		this.updateShader();
		var vertexBuffer = source.getVertexBuffer(this.__context3D);
		if(shader1.__position != null) {
			this.__context3D.setVertexBufferAt(shader1.__position.index,vertexBuffer,0,3);
		}
		if(shader1.__textureCoord != null) {
			this.__context3D.setVertexBufferAt(shader1.__textureCoord.index,vertexBuffer,3,2);
		}
		var indexBuffer = source.getIndexBuffer(this.__context3D);
		this.__context3D.drawTriangles(indexBuffer);
		if(cacheRTT != null) {
			this.__context3D.setRenderToTexture(cacheRTT,cacheRTTDepthStencil,cacheRTTAntiAlias,cacheRTTSurfaceSelector);
		} else {
			this.__context3D.setRenderToBackBuffer();
		}
		this.__clearShader();
	}
	,__resize: function(width,height) {
		this.__width = width;
		this.__height = height;
		var w = this.__defaultRenderTarget == null ? this.__stage.stageWidth : this.__defaultRenderTarget.width;
		var h = this.__defaultRenderTarget == null ? this.__stage.stageHeight : this.__defaultRenderTarget.height;
		var tmp;
		if(this.__defaultRenderTarget == null) {
			var _this = this.__worldTransform;
			tmp = Math.round(0 * _this.a + 0 * _this.c + _this.tx);
		} else {
			tmp = 0;
		}
		this.__offsetX = tmp;
		var tmp;
		if(this.__defaultRenderTarget == null) {
			var _this = this.__worldTransform;
			tmp = Math.round(0 * _this.b + 0 * _this.d + _this.ty);
		} else {
			tmp = 0;
		}
		this.__offsetY = tmp;
		var tmp;
		if(this.__defaultRenderTarget == null) {
			var _this = this.__worldTransform;
			tmp = Math.round(w * _this.a + 0 * _this.c + _this.tx - this.__offsetX);
		} else {
			tmp = w;
		}
		this.__displayWidth = tmp;
		var tmp;
		if(this.__defaultRenderTarget == null) {
			var _this = this.__worldTransform;
			tmp = Math.round(0 * _this.b + h * _this.d + _this.ty - this.__offsetY);
		} else {
			tmp = h;
		}
		this.__displayHeight = tmp;
		lime_math_Matrix4.createOrtho(this.__projection,0,this.__displayWidth + this.__offsetX * 2,0,this.__displayHeight + this.__offsetY * 2,-1000,1000);
		lime_math_Matrix4.createOrtho(this.__projectionFlipped,0,this.__displayWidth + this.__offsetX * 2,this.__displayHeight + this.__offsetY * 2,0,-1000,1000);
	}
	,__resumeClipAndMask: function(childRenderer) {
		if(this.__stencilReference > 0) {
			this.__context3D.setStencilActions(2,1,5,5,5);
			this.__context3D.setStencilReferenceValue(this.__stencilReference,255,0);
		} else {
			this.__context3D.setStencilActions();
			this.__context3D.setStencilReferenceValue(0,0,0);
		}
		if(this.__numClipRects > 0) {
			this.__scissorRect(this.__clipRects[this.__numClipRects - 1]);
		} else {
			this.__scissorRect();
		}
	}
	,__scissorRect: function(clipRect) {
		if(clipRect != null) {
			var x = Math.floor(clipRect.x);
			var y = Math.floor(clipRect.y);
			var width = clipRect.width > 0 ? Math.ceil(clipRect.get_right()) - x : 0;
			var height = clipRect.height > 0 ? Math.ceil(clipRect.get_bottom()) - y : 0;
			if(width < 0) {
				width = 0;
			}
			if(height < 0) {
				height = 0;
			}
			openfl_display_OpenGLRenderer.__scissorRectangle.setTo(x,y,width,height);
			this.__context3D.setScissorRectangle(openfl_display_OpenGLRenderer.__scissorRectangle);
		} else {
			this.__context3D.setScissorRectangle(null);
		}
	}
	,__setBlendMode: function(value) {
		if(this.__overrideBlendMode != null) {
			value = this.__overrideBlendMode;
		}
		if(this.__blendMode == value) {
			return;
		}
		this.__blendMode = value;
		switch(value) {
		case 0:
			this.__context3D.setBlendFactors(2,2);
			break;
		case 9:
			this.__context3D.setBlendFactors(1,5);
			break;
		case 12:
			this.__context3D.setBlendFactors(2,6);
			break;
		case 14:
			this.__context3D.setBlendFactors(2,2);
			this.__context3D.__setGLBlendEquation(this.__gl.FUNC_REVERSE_SUBTRACT);
			break;
		default:
			this.__context3D.setBlendFactors(2,5);
		}
	}
	,__setRenderTarget: function(renderTarget) {
		this.__defaultRenderTarget = renderTarget;
		this.__flipped = renderTarget == null;
		if(renderTarget != null) {
			this.__resize(renderTarget.width,renderTarget.height);
		}
	}
	,__setShaderBuffer: function(shaderBuffer) {
		this.setShader(shaderBuffer.shader);
		this.__currentShaderBuffer = shaderBuffer;
	}
	,__suspendClipAndMask: function() {
		if(this.__stencilReference > 0) {
			this.__context3D.setStencilActions();
			this.__context3D.setStencilReferenceValue(0,0,0);
		}
		if(this.__numClipRects > 0) {
			this.__scissorRect();
		}
	}
	,__updateShaderBuffer: function(bufferOffset) {
		if(this.__currentShader != null && this.__currentShaderBuffer != null) {
			this.__currentShader.__updateFromBuffer(this.__currentShaderBuffer,bufferOffset);
		}
	}
	,__class__: openfl_display_OpenGLRenderer
});
var openfl_display_PNGEncoderOptions = function(fastCompression) {
	if(fastCompression == null) {
		fastCompression = false;
	}
	this.fastCompression = fastCompression;
};
$hxClasses["openfl.display.PNGEncoderOptions"] = openfl_display_PNGEncoderOptions;
openfl_display_PNGEncoderOptions.__name__ = "openfl.display.PNGEncoderOptions";
openfl_display_PNGEncoderOptions.prototype = {
	fastCompression: null
	,__class__: openfl_display_PNGEncoderOptions
};
var openfl_display_PixelSnapping = {};
openfl_display_PixelSnapping.fromString = function(value) {
	switch(value) {
	case "always":
		return 0;
	case "auto":
		return 1;
	case "never":
		return 2;
	default:
		return null;
	}
};
openfl_display_PixelSnapping.toString = function(this1) {
	switch(this1) {
	case 0:
		return "always";
	case 1:
		return "auto";
	case 2:
		return "never";
	default:
		return null;
	}
};
var openfl_display_Preloader = function(display) {
	this.onComplete = new lime_app__$Event_$Void_$Void();
	this.display = display;
	if(display != null) {
		display.addEventListener("unload",$bind(this,this.display_onUnload));
		openfl_Lib.get_current().addChild(display);
	}
};
$hxClasses["openfl.display.Preloader"] = openfl_display_Preloader;
openfl_display_Preloader.__name__ = "openfl.display.Preloader";
openfl_display_Preloader.prototype = {
	onComplete: null
	,complete: null
	,display: null
	,ready: null
	,start: function() {
		this.ready = true;
		openfl_Lib.get_current().get_loaderInfo().__complete();
		if(this.display != null) {
			var complete = new openfl_events_Event("complete",true,true);
			this.display.dispatchEvent(complete);
			if(!complete.isDefaultPrevented()) {
				this.display.dispatchEvent(new openfl_events_Event("unload"));
			}
		} else if(!this.complete) {
			this.complete = true;
			this.onComplete.dispatch();
		}
	}
	,update: function(loaded,total) {
		openfl_Lib.get_current().get_loaderInfo().__update(loaded,total);
		if(this.display != null) {
			this.display.dispatchEvent(new openfl_events_ProgressEvent("progress",true,true,loaded,total));
		}
	}
	,display_onUnload: function(event) {
		if(this.display != null) {
			this.display.removeEventListener("unload",$bind(this,this.display_onUnload));
			if(this.display.parent == openfl_Lib.get_current()) {
				openfl_Lib.get_current().removeChild(this.display);
			}
			openfl_Lib.get_current().stage.set_focus(null);
			this.display = null;
		}
		if(this.ready) {
			if(!this.complete) {
				this.complete = true;
				this.onComplete.dispatch();
			}
		}
	}
	,__class__: openfl_display_Preloader
};
var openfl_display_DefaultPreloader = function() {
	openfl_display_Sprite.call(this);
	var backgroundColor = this.getBackgroundColor();
	var r = backgroundColor >> 16 & 255;
	var g = backgroundColor >> 8 & 255;
	var b = backgroundColor & 255;
	var perceivedLuminosity = 0.299 * r + 0.587 * g + 0.114 * b;
	var color = 0;
	if(perceivedLuminosity < 70) {
		color = 16777215;
	}
	var x = 30;
	var height = 7;
	var y = this.getHeight() / 2 - height / 2;
	var width = this.getWidth() - x * 2;
	var padding = 2;
	this.outline = new openfl_display_Shape();
	this.outline.get_graphics().beginFill(color,0.07);
	this.outline.get_graphics().drawRect(0,0,width,height);
	this.outline.set_x(x);
	this.outline.set_y(y);
	this.outline.set_alpha(0);
	this.addChild(this.outline);
	this.progress = new openfl_display_Shape();
	this.progress.get_graphics().beginFill(color,0.35);
	this.progress.get_graphics().drawRect(0,0,width - padding * 2,height - padding * 2);
	this.progress.set_x(x + padding);
	this.progress.set_y(y + padding);
	this.progress.set_scaleX(0);
	this.progress.set_alpha(0);
	this.addChild(this.progress);
	this.startAnimation = openfl_Lib.getTimer() + 100;
	this.endAnimation = this.startAnimation + 1000;
	this.addEventListener("addedToStage",$bind(this,this.this_onAddedToStage));
};
$hxClasses["openfl.display.DefaultPreloader"] = openfl_display_DefaultPreloader;
openfl_display_DefaultPreloader.__name__ = "openfl.display.DefaultPreloader";
openfl_display_DefaultPreloader.__super__ = openfl_display_Sprite;
openfl_display_DefaultPreloader.prototype = $extend(openfl_display_Sprite.prototype,{
	endAnimation: null
	,outline: null
	,progress: null
	,startAnimation: null
	,getBackgroundColor: function() {
		var attributes = openfl_Lib.get_current().stage.window.context.attributes;
		if(Object.prototype.hasOwnProperty.call(attributes,"background") && attributes.background != null) {
			return attributes.background;
		} else {
			return 0;
		}
	}
	,getHeight: function() {
		var height = openfl_Lib.get_current().stage.window.__height;
		if(height > 0) {
			return height;
		} else {
			return openfl_Lib.get_current().stage.stageHeight;
		}
	}
	,getWidth: function() {
		var width = openfl_Lib.get_current().stage.window.__width;
		if(width > 0) {
			return width;
		} else {
			return openfl_Lib.get_current().stage.stageWidth;
		}
	}
	,onInit: function() {
		this.addEventListener("enterFrame",$bind(this,this.this_onEnterFrame));
	}
	,onLoaded: function() {
		this.removeEventListener("enterFrame",$bind(this,this.this_onEnterFrame));
		this.dispatchEvent(new openfl_events_Event("unload"));
	}
	,onUpdate: function(bytesLoaded,bytesTotal) {
		var percentLoaded = 0.0;
		if(bytesTotal > 0) {
			percentLoaded = bytesLoaded / bytesTotal;
			if(percentLoaded > 1) {
				percentLoaded = 1;
			}
		}
		this.progress.set_scaleX(percentLoaded);
	}
	,this_onAddedToStage: function(event) {
		this.removeEventListener("addedToStage",$bind(this,this.this_onAddedToStage));
		this.onInit();
		this.onUpdate(this.get_loaderInfo().bytesLoaded,this.get_loaderInfo().bytesTotal);
		this.addEventListener("progress",$bind(this,this.this_onProgress));
		this.addEventListener("complete",$bind(this,this.this_onComplete));
	}
	,this_onComplete: function(event) {
		event.preventDefault();
		this.removeEventListener("progress",$bind(this,this.this_onProgress));
		this.removeEventListener("complete",$bind(this,this.this_onComplete));
		this.onLoaded();
	}
	,this_onEnterFrame: function(event) {
		var elapsed = openfl_Lib.getTimer() - this.startAnimation;
		var total = this.endAnimation - this.startAnimation;
		var percent = elapsed / total;
		if(percent < 0) {
			percent = 0;
		}
		if(percent > 1) {
			percent = 1;
		}
		this.outline.set_alpha(this.progress.set_alpha(percent));
	}
	,this_onProgress: function(event) {
		this.onUpdate(event.bytesLoaded | 0,event.bytesTotal | 0);
	}
	,__class__: openfl_display_DefaultPreloader
});
var openfl_display_Scene = function(name,labels,numFrames) {
	this.name = name;
	this.labels = labels;
	this.numFrames = numFrames;
};
$hxClasses["openfl.display.Scene"] = openfl_display_Scene;
openfl_display_Scene.__name__ = "openfl.display.Scene";
openfl_display_Scene.prototype = {
	labels: null
	,name: null
	,numFrames: null
	,__class__: openfl_display_Scene
};
var openfl_display_ShaderData = {};
openfl_display_ShaderData._new = function(byteArray) {
	var this1 = { };
	return this1;
};
var openfl_display_ShaderInput = function() {
	this.channels = 0;
	this.filter = 5;
	this.height = 0;
	this.index = 0;
	this.mipFilter = 2;
	this.width = 0;
	this.wrap = 0;
};
$hxClasses["openfl.display.ShaderInput"] = openfl_display_ShaderInput;
openfl_display_ShaderInput.__name__ = "openfl.display.ShaderInput";
openfl_display_ShaderInput.prototype = {
	channels: null
	,filter: null
	,height: null
	,index: null
	,input: null
	,mipFilter: null
	,name: null
	,width: null
	,wrap: null
	,__isUniform: null
	,__disableGL: function(context,id) {
		var gl = context.gl;
		context.setTextureAt(id,null);
	}
	,__updateGL: function(context,id,overrideInput,overrideFilter,overrideMipFilter,overrideWrap) {
		var gl = context.gl;
		var input = overrideInput != null ? overrideInput : this.input;
		var filter = overrideFilter != null ? overrideFilter : this.filter;
		var mipFilter = overrideMipFilter != null ? overrideMipFilter : this.mipFilter;
		var wrap = overrideWrap != null ? overrideWrap : this.wrap;
		if(input != null) {
			var bitmapData = input;
			context.setTextureAt(id,bitmapData.getTexture(context));
			context.setSamplerStateAt(id,wrap,filter,mipFilter);
		} else {
			context.setTextureAt(id,null);
		}
	}
	,__class__: openfl_display_ShaderInput
};
var openfl_display_ShaderParameter = function() {
	this.index = 0;
};
$hxClasses["openfl.display.ShaderParameter"] = openfl_display_ShaderParameter;
openfl_display_ShaderParameter.__name__ = "openfl.display.ShaderParameter";
openfl_display_ShaderParameter.prototype = {
	index: null
	,name: null
	,type: null
	,value: null
	,__arrayLength: null
	,__internal: null
	,__isBool: null
	,__isFloat: null
	,__isInt: null
	,__isUniform: null
	,__length: null
	,__uniformMatrix: null
	,__useArray: null
	,__disableGL: function(context) {
		var gl = context.gl;
		if(!this.__isUniform) {
			var _g = 0;
			var _g1 = this.__arrayLength;
			while(_g < _g1) {
				var i = _g++;
				gl.disableVertexAttribArray(this.index + i);
			}
		}
	}
	,__updateGL: function(context,overrideValue) {
		var gl = context.gl;
		var value = overrideValue != null ? overrideValue : this.value;
		var boolValue = this.__isBool ? value : null;
		var floatValue = this.__isFloat ? value : null;
		var intValue = this.__isInt ? value : null;
		if(this.__isUniform) {
			if(value != null && value.length >= this.__length) {
				switch(this.type) {
				case 0:
					gl.uniform1i(this.index,boolValue[0] ? 1 : 0);
					break;
				case 1:
					gl.uniform2i(this.index,boolValue[0] ? 1 : 0,boolValue[1] ? 1 : 0);
					break;
				case 2:
					gl.uniform3i(this.index,boolValue[0] ? 1 : 0,boolValue[1] ? 1 : 0,boolValue[2] ? 1 : 0);
					break;
				case 3:
					gl.uniform4i(this.index,boolValue[0] ? 1 : 0,boolValue[1] ? 1 : 0,boolValue[2] ? 1 : 0,boolValue[3] ? 1 : 0);
					break;
				case 4:
					gl.uniform1f(this.index,floatValue[0]);
					break;
				case 5:
					gl.uniform2f(this.index,floatValue[0],floatValue[1]);
					break;
				case 6:
					gl.uniform3f(this.index,floatValue[0],floatValue[1],floatValue[2]);
					break;
				case 7:
					gl.uniform4f(this.index,floatValue[0],floatValue[1],floatValue[2],floatValue[3]);
					break;
				case 8:
					gl.uniform1i(this.index,intValue[0]);
					break;
				case 9:
					gl.uniform2i(this.index,intValue[0],intValue[1]);
					break;
				case 10:
					gl.uniform3i(this.index,intValue[0],intValue[1],intValue[2]);
					break;
				case 11:
					gl.uniform4i(this.index,intValue[0],intValue[1],intValue[2],intValue[3]);
					break;
				case 12:
					this.__uniformMatrix[0] = floatValue[0];
					this.__uniformMatrix[1] = floatValue[1];
					this.__uniformMatrix[2] = floatValue[2];
					this.__uniformMatrix[3] = floatValue[3];
					lime_graphics_WebGLRenderContext.uniformMatrix2fv(gl,this.index,false,this.__uniformMatrix);
					break;
				case 16:
					this.__uniformMatrix[0] = floatValue[0];
					this.__uniformMatrix[1] = floatValue[1];
					this.__uniformMatrix[2] = floatValue[2];
					this.__uniformMatrix[3] = floatValue[3];
					this.__uniformMatrix[4] = floatValue[4];
					this.__uniformMatrix[5] = floatValue[5];
					this.__uniformMatrix[6] = floatValue[6];
					this.__uniformMatrix[7] = floatValue[7];
					this.__uniformMatrix[8] = floatValue[8];
					lime_graphics_WebGLRenderContext.uniformMatrix3fv(gl,this.index,false,this.__uniformMatrix);
					break;
				case 20:
					this.__uniformMatrix[0] = floatValue[0];
					this.__uniformMatrix[1] = floatValue[1];
					this.__uniformMatrix[2] = floatValue[2];
					this.__uniformMatrix[3] = floatValue[3];
					this.__uniformMatrix[4] = floatValue[4];
					this.__uniformMatrix[5] = floatValue[5];
					this.__uniformMatrix[6] = floatValue[6];
					this.__uniformMatrix[7] = floatValue[7];
					this.__uniformMatrix[8] = floatValue[8];
					this.__uniformMatrix[9] = floatValue[9];
					this.__uniformMatrix[10] = floatValue[10];
					this.__uniformMatrix[11] = floatValue[11];
					this.__uniformMatrix[12] = floatValue[12];
					this.__uniformMatrix[13] = floatValue[13];
					this.__uniformMatrix[14] = floatValue[14];
					this.__uniformMatrix[15] = floatValue[15];
					lime_graphics_WebGLRenderContext.uniformMatrix4fv(gl,this.index,false,this.__uniformMatrix);
					break;
				default:
				}
			} else {
				switch(this.type) {
				case 1:case 9:
					gl.uniform2i(this.index,0,0);
					break;
				case 3:case 11:
					gl.uniform4i(this.index,0,0,0,0);
					break;
				case 4:
					gl.uniform1f(this.index,0);
					break;
				case 5:
					gl.uniform2f(this.index,0,0);
					break;
				case 6:
					gl.uniform3f(this.index,0,0,0);
					break;
				case 7:
					gl.uniform4f(this.index,0,0,0,0);
					break;
				case 0:case 8:
					gl.uniform1i(this.index,0);
					break;
				case 2:case 10:
					gl.uniform3i(this.index,0,0,0);
					break;
				case 12:
					this.__uniformMatrix[0] = 0;
					this.__uniformMatrix[1] = 0;
					this.__uniformMatrix[2] = 0;
					this.__uniformMatrix[3] = 0;
					lime_graphics_WebGLRenderContext.uniformMatrix2fv(gl,this.index,false,this.__uniformMatrix);
					break;
				case 16:
					this.__uniformMatrix[0] = 0;
					this.__uniformMatrix[1] = 0;
					this.__uniformMatrix[2] = 0;
					this.__uniformMatrix[3] = 0;
					this.__uniformMatrix[4] = 0;
					this.__uniformMatrix[5] = 0;
					this.__uniformMatrix[6] = 0;
					this.__uniformMatrix[7] = 0;
					this.__uniformMatrix[8] = 0;
					lime_graphics_WebGLRenderContext.uniformMatrix3fv(gl,this.index,false,this.__uniformMatrix);
					break;
				case 20:
					this.__uniformMatrix[0] = 0;
					this.__uniformMatrix[1] = 0;
					this.__uniformMatrix[2] = 0;
					this.__uniformMatrix[3] = 0;
					this.__uniformMatrix[4] = 0;
					this.__uniformMatrix[5] = 0;
					this.__uniformMatrix[6] = 0;
					this.__uniformMatrix[7] = 0;
					this.__uniformMatrix[8] = 0;
					this.__uniformMatrix[9] = 0;
					this.__uniformMatrix[10] = 0;
					this.__uniformMatrix[11] = 0;
					this.__uniformMatrix[12] = 0;
					this.__uniformMatrix[13] = 0;
					this.__uniformMatrix[14] = 0;
					this.__uniformMatrix[15] = 0;
					lime_graphics_WebGLRenderContext.uniformMatrix4fv(gl,this.index,false,this.__uniformMatrix);
					break;
				default:
				}
			}
		} else if(!this.__useArray && (value == null || value.length == this.__length)) {
			var _g = 0;
			var _g1 = this.__arrayLength;
			while(_g < _g1) {
				var i = _g++;
				gl.disableVertexAttribArray(this.index + i);
			}
			if(value != null) {
				switch(this.type) {
				case 0:
					gl.vertexAttrib1f(this.index,boolValue[0] ? 1 : 0);
					break;
				case 1:
					gl.vertexAttrib2f(this.index,boolValue[0] ? 1 : 0,boolValue[1] ? 1 : 0);
					break;
				case 2:
					gl.vertexAttrib3f(this.index,boolValue[0] ? 1 : 0,boolValue[1] ? 1 : 0,boolValue[2] ? 1 : 0);
					break;
				case 3:
					gl.vertexAttrib4f(this.index,boolValue[0] ? 1 : 0,boolValue[1] ? 1 : 0,boolValue[2] ? 1 : 0,boolValue[3] ? 1 : 0);
					break;
				case 4:
					gl.vertexAttrib1f(this.index,floatValue[0]);
					break;
				case 5:
					gl.vertexAttrib2f(this.index,floatValue[0],floatValue[1]);
					break;
				case 6:
					gl.vertexAttrib3f(this.index,floatValue[0],floatValue[1],floatValue[2]);
					break;
				case 7:
					gl.vertexAttrib4f(this.index,floatValue[0],floatValue[1],floatValue[2],floatValue[3]);
					break;
				case 8:
					gl.vertexAttrib1f(this.index,intValue[0]);
					break;
				case 9:
					gl.vertexAttrib2f(this.index,intValue[0],intValue[1]);
					break;
				case 10:
					gl.vertexAttrib3f(this.index,intValue[0],intValue[1],intValue[2]);
					break;
				case 11:
					gl.vertexAttrib4f(this.index,intValue[0],intValue[1],intValue[2],intValue[3]);
					break;
				case 12:
					gl.vertexAttrib2f(this.index + 0,floatValue[0],floatValue[1]);
					gl.vertexAttrib2f(this.index + 1,floatValue[2],floatValue[3]);
					break;
				case 16:
					gl.vertexAttrib3f(this.index + 0,floatValue[0],floatValue[1],floatValue[2]);
					gl.vertexAttrib3f(this.index + 1,floatValue[3],floatValue[4],floatValue[5]);
					gl.vertexAttrib3f(this.index + 2,floatValue[6],floatValue[7],floatValue[8]);
					break;
				case 20:
					gl.vertexAttrib4f(this.index + 0,floatValue[0],floatValue[1],floatValue[2],floatValue[3]);
					gl.vertexAttrib4f(this.index + 1,floatValue[4],floatValue[5],floatValue[6],floatValue[7]);
					gl.vertexAttrib4f(this.index + 2,floatValue[8],floatValue[9],floatValue[10],floatValue[11]);
					gl.vertexAttrib4f(this.index + 3,floatValue[12],floatValue[13],floatValue[14],floatValue[15]);
					break;
				default:
				}
			} else {
				switch(this.type) {
				case 1:case 5:case 9:
					gl.vertexAttrib2f(this.index,0,0);
					break;
				case 3:case 7:case 11:
					gl.vertexAttrib4f(this.index,0,0,0,0);
					break;
				case 0:case 4:case 8:
					gl.vertexAttrib1f(this.index,0);
					break;
				case 2:case 6:case 10:
					gl.vertexAttrib3f(this.index,0,0,0);
					break;
				case 12:
					gl.vertexAttrib2f(this.index + 0,0,0);
					gl.vertexAttrib2f(this.index + 1,0,0);
					break;
				case 16:
					gl.vertexAttrib3f(this.index + 0,0,0,0);
					gl.vertexAttrib3f(this.index + 1,0,0,0);
					gl.vertexAttrib3f(this.index + 2,0,0,0);
					break;
				case 20:
					gl.vertexAttrib4f(this.index + 0,0,0,0,0);
					gl.vertexAttrib4f(this.index + 1,0,0,0,0);
					gl.vertexAttrib4f(this.index + 2,0,0,0,0);
					gl.vertexAttrib4f(this.index + 3,0,0,0,0);
					break;
				default:
				}
			}
		} else {
			var _g = 0;
			var _g1 = this.__arrayLength;
			while(_g < _g1) {
				var i = _g++;
				gl.enableVertexAttribArray(this.index + i);
			}
		}
	}
	,__updateGLFromBuffer: function(context,buffer,position,length,bufferOffset) {
		var gl = context.gl;
		if(this.__isUniform) {
			if(length >= this.__length) {
				switch(this.type) {
				case 1:case 9:
					gl.uniform2i(this.index,buffer[position] | 0,buffer[position + 1] | 0);
					break;
				case 3:case 11:
					gl.uniform4i(this.index,buffer[position] | 0,buffer[position + 1] | 0,buffer[position + 2] | 0,buffer[position + 3] | 0);
					break;
				case 4:
					gl.uniform1f(this.index,buffer[position]);
					break;
				case 5:
					gl.uniform2f(this.index,buffer[position],buffer[position + 1]);
					break;
				case 6:
					gl.uniform3f(this.index,buffer[position],buffer[position + 1],buffer[position + 2]);
					break;
				case 7:
					gl.uniform4f(this.index,buffer[position],buffer[position + 1],buffer[position + 2],buffer[position + 3]);
					break;
				case 0:case 8:
					gl.uniform1i(this.index,buffer[position] | 0);
					break;
				case 2:case 10:
					gl.uniform3i(this.index,buffer[position] | 0,buffer[position + 1] | 0,buffer[position + 2] | 0);
					break;
				case 12:
					this.__uniformMatrix[0] = buffer[position];
					this.__uniformMatrix[1] = buffer[position + 1];
					this.__uniformMatrix[2] = buffer[position + 2];
					this.__uniformMatrix[3] = buffer[position + 3];
					lime_graphics_WebGLRenderContext.uniformMatrix2fv(gl,this.index,false,this.__uniformMatrix);
					break;
				case 16:
					this.__uniformMatrix[0] = buffer[position];
					this.__uniformMatrix[1] = buffer[position + 1];
					this.__uniformMatrix[2] = buffer[position + 2];
					this.__uniformMatrix[3] = buffer[position + 3];
					this.__uniformMatrix[4] = buffer[position + 4];
					this.__uniformMatrix[5] = buffer[position + 5];
					this.__uniformMatrix[6] = buffer[position + 6];
					this.__uniformMatrix[7] = buffer[position + 7];
					this.__uniformMatrix[8] = buffer[position + 8];
					lime_graphics_WebGLRenderContext.uniformMatrix3fv(gl,this.index,false,this.__uniformMatrix);
					break;
				case 20:
					this.__uniformMatrix[0] = buffer[position];
					this.__uniformMatrix[1] = buffer[position + 1];
					this.__uniformMatrix[2] = buffer[position + 2];
					this.__uniformMatrix[3] = buffer[position + 3];
					this.__uniformMatrix[4] = buffer[position + 4];
					this.__uniformMatrix[5] = buffer[position + 5];
					this.__uniformMatrix[6] = buffer[position + 6];
					this.__uniformMatrix[7] = buffer[position + 7];
					this.__uniformMatrix[8] = buffer[position + 8];
					this.__uniformMatrix[9] = buffer[position + 9];
					this.__uniformMatrix[10] = buffer[position + 10];
					this.__uniformMatrix[11] = buffer[position + 11];
					this.__uniformMatrix[12] = buffer[position + 12];
					this.__uniformMatrix[13] = buffer[position + 13];
					this.__uniformMatrix[14] = buffer[position + 14];
					this.__uniformMatrix[15] = buffer[position + 15];
					lime_graphics_WebGLRenderContext.uniformMatrix4fv(gl,this.index,false,this.__uniformMatrix);
					break;
				default:
				}
			}
		} else if(!this.__internal && (length == 0 || length == this.__length)) {
			var _g = 0;
			var _g1 = this.__arrayLength;
			while(_g < _g1) {
				var i = _g++;
				gl.disableVertexAttribArray(this.index + i);
			}
			if(length > 0) {
				switch(this.type) {
				case 1:case 5:case 9:
					gl.vertexAttrib2f(this.index,buffer[position],buffer[position + 1]);
					break;
				case 3:case 7:case 11:
					gl.vertexAttrib4f(this.index,buffer[position],buffer[position + 1],buffer[position + 2],buffer[position + 3]);
					break;
				case 0:case 4:case 8:
					gl.vertexAttrib1f(this.index,buffer[position]);
					break;
				case 2:case 6:case 10:
					gl.vertexAttrib3f(this.index,buffer[position],buffer[position + 1],buffer[position + 2]);
					break;
				case 12:
					gl.vertexAttrib2f(this.index + 0,buffer[position],buffer[position + 1]);
					gl.vertexAttrib2f(this.index + 1,buffer[position + 2],buffer[position + 2 + 1]);
					break;
				case 16:
					gl.vertexAttrib3f(this.index + 0,buffer[position],buffer[position + 1],buffer[position + 2]);
					gl.vertexAttrib3f(this.index + 1,buffer[position + 3],buffer[position + 3 + 1],buffer[position + 3 + 2]);
					gl.vertexAttrib3f(this.index + 2,buffer[position + 6],buffer[position + 6 + 1],buffer[position + 6 + 2]);
					break;
				case 20:
					gl.vertexAttrib4f(this.index + 0,buffer[position],buffer[position + 1],buffer[position + 2],buffer[position + 3]);
					gl.vertexAttrib4f(this.index + 1,buffer[position + 4],buffer[position + 4 + 1],buffer[position + 4 + 2],buffer[position + 4 + 3]);
					gl.vertexAttrib4f(this.index + 2,buffer[position + 8],buffer[position + 8 + 1],buffer[position + 8 + 2],buffer[position + 8 + 3]);
					gl.vertexAttrib4f(this.index + 3,buffer[position + 12],buffer[position + 12 + 1],buffer[position + 12 + 2],buffer[position + 12 + 3]);
					break;
				default:
				}
			} else {
				switch(this.type) {
				case 1:case 5:case 9:
					gl.vertexAttrib2f(this.index,0,0);
					break;
				case 3:case 7:case 11:
					gl.vertexAttrib4f(this.index,0,0,0,0);
					break;
				case 0:case 4:case 8:
					gl.vertexAttrib1f(this.index,0);
					break;
				case 2:case 6:case 10:
					gl.vertexAttrib3f(this.index,0,0,0);
					break;
				case 12:
					gl.vertexAttrib2f(this.index + 0,0,0);
					gl.vertexAttrib2f(this.index + 1,0,0);
					break;
				case 16:
					gl.vertexAttrib3f(this.index + 0,0,0,0);
					gl.vertexAttrib3f(this.index + 1,0,0,0);
					gl.vertexAttrib3f(this.index + 2,0,0,0);
					break;
				case 20:
					gl.vertexAttrib4f(this.index + 0,0,0,0,0);
					gl.vertexAttrib4f(this.index + 1,0,0,0,0);
					gl.vertexAttrib4f(this.index + 2,0,0,0,0);
					gl.vertexAttrib4f(this.index + 3,0,0,0,0);
					break;
				default:
				}
			}
		} else {
			var type = gl.FLOAT;
			if(this.__isBool) {
				type = gl.INT;
			} else if(this.__isInt) {
				type = gl.INT;
			}
			var _g = 0;
			var _g1 = this.__arrayLength;
			while(_g < _g1) {
				var i = _g++;
				gl.enableVertexAttribArray(this.index + i);
			}
			if(length > 0) {
				var _g = 0;
				var _g1 = this.__arrayLength;
				while(_g < _g1) {
					var i = _g++;
					gl.vertexAttribPointer(this.index + i,this.__length,type,false,this.__length * 4,(position + bufferOffset * this.__length + i * this.__arrayLength) * 4);
				}
			}
		}
	}
	,set_name: function(value) {
		this.__internal = StringTools.startsWith(value,"openfl_");
		return this.name = value;
	}
	,__class__: openfl_display_ShaderParameter
	,__properties__: {set_name:"set_name"}
};
var openfl_display_ShaderParameterType = {};
openfl_display_ShaderParameterType.fromString = function(value) {
	switch(value) {
	case "bool":
		return 0;
	case "bool2":
		return 1;
	case "bool3":
		return 1;
	case "bool4":
		return 1;
	case "float":
		return 4;
	case "float2":
		return 5;
	case "float3":
		return 6;
	case "float4":
		return 7;
	case "int":
		return 8;
	case "int2":
		return 9;
	case "int3":
		return 10;
	case "int4":
		return 11;
	case "matrix2x2":
		return 12;
	case "matrix2x3":
		return 13;
	case "matrix2x4":
		return 14;
	case "matrix3x2":
		return 15;
	case "matrix3x3":
		return 16;
	case "matrix3x4":
		return 17;
	case "matrix4x2":
		return 18;
	case "matrix4x3":
		return 19;
	case "matrix4x4":
		return 20;
	default:
		return null;
	}
};
openfl_display_ShaderParameterType.toString = function(this1) {
	switch(this1) {
	case 0:
		return "bool";
	case 1:
		return "bool2";
	case 2:
		return "bool3";
	case 3:
		return "bool4";
	case 4:
		return "float";
	case 5:
		return "float2";
	case 6:
		return "float3";
	case 7:
		return "float4";
	case 8:
		return "int";
	case 9:
		return "int2";
	case 10:
		return "int3";
	case 11:
		return "int4";
	case 12:
		return "matrix2x2";
	case 13:
		return "matrix2x3";
	case 14:
		return "matrix2x4";
	case 15:
		return "matrix3x2";
	case 16:
		return "matrix3x3";
	case 17:
		return "matrix3x4";
	case 18:
		return "matrix4x2";
	case 19:
		return "matrix4x3";
	case 20:
		return "matrix4x4";
	default:
		return null;
	}
};
var openfl_display_ShaderPrecision = {};
openfl_display_ShaderPrecision.fromString = function(value) {
	switch(value) {
	case "fast":
		return 0;
	case "full":
		return 1;
	default:
		return null;
	}
};
openfl_display_ShaderPrecision.toString = function(this1) {
	switch(this1) {
	case 0:
		return "fast";
	case 1:
		return "full";
	default:
		return null;
	}
};
var openfl_display_Shape = function() {
	openfl_display_DisplayObject.call(this);
};
$hxClasses["openfl.display.Shape"] = openfl_display_Shape;
openfl_display_Shape.__name__ = "openfl.display.Shape";
openfl_display_Shape.__super__ = openfl_display_DisplayObject;
openfl_display_Shape.prototype = $extend(openfl_display_DisplayObject.prototype,{
	get_graphics: function() {
		if(this.__graphics == null) {
			this.__graphics = new openfl_display_Graphics(this);
		}
		return this.__graphics;
	}
	,__class__: openfl_display_Shape
	,__properties__: $extend(openfl_display_DisplayObject.prototype.__properties__,{get_graphics:"get_graphics"})
});
var openfl_display_SpreadMethod = {};
openfl_display_SpreadMethod.fromInt = function(value) {
	return value;
};
openfl_display_SpreadMethod.fromString = function(value) {
	switch(value) {
	case "pad":
		return 0;
	case "reflect":
		return 1;
	case "repeat":
		return 2;
	default:
		return null;
	}
};
openfl_display_SpreadMethod.toInt = function(this1) {
	return this1;
};
openfl_display_SpreadMethod.toString = function(this1) {
	switch(this1) {
	case 0:
		return "pad";
	case 1:
		return "reflect";
	case 2:
		return "repeat";
	default:
		return null;
	}
};
var openfl_display_Stage = function($window,color) {
	openfl_display_DisplayObjectContainer.call(this);
	this.set_name(null);
	this.__color = -1;
	this.__colorSplit = [255,255,255];
	this.__colorString = "#FFFFFF";
	this.__contentsScaleFactor = 1;
	this.__currentTabOrderIndex = 0;
	this.__deltaTime = 0;
	this.__displayState = 2;
	this.__mouseX = 0;
	this.__mouseY = 0;
	this.__lastClickTime = 0;
	this.__logicalWidth = 0;
	this.__logicalHeight = 0;
	this.__displayMatrix = new openfl_geom_Matrix();
	this.__displayRect = new openfl_geom_Rectangle();
	this.__renderDirty = true;
	this.stage3Ds = openfl_Vector.toObjectVector(null);
	this.stage3Ds.push(new openfl_display_Stage3D(this));
	this.stage3Ds.push(new openfl_display_Stage3D(this));
	this.stage3Ds.push(new openfl_display_Stage3D(this));
	this.stage3Ds.push(new openfl_display_Stage3D(this));
	this.stage = this;
	this.align = 6;
	this.allowsFullScreen = true;
	this.allowsFullScreenInteractive = true;
	this.__quality = 1;
	this.__scaleMode = 2;
	this.showDefaultContextMenu = true;
	this.softKeyboardRect = new openfl_geom_Rectangle();
	this.stageFocusRect = true;
	this.__macKeyboard = /AppleWebKit/.test (navigator.userAgent) && /Mobile\/\w+/.test (navigator.userAgent) || /Mac/.test (navigator.platform);
	this.__clearBeforeRender = true;
	this.__forceRender = false;
	this.__stack = [];
	this.__rollOutStack = [];
	this.__mouseOutStack = [];
	this.__touchData = new haxe_ds_IntMap();
	this.application = $window.application;
	this.window = $window;
	this.set_color(color);
	this.__contentsScaleFactor = $window.__scale;
	this.__wasFullscreen = $window.__fullscreen;
	this.__resize();
	if(openfl_Lib.get_current().stage == null) {
		this.stage.addChild(openfl_Lib.get_current());
	}
};
$hxClasses["openfl.display.Stage"] = openfl_display_Stage;
openfl_display_Stage.__name__ = "openfl.display.Stage";
openfl_display_Stage.__interfaces__ = [lime_app_IModule];
openfl_display_Stage.__super__ = openfl_display_DisplayObjectContainer;
openfl_display_Stage.prototype = $extend(openfl_display_DisplayObjectContainer.prototype,{
	align: null
	,allowsFullScreen: null
	,allowsFullScreenInteractive: null
	,application: null
	,context3D: null
	,showDefaultContextMenu: null
	,softKeyboardRect: null
	,stage3Ds: null
	,stageFocusRect: null
	,stageHeight: null
	,stageWidth: null
	,window: null
	,__cacheFocus: null
	,__clearBeforeRender: null
	,__color: null
	,__colorSplit: null
	,__colorString: null
	,__contentsScaleFactor: null
	,__currentTabOrderIndex: null
	,__deltaTime: null
	,__dirty: null
	,__displayMatrix: null
	,__displayRect: null
	,__displayState: null
	,__dragBounds: null
	,__dragObject: null
	,__dragOffsetX: null
	,__dragOffsetY: null
	,__focus: null
	,__forceRender: null
	,__fullscreen: null
	,__fullScreenSourceRect: null
	,__invalidated: null
	,__lastClickTime: null
	,__logicalWidth: null
	,__logicalHeight: null
	,__macKeyboard: null
	,__mouseDownLeft: null
	,__mouseDownMiddle: null
	,__mouseDownRight: null
	,__mouseOutStack: null
	,__mouseOverTarget: null
	,__mouseX: null
	,__mouseY: null
	,__pendingMouseEvent: null
	,__pendingMouseX: null
	,__pendingMouseY: null
	,__quality: null
	,__renderer: null
	,__rendering: null
	,__rollOutStack: null
	,__scaleMode: null
	,__stack: null
	,__touchData: null
	,__transparent: null
	,__wasDirty: null
	,__wasFullscreen: null
	,__primaryTouch: null
	,invalidate: function() {
		this.__invalidated = true;
		this.__renderDirty = true;
	}
	,localToGlobal: function(pos) {
		return pos.clone();
	}
	,__broadcastEvent: function(event) {
		if(Object.prototype.hasOwnProperty.call(openfl_display_DisplayObject.__broadcastEvents.h,event.type)) {
			var dispatchers = openfl_display_DisplayObject.__broadcastEvents.h[event.type];
			var _g = 0;
			while(_g < dispatchers.length) {
				var dispatcher = dispatchers[_g];
				++_g;
				if(dispatcher.stage == this || dispatcher.stage == null) {
					try {
						dispatcher.__dispatch(event);
					} catch( _g1 ) {
						haxe_NativeStackTrace.lastError = _g1;
						var e = haxe_Exception.caught(_g1).unwrap();
						this.__handleError(e);
					}
				}
			}
		}
	}
	,__createRenderer: function() {
		var pixelRatio = 1;
		if(this.window.__scale > 1) {
			pixelRatio = this.window.devicePixelRatio || 1;
		}
		var windowWidth = this.window.__width * this.window.__scale | 0;
		var windowHeight = this.window.__height * this.window.__scale | 0;
		switch(this.window.context.type) {
		case "cairo":
			break;
		case "canvas":
			this.__renderer = new openfl_display_CanvasRenderer(this.window.context.canvas2D);
			(js_Boot.__cast(this.__renderer , openfl_display_CanvasRenderer)).pixelRatio = pixelRatio;
			break;
		case "dom":
			this.__renderer = new openfl_display_DOMRenderer(this.window.context.dom);
			(js_Boot.__cast(this.__renderer , openfl_display_DOMRenderer)).pixelRatio = pixelRatio;
			break;
		case "opengl":case "opengles":case "webgl":
			this.context3D = new openfl_display3D_Context3D(this);
			this.context3D.configureBackBuffer(windowWidth,windowHeight,0,true,true,true);
			this.context3D.present();
			this.__renderer = new openfl_display_OpenGLRenderer(this.context3D);
			break;
		default:
		}
		if(this.__renderer != null) {
			var tmp = this.get_quality();
			this.__renderer.__allowSmoothing = tmp != 2;
			this.__renderer.__worldTransform = this.__displayMatrix;
			this.__renderer.__stage = this;
			this.__renderer.__resize(windowWidth,windowHeight);
		}
	}
	,__dispatchEvent: function(event) {
		try {
			return openfl_display_DisplayObjectContainer.prototype.__dispatchEvent.call(this,event);
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			this.__handleError(e);
			return false;
		}
	}
	,__dispatchPendingMouseEvent: function() {
		if(this.__pendingMouseEvent) {
			this.__onMouse("mouseMove",this.__pendingMouseX,this.__pendingMouseY,0);
			this.__pendingMouseEvent = false;
		}
	}
	,__dispatchStack: function(event,stack) {
		try {
			var target;
			var length = stack.length;
			if(length == 0) {
				event.eventPhase = 2;
				target = event.target;
				target.__dispatch(event);
			} else {
				event.eventPhase = 1;
				event.target = stack[stack.length - 1];
				var _g = 0;
				var _g1 = length - 1;
				while(_g < _g1) {
					var i = _g++;
					stack[i].__dispatch(event);
					if(event.__isCanceled) {
						return;
					}
				}
				event.eventPhase = 2;
				target = event.target;
				target.__dispatch(event);
				if(event.__isCanceled) {
					return;
				}
				if(event.bubbles) {
					event.eventPhase = 3;
					var i = length - 2;
					while(i >= 0) {
						stack[i].__dispatch(event);
						if(event.__isCanceled) {
							return;
						}
						--i;
					}
				}
			}
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			this.__handleError(e);
		}
	}
	,__dispatchTarget: function(target,event) {
		try {
			return target.__dispatchEvent(event);
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			this.__handleError(e);
			return false;
		}
	}
	,__drag: function(mouse) {
		var parent = this.__dragObject.parent;
		if(parent != null) {
			var _this = parent.__getWorldTransform();
			var norm = _this.a * _this.d - _this.b * _this.c;
			if(norm == 0) {
				mouse.x = -_this.tx;
				mouse.y = -_this.ty;
			} else {
				var px = 1.0 / norm * (_this.c * (_this.ty - mouse.y) + _this.d * (mouse.x - _this.tx));
				mouse.y = 1.0 / norm * (_this.a * (mouse.y - _this.ty) + _this.b * (_this.tx - mouse.x));
				mouse.x = px;
			}
		}
		var x = mouse.x + this.__dragOffsetX;
		var y = mouse.y + this.__dragOffsetY;
		if(this.__dragBounds != null) {
			if(x < this.__dragBounds.x) {
				x = this.__dragBounds.x;
			} else if(x > this.__dragBounds.get_right()) {
				x = this.__dragBounds.get_right();
			}
			if(y < this.__dragBounds.y) {
				y = this.__dragBounds.y;
			} else if(y > this.__dragBounds.get_bottom()) {
				y = this.__dragBounds.get_bottom();
			}
		}
		this.__dragObject.set_x(x);
		this.__dragObject.set_y(y);
	}
	,__getInteractive: function(stack) {
		if(stack != null) {
			stack.push(this);
		}
		return true;
	}
	,__globalToLocal: function(global,local) {
		if(global != local) {
			local.copyFrom(global);
		}
		return local;
	}
	,__handleError: function(e) {
		var event = new openfl_events_UncaughtErrorEvent("uncaughtError",true,true,e);
		try {
			openfl_Lib.get_current().__loaderInfo.uncaughtErrorEvents.dispatchEvent(event);
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
		}
		if(!event.__preventDefault) {
			var message = haxe_CallStack.toString(haxe_CallStack.exceptionStack());
			console.log(message);
			var message = Std.string(e);
			console.log(message);
			try {
				var exc = e;
				if(exc != null && Object.prototype.hasOwnProperty.call(exc,"stack") && exc.stack != null && exc.stack != "") {
					console.log(exc.stack);
					e.stack = exc.stack;
				} else {
					var msg = haxe_CallStack.toString(haxe_CallStack.callStack());
					console.log(msg);
				}
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
			}
			throw e;
		}
	}
	,__onKey: function(type,keyCode,modifier) {
		this.__dispatchPendingMouseEvent();
		openfl_events_MouseEvent.__altKey = lime_ui_KeyModifier.get_altKey(modifier);
		openfl_events_MouseEvent.__commandKey = lime_ui_KeyModifier.get_metaKey(modifier);
		openfl_events_MouseEvent.__ctrlKey = lime_ui_KeyModifier.get_ctrlKey(modifier);
		openfl_events_MouseEvent.__shiftKey = lime_ui_KeyModifier.get_shiftKey(modifier);
		var stack = [];
		if(this.__focus == null) {
			this.__getInteractive(stack);
		} else {
			this.__focus.__getInteractive(stack);
		}
		if(stack.length > 0) {
			var keyLocation;
			switch(keyCode) {
			case 1073741908:case 1073741909:case 1073741910:case 1073741911:case 1073741912:case 1073741913:case 1073741914:case 1073741915:case 1073741916:case 1073741917:case 1073741918:case 1073741919:case 1073741920:case 1073741921:case 1073741922:case 1073741923:case 1073742044:
				keyLocation = 3;
				break;
			case 1073742048:case 1073742049:case 1073742050:case 1073742051:
				keyLocation = 1;
				break;
			case 1073742052:case 1073742053:case 1073742054:case 1073742055:
				keyLocation = 2;
				break;
			default:
				keyLocation = 0;
			}
			var keyCode1;
			switch(keyCode) {
			case 8:
				keyCode1 = 8;
				break;
			case 9:
				keyCode1 = 9;
				break;
			case 13:
				keyCode1 = 13;
				break;
			case 27:
				keyCode1 = 27;
				break;
			case 32:
				keyCode1 = 32;
				break;
			case 33:
				keyCode1 = 49;
				break;
			case 34:
				keyCode1 = 222;
				break;
			case 35:
				keyCode1 = 51;
				break;
			case 36:
				keyCode1 = 52;
				break;
			case 37:
				keyCode1 = 53;
				break;
			case 38:
				keyCode1 = 55;
				break;
			case 39:
				keyCode1 = 222;
				break;
			case 40:
				keyCode1 = 57;
				break;
			case 41:
				keyCode1 = 48;
				break;
			case 42:
				keyCode1 = 56;
				break;
			case 44:
				keyCode1 = 188;
				break;
			case 45:
				keyCode1 = 189;
				break;
			case 46:
				keyCode1 = 190;
				break;
			case 47:
				keyCode1 = 191;
				break;
			case 48:
				keyCode1 = 48;
				break;
			case 49:
				keyCode1 = 49;
				break;
			case 50:
				keyCode1 = 50;
				break;
			case 51:
				keyCode1 = 51;
				break;
			case 52:
				keyCode1 = 52;
				break;
			case 53:
				keyCode1 = 53;
				break;
			case 54:
				keyCode1 = 54;
				break;
			case 55:
				keyCode1 = 55;
				break;
			case 56:
				keyCode1 = 56;
				break;
			case 57:
				keyCode1 = 57;
				break;
			case 58:
				keyCode1 = 186;
				break;
			case 59:
				keyCode1 = 186;
				break;
			case 60:
				keyCode1 = 60;
				break;
			case 61:
				keyCode1 = 187;
				break;
			case 62:
				keyCode1 = 190;
				break;
			case 63:
				keyCode1 = 191;
				break;
			case 64:
				keyCode1 = 50;
				break;
			case 91:
				keyCode1 = 219;
				break;
			case 92:
				keyCode1 = 220;
				break;
			case 93:
				keyCode1 = 221;
				break;
			case 94:
				keyCode1 = 54;
				break;
			case 95:
				keyCode1 = 189;
				break;
			case 96:
				keyCode1 = 192;
				break;
			case 97:
				keyCode1 = 65;
				break;
			case 98:
				keyCode1 = 66;
				break;
			case 99:
				keyCode1 = 67;
				break;
			case 100:
				keyCode1 = 68;
				break;
			case 101:
				keyCode1 = 69;
				break;
			case 102:
				keyCode1 = 70;
				break;
			case 103:
				keyCode1 = 71;
				break;
			case 104:
				keyCode1 = 72;
				break;
			case 105:
				keyCode1 = 73;
				break;
			case 106:
				keyCode1 = 74;
				break;
			case 107:
				keyCode1 = 75;
				break;
			case 108:
				keyCode1 = 76;
				break;
			case 109:
				keyCode1 = 77;
				break;
			case 110:
				keyCode1 = 78;
				break;
			case 111:
				keyCode1 = 79;
				break;
			case 112:
				keyCode1 = 80;
				break;
			case 113:
				keyCode1 = 81;
				break;
			case 114:
				keyCode1 = 82;
				break;
			case 115:
				keyCode1 = 83;
				break;
			case 116:
				keyCode1 = 84;
				break;
			case 117:
				keyCode1 = 85;
				break;
			case 118:
				keyCode1 = 86;
				break;
			case 119:
				keyCode1 = 87;
				break;
			case 120:
				keyCode1 = 88;
				break;
			case 121:
				keyCode1 = 89;
				break;
			case 122:
				keyCode1 = 90;
				break;
			case 127:
				keyCode1 = 46;
				break;
			case 1073741881:
				keyCode1 = 20;
				break;
			case 1073741882:
				keyCode1 = 112;
				break;
			case 1073741883:
				keyCode1 = 113;
				break;
			case 1073741884:
				keyCode1 = 114;
				break;
			case 1073741885:
				keyCode1 = 115;
				break;
			case 1073741886:
				keyCode1 = 116;
				break;
			case 1073741887:
				keyCode1 = 117;
				break;
			case 1073741888:
				keyCode1 = 118;
				break;
			case 1073741889:
				keyCode1 = 119;
				break;
			case 1073741890:
				keyCode1 = 120;
				break;
			case 1073741891:
				keyCode1 = 121;
				break;
			case 1073741892:
				keyCode1 = 122;
				break;
			case 1073741893:
				keyCode1 = 123;
				break;
			case 1073741894:
				keyCode1 = 301;
				break;
			case 1073741895:
				keyCode1 = 145;
				break;
			case 1073741896:
				keyCode1 = 19;
				break;
			case 1073741897:
				keyCode1 = 45;
				break;
			case 1073741898:
				keyCode1 = 36;
				break;
			case 1073741899:
				keyCode1 = 33;
				break;
			case 1073741901:
				keyCode1 = 35;
				break;
			case 1073741902:
				keyCode1 = 34;
				break;
			case 1073741903:
				keyCode1 = 39;
				break;
			case 1073741904:
				keyCode1 = 37;
				break;
			case 1073741905:
				keyCode1 = 40;
				break;
			case 1073741906:
				keyCode1 = 38;
				break;
			case 1073741907:
				keyCode1 = 144;
				break;
			case 1073741908:
				keyCode1 = 111;
				break;
			case 1073741909:
				keyCode1 = 106;
				break;
			case 1073741910:
				keyCode1 = 109;
				break;
			case 1073741911:
				keyCode1 = 107;
				break;
			case 1073741912:
				keyCode1 = 13;
				break;
			case 1073741913:
				keyCode1 = 97;
				break;
			case 1073741914:
				keyCode1 = 98;
				break;
			case 1073741915:
				keyCode1 = 99;
				break;
			case 1073741916:
				keyCode1 = 100;
				break;
			case 1073741917:
				keyCode1 = 101;
				break;
			case 1073741918:
				keyCode1 = 102;
				break;
			case 1073741919:
				keyCode1 = 103;
				break;
			case 1073741920:
				keyCode1 = 104;
				break;
			case 1073741921:
				keyCode1 = 105;
				break;
			case 1073741922:
				keyCode1 = 96;
				break;
			case 1073741923:
				keyCode1 = 110;
				break;
			case 1073741925:
				keyCode1 = 302;
				break;
			case 1073741928:
				keyCode1 = 124;
				break;
			case 1073741929:
				keyCode1 = 125;
				break;
			case 1073741930:
				keyCode1 = 126;
				break;
			case 1073741982:
				keyCode1 = 13;
				break;
			case 1073742044:
				keyCode1 = 110;
				break;
			case 1073742048:
				keyCode1 = 17;
				break;
			case 1073742049:
				keyCode1 = 16;
				break;
			case 1073742050:
				keyCode1 = 18;
				break;
			case 1073742051:
				keyCode1 = 15;
				break;
			case 1073742052:
				keyCode1 = 17;
				break;
			case 1073742053:
				keyCode1 = 16;
				break;
			case 1073742054:
				keyCode1 = 18;
				break;
			case 1073742055:
				keyCode1 = 15;
				break;
			default:
				keyCode1 = keyCode;
			}
			var charCode = openfl_ui_Keyboard.__getCharCode(keyCode1,lime_ui_KeyModifier.get_shiftKey(modifier));
			if(type == "keyUp" && (keyCode1 == 32 || keyCode1 == 13) && ((this.__focus) instanceof openfl_display_Sprite)) {
				var sprite = js_Boot.__cast(this.__focus , openfl_display_Sprite);
				if(sprite.get_buttonMode() && sprite.focusRect == true) {
					var localPoint = openfl_geom_Point.__pool.get();
					var targetPoint = openfl_geom_Point.__pool.get();
					targetPoint.x = this.__mouseX;
					targetPoint.y = this.__mouseY;
					var clickEvent = openfl_events_MouseEvent.__create("click",0,this.__mouseX,this.__mouseY,sprite.__globalToLocal(targetPoint,localPoint),sprite);
					this.__dispatchStack(clickEvent,stack);
					openfl_geom_Point.__pool.release(targetPoint);
					openfl_geom_Point.__pool.release(localPoint);
				}
			}
			var event = new openfl_events_KeyboardEvent(type,true,true,charCode,keyCode1,keyLocation,this.__macKeyboard ? lime_ui_KeyModifier.get_ctrlKey(modifier) || lime_ui_KeyModifier.get_metaKey(modifier) : lime_ui_KeyModifier.get_ctrlKey(modifier),lime_ui_KeyModifier.get_altKey(modifier),lime_ui_KeyModifier.get_shiftKey(modifier),lime_ui_KeyModifier.get_ctrlKey(modifier),lime_ui_KeyModifier.get_metaKey(modifier));
			stack.reverse();
			this.__dispatchStack(event,stack);
			if(event.__preventDefault) {
				if(type == "keyDown") {
					this.window.onKeyDown.cancel();
				} else {
					this.window.onKeyUp.cancel();
				}
			} else if(type == "keyDown" && keyCode1 == 9) {
				var tabStack = [];
				this.__tabTest(tabStack);
				var nextIndex = -1;
				var nextObject = null;
				var nextOffset = lime_ui_KeyModifier.get_shiftKey(modifier) ? -1 : 1;
				if(tabStack.length > 1) {
					haxe_ds_ArraySort.sort(tabStack,function(a,b) {
						return a.get_tabIndex() - b.get_tabIndex();
					});
					if(tabStack[tabStack.length - 1].get_tabIndex() != -1) {
						var i = 0;
						while(i < tabStack.length) {
							if(tabStack[i].get_tabIndex() > -1) {
								if(i > 0) {
									tabStack.splice(0,i);
								}
								break;
							}
							++i;
						}
					}
					if(this.get_focus() != null) {
						var current = this.get_focus();
						var index = tabStack.indexOf(current);
						while(index == -1 && current != null) {
							var currentParent = current.parent;
							if(currentParent != null && currentParent.get_tabChildren()) {
								var currentIndex = currentParent.getChildIndex(current);
								if(currentIndex == -1) {
									current = currentParent;
									continue;
								}
								var i = currentIndex + nextOffset;
								while(lime_ui_KeyModifier.get_shiftKey(modifier) ? i >= 0 : i < currentParent.get_numChildren()) {
									var sibling = currentParent.getChildAt(i);
									if(((sibling) instanceof openfl_display_InteractiveObject)) {
										var interactiveSibling = js_Boot.__cast(sibling , openfl_display_InteractiveObject);
										index = tabStack.indexOf(interactiveSibling);
										if(index != -1) {
											nextOffset = 0;
											break;
										}
									}
									i += nextOffset;
								}
							} else if(lime_ui_KeyModifier.get_shiftKey(modifier)) {
								index = tabStack.indexOf(currentParent);
								if(index != -1) {
									nextOffset = 0;
								}
							}
							current = currentParent;
						}
						if(index < 0) {
							nextIndex = 0;
						} else {
							nextIndex = index + nextOffset;
						}
					} else {
						nextIndex = this.__currentTabOrderIndex;
					}
				} else if(tabStack.length == 1) {
					nextObject = tabStack[0];
					if(this.get_focus() == nextObject) {
						nextObject = null;
					}
				}
				var cancelTab = nextIndex >= 0 && nextIndex < tabStack.length;
				if(tabStack.length == 1 || tabStack.length == 0 && this.get_focus() != null) {
					nextIndex = 0;
				} else if(tabStack.length > 1) {
					if(nextIndex < 0) {
						nextIndex += tabStack.length;
					}
					nextIndex %= tabStack.length;
					nextObject = tabStack[nextIndex];
					if(nextObject == this.get_focus()) {
						nextIndex += nextOffset;
						if(nextIndex < 0) {
							nextIndex += tabStack.length;
						}
						nextIndex %= tabStack.length;
						nextObject = tabStack[nextIndex];
					}
				}
				var focusEvent = null;
				if(this.get_focus() != null) {
					focusEvent = new openfl_events_FocusEvent("keyFocusChange",true,true,nextObject,lime_ui_KeyModifier.get_shiftKey(modifier),0);
					stack = [];
					this.get_focus().__getInteractive(stack);
					stack.reverse();
					this.__dispatchStack(focusEvent,stack);
					if(focusEvent.isDefaultPrevented()) {
						this.window.onKeyDown.cancel();
					}
				}
				if(focusEvent == null || !focusEvent.isDefaultPrevented()) {
					this.__currentTabOrderIndex = nextIndex;
					if(nextObject != null) {
						this.set_focus(nextObject);
					}
					if(cancelTab) {
						this.window.onKeyDown.cancel();
					}
				}
			}
		}
	}
	,__onLimeCreateWindow: function($window) {
		if(this.window != $window) {
			return;
		}
		var _g = $bind(this,this.__onLimeWindowActivate);
		var window1 = $window;
		var tmp = function() {
			_g(window1);
		};
		$window.onActivate.add(tmp);
		var _g1 = $bind(this,this.__onLimeWindowClose);
		var window2 = $window;
		var tmp = function() {
			_g1(window2);
		};
		$window.onClose.add(tmp,false,-9000);
		var _g2 = $bind(this,this.__onLimeWindowDeactivate);
		var window3 = $window;
		var tmp = function() {
			_g2(window3);
		};
		$window.onDeactivate.add(tmp);
		var _g3 = $bind(this,this.__onLimeWindowDropFile);
		var window4 = $window;
		var tmp = function(file) {
			_g3(window4,file);
		};
		$window.onDropFile.add(tmp);
		var _g4 = $bind(this,this.__onLimeWindowEnter);
		var window5 = $window;
		var tmp = function() {
			_g4(window5);
		};
		$window.onEnter.add(tmp);
		var _g5 = $bind(this,this.__onLimeWindowExpose);
		var window6 = $window;
		var tmp = function() {
			_g5(window6);
		};
		$window.onExpose.add(tmp);
		var _g6 = $bind(this,this.__onLimeWindowFocusIn);
		var window7 = $window;
		var tmp = function() {
			_g6(window7);
		};
		$window.onFocusIn.add(tmp);
		var _g7 = $bind(this,this.__onLimeWindowFocusOut);
		var window8 = $window;
		var tmp = function() {
			_g7(window8);
		};
		$window.onFocusOut.add(tmp);
		var _g8 = $bind(this,this.__onLimeWindowFullscreen);
		var window9 = $window;
		var tmp = function() {
			_g8(window9);
		};
		$window.onFullscreen.add(tmp);
		var _g9 = $bind(this,this.__onLimeKeyDown);
		var window10 = $window;
		var tmp = function(keyCode,modifier) {
			_g9(window10,keyCode,modifier);
		};
		$window.onKeyDown.add(tmp);
		var _g10 = $bind(this,this.__onLimeKeyUp);
		var window11 = $window;
		var tmp = function(keyCode,modifier) {
			_g10(window11,keyCode,modifier);
		};
		$window.onKeyUp.add(tmp);
		var _g11 = $bind(this,this.__onLimeWindowLeave);
		var window12 = $window;
		var tmp = function() {
			_g11(window12);
		};
		$window.onLeave.add(tmp);
		var _g12 = $bind(this,this.__onLimeWindowMinimize);
		var window13 = $window;
		var tmp = function() {
			_g12(window13);
		};
		$window.onMinimize.add(tmp);
		var _g13 = $bind(this,this.__onLimeMouseDown);
		var window14 = $window;
		var tmp = function(x,y,button) {
			_g13(window14,x,y,button);
		};
		$window.onMouseDown.add(tmp);
		var _g14 = $bind(this,this.__onLimeMouseMove);
		var window15 = $window;
		var tmp = function(x,y) {
			_g14(window15,x,y);
		};
		$window.onMouseMove.add(tmp);
		var _g15 = $bind(this,this.__onLimeMouseMoveRelative);
		var window16 = $window;
		var tmp = function(x,y) {
			_g15(window16,x,y);
		};
		$window.onMouseMoveRelative.add(tmp);
		var _g16 = $bind(this,this.__onLimeMouseUp);
		var window17 = $window;
		var tmp = function(x,y,button) {
			_g16(window17,x,y,button);
		};
		$window.onMouseUp.add(tmp);
		var _g17 = $bind(this,this.__onLimeMouseWheel);
		var window18 = $window;
		var tmp = function(deltaX,deltaY,deltaMode) {
			_g17(window18,deltaX,deltaY,deltaMode);
		};
		$window.onMouseWheel.add(tmp);
		var _g18 = $bind(this,this.__onLimeWindowMove);
		var window19 = $window;
		var tmp = function(x,y) {
			_g18(window19,x,y);
		};
		$window.onMove.add(tmp);
		$window.onRender.add($bind(this,this.__onLimeRender));
		$window.onRenderContextLost.add($bind(this,this.__onLimeRenderContextLost));
		$window.onRenderContextRestored.add($bind(this,this.__onLimeRenderContextRestored));
		var _g19 = $bind(this,this.__onLimeWindowResize);
		var window20 = $window;
		var tmp = function(width,height) {
			_g19(window20,width,height);
		};
		$window.onResize.add(tmp);
		var _g20 = $bind(this,this.__onLimeWindowRestore);
		var window21 = $window;
		var tmp = function() {
			_g20(window21);
		};
		$window.onRestore.add(tmp);
		var _g21 = $bind(this,this.__onLimeTextEdit);
		var window22 = $window;
		var tmp = function(text,start,length) {
			_g21(window22,text,start,length);
		};
		$window.onTextEdit.add(tmp);
		var _g22 = $bind(this,this.__onLimeTextInput);
		var window23 = $window;
		var tmp = function(text) {
			_g22(window23,text);
		};
		$window.onTextInput.add(tmp);
		this.__onLimeWindowCreate($window);
	}
	,__onLimeGamepadAxisMove: function(gamepad,axis,value) {
		try {
			openfl_ui_GameInput.__onGamepadAxisMove(gamepad,axis,value);
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			this.__handleError(e);
		}
	}
	,__onLimeGamepadButtonDown: function(gamepad,button) {
		try {
			openfl_ui_GameInput.__onGamepadButtonDown(gamepad,button);
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			this.__handleError(e);
		}
	}
	,__onLimeGamepadButtonUp: function(gamepad,button) {
		try {
			openfl_ui_GameInput.__onGamepadButtonUp(gamepad,button);
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			this.__handleError(e);
		}
	}
	,__onLimeGamepadConnect: function(gamepad) {
		try {
			openfl_ui_GameInput.__onGamepadConnect(gamepad);
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			this.__handleError(e);
		}
		var _g = $bind(this,this.__onLimeGamepadAxisMove);
		var gamepad1 = gamepad;
		var tmp = function(axis,value) {
			_g(gamepad1,axis,value);
		};
		gamepad.onAxisMove.add(tmp);
		var _g1 = $bind(this,this.__onLimeGamepadButtonDown);
		var gamepad2 = gamepad;
		var tmp = function(button) {
			_g1(gamepad2,button);
		};
		gamepad.onButtonDown.add(tmp);
		var _g2 = $bind(this,this.__onLimeGamepadButtonUp);
		var gamepad3 = gamepad;
		var tmp = function(button) {
			_g2(gamepad3,button);
		};
		gamepad.onButtonUp.add(tmp);
		var _g3 = $bind(this,this.__onLimeGamepadDisconnect);
		var gamepad4 = gamepad;
		var tmp = function() {
			_g3(gamepad4);
		};
		gamepad.onDisconnect.add(tmp);
	}
	,__onLimeGamepadDisconnect: function(gamepad) {
		try {
			openfl_ui_GameInput.__onGamepadDisconnect(gamepad);
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			this.__handleError(e);
		}
	}
	,__onLimeKeyDown: function($window,keyCode,modifier) {
		if(this.window == null || this.window != $window) {
			return;
		}
		this.__onKey("keyDown",keyCode,modifier);
	}
	,__onLimeKeyUp: function($window,keyCode,modifier) {
		if(this.window == null || this.window != $window) {
			return;
		}
		this.__onKey("keyUp",keyCode,modifier);
	}
	,__onLimeModuleExit: function(code) {
		if(this.window != null) {
			var event = null;
			event = new openfl_events_Event("deactivate");
			this.__broadcastEvent(event);
		}
	}
	,__onLimeMouseDown: function($window,x,y,button) {
		if(this.window == null || this.window != $window) {
			return;
		}
		this.__dispatchPendingMouseEvent();
		var type;
		switch(button) {
		case 1:
			type = "middleMouseDown";
			break;
		case 2:
			type = "rightMouseDown";
			break;
		default:
			type = "mouseDown";
		}
		this.__onMouse(type,x * $window.__scale | 0,y * $window.__scale | 0,button);
		if(!this.showDefaultContextMenu && button == 2) {
			$window.onMouseDown.cancel();
		}
	}
	,__onLimeMouseMove: function($window,x,y) {
		if(this.window == null || this.window != $window) {
			return;
		}
		this.__pendingMouseEvent = true;
		this.__pendingMouseX = x * $window.__scale | 0;
		this.__pendingMouseY = y * $window.__scale | 0;
	}
	,__onLimeMouseMoveRelative: function($window,x,y) {
	}
	,__onLimeMouseUp: function($window,x,y,button) {
		if(this.window == null || this.window != $window) {
			return;
		}
		this.__dispatchPendingMouseEvent();
		var type;
		switch(button) {
		case 1:
			type = "middleMouseUp";
			break;
		case 2:
			type = "rightMouseUp";
			break;
		default:
			type = "mouseUp";
		}
		this.__onMouse(type,x * $window.__scale | 0,y * $window.__scale | 0,button);
		if(!this.showDefaultContextMenu && button == 2) {
			$window.onMouseUp.cancel();
		}
	}
	,__onLimeMouseWheel: function($window,deltaX,deltaY,deltaMode) {
		if(this.window == null || this.window != $window) {
			return;
		}
		this.__dispatchPendingMouseEvent();
		if(deltaMode == lime_ui_MouseWheelMode.PIXELS) {
			this.__onMouseWheel(deltaX * $window.__scale | 0,deltaY * $window.__scale | 0,deltaMode);
		} else {
			this.__onMouseWheel(deltaX | 0,deltaY | 0,deltaMode);
		}
	}
	,__onLimeRender: function(context) {
		if(this.__rendering) {
			return;
		}
		this.__rendering = true;
		var event = null;
		this.__broadcastEvent(new openfl_events_Event("enterFrame"));
		this.__broadcastEvent(new openfl_events_Event("frameConstructed"));
		this.__broadcastEvent(new openfl_events_Event("exitFrame"));
		this.__renderable = true;
		this.__enterFrame(this.__deltaTime);
		this.__deltaTime = 0;
		var shouldRender = this.__renderer != null && (this.__renderDirty || this.__forceRender);
		if(this.__invalidated && shouldRender) {
			this.__invalidated = false;
			event = new openfl_events_Event("render");
			this.__broadcastEvent(event);
		}
		this.__update(false,true);
		if(this.__renderer != null) {
			if(this.context3D != null) {
				var stage3D = this.stage3Ds.iterator();
				while(stage3D.hasNext()) {
					var stage3D1 = stage3D.next();
					this.context3D.__renderStage3D(stage3D1);
				}
				if(this.context3D.__present) {
					shouldRender = true;
				}
			}
			if(shouldRender) {
				var tmp = this.__renderer.__type == "cairo";
				if(this.context3D == null) {
					this.__renderer.__clear();
				}
				this.__renderer.__render(this);
			} else if(this.context3D == null) {
				this.window.onRender.cancel();
			}
			if(this.context3D != null) {
				if(!this.context3D.__present) {
					this.window.onRender.cancel();
				} else {
					if(!this.__renderer.__cleared) {
						this.__renderer.__clear();
					}
					this.context3D.__present = false;
					this.context3D.__cleared = false;
				}
			}
			this.__renderer.__cleared = false;
		}
		this.__rendering = false;
	}
	,__onLimeRenderContextLost: function() {
		this.__renderer = null;
		this.context3D = null;
		var stage3D = this.stage3Ds.iterator();
		while(stage3D.hasNext()) {
			var stage3D1 = stage3D.next();
			stage3D1.__lostContext();
		}
	}
	,__onLimeRenderContextRestored: function(context) {
		this.__createRenderer();
		var stage3D = this.stage3Ds.iterator();
		while(stage3D.hasNext()) {
			var stage3D1 = stage3D.next();
			stage3D1.__restoreContext();
		}
	}
	,__onLimeTextEdit: function($window,text,start,length) {
	}
	,__onLimeTextInput: function($window,text) {
		if(this.window == null || this.window != $window) {
			return;
		}
		var stack = [];
		if(this.__focus == null) {
			this.__getInteractive(stack);
		} else {
			this.__focus.__getInteractive(stack);
		}
		var event = new openfl_events_TextEvent("textInput",true,true,text);
		if(stack.length > 0) {
			stack.reverse();
			this.__dispatchStack(event,stack);
		} else {
			this.__dispatchEvent(event);
		}
		if(event.isDefaultPrevented()) {
			$window.onTextInput.cancel();
		}
	}
	,__onLimeTouchCancel: function(touch) {
		var isPrimaryTouchPoint = this.__primaryTouch == touch;
		if(isPrimaryTouchPoint) {
			this.__primaryTouch = null;
		}
		this.__onTouch("touchEnd",touch,isPrimaryTouchPoint);
	}
	,__onLimeTouchMove: function(touch) {
		this.__onTouch("touchMove",touch,this.__primaryTouch == touch);
	}
	,__onLimeTouchEnd: function(touch) {
		var isPrimaryTouchPoint = this.__primaryTouch == touch;
		if(isPrimaryTouchPoint) {
			this.__primaryTouch = null;
		}
		this.__onTouch("touchEnd",touch,isPrimaryTouchPoint);
	}
	,__onLimeTouchStart: function(touch) {
		if(this.__primaryTouch == null) {
			this.__primaryTouch = touch;
		}
		this.__onTouch("touchBegin",touch,this.__primaryTouch == touch);
	}
	,__onLimeUpdate: function(deltaTime) {
		this.__deltaTime = deltaTime;
		this.__dispatchPendingMouseEvent();
	}
	,__onLimeWindowActivate: function($window) {
		if(this.window == null || this.window != $window) {
			return;
		}
	}
	,__onLimeWindowClose: function($window) {
		if(this.window == $window) {
			this.window = null;
		}
		this.__primaryTouch = null;
		var event = null;
		event = new openfl_events_Event("deactivate");
		this.__broadcastEvent(event);
	}
	,__onLimeWindowCreate: function($window) {
		if(this.window == null || this.window != $window) {
			return;
		}
		if($window.context != null) {
			this.__createRenderer();
		}
	}
	,__onLimeWindowDeactivate: function($window) {
		if(this.window == null || this.window != $window) {
			return;
		}
	}
	,__onLimeWindowDropFile: function($window,file) {
	}
	,__onLimeWindowEnter: function($window) {
	}
	,__onLimeWindowExpose: function($window) {
		if(this.window == null || this.window != $window) {
			return;
		}
		this.__renderDirty = true;
	}
	,__onLimeWindowFocusIn: function($window) {
		if(this.window == null || this.window != $window) {
			return;
		}
		this.__renderDirty = true;
		var event = null;
		event = new openfl_events_Event("activate");
		this.__broadcastEvent(event);
		this.set_focus(this.__cacheFocus);
	}
	,__onLimeWindowFocusOut: function($window) {
		if(this.window == null || this.window != $window) {
			return;
		}
		this.__primaryTouch = null;
		var event = null;
		event = new openfl_events_Event("deactivate");
		this.__broadcastEvent(event);
		var currentFocus = this.get_focus();
		this.set_focus(null);
		this.__cacheFocus = currentFocus;
		openfl_events_MouseEvent.__altKey = false;
		openfl_events_MouseEvent.__commandKey = false;
		openfl_events_MouseEvent.__ctrlKey = false;
		openfl_events_MouseEvent.__shiftKey = false;
	}
	,__onLimeWindowFullscreen: function($window) {
		if(this.window == null || this.window != $window) {
			return;
		}
		this.__resize();
		if(!this.__wasFullscreen) {
			this.__wasFullscreen = true;
			if(this.__displayState == 2) {
				this.__displayState = 1;
			}
			this.__dispatchEvent(new openfl_events_FullScreenEvent("fullScreen",false,false,true,true));
		}
	}
	,__onLimeWindowLeave: function($window) {
		if(this.window == null || this.window != $window || openfl_events_MouseEvent.__buttonDown) {
			return;
		}
		this.__dispatchPendingMouseEvent();
		var event = null;
		event = new openfl_events_Event("mouseLeave");
		this.__dispatchEvent(event);
	}
	,__onLimeWindowMinimize: function($window) {
		if(this.window == null || this.window != $window) {
			return;
		}
	}
	,__onLimeWindowMove: function($window,x,y) {
	}
	,__onLimeWindowResize: function($window,width,height) {
		if(this.window == null || this.window != $window) {
			return;
		}
		this.__resize();
		if(this.__wasFullscreen && !$window.__fullscreen) {
			this.__wasFullscreen = false;
			this.__displayState = 2;
			this.__dispatchEvent(new openfl_events_FullScreenEvent("fullScreen",false,false,false,true));
		}
	}
	,__onLimeWindowRestore: function($window) {
		if(this.window == null || this.window != $window) {
			return;
		}
		if(this.__wasFullscreen && !$window.__fullscreen) {
			this.__wasFullscreen = false;
			this.__displayState = 2;
			this.__dispatchEvent(new openfl_events_FullScreenEvent("fullScreen",false,false,false,true));
		}
	}
	,__onMouse: function(type,x,y,button) {
		if(button > 2) {
			return;
		}
		var targetPoint = openfl_geom_Point.__pool.get();
		targetPoint.setTo(x,y);
		var _this = this.__displayMatrix;
		var norm = _this.a * _this.d - _this.b * _this.c;
		if(norm == 0) {
			targetPoint.x = -_this.tx;
			targetPoint.y = -_this.ty;
		} else {
			var px = 1.0 / norm * (_this.c * (_this.ty - targetPoint.y) + _this.d * (targetPoint.x - _this.tx));
			targetPoint.y = 1.0 / norm * (_this.a * (targetPoint.y - _this.ty) + _this.b * (_this.tx - targetPoint.x));
			targetPoint.x = px;
		}
		this.__mouseX = targetPoint.x;
		this.__mouseY = targetPoint.y;
		var stack = [];
		var target = null;
		if(this.__hitTest(this.__mouseX,this.__mouseY,true,stack,true,this)) {
			target = stack[stack.length - 1];
		} else {
			target = this;
			stack = [this];
		}
		if(target == null) {
			target = this;
		}
		var clickType = null;
		switch(type) {
		case "middleMouseDown":
			this.__mouseDownMiddle = target;
			break;
		case "middleMouseUp":
			if(this.__mouseDownMiddle == target) {
				clickType = "middleClick";
			}
			this.__mouseDownMiddle = null;
			break;
		case "mouseDown":
			if(target.__allowMouseFocus()) {
				if(this.get_focus() != null) {
					var focusEvent = new openfl_events_FocusEvent("mouseFocusChange",true,true,target,false,0);
					this.__dispatchStack(focusEvent,stack);
					if(!focusEvent.isDefaultPrevented()) {
						this.set_focus(target);
					}
				} else {
					this.set_focus(target);
				}
			} else {
				this.set_focus(null);
			}
			this.__mouseDownLeft = target;
			openfl_events_MouseEvent.__buttonDown = true;
			break;
		case "mouseUp":
			if(this.__mouseDownLeft != null) {
				openfl_events_MouseEvent.__buttonDown = false;
				if(this.__mouseDownLeft == target) {
					clickType = "click";
				} else {
					var event = null;
					event = openfl_events_MouseEvent.__create("releaseOutside",1,this.__mouseX,this.__mouseY,new openfl_geom_Point(this.__mouseX,this.__mouseY),this);
					this.__mouseDownLeft.dispatchEvent(event);
				}
				this.__mouseDownLeft = null;
			}
			break;
		case "rightMouseDown":
			this.__mouseDownRight = target;
			break;
		case "rightMouseUp":
			if(this.__mouseDownRight == target) {
				clickType = "rightClick";
			}
			this.__mouseDownRight = null;
			break;
		default:
		}
		var localPoint = openfl_geom_Point.__pool.get();
		var event = null;
		event = openfl_events_MouseEvent.__create(type,button,this.__mouseX,this.__mouseY,target.__globalToLocal(targetPoint,localPoint),target);
		this.__dispatchStack(event,stack);
		if(clickType != null) {
			event = openfl_events_MouseEvent.__create(clickType,button,this.__mouseX,this.__mouseY,target.__globalToLocal(targetPoint,localPoint),target);
			this.__dispatchStack(event,stack);
			if(type == "mouseUp" && (js_Boot.__cast(target , openfl_display_InteractiveObject)).doubleClickEnabled) {
				var currentTime = openfl_Lib.getTimer();
				if(currentTime - this.__lastClickTime < 500) {
					event = openfl_events_MouseEvent.__create("doubleClick",button,this.__mouseX,this.__mouseY,target.__globalToLocal(targetPoint,localPoint),target);
					this.__dispatchStack(event,stack);
					this.__lastClickTime = 0;
				} else {
					this.__lastClickTime = currentTime;
				}
			}
		}
		if(openfl_ui_Mouse.__cursor == "auto" && !openfl_ui_Mouse.__hidden) {
			var cursor = null;
			if(this.__mouseDownLeft != null) {
				cursor = this.__mouseDownLeft.__getCursor();
			} else {
				var _g = 0;
				while(_g < stack.length) {
					var target1 = stack[_g];
					++_g;
					cursor = target1.__getCursor();
					if(cursor != null) {
						this.window.set_cursor(openfl_ui_MouseCursor.toLimeCursor(cursor));
						break;
					}
				}
			}
			if(cursor == null) {
				this.window.set_cursor(lime_ui_MouseCursor.ARROW);
			}
		}
		var event;
		if(target != this.__mouseOverTarget) {
			if(this.__mouseOverTarget != null) {
				event = openfl_events_MouseEvent.__create("mouseOut",button,this.__mouseX,this.__mouseY,this.__mouseOverTarget.__globalToLocal(targetPoint,localPoint),this.__mouseOverTarget);
				this.__dispatchStack(event,this.__mouseOutStack);
			}
		}
		var item;
		var i = 0;
		while(i < this.__rollOutStack.length) {
			item = this.__rollOutStack[i];
			if(stack.indexOf(item) == -1) {
				HxOverrides.remove(this.__rollOutStack,item);
				event = openfl_events_MouseEvent.__create("rollOut",button,this.__mouseX,this.__mouseY,this.__mouseOverTarget.__globalToLocal(targetPoint,localPoint),this.__mouseOverTarget);
				event.bubbles = false;
				this.__dispatchTarget(item,event);
			} else {
				++i;
			}
		}
		var _g = 0;
		while(_g < stack.length) {
			var item = stack[_g];
			++_g;
			if(this.__rollOutStack.indexOf(item) == -1 && this.__mouseOverTarget != null) {
				if(item.hasEventListener("rollOver")) {
					event = openfl_events_MouseEvent.__create("rollOver",button,this.__mouseX,this.__mouseY,this.__mouseOverTarget.__globalToLocal(targetPoint,localPoint),item);
					event.bubbles = false;
					this.__dispatchTarget(item,event);
				}
				if(item.hasEventListener("rollOut") || item.hasEventListener("rollOver")) {
					this.__rollOutStack.push(item);
				}
			}
		}
		if(target != this.__mouseOverTarget) {
			if(target != null) {
				event = openfl_events_MouseEvent.__create("mouseOver",button,this.__mouseX,this.__mouseY,target.__globalToLocal(targetPoint,localPoint),target);
				this.__dispatchStack(event,stack);
			}
			this.__mouseOverTarget = target;
			this.__mouseOutStack = stack;
		}
		if(this.__dragObject != null) {
			this.__drag(targetPoint);
			var dropTarget = null;
			if(this.__mouseOverTarget == this.__dragObject) {
				var cacheMouseEnabled = this.__dragObject.mouseEnabled;
				var cacheMouseChildren = this.__dragObject.mouseChildren;
				this.__dragObject.mouseEnabled = false;
				this.__dragObject.mouseChildren = false;
				var stack = [];
				if(this.__hitTest(this.__mouseX,this.__mouseY,true,stack,true,this)) {
					dropTarget = stack[stack.length - 1];
				}
				this.__dragObject.mouseEnabled = cacheMouseEnabled;
				this.__dragObject.mouseChildren = cacheMouseChildren;
			} else if(this.__mouseOverTarget != this) {
				dropTarget = this.__mouseOverTarget;
			}
			this.__dragObject.dropTarget = dropTarget;
		}
		openfl_geom_Point.__pool.release(targetPoint);
		openfl_geom_Point.__pool.release(localPoint);
	}
	,__onMouseWheel: function(deltaX,deltaY,deltaMode) {
		var x = this.__mouseX;
		var y = this.__mouseY;
		var stack = [];
		var target = null;
		if(this.__hitTest(this.__mouseX,this.__mouseY,true,stack,true,this)) {
			target = stack[stack.length - 1];
		} else {
			target = this;
			stack = [this];
		}
		if(target == null) {
			target = this;
		}
		var targetPoint = openfl_geom_Point.__pool.get();
		targetPoint.setTo(x,y);
		var _this = this.__displayMatrix;
		var norm = _this.a * _this.d - _this.b * _this.c;
		if(norm == 0) {
			targetPoint.x = -_this.tx;
			targetPoint.y = -_this.ty;
		} else {
			var px = 1.0 / norm * (_this.c * (_this.ty - targetPoint.y) + _this.d * (targetPoint.x - _this.tx));
			targetPoint.y = 1.0 / norm * (_this.a * (targetPoint.y - _this.ty) + _this.b * (_this.tx - targetPoint.x));
			targetPoint.x = px;
		}
		var delta = deltaY | 0;
		var event = openfl_events_MouseEvent.__create("mouseWheel",0,this.__mouseX,this.__mouseY,target.__globalToLocal(targetPoint,targetPoint),target,delta);
		event.cancelable = true;
		this.__dispatchStack(event,stack);
		if(event.isDefaultPrevented()) {
			this.window.onMouseWheel.cancel();
		}
		openfl_geom_Point.__pool.release(targetPoint);
	}
	,__onTouch: function(type,touch,isPrimaryTouchPoint) {
		var targetPoint = openfl_geom_Point.__pool.get();
		targetPoint.setTo(Math.round(touch.x * this.window.__width * this.window.__scale),Math.round(touch.y * this.window.__height * this.window.__scale));
		var _this = this.__displayMatrix;
		var norm = _this.a * _this.d - _this.b * _this.c;
		if(norm == 0) {
			targetPoint.x = -_this.tx;
			targetPoint.y = -_this.ty;
		} else {
			var px = 1.0 / norm * (_this.c * (_this.ty - targetPoint.y) + _this.d * (targetPoint.x - _this.tx));
			targetPoint.y = 1.0 / norm * (_this.a * (targetPoint.y - _this.ty) + _this.b * (_this.tx - targetPoint.x));
			targetPoint.x = px;
		}
		var touchX = targetPoint.x;
		var touchY = targetPoint.y;
		var stack = [];
		var target = null;
		if(this.__hitTest(touchX,touchY,false,stack,true,this)) {
			target = stack[stack.length - 1];
		} else {
			target = this;
			stack = [this];
		}
		if(target == null) {
			target = this;
		}
		var touchId = touch.id;
		var touchData = null;
		if(this.__touchData.h.hasOwnProperty(touchId)) {
			touchData = this.__touchData.h[touchId];
		} else {
			touchData = openfl__$internal_utils_TouchData.__pool.get();
			touchData.reset();
			touchData.touch = touch;
			this.__touchData.h[touchId] = touchData;
		}
		var touchType = null;
		var releaseTouchData = false;
		switch(type) {
		case "touchBegin":
			touchData.touchDownTarget = target;
			break;
		case "touchEnd":
			if(touchData.touchDownTarget == target) {
				touchType = "touchTap";
			}
			touchData.touchDownTarget = null;
			releaseTouchData = true;
			break;
		default:
		}
		var localPoint = openfl_geom_Point.__pool.get();
		var touchEvent = openfl_events_TouchEvent.__create(type,null,touchX,touchY,target.__globalToLocal(targetPoint,localPoint),target);
		touchEvent.touchPointID = touchId;
		touchEvent.isPrimaryTouchPoint = isPrimaryTouchPoint;
		touchEvent.pressure = touch.pressure;
		this.__dispatchStack(touchEvent,stack);
		if(touchType != null) {
			touchEvent = openfl_events_TouchEvent.__create(touchType,null,touchX,touchY,target.__globalToLocal(targetPoint,localPoint),target);
			touchEvent.touchPointID = touchId;
			touchEvent.isPrimaryTouchPoint = isPrimaryTouchPoint;
			touchEvent.pressure = touch.pressure;
			this.__dispatchStack(touchEvent,stack);
		}
		var touchOverTarget = touchData.touchOverTarget;
		if(target != touchOverTarget && touchOverTarget != null) {
			touchEvent = openfl_events_TouchEvent.__create("touchOut",null,touchX,touchY,touchOverTarget.__globalToLocal(targetPoint,localPoint),touchOverTarget);
			touchEvent.touchPointID = touchId;
			touchEvent.isPrimaryTouchPoint = isPrimaryTouchPoint;
			touchEvent.pressure = touch.pressure;
			this.__dispatchTarget(touchOverTarget,touchEvent);
		}
		var touchOutStack = touchData.rollOutStack;
		var item;
		var i = 0;
		while(i < touchOutStack.length) {
			item = touchOutStack[i];
			if(stack.indexOf(item) == -1) {
				HxOverrides.remove(touchOutStack,item);
				touchEvent = openfl_events_TouchEvent.__create("touchRollOut",null,touchX,touchY,touchOverTarget.__globalToLocal(targetPoint,localPoint),touchOverTarget);
				touchEvent.touchPointID = touchId;
				touchEvent.isPrimaryTouchPoint = isPrimaryTouchPoint;
				touchEvent.bubbles = false;
				touchEvent.pressure = touch.pressure;
				this.__dispatchTarget(item,touchEvent);
			} else {
				++i;
			}
		}
		var _g = 0;
		while(_g < stack.length) {
			var item = stack[_g];
			++_g;
			if(touchOutStack.indexOf(item) == -1) {
				if(item.hasEventListener("touchRollOver")) {
					touchEvent = openfl_events_TouchEvent.__create("touchRollOver",null,touchX,touchY,touchOverTarget.__globalToLocal(targetPoint,localPoint),item);
					touchEvent.touchPointID = touchId;
					touchEvent.isPrimaryTouchPoint = isPrimaryTouchPoint;
					touchEvent.bubbles = false;
					touchEvent.pressure = touch.pressure;
					this.__dispatchTarget(item,touchEvent);
				}
				if(item.hasEventListener("touchRollOut")) {
					touchOutStack.push(item);
				}
			}
		}
		if(target != touchOverTarget) {
			if(target != null) {
				touchEvent = openfl_events_TouchEvent.__create("touchOver",null,touchX,touchY,target.__globalToLocal(targetPoint,localPoint),target);
				touchEvent.touchPointID = touchId;
				touchEvent.isPrimaryTouchPoint = isPrimaryTouchPoint;
				touchEvent.bubbles = true;
				touchEvent.pressure = touch.pressure;
				this.__dispatchTarget(target,touchEvent);
			}
			touchData.touchOverTarget = target;
		}
		openfl_geom_Point.__pool.release(targetPoint);
		openfl_geom_Point.__pool.release(localPoint);
		if(releaseTouchData) {
			this.__touchData.remove(touchId);
			touchData.reset();
			openfl__$internal_utils_TouchData.__pool.release(touchData);
		}
	}
	,__registerLimeModule: function(application) {
		application.onCreateWindow.add($bind(this,this.__onLimeCreateWindow));
		application.onUpdate.add($bind(this,this.__onLimeUpdate));
		application.onExit.add($bind(this,this.__onLimeModuleExit),false,0);
		var gamepad = lime_ui_Gamepad.devices.iterator();
		while(gamepad.hasNext()) {
			var gamepad1 = gamepad.next();
			this.__onLimeGamepadConnect(gamepad1);
		}
		lime_ui_Gamepad.onConnect.add($bind(this,this.__onLimeGamepadConnect));
		lime_ui_Touch.onStart.add($bind(this,this.__onLimeTouchStart));
		lime_ui_Touch.onMove.add($bind(this,this.__onLimeTouchMove));
		lime_ui_Touch.onEnd.add($bind(this,this.__onLimeTouchEnd));
		lime_ui_Touch.onCancel.add($bind(this,this.__onLimeTouchCancel));
	}
	,__resize: function() {
		var cacheWidth = this.stageWidth;
		var cacheHeight = this.stageHeight;
		var windowWidth = this.window.__width * this.window.__scale | 0;
		var windowHeight = this.window.__height * this.window.__scale | 0;
		this.__logicalWidth = windowWidth;
		this.__logicalHeight = windowHeight;
		this.__displayMatrix.identity();
		if(this.get_fullScreenSourceRect() != null && this.window.__fullscreen) {
			this.stageWidth = this.get_fullScreenSourceRect().width | 0;
			this.stageHeight = this.get_fullScreenSourceRect().height | 0;
			var displayScaleX = windowWidth / this.stageWidth;
			var displayScaleY = windowHeight / this.stageHeight;
			this.__displayMatrix.translate(-this.get_fullScreenSourceRect().x,-this.get_fullScreenSourceRect().y);
			this.__displayMatrix.scale(displayScaleX,displayScaleY);
			this.__displayRect.setTo(this.get_fullScreenSourceRect().get_left(),this.get_fullScreenSourceRect().get_right(),this.get_fullScreenSourceRect().get_top(),this.get_fullScreenSourceRect().get_bottom());
		} else {
			if(this.__logicalWidth == 0 && this.__logicalHeight == 0) {
				this.stageWidth = windowWidth;
				this.stageHeight = windowHeight;
			} else {
				this.stageWidth = this.__logicalWidth;
				this.stageHeight = this.__logicalHeight;
				var scaleX = windowWidth / this.stageWidth;
				var scaleY = windowHeight / this.stageHeight;
				var targetScale = Math.min(scaleX,scaleY);
				var offsetX = Math.round((windowWidth - this.stageWidth * targetScale) / 2);
				var offsetY = Math.round((windowHeight - this.stageHeight * targetScale) / 2);
				this.__displayMatrix.scale(targetScale,targetScale);
				this.__displayMatrix.translate(offsetX,offsetY);
			}
			this.__displayRect.setTo(0,0,this.stageWidth,this.stageHeight);
		}
		if(this.context3D != null) {
			this.context3D.configureBackBuffer(windowWidth,windowHeight,0,true,true,true);
		}
		var stage3D = this.stage3Ds.iterator();
		while(stage3D.hasNext()) {
			var stage3D1 = stage3D.next();
			stage3D1.__resize(windowWidth,windowHeight);
		}
		if(this.__renderer != null) {
			this.__renderer.__resize(windowWidth,windowHeight);
		}
		if(this.stageWidth != cacheWidth || this.stageHeight != cacheHeight) {
			this.__renderDirty = true;
			this.__setTransformDirty();
			var event = null;
			event = new openfl_events_Event("resize");
			this.__dispatchEvent(event);
		}
	}
	,__setLogicalSize: function(width,height) {
		this.__logicalWidth = width;
		this.__logicalHeight = height;
		this.__resize();
	}
	,__startDrag: function(sprite,lockCenter,bounds) {
		if(bounds == null) {
			this.__dragBounds = null;
		} else {
			this.__dragBounds = new openfl_geom_Rectangle();
			var right = bounds.get_right();
			var bottom = bounds.get_bottom();
			this.__dragBounds.x = right < bounds.x ? right : bounds.x;
			this.__dragBounds.y = bottom < bounds.y ? bottom : bounds.y;
			this.__dragBounds.width = Math.abs(bounds.width);
			this.__dragBounds.height = Math.abs(bounds.height);
		}
		this.__dragObject = sprite;
		if(this.__dragObject != null) {
			if(lockCenter) {
				this.__dragOffsetX = 0;
				this.__dragOffsetY = 0;
			} else {
				var mouse = openfl_geom_Point.__pool.get();
				mouse.setTo(this.get_mouseX(),this.get_mouseY());
				var parent = this.__dragObject.parent;
				if(parent != null) {
					var _this = parent.__getWorldTransform();
					var norm = _this.a * _this.d - _this.b * _this.c;
					if(norm == 0) {
						mouse.x = -_this.tx;
						mouse.y = -_this.ty;
					} else {
						var px = 1.0 / norm * (_this.c * (_this.ty - mouse.y) + _this.d * (mouse.x - _this.tx));
						mouse.y = 1.0 / norm * (_this.a * (mouse.y - _this.ty) + _this.b * (_this.tx - mouse.x));
						mouse.x = px;
					}
				}
				this.__dragOffsetX = this.__dragObject.get_x() - mouse.x;
				this.__dragOffsetY = this.__dragObject.get_y() - mouse.y;
				openfl_geom_Point.__pool.release(mouse);
			}
		}
	}
	,__stopDrag: function(sprite) {
		this.__dragBounds = null;
		this.__dragObject = null;
	}
	,__unregisterLimeModule: function(application) {
		application.onCreateWindow.remove($bind(this,this.__onLimeCreateWindow));
		application.onUpdate.remove($bind(this,this.__onLimeUpdate));
		application.onExit.remove($bind(this,this.__onLimeModuleExit));
		lime_ui_Gamepad.onConnect.remove($bind(this,this.__onLimeGamepadConnect));
		lime_ui_Touch.onStart.remove($bind(this,this.__onLimeTouchStart));
		lime_ui_Touch.onMove.remove($bind(this,this.__onLimeTouchMove));
		lime_ui_Touch.onEnd.remove($bind(this,this.__onLimeTouchEnd));
		lime_ui_Touch.onCancel.remove($bind(this,this.__onLimeTouchCancel));
	}
	,__update: function(transformOnly,updateChildren) {
		if(transformOnly) {
			if(this.__transformDirty) {
				openfl_display_DisplayObjectContainer.prototype.__update.call(this,true,updateChildren);
				if(updateChildren) {
					this.__transformDirty = false;
				}
			}
		} else if(this.__transformDirty || this.__renderDirty) {
			openfl_display_DisplayObjectContainer.prototype.__update.call(this,false,updateChildren);
			if(updateChildren) {
				if(openfl_display_DisplayObject.__supportDOM) {
					this.__wasDirty = true;
				}
			}
		} else if(!this.__renderDirty && this.__wasDirty) {
			openfl_display_DisplayObjectContainer.prototype.__update.call(this,false,updateChildren);
			if(updateChildren) {
				this.__wasDirty = false;
			}
		}
	}
	,get_color: function() {
		return this.__color;
	}
	,set_color: function(value) {
		if(value == null) {
			this.__transparent = true;
			value = 0;
		} else {
			this.__transparent = false;
		}
		if(this.__color != value) {
			var r = (value & 16711680) >>> 16;
			var g = (value & 65280) >>> 8;
			var b = value & 255;
			this.__colorSplit[0] = r / 255;
			this.__colorSplit[1] = g / 255;
			this.__colorSplit[2] = b / 255;
			this.__colorString = "#" + StringTools.hex(value & 16777215,6);
			this.__renderDirty = true;
			this.__color = -16777216 | value & 16777215;
		}
		return value;
	}
	,get_contentsScaleFactor: function() {
		return this.__contentsScaleFactor;
	}
	,get_displayState: function() {
		return this.__displayState;
	}
	,set_displayState: function(value) {
		if(this.window != null) {
			if(value == 2) {
				if(this.window.__fullscreen) {
					this.window.set_fullscreen(false);
				}
			} else if(!this.window.__fullscreen) {
				this.window.set_fullscreen(true);
			}
		}
		return this.__displayState = value;
	}
	,get_focus: function() {
		return this.__focus;
	}
	,set_focus: function(value) {
		if(value != this.__focus) {
			var oldFocus = this.__focus;
			this.__focus = value;
			this.__cacheFocus = value;
			if(oldFocus != null) {
				var event = new openfl_events_FocusEvent("focusOut",true,false,value,false,0);
				var stack = [];
				oldFocus.__getInteractive(stack);
				stack.reverse();
				this.__dispatchStack(event,stack);
			}
			if(value != null) {
				var event = new openfl_events_FocusEvent("focusIn",true,false,oldFocus,false,0);
				var stack = [];
				value.__getInteractive(stack);
				stack.reverse();
				this.__dispatchStack(event,stack);
			}
		}
		return value;
	}
	,get_frameRate: function() {
		if(this.window != null) {
			return this.window.__backend.getFrameRate();
		}
		return 0;
	}
	,set_frameRate: function(value) {
		if(this.window != null) {
			return this.window.__backend.setFrameRate(value);
		}
		return value;
	}
	,get_fullScreenHeight: function() {
		return Math.ceil(this.window.get_display().currentMode.height * this.window.__scale);
	}
	,get_fullScreenSourceRect: function() {
		if(this.__fullScreenSourceRect == null) {
			return null;
		} else {
			return this.__fullScreenSourceRect.clone();
		}
	}
	,set_fullScreenSourceRect: function(value) {
		if(value == null) {
			if(this.__fullScreenSourceRect != null) {
				this.__fullScreenSourceRect = null;
				this.__resize();
			}
		} else if(!value.equals(this.__fullScreenSourceRect)) {
			this.__fullScreenSourceRect = value.clone();
			this.__resize();
		}
		return value;
	}
	,get_fullScreenWidth: function() {
		return Math.ceil(this.window.get_display().currentMode.width * this.window.__scale);
	}
	,set_height: function(value) {
		return this.get_height();
	}
	,get_mouseX: function() {
		return this.__mouseX;
	}
	,get_mouseY: function() {
		return this.__mouseY;
	}
	,get_quality: function() {
		return this.__quality;
	}
	,set_quality: function(value) {
		this.__quality = value;
		if(this.__renderer != null) {
			var tmp = this.get_quality();
			this.__renderer.__allowSmoothing = tmp != 2;
		}
		return value;
	}
	,set_rotation: function(value) {
		return 0;
	}
	,get_scaleMode: function() {
		return this.__scaleMode;
	}
	,set_scaleMode: function(value) {
		return this.__scaleMode = value;
	}
	,set_scaleX: function(value) {
		return 0;
	}
	,set_scaleY: function(value) {
		return 0;
	}
	,get_tabEnabled: function() {
		return false;
	}
	,set_tabEnabled: function(value) {
		throw haxe_Exception.thrown(new openfl_errors_IllegalOperationError("Error: The Stage class does not implement this property or method."));
	}
	,get_tabIndex: function() {
		return -1;
	}
	,set_tabIndex: function(value) {
		throw haxe_Exception.thrown(new openfl_errors_IllegalOperationError("Error: The Stage class does not implement this property or method."));
	}
	,set_transform: function(value) {
		return this.get_transform();
	}
	,set_width: function(value) {
		return this.get_width();
	}
	,set_x: function(value) {
		return 0;
	}
	,set_y: function(value) {
		return 0;
	}
	,__class__: openfl_display_Stage
	,__properties__: $extend(openfl_display_DisplayObjectContainer.prototype.__properties__,{set_scaleMode:"set_scaleMode",get_scaleMode:"get_scaleMode",set_quality:"set_quality",get_quality:"get_quality",get_fullScreenWidth:"get_fullScreenWidth",set_fullScreenSourceRect:"set_fullScreenSourceRect",get_fullScreenSourceRect:"get_fullScreenSourceRect",get_fullScreenHeight:"get_fullScreenHeight",set_frameRate:"set_frameRate",get_frameRate:"get_frameRate",set_focus:"set_focus",get_focus:"get_focus",set_displayState:"set_displayState",get_displayState:"get_displayState",get_contentsScaleFactor:"get_contentsScaleFactor",set_color:"set_color",get_color:"get_color"})
});
var openfl_display_Stage3D = function(stage) {
	openfl_events_EventDispatcher.call(this);
	this.__stage = stage;
	this.__height = 0;
	this.__projectionTransform = new openfl_geom_Matrix3D();
	this.__renderTransform = new openfl_geom_Matrix3D();
	this.__width = 0;
	this.__x = 0;
	this.__y = 0;
	this.visible = true;
	if(stage.stageWidth > 0 && stage.stageHeight > 0) {
		this.__resize(stage.stageWidth,stage.stageHeight);
	}
};
$hxClasses["openfl.display.Stage3D"] = openfl_display_Stage3D;
openfl_display_Stage3D.__name__ = "openfl.display.Stage3D";
openfl_display_Stage3D.__active = null;
openfl_display_Stage3D.__super__ = openfl_events_EventDispatcher;
openfl_display_Stage3D.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	context3D: null
	,visible: null
	,__contextLost: null
	,__contextRequested: null
	,__height: null
	,__indexBuffer: null
	,__projectionTransform: null
	,__renderTransform: null
	,__stage: null
	,__vertexBuffer: null
	,__width: null
	,__x: null
	,__y: null
	,__canvas: null
	,__renderContext: null
	,__style: null
	,__webgl: null
	,requestContext3D: function(context3DRenderMode,profile) {
		if(profile == null) {
			profile = 0;
		}
		if(context3DRenderMode == null) {
			context3DRenderMode = 0;
		}
		if(this.__contextLost) {
			this.__contextRequested = true;
			return;
		}
		if(this.context3D != null) {
			this.__contextRequested = true;
			haxe_Timer.delay($bind(this,this.__dispatchCreate),1);
		} else if(!this.__contextRequested) {
			this.__contextRequested = true;
			haxe_Timer.delay($bind(this,this.__createContext),1);
		}
	}
	,requestContext3DMatchingProfiles: function(profiles) {
		this.requestContext3D();
	}
	,__createContext: function() {
		var stage = this.__stage;
		var renderer = stage.__renderer;
		if(renderer.__type == "cairo" || renderer.__type == "canvas") {
			this.__dispatchError();
			return;
		}
		if(renderer.__type == "opengl") {
			this.context3D = new openfl_display3D_Context3D(stage,stage.context3D.__contextState,this);
			this.__dispatchCreate();
		} else if(renderer.__type == "dom") {
			this.__canvas = window.document.createElement("canvas");
			this.__canvas.width = stage.stageWidth;
			this.__canvas.height = stage.stageHeight;
			var $window = stage.window;
			var attributes = renderer.__context.attributes;
			var transparentBackground = Object.prototype.hasOwnProperty.call(attributes,"background") && attributes.background == null;
			var colorDepth = Object.prototype.hasOwnProperty.call(attributes,"colorDepth") ? attributes.colorDepth : 32;
			var options = Object.prototype.hasOwnProperty.call(attributes,"antialiasing") && attributes.antialiasing > 0;
			var options1 = { alpha : transparentBackground || colorDepth > 16, antialias : options, depth : true, premultipliedAlpha : true, stencil : true, preserveDrawingBuffer : false};
			this.__webgl = js_html__$CanvasElement_CanvasUtil.getContextWebGL(this.__canvas,options1);
			if(this.__webgl != null) {
				this.__dispatchError();
			} else {
				this.__dispatchError();
			}
		}
	}
	,__dispatchError: function() {
		this.__contextRequested = false;
		this.dispatchEvent(new openfl_events_ErrorEvent("error",false,false,"Context3D not available"));
	}
	,__dispatchCreate: function() {
		if(this.__contextRequested) {
			this.__contextRequested = false;
			this.dispatchEvent(new openfl_events_Event("context3DCreate"));
		}
	}
	,__lostContext: function() {
		this.__contextLost = true;
		if(this.context3D != null) {
			this.context3D.__dispose();
			this.__contextRequested = true;
		}
	}
	,__resize: function(width,height) {
		if(width != this.__width || height != this.__height) {
			if(this.__canvas != null) {
				this.__canvas.width = width;
				this.__canvas.height = height;
			}
			this.__projectionTransform.copyRawDataFrom(openfl_Vector.toFloatVector(null,null,null,[2.0 / (width > 0 ? width : 1),0.0,0.0,0.0,0.0,-2.0 / (height > 0 ? height : 1),0.0,0.0,0.0,0.0,-0.001,0.0,-1.0,1.0,0.0,1.0]));
			this.__renderTransform.identity();
			this.__renderTransform.appendTranslation(this.__x,this.__y,0);
			this.__renderTransform.append(this.__projectionTransform);
			this.__width = width;
			this.__height = height;
		}
	}
	,__restoreContext: function() {
		this.__contextLost = false;
		this.__createContext();
	}
	,get_x: function() {
		return this.__x;
	}
	,set_x: function(value) {
		if(this.__x == value) {
			return value;
		}
		this.__x = value;
		this.__renderTransform.identity();
		this.__renderTransform.appendTranslation(this.__x,this.__y,0);
		this.__renderTransform.append(this.__projectionTransform);
		return value;
	}
	,get_y: function() {
		return this.__y;
	}
	,set_y: function(value) {
		if(this.__y == value) {
			return value;
		}
		this.__y = value;
		this.__renderTransform.identity();
		this.__renderTransform.appendTranslation(this.__x,this.__y,0);
		this.__renderTransform.append(this.__projectionTransform);
		return value;
	}
	,__class__: openfl_display_Stage3D
	,__properties__: {set_y:"set_y",get_y:"get_y",set_x:"set_x",get_x:"get_x"}
});
var openfl_display_StageAlign = {};
openfl_display_StageAlign.fromString = function(value) {
	switch(value) {
	case "bottom":
		return 0;
	case "bottomLeft":
		return 1;
	case "bottomRight":
		return 2;
	case "left":
		return 3;
	case "right":
		return 4;
	case "top":
		return 5;
	case "topLeft":
		return 6;
	case "topRight":
		return 7;
	default:
		return null;
	}
};
openfl_display_StageAlign.toString = function(this1) {
	switch(this1) {
	case 0:
		return "bottom";
	case 1:
		return "bottomLeft";
	case 2:
		return "bottomRight";
	case 3:
		return "left";
	case 4:
		return "right";
	case 5:
		return "top";
	case 6:
		return "topLeft";
	case 7:
		return "topRight";
	default:
		return null;
	}
};
var openfl_display_StageDisplayState = {};
openfl_display_StageDisplayState.fromString = function(value) {
	switch(value) {
	case "fullScreen":
		return 0;
	case "fullScreenInteractive":
		return 1;
	case "normal":
		return 2;
	default:
		return null;
	}
};
openfl_display_StageDisplayState.toString = function(this1) {
	switch(this1) {
	case 0:
		return "fullScreen";
	case 1:
		return "fullScreenInteractive";
	case 2:
		return "normal";
	default:
		return null;
	}
};
var openfl_display_StageQuality = {};
openfl_display_StageQuality.fromString = function(value) {
	switch(value) {
	case "best":
		return 0;
	case "high":
		return 1;
	case "low":
		return 2;
	case "medium":
		return 3;
	default:
		return null;
	}
};
openfl_display_StageQuality.toString = function(this1) {
	switch(this1) {
	case 0:
		return "best";
	case 1:
		return "high";
	case 2:
		return "low";
	case 3:
		return "medium";
	default:
		return null;
	}
};
var openfl_display_StageScaleMode = {};
openfl_display_StageScaleMode.fromString = function(value) {
	switch(value) {
	case "exactFit":
		return 0;
	case "noBorder":
		return 1;
	case "noScale":
		return 2;
	case "showAll":
		return 3;
	default:
		return null;
	}
};
openfl_display_StageScaleMode.toString = function(this1) {
	switch(this1) {
	case 0:
		return "exactFit";
	case 1:
		return "noBorder";
	case 2:
		return "noScale";
	case 3:
		return "showAll";
	default:
		return null;
	}
};
var openfl_display_Timeline = function() {
	this.__framesLoaded = 1;
	this.__totalFrames = 1;
	this.__currentLabels = [];
	this.__currentFrame = 1;
	this.__lastFrameScriptEval = -1;
	this.__lastFrameUpdate = -1;
};
$hxClasses["openfl.display.Timeline"] = openfl_display_Timeline;
openfl_display_Timeline.__name__ = "openfl.display.Timeline";
openfl_display_Timeline.prototype = {
	frameRate: null
	,scenes: null
	,scripts: null
	,__currentFrame: null
	,__currentFrameLabel: null
	,__currentLabel: null
	,__currentLabels: null
	,__currentScene: null
	,__frameScripts: null
	,__framesLoaded: null
	,__frameTime: null
	,__isPlaying: null
	,__lastFrameScriptEval: null
	,__lastFrameUpdate: null
	,__scope: null
	,__timeElapsed: null
	,__totalFrames: null
	,attachMovieClip: function(movieClip) {
	}
	,enterFrame: function(frame) {
	}
	,__addFrameScript: function(index,method) {
		if(index < 0) {
			return;
		}
		var frame = index + 1;
		if(method != null) {
			if(this.__frameScripts == null) {
				this.__frameScripts = new haxe_ds_IntMap();
			}
			this.__frameScripts.h[frame] = function(scope) {
				method();
			};
		} else if(this.__frameScripts != null) {
			this.__frameScripts.remove(frame);
		}
	}
	,__attachMovieClip: function(movieClip) {
		this.__scope = movieClip;
		this.__totalFrames = 0;
		this.__framesLoaded = 0;
		if(this.scenes != null && this.scenes.length > 0) {
			var _g = 0;
			var _g1 = this.scenes;
			while(_g < _g1.length) {
				var scene = _g1[_g];
				++_g;
				this.__totalFrames += scene.numFrames;
				this.__framesLoaded += scene.numFrames;
				if(scene.labels != null) {
					this.__currentLabels = this.__currentLabels.concat(scene.labels);
				}
			}
			this.__currentScene = this.scenes[0];
		}
		if(this.scripts != null && this.scripts.length > 0) {
			this.__frameScripts = new haxe_ds_IntMap();
			var _g = 0;
			var _g1 = this.scripts;
			while(_g < _g1.length) {
				var script = _g1[_g];
				++_g;
				this.__frameScripts.h[script.frame] = script.script;
			}
		}
		this.attachMovieClip(movieClip);
	}
	,__enterFrame: function(deltaTime) {
		if(this.__isPlaying) {
			var nextFrame = this.__getNextFrame(deltaTime);
			if(this.__lastFrameScriptEval == nextFrame) {
				return;
			}
			if(this.__frameScripts != null) {
				if(nextFrame < this.__currentFrame) {
					if(!this.__evaluateFrameScripts(this.__totalFrames)) {
						return;
					}
					this.__currentFrame = 1;
				}
				if(!this.__evaluateFrameScripts(nextFrame)) {
					return;
				}
			} else {
				this.__currentFrame = nextFrame;
			}
		}
		this.__updateSymbol(this.__currentFrame);
	}
	,__evaluateFrameScripts: function(advanceToFrame) {
		if(this.__frameScripts == null) {
			return true;
		}
		var _g = this.__currentFrame;
		var _g1 = advanceToFrame + 1;
		while(_g < _g1) {
			var frame = _g++;
			if(frame == this.__lastFrameScriptEval) {
				continue;
			}
			this.__lastFrameScriptEval = frame;
			this.__currentFrame = frame;
			if(this.__frameScripts.h.hasOwnProperty(frame)) {
				this.__updateSymbol(frame);
				var script = this.__frameScripts.h[frame];
				script(this.__scope);
				if(this.__currentFrame != frame) {
					return false;
				}
			}
			if(!this.__isPlaying) {
				return false;
			}
		}
		return true;
	}
	,__getNextFrame: function(deltaTime) {
		var nextFrame = 0;
		if(this.frameRate != null) {
			this.__timeElapsed += deltaTime;
			nextFrame = this.__currentFrame + Math.floor(this.__timeElapsed / this.__frameTime);
			if(nextFrame < 1) {
				nextFrame = 1;
			}
			if(nextFrame > this.__totalFrames) {
				nextFrame = Math.floor((nextFrame - 1) % this.__totalFrames) + 1;
			}
			this.__timeElapsed %= this.__frameTime;
		} else {
			nextFrame = this.__currentFrame + 1;
			if(nextFrame > this.__totalFrames) {
				nextFrame = 1;
			}
		}
		return nextFrame;
	}
	,__goto: function(frame) {
		if(frame < 1) {
			frame = 1;
		} else if(frame > this.__totalFrames) {
			frame = this.__totalFrames;
		}
		this.__lastFrameScriptEval = -1;
		this.__currentFrame = frame;
		this.__updateSymbol(this.__currentFrame);
		this.__evaluateFrameScripts(this.__currentFrame);
	}
	,__gotoAndPlay: function(frame,scene) {
		this.__play();
		this.__goto(this.__resolveFrameReference(frame));
	}
	,__gotoAndStop: function(frame,scene) {
		this.__stop();
		this.__goto(this.__resolveFrameReference(frame));
	}
	,__nextFrame: function() {
		this.__stop();
		this.__goto(this.__currentFrame + 1);
	}
	,__nextScene: function() {
	}
	,__play: function() {
		if(this.__isPlaying || this.__totalFrames < 2) {
			return;
		}
		this.__isPlaying = true;
		if(this.frameRate != null) {
			this.__frameTime = 1000 / this.frameRate | 0;
			this.__timeElapsed = 0;
		}
	}
	,__prevFrame: function() {
		this.__stop();
		this.__goto(this.__currentFrame - 1);
	}
	,__prevScene: function() {
	}
	,__stop: function() {
		this.__isPlaying = false;
	}
	,__resolveFrameReference: function(frame) {
		if(typeof(frame) == "number" && ((frame | 0) === frame)) {
			return frame;
		} else if(typeof(frame) == "string") {
			var label = frame;
			var _g = 0;
			var _g1 = this.__currentLabels;
			while(_g < _g1.length) {
				var frameLabel = _g1[_g];
				++_g;
				if(frameLabel.name == label) {
					return frameLabel.frame;
				}
			}
			throw haxe_Exception.thrown(new openfl_errors_ArgumentError("Error #2109: Frame label " + label + " not found in scene."));
		} else {
			throw haxe_Exception.thrown("Invalid type for frame " + frame.__name__);
		}
	}
	,__updateFrameLabel: function() {
		this.__currentLabel = null;
		this.__currentFrameLabel = null;
		var _g = 0;
		var _g1 = this.__currentLabels;
		while(_g < _g1.length) {
			var label = _g1[_g];
			++_g;
			if(label.frame < this.__currentFrame) {
				this.__currentLabel = label.name;
			} else if(label.frame == this.__currentFrame) {
				this.__currentLabel = label.name;
				this.__currentFrameLabel = label.name;
			} else {
				break;
			}
		}
	}
	,__updateSymbol: function(targetFrame) {
		if(this.__currentFrame != this.__lastFrameUpdate) {
			this.__updateFrameLabel();
			this.enterFrame(targetFrame);
			this.__lastFrameUpdate = this.__currentFrame;
		}
	}
	,__class__: openfl_display_Timeline
};
var openfl_display_TriangleCulling = {};
openfl_display_TriangleCulling.fromString = function(value) {
	switch(value) {
	case "negative":
		return 0;
	case "none":
		return 1;
	case "positive":
		return 2;
	default:
		return null;
	}
};
openfl_display_TriangleCulling.toString = function(this1) {
	switch(this1) {
	case 0:
		return "negative";
	case 1:
		return "none";
	case 2:
		return "positive";
	default:
		return null;
	}
};
var openfl_display_Window = function(application,attributes) {
	lime_ui_Window.call(this,application,attributes);
	this.stage = new openfl_display_Stage(this,Object.prototype.hasOwnProperty.call(attributes.context,"background") ? attributes.context.background : 16777215);
	if(Object.prototype.hasOwnProperty.call(attributes,"parameters")) {
		try {
			this.stage.get_loaderInfo().parameters = attributes.parameters;
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
		}
	}
	if(Object.prototype.hasOwnProperty.call(attributes,"resizable") && !attributes.resizable) {
		this.stage.__setLogicalSize(attributes.width,attributes.height);
	}
	application.addModule(this.stage);
};
$hxClasses["openfl.display.Window"] = openfl_display_Window;
openfl_display_Window.__name__ = "openfl.display.Window";
openfl_display_Window.__super__ = lime_ui_Window;
openfl_display_Window.prototype = $extend(lime_ui_Window.prototype,{
	__class__: openfl_display_Window
});
var openfl_display__$internal_AbstractNoise = function(seed,octaves,channels,grayScale,falloff,stitch,stitch_threshold) {
	if(stitch_threshold == null) {
		stitch_threshold = 0.05;
	}
	if(stitch == null) {
		stitch = false;
	}
	this.stitch = stitch;
	this.stitch_threshold = stitch_threshold;
	this.octaves = octaves;
	this.channels = channels;
	this.grayscale = grayScale;
	this.calculateOctaves(falloff);
};
$hxClasses["openfl.display._internal.AbstractNoise"] = openfl_display__$internal_AbstractNoise;
openfl_display__$internal_AbstractNoise.__name__ = "openfl.display._internal.AbstractNoise";
openfl_display__$internal_AbstractNoise.prototype = {
	octaves: null
	,stitch: null
	,stitch_threshold: null
	,channels: null
	,grayscale: null
	,octaves_frequencies: null
	,octaves_persistences: null
	,persistence_max: null
	,fill: function(bitmap,_scale_x,_scale_y,_scale_z) {
	}
	,stitching: function(bitmap,color,px,py,stitch_w,stitch_h,width,height) {
		var r = color >> 16 & 255;
		var g = color >> 8 & 255;
		var b = color & 255;
		if(width - stitch_w < px) {
			var dest = bitmap.getPixel32(width - px,py);
			var dest_r = dest >> 16 & 255;
			var dest_g = dest >> 8 & 255;
			var dest_b = dest & 255;
			var u = (width - px) / stitch_w;
			var uu = u * u;
			r = this.mixI(dest_r,r,u);
			g = this.mixI(dest_g,g,u);
			b = this.mixI(dest_b,b,u);
		}
		if(height - stitch_h < py) {
			var dest = bitmap.getPixel32(px,height - py);
			var dest_r = dest >> 16 & 255;
			var dest_g = dest >> 8 & 255;
			var dest_b = dest & 255;
			var u = (height - py) / stitch_h;
			var uu = u * u;
			r = this.mixI(dest_r,r,u);
			g = this.mixI(dest_g,g,u);
			b = this.mixI(dest_b,b,u);
		}
		return -16777216 | r << 16 | g << 8 | b;
	}
	,color: function(r_noise,g_noise,b_noise) {
		var color_r = 0;
		var color_g = 0;
		var color_b = 0;
		if(null != r_noise) {
			color_r = this.noiseToColor(r_noise);
		}
		if(null != g_noise) {
			color_g = this.noiseToColor(g_noise);
		}
		if(null != b_noise) {
			color_b = this.noiseToColor(b_noise);
		}
		return -16777216 | color_r << 16 | color_g << 8 | color_b;
	}
	,noiseToColor: function(noise) {
		return (noise * this.persistence_max + 1.0) * 128 | 0;
	}
	,fade: function(t) {
		return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);
	}
	,mixI: function(x,y,t) {
		return (1.0 - t) * x + t * y | 0;
	}
	,mix: function(x,y,t) {
		return (1.0 - t) * x + t * y;
	}
	,fastfloor: function(x) {
		if(x > 0) {
			return x | 0;
		} else {
			return x - 1 | 0;
		}
	}
	,dot2d: function(grad,x,y) {
		return grad[0] * x + grad[1] * y;
	}
	,dot: function(grad,x,y,z) {
		return grad[0] * x + grad[1] * y + grad[2] * z;
	}
	,calculateOctaves: function(fPersistence) {
		var fFreq;
		var fPers;
		this.octaves_frequencies = [];
		this.octaves_persistences = [];
		this.persistence_max = 0;
		var _g = 0;
		var _g1 = this.octaves;
		while(_g < _g1) {
			var i = _g++;
			fFreq = Math.pow(2.0,i);
			fPers = Math.pow(fPersistence,i);
			this.persistence_max += fPers;
			this.octaves_frequencies.push(fFreq);
			this.octaves_persistences.push(fPers);
		}
		this.persistence_max = 1.0 / this.persistence_max;
	}
	,__class__: openfl_display__$internal_AbstractNoise
};
var openfl_display__$internal_CairoBitmap = function() { };
$hxClasses["openfl.display._internal.CairoBitmap"] = openfl_display__$internal_CairoBitmap;
openfl_display__$internal_CairoBitmap.__name__ = "openfl.display._internal.CairoBitmap";
openfl_display__$internal_CairoBitmap.render = function(bitmap,renderer) {
	if(!bitmap.__renderable) {
		return;
	}
	var alpha = renderer.__getAlpha(bitmap.__worldAlpha);
	if(alpha > 0 && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid) {
		var cairo = renderer.cairo;
		renderer.__setBlendMode(bitmap.__worldBlendMode);
		renderer.__pushMaskObject(bitmap);
		renderer.applyMatrix(bitmap.__renderTransform,cairo);
		var surface = bitmap.__bitmapData.getSurface();
		if(surface != null) {
			var pattern = lime_graphics_cairo_CairoPattern.createForSurface(surface);
			lime_graphics_cairo_CairoPattern.set_filter(pattern,renderer.__allowSmoothing && bitmap.smoothing ? 1 : 3);
			cairo.set_source(pattern);
			if(alpha == 1) {
				cairo.paint();
			} else {
				cairo.paintWithAlpha(alpha);
			}
		}
		renderer.__popMaskObject(bitmap);
		renderer.__setBlendMode(10);
	}
};
var openfl_display__$internal_CairoDisplayObject = function() { };
$hxClasses["openfl.display._internal.CairoDisplayObject"] = openfl_display__$internal_CairoDisplayObject;
openfl_display__$internal_CairoDisplayObject.__name__ = "openfl.display._internal.CairoDisplayObject";
openfl_display__$internal_CairoDisplayObject.render = function(displayObject,renderer) {
};
var openfl_display__$internal_CairoGraphics = function() { };
$hxClasses["openfl.display._internal.CairoGraphics"] = openfl_display__$internal_CairoGraphics;
openfl_display__$internal_CairoGraphics.__name__ = "openfl.display._internal.CairoGraphics";
openfl_display__$internal_CairoGraphics.hitTest = function(graphics,x,y) {
	return false;
};
openfl_display__$internal_CairoGraphics.render = function(graphics,renderer) {
};
openfl_display__$internal_CairoGraphics.renderMask = function(graphics,renderer) {
};
var openfl_display__$internal_CairoTextField = function() { };
$hxClasses["openfl.display._internal.CairoTextField"] = openfl_display__$internal_CairoTextField;
openfl_display__$internal_CairoTextField.__name__ = "openfl.display._internal.CairoTextField";
openfl_display__$internal_CairoTextField.render = function(textField,renderer,transform) {
};
var openfl_display__$internal_CanvasBitmap = function() { };
$hxClasses["openfl.display._internal.CanvasBitmap"] = openfl_display__$internal_CanvasBitmap;
openfl_display__$internal_CanvasBitmap.__name__ = "openfl.display._internal.CanvasBitmap";
openfl_display__$internal_CanvasBitmap.render = function(bitmap,renderer) {
	if(!bitmap.__renderable) {
		return;
	}
	var alpha = renderer.__getAlpha(bitmap.__worldAlpha);
	if(alpha > 0 && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) {
		var context = renderer.context;
		renderer.__setBlendMode(bitmap.__worldBlendMode);
		renderer.__pushMaskObject(bitmap,false);
		lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(bitmap.__bitmapData.image);
		context.globalAlpha = alpha;
		var scrollRect = bitmap.__scrollRect;
		renderer.setTransform(bitmap.__renderTransform,context);
		if(!renderer.__allowSmoothing || !bitmap.smoothing) {
			context.imageSmoothingEnabled = false;
		}
		if(scrollRect == null) {
			context.drawImage(bitmap.__bitmapData.image.get_src(),0,0,bitmap.__bitmapData.image.width,bitmap.__bitmapData.image.height);
		} else {
			context.drawImage(bitmap.__bitmapData.image.get_src(),scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height);
		}
		if(!renderer.__allowSmoothing || !bitmap.smoothing) {
			context.imageSmoothingEnabled = true;
		}
		renderer.__popMaskObject(bitmap,false);
	}
};
var openfl_display__$internal_CanvasDisplayObject = function() { };
$hxClasses["openfl.display._internal.CanvasDisplayObject"] = openfl_display__$internal_CanvasDisplayObject;
openfl_display__$internal_CanvasDisplayObject.__name__ = "openfl.display._internal.CanvasDisplayObject";
openfl_display__$internal_CanvasDisplayObject.render = function(displayObject,renderer) {
	if(displayObject.opaqueBackground == null && displayObject.__graphics == null) {
		return;
	}
	if(!displayObject.__renderable) {
		return;
	}
	var alpha = renderer.__getAlpha(displayObject.__worldAlpha);
	if(alpha <= 0) {
		return;
	}
	if(displayObject.opaqueBackground != null && !displayObject.__isCacheBitmapRender && displayObject.get_width() > 0 && displayObject.get_height() > 0) {
		renderer.__setBlendMode(displayObject.__worldBlendMode);
		renderer.__pushMaskObject(displayObject);
		var context = renderer.context;
		renderer.setTransform(displayObject.__renderTransform,context);
		var color = displayObject.opaqueBackground;
		context.fillStyle = "rgb(" + (color >>> 16 & 255) + "," + (color >>> 8 & 255) + "," + (color & 255) + ")";
		context.fillRect(0,0,displayObject.get_width(),displayObject.get_height());
		renderer.__popMaskObject(displayObject);
	}
	if(displayObject.__graphics != null) {
		if(displayObject.__renderable) {
			var alpha = renderer.__getAlpha(displayObject.__worldAlpha);
			if(!(alpha <= 0)) {
				var graphics = displayObject.__graphics;
				if(graphics != null) {
					openfl_display__$internal_CanvasGraphics.render(graphics,renderer);
					var width = graphics.__width;
					var height = graphics.__height;
					var canvas = graphics.__canvas;
					if(canvas != null && graphics.__visible && width >= 1 && height >= 1) {
						var transform = graphics.__worldTransform;
						var context = renderer.context;
						var scrollRect = displayObject.__scrollRect;
						var scale9Grid = displayObject.__worldScale9Grid;
						if(scrollRect == null || scrollRect.width > 0 && scrollRect.height > 0) {
							renderer.__setBlendMode(displayObject.__worldBlendMode);
							renderer.__pushMaskObject(displayObject);
							context.globalAlpha = alpha;
							if(scale9Grid != null && transform.b == 0 && transform.c == 0) {
								context.setTransform(1,0,0,1,transform.tx,transform.ty);
								var bounds = graphics.__bounds;
								var scaleX = graphics.__renderTransform.a;
								var scaleY = graphics.__renderTransform.d;
								var renderScaleX = transform.a;
								var renderScaleY = transform.d;
								var left = Math.max(1,Math.round(scale9Grid.x * scaleX));
								var top = Math.round(scale9Grid.y * scaleY);
								var right = Math.max(1,Math.round((bounds.get_right() - scale9Grid.get_right()) * scaleX));
								var bottom = Math.round((bounds.get_bottom() - scale9Grid.get_bottom()) * scaleY);
								var centerWidth = Math.round(scale9Grid.width * scaleX);
								var centerHeight = Math.round(scale9Grid.height * scaleY);
								var renderLeft = Math.round(scale9Grid.x * renderScaleX);
								var renderTop = Math.round(scale9Grid.y * renderScaleY);
								var renderRight = Math.round((bounds.get_right() - scale9Grid.get_right()) * renderScaleX);
								var renderBottom = Math.round((bounds.get_bottom() - scale9Grid.get_bottom()) * renderScaleY);
								var renderCenterWidth = Math.round(width * renderScaleX) - renderLeft - renderRight;
								var renderCenterHeight = Math.round(height * renderScaleY) - renderTop - renderBottom;
								renderer.applySmoothing(context,false);
								if(centerWidth != 0 && centerHeight != 0) {
									context.drawImage(canvas,0,0,left,top,0,0,renderLeft,renderTop);
									context.drawImage(canvas,left,0,centerWidth,top,renderLeft,0,renderCenterWidth,renderTop);
									context.drawImage(canvas,left + centerWidth,0,right,top,renderLeft + renderCenterWidth,0,renderRight,renderTop);
									context.drawImage(canvas,0,top,left,centerHeight,0,renderTop,renderLeft,renderCenterHeight);
									context.drawImage(canvas,left,top,centerWidth,centerHeight,renderLeft,renderTop,renderCenterWidth,renderCenterHeight);
									context.drawImage(canvas,left + centerWidth,top,right,centerHeight,renderLeft + renderCenterWidth,renderTop,renderRight,renderCenterHeight);
									context.drawImage(canvas,0,top + centerHeight,left,bottom,0,renderTop + renderCenterHeight,renderLeft,renderBottom);
									context.drawImage(canvas,left,top + centerHeight,centerWidth,bottom,renderLeft,renderTop + renderCenterHeight,renderCenterWidth,renderBottom);
									context.drawImage(canvas,left + centerWidth,top + centerHeight,right,bottom,renderLeft + renderCenterWidth,renderTop + renderCenterHeight,renderRight,renderBottom);
								} else if(centerWidth == 0 && centerHeight != 0) {
									var renderWidth = renderLeft + renderCenterWidth + renderRight;
									context.drawImage(canvas,0,0,width,top,0,0,renderWidth,renderTop);
									context.drawImage(canvas,0,top,width,centerHeight,0,renderTop,renderWidth,renderCenterHeight);
									context.drawImage(canvas,0,top + centerHeight,width,bottom,0,renderTop + renderCenterHeight,renderWidth,renderBottom);
								} else if(centerHeight == 0 && centerWidth != 0) {
									var renderHeight = renderTop + renderCenterHeight + renderBottom;
									context.drawImage(canvas,0,0,left,height,0,0,renderLeft,renderHeight);
									context.drawImage(canvas,left,0,centerWidth,height,renderLeft,0,renderCenterWidth,renderHeight);
									context.drawImage(canvas,left + centerWidth,0,right,height,renderLeft + renderCenterWidth,0,renderRight,renderHeight);
								}
							} else {
								renderer.setTransform(transform,context);
								if(renderer.__isDOM) {
									var reverseScale = 1 / renderer.pixelRatio;
									context.scale(reverseScale,reverseScale);
								}
								context.drawImage(canvas,0,0,width,height);
							}
							renderer.__popMaskObject(displayObject);
						}
					}
				}
			}
		}
	}
};
var openfl_display__$internal_DrawCommandBuffer = function() {
	if(openfl_display__$internal_DrawCommandBuffer.empty == null) {
		this.types = [];
		this.b = [];
		this.i = [];
		this.f = [];
		this.o = [];
		this.ff = [];
		this.ii = [];
		this.copyOnWrite = true;
	} else {
		this.clear();
	}
};
$hxClasses["openfl.display._internal.DrawCommandBuffer"] = openfl_display__$internal_DrawCommandBuffer;
openfl_display__$internal_DrawCommandBuffer.__name__ = "openfl.display._internal.DrawCommandBuffer";
openfl_display__$internal_DrawCommandBuffer.prototype = {
	types: null
	,b: null
	,copyOnWrite: null
	,f: null
	,ff: null
	,i: null
	,ii: null
	,o: null
	,append: function(other) {
		if(this.get_length() == 0) {
			this.types = other.types;
			this.b = other.b;
			this.i = other.i;
			this.f = other.f;
			this.o = other.o;
			this.ff = other.ff;
			this.ii = other.ii;
			this.copyOnWrite = other.copyOnWrite = true;
			return other;
		}
		var data = new openfl_display__$internal_DrawCommandReader(other);
		var _g = 0;
		var _g1 = other.types;
		while(_g < _g1.length) {
			var type = _g1[_g];
			++_g;
			switch(type._hx_index) {
			case 0:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL;
				var this1 = data;
				var c = this1;
				this.beginBitmapFill(c.buffer.o[c.oPos],c.buffer.o[c.oPos + 1],c.buffer.b[c.bPos],c.buffer.b[c.bPos + 1]);
				break;
			case 1:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.BEGIN_FILL;
				var this2 = data;
				var c1 = this2;
				this.beginFill(c1.buffer.i[c1.iPos],c1.buffer.f[c1.fPos]);
				break;
			case 2:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL;
				var this3 = data;
				var c2 = this3;
				this.beginGradientFill(c2.buffer.o[c2.oPos],c2.buffer.ii[c2.iiPos],c2.buffer.ff[c2.ffPos],c2.buffer.ii[c2.iiPos + 1],c2.buffer.o[c2.oPos + 1],c2.buffer.o[c2.oPos + 2],c2.buffer.o[c2.oPos + 3],c2.buffer.f[c2.fPos]);
				break;
			case 3:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL;
				var this4 = data;
				var c3 = this4;
				this.beginShaderFill(c3.buffer.o[c3.oPos]);
				break;
			case 4:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO;
				var this5 = data;
				var c4 = this5;
				this.cubicCurveTo(c4.buffer.f[c4.fPos],c4.buffer.f[c4.fPos + 1],c4.buffer.f[c4.fPos + 2],c4.buffer.f[c4.fPos + 3],c4.buffer.f[c4.fPos + 4],c4.buffer.f[c4.fPos + 5]);
				break;
			case 5:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.CURVE_TO;
				var this6 = data;
				var c5 = this6;
				this.curveTo(c5.buffer.f[c5.fPos],c5.buffer.f[c5.fPos + 1],c5.buffer.f[c5.fPos + 2],c5.buffer.f[c5.fPos + 3]);
				break;
			case 6:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_CIRCLE;
				var this7 = data;
				var c6 = this7;
				this.drawCircle(c6.buffer.f[c6.fPos],c6.buffer.f[c6.fPos + 1],c6.buffer.f[c6.fPos + 2]);
				break;
			case 7:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE;
				var this8 = data;
				var c7 = this8;
				this.drawEllipse(c7.buffer.f[c7.fPos],c7.buffer.f[c7.fPos + 1],c7.buffer.f[c7.fPos + 2],c7.buffer.f[c7.fPos + 3]);
				break;
			case 8:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_QUADS;
				var this9 = data;
				var c8 = this9;
				this.drawQuads(c8.buffer.o[c8.oPos],c8.buffer.o[c8.oPos + 1],c8.buffer.o[c8.oPos + 2]);
				break;
			case 9:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_RECT;
				var this10 = data;
				var c9 = this10;
				this.drawRect(c9.buffer.f[c9.fPos],c9.buffer.f[c9.fPos + 1],c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 3]);
				break;
			case 10:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT;
				var this11 = data;
				var c10 = this11;
				this.drawRoundRect(c10.buffer.f[c10.fPos],c10.buffer.f[c10.fPos + 1],c10.buffer.f[c10.fPos + 2],c10.buffer.f[c10.fPos + 3],c10.buffer.f[c10.fPos + 4],c10.buffer.o[c10.oPos]);
				break;
			case 12:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_TRIANGLES;
				var this12 = data;
				var c11 = this12;
				this.drawTriangles(c11.buffer.o[c11.oPos],c11.buffer.o[c11.oPos + 1],c11.buffer.o[c11.oPos + 2],c11.buffer.o[c11.oPos + 3]);
				break;
			case 13:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.END_FILL;
				var this13 = data;
				var c12 = this13;
				this.endFill();
				break;
			case 14:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_BITMAP_STYLE;
				var this14 = data;
				var c13 = this14;
				this.lineBitmapStyle(c13.buffer.o[c13.oPos],c13.buffer.o[c13.oPos + 1],c13.buffer.b[c13.bPos],c13.buffer.b[c13.bPos + 1]);
				break;
			case 15:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_GRADIENT_STYLE;
				var this15 = data;
				var c14 = this15;
				this.lineGradientStyle(c14.buffer.o[c14.oPos],c14.buffer.ii[c14.iiPos],c14.buffer.ff[c14.ffPos],c14.buffer.ii[c14.iiPos + 1],c14.buffer.o[c14.oPos + 1],c14.buffer.o[c14.oPos + 2],c14.buffer.o[c14.oPos + 3],c14.buffer.f[c14.fPos]);
				break;
			case 16:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_STYLE;
				var this16 = data;
				var c15 = this16;
				this.lineStyle(c15.buffer.o[c15.oPos],c15.buffer.i[c15.iPos],c15.buffer.f[c15.fPos],c15.buffer.b[c15.bPos],c15.buffer.o[c15.oPos + 1],c15.buffer.o[c15.oPos + 2],c15.buffer.o[c15.oPos + 3],c15.buffer.f[c15.fPos + 1]);
				break;
			case 17:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_TO;
				var this17 = data;
				var c16 = this17;
				this.lineTo(c16.buffer.f[c16.fPos],c16.buffer.f[c16.fPos + 1]);
				break;
			case 18:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.MOVE_TO;
				var this18 = data;
				var c17 = this18;
				this.moveTo(c17.buffer.f[c17.fPos],c17.buffer.f[c17.fPos + 1]);
				break;
			case 20:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.OVERRIDE_MATRIX;
				var this19 = data;
				var c18 = this19;
				this.overrideMatrix(c18.buffer.o[c18.oPos]);
				break;
			case 21:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.WINDING_EVEN_ODD;
				var this20 = data;
				var c19 = this20;
				this.windingEvenOdd();
				break;
			case 22:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.WINDING_NON_ZERO;
				var this21 = data;
				var c20 = this21;
				this.windingNonZero();
				break;
			default:
			}
		}
		data.destroy();
		return other;
	}
	,beginBitmapFill: function(bitmap,matrix,repeat,smooth) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL);
		this.o.push(bitmap);
		this.o.push(matrix);
		this.b.push(repeat);
		this.b.push(smooth);
	}
	,beginFill: function(color,alpha) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.BEGIN_FILL);
		this.i.push(color);
		this.f.push(alpha);
	}
	,beginGradientFill: function(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL);
		this.o.push(type);
		this.ii.push(colors);
		this.ff.push(alphas);
		this.ii.push(ratios);
		this.o.push(matrix);
		this.o.push(spreadMethod);
		this.o.push(interpolationMethod);
		this.f.push(focalPointRatio);
	}
	,beginShaderFill: function(shaderBuffer) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL);
		this.o.push(shaderBuffer);
	}
	,clear: function() {
		this.types = openfl_display__$internal_DrawCommandBuffer.empty.types;
		this.b = openfl_display__$internal_DrawCommandBuffer.empty.b;
		this.i = openfl_display__$internal_DrawCommandBuffer.empty.i;
		this.f = openfl_display__$internal_DrawCommandBuffer.empty.f;
		this.o = openfl_display__$internal_DrawCommandBuffer.empty.o;
		this.ff = openfl_display__$internal_DrawCommandBuffer.empty.ff;
		this.ii = openfl_display__$internal_DrawCommandBuffer.empty.ii;
		this.copyOnWrite = true;
	}
	,copy: function() {
		var copy = new openfl_display__$internal_DrawCommandBuffer();
		copy.append(this);
		return copy;
	}
	,cubicCurveTo: function(controlX1,controlY1,controlX2,controlY2,anchorX,anchorY) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO);
		this.f.push(controlX1);
		this.f.push(controlY1);
		this.f.push(controlX2);
		this.f.push(controlY2);
		this.f.push(anchorX);
		this.f.push(anchorY);
	}
	,curveTo: function(controlX,controlY,anchorX,anchorY) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.CURVE_TO);
		this.f.push(controlX);
		this.f.push(controlY);
		this.f.push(anchorX);
		this.f.push(anchorY);
	}
	,destroy: function() {
		this.clear();
		this.types = null;
		this.b = null;
		this.i = null;
		this.f = null;
		this.o = null;
		this.ff = null;
		this.ii = null;
	}
	,drawCircle: function(x,y,radius) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.DRAW_CIRCLE);
		this.f.push(x);
		this.f.push(y);
		this.f.push(radius);
	}
	,drawEllipse: function(x,y,width,height) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE);
		this.f.push(x);
		this.f.push(y);
		this.f.push(width);
		this.f.push(height);
	}
	,drawQuads: function(rects,indices,transforms) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.DRAW_QUADS);
		this.o.push(rects);
		this.o.push(indices);
		this.o.push(transforms);
	}
	,drawRect: function(x,y,width,height) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.DRAW_RECT);
		this.f.push(x);
		this.f.push(y);
		this.f.push(width);
		this.f.push(height);
	}
	,drawRoundRect: function(x,y,width,height,ellipseWidth,ellipseHeight) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT);
		this.f.push(x);
		this.f.push(y);
		this.f.push(width);
		this.f.push(height);
		this.f.push(ellipseWidth);
		this.o.push(ellipseHeight);
	}
	,drawTriangles: function(vertices,indices,uvtData,culling) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.DRAW_TRIANGLES);
		this.o.push(vertices);
		this.o.push(indices);
		this.o.push(uvtData);
		this.o.push(culling);
	}
	,endFill: function() {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.END_FILL);
	}
	,lineBitmapStyle: function(bitmap,matrix,repeat,smooth) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.LINE_BITMAP_STYLE);
		this.o.push(bitmap);
		this.o.push(matrix);
		this.b.push(repeat);
		this.b.push(smooth);
	}
	,lineGradientStyle: function(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.LINE_GRADIENT_STYLE);
		this.o.push(type);
		this.ii.push(colors);
		this.ff.push(alphas);
		this.ii.push(ratios);
		this.o.push(matrix);
		this.o.push(spreadMethod);
		this.o.push(interpolationMethod);
		this.f.push(focalPointRatio);
	}
	,lineStyle: function(thickness,color,alpha,pixelHinting,scaleMode,caps,joints,miterLimit) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.LINE_STYLE);
		this.o.push(thickness);
		this.i.push(color);
		this.f.push(alpha);
		this.b.push(pixelHinting);
		this.o.push(scaleMode);
		this.o.push(caps);
		this.o.push(joints);
		this.f.push(miterLimit);
	}
	,lineTo: function(x,y) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.LINE_TO);
		this.f.push(x);
		this.f.push(y);
	}
	,moveTo: function(x,y) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.MOVE_TO);
		this.f.push(x);
		this.f.push(y);
	}
	,prepareWrite: function() {
		if(this.copyOnWrite) {
			this.types = this.types.slice();
			this.b = this.b.slice();
			this.i = this.i.slice();
			this.f = this.f.slice();
			this.o = this.o.slice();
			this.ff = this.ff.slice();
			this.ii = this.ii.slice();
			this.copyOnWrite = false;
		}
	}
	,overrideBlendMode: function(blendMode) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.OVERRIDE_BLEND_MODE);
		this.o.push(blendMode);
	}
	,overrideMatrix: function(matrix) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.OVERRIDE_MATRIX);
		this.o.push(matrix);
	}
	,windingEvenOdd: function() {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.WINDING_EVEN_ODD);
	}
	,windingNonZero: function() {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.WINDING_NON_ZERO);
	}
	,get_length: function() {
		return this.types.length;
	}
	,__class__: openfl_display__$internal_DrawCommandBuffer
	,__properties__: {get_length:"get_length"}
};
var openfl_display__$internal_CanvasGraphics = function() { };
$hxClasses["openfl.display._internal.CanvasGraphics"] = openfl_display__$internal_CanvasGraphics;
openfl_display__$internal_CanvasGraphics.__name__ = "openfl.display._internal.CanvasGraphics";
openfl_display__$internal_CanvasGraphics.allowSmoothing = null;
openfl_display__$internal_CanvasGraphics.bitmapFill = null;
openfl_display__$internal_CanvasGraphics.bitmapStroke = null;
openfl_display__$internal_CanvasGraphics.bitmapRepeat = null;
openfl_display__$internal_CanvasGraphics.bounds = null;
openfl_display__$internal_CanvasGraphics.graphics = null;
openfl_display__$internal_CanvasGraphics.hasFill = null;
openfl_display__$internal_CanvasGraphics.hasStroke = null;
openfl_display__$internal_CanvasGraphics.hitTesting = null;
openfl_display__$internal_CanvasGraphics.inversePendingMatrix = null;
openfl_display__$internal_CanvasGraphics.pendingMatrix = null;
openfl_display__$internal_CanvasGraphics.windingRule = null;
openfl_display__$internal_CanvasGraphics.worldAlpha = null;
openfl_display__$internal_CanvasGraphics.context = null;
openfl_display__$internal_CanvasGraphics.hitTestCanvas = null;
openfl_display__$internal_CanvasGraphics.hitTestContext = null;
openfl_display__$internal_CanvasGraphics.closePath = function(strokeBefore) {
	if(strokeBefore == null) {
		strokeBefore = false;
	}
	if(openfl_display__$internal_CanvasGraphics.context.strokeStyle == null) {
		return;
	}
	if(!strokeBefore) {
		openfl_display__$internal_CanvasGraphics.context.closePath();
	}
	openfl_display__$internal_CanvasGraphics.context.stroke();
	if(strokeBefore) {
		openfl_display__$internal_CanvasGraphics.context.closePath();
	}
	openfl_display__$internal_CanvasGraphics.context.beginPath();
};
openfl_display__$internal_CanvasGraphics.createBitmapFill = function(bitmap,bitmapRepeat,smooth) {
	lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(bitmap.image);
	openfl_display__$internal_CanvasGraphics.setSmoothing(smooth);
	return openfl_display__$internal_CanvasGraphics.context.createPattern(bitmap.image.get_src(),bitmapRepeat ? "repeat" : "no-repeat");
};
openfl_display__$internal_CanvasGraphics.createGradientPattern = function(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio) {
	var gradientFill = null;
	var point = null;
	var point2 = null;
	var releaseMatrix = false;
	if(matrix == null) {
		matrix = openfl_geom_Matrix.__pool.get();
		releaseMatrix = true;
	}
	switch(type) {
	case 0:
		point = openfl_geom_Point.__pool.get();
		point.setTo(-819.2,0);
		var px = point.x;
		var py = point.y;
		point.x = px * matrix.a + py * matrix.c + matrix.tx;
		point.y = px * matrix.b + py * matrix.d + matrix.ty;
		point2 = openfl_geom_Point.__pool.get();
		point2.setTo(819.2,0);
		var px = point2.x;
		var py = point2.y;
		point2.x = px * matrix.a + py * matrix.c + matrix.tx;
		point2.y = px * matrix.b + py * matrix.d + matrix.ty;
		gradientFill = openfl_display__$internal_CanvasGraphics.context.createLinearGradient(point.x,point.y,point2.x,point2.y);
		break;
	case 1:
		point = openfl_geom_Point.__pool.get();
		point.setTo(1638.4,0);
		var px = point.x;
		var py = point.y;
		point.x = px * matrix.a + py * matrix.c + matrix.tx;
		point.y = px * matrix.b + py * matrix.d + matrix.ty;
		gradientFill = openfl_display__$internal_CanvasGraphics.context.createRadialGradient(matrix.tx,matrix.ty,0,matrix.tx,matrix.ty,Math.abs((point.x - matrix.tx) / 2));
		break;
	}
	var rgb;
	var alpha;
	var r;
	var g;
	var b;
	var ratio;
	var _g = 0;
	var _g1 = colors.length;
	while(_g < _g1) {
		var i = _g++;
		rgb = colors[i];
		alpha = alphas[i];
		r = (rgb & 16711680) >>> 16;
		g = (rgb & 65280) >>> 8;
		b = rgb & 255;
		ratio = ratios[i] / 255;
		if(ratio < 0) {
			ratio = 0;
		}
		if(ratio > 1) {
			ratio = 1;
		}
		gradientFill.addColorStop(ratio,"rgba(" + r + ", " + g + ", " + b + ", " + alpha + ")");
	}
	if(point != null) {
		openfl_geom_Point.__pool.release(point);
	}
	if(point2 != null) {
		openfl_geom_Point.__pool.release(point2);
	}
	if(releaseMatrix) {
		openfl_geom_Matrix.__pool.release(matrix);
	}
	return gradientFill;
};
openfl_display__$internal_CanvasGraphics.createTempPatternCanvas = function(bitmap,repeat,width,height) {
	var canvas = window.document.createElement("canvas");
	var context = canvas.getContext("2d");
	canvas.width = width;
	canvas.height = height;
	var tmp = bitmap.image.get_src();
	context.fillStyle = context.createPattern(tmp,repeat ? "repeat" : "no-repeat");
	context.beginPath();
	context.moveTo(0,0);
	context.lineTo(0,height);
	context.lineTo(width,height);
	context.lineTo(width,0);
	context.lineTo(0,0);
	context.closePath();
	if(!openfl_display__$internal_CanvasGraphics.hitTesting) {
		context.fill(openfl_display__$internal_CanvasGraphics.windingRule);
	}
	return canvas;
};
openfl_display__$internal_CanvasGraphics.drawRoundRect = function(x,y,width,height,ellipseWidth,ellipseHeight) {
	if(ellipseHeight == null) {
		ellipseHeight = ellipseWidth;
	}
	ellipseWidth *= 0.5;
	ellipseHeight *= 0.5;
	if(ellipseWidth > width / 2) {
		ellipseWidth = width / 2;
	}
	if(ellipseHeight > height / 2) {
		ellipseHeight = height / 2;
	}
	var xe = x + width;
	var ye = y + height;
	var cx1 = -ellipseWidth + ellipseWidth * 0.70710678118654752440084436210485;
	var cx2 = -ellipseWidth + ellipseWidth * 0.4142135623730950488016887242097;
	var cy1 = -ellipseHeight + ellipseHeight * 0.70710678118654752440084436210485;
	var cy2 = -ellipseHeight + ellipseHeight * 0.4142135623730950488016887242097;
	openfl_display__$internal_CanvasGraphics.context.moveTo(xe,ye - ellipseHeight);
	openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(xe,ye + cy2,xe + cx1,ye + cy1);
	openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(xe + cx2,ye,xe - ellipseWidth,ye);
	openfl_display__$internal_CanvasGraphics.context.lineTo(x + ellipseWidth,ye);
	openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(x - cx2,ye,x - cx1,ye + cy1);
	openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(x,ye + cy2,x,ye - ellipseHeight);
	openfl_display__$internal_CanvasGraphics.context.lineTo(x,y + ellipseHeight);
	openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(x,y - cy2,x - cx1,y - cy1);
	openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(x - cx2,y,x + ellipseWidth,y);
	openfl_display__$internal_CanvasGraphics.context.lineTo(xe - ellipseWidth,y);
	openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(xe + cx2,y,xe + cx1,y - cy1);
	openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(xe,y - cy2,xe,y + ellipseHeight);
	openfl_display__$internal_CanvasGraphics.context.lineTo(xe,ye - ellipseHeight);
};
openfl_display__$internal_CanvasGraphics.endFill = function() {
	openfl_display__$internal_CanvasGraphics.context.beginPath();
	openfl_display__$internal_CanvasGraphics.playCommands(openfl_display__$internal_CanvasGraphics.fillCommands,false);
	openfl_display__$internal_CanvasGraphics.fillCommands.clear();
};
openfl_display__$internal_CanvasGraphics.endStroke = function() {
	openfl_display__$internal_CanvasGraphics.context.beginPath();
	openfl_display__$internal_CanvasGraphics.playCommands(openfl_display__$internal_CanvasGraphics.strokeCommands,true);
	openfl_display__$internal_CanvasGraphics.context.closePath();
	openfl_display__$internal_CanvasGraphics.strokeCommands.clear();
};
openfl_display__$internal_CanvasGraphics.hitTest = function(graphics,x,y) {
	openfl_display__$internal_CanvasGraphics.bounds = graphics.__bounds;
	openfl_display__$internal_CanvasGraphics.graphics = graphics;
	if(graphics.__commands.get_length() == 0 || openfl_display__$internal_CanvasGraphics.bounds == null || openfl_display__$internal_CanvasGraphics.bounds.width <= 0 || openfl_display__$internal_CanvasGraphics.bounds.height <= 0) {
		return false;
	} else {
		openfl_display__$internal_CanvasGraphics.hitTesting = true;
		var transform = graphics.__renderTransform;
		var px = x * transform.a + y * transform.c + transform.tx;
		var py = x * transform.b + y * transform.d + transform.ty;
		x = px;
		y = py;
		x -= openfl_display__$internal_CanvasGraphics.bounds.x * transform.a + openfl_display__$internal_CanvasGraphics.bounds.y * transform.c + transform.tx;
		y -= openfl_display__$internal_CanvasGraphics.bounds.x * transform.b + openfl_display__$internal_CanvasGraphics.bounds.y * transform.d + transform.ty;
		var cacheCanvas = graphics.__canvas;
		var cacheContext = graphics.__context;
		graphics.__canvas = openfl_display__$internal_CanvasGraphics.hitTestCanvas;
		graphics.__context = openfl_display__$internal_CanvasGraphics.hitTestContext;
		openfl_display__$internal_CanvasGraphics.context = graphics.__context;
		openfl_display__$internal_CanvasGraphics.context.setTransform(transform.a,transform.b,transform.c,transform.d,transform.tx,transform.ty);
		openfl_display__$internal_CanvasGraphics.fillCommands.clear();
		openfl_display__$internal_CanvasGraphics.strokeCommands.clear();
		openfl_display__$internal_CanvasGraphics.hasFill = false;
		openfl_display__$internal_CanvasGraphics.hasStroke = false;
		openfl_display__$internal_CanvasGraphics.bitmapFill = null;
		openfl_display__$internal_CanvasGraphics.bitmapRepeat = false;
		openfl_display__$internal_CanvasGraphics.windingRule = "evenodd";
		var data = new openfl_display__$internal_DrawCommandReader(graphics.__commands);
		var _g = 0;
		var _g1 = graphics.__commands.types;
		while(_g < _g1.length) {
			var type = _g1[_g];
			++_g;
			switch(type._hx_index) {
			case 0:case 1:case 2:case 3:
				openfl_display__$internal_CanvasGraphics.endFill();
				if(openfl_display__$internal_CanvasGraphics.hasFill && openfl_display__$internal_CanvasGraphics.context.isPointInPath(x,y,openfl_display__$internal_CanvasGraphics.windingRule)) {
					data.destroy();
					graphics.__canvas = cacheCanvas;
					graphics.__context = cacheContext;
					return true;
				}
				openfl_display__$internal_CanvasGraphics.endStroke();
				if(openfl_display__$internal_CanvasGraphics.hasStroke && openfl_display__$internal_CanvasGraphics.context.isPointInStroke(x,y)) {
					data.destroy();
					graphics.__canvas = cacheCanvas;
					graphics.__context = cacheContext;
					return true;
				}
				if(type == openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL) {
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL;
					var this1 = data;
					var c = this1;
					openfl_display__$internal_CanvasGraphics.fillCommands.beginBitmapFill(c.buffer.o[c.oPos],c.buffer.o[c.oPos + 1],c.buffer.b[c.bPos],c.buffer.b[c.bPos + 1]);
					openfl_display__$internal_CanvasGraphics.strokeCommands.beginBitmapFill(c.buffer.o[c.oPos],c.buffer.o[c.oPos + 1],c.buffer.b[c.bPos],c.buffer.b[c.bPos + 1]);
				} else if(type == openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL) {
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL;
					var this2 = data;
					var c1 = this2;
					openfl_display__$internal_CanvasGraphics.fillCommands.beginGradientFill(c1.buffer.o[c1.oPos],c1.buffer.ii[c1.iiPos],c1.buffer.ff[c1.ffPos],c1.buffer.ii[c1.iiPos + 1],c1.buffer.o[c1.oPos + 1],c1.buffer.o[c1.oPos + 2],c1.buffer.o[c1.oPos + 3],c1.buffer.f[c1.fPos]);
					openfl_display__$internal_CanvasGraphics.strokeCommands.beginGradientFill(c1.buffer.o[c1.oPos],c1.buffer.ii[c1.iiPos],c1.buffer.ff[c1.ffPos],c1.buffer.ii[c1.iiPos + 1],c1.buffer.o[c1.oPos + 1],c1.buffer.o[c1.oPos + 2],c1.buffer.o[c1.oPos + 3],c1.buffer.f[c1.fPos]);
				} else if(type == openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL) {
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL;
					var this3 = data;
					var c2 = this3;
					openfl_display__$internal_CanvasGraphics.fillCommands.beginShaderFill(c2.buffer.o[c2.oPos]);
					openfl_display__$internal_CanvasGraphics.strokeCommands.beginShaderFill(c2.buffer.o[c2.oPos]);
				} else {
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.BEGIN_FILL;
					var this4 = data;
					var c3 = this4;
					openfl_display__$internal_CanvasGraphics.fillCommands.beginFill(c3.buffer.i[c3.iPos],1);
					openfl_display__$internal_CanvasGraphics.strokeCommands.beginFill(c3.buffer.i[c3.iPos],1);
				}
				break;
			case 4:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO;
				var this5 = data;
				var c4 = this5;
				openfl_display__$internal_CanvasGraphics.fillCommands.cubicCurveTo(c4.buffer.f[c4.fPos],c4.buffer.f[c4.fPos + 1],c4.buffer.f[c4.fPos + 2],c4.buffer.f[c4.fPos + 3],c4.buffer.f[c4.fPos + 4],c4.buffer.f[c4.fPos + 5]);
				openfl_display__$internal_CanvasGraphics.strokeCommands.cubicCurveTo(c4.buffer.f[c4.fPos],c4.buffer.f[c4.fPos + 1],c4.buffer.f[c4.fPos + 2],c4.buffer.f[c4.fPos + 3],c4.buffer.f[c4.fPos + 4],c4.buffer.f[c4.fPos + 5]);
				break;
			case 5:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.CURVE_TO;
				var this6 = data;
				var c5 = this6;
				openfl_display__$internal_CanvasGraphics.fillCommands.curveTo(c5.buffer.f[c5.fPos],c5.buffer.f[c5.fPos + 1],c5.buffer.f[c5.fPos + 2],c5.buffer.f[c5.fPos + 3]);
				openfl_display__$internal_CanvasGraphics.strokeCommands.curveTo(c5.buffer.f[c5.fPos],c5.buffer.f[c5.fPos + 1],c5.buffer.f[c5.fPos + 2],c5.buffer.f[c5.fPos + 3]);
				break;
			case 6:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_CIRCLE;
				var this7 = data;
				var c6 = this7;
				openfl_display__$internal_CanvasGraphics.fillCommands.drawCircle(c6.buffer.f[c6.fPos],c6.buffer.f[c6.fPos + 1],c6.buffer.f[c6.fPos + 2]);
				openfl_display__$internal_CanvasGraphics.strokeCommands.drawCircle(c6.buffer.f[c6.fPos],c6.buffer.f[c6.fPos + 1],c6.buffer.f[c6.fPos + 2]);
				break;
			case 7:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE;
				var this8 = data;
				var c7 = this8;
				openfl_display__$internal_CanvasGraphics.fillCommands.drawEllipse(c7.buffer.f[c7.fPos],c7.buffer.f[c7.fPos + 1],c7.buffer.f[c7.fPos + 2],c7.buffer.f[c7.fPos + 3]);
				openfl_display__$internal_CanvasGraphics.strokeCommands.drawEllipse(c7.buffer.f[c7.fPos],c7.buffer.f[c7.fPos + 1],c7.buffer.f[c7.fPos + 2],c7.buffer.f[c7.fPos + 3]);
				break;
			case 9:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_RECT;
				var this9 = data;
				var c8 = this9;
				openfl_display__$internal_CanvasGraphics.fillCommands.drawRect(c8.buffer.f[c8.fPos],c8.buffer.f[c8.fPos + 1],c8.buffer.f[c8.fPos + 2],c8.buffer.f[c8.fPos + 3]);
				openfl_display__$internal_CanvasGraphics.strokeCommands.drawRect(c8.buffer.f[c8.fPos],c8.buffer.f[c8.fPos + 1],c8.buffer.f[c8.fPos + 2],c8.buffer.f[c8.fPos + 3]);
				break;
			case 10:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT;
				var this10 = data;
				var c9 = this10;
				openfl_display__$internal_CanvasGraphics.fillCommands.drawRoundRect(c9.buffer.f[c9.fPos],c9.buffer.f[c9.fPos + 1],c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 3],c9.buffer.f[c9.fPos + 4],c9.buffer.o[c9.oPos]);
				openfl_display__$internal_CanvasGraphics.strokeCommands.drawRoundRect(c9.buffer.f[c9.fPos],c9.buffer.f[c9.fPos + 1],c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 3],c9.buffer.f[c9.fPos + 4],c9.buffer.o[c9.oPos]);
				break;
			case 13:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.END_FILL;
				var this11 = data;
				openfl_display__$internal_CanvasGraphics.endFill();
				if(openfl_display__$internal_CanvasGraphics.hasFill && openfl_display__$internal_CanvasGraphics.context.isPointInPath(x,y,openfl_display__$internal_CanvasGraphics.windingRule)) {
					data.destroy();
					graphics.__canvas = cacheCanvas;
					graphics.__context = cacheContext;
					return true;
				}
				openfl_display__$internal_CanvasGraphics.endStroke();
				if(openfl_display__$internal_CanvasGraphics.hasStroke && openfl_display__$internal_CanvasGraphics.context.isPointInStroke(x,y)) {
					data.destroy();
					graphics.__canvas = cacheCanvas;
					graphics.__context = cacheContext;
					return true;
				}
				openfl_display__$internal_CanvasGraphics.hasFill = false;
				openfl_display__$internal_CanvasGraphics.bitmapFill = null;
				break;
			case 14:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_BITMAP_STYLE;
				var this12 = data;
				var c10 = this12;
				openfl_display__$internal_CanvasGraphics.strokeCommands.lineBitmapStyle(c10.buffer.o[c10.oPos],c10.buffer.o[c10.oPos + 1],c10.buffer.b[c10.bPos],c10.buffer.b[c10.bPos + 1]);
				break;
			case 15:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_GRADIENT_STYLE;
				var this13 = data;
				var c11 = this13;
				openfl_display__$internal_CanvasGraphics.strokeCommands.lineGradientStyle(c11.buffer.o[c11.oPos],c11.buffer.ii[c11.iiPos],c11.buffer.ff[c11.ffPos],c11.buffer.ii[c11.iiPos + 1],c11.buffer.o[c11.oPos + 1],c11.buffer.o[c11.oPos + 2],c11.buffer.o[c11.oPos + 3],c11.buffer.f[c11.fPos]);
				break;
			case 16:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_STYLE;
				var this14 = data;
				var c12 = this14;
				openfl_display__$internal_CanvasGraphics.strokeCommands.lineStyle(c12.buffer.o[c12.oPos],c12.buffer.i[c12.iPos],1,c12.buffer.b[c12.bPos],c12.buffer.o[c12.oPos + 1],c12.buffer.o[c12.oPos + 2],c12.buffer.o[c12.oPos + 3],c12.buffer.f[c12.fPos + 1]);
				break;
			case 17:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_TO;
				var this15 = data;
				var c13 = this15;
				openfl_display__$internal_CanvasGraphics.fillCommands.lineTo(c13.buffer.f[c13.fPos],c13.buffer.f[c13.fPos + 1]);
				openfl_display__$internal_CanvasGraphics.strokeCommands.lineTo(c13.buffer.f[c13.fPos],c13.buffer.f[c13.fPos + 1]);
				break;
			case 18:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.MOVE_TO;
				var this16 = data;
				var c14 = this16;
				openfl_display__$internal_CanvasGraphics.fillCommands.moveTo(c14.buffer.f[c14.fPos],c14.buffer.f[c14.fPos + 1]);
				openfl_display__$internal_CanvasGraphics.strokeCommands.moveTo(c14.buffer.f[c14.fPos],c14.buffer.f[c14.fPos + 1]);
				break;
			case 21:
				openfl_display__$internal_CanvasGraphics.windingRule = "evenodd";
				break;
			case 22:
				openfl_display__$internal_CanvasGraphics.windingRule = "nonzero";
				break;
			default:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = type;
			}
		}
		var hitTest = false;
		if(openfl_display__$internal_CanvasGraphics.fillCommands.get_length() > 0) {
			openfl_display__$internal_CanvasGraphics.endFill();
		}
		if(openfl_display__$internal_CanvasGraphics.hasFill && openfl_display__$internal_CanvasGraphics.context.isPointInPath(x,y,openfl_display__$internal_CanvasGraphics.windingRule)) {
			hitTest = true;
		}
		if(openfl_display__$internal_CanvasGraphics.strokeCommands.get_length() > 0) {
			openfl_display__$internal_CanvasGraphics.endStroke();
		}
		if(openfl_display__$internal_CanvasGraphics.hasStroke && openfl_display__$internal_CanvasGraphics.context.isPointInStroke(x,y)) {
			hitTest = true;
		}
		data.destroy();
		graphics.__canvas = cacheCanvas;
		graphics.__context = cacheContext;
		return hitTest;
	}
};
openfl_display__$internal_CanvasGraphics.isCCW = function(x1,y1,x2,y2,x3,y3) {
	return (x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1) < 0;
};
openfl_display__$internal_CanvasGraphics.normalizeUVT = function(uvt,skipT) {
	if(skipT == null) {
		skipT = false;
	}
	var max = -Infinity;
	var tmp = -Infinity;
	var len = uvt.get_length();
	var _g = 1;
	var _g1 = len + 1;
	while(_g < _g1) {
		var t = _g++;
		if(skipT && t % 3 == 0) {
			continue;
		}
		tmp = uvt.get(t - 1);
		if(max < tmp) {
			max = tmp;
		}
	}
	if(!skipT) {
		return { max : max, uvt : uvt};
	}
	var result = openfl_Vector.toFloatVector(null);
	var _g = 1;
	var _g1 = len + 1;
	while(_g < _g1) {
		var t = _g++;
		if(skipT && t % 3 == 0) {
			continue;
		}
		result.push(uvt.get(t - 1));
	}
	return { max : max, uvt : result};
};
openfl_display__$internal_CanvasGraphics.playCommands = function(commands,stroke) {
	if(stroke == null) {
		stroke = false;
	}
	openfl_display__$internal_CanvasGraphics.bounds = openfl_display__$internal_CanvasGraphics.graphics.__bounds;
	var offsetX = openfl_display__$internal_CanvasGraphics.bounds.x;
	var offsetY = openfl_display__$internal_CanvasGraphics.bounds.y;
	var positionX = 0.0;
	var positionY = 0.0;
	var closeGap = false;
	var startX = 0.0;
	var startY = 0.0;
	var setStart = false;
	openfl_display__$internal_CanvasGraphics.windingRule = "evenodd";
	openfl_display__$internal_CanvasGraphics.setSmoothing(true);
	var hasPath = false;
	var data = new openfl_display__$internal_DrawCommandReader(commands);
	var x;
	var y;
	var width;
	var height;
	var kappa = .5522848;
	var ox;
	var oy;
	var xe;
	var ye;
	var xm;
	var ym;
	var r;
	var g;
	var b;
	var optimizationUsed;
	var canOptimizeMatrix;
	var st;
	var sr;
	var sb;
	var sl;
	var stl = null;
	var sbr = null;
	var _g = 0;
	var _g1 = commands.types;
	_hx_loop1: while(_g < _g1.length) {
		var type = _g1[_g];
		++_g;
		switch(type._hx_index) {
		case 0:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL;
			var this1 = data;
			var c = this1;
			openfl_display__$internal_CanvasGraphics.bitmapFill = c.buffer.o[c.oPos];
			openfl_display__$internal_CanvasGraphics.context.fillStyle = openfl_display__$internal_CanvasGraphics.createBitmapFill(c.buffer.o[c.oPos],c.buffer.b[c.bPos],c.buffer.b[c.bPos + 1]);
			openfl_display__$internal_CanvasGraphics.hasFill = true;
			if(c.buffer.o[c.oPos + 1] != null) {
				openfl_display__$internal_CanvasGraphics.pendingMatrix = c.buffer.o[c.oPos + 1];
				openfl_display__$internal_CanvasGraphics.inversePendingMatrix = c.buffer.o[c.oPos + 1].clone();
				openfl_display__$internal_CanvasGraphics.inversePendingMatrix.invert();
			} else {
				openfl_display__$internal_CanvasGraphics.pendingMatrix = null;
				openfl_display__$internal_CanvasGraphics.inversePendingMatrix = null;
			}
			break;
		case 1:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.BEGIN_FILL;
			var this2 = data;
			var c1 = this2;
			if(c1.buffer.f[c1.fPos] < 0.005) {
				openfl_display__$internal_CanvasGraphics.hasFill = false;
			} else {
				if(c1.buffer.f[c1.fPos] == 1) {
					var tmp = StringTools.hex(c1.buffer.i[c1.iPos] & 16777215,6);
					openfl_display__$internal_CanvasGraphics.context.fillStyle = "#" + tmp;
				} else {
					r = (c1.buffer.i[c1.iPos] & 16711680) >>> 16;
					g = (c1.buffer.i[c1.iPos] & 65280) >>> 8;
					b = c1.buffer.i[c1.iPos] & 255;
					openfl_display__$internal_CanvasGraphics.context.fillStyle = "rgba(" + r + ", " + g + ", " + b + ", " + c1.buffer.f[c1.fPos] + ")";
				}
				openfl_display__$internal_CanvasGraphics.bitmapFill = null;
				openfl_display__$internal_CanvasGraphics.setSmoothing(true);
				openfl_display__$internal_CanvasGraphics.hasFill = true;
			}
			break;
		case 2:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL;
			var this3 = data;
			var c2 = this3;
			openfl_display__$internal_CanvasGraphics.context.fillStyle = openfl_display__$internal_CanvasGraphics.createGradientPattern(c2.buffer.o[c2.oPos],c2.buffer.ii[c2.iiPos],c2.buffer.ff[c2.ffPos],c2.buffer.ii[c2.iiPos + 1],c2.buffer.o[c2.oPos + 1],c2.buffer.o[c2.oPos + 2],c2.buffer.o[c2.oPos + 3],c2.buffer.f[c2.fPos]);
			openfl_display__$internal_CanvasGraphics.bitmapFill = null;
			openfl_display__$internal_CanvasGraphics.setSmoothing(true);
			openfl_display__$internal_CanvasGraphics.hasFill = true;
			break;
		case 3:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL;
			var this4 = data;
			var c3 = this4;
			var shaderBuffer = c3.buffer.o[c3.oPos];
			if(shaderBuffer.inputCount > 0) {
				openfl_display__$internal_CanvasGraphics.bitmapFill = shaderBuffer.inputs[0];
				openfl_display__$internal_CanvasGraphics.context.fillStyle = openfl_display__$internal_CanvasGraphics.createBitmapFill(openfl_display__$internal_CanvasGraphics.bitmapFill,shaderBuffer.inputWrap[0] != 0,shaderBuffer.inputFilter[0] != 5);
				openfl_display__$internal_CanvasGraphics.hasFill = true;
				openfl_display__$internal_CanvasGraphics.pendingMatrix = null;
				openfl_display__$internal_CanvasGraphics.inversePendingMatrix = null;
			}
			break;
		case 4:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO;
			var this5 = data;
			var c4 = this5;
			hasPath = true;
			openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(c4.buffer.f[c4.fPos] - offsetX,c4.buffer.f[c4.fPos + 1] - offsetY,c4.buffer.f[c4.fPos + 2] - offsetX,c4.buffer.f[c4.fPos + 3] - offsetY,c4.buffer.f[c4.fPos + 4] - offsetX,c4.buffer.f[c4.fPos + 5] - offsetY);
			break;
		case 5:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.CURVE_TO;
			var this6 = data;
			var c5 = this6;
			hasPath = true;
			openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(c5.buffer.f[c5.fPos] - offsetX,c5.buffer.f[c5.fPos + 1] - offsetY,c5.buffer.f[c5.fPos + 2] - offsetX,c5.buffer.f[c5.fPos + 3] - offsetY);
			break;
		case 6:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.DRAW_CIRCLE;
			var this7 = data;
			var c6 = this7;
			hasPath = true;
			openfl_display__$internal_CanvasGraphics.context.moveTo(c6.buffer.f[c6.fPos] - offsetX + c6.buffer.f[c6.fPos + 2],c6.buffer.f[c6.fPos + 1] - offsetY);
			openfl_display__$internal_CanvasGraphics.context.arc(c6.buffer.f[c6.fPos] - offsetX,c6.buffer.f[c6.fPos + 1] - offsetY,c6.buffer.f[c6.fPos + 2],0,Math.PI * 2,true);
			break;
		case 7:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE;
			var this8 = data;
			var c7 = this8;
			hasPath = true;
			x = c7.buffer.f[c7.fPos];
			y = c7.buffer.f[c7.fPos + 1];
			width = c7.buffer.f[c7.fPos + 2];
			height = c7.buffer.f[c7.fPos + 3];
			x -= offsetX;
			y -= offsetY;
			ox = width / 2 * kappa;
			oy = height / 2 * kappa;
			xe = x + width;
			ye = y + height;
			xm = x + width / 2;
			ym = y + height / 2;
			openfl_display__$internal_CanvasGraphics.context.moveTo(x,ym);
			openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(x,ym - oy,xm - ox,y,xm,y);
			openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(xm + ox,y,xe,ym - oy,xe,ym);
			openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(xe,ym + oy,xm + ox,ye,xm,ye);
			openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(xm - ox,ye,x,ym + oy,x,ym);
			break;
		case 8:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.DRAW_QUADS;
			var this9 = data;
			var c8 = this9;
			var rects = c8.buffer.o[c8.oPos];
			var indices = c8.buffer.o[c8.oPos + 1];
			var transforms = c8.buffer.o[c8.oPos + 2];
			var hasIndices = indices != null;
			var transformABCD = false;
			var transformXY = false;
			var length = hasIndices ? indices.get_length() : Math.floor(rects.get_length() / 4);
			if(length == 0) {
				return;
			}
			if(transforms != null) {
				if(transforms.get_length() >= length * 6) {
					transformABCD = true;
					transformXY = true;
				} else if(transforms.get_length() >= length * 4) {
					transformABCD = true;
				} else if(transforms.get_length() >= length * 2) {
					transformXY = true;
				}
			}
			var tileRect = openfl_geom_Rectangle.__pool.get();
			var tileTransform = openfl_geom_Matrix.__pool.get();
			var transform = openfl_display__$internal_CanvasGraphics.graphics.__renderTransform;
			var alpha = openfl_display__$internal_CanvasGraphics.worldAlpha;
			var ri;
			var ti;
			openfl_display__$internal_CanvasGraphics.context.save();
			var _g2 = 0;
			var _g3 = length;
			while(_g2 < _g3) {
				var i = _g2++;
				ri = hasIndices ? indices.get(i) * 4 : i * 4;
				if(ri < 0) {
					continue;
				}
				tileRect.setTo(rects.get(ri),rects.get(ri + 1),rects.get(ri + 2),rects.get(ri + 3));
				if(tileRect.width <= 0 || tileRect.height <= 0) {
					continue;
				}
				if(transformABCD && transformXY) {
					ti = i * 6;
					tileTransform.setTo(transforms.get(ti),transforms.get(ti + 1),transforms.get(ti + 2),transforms.get(ti + 3),transforms.get(ti + 4),transforms.get(ti + 5));
				} else if(transformABCD) {
					ti = i * 4;
					tileTransform.setTo(transforms.get(ti),transforms.get(ti + 1),transforms.get(ti + 2),transforms.get(ti + 3),tileRect.x,tileRect.y);
				} else if(transformXY) {
					ti = i * 2;
					tileTransform.tx = transforms.get(ti);
					tileTransform.ty = transforms.get(ti + 1);
				} else {
					tileTransform.tx = tileRect.x;
					tileTransform.ty = tileRect.y;
				}
				tileTransform.tx += positionX - offsetX;
				tileTransform.ty += positionY - offsetY;
				tileTransform.concat(transform);
				openfl_display__$internal_CanvasGraphics.context.setTransform(tileTransform.a,tileTransform.b,tileTransform.c,tileTransform.d,tileTransform.tx,tileTransform.ty);
				if(openfl_display__$internal_CanvasGraphics.bitmapFill != null) {
					openfl_display__$internal_CanvasGraphics.context.drawImage(openfl_display__$internal_CanvasGraphics.bitmapFill.image.get_src(),tileRect.x,tileRect.y,tileRect.width,tileRect.height,0,0,tileRect.width,tileRect.height);
				} else {
					openfl_display__$internal_CanvasGraphics.context.fillRect(0,0,tileRect.width,tileRect.height);
				}
			}
			openfl_geom_Rectangle.__pool.release(tileRect);
			openfl_geom_Matrix.__pool.release(tileTransform);
			openfl_display__$internal_CanvasGraphics.context.restore();
			break;
		case 9:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.DRAW_RECT;
			var this10 = data;
			var c9 = this10;
			optimizationUsed = false;
			if(openfl_display__$internal_CanvasGraphics.bitmapFill != null && !openfl_display__$internal_CanvasGraphics.hitTesting) {
				st = 0;
				sr = 0;
				sb = 0;
				sl = 0;
				canOptimizeMatrix = true;
				if(openfl_display__$internal_CanvasGraphics.pendingMatrix != null) {
					if(openfl_display__$internal_CanvasGraphics.pendingMatrix.b != 0 || openfl_display__$internal_CanvasGraphics.pendingMatrix.c != 0) {
						canOptimizeMatrix = false;
					} else {
						if(stl == null) {
							stl = openfl_geom_Point.__pool.get();
						}
						if(sbr == null) {
							sbr = openfl_geom_Point.__pool.get();
						}
						stl.setTo(c9.buffer.f[c9.fPos],c9.buffer.f[c9.fPos + 1]);
						var _this = openfl_display__$internal_CanvasGraphics.inversePendingMatrix;
						var px = stl.x;
						var py = stl.y;
						stl.x = px * _this.a + py * _this.c + _this.tx;
						stl.y = px * _this.b + py * _this.d + _this.ty;
						sbr.setTo(c9.buffer.f[c9.fPos] + c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 1] + c9.buffer.f[c9.fPos + 3]);
						var _this1 = openfl_display__$internal_CanvasGraphics.inversePendingMatrix;
						var px1 = sbr.x;
						var py1 = sbr.y;
						sbr.x = px1 * _this1.a + py1 * _this1.c + _this1.tx;
						sbr.y = px1 * _this1.b + py1 * _this1.d + _this1.ty;
						st = stl.y;
						sl = stl.x;
						sb = sbr.y;
						sr = sbr.x;
					}
				} else {
					st = c9.buffer.f[c9.fPos + 1];
					sl = c9.buffer.f[c9.fPos];
					sb = c9.buffer.f[c9.fPos + 1] + c9.buffer.f[c9.fPos + 3];
					sr = c9.buffer.f[c9.fPos] + c9.buffer.f[c9.fPos + 2];
				}
				if(canOptimizeMatrix && st >= 0 && sl >= 0 && sr <= openfl_display__$internal_CanvasGraphics.bitmapFill.width && sb <= openfl_display__$internal_CanvasGraphics.bitmapFill.height) {
					optimizationUsed = true;
					if(!openfl_display__$internal_CanvasGraphics.hitTesting) {
						openfl_display__$internal_CanvasGraphics.context.drawImage(openfl_display__$internal_CanvasGraphics.bitmapFill.image.get_src(),sl,st,sr - sl,sb - st,c9.buffer.f[c9.fPos] - offsetX,c9.buffer.f[c9.fPos + 1] - offsetY,c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 3]);
					}
				}
			}
			if(!optimizationUsed) {
				hasPath = true;
				openfl_display__$internal_CanvasGraphics.context.rect(c9.buffer.f[c9.fPos] - offsetX,c9.buffer.f[c9.fPos + 1] - offsetY,c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 3]);
			}
			break;
		case 10:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT;
			var this11 = data;
			var c10 = this11;
			hasPath = true;
			openfl_display__$internal_CanvasGraphics.drawRoundRect(c10.buffer.f[c10.fPos] - offsetX,c10.buffer.f[c10.fPos + 1] - offsetY,c10.buffer.f[c10.fPos + 2],c10.buffer.f[c10.fPos + 3],c10.buffer.f[c10.fPos + 4],c10.buffer.o[c10.oPos]);
			break;
		case 12:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.DRAW_TRIANGLES;
			var this12 = data;
			var c11 = this12;
			var v = c11.buffer.o[c11.oPos];
			var ind = c11.buffer.o[c11.oPos + 1];
			var uvt = c11.buffer.o[c11.oPos + 2];
			var pattern = null;
			var colorFill = openfl_display__$internal_CanvasGraphics.bitmapFill == null;
			if(colorFill && uvt != null) {
				break _hx_loop1;
			}
			if(!colorFill) {
				if(uvt == null) {
					uvt = openfl_Vector.toFloatVector(null);
					var _g4 = 0;
					var _g5 = v.get_length() / 2 | 0;
					while(_g4 < _g5) {
						var i1 = _g4++;
						uvt.push(v.get(i1 * 2) - offsetX / openfl_display__$internal_CanvasGraphics.bitmapFill.width);
						uvt.push(v.get(i1 * 2 + 1) - offsetY / openfl_display__$internal_CanvasGraphics.bitmapFill.height);
					}
				}
				var skipT = uvt.get_length() != v.get_length();
				var normalizedUVT = openfl_display__$internal_CanvasGraphics.normalizeUVT(uvt,skipT);
				var maxUVT = normalizedUVT.max;
				uvt = normalizedUVT.uvt;
				if(maxUVT > 1) {
					pattern = openfl_display__$internal_CanvasGraphics.createTempPatternCanvas(openfl_display__$internal_CanvasGraphics.bitmapFill,openfl_display__$internal_CanvasGraphics.bitmapRepeat,openfl_display__$internal_CanvasGraphics.bounds.width | 0,openfl_display__$internal_CanvasGraphics.bounds.height | 0);
				} else {
					pattern = openfl_display__$internal_CanvasGraphics.createTempPatternCanvas(openfl_display__$internal_CanvasGraphics.bitmapFill,openfl_display__$internal_CanvasGraphics.bitmapRepeat,openfl_display__$internal_CanvasGraphics.bitmapFill.width,openfl_display__$internal_CanvasGraphics.bitmapFill.height);
				}
			}
			var i2 = 0;
			var l = ind.get_length();
			var a_;
			var b_;
			var c_;
			var iax;
			var iay;
			var ibx;
			var iby;
			var icx;
			var icy;
			var x1;
			var y1;
			var x2;
			var y2;
			var x3;
			var y3;
			var uvx1;
			var uvy1;
			var uvx2;
			var uvy2;
			var uvx3;
			var uvy3;
			var denom;
			var t1;
			var t2;
			var t3;
			var t4;
			var dx;
			var dy;
			while(i2 < l) {
				a_ = i2;
				b_ = i2 + 1;
				c_ = i2 + 2;
				iax = ind.get(a_) * 2;
				iay = ind.get(a_) * 2 + 1;
				ibx = ind.get(b_) * 2;
				iby = ind.get(b_) * 2 + 1;
				icx = ind.get(c_) * 2;
				icy = ind.get(c_) * 2 + 1;
				x1 = v.get(iax) - offsetX;
				y1 = v.get(iay) - offsetY;
				x2 = v.get(ibx) - offsetX;
				y2 = v.get(iby) - offsetY;
				x3 = v.get(icx) - offsetX;
				y3 = v.get(icy) - offsetY;
				switch(c11.buffer.o[c11.oPos + 3]) {
				case 0:
					if((x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1) < 0) {
						i2 += 3;
						continue;
					}
					break;
				case 2:
					if(!((x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1) < 0)) {
						i2 += 3;
						continue;
					}
					break;
				default:
				}
				if(colorFill) {
					openfl_display__$internal_CanvasGraphics.context.beginPath();
					openfl_display__$internal_CanvasGraphics.context.moveTo(x1,y1);
					openfl_display__$internal_CanvasGraphics.context.lineTo(x2,y2);
					openfl_display__$internal_CanvasGraphics.context.lineTo(x3,y3);
					openfl_display__$internal_CanvasGraphics.context.closePath();
					if(!openfl_display__$internal_CanvasGraphics.hitTesting) {
						openfl_display__$internal_CanvasGraphics.context.fill(openfl_display__$internal_CanvasGraphics.windingRule);
					}
					i2 += 3;
					continue;
				}
				uvx1 = uvt.get(iax) * pattern.width;
				uvx2 = uvt.get(ibx) * pattern.width;
				uvx3 = uvt.get(icx) * pattern.width;
				uvy1 = uvt.get(iay) * pattern.height;
				uvy2 = uvt.get(iby) * pattern.height;
				uvy3 = uvt.get(icy) * pattern.height;
				denom = uvx1 * (uvy3 - uvy2) - uvx2 * uvy3 + uvx3 * uvy2 + (uvx2 - uvx3) * uvy1;
				if(denom == 0) {
					i2 += 3;
					openfl_display__$internal_CanvasGraphics.context.restore();
					continue;
				}
				openfl_display__$internal_CanvasGraphics.context.save();
				openfl_display__$internal_CanvasGraphics.context.beginPath();
				openfl_display__$internal_CanvasGraphics.context.moveTo(x1,y1);
				openfl_display__$internal_CanvasGraphics.context.lineTo(x2,y2);
				openfl_display__$internal_CanvasGraphics.context.lineTo(x3,y3);
				openfl_display__$internal_CanvasGraphics.context.closePath();
				openfl_display__$internal_CanvasGraphics.context.clip();
				t1 = -(uvy1 * (x3 - x2) - uvy2 * x3 + uvy3 * x2 + (uvy2 - uvy3) * x1) / denom;
				t2 = (uvy2 * y3 + uvy1 * (y2 - y3) - uvy3 * y2 + (uvy3 - uvy2) * y1) / denom;
				t3 = (uvx1 * (x3 - x2) - uvx2 * x3 + uvx3 * x2 + (uvx2 - uvx3) * x1) / denom;
				t4 = -(uvx2 * y3 + uvx1 * (y2 - y3) - uvx3 * y2 + (uvx3 - uvx2) * y1) / denom;
				dx = (uvx1 * (uvy3 * x2 - uvy2 * x3) + uvy1 * (uvx2 * x3 - uvx3 * x2) + (uvx3 * uvy2 - uvx2 * uvy3) * x1) / denom;
				dy = (uvx1 * (uvy3 * y2 - uvy2 * y3) + uvy1 * (uvx2 * y3 - uvx3 * y2) + (uvx3 * uvy2 - uvx2 * uvy3) * y1) / denom;
				openfl_display__$internal_CanvasGraphics.context.transform(t1,t2,t3,t4,dx,dy);
				openfl_display__$internal_CanvasGraphics.context.drawImage(pattern,0,0,pattern.width,pattern.height);
				openfl_display__$internal_CanvasGraphics.context.restore();
				i2 += 3;
			}
			break;
		case 14:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.LINE_BITMAP_STYLE;
			var this13 = data;
			var c12 = this13;
			if(stroke && openfl_display__$internal_CanvasGraphics.hasStroke) {
				openfl_display__$internal_CanvasGraphics.closePath();
			}
			openfl_display__$internal_CanvasGraphics.context.moveTo(positionX - offsetX,positionY - offsetY);
			openfl_display__$internal_CanvasGraphics.context.strokeStyle = openfl_display__$internal_CanvasGraphics.createBitmapFill(c12.buffer.o[c12.oPos],c12.buffer.b[c12.bPos],c12.buffer.b[c12.bPos + 1]);
			openfl_display__$internal_CanvasGraphics.hasStroke = true;
			break;
		case 15:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.LINE_GRADIENT_STYLE;
			var this14 = data;
			var c13 = this14;
			if(stroke && openfl_display__$internal_CanvasGraphics.hasStroke) {
				openfl_display__$internal_CanvasGraphics.closePath();
			}
			openfl_display__$internal_CanvasGraphics.context.moveTo(positionX - offsetX,positionY - offsetY);
			openfl_display__$internal_CanvasGraphics.context.strokeStyle = openfl_display__$internal_CanvasGraphics.createGradientPattern(c13.buffer.o[c13.oPos],c13.buffer.ii[c13.iiPos],c13.buffer.ff[c13.ffPos],c13.buffer.ii[c13.iiPos + 1],c13.buffer.o[c13.oPos + 1],c13.buffer.o[c13.oPos + 2],c13.buffer.o[c13.oPos + 3],c13.buffer.f[c13.fPos]);
			openfl_display__$internal_CanvasGraphics.setSmoothing(true);
			openfl_display__$internal_CanvasGraphics.hasStroke = true;
			break;
		case 16:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.LINE_STYLE;
			var this15 = data;
			var c14 = this15;
			if(stroke && openfl_display__$internal_CanvasGraphics.hasStroke) {
				openfl_display__$internal_CanvasGraphics.closePath(true);
			}
			openfl_display__$internal_CanvasGraphics.context.moveTo(positionX - offsetX,positionY - offsetY);
			if(c14.buffer.o[c14.oPos] == null) {
				openfl_display__$internal_CanvasGraphics.hasStroke = false;
			} else {
				openfl_display__$internal_CanvasGraphics.context.lineWidth = c14.buffer.o[c14.oPos] > 0 ? c14.buffer.o[c14.oPos] : 1;
				var tmp1 = c14.buffer.o[c14.oPos + 3] == null ? "round" : openfl_display_JointStyle.toString(c14.buffer.o[c14.oPos + 3]).toLowerCase();
				openfl_display__$internal_CanvasGraphics.context.lineJoin = tmp1;
				var tmp2 = c14.buffer.o[c14.oPos + 2] == null ? "round" : c14.buffer.o[c14.oPos + 2] == 0 ? "butt" : openfl_display_CapsStyle.toString(c14.buffer.o[c14.oPos + 2]).toLowerCase();
				openfl_display__$internal_CanvasGraphics.context.lineCap = tmp2;
				openfl_display__$internal_CanvasGraphics.context.miterLimit = c14.buffer.f[c14.fPos + 1];
				if(c14.buffer.f[c14.fPos] == 1) {
					var tmp3 = StringTools.hex(c14.buffer.i[c14.iPos] & 16777215,6);
					openfl_display__$internal_CanvasGraphics.context.strokeStyle = "#" + tmp3;
				} else {
					r = (c14.buffer.i[c14.iPos] & 16711680) >>> 16;
					g = (c14.buffer.i[c14.iPos] & 65280) >>> 8;
					b = c14.buffer.i[c14.iPos] & 255;
					openfl_display__$internal_CanvasGraphics.context.strokeStyle = "rgba(" + r + ", " + g + ", " + b + ", " + c14.buffer.f[c14.fPos] + ")";
				}
				openfl_display__$internal_CanvasGraphics.setSmoothing(true);
				openfl_display__$internal_CanvasGraphics.hasStroke = true;
			}
			break;
		case 17:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.LINE_TO;
			var this16 = data;
			var c15 = this16;
			hasPath = true;
			openfl_display__$internal_CanvasGraphics.context.lineTo(c15.buffer.f[c15.fPos] - offsetX,c15.buffer.f[c15.fPos + 1] - offsetY);
			positionX = c15.buffer.f[c15.fPos];
			positionY = c15.buffer.f[c15.fPos + 1];
			if(positionX == startX && positionY == startY) {
				closeGap = true;
			}
			break;
		case 18:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.MOVE_TO;
			var this17 = data;
			var c16 = this17;
			openfl_display__$internal_CanvasGraphics.context.moveTo(c16.buffer.f[c16.fPos] - offsetX,c16.buffer.f[c16.fPos + 1] - offsetY);
			positionX = c16.buffer.f[c16.fPos];
			positionY = c16.buffer.f[c16.fPos + 1];
			if(setStart && c16.buffer.f[c16.fPos] != startX && c16.buffer.f[c16.fPos + 1] != startY) {
				closeGap = true;
			}
			startX = c16.buffer.f[c16.fPos];
			startY = c16.buffer.f[c16.fPos + 1];
			setStart = true;
			break;
		case 21:
			openfl_display__$internal_CanvasGraphics.windingRule = "evenodd";
			break;
		case 22:
			openfl_display__$internal_CanvasGraphics.windingRule = "nonzero";
			break;
		default:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = type;
		}
	}
	if(stl != null) {
		openfl_geom_Point.__pool.release(stl);
	}
	if(sbr != null) {
		openfl_geom_Point.__pool.release(sbr);
	}
	data.destroy();
	if(hasPath) {
		if(stroke && openfl_display__$internal_CanvasGraphics.hasStroke) {
			if(openfl_display__$internal_CanvasGraphics.hasFill && closeGap) {
				openfl_display__$internal_CanvasGraphics.context.lineTo(startX - offsetX,startY - offsetY);
				openfl_display__$internal_CanvasGraphics.closePath(false);
			} else if(closeGap && positionX == startX && positionY == startY) {
				openfl_display__$internal_CanvasGraphics.closePath(false);
			}
			if(!openfl_display__$internal_CanvasGraphics.hitTesting) {
				openfl_display__$internal_CanvasGraphics.context.stroke();
			}
		}
		if(!stroke) {
			if(openfl_display__$internal_CanvasGraphics.hasFill || openfl_display__$internal_CanvasGraphics.bitmapFill != null) {
				openfl_display__$internal_CanvasGraphics.context.translate(-openfl_display__$internal_CanvasGraphics.bounds.x,-openfl_display__$internal_CanvasGraphics.bounds.y);
				if(openfl_display__$internal_CanvasGraphics.pendingMatrix != null) {
					openfl_display__$internal_CanvasGraphics.context.transform(openfl_display__$internal_CanvasGraphics.pendingMatrix.a,openfl_display__$internal_CanvasGraphics.pendingMatrix.b,openfl_display__$internal_CanvasGraphics.pendingMatrix.c,openfl_display__$internal_CanvasGraphics.pendingMatrix.d,openfl_display__$internal_CanvasGraphics.pendingMatrix.tx,openfl_display__$internal_CanvasGraphics.pendingMatrix.ty);
					if(!openfl_display__$internal_CanvasGraphics.hitTesting) {
						openfl_display__$internal_CanvasGraphics.context.fill(openfl_display__$internal_CanvasGraphics.windingRule);
					}
					openfl_display__$internal_CanvasGraphics.context.transform(openfl_display__$internal_CanvasGraphics.inversePendingMatrix.a,openfl_display__$internal_CanvasGraphics.inversePendingMatrix.b,openfl_display__$internal_CanvasGraphics.inversePendingMatrix.c,openfl_display__$internal_CanvasGraphics.inversePendingMatrix.d,openfl_display__$internal_CanvasGraphics.inversePendingMatrix.tx,openfl_display__$internal_CanvasGraphics.inversePendingMatrix.ty);
				} else if(!openfl_display__$internal_CanvasGraphics.hitTesting) {
					openfl_display__$internal_CanvasGraphics.context.fill(openfl_display__$internal_CanvasGraphics.windingRule);
				}
				openfl_display__$internal_CanvasGraphics.context.translate(openfl_display__$internal_CanvasGraphics.bounds.x,openfl_display__$internal_CanvasGraphics.bounds.y);
				openfl_display__$internal_CanvasGraphics.context.closePath();
			}
		}
	}
};
openfl_display__$internal_CanvasGraphics.render = function(graphics,renderer) {
	graphics.__update(renderer.__worldTransform);
	if(graphics.__softwareDirty) {
		openfl_display__$internal_CanvasGraphics.hitTesting = false;
		openfl_display__$internal_CanvasGraphics.graphics = graphics;
		openfl_display__$internal_CanvasGraphics.allowSmoothing = renderer.__allowSmoothing;
		openfl_display__$internal_CanvasGraphics.worldAlpha = renderer.__getAlpha(graphics.__owner.__worldAlpha);
		openfl_display__$internal_CanvasGraphics.bounds = graphics.__bounds;
		var width = graphics.__width;
		var height = graphics.__height;
		if(!graphics.__visible || graphics.__commands.get_length() == 0 || openfl_display__$internal_CanvasGraphics.bounds == null || width < 1 || height < 1) {
			graphics.__canvas = null;
			graphics.__context = null;
			graphics.__bitmap = null;
		} else {
			if(graphics.__canvas == null) {
				graphics.__canvas = window.document.createElement("canvas");
				graphics.__context = graphics.__canvas.getContext("2d");
			}
			openfl_display__$internal_CanvasGraphics.context = graphics.__context;
			var transform = graphics.__renderTransform;
			var canvas = graphics.__canvas;
			var scale = renderer.pixelRatio;
			var scaledWidth = width * scale | 0;
			var scaledHeight = height * scale | 0;
			renderer.__setBlendModeContext(openfl_display__$internal_CanvasGraphics.context,10);
			if(renderer.__isDOM) {
				if(canvas.width == scaledWidth && canvas.height == scaledHeight) {
					openfl_display__$internal_CanvasGraphics.context.clearRect(0,0,scaledWidth,scaledHeight);
				} else {
					canvas.width = scaledWidth;
					canvas.height = scaledHeight;
					canvas.style.width = width + "px";
					canvas.style.height = height + "px";
				}
				var transform1 = graphics.__renderTransform;
				openfl_display__$internal_CanvasGraphics.context.setTransform(transform1.a * scale,transform1.b * scale,transform1.c * scale,transform1.d * scale,transform1.tx * scale,transform1.ty * scale);
			} else {
				if(canvas.width == scaledWidth && canvas.height == scaledHeight) {
					openfl_display__$internal_CanvasGraphics.context.closePath();
					openfl_display__$internal_CanvasGraphics.context.setTransform(1,0,0,1,0,0);
					openfl_display__$internal_CanvasGraphics.context.clearRect(0,0,scaledWidth,scaledHeight);
				} else {
					canvas.width = width;
					canvas.height = height;
				}
				openfl_display__$internal_CanvasGraphics.context.setTransform(transform.a,transform.b,transform.c,transform.d,transform.tx,transform.ty);
			}
			openfl_display__$internal_CanvasGraphics.fillCommands.clear();
			openfl_display__$internal_CanvasGraphics.strokeCommands.clear();
			openfl_display__$internal_CanvasGraphics.hasFill = false;
			openfl_display__$internal_CanvasGraphics.hasStroke = false;
			openfl_display__$internal_CanvasGraphics.bitmapFill = null;
			openfl_display__$internal_CanvasGraphics.bitmapRepeat = false;
			var hasLineStyle = false;
			var initStrokeX = 0.0;
			var initStrokeY = 0.0;
			openfl_display__$internal_CanvasGraphics.windingRule = "evenodd";
			var data = new openfl_display__$internal_DrawCommandReader(graphics.__commands);
			var _g = 0;
			var _g1 = graphics.__commands.types;
			while(_g < _g1.length) {
				var type = _g1[_g];
				++_g;
				switch(type._hx_index) {
				case 0:case 1:case 2:case 3:
					openfl_display__$internal_CanvasGraphics.endFill();
					openfl_display__$internal_CanvasGraphics.endStroke();
					if(type == openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL) {
						switch(data.prev._hx_index) {
						case 0:
							data.oPos += 2;
							data.bPos += 2;
							break;
						case 1:
							data.iPos += 1;
							data.fPos += 1;
							break;
						case 2:
							data.oPos += 4;
							data.iiPos += 2;
							data.ffPos += 1;
							data.fPos += 1;
							break;
						case 3:
							data.oPos += 1;
							break;
						case 4:
							data.fPos += 6;
							break;
						case 5:
							data.fPos += 4;
							break;
						case 6:
							data.fPos += 3;
							break;
						case 7:
							data.fPos += 4;
							break;
						case 8:
							data.oPos += 3;
							break;
						case 9:
							data.fPos += 4;
							break;
						case 10:
							data.fPos += 5;
							data.oPos += 1;
							break;
						case 12:
							data.oPos += 4;
							break;
						case 13:
							break;
						case 14:
							data.oPos += 2;
							data.bPos += 2;
							break;
						case 15:
							data.oPos += 4;
							data.iiPos += 2;
							data.ffPos += 1;
							data.fPos += 1;
							break;
						case 16:
							data.oPos += 4;
							data.iPos += 1;
							data.fPos += 2;
							data.bPos += 1;
							break;
						case 17:
							data.fPos += 2;
							break;
						case 18:
							data.fPos += 2;
							break;
						case 19:
							data.oPos += 1;
							break;
						case 20:
							data.oPos += 1;
							break;
						case 21:case 22:
							break;
						default:
						}
						data.prev = openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL;
						var this1 = data;
						var c = this1;
						openfl_display__$internal_CanvasGraphics.fillCommands.beginBitmapFill(c.buffer.o[c.oPos],c.buffer.o[c.oPos + 1],c.buffer.b[c.bPos],c.buffer.b[c.bPos + 1]);
						openfl_display__$internal_CanvasGraphics.strokeCommands.beginBitmapFill(c.buffer.o[c.oPos],c.buffer.o[c.oPos + 1],c.buffer.b[c.bPos],c.buffer.b[c.bPos + 1]);
					} else if(type == openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL) {
						switch(data.prev._hx_index) {
						case 0:
							data.oPos += 2;
							data.bPos += 2;
							break;
						case 1:
							data.iPos += 1;
							data.fPos += 1;
							break;
						case 2:
							data.oPos += 4;
							data.iiPos += 2;
							data.ffPos += 1;
							data.fPos += 1;
							break;
						case 3:
							data.oPos += 1;
							break;
						case 4:
							data.fPos += 6;
							break;
						case 5:
							data.fPos += 4;
							break;
						case 6:
							data.fPos += 3;
							break;
						case 7:
							data.fPos += 4;
							break;
						case 8:
							data.oPos += 3;
							break;
						case 9:
							data.fPos += 4;
							break;
						case 10:
							data.fPos += 5;
							data.oPos += 1;
							break;
						case 12:
							data.oPos += 4;
							break;
						case 13:
							break;
						case 14:
							data.oPos += 2;
							data.bPos += 2;
							break;
						case 15:
							data.oPos += 4;
							data.iiPos += 2;
							data.ffPos += 1;
							data.fPos += 1;
							break;
						case 16:
							data.oPos += 4;
							data.iPos += 1;
							data.fPos += 2;
							data.bPos += 1;
							break;
						case 17:
							data.fPos += 2;
							break;
						case 18:
							data.fPos += 2;
							break;
						case 19:
							data.oPos += 1;
							break;
						case 20:
							data.oPos += 1;
							break;
						case 21:case 22:
							break;
						default:
						}
						data.prev = openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL;
						var this2 = data;
						var c1 = this2;
						openfl_display__$internal_CanvasGraphics.fillCommands.beginGradientFill(c1.buffer.o[c1.oPos],c1.buffer.ii[c1.iiPos],c1.buffer.ff[c1.ffPos],c1.buffer.ii[c1.iiPos + 1],c1.buffer.o[c1.oPos + 1],c1.buffer.o[c1.oPos + 2],c1.buffer.o[c1.oPos + 3],c1.buffer.f[c1.fPos]);
						openfl_display__$internal_CanvasGraphics.strokeCommands.beginGradientFill(c1.buffer.o[c1.oPos],c1.buffer.ii[c1.iiPos],c1.buffer.ff[c1.ffPos],c1.buffer.ii[c1.iiPos + 1],c1.buffer.o[c1.oPos + 1],c1.buffer.o[c1.oPos + 2],c1.buffer.o[c1.oPos + 3],c1.buffer.f[c1.fPos]);
					} else if(type == openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL) {
						switch(data.prev._hx_index) {
						case 0:
							data.oPos += 2;
							data.bPos += 2;
							break;
						case 1:
							data.iPos += 1;
							data.fPos += 1;
							break;
						case 2:
							data.oPos += 4;
							data.iiPos += 2;
							data.ffPos += 1;
							data.fPos += 1;
							break;
						case 3:
							data.oPos += 1;
							break;
						case 4:
							data.fPos += 6;
							break;
						case 5:
							data.fPos += 4;
							break;
						case 6:
							data.fPos += 3;
							break;
						case 7:
							data.fPos += 4;
							break;
						case 8:
							data.oPos += 3;
							break;
						case 9:
							data.fPos += 4;
							break;
						case 10:
							data.fPos += 5;
							data.oPos += 1;
							break;
						case 12:
							data.oPos += 4;
							break;
						case 13:
							break;
						case 14:
							data.oPos += 2;
							data.bPos += 2;
							break;
						case 15:
							data.oPos += 4;
							data.iiPos += 2;
							data.ffPos += 1;
							data.fPos += 1;
							break;
						case 16:
							data.oPos += 4;
							data.iPos += 1;
							data.fPos += 2;
							data.bPos += 1;
							break;
						case 17:
							data.fPos += 2;
							break;
						case 18:
							data.fPos += 2;
							break;
						case 19:
							data.oPos += 1;
							break;
						case 20:
							data.oPos += 1;
							break;
						case 21:case 22:
							break;
						default:
						}
						data.prev = openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL;
						var this3 = data;
						var c2 = this3;
						openfl_display__$internal_CanvasGraphics.fillCommands.beginShaderFill(c2.buffer.o[c2.oPos]);
						openfl_display__$internal_CanvasGraphics.strokeCommands.beginShaderFill(c2.buffer.o[c2.oPos]);
					} else {
						switch(data.prev._hx_index) {
						case 0:
							data.oPos += 2;
							data.bPos += 2;
							break;
						case 1:
							data.iPos += 1;
							data.fPos += 1;
							break;
						case 2:
							data.oPos += 4;
							data.iiPos += 2;
							data.ffPos += 1;
							data.fPos += 1;
							break;
						case 3:
							data.oPos += 1;
							break;
						case 4:
							data.fPos += 6;
							break;
						case 5:
							data.fPos += 4;
							break;
						case 6:
							data.fPos += 3;
							break;
						case 7:
							data.fPos += 4;
							break;
						case 8:
							data.oPos += 3;
							break;
						case 9:
							data.fPos += 4;
							break;
						case 10:
							data.fPos += 5;
							data.oPos += 1;
							break;
						case 12:
							data.oPos += 4;
							break;
						case 13:
							break;
						case 14:
							data.oPos += 2;
							data.bPos += 2;
							break;
						case 15:
							data.oPos += 4;
							data.iiPos += 2;
							data.ffPos += 1;
							data.fPos += 1;
							break;
						case 16:
							data.oPos += 4;
							data.iPos += 1;
							data.fPos += 2;
							data.bPos += 1;
							break;
						case 17:
							data.fPos += 2;
							break;
						case 18:
							data.fPos += 2;
							break;
						case 19:
							data.oPos += 1;
							break;
						case 20:
							data.oPos += 1;
							break;
						case 21:case 22:
							break;
						default:
						}
						data.prev = openfl_display__$internal_DrawCommandType.BEGIN_FILL;
						var this4 = data;
						var c3 = this4;
						openfl_display__$internal_CanvasGraphics.fillCommands.beginFill(c3.buffer.i[c3.iPos],c3.buffer.f[c3.fPos]);
						openfl_display__$internal_CanvasGraphics.strokeCommands.beginFill(c3.buffer.i[c3.iPos],c3.buffer.f[c3.fPos]);
					}
					break;
				case 4:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO;
					var this5 = data;
					var c4 = this5;
					openfl_display__$internal_CanvasGraphics.fillCommands.cubicCurveTo(c4.buffer.f[c4.fPos],c4.buffer.f[c4.fPos + 1],c4.buffer.f[c4.fPos + 2],c4.buffer.f[c4.fPos + 3],c4.buffer.f[c4.fPos + 4],c4.buffer.f[c4.fPos + 5]);
					if(hasLineStyle) {
						openfl_display__$internal_CanvasGraphics.strokeCommands.cubicCurveTo(c4.buffer.f[c4.fPos],c4.buffer.f[c4.fPos + 1],c4.buffer.f[c4.fPos + 2],c4.buffer.f[c4.fPos + 3],c4.buffer.f[c4.fPos + 4],c4.buffer.f[c4.fPos + 5]);
					} else {
						initStrokeX = c4.buffer.f[c4.fPos + 4];
						initStrokeY = c4.buffer.f[c4.fPos + 5];
					}
					break;
				case 5:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.CURVE_TO;
					var this6 = data;
					var c5 = this6;
					openfl_display__$internal_CanvasGraphics.fillCommands.curveTo(c5.buffer.f[c5.fPos],c5.buffer.f[c5.fPos + 1],c5.buffer.f[c5.fPos + 2],c5.buffer.f[c5.fPos + 3]);
					if(hasLineStyle) {
						openfl_display__$internal_CanvasGraphics.strokeCommands.curveTo(c5.buffer.f[c5.fPos],c5.buffer.f[c5.fPos + 1],c5.buffer.f[c5.fPos + 2],c5.buffer.f[c5.fPos + 3]);
					} else {
						initStrokeX = c5.buffer.f[c5.fPos + 2];
						initStrokeY = c5.buffer.f[c5.fPos + 3];
					}
					break;
				case 6:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.DRAW_CIRCLE;
					var this7 = data;
					var c6 = this7;
					openfl_display__$internal_CanvasGraphics.fillCommands.drawCircle(c6.buffer.f[c6.fPos],c6.buffer.f[c6.fPos + 1],c6.buffer.f[c6.fPos + 2]);
					if(hasLineStyle) {
						openfl_display__$internal_CanvasGraphics.strokeCommands.drawCircle(c6.buffer.f[c6.fPos],c6.buffer.f[c6.fPos + 1],c6.buffer.f[c6.fPos + 2]);
					}
					break;
				case 7:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE;
					var this8 = data;
					var c7 = this8;
					openfl_display__$internal_CanvasGraphics.fillCommands.drawEllipse(c7.buffer.f[c7.fPos],c7.buffer.f[c7.fPos + 1],c7.buffer.f[c7.fPos + 2],c7.buffer.f[c7.fPos + 3]);
					if(hasLineStyle) {
						openfl_display__$internal_CanvasGraphics.strokeCommands.drawEllipse(c7.buffer.f[c7.fPos],c7.buffer.f[c7.fPos + 1],c7.buffer.f[c7.fPos + 2],c7.buffer.f[c7.fPos + 3]);
					}
					break;
				case 8:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.DRAW_QUADS;
					var this9 = data;
					var c8 = this9;
					openfl_display__$internal_CanvasGraphics.fillCommands.drawQuads(c8.buffer.o[c8.oPos],c8.buffer.o[c8.oPos + 1],c8.buffer.o[c8.oPos + 2]);
					break;
				case 9:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.DRAW_RECT;
					var this10 = data;
					var c9 = this10;
					openfl_display__$internal_CanvasGraphics.fillCommands.drawRect(c9.buffer.f[c9.fPos],c9.buffer.f[c9.fPos + 1],c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 3]);
					if(hasLineStyle) {
						openfl_display__$internal_CanvasGraphics.strokeCommands.drawRect(c9.buffer.f[c9.fPos],c9.buffer.f[c9.fPos + 1],c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 3]);
					}
					break;
				case 10:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT;
					var this11 = data;
					var c10 = this11;
					openfl_display__$internal_CanvasGraphics.fillCommands.drawRoundRect(c10.buffer.f[c10.fPos],c10.buffer.f[c10.fPos + 1],c10.buffer.f[c10.fPos + 2],c10.buffer.f[c10.fPos + 3],c10.buffer.f[c10.fPos + 4],c10.buffer.o[c10.oPos]);
					if(hasLineStyle) {
						openfl_display__$internal_CanvasGraphics.strokeCommands.drawRoundRect(c10.buffer.f[c10.fPos],c10.buffer.f[c10.fPos + 1],c10.buffer.f[c10.fPos + 2],c10.buffer.f[c10.fPos + 3],c10.buffer.f[c10.fPos + 4],c10.buffer.o[c10.oPos]);
					}
					break;
				case 12:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.DRAW_TRIANGLES;
					var this12 = data;
					var c11 = this12;
					openfl_display__$internal_CanvasGraphics.fillCommands.drawTriangles(c11.buffer.o[c11.oPos],c11.buffer.o[c11.oPos + 1],c11.buffer.o[c11.oPos + 2],c11.buffer.o[c11.oPos + 3]);
					break;
				case 13:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.END_FILL;
					var this13 = data;
					openfl_display__$internal_CanvasGraphics.endFill();
					openfl_display__$internal_CanvasGraphics.endStroke();
					openfl_display__$internal_CanvasGraphics.hasFill = false;
					hasLineStyle = false;
					openfl_display__$internal_CanvasGraphics.bitmapFill = null;
					initStrokeX = 0;
					initStrokeY = 0;
					break;
				case 14:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.LINE_BITMAP_STYLE;
					var this14 = data;
					var c12 = this14;
					if(!hasLineStyle && (initStrokeX != 0 || initStrokeY != 0)) {
						openfl_display__$internal_CanvasGraphics.strokeCommands.moveTo(initStrokeX,initStrokeY);
						initStrokeX = 0;
						initStrokeY = 0;
					}
					hasLineStyle = true;
					openfl_display__$internal_CanvasGraphics.strokeCommands.lineBitmapStyle(c12.buffer.o[c12.oPos],c12.buffer.o[c12.oPos + 1],c12.buffer.b[c12.bPos],c12.buffer.b[c12.bPos + 1]);
					break;
				case 15:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.LINE_GRADIENT_STYLE;
					var this15 = data;
					var c13 = this15;
					if(!hasLineStyle && (initStrokeX != 0 || initStrokeY != 0)) {
						openfl_display__$internal_CanvasGraphics.strokeCommands.moveTo(initStrokeX,initStrokeY);
						initStrokeX = 0;
						initStrokeY = 0;
					}
					hasLineStyle = true;
					openfl_display__$internal_CanvasGraphics.strokeCommands.lineGradientStyle(c13.buffer.o[c13.oPos],c13.buffer.ii[c13.iiPos],c13.buffer.ff[c13.ffPos],c13.buffer.ii[c13.iiPos + 1],c13.buffer.o[c13.oPos + 1],c13.buffer.o[c13.oPos + 2],c13.buffer.o[c13.oPos + 3],c13.buffer.f[c13.fPos]);
					break;
				case 16:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.LINE_STYLE;
					var this16 = data;
					var c14 = this16;
					if(!hasLineStyle && c14.buffer.o[c14.oPos] != null) {
						if(initStrokeX != 0 || initStrokeY != 0) {
							openfl_display__$internal_CanvasGraphics.strokeCommands.moveTo(initStrokeX,initStrokeY);
							initStrokeX = 0;
							initStrokeY = 0;
						}
					}
					hasLineStyle = c14.buffer.o[c14.oPos] != null;
					openfl_display__$internal_CanvasGraphics.strokeCommands.lineStyle(c14.buffer.o[c14.oPos],c14.buffer.i[c14.iPos],c14.buffer.f[c14.fPos],c14.buffer.b[c14.bPos],c14.buffer.o[c14.oPos + 1],c14.buffer.o[c14.oPos + 2],c14.buffer.o[c14.oPos + 3],c14.buffer.f[c14.fPos + 1]);
					break;
				case 17:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.LINE_TO;
					var this17 = data;
					var c15 = this17;
					openfl_display__$internal_CanvasGraphics.fillCommands.lineTo(c15.buffer.f[c15.fPos],c15.buffer.f[c15.fPos + 1]);
					if(hasLineStyle) {
						openfl_display__$internal_CanvasGraphics.strokeCommands.lineTo(c15.buffer.f[c15.fPos],c15.buffer.f[c15.fPos + 1]);
					} else {
						initStrokeX = c15.buffer.f[c15.fPos];
						initStrokeY = c15.buffer.f[c15.fPos + 1];
					}
					break;
				case 18:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.MOVE_TO;
					var this18 = data;
					var c16 = this18;
					openfl_display__$internal_CanvasGraphics.fillCommands.moveTo(c16.buffer.f[c16.fPos],c16.buffer.f[c16.fPos + 1]);
					if(hasLineStyle) {
						openfl_display__$internal_CanvasGraphics.strokeCommands.moveTo(c16.buffer.f[c16.fPos],c16.buffer.f[c16.fPos + 1]);
					} else {
						initStrokeX = c16.buffer.f[c16.fPos];
						initStrokeY = c16.buffer.f[c16.fPos + 1];
					}
					break;
				case 19:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.OVERRIDE_BLEND_MODE;
					var this19 = data;
					var c17 = this19;
					renderer.__setBlendModeContext(openfl_display__$internal_CanvasGraphics.context,c17.buffer.o[c17.oPos]);
					break;
				case 21:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.WINDING_EVEN_ODD;
					var this20 = data;
					openfl_display__$internal_CanvasGraphics.fillCommands.windingEvenOdd();
					openfl_display__$internal_CanvasGraphics.windingRule = "evenodd";
					break;
				case 22:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.WINDING_NON_ZERO;
					var this21 = data;
					openfl_display__$internal_CanvasGraphics.fillCommands.windingNonZero();
					openfl_display__$internal_CanvasGraphics.windingRule = "nonzero";
					break;
				default:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = type;
				}
			}
			if(openfl_display__$internal_CanvasGraphics.fillCommands.get_length() > 0) {
				openfl_display__$internal_CanvasGraphics.endFill();
			}
			if(openfl_display__$internal_CanvasGraphics.strokeCommands.get_length() > 0) {
				openfl_display__$internal_CanvasGraphics.endStroke();
			}
			data.destroy();
			graphics.__bitmap = openfl_display_BitmapData.fromCanvas(graphics.__canvas);
		}
		graphics.__softwareDirty = false;
		graphics.set___dirty(false);
	}
};
openfl_display__$internal_CanvasGraphics.renderMask = function(graphics,renderer) {
	if(graphics.__commands.get_length() != 0) {
		openfl_display__$internal_CanvasGraphics.context = renderer.context;
		var positionX = 0.0;
		var positionY = 0.0;
		var offsetX = 0;
		var offsetY = 0;
		var data = new openfl_display__$internal_DrawCommandReader(graphics.__commands);
		var x;
		var y;
		var width;
		var height;
		var kappa = .5522848;
		var ox;
		var oy;
		var xe;
		var ye;
		var xm;
		var ym;
		var _g = 0;
		var _g1 = graphics.__commands.types;
		while(_g < _g1.length) {
			var type = _g1[_g];
			++_g;
			switch(type._hx_index) {
			case 4:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO;
				var this1 = data;
				var c = this1;
				openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(c.buffer.f[c.fPos] - offsetX,c.buffer.f[c.fPos + 1] - offsetY,c.buffer.f[c.fPos + 2] - offsetX,c.buffer.f[c.fPos + 3] - offsetY,c.buffer.f[c.fPos + 4] - offsetX,c.buffer.f[c.fPos + 5] - offsetY);
				positionX = c.buffer.f[c.fPos + 4];
				positionY = c.buffer.f[c.fPos + 5];
				break;
			case 5:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.CURVE_TO;
				var this2 = data;
				var c1 = this2;
				openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(c1.buffer.f[c1.fPos] - offsetX,c1.buffer.f[c1.fPos + 1] - offsetY,c1.buffer.f[c1.fPos + 2] - offsetX,c1.buffer.f[c1.fPos + 3] - offsetY);
				positionX = c1.buffer.f[c1.fPos + 2];
				positionY = c1.buffer.f[c1.fPos + 3];
				break;
			case 6:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_CIRCLE;
				var this3 = data;
				var c2 = this3;
				openfl_display__$internal_CanvasGraphics.context.arc(c2.buffer.f[c2.fPos] - offsetX,c2.buffer.f[c2.fPos + 1] - offsetY,c2.buffer.f[c2.fPos + 2],0,Math.PI * 2,true);
				break;
			case 7:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE;
				var this4 = data;
				var c3 = this4;
				x = c3.buffer.f[c3.fPos];
				y = c3.buffer.f[c3.fPos + 1];
				width = c3.buffer.f[c3.fPos + 2];
				height = c3.buffer.f[c3.fPos + 3];
				x -= offsetX;
				y -= offsetY;
				ox = width / 2 * kappa;
				oy = height / 2 * kappa;
				xe = x + width;
				ye = y + height;
				xm = x + width / 2;
				ym = y + height / 2;
				openfl_display__$internal_CanvasGraphics.context.moveTo(x,ym);
				openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(x,ym - oy,xm - ox,y,xm,y);
				openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(xm + ox,y,xe,ym - oy,xe,ym);
				openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(xe,ym + oy,xm + ox,ye,xm,ye);
				openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(xm - ox,ye,x,ym + oy,x,ym);
				break;
			case 9:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_RECT;
				var this5 = data;
				var c4 = this5;
				openfl_display__$internal_CanvasGraphics.context.beginPath();
				openfl_display__$internal_CanvasGraphics.context.rect(c4.buffer.f[c4.fPos] - offsetX,c4.buffer.f[c4.fPos + 1] - offsetY,c4.buffer.f[c4.fPos + 2],c4.buffer.f[c4.fPos + 3]);
				openfl_display__$internal_CanvasGraphics.context.closePath();
				break;
			case 10:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT;
				var this6 = data;
				var c5 = this6;
				openfl_display__$internal_CanvasGraphics.drawRoundRect(c5.buffer.f[c5.fPos] - offsetX,c5.buffer.f[c5.fPos + 1] - offsetY,c5.buffer.f[c5.fPos + 2],c5.buffer.f[c5.fPos + 3],c5.buffer.f[c5.fPos + 4],c5.buffer.o[c5.oPos]);
				break;
			case 17:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_TO;
				var this7 = data;
				var c6 = this7;
				openfl_display__$internal_CanvasGraphics.context.lineTo(c6.buffer.f[c6.fPos] - offsetX,c6.buffer.f[c6.fPos + 1] - offsetY);
				positionX = c6.buffer.f[c6.fPos];
				positionY = c6.buffer.f[c6.fPos + 1];
				break;
			case 18:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.MOVE_TO;
				var this8 = data;
				var c7 = this8;
				openfl_display__$internal_CanvasGraphics.context.moveTo(c7.buffer.f[c7.fPos] - offsetX,c7.buffer.f[c7.fPos + 1] - offsetY);
				positionX = c7.buffer.f[c7.fPos];
				positionY = c7.buffer.f[c7.fPos + 1];
				break;
			default:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = type;
			}
		}
		data.destroy();
	}
};
openfl_display__$internal_CanvasGraphics.setSmoothing = function(smooth) {
	if(!openfl_display__$internal_CanvasGraphics.allowSmoothing) {
		smooth = false;
	}
	if(openfl_display__$internal_CanvasGraphics.context.imageSmoothingEnabled != smooth) {
		openfl_display__$internal_CanvasGraphics.context.imageSmoothingEnabled = smooth;
	}
};
var openfl_display__$internal_CanvasShape = function() { };
$hxClasses["openfl.display._internal.CanvasShape"] = openfl_display__$internal_CanvasShape;
openfl_display__$internal_CanvasShape.__name__ = "openfl.display._internal.CanvasShape";
openfl_display__$internal_CanvasShape.render = function(shape,renderer) {
	if(!shape.__renderable) {
		return;
	}
	var alpha = renderer.__getAlpha(shape.__worldAlpha);
	if(alpha <= 0) {
		return;
	}
	var graphics = shape.__graphics;
	if(graphics != null) {
		openfl_display__$internal_CanvasGraphics.render(graphics,renderer);
		var width = graphics.__width;
		var height = graphics.__height;
		var canvas = graphics.__canvas;
		if(canvas != null && graphics.__visible && width >= 1 && height >= 1) {
			var transform = graphics.__worldTransform;
			var context = renderer.context;
			var scrollRect = shape.__scrollRect;
			var scale9Grid = shape.__worldScale9Grid;
			if(scrollRect == null || scrollRect.width > 0 && scrollRect.height > 0) {
				renderer.__setBlendMode(shape.__worldBlendMode);
				renderer.__pushMaskObject(shape);
				context.globalAlpha = alpha;
				if(scale9Grid != null && transform.b == 0 && transform.c == 0) {
					context.setTransform(1,0,0,1,transform.tx,transform.ty);
					var bounds = graphics.__bounds;
					var scaleX = graphics.__renderTransform.a;
					var scaleY = graphics.__renderTransform.d;
					var renderScaleX = transform.a;
					var renderScaleY = transform.d;
					var left = Math.max(1,Math.round(scale9Grid.x * scaleX));
					var top = Math.round(scale9Grid.y * scaleY);
					var right = Math.max(1,Math.round((bounds.get_right() - scale9Grid.get_right()) * scaleX));
					var bottom = Math.round((bounds.get_bottom() - scale9Grid.get_bottom()) * scaleY);
					var centerWidth = Math.round(scale9Grid.width * scaleX);
					var centerHeight = Math.round(scale9Grid.height * scaleY);
					var renderLeft = Math.round(scale9Grid.x * renderScaleX);
					var renderTop = Math.round(scale9Grid.y * renderScaleY);
					var renderRight = Math.round((bounds.get_right() - scale9Grid.get_right()) * renderScaleX);
					var renderBottom = Math.round((bounds.get_bottom() - scale9Grid.get_bottom()) * renderScaleY);
					var renderCenterWidth = Math.round(width * renderScaleX) - renderLeft - renderRight;
					var renderCenterHeight = Math.round(height * renderScaleY) - renderTop - renderBottom;
					renderer.applySmoothing(context,false);
					if(centerWidth != 0 && centerHeight != 0) {
						context.drawImage(canvas,0,0,left,top,0,0,renderLeft,renderTop);
						context.drawImage(canvas,left,0,centerWidth,top,renderLeft,0,renderCenterWidth,renderTop);
						context.drawImage(canvas,left + centerWidth,0,right,top,renderLeft + renderCenterWidth,0,renderRight,renderTop);
						context.drawImage(canvas,0,top,left,centerHeight,0,renderTop,renderLeft,renderCenterHeight);
						context.drawImage(canvas,left,top,centerWidth,centerHeight,renderLeft,renderTop,renderCenterWidth,renderCenterHeight);
						context.drawImage(canvas,left + centerWidth,top,right,centerHeight,renderLeft + renderCenterWidth,renderTop,renderRight,renderCenterHeight);
						context.drawImage(canvas,0,top + centerHeight,left,bottom,0,renderTop + renderCenterHeight,renderLeft,renderBottom);
						context.drawImage(canvas,left,top + centerHeight,centerWidth,bottom,renderLeft,renderTop + renderCenterHeight,renderCenterWidth,renderBottom);
						context.drawImage(canvas,left + centerWidth,top + centerHeight,right,bottom,renderLeft + renderCenterWidth,renderTop + renderCenterHeight,renderRight,renderBottom);
					} else if(centerWidth == 0 && centerHeight != 0) {
						var renderWidth = renderLeft + renderCenterWidth + renderRight;
						context.drawImage(canvas,0,0,width,top,0,0,renderWidth,renderTop);
						context.drawImage(canvas,0,top,width,centerHeight,0,renderTop,renderWidth,renderCenterHeight);
						context.drawImage(canvas,0,top + centerHeight,width,bottom,0,renderTop + renderCenterHeight,renderWidth,renderBottom);
					} else if(centerHeight == 0 && centerWidth != 0) {
						var renderHeight = renderTop + renderCenterHeight + renderBottom;
						context.drawImage(canvas,0,0,left,height,0,0,renderLeft,renderHeight);
						context.drawImage(canvas,left,0,centerWidth,height,renderLeft,0,renderCenterWidth,renderHeight);
						context.drawImage(canvas,left + centerWidth,0,right,height,renderLeft + renderCenterWidth,0,renderRight,renderHeight);
					}
				} else {
					renderer.setTransform(transform,context);
					if(renderer.__isDOM) {
						var reverseScale = 1 / renderer.pixelRatio;
						context.scale(reverseScale,reverseScale);
					}
					context.drawImage(canvas,0,0,width,height);
				}
				renderer.__popMaskObject(shape);
			}
		}
	}
};
var openfl_display__$internal_CanvasTextField = function() { };
$hxClasses["openfl.display._internal.CanvasTextField"] = openfl_display__$internal_CanvasTextField;
openfl_display__$internal_CanvasTextField.__name__ = "openfl.display._internal.CanvasTextField";
openfl_display__$internal_CanvasTextField.context = null;
openfl_display__$internal_CanvasTextField.clearRect = null;
openfl_display__$internal_CanvasTextField.render = function(textField,renderer,transform) {
	var textEngine = textField.__textEngine;
	var bounds = textEngine.background || textEngine.border ? textEngine.bounds : textEngine.textBounds;
	var graphics = textField.__graphics;
	if(textField.__dirty) {
		textField.__updateLayout();
		if(graphics.__bounds == null) {
			graphics.__bounds = new openfl_geom_Rectangle();
		}
		graphics.__bounds.copyFrom(bounds);
	}
	graphics.__update(renderer.__worldTransform);
	if(textField.__dirty || graphics.__softwareDirty) {
		var width = graphics.__width;
		var height = graphics.__height;
		if((textEngine.text == null || textEngine.text == "") && !textEngine.background && !textEngine.border && !textEngine.__hasFocus && (textEngine.type != 1 || !textEngine.selectable) || (textEngine.width <= 0 || textEngine.height <= 0) && textEngine.autoSize != 2) {
			textField.__graphics.__canvas = null;
			textField.__graphics.__context = null;
			textField.__graphics.__bitmap = null;
			textField.__graphics.__softwareDirty = false;
			textField.__graphics.set___dirty(false);
			textField.__dirty = false;
		} else {
			if(textField.__graphics.__canvas == null) {
				textField.__graphics.__canvas = window.document.createElement("canvas");
				textField.__graphics.__context = textField.__graphics.__canvas.getContext("2d");
			}
			openfl_display__$internal_CanvasTextField.context = graphics.__context;
			var transform = graphics.__renderTransform;
			if(renderer.__isDOM) {
				var scale = renderer.pixelRatio;
				graphics.__canvas.width = width * scale | 0;
				graphics.__canvas.height = height * scale | 0;
				graphics.__canvas.style.width = width + "px";
				graphics.__canvas.style.height = height + "px";
				var matrix = openfl_geom_Matrix.__pool.get();
				matrix.copyFrom(transform);
				matrix.scale(scale,scale);
				renderer.setTransform(matrix,openfl_display__$internal_CanvasTextField.context);
				openfl_geom_Matrix.__pool.release(matrix);
			} else {
				graphics.__canvas.width = width;
				graphics.__canvas.height = height;
				openfl_display__$internal_CanvasTextField.context.setTransform(transform.a,transform.b,transform.c,transform.d,transform.tx,transform.ty);
			}
			if(openfl_display__$internal_CanvasTextField.clearRect == null) {
				openfl_display__$internal_CanvasTextField.clearRect = (typeof navigator !== 'undefined' && typeof navigator['isCocoonJS'] !== 'undefined');
			}
			if(openfl_display__$internal_CanvasTextField.clearRect) {
				openfl_display__$internal_CanvasTextField.context.clearRect(0,0,graphics.__canvas.width,graphics.__canvas.height);
			}
			if(textEngine.text != null && textEngine.text != "" || textEngine.__hasFocus) {
				var text = textEngine.text;
				if(!renderer.__allowSmoothing || textEngine.antiAliasType == 0 && textEngine.sharpness == 400) {
					graphics.__context.imageSmoothingEnabled = false;
				} else {
					graphics.__context.imageSmoothingEnabled = true;
				}
				if(textEngine.border || textEngine.background) {
					openfl_display__$internal_CanvasTextField.context.rect(0.5,0.5,bounds.width - 1,bounds.height - 1);
					if(textEngine.background) {
						var tmp = StringTools.hex(textEngine.backgroundColor & 16777215,6);
						openfl_display__$internal_CanvasTextField.context.fillStyle = "#" + tmp;
						openfl_display__$internal_CanvasTextField.context.fill();
					}
					if(textEngine.border) {
						openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
						var tmp = StringTools.hex(textEngine.borderColor & 16777215,6);
						openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
						openfl_display__$internal_CanvasTextField.context.stroke();
					}
				}
				openfl_display__$internal_CanvasTextField.context.textBaseline = "alphabetic";
				openfl_display__$internal_CanvasTextField.context.textAlign = "start";
				var scrollX = -textField.get_scrollH();
				var scrollY = 0.0;
				var _g = 0;
				var _g1 = textField.get_scrollV() - 1;
				while(_g < _g1) {
					var i = _g++;
					scrollY -= textEngine.lineHeights.get(i);
				}
				var advance;
				var group = textEngine.layoutGroups.iterator();
				while(group.hasNext()) {
					var group1 = group.next();
					if(group1.lineIndex < textField.get_scrollV() - 1) {
						continue;
					}
					if(group1.lineIndex > textEngine.get_bottomScrollV() - 1) {
						break;
					}
					var color = "#" + StringTools.hex(group1.format.color & 16777215,6);
					openfl_display__$internal_CanvasTextField.context.font = openfl_text__$internal_TextEngine.getFont(group1.format);
					openfl_display__$internal_CanvasTextField.context.fillStyle = color;
					openfl_display__$internal_CanvasTextField.context.fillText(text.substring(group1.startIndex,group1.endIndex),group1.offsetX + scrollX - bounds.x,group1.offsetY + group1.ascent + scrollY - bounds.y);
					if(textField.__caretIndex > -1 && textEngine.selectable) {
						if(textField.__selectionIndex == textField.__caretIndex) {
							if(textField.__showCursor && group1.startIndex <= textField.__caretIndex && group1.endIndex >= textField.__caretIndex) {
								advance = 0.0;
								var _g = 0;
								var _g1 = textField.__caretIndex - group1.startIndex;
								while(_g < _g1) {
									var i = _g++;
									if(group1.positions.length <= i) {
										break;
									}
									advance += group1.positions[i];
								}
								var scrollY1 = 0.0;
								var _g2 = textField.get_scrollV();
								var _g3 = group1.lineIndex + 1;
								while(_g2 < _g3) {
									var i1 = _g2++;
									scrollY1 += textEngine.lineHeights.get(i1 - 1);
								}
								openfl_display__$internal_CanvasTextField.context.beginPath();
								var tmp = StringTools.hex(group1.format.color & 16777215,6);
								openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
								openfl_display__$internal_CanvasTextField.context.moveTo(group1.offsetX + advance - textField.get_scrollH() - bounds.x,scrollY1 + 2 - bounds.y);
								openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
								openfl_display__$internal_CanvasTextField.context.lineTo(group1.offsetX + advance - textField.get_scrollH() - bounds.x,scrollY1 + openfl_text__$internal_TextEngine.getFormatHeight(textField.get_defaultTextFormat()) - 1 - bounds.y);
								openfl_display__$internal_CanvasTextField.context.stroke();
								openfl_display__$internal_CanvasTextField.context.closePath();
							}
						} else if(group1.startIndex <= textField.__caretIndex && group1.endIndex >= textField.__caretIndex || group1.startIndex <= textField.__selectionIndex && group1.endIndex >= textField.__selectionIndex || group1.startIndex > textField.__caretIndex && group1.endIndex < textField.__selectionIndex || group1.startIndex > textField.__selectionIndex && group1.endIndex < textField.__caretIndex) {
							var selectionStart = Math.min(textField.__selectionIndex,textField.__caretIndex) | 0;
							var selectionEnd = Math.max(textField.__selectionIndex,textField.__caretIndex) | 0;
							if(group1.startIndex > selectionStart) {
								selectionStart = group1.startIndex;
							}
							if(group1.endIndex < selectionEnd) {
								selectionEnd = group1.endIndex;
							}
							var end;
							var start = textField.getCharBoundaries(selectionStart);
							if(selectionEnd >= group1.endIndex) {
								end = textField.getCharBoundaries(group1.endIndex - 1);
								if(end != null) {
									end.x += end.width + 2;
								}
							} else {
								end = textField.getCharBoundaries(selectionEnd);
							}
							if(start != null && end != null) {
								openfl_display__$internal_CanvasTextField.context.fillStyle = "#000000";
								openfl_display__$internal_CanvasTextField.context.fillRect(start.x + scrollX,start.y + scrollY,end.x - start.x,group1.height);
								openfl_display__$internal_CanvasTextField.context.fillStyle = "#FFFFFF";
								openfl_display__$internal_CanvasTextField.context.fillText(text.substring(selectionStart,selectionEnd),scrollX + start.x,group1.offsetY + group1.ascent + scrollY);
							}
						}
					}
					if(group1.format.underline) {
						openfl_display__$internal_CanvasTextField.context.beginPath();
						openfl_display__$internal_CanvasTextField.context.strokeStyle = color;
						openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
						var x = group1.offsetX + scrollX - bounds.x;
						var y = Math.floor(group1.offsetY + scrollY + group1.ascent - bounds.y) + 0.5;
						openfl_display__$internal_CanvasTextField.context.moveTo(x,y);
						openfl_display__$internal_CanvasTextField.context.lineTo(x + group1.width,y);
						openfl_display__$internal_CanvasTextField.context.stroke();
						openfl_display__$internal_CanvasTextField.context.closePath();
					}
				}
			} else {
				if(textEngine.border || textEngine.background) {
					if(textEngine.border) {
						openfl_display__$internal_CanvasTextField.context.rect(0.5,0.5,bounds.width - 1,bounds.height - 1);
					} else {
						openfl_display__$internal_CanvasTextField.context.rect(0,0,bounds.width,bounds.height);
					}
					if(textEngine.background) {
						var tmp = StringTools.hex(textEngine.backgroundColor & 16777215,6);
						openfl_display__$internal_CanvasTextField.context.fillStyle = "#" + tmp;
						openfl_display__$internal_CanvasTextField.context.fill();
					}
					if(textEngine.border) {
						openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
						openfl_display__$internal_CanvasTextField.context.lineCap = "square";
						var tmp = StringTools.hex(textEngine.borderColor & 16777215,6);
						openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
						openfl_display__$internal_CanvasTextField.context.stroke();
					}
				}
				if(textField.__caretIndex > -1 && textEngine.selectable && textField.__showCursor) {
					var scrollX = -textField.get_scrollH();
					var scrollY = 0.0;
					var _g = 0;
					var _g1 = textField.get_scrollV() - 1;
					while(_g < _g1) {
						var i = _g++;
						scrollY += textEngine.lineHeights.get(i);
					}
					openfl_display__$internal_CanvasTextField.context.beginPath();
					var tmp = StringTools.hex(textField.get_defaultTextFormat().color & 16777215,6);
					openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
					openfl_display__$internal_CanvasTextField.context.moveTo(scrollX + 2.5,scrollY + 2.5);
					openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
					openfl_display__$internal_CanvasTextField.context.lineTo(scrollX + 2.5,scrollY + openfl_text__$internal_TextEngine.getFormatHeight(textField.get_defaultTextFormat()) - 1);
					openfl_display__$internal_CanvasTextField.context.stroke();
					openfl_display__$internal_CanvasTextField.context.closePath();
				}
			}
			graphics.__bitmap = openfl_display_BitmapData.fromCanvas(textField.__graphics.__canvas);
			graphics.__visible = true;
			textField.__dirty = false;
			graphics.__softwareDirty = false;
			graphics.set___dirty(false);
		}
	}
};
var openfl_display__$internal_Context3DBitmap = function() { };
$hxClasses["openfl.display._internal.Context3DBitmap"] = openfl_display__$internal_Context3DBitmap;
openfl_display__$internal_Context3DBitmap.__name__ = "openfl.display._internal.Context3DBitmap";
openfl_display__$internal_Context3DBitmap.render = function(bitmap,renderer) {
	if(!bitmap.__renderable || bitmap.__worldAlpha <= 0) {
		return;
	}
	if(bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid) {
		var context = renderer.__context3D;
		renderer.__setBlendMode(bitmap.__worldBlendMode);
		renderer.__pushMaskObject(bitmap);
		var shader = renderer.__initDisplayShader(bitmap.__worldShader);
		renderer.setShader(shader);
		renderer.applyBitmapData(bitmap.__bitmapData,renderer.__allowSmoothing && (bitmap.smoothing || renderer.__upscaled));
		renderer.applyMatrix(renderer.__getMatrix(bitmap.__renderTransform,bitmap.pixelSnapping));
		renderer.applyAlpha(bitmap.__worldAlpha);
		renderer.applyColorTransform(bitmap.__worldColorTransform);
		renderer.updateShader();
		var vertexBuffer = bitmap.__bitmapData.getVertexBuffer(context);
		if(shader.__position != null) {
			context.setVertexBufferAt(shader.__position.index,vertexBuffer,0,3);
		}
		if(shader.__textureCoord != null) {
			context.setVertexBufferAt(shader.__textureCoord.index,vertexBuffer,3,2);
		}
		var indexBuffer = bitmap.__bitmapData.getIndexBuffer(context);
		context.drawTriangles(indexBuffer);
		renderer.__clearShader();
		renderer.__popMaskObject(bitmap);
	}
};
openfl_display__$internal_Context3DBitmap.renderMask = function(bitmap,renderer) {
	if(bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid) {
		var context = renderer.__context3D;
		var shader = renderer.__maskShader;
		renderer.setShader(shader);
		renderer.applyBitmapData(openfl_display__$internal_Context3DMaskShader.opaqueBitmapData,true);
		renderer.applyMatrix(renderer.__getMatrix(bitmap.__renderTransform,bitmap.pixelSnapping));
		renderer.updateShader();
		var vertexBuffer = bitmap.__bitmapData.getVertexBuffer(context);
		if(shader.__position != null) {
			context.setVertexBufferAt(shader.__position.index,vertexBuffer,0,3);
		}
		if(shader.__textureCoord != null) {
			context.setVertexBufferAt(shader.__textureCoord.index,vertexBuffer,3,2);
		}
		var indexBuffer = bitmap.__bitmapData.getIndexBuffer(context);
		context.drawTriangles(indexBuffer);
		renderer.__clearShader();
	}
};
var openfl_display__$internal_Context3DBuffer = function(context3D,elementType,elementCount,dataPerVertex) {
	this.context3D = context3D;
	this.elementType = elementType;
	this.dataPerVertex = dataPerVertex;
	this.indexCount = 0;
	this.vertexCount = 0;
	this.resize(elementCount);
};
$hxClasses["openfl.display._internal.Context3DBuffer"] = openfl_display__$internal_Context3DBuffer;
openfl_display__$internal_Context3DBuffer.__name__ = "openfl.display._internal.Context3DBuffer";
openfl_display__$internal_Context3DBuffer.prototype = {
	dataPerVertex: null
	,elementCount: null
	,elementType: null
	,indexBufferData: null
	,indexBuffers: null
	,indexCount: null
	,vertexBuffer: null
	,vertexBufferData: null
	,vertexCount: null
	,context3D: null
	,drawElements: function(start,length) {
		if(length == null) {
			length = -1;
		}
		if(this.indexCount == 0 || this.vertexCount == 0) {
			return;
		}
		if(this.elementType._hx_index == 0) {
			if(length == -1) {
				length = this.elementCount * 2;
			}
			if(start < 10922 && length - start < 10922) {
				this.context3D.drawTriangles(this.indexBuffers[0],start,length * 2);
			} else {
				var end = start + length;
				while(start < end) {
					var arrayBufferIndex = Math.floor(start / 10922);
					length = Math.min(end - start,10922) | 0;
					if(length <= 0) {
						break;
					}
					this.context3D.drawTriangles(this.indexBuffers[arrayBufferIndex],(start - arrayBufferIndex * 10922) * 3,length * 2);
					start += length;
				}
			}
		}
	}
	,flushVertexBufferData: function() {
		if(this.vertexBufferData.length > this.vertexCount) {
			this.vertexCount = this.vertexBufferData.length;
			this.vertexBuffer = this.context3D.createVertexBuffer(this.vertexCount,this.dataPerVertex,0);
		}
		this.vertexBuffer.uploadFromTypedArray(lime_utils_Float32Array.toArrayBufferView(this.vertexBufferData));
	}
	,resize: function(elementCount,dataPerVertex) {
		if(dataPerVertex == null) {
			dataPerVertex = -1;
		}
		this.elementCount = elementCount;
		if(dataPerVertex == -1) {
			dataPerVertex = this.dataPerVertex;
		}
		if(dataPerVertex != this.dataPerVertex) {
			this.vertexBuffer = null;
			this.vertexCount = 0;
			this.dataPerVertex = dataPerVertex;
		}
		var numVertices = 0;
		switch(this.elementType._hx_index) {
		case 0:
			numVertices = elementCount * 4;
			break;
		case 1:
			numVertices = elementCount * 3;
			break;
		case 2:
			numVertices = elementCount * 3;
			break;
		}
		var vertexLength = numVertices * dataPerVertex;
		if(this.vertexBufferData == null) {
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1;
			if(vertexLength != null) {
				this1 = new Float32Array(vertexLength);
			} else if(array != null) {
				this1 = new Float32Array(array);
			} else if(vector != null) {
				this1 = new Float32Array(vector.__array);
			} else if(view != null) {
				this1 = new Float32Array(view);
			} else if(buffer != null) {
				if(len == null) {
					this1 = new Float32Array(buffer,0);
				} else {
					this1 = new Float32Array(buffer,0,len);
				}
			} else {
				this1 = null;
			}
			this.vertexBufferData = this1;
		} else if(vertexLength > this.vertexBufferData.length) {
			var cacheBufferData = this.vertexBufferData;
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1;
			if(vertexLength != null) {
				this1 = new Float32Array(vertexLength);
			} else if(array != null) {
				this1 = new Float32Array(array);
			} else if(vector != null) {
				this1 = new Float32Array(vector.__array);
			} else if(view != null) {
				this1 = new Float32Array(view);
			} else if(buffer != null) {
				if(len == null) {
					this1 = new Float32Array(buffer,0);
				} else {
					this1 = new Float32Array(buffer,0,len);
				}
			} else {
				this1 = null;
			}
			this.vertexBufferData = this1;
			this.vertexBufferData.set(cacheBufferData);
		}
	}
	,__class__: openfl_display__$internal_Context3DBuffer
};
var openfl_display__$internal_Context3DElementType = $hxEnums["openfl.display._internal.Context3DElementType"] = { __ename__ : "openfl.display._internal.Context3DElementType", __constructs__ : ["QUADS","TRIANGLES","TRIANGLE_INDICES"]
	,QUADS: {_hx_index:0,__enum__:"openfl.display._internal.Context3DElementType",toString:$estr}
	,TRIANGLES: {_hx_index:1,__enum__:"openfl.display._internal.Context3DElementType",toString:$estr}
	,TRIANGLE_INDICES: {_hx_index:2,__enum__:"openfl.display._internal.Context3DElementType",toString:$estr}
};
var openfl_display__$internal_Context3DDisplayObject = function() { };
$hxClasses["openfl.display._internal.Context3DDisplayObject"] = openfl_display__$internal_Context3DDisplayObject;
openfl_display__$internal_Context3DDisplayObject.__name__ = "openfl.display._internal.Context3DDisplayObject";
openfl_display__$internal_Context3DDisplayObject.render = function(displayObject,renderer) {
	if(displayObject.opaqueBackground == null && displayObject.__graphics == null) {
		return;
	}
	if(!displayObject.__renderable || displayObject.__worldAlpha <= 0) {
		return;
	}
	if(displayObject.opaqueBackground != null && !displayObject.__isCacheBitmapRender && displayObject.get_width() > 0 && displayObject.get_height() > 0) {
		renderer.__setBlendMode(displayObject.__worldBlendMode);
		renderer.__pushMaskObject(displayObject);
		var context = renderer.__context3D;
		var rect = openfl_geom_Rectangle.__pool.get();
		rect.setTo(0,0,displayObject.get_width(),displayObject.get_height());
		renderer.__pushMaskRect(rect,displayObject.__renderTransform);
		var color = displayObject.opaqueBackground;
		context.clear((color >>> 16 & 255) / 255,(color >>> 8 & 255) / 255,(color & 255) / 255,1,0,0,1);
		renderer.__popMaskRect();
		renderer.__popMaskObject(displayObject);
		openfl_geom_Rectangle.__pool.release(rect);
	}
	if(displayObject.__graphics != null) {
		openfl_display__$internal_Context3DShape.render(displayObject,renderer);
	}
};
openfl_display__$internal_Context3DDisplayObject.renderMask = function(displayObject,renderer) {
	if(displayObject.opaqueBackground == null && displayObject.__graphics == null) {
		return;
	}
	var tmp = displayObject.opaqueBackground != null && !displayObject.__isCacheBitmapRender && displayObject.get_width() > 0 && displayObject.get_height() > 0;
	if(displayObject.__graphics != null) {
		openfl_display__$internal_Context3DShape.renderMask(displayObject,renderer);
	}
};
var openfl_display__$internal_Context3DGraphics = function() { };
$hxClasses["openfl.display._internal.Context3DGraphics"] = openfl_display__$internal_Context3DGraphics;
openfl_display__$internal_Context3DGraphics.__name__ = "openfl.display._internal.Context3DGraphics";
openfl_display__$internal_Context3DGraphics.maskRender = null;
openfl_display__$internal_Context3DGraphics.buildBuffer = function(graphics,renderer) {
	var quadBufferPosition = 0;
	var triangleIndexBufferPosition = 0;
	var vertexBufferPosition = 0;
	var vertexBufferPositionUVT = 0;
	var data = new openfl_display__$internal_DrawCommandReader(graphics.__commands);
	var context = renderer.__context3D;
	var tileRect = openfl_geom_Rectangle.__pool.get();
	var tileTransform = openfl_geom_Matrix.__pool.get();
	var bitmap = null;
	var _g = 0;
	var _g1 = graphics.__commands.types;
	while(_g < _g1.length) {
		var type = _g1[_g];
		++_g;
		switch(type._hx_index) {
		case 0:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL;
			var this1 = data;
			var c = this1;
			bitmap = c.buffer.o[c.oPos];
			break;
		case 1:
			bitmap = null;
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = type;
			break;
		case 3:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL;
			var this2 = data;
			var c1 = this2;
			var shaderBuffer = c1.buffer.o[c1.oPos];
			bitmap = null;
			if(shaderBuffer != null) {
				var _g2 = 0;
				var _g3 = shaderBuffer.inputCount;
				while(_g2 < _g3) {
					var i = _g2++;
					if(shaderBuffer.inputRefs[i].name == "bitmap") {
						bitmap = shaderBuffer.inputs[i];
						break;
					}
				}
			}
			break;
		case 8:
			if(bitmap != null) {
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_QUADS;
				var this3 = data;
				var c2 = this3;
				var rects = c2.buffer.o[c2.oPos];
				var indices = c2.buffer.o[c2.oPos + 1];
				var transforms = c2.buffer.o[c2.oPos + 2];
				var hasIndices = indices != null;
				var transformABCD = false;
				var transformXY = false;
				var length = hasIndices ? indices.get_length() : Math.floor(rects.get_length() / 4);
				if(length == 0) {
					return;
				}
				if(transforms != null) {
					if(transforms.get_length() >= length * 6) {
						transformABCD = true;
						transformXY = true;
					} else if(transforms.get_length() >= length * 4) {
						transformABCD = true;
					} else if(transforms.get_length() >= length * 2) {
						transformXY = true;
					}
				}
				var dataPerVertex = 4;
				var stride = dataPerVertex * 4;
				if(graphics.__quadBuffer == null) {
					graphics.__quadBuffer = new openfl_display__$internal_Context3DBuffer(context,openfl_display__$internal_Context3DElementType.QUADS,length,dataPerVertex);
				} else {
					graphics.__quadBuffer.resize(quadBufferPosition + length,dataPerVertex);
				}
				var vertexOffset;
				var alpha = 1.0;
				var tileData;
				var id;
				var tileWidth;
				var tileHeight;
				var uvX;
				var uvY;
				var uvWidth;
				var uvHeight;
				var x;
				var y;
				var x2;
				var y2;
				var x3;
				var y3;
				var x4;
				var y4;
				var ri;
				var ti;
				var vertexBufferData = graphics.__quadBuffer.vertexBufferData;
				var bitmapWidth = bitmap.width;
				var bitmapHeight = bitmap.height;
				var sourceRect = bitmap.rect;
				var _g4 = 0;
				var _g5 = length;
				while(_g4 < _g5) {
					var i1 = _g4++;
					vertexOffset = (quadBufferPosition + i1) * stride;
					ri = hasIndices ? indices.get(i1) * 4 : i1 * 4;
					if(ri < 0) {
						continue;
					}
					tileRect.setTo(rects.get(ri),rects.get(ri + 1),rects.get(ri + 2),rects.get(ri + 3));
					tileWidth = tileRect.width;
					tileHeight = tileRect.height;
					if(tileWidth <= 0 || tileHeight <= 0) {
						continue;
					}
					if(transformABCD && transformXY) {
						ti = i1 * 6;
						tileTransform.setTo(transforms.get(ti),transforms.get(ti + 1),transforms.get(ti + 2),transforms.get(ti + 3),transforms.get(ti + 4),transforms.get(ti + 5));
					} else if(transformABCD) {
						ti = i1 * 4;
						tileTransform.setTo(transforms.get(ti),transforms.get(ti + 1),transforms.get(ti + 2),transforms.get(ti + 3),tileRect.x,tileRect.y);
					} else if(transformXY) {
						ti = i1 * 2;
						tileTransform.tx = transforms.get(ti);
						tileTransform.ty = transforms.get(ti + 1);
					} else {
						tileTransform.tx = tileRect.x;
						tileTransform.ty = tileRect.y;
					}
					uvX = tileRect.x / bitmapWidth;
					uvY = tileRect.y / bitmapHeight;
					uvWidth = tileRect.get_right() / bitmapWidth;
					uvHeight = tileRect.get_bottom() / bitmapHeight;
					x = 0 * tileTransform.a + 0 * tileTransform.c + tileTransform.tx;
					y = 0 * tileTransform.b + 0 * tileTransform.d + tileTransform.ty;
					x2 = tileWidth * tileTransform.a + 0 * tileTransform.c + tileTransform.tx;
					y2 = tileWidth * tileTransform.b + 0 * tileTransform.d + tileTransform.ty;
					x3 = 0 * tileTransform.a + tileHeight * tileTransform.c + tileTransform.tx;
					y3 = 0 * tileTransform.b + tileHeight * tileTransform.d + tileTransform.ty;
					x4 = tileWidth * tileTransform.a + tileHeight * tileTransform.c + tileTransform.tx;
					y4 = tileWidth * tileTransform.b + tileHeight * tileTransform.d + tileTransform.ty;
					vertexBufferData[vertexOffset] = x;
					vertexBufferData[vertexOffset + 1] = y;
					vertexBufferData[vertexOffset + 2] = uvX;
					vertexBufferData[vertexOffset + 3] = uvY;
					vertexBufferData[vertexOffset + dataPerVertex] = x2;
					vertexBufferData[vertexOffset + dataPerVertex + 1] = y2;
					vertexBufferData[vertexOffset + dataPerVertex + 2] = uvWidth;
					vertexBufferData[vertexOffset + dataPerVertex + 3] = uvY;
					vertexBufferData[vertexOffset + dataPerVertex * 2] = x3;
					vertexBufferData[vertexOffset + dataPerVertex * 2 + 1] = y3;
					vertexBufferData[vertexOffset + dataPerVertex * 2 + 2] = uvX;
					vertexBufferData[vertexOffset + dataPerVertex * 2 + 3] = uvHeight;
					vertexBufferData[vertexOffset + dataPerVertex * 3] = x4;
					vertexBufferData[vertexOffset + dataPerVertex * 3 + 1] = y4;
					vertexBufferData[vertexOffset + dataPerVertex * 3 + 2] = uvWidth;
					vertexBufferData[vertexOffset + dataPerVertex * 3 + 3] = uvHeight;
				}
				quadBufferPosition += length;
			}
			break;
		case 12:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.DRAW_TRIANGLES;
			var this4 = data;
			var c3 = this4;
			var vertices = c3.buffer.o[c3.oPos];
			var indices1 = c3.buffer.o[c3.oPos + 1];
			var uvtData = c3.buffer.o[c3.oPos + 2];
			var culling = c3.buffer.o[c3.oPos + 3];
			var hasIndices1 = indices1 != null;
			var numVertices = Math.floor(vertices.get_length() / 2);
			var length1 = hasIndices1 ? indices1.get_length() : numVertices;
			var hasUVData = uvtData != null;
			var hasUVTData = hasUVData && uvtData.get_length() >= numVertices * 3;
			var vertLength = hasUVTData ? 4 : 2;
			var uvStride = hasUVTData ? 3 : 2;
			var dataPerVertex1 = vertLength + 2;
			var vertexOffset1 = hasUVTData ? vertexBufferPositionUVT : vertexBufferPosition;
			openfl_display__$internal_Context3DGraphics.resizeVertexBuffer(graphics,hasUVTData,vertexOffset1 + length1 * dataPerVertex1);
			var vertexBufferData1 = hasUVTData ? graphics.__vertexBufferDataUVT : graphics.__vertexBufferData;
			var offset;
			var vertOffset;
			var uvOffset;
			var t;
			var _g6 = 0;
			var _g7 = length1;
			while(_g6 < _g7) {
				var i2 = _g6++;
				offset = vertexOffset1 + i2 * dataPerVertex1;
				vertOffset = hasIndices1 ? indices1.get(i2) * 2 : i2 * 2;
				uvOffset = hasIndices1 ? indices1.get(i2) * uvStride : i2 * uvStride;
				if(hasUVTData) {
					t = uvtData.get(uvOffset + 2);
					vertexBufferData1[offset] = vertices.get(vertOffset) / t;
					vertexBufferData1[offset + 1] = vertices.get(vertOffset + 1) / t;
					vertexBufferData1[offset + 2] = 0;
					vertexBufferData1[offset + 3] = 1 / t;
				} else {
					vertexBufferData1[offset] = vertices.get(vertOffset);
					vertexBufferData1[offset + 1] = vertices.get(vertOffset + 1);
				}
				vertexBufferData1[offset + vertLength] = hasUVData ? uvtData.get(uvOffset) : 0;
				vertexBufferData1[offset + vertLength + 1] = hasUVData ? uvtData.get(uvOffset + 1) : 0;
			}
			if(hasUVTData) {
				vertexBufferPositionUVT += length1 * dataPerVertex1;
			} else {
				vertexBufferPosition += length1 * dataPerVertex1;
			}
			break;
		case 13:
			bitmap = null;
			break;
		default:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = type;
		}
	}
	if(quadBufferPosition > 0) {
		graphics.__quadBuffer.flushVertexBufferData();
	}
	if(triangleIndexBufferPosition > 0) {
		var buffer = graphics.__triangleIndexBuffer;
		if(buffer == null || triangleIndexBufferPosition > graphics.__triangleIndexBufferCount) {
			buffer = context.createIndexBuffer(triangleIndexBufferPosition,0);
			graphics.__triangleIndexBuffer = buffer;
			graphics.__triangleIndexBufferCount = triangleIndexBufferPosition;
		}
		buffer.uploadFromTypedArray(graphics.__triangleIndexBufferData);
	}
	if(vertexBufferPosition > 0) {
		var buffer = graphics.__vertexBuffer;
		if(buffer == null || vertexBufferPosition > graphics.__vertexBufferCount) {
			buffer = context.createVertexBuffer(vertexBufferPosition,4,0);
			graphics.__vertexBuffer = buffer;
			graphics.__vertexBufferCount = vertexBufferPosition;
		}
		buffer.uploadFromTypedArray(lime_utils_Float32Array.toArrayBufferView(graphics.__vertexBufferData));
	}
	if(vertexBufferPositionUVT > 0) {
		var buffer = graphics.__vertexBufferUVT;
		if(buffer == null || vertexBufferPositionUVT > graphics.__vertexBufferCountUVT) {
			buffer = context.createVertexBuffer(vertexBufferPositionUVT,6,0);
			graphics.__vertexBufferUVT = buffer;
			graphics.__vertexBufferCountUVT = vertexBufferPositionUVT;
		}
		buffer.uploadFromTypedArray(lime_utils_Float32Array.toArrayBufferView(graphics.__vertexBufferDataUVT));
	}
	openfl_geom_Rectangle.__pool.release(tileRect);
	openfl_geom_Matrix.__pool.release(tileTransform);
};
openfl_display__$internal_Context3DGraphics.isCompatible = function(graphics) {
	if(graphics.__owner.__worldScale9Grid != null) {
		return false;
	}
	var data = new openfl_display__$internal_DrawCommandReader(graphics.__commands);
	var hasColorFill = false;
	var hasBitmapFill = false;
	var hasShaderFill = false;
	var _g = 0;
	var _g1 = graphics.__commands.types;
	while(_g < _g1.length) {
		var type = _g1[_g];
		++_g;
		switch(type._hx_index) {
		case 0:
			hasBitmapFill = true;
			hasColorFill = false;
			hasShaderFill = false;
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = type;
			break;
		case 1:
			hasBitmapFill = false;
			hasColorFill = true;
			hasShaderFill = false;
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = type;
			break;
		case 3:
			hasBitmapFill = false;
			hasColorFill = false;
			hasShaderFill = true;
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = type;
			break;
		case 8:
			if(hasBitmapFill || hasShaderFill) {
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = type;
			} else {
				data.destroy();
				return false;
			}
			break;
		case 9:
			if(hasColorFill) {
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = type;
			} else {
				data.destroy();
				return false;
			}
			break;
		case 12:
			if(hasBitmapFill || hasShaderFill) {
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = type;
			} else {
				data.destroy();
				return false;
			}
			break;
		case 13:
			hasBitmapFill = false;
			hasColorFill = false;
			hasShaderFill = false;
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = type;
			break;
		case 18:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = type;
			break;
		case 19:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = type;
			break;
		default:
			data.destroy();
			return false;
		}
	}
	data.destroy();
	return true;
};
openfl_display__$internal_Context3DGraphics.render = function(graphics,renderer) {
	if(!graphics.__visible || graphics.__commands.get_length() == 0) {
		return;
	}
	if(graphics.__bitmap != null && !graphics.__dirty || !openfl_display__$internal_Context3DGraphics.isCompatible(graphics)) {
		var cacheTransform = renderer.__softwareRenderer.__worldTransform;
		renderer.__softwareRenderer.__worldTransform = renderer.__worldTransform;
		openfl_display__$internal_CanvasGraphics.render(graphics,renderer.__softwareRenderer);
		renderer.__softwareRenderer.__worldTransform = cacheTransform;
	} else {
		graphics.__bitmap = null;
		graphics.__update(renderer.__worldTransform);
		var bounds = graphics.__bounds;
		var width = graphics.__width;
		var height = graphics.__height;
		if(bounds != null && width >= 1 && height >= 1) {
			if(graphics.__hardwareDirty || graphics.__quadBuffer == null && graphics.__vertexBuffer == null && graphics.__vertexBufferUVT == null) {
				openfl_display__$internal_Context3DGraphics.buildBuffer(graphics,renderer);
			}
			var data = new openfl_display__$internal_DrawCommandReader(graphics.__commands);
			var context = renderer.__context3D;
			var gl = context.gl;
			var matrix = openfl_geom_Matrix.__pool.get();
			var shaderBuffer = null;
			var bitmap = null;
			var repeat = false;
			var smooth = false;
			var fill = null;
			var positionX = 0.0;
			var positionY = 0.0;
			var quadBufferPosition = 0;
			var shaderBufferOffset = 0;
			var triangleIndexBufferPosition = 0;
			var vertexBufferPosition = 0;
			var vertexBufferPositionUVT = 0;
			var _g = 0;
			var _g1 = graphics.__commands.types;
			while(_g < _g1.length) {
				var type = _g1[_g];
				++_g;
				switch(type._hx_index) {
				case 0:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL;
					var this1 = data;
					var c = this1;
					bitmap = c.buffer.o[c.oPos];
					repeat = c.buffer.b[c.bPos];
					smooth = c.buffer.b[c.bPos + 1];
					shaderBuffer = null;
					fill = null;
					break;
				case 1:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.BEGIN_FILL;
					var this2 = data;
					var c1 = this2;
					var color = c1.buffer.i[c1.iPos] | 0;
					var alpha = c1.buffer.f[c1.fPos] * 255 | 0;
					fill = color & 16777215 | alpha << 24;
					shaderBuffer = null;
					bitmap = null;
					break;
				case 3:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL;
					var this3 = data;
					var c2 = this3;
					shaderBuffer = c2.buffer.o[c2.oPos];
					shaderBufferOffset = 0;
					if(shaderBuffer == null || shaderBuffer.shader == null || shaderBuffer.shader.__bitmap == null) {
						bitmap = null;
					} else {
						bitmap = shaderBuffer.shader.__bitmap.input;
					}
					fill = null;
					break;
				case 8:
					if(bitmap != null) {
						switch(data.prev._hx_index) {
						case 0:
							data.oPos += 2;
							data.bPos += 2;
							break;
						case 1:
							data.iPos += 1;
							data.fPos += 1;
							break;
						case 2:
							data.oPos += 4;
							data.iiPos += 2;
							data.ffPos += 1;
							data.fPos += 1;
							break;
						case 3:
							data.oPos += 1;
							break;
						case 4:
							data.fPos += 6;
							break;
						case 5:
							data.fPos += 4;
							break;
						case 6:
							data.fPos += 3;
							break;
						case 7:
							data.fPos += 4;
							break;
						case 8:
							data.oPos += 3;
							break;
						case 9:
							data.fPos += 4;
							break;
						case 10:
							data.fPos += 5;
							data.oPos += 1;
							break;
						case 12:
							data.oPos += 4;
							break;
						case 13:
							break;
						case 14:
							data.oPos += 2;
							data.bPos += 2;
							break;
						case 15:
							data.oPos += 4;
							data.iiPos += 2;
							data.ffPos += 1;
							data.fPos += 1;
							break;
						case 16:
							data.oPos += 4;
							data.iPos += 1;
							data.fPos += 2;
							data.bPos += 1;
							break;
						case 17:
							data.fPos += 2;
							break;
						case 18:
							data.fPos += 2;
							break;
						case 19:
							data.oPos += 1;
							break;
						case 20:
							data.oPos += 1;
							break;
						case 21:case 22:
							break;
						default:
						}
						data.prev = openfl_display__$internal_DrawCommandType.DRAW_QUADS;
						var this4 = data;
						var c3 = this4;
						var rects = c3.buffer.o[c3.oPos];
						var indices = c3.buffer.o[c3.oPos + 1];
						var transforms = c3.buffer.o[c3.oPos + 2];
						var hasIndices = indices != null;
						var length = hasIndices ? indices.get_length() : Math.floor(rects.get_length() / 4);
						var uMatrix = renderer.__getMatrix(graphics.__owner.__renderTransform,1);
						var shader;
						if(shaderBuffer != null && !openfl_display__$internal_Context3DGraphics.maskRender) {
							shader = renderer.__initShaderBuffer(shaderBuffer);
							renderer.__setShaderBuffer(shaderBuffer);
							renderer.applyMatrix(uMatrix);
							renderer.applyBitmapData(bitmap,false,repeat);
							renderer.applyAlpha(graphics.__owner.__worldAlpha);
							renderer.applyColorTransform(graphics.__owner.__worldColorTransform);
						} else {
							shader = openfl_display__$internal_Context3DGraphics.maskRender ? renderer.__maskShader : renderer.__initGraphicsShader(null);
							renderer.setShader(shader);
							renderer.applyMatrix(uMatrix);
							renderer.applyBitmapData(bitmap,smooth,repeat);
							renderer.applyAlpha(graphics.__owner.__worldAlpha);
							renderer.applyColorTransform(graphics.__owner.__worldColorTransform);
							renderer.updateShader();
						}
						var end = quadBufferPosition + length;
						while(quadBufferPosition < end) {
							length = Math.min(end - quadBufferPosition,context.__quadIndexBufferElements) | 0;
							if(length <= 0) {
								break;
							}
							if(shaderBuffer != null && !openfl_display__$internal_Context3DGraphics.maskRender) {
								renderer.__updateShaderBuffer(shaderBufferOffset);
							}
							if(shader.__position != null) {
								context.setVertexBufferAt(shader.__position.index,graphics.__quadBuffer.vertexBuffer,quadBufferPosition * 16,2);
							}
							if(shader.__textureCoord != null) {
								context.setVertexBufferAt(shader.__textureCoord.index,graphics.__quadBuffer.vertexBuffer,quadBufferPosition * 16 + 2,2);
							}
							context.drawTriangles(context.__quadIndexBuffer,0,length * 2);
							shaderBufferOffset += length * 4;
							quadBufferPosition += length;
						}
						renderer.__clearShader();
					}
					break;
				case 9:
					if(fill != null) {
						switch(data.prev._hx_index) {
						case 0:
							data.oPos += 2;
							data.bPos += 2;
							break;
						case 1:
							data.iPos += 1;
							data.fPos += 1;
							break;
						case 2:
							data.oPos += 4;
							data.iiPos += 2;
							data.ffPos += 1;
							data.fPos += 1;
							break;
						case 3:
							data.oPos += 1;
							break;
						case 4:
							data.fPos += 6;
							break;
						case 5:
							data.fPos += 4;
							break;
						case 6:
							data.fPos += 3;
							break;
						case 7:
							data.fPos += 4;
							break;
						case 8:
							data.oPos += 3;
							break;
						case 9:
							data.fPos += 4;
							break;
						case 10:
							data.fPos += 5;
							data.oPos += 1;
							break;
						case 12:
							data.oPos += 4;
							break;
						case 13:
							break;
						case 14:
							data.oPos += 2;
							data.bPos += 2;
							break;
						case 15:
							data.oPos += 4;
							data.iiPos += 2;
							data.ffPos += 1;
							data.fPos += 1;
							break;
						case 16:
							data.oPos += 4;
							data.iPos += 1;
							data.fPos += 2;
							data.bPos += 1;
							break;
						case 17:
							data.fPos += 2;
							break;
						case 18:
							data.fPos += 2;
							break;
						case 19:
							data.oPos += 1;
							break;
						case 20:
							data.oPos += 1;
							break;
						case 21:case 22:
							break;
						default:
						}
						data.prev = openfl_display__$internal_DrawCommandType.DRAW_RECT;
						var this5 = data;
						var c4 = this5;
						var x = c4.buffer.f[c4.fPos];
						var y = c4.buffer.f[c4.fPos + 1];
						var width = c4.buffer.f[c4.fPos + 2];
						var height = c4.buffer.f[c4.fPos + 3];
						var color1 = fill;
						openfl_display__$internal_Context3DGraphics.tempColorTransform.redOffset = color1 >>> 16 & 255;
						openfl_display__$internal_Context3DGraphics.tempColorTransform.greenOffset = color1 >>> 8 & 255;
						openfl_display__$internal_Context3DGraphics.tempColorTransform.blueOffset = color1 & 255;
						openfl_display__$internal_Context3DGraphics.tempColorTransform.__combine(graphics.__owner.__worldColorTransform);
						matrix.identity();
						matrix.scale(width,height);
						matrix.tx = x;
						matrix.ty = y;
						matrix.concat(graphics.__owner.__renderTransform);
						var shader1 = openfl_display__$internal_Context3DGraphics.maskRender ? renderer.__maskShader : renderer.__initGraphicsShader(null);
						renderer.setShader(shader1);
						renderer.applyMatrix(renderer.__getMatrix(matrix,1));
						renderer.applyBitmapData(openfl_display__$internal_Context3DGraphics.blankBitmapData,true,repeat);
						renderer.applyAlpha((color1 >>> 24 & 255) / 255 * graphics.__owner.__worldAlpha);
						renderer.applyColorTransform(openfl_display__$internal_Context3DGraphics.tempColorTransform);
						renderer.updateShader();
						var vertexBuffer = openfl_display__$internal_Context3DGraphics.blankBitmapData.getVertexBuffer(context);
						if(shader1.__position != null) {
							context.setVertexBufferAt(shader1.__position.index,vertexBuffer,0,3);
						}
						if(shader1.__textureCoord != null) {
							context.setVertexBufferAt(shader1.__textureCoord.index,vertexBuffer,3,2);
						}
						var indexBuffer = openfl_display__$internal_Context3DGraphics.blankBitmapData.getIndexBuffer(context);
						context.drawTriangles(indexBuffer);
						shaderBufferOffset += 4;
						renderer.__clearShader();
					}
					break;
				case 12:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.DRAW_TRIANGLES;
					var this6 = data;
					var c5 = this6;
					var vertices = c5.buffer.o[c5.oPos];
					var indices1 = c5.buffer.o[c5.oPos + 1];
					var uvtData = c5.buffer.o[c5.oPos + 2];
					var culling = c5.buffer.o[c5.oPos + 3];
					var hasIndices1 = indices1 != null;
					var numVertices = Math.floor(vertices.get_length() / 2);
					var length1 = hasIndices1 ? indices1.get_length() : numVertices;
					var hasUVData = uvtData != null;
					var hasUVTData = hasUVData && uvtData.get_length() >= numVertices * 3;
					var vertLength = hasUVTData ? 4 : 2;
					var uvStride = hasUVTData ? 3 : 2;
					var dataPerVertex = vertLength + 2;
					var vertexBuffer1 = hasUVTData ? graphics.__vertexBufferUVT : graphics.__vertexBuffer;
					var bufferPosition = hasUVTData ? vertexBufferPositionUVT : vertexBufferPosition;
					var uMatrix1 = renderer.__getMatrix(graphics.__owner.__renderTransform,1);
					var shader2;
					if(shaderBuffer != null && !openfl_display__$internal_Context3DGraphics.maskRender) {
						shader2 = renderer.__initShaderBuffer(shaderBuffer);
						renderer.__setShaderBuffer(shaderBuffer);
						renderer.applyMatrix(uMatrix1);
						renderer.applyBitmapData(bitmap,false,repeat);
						renderer.applyAlpha(1);
						renderer.applyColorTransform(null);
						renderer.__updateShaderBuffer(shaderBufferOffset);
					} else {
						shader2 = openfl_display__$internal_Context3DGraphics.maskRender ? renderer.__maskShader : renderer.__initGraphicsShader(null);
						renderer.setShader(shader2);
						renderer.applyMatrix(uMatrix1);
						renderer.applyBitmapData(bitmap,smooth,repeat);
						renderer.applyAlpha(graphics.__owner.__worldAlpha);
						renderer.applyColorTransform(graphics.__owner.__worldColorTransform);
						renderer.updateShader();
					}
					if(shader2.__position != null) {
						context.setVertexBufferAt(shader2.__position.index,vertexBuffer1,bufferPosition,hasUVTData ? 4 : 2);
					}
					if(shader2.__textureCoord != null) {
						context.setVertexBufferAt(shader2.__textureCoord.index,vertexBuffer1,bufferPosition + vertLength,2);
					}
					switch(culling) {
					case 0:
						context.setCulling(0);
						break;
					case 1:
						context.setCulling(3);
						break;
					case 2:
						context.setCulling(1);
						break;
					default:
					}
					context.__drawTriangles(0,length1);
					shaderBufferOffset += length1;
					if(hasUVTData) {
						vertexBufferPositionUVT += dataPerVertex * length1;
					} else {
						vertexBufferPosition += dataPerVertex * length1;
					}
					switch(culling) {
					case 1:case 2:
						context.setCulling(0);
						break;
					default:
					}
					renderer.__clearShader();
					break;
				case 13:
					bitmap = null;
					fill = null;
					shaderBuffer = null;
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = type;
					break;
				case 18:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.MOVE_TO;
					var this7 = data;
					var c6 = this7;
					positionX = c6.buffer.f[c6.fPos];
					positionY = c6.buffer.f[c6.fPos + 1];
					break;
				case 19:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.OVERRIDE_BLEND_MODE;
					var this8 = data;
					var c7 = this8;
					renderer.__setBlendMode(c7.buffer.o[c7.oPos]);
					break;
				default:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = type;
				}
			}
			openfl_geom_Matrix.__pool.release(matrix);
		}
		graphics.__hardwareDirty = false;
		graphics.set___dirty(false);
	}
};
openfl_display__$internal_Context3DGraphics.renderMask = function(graphics,renderer) {
	openfl_display__$internal_Context3DGraphics.maskRender = true;
	openfl_display__$internal_Context3DGraphics.render(graphics,renderer);
	openfl_display__$internal_Context3DGraphics.maskRender = false;
};
openfl_display__$internal_Context3DGraphics.resizeIndexBuffer = function(graphics,isQuad,length) {
	if(isQuad) {
		return;
	}
	var buffer = isQuad ? null : graphics.__triangleIndexBufferData;
	var position = 0;
	var newBuffer = null;
	if(buffer == null) {
		var array = null;
		var vector = null;
		var view = null;
		var buffer1 = null;
		var len = null;
		var this1;
		if(length != null) {
			this1 = new Uint16Array(length);
		} else if(array != null) {
			this1 = new Uint16Array(array);
		} else if(vector != null) {
			this1 = new Uint16Array(vector.__array);
		} else if(view != null) {
			this1 = new Uint16Array(view);
		} else if(buffer1 != null) {
			if(len == null) {
				this1 = new Uint16Array(buffer1,0);
			} else {
				this1 = new Uint16Array(buffer1,0,len);
			}
		} else {
			this1 = null;
		}
		newBuffer = this1;
	} else if(length > buffer.length) {
		var array = null;
		var vector = null;
		var view = null;
		var buffer1 = null;
		var len = null;
		var this1;
		if(length != null) {
			this1 = new Uint16Array(length);
		} else if(array != null) {
			this1 = new Uint16Array(array);
		} else if(vector != null) {
			this1 = new Uint16Array(vector.__array);
		} else if(view != null) {
			this1 = new Uint16Array(view);
		} else if(buffer1 != null) {
			if(len == null) {
				this1 = new Uint16Array(buffer1,0);
			} else {
				this1 = new Uint16Array(buffer1,0,len);
			}
		} else {
			this1 = null;
		}
		newBuffer = this1;
		newBuffer.set(buffer);
		position = buffer.length;
	}
	if(newBuffer != null) {
		if(!isQuad) {
			graphics.__triangleIndexBufferData = newBuffer;
		}
	}
};
openfl_display__$internal_Context3DGraphics.resizeVertexBuffer = function(graphics,hasUVTData,length) {
	var buffer = hasUVTData ? graphics.__vertexBufferDataUVT : graphics.__vertexBufferData;
	var newBuffer = null;
	if(buffer == null) {
		var array = null;
		var vector = null;
		var view = null;
		var buffer1 = null;
		var len = null;
		var this1;
		if(length != null) {
			this1 = new Float32Array(length);
		} else if(array != null) {
			this1 = new Float32Array(array);
		} else if(vector != null) {
			this1 = new Float32Array(vector.__array);
		} else if(view != null) {
			this1 = new Float32Array(view);
		} else if(buffer1 != null) {
			if(len == null) {
				this1 = new Float32Array(buffer1,0);
			} else {
				this1 = new Float32Array(buffer1,0,len);
			}
		} else {
			this1 = null;
		}
		newBuffer = this1;
	} else if(length > buffer.length) {
		var array = null;
		var vector = null;
		var view = null;
		var buffer1 = null;
		var len = null;
		var this1;
		if(length != null) {
			this1 = new Float32Array(length);
		} else if(array != null) {
			this1 = new Float32Array(array);
		} else if(vector != null) {
			this1 = new Float32Array(vector.__array);
		} else if(view != null) {
			this1 = new Float32Array(view);
		} else if(buffer1 != null) {
			if(len == null) {
				this1 = new Float32Array(buffer1,0);
			} else {
				this1 = new Float32Array(buffer1,0,len);
			}
		} else {
			this1 = null;
		}
		newBuffer = this1;
		newBuffer.set(buffer);
	}
	if(newBuffer != null) {
		if(hasUVTData) {
			graphics.__vertexBufferDataUVT = newBuffer;
		} else {
			graphics.__vertexBufferData = newBuffer;
		}
	}
};
var openfl_display__$internal_Context3DMaskShader = function() {
	if(this.__glFragmentSource == null) {
		this.__glFragmentSource = "varying vec2 openfl_TextureCoordv;\n\n\t\tuniform sampler2D openfl_Texture;\n\n\t\tvoid main(void) {\n\n\t\t\tvec4 color = texture2D (openfl_Texture, openfl_TextureCoordv);\n\n\t\t\tif (color.a == 0.0) {\n\n\t\t\t\tdiscard;\n\n\t\t\t} else {\n\n\t\t\t\tgl_FragColor = color;\n\n\t\t\t}\n\n\t\t}";
	}
	if(this.__glVertexSource == null) {
		this.__glVertexSource = "attribute vec4 openfl_Position;\n\t\tattribute vec2 openfl_TextureCoord;\n\t\tvarying vec2 openfl_TextureCoordv;\n\n\t\tuniform mat4 openfl_Matrix;\n\n\t\tvoid main(void) {\n\n\t\t\topenfl_TextureCoordv = openfl_TextureCoord;\n\n\t\t\tgl_Position = openfl_Matrix * openfl_Position;\n\n\t\t}";
	}
	openfl_display_Shader.call(this);
	this.__isGenerated = true;
	this.__initGL();
};
$hxClasses["openfl.display._internal.Context3DMaskShader"] = openfl_display__$internal_Context3DMaskShader;
openfl_display__$internal_Context3DMaskShader.__name__ = "openfl.display._internal.Context3DMaskShader";
openfl_display__$internal_Context3DMaskShader.__super__ = openfl_display_Shader;
openfl_display__$internal_Context3DMaskShader.prototype = $extend(openfl_display_Shader.prototype,{
	openfl_Position: null
	,openfl_TextureCoord: null
	,openfl_Matrix: null
	,openfl_Texture: null
	,__class__: openfl_display__$internal_Context3DMaskShader
});
var openfl_display__$internal_Context3DShape = function() { };
$hxClasses["openfl.display._internal.Context3DShape"] = openfl_display__$internal_Context3DShape;
openfl_display__$internal_Context3DShape.__name__ = "openfl.display._internal.Context3DShape";
openfl_display__$internal_Context3DShape.render = function(shape,renderer) {
	if(!shape.__renderable || shape.__worldAlpha <= 0) {
		return;
	}
	var graphics = shape.__graphics;
	if(graphics != null) {
		renderer.__setBlendMode(shape.__worldBlendMode);
		renderer.__pushMaskObject(shape);
		openfl_display__$internal_Context3DGraphics.render(graphics,renderer);
		if(graphics.__bitmap != null && graphics.__visible) {
			var context = renderer.__context3D;
			var scale9Grid = shape.__worldScale9Grid;
			var shader = renderer.__initDisplayShader(shape.__worldShader);
			renderer.setShader(shader);
			renderer.applyBitmapData(graphics.__bitmap,true);
			renderer.applyMatrix(renderer.__getMatrix(graphics.__worldTransform,1));
			renderer.applyAlpha(shape.__worldAlpha);
			renderer.applyColorTransform(shape.__worldColorTransform);
			renderer.updateShader();
			var vertexBuffer = graphics.__bitmap.getVertexBuffer(context);
			if(shader.__position != null) {
				context.setVertexBufferAt(shader.__position.index,vertexBuffer,0,3);
			}
			if(shader.__textureCoord != null) {
				context.setVertexBufferAt(shader.__textureCoord.index,vertexBuffer,3,2);
			}
			var indexBuffer = graphics.__bitmap.getIndexBuffer(context);
			context.drawTriangles(indexBuffer);
			renderer.__clearShader();
		}
		renderer.__popMaskObject(shape);
	}
};
openfl_display__$internal_Context3DShape.renderMask = function(shape,renderer) {
	var graphics = shape.__graphics;
	if(graphics != null) {
		openfl_display__$internal_Context3DGraphics.renderMask(graphics,renderer);
		if(graphics.__bitmap != null) {
			var context = renderer.__context3D;
			var shader = renderer.__maskShader;
			renderer.setShader(shader);
			renderer.applyBitmapData(graphics.__bitmap,true);
			renderer.applyMatrix(renderer.__getMatrix(graphics.__worldTransform,1));
			renderer.updateShader();
			var vertexBuffer = graphics.__bitmap.getVertexBuffer(context);
			if(shader.__position != null) {
				context.setVertexBufferAt(shader.__position.index,vertexBuffer,0,3);
			}
			if(shader.__textureCoord != null) {
				context.setVertexBufferAt(shader.__textureCoord.index,vertexBuffer,3,2);
			}
			var indexBuffer = graphics.__bitmap.getIndexBuffer(context);
			context.drawTriangles(indexBuffer);
			renderer.__clearShader();
		}
	}
};
var openfl_display__$internal_Context3DTextField = function() { };
$hxClasses["openfl.display._internal.Context3DTextField"] = openfl_display__$internal_Context3DTextField;
openfl_display__$internal_Context3DTextField.__name__ = "openfl.display._internal.Context3DTextField";
openfl_display__$internal_Context3DTextField.render = function(textField,renderer) {
	var renderer1 = renderer.__softwareRenderer;
	var transform = textField.__worldTransform;
	var textEngine = textField.__textEngine;
	var bounds = textEngine.background || textEngine.border ? textEngine.bounds : textEngine.textBounds;
	var graphics = textField.__graphics;
	if(textField.__dirty) {
		textField.__updateLayout();
		if(graphics.__bounds == null) {
			graphics.__bounds = new openfl_geom_Rectangle();
		}
		graphics.__bounds.copyFrom(bounds);
	}
	graphics.__update(renderer1.__worldTransform);
	if(textField.__dirty || graphics.__softwareDirty) {
		var width = graphics.__width;
		var height = graphics.__height;
		if((textEngine.text == null || textEngine.text == "") && !textEngine.background && !textEngine.border && !textEngine.__hasFocus && (textEngine.type != 1 || !textEngine.selectable) || (textEngine.width <= 0 || textEngine.height <= 0) && textEngine.autoSize != 2) {
			textField.__graphics.__canvas = null;
			textField.__graphics.__context = null;
			textField.__graphics.__bitmap = null;
			textField.__graphics.__softwareDirty = false;
			textField.__graphics.set___dirty(false);
			textField.__dirty = false;
		} else {
			if(textField.__graphics.__canvas == null) {
				textField.__graphics.__canvas = window.document.createElement("canvas");
				textField.__graphics.__context = textField.__graphics.__canvas.getContext("2d");
			}
			openfl_display__$internal_CanvasTextField.context = graphics.__context;
			var transform = graphics.__renderTransform;
			if(renderer1.__isDOM) {
				var scale = renderer1.pixelRatio;
				graphics.__canvas.width = width * scale | 0;
				graphics.__canvas.height = height * scale | 0;
				graphics.__canvas.style.width = width + "px";
				graphics.__canvas.style.height = height + "px";
				var matrix = openfl_geom_Matrix.__pool.get();
				matrix.copyFrom(transform);
				matrix.scale(scale,scale);
				renderer1.setTransform(matrix,openfl_display__$internal_CanvasTextField.context);
				openfl_geom_Matrix.__pool.release(matrix);
			} else {
				graphics.__canvas.width = width;
				graphics.__canvas.height = height;
				openfl_display__$internal_CanvasTextField.context.setTransform(transform.a,transform.b,transform.c,transform.d,transform.tx,transform.ty);
			}
			if(openfl_display__$internal_CanvasTextField.clearRect == null) {
				openfl_display__$internal_CanvasTextField.clearRect = (typeof navigator !== 'undefined' && typeof navigator['isCocoonJS'] !== 'undefined');
			}
			if(openfl_display__$internal_CanvasTextField.clearRect) {
				openfl_display__$internal_CanvasTextField.context.clearRect(0,0,graphics.__canvas.width,graphics.__canvas.height);
			}
			if(textEngine.text != null && textEngine.text != "" || textEngine.__hasFocus) {
				var text = textEngine.text;
				if(!renderer1.__allowSmoothing || textEngine.antiAliasType == 0 && textEngine.sharpness == 400) {
					graphics.__context.imageSmoothingEnabled = false;
				} else {
					graphics.__context.imageSmoothingEnabled = true;
				}
				if(textEngine.border || textEngine.background) {
					openfl_display__$internal_CanvasTextField.context.rect(0.5,0.5,bounds.width - 1,bounds.height - 1);
					if(textEngine.background) {
						var tmp = StringTools.hex(textEngine.backgroundColor & 16777215,6);
						openfl_display__$internal_CanvasTextField.context.fillStyle = "#" + tmp;
						openfl_display__$internal_CanvasTextField.context.fill();
					}
					if(textEngine.border) {
						openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
						var tmp = StringTools.hex(textEngine.borderColor & 16777215,6);
						openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
						openfl_display__$internal_CanvasTextField.context.stroke();
					}
				}
				openfl_display__$internal_CanvasTextField.context.textBaseline = "alphabetic";
				openfl_display__$internal_CanvasTextField.context.textAlign = "start";
				var scrollX = -textField.get_scrollH();
				var scrollY = 0.0;
				var _g = 0;
				var _g1 = textField.get_scrollV() - 1;
				while(_g < _g1) {
					var i = _g++;
					scrollY -= textEngine.lineHeights.get(i);
				}
				var advance;
				var group = textEngine.layoutGroups.iterator();
				while(group.hasNext()) {
					var group1 = group.next();
					if(group1.lineIndex < textField.get_scrollV() - 1) {
						continue;
					}
					if(group1.lineIndex > textEngine.get_bottomScrollV() - 1) {
						break;
					}
					var color = "#" + StringTools.hex(group1.format.color & 16777215,6);
					openfl_display__$internal_CanvasTextField.context.font = openfl_text__$internal_TextEngine.getFont(group1.format);
					openfl_display__$internal_CanvasTextField.context.fillStyle = color;
					openfl_display__$internal_CanvasTextField.context.fillText(text.substring(group1.startIndex,group1.endIndex),group1.offsetX + scrollX - bounds.x,group1.offsetY + group1.ascent + scrollY - bounds.y);
					if(textField.__caretIndex > -1 && textEngine.selectable) {
						if(textField.__selectionIndex == textField.__caretIndex) {
							if(textField.__showCursor && group1.startIndex <= textField.__caretIndex && group1.endIndex >= textField.__caretIndex) {
								advance = 0.0;
								var _g = 0;
								var _g1 = textField.__caretIndex - group1.startIndex;
								while(_g < _g1) {
									var i = _g++;
									if(group1.positions.length <= i) {
										break;
									}
									advance += group1.positions[i];
								}
								var scrollY1 = 0.0;
								var _g2 = textField.get_scrollV();
								var _g3 = group1.lineIndex + 1;
								while(_g2 < _g3) {
									var i1 = _g2++;
									scrollY1 += textEngine.lineHeights.get(i1 - 1);
								}
								openfl_display__$internal_CanvasTextField.context.beginPath();
								var tmp = StringTools.hex(group1.format.color & 16777215,6);
								openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
								openfl_display__$internal_CanvasTextField.context.moveTo(group1.offsetX + advance - textField.get_scrollH() - bounds.x,scrollY1 + 2 - bounds.y);
								openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
								openfl_display__$internal_CanvasTextField.context.lineTo(group1.offsetX + advance - textField.get_scrollH() - bounds.x,scrollY1 + openfl_text__$internal_TextEngine.getFormatHeight(textField.get_defaultTextFormat()) - 1 - bounds.y);
								openfl_display__$internal_CanvasTextField.context.stroke();
								openfl_display__$internal_CanvasTextField.context.closePath();
							}
						} else if(group1.startIndex <= textField.__caretIndex && group1.endIndex >= textField.__caretIndex || group1.startIndex <= textField.__selectionIndex && group1.endIndex >= textField.__selectionIndex || group1.startIndex > textField.__caretIndex && group1.endIndex < textField.__selectionIndex || group1.startIndex > textField.__selectionIndex && group1.endIndex < textField.__caretIndex) {
							var selectionStart = Math.min(textField.__selectionIndex,textField.__caretIndex) | 0;
							var selectionEnd = Math.max(textField.__selectionIndex,textField.__caretIndex) | 0;
							if(group1.startIndex > selectionStart) {
								selectionStart = group1.startIndex;
							}
							if(group1.endIndex < selectionEnd) {
								selectionEnd = group1.endIndex;
							}
							var end;
							var start = textField.getCharBoundaries(selectionStart);
							if(selectionEnd >= group1.endIndex) {
								end = textField.getCharBoundaries(group1.endIndex - 1);
								if(end != null) {
									end.x += end.width + 2;
								}
							} else {
								end = textField.getCharBoundaries(selectionEnd);
							}
							if(start != null && end != null) {
								openfl_display__$internal_CanvasTextField.context.fillStyle = "#000000";
								openfl_display__$internal_CanvasTextField.context.fillRect(start.x + scrollX,start.y + scrollY,end.x - start.x,group1.height);
								openfl_display__$internal_CanvasTextField.context.fillStyle = "#FFFFFF";
								openfl_display__$internal_CanvasTextField.context.fillText(text.substring(selectionStart,selectionEnd),scrollX + start.x,group1.offsetY + group1.ascent + scrollY);
							}
						}
					}
					if(group1.format.underline) {
						openfl_display__$internal_CanvasTextField.context.beginPath();
						openfl_display__$internal_CanvasTextField.context.strokeStyle = color;
						openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
						var x = group1.offsetX + scrollX - bounds.x;
						var y = Math.floor(group1.offsetY + scrollY + group1.ascent - bounds.y) + 0.5;
						openfl_display__$internal_CanvasTextField.context.moveTo(x,y);
						openfl_display__$internal_CanvasTextField.context.lineTo(x + group1.width,y);
						openfl_display__$internal_CanvasTextField.context.stroke();
						openfl_display__$internal_CanvasTextField.context.closePath();
					}
				}
			} else {
				if(textEngine.border || textEngine.background) {
					if(textEngine.border) {
						openfl_display__$internal_CanvasTextField.context.rect(0.5,0.5,bounds.width - 1,bounds.height - 1);
					} else {
						openfl_display__$internal_CanvasTextField.context.rect(0,0,bounds.width,bounds.height);
					}
					if(textEngine.background) {
						var tmp = StringTools.hex(textEngine.backgroundColor & 16777215,6);
						openfl_display__$internal_CanvasTextField.context.fillStyle = "#" + tmp;
						openfl_display__$internal_CanvasTextField.context.fill();
					}
					if(textEngine.border) {
						openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
						openfl_display__$internal_CanvasTextField.context.lineCap = "square";
						var tmp = StringTools.hex(textEngine.borderColor & 16777215,6);
						openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
						openfl_display__$internal_CanvasTextField.context.stroke();
					}
				}
				if(textField.__caretIndex > -1 && textEngine.selectable && textField.__showCursor) {
					var scrollX = -textField.get_scrollH();
					var scrollY = 0.0;
					var _g = 0;
					var _g1 = textField.get_scrollV() - 1;
					while(_g < _g1) {
						var i = _g++;
						scrollY += textEngine.lineHeights.get(i);
					}
					openfl_display__$internal_CanvasTextField.context.beginPath();
					var tmp = StringTools.hex(textField.get_defaultTextFormat().color & 16777215,6);
					openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
					openfl_display__$internal_CanvasTextField.context.moveTo(scrollX + 2.5,scrollY + 2.5);
					openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
					openfl_display__$internal_CanvasTextField.context.lineTo(scrollX + 2.5,scrollY + openfl_text__$internal_TextEngine.getFormatHeight(textField.get_defaultTextFormat()) - 1);
					openfl_display__$internal_CanvasTextField.context.stroke();
					openfl_display__$internal_CanvasTextField.context.closePath();
				}
			}
			graphics.__bitmap = openfl_display_BitmapData.fromCanvas(textField.__graphics.__canvas);
			graphics.__visible = true;
			textField.__dirty = false;
			graphics.__softwareDirty = false;
			graphics.set___dirty(false);
		}
	}
	textField.__graphics.__hardwareDirty = false;
};
openfl_display__$internal_Context3DTextField.renderMask = function(textField,renderer) {
	var renderer1 = renderer.__softwareRenderer;
	var transform = textField.__worldTransform;
	var textEngine = textField.__textEngine;
	var bounds = textEngine.background || textEngine.border ? textEngine.bounds : textEngine.textBounds;
	var graphics = textField.__graphics;
	if(textField.__dirty) {
		textField.__updateLayout();
		if(graphics.__bounds == null) {
			graphics.__bounds = new openfl_geom_Rectangle();
		}
		graphics.__bounds.copyFrom(bounds);
	}
	graphics.__update(renderer1.__worldTransform);
	if(textField.__dirty || graphics.__softwareDirty) {
		var width = graphics.__width;
		var height = graphics.__height;
		if((textEngine.text == null || textEngine.text == "") && !textEngine.background && !textEngine.border && !textEngine.__hasFocus && (textEngine.type != 1 || !textEngine.selectable) || (textEngine.width <= 0 || textEngine.height <= 0) && textEngine.autoSize != 2) {
			textField.__graphics.__canvas = null;
			textField.__graphics.__context = null;
			textField.__graphics.__bitmap = null;
			textField.__graphics.__softwareDirty = false;
			textField.__graphics.set___dirty(false);
			textField.__dirty = false;
		} else {
			if(textField.__graphics.__canvas == null) {
				textField.__graphics.__canvas = window.document.createElement("canvas");
				textField.__graphics.__context = textField.__graphics.__canvas.getContext("2d");
			}
			openfl_display__$internal_CanvasTextField.context = graphics.__context;
			var transform = graphics.__renderTransform;
			if(renderer1.__isDOM) {
				var scale = renderer1.pixelRatio;
				graphics.__canvas.width = width * scale | 0;
				graphics.__canvas.height = height * scale | 0;
				graphics.__canvas.style.width = width + "px";
				graphics.__canvas.style.height = height + "px";
				var matrix = openfl_geom_Matrix.__pool.get();
				matrix.copyFrom(transform);
				matrix.scale(scale,scale);
				renderer1.setTransform(matrix,openfl_display__$internal_CanvasTextField.context);
				openfl_geom_Matrix.__pool.release(matrix);
			} else {
				graphics.__canvas.width = width;
				graphics.__canvas.height = height;
				openfl_display__$internal_CanvasTextField.context.setTransform(transform.a,transform.b,transform.c,transform.d,transform.tx,transform.ty);
			}
			if(openfl_display__$internal_CanvasTextField.clearRect == null) {
				openfl_display__$internal_CanvasTextField.clearRect = (typeof navigator !== 'undefined' && typeof navigator['isCocoonJS'] !== 'undefined');
			}
			if(openfl_display__$internal_CanvasTextField.clearRect) {
				openfl_display__$internal_CanvasTextField.context.clearRect(0,0,graphics.__canvas.width,graphics.__canvas.height);
			}
			if(textEngine.text != null && textEngine.text != "" || textEngine.__hasFocus) {
				var text = textEngine.text;
				if(!renderer1.__allowSmoothing || textEngine.antiAliasType == 0 && textEngine.sharpness == 400) {
					graphics.__context.imageSmoothingEnabled = false;
				} else {
					graphics.__context.imageSmoothingEnabled = true;
				}
				if(textEngine.border || textEngine.background) {
					openfl_display__$internal_CanvasTextField.context.rect(0.5,0.5,bounds.width - 1,bounds.height - 1);
					if(textEngine.background) {
						var tmp = StringTools.hex(textEngine.backgroundColor & 16777215,6);
						openfl_display__$internal_CanvasTextField.context.fillStyle = "#" + tmp;
						openfl_display__$internal_CanvasTextField.context.fill();
					}
					if(textEngine.border) {
						openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
						var tmp = StringTools.hex(textEngine.borderColor & 16777215,6);
						openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
						openfl_display__$internal_CanvasTextField.context.stroke();
					}
				}
				openfl_display__$internal_CanvasTextField.context.textBaseline = "alphabetic";
				openfl_display__$internal_CanvasTextField.context.textAlign = "start";
				var scrollX = -textField.get_scrollH();
				var scrollY = 0.0;
				var _g = 0;
				var _g1 = textField.get_scrollV() - 1;
				while(_g < _g1) {
					var i = _g++;
					scrollY -= textEngine.lineHeights.get(i);
				}
				var advance;
				var group = textEngine.layoutGroups.iterator();
				while(group.hasNext()) {
					var group1 = group.next();
					if(group1.lineIndex < textField.get_scrollV() - 1) {
						continue;
					}
					if(group1.lineIndex > textEngine.get_bottomScrollV() - 1) {
						break;
					}
					var color = "#" + StringTools.hex(group1.format.color & 16777215,6);
					openfl_display__$internal_CanvasTextField.context.font = openfl_text__$internal_TextEngine.getFont(group1.format);
					openfl_display__$internal_CanvasTextField.context.fillStyle = color;
					openfl_display__$internal_CanvasTextField.context.fillText(text.substring(group1.startIndex,group1.endIndex),group1.offsetX + scrollX - bounds.x,group1.offsetY + group1.ascent + scrollY - bounds.y);
					if(textField.__caretIndex > -1 && textEngine.selectable) {
						if(textField.__selectionIndex == textField.__caretIndex) {
							if(textField.__showCursor && group1.startIndex <= textField.__caretIndex && group1.endIndex >= textField.__caretIndex) {
								advance = 0.0;
								var _g = 0;
								var _g1 = textField.__caretIndex - group1.startIndex;
								while(_g < _g1) {
									var i = _g++;
									if(group1.positions.length <= i) {
										break;
									}
									advance += group1.positions[i];
								}
								var scrollY1 = 0.0;
								var _g2 = textField.get_scrollV();
								var _g3 = group1.lineIndex + 1;
								while(_g2 < _g3) {
									var i1 = _g2++;
									scrollY1 += textEngine.lineHeights.get(i1 - 1);
								}
								openfl_display__$internal_CanvasTextField.context.beginPath();
								var tmp = StringTools.hex(group1.format.color & 16777215,6);
								openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
								openfl_display__$internal_CanvasTextField.context.moveTo(group1.offsetX + advance - textField.get_scrollH() - bounds.x,scrollY1 + 2 - bounds.y);
								openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
								openfl_display__$internal_CanvasTextField.context.lineTo(group1.offsetX + advance - textField.get_scrollH() - bounds.x,scrollY1 + openfl_text__$internal_TextEngine.getFormatHeight(textField.get_defaultTextFormat()) - 1 - bounds.y);
								openfl_display__$internal_CanvasTextField.context.stroke();
								openfl_display__$internal_CanvasTextField.context.closePath();
							}
						} else if(group1.startIndex <= textField.__caretIndex && group1.endIndex >= textField.__caretIndex || group1.startIndex <= textField.__selectionIndex && group1.endIndex >= textField.__selectionIndex || group1.startIndex > textField.__caretIndex && group1.endIndex < textField.__selectionIndex || group1.startIndex > textField.__selectionIndex && group1.endIndex < textField.__caretIndex) {
							var selectionStart = Math.min(textField.__selectionIndex,textField.__caretIndex) | 0;
							var selectionEnd = Math.max(textField.__selectionIndex,textField.__caretIndex) | 0;
							if(group1.startIndex > selectionStart) {
								selectionStart = group1.startIndex;
							}
							if(group1.endIndex < selectionEnd) {
								selectionEnd = group1.endIndex;
							}
							var end;
							var start = textField.getCharBoundaries(selectionStart);
							if(selectionEnd >= group1.endIndex) {
								end = textField.getCharBoundaries(group1.endIndex - 1);
								if(end != null) {
									end.x += end.width + 2;
								}
							} else {
								end = textField.getCharBoundaries(selectionEnd);
							}
							if(start != null && end != null) {
								openfl_display__$internal_CanvasTextField.context.fillStyle = "#000000";
								openfl_display__$internal_CanvasTextField.context.fillRect(start.x + scrollX,start.y + scrollY,end.x - start.x,group1.height);
								openfl_display__$internal_CanvasTextField.context.fillStyle = "#FFFFFF";
								openfl_display__$internal_CanvasTextField.context.fillText(text.substring(selectionStart,selectionEnd),scrollX + start.x,group1.offsetY + group1.ascent + scrollY);
							}
						}
					}
					if(group1.format.underline) {
						openfl_display__$internal_CanvasTextField.context.beginPath();
						openfl_display__$internal_CanvasTextField.context.strokeStyle = color;
						openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
						var x = group1.offsetX + scrollX - bounds.x;
						var y = Math.floor(group1.offsetY + scrollY + group1.ascent - bounds.y) + 0.5;
						openfl_display__$internal_CanvasTextField.context.moveTo(x,y);
						openfl_display__$internal_CanvasTextField.context.lineTo(x + group1.width,y);
						openfl_display__$internal_CanvasTextField.context.stroke();
						openfl_display__$internal_CanvasTextField.context.closePath();
					}
				}
			} else {
				if(textEngine.border || textEngine.background) {
					if(textEngine.border) {
						openfl_display__$internal_CanvasTextField.context.rect(0.5,0.5,bounds.width - 1,bounds.height - 1);
					} else {
						openfl_display__$internal_CanvasTextField.context.rect(0,0,bounds.width,bounds.height);
					}
					if(textEngine.background) {
						var tmp = StringTools.hex(textEngine.backgroundColor & 16777215,6);
						openfl_display__$internal_CanvasTextField.context.fillStyle = "#" + tmp;
						openfl_display__$internal_CanvasTextField.context.fill();
					}
					if(textEngine.border) {
						openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
						openfl_display__$internal_CanvasTextField.context.lineCap = "square";
						var tmp = StringTools.hex(textEngine.borderColor & 16777215,6);
						openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
						openfl_display__$internal_CanvasTextField.context.stroke();
					}
				}
				if(textField.__caretIndex > -1 && textEngine.selectable && textField.__showCursor) {
					var scrollX = -textField.get_scrollH();
					var scrollY = 0.0;
					var _g = 0;
					var _g1 = textField.get_scrollV() - 1;
					while(_g < _g1) {
						var i = _g++;
						scrollY += textEngine.lineHeights.get(i);
					}
					openfl_display__$internal_CanvasTextField.context.beginPath();
					var tmp = StringTools.hex(textField.get_defaultTextFormat().color & 16777215,6);
					openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
					openfl_display__$internal_CanvasTextField.context.moveTo(scrollX + 2.5,scrollY + 2.5);
					openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
					openfl_display__$internal_CanvasTextField.context.lineTo(scrollX + 2.5,scrollY + openfl_text__$internal_TextEngine.getFormatHeight(textField.get_defaultTextFormat()) - 1);
					openfl_display__$internal_CanvasTextField.context.stroke();
					openfl_display__$internal_CanvasTextField.context.closePath();
				}
			}
			graphics.__bitmap = openfl_display_BitmapData.fromCanvas(textField.__graphics.__canvas);
			graphics.__visible = true;
			textField.__dirty = false;
			graphics.__softwareDirty = false;
			graphics.set___dirty(false);
		}
	}
	textField.__graphics.__hardwareDirty = false;
};
var openfl_display__$internal_DOMBitmap = function() { };
$hxClasses["openfl.display._internal.DOMBitmap"] = openfl_display__$internal_DOMBitmap;
openfl_display__$internal_DOMBitmap.__name__ = "openfl.display._internal.DOMBitmap";
openfl_display__$internal_DOMBitmap.clear = function(bitmap,renderer) {
	if(bitmap.__image != null) {
		renderer.element.removeChild(bitmap.__image);
		bitmap.__image = null;
		bitmap.__style = null;
	}
	if(bitmap.__canvas != null) {
		renderer.element.removeChild(bitmap.__canvas);
		bitmap.__canvas = null;
		bitmap.__style = null;
	}
};
openfl_display__$internal_DOMBitmap.render = function(bitmap,renderer) {
	if(bitmap.stage != null && bitmap.__worldVisible && bitmap.__renderable && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) {
		renderer.__pushMaskObject(bitmap);
		if(bitmap.__bitmapData.image.buffer.__srcImage != null) {
			openfl_display__$internal_DOMBitmap.renderImage(bitmap,renderer);
		} else {
			openfl_display__$internal_DOMBitmap.renderCanvas(bitmap,renderer);
		}
		renderer.__popMaskObject(bitmap);
	} else {
		openfl_display__$internal_DOMBitmap.clear(bitmap,renderer);
	}
};
openfl_display__$internal_DOMBitmap.renderCanvas = function(bitmap,renderer) {
	if(bitmap.__image != null) {
		renderer.element.removeChild(bitmap.__image);
		bitmap.__image = null;
	}
	if(bitmap.__canvas == null) {
		bitmap.__canvas = window.document.createElement("canvas");
		bitmap.__context = bitmap.__canvas.getContext("2d");
		bitmap.__imageVersion = -1;
		if(!renderer.__allowSmoothing || !bitmap.smoothing) {
			bitmap.__context.imageSmoothingEnabled = false;
		}
		renderer.__initializeElement(bitmap,bitmap.__canvas);
	}
	if(bitmap.__imageVersion != bitmap.__bitmapData.image.version) {
		lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(bitmap.__bitmapData.image);
		bitmap.__canvas.width = bitmap.__bitmapData.width + 1;
		bitmap.__canvas.width = bitmap.__bitmapData.width;
		bitmap.__canvas.height = bitmap.__bitmapData.height;
		bitmap.__context.drawImage(bitmap.__bitmapData.image.buffer.__srcCanvas,0,0);
		bitmap.__imageVersion = bitmap.__bitmapData.image.version;
	}
	renderer.__updateClip(bitmap);
	renderer.__applyStyle(bitmap,true,true,true);
};
openfl_display__$internal_DOMBitmap.renderImage = function(bitmap,renderer) {
	if(bitmap.__canvas != null) {
		renderer.element.removeChild(bitmap.__canvas);
		bitmap.__canvas = null;
	}
	if(bitmap.__image == null) {
		bitmap.__image = window.document.createElement("img");
		bitmap.__image.crossOrigin = "Anonymous";
		bitmap.__image.src = bitmap.__bitmapData.image.buffer.__srcImage.src;
		renderer.__initializeElement(bitmap,bitmap.__image);
	}
	renderer.__updateClip(bitmap);
	renderer.__applyStyle(bitmap,true,true,true);
};
var openfl_display__$internal_DOMDisplayObject = function() { };
$hxClasses["openfl.display._internal.DOMDisplayObject"] = openfl_display__$internal_DOMDisplayObject;
openfl_display__$internal_DOMDisplayObject.__name__ = "openfl.display._internal.DOMDisplayObject";
openfl_display__$internal_DOMDisplayObject.clear = function(displayObject,renderer) {
	if(displayObject.__cacheBitmap != null) {
		openfl_display__$internal_DOMBitmap.clear(displayObject.__cacheBitmap,renderer);
	}
	openfl_display__$internal_DOMShape.clear(displayObject,renderer);
};
openfl_display__$internal_DOMDisplayObject.render = function(displayObject,renderer) {
	var tmp = displayObject.opaqueBackground != null && !displayObject.__isCacheBitmapRender && displayObject.get_width() > 0 && displayObject.get_height() > 0;
	var graphics = displayObject.__graphics;
	if(displayObject.stage != null && displayObject.__worldVisible && displayObject.__renderable && graphics != null) {
		openfl_display__$internal_CanvasGraphics.render(graphics,renderer.__canvasRenderer);
		if(graphics.__softwareDirty || displayObject.__worldAlphaChanged || displayObject.__canvas != graphics.__canvas) {
			if(graphics.__canvas != null) {
				if(displayObject.__canvas != graphics.__canvas) {
					if(displayObject.__canvas != null) {
						renderer.element.removeChild(displayObject.__canvas);
					}
					displayObject.__canvas = graphics.__canvas;
					displayObject.__context = graphics.__context;
					renderer.__initializeElement(displayObject,displayObject.__canvas);
				}
			} else {
				openfl_display__$internal_DOMShape.clear(displayObject,renderer);
			}
		}
		if(displayObject.__canvas != null) {
			renderer.__pushMaskObject(displayObject);
			var cacheTransform = displayObject.__renderTransform;
			displayObject.__renderTransform = graphics.__worldTransform;
			if(graphics.__transformDirty) {
				graphics.__transformDirty = false;
				displayObject.__renderTransformChanged = true;
			}
			renderer.__updateClip(displayObject);
			renderer.__applyStyle(displayObject,true,true,true);
			displayObject.__renderTransform = cacheTransform;
			renderer.__popMaskObject(displayObject);
		}
	} else {
		openfl_display__$internal_DOMShape.clear(displayObject,renderer);
	}
};
var openfl_display__$internal_DOMShape = function() { };
$hxClasses["openfl.display._internal.DOMShape"] = openfl_display__$internal_DOMShape;
openfl_display__$internal_DOMShape.__name__ = "openfl.display._internal.DOMShape";
openfl_display__$internal_DOMShape.clear = function(shape,renderer) {
	if(shape.__canvas != null) {
		renderer.element.removeChild(shape.__canvas);
		shape.__canvas = null;
		shape.__style = null;
	}
};
openfl_display__$internal_DOMShape.render = function(shape,renderer) {
	var graphics = shape.__graphics;
	if(shape.stage != null && shape.__worldVisible && shape.__renderable && graphics != null) {
		openfl_display__$internal_CanvasGraphics.render(graphics,renderer.__canvasRenderer);
		if(graphics.__softwareDirty || shape.__worldAlphaChanged || shape.__canvas != graphics.__canvas) {
			if(graphics.__canvas != null) {
				if(shape.__canvas != graphics.__canvas) {
					if(shape.__canvas != null) {
						renderer.element.removeChild(shape.__canvas);
					}
					shape.__canvas = graphics.__canvas;
					shape.__context = graphics.__context;
					renderer.__initializeElement(shape,shape.__canvas);
				}
			} else {
				openfl_display__$internal_DOMShape.clear(shape,renderer);
			}
		}
		if(shape.__canvas != null) {
			renderer.__pushMaskObject(shape);
			var cacheTransform = shape.__renderTransform;
			shape.__renderTransform = graphics.__worldTransform;
			if(graphics.__transformDirty) {
				graphics.__transformDirty = false;
				shape.__renderTransformChanged = true;
			}
			renderer.__updateClip(shape);
			renderer.__applyStyle(shape,true,true,true);
			shape.__renderTransform = cacheTransform;
			renderer.__popMaskObject(shape);
		}
	} else {
		openfl_display__$internal_DOMShape.clear(shape,renderer);
	}
};
var openfl_display__$internal_DOMTextField = function() { };
$hxClasses["openfl.display._internal.DOMTextField"] = openfl_display__$internal_DOMTextField;
openfl_display__$internal_DOMTextField.__name__ = "openfl.display._internal.DOMTextField";
openfl_display__$internal_DOMTextField.clear = function(textField,renderer) {
	if(textField.__div != null) {
		renderer.element.removeChild(textField.__div);
		textField.__div = null;
		textField.__style = null;
	}
};
openfl_display__$internal_DOMTextField.measureText = function(textField) {
	var textEngine = textField.__textEngine;
	var div = textField.__div;
	if(div == null) {
		div = window.document.createElement("div");
		var _this_r = new RegExp("\n","g".split("u").join(""));
		div.innerHTML = textEngine.text.replace(_this_r,"<br>");
		div.style.setProperty("font",openfl_text__$internal_TextEngine.getFont(textField.__textFormat),null);
		div.style.setProperty("pointer-events","none",null);
		div.style.position = "absolute";
		div.style.top = "110%";
		window.document.body.appendChild(div);
	}
	textEngine.__measuredWidth = div.clientWidth;
	if(textField.__div == null) {
		div.style.width = Std.string(textEngine.width - 4) + "px";
	}
	textEngine.__measuredHeight = div.clientHeight;
	if(textField.__div == null) {
		window.document.body.removeChild(div);
	}
};
openfl_display__$internal_DOMTextField.render = function(textField,renderer) {
	var textEngine = textField.__textEngine;
	if(textField.stage != null && textField.__worldVisible && textField.__renderable) {
		if(textField.__dirty || textField.__renderTransformChanged || textField.__div == null) {
			if(textEngine.text != "" || textEngine.background || textEngine.border || textEngine.type == 1) {
				if(textField.__div == null) {
					textField.__div = window.document.createElement("div");
					renderer.__initializeElement(textField,textField.__div);
					textField.__style.setProperty("outline","none",null);
					textField.__div.addEventListener("input",function(event) {
						event.preventDefault();
						if(textField.get_htmlText() != textField.__div.innerHTML) {
							textField.set_htmlText(textField.__div.innerHTML);
							var textField1 = textField.__displayAsPassword;
							textField.__dirty = false;
							textField.dispatchEvent(new openfl_events_TextEvent("textInput",false,false,textField.get_htmlText()));
						}
					},true);
				}
				if(!textEngine.wordWrap) {
					textField.__style.setProperty("white-space","nowrap",null);
				} else {
					textField.__style.setProperty("word-wrap","break-word",null);
				}
				textField.__style.setProperty("overflow","hidden",null);
				if(textEngine.selectable) {
					textField.__style.setProperty("cursor","text",null);
					textField.__style.setProperty("-webkit-user-select","text",null);
					textField.__style.setProperty("-moz-user-select","text",null);
					textField.__style.setProperty("-ms-user-select","text",null);
					textField.__style.setProperty("-o-user-select","text",null);
				} else {
					textField.__style.setProperty("cursor","inherit",null);
				}
				var div = textField.__div;
				div.contentEditable = textEngine.type == 1;
				var style = textField.__style;
				if(textEngine.background) {
					style.setProperty("background-color","#" + StringTools.hex(textEngine.backgroundColor & 16777215,6),null);
				} else {
					style.removeProperty("background-color");
				}
				var w = textEngine.width;
				var h = textEngine.height;
				var scale = 1;
				var unscaledSize = textField.__textFormat.size;
				var scaledSize = unscaledSize;
				var t = textField.__renderTransform;
				if(t.a != 1.0 || t.d != 1.0) {
					if(t.a == t.d) {
						scale = t.a;
						t.a = t.d = 1.0;
					} else if(t.a > t.d) {
						scale = t.a;
						t.d /= t.a;
						t.a = 1.0;
					} else {
						scale = t.d;
						t.a /= t.d;
						t.d = 1.0;
					}
					scaledSize *= scale;
					w = Math.ceil(w * scale);
					h = Math.ceil(h * scale);
				}
				textField.__textFormat.size = scaledSize;
				var text = textEngine.text;
				var adjustment = 0;
				if(!textField.__isHTML) {
					text = StringTools.htmlEscape(text);
				} else {
					var matchText = text;
					while(openfl_display__$internal_DOMTextField.__regexFont.match(matchText)) {
						var fontText = openfl_display__$internal_DOMTextField.__regexFont.matched(0);
						var style1 = "";
						if(openfl_display__$internal_DOMTextField.__regexFace.match(fontText)) {
							style1 += "font-family:'" + openfl_display__$internal_DOMTextField.__getAttributeMatch(openfl_display__$internal_DOMTextField.__regexFace) + "';";
						}
						if(openfl_display__$internal_DOMTextField.__regexColor.match(fontText)) {
							style1 += "color:#" + openfl_display__$internal_DOMTextField.__getAttributeMatch(openfl_display__$internal_DOMTextField.__regexColor) + ";";
						}
						if(openfl_display__$internal_DOMTextField.__regexSize.match(fontText)) {
							var sizeAttr = openfl_display__$internal_DOMTextField.__getAttributeMatch(openfl_display__$internal_DOMTextField.__regexSize);
							var firstChar = HxOverrides.cca(sizeAttr,0);
							var size;
							adjustment = parseFloat(sizeAttr) * scale;
							if(firstChar == 43 || firstChar == 45) {
								size = scaledSize + adjustment;
							} else {
								size = adjustment;
							}
							style1 += "font-size:" + size + "px;";
						}
						text = StringTools.replace(text,fontText,"<span style='" + style1 + "'>");
						matchText = openfl_display__$internal_DOMTextField.__regexFont.matchedRight();
					}
					text = text.replace(openfl_display__$internal_DOMTextField.__regexCloseFont.r,"</span>");
				}
				text = StringTools.replace(text,"<p ","<p style='margin-top:0; margin-bottom:0;' ");
				var unscaledLeading = textField.__textFormat.leading;
				textField.__textFormat.leading += adjustment | 0;
				var _this_r = new RegExp("\r\n","g".split("u").join(""));
				var tmp = text.replace(_this_r,"<br>");
				textField.__div.innerHTML = tmp;
				var _this_r = new RegExp("\n","g".split("u").join(""));
				var tmp = textField.__div.innerHTML.replace(_this_r,"<br>");
				textField.__div.innerHTML = tmp;
				var _this_r = new RegExp("\r","g".split("u").join(""));
				var tmp = textField.__div.innerHTML.replace(_this_r,"<br>");
				textField.__div.innerHTML = tmp;
				style.setProperty("font",openfl_text__$internal_TextEngine.getFont(textField.__textFormat),null);
				textField.__textFormat.size = unscaledSize;
				textField.__textFormat.leading = unscaledLeading;
				style.setProperty("top","3px",null);
				if(textEngine.border) {
					style.setProperty("border","solid 1px #" + StringTools.hex(textEngine.borderColor & 16777215,6),null);
					textField.__renderTransform.translate(-1,-1);
					textField.__renderTransformChanged = true;
					textField.__transformDirty = true;
				} else if(style.border != "") {
					style.removeProperty("border");
					textField.__renderTransformChanged = true;
				}
				style.setProperty("color","#" + StringTools.hex(textField.__textFormat.color & 16777215,6),null);
				style.setProperty("width",w + "px",null);
				style.setProperty("height",h + "px",null);
				switch(textField.__textFormat.align) {
				case 0:
					style.setProperty("text-align","center",null);
					break;
				case 4:
					style.setProperty("text-align","right",null);
					break;
				default:
					style.setProperty("text-align","left",null);
				}
				textField.__dirty = false;
			} else if(textField.__div != null) {
				renderer.element.removeChild(textField.__div);
				textField.__div = null;
			}
		}
		if(textField.__div != null) {
			var old = renderer.__roundPixels;
			renderer.__roundPixels = true;
			renderer.__updateClip(textField);
			renderer.__applyStyle(textField,true,true,true);
			renderer.__roundPixels = old;
		}
	} else {
		openfl_display__$internal_DOMTextField.clear(textField,renderer);
	}
};
openfl_display__$internal_DOMTextField.__getAttributeMatch = function(regex) {
	if(regex.matched(2) != null) {
		return regex.matched(2);
	} else {
		return regex.matched(3);
	}
};
var openfl_display__$internal_DrawCommandReader = function(buffer) {
	this.buffer = buffer;
	this.bPos = this.iPos = this.fPos = this.oPos = this.ffPos = this.iiPos = this.tsPos = 0;
	this.prev = openfl_display__$internal_DrawCommandType.UNKNOWN;
};
$hxClasses["openfl.display._internal.DrawCommandReader"] = openfl_display__$internal_DrawCommandReader;
openfl_display__$internal_DrawCommandReader.__name__ = "openfl.display._internal.DrawCommandReader";
openfl_display__$internal_DrawCommandReader.prototype = {
	buffer: null
	,bPos: null
	,iiPos: null
	,iPos: null
	,ffPos: null
	,fPos: null
	,oPos: null
	,prev: null
	,tsPos: null
	,advance: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
	}
	,bool: function(index) {
		return this.buffer.b[this.bPos + index];
	}
	,destroy: function() {
		this.buffer = null;
		this.reset();
	}
	,fArr: function(index) {
		return this.buffer.ff[this.ffPos + index];
	}
	,float: function(index) {
		return this.buffer.f[this.fPos + index];
	}
	,iArr: function(index) {
		return this.buffer.ii[this.iiPos + index];
	}
	,int: function(index) {
		return this.buffer.i[this.iPos + index];
	}
	,obj: function(index) {
		return this.buffer.o[this.oPos + index];
	}
	,readBeginBitmapFill: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL;
		var this1 = this;
		return this1;
	}
	,readBeginFill: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.BEGIN_FILL;
		var this1 = this;
		return this1;
	}
	,readBeginGradientFill: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL;
		var this1 = this;
		return this1;
	}
	,readBeginShaderFill: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL;
		var this1 = this;
		return this1;
	}
	,readCubicCurveTo: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO;
		var this1 = this;
		return this1;
	}
	,readCurveTo: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.CURVE_TO;
		var this1 = this;
		return this1;
	}
	,readDrawCircle: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.DRAW_CIRCLE;
		var this1 = this;
		return this1;
	}
	,readDrawEllipse: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE;
		var this1 = this;
		return this1;
	}
	,readDrawQuads: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.DRAW_QUADS;
		var this1 = this;
		return this1;
	}
	,readDrawRect: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.DRAW_RECT;
		var this1 = this;
		return this1;
	}
	,readDrawRoundRect: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT;
		var this1 = this;
		return this1;
	}
	,readDrawTriangles: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.DRAW_TRIANGLES;
		var this1 = this;
		return this1;
	}
	,readEndFill: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.END_FILL;
		var this1 = this;
		return this1;
	}
	,readLineBitmapStyle: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.LINE_BITMAP_STYLE;
		var this1 = this;
		return this1;
	}
	,readLineGradientStyle: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.LINE_GRADIENT_STYLE;
		var this1 = this;
		return this1;
	}
	,readLineStyle: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.LINE_STYLE;
		var this1 = this;
		return this1;
	}
	,readLineTo: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.LINE_TO;
		var this1 = this;
		return this1;
	}
	,readMoveTo: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.MOVE_TO;
		var this1 = this;
		return this1;
	}
	,readOverrideBlendMode: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.OVERRIDE_BLEND_MODE;
		var this1 = this;
		return this1;
	}
	,readOverrideMatrix: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.OVERRIDE_MATRIX;
		var this1 = this;
		return this1;
	}
	,readWindingEvenOdd: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.WINDING_EVEN_ODD;
		var this1 = this;
		return this1;
	}
	,readWindingNonZero: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.WINDING_NON_ZERO;
		var this1 = this;
		return this1;
	}
	,reset: function() {
		this.bPos = this.iPos = this.fPos = this.oPos = this.ffPos = this.iiPos = this.tsPos = 0;
	}
	,skip: function(type) {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = type;
	}
	,__class__: openfl_display__$internal_DrawCommandReader
};
var openfl_display__$internal_BeginBitmapFillView = {};
openfl_display__$internal_BeginBitmapFillView.__properties__ = {get_smooth:"get_smooth",get_repeat:"get_repeat",get_matrix:"get_matrix",get_bitmap:"get_bitmap"};
openfl_display__$internal_BeginBitmapFillView._new = function(d) {
	var this1 = d;
	return this1;
};
openfl_display__$internal_BeginBitmapFillView.get_bitmap = function(this1) {
	return this1.buffer.o[this1.oPos];
};
openfl_display__$internal_BeginBitmapFillView.get_matrix = function(this1) {
	return this1.buffer.o[this1.oPos + 1];
};
openfl_display__$internal_BeginBitmapFillView.get_repeat = function(this1) {
	return this1.buffer.b[this1.bPos];
};
openfl_display__$internal_BeginBitmapFillView.get_smooth = function(this1) {
	return this1.buffer.b[this1.bPos + 1];
};
var openfl_display__$internal_BeginFillView = {};
openfl_display__$internal_BeginFillView.__properties__ = {get_alpha:"get_alpha",get_color:"get_color"};
openfl_display__$internal_BeginFillView._new = function(d) {
	var this1 = d;
	return this1;
};
openfl_display__$internal_BeginFillView.get_color = function(this1) {
	return this1.buffer.i[this1.iPos];
};
openfl_display__$internal_BeginFillView.get_alpha = function(this1) {
	return this1.buffer.f[this1.fPos];
};
var openfl_display__$internal_BeginGradientFillView = {};
openfl_display__$internal_BeginGradientFillView.__properties__ = {get_focalPointRatio:"get_focalPointRatio",get_interpolationMethod:"get_interpolationMethod",get_spreadMethod:"get_spreadMethod",get_matrix:"get_matrix",get_ratios:"get_ratios",get_alphas:"get_alphas",get_colors:"get_colors",get_type:"get_type"};
openfl_display__$internal_BeginGradientFillView._new = function(d) {
	var this1 = d;
	return this1;
};
openfl_display__$internal_BeginGradientFillView.get_type = function(this1) {
	return this1.buffer.o[this1.oPos];
};
openfl_display__$internal_BeginGradientFillView.get_colors = function(this1) {
	return this1.buffer.ii[this1.iiPos];
};
openfl_display__$internal_BeginGradientFillView.get_alphas = function(this1) {
	return this1.buffer.ff[this1.ffPos];
};
openfl_display__$internal_BeginGradientFillView.get_ratios = function(this1) {
	return this1.buffer.ii[this1.iiPos + 1];
};
openfl_display__$internal_BeginGradientFillView.get_matrix = function(this1) {
	return this1.buffer.o[this1.oPos + 1];
};
openfl_display__$internal_BeginGradientFillView.get_spreadMethod = function(this1) {
	return this1.buffer.o[this1.oPos + 2];
};
openfl_display__$internal_BeginGradientFillView.get_interpolationMethod = function(this1) {
	return this1.buffer.o[this1.oPos + 3];
};
openfl_display__$internal_BeginGradientFillView.get_focalPointRatio = function(this1) {
	return this1.buffer.f[this1.fPos];
};
var openfl_display__$internal_BeginShaderFillView = {};
openfl_display__$internal_BeginShaderFillView.__properties__ = {get_shaderBuffer:"get_shaderBuffer"};
openfl_display__$internal_BeginShaderFillView._new = function(d) {
	var this1 = d;
	return this1;
};
openfl_display__$internal_BeginShaderFillView.get_shaderBuffer = function(this1) {
	return this1.buffer.o[this1.oPos];
};
var openfl_display__$internal_CubicCurveToView = {};
openfl_display__$internal_CubicCurveToView.__properties__ = {get_anchorY:"get_anchorY",get_anchorX:"get_anchorX",get_controlY2:"get_controlY2",get_controlX2:"get_controlX2",get_controlY1:"get_controlY1",get_controlX1:"get_controlX1"};
openfl_display__$internal_CubicCurveToView._new = function(d) {
	var this1 = d;
	return this1;
};
openfl_display__$internal_CubicCurveToView.get_controlX1 = function(this1) {
	return this1.buffer.f[this1.fPos];
};
openfl_display__$internal_CubicCurveToView.get_controlY1 = function(this1) {
	return this1.buffer.f[this1.fPos + 1];
};
openfl_display__$internal_CubicCurveToView.get_controlX2 = function(this1) {
	return this1.buffer.f[this1.fPos + 2];
};
openfl_display__$internal_CubicCurveToView.get_controlY2 = function(this1) {
	return this1.buffer.f[this1.fPos + 3];
};
openfl_display__$internal_CubicCurveToView.get_anchorX = function(this1) {
	return this1.buffer.f[this1.fPos + 4];
};
openfl_display__$internal_CubicCurveToView.get_anchorY = function(this1) {
	return this1.buffer.f[this1.fPos + 5];
};
var openfl_display__$internal_CurveToView = {};
openfl_display__$internal_CurveToView.__properties__ = {get_anchorY:"get_anchorY",get_anchorX:"get_anchorX",get_controlY:"get_controlY",get_controlX:"get_controlX"};
openfl_display__$internal_CurveToView._new = function(d) {
	var this1 = d;
	return this1;
};
openfl_display__$internal_CurveToView.get_controlX = function(this1) {
	return this1.buffer.f[this1.fPos];
};
openfl_display__$internal_CurveToView.get_controlY = function(this1) {
	return this1.buffer.f[this1.fPos + 1];
};
openfl_display__$internal_CurveToView.get_anchorX = function(this1) {
	return this1.buffer.f[this1.fPos + 2];
};
openfl_display__$internal_CurveToView.get_anchorY = function(this1) {
	return this1.buffer.f[this1.fPos + 3];
};
var openfl_display__$internal_DrawCircleView = {};
openfl_display__$internal_DrawCircleView.__properties__ = {get_radius:"get_radius",get_y:"get_y",get_x:"get_x"};
openfl_display__$internal_DrawCircleView._new = function(d) {
	var this1 = d;
	return this1;
};
openfl_display__$internal_DrawCircleView.get_x = function(this1) {
	return this1.buffer.f[this1.fPos];
};
openfl_display__$internal_DrawCircleView.get_y = function(this1) {
	return this1.buffer.f[this1.fPos + 1];
};
openfl_display__$internal_DrawCircleView.get_radius = function(this1) {
	return this1.buffer.f[this1.fPos + 2];
};
var openfl_display__$internal_DrawEllipseView = {};
openfl_display__$internal_DrawEllipseView.__properties__ = {get_height:"get_height",get_width:"get_width",get_y:"get_y",get_x:"get_x"};
openfl_display__$internal_DrawEllipseView._new = function(d) {
	var this1 = d;
	return this1;
};
openfl_display__$internal_DrawEllipseView.get_x = function(this1) {
	return this1.buffer.f[this1.fPos];
};
openfl_display__$internal_DrawEllipseView.get_y = function(this1) {
	return this1.buffer.f[this1.fPos + 1];
};
openfl_display__$internal_DrawEllipseView.get_width = function(this1) {
	return this1.buffer.f[this1.fPos + 2];
};
openfl_display__$internal_DrawEllipseView.get_height = function(this1) {
	return this1.buffer.f[this1.fPos + 3];
};
var openfl_display__$internal_DrawQuadsView = {};
openfl_display__$internal_DrawQuadsView.__properties__ = {get_transforms:"get_transforms",get_indices:"get_indices",get_rects:"get_rects"};
openfl_display__$internal_DrawQuadsView._new = function(d) {
	var this1 = d;
	return this1;
};
openfl_display__$internal_DrawQuadsView.get_rects = function(this1) {
	return this1.buffer.o[this1.oPos];
};
openfl_display__$internal_DrawQuadsView.get_indices = function(this1) {
	return this1.buffer.o[this1.oPos + 1];
};
openfl_display__$internal_DrawQuadsView.get_transforms = function(this1) {
	return this1.buffer.o[this1.oPos + 2];
};
var openfl_display__$internal_DrawRectView = {};
openfl_display__$internal_DrawRectView.__properties__ = {get_height:"get_height",get_width:"get_width",get_y:"get_y",get_x:"get_x"};
openfl_display__$internal_DrawRectView._new = function(d) {
	var this1 = d;
	return this1;
};
openfl_display__$internal_DrawRectView.get_x = function(this1) {
	return this1.buffer.f[this1.fPos];
};
openfl_display__$internal_DrawRectView.get_y = function(this1) {
	return this1.buffer.f[this1.fPos + 1];
};
openfl_display__$internal_DrawRectView.get_width = function(this1) {
	return this1.buffer.f[this1.fPos + 2];
};
openfl_display__$internal_DrawRectView.get_height = function(this1) {
	return this1.buffer.f[this1.fPos + 3];
};
var openfl_display__$internal_DrawRoundRectView = {};
openfl_display__$internal_DrawRoundRectView.__properties__ = {get_ellipseHeight:"get_ellipseHeight",get_ellipseWidth:"get_ellipseWidth",get_height:"get_height",get_width:"get_width",get_y:"get_y",get_x:"get_x"};
openfl_display__$internal_DrawRoundRectView._new = function(d) {
	var this1 = d;
	return this1;
};
openfl_display__$internal_DrawRoundRectView.get_x = function(this1) {
	return this1.buffer.f[this1.fPos];
};
openfl_display__$internal_DrawRoundRectView.get_y = function(this1) {
	return this1.buffer.f[this1.fPos + 1];
};
openfl_display__$internal_DrawRoundRectView.get_width = function(this1) {
	return this1.buffer.f[this1.fPos + 2];
};
openfl_display__$internal_DrawRoundRectView.get_height = function(this1) {
	return this1.buffer.f[this1.fPos + 3];
};
openfl_display__$internal_DrawRoundRectView.get_ellipseWidth = function(this1) {
	return this1.buffer.f[this1.fPos + 4];
};
openfl_display__$internal_DrawRoundRectView.get_ellipseHeight = function(this1) {
	return this1.buffer.o[this1.oPos];
};
var openfl_display__$internal_DrawTrianglesView = {};
openfl_display__$internal_DrawTrianglesView.__properties__ = {get_culling:"get_culling",get_uvtData:"get_uvtData",get_indices:"get_indices",get_vertices:"get_vertices"};
openfl_display__$internal_DrawTrianglesView._new = function(d) {
	var this1 = d;
	return this1;
};
openfl_display__$internal_DrawTrianglesView.get_vertices = function(this1) {
	return this1.buffer.o[this1.oPos];
};
openfl_display__$internal_DrawTrianglesView.get_indices = function(this1) {
	return this1.buffer.o[this1.oPos + 1];
};
openfl_display__$internal_DrawTrianglesView.get_uvtData = function(this1) {
	return this1.buffer.o[this1.oPos + 2];
};
openfl_display__$internal_DrawTrianglesView.get_culling = function(this1) {
	return this1.buffer.o[this1.oPos + 3];
};
var openfl_display__$internal_EndFillView = {};
openfl_display__$internal_EndFillView._new = function(d) {
	var this1 = d;
	return this1;
};
var openfl_display__$internal_LineBitmapStyleView = {};
openfl_display__$internal_LineBitmapStyleView.__properties__ = {get_smooth:"get_smooth",get_repeat:"get_repeat",get_matrix:"get_matrix",get_bitmap:"get_bitmap"};
openfl_display__$internal_LineBitmapStyleView._new = function(d) {
	var this1 = d;
	return this1;
};
openfl_display__$internal_LineBitmapStyleView.get_bitmap = function(this1) {
	return this1.buffer.o[this1.oPos];
};
openfl_display__$internal_LineBitmapStyleView.get_matrix = function(this1) {
	return this1.buffer.o[this1.oPos + 1];
};
openfl_display__$internal_LineBitmapStyleView.get_repeat = function(this1) {
	return this1.buffer.b[this1.bPos];
};
openfl_display__$internal_LineBitmapStyleView.get_smooth = function(this1) {
	return this1.buffer.b[this1.bPos + 1];
};
var openfl_display__$internal_LineGradientStyleView = {};
openfl_display__$internal_LineGradientStyleView.__properties__ = {get_focalPointRatio:"get_focalPointRatio",get_interpolationMethod:"get_interpolationMethod",get_spreadMethod:"get_spreadMethod",get_matrix:"get_matrix",get_ratios:"get_ratios",get_alphas:"get_alphas",get_colors:"get_colors",get_type:"get_type"};
openfl_display__$internal_LineGradientStyleView._new = function(d) {
	var this1 = d;
	return this1;
};
openfl_display__$internal_LineGradientStyleView.get_type = function(this1) {
	return this1.buffer.o[this1.oPos];
};
openfl_display__$internal_LineGradientStyleView.get_colors = function(this1) {
	return this1.buffer.ii[this1.iiPos];
};
openfl_display__$internal_LineGradientStyleView.get_alphas = function(this1) {
	return this1.buffer.ff[this1.ffPos];
};
openfl_display__$internal_LineGradientStyleView.get_ratios = function(this1) {
	return this1.buffer.ii[this1.iiPos + 1];
};
openfl_display__$internal_LineGradientStyleView.get_matrix = function(this1) {
	return this1.buffer.o[this1.oPos + 1];
};
openfl_display__$internal_LineGradientStyleView.get_spreadMethod = function(this1) {
	return this1.buffer.o[this1.oPos + 2];
};
openfl_display__$internal_LineGradientStyleView.get_interpolationMethod = function(this1) {
	return this1.buffer.o[this1.oPos + 3];
};
openfl_display__$internal_LineGradientStyleView.get_focalPointRatio = function(this1) {
	return this1.buffer.f[this1.fPos];
};
var openfl_display__$internal_LineStyleView = {};
openfl_display__$internal_LineStyleView.__properties__ = {get_miterLimit:"get_miterLimit",get_joints:"get_joints",get_caps:"get_caps",get_scaleMode:"get_scaleMode",get_pixelHinting:"get_pixelHinting",get_alpha:"get_alpha",get_color:"get_color",get_thickness:"get_thickness"};
openfl_display__$internal_LineStyleView._new = function(d) {
	var this1 = d;
	return this1;
};
openfl_display__$internal_LineStyleView.get_thickness = function(this1) {
	return this1.buffer.o[this1.oPos];
};
openfl_display__$internal_LineStyleView.get_color = function(this1) {
	return this1.buffer.i[this1.iPos];
};
openfl_display__$internal_LineStyleView.get_alpha = function(this1) {
	return this1.buffer.f[this1.fPos];
};
openfl_display__$internal_LineStyleView.get_pixelHinting = function(this1) {
	return this1.buffer.b[this1.bPos];
};
openfl_display__$internal_LineStyleView.get_scaleMode = function(this1) {
	return this1.buffer.o[this1.oPos + 1];
};
openfl_display__$internal_LineStyleView.get_caps = function(this1) {
	return this1.buffer.o[this1.oPos + 2];
};
openfl_display__$internal_LineStyleView.get_joints = function(this1) {
	return this1.buffer.o[this1.oPos + 3];
};
openfl_display__$internal_LineStyleView.get_miterLimit = function(this1) {
	return this1.buffer.f[this1.fPos + 1];
};
var openfl_display__$internal_LineToView = {};
openfl_display__$internal_LineToView.__properties__ = {get_y:"get_y",get_x:"get_x"};
openfl_display__$internal_LineToView._new = function(d) {
	var this1 = d;
	return this1;
};
openfl_display__$internal_LineToView.get_x = function(this1) {
	return this1.buffer.f[this1.fPos];
};
openfl_display__$internal_LineToView.get_y = function(this1) {
	return this1.buffer.f[this1.fPos + 1];
};
var openfl_display__$internal_MoveToView = {};
openfl_display__$internal_MoveToView.__properties__ = {get_y:"get_y",get_x:"get_x"};
openfl_display__$internal_MoveToView._new = function(d) {
	var this1 = d;
	return this1;
};
openfl_display__$internal_MoveToView.get_x = function(this1) {
	return this1.buffer.f[this1.fPos];
};
openfl_display__$internal_MoveToView.get_y = function(this1) {
	return this1.buffer.f[this1.fPos + 1];
};
var openfl_display__$internal_OverrideBlendModeView = {};
openfl_display__$internal_OverrideBlendModeView.__properties__ = {get_blendMode:"get_blendMode"};
openfl_display__$internal_OverrideBlendModeView._new = function(d) {
	var this1 = d;
	return this1;
};
openfl_display__$internal_OverrideBlendModeView.get_blendMode = function(this1) {
	return this1.buffer.o[this1.oPos];
};
var openfl_display__$internal_OverrideMatrixView = {};
openfl_display__$internal_OverrideMatrixView.__properties__ = {get_matrix:"get_matrix"};
openfl_display__$internal_OverrideMatrixView._new = function(d) {
	var this1 = d;
	return this1;
};
openfl_display__$internal_OverrideMatrixView.get_matrix = function(this1) {
	return this1.buffer.o[this1.oPos];
};
var openfl_display__$internal_WindingEvenOddView = {};
openfl_display__$internal_WindingEvenOddView._new = function(d) {
	var this1 = d;
	return this1;
};
var openfl_display__$internal_WindingNonZeroView = {};
openfl_display__$internal_WindingNonZeroView._new = function(d) {
	var this1 = d;
	return this1;
};
var openfl_display__$internal_DrawCommandType = $hxEnums["openfl.display._internal.DrawCommandType"] = { __ename__ : "openfl.display._internal.DrawCommandType", __constructs__ : ["BEGIN_BITMAP_FILL","BEGIN_FILL","BEGIN_GRADIENT_FILL","BEGIN_SHADER_FILL","CUBIC_CURVE_TO","CURVE_TO","DRAW_CIRCLE","DRAW_ELLIPSE","DRAW_QUADS","DRAW_RECT","DRAW_ROUND_RECT","DRAW_TILES","DRAW_TRIANGLES","END_FILL","LINE_BITMAP_STYLE","LINE_GRADIENT_STYLE","LINE_STYLE","LINE_TO","MOVE_TO","OVERRIDE_BLEND_MODE","OVERRIDE_MATRIX","WINDING_EVEN_ODD","WINDING_NON_ZERO","UNKNOWN"]
	,BEGIN_BITMAP_FILL: {_hx_index:0,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,BEGIN_FILL: {_hx_index:1,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,BEGIN_GRADIENT_FILL: {_hx_index:2,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,BEGIN_SHADER_FILL: {_hx_index:3,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,CUBIC_CURVE_TO: {_hx_index:4,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,CURVE_TO: {_hx_index:5,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,DRAW_CIRCLE: {_hx_index:6,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,DRAW_ELLIPSE: {_hx_index:7,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,DRAW_QUADS: {_hx_index:8,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,DRAW_RECT: {_hx_index:9,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,DRAW_ROUND_RECT: {_hx_index:10,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,DRAW_TILES: {_hx_index:11,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,DRAW_TRIANGLES: {_hx_index:12,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,END_FILL: {_hx_index:13,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,LINE_BITMAP_STYLE: {_hx_index:14,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,LINE_GRADIENT_STYLE: {_hx_index:15,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,LINE_STYLE: {_hx_index:16,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,LINE_TO: {_hx_index:17,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,MOVE_TO: {_hx_index:18,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,OVERRIDE_BLEND_MODE: {_hx_index:19,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,OVERRIDE_MATRIX: {_hx_index:20,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,WINDING_EVEN_ODD: {_hx_index:21,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,WINDING_NON_ZERO: {_hx_index:22,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,UNKNOWN: {_hx_index:23,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
};
var openfl_display__$internal_PerlinNoise = function(seed,octaves,channels,grayScale,falloff,stitch,stitch_threshold) {
	if(stitch_threshold == null) {
		stitch_threshold = 0.05;
	}
	if(stitch == null) {
		stitch = false;
	}
	openfl_display__$internal_AbstractNoise.call(this,seed,octaves,channels,grayScale,falloff,stitch,stitch_threshold);
	this.p_perm = [];
	var _g = 0;
	while(_g < 512) {
		var i = _g++;
		this.p_perm[i] = openfl_display__$internal_PerlinNoise.P[i & 255];
	}
	this.base_factor = 0.03125;
	this.setSeed(seed);
};
$hxClasses["openfl.display._internal.PerlinNoise"] = openfl_display__$internal_PerlinNoise;
openfl_display__$internal_PerlinNoise.__name__ = "openfl.display._internal.PerlinNoise";
openfl_display__$internal_PerlinNoise.__super__ = openfl_display__$internal_AbstractNoise;
openfl_display__$internal_PerlinNoise.prototype = $extend(openfl_display__$internal_AbstractNoise.prototype,{
	p_perm: null
	,x_offset: null
	,y_offset: null
	,z_offset: null
	,base_factor: null
	,fill: function(bitmap,_scale_x,_scale_y,_scale_z) {
		var width = bitmap.width;
		var height = bitmap.height;
		var octaves = this.octaves;
		var octaves_frequencies = this.octaves_frequencies;
		var octaves_persistences = this.octaves_persistences;
		var isRed = (1 & this.channels) == 1;
		var isGreen = (2 & this.channels) == 2;
		var isBlue = (4 & this.channels) == 4;
		var channels = 0;
		if(isRed) {
			++channels;
		}
		if(isGreen) {
			++channels;
		}
		if(isBlue) {
			++channels;
		}
		var grayscale = this.grayscale;
		var stitch_w = this.stitch_threshold * width | 0;
		var stitch_h = this.stitch_threshold * height | 0;
		var base_x = _scale_x * this.base_factor + this.x_offset;
		_scale_y = _scale_y * this.base_factor + this.y_offset;
		_scale_z = _scale_z * this.base_factor + this.z_offset;
		var g_offset = 1.0;
		var b_offset = 2.0;
		var _g = 0;
		var _g1 = height;
		while(_g < _g1) {
			var py = _g++;
			_scale_x = base_x;
			var _g2 = 0;
			var _g3 = width;
			while(_g2 < _g3) {
				var px = _g2++;
				var color1 = 0.0;
				var color2 = 0.0;
				var color3 = 0.0;
				var _g4 = 0;
				var _g5 = octaves;
				while(_g4 < _g5) {
					var i = _g4++;
					var frequency = octaves_frequencies[i];
					var persistence = octaves_persistences[i];
					color1 += this.noise(_scale_x * frequency,_scale_y * frequency,_scale_z * frequency) * persistence;
					if(!grayscale) {
						if(1 < channels) {
							color2 += this.noise((_scale_x + g_offset) * frequency,(_scale_y + g_offset) * frequency,_scale_z * frequency) * persistence;
						}
						if(2 < channels) {
							color3 += this.noise((_scale_x + b_offset) * frequency,(_scale_y + b_offset) * frequency,_scale_z * frequency) * persistence;
						}
					}
				}
				var color = 0;
				if(grayscale) {
					color = this.color(color1,color1,color1);
				} else if(isRed && isGreen && isBlue) {
					color = this.color(color1,color2,color3);
				} else if(isRed && isGreen) {
					color = this.color(color1,color2,null);
				} else if(isRed && isBlue) {
					color = this.color(color1,null,color2);
				} else if(isGreen && isBlue) {
					color = this.color(null,color1,color2);
				} else if(isRed) {
					color = this.color(color1,null,null);
				} else if(isGreen) {
					color = this.color(null,color1,null);
				} else if(isBlue) {
					color = this.color(null,null,color1);
				}
				if(this.stitch) {
					color = this.stitching(bitmap,color,px,py,stitch_w,stitch_h,width,height);
				}
				bitmap.setPixel32(px,py,color);
				_scale_x += this.base_factor;
			}
			_scale_y += this.base_factor;
		}
	}
	,noise: function(x,y,z) {
		var xf = x - x % 1;
		var yf = y - y % 1;
		var zf = z - z % 1;
		x -= xf;
		y -= yf;
		z -= zf;
		var X = (xf | 0) & 255;
		var Y = (yf | 0) & 255;
		var Z = (zf | 0) & 255;
		var u = this.fade(x);
		var v = this.fade(y);
		var w = this.fade(z);
		var A = this.p_perm[X] + Y;
		var AA = this.p_perm[A] + Z;
		var AB = this.p_perm[A + 1] + Z;
		var B = this.p_perm[X + 1] + Y;
		var BA = this.p_perm[B] + Z;
		var BB = this.p_perm[B + 1] + Z;
		var x1 = x - 1;
		var y1 = y - 1;
		var z1 = z - 1;
		var hash = this.p_perm[BB + 1] & 15;
		var g1 = ((hash & 1) == 0 ? hash < 8 ? x1 : y1 : hash < 8 ? -x1 : -y1) + ((hash & 2) == 0 ? hash < 4 ? y1 : hash == 12 ? x1 : z1 : hash < 4 ? -y1 : hash == 14 ? -x1 : -z1);
		hash = this.p_perm[AB + 1] & 15;
		var g2 = ((hash & 1) == 0 ? hash < 8 ? x : y1 : hash < 8 ? -x : -y1) + ((hash & 2) == 0 ? hash < 4 ? y1 : hash == 12 ? x : z1 : hash < 4 ? -y1 : hash == 14 ? -x : -z1);
		hash = this.p_perm[BA + 1] & 15;
		var g3 = ((hash & 1) == 0 ? hash < 8 ? x1 : y : hash < 8 ? -x1 : -y) + ((hash & 2) == 0 ? hash < 4 ? y : hash == 12 ? x1 : z1 : hash < 4 ? -y : hash == 14 ? -x1 : -z1);
		hash = this.p_perm[AA + 1] & 15;
		var g4 = ((hash & 1) == 0 ? hash < 8 ? x : y : hash < 8 ? -x : -y) + ((hash & 2) == 0 ? hash < 4 ? y : hash == 12 ? x : z1 : hash < 4 ? -y : hash == 14 ? -x : -z1);
		hash = this.p_perm[BB] & 15;
		var g5 = ((hash & 1) == 0 ? hash < 8 ? x1 : y1 : hash < 8 ? -x1 : -y1) + ((hash & 2) == 0 ? hash < 4 ? y1 : hash == 12 ? x1 : z : hash < 4 ? -y1 : hash == 14 ? -x1 : -z);
		hash = this.p_perm[AB] & 15;
		var g6 = ((hash & 1) == 0 ? hash < 8 ? x : y1 : hash < 8 ? -x : -y1) + ((hash & 2) == 0 ? hash < 4 ? y1 : hash == 12 ? x : z : hash < 4 ? -y1 : hash == 14 ? -x : -z);
		hash = this.p_perm[BA] & 15;
		var g7 = ((hash & 1) == 0 ? hash < 8 ? x1 : y : hash < 8 ? -x1 : -y) + ((hash & 2) == 0 ? hash < 4 ? y : hash == 12 ? x1 : z : hash < 4 ? -y : hash == 14 ? -x1 : -z);
		hash = this.p_perm[AA] & 15;
		var g8 = ((hash & 1) == 0 ? hash < 8 ? x : y : hash < 8 ? -x : -y) + ((hash & 2) == 0 ? hash < 4 ? y : hash == 12 ? x : z : hash < 4 ? -y : hash == 14 ? -x : -z);
		g2 += u * (g1 - g2);
		g4 += u * (g3 - g4);
		g6 += u * (g5 - g6);
		g8 += u * (g7 - g8);
		g4 += v * (g2 - g4);
		g8 += v * (g6 - g8);
		return g8 + w * (g4 - g8);
	}
	,setSeed: function(seed) {
		seed = seed * 16807.0 % 2147483647 | 0;
		this.x_offset = seed;
		seed = seed * 16807.0 % 2147483647 | 0;
		this.y_offset = seed;
		seed = seed * 16807.0 % 2147483647 | 0;
		this.z_offset = seed;
	}
	,__class__: openfl_display__$internal_PerlinNoise
});
var openfl_display__$internal_SamplerState = function(wrap,filter,mipfilter,lodBias,ignoreSampler,centroid,textureAlpha) {
	if(textureAlpha == null) {
		textureAlpha = false;
	}
	if(centroid == null) {
		centroid = false;
	}
	if(ignoreSampler == null) {
		ignoreSampler = false;
	}
	if(lodBias == null) {
		lodBias = 0.0;
	}
	if(mipfilter == null) {
		mipfilter = 2;
	}
	if(filter == null) {
		filter = 5;
	}
	if(wrap == null) {
		wrap = 0;
	}
	this.wrap = wrap;
	this.filter = filter;
	this.mipfilter = mipfilter;
	this.lodBias = lodBias;
	this.ignoreSampler = ignoreSampler;
	this.centroid = centroid;
	this.textureAlpha = textureAlpha;
};
$hxClasses["openfl.display._internal.SamplerState"] = openfl_display__$internal_SamplerState;
openfl_display__$internal_SamplerState.__name__ = "openfl.display._internal.SamplerState";
openfl_display__$internal_SamplerState.prototype = {
	centroid: null
	,filter: null
	,ignoreSampler: null
	,lodBias: null
	,mipfilter: null
	,mipmapGenerated: null
	,textureAlpha: null
	,wrap: null
	,clone: function() {
		var copy = new openfl_display__$internal_SamplerState(this.wrap,this.filter,this.mipfilter,this.lodBias,this.ignoreSampler,this.centroid,this.textureAlpha);
		copy.mipmapGenerated = this.mipmapGenerated;
		return copy;
	}
	,copyFrom: function(other) {
		if(other == null || other.ignoreSampler) {
			return;
		}
		this.wrap = other.wrap;
		this.filter = other.filter;
		this.mipfilter = other.mipfilter;
		this.lodBias = other.lodBias;
		this.centroid = other.centroid;
		this.textureAlpha = other.textureAlpha;
	}
	,equals: function(other) {
		if(other == null) {
			return false;
		}
		if(this.wrap == other.wrap && this.filter == other.filter && this.mipfilter == other.mipfilter && this.lodBias == other.lodBias) {
			return this.textureAlpha == other.textureAlpha;
		} else {
			return false;
		}
	}
	,__class__: openfl_display__$internal_SamplerState
};
var openfl_display__$internal_ShaderBuffer = function() {
	this.inputRefs = [];
	this.inputFilter = [];
	this.inputMipFilter = [];
	this.inputs = [];
	this.inputWrap = [];
	this.overrideIntNames = [];
	this.overrideIntValues = [];
	this.overrideFloatNames = [];
	this.overrideFloatValues = [];
	this.overrideBoolNames = [];
	this.overrideBoolValues = [];
	this.paramLengths = [];
	this.paramPositions = [];
	this.paramRefs_Bool = [];
	this.paramRefs_Float = [];
	this.paramRefs_Int = [];
	this.paramTypes = [];
};
$hxClasses["openfl.display._internal.ShaderBuffer"] = openfl_display__$internal_ShaderBuffer;
openfl_display__$internal_ShaderBuffer.__name__ = "openfl.display._internal.ShaderBuffer";
openfl_display__$internal_ShaderBuffer.prototype = {
	inputCount: null
	,inputRefs: null
	,inputFilter: null
	,inputMipFilter: null
	,inputs: null
	,inputWrap: null
	,overrideBoolCount: null
	,overrideBoolNames: null
	,overrideBoolValues: null
	,overrideFloatCount: null
	,overrideFloatNames: null
	,overrideFloatValues: null
	,overrideIntCount: null
	,overrideIntNames: null
	,overrideIntValues: null
	,paramBoolCount: null
	,paramCount: null
	,paramData: null
	,paramDataBuffer: null
	,paramDataLength: null
	,paramFloatCount: null
	,paramIntCount: null
	,paramLengths: null
	,paramPositions: null
	,paramRefs_Bool: null
	,paramRefs_Float: null
	,paramRefs_Int: null
	,paramTypes: null
	,shader: null
	,addBoolOverride: function(name,values) {
		this.overrideBoolNames[this.overrideBoolCount] = name;
		this.overrideBoolValues[this.overrideBoolCount] = values;
		this.overrideBoolCount++;
	}
	,addFloatOverride: function(name,values) {
		this.overrideFloatNames[this.overrideFloatCount] = name;
		this.overrideFloatValues[this.overrideFloatCount] = values;
		this.overrideFloatCount++;
	}
	,addIntOverride: function(name,values) {
		this.overrideIntNames[this.overrideIntCount] = name;
		this.overrideIntValues[this.overrideIntCount] = values;
		this.overrideIntCount++;
	}
	,clearOverride: function() {
		this.overrideIntCount = 0;
		this.overrideFloatCount = 0;
		this.overrideBoolCount = 0;
	}
	,update: function(shader) {
		this.inputCount = 0;
		this.overrideIntCount = 0;
		this.overrideFloatCount = 0;
		this.overrideBoolCount = 0;
		this.paramBoolCount = 0;
		this.paramCount = 0;
		this.paramDataLength = 0;
		this.paramFloatCount = 0;
		this.paramIntCount = 0;
		this.shader = null;
		if(shader == null) {
			return;
		}
		shader.__init();
		this.inputCount = shader.__inputBitmapData.length;
		var input;
		var _g = 0;
		var _g1 = this.inputCount;
		while(_g < _g1) {
			var i = _g++;
			input = shader.__inputBitmapData[i];
			this.inputs[i] = input.input;
			this.inputFilter[i] = input.filter;
			this.inputMipFilter[i] = input.mipFilter;
			this.inputRefs[i] = input;
			this.inputWrap[i] = input.wrap;
		}
		var boolCount = shader.__paramBool.length;
		var floatCount = shader.__paramFloat.length;
		var intCount = shader.__paramInt.length;
		this.paramCount = boolCount + floatCount + intCount;
		this.paramBoolCount = boolCount;
		this.paramFloatCount = floatCount;
		this.paramIntCount = intCount;
		var length = 0;
		var p = 0;
		var param;
		var _g = 0;
		var _g1 = boolCount;
		while(_g < _g1) {
			var i = _g++;
			param = shader.__paramBool[i];
			this.paramPositions[p] = this.paramDataLength;
			length = param.value != null ? param.value.length : 0;
			this.paramLengths[p] = length;
			this.paramDataLength += length;
			this.paramTypes[p] = 0;
			this.paramRefs_Bool[i] = param;
			++p;
		}
		var param;
		var _g = 0;
		var _g1 = floatCount;
		while(_g < _g1) {
			var i = _g++;
			param = shader.__paramFloat[i];
			this.paramPositions[p] = this.paramDataLength;
			length = param.value != null ? param.value.length : 0;
			this.paramLengths[p] = length;
			this.paramDataLength += length;
			this.paramTypes[p] = 1;
			this.paramRefs_Float[i] = param;
			++p;
		}
		var param;
		var _g = 0;
		var _g1 = intCount;
		while(_g < _g1) {
			var i = _g++;
			param = shader.__paramInt[i];
			this.paramPositions[p] = this.paramDataLength;
			length = param.value != null ? param.value.length : 0;
			this.paramLengths[p] = length;
			this.paramDataLength += length;
			this.paramTypes[p] = 2;
			this.paramRefs_Int[i] = param;
			++p;
		}
		if(this.paramDataLength > 0) {
			if(this.paramData == null) {
				var elements = this.paramDataLength;
				var array = null;
				var vector = null;
				var view = null;
				var buffer = null;
				var len = null;
				var this1;
				if(elements != null) {
					this1 = new Float32Array(elements);
				} else if(array != null) {
					this1 = new Float32Array(array);
				} else if(vector != null) {
					this1 = new Float32Array(vector.__array);
				} else if(view != null) {
					this1 = new Float32Array(view);
				} else if(buffer != null) {
					if(len == null) {
						this1 = new Float32Array(buffer,0);
					} else {
						this1 = new Float32Array(buffer,0,len);
					}
				} else {
					this1 = null;
				}
				this.paramData = this1;
			} else if(this.paramDataLength > this.paramData.length) {
				var elements = this.paramDataLength;
				var array = null;
				var vector = null;
				var view = null;
				var buffer = null;
				var len = null;
				var this1;
				if(elements != null) {
					this1 = new Float32Array(elements);
				} else if(array != null) {
					this1 = new Float32Array(array);
				} else if(vector != null) {
					this1 = new Float32Array(vector.__array);
				} else if(view != null) {
					this1 = new Float32Array(view);
				} else if(buffer != null) {
					if(len == null) {
						this1 = new Float32Array(buffer,0);
					} else {
						this1 = new Float32Array(buffer,0,len);
					}
				} else {
					this1 = null;
				}
				var data = this1;
				data.set(this.paramData);
				this.paramData = data;
			}
		}
		var boolIndex = 0;
		var floatIndex = 0;
		var intIndex = 0;
		var paramPosition = 0;
		var boolParam;
		var floatParam;
		var intParam;
		var length;
		var _g = 0;
		var _g1 = this.paramCount;
		while(_g < _g1) {
			var i = _g++;
			length = this.paramLengths[i];
			if(i < boolCount) {
				boolParam = this.paramRefs_Bool[boolIndex];
				++boolIndex;
				var _g2 = 0;
				var _g3 = length;
				while(_g2 < _g3) {
					var j = _g2++;
					this.paramData[paramPosition] = boolParam.value[j] ? 1 : 0;
					++paramPosition;
				}
			} else if(i < boolCount + floatCount) {
				floatParam = this.paramRefs_Float[floatIndex];
				++floatIndex;
				var _g4 = 0;
				var _g5 = length;
				while(_g4 < _g5) {
					var j1 = _g4++;
					this.paramData[paramPosition] = floatParam.value[j1];
					++paramPosition;
				}
			} else {
				intParam = this.paramRefs_Int[intIndex];
				++intIndex;
				var _g6 = 0;
				var _g7 = length;
				while(_g6 < _g7) {
					var j2 = _g6++;
					this.paramData[paramPosition] = intParam.value[j2];
					++paramPosition;
				}
			}
		}
		this.shader = shader;
	}
	,__class__: openfl_display__$internal_ShaderBuffer
};
var openfl_display3D_Context3D = function(stage,contextState,stage3D) {
	this.profile = 3;
	this.driverInfo = "OpenGL (Direct blitting)";
	this.backBufferWidth = 0;
	this.backBufferHeight = 0;
	openfl_events_EventDispatcher.call(this);
	this.__stage = stage;
	this.__contextState = contextState;
	this.__stage3D = stage3D;
	this.__context = stage.window.context;
	this.gl = this.__context.webgl;
	if(this.__contextState == null) {
		this.__contextState = new openfl_display3D__$internal_Context3DState();
	}
	this.__state = new openfl_display3D__$internal_Context3DState();
	var array = null;
	var vector = null;
	var view = null;
	var buffer = null;
	var len = null;
	var this1 = new Float32Array(512);
	this.__vertexConstants = this1;
	var array = null;
	var vector = null;
	var view = null;
	var buffer = null;
	var len = null;
	var this1 = new Float32Array(512);
	this.__fragmentConstants = this1;
	var elements = null;
	var array = [1.0,1.0,1.0,1.0];
	var vector = null;
	var view = null;
	var buffer = null;
	var len = null;
	var this1;
	if(elements != null) {
		this1 = new Float32Array(elements);
	} else if(array != null) {
		this1 = new Float32Array(array);
	} else if(vector != null) {
		this1 = new Float32Array(vector.__array);
	} else if(view != null) {
		this1 = new Float32Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Float32Array(buffer,0);
		} else {
			this1 = new Float32Array(buffer,0,len);
		}
	} else {
		this1 = null;
	}
	this.__positionScale = this1;
	this.__programs = new haxe_ds_StringMap();
	if(openfl_display3D_Context3D.__glMaxViewportDims == -1) {
		openfl_display3D_Context3D.__glMaxViewportDims = this.gl.getParameter(this.gl.MAX_VIEWPORT_DIMS);
	}
	this.maxBackBufferWidth = openfl_display3D_Context3D.__glMaxViewportDims;
	this.maxBackBufferHeight = openfl_display3D_Context3D.__glMaxViewportDims;
	if(openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy == -1) {
		var extension = this.gl.getExtension("EXT_texture_filter_anisotropic");
		if(extension == null || !Object.prototype.hasOwnProperty.call(extension,"MAX_TEXTURE_MAX_ANISOTROPY_EXT")) {
			extension = this.gl.getExtension("MOZ_EXT_texture_filter_anisotropic");
		}
		if(extension == null || !Object.prototype.hasOwnProperty.call(extension,"MAX_TEXTURE_MAX_ANISOTROPY_EXT")) {
			extension = this.gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
		}
		if(extension != null) {
			openfl_display3D_Context3D.__glTextureMaxAnisotropy = extension.TEXTURE_MAX_ANISOTROPY_EXT;
			openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy = this.gl.getParameter(extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT);
		} else {
			openfl_display3D_Context3D.__glTextureMaxAnisotropy = 0;
			openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy = 0;
		}
	}
	if(openfl_display3D_Context3D.__glDepthStencil == -1) {
		openfl_display3D_Context3D.__glDepthStencil = this.gl.DEPTH_STENCIL;
	}
	if(openfl_display3D_Context3D.__glMemoryTotalAvailable == -1) {
		var extension = this.gl.getExtension("NVX_gpu_memory_info");
		if(extension != null) {
			openfl_display3D_Context3D.__glMemoryTotalAvailable = extension.GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX;
			openfl_display3D_Context3D.__glMemoryCurrentAvailable = extension.GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX;
		}
	}
	if(openfl_display3D_Context3D.__driverInfo == null) {
		var vendor = this.gl.getParameter(this.gl.VENDOR);
		var version = this.gl.getParameter(this.gl.VERSION);
		var renderer = this.gl.getParameter(this.gl.RENDERER);
		var glslVersion = this.gl.getParameter(this.gl.SHADING_LANGUAGE_VERSION);
		openfl_display3D_Context3D.__driverInfo = "OpenGL Vendor=" + vendor + " Version=" + version + " Renderer=" + renderer + " GLSL=" + glslVersion;
	}
	this.driverInfo = openfl_display3D_Context3D.__driverInfo;
	this.__quadIndexBufferElements = 16383;
	this.__quadIndexBufferCount = this.__quadIndexBufferElements * 6;
	var elements = this.__quadIndexBufferCount;
	var array = null;
	var vector = null;
	var view = null;
	var buffer = null;
	var len = null;
	var this1;
	if(elements != null) {
		this1 = new Uint16Array(elements);
	} else if(array != null) {
		this1 = new Uint16Array(array);
	} else if(vector != null) {
		this1 = new Uint16Array(vector.__array);
	} else if(view != null) {
		this1 = new Uint16Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Uint16Array(buffer,0);
		} else {
			this1 = new Uint16Array(buffer,0,len);
		}
	} else {
		this1 = null;
	}
	var data = this1;
	var index = 0;
	var vertex = 0;
	var _g = 0;
	var _g1 = this.__quadIndexBufferElements;
	while(_g < _g1) {
		var i = _g++;
		data[index] = vertex;
		data[index + 1] = vertex + 1;
		data[index + 2] = vertex + 2;
		data[index + 3] = vertex + 2;
		data[index + 4] = vertex + 1;
		data[index + 5] = vertex + 3;
		index = index + 6;
		vertex = vertex + 4;
	}
	this.__quadIndexBuffer = this.createIndexBuffer(this.__quadIndexBufferCount);
	this.__quadIndexBuffer.uploadFromTypedArray(data);
};
$hxClasses["openfl.display3D.Context3D"] = openfl_display3D_Context3D;
openfl_display3D_Context3D.__name__ = "openfl.display3D.Context3D";
openfl_display3D_Context3D.__driverInfo = null;
openfl_display3D_Context3D.__super__ = openfl_events_EventDispatcher;
openfl_display3D_Context3D.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	backBufferHeight: null
	,backBufferWidth: null
	,driverInfo: null
	,maxBackBufferHeight: null
	,maxBackBufferWidth: null
	,profile: null
	,gl: null
	,__backBufferAntiAlias: null
	,__backBufferTexture: null
	,__backBufferWantsBestResolution: null
	,__backBufferWantsBestResolutionOnBrowserZoom: null
	,__cleared: null
	,__context: null
	,__contextState: null
	,__renderStage3DProgram: null
	,__enableErrorChecking: null
	,__fragmentConstants: null
	,__frontBufferTexture: null
	,__positionScale: null
	,__present: null
	,__programs: null
	,__quadIndexBuffer: null
	,__quadIndexBufferCount: null
	,__quadIndexBufferElements: null
	,__stage: null
	,__stage3D: null
	,__state: null
	,__vertexConstants: null
	,clear: function(red,green,blue,alpha,depth,stencil,mask) {
		if(mask == null) {
			mask = 7;
		}
		if(stencil == null) {
			stencil = 0;
		}
		if(depth == null) {
			depth = 1;
		}
		if(alpha == null) {
			alpha = 1;
		}
		if(blue == null) {
			blue = 0;
		}
		if(green == null) {
			green = 0;
		}
		if(red == null) {
			red = 0;
		}
		this.__flushGLFramebuffer();
		this.__flushGLViewport();
		var clearMask = 0;
		if((mask & 1) != 0) {
			if(this.__state.renderToTexture == null) {
				if(this.__stage.context3D == this && !this.__stage.__renderer.__cleared) {
					this.__stage.__renderer.__cleared = true;
				}
				this.__cleared = true;
			}
			clearMask |= this.gl.COLOR_BUFFER_BIT;
			if(this.__contextState.colorMaskRed != true || this.__contextState.colorMaskGreen != true || this.__contextState.colorMaskBlue != true || this.__contextState.colorMaskAlpha != true) {
				this.gl.colorMask(true,true,true,true);
				this.__contextState.colorMaskRed = true;
				this.__contextState.colorMaskGreen = true;
				this.__contextState.colorMaskBlue = true;
				this.__contextState.colorMaskAlpha = true;
			}
			this.gl.clearColor(red,green,blue,alpha);
		}
		if((mask & 2) != 0) {
			clearMask |= this.gl.DEPTH_BUFFER_BIT;
			if(this.__contextState.depthMask != true) {
				this.gl.depthMask(true);
				this.__contextState.depthMask = true;
			}
			this.gl.clearDepth(depth);
		}
		if((mask & 4) != 0) {
			clearMask |= this.gl.STENCIL_BUFFER_BIT;
			if(this.__contextState.stencilWriteMask != 255) {
				this.gl.stencilMask(255);
				this.__contextState.stencilWriteMask = 255;
			}
			this.gl.clearStencil(stencil);
			this.__contextState.stencilWriteMask = 255;
		}
		if(clearMask == 0) {
			return;
		}
		this.__setGLScissorTest(false);
		this.gl.clear(clearMask);
	}
	,configureBackBuffer: function(width,height,antiAlias,enableDepthAndStencil,wantsBestResolution,wantsBestResolutionOnBrowserZoom) {
		if(wantsBestResolutionOnBrowserZoom == null) {
			wantsBestResolutionOnBrowserZoom = false;
		}
		if(wantsBestResolution == null) {
			wantsBestResolution = false;
		}
		if(enableDepthAndStencil == null) {
			enableDepthAndStencil = true;
		}
		if(this.__stage3D == null) {
			this.backBufferWidth = width;
			this.backBufferHeight = height;
			this.__backBufferAntiAlias = antiAlias;
			this.__state.backBufferEnableDepthAndStencil = enableDepthAndStencil;
			this.__backBufferWantsBestResolution = wantsBestResolution;
			this.__backBufferWantsBestResolutionOnBrowserZoom = wantsBestResolutionOnBrowserZoom;
		} else {
			if(this.__backBufferTexture == null || this.backBufferWidth != width || this.backBufferHeight != height) {
				if(this.__backBufferTexture != null) {
					this.__backBufferTexture.dispose();
				}
				if(this.__frontBufferTexture != null) {
					this.__frontBufferTexture.dispose();
				}
				this.__backBufferTexture = this.createRectangleTexture(width,height,1,true);
				this.__frontBufferTexture = this.createRectangleTexture(width,height,1,true);
				if(this.__stage3D.__vertexBuffer == null) {
					this.__stage3D.__vertexBuffer = this.createVertexBuffer(4,5);
				}
				var vertexData = openfl_Vector.toFloatVector(null,null,null,[width,height,0,1,1,0,height,0,0,1,width,0,0,1,0,0,0,0,0,0.0]);
				this.__stage3D.__vertexBuffer.uploadFromVector(vertexData,0,20);
				if(this.__stage3D.__indexBuffer == null) {
					this.__stage3D.__indexBuffer = this.createIndexBuffer(6);
					var indexData = openfl_Vector.toIntVector(null,null,null,[0,1,2,2,1,3]);
					this.__stage3D.__indexBuffer.uploadFromVector(indexData,0,6);
				}
			}
			this.backBufferWidth = width;
			this.backBufferHeight = height;
			this.__backBufferAntiAlias = antiAlias;
			this.__state.backBufferEnableDepthAndStencil = enableDepthAndStencil;
			this.__backBufferWantsBestResolution = wantsBestResolution;
			this.__backBufferWantsBestResolutionOnBrowserZoom = wantsBestResolutionOnBrowserZoom;
			this.__state.__primaryGLFramebuffer = this.__backBufferTexture.__getGLFramebuffer(enableDepthAndStencil,antiAlias,0);
			this.__frontBufferTexture.__getGLFramebuffer(enableDepthAndStencil,antiAlias,0);
		}
	}
	,createCubeTexture: function(size,format,optimizeForRenderToTexture,streamingLevels) {
		if(streamingLevels == null) {
			streamingLevels = 0;
		}
		return new openfl_display3D_textures_CubeTexture(this,size,format,optimizeForRenderToTexture,streamingLevels);
	}
	,createIndexBuffer: function(numIndices,bufferUsage) {
		if(bufferUsage == null) {
			bufferUsage = 1;
		}
		return new openfl_display3D_IndexBuffer3D(this,numIndices,bufferUsage);
	}
	,createProgram: function(format) {
		if(format == null) {
			format = 0;
		}
		return new openfl_display3D_Program3D(this,format);
	}
	,createRectangleTexture: function(width,height,format,optimizeForRenderToTexture) {
		return new openfl_display3D_textures_RectangleTexture(this,width,height,openfl_display3D_Context3DTextureFormat.toString(format),optimizeForRenderToTexture);
	}
	,createTexture: function(width,height,format,optimizeForRenderToTexture,streamingLevels) {
		if(streamingLevels == null) {
			streamingLevels = 0;
		}
		return new openfl_display3D_textures_Texture(this,width,height,format,optimizeForRenderToTexture,streamingLevels);
	}
	,createVertexBuffer: function(numVertices,data32PerVertex,bufferUsage) {
		if(bufferUsage == null) {
			bufferUsage = 1;
		}
		return new openfl_display3D_VertexBuffer3D(this,numVertices,data32PerVertex,openfl_display3D_Context3DBufferUsage.toString(bufferUsage));
	}
	,createVideoTexture: function() {
		return new openfl_display3D_textures_VideoTexture(this);
	}
	,dispose: function(recreate) {
		if(recreate == null) {
			recreate = true;
		}
		this.gl = null;
		this.__dispose();
	}
	,drawToBitmapData: function(destination,srcRect,destPoint) {
		if(destination == null) {
			return;
		}
		var sourceRect = srcRect != null ? srcRect.__toLimeRectangle() : new lime_math_Rectangle(0,0,this.backBufferWidth,this.backBufferHeight);
		var destVector = destPoint != null ? destPoint.__toLimeVector2() : new lime_math_Vector2();
		if(this.__stage.context3D == this) {
			if(this.__stage.window != null) {
				if(this.__stage3D != null) {
					var xa = -this.__stage3D.get_x() | 0;
					var ya = -this.__stage3D.get_y() | 0;
					destVector.x = xa;
					destVector.y = ya;
				}
				var image = this.__stage.window.readPixels();
				destination.image.copyPixels(image,sourceRect,destVector);
			}
		} else if(this.__backBufferTexture != null) {
			var cacheRenderToTexture = this.__state.renderToTexture;
			this.setRenderToBackBuffer();
			this.__flushGLFramebuffer();
			this.__flushGLViewport();
			var elements = this.backBufferWidth * this.backBufferHeight * 4;
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1;
			if(elements != null) {
				this1 = new Uint8Array(elements);
			} else if(array != null) {
				this1 = new Uint8Array(array);
			} else if(vector != null) {
				this1 = new Uint8Array(vector.__array);
			} else if(view != null) {
				this1 = new Uint8Array(view);
			} else if(buffer != null) {
				if(len == null) {
					this1 = new Uint8Array(buffer,0);
				} else {
					this1 = new Uint8Array(buffer,0,len);
				}
			} else {
				this1 = null;
			}
			var data = this1;
			var this1 = this.gl;
			var width = this.backBufferWidth;
			var height = this.backBufferHeight;
			var format = this.__backBufferTexture.__format;
			var type = this.gl.UNSIGNED_BYTE;
			var pixels = data;
			var dstOffset = null;
			if(dstOffset != null) {
				this1.readPixels(0,0,width,height,format,type,pixels,dstOffset);
			} else {
				this1.readPixels(0,0,width,height,format,type,pixels);
			}
			var image = new lime_graphics_Image(new lime_graphics_ImageBuffer(data,this.backBufferWidth,this.backBufferHeight,32,2));
			destination.image.copyPixels(image,sourceRect,destVector);
			if(cacheRenderToTexture != null) {
				this.setRenderToTexture(cacheRenderToTexture,this.__state.renderToTextureDepthStencil,this.__state.renderToTextureAntiAlias,this.__state.renderToTextureSurfaceSelector);
			}
		}
	}
	,drawTriangles: function(indexBuffer,firstIndex,numTriangles) {
		if(numTriangles == null) {
			numTriangles = -1;
		}
		if(firstIndex == null) {
			firstIndex = 0;
		}
		if(this.__state.renderToTexture == null) {
			if(this.__stage.context3D == this && !this.__stage.__renderer.__cleared) {
				this.__stage.__renderer.__clear();
			} else if(!this.__cleared) {
				this.clear(0,0,0,0,1,0,1);
			}
		}
		this.__flushGL();
		if(this.__state.program != null) {
			this.__state.program.__flush();
		}
		var count = numTriangles == -1 ? indexBuffer.__numIndices : numTriangles * 3;
		this.__bindGLElementArrayBuffer(indexBuffer.__id);
		this.gl.drawElements(this.gl.TRIANGLES,count,this.gl.UNSIGNED_SHORT,firstIndex * 2);
	}
	,present: function() {
		this.setRenderToBackBuffer();
		if(this.__stage3D != null && this.__backBufferTexture != null) {
			if(!this.__cleared) {
				this.clear(0,0,0,0,1,0,1);
			}
			var cacheBuffer = this.__backBufferTexture;
			this.__backBufferTexture = this.__frontBufferTexture;
			this.__frontBufferTexture = cacheBuffer;
			this.__state.__primaryGLFramebuffer = this.__backBufferTexture.__getGLFramebuffer(this.__state.backBufferEnableDepthAndStencil,this.__backBufferAntiAlias,0);
			this.__cleared = false;
		}
		this.__present = true;
	}
	,setBlendFactors: function(sourceFactor,destinationFactor) {
		this.setBlendFactorsSeparate(sourceFactor,destinationFactor,sourceFactor,destinationFactor);
	}
	,setBlendFactorsSeparate: function(sourceRGBFactor,destinationRGBFactor,sourceAlphaFactor,destinationAlphaFactor) {
		this.__state.blendSourceRGBFactor = sourceRGBFactor;
		this.__state.blendDestinationRGBFactor = destinationRGBFactor;
		this.__state.blendSourceAlphaFactor = sourceAlphaFactor;
		this.__state.blendDestinationAlphaFactor = destinationAlphaFactor;
		this.__setGLBlendEquation(this.gl.FUNC_ADD);
	}
	,setColorMask: function(red,green,blue,alpha) {
		this.__state.colorMaskRed = red;
		this.__state.colorMaskGreen = green;
		this.__state.colorMaskBlue = blue;
		this.__state.colorMaskAlpha = alpha;
	}
	,setCulling: function(triangleFaceToCull) {
		this.__state.culling = triangleFaceToCull;
	}
	,setDepthTest: function(depthMask,passCompareMode) {
		this.__state.depthMask = depthMask;
		this.__state.depthCompareMode = passCompareMode;
	}
	,setProgram: function(program) {
		this.__state.program = program;
		this.__state.shader = null;
		if(program != null) {
			var _g = 0;
			var _g1 = program.__samplerStates.length;
			while(_g < _g1) {
				var i = _g++;
				if(this.__state.samplerStates[i] == null) {
					this.__state.samplerStates[i] = program.__samplerStates[i].clone();
				} else {
					this.__state.samplerStates[i].copyFrom(program.__samplerStates[i]);
				}
			}
		}
	}
	,setProgramConstantsFromByteArray: function(programType,firstRegister,numRegisters,data,byteArrayOffset) {
		if(numRegisters == 0 || this.__state.program == null) {
			return;
		}
		if(!(this.__state.program != null && this.__state.program.__format == 1)) {
			if(numRegisters == -1) {
				numRegisters = (openfl_utils_ByteArray.get_length(data) >>> 2) - byteArrayOffset;
			}
			var isVertex = programType == 1;
			var dest = isVertex ? this.__vertexConstants : this.__fragmentConstants;
			var bytes = openfl_utils_ByteArray.toBytes(data);
			var byteOffset = 0;
			var len = openfl_utils_ByteArray.get_length(data);
			if(byteOffset == null) {
				byteOffset = 0;
			}
			var floatData = byteOffset == null ? new Float32Array(bytes.b.bufferValue) : len == null ? new Float32Array(bytes.b.bufferValue,byteOffset) : new Float32Array(bytes.b.bufferValue,byteOffset,len);
			var outOffset = firstRegister * 4;
			var inOffset = UInt.toFloat(byteArrayOffset) / UInt.toFloat(4) | 0;
			var _g = 0;
			var _g1 = numRegisters * 4;
			while(_g < _g1) {
				var i = _g++;
				dest[outOffset + i] = floatData[inOffset + i];
			}
			if(this.__state.program != null) {
				this.__state.program.__markDirty(isVertex,firstRegister,numRegisters);
			}
		}
	}
	,setProgramConstantsFromMatrix: function(programType,firstRegister,matrix,transposedMatrix) {
		if(transposedMatrix == null) {
			transposedMatrix = false;
		}
		if(this.__state.program != null && this.__state.program.__format == 1) {
			this.__flushGLProgram();
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1 = new Float32Array(16);
			var data = this1;
			data[0] = matrix.rawData.get(0);
			data[1] = matrix.rawData.get(1);
			data[2] = matrix.rawData.get(2);
			data[3] = matrix.rawData.get(3);
			data[4] = matrix.rawData.get(4);
			data[5] = matrix.rawData.get(5);
			data[6] = matrix.rawData.get(6);
			data[7] = matrix.rawData.get(7);
			data[8] = matrix.rawData.get(8);
			data[9] = matrix.rawData.get(9);
			data[10] = matrix.rawData.get(10);
			data[11] = matrix.rawData.get(11);
			data[12] = matrix.rawData.get(12);
			data[13] = matrix.rawData.get(13);
			data[14] = matrix.rawData.get(14);
			data[15] = matrix.rawData.get(15);
			lime_graphics_WebGLRenderContext.uniformMatrix4fv(this.gl,firstRegister,transposedMatrix,data);
		} else {
			var isVertex = programType == 1;
			var dest = isVertex ? this.__vertexConstants : this.__fragmentConstants;
			var source = matrix.rawData;
			var i = firstRegister * 4;
			if(transposedMatrix) {
				dest[i++] = source.get(0);
				dest[i++] = source.get(4);
				dest[i++] = source.get(8);
				dest[i++] = source.get(12);
				dest[i++] = source.get(1);
				dest[i++] = source.get(5);
				dest[i++] = source.get(9);
				dest[i++] = source.get(13);
				dest[i++] = source.get(2);
				dest[i++] = source.get(6);
				dest[i++] = source.get(10);
				dest[i++] = source.get(14);
				dest[i++] = source.get(3);
				dest[i++] = source.get(7);
				dest[i++] = source.get(11);
				dest[i++] = source.get(15);
			} else {
				dest[i++] = source.get(0);
				dest[i++] = source.get(1);
				dest[i++] = source.get(2);
				dest[i++] = source.get(3);
				dest[i++] = source.get(4);
				dest[i++] = source.get(5);
				dest[i++] = source.get(6);
				dest[i++] = source.get(7);
				dest[i++] = source.get(8);
				dest[i++] = source.get(9);
				dest[i++] = source.get(10);
				dest[i++] = source.get(11);
				dest[i++] = source.get(12);
				dest[i++] = source.get(13);
				dest[i++] = source.get(14);
				dest[i++] = source.get(15);
			}
			if(this.__state.program != null) {
				this.__state.program.__markDirty(isVertex,firstRegister,4);
			}
		}
	}
	,setProgramConstantsFromVector: function(programType,firstRegister,data,numRegisters) {
		if(numRegisters == null) {
			numRegisters = -1;
		}
		if(numRegisters == 0) {
			return;
		}
		if(!(this.__state.program != null && this.__state.program.__format == 1)) {
			if(numRegisters == -1) {
				numRegisters = data.get_length() >> 2;
			}
			var isVertex = programType == 1;
			var dest = isVertex ? this.__vertexConstants : this.__fragmentConstants;
			var source = data;
			var sourceIndex = 0;
			var destIndex = firstRegister * 4;
			var _g = 0;
			var _g1 = numRegisters;
			while(_g < _g1) {
				var i = _g++;
				dest[destIndex++] = source.get(sourceIndex++);
				dest[destIndex++] = source.get(sourceIndex++);
				dest[destIndex++] = source.get(sourceIndex++);
				dest[destIndex++] = source.get(sourceIndex++);
			}
			if(this.__state.program != null) {
				this.__state.program.__markDirty(isVertex,firstRegister,numRegisters);
			}
		}
	}
	,setRenderToBackBuffer: function() {
		this.__state.renderToTexture = null;
	}
	,setRenderToTexture: function(texture,enableDepthAndStencil,antiAlias,surfaceSelector) {
		if(surfaceSelector == null) {
			surfaceSelector = 0;
		}
		if(antiAlias == null) {
			antiAlias = 0;
		}
		if(enableDepthAndStencil == null) {
			enableDepthAndStencil = false;
		}
		this.__state.renderToTexture = texture;
		this.__state.renderToTextureDepthStencil = enableDepthAndStencil;
		this.__state.renderToTextureAntiAlias = antiAlias;
		this.__state.renderToTextureSurfaceSelector = surfaceSelector;
	}
	,setSamplerStateAt: function(sampler,wrap,filter,mipfilter) {
		if(this.__state.samplerStates[sampler] == null) {
			this.__state.samplerStates[sampler] = new openfl_display__$internal_SamplerState();
		}
		var state = this.__state.samplerStates[sampler];
		state.wrap = wrap;
		state.filter = filter;
		state.mipfilter = mipfilter;
	}
	,setScissorRectangle: function(rectangle) {
		if(rectangle != null) {
			this.__state.scissorEnabled = true;
			this.__state.scissorRectangle.copyFrom(rectangle);
		} else {
			this.__state.scissorEnabled = false;
		}
	}
	,setStencilActions: function(triangleFace,compareMode,actionOnBothPass,actionOnDepthFail,actionOnDepthPassStencilFail) {
		if(actionOnDepthPassStencilFail == null) {
			actionOnDepthPassStencilFail = 5;
		}
		if(actionOnDepthFail == null) {
			actionOnDepthFail = 5;
		}
		if(actionOnBothPass == null) {
			actionOnBothPass = 5;
		}
		if(compareMode == null) {
			compareMode = 0;
		}
		if(triangleFace == null) {
			triangleFace = 2;
		}
		this.__state.stencilTriangleFace = triangleFace;
		this.__state.stencilCompareMode = compareMode;
		this.__state.stencilPass = actionOnBothPass;
		this.__state.stencilDepthFail = actionOnDepthFail;
		this.__state.stencilFail = actionOnDepthPassStencilFail;
	}
	,setStencilReferenceValue: function(referenceValue,readMask,writeMask) {
		if(writeMask == null) {
			writeMask = 255;
		}
		if(readMask == null) {
			readMask = 255;
		}
		this.__state.stencilReferenceValue = referenceValue;
		this.__state.stencilReadMask = readMask;
		this.__state.stencilWriteMask = writeMask;
	}
	,setTextureAt: function(sampler,texture) {
		this.__state.textures[sampler] = texture;
	}
	,setVertexBufferAt: function(index,buffer,bufferOffset,format) {
		if(format == null) {
			format = 4;
		}
		if(bufferOffset == null) {
			bufferOffset = 0;
		}
		if(buffer == null) {
			this.gl.disableVertexAttribArray(index);
			this.__bindGLArrayBuffer(null);
			return;
		}
		this.__bindGLArrayBuffer(buffer.__id);
		this.gl.enableVertexAttribArray(index);
		var byteOffset = bufferOffset * 4;
		switch(format) {
		case 0:
			this.gl.vertexAttribPointer(index,4,this.gl.UNSIGNED_BYTE,true,buffer.__stride,byteOffset);
			break;
		case 1:
			this.gl.vertexAttribPointer(index,1,this.gl.FLOAT,false,buffer.__stride,byteOffset);
			break;
		case 2:
			this.gl.vertexAttribPointer(index,2,this.gl.FLOAT,false,buffer.__stride,byteOffset);
			break;
		case 3:
			this.gl.vertexAttribPointer(index,3,this.gl.FLOAT,false,buffer.__stride,byteOffset);
			break;
		case 4:
			this.gl.vertexAttribPointer(index,4,this.gl.FLOAT,false,buffer.__stride,byteOffset);
			break;
		default:
			throw haxe_Exception.thrown(new openfl_errors_IllegalOperationError());
		}
	}
	,__bindGLArrayBuffer: function(buffer) {
		if(this.__contextState.__currentGLArrayBuffer != buffer) {
			this.gl.bindBuffer(this.gl.ARRAY_BUFFER,buffer);
			this.__contextState.__currentGLArrayBuffer = buffer;
		}
	}
	,__bindGLElementArrayBuffer: function(buffer) {
		if(this.__contextState.__currentGLElementArrayBuffer != buffer) {
			this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,buffer);
			this.__contextState.__currentGLElementArrayBuffer = buffer;
		}
	}
	,__bindGLFramebuffer: function(framebuffer) {
		if(this.__contextState.__currentGLFramebuffer != framebuffer) {
			this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,framebuffer);
			this.__contextState.__currentGLFramebuffer = framebuffer;
		}
	}
	,__bindGLTexture2D: function(texture) {
		this.gl.bindTexture(this.gl.TEXTURE_2D,texture);
		this.__contextState.__currentGLTexture2D = texture;
	}
	,__bindGLTextureCubeMap: function(texture) {
		this.gl.bindTexture(this.gl.TEXTURE_CUBE_MAP,texture);
		this.__contextState.__currentGLTextureCubeMap = texture;
	}
	,__dispose: function() {
		this.driverInfo += " (Disposed)";
		if(this.__stage3D != null) {
			this.__stage3D.__indexBuffer = null;
			this.__stage3D.__vertexBuffer = null;
			this.__stage3D.context3D = null;
			this.__stage3D = null;
		}
		this.__backBufferTexture = null;
		this.__context = null;
		this.__renderStage3DProgram = null;
		this.__fragmentConstants = null;
		this.__frontBufferTexture = null;
		this.__positionScale = null;
		this.__present = false;
		this.__quadIndexBuffer = null;
		this.__stage = null;
		this.__vertexConstants = null;
	}
	,__drawTriangles: function(firstIndex,count) {
		if(firstIndex == null) {
			firstIndex = 0;
		}
		if(this.__state.renderToTexture == null) {
			if(this.__stage.context3D == this && !this.__stage.__renderer.__cleared) {
				this.__stage.__renderer.__clear();
			} else if(!this.__cleared) {
				this.clear(0,0,0,0,1,0,1);
			}
		}
		this.__flushGL();
		if(this.__state.program != null) {
			this.__state.program.__flush();
		}
		this.gl.drawArrays(this.gl.TRIANGLES,firstIndex,count);
	}
	,__flushGL: function() {
		this.__flushGLProgram();
		this.__flushGLFramebuffer();
		this.__flushGLViewport();
		this.__flushGLBlend();
		if(this.__contextState.colorMaskRed != this.__state.colorMaskRed || this.__contextState.colorMaskGreen != this.__state.colorMaskGreen || this.__contextState.colorMaskBlue != this.__state.colorMaskBlue || this.__contextState.colorMaskAlpha != this.__state.colorMaskAlpha) {
			this.gl.colorMask(this.__state.colorMaskRed,this.__state.colorMaskGreen,this.__state.colorMaskBlue,this.__state.colorMaskAlpha);
			this.__contextState.colorMaskRed = this.__state.colorMaskRed;
			this.__contextState.colorMaskGreen = this.__state.colorMaskGreen;
			this.__contextState.colorMaskBlue = this.__state.colorMaskBlue;
			this.__contextState.colorMaskAlpha = this.__state.colorMaskAlpha;
		}
		this.__flushGLCulling();
		this.__flushGLDepth();
		this.__flushGLScissor();
		this.__flushGLStencil();
		this.__flushGLTextures();
	}
	,__flushGLBlend: function() {
		if(this.__contextState.blendDestinationRGBFactor != this.__state.blendDestinationRGBFactor || this.__contextState.blendSourceRGBFactor != this.__state.blendSourceRGBFactor || this.__contextState.blendDestinationAlphaFactor != this.__state.blendDestinationAlphaFactor || this.__contextState.blendSourceAlphaFactor != this.__state.blendSourceAlphaFactor) {
			this.__setGLBlend(true);
			if(this.__state.blendDestinationRGBFactor == this.__state.blendDestinationAlphaFactor && this.__state.blendSourceRGBFactor == this.__state.blendSourceAlphaFactor) {
				this.gl.blendFunc(this.__getGLBlend(this.__state.blendSourceRGBFactor),this.__getGLBlend(this.__state.blendDestinationRGBFactor));
			} else {
				this.gl.blendFuncSeparate(this.__getGLBlend(this.__state.blendSourceRGBFactor),this.__getGLBlend(this.__state.blendDestinationRGBFactor),this.__getGLBlend(this.__state.blendSourceAlphaFactor),this.__getGLBlend(this.__state.blendDestinationAlphaFactor));
			}
			this.__contextState.blendDestinationRGBFactor = this.__state.blendDestinationRGBFactor;
			this.__contextState.blendSourceRGBFactor = this.__state.blendSourceRGBFactor;
			this.__contextState.blendDestinationAlphaFactor = this.__state.blendDestinationAlphaFactor;
			this.__contextState.blendSourceAlphaFactor = this.__state.blendSourceAlphaFactor;
		}
	}
	,__flushGLColor: function() {
		if(this.__contextState.colorMaskRed != this.__state.colorMaskRed || this.__contextState.colorMaskGreen != this.__state.colorMaskGreen || this.__contextState.colorMaskBlue != this.__state.colorMaskBlue || this.__contextState.colorMaskAlpha != this.__state.colorMaskAlpha) {
			this.gl.colorMask(this.__state.colorMaskRed,this.__state.colorMaskGreen,this.__state.colorMaskBlue,this.__state.colorMaskAlpha);
			this.__contextState.colorMaskRed = this.__state.colorMaskRed;
			this.__contextState.colorMaskGreen = this.__state.colorMaskGreen;
			this.__contextState.colorMaskBlue = this.__state.colorMaskBlue;
			this.__contextState.colorMaskAlpha = this.__state.colorMaskAlpha;
		}
	}
	,__flushGLCulling: function() {
		if(this.__contextState.culling != this.__state.culling) {
			if(this.__state.culling == 3) {
				this.__setGLCullFace(false);
			} else {
				this.__setGLCullFace(true);
				switch(this.__state.culling) {
				case 0:
					this.gl.cullFace(this.gl.BACK);
					break;
				case 1:
					this.gl.cullFace(this.gl.FRONT);
					break;
				case 2:
					this.gl.cullFace(this.gl.FRONT_AND_BACK);
					break;
				case 3:
					break;
				default:
					throw haxe_Exception.thrown(new openfl_errors_IllegalOperationError());
				}
			}
			this.__contextState.culling = this.__state.culling;
		}
	}
	,__flushGLDepth: function() {
		var depthMask = this.__state.depthMask && (this.__state.renderToTexture != null ? this.__state.renderToTextureDepthStencil : this.__state.backBufferEnableDepthAndStencil);
		if(this.__contextState.depthMask != depthMask) {
			this.gl.depthMask(depthMask);
			this.__contextState.depthMask = depthMask;
		}
		if(this.__contextState.depthCompareMode != this.__state.depthCompareMode) {
			switch(this.__state.depthCompareMode) {
			case 0:
				this.gl.depthFunc(this.gl.ALWAYS);
				break;
			case 1:
				this.gl.depthFunc(this.gl.EQUAL);
				break;
			case 2:
				this.gl.depthFunc(this.gl.GREATER);
				break;
			case 3:
				this.gl.depthFunc(this.gl.GEQUAL);
				break;
			case 4:
				this.gl.depthFunc(this.gl.LESS);
				break;
			case 5:
				this.gl.depthFunc(this.gl.LEQUAL);
				break;
			case 6:
				this.gl.depthFunc(this.gl.NEVER);
				break;
			case 7:
				this.gl.depthFunc(this.gl.NOTEQUAL);
				break;
			default:
				throw haxe_Exception.thrown(new openfl_errors_IllegalOperationError());
			}
			this.__contextState.depthCompareMode = this.__state.depthCompareMode;
		}
	}
	,__flushGLFramebuffer: function() {
		if(this.__state.renderToTexture != null) {
			if(this.__contextState.renderToTexture != this.__state.renderToTexture || this.__contextState.renderToTextureSurfaceSelector != this.__state.renderToTextureSurfaceSelector) {
				var framebuffer = this.__state.renderToTexture.__getGLFramebuffer(this.__state.renderToTextureDepthStencil,this.__state.renderToTextureAntiAlias,this.__state.renderToTextureSurfaceSelector);
				this.__bindGLFramebuffer(framebuffer);
				this.__contextState.renderToTexture = this.__state.renderToTexture;
				this.__contextState.renderToTextureAntiAlias = this.__state.renderToTextureAntiAlias;
				this.__contextState.renderToTextureDepthStencil = this.__state.renderToTextureDepthStencil;
				this.__contextState.renderToTextureSurfaceSelector = this.__state.renderToTextureSurfaceSelector;
			}
			this.__setGLDepthTest(this.__state.renderToTextureDepthStencil);
			this.__setGLStencilTest(this.__state.renderToTextureDepthStencil);
			this.__setGLFrontFace(true);
		} else {
			if(this.__stage == null && this.backBufferWidth == 0 && this.backBufferHeight == 0) {
				throw haxe_Exception.thrown(new openfl_errors_Error("Context3D backbuffer has not been configured"));
			}
			if(this.__contextState.renderToTexture != null || this.__contextState.__currentGLFramebuffer != this.__state.__primaryGLFramebuffer || this.__contextState.backBufferEnableDepthAndStencil != this.__state.backBufferEnableDepthAndStencil) {
				this.__bindGLFramebuffer(this.__state.__primaryGLFramebuffer);
				this.__contextState.renderToTexture = null;
				this.__contextState.backBufferEnableDepthAndStencil = this.__state.backBufferEnableDepthAndStencil;
			}
			this.__setGLDepthTest(this.__state.backBufferEnableDepthAndStencil);
			this.__setGLStencilTest(this.__state.backBufferEnableDepthAndStencil);
			this.__setGLFrontFace(this.__stage.context3D != this);
		}
	}
	,__flushGLProgram: function() {
		var shader = this.__state.shader;
		var program = this.__state.program;
		if(this.__contextState.shader != shader) {
			if(this.__contextState.shader != null) {
				this.__contextState.shader.__disable();
			}
			if(shader != null) {
				shader.__enable();
			}
			this.__contextState.shader = shader;
		}
		if(this.__contextState.program != program) {
			if(this.__contextState.program != null) {
				this.__contextState.program.__disable();
			}
			if(program != null) {
				program.__enable();
			}
			this.__contextState.program = program;
		}
		if(program != null && program.__format == 0) {
			this.__positionScale[1] = this.__stage.context3D == this && this.__state.renderToTexture == null ? 1.0 : -1.0;
			program.__setPositionScale(this.__positionScale);
		}
	}
	,__flushGLScissor: function() {
		if(!this.__state.scissorEnabled) {
			if(this.__contextState.scissorEnabled != this.__state.scissorEnabled) {
				this.__setGLScissorTest(false);
				this.__contextState.scissorEnabled = false;
			}
		} else {
			this.__setGLScissorTest(true);
			this.__contextState.scissorEnabled = true;
			var scissorX = this.__state.scissorRectangle.x | 0;
			var scissorY = this.__state.scissorRectangle.y | 0;
			var scissorWidth = this.__state.scissorRectangle.width | 0;
			var scissorHeight = this.__state.scissorRectangle.height | 0;
			if(this.__state.renderToTexture == null && this.__stage3D == null) {
				var contextHeight = this.__stage.window.__height * this.__stage.window.__scale | 0;
				scissorY = contextHeight - (this.__state.scissorRectangle.height | 0) - scissorY;
			}
			if(this.__contextState.scissorRectangle.x != scissorX || this.__contextState.scissorRectangle.y != scissorY || this.__contextState.scissorRectangle.width != scissorWidth || this.__contextState.scissorRectangle.height != scissorHeight) {
				this.gl.scissor(scissorX,scissorY,scissorWidth,scissorHeight);
				this.__contextState.scissorRectangle.setTo(scissorX,scissorY,scissorWidth,scissorHeight);
			}
		}
	}
	,__flushGLStencil: function() {
		if(this.__contextState.stencilTriangleFace != this.__state.stencilTriangleFace || this.__contextState.stencilPass != this.__state.stencilPass || this.__contextState.stencilDepthFail != this.__state.stencilDepthFail || this.__contextState.stencilFail != this.__state.stencilFail) {
			this.gl.stencilOpSeparate(this.__getGLTriangleFace(this.__state.stencilTriangleFace),this.__getGLStencilAction(this.__state.stencilFail),this.__getGLStencilAction(this.__state.stencilDepthFail),this.__getGLStencilAction(this.__state.stencilPass));
			this.__contextState.stencilTriangleFace = this.__state.stencilTriangleFace;
			this.__contextState.stencilPass = this.__state.stencilPass;
			this.__contextState.stencilDepthFail = this.__state.stencilDepthFail;
			this.__contextState.stencilFail = this.__state.stencilFail;
		}
		if(this.__contextState.stencilWriteMask != this.__state.stencilWriteMask) {
			this.gl.stencilMask(this.__state.stencilWriteMask);
			this.__contextState.stencilWriteMask = this.__state.stencilWriteMask;
		}
		if(this.__contextState.stencilCompareMode != this.__state.stencilCompareMode || this.__contextState.stencilReferenceValue != this.__state.stencilReferenceValue || this.__contextState.stencilReadMask != this.__state.stencilReadMask) {
			this.gl.stencilFunc(this.__getGLCompareMode(this.__state.stencilCompareMode),this.__state.stencilReferenceValue,this.__state.stencilReadMask);
			this.__contextState.stencilCompareMode = this.__state.stencilCompareMode;
			this.__contextState.stencilReferenceValue = this.__state.stencilReferenceValue;
			this.__contextState.stencilReadMask = this.__state.stencilReadMask;
		}
	}
	,__flushGLTextures: function() {
		var sampler = 0;
		var texture;
		var samplerState;
		var _g = 0;
		var _g1 = this.__state.textures.length;
		while(_g < _g1) {
			var i = _g++;
			texture = this.__state.textures[i];
			samplerState = this.__state.samplerStates[i];
			if(samplerState == null) {
				this.__state.samplerStates[i] = new openfl_display__$internal_SamplerState();
				samplerState = this.__state.samplerStates[i];
			}
			this.gl.activeTexture(this.gl.TEXTURE0 + sampler);
			if(texture != null) {
				if(texture.__textureTarget == this.gl.TEXTURE_2D) {
					this.__bindGLTexture2D(texture.__getTexture());
				} else {
					this.__bindGLTextureCubeMap(texture.__getTexture());
				}
				this.__contextState.textures[i] = texture;
				texture.__setSamplerState(samplerState);
			} else {
				this.__bindGLTexture2D(null);
			}
			if(this.__state.program != null && this.__state.program.__format == 0 && samplerState.textureAlpha) {
				this.gl.activeTexture(this.gl.TEXTURE0 + sampler + 4);
				if(texture != null && texture.__alphaTexture != null) {
					if(texture.__alphaTexture.__textureTarget == this.gl.TEXTURE_2D) {
						this.__bindGLTexture2D(texture.__alphaTexture.__getTexture());
					} else {
						this.__bindGLTextureCubeMap(texture.__alphaTexture.__getTexture());
					}
					texture.__alphaTexture.__setSamplerState(samplerState);
					this.gl.uniform1i(this.__state.program.__agalAlphaSamplerEnabled[sampler].location,1);
				} else {
					this.__bindGLTexture2D(null);
					if(this.__state.program.__agalAlphaSamplerEnabled[sampler] != null) {
						this.gl.uniform1i(this.__state.program.__agalAlphaSamplerEnabled[sampler].location,0);
					}
				}
			}
			++sampler;
		}
	}
	,__flushGLViewport: function() {
		if(this.__state.renderToTexture == null) {
			if(this.__stage.context3D == this) {
				var x = this.__stage3D == null ? 0 : this.__stage3D.get_x() | 0;
				var y = this.__stage.window.__height * this.__stage.window.__scale - this.backBufferHeight - (this.__stage3D == null ? 0 : this.__stage3D.get_y()) | 0;
				this.gl.viewport(x,y,this.backBufferWidth,this.backBufferHeight);
			} else {
				this.gl.viewport(0,0,this.backBufferWidth,this.backBufferHeight);
			}
		} else {
			var width = 0;
			var height = 0;
			if(((this.__state.renderToTexture) instanceof openfl_display3D_textures_Texture)) {
				var texture2D = this.__state.renderToTexture;
				width = texture2D.__width;
				height = texture2D.__height;
			} else if(((this.__state.renderToTexture) instanceof openfl_display3D_textures_RectangleTexture)) {
				var rectTexture = this.__state.renderToTexture;
				width = rectTexture.__width;
				height = rectTexture.__height;
			} else if(((this.__state.renderToTexture) instanceof openfl_display3D_textures_CubeTexture)) {
				var cubeTexture = this.__state.renderToTexture;
				width = cubeTexture.__size;
				height = cubeTexture.__size;
			}
			this.gl.viewport(0,0,width,height);
		}
	}
	,__getGLBlend: function(blendFactor) {
		switch(blendFactor) {
		case 0:
			return this.gl.DST_ALPHA;
		case 1:
			return this.gl.DST_COLOR;
		case 2:
			return this.gl.ONE;
		case 3:
			return this.gl.ONE_MINUS_DST_ALPHA;
		case 4:
			return this.gl.ONE_MINUS_DST_COLOR;
		case 5:
			return this.gl.ONE_MINUS_SRC_ALPHA;
		case 6:
			return this.gl.ONE_MINUS_SRC_COLOR;
		case 7:
			return this.gl.SRC_ALPHA;
		case 8:
			return this.gl.SRC_COLOR;
		case 9:
			return this.gl.ZERO;
		default:
			throw haxe_Exception.thrown(new openfl_errors_IllegalOperationError());
		}
	}
	,__getGLCompareMode: function(mode) {
		switch(mode) {
		case 0:
			return this.gl.ALWAYS;
		case 1:
			return this.gl.EQUAL;
		case 2:
			return this.gl.GREATER;
		case 3:
			return this.gl.GEQUAL;
		case 4:
			return this.gl.LESS;
		case 5:
			return this.gl.LEQUAL;
		case 6:
			return this.gl.NEVER;
		case 7:
			return this.gl.NOTEQUAL;
		default:
			return this.gl.EQUAL;
		}
	}
	,__getGLStencilAction: function(action) {
		switch(action) {
		case 0:
			return this.gl.DECR;
		case 1:
			return this.gl.DECR_WRAP;
		case 2:
			return this.gl.INCR;
		case 3:
			return this.gl.INCR_WRAP;
		case 4:
			return this.gl.INVERT;
		case 5:
			return this.gl.KEEP;
		case 6:
			return this.gl.REPLACE;
		case 7:
			return this.gl.ZERO;
		default:
			return this.gl.KEEP;
		}
	}
	,__getGLTriangleFace: function(face) {
		switch(face) {
		case 0:
			return this.gl.BACK;
		case 1:
			return this.gl.FRONT;
		case 2:
			return this.gl.FRONT_AND_BACK;
		case 3:
			return this.gl.NONE;
		default:
			return this.gl.FRONT_AND_BACK;
		}
	}
	,__renderStage3D: function(stage3D) {
		var context = stage3D.context3D;
		if(context != null && context != this && context.__frontBufferTexture != null && stage3D.visible && this.backBufferHeight > 0 && this.backBufferWidth > 0) {
			if(this.__renderStage3DProgram == null) {
				var vertexAssembler = new openfl_utils_AGALMiniAssembler();
				vertexAssembler.assemble(openfl_display3D_Context3DProgramType.toString(1),"m44 op, va0, vc0\n" + "mov v0, va1");
				var fragmentAssembler = new openfl_utils_AGALMiniAssembler();
				fragmentAssembler.assemble(openfl_display3D_Context3DProgramType.toString(0),"tex ft1, v0, fs0 <2d,nearest,nomip>\n" + "mov oc, ft1");
				this.__renderStage3DProgram = this.createProgram();
				this.__renderStage3DProgram.upload(vertexAssembler.agalcode,fragmentAssembler.agalcode);
			}
			this.setProgram(this.__renderStage3DProgram);
			this.setBlendFactors(2,9);
			this.setColorMask(true,true,true,true);
			this.setCulling(3);
			this.setDepthTest(false,0);
			this.setStencilActions();
			this.setStencilReferenceValue(0,0,0);
			this.setScissorRectangle(null);
			this.setTextureAt(0,context.__frontBufferTexture);
			this.setVertexBufferAt(0,stage3D.__vertexBuffer,0,3);
			this.setVertexBufferAt(1,stage3D.__vertexBuffer,3,2);
			this.setProgramConstantsFromMatrix(1,0,stage3D.__renderTransform,true);
			this.drawTriangles(stage3D.__indexBuffer);
			this.__present = true;
		}
	}
	,__setGLBlend: function(enable) {
		if(this.__contextState.__enableGLBlend != enable) {
			if(enable) {
				this.gl.enable(this.gl.BLEND);
			} else {
				this.gl.disable(this.gl.BLEND);
			}
			this.__contextState.__enableGLBlend = enable;
		}
	}
	,__setGLBlendEquation: function(value) {
		if(this.__contextState.__glBlendEquation != value) {
			this.gl.blendEquation(value);
			this.__contextState.__glBlendEquation = value;
		}
	}
	,__setGLCullFace: function(enable) {
		if(this.__contextState.__enableGLCullFace != enable) {
			if(enable) {
				this.gl.enable(this.gl.CULL_FACE);
			} else {
				this.gl.disable(this.gl.CULL_FACE);
			}
			this.__contextState.__enableGLCullFace = enable;
		}
	}
	,__setGLDepthTest: function(enable) {
		if(this.__contextState.__enableGLDepthTest != enable) {
			if(enable) {
				this.gl.enable(this.gl.DEPTH_TEST);
			} else {
				this.gl.disable(this.gl.DEPTH_TEST);
			}
			this.__contextState.__enableGLDepthTest = enable;
		}
	}
	,__setGLFrontFace: function(counterClockWise) {
		if(this.__contextState.__frontFaceGLCCW != counterClockWise) {
			this.gl.frontFace(counterClockWise ? this.gl.CCW : this.gl.CW);
			this.__contextState.__frontFaceGLCCW = counterClockWise;
		}
	}
	,__setGLScissorTest: function(enable) {
		if(this.__contextState.__enableGLScissorTest != enable) {
			if(enable) {
				this.gl.enable(this.gl.SCISSOR_TEST);
			} else {
				this.gl.disable(this.gl.SCISSOR_TEST);
			}
			this.__contextState.__enableGLScissorTest = enable;
		}
	}
	,__setGLStencilTest: function(enable) {
		if(this.__contextState.__enableGLStencilTest != enable) {
			if(enable) {
				this.gl.enable(this.gl.STENCIL_TEST);
			} else {
				this.gl.disable(this.gl.STENCIL_TEST);
			}
			this.__contextState.__enableGLStencilTest = enable;
		}
	}
	,get_enableErrorChecking: function() {
		return this.__enableErrorChecking;
	}
	,set_enableErrorChecking: function(value) {
		return this.__enableErrorChecking = value;
	}
	,get_totalGPUMemory: function() {
		if(openfl_display3D_Context3D.__glMemoryCurrentAvailable != -1) {
			var current = this.gl.getParameter(openfl_display3D_Context3D.__glMemoryCurrentAvailable);
			var total = this.gl.getParameter(openfl_display3D_Context3D.__glMemoryTotalAvailable);
			if(total > 0) {
				return (total - current) * 1024;
			}
		}
		return 0;
	}
	,__class__: openfl_display3D_Context3D
	,__properties__: {get_totalGPUMemory:"get_totalGPUMemory",set_enableErrorChecking:"set_enableErrorChecking",get_enableErrorChecking:"get_enableErrorChecking"}
});
var openfl_display3D_Context3DBlendFactor = {};
openfl_display3D_Context3DBlendFactor.fromString = function(value) {
	switch(value) {
	case "destinationAlpha":
		return 0;
	case "destinationColor":
		return 1;
	case "one":
		return 2;
	case "oneMinusDestinationAlpha":
		return 3;
	case "oneMinusDestinationColor":
		return 4;
	case "oneMinusSourceAlpha":
		return 5;
	case "oneMinusSourceColor":
		return 6;
	case "sourceAlpha":
		return 7;
	case "sourceColor":
		return 8;
	case "zero":
		return 9;
	default:
		return null;
	}
};
openfl_display3D_Context3DBlendFactor.toString = function(this1) {
	switch(this1) {
	case 0:
		return "destinationAlpha";
	case 1:
		return "destinationColor";
	case 2:
		return "one";
	case 3:
		return "oneMinusDestinationAlpha";
	case 4:
		return "oneMinusDestinationColor";
	case 5:
		return "oneMinusSourceAlpha";
	case 6:
		return "oneMinusSourceColor";
	case 7:
		return "sourceAlpha";
	case 8:
		return "sourceColor";
	case 9:
		return "zero";
	default:
		return null;
	}
};
var openfl_display3D_Context3DBufferUsage = {};
openfl_display3D_Context3DBufferUsage.fromString = function(value) {
	switch(value) {
	case "dynamicDraw":
		return 0;
	case "staticDraw":
		return 1;
	default:
		return null;
	}
};
openfl_display3D_Context3DBufferUsage.toString = function(this1) {
	switch(this1) {
	case 0:
		return "dynamicDraw";
	case 1:
		return "staticDraw";
	default:
		return null;
	}
};
var openfl_display3D_Context3DCompareMode = {};
openfl_display3D_Context3DCompareMode.fromString = function(value) {
	switch(value) {
	case "always":
		return 0;
	case "equal":
		return 1;
	case "greater":
		return 2;
	case "greaterEqual":
		return 3;
	case "less":
		return 4;
	case "lessEqual":
		return 5;
	case "never":
		return 6;
	case "notEqual":
		return 7;
	default:
		return null;
	}
};
openfl_display3D_Context3DCompareMode.toString = function(this1) {
	switch(this1) {
	case 0:
		return "always";
	case 1:
		return "equal";
	case 2:
		return "greater";
	case 3:
		return "greaterEqual";
	case 4:
		return "less";
	case 5:
		return "lessEqual";
	case 6:
		return "never";
	case 7:
		return "notEqual";
	default:
		return null;
	}
};
var openfl_display3D_Context3DMipFilter = {};
openfl_display3D_Context3DMipFilter.fromString = function(value) {
	switch(value) {
	case "miplinear":
		return 0;
	case "mipnearest":
		return 1;
	case "mipnone":
		return 2;
	default:
		return null;
	}
};
openfl_display3D_Context3DMipFilter.toString = function(this1) {
	switch(this1) {
	case 0:
		return "miplinear";
	case 1:
		return "mipnearest";
	case 2:
		return "mipnone";
	default:
		return null;
	}
};
var openfl_display3D_Context3DProfile = {};
openfl_display3D_Context3DProfile.fromString = function(value) {
	switch(value) {
	case "baseline":
		return 0;
	case "baselineConstrained":
		return 1;
	case "baselineExtended":
		return 2;
	case "standard":
		return 3;
	case "standardConstrained":
		return 4;
	case "standardExtended":
		return 5;
	default:
		return null;
	}
};
openfl_display3D_Context3DProfile.toString = function(this1) {
	switch(this1) {
	case 0:
		return "baseline";
	case 1:
		return "baselineConstrained";
	case 2:
		return "baselineExtended";
	case 3:
		return "standard";
	case 4:
		return "standardConstrained";
	case 5:
		return "standardExtended";
	default:
		return null;
	}
};
var openfl_display3D_Context3DProgramFormat = {};
openfl_display3D_Context3DProgramFormat.fromString = function(value) {
	switch(value) {
	case "agal":
		return 0;
	case "glsl":
		return 1;
	default:
		return null;
	}
};
openfl_display3D_Context3DProgramFormat.toString = function(this1) {
	switch(this1) {
	case 0:
		return "agal";
	case 1:
		return "glsl";
	default:
		return null;
	}
};
var openfl_display3D_Context3DProgramType = {};
openfl_display3D_Context3DProgramType.fromString = function(value) {
	switch(value) {
	case "fragment":
		return 0;
	case "vertex":
		return 1;
	default:
		return null;
	}
};
openfl_display3D_Context3DProgramType.toString = function(this1) {
	switch(this1) {
	case 0:
		return "fragment";
	case 1:
		return "vertex";
	default:
		return null;
	}
};
var openfl_display3D_Context3DRenderMode = {};
openfl_display3D_Context3DRenderMode.fromString = function(value) {
	switch(value) {
	case "auto":
		return 0;
	case "software":
		return 1;
	default:
		return null;
	}
};
openfl_display3D_Context3DRenderMode.toString = function(this1) {
	switch(this1) {
	case 0:
		return "auto";
	case 1:
		return "software";
	default:
		return null;
	}
};
var openfl_display3D_Context3DStencilAction = {};
openfl_display3D_Context3DStencilAction.fromString = function(value) {
	switch(value) {
	case "decrementSaturate":
		return 0;
	case "decrementWrap":
		return 1;
	case "incrementSaturate":
		return 2;
	case "incrementWrap":
		return 3;
	case "invert":
		return 4;
	case "keep":
		return 5;
	case "set":
		return 6;
	case "zero":
		return 7;
	default:
		return null;
	}
};
openfl_display3D_Context3DStencilAction.toString = function(this1) {
	switch(this1) {
	case 0:
		return "decrementSaturate";
	case 1:
		return "decrementWrap";
	case 2:
		return "incrementSaturate";
	case 3:
		return "incrementWrap";
	case 4:
		return "invert";
	case 5:
		return "keep";
	case 6:
		return "set";
	case 7:
		return "zero";
	default:
		return null;
	}
};
var openfl_display3D_Context3DTextureFilter = {};
openfl_display3D_Context3DTextureFilter.fromString = function(value) {
	switch(value) {
	case "anisotropic16x":
		return 0;
	case "anisotropic2x":
		return 1;
	case "anisotropic4x":
		return 2;
	case "anisotropic8x":
		return 3;
	case "linear":
		return 4;
	case "nearest":
		return 5;
	default:
		return null;
	}
};
openfl_display3D_Context3DTextureFilter.toString = function(this1) {
	switch(this1) {
	case 0:
		return "anisotropic16x";
	case 1:
		return "anisotropic2x";
	case 2:
		return "anisotropic4x";
	case 3:
		return "anisotropic8x";
	case 4:
		return "linear";
	case 5:
		return "nearest";
	default:
		return null;
	}
};
var openfl_display3D_Context3DTextureFormat = {};
openfl_display3D_Context3DTextureFormat.fromString = function(value) {
	switch(value) {
	case "bgrPacked565":
		return 0;
	case "bgra":
		return 1;
	case "bgraPacked4444":
		return 2;
	case "compressed":
		return 3;
	case "compressedAlpha":
		return 4;
	case "rgbaHalfFloat":
		return 5;
	default:
		return null;
	}
};
openfl_display3D_Context3DTextureFormat.toString = function(this1) {
	switch(this1) {
	case 0:
		return "bgrPacked565";
	case 1:
		return "bgra";
	case 2:
		return "bgraPacked4444";
	case 3:
		return "compressed";
	case 4:
		return "compressedAlpha";
	case 5:
		return "rgbaHalfFloat";
	default:
		return null;
	}
};
var openfl_display3D_Context3DTriangleFace = {};
openfl_display3D_Context3DTriangleFace.fromString = function(value) {
	switch(value) {
	case "back":
		return 0;
	case "front":
		return 1;
	case "frontAndBack":
		return 2;
	case "none":
		return 3;
	default:
		return null;
	}
};
openfl_display3D_Context3DTriangleFace.toString = function(this1) {
	switch(this1) {
	case 0:
		return "back";
	case 1:
		return "front";
	case 2:
		return "frontAndBack";
	case 3:
		return "none";
	default:
		return null;
	}
};
var openfl_display3D_Context3DVertexBufferFormat = {};
openfl_display3D_Context3DVertexBufferFormat.fromString = function(value) {
	switch(value) {
	case "bytes4":
		return 0;
	case "float1":
		return 1;
	case "float2":
		return 2;
	case "float3":
		return 3;
	case "float4":
		return 4;
	default:
		return null;
	}
};
openfl_display3D_Context3DVertexBufferFormat.toString = function(this1) {
	switch(this1) {
	case 0:
		return "bytes4";
	case 1:
		return "float1";
	case 2:
		return "float2";
	case 3:
		return "float3";
	case 4:
		return "float4";
	default:
		return null;
	}
};
var openfl_display3D_Context3DWrapMode = {};
openfl_display3D_Context3DWrapMode.fromString = function(value) {
	switch(value) {
	case "clamp":
		return 0;
	case "clamp_u_repeat_v":
		return 1;
	case "repeat":
		return 2;
	case "repeat_u_clamp_v":
		return 3;
	default:
		return null;
	}
};
openfl_display3D_Context3DWrapMode.toString = function(this1) {
	switch(this1) {
	case 0:
		return "clamp";
	case 1:
		return "clamp_u_repeat_v";
	case 2:
		return "repeat";
	case 3:
		return "repeat_u_clamp_v";
	default:
		return null;
	}
};
var openfl_display3D_IndexBuffer3D = function(context3D,numIndices,bufferUsage) {
	this.__context = context3D;
	this.__numIndices = numIndices;
	var gl = this.__context.gl;
	this.__id = gl.createBuffer();
	this.__usage = bufferUsage == 0 ? gl.DYNAMIC_DRAW : gl.STATIC_DRAW;
};
$hxClasses["openfl.display3D.IndexBuffer3D"] = openfl_display3D_IndexBuffer3D;
openfl_display3D_IndexBuffer3D.__name__ = "openfl.display3D.IndexBuffer3D";
openfl_display3D_IndexBuffer3D.prototype = {
	__context: null
	,__id: null
	,__memoryUsage: null
	,__numIndices: null
	,__tempUInt16Array: null
	,__usage: null
	,dispose: function() {
		var gl = this.__context.gl;
		gl.deleteBuffer(this.__id);
	}
	,uploadFromByteArray: function(data,byteArrayOffset,startOffset,count) {
		var offset = byteArrayOffset + startOffset * 2;
		var elements = null;
		var array = null;
		var vector = null;
		var view = null;
		var buffer = openfl_utils_ByteArray.toArrayBuffer(data);
		var byteoffset = offset;
		if(byteoffset == null) {
			byteoffset = 0;
		}
		var this1;
		if(elements != null) {
			this1 = new Uint16Array(elements);
		} else if(array != null) {
			this1 = new Uint16Array(array);
		} else if(vector != null) {
			this1 = new Uint16Array(vector.__array);
		} else if(view != null) {
			this1 = new Uint16Array(view);
		} else if(buffer != null) {
			if(count == null) {
				this1 = new Uint16Array(buffer,byteoffset);
			} else {
				this1 = new Uint16Array(buffer,byteoffset,count);
			}
		} else {
			this1 = null;
		}
		this.uploadFromTypedArray(this1);
	}
	,uploadFromTypedArray: function(data,byteLength) {
		if(byteLength == null) {
			byteLength = -1;
		}
		if(data == null) {
			return;
		}
		var gl = this.__context.gl;
		this.__context.__bindGLElementArrayBuffer(this.__id);
		lime_graphics_WebGLRenderContext.bufferData(gl,gl.ELEMENT_ARRAY_BUFFER,data,this.__usage);
	}
	,uploadFromVector: function(data,startOffset,count) {
		if(data == null) {
			return;
		}
		var gl = this.__context.gl;
		var length = startOffset + count;
		var existingUInt16Array = this.__tempUInt16Array;
		if(this.__tempUInt16Array == null || this.__tempUInt16Array.length < count) {
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1;
			if(count != null) {
				this1 = new Uint16Array(count);
			} else if(array != null) {
				this1 = new Uint16Array(array);
			} else if(vector != null) {
				this1 = new Uint16Array(vector.__array);
			} else if(view != null) {
				this1 = new Uint16Array(view);
			} else if(buffer != null) {
				if(len == null) {
					this1 = new Uint16Array(buffer,0);
				} else {
					this1 = new Uint16Array(buffer,0,len);
				}
			} else {
				this1 = null;
			}
			this.__tempUInt16Array = this1;
			if(existingUInt16Array != null) {
				this.__tempUInt16Array.set(existingUInt16Array);
			}
		}
		var _g = startOffset;
		var _g1 = length;
		while(_g < _g1) {
			var i = _g++;
			this.__tempUInt16Array[i - startOffset] = data.get(i);
		}
		this.uploadFromTypedArray(this.__tempUInt16Array);
	}
	,__class__: openfl_display3D_IndexBuffer3D
};
var openfl_display3D_Program3D = function(context3D,format) {
	this.__context = context3D;
	this.__format = format;
	if(this.__format == 0) {
		this.__agalSamplerUsageMask = 0;
		this.__agalUniforms = new haxe_ds_List();
		this.__agalSamplerUniforms = new haxe_ds_List();
		this.__agalAlphaSamplerUniforms = new haxe_ds_List();
		this.__agalAlphaSamplerEnabled = [];
	} else {
		this.__glslAttribNames = [];
		this.__glslAttribTypes = [];
		this.__glslSamplerNames = [];
		this.__glslUniformLocations = [];
		this.__glslUniformNames = [];
		this.__glslUniformTypes = [];
	}
	this.__samplerStates = [];
};
$hxClasses["openfl.display3D.Program3D"] = openfl_display3D_Program3D;
openfl_display3D_Program3D.__name__ = "openfl.display3D.Program3D";
openfl_display3D_Program3D.prototype = {
	__agalAlphaSamplerEnabled: null
	,__agalAlphaSamplerUniforms: null
	,__agalFragmentUniformMap: null
	,__agalPositionScale: null
	,__agalSamplerUniforms: null
	,__agalSamplerUsageMask: null
	,__agalUniforms: null
	,__agalVertexUniformMap: null
	,__context: null
	,__format: null
	,__glFragmentShader: null
	,__glFragmentSource: null
	,__glProgram: null
	,__glslAttribNames: null
	,__glslAttribTypes: null
	,__glslSamplerNames: null
	,__glslUniformLocations: null
	,__glslUniformNames: null
	,__glslUniformTypes: null
	,__glVertexShader: null
	,__glVertexSource: null
	,__samplerStates: null
	,dispose: function() {
		this.__deleteShaders();
	}
	,getAttributeIndex: function(name) {
		if(this.__format == 0) {
			if(StringTools.startsWith(name,"va")) {
				return Std.parseInt(name.substring(2));
			} else {
				return -1;
			}
		} else {
			var _g = 0;
			var _g1 = this.__glslAttribNames.length;
			while(_g < _g1) {
				var i = _g++;
				if(this.__glslAttribNames[i] == name) {
					return i;
				}
			}
			return -1;
		}
	}
	,getConstantIndex: function(name) {
		if(this.__format == 0) {
			if(StringTools.startsWith(name,"vc")) {
				return Std.parseInt(name.substring(2));
			} else if(StringTools.startsWith(name,"fc")) {
				return Std.parseInt(name.substring(2));
			} else {
				return -1;
			}
		} else {
			var _g = 0;
			var _g1 = this.__glslUniformNames.length;
			while(_g < _g1) {
				var i = _g++;
				if(this.__glslUniformNames[i] == name) {
					return this.__glslUniformLocations[i];
				}
			}
			return -1;
		}
	}
	,upload: function(vertexProgram,fragmentProgram) {
		if(this.__format != 0) {
			return;
		}
		var samplerStates = [];
		var glslVertex = openfl_display3D__$internal_agal_AGALConverter.convertToGLSL(vertexProgram,null);
		var glslFragment = openfl_display3D__$internal_agal_AGALConverter.convertToGLSL(fragmentProgram,samplerStates);
		if(lime_utils_Log.level == 5) {
			lime_utils_Log.info(glslVertex,{ fileName : "openfl/display3D/Program3D.hx", lineNumber : 399, className : "openfl.display3D.Program3D", methodName : "upload"});
			lime_utils_Log.info(glslFragment,{ fileName : "openfl/display3D/Program3D.hx", lineNumber : 400, className : "openfl.display3D.Program3D", methodName : "upload"});
		}
		this.__deleteShaders();
		this.__uploadFromGLSL(glslVertex,glslFragment);
		this.__buildAGALUniformList();
		var _g = 0;
		var _g1 = samplerStates.length;
		while(_g < _g1) {
			var i = _g++;
			this.__samplerStates[i] = samplerStates[i];
		}
	}
	,uploadSources: function(vertexSource,fragmentSource) {
		if(this.__format != 1) {
			return;
		}
		var prefix = "#ifdef GL_ES\n\t\t\t#ifdef GL_FRAGMENT_PRECISION_HIGH\n\t\t\tprecision highp float;\n\t\t\t#else\n\t\t\tprecision mediump float;\n\t\t\t#endif\n\t\t\t#endif\n\t\t\t";
		var vertex = prefix + vertexSource;
		var fragment = prefix + fragmentSource;
		if(vertex == this.__glVertexSource && fragment == this.__glFragmentSource) {
			return;
		}
		this.__processGLSLData(vertexSource,"attribute");
		this.__processGLSLData(vertexSource,"uniform");
		this.__processGLSLData(fragmentSource,"uniform");
		this.__deleteShaders();
		this.__uploadFromGLSL(vertex,fragment);
		var samplerNames = this.__glslSamplerNames;
		var attribNames = this.__glslAttribNames;
		var attribTypes = this.__glslAttribTypes;
		var uniformNames = this.__glslUniformNames;
		this.__glslSamplerNames = [];
		this.__glslAttribNames = [];
		this.__glslAttribTypes = [];
		this.__glslUniformLocations = [];
		var gl = this.__context.gl;
		var index;
		var location;
		var _g = 0;
		while(_g < samplerNames.length) {
			var name = samplerNames[_g];
			++_g;
			index = gl.getUniformLocation(this.__glProgram,name);
			this.__glslSamplerNames[index] = name;
		}
		var _g = 0;
		var _g1 = attribNames.length;
		while(_g < _g1) {
			var i = _g++;
			index = gl.getAttribLocation(this.__glProgram,attribNames[i]);
			this.__glslAttribNames[index] = attribNames[i];
			this.__glslAttribTypes[index] = attribTypes[i];
		}
		var _g = 0;
		var _g1 = uniformNames.length;
		while(_g < _g1) {
			var i = _g++;
			location = gl.getUniformLocation(this.__glProgram,uniformNames[i]);
			this.__glslUniformLocations[i] = location;
		}
	}
	,__buildAGALUniformList: function() {
		if(this.__format == 1) {
			return;
		}
		var gl = this.__context.gl;
		this.__agalUniforms.clear();
		this.__agalSamplerUniforms.clear();
		this.__agalAlphaSamplerUniforms.clear();
		this.__agalAlphaSamplerEnabled = [];
		this.__agalSamplerUsageMask = 0;
		var numActive = 0;
		numActive = gl.getProgramParameter(this.__glProgram,gl.ACTIVE_UNIFORMS);
		var vertexUniforms = new haxe_ds_List();
		var fragmentUniforms = new haxe_ds_List();
		var _g = 0;
		var _g1 = numActive;
		while(_g < _g1) {
			var i = _g++;
			var info = gl.getActiveUniform(this.__glProgram,i);
			var name = info.name;
			var size = info.size;
			var uniformType = info.type;
			var uniform = new openfl_display3D_Uniform(this.__context);
			uniform.name = name;
			uniform.size = size;
			uniform.type = uniformType;
			uniform.location = gl.getUniformLocation(this.__glProgram,uniform.name);
			var indexBracket = uniform.name.indexOf("[");
			if(indexBracket >= 0) {
				uniform.name = uniform.name.substring(0,indexBracket);
			}
			switch(uniform.type) {
			case 35674:
				uniform.regCount = 2;
				break;
			case 35675:
				uniform.regCount = 3;
				break;
			case 35676:
				uniform.regCount = 4;
				break;
			default:
				uniform.regCount = 1;
			}
			uniform.regCount *= uniform.size;
			this.__agalUniforms.add(uniform);
			if(uniform.name == "vcPositionScale") {
				this.__agalPositionScale = uniform;
			} else if(StringTools.startsWith(uniform.name,"vc")) {
				uniform.regIndex = Std.parseInt(uniform.name.substring(2));
				uniform.regData = this.__context.__vertexConstants;
				vertexUniforms.add(uniform);
			} else if(StringTools.startsWith(uniform.name,"fc")) {
				uniform.regIndex = Std.parseInt(uniform.name.substring(2));
				uniform.regData = this.__context.__fragmentConstants;
				fragmentUniforms.add(uniform);
			} else if(StringTools.startsWith(uniform.name,"sampler") && uniform.name.indexOf("alpha") == -1) {
				uniform.regIndex = Std.parseInt(uniform.name.substring(7));
				this.__agalSamplerUniforms.add(uniform);
				var _g2 = 0;
				var _g3 = uniform.regCount;
				while(_g2 < _g3) {
					var reg = _g2++;
					this.__agalSamplerUsageMask |= 1 << uniform.regIndex + reg;
				}
			} else if(StringTools.startsWith(uniform.name,"sampler") && StringTools.endsWith(uniform.name,"_alpha")) {
				var len = uniform.name.indexOf("_") - 7;
				uniform.regIndex = Std.parseInt(uniform.name.substring(7,7 + len)) + 4;
				this.__agalAlphaSamplerUniforms.add(uniform);
			} else if(StringTools.startsWith(uniform.name,"sampler") && StringTools.endsWith(uniform.name,"_alphaEnabled")) {
				uniform.regIndex = Std.parseInt(uniform.name.substring(7));
				this.__agalAlphaSamplerEnabled[uniform.regIndex] = uniform;
			}
			if(lime_utils_Log.level == 5) {
				lime_utils_Log.verbose("" + i + " name:" + uniform.name + " type:" + uniform.type + " size:" + uniform.size + " location:" + Std.string(uniform.location),{ fileName : "openfl/display3D/Program3D.hx", lineNumber : 577, className : "openfl.display3D.Program3D", methodName : "__buildAGALUniformList"});
			}
		}
		this.__agalVertexUniformMap = new openfl_display3D_UniformMap(Lambda.array(vertexUniforms));
		this.__agalFragmentUniformMap = new openfl_display3D_UniformMap(Lambda.array(fragmentUniforms));
	}
	,__deleteShaders: function() {
		var gl = this.__context.gl;
		if(this.__glProgram != null) {
			this.__glProgram = null;
		}
		if(this.__glVertexShader != null) {
			gl.deleteShader(this.__glVertexShader);
			this.__glVertexShader = null;
		}
		if(this.__glFragmentShader != null) {
			gl.deleteShader(this.__glFragmentShader);
			this.__glFragmentShader = null;
		}
	}
	,__disable: function() {
		var tmp = this.__format == 1;
	}
	,__enable: function() {
		var gl = this.__context.gl;
		gl.useProgram(this.__glProgram);
		if(this.__format == 0) {
			this.__agalVertexUniformMap.markAllDirty();
			this.__agalFragmentUniformMap.markAllDirty();
			var _g_head = this.__agalSamplerUniforms.h;
			while(_g_head != null) {
				var val = _g_head.item;
				_g_head = _g_head.next;
				var sampler = val;
				if(sampler.regCount == 1) {
					gl.uniform1i(sampler.location,sampler.regIndex);
				} else {
					throw haxe_Exception.thrown(new openfl_errors_IllegalOperationError("!!! TODO: uniform location on webgl"));
				}
			}
			var _g1_head = this.__agalAlphaSamplerUniforms.h;
			while(_g1_head != null) {
				var val = _g1_head.item;
				_g1_head = _g1_head.next;
				var sampler = val;
				if(sampler.regCount == 1) {
					gl.uniform1i(sampler.location,sampler.regIndex);
				} else {
					throw haxe_Exception.thrown(new openfl_errors_IllegalOperationError("!!! TODO: uniform location on webgl"));
				}
			}
		}
	}
	,__flush: function() {
		if(this.__format == 0) {
			this.__agalVertexUniformMap.flush();
			this.__agalFragmentUniformMap.flush();
		} else {
			return;
		}
	}
	,__getSamplerState: function(sampler) {
		return this.__samplerStates[sampler];
	}
	,__markDirty: function(isVertex,index,count) {
		if(this.__format == 1) {
			return;
		}
		if(isVertex) {
			this.__agalVertexUniformMap.markDirty(index,count);
		} else {
			this.__agalFragmentUniformMap.markDirty(index,count);
		}
	}
	,__processGLSLData: function(source,storageType) {
		var lastMatch = 0;
		var position;
		var regex;
		var name;
		var type;
		if(storageType == "uniform") {
			regex = new EReg("uniform ([A-Za-z0-9]+) ([A-Za-z0-9_]+)","");
		} else {
			regex = new EReg("attribute ([A-Za-z0-9]+) ([A-Za-z0-9_]+)","");
		}
		while(regex.matchSub(source,lastMatch)) {
			type = regex.matched(1);
			name = regex.matched(2);
			if(StringTools.startsWith(name,"gl_")) {
				continue;
			}
			if(StringTools.startsWith(type,"sampler")) {
				this.__glslSamplerNames.push(name);
			} else {
				var parameterType;
				switch(type) {
				case "bool":
					parameterType = 0;
					break;
				case "bvec2":
					parameterType = 1;
					break;
				case "bvec3":
					parameterType = 2;
					break;
				case "bvec4":
					parameterType = 3;
					break;
				case "dvec2":case "vec2":
					parameterType = 5;
					break;
				case "dvec3":case "vec3":
					parameterType = 6;
					break;
				case "double":case "float":
					parameterType = 4;
					break;
				case "ivec3":case "uvec3":
					parameterType = 10;
					break;
				case "ivec4":case "uvec4":
					parameterType = 11;
					break;
				case "mat2":case "mat2x2":
					parameterType = 12;
					break;
				case "mat2x3":
					parameterType = 13;
					break;
				case "mat2x4":
					parameterType = 14;
					break;
				case "mat3x2":
					parameterType = 15;
					break;
				case "mat3":case "mat3x3":
					parameterType = 16;
					break;
				case "mat3x4":
					parameterType = 17;
					break;
				case "mat4":case "mat4x4":
					parameterType = 20;
					break;
				case "mat4x2":
					parameterType = 18;
					break;
				case "mat4x3":
					parameterType = 19;
					break;
				case "int":case "uint":
					parameterType = 8;
					break;
				case "ivec2":case "uvec2":
					parameterType = 9;
					break;
				case "dvec4":case "vec4":
					parameterType = 7;
					break;
				default:
					parameterType = null;
				}
				if(storageType == "uniform") {
					this.__glslUniformNames.push(name);
					this.__glslUniformTypes.push(parameterType);
				} else {
					this.__glslAttribNames.push(name);
					this.__glslAttribTypes.push(parameterType);
				}
			}
			position = regex.matchedPos();
			lastMatch = position.pos + position.len;
		}
	}
	,__setPositionScale: function(positionScale) {
		if(this.__format == 1) {
			return;
		}
		if(this.__agalPositionScale != null) {
			var gl = this.__context.gl;
			var location = this.__agalPositionScale.location;
			var data = positionScale;
			var srcOffset = null;
			if(srcOffset != null) {
				gl.uniform4fv(location,data,srcOffset,null);
			} else {
				gl.uniform4fv(location,data);
			}
		}
	}
	,__setSamplerState: function(sampler,state) {
		this.__samplerStates[sampler] = state;
	}
	,__uploadFromGLSL: function(vertexShaderSource,fragmentShaderSource) {
		var gl = this.__context.gl;
		this.__glVertexSource = vertexShaderSource;
		this.__glFragmentSource = fragmentShaderSource;
		this.__glVertexShader = gl.createShader(gl.VERTEX_SHADER);
		gl.shaderSource(this.__glVertexShader,vertexShaderSource);
		gl.compileShader(this.__glVertexShader);
		if(gl.getShaderParameter(this.__glVertexShader,gl.COMPILE_STATUS) == 0) {
			var message = "Error compiling vertex shader";
			message += "\n" + gl.getShaderInfoLog(this.__glVertexShader);
			message += "\n" + vertexShaderSource;
			lime_utils_Log.error(message,{ fileName : "openfl/display3D/Program3D.hx", lineNumber : 869, className : "openfl.display3D.Program3D", methodName : "__uploadFromGLSL"});
		}
		this.__glFragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
		gl.shaderSource(this.__glFragmentShader,fragmentShaderSource);
		gl.compileShader(this.__glFragmentShader);
		if(gl.getShaderParameter(this.__glFragmentShader,gl.COMPILE_STATUS) == 0) {
			var message = "Error compiling fragment shader";
			message += "\n" + gl.getShaderInfoLog(this.__glFragmentShader);
			message += "\n" + fragmentShaderSource;
			lime_utils_Log.error(message,{ fileName : "openfl/display3D/Program3D.hx", lineNumber : 881, className : "openfl.display3D.Program3D", methodName : "__uploadFromGLSL"});
		}
		this.__glProgram = gl.createProgram();
		if(this.__format == 0) {
			var _g = 0;
			while(_g < 16) {
				var i = _g++;
				var name = "va" + i;
				if(vertexShaderSource.indexOf(" " + name) != -1) {
					gl.bindAttribLocation(this.__glProgram,i,name);
				}
			}
		} else {
			var _g = 0;
			var _g1 = this.__glslAttribNames;
			while(_g < _g1.length) {
				var name = _g1[_g];
				++_g;
				if(name.indexOf("Position") > -1 && StringTools.startsWith(name,"openfl_")) {
					gl.bindAttribLocation(this.__glProgram,0,name);
					break;
				}
			}
		}
		gl.attachShader(this.__glProgram,this.__glVertexShader);
		gl.attachShader(this.__glProgram,this.__glFragmentShader);
		gl.linkProgram(this.__glProgram);
		if(gl.getProgramParameter(this.__glProgram,gl.LINK_STATUS) == 0) {
			var message = "Unable to initialize the shader program";
			message += "\n" + gl.getProgramInfoLog(this.__glProgram);
			lime_utils_Log.error(message,{ fileName : "openfl/display3D/Program3D.hx", lineNumber : 922, className : "openfl.display3D.Program3D", methodName : "__uploadFromGLSL"});
		}
	}
	,__class__: openfl_display3D_Program3D
};
var openfl_display3D_Uniform = function(context) {
	this.context = context;
	this.isDirty = true;
	var this1 = new lime_utils_BytePointerData(null,0);
	this.regDataPointer = this1;
};
$hxClasses["openfl.display3D.Uniform"] = openfl_display3D_Uniform;
openfl_display3D_Uniform.__name__ = "openfl.display3D.Uniform";
openfl_display3D_Uniform.prototype = {
	name: null
	,location: null
	,type: null
	,size: null
	,regData: null
	,regIndex: null
	,regCount: null
	,isDirty: null
	,context: null
	,regDataPointer: null
	,flush: function() {
		var gl = this.context.gl;
		var index = this.regIndex * 4;
		switch(this.type) {
		case 35664:
			lime_graphics_WebGL2RenderContext.uniform2fv(gl,this.location,this.regData.subarray(index,index + this.regCount * 2));
			break;
		case 35665:
			var location = this.location;
			var data = this.regData.subarray(index,index + this.regCount * 3);
			var srcOffset = null;
			if(srcOffset != null) {
				gl.uniform3fv(location,data,srcOffset,null);
			} else {
				gl.uniform3fv(location,data);
			}
			break;
		case 35666:
			var location = this.location;
			var data = this.regData.subarray(index,index + this.regCount * 4);
			var srcOffset = null;
			if(srcOffset != null) {
				gl.uniform4fv(location,data,srcOffset,null);
			} else {
				gl.uniform4fv(location,data);
			}
			break;
		case 35674:
			lime_graphics_WebGLRenderContext.uniformMatrix2fv(gl,this.location,false,this.regData.subarray(index,index + this.size * 2 * 2));
			break;
		case 35675:
			lime_graphics_WebGLRenderContext.uniformMatrix3fv(gl,this.location,false,this.regData.subarray(index,index + this.size * 3 * 3));
			break;
		case 35676:
			lime_graphics_WebGLRenderContext.uniformMatrix4fv(gl,this.location,false,this.regData.subarray(index,index + this.size * 4 * 4));
			break;
		default:
			var location = this.location;
			var data = this.regData.subarray(index,index + this.regCount * 4);
			var srcOffset = null;
			if(srcOffset != null) {
				gl.uniform4fv(location,data,srcOffset,null);
			} else {
				gl.uniform4fv(location,data);
			}
		}
	}
	,__getUniformRegisters: function(index,size) {
		return this.regData.subarray(index,index + size);
	}
	,__class__: openfl_display3D_Uniform
};
var openfl_display3D_UniformMap = function(list) {
	this.__uniforms = list;
	this.__uniforms.sort(function(a,b) {
		return Reflect.compare(a.regIndex,b.regIndex);
	});
	var total = 0;
	var _g = 0;
	var _g1 = this.__uniforms;
	while(_g < _g1.length) {
		var uniform = _g1[_g];
		++_g;
		if(uniform.regIndex + uniform.regCount > total) {
			total = uniform.regIndex + uniform.regCount;
		}
	}
	this.__registerLookup = openfl_Vector.toObjectVector(null,total);
	var _g = 0;
	var _g1 = this.__uniforms;
	while(_g < _g1.length) {
		var uniform = _g1[_g];
		++_g;
		var _g2 = 0;
		var _g3 = uniform.regCount;
		while(_g2 < _g3) {
			var i = _g2++;
			this.__registerLookup.set(uniform.regIndex + i,uniform);
		}
	}
	this.__anyDirty = this.__allDirty = true;
};
$hxClasses["openfl.display3D.UniformMap"] = openfl_display3D_UniformMap;
openfl_display3D_UniformMap.__name__ = "openfl.display3D.UniformMap";
openfl_display3D_UniformMap.prototype = {
	__allDirty: null
	,__anyDirty: null
	,__registerLookup: null
	,__uniforms: null
	,flush: function() {
		if(this.__anyDirty) {
			var _g = 0;
			var _g1 = this.__uniforms;
			while(_g < _g1.length) {
				var uniform = _g1[_g];
				++_g;
				if(this.__allDirty || uniform.isDirty) {
					uniform.flush();
					uniform.isDirty = false;
				}
			}
			this.__anyDirty = this.__allDirty = false;
		}
	}
	,markAllDirty: function() {
		this.__allDirty = true;
		this.__anyDirty = true;
	}
	,markDirty: function(start,count) {
		if(this.__allDirty) {
			return;
		}
		var end = start + count;
		if(end > this.__registerLookup.get_length()) {
			end = this.__registerLookup.get_length();
		}
		var index = start;
		while(index < end) {
			var uniform = this.__registerLookup.get(index);
			if(uniform != null) {
				uniform.isDirty = true;
				this.__anyDirty = true;
				index = uniform.regIndex + uniform.regCount;
			} else {
				++index;
			}
		}
	}
	,__class__: openfl_display3D_UniformMap
};
var openfl_display3D_VertexBuffer3D = function(context3D,numVertices,dataPerVertex,bufferUsage) {
	this.__context = context3D;
	this.__numVertices = numVertices;
	this.__vertexSize = dataPerVertex;
	var gl = this.__context.gl;
	this.__id = gl.createBuffer();
	this.__stride = this.__vertexSize * 4;
	this.__usage = openfl_display3D_Context3DBufferUsage.fromString(bufferUsage) == 0 ? gl.DYNAMIC_DRAW : gl.STATIC_DRAW;
};
$hxClasses["openfl.display3D.VertexBuffer3D"] = openfl_display3D_VertexBuffer3D;
openfl_display3D_VertexBuffer3D.__name__ = "openfl.display3D.VertexBuffer3D";
openfl_display3D_VertexBuffer3D.prototype = {
	__context: null
	,__data: null
	,__id: null
	,__memoryUsage: null
	,__numVertices: null
	,__stride: null
	,__tempFloat32Array: null
	,__usage: null
	,__vertexSize: null
	,dispose: function() {
		var gl = this.__context.gl;
		gl.deleteBuffer(this.__id);
	}
	,uploadFromByteArray: function(data,byteArrayOffset,startVertex,numVertices) {
		var offset = byteArrayOffset + startVertex * this.__stride;
		var length = numVertices * this.__vertexSize;
		var elements = null;
		var array = null;
		var vector = null;
		var view = null;
		var buffer = openfl_utils_ByteArray.toArrayBuffer(data);
		var byteoffset = offset;
		if(byteoffset == null) {
			byteoffset = 0;
		}
		var this1;
		if(elements != null) {
			this1 = new Float32Array(elements);
		} else if(array != null) {
			this1 = new Float32Array(array);
		} else if(vector != null) {
			this1 = new Float32Array(vector.__array);
		} else if(view != null) {
			this1 = new Float32Array(view);
		} else if(buffer != null) {
			if(length == null) {
				this1 = new Float32Array(buffer,byteoffset);
			} else {
				this1 = new Float32Array(buffer,byteoffset,length);
			}
		} else {
			this1 = null;
		}
		this.uploadFromTypedArray(lime_utils_Float32Array.toArrayBufferView(this1));
	}
	,uploadFromTypedArray: function(data,byteLength) {
		if(byteLength == null) {
			byteLength = -1;
		}
		if(data == null) {
			return;
		}
		var gl = this.__context.gl;
		this.__context.__bindGLArrayBuffer(this.__id);
		lime_graphics_WebGLRenderContext.bufferData(gl,gl.ARRAY_BUFFER,data,this.__usage);
	}
	,uploadFromVector: function(data,startVertex,numVertices) {
		if(data == null) {
			return;
		}
		var gl = this.__context.gl;
		var start = startVertex * this.__vertexSize;
		var count = numVertices * this.__vertexSize;
		var length = start + count;
		var existingFloat32Array = this.__tempFloat32Array;
		if(this.__tempFloat32Array == null || this.__tempFloat32Array.length < count) {
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1;
			if(count != null) {
				this1 = new Float32Array(count);
			} else if(array != null) {
				this1 = new Float32Array(array);
			} else if(vector != null) {
				this1 = new Float32Array(vector.__array);
			} else if(view != null) {
				this1 = new Float32Array(view);
			} else if(buffer != null) {
				if(len == null) {
					this1 = new Float32Array(buffer,0);
				} else {
					this1 = new Float32Array(buffer,0,len);
				}
			} else {
				this1 = null;
			}
			this.__tempFloat32Array = this1;
			if(existingFloat32Array != null) {
				this.__tempFloat32Array.set(existingFloat32Array);
			}
		}
		var _g = start;
		var _g1 = length;
		while(_g < _g1) {
			var i = _g++;
			this.__tempFloat32Array[i - start] = data.get(i);
		}
		this.uploadFromTypedArray(lime_utils_Float32Array.toArrayBufferView(this.__tempFloat32Array));
	}
	,__class__: openfl_display3D_VertexBuffer3D
};
var openfl_display3D__$internal_Context3DState = function() {
	this.backBufferEnableDepthAndStencil = false;
	this.blendDestinationAlphaFactor = 9;
	this.blendSourceAlphaFactor = 2;
	this.blendDestinationRGBFactor = 9;
	this.blendSourceRGBFactor = 2;
	this.colorMaskRed = true;
	this.colorMaskGreen = true;
	this.colorMaskBlue = true;
	this.colorMaskAlpha = true;
	this.culling = 3;
	this.depthCompareMode = 4;
	this.depthMask = true;
	this.samplerStates = [];
	this.scissorRectangle = new openfl_geom_Rectangle();
	this.stencilCompareMode = 0;
	this.stencilDepthFail = 5;
	this.stencilFail = 5;
	this.stencilPass = 5;
	this.stencilReadMask = 255;
	this.stencilReferenceValue = 0;
	this.stencilTriangleFace = 2;
	this.stencilWriteMask = 255;
	this.textures = [];
	this.__frontFaceGLCCW = true;
	this.__glBlendEquation = 32774;
};
$hxClasses["openfl.display3D._internal.Context3DState"] = openfl_display3D__$internal_Context3DState;
openfl_display3D__$internal_Context3DState.__name__ = "openfl.display3D._internal.Context3DState";
openfl_display3D__$internal_Context3DState.prototype = {
	backBufferEnableDepthAndStencil: null
	,blendDestinationAlphaFactor: null
	,blendSourceAlphaFactor: null
	,blendDestinationRGBFactor: null
	,blendSourceRGBFactor: null
	,colorMaskRed: null
	,colorMaskGreen: null
	,colorMaskBlue: null
	,colorMaskAlpha: null
	,culling: null
	,depthCompareMode: null
	,depthMask: null
	,program: null
	,renderToTexture: null
	,renderToTextureAntiAlias: null
	,renderToTextureDepthStencil: null
	,renderToTextureSurfaceSelector: null
	,samplerStates: null
	,scissorEnabled: null
	,scissorRectangle: null
	,stencilCompareMode: null
	,stencilDepthFail: null
	,stencilFail: null
	,stencilPass: null
	,stencilReadMask: null
	,stencilReferenceValue: null
	,stencilTriangleFace: null
	,stencilWriteMask: null
	,textures: null
	,shader: null
	,__currentGLArrayBuffer: null
	,__currentGLElementArrayBuffer: null
	,__currentGLFramebuffer: null
	,__currentGLTexture2D: null
	,__currentGLTextureCubeMap: null
	,__enableGLBlend: null
	,__enableGLCullFace: null
	,__enableGLDepthTest: null
	,__enableGLScissorTest: null
	,__enableGLStencilTest: null
	,__frontFaceGLCCW: null
	,__glBlendEquation: null
	,__primaryGLFramebuffer: null
	,__rttDepthGLRenderbuffer: null
	,__rttGLFramebuffer: null
	,__rttGLRenderbuffer: null
	,__rttStencilGLRenderbuffer: null
	,__class__: openfl_display3D__$internal_Context3DState
};
var openfl_display3D__$internal_agal_AGALConverter = function() { };
$hxClasses["openfl.display3D._internal.agal.AGALConverter"] = openfl_display3D__$internal_agal_AGALConverter;
openfl_display3D__$internal_agal_AGALConverter.__name__ = "openfl.display3D._internal.agal.AGALConverter";
openfl_display3D__$internal_agal_AGALConverter.prefixFromType = function(regType,programType) {
	switch(regType) {
	case 0:
		return "va";
	case 1:
		if(programType == openfl_display3D__$internal_agal__$AGALConverter_ProgramType.VERTEX) {
			return "vc";
		} else {
			return "fc";
		}
		break;
	case 2:
		if(programType == openfl_display3D__$internal_agal__$AGALConverter_ProgramType.VERTEX) {
			return "vt";
		} else {
			return "ft";
		}
		break;
	case 3:
		return "output_";
	case 4:
		return "v";
	case 5:
		return "sampler";
	default:
		throw haxe_Exception.thrown(new openfl_errors_IllegalOperationError("Invalid data!"));
	}
};
openfl_display3D__$internal_agal_AGALConverter.readUInt64 = function(byteArray) {
	var low = byteArray.readInt();
	var high = byteArray.readInt();
	var this1 = new haxe__$Int64__$_$_$Int64(high,low);
	return this1;
};
openfl_display3D__$internal_agal_AGALConverter.convertToGLSL = function(agal,samplerState) {
	agal.position = 0;
	agal.__endian = 1;
	var magic = agal.readByte() & 255;
	if(magic == 176) {
		return agal.readUTF();
	}
	if(magic != 160) {
		throw haxe_Exception.thrown(new openfl_errors_IllegalOperationError("Magic value must be 0xA0, may not be AGAL"));
	}
	var version = agal.readInt();
	if(version != 1) {
		throw haxe_Exception.thrown(new openfl_errors_IllegalOperationError("Version must be 1"));
	}
	var shaderTypeID = agal.readByte() & 255;
	if(shaderTypeID != 161) {
		throw haxe_Exception.thrown(new openfl_errors_IllegalOperationError("Shader type ID must be 0xA1"));
	}
	var programType = (agal.readByte() & 255) == 0 ? openfl_display3D__$internal_agal__$AGALConverter_ProgramType.VERTEX : openfl_display3D__$internal_agal__$AGALConverter_ProgramType.FRAGMENT;
	var map = new openfl_display3D__$internal_agal_RegisterMap();
	var sb_b = "";
	while(true) {
		var a = agal.position;
		if(!UInt.gt(openfl_utils_ByteArray.get_length(agal),a)) {
			break;
		}
		var opcode = agal.readInt();
		var dest = agal.readUnsignedInt();
		var source1 = openfl_display3D__$internal_agal_AGALConverter.readUInt64(agal);
		var source2 = openfl_display3D__$internal_agal_AGALConverter.readUInt64(agal);
		var dr = openfl_display3D__$internal_agal__$AGALConverter_DestRegister.parse(dest,programType);
		var sr1 = openfl_display3D__$internal_agal__$AGALConverter_SourceRegister.parse(source1,programType,dr.mask);
		var sr2 = openfl_display3D__$internal_agal__$AGALConverter_SourceRegister.parse(source2,programType,dr.mask);
		sb_b += "\t";
		switch(opcode) {
		case 0:
			sb_b += Std.string(dr.toGLSL() + " = " + sr1.toGLSL() + "; // mov");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 1:
			sb_b += Std.string(dr.toGLSL() + " = " + sr1.toGLSL() + " + " + sr2.toGLSL() + "; // add");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 2:
			sb_b += Std.string(dr.toGLSL() + " = " + sr1.toGLSL() + " - " + sr2.toGLSL() + "; // sub");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 3:
			sb_b += Std.string(dr.toGLSL() + " = " + sr1.toGLSL() + " * " + sr2.toGLSL() + "; // mul");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 4:
			sb_b += Std.string(dr.toGLSL() + " = " + sr1.toGLSL() + " / " + sr2.toGLSL() + "; // div");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 5:
			var sr = sr1.toGLSL();
			if(sr.indexOf(".") > -1) {
				sb_b += Std.string(dr.toGLSL() + " = 1.0 / " + sr1.toGLSL() + "; // rcp");
			} else {
				sb_b += Std.string(dr.toGLSL() + " = vec4(1) / " + sr1.toGLSL() + "; // rcp");
			}
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 6:
			sb_b += Std.string(dr.toGLSL() + " = min(" + sr1.toGLSL() + ", " + sr2.toGLSL() + "); // min");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 7:
			sb_b += Std.string(dr.toGLSL() + " = max(" + sr1.toGLSL() + ", " + sr2.toGLSL() + "); // max");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 8:
			sb_b += Std.string(dr.toGLSL() + " = fract(" + sr1.toGLSL() + "); // frc");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 9:
			sb_b += Std.string(dr.toGLSL() + " = sqrt(" + sr1.toGLSL() + "); // sqrt");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 10:
			sb_b += Std.string(dr.toGLSL() + " = inversesqrt(" + sr1.toGLSL() + "); // rsq");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 11:
			sb_b += Std.string(dr.toGLSL() + " = pow(" + sr1.toGLSL() + ", " + sr2.toGLSL() + "); // pow");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 12:
			sb_b += Std.string(dr.toGLSL() + " = log2(" + sr1.toGLSL() + "); // log");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 13:
			sb_b += Std.string(dr.toGLSL() + " = exp2(" + sr1.toGLSL() + "); // exp");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 14:
			sb_b += Std.string(dr.toGLSL() + " = normalize(" + sr1.toGLSL() + "); // normalize");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 15:
			sb_b += Std.string(dr.toGLSL() + " = sin(" + sr1.toGLSL() + "); // sin");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 16:
			sb_b += Std.string(dr.toGLSL() + " = cos(" + sr1.toGLSL() + "); // cos");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 17:
			sr1.sourceMask = sr2.sourceMask = 7;
			sb_b += Std.string(dr.toGLSL() + " = cross(vec3(" + sr1.toGLSL() + "), vec3(" + sr2.toGLSL() + ")); // crs");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 18:
			sr1.sourceMask = sr2.sourceMask = 7;
			sb_b += Std.string(dr.toGLSL() + " = vec4(dot(vec3(" + sr1.toGLSL() + "), vec3(" + sr2.toGLSL() + ")))" + dr.getWriteMask() + "; // dp3");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 19:
			sr1.sourceMask = sr2.sourceMask = 15;
			sb_b += Std.string(dr.toGLSL() + " = vec4(dot(vec4(" + sr1.toGLSL() + "), vec4(" + sr2.toGLSL() + ")))" + dr.getWriteMask() + "; // dp4");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 20:
			sb_b += Std.string(dr.toGLSL() + " = abs(" + sr1.toGLSL() + "); // abs");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 21:
			sb_b += Std.string(dr.toGLSL() + " = -" + sr1.toGLSL() + "; // neg");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 22:
			sb_b += Std.string(dr.toGLSL() + " = clamp(" + sr1.toGLSL() + ", 0.0, 1.0); // saturate");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 23:
			var existingUsage = map.getRegisterUsage(sr2);
			if(existingUsage != openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4 && existingUsage != openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4_ARRAY) {
				sb_b += Std.string(dr.toGLSL() + " = " + sr1.toGLSL() + " * mat3(" + sr2.toGLSL(false) + "); // m33");
				map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
				map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
				map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.MATRIX_4_4);
			} else {
				sr1.sourceMask = sr2.sourceMask = 7;
				sb_b += Std.string(dr.toGLSL() + " = vec3(" + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,0) + "), " + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,1) + ")," + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,2) + ")); // m33");
				map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
				map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
				map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4,0);
				map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4,1);
				map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4,2);
			}
			break;
		case 24:
			var existingUsage1 = map.getRegisterUsage(sr2);
			if(existingUsage1 != openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4 && existingUsage1 != openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4_ARRAY) {
				sb_b += Std.string(dr.toGLSL() + " = " + sr1.toGLSL() + " * " + sr2.toGLSL(false) + "; // m44");
				map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
				map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
				map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.MATRIX_4_4);
			} else {
				sr1.sourceMask = sr2.sourceMask = 15;
				sb_b += Std.string(dr.toGLSL() + " = vec4(" + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,0) + "), " + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,1) + "), " + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,2) + "), " + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,3) + ")); // m44");
				map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
				map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
				map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4,0);
				map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4,1);
				map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4,2);
				map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4,3);
			}
			break;
		case 25:
			dr.mask &= 7;
			var existingUsage2 = map.getRegisterUsage(sr2);
			if(existingUsage2 != openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4 && existingUsage2 != openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4_ARRAY) {
				sb_b += Std.string(dr.toGLSL() + " = " + sr1.toGLSL() + " * " + sr2.toGLSL(false) + "; // m34");
				map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
				map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
				map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.MATRIX_4_4);
			} else {
				sr1.sourceMask = sr2.sourceMask = 15;
				sb_b += Std.string(dr.toGLSL() + " = vec3(" + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,0) + "), " + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,1) + ")," + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,2) + ")); // m34");
				map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
				map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
				map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4,0);
				map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4,1);
				map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4,2);
			}
			break;
		case 39:
			sr1.sourceMask = 15;
			sb_b += Std.string("if (any(lessThan(" + sr1.toGLSL() + ", vec4(0)))) discard;");
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 40:
			var sampler = openfl_display3D__$internal_agal__$AGALConverter_SamplerRegister.parse(source2,programType);
			switch(sampler.d) {
			case 0:
				if(sampler.t == 2) {
					sr1.sourceMask = 3;
					map.addSaR(sampler,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.SAMPLER_2D_ALPHA);
					sb_b += Std.string("if (" + sampler.toGLSL() + "_alphaEnabled) {\n");
					sb_b += Std.string("\t\t" + dr.toGLSL() + " = vec4(texture2D(" + sampler.toGLSL() + ", " + sr1.toGLSL() + ").xyz, texture2D(" + sampler.toGLSL() + "_alpha, " + sr1.toGLSL() + ").x); // tex + alpha\n");
					sb_b += "\t} else {\n";
					sb_b += Std.string("\t\t" + dr.toGLSL() + " = texture2D(" + sampler.toGLSL() + ", " + sr1.toGLSL() + "); // tex\n");
					sb_b += "\t}";
				} else {
					sr1.sourceMask = 3;
					map.addSaR(sampler,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.SAMPLER_2D);
					sb_b += Std.string(dr.toGLSL() + " = texture2D(" + sampler.toGLSL() + ", " + sr1.toGLSL() + "); // tex");
				}
				break;
			case 1:
				if(sampler.t == 2) {
					sr1.sourceMask = 7;
					map.addSaR(sampler,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.SAMPLER_CUBE_ALPHA);
					sb_b += Std.string("if (" + sampler.toGLSL() + "_alphaEnabled) {\n");
					sb_b += Std.string("\t\t" + dr.toGLSL() + " = vec4(textureCube(" + sampler.toGLSL() + ", " + sr1.toGLSL() + ").xyz, textureCube(" + sampler.toGLSL() + "_alpha, " + sr1.toGLSL() + ").x); // tex + alpha\n");
					sb_b += "\t} else {\n";
					sb_b += Std.string("\t\t" + dr.toGLSL() + " = textureCube(" + sampler.toGLSL() + ", " + sr1.toGLSL() + "); // tex");
					sb_b += "\t}";
				} else {
					sr1.sourceMask = 7;
					sb_b += Std.string(dr.toGLSL() + " = textureCube(" + sampler.toGLSL() + ", " + sr1.toGLSL() + "); // tex");
					map.addSaR(sampler,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.SAMPLER_CUBE);
				}
				break;
			}
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			if(samplerState != null) {
				samplerState[sampler.n] = sampler.toSamplerState();
			}
			break;
		case 41:
			sr1.sourceMask = sr2.sourceMask = 15;
			sb_b += Std.string(dr.toGLSL() + " = vec4(greaterThanEqual(" + sr1.toGLSL() + ", " + sr2.toGLSL() + "))" + dr.getWriteMask() + "; // ste");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 42:
			sr1.sourceMask = sr2.sourceMask = 15;
			sb_b += Std.string(dr.toGLSL() + " = vec4(lessThan(" + sr1.toGLSL() + ", " + sr2.toGLSL() + "))" + dr.getWriteMask() + "; // slt");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 44:
			sr1.sourceMask = sr2.sourceMask = 15;
			sb_b += Std.string(dr.toGLSL() + " = vec4(equal(" + sr1.toGLSL() + ", " + sr2.toGLSL() + "))" + dr.getWriteMask() + "; // seq");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 45:
			sr1.sourceMask = sr2.sourceMask = 15;
			sb_b += Std.string(dr.toGLSL() + " = vec4(notEqual(" + sr1.toGLSL() + ", " + sr2.toGLSL() + "))" + dr.getWriteMask() + "; // sne");
			map.addDR(dr,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		default:
			throw haxe_Exception.thrown(new openfl_errors_IllegalOperationError("Opcode " + opcode));
		}
		sb_b += "\n";
	}
	if(openfl_display3D__$internal_agal_AGALConverter.limitedProfile == null) {
		var version = lime_graphics_opengl_GL.context.getParameter(7938);
		openfl_display3D__$internal_agal_AGALConverter.limitedProfile = version.indexOf("OpenGL ES") > -1 || version.indexOf("WebGL") > -1;
	}
	var glsl_b = "";
	glsl_b += Std.string("// AGAL " + (programType == openfl_display3D__$internal_agal__$AGALConverter_ProgramType.VERTEX ? "vertex" : "fragment") + " shader\n");
	if(openfl_display3D__$internal_agal_AGALConverter.limitedProfile) {
		glsl_b += "#version 100\n";
		glsl_b += "#ifdef GL_FRAGMENT_PRECISION_HIGH\n";
		glsl_b += "precision highp float;\n";
		glsl_b += "#else\n";
		glsl_b += "precision mediump float;\n";
		glsl_b += "#endif\n";
	} else {
		glsl_b += "#version 120\n";
	}
	glsl_b += Std.string(map.toGLSL(false));
	if(programType == openfl_display3D__$internal_agal__$AGALConverter_ProgramType.VERTEX) {
		glsl_b += "uniform vec4 vcPositionScale;\n";
	}
	glsl_b += "void main() {\n";
	glsl_b += Std.string(map.toGLSL(true));
	glsl_b += Std.string(sb_b);
	if(programType == openfl_display3D__$internal_agal__$AGALConverter_ProgramType.VERTEX) {
		glsl_b += "\tgl_Position *= vcPositionScale;\n";
	}
	glsl_b += "}\n";
	return glsl_b;
};
var openfl_display3D__$internal_agal__$AGALConverter_DestRegister = function() {
};
$hxClasses["openfl.display3D._internal.agal._AGALConverter.DestRegister"] = openfl_display3D__$internal_agal__$AGALConverter_DestRegister;
openfl_display3D__$internal_agal__$AGALConverter_DestRegister.__name__ = "openfl.display3D._internal.agal._AGALConverter.DestRegister";
openfl_display3D__$internal_agal__$AGALConverter_DestRegister.parse = function(v,programType) {
	var dr = new openfl_display3D__$internal_agal__$AGALConverter_DestRegister();
	dr.programType = programType;
	dr.type = v >>> 24 & 15;
	dr.mask = v >>> 16 & 15;
	dr.n = v & 65535;
	return dr;
};
openfl_display3D__$internal_agal__$AGALConverter_DestRegister.prototype = {
	mask: null
	,n: null
	,programType: null
	,type: null
	,getWriteMask: function() {
		var str = ".";
		if((this.mask & 1) != 0) {
			str += "x";
		}
		if((this.mask & 2) != 0) {
			str += "y";
		}
		if((this.mask & 4) != 0) {
			str += "z";
		}
		if((this.mask & 8) != 0) {
			str += "w";
		}
		return str;
	}
	,toGLSL: function(useMask) {
		if(useMask == null) {
			useMask = true;
		}
		var str;
		if(this.type == 3) {
			str = this.programType == openfl_display3D__$internal_agal__$AGALConverter_ProgramType.VERTEX ? "gl_Position" : "gl_FragColor";
		} else {
			str = openfl_display3D__$internal_agal_AGALConverter.prefixFromType(this.type,this.programType) + this.n;
		}
		if(useMask && this.mask != 15) {
			str += this.getWriteMask();
		}
		return str;
	}
	,__class__: openfl_display3D__$internal_agal__$AGALConverter_DestRegister
};
var openfl_display3D__$internal_agal__$AGALConverter_ProgramType = $hxEnums["openfl.display3D._internal.agal._AGALConverter.ProgramType"] = { __ename__ : "openfl.display3D._internal.agal._AGALConverter.ProgramType", __constructs__ : ["VERTEX","FRAGMENT"]
	,VERTEX: {_hx_index:0,__enum__:"openfl.display3D._internal.agal._AGALConverter.ProgramType",toString:$estr}
	,FRAGMENT: {_hx_index:1,__enum__:"openfl.display3D._internal.agal._AGALConverter.ProgramType",toString:$estr}
};
var openfl_display3D__$internal_agal_RegisterMap = function() {
	this.mEntries = [];
};
$hxClasses["openfl.display3D._internal.agal.RegisterMap"] = openfl_display3D__$internal_agal_RegisterMap;
openfl_display3D__$internal_agal_RegisterMap.__name__ = "openfl.display3D._internal.agal.RegisterMap";
openfl_display3D__$internal_agal_RegisterMap.prototype = {
	mEntries: null
	,add: function(type,name,number,usage) {
		var _g = 0;
		var _g1 = this.mEntries;
		while(_g < _g1.length) {
			var entry = _g1[_g];
			++_g;
			if(entry.type == type && entry.name == name && entry.number == number) {
				if(entry.usage != usage) {
					throw haxe_Exception.thrown(new openfl_errors_IllegalOperationError("Cannot use register in multiple ways yet (mat4/vec4)"));
				}
				return;
			}
		}
		var entry = new openfl_display3D__$internal_agal__$AGALConverter_RegisterMapEntry();
		entry.type = type;
		entry.name = name;
		entry.number = number;
		entry.usage = usage;
		this.mEntries.push(entry);
	}
	,addDR: function(dr,usage) {
		this.add(dr.type,dr.toGLSL(false),dr.n,usage);
	}
	,addSaR: function(sr,usage) {
		this.add(sr.type,sr.toGLSL(),sr.n,usage);
	}
	,addSR: function(sr,usage,offset) {
		if(offset == null) {
			offset = 0;
		}
		if(sr.d != 0) {
			this.add(sr.itype,openfl_display3D__$internal_agal_AGALConverter.prefixFromType(sr.itype,sr.programType) + sr.n,sr.n,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4);
			this.add(sr.type,openfl_display3D__$internal_agal_AGALConverter.prefixFromType(sr.type,sr.programType) + sr.o,sr.o,openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4_ARRAY);
			return;
		}
		this.add(sr.type,sr.toGLSL(false,offset),sr.n + offset,usage);
	}
	,getRegisterUsage: function(sr) {
		if(sr.d != 0) {
			return openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4_ARRAY;
		}
		return this.getUsage(sr.type,sr.toGLSL(false),sr.n);
	}
	,getUsage: function(type,name,number) {
		var _g = 0;
		var _g1 = this.mEntries;
		while(_g < _g1.length) {
			var entry = _g1[_g];
			++_g;
			if(entry.type == type && entry.name == name && entry.number == number) {
				return entry.usage;
			}
		}
		return openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.UNUSED;
	}
	,toGLSL: function(tempRegistersOnly) {
		this.mEntries.sort(function(a,b) {
			return a.number - b.number;
		});
		var entry;
		this.mEntries.sort(function(a,b) {
			return js_Boot.__cast(a.type , Int) - js_Boot.__cast(b.type , Int);
		});
		var sb_b = "";
		var _g = 0;
		var _g1 = this.mEntries.length;
		while(_g < _g1) {
			var i = _g++;
			entry = this.mEntries[i];
			if(tempRegistersOnly && entry.type != 2 || !tempRegistersOnly && entry.type == 2) {
				continue;
			}
			if(entry.type == 3) {
				continue;
			}
			switch(entry.type) {
			case 0:
				sb_b += "attribute ";
				break;
			case 1:
				sb_b += "uniform ";
				break;
			case 2:
				sb_b += "\t";
				break;
			case 3:
				break;
			case 4:
				sb_b += "varying ";
				break;
			case 5:
				sb_b += "uniform ";
				break;
			default:
				throw haxe_Exception.thrown(new openfl_errors_IllegalOperationError());
			}
			switch(entry.usage._hx_index) {
			case 0:
				lime_utils_Log.info("Missing switch patten: RegisterUsage.UNUSED",{ fileName : "openfl/display3D/_internal/agal/AGALConverter.hx", lineNumber : 750, className : "openfl.display3D._internal.agal.RegisterMap", methodName : "toGLSL"});
				break;
			case 1:
				sb_b += "vec4 ";
				break;
			case 2:
				sb_b += "mat4 ";
				break;
			case 3:
				sb_b += "sampler2D ";
				break;
			case 4:
				break;
			case 5:
				sb_b += "samplerCube ";
				break;
			case 6:
				break;
			case 7:
				sb_b += "vec4 ";
				break;
			}
			if(entry.usage == openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.SAMPLER_2D_ALPHA) {
				sb_b += "sampler2D ";
				sb_b += Std.string(entry.name);
				sb_b += ";\n";
				sb_b += "uniform ";
				sb_b += "sampler2D ";
				sb_b += Std.string(entry.name + "_alpha");
				sb_b += ";\n";
				sb_b += "uniform ";
				sb_b += "bool ";
				sb_b += Std.string(entry.name + "_alphaEnabled");
				sb_b += ";\n";
			} else if(entry.usage == openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.SAMPLER_CUBE_ALPHA) {
				sb_b += "samplerCube ";
				sb_b += Std.string(entry.name);
				sb_b += ";\n";
				sb_b += "uniform ";
				sb_b += "samplerCube ";
				sb_b += Std.string(entry.name + "_alpha");
				sb_b += ";\n";
				sb_b += "uniform ";
				sb_b += "bool ";
				sb_b += Std.string(entry.name + "_alphaEnabled");
				sb_b += ";\n";
			} else if(entry.usage == openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage.VECTOR_4_ARRAY) {
				sb_b += Std.string(entry.name + "[128]");
				sb_b += ";\n";
			} else {
				sb_b += Std.string(entry.name);
				sb_b += ";\n";
			}
		}
		return sb_b;
	}
	,__class__: openfl_display3D__$internal_agal_RegisterMap
};
var openfl_display3D__$internal_agal__$AGALConverter_RegisterMapEntry = function() {
};
$hxClasses["openfl.display3D._internal.agal._AGALConverter.RegisterMapEntry"] = openfl_display3D__$internal_agal__$AGALConverter_RegisterMapEntry;
openfl_display3D__$internal_agal__$AGALConverter_RegisterMapEntry.__name__ = "openfl.display3D._internal.agal._AGALConverter.RegisterMapEntry";
openfl_display3D__$internal_agal__$AGALConverter_RegisterMapEntry.prototype = {
	name: null
	,number: null
	,type: null
	,usage: null
	,__class__: openfl_display3D__$internal_agal__$AGALConverter_RegisterMapEntry
};
var openfl_display3D__$internal_agal__$AGALConverter_RegisterUsage = $hxEnums["openfl.display3D._internal.agal._AGALConverter.RegisterUsage"] = { __ename__ : "openfl.display3D._internal.agal._AGALConverter.RegisterUsage", __constructs__ : ["UNUSED","VECTOR_4","MATRIX_4_4","SAMPLER_2D","SAMPLER_2D_ALPHA","SAMPLER_CUBE","SAMPLER_CUBE_ALPHA","VECTOR_4_ARRAY"]
	,UNUSED: {_hx_index:0,__enum__:"openfl.display3D._internal.agal._AGALConverter.RegisterUsage",toString:$estr}
	,VECTOR_4: {_hx_index:1,__enum__:"openfl.display3D._internal.agal._AGALConverter.RegisterUsage",toString:$estr}
	,MATRIX_4_4: {_hx_index:2,__enum__:"openfl.display3D._internal.agal._AGALConverter.RegisterUsage",toString:$estr}
	,SAMPLER_2D: {_hx_index:3,__enum__:"openfl.display3D._internal.agal._AGALConverter.RegisterUsage",toString:$estr}
	,SAMPLER_2D_ALPHA: {_hx_index:4,__enum__:"openfl.display3D._internal.agal._AGALConverter.RegisterUsage",toString:$estr}
	,SAMPLER_CUBE: {_hx_index:5,__enum__:"openfl.display3D._internal.agal._AGALConverter.RegisterUsage",toString:$estr}
	,SAMPLER_CUBE_ALPHA: {_hx_index:6,__enum__:"openfl.display3D._internal.agal._AGALConverter.RegisterUsage",toString:$estr}
	,VECTOR_4_ARRAY: {_hx_index:7,__enum__:"openfl.display3D._internal.agal._AGALConverter.RegisterUsage",toString:$estr}
};
var openfl_display3D__$internal_agal__$AGALConverter_SamplerRegister = function() {
};
$hxClasses["openfl.display3D._internal.agal._AGALConverter.SamplerRegister"] = openfl_display3D__$internal_agal__$AGALConverter_SamplerRegister;
openfl_display3D__$internal_agal__$AGALConverter_SamplerRegister.__name__ = "openfl.display3D._internal.agal._AGALConverter.SamplerRegister";
openfl_display3D__$internal_agal__$AGALConverter_SamplerRegister.parse = function(v,programType) {
	var sr = new openfl_display3D__$internal_agal__$AGALConverter_SamplerRegister();
	sr.programType = programType;
	var b = 60;
	b &= 63;
	var a;
	if(b == 0) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high,v.low);
		a = this1;
	} else if(b < 32) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b);
		a = this1;
	} else {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
		a = this1;
	}
	var b_high = 0;
	var b_low = 15;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.f = this_low;
	var b = 56;
	b &= 63;
	var a;
	if(b == 0) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high,v.low);
		a = this1;
	} else if(b < 32) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b);
		a = this1;
	} else {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
		a = this1;
	}
	var b_high = 0;
	var b_low = 15;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.m = this_low;
	var b = 52;
	b &= 63;
	var a;
	if(b == 0) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high,v.low);
		a = this1;
	} else if(b < 32) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b);
		a = this1;
	} else {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
		a = this1;
	}
	var b_high = 0;
	var b_low = 15;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.w = this_low;
	var b = 48;
	b &= 63;
	var a;
	if(b == 0) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high,v.low);
		a = this1;
	} else if(b < 32) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b);
		a = this1;
	} else {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
		a = this1;
	}
	var b_high = 0;
	var b_low = 15;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.s = this_low;
	var b = 44;
	b &= 63;
	var a;
	if(b == 0) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high,v.low);
		a = this1;
	} else if(b < 32) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b);
		a = this1;
	} else {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
		a = this1;
	}
	var b_high = 0;
	var b_low = 15;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.d = this_low;
	var b = 40;
	b &= 63;
	var a;
	if(b == 0) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high,v.low);
		a = this1;
	} else if(b < 32) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b);
		a = this1;
	} else {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
		a = this1;
	}
	var b_high = 0;
	var b_low = 15;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.t = this_low;
	var b = 32;
	b &= 63;
	var a;
	if(b == 0) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high,v.low);
		a = this1;
	} else if(b < 32) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b);
		a = this1;
	} else {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
		a = this1;
	}
	var b_high = 0;
	var b_low = 15;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.type = this_low;
	var b = 16;
	b &= 63;
	var a;
	if(b == 0) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high,v.low);
		a = this1;
	} else if(b < 32) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b);
		a = this1;
	} else {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
		a = this1;
	}
	var b_high = 0;
	var b_low = 255;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.b = this_low;
	var b_high = 0;
	var b_low = 65535;
	var this_high = v.high & b_high;
	var this_low = v.low & b_low;
	sr.n = this_low;
	return sr;
};
openfl_display3D__$internal_agal__$AGALConverter_SamplerRegister.prototype = {
	b: null
	,d: null
	,f: null
	,m: null
	,n: null
	,programType: null
	,s: null
	,t: null
	,type: null
	,w: null
	,toGLSL: function() {
		var str = openfl_display3D__$internal_agal_AGALConverter.prefixFromType(this.type,this.programType) + this.n;
		return str;
	}
	,toSamplerState: function() {
		var wrap;
		var filter;
		var mipfilter;
		switch(this.f) {
		case 0:
			filter = 5;
			break;
		case 1:
			filter = 4;
			break;
		default:
			throw haxe_Exception.thrown(new openfl_errors_IllegalOperationError());
		}
		switch(this.m) {
		case 0:
			mipfilter = 2;
			break;
		case 1:
			mipfilter = 1;
			break;
		case 2:
			mipfilter = 0;
			break;
		default:
			throw haxe_Exception.thrown(new openfl_errors_IllegalOperationError());
		}
		switch(this.w) {
		case 0:
			wrap = 0;
			break;
		case 1:
			wrap = 2;
			break;
		default:
			throw haxe_Exception.thrown(new openfl_errors_IllegalOperationError());
		}
		var ignoreSampler = (this.s & 4) == 4;
		var centroid = (this.s & 1) == 1;
		var textureAlpha = this.t == 2;
		var lodBias = (this.b << 24 >> 24) / 8.0;
		return new openfl_display__$internal_SamplerState(wrap,filter,mipfilter,lodBias,ignoreSampler,centroid,textureAlpha);
	}
	,__class__: openfl_display3D__$internal_agal__$AGALConverter_SamplerRegister
};
var openfl_display3D__$internal_agal__$AGALConverter_SourceRegister = function() {
};
$hxClasses["openfl.display3D._internal.agal._AGALConverter.SourceRegister"] = openfl_display3D__$internal_agal__$AGALConverter_SourceRegister;
openfl_display3D__$internal_agal__$AGALConverter_SourceRegister.__name__ = "openfl.display3D._internal.agal._AGALConverter.SourceRegister";
openfl_display3D__$internal_agal__$AGALConverter_SourceRegister.parse = function(v,programType,sourceMask) {
	var sr = new openfl_display3D__$internal_agal__$AGALConverter_SourceRegister();
	sr.programType = programType;
	var b = 63;
	b &= 63;
	var a;
	if(b == 0) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high,v.low);
		a = this1;
	} else if(b < 32) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b);
		a = this1;
	} else {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
		a = this1;
	}
	var b_high = 0;
	var b_low = 1;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.d = this_low;
	var b = 48;
	b &= 63;
	var a;
	if(b == 0) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high,v.low);
		a = this1;
	} else if(b < 32) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b);
		a = this1;
	} else {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
		a = this1;
	}
	var b_high = 0;
	var b_low = 3;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.q = this_low;
	var b = 40;
	b &= 63;
	var a;
	if(b == 0) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high,v.low);
		a = this1;
	} else if(b < 32) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b);
		a = this1;
	} else {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
		a = this1;
	}
	var b_high = 0;
	var b_low = 15;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.itype = this_low;
	var b = 32;
	b &= 63;
	var a;
	if(b == 0) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high,v.low);
		a = this1;
	} else if(b < 32) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b);
		a = this1;
	} else {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
		a = this1;
	}
	var b_high = 0;
	var b_low = 15;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.type = this_low;
	var b = 24;
	b &= 63;
	var a;
	if(b == 0) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high,v.low);
		a = this1;
	} else if(b < 32) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b);
		a = this1;
	} else {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
		a = this1;
	}
	var b_high = 0;
	var b_low = 255;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.s = this_low;
	var b = 16;
	b &= 63;
	var a;
	if(b == 0) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high,v.low);
		a = this1;
	} else if(b < 32) {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b);
		a = this1;
	} else {
		var this1 = new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
		a = this1;
	}
	var b_high = 0;
	var b_low = 255;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.o = this_low;
	var b_high = 0;
	var b_low = 65535;
	var this_high = v.high & b_high;
	var this_low = v.low & b_low;
	sr.n = this_low;
	sr.sourceMask = sourceMask;
	return sr;
};
openfl_display3D__$internal_agal__$AGALConverter_SourceRegister.prototype = {
	d: null
	,itype: null
	,n: null
	,o: null
	,programType: null
	,q: null
	,s: null
	,sourceMask: null
	,type: null
	,toGLSL: function(emitSwizzle,offset) {
		if(offset == null) {
			offset = 0;
		}
		if(emitSwizzle == null) {
			emitSwizzle = true;
		}
		if(this.type == 3) {
			if(this.programType == openfl_display3D__$internal_agal__$AGALConverter_ProgramType.VERTEX) {
				return "gl_Position";
			} else {
				return "gl_FragColor";
			}
		}
		var fullxyzw = this.s == 228 && this.sourceMask == 15;
		var swizzle = "";
		if(this.type != 5 && !fullxyzw) {
			if((this.sourceMask & 1) != 0) {
				switch(this.s & 3) {
				case 0:
					swizzle += "x";
					break;
				case 1:
					swizzle += "y";
					break;
				case 2:
					swizzle += "z";
					break;
				case 3:
					swizzle += "w";
					break;
				}
			}
			if((this.sourceMask & 2) != 0) {
				switch(this.s >> 2 & 3) {
				case 0:
					swizzle += "x";
					break;
				case 1:
					swizzle += "y";
					break;
				case 2:
					swizzle += "z";
					break;
				case 3:
					swizzle += "w";
					break;
				}
			}
			if((this.sourceMask & 4) != 0) {
				switch(this.s >> 4 & 3) {
				case 0:
					swizzle += "x";
					break;
				case 1:
					swizzle += "y";
					break;
				case 2:
					swizzle += "z";
					break;
				case 3:
					swizzle += "w";
					break;
				}
			}
			if((this.sourceMask & 8) != 0) {
				switch(this.s >> 6 & 3) {
				case 0:
					swizzle += "x";
					break;
				case 1:
					swizzle += "y";
					break;
				case 2:
					swizzle += "z";
					break;
				case 3:
					swizzle += "w";
					break;
				}
			}
		}
		var str = openfl_display3D__$internal_agal_AGALConverter.prefixFromType(this.type,this.programType);
		if(this.d == 0) {
			str += this.n + offset;
		} else {
			str += this.o;
			var indexComponent = "";
			switch(this.q) {
			case 0:
				indexComponent = "x";
				break;
			case 1:
				indexComponent = "y";
				break;
			case 2:
				indexComponent = "z";
				break;
			case 3:
				indexComponent = "w";
				break;
			}
			var indexRegister = openfl_display3D__$internal_agal_AGALConverter.prefixFromType(this.itype,this.programType) + this.n + "." + indexComponent;
			str += "[ int(" + indexRegister + ") +" + offset + "]";
		}
		if(emitSwizzle && swizzle != "") {
			str += "." + swizzle;
		}
		return str;
	}
	,__class__: openfl_display3D__$internal_agal__$AGALConverter_SourceRegister
};
var openfl_display3D__$internal_atf_ATFReader = function(data,byteArrayOffset) {
	this.version = 0;
	data.position = byteArrayOffset;
	var signature = data.readUTFBytes(3);
	data.position = byteArrayOffset;
	if(signature != "ATF") {
		throw haxe_Exception.thrown(new openfl_errors_IllegalOperationError("ATF signature not found"));
	}
	var length = 0;
	if(data.b[byteArrayOffset + 6] == 255) {
		this.version = data.b[byteArrayOffset + 7];
		data.position = byteArrayOffset + 8;
		length = this.__readUInt32(data);
	} else {
		this.version = 0;
		data.position = byteArrayOffset + 3;
		length = this.__readUInt24(data);
	}
	if(UInt.gt(js_Boot.__cast(byteArrayOffset + length , Int),openfl_utils_ByteArray.get_length(data))) {
		throw haxe_Exception.thrown(new openfl_errors_IllegalOperationError("ATF length exceeds byte array length"));
	}
	this.data = data;
};
$hxClasses["openfl.display3D._internal.atf.ATFReader"] = openfl_display3D__$internal_atf_ATFReader;
openfl_display3D__$internal_atf_ATFReader.__name__ = "openfl.display3D._internal.atf.ATFReader";
openfl_display3D__$internal_atf_ATFReader.prototype = {
	atfFormat: null
	,cubeMap: null
	,data: null
	,height: null
	,mipCount: null
	,version: null
	,width: null
	,readHeader: function(__width,__height,cubeMap) {
		var tdata = this.data.readUnsignedByte();
		var type = tdata >>> 7;
		if(!cubeMap && type != 0) {
			throw haxe_Exception.thrown(new openfl_errors_IllegalOperationError("ATF Cube map not expected"));
		}
		if(cubeMap && type != 1) {
			throw haxe_Exception.thrown(new openfl_errors_IllegalOperationError("ATF Cube map expected"));
		}
		this.cubeMap = cubeMap;
		this.atfFormat = tdata & 127;
		if(this.atfFormat != 3 && this.atfFormat != 5) {
			lime_utils_Log.warn("Only ATF block compressed textures without JPEG-XR+LZMA are supported",{ fileName : "openfl/display3D/_internal/atf/ATFReader.hx", lineNumber : 96, className : "openfl.display3D._internal.atf.ATFReader", methodName : "readHeader"});
		}
		this.width = 1 << this.data.readUnsignedByte();
		this.height = 1 << this.data.readUnsignedByte();
		if(this.width != __width || this.height != __height) {
			throw haxe_Exception.thrown(new openfl_errors_IllegalOperationError("ATF width and height dont match"));
		}
		this.mipCount = this.data.readUnsignedByte();
		return this.atfFormat == 5;
	}
	,readTextures: function(uploadCallback) {
		var gpuFormats = this.version < 3 ? 3 : 4;
		var sideCount = this.cubeMap ? 6 : 1;
		var _g = 0;
		var _g1 = sideCount;
		while(_g < _g1) {
			var side = _g++;
			var _g2 = 0;
			var _g3 = this.mipCount;
			while(_g2 < _g3) {
				var level = _g2++;
				var _g4 = 0;
				var _g5 = gpuFormats;
				while(_g4 < _g5) {
					var gpuFormat = _g4++;
					var blockLength = this.version == 0 ? this.__readUInt24(this.data) : this.__readUInt32(this.data);
					if(UInt.gt(this.data.position + blockLength,openfl_utils_ByteArray.get_length(this.data))) {
						throw haxe_Exception.thrown(new openfl_errors_IllegalOperationError("Block length exceeds ATF file length"));
					}
					if(UInt.gt(blockLength,0)) {
						var bytes = new haxe_io_Bytes(new ArrayBuffer(blockLength));
						var this1 = this.data;
						var bytes1 = openfl_utils_ByteArray.fromBytes(bytes);
						var offset = 0;
						var length = blockLength;
						if(length == null) {
							length = 0;
						}
						if(offset == null) {
							offset = 0;
						}
						this1.readBytes(bytes1,offset,length);
						uploadCallback(side,level,gpuFormat,this.width >> level,this.height >> level,blockLength,bytes);
					}
				}
			}
		}
	}
	,__readUInt24: function(data) {
		var value = data.readUnsignedByte() << 16;
		value = value | data.readUnsignedByte() << 8;
		value = value | data.readUnsignedByte();
		return value;
	}
	,__readUInt32: function(data) {
		var value = data.readUnsignedByte() << 24;
		value = value | data.readUnsignedByte() << 16;
		value = value | data.readUnsignedByte() << 8;
		value = value | data.readUnsignedByte();
		return value;
	}
	,__class__: openfl_display3D__$internal_atf_ATFReader
};
var openfl_display3D_textures_TextureBase = function(context) {
	openfl_events_EventDispatcher.call(this);
	this.__context = context;
	var gl = this.__context.gl;
	this.__textureID = gl.createTexture();
	this.__textureContext = this.__context.__context;
	if(openfl_display3D_textures_TextureBase.__supportsBGRA == null) {
		openfl_display3D_textures_TextureBase.__textureInternalFormat = gl.RGBA;
		var bgraExtension = null;
		if(bgraExtension != null) {
			openfl_display3D_textures_TextureBase.__supportsBGRA = true;
			openfl_display3D_textures_TextureBase.__textureFormat = bgraExtension.BGRA_EXT;
			if(context.__context.type == "opengles") {
				openfl_display3D_textures_TextureBase.__textureInternalFormat = bgraExtension.BGRA_EXT;
			}
		} else {
			openfl_display3D_textures_TextureBase.__supportsBGRA = false;
			openfl_display3D_textures_TextureBase.__textureFormat = gl.RGBA;
		}
		openfl_display3D_textures_TextureBase.__compressedFormats = new haxe_ds_IntMap();
		openfl_display3D_textures_TextureBase.__compressedFormatsAlpha = new haxe_ds_IntMap();
		var dxtExtension = gl.getExtension("WEBGL_compressed_texture_s3tc");
		var etc1Extension = gl.getExtension("WEBGL_compressed_texture_etc1");
		var pvrtcExtension = gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
		if(dxtExtension != null) {
			var v = dxtExtension.COMPRESSED_RGBA_S3TC_DXT1_EXT;
			openfl_display3D_textures_TextureBase.__compressedFormats.h[0] = v;
			var v = dxtExtension.COMPRESSED_RGBA_S3TC_DXT5_EXT;
			openfl_display3D_textures_TextureBase.__compressedFormatsAlpha.h[0] = v;
		}
		if(etc1Extension != null) {
			var v = etc1Extension.COMPRESSED_RGB_ETC1_WEBGL;
			openfl_display3D_textures_TextureBase.__compressedFormats.h[2] = v;
			var v = etc1Extension.COMPRESSED_RGB_ETC1_WEBGL;
			openfl_display3D_textures_TextureBase.__compressedFormatsAlpha.h[2] = v;
		}
		if(pvrtcExtension != null) {
			var v = pvrtcExtension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
			openfl_display3D_textures_TextureBase.__compressedFormats.h[1] = v;
			var v = pvrtcExtension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
			openfl_display3D_textures_TextureBase.__compressedFormatsAlpha.h[1] = v;
		}
	}
	this.__internalFormat = openfl_display3D_textures_TextureBase.__textureInternalFormat;
	this.__format = openfl_display3D_textures_TextureBase.__textureFormat;
};
$hxClasses["openfl.display3D.textures.TextureBase"] = openfl_display3D_textures_TextureBase;
openfl_display3D_textures_TextureBase.__name__ = "openfl.display3D.textures.TextureBase";
openfl_display3D_textures_TextureBase.__compressedFormats = null;
openfl_display3D_textures_TextureBase.__compressedFormatsAlpha = null;
openfl_display3D_textures_TextureBase.__textureFormat = null;
openfl_display3D_textures_TextureBase.__textureInternalFormat = null;
openfl_display3D_textures_TextureBase.__super__ = openfl_events_EventDispatcher;
openfl_display3D_textures_TextureBase.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	__alphaTexture: null
	,__context: null
	,__format: null
	,__glDepthRenderbuffer: null
	,__glFramebuffer: null
	,__glStencilRenderbuffer: null
	,__height: null
	,__internalFormat: null
	,__optimizeForRenderToTexture: null
	,__samplerState: null
	,__streamingLevels: null
	,__textureContext: null
	,__textureID: null
	,__textureTarget: null
	,__width: null
	,dispose: function() {
		var gl = this.__context.gl;
		if(this.__alphaTexture != null) {
			this.__alphaTexture.dispose();
			this.__alphaTexture = null;
		}
		if(this.__textureID != null) {
			gl.deleteTexture(this.__textureID);
			this.__textureID = null;
		}
		if(this.__glFramebuffer != null) {
			gl.deleteFramebuffer(this.__glFramebuffer);
			this.__glFramebuffer = null;
		}
		if(this.__glDepthRenderbuffer != null) {
			gl.deleteRenderbuffer(this.__glDepthRenderbuffer);
			this.__glDepthRenderbuffer = null;
		}
		if(this.__glStencilRenderbuffer != null) {
			gl.deleteRenderbuffer(this.__glStencilRenderbuffer);
			this.__glStencilRenderbuffer = null;
		}
	}
	,__getGLFramebuffer: function(enableDepthAndStencil,antiAlias,surfaceSelector) {
		var gl = this.__context.gl;
		if(this.__glFramebuffer == null) {
			this.__glFramebuffer = gl.createFramebuffer();
			this.__context.__bindGLFramebuffer(this.__glFramebuffer);
			gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_2D,this.__textureID,0);
			if(this.__context.__enableErrorChecking) {
				var code = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
				if(code != gl.FRAMEBUFFER_COMPLETE) {
					lime_utils_Log.warn("Error: Context3D.setRenderToTexture status:" + code + " width:" + this.__width + " height:" + this.__height,{ fileName : "openfl/display3D/textures/TextureBase.hx", lineNumber : 201, className : "openfl.display3D.textures.TextureBase", methodName : "__getGLFramebuffer"});
				}
			}
		}
		if(enableDepthAndStencil && this.__glDepthRenderbuffer == null) {
			this.__context.__bindGLFramebuffer(this.__glFramebuffer);
			if(openfl_display3D_Context3D.__glDepthStencil != 0) {
				this.__glDepthRenderbuffer = gl.createRenderbuffer();
				this.__glStencilRenderbuffer = this.__glDepthRenderbuffer;
				gl.bindRenderbuffer(gl.RENDERBUFFER,this.__glDepthRenderbuffer);
				gl.renderbufferStorage(gl.RENDERBUFFER,openfl_display3D_Context3D.__glDepthStencil,this.__width,this.__height);
				gl.framebufferRenderbuffer(gl.FRAMEBUFFER,gl.DEPTH_STENCIL_ATTACHMENT,gl.RENDERBUFFER,this.__glDepthRenderbuffer);
			} else {
				this.__glDepthRenderbuffer = gl.createRenderbuffer();
				this.__glStencilRenderbuffer = gl.createRenderbuffer();
				gl.bindRenderbuffer(gl.RENDERBUFFER,this.__glDepthRenderbuffer);
				gl.renderbufferStorage(gl.RENDERBUFFER,gl.DEPTH_COMPONENT16,this.__width,this.__height);
				gl.bindRenderbuffer(gl.RENDERBUFFER,this.__glStencilRenderbuffer);
				gl.renderbufferStorage(gl.RENDERBUFFER,gl.STENCIL_INDEX8,this.__width,this.__height);
				gl.framebufferRenderbuffer(gl.FRAMEBUFFER,gl.DEPTH_ATTACHMENT,gl.RENDERBUFFER,this.__glDepthRenderbuffer);
				gl.framebufferRenderbuffer(gl.FRAMEBUFFER,gl.STENCIL_ATTACHMENT,gl.RENDERBUFFER,this.__glStencilRenderbuffer);
			}
			if(this.__context.__enableErrorChecking) {
				var code = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
				if(code != gl.FRAMEBUFFER_COMPLETE) {
					lime_utils_Log.warn("Error: Context3D.setRenderToTexture status:" + code + " width:" + this.__width + " height:" + this.__height,{ fileName : "openfl/display3D/textures/TextureBase.hx", lineNumber : 239, className : "openfl.display3D.textures.TextureBase", methodName : "__getGLFramebuffer"});
				}
			}
			gl.bindRenderbuffer(gl.RENDERBUFFER,null);
		}
		return this.__glFramebuffer;
	}
	,__getImage: function(bitmapData) {
		var image = bitmapData.image;
		if(!bitmapData.__isValid || image == null) {
			return null;
		}
		lime__$internal_graphics_ImageCanvasUtil.sync(image,false);
		var gl = this.__context.gl;
		if(image.type != lime_graphics_ImageType.DATA && !image.get_premultiplied()) {
			gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1);
		} else if(!image.get_premultiplied() && image.get_transparent()) {
			gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0);
			image = image.clone();
			image.set_premultiplied(true);
		}
		if(image.get_format() != 0) {
			image = image.clone();
			image.set_format(0);
			image.buffer.premultiplied = true;
		}
		return image;
	}
	,__getTexture: function() {
		return this.__textureID;
	}
	,__setSamplerState: function(state) {
		if(!state.equals(this.__samplerState)) {
			var gl = this.__context.gl;
			if(this.__textureTarget == this.__context.gl.TEXTURE_CUBE_MAP) {
				this.__context.__bindGLTextureCubeMap(this.__textureID);
			} else {
				this.__context.__bindGLTexture2D(this.__textureID);
			}
			var wrapModeS = 0;
			var wrapModeT = 0;
			switch(state.wrap) {
			case 0:
				wrapModeS = gl.CLAMP_TO_EDGE;
				wrapModeT = gl.CLAMP_TO_EDGE;
				break;
			case 1:
				wrapModeS = gl.CLAMP_TO_EDGE;
				wrapModeT = gl.REPEAT;
				break;
			case 2:
				wrapModeS = gl.REPEAT;
				wrapModeT = gl.REPEAT;
				break;
			case 3:
				wrapModeS = gl.REPEAT;
				wrapModeT = gl.CLAMP_TO_EDGE;
				break;
			default:
				throw haxe_Exception.thrown(new openfl_errors_Error("wrap bad enum"));
			}
			var magFilter = 0;
			var minFilter = 0;
			if(state.filter == 5) {
				magFilter = gl.NEAREST;
			} else {
				magFilter = gl.LINEAR;
			}
			switch(state.mipfilter) {
			case 0:
				minFilter = state.filter == 5 ? gl.NEAREST_MIPMAP_LINEAR : gl.LINEAR_MIPMAP_LINEAR;
				break;
			case 1:
				minFilter = state.filter == 5 ? gl.NEAREST_MIPMAP_NEAREST : gl.LINEAR_MIPMAP_NEAREST;
				break;
			case 2:
				minFilter = state.filter == 5 ? gl.NEAREST : gl.LINEAR;
				break;
			default:
				throw haxe_Exception.thrown(new openfl_errors_Error("mipfiter bad enum"));
			}
			gl.texParameteri(this.__textureTarget,gl.TEXTURE_MIN_FILTER,minFilter);
			gl.texParameteri(this.__textureTarget,gl.TEXTURE_MAG_FILTER,magFilter);
			gl.texParameteri(this.__textureTarget,gl.TEXTURE_WRAP_S,wrapModeS);
			gl.texParameteri(this.__textureTarget,gl.TEXTURE_WRAP_T,wrapModeT);
			var tmp = state.lodBias != 0.0;
			if(this.__samplerState == null) {
				this.__samplerState = state.clone();
			}
			this.__samplerState.copyFrom(state);
			return true;
		}
		return false;
	}
	,__uploadFromImage: function(image) {
		var gl = this.__context.gl;
		var internalFormat;
		var format;
		if(this.__textureTarget != gl.TEXTURE_2D) {
			return;
		}
		if(image.buffer.bitsPerPixel == 1) {
			internalFormat = gl.ALPHA;
			format = gl.ALPHA;
		} else {
			internalFormat = openfl_display3D_textures_TextureBase.__textureInternalFormat;
			format = openfl_display3D_textures_TextureBase.__textureFormat;
		}
		this.__context.__bindGLTexture2D(this.__textureID);
		if(image.type != lime_graphics_ImageType.DATA && !image.get_premultiplied()) {
			gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1);
		} else if(!image.get_premultiplied() && image.get_transparent()) {
			gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1);
		}
		if(image.type == lime_graphics_ImageType.DATA) {
			lime_graphics_WebGLRenderContext.texImage2D(gl,gl.TEXTURE_2D,0,internalFormat,image.buffer.width,image.buffer.height,0,format,gl.UNSIGNED_BYTE,image.get_data());
		} else {
			lime_graphics_WebGLRenderContext.texImage2D(gl,gl.TEXTURE_2D,0,internalFormat,format,gl.UNSIGNED_BYTE,image.get_src());
		}
		this.__context.__bindGLTexture2D(null);
	}
	,__class__: openfl_display3D_textures_TextureBase
});
var openfl_display3D_textures_CubeTexture = function(context,size,format,optimizeForRenderToTexture,streamingLevels) {
	openfl_display3D_textures_TextureBase.call(this,context);
	this.__size = size;
	this.__width = this.__height = this.__size;
	this.__optimizeForRenderToTexture = optimizeForRenderToTexture;
	this.__streamingLevels = streamingLevels;
	this.__textureTarget = this.__context.gl.TEXTURE_CUBE_MAP;
	this.__uploadedSides = 0;
};
$hxClasses["openfl.display3D.textures.CubeTexture"] = openfl_display3D_textures_CubeTexture;
openfl_display3D_textures_CubeTexture.__name__ = "openfl.display3D.textures.CubeTexture";
openfl_display3D_textures_CubeTexture.__super__ = openfl_display3D_textures_TextureBase;
openfl_display3D_textures_CubeTexture.prototype = $extend(openfl_display3D_textures_TextureBase.prototype,{
	__framebufferSurface: null
	,__size: null
	,__uploadedSides: null
	,uploadCompressedTextureFromByteArray: function(data,byteArrayOffset,async) {
		if(async == null) {
			async = false;
		}
		var _gthis = this;
		if(!async) {
			this.__uploadCompressedTextureFromByteArray(data,byteArrayOffset);
		} else {
			haxe_Timer.delay(function() {
				_gthis.__uploadCompressedTextureFromByteArray(data,byteArrayOffset);
				var event = null;
				event = new openfl_events_Event("textureReady");
				_gthis.dispatchEvent(event);
			},1);
		}
	}
	,uploadFromBitmapData: function(source,side,miplevel,generateMipmap) {
		if(generateMipmap == null) {
			generateMipmap = false;
		}
		if(miplevel == null) {
			miplevel = 0;
		}
		if(source == null) {
			return;
		}
		var size = this.__size >> miplevel;
		if(size == 0) {
			return;
		}
		var image = this.__getImage(source);
		if(image == null) {
			return;
		}
		if(miplevel == 0 && image.buffer != null && image.buffer.data == null && image.buffer.get_src() != null) {
			var gl = this.__context.gl;
			var size = this.__size >> miplevel;
			if(size == 0) {
				return;
			}
			var target = this.__sideToTarget(side);
			this.__context.__bindGLTextureCubeMap(this.__textureID);
			lime_graphics_WebGLRenderContext.texImage2D(gl,target,miplevel,this.__internalFormat,this.__format,gl.UNSIGNED_BYTE,image.buffer.get_src());
			this.__context.__bindGLTextureCubeMap(null);
			this.__uploadedSides |= 1 << side;
			return;
		}
		this.uploadFromTypedArray(image.get_data(),side,miplevel);
	}
	,uploadFromByteArray: function(data,byteArrayOffset,side,miplevel) {
		if(miplevel == null) {
			miplevel = 0;
		}
		if(byteArrayOffset == 0) {
			this.uploadFromTypedArray(data.b,side,miplevel);
			return;
		}
		var elements = null;
		var array = null;
		var vector = null;
		var view = null;
		var buffer = openfl_utils_ByteArray.toArrayBuffer(data);
		var byteoffset = byteArrayOffset;
		var len = null;
		if(byteoffset == null) {
			byteoffset = 0;
		}
		var this1;
		if(elements != null) {
			this1 = new Uint8Array(elements);
		} else if(array != null) {
			this1 = new Uint8Array(array);
		} else if(vector != null) {
			this1 = new Uint8Array(vector.__array);
		} else if(view != null) {
			this1 = new Uint8Array(view);
		} else if(buffer != null) {
			if(len == null) {
				this1 = new Uint8Array(buffer,byteoffset);
			} else {
				this1 = new Uint8Array(buffer,byteoffset,len);
			}
		} else {
			this1 = null;
		}
		this.uploadFromTypedArray(this1,side,miplevel);
	}
	,uploadFromTypedArray: function(data,side,miplevel) {
		if(miplevel == null) {
			miplevel = 0;
		}
		if(data == null) {
			return;
		}
		var gl = this.__context.gl;
		var size = this.__size >> miplevel;
		if(size == 0) {
			return;
		}
		var target = this.__sideToTarget(side);
		this.__context.__bindGLTextureCubeMap(this.__textureID);
		lime_graphics_WebGLRenderContext.texImage2D(gl,target,miplevel,this.__internalFormat,size,size,0,this.__format,gl.UNSIGNED_BYTE,data);
		this.__context.__bindGLTextureCubeMap(null);
		this.__uploadedSides |= 1 << side;
	}
	,__getGLFramebuffer: function(enableDepthAndStencil,antiAlias,surfaceSelector) {
		var gl = this.__context.gl;
		if(this.__glFramebuffer == null) {
			this.__glFramebuffer = gl.createFramebuffer();
			this.__framebufferSurface = -1;
		}
		if(this.__framebufferSurface != surfaceSelector) {
			this.__framebufferSurface = surfaceSelector;
			this.__context.__bindGLFramebuffer(this.__glFramebuffer);
			gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_CUBE_MAP_POSITIVE_X + surfaceSelector,this.__textureID,0);
			if(this.__context.__enableErrorChecking) {
				var code = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
				if(code != gl.FRAMEBUFFER_COMPLETE) {
					lime_utils_Log.error("Error: Context3D.setRenderToTexture status:" + code + " width:" + this.__width + " height:" + this.__height,{ fileName : "openfl/display3D/textures/CubeTexture.hx", lineNumber : 278, className : "openfl.display3D.textures.CubeTexture", methodName : "__getGLFramebuffer"});
				}
			}
		}
		return openfl_display3D_textures_TextureBase.prototype.__getGLFramebuffer.call(this,enableDepthAndStencil,antiAlias,surfaceSelector);
	}
	,__setSamplerState: function(state) {
		if(openfl_display3D_textures_TextureBase.prototype.__setSamplerState.call(this,state)) {
			var gl = this.__context.gl;
			if(state.mipfilter != 2 && !this.__samplerState.mipmapGenerated) {
				gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
				this.__samplerState.mipmapGenerated = true;
			}
			if(openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy != 0) {
				var aniso;
				switch(state.filter) {
				case 0:
					aniso = 16;
					break;
				case 1:
					aniso = 2;
					break;
				case 2:
					aniso = 4;
					break;
				case 3:
					aniso = 8;
					break;
				default:
					aniso = 1;
				}
				if(aniso > openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy) {
					aniso = openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy;
				}
				gl.texParameterf(gl.TEXTURE_CUBE_MAP,openfl_display3D_Context3D.__glTextureMaxAnisotropy,aniso);
			}
			return true;
		}
		return false;
	}
	,__sideToTarget: function(side) {
		var gl = this.__context.gl;
		switch(side) {
		case 0:
			return gl.TEXTURE_CUBE_MAP_POSITIVE_X;
		case 1:
			return gl.TEXTURE_CUBE_MAP_NEGATIVE_X;
		case 2:
			return gl.TEXTURE_CUBE_MAP_POSITIVE_Y;
		case 3:
			return gl.TEXTURE_CUBE_MAP_NEGATIVE_Y;
		case 4:
			return gl.TEXTURE_CUBE_MAP_POSITIVE_Z;
		case 5:
			return gl.TEXTURE_CUBE_MAP_NEGATIVE_Z;
		default:
			throw haxe_Exception.thrown(new openfl_errors_IllegalOperationError());
		}
	}
	,__uploadCompressedTextureFromByteArray: function(data,byteArrayOffset) {
		var _gthis = this;
		var reader = new openfl_display3D__$internal_atf_ATFReader(data,byteArrayOffset);
		var alpha = reader.readHeader(this.__size,this.__size,true);
		var gl = this.__context.gl;
		this.__context.__bindGLTextureCubeMap(this.__textureID);
		var hasTexture = false;
		reader.readTextures(function(side,level,gpuFormat,width,height,blockLength,bytes) {
			var format = alpha ? openfl_display3D_textures_TextureBase.__compressedFormatsAlpha.h[gpuFormat] : openfl_display3D_textures_TextureBase.__compressedFormats.h[gpuFormat];
			if(format == 0) {
				return;
			}
			hasTexture = true;
			var target = _gthis.__sideToTarget(side);
			_gthis.__format = format;
			_gthis.__internalFormat = format;
			if(alpha && gpuFormat == 2) {
				var size = blockLength / 2 | 0;
				var elements = null;
				var array = null;
				var vector = null;
				var view = null;
				var buffer = bytes.b.buffer;
				var byteoffset = 0;
				if(byteoffset == null) {
					byteoffset = 0;
				}
				var this1;
				if(elements != null) {
					this1 = new Uint8Array(elements);
				} else if(array != null) {
					this1 = new Uint8Array(array);
				} else if(vector != null) {
					this1 = new Uint8Array(vector.__array);
				} else if(view != null) {
					this1 = new Uint8Array(view);
				} else if(buffer != null) {
					if(size == null) {
						this1 = new Uint8Array(buffer,byteoffset);
					} else {
						this1 = new Uint8Array(buffer,byteoffset,size);
					}
				} else {
					this1 = null;
				}
				lime_graphics_WebGLRenderContext.compressedTexImage2D(gl,target,level,_gthis.__internalFormat,width,height,0,this1);
				var alphaTexture = new openfl_display3D_textures_CubeTexture(_gthis.__context,_gthis.__size,3,_gthis.__optimizeForRenderToTexture,_gthis.__streamingLevels);
				alphaTexture.__format = format;
				alphaTexture.__internalFormat = format;
				_gthis.__context.__bindGLTextureCubeMap(alphaTexture.__textureID);
				var elements = null;
				var array = null;
				var vector = null;
				var view = null;
				var buffer = bytes.b.buffer;
				var byteoffset = size;
				if(byteoffset == null) {
					byteoffset = 0;
				}
				var this1;
				if(elements != null) {
					this1 = new Uint8Array(elements);
				} else if(array != null) {
					this1 = new Uint8Array(array);
				} else if(vector != null) {
					this1 = new Uint8Array(vector.__array);
				} else if(view != null) {
					this1 = new Uint8Array(view);
				} else if(buffer != null) {
					if(size == null) {
						this1 = new Uint8Array(buffer,byteoffset);
					} else {
						this1 = new Uint8Array(buffer,byteoffset,size);
					}
				} else {
					this1 = null;
				}
				lime_graphics_WebGLRenderContext.compressedTexImage2D(gl,target,level,alphaTexture.__internalFormat,width,height,0,this1);
				_gthis.__alphaTexture = alphaTexture;
			} else {
				var elements = null;
				var array = null;
				var vector = null;
				var view = null;
				var buffer = bytes.b.buffer;
				var byteoffset = 0;
				if(byteoffset == null) {
					byteoffset = 0;
				}
				var this1;
				if(elements != null) {
					this1 = new Uint8Array(elements);
				} else if(array != null) {
					this1 = new Uint8Array(array);
				} else if(vector != null) {
					this1 = new Uint8Array(vector.__array);
				} else if(view != null) {
					this1 = new Uint8Array(view);
				} else if(buffer != null) {
					if(blockLength == null) {
						this1 = new Uint8Array(buffer,byteoffset);
					} else {
						this1 = new Uint8Array(buffer,byteoffset,blockLength);
					}
				} else {
					this1 = null;
				}
				lime_graphics_WebGLRenderContext.compressedTexImage2D(gl,target,level,_gthis.__internalFormat,width,height,0,this1);
			}
		});
		if(!hasTexture) {
			var elements = this.__size * this.__size * 4;
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1;
			if(elements != null) {
				this1 = new Uint8Array(elements);
			} else if(array != null) {
				this1 = new Uint8Array(array);
			} else if(vector != null) {
				this1 = new Uint8Array(vector.__array);
			} else if(view != null) {
				this1 = new Uint8Array(view);
			} else if(buffer != null) {
				if(len == null) {
					this1 = new Uint8Array(buffer,0);
				} else {
					this1 = new Uint8Array(buffer,0,len);
				}
			} else {
				this1 = null;
			}
			var data = this1;
			lime_graphics_WebGLRenderContext.texImage2D(gl,this.__sideToTarget(0),0,this.__internalFormat,this.__size,this.__size,0,this.__format,gl.UNSIGNED_BYTE,data);
			var elements = this.__size * this.__size * 4;
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1;
			if(elements != null) {
				this1 = new Uint8Array(elements);
			} else if(array != null) {
				this1 = new Uint8Array(array);
			} else if(vector != null) {
				this1 = new Uint8Array(vector.__array);
			} else if(view != null) {
				this1 = new Uint8Array(view);
			} else if(buffer != null) {
				if(len == null) {
					this1 = new Uint8Array(buffer,0);
				} else {
					this1 = new Uint8Array(buffer,0,len);
				}
			} else {
				this1 = null;
			}
			var data = this1;
			lime_graphics_WebGLRenderContext.texImage2D(gl,this.__sideToTarget(1),0,this.__internalFormat,this.__size,this.__size,0,this.__format,gl.UNSIGNED_BYTE,data);
			var elements = this.__size * this.__size * 4;
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1;
			if(elements != null) {
				this1 = new Uint8Array(elements);
			} else if(array != null) {
				this1 = new Uint8Array(array);
			} else if(vector != null) {
				this1 = new Uint8Array(vector.__array);
			} else if(view != null) {
				this1 = new Uint8Array(view);
			} else if(buffer != null) {
				if(len == null) {
					this1 = new Uint8Array(buffer,0);
				} else {
					this1 = new Uint8Array(buffer,0,len);
				}
			} else {
				this1 = null;
			}
			var data = this1;
			lime_graphics_WebGLRenderContext.texImage2D(gl,this.__sideToTarget(2),0,this.__internalFormat,this.__size,this.__size,0,this.__format,gl.UNSIGNED_BYTE,data);
			var elements = this.__size * this.__size * 4;
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1;
			if(elements != null) {
				this1 = new Uint8Array(elements);
			} else if(array != null) {
				this1 = new Uint8Array(array);
			} else if(vector != null) {
				this1 = new Uint8Array(vector.__array);
			} else if(view != null) {
				this1 = new Uint8Array(view);
			} else if(buffer != null) {
				if(len == null) {
					this1 = new Uint8Array(buffer,0);
				} else {
					this1 = new Uint8Array(buffer,0,len);
				}
			} else {
				this1 = null;
			}
			var data = this1;
			lime_graphics_WebGLRenderContext.texImage2D(gl,this.__sideToTarget(3),0,this.__internalFormat,this.__size,this.__size,0,this.__format,gl.UNSIGNED_BYTE,data);
			var elements = this.__size * this.__size * 4;
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1;
			if(elements != null) {
				this1 = new Uint8Array(elements);
			} else if(array != null) {
				this1 = new Uint8Array(array);
			} else if(vector != null) {
				this1 = new Uint8Array(vector.__array);
			} else if(view != null) {
				this1 = new Uint8Array(view);
			} else if(buffer != null) {
				if(len == null) {
					this1 = new Uint8Array(buffer,0);
				} else {
					this1 = new Uint8Array(buffer,0,len);
				}
			} else {
				this1 = null;
			}
			var data = this1;
			lime_graphics_WebGLRenderContext.texImage2D(gl,this.__sideToTarget(4),0,this.__internalFormat,this.__size,this.__size,0,this.__format,gl.UNSIGNED_BYTE,data);
			var elements = this.__size * this.__size * 4;
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1;
			if(elements != null) {
				this1 = new Uint8Array(elements);
			} else if(array != null) {
				this1 = new Uint8Array(array);
			} else if(vector != null) {
				this1 = new Uint8Array(vector.__array);
			} else if(view != null) {
				this1 = new Uint8Array(view);
			} else if(buffer != null) {
				if(len == null) {
					this1 = new Uint8Array(buffer,0);
				} else {
					this1 = new Uint8Array(buffer,0,len);
				}
			} else {
				this1 = null;
			}
			var data = this1;
			lime_graphics_WebGLRenderContext.texImage2D(gl,this.__sideToTarget(5),0,this.__internalFormat,this.__size,this.__size,0,this.__format,gl.UNSIGNED_BYTE,data);
		}
		this.__context.__bindGLTextureCubeMap(null);
	}
	,__class__: openfl_display3D_textures_CubeTexture
});
var openfl_display3D_textures_RectangleTexture = function(context,width,height,format,optimizeForRenderToTexture) {
	openfl_display3D_textures_TextureBase.call(this,context);
	this.__width = width;
	this.__height = height;
	this.__optimizeForRenderToTexture = optimizeForRenderToTexture;
	this.__textureTarget = this.__context.gl.TEXTURE_2D;
	this.uploadFromTypedArray(null);
	if(optimizeForRenderToTexture) {
		this.__getGLFramebuffer(true,0,0);
	}
};
$hxClasses["openfl.display3D.textures.RectangleTexture"] = openfl_display3D_textures_RectangleTexture;
openfl_display3D_textures_RectangleTexture.__name__ = "openfl.display3D.textures.RectangleTexture";
openfl_display3D_textures_RectangleTexture.__super__ = openfl_display3D_textures_TextureBase;
openfl_display3D_textures_RectangleTexture.prototype = $extend(openfl_display3D_textures_TextureBase.prototype,{
	uploadFromBitmapData: function(source) {
		if(source == null) {
			return;
		}
		var image = this.__getImage(source);
		if(image == null) {
			return;
		}
		if(image.buffer != null && image.buffer.data == null && image.buffer.get_src() != null) {
			var gl = this.__context.gl;
			this.__context.__bindGLTexture2D(this.__textureID);
			lime_graphics_WebGLRenderContext.texImage2D(gl,this.__textureTarget,0,this.__internalFormat,this.__format,gl.UNSIGNED_BYTE,image.buffer.get_src());
			this.__context.__bindGLTexture2D(null);
			return;
		}
		this.uploadFromTypedArray(image.get_data());
	}
	,uploadFromByteArray: function(data,byteArrayOffset) {
		if(byteArrayOffset == 0) {
			this.uploadFromTypedArray(data.b);
			return;
		}
		var elements = null;
		var array = null;
		var vector = null;
		var view = null;
		var buffer = openfl_utils_ByteArray.toArrayBuffer(data);
		var byteoffset = byteArrayOffset;
		var len = null;
		if(byteoffset == null) {
			byteoffset = 0;
		}
		var this1;
		if(elements != null) {
			this1 = new Uint8Array(elements);
		} else if(array != null) {
			this1 = new Uint8Array(array);
		} else if(vector != null) {
			this1 = new Uint8Array(vector.__array);
		} else if(view != null) {
			this1 = new Uint8Array(view);
		} else if(buffer != null) {
			if(len == null) {
				this1 = new Uint8Array(buffer,byteoffset);
			} else {
				this1 = new Uint8Array(buffer,byteoffset,len);
			}
		} else {
			this1 = null;
		}
		this.uploadFromTypedArray(this1);
	}
	,uploadFromTypedArray: function(data) {
		var gl = this.__context.gl;
		this.__context.__bindGLTexture2D(this.__textureID);
		lime_graphics_WebGLRenderContext.texImage2D(gl,this.__textureTarget,0,this.__internalFormat,this.__width,this.__height,0,this.__format,gl.UNSIGNED_BYTE,data);
		this.__context.__bindGLTexture2D(null);
	}
	,__setSamplerState: function(state) {
		if(openfl_display3D_textures_TextureBase.prototype.__setSamplerState.call(this,state)) {
			var gl = this.__context.gl;
			if(openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy != 0) {
				var aniso;
				switch(state.filter) {
				case 0:
					aniso = 16;
					break;
				case 1:
					aniso = 2;
					break;
				case 2:
					aniso = 4;
					break;
				case 3:
					aniso = 8;
					break;
				default:
					aniso = 1;
				}
				if(aniso > openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy) {
					aniso = openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy;
				}
				gl.texParameterf(gl.TEXTURE_2D,openfl_display3D_Context3D.__glTextureMaxAnisotropy,aniso);
			}
			return true;
		}
		return false;
	}
	,__class__: openfl_display3D_textures_RectangleTexture
});
var openfl_display3D_textures_Texture = function(context,width,height,format,optimizeForRenderToTexture,streamingLevels) {
	openfl_display3D_textures_TextureBase.call(this,context);
	this.__width = width;
	this.__height = height;
	this.__optimizeForRenderToTexture = optimizeForRenderToTexture;
	this.__streamingLevels = streamingLevels;
	var gl = this.__context.gl;
	this.__textureTarget = gl.TEXTURE_2D;
	this.__context.__bindGLTexture2D(this.__textureID);
	lime_graphics_WebGLRenderContext.texImage2D(gl,this.__textureTarget,0,this.__internalFormat,this.__width,this.__height,0,this.__format,gl.UNSIGNED_BYTE,null);
	this.__context.__bindGLTexture2D(null);
	if(optimizeForRenderToTexture) {
		this.__getGLFramebuffer(true,0,0);
	}
};
$hxClasses["openfl.display3D.textures.Texture"] = openfl_display3D_textures_Texture;
openfl_display3D_textures_Texture.__name__ = "openfl.display3D.textures.Texture";
openfl_display3D_textures_Texture.__super__ = openfl_display3D_textures_TextureBase;
openfl_display3D_textures_Texture.prototype = $extend(openfl_display3D_textures_TextureBase.prototype,{
	uploadCompressedTextureFromByteArray: function(data,byteArrayOffset,async) {
		if(async == null) {
			async = false;
		}
		var _gthis = this;
		if(!async) {
			this.__uploadCompressedTextureFromByteArray(data,byteArrayOffset);
		} else {
			haxe_Timer.delay(function() {
				_gthis.__uploadCompressedTextureFromByteArray(data,byteArrayOffset);
				var event = null;
				event = new openfl_events_Event("textureReady");
				_gthis.dispatchEvent(event);
			},1);
		}
	}
	,uploadFromBitmapData: function(source,miplevel,generateMipmap) {
		if(generateMipmap == null) {
			generateMipmap = false;
		}
		if(miplevel == null) {
			miplevel = 0;
		}
		if(source == null) {
			return;
		}
		var width = this.__width >> miplevel;
		var height = this.__height >> miplevel;
		if(width == 0 && height == 0) {
			return;
		}
		if(width == 0) {
			width = 1;
		}
		if(height == 0) {
			height = 1;
		}
		if(source.width != width || source.height != height) {
			var copy = new openfl_display_BitmapData(width,height,true,0);
			copy.draw(source);
			source = copy;
		}
		var image = this.__getImage(source);
		if(image == null) {
			return;
		}
		if(miplevel == 0 && image.buffer != null && image.buffer.data == null && image.buffer.get_src() != null) {
			var gl = this.__context.gl;
			var width = this.__width >> miplevel;
			var height = this.__height >> miplevel;
			if(width == 0 && height == 0) {
				return;
			}
			if(width == 0) {
				width = 1;
			}
			if(height == 0) {
				height = 1;
			}
			this.__context.__bindGLTexture2D(this.__textureID);
			lime_graphics_WebGLRenderContext.texImage2D(gl,this.__textureTarget,miplevel,this.__internalFormat,this.__format,gl.UNSIGNED_BYTE,image.buffer.get_src());
			this.__context.__bindGLTexture2D(null);
			return;
		}
		this.uploadFromTypedArray(image.get_data(),miplevel);
	}
	,uploadFromByteArray: function(data,byteArrayOffset,miplevel) {
		if(miplevel == null) {
			miplevel = 0;
		}
		if(byteArrayOffset == 0) {
			this.uploadFromTypedArray(data.b,miplevel);
			return;
		}
		var elements = null;
		var array = null;
		var vector = null;
		var view = null;
		var buffer = openfl_utils_ByteArray.toArrayBuffer(data);
		var byteoffset = byteArrayOffset;
		var len = null;
		if(byteoffset == null) {
			byteoffset = 0;
		}
		var this1;
		if(elements != null) {
			this1 = new Uint8Array(elements);
		} else if(array != null) {
			this1 = new Uint8Array(array);
		} else if(vector != null) {
			this1 = new Uint8Array(vector.__array);
		} else if(view != null) {
			this1 = new Uint8Array(view);
		} else if(buffer != null) {
			if(len == null) {
				this1 = new Uint8Array(buffer,byteoffset);
			} else {
				this1 = new Uint8Array(buffer,byteoffset,len);
			}
		} else {
			this1 = null;
		}
		this.uploadFromTypedArray(this1,miplevel);
	}
	,uploadFromTypedArray: function(data,miplevel) {
		if(miplevel == null) {
			miplevel = 0;
		}
		if(data == null) {
			return;
		}
		var gl = this.__context.gl;
		var width = this.__width >> miplevel;
		var height = this.__height >> miplevel;
		if(width == 0 && height == 0) {
			return;
		}
		if(width == 0) {
			width = 1;
		}
		if(height == 0) {
			height = 1;
		}
		this.__context.__bindGLTexture2D(this.__textureID);
		lime_graphics_WebGLRenderContext.texImage2D(gl,this.__textureTarget,miplevel,this.__internalFormat,width,height,0,this.__format,gl.UNSIGNED_BYTE,data);
		this.__context.__bindGLTexture2D(null);
	}
	,__setSamplerState: function(state) {
		if(openfl_display3D_textures_TextureBase.prototype.__setSamplerState.call(this,state)) {
			var gl = this.__context.gl;
			if(state.mipfilter != 2 && !this.__samplerState.mipmapGenerated) {
				gl.generateMipmap(gl.TEXTURE_2D);
				this.__samplerState.mipmapGenerated = true;
			}
			if(openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy != 0) {
				var aniso;
				switch(state.filter) {
				case 0:
					aniso = 16;
					break;
				case 1:
					aniso = 2;
					break;
				case 2:
					aniso = 4;
					break;
				case 3:
					aniso = 8;
					break;
				default:
					aniso = 1;
				}
				if(aniso > openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy) {
					aniso = openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy;
				}
				gl.texParameterf(gl.TEXTURE_2D,openfl_display3D_Context3D.__glTextureMaxAnisotropy,aniso);
			}
			return true;
		}
		return false;
	}
	,__uploadCompressedTextureFromByteArray: function(data,byteArrayOffset) {
		var _gthis = this;
		var reader = new openfl_display3D__$internal_atf_ATFReader(data,byteArrayOffset);
		var alpha = reader.readHeader(this.__width,this.__height,false);
		var context = this.__context;
		var gl = context.gl;
		this.__context.__bindGLTexture2D(this.__textureID);
		var hasTexture = false;
		reader.readTextures(function(target,level,gpuFormat,width,height,blockLength,bytes) {
			var format = alpha ? openfl_display3D_textures_TextureBase.__compressedFormatsAlpha.h[gpuFormat] : openfl_display3D_textures_TextureBase.__compressedFormats.h[gpuFormat];
			if(format == 0) {
				return;
			}
			hasTexture = true;
			_gthis.__format = format;
			_gthis.__internalFormat = format;
			if(alpha && gpuFormat == 2) {
				var size = blockLength / 2 | 0;
				var elements = null;
				var array = null;
				var vector = null;
				var view = null;
				var buffer = bytes.b.buffer;
				var byteoffset = 0;
				if(byteoffset == null) {
					byteoffset = 0;
				}
				var this1;
				if(elements != null) {
					this1 = new Uint8Array(elements);
				} else if(array != null) {
					this1 = new Uint8Array(array);
				} else if(vector != null) {
					this1 = new Uint8Array(vector.__array);
				} else if(view != null) {
					this1 = new Uint8Array(view);
				} else if(buffer != null) {
					if(size == null) {
						this1 = new Uint8Array(buffer,byteoffset);
					} else {
						this1 = new Uint8Array(buffer,byteoffset,size);
					}
				} else {
					this1 = null;
				}
				lime_graphics_WebGLRenderContext.compressedTexImage2D(gl,_gthis.__textureTarget,level,_gthis.__internalFormat,width,height,0,this1);
				var alphaTexture = new openfl_display3D_textures_Texture(_gthis.__context,_gthis.__width,_gthis.__height,3,_gthis.__optimizeForRenderToTexture,_gthis.__streamingLevels);
				alphaTexture.__format = format;
				alphaTexture.__internalFormat = format;
				_gthis.__context.__bindGLTexture2D(alphaTexture.__textureID);
				var elements = null;
				var array = null;
				var vector = null;
				var view = null;
				var buffer = bytes.b.buffer;
				var byteoffset = size;
				if(byteoffset == null) {
					byteoffset = 0;
				}
				var this1;
				if(elements != null) {
					this1 = new Uint8Array(elements);
				} else if(array != null) {
					this1 = new Uint8Array(array);
				} else if(vector != null) {
					this1 = new Uint8Array(vector.__array);
				} else if(view != null) {
					this1 = new Uint8Array(view);
				} else if(buffer != null) {
					if(size == null) {
						this1 = new Uint8Array(buffer,byteoffset);
					} else {
						this1 = new Uint8Array(buffer,byteoffset,size);
					}
				} else {
					this1 = null;
				}
				lime_graphics_WebGLRenderContext.compressedTexImage2D(gl,alphaTexture.__textureTarget,level,alphaTexture.__internalFormat,width,height,0,this1);
				_gthis.__alphaTexture = alphaTexture;
			} else {
				var elements = null;
				var array = null;
				var vector = null;
				var view = null;
				var buffer = bytes.b.buffer;
				var byteoffset = 0;
				if(byteoffset == null) {
					byteoffset = 0;
				}
				var this1;
				if(elements != null) {
					this1 = new Uint8Array(elements);
				} else if(array != null) {
					this1 = new Uint8Array(array);
				} else if(vector != null) {
					this1 = new Uint8Array(vector.__array);
				} else if(view != null) {
					this1 = new Uint8Array(view);
				} else if(buffer != null) {
					if(blockLength == null) {
						this1 = new Uint8Array(buffer,byteoffset);
					} else {
						this1 = new Uint8Array(buffer,byteoffset,blockLength);
					}
				} else {
					this1 = null;
				}
				lime_graphics_WebGLRenderContext.compressedTexImage2D(gl,_gthis.__textureTarget,level,_gthis.__internalFormat,width,height,0,this1);
			}
		});
		if(!hasTexture) {
			var elements = this.__width * this.__height * 4;
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1;
			if(elements != null) {
				this1 = new Uint8Array(elements);
			} else if(array != null) {
				this1 = new Uint8Array(array);
			} else if(vector != null) {
				this1 = new Uint8Array(vector.__array);
			} else if(view != null) {
				this1 = new Uint8Array(view);
			} else if(buffer != null) {
				if(len == null) {
					this1 = new Uint8Array(buffer,0);
				} else {
					this1 = new Uint8Array(buffer,0,len);
				}
			} else {
				this1 = null;
			}
			var data = this1;
			lime_graphics_WebGLRenderContext.texImage2D(gl,this.__textureTarget,0,this.__internalFormat,this.__width,this.__height,0,this.__format,gl.UNSIGNED_BYTE,data);
		}
		this.__context.__bindGLTexture2D(null);
	}
	,__class__: openfl_display3D_textures_Texture
});
var openfl_display3D_textures_VideoTexture = function(context) {
	openfl_display3D_textures_TextureBase.call(this,context);
	this.__textureTarget = this.__context.gl.TEXTURE_2D;
};
$hxClasses["openfl.display3D.textures.VideoTexture"] = openfl_display3D_textures_VideoTexture;
openfl_display3D_textures_VideoTexture.__name__ = "openfl.display3D.textures.VideoTexture";
openfl_display3D_textures_VideoTexture.__super__ = openfl_display3D_textures_TextureBase;
openfl_display3D_textures_VideoTexture.prototype = $extend(openfl_display3D_textures_TextureBase.prototype,{
	videoHeight: null
	,videoWidth: null
	,__cacheTime: null
	,__netStream: null
	,attachNetStream: function(netStream) {
		var _gthis = this;
		if(this.__netStream != null) {
			this.__netStream.__video.removeEventListener("canplay",$bind(this,this.__onCanPlay),false);
		}
		this.__cacheTime = -1;
		this.__netStream = netStream;
		if(this.__netStream != null) {
			if(this.__netStream.__video.readyState >= 2) {
				haxe_Timer.delay(function() {
					_gthis.__textureReady();
				},0);
			} else {
				this.__netStream.__video.addEventListener("canplay",$bind(this,this.__onCanPlay),false);
			}
		}
	}
	,dispose: function() {
		if(this.__netStream != null && this.__netStream.__video != null) {
			this.__netStream.__video.removeEventListener("timeupdate",$bind(this,this.__onTimeUpdate));
		}
		openfl_display3D_textures_TextureBase.prototype.dispose.call(this);
	}
	,__onCanPlay: function(_) {
		this.__netStream.__video.addEventListener("timeupdate",$bind(this,this.__onTimeUpdate));
		this.__textureReady();
	}
	,__onTimeUpdate: function(_) {
		if(this.__netStream != null && this.__netStream.__video.currentTime != this.__cacheTime && this.__netStream.__video.readyState >= 2) {
			this.__textureReady();
		}
	}
	,__getTexture: function() {
		if(this.__netStream.__video.currentTime != this.__cacheTime && this.__netStream.__video.readyState >= 2) {
			var gl = this.__context.gl;
			this.__context.__bindGLTexture2D(this.__textureID);
			lime_graphics_WebGLRenderContext.texImage2D(gl,gl.TEXTURE_2D,0,gl.RGBA,gl.RGBA,gl.UNSIGNED_BYTE,this.__netStream.__video);
			this.__cacheTime = this.__netStream.__video.currentTime;
		}
		return this.__textureID;
	}
	,__textureReady: function() {
		this.videoWidth = this.__netStream.__video.videoWidth;
		this.videoHeight = this.__netStream.__video.videoHeight;
		var event = null;
		event = new openfl_events_Event("textureReady");
		this.dispatchEvent(event);
	}
	,__class__: openfl_display3D_textures_VideoTexture
});
var openfl_errors_Error = function(message,id) {
	if(id == null) {
		id = 0;
	}
	if(message == null) {
		message = "";
	}
	this.message = message;
	this.errorID = id;
	this.name = "Error";
};
$hxClasses["openfl.errors.Error"] = openfl_errors_Error;
openfl_errors_Error.__name__ = "openfl.errors.Error";
openfl_errors_Error.prototype = {
	errorID: null
	,message: null
	,name: null
	,getStackTrace: function() {
		return haxe_CallStack.toString(haxe_CallStack.exceptionStack());
	}
	,toString: function() {
		if(this.message != null) {
			return this.message;
		} else {
			return "Error";
		}
	}
	,__class__: openfl_errors_Error
};
var openfl_errors_ArgumentError = function(message) {
	if(message == null) {
		message = "";
	}
	openfl_errors_Error.call(this,message);
	this.name = "ArgumentError";
};
$hxClasses["openfl.errors.ArgumentError"] = openfl_errors_ArgumentError;
openfl_errors_ArgumentError.__name__ = "openfl.errors.ArgumentError";
openfl_errors_ArgumentError.__super__ = openfl_errors_Error;
openfl_errors_ArgumentError.prototype = $extend(openfl_errors_Error.prototype,{
	__class__: openfl_errors_ArgumentError
});
var openfl_errors_IOError = function(message) {
	if(message == null) {
		message = "";
	}
	openfl_errors_Error.call(this,message);
	this.name = "IOError";
};
$hxClasses["openfl.errors.IOError"] = openfl_errors_IOError;
openfl_errors_IOError.__name__ = "openfl.errors.IOError";
openfl_errors_IOError.__super__ = openfl_errors_Error;
openfl_errors_IOError.prototype = $extend(openfl_errors_Error.prototype,{
	__class__: openfl_errors_IOError
});
var openfl_errors_EOFError = function(message,id) {
	if(id == null) {
		id = 0;
	}
	openfl_errors_IOError.call(this,"End of file was encountered");
	this.name = "EOFError";
	this.errorID = 2030;
};
$hxClasses["openfl.errors.EOFError"] = openfl_errors_EOFError;
openfl_errors_EOFError.__name__ = "openfl.errors.EOFError";
openfl_errors_EOFError.__super__ = openfl_errors_IOError;
openfl_errors_EOFError.prototype = $extend(openfl_errors_IOError.prototype,{
	__class__: openfl_errors_EOFError
});
var openfl_errors_IllegalOperationError = function(message) {
	if(message == null) {
		message = "";
	}
	openfl_errors_Error.call(this,message,0);
	this.name = "IllegalOperationError";
};
$hxClasses["openfl.errors.IllegalOperationError"] = openfl_errors_IllegalOperationError;
openfl_errors_IllegalOperationError.__name__ = "openfl.errors.IllegalOperationError";
openfl_errors_IllegalOperationError.__super__ = openfl_errors_Error;
openfl_errors_IllegalOperationError.prototype = $extend(openfl_errors_Error.prototype,{
	__class__: openfl_errors_IllegalOperationError
});
var openfl_errors_RangeError = function(message) {
	if(message == null) {
		message = "";
	}
	openfl_errors_Error.call(this,message,0);
	this.name = "RangeError";
};
$hxClasses["openfl.errors.RangeError"] = openfl_errors_RangeError;
openfl_errors_RangeError.__name__ = "openfl.errors.RangeError";
openfl_errors_RangeError.__super__ = openfl_errors_Error;
openfl_errors_RangeError.prototype = $extend(openfl_errors_Error.prototype,{
	__class__: openfl_errors_RangeError
});
var openfl_errors_TypeError = function(message) {
	if(message == null) {
		message = "";
	}
	openfl_errors_Error.call(this,message,0);
	this.name = "TypeError";
};
$hxClasses["openfl.errors.TypeError"] = openfl_errors_TypeError;
openfl_errors_TypeError.__name__ = "openfl.errors.TypeError";
openfl_errors_TypeError.__super__ = openfl_errors_Error;
openfl_errors_TypeError.prototype = $extend(openfl_errors_Error.prototype,{
	__class__: openfl_errors_TypeError
});
var openfl_events_Event = function(type,bubbles,cancelable) {
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	this.type = type;
	this.bubbles = bubbles;
	this.cancelable = cancelable;
	this.eventPhase = 2;
};
$hxClasses["openfl.events.Event"] = openfl_events_Event;
openfl_events_Event.__name__ = "openfl.events.Event";
openfl_events_Event.prototype = {
	bubbles: null
	,cancelable: null
	,currentTarget: null
	,eventPhase: null
	,target: null
	,type: null
	,__isCanceled: null
	,__isCanceledNow: null
	,__preventDefault: null
	,clone: function() {
		var event = new openfl_events_Event(this.type,this.bubbles,this.cancelable);
		event.eventPhase = this.eventPhase;
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		return event;
	}
	,formatToString: function(className,p1,p2,p3,p4,p5) {
		var parameters = [];
		if(p1 != null) {
			parameters.push(p1);
		}
		if(p2 != null) {
			parameters.push(p2);
		}
		if(p3 != null) {
			parameters.push(p3);
		}
		if(p4 != null) {
			parameters.push(p4);
		}
		if(p5 != null) {
			parameters.push(p5);
		}
		return $bind(this,this.__formatToString).apply(this,[className,parameters]);
	}
	,isDefaultPrevented: function() {
		return this.__preventDefault;
	}
	,preventDefault: function() {
		if(this.cancelable) {
			this.__preventDefault = true;
		}
	}
	,stopImmediatePropagation: function() {
		this.__isCanceled = true;
		this.__isCanceledNow = true;
	}
	,stopPropagation: function() {
		this.__isCanceled = true;
	}
	,toString: function() {
		return this.__formatToString("Event",["type","bubbles","cancelable"]);
	}
	,__formatToString: function(className,parameters) {
		var output = "[" + className;
		var arg = null;
		var _g = 0;
		while(_g < parameters.length) {
			var param = parameters[_g];
			++_g;
			arg = Reflect.field(this,param);
			if(typeof(arg) == "string") {
				output += " " + param + "=\"" + Std.string(arg) + "\"";
			} else {
				output += " " + param + "=" + Std.string(arg);
			}
		}
		output += "]";
		return output;
	}
	,__init: function() {
		this.target = null;
		this.currentTarget = null;
		this.bubbles = false;
		this.cancelable = false;
		this.eventPhase = 2;
		this.__isCanceled = false;
		this.__isCanceledNow = false;
		this.__preventDefault = false;
	}
	,__class__: openfl_events_Event
};
var openfl_events_AccelerometerEvent = function(type,bubbles,cancelable,timestamp,accelerationX,accelerationY,accelerationZ) {
	if(accelerationZ == null) {
		accelerationZ = 0;
	}
	if(accelerationY == null) {
		accelerationY = 0;
	}
	if(accelerationX == null) {
		accelerationX = 0;
	}
	if(timestamp == null) {
		timestamp = 0;
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.timestamp = timestamp;
	this.accelerationX = accelerationX;
	this.accelerationY = accelerationY;
	this.accelerationZ = accelerationZ;
};
$hxClasses["openfl.events.AccelerometerEvent"] = openfl_events_AccelerometerEvent;
openfl_events_AccelerometerEvent.__name__ = "openfl.events.AccelerometerEvent";
openfl_events_AccelerometerEvent.__super__ = openfl_events_Event;
openfl_events_AccelerometerEvent.prototype = $extend(openfl_events_Event.prototype,{
	accelerationX: null
	,accelerationY: null
	,accelerationZ: null
	,timestamp: null
	,clone: function() {
		var event = new openfl_events_AccelerometerEvent(this.type,this.bubbles,this.cancelable,this.timestamp,this.accelerationX,this.accelerationY,this.accelerationZ);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("AccelerometerEvent",["type","bubbles","cancelable","timestamp","accelerationX","accelerationY","accelerationZ"]);
	}
	,__init: function() {
		openfl_events_Event.prototype.__init.call(this);
		this.timestamp = 0;
		this.accelerationX = 0;
		this.accelerationY = 0;
		this.accelerationZ = 0;
	}
	,__class__: openfl_events_AccelerometerEvent
});
var openfl_events_ActivityEvent = function(type,bubbles,cancelable,activating) {
	if(activating == null) {
		activating = false;
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.activating = activating;
};
$hxClasses["openfl.events.ActivityEvent"] = openfl_events_ActivityEvent;
openfl_events_ActivityEvent.__name__ = "openfl.events.ActivityEvent";
openfl_events_ActivityEvent.__super__ = openfl_events_Event;
openfl_events_ActivityEvent.prototype = $extend(openfl_events_Event.prototype,{
	activating: null
	,clone: function() {
		var event = new openfl_events_ActivityEvent(this.type,this.bubbles,this.cancelable,this.activating);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("ActivityEvent",["type","bubbles","cancelable","activating"]);
	}
	,__init: function() {
		openfl_events_Event.prototype.__init.call(this);
		this.activating = false;
	}
	,__class__: openfl_events_ActivityEvent
});
var openfl_events_TextEvent = function(type,bubbles,cancelable,text) {
	if(text == null) {
		text = "";
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.text = text;
};
$hxClasses["openfl.events.TextEvent"] = openfl_events_TextEvent;
openfl_events_TextEvent.__name__ = "openfl.events.TextEvent";
openfl_events_TextEvent.__super__ = openfl_events_Event;
openfl_events_TextEvent.prototype = $extend(openfl_events_Event.prototype,{
	text: null
	,clone: function() {
		var event = new openfl_events_TextEvent(this.type,this.bubbles,this.cancelable,this.text);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("TextEvent",["type","bubbles","cancelable","text"]);
	}
	,__init: function() {
		openfl_events_Event.prototype.__init.call(this);
		this.text = "";
	}
	,__class__: openfl_events_TextEvent
});
var openfl_events_ErrorEvent = function(type,bubbles,cancelable,text,id) {
	if(id == null) {
		id = 0;
	}
	if(text == null) {
		text = "";
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_TextEvent.call(this,type,bubbles,cancelable,text);
	this.errorID = id;
};
$hxClasses["openfl.events.ErrorEvent"] = openfl_events_ErrorEvent;
openfl_events_ErrorEvent.__name__ = "openfl.events.ErrorEvent";
openfl_events_ErrorEvent.__super__ = openfl_events_TextEvent;
openfl_events_ErrorEvent.prototype = $extend(openfl_events_TextEvent.prototype,{
	errorID: null
	,clone: function() {
		var event = new openfl_events_ErrorEvent(this.type,this.bubbles,this.cancelable,this.text,this.errorID);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("ErrorEvent",["type","bubbles","cancelable","text","errorID"]);
	}
	,__init: function() {
		openfl_events_TextEvent.prototype.__init.call(this);
		this.errorID = 0;
	}
	,__class__: openfl_events_ErrorEvent
});
var openfl_events__$EventDispatcher_DispatchIterator = function(list) {
	this.active = false;
	this.reset(list);
};
$hxClasses["openfl.events._EventDispatcher.DispatchIterator"] = openfl_events__$EventDispatcher_DispatchIterator;
openfl_events__$EventDispatcher_DispatchIterator.__name__ = "openfl.events._EventDispatcher.DispatchIterator";
openfl_events__$EventDispatcher_DispatchIterator.prototype = {
	active: null
	,index: null
	,isCopy: null
	,list: null
	,copy: function() {
		if(!this.isCopy) {
			this.list = this.list.slice();
			this.isCopy = true;
		}
	}
	,hasNext: function() {
		return this.index < this.list.length;
	}
	,next: function() {
		return this.list[this.index++];
	}
	,remove: function(listener,listIndex) {
		if(this.active) {
			if(!this.isCopy) {
				if(listIndex < this.index) {
					this.index--;
				}
			} else {
				var _g = this.index;
				var _g1 = this.list.length;
				while(_g < _g1) {
					var i = _g++;
					if(this.list[i] == listener) {
						this.list.splice(i,1);
						break;
					}
				}
			}
		}
	}
	,reset: function(list) {
		this.list = list;
		this.isCopy = false;
		this.index = 0;
	}
	,start: function() {
		this.active = true;
	}
	,stop: function() {
		this.active = false;
	}
	,__class__: openfl_events__$EventDispatcher_DispatchIterator
};
var openfl_events__$EventDispatcher_Listener = function(callback,useCapture,priority) {
	this.callback = callback;
	this.useCapture = useCapture;
	this.priority = priority;
};
$hxClasses["openfl.events._EventDispatcher.Listener"] = openfl_events__$EventDispatcher_Listener;
openfl_events__$EventDispatcher_Listener.__name__ = "openfl.events._EventDispatcher.Listener";
openfl_events__$EventDispatcher_Listener.prototype = {
	callback: null
	,priority: null
	,useCapture: null
	,match: function(callback,useCapture) {
		if(Reflect.compareMethods(this.callback,callback)) {
			return this.useCapture == useCapture;
		} else {
			return false;
		}
	}
	,__class__: openfl_events__$EventDispatcher_Listener
};
var openfl_events_EventType = {};
openfl_events_EventType.equals = function(a,b) {
	return a == b;
};
openfl_events_EventType.notEquals = function(a,b) {
	return a != b;
};
var openfl_events_FocusEvent = function(type,bubbles,cancelable,relatedObject,shiftKey,keyCode) {
	if(keyCode == null) {
		keyCode = 0;
	}
	if(shiftKey == null) {
		shiftKey = false;
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.keyCode = keyCode;
	this.shiftKey = shiftKey;
	this.relatedObject = relatedObject;
};
$hxClasses["openfl.events.FocusEvent"] = openfl_events_FocusEvent;
openfl_events_FocusEvent.__name__ = "openfl.events.FocusEvent";
openfl_events_FocusEvent.__super__ = openfl_events_Event;
openfl_events_FocusEvent.prototype = $extend(openfl_events_Event.prototype,{
	keyCode: null
	,relatedObject: null
	,shiftKey: null
	,clone: function() {
		var event = new openfl_events_FocusEvent(this.type,this.bubbles,this.cancelable,this.relatedObject,this.shiftKey,this.keyCode);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("FocusEvent",["type","bubbles","cancelable","relatedObject","shiftKey","keyCode"]);
	}
	,__init: function() {
		openfl_events_Event.prototype.__init.call(this);
		this.keyCode = 0;
		this.shiftKey = false;
		this.relatedObject = null;
	}
	,__class__: openfl_events_FocusEvent
});
var openfl_events_FullScreenEvent = function(type,bubbles,cancelable,fullScreen,interactive) {
	if(interactive == null) {
		interactive = false;
	}
	if(fullScreen == null) {
		fullScreen = false;
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_ActivityEvent.call(this,type,bubbles,cancelable);
	this.fullScreen = fullScreen;
	this.interactive = interactive;
};
$hxClasses["openfl.events.FullScreenEvent"] = openfl_events_FullScreenEvent;
openfl_events_FullScreenEvent.__name__ = "openfl.events.FullScreenEvent";
openfl_events_FullScreenEvent.__super__ = openfl_events_ActivityEvent;
openfl_events_FullScreenEvent.prototype = $extend(openfl_events_ActivityEvent.prototype,{
	fullScreen: null
	,interactive: null
	,clone: function() {
		var event = new openfl_events_FullScreenEvent(this.type,this.bubbles,this.cancelable,this.fullScreen,this.interactive);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("FullscreenEvent",["type","bubbles","cancelable","fullscreen","interactive"]);
	}
	,__init: function() {
		openfl_events_ActivityEvent.prototype.__init.call(this);
		this.fullScreen = false;
		this.interactive = false;
	}
	,__class__: openfl_events_FullScreenEvent
});
var openfl_events_GameInputEvent = function(type,bubbles,cancelable,device) {
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = true;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.device = device;
};
$hxClasses["openfl.events.GameInputEvent"] = openfl_events_GameInputEvent;
openfl_events_GameInputEvent.__name__ = "openfl.events.GameInputEvent";
openfl_events_GameInputEvent.__super__ = openfl_events_Event;
openfl_events_GameInputEvent.prototype = $extend(openfl_events_Event.prototype,{
	device: null
	,clone: function() {
		var event = new openfl_events_GameInputEvent(this.type,this.bubbles,this.cancelable,this.device);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("GameInputEvent",["type","bubbles","cancelable","device"]);
	}
	,__init: function() {
		openfl_events_Event.prototype.__init.call(this);
		this.device = null;
	}
	,__class__: openfl_events_GameInputEvent
});
var openfl_events_HTTPStatusEvent = function(type,bubbles,cancelable,status,redirected) {
	if(redirected == null) {
		redirected = false;
	}
	if(status == null) {
		status = 0;
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	this.status = status;
	this.redirected = redirected;
	openfl_events_Event.call(this,type,bubbles,cancelable);
};
$hxClasses["openfl.events.HTTPStatusEvent"] = openfl_events_HTTPStatusEvent;
openfl_events_HTTPStatusEvent.__name__ = "openfl.events.HTTPStatusEvent";
openfl_events_HTTPStatusEvent.__super__ = openfl_events_Event;
openfl_events_HTTPStatusEvent.prototype = $extend(openfl_events_Event.prototype,{
	redirected: null
	,responseHeaders: null
	,responseURL: null
	,status: null
	,clone: function() {
		var event = new openfl_events_HTTPStatusEvent(this.type,this.bubbles,this.cancelable,this.status,this.redirected);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("HTTPStatusEvent",["type","bubbles","cancelable","status","redirected"]);
	}
	,__init: function() {
		openfl_events_Event.prototype.__init.call(this);
		this.status = 0;
		this.redirected = false;
	}
	,__class__: openfl_events_HTTPStatusEvent
});
var openfl_events_IOErrorEvent = function(type,bubbles,cancelable,text,id) {
	if(id == null) {
		id = 0;
	}
	if(text == null) {
		text = "";
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = true;
	}
	openfl_events_ErrorEvent.call(this,type,bubbles,cancelable,text,id);
};
$hxClasses["openfl.events.IOErrorEvent"] = openfl_events_IOErrorEvent;
openfl_events_IOErrorEvent.__name__ = "openfl.events.IOErrorEvent";
openfl_events_IOErrorEvent.__super__ = openfl_events_ErrorEvent;
openfl_events_IOErrorEvent.prototype = $extend(openfl_events_ErrorEvent.prototype,{
	clone: function() {
		var event = new openfl_events_IOErrorEvent(this.type,this.bubbles,this.cancelable,this.text,this.errorID);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("IOErrorEvent",["type","bubbles","cancelable","text","errorID"]);
	}
	,__class__: openfl_events_IOErrorEvent
});
var openfl_events_KeyboardEvent = function(type,bubbles,cancelable,charCodeValue,keyCodeValue,keyLocationValue,ctrlKeyValue,altKeyValue,shiftKeyValue,controlKeyValue,commandKeyValue) {
	if(commandKeyValue == null) {
		commandKeyValue = false;
	}
	if(controlKeyValue == null) {
		controlKeyValue = false;
	}
	if(shiftKeyValue == null) {
		shiftKeyValue = false;
	}
	if(altKeyValue == null) {
		altKeyValue = false;
	}
	if(ctrlKeyValue == null) {
		ctrlKeyValue = false;
	}
	if(keyCodeValue == null) {
		keyCodeValue = 0;
	}
	if(charCodeValue == null) {
		charCodeValue = 0;
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.charCode = charCodeValue;
	this.keyCode = keyCodeValue;
	this.keyLocation = keyLocationValue != null ? keyLocationValue : 0;
	this.ctrlKey = ctrlKeyValue;
	this.altKey = altKeyValue;
	this.shiftKey = shiftKeyValue;
	this.controlKey = controlKeyValue;
	this.commandKey = commandKeyValue;
};
$hxClasses["openfl.events.KeyboardEvent"] = openfl_events_KeyboardEvent;
openfl_events_KeyboardEvent.__name__ = "openfl.events.KeyboardEvent";
openfl_events_KeyboardEvent.__super__ = openfl_events_Event;
openfl_events_KeyboardEvent.prototype = $extend(openfl_events_Event.prototype,{
	altKey: null
	,charCode: null
	,commandKey: null
	,controlKey: null
	,ctrlKey: null
	,keyCode: null
	,keyLocation: null
	,shiftKey: null
	,clone: function() {
		var event = new openfl_events_KeyboardEvent(this.type,this.bubbles,this.cancelable,this.charCode,this.keyCode,this.keyLocation,this.ctrlKey,this.altKey,this.shiftKey,this.controlKey,this.commandKey);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("KeyboardEvent",["type","bubbles","cancelable","charCode","keyCode","keyLocation","ctrlKey","altKey","shiftKey"]);
	}
	,__init: function() {
		openfl_events_Event.prototype.__init.call(this);
		this.charCode = 0;
		this.keyCode = 0;
		this.keyLocation = 0;
		this.ctrlKey = false;
		this.altKey = false;
		this.shiftKey = false;
		this.controlKey = false;
		this.commandKey = false;
	}
	,__class__: openfl_events_KeyboardEvent
});
var openfl_events_MouseEvent = function(type,bubbles,cancelable,localX,localY,relatedObject,ctrlKey,altKey,shiftKey,buttonDown,delta,commandKey,clickCount) {
	if(clickCount == null) {
		clickCount = 0;
	}
	if(commandKey == null) {
		commandKey = false;
	}
	if(delta == null) {
		delta = 0;
	}
	if(buttonDown == null) {
		buttonDown = false;
	}
	if(shiftKey == null) {
		shiftKey = false;
	}
	if(altKey == null) {
		altKey = false;
	}
	if(ctrlKey == null) {
		ctrlKey = false;
	}
	if(localY == null) {
		localY = 0;
	}
	if(localX == null) {
		localX = 0;
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = true;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.shiftKey = shiftKey;
	this.altKey = altKey;
	this.ctrlKey = ctrlKey;
	this.bubbles = bubbles;
	this.relatedObject = relatedObject;
	this.delta = delta;
	this.localX = localX;
	this.localY = localY;
	this.buttonDown = buttonDown;
	this.commandKey = commandKey;
	this.clickCount = clickCount;
	this.isRelatedObjectInaccessible = false;
	this.stageX = NaN;
	this.stageY = NaN;
};
$hxClasses["openfl.events.MouseEvent"] = openfl_events_MouseEvent;
openfl_events_MouseEvent.__name__ = "openfl.events.MouseEvent";
openfl_events_MouseEvent.__altKey = null;
openfl_events_MouseEvent.__buttonDown = null;
openfl_events_MouseEvent.__commandKey = null;
openfl_events_MouseEvent.__ctrlKey = null;
openfl_events_MouseEvent.__shiftKey = null;
openfl_events_MouseEvent.__create = function(type,button,stageX,stageY,local,target,delta) {
	if(delta == null) {
		delta = 0;
	}
	var event = new openfl_events_MouseEvent(type,true,false,local.x,local.y,null,openfl_events_MouseEvent.__ctrlKey,openfl_events_MouseEvent.__altKey,openfl_events_MouseEvent.__shiftKey,openfl_events_MouseEvent.__buttonDown,delta,openfl_events_MouseEvent.__commandKey);
	event.stageX = stageX;
	event.stageY = stageY;
	event.target = target;
	return event;
};
openfl_events_MouseEvent.__super__ = openfl_events_Event;
openfl_events_MouseEvent.prototype = $extend(openfl_events_Event.prototype,{
	altKey: null
	,buttonDown: null
	,commandKey: null
	,clickCount: null
	,ctrlKey: null
	,delta: null
	,isRelatedObjectInaccessible: null
	,localX: null
	,localY: null
	,relatedObject: null
	,shiftKey: null
	,stageX: null
	,stageY: null
	,clone: function() {
		var event = new openfl_events_MouseEvent(this.type,this.bubbles,this.cancelable,this.localX,this.localY,this.relatedObject,this.ctrlKey,this.altKey,this.shiftKey,this.buttonDown,this.delta,this.commandKey,this.clickCount);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("MouseEvent",["type","bubbles","cancelable","localX","localY","relatedObject","ctrlKey","altKey","shiftKey","buttonDown","delta"]);
	}
	,updateAfterEvent: function() {
	}
	,__init: function() {
		openfl_events_Event.prototype.__init.call(this);
		this.shiftKey = false;
		this.altKey = false;
		this.ctrlKey = false;
		this.bubbles = false;
		this.relatedObject = null;
		this.delta = 0;
		this.localX = 0;
		this.localY = 0;
		this.buttonDown = false;
		this.commandKey = false;
		this.clickCount = 0;
		this.isRelatedObjectInaccessible = false;
		this.stageX = NaN;
		this.stageY = NaN;
	}
	,__class__: openfl_events_MouseEvent
});
var openfl_events_NetStatusEvent = function(type,bubbles,cancelable,info) {
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	this.info = info;
	openfl_events_Event.call(this,type,bubbles,cancelable);
};
$hxClasses["openfl.events.NetStatusEvent"] = openfl_events_NetStatusEvent;
openfl_events_NetStatusEvent.__name__ = "openfl.events.NetStatusEvent";
openfl_events_NetStatusEvent.__super__ = openfl_events_Event;
openfl_events_NetStatusEvent.prototype = $extend(openfl_events_Event.prototype,{
	info: null
	,clone: function() {
		var event = new openfl_events_NetStatusEvent(this.type,this.bubbles,this.cancelable,this.info);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("NetStatusEvent",["type","bubbles","cancelable","info"]);
	}
	,__init: function() {
		openfl_events_Event.prototype.__init.call(this);
		this.info = null;
	}
	,__class__: openfl_events_NetStatusEvent
});
var openfl_events_ProgressEvent = function(type,bubbles,cancelable,bytesLoaded,bytesTotal) {
	if(bytesTotal == null) {
		bytesTotal = 0;
	}
	if(bytesLoaded == null) {
		bytesLoaded = 0;
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.bytesLoaded = bytesLoaded;
	this.bytesTotal = bytesTotal;
};
$hxClasses["openfl.events.ProgressEvent"] = openfl_events_ProgressEvent;
openfl_events_ProgressEvent.__name__ = "openfl.events.ProgressEvent";
openfl_events_ProgressEvent.__super__ = openfl_events_Event;
openfl_events_ProgressEvent.prototype = $extend(openfl_events_Event.prototype,{
	bytesLoaded: null
	,bytesTotal: null
	,clone: function() {
		var event = new openfl_events_ProgressEvent(this.type,this.bubbles,this.cancelable,this.bytesLoaded,this.bytesTotal);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("ProgressEvent",["type","bubbles","cancelable","bytesLoaded","bytesTotal"]);
	}
	,__init: function() {
		openfl_events_Event.prototype.__init.call(this);
		this.bytesLoaded = 0;
		this.bytesTotal = 0;
	}
	,__class__: openfl_events_ProgressEvent
});
var openfl_events_RenderEvent = function(type,bubbles,cancelable,objectMatrix,objectColorTransform,allowSmoothing) {
	if(allowSmoothing == null) {
		allowSmoothing = true;
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.objectMatrix = objectMatrix;
	this.objectColorTransform = objectColorTransform;
	this.allowSmoothing = allowSmoothing;
};
$hxClasses["openfl.events.RenderEvent"] = openfl_events_RenderEvent;
openfl_events_RenderEvent.__name__ = "openfl.events.RenderEvent";
openfl_events_RenderEvent.__super__ = openfl_events_Event;
openfl_events_RenderEvent.prototype = $extend(openfl_events_Event.prototype,{
	allowSmoothing: null
	,objectColorTransform: null
	,objectMatrix: null
	,renderer: null
	,clone: function() {
		var event = new openfl_events_RenderEvent(this.type,this.bubbles,this.cancelable,this.objectMatrix.clone(),this.objectColorTransform.__clone(),this.allowSmoothing);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("RenderEvent",["type","bubbles","cancelable"]);
	}
	,__init: function() {
		openfl_events_Event.prototype.__init.call(this);
		this.objectMatrix = null;
		this.objectColorTransform = null;
		this.allowSmoothing = false;
		this.renderer = null;
	}
	,__class__: openfl_events_RenderEvent
});
var openfl_events_SecurityErrorEvent = function(type,bubbles,cancelable,text,id) {
	if(id == null) {
		id = 0;
	}
	if(text == null) {
		text = "";
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_ErrorEvent.call(this,type,bubbles,cancelable,text,id);
};
$hxClasses["openfl.events.SecurityErrorEvent"] = openfl_events_SecurityErrorEvent;
openfl_events_SecurityErrorEvent.__name__ = "openfl.events.SecurityErrorEvent";
openfl_events_SecurityErrorEvent.__super__ = openfl_events_ErrorEvent;
openfl_events_SecurityErrorEvent.prototype = $extend(openfl_events_ErrorEvent.prototype,{
	clone: function() {
		var event = new openfl_events_SecurityErrorEvent(this.type,this.bubbles,this.cancelable,this.text,this.errorID);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("SecurityErrorEvent",["type","bubbles","cancelable","text","errorID"]);
	}
	,__class__: openfl_events_SecurityErrorEvent
});
var openfl_events_TouchEvent = function(type,bubbles,cancelable,touchPointID,isPrimaryTouchPoint,localX,localY,sizeX,sizeY,pressure,relatedObject,ctrlKey,altKey,shiftKey,commandKey,controlKey,timestamp,touchIntent,samples,isTouchPointCanceled) {
	if(isTouchPointCanceled == null) {
		isTouchPointCanceled = false;
	}
	if(timestamp == null) {
		timestamp = 0;
	}
	if(controlKey == null) {
		controlKey = false;
	}
	if(commandKey == null) {
		commandKey = false;
	}
	if(shiftKey == null) {
		shiftKey = false;
	}
	if(altKey == null) {
		altKey = false;
	}
	if(ctrlKey == null) {
		ctrlKey = false;
	}
	if(pressure == null) {
		pressure = 0;
	}
	if(sizeY == null) {
		sizeY = 0;
	}
	if(sizeX == null) {
		sizeX = 0;
	}
	if(localY == null) {
		localY = 0;
	}
	if(localX == null) {
		localX = 0;
	}
	if(isPrimaryTouchPoint == null) {
		isPrimaryTouchPoint = false;
	}
	if(touchPointID == null) {
		touchPointID = 0;
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = true;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.touchPointID = touchPointID;
	this.isPrimaryTouchPoint = isPrimaryTouchPoint;
	this.localX = localX;
	this.localY = localY;
	this.sizeX = sizeX;
	this.sizeY = sizeY;
	this.pressure = pressure;
	this.relatedObject = relatedObject;
	this.ctrlKey = ctrlKey;
	this.altKey = altKey;
	this.shiftKey = shiftKey;
	this.commandKey = commandKey;
	this.controlKey = controlKey;
	this.stageX = NaN;
	this.stageY = NaN;
};
$hxClasses["openfl.events.TouchEvent"] = openfl_events_TouchEvent;
openfl_events_TouchEvent.__name__ = "openfl.events.TouchEvent";
openfl_events_TouchEvent.__create = function(type,touch,stageX,stageY,local,target) {
	var evt = new openfl_events_TouchEvent(type,true,false,0,true,local.x,local.y,1,1,1);
	evt.stageX = stageX;
	evt.stageY = stageY;
	evt.target = target;
	return evt;
};
openfl_events_TouchEvent.__super__ = openfl_events_Event;
openfl_events_TouchEvent.prototype = $extend(openfl_events_Event.prototype,{
	altKey: null
	,commandKey: null
	,controlKey: null
	,ctrlKey: null
	,delta: null
	,isPrimaryTouchPoint: null
	,localX: null
	,localY: null
	,pressure: null
	,relatedObject: null
	,shiftKey: null
	,sizeX: null
	,sizeY: null
	,stageX: null
	,stageY: null
	,touchPointID: null
	,clone: function() {
		var event = new openfl_events_TouchEvent(this.type,this.bubbles,this.cancelable,this.touchPointID,this.isPrimaryTouchPoint,this.localX,this.localY,this.sizeX,this.sizeY,this.pressure,this.relatedObject,this.ctrlKey,this.altKey,this.shiftKey,this.commandKey,this.controlKey);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("TouchEvent",["type","bubbles","cancelable","touchPointID","isPrimaryTouchPoint","localX","localY","sizeX","sizeY","pressure","relatedObject","ctrlKey","altKey","shiftKey","commandKey","controlKey"]);
	}
	,updateAfterEvent: function() {
	}
	,__init: function() {
		openfl_events_Event.prototype.__init.call(this);
		this.touchPointID = 0;
		this.isPrimaryTouchPoint = false;
		this.localX = 0;
		this.localY = 0;
		this.sizeX = 0;
		this.sizeY = 0;
		this.pressure = 0;
		this.relatedObject = null;
		this.ctrlKey = false;
		this.altKey = false;
		this.shiftKey = false;
		this.commandKey = false;
		this.controlKey = false;
		this.stageX = NaN;
		this.stageY = NaN;
	}
	,__class__: openfl_events_TouchEvent
});
var openfl_events_UncaughtErrorEvent = function(type,bubbles,cancelable,error) {
	if(cancelable == null) {
		cancelable = true;
	}
	if(bubbles == null) {
		bubbles = true;
	}
	openfl_events_ErrorEvent.call(this,type,bubbles,cancelable);
	this.error = error;
};
$hxClasses["openfl.events.UncaughtErrorEvent"] = openfl_events_UncaughtErrorEvent;
openfl_events_UncaughtErrorEvent.__name__ = "openfl.events.UncaughtErrorEvent";
openfl_events_UncaughtErrorEvent.__super__ = openfl_events_ErrorEvent;
openfl_events_UncaughtErrorEvent.prototype = $extend(openfl_events_ErrorEvent.prototype,{
	error: null
	,clone: function() {
		var event = new openfl_events_UncaughtErrorEvent(this.type,this.bubbles,this.cancelable,this.error);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("UncaughtErrorEvent",["type","bubbles","cancelable","error"]);
	}
	,__init: function() {
		openfl_events_ErrorEvent.prototype.__init.call(this);
		this.error = null;
	}
	,__class__: openfl_events_UncaughtErrorEvent
});
var openfl_events_UncaughtErrorEvents = function() {
	openfl_events_EventDispatcher.call(this);
};
$hxClasses["openfl.events.UncaughtErrorEvents"] = openfl_events_UncaughtErrorEvents;
openfl_events_UncaughtErrorEvents.__name__ = "openfl.events.UncaughtErrorEvents";
openfl_events_UncaughtErrorEvents.__super__ = openfl_events_EventDispatcher;
openfl_events_UncaughtErrorEvents.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	__class__: openfl_events_UncaughtErrorEvents
});
var openfl_filters_BitmapFilter = function() {
	this.__bottomExtension = 0;
	this.__leftExtension = 0;
	this.__needSecondBitmapData = true;
	this.__numShaderPasses = 0;
	this.__preserveObject = false;
	this.__rightExtension = 0;
	this.__shaderBlendMode = 10;
	this.__topExtension = 0;
	this.__smooth = true;
};
$hxClasses["openfl.filters.BitmapFilter"] = openfl_filters_BitmapFilter;
openfl_filters_BitmapFilter.__name__ = "openfl.filters.BitmapFilter";
openfl_filters_BitmapFilter.prototype = {
	__bottomExtension: null
	,__leftExtension: null
	,__needSecondBitmapData: null
	,__numShaderPasses: null
	,__preserveObject: null
	,__renderDirty: null
	,__rightExtension: null
	,__shaderBlendMode: null
	,__smooth: null
	,__topExtension: null
	,clone: function() {
		return new openfl_filters_BitmapFilter();
	}
	,__applyFilter: function(bitmapData,sourceBitmapData,sourceRect,destPoint) {
		return sourceBitmapData;
	}
	,__initShader: function(renderer,pass,sourceBitmapData) {
		return null;
	}
	,__class__: openfl_filters_BitmapFilter
};
var openfl_geom_Matrix3D = function(v) {
	if(v != null && v.get_length() == 16) {
		this.rawData = v.concat(null);
	} else {
		this.rawData = openfl_Vector.toFloatVector(null,null,null,[1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0]);
	}
};
$hxClasses["openfl.geom.Matrix3D"] = openfl_geom_Matrix3D;
openfl_geom_Matrix3D.__name__ = "openfl.geom.Matrix3D";
openfl_geom_Matrix3D.create2D = function(x,y,scale,rotation) {
	if(rotation == null) {
		rotation = 0;
	}
	if(scale == null) {
		scale = 1;
	}
	var theta = rotation * Math.PI / 180.0;
	var c = Math.cos(theta);
	var s = Math.sin(theta);
	return new openfl_geom_Matrix3D(openfl_Vector.toFloatVector(null,null,null,[c * scale,-s * scale,0,0,s * scale,c * scale,0,0,0,0,1,0,x,y,0,1]));
};
openfl_geom_Matrix3D.createABCD = function(a,b,c,d,tx,ty) {
	return new openfl_geom_Matrix3D(openfl_Vector.toFloatVector(null,null,null,[a,b,0,0,c,d,0,0,0,0,1,0,tx,ty,0,1]));
};
openfl_geom_Matrix3D.createOrtho = function(x0,x1,y0,y1,zNear,zFar) {
	var sx = 1.0 / (x1 - x0);
	var sy = 1.0 / (y1 - y0);
	var sz = 1.0 / (zFar - zNear);
	return new openfl_geom_Matrix3D(openfl_Vector.toFloatVector(null,null,null,[2.0 * sx,0,0,0,0,2.0 * sy,0,0,0,0,-2.0 * sz,0,-(x0 + x1) * sx,-(y0 + y1) * sy,-(zNear + zFar) * sz,1]));
};
openfl_geom_Matrix3D.interpolate = function(thisMat,toMat,percent) {
	var m = new openfl_geom_Matrix3D();
	var _g = 0;
	while(_g < 16) {
		var i = _g++;
		m.rawData.set(i,thisMat.rawData.get(i) + (toMat.rawData.get(i) - thisMat.rawData.get(i)) * percent);
	}
	return m;
};
openfl_geom_Matrix3D.__getAxisRotation = function(x,y,z,degrees) {
	var m = new openfl_geom_Matrix3D();
	var a1 = new openfl_geom_Vector3D(x,y,z);
	var rad = -degrees * (Math.PI / 180);
	var c = Math.cos(rad);
	var s = Math.sin(rad);
	var t = 1.0 - c;
	m.rawData.set(0,c + a1.x * a1.x * t);
	m.rawData.set(5,c + a1.y * a1.y * t);
	m.rawData.set(10,c + a1.z * a1.z * t);
	var tmp1 = a1.x * a1.y * t;
	var tmp2 = a1.z * s;
	m.rawData.set(4,tmp1 + tmp2);
	m.rawData.set(1,tmp1 - tmp2);
	tmp1 = a1.x * a1.z * t;
	tmp2 = a1.y * s;
	m.rawData.set(8,tmp1 - tmp2);
	m.rawData.set(2,tmp1 + tmp2);
	tmp1 = a1.y * a1.z * t;
	tmp2 = a1.x * s;
	m.rawData.set(9,tmp1 + tmp2);
	m.rawData.set(6,tmp1 - tmp2);
	return m;
};
openfl_geom_Matrix3D.prototype = {
	rawData: null
	,append: function(lhs) {
		var m111 = this.rawData.get(0);
		var m121 = this.rawData.get(4);
		var m131 = this.rawData.get(8);
		var m141 = this.rawData.get(12);
		var m112 = this.rawData.get(1);
		var m122 = this.rawData.get(5);
		var m132 = this.rawData.get(9);
		var m142 = this.rawData.get(13);
		var m113 = this.rawData.get(2);
		var m123 = this.rawData.get(6);
		var m133 = this.rawData.get(10);
		var m143 = this.rawData.get(14);
		var m114 = this.rawData.get(3);
		var m124 = this.rawData.get(7);
		var m134 = this.rawData.get(11);
		var m144 = this.rawData.get(15);
		var m211 = lhs.rawData.get(0);
		var m221 = lhs.rawData.get(4);
		var m231 = lhs.rawData.get(8);
		var m241 = lhs.rawData.get(12);
		var m212 = lhs.rawData.get(1);
		var m222 = lhs.rawData.get(5);
		var m232 = lhs.rawData.get(9);
		var m242 = lhs.rawData.get(13);
		var m213 = lhs.rawData.get(2);
		var m223 = lhs.rawData.get(6);
		var m233 = lhs.rawData.get(10);
		var m243 = lhs.rawData.get(14);
		var m214 = lhs.rawData.get(3);
		var m224 = lhs.rawData.get(7);
		var m234 = lhs.rawData.get(11);
		var m244 = lhs.rawData.get(15);
		this.rawData.set(0,m111 * m211 + m112 * m221 + m113 * m231 + m114 * m241);
		this.rawData.set(1,m111 * m212 + m112 * m222 + m113 * m232 + m114 * m242);
		this.rawData.set(2,m111 * m213 + m112 * m223 + m113 * m233 + m114 * m243);
		this.rawData.set(3,m111 * m214 + m112 * m224 + m113 * m234 + m114 * m244);
		this.rawData.set(4,m121 * m211 + m122 * m221 + m123 * m231 + m124 * m241);
		this.rawData.set(5,m121 * m212 + m122 * m222 + m123 * m232 + m124 * m242);
		this.rawData.set(6,m121 * m213 + m122 * m223 + m123 * m233 + m124 * m243);
		this.rawData.set(7,m121 * m214 + m122 * m224 + m123 * m234 + m124 * m244);
		this.rawData.set(8,m131 * m211 + m132 * m221 + m133 * m231 + m134 * m241);
		this.rawData.set(9,m131 * m212 + m132 * m222 + m133 * m232 + m134 * m242);
		this.rawData.set(10,m131 * m213 + m132 * m223 + m133 * m233 + m134 * m243);
		this.rawData.set(11,m131 * m214 + m132 * m224 + m133 * m234 + m134 * m244);
		this.rawData.set(12,m141 * m211 + m142 * m221 + m143 * m231 + m144 * m241);
		this.rawData.set(13,m141 * m212 + m142 * m222 + m143 * m232 + m144 * m242);
		this.rawData.set(14,m141 * m213 + m142 * m223 + m143 * m233 + m144 * m243);
		this.rawData.set(15,m141 * m214 + m142 * m224 + m143 * m234 + m144 * m244);
	}
	,appendRotation: function(degrees,axis,pivotPoint) {
		var tz = 0;
		var ty = tz;
		var tx = ty;
		if(pivotPoint != null) {
			tx = pivotPoint.x;
			ty = pivotPoint.y;
			tz = pivotPoint.z;
		}
		var radian = degrees * Math.PI / 180;
		var cos = Math.cos(radian);
		var sin = Math.sin(radian);
		var x = axis.x;
		var y = axis.y;
		var z = axis.z;
		var x2 = x * x;
		var y2 = y * y;
		var z2 = z * z;
		var ls = x2 + y2 + z2;
		if(ls != 0) {
			var l = Math.sqrt(ls);
			x /= l;
			y /= l;
			z /= l;
			x2 /= ls;
			y2 /= ls;
			z2 /= ls;
		}
		var ccos = 1 - cos;
		var m = new openfl_geom_Matrix3D();
		var d = m.rawData;
		d.set(0,x2 + (y2 + z2) * cos);
		d.set(1,x * y * ccos + z * sin);
		d.set(2,x * z * ccos - y * sin);
		d.set(4,x * y * ccos - z * sin);
		d.set(5,y2 + (x2 + z2) * cos);
		d.set(6,y * z * ccos + x * sin);
		d.set(8,x * z * ccos + y * sin);
		d.set(9,y * z * ccos - x * sin);
		d.set(10,z2 + (x2 + y2) * cos);
		d.set(12,(tx * (y2 + z2) - x * (ty * y + tz * z)) * ccos + (ty * z - tz * y) * sin);
		d.set(13,(ty * (x2 + z2) - y * (tx * x + tz * z)) * ccos + (tz * x - tx * z) * sin);
		d.set(14,(tz * (x2 + y2) - z * (tx * x + ty * y)) * ccos + (tx * y - ty * x) * sin);
		this.append(m);
	}
	,appendScale: function(xScale,yScale,zScale) {
		this.append(new openfl_geom_Matrix3D(openfl_Vector.toFloatVector(null,null,null,[xScale,0.0,0.0,0.0,0.0,yScale,0.0,0.0,0.0,0.0,zScale,0.0,0.0,0.0,0.0,1.0])));
	}
	,appendTranslation: function(x,y,z) {
		var _g = this.rawData;
		_g.set(12,_g.get(12) + x);
		var _g = this.rawData;
		_g.set(13,_g.get(13) + y);
		var _g = this.rawData;
		_g.set(14,_g.get(14) + z);
	}
	,clone: function() {
		return new openfl_geom_Matrix3D(this.rawData.copy());
	}
	,copyColumnFrom: function(column,vector3D) {
		switch(column) {
		case 0:
			this.rawData.set(0,vector3D.x);
			this.rawData.set(1,vector3D.y);
			this.rawData.set(2,vector3D.z);
			this.rawData.set(3,vector3D.w);
			break;
		case 1:
			this.rawData.set(4,vector3D.x);
			this.rawData.set(5,vector3D.y);
			this.rawData.set(6,vector3D.z);
			this.rawData.set(7,vector3D.w);
			break;
		case 2:
			this.rawData.set(8,vector3D.x);
			this.rawData.set(9,vector3D.y);
			this.rawData.set(10,vector3D.z);
			this.rawData.set(11,vector3D.w);
			break;
		case 3:
			this.rawData.set(12,vector3D.x);
			this.rawData.set(13,vector3D.y);
			this.rawData.set(14,vector3D.z);
			this.rawData.set(15,vector3D.w);
			break;
		default:
		}
	}
	,copyColumnTo: function(column,vector3D) {
		switch(column) {
		case 0:
			vector3D.x = this.rawData.get(0);
			vector3D.y = this.rawData.get(1);
			vector3D.z = this.rawData.get(2);
			vector3D.w = this.rawData.get(3);
			break;
		case 1:
			vector3D.x = this.rawData.get(4);
			vector3D.y = this.rawData.get(5);
			vector3D.z = this.rawData.get(6);
			vector3D.w = this.rawData.get(7);
			break;
		case 2:
			vector3D.x = this.rawData.get(8);
			vector3D.y = this.rawData.get(9);
			vector3D.z = this.rawData.get(10);
			vector3D.w = this.rawData.get(11);
			break;
		case 3:
			vector3D.x = this.rawData.get(12);
			vector3D.y = this.rawData.get(13);
			vector3D.z = this.rawData.get(14);
			vector3D.w = this.rawData.get(15);
			break;
		default:
		}
	}
	,copyFrom: function(other) {
		this.rawData = other.rawData.copy();
	}
	,copyRawDataFrom: function(vector,index,transpose) {
		if(transpose == null) {
			transpose = false;
		}
		if(index == null) {
			index = 0;
		}
		if(transpose) {
			this.transpose();
		}
		var length = vector.get_length() - index;
		var _g = 0;
		var _g1 = length;
		while(_g < _g1) {
			var i = _g++;
			this.rawData.set(i,vector.get(i + index));
		}
		if(transpose) {
			this.transpose();
		}
	}
	,copyRawDataTo: function(vector,index,transpose) {
		if(transpose == null) {
			transpose = false;
		}
		if(index == null) {
			index = 0;
		}
		if(transpose) {
			this.transpose();
		}
		var _g = 0;
		var _g1 = this.rawData.get_length();
		while(_g < _g1) {
			var i = _g++;
			vector.set(i + index,this.rawData.get(i));
		}
		if(transpose) {
			this.transpose();
		}
	}
	,copyRowFrom: function(row,vector3D) {
		switch(row) {
		case 0:
			this.rawData.set(0,vector3D.x);
			this.rawData.set(4,vector3D.y);
			this.rawData.set(8,vector3D.z);
			this.rawData.set(12,vector3D.w);
			break;
		case 1:
			this.rawData.set(1,vector3D.x);
			this.rawData.set(5,vector3D.y);
			this.rawData.set(9,vector3D.z);
			this.rawData.set(13,vector3D.w);
			break;
		case 2:
			this.rawData.set(2,vector3D.x);
			this.rawData.set(6,vector3D.y);
			this.rawData.set(10,vector3D.z);
			this.rawData.set(14,vector3D.w);
			break;
		case 3:
			this.rawData.set(3,vector3D.x);
			this.rawData.set(7,vector3D.y);
			this.rawData.set(11,vector3D.z);
			this.rawData.set(15,vector3D.w);
			break;
		default:
		}
	}
	,copyRowTo: function(row,vector3D) {
		switch(row) {
		case 0:
			vector3D.x = this.rawData.get(0);
			vector3D.y = this.rawData.get(4);
			vector3D.z = this.rawData.get(8);
			vector3D.w = this.rawData.get(12);
			break;
		case 1:
			vector3D.x = this.rawData.get(1);
			vector3D.y = this.rawData.get(5);
			vector3D.z = this.rawData.get(9);
			vector3D.w = this.rawData.get(13);
			break;
		case 2:
			vector3D.x = this.rawData.get(2);
			vector3D.y = this.rawData.get(6);
			vector3D.z = this.rawData.get(10);
			vector3D.w = this.rawData.get(14);
			break;
		case 3:
			vector3D.x = this.rawData.get(3);
			vector3D.y = this.rawData.get(7);
			vector3D.z = this.rawData.get(11);
			vector3D.w = this.rawData.get(15);
			break;
		default:
		}
	}
	,copyToMatrix3D: function(other) {
		other.rawData = this.rawData.copy();
	}
	,decompose: function(orientationStyle) {
		if(orientationStyle == null) {
			orientationStyle = 1;
		}
		var vec = openfl_Vector.toObjectVector(null);
		var m = this.clone();
		var mr = m.rawData.copy();
		var pos = new openfl_geom_Vector3D(mr.get(12),mr.get(13),mr.get(14));
		mr.set(12,0);
		mr.set(13,0);
		mr.set(14,0);
		var scale = new openfl_geom_Vector3D();
		scale.x = Math.sqrt(mr.get(0) * mr.get(0) + mr.get(1) * mr.get(1) + mr.get(2) * mr.get(2));
		scale.y = Math.sqrt(mr.get(4) * mr.get(4) + mr.get(5) * mr.get(5) + mr.get(6) * mr.get(6));
		scale.z = Math.sqrt(mr.get(8) * mr.get(8) + mr.get(9) * mr.get(9) + mr.get(10) * mr.get(10));
		if(mr.get(0) * (mr.get(5) * mr.get(10) - mr.get(6) * mr.get(9)) - mr.get(1) * (mr.get(4) * mr.get(10) - mr.get(6) * mr.get(8)) + mr.get(2) * (mr.get(4) * mr.get(9) - mr.get(5) * mr.get(8)) < 0) {
			scale.z = -scale.z;
		}
		var _g = mr;
		_g.set(0,_g.get(0) / scale.x);
		var _g = mr;
		_g.set(1,_g.get(1) / scale.x);
		var _g = mr;
		_g.set(2,_g.get(2) / scale.x);
		var _g = mr;
		_g.set(4,_g.get(4) / scale.y);
		var _g = mr;
		_g.set(5,_g.get(5) / scale.y);
		var _g = mr;
		_g.set(6,_g.get(6) / scale.y);
		var _g = mr;
		_g.set(8,_g.get(8) / scale.z);
		var _g = mr;
		_g.set(9,_g.get(9) / scale.z);
		var _g = mr;
		_g.set(10,_g.get(10) / scale.z);
		var rot = new openfl_geom_Vector3D();
		switch(orientationStyle) {
		case 0:
			rot.w = Math.acos((mr.get(0) + mr.get(5) + mr.get(10) - 1) / 2);
			var len = Math.sqrt((mr.get(6) - mr.get(9)) * (mr.get(6) - mr.get(9)) + (mr.get(8) - mr.get(2)) * (mr.get(8) - mr.get(2)) + (mr.get(1) - mr.get(4)) * (mr.get(1) - mr.get(4)));
			if(len != 0) {
				rot.x = (mr.get(6) - mr.get(9)) / len;
				rot.y = (mr.get(8) - mr.get(2)) / len;
				rot.z = (mr.get(1) - mr.get(4)) / len;
			} else {
				rot.x = rot.y = rot.z = 0;
			}
			break;
		case 1:
			rot.y = Math.asin(-mr.get(2));
			if(mr.get(2) != 1 && mr.get(2) != -1) {
				rot.x = Math.atan2(mr.get(6),mr.get(10));
				rot.z = Math.atan2(mr.get(1),mr.get(0));
			} else {
				rot.z = 0;
				rot.x = Math.atan2(mr.get(4),mr.get(5));
			}
			break;
		case 2:
			var tr = mr.get(0) + mr.get(5) + mr.get(10);
			if(tr > 0) {
				rot.w = Math.sqrt(1 + tr) / 2;
				rot.x = (mr.get(6) - mr.get(9)) / (4 * rot.w);
				rot.y = (mr.get(8) - mr.get(2)) / (4 * rot.w);
				rot.z = (mr.get(1) - mr.get(4)) / (4 * rot.w);
			} else if(mr.get(0) > mr.get(5) && mr.get(0) > mr.get(10)) {
				rot.x = Math.sqrt(1 + mr.get(0) - mr.get(5) - mr.get(10)) / 2;
				rot.w = (mr.get(6) - mr.get(9)) / (4 * rot.x);
				rot.y = (mr.get(1) + mr.get(4)) / (4 * rot.x);
				rot.z = (mr.get(8) + mr.get(2)) / (4 * rot.x);
			} else if(mr.get(5) > mr.get(10)) {
				rot.y = Math.sqrt(1 + mr.get(5) - mr.get(0) - mr.get(10)) / 2;
				rot.x = (mr.get(1) + mr.get(4)) / (4 * rot.y);
				rot.w = (mr.get(8) - mr.get(2)) / (4 * rot.y);
				rot.z = (mr.get(6) + mr.get(9)) / (4 * rot.y);
			} else {
				rot.z = Math.sqrt(1 + mr.get(10) - mr.get(0) - mr.get(5)) / 2;
				rot.x = (mr.get(8) + mr.get(2)) / (4 * rot.z);
				rot.y = (mr.get(6) + mr.get(9)) / (4 * rot.z);
				rot.w = (mr.get(1) - mr.get(4)) / (4 * rot.z);
			}
			break;
		}
		vec.push(pos);
		vec.push(rot);
		vec.push(scale);
		return vec;
	}
	,deltaTransformVector: function(v) {
		var x = v.x;
		var y = v.y;
		var z = v.z;
		return new openfl_geom_Vector3D(x * this.rawData.get(0) + y * this.rawData.get(4) + z * this.rawData.get(8),x * this.rawData.get(1) + y * this.rawData.get(5) + z * this.rawData.get(9),x * this.rawData.get(2) + y * this.rawData.get(6) + z * this.rawData.get(10),x * this.rawData.get(3) + y * this.rawData.get(7) + z * this.rawData.get(11));
	}
	,identity: function() {
		this.rawData = openfl_Vector.toFloatVector(null,null,null,[1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0]);
	}
	,interpolateTo: function(toMat,percent) {
		var _g = 0;
		while(_g < 16) {
			var i = _g++;
			this.rawData.set(i,this.rawData.get(i) + (toMat.rawData.get(i) - this.rawData.get(i)) * percent);
		}
	}
	,invert: function() {
		var d = this.get_determinant();
		var invertable = Math.abs(d) > 0.00000000001;
		if(invertable) {
			d = 1 / d;
			var m11 = this.rawData.get(0);
			var m21 = this.rawData.get(4);
			var m31 = this.rawData.get(8);
			var m41 = this.rawData.get(12);
			var m12 = this.rawData.get(1);
			var m22 = this.rawData.get(5);
			var m32 = this.rawData.get(9);
			var m42 = this.rawData.get(13);
			var m13 = this.rawData.get(2);
			var m23 = this.rawData.get(6);
			var m33 = this.rawData.get(10);
			var m43 = this.rawData.get(14);
			var m14 = this.rawData.get(3);
			var m24 = this.rawData.get(7);
			var m34 = this.rawData.get(11);
			var m44 = this.rawData.get(15);
			this.rawData.set(0,d * (m22 * (m33 * m44 - m43 * m34) - m32 * (m23 * m44 - m43 * m24) + m42 * (m23 * m34 - m33 * m24)));
			this.rawData.set(1,-d * (m12 * (m33 * m44 - m43 * m34) - m32 * (m13 * m44 - m43 * m14) + m42 * (m13 * m34 - m33 * m14)));
			this.rawData.set(2,d * (m12 * (m23 * m44 - m43 * m24) - m22 * (m13 * m44 - m43 * m14) + m42 * (m13 * m24 - m23 * m14)));
			this.rawData.set(3,-d * (m12 * (m23 * m34 - m33 * m24) - m22 * (m13 * m34 - m33 * m14) + m32 * (m13 * m24 - m23 * m14)));
			this.rawData.set(4,-d * (m21 * (m33 * m44 - m43 * m34) - m31 * (m23 * m44 - m43 * m24) + m41 * (m23 * m34 - m33 * m24)));
			this.rawData.set(5,d * (m11 * (m33 * m44 - m43 * m34) - m31 * (m13 * m44 - m43 * m14) + m41 * (m13 * m34 - m33 * m14)));
			this.rawData.set(6,-d * (m11 * (m23 * m44 - m43 * m24) - m21 * (m13 * m44 - m43 * m14) + m41 * (m13 * m24 - m23 * m14)));
			this.rawData.set(7,d * (m11 * (m23 * m34 - m33 * m24) - m21 * (m13 * m34 - m33 * m14) + m31 * (m13 * m24 - m23 * m14)));
			this.rawData.set(8,d * (m21 * (m32 * m44 - m42 * m34) - m31 * (m22 * m44 - m42 * m24) + m41 * (m22 * m34 - m32 * m24)));
			this.rawData.set(9,-d * (m11 * (m32 * m44 - m42 * m34) - m31 * (m12 * m44 - m42 * m14) + m41 * (m12 * m34 - m32 * m14)));
			this.rawData.set(10,d * (m11 * (m22 * m44 - m42 * m24) - m21 * (m12 * m44 - m42 * m14) + m41 * (m12 * m24 - m22 * m14)));
			this.rawData.set(11,-d * (m11 * (m22 * m34 - m32 * m24) - m21 * (m12 * m34 - m32 * m14) + m31 * (m12 * m24 - m22 * m14)));
			this.rawData.set(12,-d * (m21 * (m32 * m43 - m42 * m33) - m31 * (m22 * m43 - m42 * m23) + m41 * (m22 * m33 - m32 * m23)));
			this.rawData.set(13,d * (m11 * (m32 * m43 - m42 * m33) - m31 * (m12 * m43 - m42 * m13) + m41 * (m12 * m33 - m32 * m13)));
			this.rawData.set(14,-d * (m11 * (m22 * m43 - m42 * m23) - m21 * (m12 * m43 - m42 * m13) + m41 * (m12 * m23 - m22 * m13)));
			this.rawData.set(15,d * (m11 * (m22 * m33 - m32 * m23) - m21 * (m12 * m33 - m32 * m13) + m31 * (m12 * m23 - m22 * m13)));
		}
		return invertable;
	}
	,pointAt: function(pos,at,up) {
		if(at == null) {
			at = new openfl_geom_Vector3D(0,0,-1);
		}
		if(up == null) {
			up = new openfl_geom_Vector3D(0,-1,0);
		}
		var dir = at.subtract(pos);
		var vup = up.clone();
		dir.normalize();
		vup.normalize();
		var dir2 = dir.clone();
		dir2.scaleBy(vup.dotProduct(dir));
		vup = vup.subtract(dir2);
		if(vup.get_length() > 0) {
			vup.normalize();
		} else if(dir.x != 0) {
			vup = new openfl_geom_Vector3D(-dir.y,dir.x,0);
		} else {
			vup = new openfl_geom_Vector3D(1,0,0);
		}
		var right = vup.crossProduct(dir);
		right.normalize();
		this.rawData.set(0,right.x);
		this.rawData.set(4,right.y);
		this.rawData.set(8,right.z);
		this.rawData.set(12,0.0);
		this.rawData.set(1,vup.x);
		this.rawData.set(5,vup.y);
		this.rawData.set(9,vup.z);
		this.rawData.set(13,0.0);
		this.rawData.set(2,dir.x);
		this.rawData.set(6,dir.y);
		this.rawData.set(10,dir.z);
		this.rawData.set(14,0.0);
		this.rawData.set(3,pos.x);
		this.rawData.set(7,pos.y);
		this.rawData.set(11,pos.z);
		this.rawData.set(15,1.0);
	}
	,prepend: function(rhs) {
		var m111 = rhs.rawData.get(0);
		var m121 = rhs.rawData.get(4);
		var m131 = rhs.rawData.get(8);
		var m141 = rhs.rawData.get(12);
		var m112 = rhs.rawData.get(1);
		var m122 = rhs.rawData.get(5);
		var m132 = rhs.rawData.get(9);
		var m142 = rhs.rawData.get(13);
		var m113 = rhs.rawData.get(2);
		var m123 = rhs.rawData.get(6);
		var m133 = rhs.rawData.get(10);
		var m143 = rhs.rawData.get(14);
		var m114 = rhs.rawData.get(3);
		var m124 = rhs.rawData.get(7);
		var m134 = rhs.rawData.get(11);
		var m144 = rhs.rawData.get(15);
		var m211 = this.rawData.get(0);
		var m221 = this.rawData.get(4);
		var m231 = this.rawData.get(8);
		var m241 = this.rawData.get(12);
		var m212 = this.rawData.get(1);
		var m222 = this.rawData.get(5);
		var m232 = this.rawData.get(9);
		var m242 = this.rawData.get(13);
		var m213 = this.rawData.get(2);
		var m223 = this.rawData.get(6);
		var m233 = this.rawData.get(10);
		var m243 = this.rawData.get(14);
		var m214 = this.rawData.get(3);
		var m224 = this.rawData.get(7);
		var m234 = this.rawData.get(11);
		var m244 = this.rawData.get(15);
		this.rawData.set(0,m111 * m211 + m112 * m221 + m113 * m231 + m114 * m241);
		this.rawData.set(1,m111 * m212 + m112 * m222 + m113 * m232 + m114 * m242);
		this.rawData.set(2,m111 * m213 + m112 * m223 + m113 * m233 + m114 * m243);
		this.rawData.set(3,m111 * m214 + m112 * m224 + m113 * m234 + m114 * m244);
		this.rawData.set(4,m121 * m211 + m122 * m221 + m123 * m231 + m124 * m241);
		this.rawData.set(5,m121 * m212 + m122 * m222 + m123 * m232 + m124 * m242);
		this.rawData.set(6,m121 * m213 + m122 * m223 + m123 * m233 + m124 * m243);
		this.rawData.set(7,m121 * m214 + m122 * m224 + m123 * m234 + m124 * m244);
		this.rawData.set(8,m131 * m211 + m132 * m221 + m133 * m231 + m134 * m241);
		this.rawData.set(9,m131 * m212 + m132 * m222 + m133 * m232 + m134 * m242);
		this.rawData.set(10,m131 * m213 + m132 * m223 + m133 * m233 + m134 * m243);
		this.rawData.set(11,m131 * m214 + m132 * m224 + m133 * m234 + m134 * m244);
		this.rawData.set(12,m141 * m211 + m142 * m221 + m143 * m231 + m144 * m241);
		this.rawData.set(13,m141 * m212 + m142 * m222 + m143 * m232 + m144 * m242);
		this.rawData.set(14,m141 * m213 + m142 * m223 + m143 * m233 + m144 * m243);
		this.rawData.set(15,m141 * m214 + m142 * m224 + m143 * m234 + m144 * m244);
	}
	,prependRotation: function(degrees,axis,pivotPoint) {
		var tz = 0;
		var ty = tz;
		var tx = ty;
		if(pivotPoint != null) {
			tx = pivotPoint.x;
			ty = pivotPoint.y;
			tz = pivotPoint.z;
		}
		var radian = degrees * Math.PI / 180;
		var cos = Math.cos(radian);
		var sin = Math.sin(radian);
		var x = axis.x;
		var y = axis.y;
		var z = axis.z;
		var x2 = x * x;
		var y2 = y * y;
		var z2 = z * z;
		var ls = x2 + y2 + z2;
		if(ls != 0) {
			var l = Math.sqrt(ls);
			x /= l;
			y /= l;
			z /= l;
			x2 /= ls;
			y2 /= ls;
			z2 /= ls;
		}
		var ccos = 1 - cos;
		var m = new openfl_geom_Matrix3D();
		var d = m.rawData;
		d.set(0,x2 + (y2 + z2) * cos);
		d.set(1,x * y * ccos + z * sin);
		d.set(2,x * z * ccos - y * sin);
		d.set(4,x * y * ccos - z * sin);
		d.set(5,y2 + (x2 + z2) * cos);
		d.set(6,y * z * ccos + x * sin);
		d.set(8,x * z * ccos + y * sin);
		d.set(9,y * z * ccos - x * sin);
		d.set(10,z2 + (x2 + y2) * cos);
		d.set(12,(tx * (y2 + z2) - x * (ty * y + tz * z)) * ccos + (ty * z - tz * y) * sin);
		d.set(13,(ty * (x2 + z2) - y * (tx * x + tz * z)) * ccos + (tz * x - tx * z) * sin);
		d.set(14,(tz * (x2 + y2) - z * (tx * x + ty * y)) * ccos + (tx * y - ty * x) * sin);
		this.prepend(m);
	}
	,prependScale: function(xScale,yScale,zScale) {
		this.prepend(new openfl_geom_Matrix3D(openfl_Vector.toFloatVector(null,null,null,[xScale,0.0,0.0,0.0,0.0,yScale,0.0,0.0,0.0,0.0,zScale,0.0,0.0,0.0,0.0,1.0])));
	}
	,prependTranslation: function(x,y,z) {
		var m = new openfl_geom_Matrix3D();
		m.set_position(new openfl_geom_Vector3D(x,y,z));
		this.prepend(m);
	}
	,recompose: function(components,orientationStyle) {
		if(orientationStyle == null) {
			orientationStyle = 1;
		}
		if(components.get_length() < 3 || components.get(2).x == 0 || components.get(2).y == 0 || components.get(2).z == 0) {
			return false;
		}
		this.identity();
		var scale = [];
		scale[0] = scale[1] = scale[2] = components.get(2).x;
		scale[4] = scale[5] = scale[6] = components.get(2).y;
		scale[8] = scale[9] = scale[10] = components.get(2).z;
		if(orientationStyle == 1) {
			var cx = Math.cos(components.get(1).x);
			var cy = Math.cos(components.get(1).y);
			var cz = Math.cos(components.get(1).z);
			var sx = Math.sin(components.get(1).x);
			var sy = Math.sin(components.get(1).y);
			var sz = Math.sin(components.get(1).z);
			this.rawData.set(0,cy * cz * scale[0]);
			this.rawData.set(1,cy * sz * scale[1]);
			this.rawData.set(2,-sy * scale[2]);
			this.rawData.set(3,0);
			this.rawData.set(4,(sx * sy * cz - cx * sz) * scale[4]);
			this.rawData.set(5,(sx * sy * sz + cx * cz) * scale[5]);
			this.rawData.set(6,sx * cy * scale[6]);
			this.rawData.set(7,0);
			this.rawData.set(8,(cx * sy * cz + sx * sz) * scale[8]);
			this.rawData.set(9,(cx * sy * sz - sx * cz) * scale[9]);
			this.rawData.set(10,cx * cy * scale[10]);
			this.rawData.set(11,0);
			this.rawData.set(12,components.get(0).x);
			this.rawData.set(13,components.get(0).y);
			this.rawData.set(14,components.get(0).z);
			this.rawData.set(15,1);
		} else {
			var x = components.get(1).x;
			var y = components.get(1).y;
			var z = components.get(1).z;
			var w = components.get(1).w;
			if(orientationStyle == 0) {
				x *= Math.sin(w / 2);
				y *= Math.sin(w / 2);
				z *= Math.sin(w / 2);
				w = Math.cos(w / 2);
			}
			this.rawData.set(0,(1 - 2 * y * y - 2 * z * z) * scale[0]);
			this.rawData.set(1,(2 * x * y + 2 * w * z) * scale[1]);
			this.rawData.set(2,(2 * x * z - 2 * w * y) * scale[2]);
			this.rawData.set(3,0);
			this.rawData.set(4,(2 * x * y - 2 * w * z) * scale[4]);
			this.rawData.set(5,(1 - 2 * x * x - 2 * z * z) * scale[5]);
			this.rawData.set(6,(2 * y * z + 2 * w * x) * scale[6]);
			this.rawData.set(7,0);
			this.rawData.set(8,(2 * x * z + 2 * w * y) * scale[8]);
			this.rawData.set(9,(2 * y * z - 2 * w * x) * scale[9]);
			this.rawData.set(10,(1 - 2 * x * x - 2 * y * y) * scale[10]);
			this.rawData.set(11,0);
			this.rawData.set(12,components.get(0).x);
			this.rawData.set(13,components.get(0).y);
			this.rawData.set(14,components.get(0).z);
			this.rawData.set(15,1);
		}
		if(components.get(2).x == 0) {
			this.rawData.set(0,1e-15);
		}
		if(components.get(2).y == 0) {
			this.rawData.set(5,1e-15);
		}
		if(components.get(2).z == 0) {
			this.rawData.set(10,1e-15);
		}
		return !(components.get(2).x == 0 || components.get(2).y == 0 || components.get(2).y == 0);
	}
	,transformVector: function(v) {
		var x = v.x;
		var y = v.y;
		var z = v.z;
		return new openfl_geom_Vector3D(x * this.rawData.get(0) + y * this.rawData.get(4) + z * this.rawData.get(8) + this.rawData.get(12),x * this.rawData.get(1) + y * this.rawData.get(5) + z * this.rawData.get(9) + this.rawData.get(13),x * this.rawData.get(2) + y * this.rawData.get(6) + z * this.rawData.get(10) + this.rawData.get(14),x * this.rawData.get(3) + y * this.rawData.get(7) + z * this.rawData.get(11) + this.rawData.get(15));
	}
	,transformVectors: function(vin,vout) {
		var i = 0;
		var x;
		var y;
		var z;
		while(i + 3 <= vin.get_length()) {
			x = vin.get(i);
			y = vin.get(i + 1);
			z = vin.get(i + 2);
			vout.set(i,x * this.rawData.get(0) + y * this.rawData.get(4) + z * this.rawData.get(8) + this.rawData.get(12));
			vout.set(i + 1,x * this.rawData.get(1) + y * this.rawData.get(5) + z * this.rawData.get(9) + this.rawData.get(13));
			vout.set(i + 2,x * this.rawData.get(2) + y * this.rawData.get(6) + z * this.rawData.get(10) + this.rawData.get(14));
			i += 3;
		}
	}
	,transpose: function() {
		var oRawData = this.rawData.copy();
		this.rawData.set(1,oRawData.get(4));
		this.rawData.set(2,oRawData.get(8));
		this.rawData.set(3,oRawData.get(12));
		this.rawData.set(4,oRawData.get(1));
		this.rawData.set(6,oRawData.get(9));
		this.rawData.set(7,oRawData.get(13));
		this.rawData.set(8,oRawData.get(2));
		this.rawData.set(9,oRawData.get(6));
		this.rawData.set(11,oRawData.get(14));
		this.rawData.set(12,oRawData.get(3));
		this.rawData.set(13,oRawData.get(7));
		this.rawData.set(14,oRawData.get(11));
	}
	,get_determinant: function() {
		return (this.rawData.get(0) * this.rawData.get(5) - this.rawData.get(4) * this.rawData.get(1)) * (this.rawData.get(10) * this.rawData.get(15) - this.rawData.get(14) * this.rawData.get(11)) - (this.rawData.get(0) * this.rawData.get(9) - this.rawData.get(8) * this.rawData.get(1)) * (this.rawData.get(6) * this.rawData.get(15) - this.rawData.get(14) * this.rawData.get(7)) + (this.rawData.get(0) * this.rawData.get(13) - this.rawData.get(12) * this.rawData.get(1)) * (this.rawData.get(6) * this.rawData.get(11) - this.rawData.get(10) * this.rawData.get(7)) + (this.rawData.get(4) * this.rawData.get(9) - this.rawData.get(8) * this.rawData.get(5)) * (this.rawData.get(2) * this.rawData.get(15) - this.rawData.get(14) * this.rawData.get(3)) - (this.rawData.get(4) * this.rawData.get(13) - this.rawData.get(12) * this.rawData.get(5)) * (this.rawData.get(2) * this.rawData.get(11) - this.rawData.get(10) * this.rawData.get(3)) + (this.rawData.get(8) * this.rawData.get(13) - this.rawData.get(12) * this.rawData.get(9)) * (this.rawData.get(2) * this.rawData.get(7) - this.rawData.get(6) * this.rawData.get(3));
	}
	,get_position: function() {
		return new openfl_geom_Vector3D(this.rawData.get(12),this.rawData.get(13),this.rawData.get(14));
	}
	,set_position: function(val) {
		this.rawData.set(12,val.x);
		this.rawData.set(13,val.y);
		this.rawData.set(14,val.z);
		return val;
	}
	,__class__: openfl_geom_Matrix3D
	,__properties__: {set_position:"set_position",get_position:"get_position",get_determinant:"get_determinant"}
};
var openfl_geom_Orientation3D = {};
openfl_geom_Orientation3D.fromString = function(value) {
	switch(value) {
	case "axisAngle":
		return 0;
	case "eulerAngles":
		return 1;
	case "quaternion":
		return 2;
	default:
		return null;
	}
};
openfl_geom_Orientation3D.toString = function(this1) {
	switch(this1) {
	case 0:
		return "axisAngle";
	case 1:
		return "eulerAngles";
	case 2:
		return "quaternion";
	default:
		return null;
	}
};
var openfl_geom_Transform = function(displayObject) {
	this.__colorTransform = new openfl_geom_ColorTransform();
	this.concatenatedColorTransform = new openfl_geom_ColorTransform();
	this.pixelBounds = new openfl_geom_Rectangle();
	this.__displayObject = displayObject;
	this.__hasMatrix = true;
};
$hxClasses["openfl.geom.Transform"] = openfl_geom_Transform;
openfl_geom_Transform.__name__ = "openfl.geom.Transform";
openfl_geom_Transform.prototype = {
	concatenatedColorTransform: null
	,pixelBounds: null
	,__colorTransform: null
	,__displayObject: null
	,__hasMatrix: null
	,__hasMatrix3D: null
	,get_colorTransform: function() {
		return this.__colorTransform;
	}
	,set_colorTransform: function(value) {
		if(!this.__colorTransform.__equals(value,false)) {
			this.__colorTransform.__copyFrom(value);
			if(value != null) {
				this.__displayObject.set_alpha(value.alphaMultiplier);
			}
			var _this = this.__displayObject;
			if(!_this.__renderDirty) {
				_this.__renderDirty = true;
				_this.__setParentRenderDirty();
			}
		}
		return this.__colorTransform;
	}
	,get_concatenatedMatrix: function() {
		if(this.__hasMatrix) {
			return this.__displayObject.__getWorldTransform().clone();
		}
		return null;
	}
	,get_matrix: function() {
		if(this.__hasMatrix) {
			return this.__displayObject.__transform.clone();
		}
		return null;
	}
	,set_matrix: function(value) {
		if(value == null) {
			this.__hasMatrix = false;
			return null;
		}
		this.__hasMatrix = true;
		this.__hasMatrix3D = false;
		if(this.__displayObject != null) {
			this.__setTransform(value.a,value.b,value.c,value.d,value.tx,value.ty);
		}
		return value;
	}
	,get_matrix3D: function() {
		if(this.__hasMatrix3D) {
			var matrix = this.__displayObject.__transform;
			return new openfl_geom_Matrix3D(openfl_Vector.toFloatVector(null,null,null,[matrix.a,matrix.b,0.0,0.0,matrix.c,matrix.d,0.0,0.0,0.0,0.0,1.0,0.0,matrix.tx,matrix.ty,0.0,1.0]));
		}
		return null;
	}
	,set_matrix3D: function(value) {
		if(value == null) {
			this.__hasMatrix3D = false;
			return null;
		}
		this.__hasMatrix = false;
		this.__hasMatrix3D = true;
		this.__setTransform(value.rawData.get(0),value.rawData.get(1),value.rawData.get(5),value.rawData.get(6),value.rawData.get(12),value.rawData.get(13));
		return value;
	}
	,__setTransform: function(a,b,c,d,tx,ty) {
		if(this.__displayObject != null) {
			var transform = this.__displayObject.__transform;
			if(transform.a == a && transform.b == b && transform.c == c && transform.d == d && transform.tx == tx && transform.ty == ty) {
				return;
			}
			var scaleX = 0.0;
			var scaleY = 0.0;
			if(b == 0) {
				scaleX = a;
			} else {
				scaleX = Math.sqrt(a * a + b * b);
			}
			if(c == 0) {
				scaleY = d;
			} else {
				scaleY = Math.sqrt(c * c + d * d);
			}
			this.__displayObject.__scaleX = scaleX;
			this.__displayObject.__scaleY = scaleY;
			var rotation = 180 / Math.PI * Math.atan2(d,c) - 90;
			if(rotation != this.__displayObject.__rotation) {
				this.__displayObject.__rotation = rotation;
				var radians = rotation * (Math.PI / 180);
				this.__displayObject.__rotationSine = Math.sin(radians);
				this.__displayObject.__rotationCosine = Math.cos(radians);
			}
			transform.a = a;
			transform.b = b;
			transform.c = c;
			transform.d = d;
			transform.tx = tx;
			transform.ty = ty;
			this.__displayObject.__setTransformDirty();
		}
	}
	,__class__: openfl_geom_Transform
	,__properties__: {set_matrix3D:"set_matrix3D",get_matrix3D:"get_matrix3D",set_matrix:"set_matrix",get_matrix:"get_matrix",get_concatenatedMatrix:"get_concatenatedMatrix",set_colorTransform:"set_colorTransform",get_colorTransform:"get_colorTransform"}
};
var openfl_geom_Vector3D = function(x,y,z,w) {
	if(w == null) {
		w = 0;
	}
	if(z == null) {
		z = 0;
	}
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	this.w = w;
	this.x = x;
	this.y = y;
	this.z = z;
};
$hxClasses["openfl.geom.Vector3D"] = openfl_geom_Vector3D;
openfl_geom_Vector3D.__name__ = "openfl.geom.Vector3D";
openfl_geom_Vector3D.__properties__ = {get_Z_AXIS:"get_Z_AXIS",get_Y_AXIS:"get_Y_AXIS",get_X_AXIS:"get_X_AXIS"};
openfl_geom_Vector3D.angleBetween = function(a,b) {
	var la = a.get_length();
	var lb = b.get_length();
	var dot = a.dotProduct(b);
	if(la != 0) {
		dot /= la;
	}
	if(lb != 0) {
		dot /= lb;
	}
	return Math.acos(dot);
};
openfl_geom_Vector3D.distance = function(pt1,pt2) {
	var x = pt2.x - pt1.x;
	var y = pt2.y - pt1.y;
	var z = pt2.z - pt1.z;
	return Math.sqrt(x * x + y * y + z * z);
};
openfl_geom_Vector3D.get_X_AXIS = function() {
	return new openfl_geom_Vector3D(1,0,0);
};
openfl_geom_Vector3D.get_Y_AXIS = function() {
	return new openfl_geom_Vector3D(0,1,0);
};
openfl_geom_Vector3D.get_Z_AXIS = function() {
	return new openfl_geom_Vector3D(0,0,1);
};
openfl_geom_Vector3D.prototype = {
	w: null
	,x: null
	,y: null
	,z: null
	,add: function(a) {
		return new openfl_geom_Vector3D(this.x + a.x,this.y + a.y,this.z + a.z);
	}
	,clone: function() {
		return new openfl_geom_Vector3D(this.x,this.y,this.z,this.w);
	}
	,copyFrom: function(sourceVector3D) {
		this.x = sourceVector3D.x;
		this.y = sourceVector3D.y;
		this.z = sourceVector3D.z;
	}
	,crossProduct: function(a) {
		return new openfl_geom_Vector3D(this.y * a.z - this.z * a.y,this.z * a.x - this.x * a.z,this.x * a.y - this.y * a.x,1);
	}
	,decrementBy: function(a) {
		this.x -= a.x;
		this.y -= a.y;
		this.z -= a.z;
	}
	,dotProduct: function(a) {
		return this.x * a.x + this.y * a.y + this.z * a.z;
	}
	,equals: function(toCompare,allFour) {
		if(allFour == null) {
			allFour = false;
		}
		if(this.x == toCompare.x && this.y == toCompare.y && this.z == toCompare.z) {
			if(allFour) {
				return this.w == toCompare.w;
			} else {
				return true;
			}
		} else {
			return false;
		}
	}
	,incrementBy: function(a) {
		this.x += a.x;
		this.y += a.y;
		this.z += a.z;
	}
	,nearEquals: function(toCompare,tolerance,allFour) {
		if(allFour == null) {
			allFour = false;
		}
		if(Math.abs(this.x - toCompare.x) < tolerance && Math.abs(this.y - toCompare.y) < tolerance && Math.abs(this.z - toCompare.z) < tolerance) {
			if(!(!allFour)) {
				return Math.abs(this.w - toCompare.w) < tolerance;
			} else {
				return true;
			}
		} else {
			return false;
		}
	}
	,negate: function() {
		this.x *= -1;
		this.y *= -1;
		this.z *= -1;
	}
	,normalize: function() {
		var l = this.get_length();
		if(l != 0) {
			this.x /= l;
			this.y /= l;
			this.z /= l;
		}
		return l;
	}
	,project: function() {
		this.x /= this.w;
		this.y /= this.w;
		this.z /= this.w;
	}
	,scaleBy: function(s) {
		this.x *= s;
		this.y *= s;
		this.z *= s;
	}
	,setTo: function(xa,ya,za) {
		this.x = xa;
		this.y = ya;
		this.z = za;
	}
	,subtract: function(a) {
		return new openfl_geom_Vector3D(this.x - a.x,this.y - a.y,this.z - a.z);
	}
	,toString: function() {
		return "Vector3D(" + this.x + ", " + this.y + ", " + this.z + ")";
	}
	,get_length: function() {
		return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
	}
	,get_lengthSquared: function() {
		return this.x * this.x + this.y * this.y + this.z * this.z;
	}
	,__class__: openfl_geom_Vector3D
	,__properties__: {get_lengthSquared:"get_lengthSquared",get_length:"get_length"}
};
var openfl_media_ID3Info = function() {
};
$hxClasses["openfl.media.ID3Info"] = openfl_media_ID3Info;
openfl_media_ID3Info.__name__ = "openfl.media.ID3Info";
openfl_media_ID3Info.prototype = {
	album: null
	,artist: null
	,comment: null
	,genre: null
	,songName: null
	,track: null
	,year: null
	,__class__: openfl_media_ID3Info
};
var openfl_media_Sound = function(stream,context) {
	openfl_events_EventDispatcher.call(this,this);
	this.bytesLoaded = 0;
	this.bytesTotal = 0;
	this.isBuffering = false;
	this.url = null;
	if(stream != null) {
		this.load(stream,context);
	}
};
$hxClasses["openfl.media.Sound"] = openfl_media_Sound;
openfl_media_Sound.__name__ = "openfl.media.Sound";
openfl_media_Sound.fromAudioBuffer = function(buffer) {
	var sound = new openfl_media_Sound();
	sound.__buffer = buffer;
	return sound;
};
openfl_media_Sound.fromFile = function(path) {
	return openfl_media_Sound.fromAudioBuffer(lime_media_AudioBuffer.fromFile(path));
};
openfl_media_Sound.loadFromFile = function(path) {
	return lime_media_AudioBuffer.loadFromFile(path).then(function(audioBuffer) {
		return lime_app_Future.withValue(openfl_media_Sound.fromAudioBuffer(audioBuffer));
	});
};
openfl_media_Sound.loadFromFiles = function(paths) {
	return lime_media_AudioBuffer.loadFromFiles(paths).then(function(audioBuffer) {
		return lime_app_Future.withValue(openfl_media_Sound.fromAudioBuffer(audioBuffer));
	});
};
openfl_media_Sound.__super__ = openfl_events_EventDispatcher;
openfl_media_Sound.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	bytesLoaded: null
	,bytesTotal: null
	,isBuffering: null
	,url: null
	,__buffer: null
	,close: function() {
		if(this.__buffer != null) {
			this.__buffer.dispose();
			this.__buffer = null;
		}
	}
	,load: function(stream,context) {
		var _gthis = this;
		this.url = stream.url;
		var defaultLibrary = lime_utils_Assets.getLibrary("default");
		if(defaultLibrary != null && Object.prototype.hasOwnProperty.call(defaultLibrary.cachedAudioBuffers.h,this.url)) {
			this.AudioBuffer_onURLLoad(defaultLibrary.cachedAudioBuffers.h[this.url]);
		} else {
			lime_media_AudioBuffer.loadFromFile(this.url).onComplete($bind(this,this.AudioBuffer_onURLLoad)).onError(function(_) {
				_gthis.AudioBuffer_onURLLoad(null);
			});
		}
	}
	,loadCompressedDataFromByteArray: function(bytes,bytesLength) {
		if(bytes == null || bytesLength <= 0) {
			this.dispatchEvent(new openfl_events_IOErrorEvent("ioError"));
			return;
		}
		if(UInt.gt(bytes.position,0) || UInt.gt(openfl_utils_ByteArray.get_length(bytes),bytesLength)) {
			var length = bytesLength;
			if(length == null) {
				length = 0;
			}
			var this1 = new openfl_utils_ByteArrayData(length);
			var copy = this1;
			var offset = bytes.position;
			var length = bytesLength;
			if(length == null) {
				length = 0;
			}
			if(offset == null) {
				offset = 0;
			}
			copy.writeBytes(bytes,offset,length);
			bytes = copy;
		}
		this.__buffer = lime_media_AudioBuffer.fromBytes(openfl_utils_ByteArray.toBytes(bytes));
		if(this.__buffer == null) {
			this.dispatchEvent(new openfl_events_IOErrorEvent("ioError"));
		} else {
			this.dispatchEvent(new openfl_events_Event("complete"));
		}
	}
	,loadPCMFromByteArray: function(bytes,samples,format,stereo,sampleRate) {
		if(sampleRate == null) {
			sampleRate = 44100;
		}
		if(stereo == null) {
			stereo = true;
		}
		if(format == null) {
			format = "float";
		}
		if(bytes == null) {
			this.dispatchEvent(new openfl_events_IOErrorEvent("ioError"));
			return;
		}
		var bitsPerSample = format == "float" ? 32 : 16;
		var channels = stereo ? 2 : 1;
		var bytesLength = samples * channels * (bitsPerSample / 8) | 0;
		if(UInt.gt(bytes.position,0) || UInt.gt(openfl_utils_ByteArray.get_length(bytes),bytesLength)) {
			var length = bytesLength;
			if(length == null) {
				length = 0;
			}
			var this1 = new openfl_utils_ByteArrayData(length);
			var copy = this1;
			var offset = bytes.position;
			var length = bytesLength;
			if(length == null) {
				length = 0;
			}
			if(offset == null) {
				offset = 0;
			}
			copy.writeBytes(bytes,offset,length);
			bytes = copy;
		}
		var audioBuffer = new lime_media_AudioBuffer();
		audioBuffer.bitsPerSample = bitsPerSample;
		audioBuffer.channels = channels;
		var elements = null;
		var array = null;
		var vector = null;
		var view = null;
		var buffer = openfl_utils_ByteArray.toArrayBuffer(bytes);
		var len = null;
		var this1;
		if(elements != null) {
			this1 = new Uint8Array(elements);
		} else if(array != null) {
			this1 = new Uint8Array(array);
		} else if(vector != null) {
			this1 = new Uint8Array(vector.__array);
		} else if(view != null) {
			this1 = new Uint8Array(view);
		} else if(buffer != null) {
			if(len == null) {
				this1 = new Uint8Array(buffer,0);
			} else {
				this1 = new Uint8Array(buffer,0,len);
			}
		} else {
			this1 = null;
		}
		audioBuffer.data = this1;
		audioBuffer.sampleRate = sampleRate | 0;
		this.__buffer = audioBuffer;
		this.dispatchEvent(new openfl_events_Event("complete"));
	}
	,play: function(startTime,loops,sndTransform) {
		if(loops == null) {
			loops = 0;
		}
		if(startTime == null) {
			startTime = 0.0;
		}
		if(this.__buffer == null || openfl_media_SoundMixer.__soundChannels.length >= 32) {
			return null;
		}
		if(sndTransform == null) {
			sndTransform = new openfl_media_SoundTransform();
		} else {
			sndTransform = sndTransform.clone();
		}
		var pan = openfl_media_SoundMixer.__soundTransform.pan + sndTransform.pan;
		if(pan > 1) {
			pan = 1;
		}
		if(pan < -1) {
			pan = -1;
		}
		var volume = openfl_media_SoundMixer.__soundTransform.volume * sndTransform.volume;
		var source = new lime_media_AudioSource(this.__buffer);
		source.offset = startTime | 0;
		if(loops > 1) {
			source.set_loops(loops - 1);
		}
		source.set_gain(volume);
		var position = source.get_position();
		position.x = pan;
		position.z = -1 * Math.sqrt(1 - Math.pow(pan,2));
		source.set_position(position);
		return new openfl_media_SoundChannel(source,sndTransform);
	}
	,get_id3: function() {
		return new openfl_media_ID3Info();
	}
	,get_length: function() {
		if(this.__buffer != null) {
			return this.__buffer.get_src().duration() * 1000 | 0;
		}
		return 0;
	}
	,AudioBuffer_onURLLoad: function(buffer) {
		if(buffer == null) {
			this.dispatchEvent(new openfl_events_IOErrorEvent("ioError"));
		} else {
			this.__buffer = buffer;
			this.dispatchEvent(new openfl_events_Event("complete"));
		}
	}
	,__class__: openfl_media_Sound
	,__properties__: {get_length:"get_length",get_id3:"get_id3"}
});
var openfl_media_SoundChannel = function(source,soundTransform) {
	openfl_events_EventDispatcher.call(this,this);
	this.leftPeak = 1;
	this.rightPeak = 1;
	if(soundTransform != null) {
		this.__soundTransform = soundTransform;
	} else {
		this.__soundTransform = new openfl_media_SoundTransform();
	}
	if(source != null) {
		this.__source = source;
		this.__source.onComplete.add($bind(this,this.source_onComplete));
		this.__isValid = true;
		this.__source.play();
	}
	openfl_media_SoundMixer.__registerSoundChannel(this);
};
$hxClasses["openfl.media.SoundChannel"] = openfl_media_SoundChannel;
openfl_media_SoundChannel.__name__ = "openfl.media.SoundChannel";
openfl_media_SoundChannel.__super__ = openfl_events_EventDispatcher;
openfl_media_SoundChannel.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	leftPeak: null
	,rightPeak: null
	,__isValid: null
	,__soundTransform: null
	,__source: null
	,stop: function() {
		openfl_media_SoundMixer.__unregisterSoundChannel(this);
		if(!this.__isValid) {
			return;
		}
		this.__source.stop();
		this.__dispose();
	}
	,__dispose: function() {
		if(!this.__isValid) {
			return;
		}
		this.__source.onComplete.remove($bind(this,this.source_onComplete));
		this.__source.dispose();
		this.__source = null;
		this.__isValid = false;
	}
	,__updateTransform: function() {
		this.set_soundTransform(this.get_soundTransform());
	}
	,get_position: function() {
		if(!this.__isValid) {
			return 0;
		}
		return this.__source.get_currentTime() + this.__source.offset;
	}
	,set_position: function(value) {
		if(!this.__isValid) {
			return 0;
		}
		this.__source.set_currentTime((value | 0) - this.__source.offset);
		return value;
	}
	,get_soundTransform: function() {
		return this.__soundTransform.clone();
	}
	,set_soundTransform: function(value) {
		if(value != null) {
			this.__soundTransform.pan = value.pan;
			this.__soundTransform.volume = value.volume;
			var pan = openfl_media_SoundMixer.__soundTransform.pan + this.__soundTransform.pan;
			if(pan < -1) {
				pan = -1;
			}
			if(pan > 1) {
				pan = 1;
			}
			var volume = openfl_media_SoundMixer.__soundTransform.volume * this.__soundTransform.volume;
			if(this.__isValid) {
				this.__source.set_gain(volume);
				var position = this.__source.get_position();
				position.x = pan;
				position.z = -1 * Math.sqrt(1 - Math.pow(pan,2));
				this.__source.set_position(position);
				return value;
			}
		}
		return value;
	}
	,source_onComplete: function() {
		openfl_media_SoundMixer.__unregisterSoundChannel(this);
		this.__dispose();
		this.dispatchEvent(new openfl_events_Event("soundComplete"));
	}
	,__class__: openfl_media_SoundChannel
	,__properties__: {set_soundTransform:"set_soundTransform",get_soundTransform:"get_soundTransform",set_position:"set_position",get_position:"get_position"}
});
var openfl_media_SoundLoaderContext = function(bufferTime,checkPolicyFile) {
	if(checkPolicyFile == null) {
		checkPolicyFile = false;
	}
	if(bufferTime == null) {
		bufferTime = 1000;
	}
	this.bufferTime = bufferTime;
	this.checkPolicyFile = checkPolicyFile;
};
$hxClasses["openfl.media.SoundLoaderContext"] = openfl_media_SoundLoaderContext;
openfl_media_SoundLoaderContext.__name__ = "openfl.media.SoundLoaderContext";
openfl_media_SoundLoaderContext.prototype = {
	bufferTime: null
	,checkPolicyFile: null
	,__class__: openfl_media_SoundLoaderContext
};
var openfl_media_SoundTransform = function(vol,panning) {
	if(panning == null) {
		panning = 0;
	}
	if(vol == null) {
		vol = 1;
	}
	this.volume = vol;
	this.pan = panning;
	this.leftToLeft = 0;
	this.leftToRight = 0;
	this.rightToLeft = 0;
	this.rightToRight = 0;
};
$hxClasses["openfl.media.SoundTransform"] = openfl_media_SoundTransform;
openfl_media_SoundTransform.__name__ = "openfl.media.SoundTransform";
openfl_media_SoundTransform.prototype = {
	leftToLeft: null
	,leftToRight: null
	,pan: null
	,rightToLeft: null
	,rightToRight: null
	,volume: null
	,clone: function() {
		return new openfl_media_SoundTransform(this.volume,this.pan);
	}
	,__class__: openfl_media_SoundTransform
};
var openfl_media_SoundMixer = function() { };
$hxClasses["openfl.media.SoundMixer"] = openfl_media_SoundMixer;
openfl_media_SoundMixer.__name__ = "openfl.media.SoundMixer";
openfl_media_SoundMixer.__properties__ = {set_soundTransform:"set_soundTransform",get_soundTransform:"get_soundTransform"};
openfl_media_SoundMixer.bufferTime = null;
openfl_media_SoundMixer.areSoundsInaccessible = function() {
	return false;
};
openfl_media_SoundMixer.stopAll = function() {
	var _g = 0;
	var _g1 = openfl_media_SoundMixer.__soundChannels;
	while(_g < _g1.length) {
		var channel = _g1[_g];
		++_g;
		channel.stop();
	}
};
openfl_media_SoundMixer.__registerSoundChannel = function(soundChannel) {
	openfl_media_SoundMixer.__soundChannels.push(soundChannel);
};
openfl_media_SoundMixer.__unregisterSoundChannel = function(soundChannel) {
	HxOverrides.remove(openfl_media_SoundMixer.__soundChannels,soundChannel);
};
openfl_media_SoundMixer.get_soundTransform = function() {
	return openfl_media_SoundMixer.__soundTransform;
};
openfl_media_SoundMixer.set_soundTransform = function(value) {
	openfl_media_SoundMixer.__soundTransform = value.clone();
	var _g = 0;
	var _g1 = openfl_media_SoundMixer.__soundChannels;
	while(_g < _g1.length) {
		var channel = _g1[_g];
		++_g;
		channel.__updateTransform();
	}
	return value;
};
var openfl_net_NetConnection = function() {
	openfl_events_EventDispatcher.call(this);
};
$hxClasses["openfl.net.NetConnection"] = openfl_net_NetConnection;
openfl_net_NetConnection.__name__ = "openfl.net.NetConnection";
openfl_net_NetConnection.__super__ = openfl_events_EventDispatcher;
openfl_net_NetConnection.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	connect: function(command,p1,p2,p3,p4,p5) {
		if(command != null) {
			throw haxe_Exception.thrown("Error: Can only connect in \"HTTP streaming\" mode");
		}
		this.dispatchEvent(new openfl_events_NetStatusEvent("netStatus",false,true,{ code : "NetConnection.Connect.Success"}));
	}
	,__class__: openfl_net_NetConnection
});
var openfl_net_NetStream = function(connection,peerID) {
	openfl_events_EventDispatcher.call(this);
	this.__connection = connection;
	this.__soundTransform = new openfl_media_SoundTransform();
	this.__video = window.document.createElement("video");
	this.__video.setAttribute("playsinline","");
	this.__video.setAttribute("webkit-playsinline","");
	this.__video.setAttribute("crossorigin","anonymous");
	this.__video.addEventListener("error",$bind(this,this.video_onError),false);
	this.__video.addEventListener("waiting",$bind(this,this.video_onWaiting),false);
	this.__video.addEventListener("ended",$bind(this,this.video_onEnd),false);
	this.__video.addEventListener("pause",$bind(this,this.video_onPause),false);
	this.__video.addEventListener("seeking",$bind(this,this.video_onSeeking),false);
	this.__video.addEventListener("playing",$bind(this,this.video_onPlaying),false);
	this.__video.addEventListener("timeupdate",$bind(this,this.video_onTimeUpdate),false);
	this.__video.addEventListener("loadstart",$bind(this,this.video_onLoadStart),false);
	this.__video.addEventListener("stalled",$bind(this,this.video_onStalled),false);
	this.__video.addEventListener("durationchanged",$bind(this,this.video_onDurationChanged),false);
	this.__video.addEventListener("canplay",$bind(this,this.video_onCanPlay),false);
	this.__video.addEventListener("canplaythrough",$bind(this,this.video_onCanPlayThrough),false);
	this.__video.addEventListener("loadedmetadata",$bind(this,this.video_onLoadMetaData),false);
};
$hxClasses["openfl.net.NetStream"] = openfl_net_NetStream;
openfl_net_NetStream.__name__ = "openfl.net.NetStream";
openfl_net_NetStream.__super__ = openfl_events_EventDispatcher;
openfl_net_NetStream.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	audioCodec: null
	,bufferLength: null
	,bufferTime: null
	,bytesLoaded: null
	,bytesTotal: null
	,checkPolicyFile: null
	,client: null
	,currentFPS: null
	,decodedFrames: null
	,liveDelay: null
	,objectEncoding: null
	,time: null
	,videoCode: null
	,__closed: null
	,__connection: null
	,__soundTransform: null
	,__timer: null
	,__video: null
	,close: function() {
		if(this.__video == null) {
			return;
		}
		this.__closed = true;
		this.__video.pause();
		this.__video.src = "";
		this.time = 0;
	}
	,dispose: function() {
		this.close();
		this.__video = null;
	}
	,pause: function() {
		if(this.__video != null) {
			this.__video.pause();
		}
	}
	,play: function(url,p1,p2,p3,p4,p5) {
		if(this.__video == null) {
			return;
		}
		this.__video.volume = openfl_media_SoundMixer.__soundTransform.volume * this.__soundTransform.volume;
		if(typeof(url) == "string") {
			this.__video.src = url;
		} else {
			this.__video.srcObject = url;
		}
		this.__video.play();
	}
	,requestVideoStatus: function() {
		var _gthis = this;
		if(this.__video == null) {
			return;
		}
		if(this.__timer == null) {
			this.__timer = new haxe_Timer(1);
		}
		this.__timer.run = function() {
			if(_gthis.__video.paused) {
				_gthis.__playStatus("NetStream.Play.pause");
			} else {
				_gthis.__playStatus("NetStream.Play.playing");
			}
			_gthis.__timer.stop();
		};
	}
	,resume: function() {
		if(this.__video != null) {
			this.__video.play();
		}
	}
	,seek: function(time) {
		if(this.__video == null) {
			return;
		}
		if(time < 0) {
			time = 0;
		} else if(time > this.__video.duration) {
			time = this.__video.duration;
		}
		this.__dispatchStatus("NetStream.SeekStart.Notify");
		this.__video.currentTime = time;
	}
	,togglePause: function() {
		if(this.__video == null) {
			return;
		}
		if(this.__video.paused) {
			this.__video.play();
		} else {
			this.__video.pause();
		}
	}
	,__dispatchStatus: function(code) {
		var event = new openfl_events_NetStatusEvent("netStatus",false,false,{ code : code});
		this.__connection.dispatchEvent(event);
		this.dispatchEvent(event);
	}
	,__playStatus: function(code) {
		if(this.__video == null) {
			return;
		}
		if(this.client != null) {
			try {
				var handler = this.client.onPlayStatus;
				handler({ code : code, duration : this.__video.duration, position : this.__video.currentTime, speed : this.__video.playbackRate, start : this.__video.startTime});
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
			}
		}
	}
	,video_onCanPlay: function(event) {
		this.__playStatus("NetStream.Play.canplay");
	}
	,video_onCanPlayThrough: function(event) {
		this.__playStatus("NetStream.Play.canplaythrough");
	}
	,video_onDurationChanged: function(event) {
		this.__playStatus("NetStream.Play.durationchanged");
	}
	,video_onEnd: function(event) {
		this.__dispatchStatus("NetStream.Play.Stop");
		this.__dispatchStatus("NetStream.Play.Complete");
		this.__playStatus("NetStream.Play.Complete");
	}
	,video_onError: function(event) {
		this.__dispatchStatus("NetStream.Play.Stop");
		this.__playStatus("NetStream.Play.error");
	}
	,video_onLoadMetaData: function(event) {
		if(this.__video == null) {
			return;
		}
		if(this.client != null) {
			try {
				var handler = this.client.onMetaData;
				handler({ width : this.__video.videoWidth, height : this.__video.videoHeight, duration : this.__video.duration});
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
			}
		}
	}
	,video_onLoadStart: function(event) {
		this.__playStatus("NetStream.Play.loadstart");
	}
	,video_onPause: function(event) {
		this.__playStatus("NetStream.Play.pause");
	}
	,video_onPlaying: function(event) {
		this.__dispatchStatus("NetStream.Play.Start");
		this.__playStatus("NetStream.Play.playing");
	}
	,video_onSeeking: function(event) {
		this.__playStatus("NetStream.Play.seeking");
		this.__dispatchStatus("NetStream.Seek.Complete");
	}
	,video_onStalled: function(event) {
		this.__playStatus("NetStream.Play.stalled");
	}
	,video_onTimeUpdate: function(event) {
		if(this.__video == null) {
			return;
		}
		this.time = this.__video.currentTime;
		this.__playStatus("NetStream.Play.timeupdate");
	}
	,video_onWaiting: function(event) {
		this.__playStatus("NetStream.Play.waiting");
	}
	,get_soundTransform: function() {
		return this.__soundTransform.clone();
	}
	,set_soundTransform: function(value) {
		if(value != null) {
			this.__soundTransform.pan = value.pan;
			this.__soundTransform.volume = value.volume;
			if(this.__video != null) {
				this.__video.volume = openfl_media_SoundMixer.__soundTransform.volume * this.__soundTransform.volume;
			}
		}
		return value;
	}
	,get_speed: function() {
		if(this.__video != null) {
			return this.__video.playbackRate;
		} else {
			return 1;
		}
	}
	,set_speed: function(value) {
		if(this.__video != null) {
			return this.__video.playbackRate = value;
		} else {
			return value;
		}
	}
	,__class__: openfl_net_NetStream
	,__properties__: {set_speed:"set_speed",get_speed:"get_speed",set_soundTransform:"set_soundTransform",get_soundTransform:"get_soundTransform"}
});
var openfl_net_SharedObject = function() {
	openfl_events_EventDispatcher.call(this);
	this.client = this;
	this.objectEncoding = openfl_net_SharedObject.defaultObjectEncoding;
};
$hxClasses["openfl.net.SharedObject"] = openfl_net_SharedObject;
openfl_net_SharedObject.__name__ = "openfl.net.SharedObject";
openfl_net_SharedObject.__sharedObjects = null;
openfl_net_SharedObject.getLocal = function(name,localPath,secure) {
	if(secure == null) {
		secure = false;
	}
	var illegalValues = [" ","~","%","&","\\",";",":","\"","'",",","<",">","?","#"];
	var allowed = true;
	if(name == null || name == "") {
		allowed = false;
	} else {
		var _g = 0;
		while(_g < illegalValues.length) {
			var value = illegalValues[_g];
			++_g;
			if(name.indexOf(value) > -1) {
				allowed = false;
				break;
			}
		}
	}
	if(!allowed) {
		throw haxe_Exception.thrown(new openfl_errors_Error("Error #2134: Cannot create SharedObject."));
	}
	if(openfl_net_SharedObject.__sharedObjects == null) {
		openfl_net_SharedObject.__sharedObjects = new haxe_ds_StringMap();
		if(lime_app_Application.current != null) {
			lime_app_Application.current.onExit.add(openfl_net_SharedObject.application_onExit);
		}
	}
	var id = localPath + "/" + name;
	if(!Object.prototype.hasOwnProperty.call(openfl_net_SharedObject.__sharedObjects.h,id)) {
		var encodedData = null;
		try {
			var storage = js_Browser.getLocalStorage();
			if(localPath == null) {
				if(storage != null) {
					encodedData = storage.getItem(window.location.href + ":" + name);
					storage.removeItem(window.location.href + ":" + name);
				}
				localPath = window.location.pathname;
			}
			if(storage != null && encodedData == null) {
				encodedData = storage.getItem(localPath + ":" + name);
			}
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
		}
		var sharedObject = new openfl_net_SharedObject();
		sharedObject.data = { };
		sharedObject.__localPath = localPath;
		sharedObject.__name = name;
		if(encodedData != null && encodedData != "") {
			try {
				var unserializer = new haxe_Unserializer(encodedData);
				unserializer.setResolver({ resolveEnum : Type.resolveEnum, resolveClass : openfl_net_SharedObject.__resolveClass});
				sharedObject.data = unserializer.unserialize();
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
			}
		}
		openfl_net_SharedObject.__sharedObjects.h[id] = sharedObject;
	}
	return openfl_net_SharedObject.__sharedObjects.h[id];
};
openfl_net_SharedObject.getRemote = function(name,remotePath,persistence,secure) {
	if(secure == null) {
		secure = false;
	}
	if(persistence == null) {
		persistence = false;
	}
	openfl__$internal_Lib.notImplemented({ fileName : "openfl/net/SharedObject.hx", lineNumber : 808, className : "openfl.net.SharedObject", methodName : "getRemote"});
	return null;
};
openfl_net_SharedObject.__getPath = function(localPath,name) {
	var path = lime_system_System.get_applicationStorageDirectory() + "/" + localPath + "/";
	name = StringTools.replace(name,"//","/");
	name = StringTools.replace(name,"//","/");
	if(StringTools.startsWith(name,"/")) {
		name = HxOverrides.substr(name,1,null);
	}
	if(StringTools.endsWith(name,"/")) {
		name = name.substring(0,name.length - 1);
	}
	if(name.indexOf("/") > -1) {
		var split = name.split("/");
		name = "";
		var _g = 0;
		var _g1 = split.length - 1;
		while(_g < _g1) {
			var i = _g++;
			name += "#" + split[i] + "/";
		}
		name += split[split.length - 1];
	}
	return path + name + ".sol";
};
openfl_net_SharedObject.__mkdir = function(directory) {
};
openfl_net_SharedObject.__resolveClass = function(name) {
	if(name != null) {
		if(StringTools.startsWith(name,"neash.")) {
			name = StringTools.replace(name,"neash.","openfl.");
		}
		if(StringTools.startsWith(name,"native.")) {
			name = StringTools.replace(name,"native.","openfl.");
		}
		if(StringTools.startsWith(name,"flash.")) {
			name = StringTools.replace(name,"flash.","openfl.");
		}
		if(StringTools.startsWith(name,"openfl._v2.")) {
			name = StringTools.replace(name,"openfl._v2.","openfl.");
		}
		if(StringTools.startsWith(name,"openfl._legacy.")) {
			name = StringTools.replace(name,"openfl._legacy.","openfl.");
		}
		return $hxClasses[name];
	}
	return null;
};
openfl_net_SharedObject.application_onExit = function(_) {
	var sharedObject = haxe_ds_StringMap.valueIterator(openfl_net_SharedObject.__sharedObjects.h);
	while(sharedObject.hasNext()) {
		var sharedObject1 = sharedObject.next();
		sharedObject1.flush();
	}
};
openfl_net_SharedObject.__super__ = openfl_events_EventDispatcher;
openfl_net_SharedObject.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	client: null
	,data: null
	,fps: null
	,objectEncoding: null
	,__localPath: null
	,__name: null
	,clear: function() {
		this.data = { };
		try {
			var storage = js_Browser.getLocalStorage();
			if(storage != null) {
				storage.removeItem(this.__localPath + ":" + this.__name);
			}
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
		}
	}
	,close: function() {
	}
	,connect: function(myConnection,params) {
		openfl__$internal_Lib.notImplemented({ fileName : "openfl/net/SharedObject.hx", lineNumber : 392, className : "openfl.net.SharedObject", methodName : "connect"});
	}
	,flush: function(minDiskSpace) {
		if(minDiskSpace == null) {
			minDiskSpace = 0;
		}
		if(Reflect.fields(this.data).length == 0) {
			return 0;
		}
		var encodedData = haxe_Serializer.run(this.data);
		try {
			var storage = js_Browser.getLocalStorage();
			if(storage != null) {
				storage.removeItem(this.__localPath + ":" + this.__name);
				storage.setItem(this.__localPath + ":" + this.__name,encodedData);
			}
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			return 1;
		}
		return 0;
	}
	,send: function(args) {
		openfl__$internal_Lib.notImplemented({ fileName : "openfl/net/SharedObject.hx", lineNumber : 824, className : "openfl.net.SharedObject", methodName : "send"});
	}
	,setDirty: function(propertyName) {
	}
	,setProperty: function(propertyName,value) {
		if(this.data != null) {
			this.data[propertyName] = value;
		}
	}
	,get_size: function() {
		try {
			var d = haxe_Serializer.run(this.data);
			return haxe_io_Bytes.ofString(d).length;
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			return 0;
		}
	}
	,__class__: openfl_net_SharedObject
	,__properties__: {get_size:"get_size"}
});
var openfl_net_SharedObjectFlushStatus = {};
openfl_net_SharedObjectFlushStatus.fromString = function(value) {
	switch(value) {
	case "flushed":
		return 0;
	case "pending":
		return 1;
	default:
		return null;
	}
};
openfl_net_SharedObjectFlushStatus.toString = function(this1) {
	switch(this1) {
	case 0:
		return "flushed";
	case 1:
		return "pending";
	default:
		return null;
	}
};
var openfl_net_URLLoader = function(request) {
	openfl_events_EventDispatcher.call(this);
	this.bytesLoaded = 0;
	this.bytesTotal = 0;
	this.dataFormat = 1;
	if(request != null) {
		this.load(request);
	}
};
$hxClasses["openfl.net.URLLoader"] = openfl_net_URLLoader;
openfl_net_URLLoader.__name__ = "openfl.net.URLLoader";
openfl_net_URLLoader.__super__ = openfl_events_EventDispatcher;
openfl_net_URLLoader.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	bytesLoaded: null
	,bytesTotal: null
	,data: null
	,dataFormat: null
	,__httpRequest: null
	,close: function() {
		if(this.__httpRequest != null) {
			this.__httpRequest.cancel();
		}
	}
	,load: function(request) {
		var _gthis = this;
		if(this.dataFormat == 0) {
			var httpRequest = new lime_net__$HTTPRequest_$openfl_$utils_$ByteArray();
			this.__prepareRequest(httpRequest,request);
			httpRequest.load().onProgress($bind(this,this.httpRequest_onProgress)).onError($bind(this,this.httpRequest_onError)).onComplete(function(data) {
				_gthis.__dispatchStatus();
				_gthis.data = data;
				var event = new openfl_events_Event("complete");
				_gthis.dispatchEvent(event);
			});
		} else {
			var httpRequest = new lime_net__$HTTPRequest_$String();
			this.__prepareRequest(httpRequest,request);
			httpRequest.load().onProgress($bind(this,this.httpRequest_onProgress)).onError($bind(this,this.httpRequest_onError)).onComplete(function(data) {
				_gthis.__dispatchStatus();
				_gthis.data = data;
				var event = new openfl_events_Event("complete");
				_gthis.dispatchEvent(event);
			});
		}
	}
	,__dispatchStatus: function() {
		var event = new openfl_events_HTTPStatusEvent("httpStatus",false,false,this.__httpRequest.responseStatus);
		event.responseURL = this.__httpRequest.uri;
		var headers = [];
		if(this.__httpRequest.enableResponseHeaders && this.__httpRequest.responseHeaders != null) {
			var _g = 0;
			var _g1 = this.__httpRequest.responseHeaders;
			while(_g < _g1.length) {
				var header = _g1[_g];
				++_g;
				headers.push(new openfl_net_URLRequestHeader(header.name,header.value));
			}
		}
		event.responseHeaders = headers;
		this.dispatchEvent(event);
	}
	,__prepareRequest: function(httpRequest,request) {
		this.__httpRequest = httpRequest;
		this.__httpRequest.uri = request.url;
		this.__httpRequest.method = request.method;
		if(request.data != null) {
			if(Type.typeof(request.data) == ValueType.TObject) {
				var fields = Reflect.fields(request.data);
				var _g = 0;
				while(_g < fields.length) {
					var field = fields[_g];
					++_g;
					this.__httpRequest.formData.h[field] = Reflect.field(request.data,field);
				}
			} else if(((request.data) instanceof haxe_io_Bytes)) {
				this.__httpRequest.data = request.data;
			} else {
				this.__httpRequest.data = haxe_io_Bytes.ofString(Std.string(request.data));
			}
		}
		this.__httpRequest.contentType = request.contentType;
		if(request.requestHeaders != null) {
			var _g = 0;
			var _g1 = request.requestHeaders;
			while(_g < _g1.length) {
				var header = _g1[_g];
				++_g;
				this.__httpRequest.headers.push(new lime_net_HTTPRequestHeader(header.name,header.value));
			}
		}
		this.__httpRequest.followRedirects = request.followRedirects;
		this.__httpRequest.timeout = request.idleTimeout | 0;
		this.__httpRequest.withCredentials = request.manageCookies;
		var userAgent = request.userAgent;
		if(userAgent == null) {
			userAgent = "Mozilla/5.0 (Windows; U; en) AppleWebKit/420+ (KHTML, like Gecko) OpenFL/1.0";
		}
		this.__httpRequest.userAgent = request.userAgent;
		this.__httpRequest.enableResponseHeaders = true;
	}
	,httpRequest_onError: function(error) {
		this.__dispatchStatus();
		if(error == 403) {
			var event = new openfl_events_SecurityErrorEvent("securityError");
			event.text = Std.string(error);
			this.dispatchEvent(event);
		} else {
			var event = new openfl_events_IOErrorEvent("ioError");
			event.text = Std.string(error);
			this.dispatchEvent(event);
		}
	}
	,httpRequest_onProgress: function(bytesLoaded,bytesTotal) {
		var event = new openfl_events_ProgressEvent("progress");
		event.bytesLoaded = bytesLoaded;
		event.bytesTotal = bytesTotal;
		this.dispatchEvent(event);
	}
	,__class__: openfl_net_URLLoader
});
var openfl_net_URLLoaderDataFormat = {};
openfl_net_URLLoaderDataFormat.fromString = function(value) {
	switch(value) {
	case "binary":
		return 0;
	case "text":
		return 1;
	case "variables":
		return 2;
	default:
		return null;
	}
};
openfl_net_URLLoaderDataFormat.toString = function(this1) {
	switch(this1) {
	case 0:
		return "binary";
	case 1:
		return "text";
	case 2:
		return "variables";
	default:
		return null;
	}
};
var openfl_net_URLRequest = function(url) {
	if(url != null) {
		this.url = url;
	}
	this.contentType = null;
	this.followRedirects = openfl_net_URLRequestDefaults.followRedirects;
	if(openfl_net_URLRequestDefaults.idleTimeout > 0) {
		this.idleTimeout = openfl_net_URLRequestDefaults.idleTimeout;
	} else {
		this.idleTimeout = 30000;
	}
	this.manageCookies = openfl_net_URLRequestDefaults.manageCookies;
	this.method = "GET";
	this.requestHeaders = [];
	this.userAgent = openfl_net_URLRequestDefaults.userAgent;
};
$hxClasses["openfl.net.URLRequest"] = openfl_net_URLRequest;
openfl_net_URLRequest.__name__ = "openfl.net.URLRequest";
openfl_net_URLRequest.prototype = {
	contentType: null
	,data: null
	,followRedirects: null
	,idleTimeout: null
	,manageCookies: null
	,method: null
	,requestHeaders: null
	,url: null
	,userAgent: null
	,__class__: openfl_net_URLRequest
};
var openfl_net_URLRequestDefaults = function() { };
$hxClasses["openfl.net.URLRequestDefaults"] = openfl_net_URLRequestDefaults;
openfl_net_URLRequestDefaults.__name__ = "openfl.net.URLRequestDefaults";
openfl_net_URLRequestDefaults.userAgent = null;
var openfl_net_URLRequestHeader = function(name,value) {
	if(value == null) {
		value = "";
	}
	if(name == null) {
		name = "";
	}
	this.name = name;
	this.value = value;
};
$hxClasses["openfl.net.URLRequestHeader"] = openfl_net_URLRequestHeader;
openfl_net_URLRequestHeader.__name__ = "openfl.net.URLRequestHeader";
openfl_net_URLRequestHeader.prototype = {
	name: null
	,value: null
	,__class__: openfl_net_URLRequestHeader
};
var openfl_sensors_Accelerometer = function() {
	openfl_events_EventDispatcher.call(this);
	openfl_sensors_Accelerometer.initialize();
	this.__interval = 0;
	this.__muted = false;
	this.setRequestedUpdateInterval(openfl_sensors_Accelerometer.defaultInterval);
};
$hxClasses["openfl.sensors.Accelerometer"] = openfl_sensors_Accelerometer;
openfl_sensors_Accelerometer.__name__ = "openfl.sensors.Accelerometer";
openfl_sensors_Accelerometer.__properties__ = {get_isSupported:"get_isSupported"};
openfl_sensors_Accelerometer.initialize = function() {
	if(!openfl_sensors_Accelerometer.initialized) {
		var sensors = lime_system_Sensor.getSensors(lime_system_SensorType.ACCELEROMETER);
		if(sensors.length > 0) {
			sensors[0].onUpdate.add(openfl_sensors_Accelerometer.accelerometer_onUpdate);
			openfl_sensors_Accelerometer.supported = true;
		}
		openfl_sensors_Accelerometer.initialized = true;
	}
};
openfl_sensors_Accelerometer.accelerometer_onUpdate = function(x,y,z) {
	openfl_sensors_Accelerometer.currentX = x;
	openfl_sensors_Accelerometer.currentY = y;
	openfl_sensors_Accelerometer.currentZ = z;
};
openfl_sensors_Accelerometer.get_isSupported = function() {
	openfl_sensors_Accelerometer.initialize();
	return openfl_sensors_Accelerometer.supported;
};
openfl_sensors_Accelerometer.__super__ = openfl_events_EventDispatcher;
openfl_sensors_Accelerometer.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	__interval: null
	,__muted: null
	,__timer: null
	,addEventListener: function(type,listener,useCapture,priority,useWeakReference) {
		if(useWeakReference == null) {
			useWeakReference = false;
		}
		if(priority == null) {
			priority = 0;
		}
		if(useCapture == null) {
			useCapture = false;
		}
		openfl_events_EventDispatcher.prototype.addEventListener.call(this,type,listener,useCapture,priority,useWeakReference);
		this.update();
	}
	,setRequestedUpdateInterval: function(interval) {
		this.__interval = interval;
		if(this.__interval < 0) {
			throw haxe_Exception.thrown(new openfl_errors_ArgumentError());
		} else if(this.__interval == 0) {
			this.__interval = openfl_sensors_Accelerometer.defaultInterval;
		}
		if(this.__timer != null) {
			this.__timer.stop();
			this.__timer = null;
		}
		if(openfl_sensors_Accelerometer.supported && !this.get_muted()) {
			this.__timer = new haxe_Timer(this.__interval);
			this.__timer.run = $bind(this,this.update);
		}
	}
	,update: function() {
		var event = new openfl_events_AccelerometerEvent("update");
		event.timestamp = new Date().getTime() / 1000;
		event.accelerationX = openfl_sensors_Accelerometer.currentX;
		event.accelerationY = openfl_sensors_Accelerometer.currentY;
		event.accelerationZ = openfl_sensors_Accelerometer.currentZ;
		this.dispatchEvent(event);
	}
	,get_muted: function() {
		return this.__muted;
	}
	,set_muted: function(value) {
		this.__muted = value;
		this.setRequestedUpdateInterval(this.__interval);
		return value;
	}
	,__class__: openfl_sensors_Accelerometer
	,__properties__: {set_muted:"set_muted",get_muted:"get_muted"}
});
var openfl_system_ApplicationDomain = function(parentDomain) {
	if(parentDomain != null) {
		this.parentDomain = parentDomain;
	} else {
		this.parentDomain = openfl_system_ApplicationDomain.currentDomain;
	}
};
$hxClasses["openfl.system.ApplicationDomain"] = openfl_system_ApplicationDomain;
openfl_system_ApplicationDomain.__name__ = "openfl.system.ApplicationDomain";
openfl_system_ApplicationDomain.prototype = {
	parentDomain: null
	,getDefinition: function(name) {
		return $hxClasses[name];
	}
	,hasDefinition: function(name) {
		return $hxClasses[name] != null;
	}
	,__class__: openfl_system_ApplicationDomain
};
var openfl_system_LoaderContext = function(checkPolicyFile,applicationDomain,securityDomain) {
	if(checkPolicyFile == null) {
		checkPolicyFile = false;
	}
	this.checkPolicyFile = checkPolicyFile;
	this.securityDomain = securityDomain;
	this.applicationDomain = applicationDomain;
	this.allowCodeImport = true;
	this.allowLoadBytesCodeExecution = true;
};
$hxClasses["openfl.system.LoaderContext"] = openfl_system_LoaderContext;
openfl_system_LoaderContext.__name__ = "openfl.system.LoaderContext";
openfl_system_LoaderContext.prototype = {
	allowCodeImport: null
	,allowLoadBytesCodeExecution: null
	,applicationDomain: null
	,checkPolicyFile: null
	,securityDomain: null
	,__class__: openfl_system_LoaderContext
};
var openfl_system_SecurityDomain = function() {
};
$hxClasses["openfl.system.SecurityDomain"] = openfl_system_SecurityDomain;
openfl_system_SecurityDomain.__name__ = "openfl.system.SecurityDomain";
openfl_system_SecurityDomain.prototype = {
	__class__: openfl_system_SecurityDomain
};
var openfl_system_System = function() { };
$hxClasses["openfl.system.System"] = openfl_system_System;
openfl_system_System.__name__ = "openfl.system.System";
openfl_system_System.__properties__ = {get_vmVersion:"get_vmVersion",get_totalMemory:"get_totalMemory"};
openfl_system_System.disposeXML = function(node) {
};
openfl_system_System.exit = function(code) {
	lime_system_System.exit(code);
};
openfl_system_System.gc = function() {
};
openfl_system_System.pause = function() {
	openfl__$internal_Lib.notImplemented({ fileName : "openfl/system/System.hx", lineNumber : 213, className : "openfl.system.System", methodName : "pause"});
};
openfl_system_System.resume = function() {
	openfl__$internal_Lib.notImplemented({ fileName : "openfl/system/System.hx", lineNumber : 229, className : "openfl.system.System", methodName : "resume"});
};
openfl_system_System.setClipboard = function(string) {
	lime_system_Clipboard.set_text(string);
};
openfl_system_System.get_totalMemory = function() {
	return (window.performance && window.performance.memory) ? window.performance.memory.usedJSHeapSize : 0;
};
openfl_system_System.get_vmVersion = function() {
	return "1.0.0";
};
var openfl_text_AntiAliasType = {};
openfl_text_AntiAliasType.fromString = function(value) {
	switch(value) {
	case "advanced":
		return 0;
	case "normal":
		return 1;
	default:
		return null;
	}
};
openfl_text_AntiAliasType.toString = function(this1) {
	switch(this1) {
	case 0:
		return "advanced";
	case 1:
		return "normal";
	default:
		return null;
	}
};
var openfl_text_FontStyle = {};
openfl_text_FontStyle.fromString = function(value) {
	switch(value) {
	case "bold":
		return 0;
	case "boldItalic":
		return 1;
	case "italic":
		return 2;
	case "regular":
		return 3;
	default:
		return null;
	}
};
openfl_text_FontStyle.toString = function(this1) {
	switch(this1) {
	case 0:
		return "bold";
	case 1:
		return "boldItalic";
	case 2:
		return "italic";
	case 3:
		return "regular";
	default:
		return null;
	}
};
var openfl_text_FontType = {};
openfl_text_FontType.fromString = function(value) {
	switch(value) {
	case "device":
		return 0;
	case "embedded":
		return 1;
	case "embeddedCFF":
		return 2;
	default:
		return null;
	}
};
openfl_text_FontType.toString = function(this1) {
	switch(this1) {
	case 0:
		return "device";
	case 1:
		return "embedded";
	case 2:
		return "embeddedCFF";
	default:
		return null;
	}
};
var openfl_text_GridFitType = {};
openfl_text_GridFitType.fromString = function(value) {
	switch(value) {
	case "none":
		return 0;
	case "pixel":
		return 1;
	case "subpixel":
		return 2;
	default:
		return null;
	}
};
openfl_text_GridFitType.toString = function(this1) {
	switch(this1) {
	case 0:
		return "none";
	case 1:
		return "pixel";
	case 2:
		return "subpixel";
	default:
		return null;
	}
};
var openfl_text_TextField = function() {
	this.__forceCachedBitmapUpdate = false;
	this.__renderedOnCanvasWhileOnDOM = false;
	openfl_display_InteractiveObject.call(this);
	this.__caretIndex = -1;
	this.__displayAsPassword = false;
	this.__graphics = new openfl_display_Graphics(this);
	this.__textEngine = new openfl_text__$internal_TextEngine(this);
	this.__layoutDirty = true;
	this.__offsetX = 0;
	this.__offsetY = 0;
	this.__mouseWheelEnabled = true;
	this.__text = "";
	this.doubleClickEnabled = true;
	if(openfl_text_TextField.__defaultTextFormat == null) {
		openfl_text_TextField.__defaultTextFormat = new openfl_text_TextFormat("Times New Roman",12,0,false,false,false,"","",3,0,0,0,0);
		openfl_text_TextField.__defaultTextFormat.blockIndent = 0;
		openfl_text_TextField.__defaultTextFormat.bullet = false;
		openfl_text_TextField.__defaultTextFormat.letterSpacing = 0;
		openfl_text_TextField.__defaultTextFormat.kerning = false;
	}
	this.__textFormat = openfl_text_TextField.__defaultTextFormat.clone();
	this.__textEngine.textFormatRanges.push(new openfl_text__$internal_TextFormatRange(this.__textFormat,0,0));
	this.addEventListener("mouseDown",$bind(this,this.this_onMouseDown));
	this.addEventListener("focusIn",$bind(this,this.this_onFocusIn));
	this.addEventListener("focusOut",$bind(this,this.this_onFocusOut));
	this.addEventListener("keyDown",$bind(this,this.this_onKeyDown));
	this.addEventListener("mouseWheel",$bind(this,this.this_onMouseWheel));
	this.addEventListener("doubleClick",$bind(this,this.this_onDoubleClick));
};
$hxClasses["openfl.text.TextField"] = openfl_text_TextField;
openfl_text_TextField.__name__ = "openfl.text.TextField";
openfl_text_TextField.__defaultTextFormat = null;
openfl_text_TextField.__super__ = openfl_display_InteractiveObject;
openfl_text_TextField.prototype = $extend(openfl_display_InteractiveObject.prototype,{
	__bounds: null
	,__caretIndex: null
	,__cursorTimer: null
	,__dirty: null
	,__displayAsPassword: null
	,__domRender: null
	,__inputEnabled: null
	,__isHTML: null
	,__layoutDirty: null
	,__mouseWheelEnabled: null
	,__offsetX: null
	,__offsetY: null
	,__selectionIndex: null
	,__showCursor: null
	,__text: null
	,__htmlText: null
	,__textEngine: null
	,__textFormat: null
	,__div: null
	,__renderedOnCanvasWhileOnDOM: null
	,__rawHtmlText: null
	,__forceCachedBitmapUpdate: null
	,appendText: function(text) {
		if(text == null || text == "") {
			return;
		}
		this.__dirty = true;
		this.__layoutDirty = true;
		if(!this.__renderDirty) {
			this.__renderDirty = true;
			this.__setParentRenderDirty();
		}
		this.__updateText(this.__text + text);
		this.__textEngine.textFormatRanges.get(this.__textEngine.textFormatRanges.get_length() - 1).end = this.__text.length;
		this.__updateScrollV();
		this.__updateScrollH();
	}
	,getCharBoundaries: function(charIndex) {
		if(charIndex < 0 || charIndex > this.__text.length - 1) {
			return null;
		}
		var rect = new openfl_geom_Rectangle();
		if(this.__getCharBoundaries(charIndex,rect)) {
			return rect;
		} else {
			return null;
		}
	}
	,getCharIndexAtPoint: function(x,y) {
		if(x <= 2 || x > this.get_width() + 4 || y <= 0 || y > this.get_height() + 4) {
			return -1;
		}
		this.__updateLayout();
		x += this.get_scrollH();
		var _g = 0;
		var _g1 = this.get_scrollV() - 1;
		while(_g < _g1) {
			var i = _g++;
			y += this.__textEngine.lineHeights.get(i);
		}
		var group = this.__textEngine.layoutGroups.iterator();
		while(group.hasNext()) {
			var group1 = group.next();
			if(y >= group1.offsetY && y <= group1.offsetY + group1.height) {
				if(x >= group1.offsetX && x <= group1.offsetX + group1.width) {
					var advance = 0.0;
					var _g = 0;
					var _g1 = group1.positions.length;
					while(_g < _g1) {
						var i = _g++;
						advance += group1.positions[i];
						if(x <= group1.offsetX + advance) {
							return group1.startIndex + i;
						}
					}
					return group1.endIndex;
				}
			}
		}
		return -1;
	}
	,getFirstCharInParagraph: function(charIndex) {
		if(charIndex < 0 || charIndex > this.get_text().length) {
			return -1;
		}
		var index = this.__textEngine.getLineBreakIndex();
		var startIndex = 0;
		while(index > -1) {
			if(index < charIndex) {
				startIndex = index + 1;
			} else if(index >= charIndex) {
				break;
			}
			index = this.__textEngine.getLineBreakIndex(index + 1);
		}
		return startIndex;
	}
	,getLineIndexAtPoint: function(x,y) {
		this.__updateLayout();
		if(x <= 2 || x > this.get_width() + 4 || y <= 0 || y > this.get_height() + 4) {
			return -1;
		}
		var _g = 0;
		var _g1 = this.get_scrollV() - 1;
		while(_g < _g1) {
			var i = _g++;
			y += this.__textEngine.lineHeights.get(i);
		}
		var group = this.__textEngine.layoutGroups.iterator();
		while(group.hasNext()) {
			var group1 = group.next();
			if(y >= group1.offsetY && y <= group1.offsetY + group1.height) {
				return group1.lineIndex;
			}
		}
		return -1;
	}
	,getLineIndexOfChar: function(charIndex) {
		if(charIndex < 0 || charIndex > this.__text.length) {
			return -1;
		}
		this.__updateLayout();
		var group = this.__textEngine.layoutGroups.iterator();
		while(group.hasNext()) {
			var group1 = group.next();
			if(group1.startIndex <= charIndex && group1.endIndex >= charIndex) {
				return group1.lineIndex;
			}
		}
		return -1;
	}
	,getLineLength: function(lineIndex) {
		this.__updateLayout();
		if(lineIndex < 0 || lineIndex > this.__textEngine.numLines - 1) {
			return 0;
		}
		var startIndex = -1;
		var endIndex = -1;
		var group = this.__textEngine.layoutGroups.iterator();
		while(group.hasNext()) {
			var group1 = group.next();
			if(group1.lineIndex == lineIndex) {
				if(startIndex == -1) {
					startIndex = group1.startIndex;
				}
			} else if(group1.lineIndex == lineIndex + 1) {
				endIndex = group1.startIndex;
				break;
			}
		}
		if(endIndex == -1) {
			endIndex = this.__text.length;
		}
		return endIndex - startIndex;
	}
	,getLineMetrics: function(lineIndex) {
		this.__updateLayout();
		var ascender = this.__textEngine.lineAscents.get(lineIndex);
		var descender = this.__textEngine.lineDescents.get(lineIndex);
		var leading = this.__textEngine.lineLeadings.get(lineIndex);
		var lineHeight = this.__textEngine.lineHeights.get(lineIndex);
		var lineWidth = this.__textEngine.lineWidths.get(lineIndex);
		var margin;
		switch(this.__textFormat.align) {
		case 0:
			margin = (this.__textEngine.width - lineWidth) / 2;
			break;
		case 1:case 4:
			margin = this.__textEngine.width - lineWidth - 2;
			break;
		case 2:case 3:case 5:
			margin = 2;
			break;
		}
		return new openfl_text_TextLineMetrics(margin,lineWidth,lineHeight,ascender,descender,leading);
	}
	,getLineOffset: function(lineIndex) {
		this.__updateLayout();
		if(lineIndex < 0 || lineIndex > this.__textEngine.numLines - 1) {
			return -1;
		}
		var group = this.__textEngine.layoutGroups.iterator();
		while(group.hasNext()) {
			var group1 = group.next();
			if(group1.lineIndex == lineIndex) {
				return group1.startIndex;
			}
		}
		return 0;
	}
	,getLineText: function(lineIndex) {
		this.__updateLayout();
		if(lineIndex < 0 || lineIndex > this.__textEngine.numLines - 1) {
			return null;
		}
		var startIndex = -1;
		var endIndex = -1;
		var group = this.__textEngine.layoutGroups.iterator();
		while(group.hasNext()) {
			var group1 = group.next();
			if(group1.lineIndex == lineIndex) {
				if(startIndex == -1) {
					startIndex = group1.startIndex;
				}
			} else if(group1.lineIndex == lineIndex + 1) {
				endIndex = group1.startIndex;
				break;
			}
		}
		if(endIndex == -1) {
			endIndex = this.__text.length;
		}
		return this.__textEngine.text.substring(startIndex,endIndex);
	}
	,getParagraphLength: function(charIndex) {
		if(charIndex < 0 || charIndex > this.get_text().length) {
			return -1;
		}
		var startIndex = this.getFirstCharInParagraph(charIndex);
		if(charIndex >= this.get_text().length) {
			return this.get_text().length - startIndex + 1;
		}
		var endIndex = this.__textEngine.getLineBreakIndex(charIndex) + 1;
		if(endIndex == 0) {
			endIndex = this.__text.length;
		}
		return endIndex - startIndex;
	}
	,getTextFormat: function(beginIndex,endIndex) {
		if(endIndex == null) {
			endIndex = -1;
		}
		if(beginIndex == null) {
			beginIndex = -1;
		}
		var format = null;
		if(beginIndex >= this.get_text().length || beginIndex < -1 || endIndex > this.get_text().length || endIndex < -1) {
			throw haxe_Exception.thrown(new openfl_errors_RangeError("The supplied index is out of bounds"));
		}
		if(beginIndex == -1) {
			beginIndex = 0;
		}
		if(endIndex == -1) {
			endIndex = this.get_text().length;
		}
		if(beginIndex >= endIndex) {
			return new openfl_text_TextFormat();
		}
		var group = this.__textEngine.textFormatRanges.iterator();
		while(group.hasNext()) {
			var group1 = group.next();
			if(group1.start <= beginIndex && group1.end > beginIndex || group1.start < endIndex && group1.end >= endIndex) {
				if(format == null) {
					format = group1.format.clone();
				} else {
					if(group1.format.font != format.font) {
						format.font = null;
					}
					if(group1.format.size != format.size) {
						format.size = null;
					}
					if(group1.format.color != format.color) {
						format.color = null;
					}
					if(group1.format.bold != format.bold) {
						format.bold = null;
					}
					if(group1.format.italic != format.italic) {
						format.italic = null;
					}
					if(group1.format.underline != format.underline) {
						format.underline = null;
					}
					if(group1.format.url != format.url) {
						format.url = null;
					}
					if(group1.format.target != format.target) {
						format.target = null;
					}
					if(group1.format.align != format.align) {
						format.align = null;
					}
					if(group1.format.leftMargin != format.leftMargin) {
						format.leftMargin = null;
					}
					if(group1.format.rightMargin != format.rightMargin) {
						format.rightMargin = null;
					}
					if(group1.format.indent != format.indent) {
						format.indent = null;
					}
					if(group1.format.leading != format.leading) {
						format.leading = null;
					}
					if(group1.format.blockIndent != format.blockIndent) {
						format.blockIndent = null;
					}
					if(group1.format.bullet != format.bullet) {
						format.bullet = null;
					}
					if(group1.format.kerning != format.kerning) {
						format.kerning = null;
					}
					if(group1.format.letterSpacing != format.letterSpacing) {
						format.letterSpacing = null;
					}
					if(group1.format.tabStops != format.tabStops) {
						format.tabStops = null;
					}
				}
			}
		}
		if(format == null) {
			format = new openfl_text_TextFormat();
		}
		return format;
	}
	,replaceSelectedText: function(value) {
		this.__replaceSelectedText(value,false);
	}
	,replaceText: function(beginIndex,endIndex,newText) {
		this.__replaceText(beginIndex,endIndex,newText,false);
	}
	,setSelection: function(beginIndex,endIndex) {
		this.__selectionIndex = beginIndex;
		this.__caretIndex = endIndex;
		this.__updateScrollV();
		this.__stopCursorTimer();
		this.__startCursorTimer();
	}
	,setTextFormat: function(format,beginIndex,endIndex) {
		if(endIndex == null) {
			endIndex = 0;
		}
		if(beginIndex == null) {
			beginIndex = 0;
		}
		var max = this.get_text().length;
		var range;
		if(beginIndex < 0) {
			beginIndex = 0;
		}
		if(endIndex < 0) {
			endIndex = 0;
		}
		if(endIndex == 0) {
			if(beginIndex == 0) {
				endIndex = max;
			} else {
				endIndex = beginIndex + 1;
			}
		}
		if(endIndex < beginIndex) {
			return;
		}
		if(beginIndex == 0 && endIndex >= max) {
			this.__textFormat.__merge(format);
			var _g = 0;
			var _g1 = this.__textEngine.textFormatRanges.get_length();
			while(_g < _g1) {
				var i = _g++;
				range = this.__textEngine.textFormatRanges.get(i);
				range.format.__merge(format);
			}
		} else {
			var index = 0;
			var newRange;
			while(index < this.__textEngine.textFormatRanges.get_length()) {
				range = this.__textEngine.textFormatRanges.get(index);
				if(range.start == beginIndex && range.end == endIndex) {
					range.format.__merge(format);
					break;
				} else if(range.start >= beginIndex && range.end <= endIndex) {
					range.format.__merge(format);
				} else if(range.start >= beginIndex && range.start < endIndex && range.end > beginIndex) {
					newRange = new openfl_text__$internal_TextFormatRange(range.format.clone(),range.start,endIndex);
					newRange.format.__merge(format);
					this.__textEngine.textFormatRanges.insertAt(index,newRange);
					range.start = endIndex;
					++index;
				} else if(range.start < beginIndex && range.end > beginIndex && range.end >= endIndex) {
					newRange = new openfl_text__$internal_TextFormatRange(range.format.clone(),beginIndex,range.end);
					newRange.format.__merge(format);
					this.__textEngine.textFormatRanges.insertAt(index + 1,newRange);
					range.end = beginIndex;
					++index;
				}
				++index;
			}
		}
		this.__dirty = true;
		this.__layoutDirty = true;
		if(!this.__renderDirty) {
			this.__renderDirty = true;
			this.__setParentRenderDirty();
		}
	}
	,__allowMouseFocus: function() {
		if(!(this.__textEngine.type == 1 || this.get_tabEnabled())) {
			return this.get_selectable();
		} else {
			return true;
		}
	}
	,__caretBeginningOfLine: function() {
		if(this.__selectionIndex == this.__caretIndex || this.__caretIndex < this.__selectionIndex) {
			this.__caretIndex = this.getLineOffset(this.getLineIndexOfChar(this.__caretIndex));
		} else {
			this.__selectionIndex = this.getLineOffset(this.getLineIndexOfChar(this.__selectionIndex));
		}
	}
	,__caretEndOfLine: function() {
		var lineIndex;
		if(this.__selectionIndex == this.__caretIndex) {
			lineIndex = this.getLineIndexOfChar(this.__caretIndex);
		} else {
			lineIndex = this.getLineIndexOfChar(Math.max(this.__caretIndex,this.__selectionIndex) | 0);
		}
		if(lineIndex < this.__textEngine.numLines - 1) {
			this.__caretIndex = this.getLineOffset(lineIndex + 1) - 1;
		} else {
			this.__caretIndex = this.__text.length;
		}
	}
	,__caretNextCharacter: function() {
		if(this.__caretIndex < this.__text.length) {
			this.__caretIndex++;
		}
	}
	,__caretNextLine: function(lineIndex,caretIndex) {
		if(lineIndex == null) {
			lineIndex = this.getLineIndexOfChar(this.__caretIndex);
		}
		if(lineIndex < this.__textEngine.numLines - 1) {
			if(caretIndex == null) {
				caretIndex = this.__caretIndex;
			}
			this.__caretIndex = this.__getCharIndexOnDifferentLine(caretIndex,lineIndex + 1);
		} else {
			this.__caretIndex = this.__text.length;
		}
	}
	,__caretPreviousCharacter: function() {
		if(this.__caretIndex > 0) {
			this.__caretIndex--;
		}
	}
	,__caretPreviousLine: function(lineIndex,caretIndex) {
		if(lineIndex == null) {
			lineIndex = this.getLineIndexOfChar(this.__caretIndex);
		}
		if(lineIndex > 0) {
			if(caretIndex == null) {
				caretIndex = this.__caretIndex;
			}
			this.__caretIndex = this.__getCharIndexOnDifferentLine(caretIndex,lineIndex - 1);
		} else {
			this.__caretIndex = 0;
		}
	}
	,__disableInput: function() {
		if(this.__inputEnabled && this.stage != null) {
			this.stage.window.__backend.setTextInputEnabled(false);
			this.stage.window.onTextInput.remove($bind(this,this.window_onTextInput));
			this.stage.window.onKeyDown.remove($bind(this,this.window_onKeyDown));
			this.__inputEnabled = false;
			this.__stopCursorTimer();
		}
	}
	,__dispatch: function(event) {
		if(event.eventPhase == 2 && event.type == "mouseUp") {
			var event1 = event;
			var group = this.__getGroup(this.get_mouseX(),this.get_mouseY(),true);
			if(group != null) {
				var url = group.format.url;
				if(url != null && url != "") {
					if(StringTools.startsWith(url,"event:")) {
						this.dispatchEvent(new openfl_events_TextEvent("link",false,false,HxOverrides.substr(url,6,null)));
					} else {
						openfl_Lib.getURL(new openfl_net_URLRequest(url));
					}
				}
			}
		}
		return openfl_display_InteractiveObject.prototype.__dispatch.call(this,event);
	}
	,__enableInput: function() {
		if(this.stage != null) {
			this.stage.window.__backend.setTextInputEnabled(true);
			if(!this.__inputEnabled) {
				this.stage.window.__backend.setTextInputEnabled(true);
				if(!this.stage.window.onTextInput.has($bind(this,this.window_onTextInput))) {
					this.stage.window.onTextInput.add($bind(this,this.window_onTextInput));
					this.stage.window.onKeyDown.add($bind(this,this.window_onKeyDown));
				}
				this.__inputEnabled = true;
				this.__startCursorTimer();
			}
		}
	}
	,__getAdvance: function(position) {
		return position;
	}
	,__getBounds: function(rect,matrix) {
		this.__updateLayout();
		var bounds = openfl_geom_Rectangle.__pool.get();
		bounds.copyFrom(this.__textEngine.bounds);
		matrix.tx += this.__offsetX;
		matrix.ty += this.__offsetY;
		bounds.__transform(bounds,matrix);
		rect.__expand(bounds.x,bounds.y,bounds.width,bounds.height);
		openfl_geom_Rectangle.__pool.release(bounds);
	}
	,__getCharBoundaries: function(charIndex,rect) {
		if(charIndex < 0 || charIndex > this.__text.length - 1) {
			return false;
		}
		this.__updateLayout();
		var group = this.__textEngine.layoutGroups.iterator();
		while(group.hasNext()) {
			var group1 = group.next();
			if(charIndex >= group1.startIndex && charIndex < group1.endIndex) {
				try {
					var x = group1.offsetX;
					var _g = 0;
					var _g1 = charIndex - group1.startIndex;
					while(_g < _g1) {
						var i = _g++;
						x += group1.positions[i];
					}
					var lastPosition = group1.positions[charIndex - group1.startIndex];
					rect.setTo(x,group1.offsetY,lastPosition,group1.ascent + group1.descent);
					return true;
				} catch( _g2 ) {
					haxe_NativeStackTrace.lastError = _g2;
				}
			}
		}
		return false;
	}
	,__getCharIndexOnDifferentLine: function(charIndex,lineIndex) {
		if(charIndex < 0 || charIndex > this.__text.length) {
			return -1;
		}
		if(lineIndex < 0 || lineIndex > this.__textEngine.numLines - 1) {
			return -1;
		}
		var x = null;
		var y = null;
		var group = this.__textEngine.layoutGroups.iterator();
		while(group.hasNext()) {
			var group1 = group.next();
			if(charIndex >= group1.startIndex && charIndex <= group1.endIndex) {
				x = group1.offsetX;
				var _g = 0;
				var _g1 = charIndex - group1.startIndex;
				while(_g < _g1) {
					var i = _g++;
					x += group1.positions[i];
				}
				if(y != null) {
					return this.__getPosition(x,y);
				}
			}
			if(group1.lineIndex == lineIndex) {
				y = group1.offsetY + group1.height / 2;
				var _g2 = 0;
				var _g3 = this.get_scrollV() - 1;
				while(_g2 < _g3) {
					var i1 = _g2++;
					y -= this.__textEngine.lineHeights.get(i1);
				}
				if(x != null) {
					return this.__getPosition(x,y);
				}
			}
		}
		return -1;
	}
	,__getCursor: function() {
		var group = this.__getGroup(this.get_mouseX(),this.get_mouseY(),true);
		if(group != null && group.format.url != "") {
			return "button";
		} else if(this.__textEngine.selectable) {
			return "ibeam";
		}
		return null;
	}
	,__getGroup: function(x,y,precise) {
		if(precise == null) {
			precise = false;
		}
		this.__updateLayout();
		x += this.get_scrollH();
		var _g = 0;
		var _g1 = this.get_scrollV() - 1;
		while(_g < _g1) {
			var i = _g++;
			y += this.__textEngine.lineHeights.get(i);
		}
		if(!precise && y > this.__textEngine.textHeight) {
			y = this.__textEngine.textHeight;
		}
		var firstGroup = true;
		var group;
		var nextGroup;
		var _g = 0;
		var _g1 = this.__textEngine.layoutGroups.get_length();
		while(_g < _g1) {
			var i = _g++;
			group = this.__textEngine.layoutGroups.get(i);
			if(i < this.__textEngine.layoutGroups.get_length() - 1) {
				nextGroup = this.__textEngine.layoutGroups.get(i + 1);
			} else {
				nextGroup = null;
			}
			if(firstGroup) {
				if(y < group.offsetY) {
					y = group.offsetY;
				}
				if(x < group.offsetX) {
					x = group.offsetX;
				}
				firstGroup = false;
			}
			if(y >= group.offsetY && y <= group.offsetY + group.height || !precise && nextGroup == null) {
				if(x >= group.offsetX && x <= group.offsetX + group.width || !precise && (nextGroup == null || nextGroup.lineIndex != group.lineIndex)) {
					return group;
				}
			}
		}
		return null;
	}
	,__getPosition: function(x,y) {
		var group = this.__getGroup(x,y);
		if(group == null) {
			return this.__text.length;
		}
		var advance = 0.0;
		var _g = 0;
		var _g1 = group.positions.length;
		while(_g < _g1) {
			var i = _g++;
			advance += group.positions[i];
			if(x <= group.offsetX + advance) {
				if(x <= group.offsetX + (advance - group.positions[i]) + group.positions[i] / 2) {
					return group.startIndex + i;
				} else if(group.startIndex + i < group.endIndex) {
					return group.startIndex + i + 1;
				} else {
					return group.endIndex;
				}
			}
		}
		return group.endIndex;
	}
	,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) {
		if(!hitObject.get_visible() || this.__isMask || interactiveOnly && !this.mouseEnabled) {
			return false;
		}
		if(this.get_mask() != null && !this.get_mask().__hitTestMask(x,y)) {
			return false;
		}
		this.__getRenderTransform();
		this.__updateLayout();
		var _this = this.__renderTransform;
		var norm = _this.a * _this.d - _this.b * _this.c;
		var px = norm == 0 ? -_this.tx : 1.0 / norm * (_this.c * (_this.ty - y) + _this.d * (x - _this.tx));
		var _this = this.__renderTransform;
		var norm = _this.a * _this.d - _this.b * _this.c;
		var py = norm == 0 ? -_this.ty : 1.0 / norm * (_this.a * (y - _this.ty) + _this.b * (_this.tx - x));
		if(this.__textEngine.bounds.contains(px,py)) {
			if(stack != null) {
				stack.push(hitObject);
			}
			return true;
		}
		return false;
	}
	,__hitTestMask: function(x,y) {
		this.__getRenderTransform();
		this.__updateLayout();
		var _this = this.__renderTransform;
		var norm = _this.a * _this.d - _this.b * _this.c;
		var px = norm == 0 ? -_this.tx : 1.0 / norm * (_this.c * (_this.ty - y) + _this.d * (x - _this.tx));
		var _this = this.__renderTransform;
		var norm = _this.a * _this.d - _this.b * _this.c;
		var py = norm == 0 ? -_this.ty : 1.0 / norm * (_this.a * (y - _this.ty) + _this.b * (_this.tx - x));
		if(this.__textEngine.bounds.contains(px,py)) {
			return true;
		}
		return false;
	}
	,__renderCairo: function(renderer) {
	}
	,__renderCanvas: function(renderer) {
		if(renderer.__isDOM && !this.__renderedOnCanvasWhileOnDOM) {
			this.__renderedOnCanvasWhileOnDOM = true;
			if(this.get_type() == 1) {
				this.replaceText(0,this.__text.length,this.__text);
			}
			if(this.__isHTML) {
				this.__updateText(openfl__$internal_formats_html_HTMLParser.parse(this.__text,this.__textFormat,this.__textEngine.textFormatRanges));
			}
			this.__dirty = true;
			this.__layoutDirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		if(this.get_mask() == null || this.get_mask().get_width() > 0 && this.get_mask().get_height() > 0) {
			this.__updateCacheBitmap(renderer,this.__dirty);
			if(this.__cacheBitmap != null && !this.__isCacheBitmapRender) {
				var bitmap = this.__cacheBitmap;
				if(bitmap.__renderable) {
					var alpha = renderer.__getAlpha(bitmap.__worldAlpha);
					if(alpha > 0 && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) {
						var context = renderer.context;
						renderer.__setBlendMode(bitmap.__worldBlendMode);
						renderer.__pushMaskObject(bitmap,false);
						lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(bitmap.__bitmapData.image);
						context.globalAlpha = alpha;
						var scrollRect = bitmap.__scrollRect;
						renderer.setTransform(bitmap.__renderTransform,context);
						if(!renderer.__allowSmoothing || !bitmap.smoothing) {
							context.imageSmoothingEnabled = false;
						}
						if(scrollRect == null) {
							context.drawImage(bitmap.__bitmapData.image.get_src(),0,0,bitmap.__bitmapData.image.width,bitmap.__bitmapData.image.height);
						} else {
							context.drawImage(bitmap.__bitmapData.image.get_src(),scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height);
						}
						if(!renderer.__allowSmoothing || !bitmap.smoothing) {
							context.imageSmoothingEnabled = true;
						}
						renderer.__popMaskObject(bitmap,false);
					}
				}
			} else {
				var transform = this.__worldTransform;
				var textEngine = this.__textEngine;
				var bounds = textEngine.background || textEngine.border ? textEngine.bounds : textEngine.textBounds;
				var graphics = this.__graphics;
				if(this.__dirty) {
					this.__updateLayout();
					if(graphics.__bounds == null) {
						graphics.__bounds = new openfl_geom_Rectangle();
					}
					graphics.__bounds.copyFrom(bounds);
				}
				graphics.__update(renderer.__worldTransform);
				if(this.__dirty || graphics.__softwareDirty) {
					var width = graphics.__width;
					var height = graphics.__height;
					if((textEngine.text == null || textEngine.text == "") && !textEngine.background && !textEngine.border && !textEngine.__hasFocus && (textEngine.type != 1 || !textEngine.selectable) || (textEngine.width <= 0 || textEngine.height <= 0) && textEngine.autoSize != 2) {
						this.__graphics.__canvas = null;
						this.__graphics.__context = null;
						this.__graphics.__bitmap = null;
						this.__graphics.__softwareDirty = false;
						this.__graphics.set___dirty(false);
						this.__dirty = false;
					} else {
						if(this.__graphics.__canvas == null) {
							this.__graphics.__canvas = window.document.createElement("canvas");
							this.__graphics.__context = this.__graphics.__canvas.getContext("2d");
						}
						openfl_display__$internal_CanvasTextField.context = graphics.__context;
						var transform = graphics.__renderTransform;
						if(renderer.__isDOM) {
							var scale = renderer.pixelRatio;
							graphics.__canvas.width = width * scale | 0;
							graphics.__canvas.height = height * scale | 0;
							graphics.__canvas.style.width = width + "px";
							graphics.__canvas.style.height = height + "px";
							var matrix = openfl_geom_Matrix.__pool.get();
							matrix.copyFrom(transform);
							matrix.scale(scale,scale);
							renderer.setTransform(matrix,openfl_display__$internal_CanvasTextField.context);
							openfl_geom_Matrix.__pool.release(matrix);
						} else {
							graphics.__canvas.width = width;
							graphics.__canvas.height = height;
							openfl_display__$internal_CanvasTextField.context.setTransform(transform.a,transform.b,transform.c,transform.d,transform.tx,transform.ty);
						}
						if(openfl_display__$internal_CanvasTextField.clearRect == null) {
							openfl_display__$internal_CanvasTextField.clearRect = (typeof navigator !== 'undefined' && typeof navigator['isCocoonJS'] !== 'undefined');
						}
						if(openfl_display__$internal_CanvasTextField.clearRect) {
							openfl_display__$internal_CanvasTextField.context.clearRect(0,0,graphics.__canvas.width,graphics.__canvas.height);
						}
						if(textEngine.text != null && textEngine.text != "" || textEngine.__hasFocus) {
							var text = textEngine.text;
							if(!renderer.__allowSmoothing || textEngine.antiAliasType == 0 && textEngine.sharpness == 400) {
								graphics.__context.imageSmoothingEnabled = false;
							} else {
								graphics.__context.imageSmoothingEnabled = true;
							}
							if(textEngine.border || textEngine.background) {
								openfl_display__$internal_CanvasTextField.context.rect(0.5,0.5,bounds.width - 1,bounds.height - 1);
								if(textEngine.background) {
									var tmp = StringTools.hex(textEngine.backgroundColor & 16777215,6);
									openfl_display__$internal_CanvasTextField.context.fillStyle = "#" + tmp;
									openfl_display__$internal_CanvasTextField.context.fill();
								}
								if(textEngine.border) {
									openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
									var tmp = StringTools.hex(textEngine.borderColor & 16777215,6);
									openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
									openfl_display__$internal_CanvasTextField.context.stroke();
								}
							}
							openfl_display__$internal_CanvasTextField.context.textBaseline = "alphabetic";
							openfl_display__$internal_CanvasTextField.context.textAlign = "start";
							var scrollX = -this.get_scrollH();
							var scrollY = 0.0;
							var _g = 0;
							var _g1 = this.get_scrollV() - 1;
							while(_g < _g1) {
								var i = _g++;
								scrollY -= textEngine.lineHeights.get(i);
							}
							var advance;
							var group = textEngine.layoutGroups.iterator();
							while(group.hasNext()) {
								var group1 = group.next();
								if(group1.lineIndex < this.get_scrollV() - 1) {
									continue;
								}
								if(group1.lineIndex > textEngine.get_bottomScrollV() - 1) {
									break;
								}
								var color = "#" + StringTools.hex(group1.format.color & 16777215,6);
								openfl_display__$internal_CanvasTextField.context.font = openfl_text__$internal_TextEngine.getFont(group1.format);
								openfl_display__$internal_CanvasTextField.context.fillStyle = color;
								openfl_display__$internal_CanvasTextField.context.fillText(text.substring(group1.startIndex,group1.endIndex),group1.offsetX + scrollX - bounds.x,group1.offsetY + group1.ascent + scrollY - bounds.y);
								if(this.__caretIndex > -1 && textEngine.selectable) {
									if(this.__selectionIndex == this.__caretIndex) {
										if(this.__showCursor && group1.startIndex <= this.__caretIndex && group1.endIndex >= this.__caretIndex) {
											advance = 0.0;
											var _g = 0;
											var _g1 = this.__caretIndex - group1.startIndex;
											while(_g < _g1) {
												var i = _g++;
												if(group1.positions.length <= i) {
													break;
												}
												advance += group1.positions[i];
											}
											var scrollY1 = 0.0;
											var _g2 = this.get_scrollV();
											var _g3 = group1.lineIndex + 1;
											while(_g2 < _g3) {
												var i1 = _g2++;
												scrollY1 += textEngine.lineHeights.get(i1 - 1);
											}
											openfl_display__$internal_CanvasTextField.context.beginPath();
											var tmp = StringTools.hex(group1.format.color & 16777215,6);
											openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
											openfl_display__$internal_CanvasTextField.context.moveTo(group1.offsetX + advance - this.get_scrollH() - bounds.x,scrollY1 + 2 - bounds.y);
											openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
											openfl_display__$internal_CanvasTextField.context.lineTo(group1.offsetX + advance - this.get_scrollH() - bounds.x,scrollY1 + openfl_text__$internal_TextEngine.getFormatHeight(this.get_defaultTextFormat()) - 1 - bounds.y);
											openfl_display__$internal_CanvasTextField.context.stroke();
											openfl_display__$internal_CanvasTextField.context.closePath();
										}
									} else if(group1.startIndex <= this.__caretIndex && group1.endIndex >= this.__caretIndex || group1.startIndex <= this.__selectionIndex && group1.endIndex >= this.__selectionIndex || group1.startIndex > this.__caretIndex && group1.endIndex < this.__selectionIndex || group1.startIndex > this.__selectionIndex && group1.endIndex < this.__caretIndex) {
										var selectionStart = Math.min(this.__selectionIndex,this.__caretIndex) | 0;
										var selectionEnd = Math.max(this.__selectionIndex,this.__caretIndex) | 0;
										if(group1.startIndex > selectionStart) {
											selectionStart = group1.startIndex;
										}
										if(group1.endIndex < selectionEnd) {
											selectionEnd = group1.endIndex;
										}
										var end;
										var start = this.getCharBoundaries(selectionStart);
										if(selectionEnd >= group1.endIndex) {
											end = this.getCharBoundaries(group1.endIndex - 1);
											if(end != null) {
												end.x += end.width + 2;
											}
										} else {
											end = this.getCharBoundaries(selectionEnd);
										}
										if(start != null && end != null) {
											openfl_display__$internal_CanvasTextField.context.fillStyle = "#000000";
											openfl_display__$internal_CanvasTextField.context.fillRect(start.x + scrollX,start.y + scrollY,end.x - start.x,group1.height);
											openfl_display__$internal_CanvasTextField.context.fillStyle = "#FFFFFF";
											openfl_display__$internal_CanvasTextField.context.fillText(text.substring(selectionStart,selectionEnd),scrollX + start.x,group1.offsetY + group1.ascent + scrollY);
										}
									}
								}
								if(group1.format.underline) {
									openfl_display__$internal_CanvasTextField.context.beginPath();
									openfl_display__$internal_CanvasTextField.context.strokeStyle = color;
									openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
									var x = group1.offsetX + scrollX - bounds.x;
									var y = Math.floor(group1.offsetY + scrollY + group1.ascent - bounds.y) + 0.5;
									openfl_display__$internal_CanvasTextField.context.moveTo(x,y);
									openfl_display__$internal_CanvasTextField.context.lineTo(x + group1.width,y);
									openfl_display__$internal_CanvasTextField.context.stroke();
									openfl_display__$internal_CanvasTextField.context.closePath();
								}
							}
						} else {
							if(textEngine.border || textEngine.background) {
								if(textEngine.border) {
									openfl_display__$internal_CanvasTextField.context.rect(0.5,0.5,bounds.width - 1,bounds.height - 1);
								} else {
									openfl_display__$internal_CanvasTextField.context.rect(0,0,bounds.width,bounds.height);
								}
								if(textEngine.background) {
									var tmp = StringTools.hex(textEngine.backgroundColor & 16777215,6);
									openfl_display__$internal_CanvasTextField.context.fillStyle = "#" + tmp;
									openfl_display__$internal_CanvasTextField.context.fill();
								}
								if(textEngine.border) {
									openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
									openfl_display__$internal_CanvasTextField.context.lineCap = "square";
									var tmp = StringTools.hex(textEngine.borderColor & 16777215,6);
									openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
									openfl_display__$internal_CanvasTextField.context.stroke();
								}
							}
							if(this.__caretIndex > -1 && textEngine.selectable && this.__showCursor) {
								var scrollX = -this.get_scrollH();
								var scrollY = 0.0;
								var _g = 0;
								var _g1 = this.get_scrollV() - 1;
								while(_g < _g1) {
									var i = _g++;
									scrollY += textEngine.lineHeights.get(i);
								}
								openfl_display__$internal_CanvasTextField.context.beginPath();
								var tmp = StringTools.hex(this.get_defaultTextFormat().color & 16777215,6);
								openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
								openfl_display__$internal_CanvasTextField.context.moveTo(scrollX + 2.5,scrollY + 2.5);
								openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
								openfl_display__$internal_CanvasTextField.context.lineTo(scrollX + 2.5,scrollY + openfl_text__$internal_TextEngine.getFormatHeight(this.get_defaultTextFormat()) - 1);
								openfl_display__$internal_CanvasTextField.context.stroke();
								openfl_display__$internal_CanvasTextField.context.closePath();
							}
						}
						graphics.__bitmap = openfl_display_BitmapData.fromCanvas(this.__graphics.__canvas);
						graphics.__visible = true;
						this.__dirty = false;
						graphics.__softwareDirty = false;
						graphics.set___dirty(false);
					}
				}
				var smoothingEnabled = false;
				if(this.__textEngine.antiAliasType == 0 && this.__textEngine.gridFitType == 1) {
					smoothingEnabled = renderer.context.imageSmoothingEnabled;
					if(smoothingEnabled) {
						renderer.context.imageSmoothingEnabled = false;
					}
				}
				if(!(this.opaqueBackground == null && this.__graphics == null)) {
					if(this.__renderable) {
						var alpha = renderer.__getAlpha(this.__worldAlpha);
						if(!(alpha <= 0)) {
							if(this.opaqueBackground != null && !this.__isCacheBitmapRender && this.get_width() > 0 && this.get_height() > 0) {
								renderer.__setBlendMode(this.__worldBlendMode);
								renderer.__pushMaskObject(this);
								var context = renderer.context;
								renderer.setTransform(this.__renderTransform,context);
								var color = this.opaqueBackground;
								context.fillStyle = "rgb(" + (color >>> 16 & 255) + "," + (color >>> 8 & 255) + "," + (color & 255) + ")";
								context.fillRect(0,0,this.get_width(),this.get_height());
								renderer.__popMaskObject(this);
							}
							if(this.__graphics != null) {
								if(this.__renderable) {
									var alpha = renderer.__getAlpha(this.__worldAlpha);
									if(!(alpha <= 0)) {
										var graphics = this.__graphics;
										if(graphics != null) {
											openfl_display__$internal_CanvasGraphics.render(graphics,renderer);
											var width = graphics.__width;
											var height = graphics.__height;
											var canvas = graphics.__canvas;
											if(canvas != null && graphics.__visible && width >= 1 && height >= 1) {
												var transform = graphics.__worldTransform;
												var context = renderer.context;
												var scrollRect = this.__scrollRect;
												var scale9Grid = this.__worldScale9Grid;
												if(scrollRect == null || scrollRect.width > 0 && scrollRect.height > 0) {
													renderer.__setBlendMode(this.__worldBlendMode);
													renderer.__pushMaskObject(this);
													context.globalAlpha = alpha;
													if(scale9Grid != null && transform.b == 0 && transform.c == 0) {
														context.setTransform(1,0,0,1,transform.tx,transform.ty);
														var bounds = graphics.__bounds;
														var scaleX = graphics.__renderTransform.a;
														var scaleY = graphics.__renderTransform.d;
														var renderScaleX = transform.a;
														var renderScaleY = transform.d;
														var left = Math.max(1,Math.round(scale9Grid.x * scaleX));
														var top = Math.round(scale9Grid.y * scaleY);
														var right = Math.max(1,Math.round((bounds.get_right() - scale9Grid.get_right()) * scaleX));
														var bottom = Math.round((bounds.get_bottom() - scale9Grid.get_bottom()) * scaleY);
														var centerWidth = Math.round(scale9Grid.width * scaleX);
														var centerHeight = Math.round(scale9Grid.height * scaleY);
														var renderLeft = Math.round(scale9Grid.x * renderScaleX);
														var renderTop = Math.round(scale9Grid.y * renderScaleY);
														var renderRight = Math.round((bounds.get_right() - scale9Grid.get_right()) * renderScaleX);
														var renderBottom = Math.round((bounds.get_bottom() - scale9Grid.get_bottom()) * renderScaleY);
														var renderCenterWidth = Math.round(width * renderScaleX) - renderLeft - renderRight;
														var renderCenterHeight = Math.round(height * renderScaleY) - renderTop - renderBottom;
														renderer.applySmoothing(context,false);
														if(centerWidth != 0 && centerHeight != 0) {
															context.drawImage(canvas,0,0,left,top,0,0,renderLeft,renderTop);
															context.drawImage(canvas,left,0,centerWidth,top,renderLeft,0,renderCenterWidth,renderTop);
															context.drawImage(canvas,left + centerWidth,0,right,top,renderLeft + renderCenterWidth,0,renderRight,renderTop);
															context.drawImage(canvas,0,top,left,centerHeight,0,renderTop,renderLeft,renderCenterHeight);
															context.drawImage(canvas,left,top,centerWidth,centerHeight,renderLeft,renderTop,renderCenterWidth,renderCenterHeight);
															context.drawImage(canvas,left + centerWidth,top,right,centerHeight,renderLeft + renderCenterWidth,renderTop,renderRight,renderCenterHeight);
															context.drawImage(canvas,0,top + centerHeight,left,bottom,0,renderTop + renderCenterHeight,renderLeft,renderBottom);
															context.drawImage(canvas,left,top + centerHeight,centerWidth,bottom,renderLeft,renderTop + renderCenterHeight,renderCenterWidth,renderBottom);
															context.drawImage(canvas,left + centerWidth,top + centerHeight,right,bottom,renderLeft + renderCenterWidth,renderTop + renderCenterHeight,renderRight,renderBottom);
														} else if(centerWidth == 0 && centerHeight != 0) {
															var renderWidth = renderLeft + renderCenterWidth + renderRight;
															context.drawImage(canvas,0,0,width,top,0,0,renderWidth,renderTop);
															context.drawImage(canvas,0,top,width,centerHeight,0,renderTop,renderWidth,renderCenterHeight);
															context.drawImage(canvas,0,top + centerHeight,width,bottom,0,renderTop + renderCenterHeight,renderWidth,renderBottom);
														} else if(centerHeight == 0 && centerWidth != 0) {
															var renderHeight = renderTop + renderCenterHeight + renderBottom;
															context.drawImage(canvas,0,0,left,height,0,0,renderLeft,renderHeight);
															context.drawImage(canvas,left,0,centerWidth,height,renderLeft,0,renderCenterWidth,renderHeight);
															context.drawImage(canvas,left + centerWidth,0,right,height,renderLeft + renderCenterWidth,0,renderRight,renderHeight);
														}
													} else {
														renderer.setTransform(transform,context);
														if(renderer.__isDOM) {
															var reverseScale = 1 / renderer.pixelRatio;
															context.scale(reverseScale,reverseScale);
														}
														context.drawImage(canvas,0,0,width,height);
													}
													renderer.__popMaskObject(this);
												}
											}
										}
									}
								}
							}
						}
					}
				}
				if(smoothingEnabled) {
					renderer.context.imageSmoothingEnabled = true;
				}
			}
		}
	}
	,__renderDOM: function(renderer) {
		this.__domRender = true;
		this.__updateCacheBitmap(renderer,this.__forceCachedBitmapUpdate);
		this.__forceCachedBitmapUpdate = false;
		this.__domRender = false;
		if(this.__cacheBitmap != null && !this.__isCacheBitmapRender) {
			this.__renderDOMClear(renderer);
			this.__cacheBitmap.stage = this.stage;
			var bitmap = this.__cacheBitmap;
			if(bitmap.stage != null && bitmap.__worldVisible && bitmap.__renderable && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) {
				renderer.__pushMaskObject(bitmap);
				if(bitmap.__bitmapData.image.buffer.__srcImage != null) {
					openfl_display__$internal_DOMBitmap.renderImage(bitmap,renderer);
				} else {
					openfl_display__$internal_DOMBitmap.renderCanvas(bitmap,renderer);
				}
				renderer.__popMaskObject(bitmap);
			} else {
				openfl_display__$internal_DOMBitmap.clear(bitmap,renderer);
			}
		} else {
			if(this.__renderedOnCanvasWhileOnDOM) {
				this.__renderedOnCanvasWhileOnDOM = false;
				if(this.__isHTML && this.__rawHtmlText != null) {
					this.__updateText(this.__rawHtmlText);
					this.__dirty = true;
					this.__layoutDirty = true;
					if(!this.__renderDirty) {
						this.__renderDirty = true;
						this.__setParentRenderDirty();
					}
				}
			}
			var textField = this;
			var textEngine = textField.__textEngine;
			if(textField.stage != null && textField.__worldVisible && textField.__renderable) {
				if(textField.__dirty || textField.__renderTransformChanged || textField.__div == null) {
					if(textEngine.text != "" || textEngine.background || textEngine.border || textEngine.type == 1) {
						if(textField.__div == null) {
							textField.__div = window.document.createElement("div");
							renderer.__initializeElement(textField,textField.__div);
							textField.__style.setProperty("outline","none",null);
							textField.__div.addEventListener("input",function(event) {
								event.preventDefault();
								if(textField.get_htmlText() != textField.__div.innerHTML) {
									textField.set_htmlText(textField.__div.innerHTML);
									var textField1 = textField.__displayAsPassword;
									textField.__dirty = false;
									textField.dispatchEvent(new openfl_events_TextEvent("textInput",false,false,textField.get_htmlText()));
								}
							},true);
						}
						if(!textEngine.wordWrap) {
							textField.__style.setProperty("white-space","nowrap",null);
						} else {
							textField.__style.setProperty("word-wrap","break-word",null);
						}
						textField.__style.setProperty("overflow","hidden",null);
						if(textEngine.selectable) {
							textField.__style.setProperty("cursor","text",null);
							textField.__style.setProperty("-webkit-user-select","text",null);
							textField.__style.setProperty("-moz-user-select","text",null);
							textField.__style.setProperty("-ms-user-select","text",null);
							textField.__style.setProperty("-o-user-select","text",null);
						} else {
							textField.__style.setProperty("cursor","inherit",null);
						}
						var div = textField.__div;
						div.contentEditable = textEngine.type == 1;
						var style = textField.__style;
						if(textEngine.background) {
							style.setProperty("background-color","#" + StringTools.hex(textEngine.backgroundColor & 16777215,6),null);
						} else {
							style.removeProperty("background-color");
						}
						var w = textEngine.width;
						var h = textEngine.height;
						var scale = 1;
						var unscaledSize = textField.__textFormat.size;
						var scaledSize = unscaledSize;
						var t = textField.__renderTransform;
						if(t.a != 1.0 || t.d != 1.0) {
							if(t.a == t.d) {
								scale = t.a;
								t.a = t.d = 1.0;
							} else if(t.a > t.d) {
								scale = t.a;
								t.d /= t.a;
								t.a = 1.0;
							} else {
								scale = t.d;
								t.a /= t.d;
								t.d = 1.0;
							}
							scaledSize *= scale;
							w = Math.ceil(w * scale);
							h = Math.ceil(h * scale);
						}
						textField.__textFormat.size = scaledSize;
						var text = textEngine.text;
						var adjustment = 0;
						if(!textField.__isHTML) {
							text = StringTools.htmlEscape(text);
						} else {
							var matchText = text;
							while(openfl_display__$internal_DOMTextField.__regexFont.match(matchText)) {
								var fontText = openfl_display__$internal_DOMTextField.__regexFont.matched(0);
								var style1 = "";
								if(openfl_display__$internal_DOMTextField.__regexFace.match(fontText)) {
									style1 += "font-family:'" + openfl_display__$internal_DOMTextField.__getAttributeMatch(openfl_display__$internal_DOMTextField.__regexFace) + "';";
								}
								if(openfl_display__$internal_DOMTextField.__regexColor.match(fontText)) {
									style1 += "color:#" + openfl_display__$internal_DOMTextField.__getAttributeMatch(openfl_display__$internal_DOMTextField.__regexColor) + ";";
								}
								if(openfl_display__$internal_DOMTextField.__regexSize.match(fontText)) {
									var sizeAttr = openfl_display__$internal_DOMTextField.__getAttributeMatch(openfl_display__$internal_DOMTextField.__regexSize);
									var firstChar = HxOverrides.cca(sizeAttr,0);
									var size;
									adjustment = parseFloat(sizeAttr) * scale;
									if(firstChar == 43 || firstChar == 45) {
										size = scaledSize + adjustment;
									} else {
										size = adjustment;
									}
									style1 += "font-size:" + size + "px;";
								}
								text = StringTools.replace(text,fontText,"<span style='" + style1 + "'>");
								matchText = openfl_display__$internal_DOMTextField.__regexFont.matchedRight();
							}
							text = text.replace(openfl_display__$internal_DOMTextField.__regexCloseFont.r,"</span>");
						}
						text = StringTools.replace(text,"<p ","<p style='margin-top:0; margin-bottom:0;' ");
						var unscaledLeading = textField.__textFormat.leading;
						textField.__textFormat.leading += adjustment | 0;
						var _this_r = new RegExp("\r\n","g".split("u").join(""));
						var tmp = text.replace(_this_r,"<br>");
						textField.__div.innerHTML = tmp;
						var _this_r = new RegExp("\n","g".split("u").join(""));
						var tmp = textField.__div.innerHTML.replace(_this_r,"<br>");
						textField.__div.innerHTML = tmp;
						var _this_r = new RegExp("\r","g".split("u").join(""));
						var tmp = textField.__div.innerHTML.replace(_this_r,"<br>");
						textField.__div.innerHTML = tmp;
						style.setProperty("font",openfl_text__$internal_TextEngine.getFont(textField.__textFormat),null);
						textField.__textFormat.size = unscaledSize;
						textField.__textFormat.leading = unscaledLeading;
						style.setProperty("top","3px",null);
						if(textEngine.border) {
							style.setProperty("border","solid 1px #" + StringTools.hex(textEngine.borderColor & 16777215,6),null);
							textField.__renderTransform.translate(-1,-1);
							textField.__renderTransformChanged = true;
							textField.__transformDirty = true;
						} else if(style.border != "") {
							style.removeProperty("border");
							textField.__renderTransformChanged = true;
						}
						style.setProperty("color","#" + StringTools.hex(textField.__textFormat.color & 16777215,6),null);
						style.setProperty("width",w + "px",null);
						style.setProperty("height",h + "px",null);
						switch(textField.__textFormat.align) {
						case 0:
							style.setProperty("text-align","center",null);
							break;
						case 4:
							style.setProperty("text-align","right",null);
							break;
						default:
							style.setProperty("text-align","left",null);
						}
						textField.__dirty = false;
					} else if(textField.__div != null) {
						renderer.element.removeChild(textField.__div);
						textField.__div = null;
					}
				}
				if(textField.__div != null) {
					var old = renderer.__roundPixels;
					renderer.__roundPixels = true;
					renderer.__updateClip(textField);
					renderer.__applyStyle(textField,true,true,true);
					renderer.__roundPixels = old;
				}
			} else {
				openfl_display__$internal_DOMTextField.clear(textField,renderer);
			}
		}
		this.__renderEvent(renderer);
	}
	,__renderDOMClear: function(renderer) {
		openfl_display__$internal_DOMTextField.clear(this,renderer);
	}
	,__renderGL: function(renderer) {
		this.__updateCacheBitmap(renderer,false);
		if(this.__cacheBitmap != null && !this.__isCacheBitmapRender) {
			openfl_display__$internal_Context3DBitmap.render(this.__cacheBitmap,renderer);
		} else {
			openfl_display__$internal_Context3DTextField.render(this,renderer);
			if(!(this.opaqueBackground == null && this.__graphics == null)) {
				if(!(!this.__renderable || this.__worldAlpha <= 0)) {
					if(this.opaqueBackground != null && !this.__isCacheBitmapRender && this.get_width() > 0 && this.get_height() > 0) {
						renderer.__setBlendMode(this.__worldBlendMode);
						renderer.__pushMaskObject(this);
						var context = renderer.__context3D;
						var rect = openfl_geom_Rectangle.__pool.get();
						rect.setTo(0,0,this.get_width(),this.get_height());
						renderer.__pushMaskRect(rect,this.__renderTransform);
						var color = this.opaqueBackground;
						context.clear((color >>> 16 & 255) / 255,(color >>> 8 & 255) / 255,(color & 255) / 255,1,0,0,1);
						renderer.__popMaskRect();
						renderer.__popMaskObject(this);
						openfl_geom_Rectangle.__pool.release(rect);
					}
					if(this.__graphics != null) {
						openfl_display__$internal_Context3DShape.render(this,renderer);
					}
				}
			}
		}
		this.__renderEvent(renderer);
	}
	,__renderGLMask: function(renderer) {
		openfl_display__$internal_Context3DTextField.renderMask(this,renderer);
		openfl_display_InteractiveObject.prototype.__renderGLMask.call(this,renderer);
	}
	,__replaceSelectedText: function(value,restrict) {
		if(restrict == null) {
			restrict = true;
		}
		if(value == null) {
			value = "";
		}
		if(value == "" && this.__selectionIndex == this.__caretIndex) {
			return;
		}
		var startIndex = this.__caretIndex < this.__selectionIndex ? this.__caretIndex : this.__selectionIndex;
		var endIndex = this.__caretIndex > this.__selectionIndex ? this.__caretIndex : this.__selectionIndex;
		if(startIndex == endIndex && this.__textEngine.maxChars > 0 && this.__text.length == this.__textEngine.maxChars) {
			return;
		}
		if(startIndex > this.__text.length) {
			startIndex = this.__text.length;
		}
		if(endIndex > this.__text.length) {
			endIndex = this.__text.length;
		}
		if(endIndex < startIndex) {
			var cache = endIndex;
			endIndex = startIndex;
			startIndex = cache;
		}
		if(startIndex < 0) {
			startIndex = 0;
		}
		this.__replaceText(startIndex,endIndex,value,restrict);
		var i = startIndex + (js_Boot.__cast(value , String)).length;
		if(i > this.__text.length) {
			i = this.__text.length;
		}
		this.setSelection(i,i);
		this.__updateScrollH();
	}
	,__replaceText: function(beginIndex,endIndex,newText,restrict) {
		if(endIndex < beginIndex || beginIndex < 0 || endIndex > this.__text.length || newText == null) {
			return;
		}
		if(restrict) {
			newText = this.__textEngine.restrictText(newText);
			if(this.__textEngine.maxChars > 0) {
				var removeLength = endIndex - beginIndex;
				var maxLength = this.__textEngine.maxChars - this.__text.length + removeLength;
				if(maxLength <= 0) {
					newText = "";
				} else if(maxLength < newText.length) {
					newText = HxOverrides.substr(newText,0,maxLength);
				}
			}
		}
		this.__updateText(this.__text.substring(0,beginIndex) + newText + this.__text.substring(endIndex));
		if(endIndex > this.__text.length) {
			endIndex = this.__text.length;
		}
		var offset = newText.length - (endIndex - beginIndex);
		var i = 0;
		var range;
		while(i < this.__textEngine.textFormatRanges.get_length()) {
			range = this.__textEngine.textFormatRanges.get(i);
			if(range.start <= beginIndex && range.end >= endIndex) {
				range.end += offset;
				++i;
			} else if(range.start >= beginIndex && range.end <= endIndex) {
				if(i > 0) {
					this.__textEngine.textFormatRanges.splice(i,1);
				} else {
					range.start = 0;
					range.end = beginIndex + newText.length;
					++i;
				}
				offset -= range.end - range.start;
			} else if(range.start > beginIndex && range.start <= endIndex) {
				range.start += offset;
				++i;
			} else {
				++i;
			}
		}
		this.__updateScrollV();
		this.__updateScrollH();
		this.__dirty = true;
		this.__layoutDirty = true;
		if(!this.__renderDirty) {
			this.__renderDirty = true;
			this.__setParentRenderDirty();
		}
	}
	,__shouldCacheHardware: function(value) {
		if(value == true) {
			return true;
		} else {
			return false;
		}
	}
	,__startCursorTimer: function() {
		this.__cursorTimer = haxe_Timer.delay($bind(this,this.__startCursorTimer),600);
		this.__showCursor = !this.__showCursor;
		this.__dirty = true;
		if(!this.__renderDirty) {
			this.__renderDirty = true;
			this.__setParentRenderDirty();
		}
	}
	,__startTextInput: function() {
		if(this.__caretIndex < 0) {
			this.__caretIndex = this.__text.length;
			this.__selectionIndex = this.__caretIndex;
		}
		var enableInput = openfl_display_DisplayObject.__supportDOM ? this.__renderedOnCanvasWhileOnDOM : true;
		if(enableInput) {
			this.__enableInput();
		}
	}
	,__stopCursorTimer: function() {
		if(this.__cursorTimer != null) {
			this.__cursorTimer.stop();
			this.__cursorTimer = null;
		}
		if(this.__showCursor) {
			this.__showCursor = false;
			this.__dirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
	}
	,__stopTextInput: function() {
		var disableInput = openfl_display_DisplayObject.__supportDOM ? this.__renderedOnCanvasWhileOnDOM : true;
		if(disableInput) {
			this.__disableInput();
		}
	}
	,__updateCacheBitmap: function(renderer,force) {
		if(this.__filters == null && renderer.__type == "opengl" && this.__cacheBitmap == null && !this.__domRender) {
			return false;
		}
		if(force) {
			this.__renderDirty = true;
		}
		if(openfl_display_InteractiveObject.prototype.__updateCacheBitmap.call(this,renderer,force || this.__dirty)) {
			if(this.__cacheBitmap != null) {
				this.__cacheBitmap.__renderTransform.tx -= this.__offsetX;
				this.__cacheBitmap.__renderTransform.ty -= this.__offsetY;
			}
			return true;
		}
		return false;
	}
	,__updateLayout: function() {
		if(this.__layoutDirty) {
			var cacheWidth = this.__textEngine.width;
			this.__textEngine.update();
			if(this.__textEngine.autoSize != 2) {
				if(this.__textEngine.width != cacheWidth) {
					switch(this.__textEngine.autoSize) {
					case 0:
						var _g = this;
						_g.set_x(_g.get_x() + (cacheWidth - this.__textEngine.width) / 2);
						break;
					case 3:
						var _g = this;
						_g.set_x(_g.get_x() + (cacheWidth - this.__textEngine.width));
						break;
					default:
					}
				}
				this.__textEngine.getBounds();
			}
			this.__layoutDirty = false;
		}
	}
	,__updateScrollH: function() {
		if(!this.get_multiline() && this.get_type() == 1) {
			this.__layoutDirty = true;
			this.__updateLayout();
			var offsetX = this.__textEngine.textWidth - this.__textEngine.width + 4;
			if(offsetX > 0) {
				if(this.__caretIndex >= this.get_text().length) {
					this.set_scrollH(Math.ceil(offsetX));
				} else {
					var caret = openfl_geom_Rectangle.__pool.get();
					this.__getCharBoundaries(this.__caretIndex,caret);
					if(caret.x < this.get_scrollH()) {
						this.set_scrollH(Math.floor(caret.x - 2));
					} else if(caret.x > this.get_scrollH() + this.__textEngine.width) {
						this.set_scrollH(Math.ceil(caret.x - this.__textEngine.width - 2));
					}
					openfl_geom_Rectangle.__pool.release(caret);
				}
			} else {
				this.set_scrollH(0);
			}
		}
	}
	,__updateScrollV: function() {
		this.__layoutDirty = true;
		this.__updateLayout();
		var lineIndex = this.getLineIndexOfChar(this.__caretIndex);
		if(lineIndex == -1 && this.__caretIndex > 0) {
			lineIndex = this.getLineIndexOfChar(this.__caretIndex - 1) + 1;
		}
		if(lineIndex + 1 < this.get_scrollV()) {
			this.set_scrollV(lineIndex + 1);
		} else if(lineIndex + 1 > this.get_bottomScrollV()) {
			var i = lineIndex;
			var tempHeight = 0.0;
			while(i >= 0) if(tempHeight + this.__textEngine.lineHeights.get(i) <= this.get_height() - 4) {
				tempHeight += this.__textEngine.lineHeights.get(i);
				--i;
			} else {
				break;
			}
			this.set_scrollV(i + 2);
		} else {
			this.set_scrollV(this.get_scrollV());
		}
	}
	,__updateText: function(value) {
		if(openfl_display_DisplayObject.__supportDOM && this.__renderedOnCanvasWhileOnDOM) {
			this.__forceCachedBitmapUpdate = this.__text != value;
		}
		this.__textEngine.set_text(value);
		this.__text = this.__textEngine.text;
		if(this.__text.length < this.__caretIndex) {
			this.__selectionIndex = this.__caretIndex = this.__text.length;
		}
		if(!this.__displayAsPassword || openfl_display_DisplayObject.__supportDOM && !this.__renderedOnCanvasWhileOnDOM) {
			this.__textEngine.set_text(this.__text);
		} else {
			var length = this.get_text().length;
			var mask = "";
			var _g = 0;
			var _g1 = length;
			while(_g < _g1) {
				var i = _g++;
				mask += "*";
			}
			this.__textEngine.set_text(mask);
		}
	}
	,__updateTransforms: function(overrideTransform) {
		openfl_display_InteractiveObject.prototype.__updateTransforms.call(this,overrideTransform);
		var _this = this.__renderTransform;
		var px = this.__offsetX;
		var py = this.__offsetY;
		_this.tx = px * _this.a + py * _this.c + _this.tx;
		_this.ty = px * _this.b + py * _this.d + _this.ty;
	}
	,get_antiAliasType: function() {
		return this.__textEngine.antiAliasType;
	}
	,set_antiAliasType: function(value) {
		var tmp = value != this.__textEngine.antiAliasType;
		return this.__textEngine.antiAliasType = value;
	}
	,get_autoSize: function() {
		return this.__textEngine.autoSize;
	}
	,set_autoSize: function(value) {
		if(value != this.__textEngine.autoSize) {
			this.__dirty = true;
			this.__layoutDirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__textEngine.autoSize = value;
	}
	,get_background: function() {
		return this.__textEngine.background;
	}
	,set_background: function(value) {
		if(value != this.__textEngine.background) {
			this.__dirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__textEngine.background = value;
	}
	,get_backgroundColor: function() {
		return this.__textEngine.backgroundColor;
	}
	,set_backgroundColor: function(value) {
		if(value != this.__textEngine.backgroundColor) {
			this.__dirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__textEngine.backgroundColor = value;
	}
	,get_border: function() {
		return this.__textEngine.border;
	}
	,set_border: function(value) {
		if(value != this.__textEngine.border) {
			this.__dirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__textEngine.border = value;
	}
	,get_borderColor: function() {
		return this.__textEngine.borderColor;
	}
	,set_borderColor: function(value) {
		if(value != this.__textEngine.borderColor) {
			this.__dirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__textEngine.borderColor = value;
	}
	,get_bottomScrollV: function() {
		this.__updateLayout();
		return this.__textEngine.get_bottomScrollV();
	}
	,get_caretIndex: function() {
		return this.__caretIndex;
	}
	,get_defaultTextFormat: function() {
		return this.__textFormat.clone();
	}
	,set_defaultTextFormat: function(value) {
		this.__textFormat.__merge(value);
		this.__layoutDirty = true;
		this.__dirty = true;
		if(!this.__renderDirty) {
			this.__renderDirty = true;
			this.__setParentRenderDirty();
		}
		return value;
	}
	,get_displayAsPassword: function() {
		return this.__displayAsPassword;
	}
	,set_displayAsPassword: function(value) {
		if(value != this.__displayAsPassword) {
			this.__dirty = true;
			this.__layoutDirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
			this.__displayAsPassword = value;
			this.__updateText(this.__text);
		}
		return value;
	}
	,get_embedFonts: function() {
		return this.__textEngine.embedFonts;
	}
	,set_embedFonts: function(value) {
		return this.__textEngine.embedFonts = value;
	}
	,get_gridFitType: function() {
		return this.__textEngine.gridFitType;
	}
	,set_gridFitType: function(value) {
		return this.__textEngine.gridFitType = value;
	}
	,get_height: function() {
		this.__updateLayout();
		return this.__textEngine.height * Math.abs(this.get_scaleY());
	}
	,set_height: function(value) {
		if(value != this.__textEngine.height) {
			this.__setTransformDirty();
			this.__dirty = true;
			this.__layoutDirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
			this.__textEngine.height = value;
		}
		return this.__textEngine.height * Math.abs(this.get_scaleY());
	}
	,get_htmlText: function() {
		if(this.__isHTML) {
			return this.__rawHtmlText;
		} else {
			return this.__text;
		}
	}
	,set_htmlText: function(value) {
		if(!this.__isHTML || this.__text != value) {
			this.__dirty = true;
			this.__layoutDirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		this.__isHTML = true;
		this.__rawHtmlText = value;
		value = openfl__$internal_formats_html_HTMLParser.parse(value,this.__textFormat,this.__textEngine.textFormatRanges);
		if(openfl_display_DisplayObject.__supportDOM) {
			if(this.__textEngine.textFormatRanges.get_length() > 1) {
				this.__textEngine.textFormatRanges.splice(1,this.__textEngine.textFormatRanges.get_length() - 1);
			}
			var range = this.__textEngine.textFormatRanges.get(0);
			range.format = this.__textFormat;
			range.start = 0;
			if(this.__renderedOnCanvasWhileOnDOM) {
				range.end = value.length;
				this.__updateText(value);
			} else {
				range.end = this.__rawHtmlText.length;
				this.__updateText(this.__rawHtmlText);
			}
		} else {
			this.__updateText(value);
		}
		this.__updateScrollV();
		return value;
	}
	,get_length: function() {
		if(this.__text != null) {
			return this.__text.length;
		}
		return 0;
	}
	,get_maxChars: function() {
		return this.__textEngine.maxChars;
	}
	,set_maxChars: function(value) {
		if(value != this.__textEngine.maxChars) {
			this.__textEngine.maxChars = value;
			this.__dirty = true;
			this.__layoutDirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return value;
	}
	,get_maxScrollH: function() {
		this.__updateLayout();
		return this.__textEngine.maxScrollH;
	}
	,get_maxScrollV: function() {
		this.__updateLayout();
		return this.__textEngine.get_maxScrollV();
	}
	,get_mouseWheelEnabled: function() {
		return this.__mouseWheelEnabled;
	}
	,set_mouseWheelEnabled: function(value) {
		return this.__mouseWheelEnabled = value;
	}
	,get_multiline: function() {
		return this.__textEngine.multiline;
	}
	,set_multiline: function(value) {
		if(value != this.__textEngine.multiline) {
			this.__dirty = true;
			this.__layoutDirty = true;
			this.__updateText(this.__text);
			this.__updateScrollH();
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__textEngine.multiline = value;
	}
	,get_numLines: function() {
		this.__updateLayout();
		return this.__textEngine.numLines;
	}
	,get_restrict: function() {
		return this.__textEngine.restrict;
	}
	,set_restrict: function(value) {
		if(this.__textEngine.restrict != value) {
			this.__textEngine.set_restrict(value);
			this.__updateText(this.__text);
		}
		return value;
	}
	,get_scrollH: function() {
		return this.__textEngine.scrollH;
	}
	,set_scrollH: function(value) {
		this.__updateLayout();
		if(value > this.__textEngine.maxScrollH) {
			value = this.__textEngine.maxScrollH;
		}
		if(value < 0) {
			value = 0;
		}
		if(value != this.__textEngine.scrollH) {
			this.__dirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
			this.__textEngine.scrollH = value;
			this.dispatchEvent(new openfl_events_Event("scroll"));
		}
		return this.__textEngine.scrollH;
	}
	,get_scrollV: function() {
		return this.__textEngine.get_scrollV();
	}
	,set_scrollV: function(value) {
		this.__updateLayout();
		if(value > 0 && value != this.__textEngine.get_scrollV()) {
			this.__dirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
			this.__textEngine.set_scrollV(value);
			this.dispatchEvent(new openfl_events_Event("scroll"));
		}
		return this.__textEngine.get_scrollV();
	}
	,get_selectable: function() {
		return this.__textEngine.selectable;
	}
	,set_selectable: function(value) {
		if(value != this.__textEngine.selectable && this.get_type() == 1) {
			if(this.stage != null && this.stage.get_focus() == this) {
				this.__startTextInput();
			} else if(!value) {
				this.__stopTextInput();
			}
		}
		return this.__textEngine.selectable = value;
	}
	,get_selectionBeginIndex: function() {
		return Math.min(this.__caretIndex,this.__selectionIndex) | 0;
	}
	,get_selectionEndIndex: function() {
		return Math.max(this.__caretIndex,this.__selectionIndex) | 0;
	}
	,get_sharpness: function() {
		return this.__textEngine.sharpness;
	}
	,set_sharpness: function(value) {
		if(value != this.__textEngine.sharpness) {
			this.__dirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__textEngine.sharpness = value;
	}
	,get_tabEnabled: function() {
		if(this.__tabEnabled == null) {
			return this.__textEngine.type == 1;
		} else {
			return this.__tabEnabled;
		}
	}
	,get_text: function() {
		return this.__text;
	}
	,set_text: function(value) {
		if(this.__isHTML || this.__text != value) {
			this.__dirty = true;
			this.__layoutDirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		} else {
			return value;
		}
		if(this.__textEngine.textFormatRanges.get_length() > 1) {
			this.__textEngine.textFormatRanges.splice(1,this.__textEngine.textFormatRanges.get_length() - 1);
		}
		var utfValue = value;
		var range = this.__textEngine.textFormatRanges.get(0);
		range.format = this.__textFormat;
		range.start = 0;
		range.end = utfValue.length;
		this.__isHTML = false;
		this.__updateText(value);
		this.__updateScrollV();
		return value;
	}
	,get_textColor: function() {
		return this.__textFormat.color;
	}
	,set_textColor: function(value) {
		if(value != this.__textFormat.color) {
			this.__dirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		var range = this.__textEngine.textFormatRanges.iterator();
		while(range.hasNext()) {
			var range1 = range.next();
			range1.format.color = value;
		}
		return this.__textFormat.color = value;
	}
	,get_textWidth: function() {
		this.__updateLayout();
		return this.__textEngine.textWidth;
	}
	,get_textHeight: function() {
		this.__updateLayout();
		return this.__textEngine.textHeight;
	}
	,get_type: function() {
		return this.__textEngine.type;
	}
	,set_type: function(value) {
		if(value != this.__textEngine.type) {
			if(value == 1) {
				this.addEventListener("addedToStage",$bind(this,this.this_onAddedToStage));
				this.this_onFocusIn(null);
				this.__textEngine.__useIntAdvances = true;
			} else {
				this.removeEventListener("addedToStage",$bind(this,this.this_onAddedToStage));
				this.__stopTextInput();
				this.__textEngine.__useIntAdvances = null;
			}
			this.__dirty = true;
			this.__layoutDirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__textEngine.type = value;
	}
	,get_width: function() {
		this.__updateLayout();
		return this.__textEngine.width * Math.abs(this.__scaleX);
	}
	,set_width: function(value) {
		if(value != this.__textEngine.width) {
			this.__setTransformDirty();
			this.__dirty = true;
			this.__layoutDirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
			this.__textEngine.width = value;
		}
		return this.__textEngine.width * Math.abs(this.__scaleX);
	}
	,get_wordWrap: function() {
		return this.__textEngine.wordWrap;
	}
	,set_wordWrap: function(value) {
		if(value != this.__textEngine.wordWrap) {
			this.__dirty = true;
			this.__layoutDirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__textEngine.wordWrap = value;
	}
	,get_x: function() {
		return this.__transform.tx + this.__offsetX;
	}
	,set_x: function(value) {
		if(value != this.__transform.tx + this.__offsetX) {
			this.__setTransformDirty();
		}
		return this.__transform.tx = value - this.__offsetX;
	}
	,get_y: function() {
		return this.__transform.ty + this.__offsetY;
	}
	,set_y: function(value) {
		if(value != this.__transform.ty + this.__offsetY) {
			this.__setTransformDirty();
		}
		return this.__transform.ty = value - this.__offsetY;
	}
	,stage_onMouseMove: function(event) {
		if(this.stage == null) {
			return;
		}
		if(this.get_selectable() && this.__selectionIndex >= 0) {
			this.__updateLayout();
			var position = this.__getPosition(this.get_mouseX() + this.get_scrollH(),this.get_mouseY());
			if(position != this.__caretIndex) {
				this.__caretIndex = position;
				var setDirty = true;
				if(openfl_display_DisplayObject.__supportDOM) {
					if(this.__renderedOnCanvasWhileOnDOM) {
						this.__forceCachedBitmapUpdate = true;
					}
					setDirty = false;
				}
				if(setDirty) {
					this.__dirty = true;
					if(!this.__renderDirty) {
						this.__renderDirty = true;
						this.__setParentRenderDirty();
					}
				}
			}
		}
	}
	,stage_onMouseUp: function(event) {
		if(this.stage == null) {
			return;
		}
		this.stage.removeEventListener("mouseMove",$bind(this,this.stage_onMouseMove));
		this.stage.removeEventListener("mouseUp",$bind(this,this.stage_onMouseUp));
		if(this.stage.get_focus() == this) {
			this.__getWorldTransform();
			this.__updateLayout();
			var upPos = this.__getPosition(this.get_mouseX() + this.get_scrollH(),this.get_mouseY());
			var leftPos = Math.min(this.__selectionIndex,upPos) | 0;
			var rightPos = Math.max(this.__selectionIndex,upPos) | 0;
			this.__selectionIndex = leftPos;
			this.__caretIndex = rightPos;
			if(this.__inputEnabled) {
				this.this_onFocusIn(null);
				this.__stopCursorTimer();
				this.__startCursorTimer();
				if(openfl_display_DisplayObject.__supportDOM && this.__renderedOnCanvasWhileOnDOM) {
					this.__forceCachedBitmapUpdate = true;
				}
			}
		}
	}
	,this_onAddedToStage: function(event) {
		this.this_onFocusIn(null);
	}
	,this_onFocusIn: function(event) {
		if(this.get_type() == 1 && this.stage != null && this.stage.get_focus() == this) {
			this.__startTextInput();
		}
	}
	,this_onFocusOut: function(event) {
		this.__stopCursorTimer();
		if(event.relatedObject == null || !((event.relatedObject) instanceof openfl_text_TextField)) {
			this.__stopTextInput();
		} else {
			if(this.stage != null) {
				this.stage.window.onTextInput.remove($bind(this,this.window_onTextInput));
				this.stage.window.onKeyDown.remove($bind(this,this.window_onKeyDown));
			}
			this.__inputEnabled = false;
		}
		if(this.__selectionIndex != this.__caretIndex) {
			this.__selectionIndex = this.__caretIndex;
			this.__dirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
	}
	,this_onKeyDown: function(event) {
		if(this.get_selectable() && this.get_type() != 1 && event.keyCode == 67 && (event.commandKey || event.ctrlKey)) {
			if(this.__caretIndex != this.__selectionIndex) {
				lime_system_Clipboard.set_text(this.__text.substring(this.__caretIndex,this.__selectionIndex));
			}
		}
	}
	,this_onMouseDown: function(event) {
		if(!this.get_selectable() && this.get_type() != 1) {
			return;
		}
		this.__updateLayout();
		this.__caretIndex = this.__getPosition(this.get_mouseX() + this.get_scrollH(),this.get_mouseY());
		this.__selectionIndex = this.__caretIndex;
		if(!openfl_display_DisplayObject.__supportDOM) {
			this.__dirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		this.stage.addEventListener("mouseMove",$bind(this,this.stage_onMouseMove));
		this.stage.addEventListener("mouseUp",$bind(this,this.stage_onMouseUp));
	}
	,this_onMouseWheel: function(event) {
		if(this.get_mouseWheelEnabled()) {
			var _g = this;
			_g.set_scrollV(_g.get_scrollV() - event.delta);
		}
	}
	,this_onDoubleClick: function(event) {
		if(this.get_selectable()) {
			this.__updateLayout();
			var delimiters = ["\n",".","!","?",","," ",";",":","(",")","-","_","/"];
			var txtStr = this.__text;
			var leftPos = -1;
			var rightPos = txtStr.length;
			var pos = 0;
			var startPos = Math.max(this.__caretIndex,1) | 0;
			if(txtStr.length > 0 && this.__caretIndex >= 0 && rightPos >= this.__caretIndex) {
				var _g = 0;
				while(_g < delimiters.length) {
					var c = delimiters[_g];
					++_g;
					pos = txtStr.lastIndexOf(c,startPos - 1);
					if(pos > leftPos) {
						leftPos = pos + 1;
					}
					pos = txtStr.indexOf(c,startPos);
					if(pos < rightPos && pos != -1) {
						rightPos = pos;
					}
				}
				if(leftPos != rightPos) {
					this.setSelection(leftPos,rightPos);
					var setDirty = true;
					if(openfl_display_DisplayObject.__supportDOM) {
						if(this.__renderedOnCanvasWhileOnDOM) {
							this.__forceCachedBitmapUpdate = true;
						}
						setDirty = false;
					}
					if(setDirty) {
						this.__dirty = true;
						if(!this.__renderDirty) {
							this.__renderDirty = true;
							this.__setParentRenderDirty();
						}
					}
				}
			}
		}
	}
	,window_onKeyDown: function(key,modifier) {
		switch(key) {
		case 8:
			if(this.__selectionIndex == this.__caretIndex && this.__caretIndex > 0) {
				this.__selectionIndex = this.__caretIndex - 1;
			}
			if(this.__selectionIndex != this.__caretIndex) {
				this.replaceSelectedText("");
				this.__selectionIndex = this.__caretIndex;
				this.dispatchEvent(new openfl_events_Event("change",true));
			}
			break;
		case 97:
			if(this.get_selectable()) {
				if(lime_ui_KeyModifier.get_metaKey(modifier) || lime_ui_KeyModifier.get_ctrlKey(modifier)) {
					this.__caretIndex = this.__text.length;
					this.__selectionIndex = 0;
				}
			}
			break;
		case 99:
			if(lime_ui_KeyModifier.get_metaKey(modifier) || lime_ui_KeyModifier.get_ctrlKey(modifier)) {
				if(this.__caretIndex != this.__selectionIndex) {
					lime_system_Clipboard.set_text(this.__text.substring(this.__caretIndex,this.__selectionIndex));
				}
			}
			break;
		case 120:
			if(lime_ui_KeyModifier.get_metaKey(modifier) || lime_ui_KeyModifier.get_ctrlKey(modifier)) {
				if(this.__caretIndex != this.__selectionIndex) {
					lime_system_Clipboard.set_text(this.__text.substring(this.__caretIndex,this.__selectionIndex));
					this.replaceSelectedText("");
					this.dispatchEvent(new openfl_events_Event("change",true));
				}
			}
			break;
		case 127:
			if(this.__selectionIndex == this.__caretIndex && this.__caretIndex < this.__text.length) {
				this.__selectionIndex = this.__caretIndex + 1;
			}
			if(this.__selectionIndex != this.__caretIndex) {
				this.replaceSelectedText("");
				this.__selectionIndex = this.__caretIndex;
				this.dispatchEvent(new openfl_events_Event("change",true));
			}
			break;
		case 1073741898:
			if(this.get_selectable()) {
				this.__caretBeginningOfLine();
				this.__stopCursorTimer();
				this.__startCursorTimer();
			}
			break;
		case 1073741901:
			if(this.get_selectable()) {
				this.__caretEndOfLine();
				this.__stopCursorTimer();
				this.__startCursorTimer();
			}
			break;
		case 1073741903:
			if(this.get_selectable()) {
				if(lime_ui_KeyModifier.get_metaKey(modifier)) {
					this.__caretEndOfLine();
					if(!lime_ui_KeyModifier.get_shiftKey(modifier)) {
						this.__selectionIndex = this.__caretIndex;
					}
				} else if(lime_ui_KeyModifier.get_shiftKey(modifier)) {
					this.__caretNextCharacter();
				} else {
					if(this.__selectionIndex == this.__caretIndex) {
						this.__caretNextCharacter();
					} else {
						this.__caretIndex = Math.max(this.__caretIndex,this.__selectionIndex) | 0;
					}
					this.__selectionIndex = this.__caretIndex;
				}
				this.__updateScrollH();
				this.__updateScrollV();
				this.__stopCursorTimer();
				this.__startCursorTimer();
			}
			break;
		case 1073741904:
			if(this.get_selectable()) {
				if(lime_ui_KeyModifier.get_metaKey(modifier)) {
					this.__caretBeginningOfLine();
					if(!lime_ui_KeyModifier.get_shiftKey(modifier)) {
						this.__selectionIndex = this.__caretIndex;
					}
				} else if(lime_ui_KeyModifier.get_shiftKey(modifier)) {
					this.__caretPreviousCharacter();
				} else {
					if(this.__selectionIndex == this.__caretIndex) {
						this.__caretPreviousCharacter();
					} else {
						this.__caretIndex = Math.min(this.__caretIndex,this.__selectionIndex) | 0;
					}
					this.__selectionIndex = this.__caretIndex;
				}
				this.__updateScrollH();
				this.__updateScrollV();
				this.__stopCursorTimer();
				this.__startCursorTimer();
			}
			break;
		case 1073741905:
			if(this.get_selectable()) {
				if(!this.__textEngine.multiline) {
					return;
				}
				if(lime_ui_KeyModifier.get_shiftKey(modifier)) {
					this.__caretNextLine();
				} else {
					if(this.__selectionIndex == this.__caretIndex) {
						this.__caretNextLine();
					} else {
						var lineIndex = this.getLineIndexOfChar(Math.max(this.__caretIndex,this.__selectionIndex) | 0);
						this.__caretNextLine(lineIndex,Math.min(this.__caretIndex,this.__selectionIndex) | 0);
					}
					this.__selectionIndex = this.__caretIndex;
				}
				this.__updateScrollV();
				this.__stopCursorTimer();
				this.__startCursorTimer();
			}
			break;
		case 1073741906:
			if(this.get_selectable()) {
				if(!this.__textEngine.multiline) {
					return;
				}
				if(lime_ui_KeyModifier.get_shiftKey(modifier)) {
					this.__caretPreviousLine();
				} else {
					if(this.__selectionIndex == this.__caretIndex) {
						this.__caretPreviousLine();
					} else {
						var lineIndex = this.getLineIndexOfChar(Math.min(this.__caretIndex,this.__selectionIndex) | 0);
						this.__caretPreviousLine(lineIndex,Math.min(this.__caretIndex,this.__selectionIndex) | 0);
					}
					this.__selectionIndex = this.__caretIndex;
				}
				this.__updateScrollV();
				this.__stopCursorTimer();
				this.__startCursorTimer();
			}
			break;
		case 13:case 1073741912:
			if(this.__textEngine.multiline) {
				var te = new openfl_events_TextEvent("textInput",true,true,"\n");
				this.dispatchEvent(te);
				if(!te.isDefaultPrevented()) {
					this.__replaceSelectedText("\n",true);
					this.dispatchEvent(new openfl_events_Event("change",true));
				}
			}
			break;
		default:
		}
	}
	,window_onTextInput: function(value) {
		this.__replaceSelectedText(value,true);
		this.dispatchEvent(new openfl_events_Event("change",true));
	}
	,__class__: openfl_text_TextField
	,__properties__: $extend(openfl_display_InteractiveObject.prototype.__properties__,{set_wordWrap:"set_wordWrap",get_wordWrap:"get_wordWrap",set_type:"set_type",get_type:"get_type",get_textWidth:"get_textWidth",get_textHeight:"get_textHeight",set_textColor:"set_textColor",get_textColor:"get_textColor",set_text:"set_text",get_text:"get_text",set_sharpness:"set_sharpness",get_sharpness:"get_sharpness",get_selectionEndIndex:"get_selectionEndIndex",get_selectionBeginIndex:"get_selectionBeginIndex",set_selectable:"set_selectable",get_selectable:"get_selectable",set_scrollV:"set_scrollV",get_scrollV:"get_scrollV",set_scrollH:"set_scrollH",get_scrollH:"get_scrollH",set_restrict:"set_restrict",get_restrict:"get_restrict",get_numLines:"get_numLines",set_multiline:"set_multiline",get_multiline:"get_multiline",set_mouseWheelEnabled:"set_mouseWheelEnabled",get_mouseWheelEnabled:"get_mouseWheelEnabled",get_maxScrollV:"get_maxScrollV",get_maxScrollH:"get_maxScrollH",set_maxChars:"set_maxChars",get_maxChars:"get_maxChars",get_length:"get_length",set_htmlText:"set_htmlText",get_htmlText:"get_htmlText",set_gridFitType:"set_gridFitType",get_gridFitType:"get_gridFitType",set_embedFonts:"set_embedFonts",get_embedFonts:"get_embedFonts",set_displayAsPassword:"set_displayAsPassword",get_displayAsPassword:"get_displayAsPassword",set_defaultTextFormat:"set_defaultTextFormat",get_defaultTextFormat:"get_defaultTextFormat",get_caretIndex:"get_caretIndex",get_bottomScrollV:"get_bottomScrollV",set_borderColor:"set_borderColor",get_borderColor:"get_borderColor",set_border:"set_border",get_border:"get_border",set_backgroundColor:"set_backgroundColor",get_backgroundColor:"get_backgroundColor",set_background:"set_background",get_background:"get_background",set_autoSize:"set_autoSize",get_autoSize:"get_autoSize",set_antiAliasType:"set_antiAliasType",get_antiAliasType:"get_antiAliasType"})
});
var openfl_text_TextFieldAutoSize = {};
openfl_text_TextFieldAutoSize.fromString = function(value) {
	switch(value) {
	case "center":
		return 0;
	case "left":
		return 1;
	case "none":
		return 2;
	case "right":
		return 3;
	default:
		return null;
	}
};
openfl_text_TextFieldAutoSize.toString = function(this1) {
	switch(this1) {
	case 0:
		return "center";
	case 1:
		return "left";
	case 2:
		return "none";
	case 3:
		return "right";
	default:
		return null;
	}
};
var openfl_text_TextFieldType = {};
openfl_text_TextFieldType.fromString = function(value) {
	switch(value) {
	case "dynamic":
		return 0;
	case "input":
		return 1;
	default:
		return null;
	}
};
openfl_text_TextFieldType.toString = function(this1) {
	switch(this1) {
	case 0:
		return "dynamic";
	case 1:
		return "input";
	default:
		return null;
	}
};
var openfl_text_TextFormat = function(font,size,color,bold,italic,underline,url,target,align,leftMargin,rightMargin,indent,leading) {
	this.font = font;
	this.size = size;
	this.color = color;
	this.bold = bold;
	this.italic = italic;
	this.underline = underline;
	this.url = url;
	this.target = target;
	this.align = align;
	this.leftMargin = leftMargin;
	this.rightMargin = rightMargin;
	this.indent = indent;
	this.leading = leading;
};
$hxClasses["openfl.text.TextFormat"] = openfl_text_TextFormat;
openfl_text_TextFormat.__name__ = "openfl.text.TextFormat";
openfl_text_TextFormat.prototype = {
	align: null
	,blockIndent: null
	,bold: null
	,bullet: null
	,color: null
	,font: null
	,indent: null
	,italic: null
	,kerning: null
	,leading: null
	,leftMargin: null
	,letterSpacing: null
	,rightMargin: null
	,size: null
	,tabStops: null
	,target: null
	,underline: null
	,url: null
	,__ascent: null
	,__descent: null
	,clone: function() {
		var newFormat = new openfl_text_TextFormat(this.font,this.size,this.color,this.bold,this.italic,this.underline,this.url,this.target);
		newFormat.align = this.align;
		newFormat.leftMargin = this.leftMargin;
		newFormat.rightMargin = this.rightMargin;
		newFormat.indent = this.indent;
		newFormat.leading = this.leading;
		newFormat.blockIndent = this.blockIndent;
		newFormat.bullet = this.bullet;
		newFormat.kerning = this.kerning;
		newFormat.letterSpacing = this.letterSpacing;
		newFormat.tabStops = this.tabStops;
		newFormat.__ascent = this.__ascent;
		newFormat.__descent = this.__descent;
		return newFormat;
	}
	,__merge: function(format) {
		if(format.font != null) {
			this.font = format.font;
		}
		if(format.size != null) {
			this.size = format.size;
		}
		if(format.color != null) {
			this.color = format.color;
		}
		if(format.bold != null) {
			this.bold = format.bold;
		}
		if(format.italic != null) {
			this.italic = format.italic;
		}
		if(format.underline != null) {
			this.underline = format.underline;
		}
		if(format.url != null) {
			this.url = format.url;
		}
		if(format.target != null) {
			this.target = format.target;
		}
		if(format.align != null) {
			this.align = format.align;
		}
		if(format.leftMargin != null) {
			this.leftMargin = format.leftMargin;
		}
		if(format.rightMargin != null) {
			this.rightMargin = format.rightMargin;
		}
		if(format.indent != null) {
			this.indent = format.indent;
		}
		if(format.leading != null) {
			this.leading = format.leading;
		}
		if(format.blockIndent != null) {
			this.blockIndent = format.blockIndent;
		}
		if(format.bullet != null) {
			this.bullet = format.bullet;
		}
		if(format.kerning != null) {
			this.kerning = format.kerning;
		}
		if(format.letterSpacing != null) {
			this.letterSpacing = format.letterSpacing;
		}
		if(format.tabStops != null) {
			this.tabStops = format.tabStops;
		}
		if(format.__ascent != null) {
			this.__ascent = format.__ascent;
		}
		if(format.__descent != null) {
			this.__descent = format.__descent;
		}
	}
	,__class__: openfl_text_TextFormat
};
var openfl_text_TextFormatAlign = {};
openfl_text_TextFormatAlign.fromString = function(value) {
	switch(value) {
	case "center":
		return 0;
	case "end":
		return 1;
	case "justify":
		return 2;
	case "left":
		return 3;
	case "right":
		return 4;
	case "start":
		return 5;
	default:
		return null;
	}
};
openfl_text_TextFormatAlign.toString = function(this1) {
	switch(this1) {
	case 0:
		return "center";
	case 1:
		return "end";
	case 2:
		return "justify";
	case 3:
		return "left";
	case 4:
		return "right";
	case 5:
		return "start";
	default:
		return null;
	}
};
var openfl_text_TextLineMetrics = function(x,width,height,ascent,descent,leading) {
	this.x = x;
	this.width = width;
	this.height = height;
	this.ascent = ascent;
	this.descent = descent;
	this.leading = leading;
};
$hxClasses["openfl.text.TextLineMetrics"] = openfl_text_TextLineMetrics;
openfl_text_TextLineMetrics.__name__ = "openfl.text.TextLineMetrics";
openfl_text_TextLineMetrics.prototype = {
	ascent: null
	,descent: null
	,height: null
	,leading: null
	,width: null
	,x: null
	,__class__: openfl_text_TextLineMetrics
};
var openfl_text__$internal_GlyphPosition = function(glyph,advance,offset) {
	this.glyph = glyph;
	this.advance = advance;
	if(offset != null) {
		this.offset = offset;
	} else {
		this.offset = new lime_math_Vector2();
	}
};
$hxClasses["openfl.text._internal.GlyphPosition"] = openfl_text__$internal_GlyphPosition;
openfl_text__$internal_GlyphPosition.__name__ = "openfl.text._internal.GlyphPosition";
openfl_text__$internal_GlyphPosition.prototype = {
	advance: null
	,glyph: null
	,offset: null
	,__class__: openfl_text__$internal_GlyphPosition
};
var openfl_text__$internal_TextEngine = function(textField) {
	this.textField = textField;
	this.width = 100;
	this.height = 100;
	this.set_text("");
	this.bounds = new openfl_geom_Rectangle(0,0,0,0);
	this.textBounds = new openfl_geom_Rectangle(0,0,0,0);
	this.type = 0;
	this.autoSize = 2;
	this.embedFonts = false;
	this.selectable = true;
	this.borderColor = 0;
	this.border = false;
	this.backgroundColor = 16777215;
	this.background = false;
	this.gridFitType = 1;
	this.maxChars = 0;
	this.multiline = false;
	this.numLines = 1;
	this.sharpness = 0;
	this.scrollH = 0;
	this.set_scrollV(1);
	this.wordWrap = false;
	this.lineAscents = openfl_Vector.toFloatVector(null);
	this.lineBreaks = openfl_Vector.toIntVector(null);
	this.lineDescents = openfl_Vector.toFloatVector(null);
	this.lineLeadings = openfl_Vector.toFloatVector(null);
	this.lineHeights = openfl_Vector.toFloatVector(null);
	this.lineWidths = openfl_Vector.toFloatVector(null);
	this.layoutGroups = openfl_Vector.toObjectVector(null);
	this.textFormatRanges = openfl_Vector.toObjectVector(null);
	if(openfl_text__$internal_TextEngine.__context == null) {
		openfl_text__$internal_TextEngine.__context = window.document.createElement("canvas").getContext("2d");
	}
};
$hxClasses["openfl.text._internal.TextEngine"] = openfl_text__$internal_TextEngine;
openfl_text__$internal_TextEngine.__name__ = "openfl.text._internal.TextEngine";
openfl_text__$internal_TextEngine.__context = null;
openfl_text__$internal_TextEngine.findFont = function(name) {
	return openfl_text_Font.__fontByName.h[name];
};
openfl_text__$internal_TextEngine.findFontVariant = function(format) {
	var fontName = format.font;
	var bold = format.bold;
	var italic = format.italic;
	if(fontName == null) {
		fontName = "_serif";
	}
	var fontNamePrefix = StringTools.replace(StringTools.replace(fontName," Normal","")," Regular","");
	if(bold && italic && Object.prototype.hasOwnProperty.call(openfl_text_Font.__fontByName.h,fontNamePrefix + " Bold Italic")) {
		return openfl_text__$internal_TextEngine.findFont(fontNamePrefix + " Bold Italic");
	} else if(bold && Object.prototype.hasOwnProperty.call(openfl_text_Font.__fontByName.h,fontNamePrefix + " Bold")) {
		return openfl_text__$internal_TextEngine.findFont(fontNamePrefix + " Bold");
	} else if(italic && Object.prototype.hasOwnProperty.call(openfl_text_Font.__fontByName.h,fontNamePrefix + " Italic")) {
		return openfl_text__$internal_TextEngine.findFont(fontNamePrefix + " Italic");
	}
	return openfl_text__$internal_TextEngine.findFont(fontName);
};
openfl_text__$internal_TextEngine.getFormatHeight = function(format) {
	var ascent;
	var descent;
	openfl_text__$internal_TextEngine.__context.font = openfl_text__$internal_TextEngine.getFont(format);
	var font = openfl_text__$internal_TextEngine.getFontInstance(format);
	if(format.__ascent != null) {
		ascent = format.size * format.__ascent;
		descent = format.size * format.__descent;
	} else if(font != null && font.unitsPerEM != 0) {
		ascent = font.ascender / font.unitsPerEM * format.size;
		descent = Math.abs(font.descender / font.unitsPerEM * format.size);
	} else {
		ascent = format.size;
		descent = format.size * 0.185;
	}
	var leading = format.leading;
	return ascent + descent + leading;
};
openfl_text__$internal_TextEngine.getFont = function(format) {
	var fontName = format.font;
	var bold = format.bold;
	var italic = format.italic;
	if(fontName == null) {
		fontName = "_serif";
	}
	var fontNamePrefix = StringTools.replace(StringTools.replace(fontName," Normal","")," Regular","");
	if(bold && italic && Object.prototype.hasOwnProperty.call(openfl_text_Font.__fontByName.h,fontNamePrefix + " Bold Italic")) {
		fontName = fontNamePrefix + " Bold Italic";
		bold = false;
		italic = false;
	} else if(bold && Object.prototype.hasOwnProperty.call(openfl_text_Font.__fontByName.h,fontNamePrefix + " Bold")) {
		fontName = fontNamePrefix + " Bold";
		bold = false;
	} else if(italic && Object.prototype.hasOwnProperty.call(openfl_text_Font.__fontByName.h,fontNamePrefix + " Italic")) {
		fontName = fontNamePrefix + " Italic";
		italic = false;
	} else {
		if(bold && (fontName.indexOf(" Bold ") > -1 || StringTools.endsWith(fontName," Bold"))) {
			bold = false;
		}
		if(italic && (fontName.indexOf(" Italic ") > -1 || StringTools.endsWith(fontName," Italic"))) {
			italic = false;
		}
	}
	var font = italic ? "italic " : "normal ";
	font += "normal ";
	font += bold ? "bold " : "normal ";
	font += format.size + "px";
	font += "/" + (format.leading + format.size + 3) + "px ";
	var font1;
	switch(fontName) {
	case "_sans":
		font1 = "sans-serif";
		break;
	case "_serif":
		font1 = "serif";
		break;
	case "_typewriter":
		font1 = "monospace";
		break;
	default:
		var _this_r = new RegExp("^[\\s'\"]+(.*)[\\s'\"]+$","".split("u").join(""));
		font1 = "'" + fontName.replace(_this_r,"$1") + "'";
	}
	font += "" + font1;
	return font;
};
openfl_text__$internal_TextEngine.getFontInstance = function(format) {
	return openfl_text__$internal_TextEngine.findFontVariant(format);
};
openfl_text__$internal_TextEngine.prototype = {
	antiAliasType: null
	,autoSize: null
	,background: null
	,backgroundColor: null
	,border: null
	,borderColor: null
	,bottomScrollV: null
	,bounds: null
	,caretIndex: null
	,embedFonts: null
	,gridFitType: null
	,height: null
	,layoutGroups: null
	,lineAscents: null
	,lineBreaks: null
	,lineDescents: null
	,lineLeadings: null
	,lineHeights: null
	,lineWidths: null
	,maxChars: null
	,maxScrollH: null
	,maxScrollV: null
	,multiline: null
	,numLines: null
	,restrict: null
	,scrollH: null
	,scrollV: null
	,selectable: null
	,sharpness: null
	,text: null
	,textBounds: null
	,textHeight: null
	,textFormatRanges: null
	,textWidth: null
	,type: null
	,width: null
	,wordWrap: null
	,textField: null
	,__cursorTimer: null
	,__hasFocus: null
	,__isKeyDown: null
	,__measuredHeight: null
	,__measuredWidth: null
	,__restrictRegexp: null
	,__selectionStart: null
	,__showCursor: null
	,__textFormat: null
	,__textLayout: null
	,__texture: null
	,__useIntAdvances: null
	,__cairoFont: null
	,__font: null
	,createRestrictRegexp: function(restrict) {
		var declinedRange = new EReg("\\^(.-.|.)","gu");
		var declined = "";
		var accepted = declinedRange.map(restrict,function(ereg) {
			declined += ereg.matched(1);
			return "";
		});
		var testRegexpParts = [];
		if(accepted.length > 0) {
			testRegexpParts.push("[^" + restrict + "]");
		}
		if(declined.length > 0) {
			testRegexpParts.push("[" + declined + "]");
		}
		return new EReg("(" + testRegexpParts.join("|") + ")","g");
	}
	,getBounds: function() {
		var padding = this.border ? 1 : 0;
		this.bounds.width = this.width + padding;
		this.bounds.height = this.height + padding;
		var x = this.width;
		var y = this.width;
		var group = this.layoutGroups.iterator();
		while(group.hasNext()) {
			var group1 = group.next();
			if(group1.offsetX < x) {
				x = group1.offsetX;
			}
			if(group1.offsetY < y) {
				y = group1.offsetY;
			}
		}
		if(x >= this.width) {
			x = 2;
		}
		if(y >= this.height) {
			y = 2;
		}
		var textHeight = this.textHeight * 1.185;
		this.textBounds.setTo(Math.max(x - 2,0),Math.max(y - 2,0),Math.min(this.textWidth + 4,this.bounds.width + 4),Math.min(textHeight + 4,this.bounds.height + 4));
	}
	,getLine: function(index) {
		if(index < 0 || index > this.lineBreaks.get_length() + 1) {
			return null;
		}
		if(this.lineBreaks.get_length() == 0) {
			return this.text;
		} else {
			return this.text.substring(index > 0 ? this.lineBreaks.get(index - 1) : 0,this.lineBreaks.get(index));
		}
	}
	,getLineBreakIndex: function(startIndex) {
		if(startIndex == null) {
			startIndex = 0;
		}
		var cr = this.text.indexOf("\n",startIndex);
		var lf = this.text.indexOf("\r",startIndex);
		if(cr == -1) {
			return lf;
		}
		if(lf == -1) {
			return cr;
		}
		if(cr < lf) {
			return cr;
		} else {
			return lf;
		}
	}
	,getLineMeasurements: function() {
		this.lineAscents.set_length(0);
		this.lineDescents.set_length(0);
		this.lineLeadings.set_length(0);
		this.lineHeights.set_length(0);
		this.lineWidths.set_length(0);
		var currentLineAscent = 0.0;
		var currentLineDescent = 0.0;
		var currentLineLeading = null;
		var currentLineHeight = 0.0;
		var currentLineWidth = 0.0;
		var currentTextHeight = 0.0;
		this.textWidth = 0;
		this.textHeight = 0;
		this.numLines = 1;
		this.maxScrollH = 0;
		var group = this.layoutGroups.iterator();
		while(group.hasNext()) {
			var group1 = group.next();
			while(group1.lineIndex > this.numLines - 1) {
				this.lineAscents.push(currentLineAscent);
				this.lineDescents.push(currentLineDescent);
				this.lineLeadings.push(currentLineLeading != null ? currentLineLeading : 0);
				this.lineHeights.push(currentLineHeight);
				this.lineWidths.push(currentLineWidth);
				currentLineAscent = 0;
				currentLineDescent = 0;
				currentLineLeading = null;
				currentLineHeight = 0;
				currentLineWidth = 0;
				this.numLines++;
			}
			currentLineAscent = Math.max(currentLineAscent,group1.ascent);
			currentLineDescent = Math.max(currentLineDescent,group1.descent);
			if(currentLineLeading == null) {
				currentLineLeading = group1.leading;
			} else {
				currentLineLeading = Math.max(currentLineLeading,group1.leading) | 0;
			}
			currentLineHeight = Math.max(currentLineHeight,group1.height);
			currentLineWidth = group1.offsetX - 2 + group1.width;
			if(currentLineWidth > this.textWidth) {
				this.textWidth = currentLineWidth;
			}
			currentTextHeight = group1.offsetY - 2 + group1.ascent + group1.descent;
			if(currentTextHeight > this.textHeight) {
				this.textHeight = currentTextHeight;
			}
		}
		if(this.textHeight == 0 && this.textField != null && this.textField.get_type() == 1) {
			var currentFormat = this.textField.__textFormat;
			var ascent;
			var descent;
			var font = openfl_text__$internal_TextEngine.getFontInstance(currentFormat);
			if(currentFormat.__ascent != null) {
				ascent = currentFormat.size * currentFormat.__ascent;
				descent = currentFormat.size * currentFormat.__descent;
			} else if(font != null && font.unitsPerEM != 0) {
				ascent = font.ascender / font.unitsPerEM * currentFormat.size;
				descent = Math.abs(font.descender / font.unitsPerEM * currentFormat.size);
			} else {
				ascent = currentFormat.size;
				descent = currentFormat.size * 0.185;
			}
			var leading = currentFormat.leading;
			var heightValue = ascent + descent + leading;
			currentLineAscent = ascent;
			currentLineDescent = descent;
			currentLineLeading = leading;
			currentTextHeight = ascent + descent;
			this.textHeight = currentTextHeight;
		}
		this.lineAscents.push(currentLineAscent);
		this.lineDescents.push(currentLineDescent);
		this.lineLeadings.push(currentLineLeading != null ? currentLineLeading : 0);
		this.lineHeights.push(currentLineHeight);
		this.lineWidths.push(currentLineWidth);
		if(this.numLines == 1) {
			if(currentLineLeading > 0) {
				this.textHeight += currentLineLeading;
			}
		}
		if(this.layoutGroups.get_length() > 0) {
			var group = this.layoutGroups.get(this.layoutGroups.get_length() - 1);
			if(group != null && group.startIndex == group.endIndex) {
				this.textHeight -= currentLineHeight;
			}
		}
		if(this.autoSize != 2) {
			switch(this.autoSize) {
			case 0:case 1:case 3:
				if(!this.wordWrap) {
					this.width = this.textWidth + 4;
				}
				this.height = this.textHeight + 4;
				this.bottomScrollV = this.numLines;
				break;
			default:
			}
		}
		if(this.textWidth > this.width - 4) {
			this.maxScrollH = this.textWidth - this.width + 4 | 0;
		} else {
			this.maxScrollH = 0;
		}
		if(this.scrollH > this.maxScrollH) {
			this.scrollH = this.maxScrollH;
		}
	}
	,getLayoutGroups: function() {
		var _gthis = this;
		this.layoutGroups.set_length(0);
		if(this.text == null || this.text == "") {
			return;
		}
		var rangeIndex = -1;
		var formatRange = null;
		var font = null;
		var currentFormat = openfl_text_TextField.__defaultTextFormat.clone();
		var leading = 0;
		var ascent = 0.0;
		var maxAscent = 0.0;
		var descent = 0.0;
		var align = 3;
		var blockIndent = 0;
		var bullet = false;
		var indent = 0;
		var leftMargin = 0;
		var rightMargin = 0;
		var tabStops = null;
		var layoutGroup = null;
		var positions = null;
		var widthValue = 0.0;
		var heightValue = 0;
		var maxHeightValue = 0;
		var previousSpaceIndex = -2;
		var previousBreakIndex = -1;
		var spaceIndex = this.text.indexOf(" ");
		var breakIndex = this.getLineBreakIndex();
		var offsetX = 2.0;
		var offsetY = 2.0;
		var textIndex = 0;
		var lineIndex = 0;
		var getPositions = function(text,startIndex,endIndex) {
			var positions = [];
			var letterSpacing = 0.0;
			if(formatRange.format.letterSpacing != null) {
				letterSpacing = formatRange.format.letterSpacing;
			}
			if(_gthis.__useIntAdvances == null) {
				var getPositions = new EReg("Trident/7.0","");
				_gthis.__useIntAdvances = getPositions.match($global.navigator.userAgent);
			}
			if(_gthis.__useIntAdvances) {
				var previousWidth = 0.0;
				var width;
				var _g = startIndex;
				var _g1 = endIndex;
				while(_g < _g1) {
					var i = _g++;
					width = openfl_text__$internal_TextEngine.__context.measureText(text.substring(startIndex,i + 1)).width;
					positions.push(width - previousWidth);
					previousWidth = width;
				}
			} else {
				var _g = startIndex;
				var _g1 = endIndex;
				while(_g < _g1) {
					var i = _g++;
					var advance;
					if(i < text.length - 1) {
						var nextWidth = openfl_text__$internal_TextEngine.__context.measureText(text.charAt(i + 1)).width;
						var twoWidths = openfl_text__$internal_TextEngine.__context.measureText(HxOverrides.substr(text,i,2)).width;
						advance = twoWidths - nextWidth;
					} else {
						advance = openfl_text__$internal_TextEngine.__context.measureText(text.charAt(i)).width;
					}
					positions.push(advance);
				}
			}
			return positions;
		};
		var getPositionsWidth = function(positions) {
			var width = 0.0;
			var _g = 0;
			while(_g < positions.length) {
				var position = positions[_g];
				++_g;
				width += position;
			}
			return width;
		};
		var getTextWidth = function(text) {
			return openfl_text__$internal_TextEngine.__context.measureText(text).width;
		};
		var nextLayoutGroup = function(startIndex,endIndex) {
			if(layoutGroup == null || layoutGroup.startIndex != layoutGroup.endIndex) {
				layoutGroup = new openfl_text__$internal_TextLayoutGroup(formatRange.format,startIndex,endIndex);
				_gthis.layoutGroups.push(layoutGroup);
			} else {
				layoutGroup.format = formatRange.format;
				layoutGroup.startIndex = startIndex;
				layoutGroup.endIndex = endIndex;
			}
		};
		var setLineMetrics = function() {
			if(currentFormat.__ascent != null) {
				ascent = currentFormat.size * currentFormat.__ascent;
				descent = currentFormat.size * currentFormat.__descent;
			} else if(font != null && font.unitsPerEM != 0) {
				ascent = font.ascender / font.unitsPerEM * currentFormat.size;
				descent = Math.abs(font.descender / font.unitsPerEM * currentFormat.size);
			} else {
				ascent = currentFormat.size;
				descent = currentFormat.size * 0.185;
			}
			leading = currentFormat.leading;
			heightValue = Math.ceil(ascent + descent + leading);
			if(heightValue > maxHeightValue) {
				maxHeightValue = heightValue;
			}
			if(ascent > maxAscent) {
				maxAscent = ascent;
			}
		};
		var setParagraphMetrics = function() {
			if(currentFormat.align != null) {
				align = currentFormat.align;
			}
			var setParagraphMetrics = currentFormat.blockIndent != null;
			var setParagraphMetrics = currentFormat.bullet != null;
			var setParagraphMetrics = currentFormat.indent != null;
			if(currentFormat.leftMargin != null) {
				leftMargin = currentFormat.leftMargin;
			}
			if(currentFormat.rightMargin != null) {
				rightMargin = currentFormat.rightMargin;
			}
			var setParagraphMetrics = currentFormat.tabStops != null;
		};
		var nextFormatRange = function() {
			if(rangeIndex < _gthis.textFormatRanges.get_length() - 1) {
				rangeIndex += 1;
				formatRange = _gthis.textFormatRanges.get(rangeIndex);
				currentFormat.__merge(formatRange.format);
				openfl_text__$internal_TextEngine.__context.font = openfl_text__$internal_TextEngine.getFont(currentFormat);
				font = openfl_text__$internal_TextEngine.getFontInstance(currentFormat);
				return true;
			}
			return false;
		};
		var setFormattedPositions = function(startIndex,endIndex) {
			if(endIndex <= formatRange.end) {
				positions = getPositions(_gthis.text,startIndex,endIndex);
				widthValue = getPositionsWidth(positions);
			} else {
				var tempIndex = startIndex;
				var tempRangeEnd = formatRange.end;
				var countRanges = 0;
				positions = [];
				widthValue = 0;
				while(true) {
					if(tempIndex != tempRangeEnd) {
						var tempPositions = getPositions(_gthis.text,tempIndex,tempRangeEnd);
						positions = positions.concat(tempPositions);
					}
					if(tempRangeEnd != endIndex) {
						if(!nextFormatRange()) {
							lime_utils_Log.warn("You found a bug in OpenFL's text code! Please save a copy of your project and contact Joshua Granick (@singmajesty) so we can fix this.",{ fileName : "openfl/text/_internal/TextEngine.hx", lineNumber : 1061, className : "openfl.text._internal.TextEngine", methodName : "getLayoutGroups"});
							break;
						}
						tempIndex = tempRangeEnd;
						tempRangeEnd = endIndex < formatRange.end ? endIndex : formatRange.end;
						++countRanges;
					} else {
						widthValue = getPositionsWidth(positions);
						break;
					}
				}
				rangeIndex -= countRanges + 1;
				nextFormatRange();
			}
		};
		var placeFormattedText = function(endIndex) {
			if(endIndex <= formatRange.end) {
				positions = getPositions(_gthis.text,textIndex,endIndex);
				widthValue = getPositionsWidth(positions);
				nextLayoutGroup(textIndex,endIndex);
				layoutGroup.positions = positions;
				layoutGroup.offsetX = offsetX;
				layoutGroup.ascent = ascent;
				layoutGroup.descent = descent;
				layoutGroup.leading = leading;
				layoutGroup.lineIndex = lineIndex;
				layoutGroup.offsetY = offsetY;
				layoutGroup.width = widthValue;
				layoutGroup.height = heightValue;
				offsetX += widthValue;
				if(endIndex == formatRange.end) {
					layoutGroup = null;
					nextFormatRange();
					setLineMetrics();
				}
			} else {
				while(true) {
					var tempRangeEnd = endIndex < formatRange.end ? endIndex : formatRange.end;
					if(textIndex != tempRangeEnd) {
						positions = getPositions(_gthis.text,textIndex,tempRangeEnd);
						widthValue = getPositionsWidth(positions);
						nextLayoutGroup(textIndex,tempRangeEnd);
						layoutGroup.positions = positions;
						layoutGroup.offsetX = offsetX;
						layoutGroup.ascent = ascent;
						layoutGroup.descent = descent;
						layoutGroup.leading = leading;
						layoutGroup.lineIndex = lineIndex;
						layoutGroup.offsetY = offsetY;
						layoutGroup.width = widthValue;
						layoutGroup.height = heightValue;
						offsetX += widthValue;
						textIndex = tempRangeEnd;
					}
					if(tempRangeEnd == formatRange.end) {
						layoutGroup = null;
					}
					if(tempRangeEnd == endIndex) {
						break;
					}
					if(!nextFormatRange()) {
						lime_utils_Log.warn("You found a bug in OpenFL's text code! Please save a copy of your project and contact Joshua Granick (@singmajesty) so we can fix this.",{ fileName : "openfl/text/_internal/TextEngine.hx", lineNumber : 1149, className : "openfl.text._internal.TextEngine", methodName : "getLayoutGroups"});
						break;
					}
					setLineMetrics();
				}
			}
			textIndex = endIndex;
		};
		var alignBaseline = function() {
			setLineMetrics();
			var i = _gthis.layoutGroups.get_length();
			while(--i > -1) {
				var lg = _gthis.layoutGroups.get(i);
				if(lg.lineIndex < lineIndex) {
					break;
				}
				if(lg.lineIndex > lineIndex) {
					continue;
				}
				lg.ascent = maxAscent;
				lg.height = maxHeightValue;
			}
			offsetY += maxHeightValue;
			maxAscent = 0.0;
			maxHeightValue = 0;
			lineIndex += 1;
			offsetX = 2;
		};
		var breakLongWords = function(endIndex) {
			var remainingPositions = positions;
			var i;
			var bufferCount;
			var placeIndex;
			var positionWidth;
			var currentPosition;
			var tempWidth = getPositionsWidth(remainingPositions);
			while(offsetX + tempWidth > _gthis.width - 2) {
				bufferCount = 0;
				i = bufferCount;
				positionWidth = 0.0;
				while(offsetX + positionWidth < _gthis.width - 2) {
					currentPosition = remainingPositions[i];
					if(currentPosition == 0.0) {
						++i;
						++bufferCount;
					} else {
						positionWidth += currentPosition;
						++i;
					}
				}
				if(positionWidth == 0.0) {
					break;
				} else if(i < 2 && positionWidth + offsetX > _gthis.width - 2) {
					if(textIndex + i - bufferCount == endIndex) {
						break;
					}
				} else {
					while(offsetX + positionWidth > _gthis.width - 2) {
						--i;
						if(i - bufferCount > 0) {
							setFormattedPositions(textIndex,textIndex + i - bufferCount);
							positionWidth = widthValue;
						} else {
							i = 1;
							bufferCount = 0;
							setFormattedPositions(textIndex,textIndex + 1);
							positionWidth = 0;
						}
					}
				}
				placeIndex = textIndex + i - bufferCount;
				placeFormattedText(placeIndex);
				alignBaseline();
				setFormattedPositions(placeIndex,endIndex);
				remainingPositions = positions;
				tempWidth = widthValue;
			}
		};
		var placeText = function(endIndex) {
			if(_gthis.width >= 4 && _gthis.wordWrap) {
				breakLongWords(endIndex);
			}
			placeFormattedText(endIndex);
		};
		nextFormatRange();
		setParagraphMetrics();
		setLineMetrics();
		var wrap;
		var maxLoops = this.text.length + 1;
		while(textIndex < maxLoops) if(breakIndex > -1 && (spaceIndex == -1 || breakIndex < spaceIndex)) {
			if(textIndex <= breakIndex) {
				setFormattedPositions(textIndex,breakIndex);
				placeText(breakIndex);
				layoutGroup = null;
			} else if(layoutGroup != null && layoutGroup.startIndex != layoutGroup.endIndex) {
				if(layoutGroup.endIndex == spaceIndex) {
					layoutGroup.width -= layoutGroup.positions[layoutGroup.positions.length - 1];
				}
				layoutGroup = null;
			}
			if(formatRange.end == breakIndex) {
				nextFormatRange();
				setLineMetrics();
			}
			alignBaseline();
			textIndex = breakIndex + 1;
			previousBreakIndex = breakIndex;
			breakIndex = this.getLineBreakIndex(textIndex);
			setParagraphMetrics();
		} else if(spaceIndex > -1) {
			if(layoutGroup != null && layoutGroup.startIndex != layoutGroup.endIndex) {
				layoutGroup = null;
			}
			wrap = false;
			while(textIndex < this.text.length) {
				var endIndex = -1;
				if(spaceIndex == -1) {
					endIndex = breakIndex;
				} else {
					endIndex = spaceIndex + 1;
					if(breakIndex > -1 && breakIndex < endIndex) {
						endIndex = breakIndex;
					}
				}
				if(endIndex == -1) {
					endIndex = this.text.length;
				}
				setFormattedPositions(textIndex,endIndex);
				if(align == 2) {
					if(positions.length > 0 && textIndex == previousSpaceIndex) {
						textIndex += 1;
						var spaceWidth = positions.shift();
						widthValue -= spaceWidth;
						offsetX += spaceWidth;
					}
					if(positions.length > 0 && endIndex == spaceIndex + 1) {
						--endIndex;
						var spaceWidth1 = positions.pop();
						widthValue -= spaceWidth1;
					}
				}
				if(this.wordWrap) {
					if(offsetX + widthValue > this.width - 2) {
						wrap = true;
						if(positions.length > 0 && endIndex == spaceIndex + 1) {
							var lastPosition = positions[positions.length - 1];
							var spaceWidth2 = lastPosition;
							if(offsetX + widthValue - spaceWidth2 <= this.width - 2) {
								wrap = false;
							}
						}
					}
				}
				if(wrap) {
					if(align != 2 && (layoutGroup != null || this.layoutGroups.get_length() > 0)) {
						var previous = layoutGroup;
						if(previous == null) {
							previous = this.layoutGroups.get(this.layoutGroups.get_length() - 1);
						}
						previous.width -= previous.positions[previous.positions.length - 1];
						previous.endIndex--;
					}
					var i = this.layoutGroups.get_length() - 1;
					var offsetCount = 0;
					while(true) {
						layoutGroup = this.layoutGroups.get(i);
						if(i > 0 && layoutGroup.startIndex > previousSpaceIndex) {
							++offsetCount;
						} else {
							break;
						}
						--i;
					}
					if(textIndex == previousSpaceIndex + 1) {
						alignBaseline();
					}
					offsetX = 2;
					if(offsetCount > 0) {
						var bumpX = this.layoutGroups.get(this.layoutGroups.get_length() - offsetCount).offsetX;
						var _g = this.layoutGroups.get_length() - offsetCount;
						var _g1 = this.layoutGroups.get_length();
						while(_g < _g1) {
							var i1 = _g++;
							layoutGroup = this.layoutGroups.get(i1);
							layoutGroup.offsetX -= bumpX;
							layoutGroup.offsetY = offsetY;
							layoutGroup.lineIndex = lineIndex;
							offsetX += layoutGroup.width;
						}
					}
					placeText(endIndex);
					wrap = false;
				} else if(layoutGroup != null && textIndex == spaceIndex) {
					if(align != 2) {
						layoutGroup.endIndex = spaceIndex;
						layoutGroup.positions = layoutGroup.positions.concat(positions);
						layoutGroup.width += widthValue;
					}
					offsetX += widthValue;
					textIndex = endIndex;
				} else if(layoutGroup == null || align == 2) {
					placeText(endIndex);
				} else {
					var tempRangeEnd = endIndex < formatRange.end ? endIndex : formatRange.end;
					if(tempRangeEnd < endIndex) {
						positions = getPositions(this.text,textIndex,tempRangeEnd);
						widthValue = getPositionsWidth(positions);
					}
					layoutGroup.endIndex = tempRangeEnd;
					layoutGroup.positions = layoutGroup.positions.concat(positions);
					layoutGroup.width += widthValue;
					offsetX += widthValue;
					if(tempRangeEnd == formatRange.end) {
						layoutGroup = null;
						nextFormatRange();
						setLineMetrics();
						textIndex = tempRangeEnd;
						if(tempRangeEnd != endIndex) {
							placeFormattedText(endIndex);
						}
					}
					if(breakIndex == endIndex) {
						++endIndex;
					}
					textIndex = endIndex;
				}
				var nextSpaceIndex = this.text.indexOf(" ",textIndex);
				if(breakIndex == previousSpaceIndex) {
					layoutGroup.endIndex = breakIndex;
					if(breakIndex - layoutGroup.startIndex - layoutGroup.positions.length < 0) {
						layoutGroup.positions.push(0.0);
					}
					textIndex = breakIndex + 1;
				}
				previousSpaceIndex = spaceIndex;
				spaceIndex = nextSpaceIndex;
				if(breakIndex > -1 && breakIndex <= textIndex && (spaceIndex > breakIndex || spaceIndex == -1) || textIndex > this.text.length) {
					break;
				}
			}
		} else {
			if(textIndex < this.text.length) {
				setFormattedPositions(textIndex,this.text.length);
				placeText(this.text.length);
				alignBaseline();
			}
			textIndex += 1;
		}
		if(previousBreakIndex == textIndex - 2 && previousBreakIndex > -1) {
			nextLayoutGroup(textIndex,textIndex);
			layoutGroup.positions = [];
			layoutGroup.ascent = ascent;
			layoutGroup.descent = descent;
			layoutGroup.leading = leading;
			layoutGroup.lineIndex = lineIndex;
			layoutGroup.offsetX = 2;
			layoutGroup.offsetY = offsetY;
			layoutGroup.width = 0;
			layoutGroup.height = heightValue;
		}
	}
	,restrictText: function(value) {
		if(value == null) {
			return value;
		}
		if(this.__restrictRegexp != null) {
			value = this.__restrictRegexp.split(value).join("");
		}
		return value;
	}
	,setTextAlignment: function() {
		var lineIndex = -1;
		var offsetX = 0.0;
		var totalWidth = this.width - 4;
		var group;
		var lineLength;
		var lineMeasurementsDirty = false;
		var _g = 0;
		var _g1 = this.layoutGroups.get_length();
		while(_g < _g1) {
			var i = _g++;
			group = this.layoutGroups.get(i);
			if(group.lineIndex != lineIndex) {
				lineIndex = group.lineIndex;
				totalWidth = this.width - 4 - group.format.rightMargin;
				switch(group.format.align) {
				case 0:
					if(this.lineWidths.get(lineIndex) < totalWidth) {
						offsetX = Math.round((totalWidth - this.lineWidths.get(lineIndex)) / 2);
					} else {
						offsetX = 0;
					}
					break;
				case 2:
					if(this.lineWidths.get(lineIndex) < totalWidth) {
						lineLength = 1;
						var _g2 = i + 1;
						var _g3 = this.layoutGroups.get_length();
						while(_g2 < _g3) {
							var j = _g2++;
							if(this.layoutGroups.get(j).lineIndex == lineIndex) {
								if(j == 0 || HxOverrides.cca(this.text,this.layoutGroups.get(j).startIndex - 1) == 32) {
									++lineLength;
								}
							} else {
								break;
							}
						}
						if(lineLength > 1) {
							group = this.layoutGroups.get(i + lineLength - 1);
							var endChar = HxOverrides.cca(this.text,group.endIndex);
							if(group.endIndex < this.text.length && endChar != 10 && endChar != 13) {
								offsetX = (totalWidth - this.lineWidths.get(lineIndex)) / (lineLength - 1);
								lineMeasurementsDirty = true;
								var j1 = 1;
								while(true) {
									this.layoutGroups.get(i + j1).offsetX += offsetX * j1;
									if(!(++j1 < lineLength)) {
										break;
									}
								}
							}
						}
					}
					offsetX = 0;
					break;
				case 4:
					if(this.lineWidths.get(lineIndex) < totalWidth) {
						offsetX = Math.round(totalWidth - this.lineWidths.get(lineIndex));
					} else {
						offsetX = 0;
					}
					break;
				default:
					offsetX = 0;
				}
			}
			if(offsetX > 0) {
				group.offsetX += offsetX;
			}
		}
		if(lineMeasurementsDirty) {
			this.getLineMeasurements();
		}
	}
	,trimText: function(value) {
		if(value == null) {
			return value;
		}
		if(this.maxChars > 0 && value.length > this.maxChars) {
			value = HxOverrides.substr(value,0,this.maxChars);
		}
		return value;
	}
	,update: function() {
		if(this.text == null || this.textFormatRanges.get_length() == 0) {
			this.lineAscents.set_length(0);
			this.lineBreaks.set_length(0);
			this.lineDescents.set_length(0);
			this.lineLeadings.set_length(0);
			this.lineHeights.set_length(0);
			this.lineWidths.set_length(0);
			this.layoutGroups.set_length(0);
			this.textWidth = 0;
			this.textHeight = 0;
			this.numLines = 1;
			this.maxScrollH = 0;
			this.maxScrollV = 1;
			this.bottomScrollV = 1;
		} else {
			this.getLayoutGroups();
			this.getLineMeasurements();
			this.setTextAlignment();
		}
		this.getBounds();
	}
	,get_bottomScrollV: function() {
		if(this.numLines == 1 || this.lineHeights == null) {
			return 1;
		} else {
			var tempHeight = 0.0;
			var ret = this.lineHeights.get_length();
			var _g = ret - 1;
			var _g1 = this.lineHeights.get_length();
			while(_g < _g1) {
				var i = _g++;
				if(tempHeight + this.lineHeights.get(i) <= this.height - 4) {
					tempHeight += this.lineHeights.get(i);
				} else {
					ret = i;
					break;
				}
			}
			if(ret < 1) {
				return 1;
			}
			return ret;
		}
	}
	,get_maxScrollV: function() {
		if(this.numLines == 1 || this.lineHeights == null) {
			return 1;
		} else {
			var i = this.numLines - 1;
			var tempHeight = 0.0;
			if(HxOverrides.cca(this.text,this.text.length - 1) == 10) {
				--i;
			}
			var j = i;
			while(i >= 0) if(tempHeight + this.lineHeights.get(i) <= this.height - 4) {
				tempHeight += this.lineHeights.get(i);
				--i;
			} else {
				break;
			}
			if(i == j) {
				i = this.numLines;
			} else {
				i += 2;
			}
			if(i < 1) {
				return 1;
			}
			return i;
		}
	}
	,set_restrict: function(value) {
		if(this.restrict == value) {
			return this.restrict;
		}
		this.restrict = value;
		if(this.restrict == null || this.restrict.length == 0) {
			this.__restrictRegexp = null;
		} else {
			this.__restrictRegexp = this.createRestrictRegexp(value);
		}
		return this.restrict;
	}
	,get_scrollV: function() {
		if(this.numLines == 1 || this.lineHeights == null) {
			return 1;
		}
		var max = this.get_maxScrollV();
		if(this.scrollV > max) {
			return max;
		}
		return this.scrollV;
	}
	,set_scrollV: function(value) {
		if(value < 1) {
			value = 1;
		}
		return this.scrollV = value;
	}
	,set_text: function(value) {
		return this.text = value;
	}
	,__class__: openfl_text__$internal_TextEngine
	,__properties__: {set_text:"set_text",set_scrollV:"set_scrollV",get_scrollV:"get_scrollV",set_restrict:"set_restrict",get_maxScrollV:"get_maxScrollV",get_bottomScrollV:"get_bottomScrollV"}
};
var openfl_text__$internal_TextFormatRange = function(format,start,end) {
	this.format = format;
	this.start = start;
	this.end = end;
};
$hxClasses["openfl.text._internal.TextFormatRange"] = openfl_text__$internal_TextFormatRange;
openfl_text__$internal_TextFormatRange.__name__ = "openfl.text._internal.TextFormatRange";
openfl_text__$internal_TextFormatRange.prototype = {
	end: null
	,format: null
	,start: null
	,__class__: openfl_text__$internal_TextFormatRange
};
var openfl_text__$internal_TextLayout = function(text,font,size,direction,script,language) {
	if(language == null) {
		language = "en";
	}
	if(script == null) {
		script = "Zyyy";
	}
	if(direction == null) {
		direction = 4;
	}
	if(size == null) {
		size = 12;
	}
	if(text == null) {
		text = "";
	}
	this.letterSpacing = 0;
	this.set_text(text);
	this.set_font(font);
	this.set_size(size);
	this.__direction = direction;
	this.__script = script;
	this.__language = language;
	this.positions = [];
	this.__dirty = true;
	this.__create(this.__direction,this.__script,this.__language);
};
$hxClasses["openfl.text._internal.TextLayout"] = openfl_text__$internal_TextLayout;
openfl_text__$internal_TextLayout.__name__ = "openfl.text._internal.TextLayout";
openfl_text__$internal_TextLayout.prototype = {
	autoHint: null
	,font: null
	,glyphs: null
	,letterSpacing: null
	,positions: null
	,size: null
	,text: null
	,__buffer: null
	,__direction: null
	,__dirty: null
	,__handle: null
	,__language: null
	,__script: null
	,__font: null
	,__hbBuffer: null
	,__hbFont: null
	,__create: function(direction,script,language) {
		if(language.length != 4) {
			return;
		}
		this.__hbBuffer = lime_text_harfbuzz_HBBuffer._new();
		switch(direction) {
		case 4:
			break;
		case 5:
			break;
		case 6:
			break;
		case 7:
			break;
		default:
		}
		var this1 = this.__hbBuffer;
		var value = lime_text_harfbuzz_HBLanguage._new(language);
	}
	,__position: function() {
		this.positions = [];
	}
	,get_positions: function() {
		if(this.__dirty) {
			this.__dirty = false;
			this.__position();
		}
		return this.positions;
	}
	,get_direction: function() {
		return this.__direction;
	}
	,set_direction: function(value) {
		if(value == this.__direction) {
			return value;
		}
		this.__direction = value;
		this.__dirty = true;
		return value;
	}
	,set_font: function(value) {
		if(value == this.font) {
			return value;
		}
		this.font = value;
		this.__dirty = true;
		return value;
	}
	,get_glyphs: function() {
		var glyphs = [];
		var _g = 0;
		var _g1 = this.get_positions();
		while(_g < _g1.length) {
			var position = _g1[_g];
			++_g;
			glyphs.push(position.glyph);
		}
		return glyphs;
	}
	,get_language: function() {
		return this.__language;
	}
	,set_language: function(value) {
		if(value == this.__language) {
			return value;
		}
		this.__language = value;
		this.__dirty = true;
		return value;
	}
	,get_script: function() {
		return this.__script;
	}
	,set_script: function(value) {
		if(value == this.__script) {
			return value;
		}
		this.__script = value;
		this.__dirty = true;
		return value;
	}
	,set_size: function(value) {
		if(value == this.size) {
			return value;
		}
		this.size = value;
		this.__dirty = true;
		return value;
	}
	,set_text: function(value) {
		if(value == this.text) {
			return value;
		}
		this.text = value;
		this.__dirty = true;
		return value;
	}
	,__class__: openfl_text__$internal_TextLayout
	,__properties__: {set_text:"set_text",set_size:"set_size",set_script:"set_script",get_script:"get_script",get_positions:"get_positions",set_language:"set_language",get_language:"get_language",get_glyphs:"get_glyphs",set_font:"set_font",set_direction:"set_direction",get_direction:"get_direction"}
};
var openfl_text__$internal_TextDirection = {};
openfl_text__$internal_TextDirection.__properties__ = {get_vertical:"get_vertical",get_horizontal:"get_horizontal",get_forward:"get_forward",get_backward:"get_backward"};
openfl_text__$internal_TextDirection.reverse = function(this1) {
	this1 ^= 1;
};
openfl_text__$internal_TextDirection.toString = function(this1) {
	switch(this1) {
	case 4:
		return "leftToRight";
	case 5:
		return "rightToLeft";
	case 6:
		return "topToBottom";
	case 7:
		return "bottomToTop";
	default:
		return "";
	}
};
openfl_text__$internal_TextDirection.toHBDirection = function(this1) {
	switch(this1) {
	case 4:
		return 4;
	case 5:
		return 5;
	case 6:
		return 6;
	case 7:
		return 7;
	default:
		return 0;
	}
};
openfl_text__$internal_TextDirection.get_backward = function(this1) {
	return (this1 & -3) == 5;
};
openfl_text__$internal_TextDirection.get_forward = function(this1) {
	return (this1 & -3) == 4;
};
openfl_text__$internal_TextDirection.get_horizontal = function(this1) {
	return (this1 & -2) == 4;
};
openfl_text__$internal_TextDirection.get_vertical = function(this1) {
	return (this1 & -2) == 6;
};
var openfl_text__$internal_TextScript = {};
openfl_text__$internal_TextScript.__properties__ = {get_rightToLeft:"get_rightToLeft"};
openfl_text__$internal_TextScript.toHBScript = function(this1) {
	return 1517910393;
};
openfl_text__$internal_TextScript.get_rightToLeft = function(this1) {
	switch(this1) {
	case "Arab":case "Armi":case "Avst":case "Cprt":case "Hebr":case "Khar":case "Lydi":case "Mand":case "Nkoo":case "Orkh":case "Phli":case "Phlp":case "Phnx":case "Samr":case "Sarb":case "Syrc":case "Thaa":
		return true;
	default:
		return false;
	}
};
var openfl_text__$internal_TextLayoutGroup = function(format,startIndex,endIndex) {
	this.format = format;
	this.startIndex = startIndex;
	this.endIndex = endIndex;
};
$hxClasses["openfl.text._internal.TextLayoutGroup"] = openfl_text__$internal_TextLayoutGroup;
openfl_text__$internal_TextLayoutGroup.__name__ = "openfl.text._internal.TextLayoutGroup";
openfl_text__$internal_TextLayoutGroup.prototype = {
	ascent: null
	,descent: null
	,endIndex: null
	,format: null
	,height: null
	,leading: null
	,lineIndex: null
	,offsetX: null
	,offsetY: null
	,positions: null
	,startIndex: null
	,width: null
	,getAdvance: function(index) {
		return this.positions[index];
	}
	,__class__: openfl_text__$internal_TextLayoutGroup
};
var openfl_ui_GameInput = function() {
	openfl_events_EventDispatcher.call(this);
	openfl_ui_GameInput.__instances.push(this);
};
$hxClasses["openfl.ui.GameInput"] = openfl_ui_GameInput;
openfl_ui_GameInput.__name__ = "openfl.ui.GameInput";
openfl_ui_GameInput.getDeviceAt = function(index) {
	if(index >= 0 && index < openfl_ui_GameInput.__deviceList.length) {
		return openfl_ui_GameInput.__deviceList[index];
	}
	return null;
};
openfl_ui_GameInput.__getDevice = function(gamepad) {
	if(gamepad == null) {
		return null;
	}
	if(openfl_ui_GameInput.__devices.h.__keys__[gamepad.__id__] == null) {
		var devices = lime_ui_Joystick.__getDeviceData();
		var device = devices[gamepad.id].id;
		var devices = lime_ui_Joystick.__getDeviceData();
		var device1 = new openfl_ui_GameInputDevice(device,devices[gamepad.id].id);
		openfl_ui_GameInput.__deviceList.push(device1);
		openfl_ui_GameInput.__devices.set(gamepad,device1);
		openfl_ui_GameInput.numDevices = openfl_ui_GameInput.__deviceList.length;
	}
	return openfl_ui_GameInput.__devices.h[gamepad.__id__];
};
openfl_ui_GameInput.__onGamepadAxisMove = function(gamepad,axis,value) {
	var device = openfl_ui_GameInput.__getDevice(gamepad);
	if(device == null) {
		return;
	}
	if(device.enabled) {
		if(!device.__axis.h.hasOwnProperty(axis)) {
			var control;
			if(axis == null) {
				control = "null";
			} else {
				switch(axis) {
				case 0:
					control = "LEFT_X";
					break;
				case 1:
					control = "LEFT_Y";
					break;
				case 2:
					control = "RIGHT_X";
					break;
				case 3:
					control = "RIGHT_Y";
					break;
				case 4:
					control = "TRIGGER_LEFT";
					break;
				case 5:
					control = "TRIGGER_RIGHT";
					break;
				default:
					control = "UNKNOWN (" + axis + ")";
				}
			}
			var control1 = new openfl_ui_GameInputControl(device,"AXIS_" + control,-1,1);
			device.__axis.h[axis] = control1;
			device.__controls.push(control1);
		}
		var control = device.__axis.h[axis];
		control.value = value;
		control.dispatchEvent(new openfl_events_Event("change"));
	}
};
openfl_ui_GameInput.__onGamepadButtonDown = function(gamepad,button) {
	var device = openfl_ui_GameInput.__getDevice(gamepad);
	if(device == null) {
		return;
	}
	if(device.enabled) {
		if(!device.__button.h.hasOwnProperty(button)) {
			var control;
			if(button == null) {
				control = "null";
			} else {
				switch(button) {
				case 0:
					control = "A";
					break;
				case 1:
					control = "B";
					break;
				case 2:
					control = "X";
					break;
				case 3:
					control = "Y";
					break;
				case 4:
					control = "BACK";
					break;
				case 5:
					control = "GUIDE";
					break;
				case 6:
					control = "START";
					break;
				case 7:
					control = "LEFT_STICK";
					break;
				case 8:
					control = "RIGHT_STICK";
					break;
				case 9:
					control = "LEFT_SHOULDER";
					break;
				case 10:
					control = "RIGHT_SHOULDER";
					break;
				case 11:
					control = "DPAD_UP";
					break;
				case 12:
					control = "DPAD_DOWN";
					break;
				case 13:
					control = "DPAD_LEFT";
					break;
				case 14:
					control = "DPAD_RIGHT";
					break;
				default:
					control = "UNKNOWN (" + button + ")";
				}
			}
			var control1 = new openfl_ui_GameInputControl(device,"BUTTON_" + control,0,1);
			device.__button.h[button] = control1;
			device.__controls.push(control1);
		}
		var control = device.__button.h[button];
		control.value = 1;
		control.dispatchEvent(new openfl_events_Event("change"));
	}
};
openfl_ui_GameInput.__onGamepadButtonUp = function(gamepad,button) {
	var device = openfl_ui_GameInput.__getDevice(gamepad);
	if(device == null) {
		return;
	}
	if(device.enabled) {
		if(!device.__button.h.hasOwnProperty(button)) {
			var control;
			if(button == null) {
				control = "null";
			} else {
				switch(button) {
				case 0:
					control = "A";
					break;
				case 1:
					control = "B";
					break;
				case 2:
					control = "X";
					break;
				case 3:
					control = "Y";
					break;
				case 4:
					control = "BACK";
					break;
				case 5:
					control = "GUIDE";
					break;
				case 6:
					control = "START";
					break;
				case 7:
					control = "LEFT_STICK";
					break;
				case 8:
					control = "RIGHT_STICK";
					break;
				case 9:
					control = "LEFT_SHOULDER";
					break;
				case 10:
					control = "RIGHT_SHOULDER";
					break;
				case 11:
					control = "DPAD_UP";
					break;
				case 12:
					control = "DPAD_DOWN";
					break;
				case 13:
					control = "DPAD_LEFT";
					break;
				case 14:
					control = "DPAD_RIGHT";
					break;
				default:
					control = "UNKNOWN (" + button + ")";
				}
			}
			var control1 = new openfl_ui_GameInputControl(device,"BUTTON_" + control,0,1);
			device.__button.h[button] = control1;
			device.__controls.push(control1);
		}
		var control = device.__button.h[button];
		control.value = 0;
		control.dispatchEvent(new openfl_events_Event("change"));
	}
};
openfl_ui_GameInput.__onGamepadConnect = function(gamepad) {
	var device = openfl_ui_GameInput.__getDevice(gamepad);
	if(device == null) {
		return;
	}
	var _g = 0;
	var _g1 = openfl_ui_GameInput.__instances;
	while(_g < _g1.length) {
		var instance = _g1[_g];
		++_g;
		instance.dispatchEvent(new openfl_events_GameInputEvent("deviceAdded",true,false,device));
	}
};
openfl_ui_GameInput.__onGamepadDisconnect = function(gamepad) {
	var device = openfl_ui_GameInput.__devices.h[gamepad.__id__];
	if(device != null) {
		if(openfl_ui_GameInput.__devices.h.__keys__[gamepad.__id__] != null) {
			HxOverrides.remove(openfl_ui_GameInput.__deviceList,openfl_ui_GameInput.__devices.h[gamepad.__id__]);
			openfl_ui_GameInput.__devices.remove(gamepad);
		}
		openfl_ui_GameInput.numDevices = openfl_ui_GameInput.__deviceList.length;
		var _g = 0;
		var _g1 = openfl_ui_GameInput.__instances;
		while(_g < _g1.length) {
			var instance = _g1[_g];
			++_g;
			instance.dispatchEvent(new openfl_events_GameInputEvent("deviceRemoved",true,false,device));
		}
	}
};
openfl_ui_GameInput.__super__ = openfl_events_EventDispatcher;
openfl_ui_GameInput.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	addEventListener: function(type,listener,useCapture,priority,useWeakReference) {
		if(useWeakReference == null) {
			useWeakReference = false;
		}
		if(priority == null) {
			priority = 0;
		}
		if(useCapture == null) {
			useCapture = false;
		}
		openfl_events_EventDispatcher.prototype.addEventListener.call(this,type,listener,useCapture,priority,useWeakReference);
		if(type == "deviceAdded") {
			var _g = 0;
			var _g1 = openfl_ui_GameInput.__deviceList;
			while(_g < _g1.length) {
				var device = _g1[_g];
				++_g;
				this.dispatchEvent(new openfl_events_GameInputEvent("deviceAdded",true,false,device));
			}
		}
	}
	,__class__: openfl_ui_GameInput
});
var openfl_ui_GameInputControl = function(device,id,minValue,maxValue,value) {
	if(value == null) {
		value = 0;
	}
	openfl_events_EventDispatcher.call(this);
	this.device = device;
	this.id = id;
	this.minValue = minValue;
	this.maxValue = maxValue;
	this.value = value;
};
$hxClasses["openfl.ui.GameInputControl"] = openfl_ui_GameInputControl;
openfl_ui_GameInputControl.__name__ = "openfl.ui.GameInputControl";
openfl_ui_GameInputControl.__super__ = openfl_events_EventDispatcher;
openfl_ui_GameInputControl.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	device: null
	,id: null
	,maxValue: null
	,minValue: null
	,value: null
	,__class__: openfl_ui_GameInputControl
});
var openfl_ui_GameInputDevice = function(id,name) {
	this.__controls = [];
	this.__button = new haxe_ds_IntMap();
	this.__axis = new haxe_ds_IntMap();
	this.id = id;
	this.name = name;
	var control;
	control = new openfl_ui_GameInputControl(this,"AXIS_" + 0,-1,1);
	this.__axis.h[0] = control;
	this.__controls.push(control);
	control = new openfl_ui_GameInputControl(this,"AXIS_" + 1,-1,1);
	this.__axis.h[1] = control;
	this.__controls.push(control);
	control = new openfl_ui_GameInputControl(this,"AXIS_" + 2,-1,1);
	this.__axis.h[2] = control;
	this.__controls.push(control);
	control = new openfl_ui_GameInputControl(this,"AXIS_" + 3,-1,1);
	this.__axis.h[3] = control;
	this.__controls.push(control);
	control = new openfl_ui_GameInputControl(this,"AXIS_" + 4,-1,1);
	this.__axis.h[4] = control;
	this.__controls.push(control);
	control = new openfl_ui_GameInputControl(this,"AXIS_" + 5,-1,1);
	this.__axis.h[5] = control;
	this.__controls.push(control);
	var _g = 0;
	while(_g < 15) {
		var i = _g++;
		control = new openfl_ui_GameInputControl(this,"BUTTON_" + i,0,1);
		this.__button.h[i] = control;
		this.__controls.push(control);
	}
};
$hxClasses["openfl.ui.GameInputDevice"] = openfl_ui_GameInputDevice;
openfl_ui_GameInputDevice.__name__ = "openfl.ui.GameInputDevice";
openfl_ui_GameInputDevice.prototype = {
	enabled: null
	,id: null
	,name: null
	,sampleInterval: null
	,__axis: null
	,__button: null
	,__controls: null
	,__gamepad: null
	,getCachedSamples: function(data,append) {
		if(append == null) {
			append = false;
		}
		return 0;
	}
	,getControlAt: function(i) {
		if(i >= 0 && i < this.__controls.length) {
			return this.__controls[i];
		}
		return null;
	}
	,startCachingSamples: function(numSamples,controls) {
	}
	,stopCachingSamples: function() {
	}
	,get_numControls: function() {
		return this.__controls.length;
	}
	,__class__: openfl_ui_GameInputDevice
	,__properties__: {get_numControls:"get_numControls"}
};
var openfl_ui_Keyboard = function() { };
$hxClasses["openfl.ui.Keyboard"] = openfl_ui_Keyboard;
openfl_ui_Keyboard.__name__ = "openfl.ui.Keyboard";
openfl_ui_Keyboard.capsLock = null;
openfl_ui_Keyboard.numLock = null;
openfl_ui_Keyboard.isAccessible = function() {
	return false;
};
openfl_ui_Keyboard.__convertKeyCode = function(key) {
	switch(key) {
	case 8:
		return 8;
	case 9:
		return 9;
	case 13:
		return 13;
	case 27:
		return 27;
	case 32:
		return 32;
	case 33:
		return 49;
	case 34:
		return 222;
	case 35:
		return 51;
	case 36:
		return 52;
	case 37:
		return 53;
	case 38:
		return 55;
	case 39:
		return 222;
	case 40:
		return 57;
	case 41:
		return 48;
	case 42:
		return 56;
	case 44:
		return 188;
	case 45:
		return 189;
	case 46:
		return 190;
	case 47:
		return 191;
	case 48:
		return 48;
	case 49:
		return 49;
	case 50:
		return 50;
	case 51:
		return 51;
	case 52:
		return 52;
	case 53:
		return 53;
	case 54:
		return 54;
	case 55:
		return 55;
	case 56:
		return 56;
	case 57:
		return 57;
	case 58:
		return 186;
	case 59:
		return 186;
	case 60:
		return 60;
	case 61:
		return 187;
	case 62:
		return 190;
	case 63:
		return 191;
	case 64:
		return 50;
	case 91:
		return 219;
	case 92:
		return 220;
	case 93:
		return 221;
	case 94:
		return 54;
	case 95:
		return 189;
	case 96:
		return 192;
	case 97:
		return 65;
	case 98:
		return 66;
	case 99:
		return 67;
	case 100:
		return 68;
	case 101:
		return 69;
	case 102:
		return 70;
	case 103:
		return 71;
	case 104:
		return 72;
	case 105:
		return 73;
	case 106:
		return 74;
	case 107:
		return 75;
	case 108:
		return 76;
	case 109:
		return 77;
	case 110:
		return 78;
	case 111:
		return 79;
	case 112:
		return 80;
	case 113:
		return 81;
	case 114:
		return 82;
	case 115:
		return 83;
	case 116:
		return 84;
	case 117:
		return 85;
	case 118:
		return 86;
	case 119:
		return 87;
	case 120:
		return 88;
	case 121:
		return 89;
	case 122:
		return 90;
	case 127:
		return 46;
	case 1073741881:
		return 20;
	case 1073741882:
		return 112;
	case 1073741883:
		return 113;
	case 1073741884:
		return 114;
	case 1073741885:
		return 115;
	case 1073741886:
		return 116;
	case 1073741887:
		return 117;
	case 1073741888:
		return 118;
	case 1073741889:
		return 119;
	case 1073741890:
		return 120;
	case 1073741891:
		return 121;
	case 1073741892:
		return 122;
	case 1073741893:
		return 123;
	case 1073741894:
		return 301;
	case 1073741895:
		return 145;
	case 1073741896:
		return 19;
	case 1073741897:
		return 45;
	case 1073741898:
		return 36;
	case 1073741899:
		return 33;
	case 1073741901:
		return 35;
	case 1073741902:
		return 34;
	case 1073741903:
		return 39;
	case 1073741904:
		return 37;
	case 1073741905:
		return 40;
	case 1073741906:
		return 38;
	case 1073741907:
		return 144;
	case 1073741908:
		return 111;
	case 1073741909:
		return 106;
	case 1073741910:
		return 109;
	case 1073741911:
		return 107;
	case 1073741912:
		return 13;
	case 1073741913:
		return 97;
	case 1073741914:
		return 98;
	case 1073741915:
		return 99;
	case 1073741916:
		return 100;
	case 1073741917:
		return 101;
	case 1073741918:
		return 102;
	case 1073741919:
		return 103;
	case 1073741920:
		return 104;
	case 1073741921:
		return 105;
	case 1073741922:
		return 96;
	case 1073741923:
		return 110;
	case 1073741925:
		return 302;
	case 1073741928:
		return 124;
	case 1073741929:
		return 125;
	case 1073741930:
		return 126;
	case 1073741982:
		return 13;
	case 1073742044:
		return 110;
	case 1073742048:
		return 17;
	case 1073742049:
		return 16;
	case 1073742050:
		return 18;
	case 1073742051:
		return 15;
	case 1073742052:
		return 17;
	case 1073742053:
		return 16;
	case 1073742054:
		return 18;
	case 1073742055:
		return 15;
	default:
		return key;
	}
};
openfl_ui_Keyboard.__getCharCode = function(key,shift) {
	if(shift == null) {
		shift = false;
	}
	if(!shift) {
		switch(key) {
		case 8:
			return 8;
		case 9:
			return 9;
		case 13:
			return 13;
		case 27:
			return 27;
		case 32:
			return 32;
		case 186:
			return 59;
		case 187:
			return 61;
		case 188:
			return 44;
		case 189:
			return 45;
		case 190:
			return 46;
		case 191:
			return 47;
		case 192:
			return 96;
		case 219:
			return 91;
		case 220:
			return 92;
		case 221:
			return 93;
		case 222:
			return 39;
		}
		if(key >= 48 && key <= 57) {
			return key - 48 + 48;
		}
		if(key >= 65 && key <= 90) {
			return key - 65 + 97;
		}
	} else {
		switch(key) {
		case 48:
			return 41;
		case 49:
			return 33;
		case 50:
			return 64;
		case 51:
			return 35;
		case 52:
			return 36;
		case 53:
			return 37;
		case 54:
			return 94;
		case 55:
			return 38;
		case 56:
			return 42;
		case 57:
			return 40;
		case 186:
			return 58;
		case 187:
			return 43;
		case 188:
			return 60;
		case 189:
			return 95;
		case 190:
			return 62;
		case 191:
			return 63;
		case 192:
			return 126;
		case 219:
			return 123;
		case 220:
			return 124;
		case 221:
			return 125;
		case 222:
			return 34;
		}
		if(key >= 65 && key <= 90) {
			return key - 65 + 65;
		}
	}
	if(key >= 96 && key <= 105) {
		return key - 96 + 48;
	}
	switch(key) {
	case 8:
		return 8;
	case 13:
		return 13;
	case 46:
		return 127;
	case 106:
		return 42;
	case 107:
		return 43;
	case 108:
		return 44;
	case 110:
		return 45;
	case 111:
		return 46;
	}
	return 0;
};
openfl_ui_Keyboard.__getKeyLocation = function(key) {
	switch(key) {
	case 1073741908:case 1073741909:case 1073741910:case 1073741911:case 1073741912:case 1073741913:case 1073741914:case 1073741915:case 1073741916:case 1073741917:case 1073741918:case 1073741919:case 1073741920:case 1073741921:case 1073741922:case 1073741923:case 1073742044:
		return 3;
	case 1073742048:case 1073742049:case 1073742050:case 1073742051:
		return 1;
	case 1073742052:case 1073742053:case 1073742054:case 1073742055:
		return 2;
	default:
		return 0;
	}
};
var openfl_ui_Mouse = function() { };
$hxClasses["openfl.ui.Mouse"] = openfl_ui_Mouse;
openfl_ui_Mouse.__name__ = "openfl.ui.Mouse";
openfl_ui_Mouse.__properties__ = {set_cursor:"set_cursor",get_cursor:"get_cursor"};
openfl_ui_Mouse.__hidden = null;
openfl_ui_Mouse.hide = function() {
	openfl_ui_Mouse.__hidden = true;
	var _g = 0;
	var _g1 = lime_app_Application.current.__windows;
	while(_g < _g1.length) {
		var $window = _g1[_g];
		++_g;
		$window.set_cursor(null);
	}
};
openfl_ui_Mouse.show = function() {
	openfl_ui_Mouse.__hidden = false;
	var cacheCursor = openfl_ui_Mouse.__cursor;
	openfl_ui_Mouse.__cursor = null;
	openfl_ui_Mouse.set_cursor(cacheCursor);
};
openfl_ui_Mouse.get_cursor = function() {
	return openfl_ui_Mouse.__cursor;
};
openfl_ui_Mouse.set_cursor = function(value) {
	if(value == null) {
		value = "auto";
	}
	var setCursor = null;
	switch(value) {
	case "arrow":
		setCursor = lime_ui_MouseCursor.ARROW;
		break;
	case "button":
		setCursor = lime_ui_MouseCursor.POINTER;
		break;
	case "crosshair":
		setCursor = lime_ui_MouseCursor.CROSSHAIR;
		break;
	case "custom":
		setCursor = lime_ui_MouseCursor.CUSTOM;
		break;
	case "hand":
		setCursor = lime_ui_MouseCursor.MOVE;
		break;
	case "ibeam":
		setCursor = lime_ui_MouseCursor.TEXT;
		break;
	case "resize_nesw":
		setCursor = lime_ui_MouseCursor.RESIZE_NESW;
		break;
	case "resize_ns":
		setCursor = lime_ui_MouseCursor.RESIZE_NS;
		break;
	case "resize_nwse":
		setCursor = lime_ui_MouseCursor.RESIZE_NWSE;
		break;
	case "resize_we":
		setCursor = lime_ui_MouseCursor.RESIZE_WE;
		break;
	case "wait":
		setCursor = lime_ui_MouseCursor.WAIT;
		break;
	case "waitarrow":
		setCursor = lime_ui_MouseCursor.WAIT_ARROW;
		break;
	default:
	}
	if(setCursor != null && !openfl_ui_Mouse.__hidden) {
		var _g = 0;
		var _g1 = lime_app_Application.current.__windows;
		while(_g < _g1.length) {
			var $window = _g1[_g];
			++_g;
			$window.set_cursor(setCursor);
		}
	}
	return openfl_ui_Mouse.__cursor = value;
};
var openfl_ui_MouseCursor = {};
openfl_ui_MouseCursor.fromLimeCursor = function(cursor) {
	switch(cursor._hx_index) {
	case 0:
		return "arrow";
	case 1:
		return "crosshair";
	case 2:
		return "auto";
	case 3:
		return "hand";
	case 4:
		return "button";
	case 5:
		return "resize_nesw";
	case 6:
		return "resize_ns";
	case 7:
		return "resize_nwse";
	case 8:
		return "resize_we";
	case 9:
		return "ibeam";
	case 10:
		return "wait";
	case 11:
		return "waitarrow";
	case 12:
		return "custom";
	}
};
openfl_ui_MouseCursor.toLimeCursor = function(this1) {
	switch(this1) {
	case "arrow":
		return lime_ui_MouseCursor.ARROW;
	case "auto":
		return lime_ui_MouseCursor.DEFAULT;
	case "button":
		return lime_ui_MouseCursor.POINTER;
	case "crosshair":
		return lime_ui_MouseCursor.CROSSHAIR;
	case "custom":
		return lime_ui_MouseCursor.CUSTOM;
	case "hand":
		return lime_ui_MouseCursor.MOVE;
	case "ibeam":
		return lime_ui_MouseCursor.TEXT;
	case "resize_nesw":
		return lime_ui_MouseCursor.RESIZE_NESW;
	case "resize_ns":
		return lime_ui_MouseCursor.RESIZE_NS;
	case "resize_nwse":
		return lime_ui_MouseCursor.RESIZE_NWSE;
	case "resize_we":
		return lime_ui_MouseCursor.RESIZE_WE;
	case "wait":
		return lime_ui_MouseCursor.WAIT;
	case "waitarrow":
		return lime_ui_MouseCursor.WAIT_ARROW;
	default:
		return lime_ui_MouseCursor.DEFAULT;
	}
};
var openfl_ui_Multitouch = function() { };
$hxClasses["openfl.ui.Multitouch"] = openfl_ui_Multitouch;
openfl_ui_Multitouch.__name__ = "openfl.ui.Multitouch";
openfl_ui_Multitouch.__properties__ = {get_supportsTouchEvents:"get_supportsTouchEvents"};
openfl_ui_Multitouch.inputMode = null;
openfl_ui_Multitouch.maxTouchPoints = null;
openfl_ui_Multitouch.supportedGestures = null;
openfl_ui_Multitouch.supportsGestureEvents = null;
openfl_ui_Multitouch.get_supportsTouchEvents = function() {
	if(('ontouchstart' in document.documentElement) || (window.DocumentTouch && document instanceof DocumentTouch)) {
		return true;
	}
	return false;
};
var openfl_ui_MultitouchInputMode = {};
openfl_ui_MultitouchInputMode.fromString = function(value) {
	switch(value) {
	case "gesture":
		return 0;
	case "none":
		return 1;
	case "touchPoint":
		return 2;
	default:
		return null;
	}
};
openfl_ui_MultitouchInputMode.toString = function(this1) {
	switch(this1) {
	case 0:
		return "gesture";
	case 1:
		return "none";
	case 2:
		return "touchPoint";
	default:
		return null;
	}
};
var openfl_utils_AGALMiniAssembler = function(debugging) {
	if(debugging == null) {
		debugging = false;
	}
	this.debugEnabled = false;
	this.debugEnabled = debugging;
	if(!openfl_utils_AGALMiniAssembler.initialized) {
		openfl_utils_AGALMiniAssembler.init();
	}
};
$hxClasses["openfl.utils.AGALMiniAssembler"] = openfl_utils_AGALMiniAssembler;
openfl_utils_AGALMiniAssembler.__name__ = "openfl.utils.AGALMiniAssembler";
openfl_utils_AGALMiniAssembler.init = function() {
	openfl_utils_AGALMiniAssembler.initialized = true;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("mov",2,0,0);
	this1.h["mov"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("add",3,1,0);
	this1.h["add"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("sub",3,2,0);
	this1.h["sub"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("mul",3,3,0);
	this1.h["mul"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("div",3,4,0);
	this1.h["div"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("rcp",2,5,0);
	this1.h["rcp"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("min",3,6,0);
	this1.h["min"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("max",3,7,0);
	this1.h["max"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("frc",2,8,0);
	this1.h["frc"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("sqt",2,9,0);
	this1.h["sqt"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("rsq",2,10,0);
	this1.h["rsq"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("pow",3,11,0);
	this1.h["pow"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("log",2,12,0);
	this1.h["log"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("exp",2,13,0);
	this1.h["exp"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("nrm",2,14,0);
	this1.h["nrm"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("sin",2,15,0);
	this1.h["sin"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("cos",2,16,0);
	this1.h["cos"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("crs",3,17,0);
	this1.h["crs"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("dp3",3,18,0);
	this1.h["dp3"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("dp4",3,19,0);
	this1.h["dp4"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("abs",2,20,0);
	this1.h["abs"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("neg",2,21,0);
	this1.h["neg"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("sat",2,22,0);
	this1.h["sat"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("m33",3,23,16);
	this1.h["m33"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("m44",3,24,16);
	this1.h["m44"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("m34",3,25,16);
	this1.h["m34"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("ddx",2,26,288);
	this1.h["ddx"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("ddy",2,27,288);
	this1.h["ddy"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("ife",2,28,897);
	this1.h["ife"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("ine",2,29,897);
	this1.h["ine"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("ifg",2,30,897);
	this1.h["ifg"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("ifl",2,31,897);
	this1.h["ifl"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("els",0,32,1921);
	this1.h["els"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("eif",0,33,1409);
	this1.h["eif"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("kil",1,39,160);
	this1.h["kil"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("tex",3,40,40);
	this1.h["tex"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("sge",3,41,0);
	this1.h["sge"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("slt",3,42,0);
	this1.h["slt"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("sgn",2,43,0);
	this1.h["sgn"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("seq",3,44,0);
	this1.h["seq"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("sne",3,45,0);
	this1.h["sne"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("rgba",8,0);
	this1.h["rgba"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("compressed",8,1);
	this1.h["compressed"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("compressedalpha",8,2);
	this1.h["compressedalpha"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("dxt1",8,1);
	this1.h["dxt1"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("dxt5",8,2);
	this1.h["dxt5"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("video",8,3);
	this1.h["video"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("2d",12,0);
	this1.h["2d"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("3d",12,2);
	this1.h["3d"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("cube",12,1);
	this1.h["cube"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("mipnearest",24,1);
	this1.h["mipnearest"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("miplinear",24,2);
	this1.h["miplinear"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("mipnone",24,0);
	this1.h["mipnone"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("nomip",24,0);
	this1.h["nomip"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("nearest",28,0);
	this1.h["nearest"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("linear",28,1);
	this1.h["linear"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("anisotropic2x",28,2);
	this1.h["anisotropic2x"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("anisotropic4x",28,3);
	this1.h["anisotropic4x"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("anisotropic8x",28,4);
	this1.h["anisotropic8x"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("anisotropic16x",28,5);
	this1.h["anisotropic16x"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("centroid",16,1);
	this1.h["centroid"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("single",16,2);
	this1.h["single"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("ignoresampler",16,4);
	this1.h["ignoresampler"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("repeat",20,1);
	this1.h["repeat"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("wrap",20,1);
	this1.h["wrap"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("clamp",20,0);
	this1.h["clamp"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("clamp_u_repeat_v",20,2);
	this1.h["clamp_u_repeat_v"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("repeat_u_clamp_v",20,3);
	this1.h["repeat_u_clamp_v"] = v;
};
openfl_utils_AGALMiniAssembler.prototype = {
	agalcode: null
	,error: null
	,verbose: null
	,debugEnabled: null
	,assemble2: function(context3D,version,vertexSource,fragmentSource) {
		var agalVertex = this.assemble("vertex",vertexSource,version);
		var agalFragment = this.assemble("fragment",fragmentSource,version);
		var program = context3D.createProgram();
		program.upload(agalVertex,agalFragment);
		return program;
	}
	,assemble: function(mode,source,version,ignoreLimits) {
		if(ignoreLimits == null) {
			ignoreLimits = false;
		}
		if(version == null) {
			version = 1;
		}
		var start = openfl_Lib.getTimer();
		var this1 = new openfl_utils_ByteArrayData(0);
		this.agalcode = this1;
		this.error = "";
		var isFrag = false;
		if(mode == "fragment") {
			isFrag = true;
		} else if(mode != "vertex") {
			this.error = "ERROR: mode needs to be \"" + "fragment" + "\" or \"" + "vertex" + "\" but is \"" + mode + "\".";
		}
		this.agalcode.__endian = 1;
		this.agalcode.writeByte(160);
		this.agalcode.writeUnsignedInt(version);
		this.agalcode.writeByte(161);
		this.agalcode.writeByte(isFrag ? 1 : 0);
		this.initregmap(version,ignoreLimits);
		var lines = StringTools.replace(source,"\r","\n").split("\n");
		var nops = 0;
		var lng = lines.length;
		var reg1 = new EReg("<.*>","g");
		var reg2 = new EReg("([\\w\\.\\-\\+]+)","gi");
		var reg3 = new EReg("^\\w{3}","ig");
		var reg4 = new EReg("vc\\[([vofi][acostdip]?[d]?)(\\d*)?(\\.[xyzw](\\+\\d{1,3})?)?\\](\\.[xyzw]{1,4})?|([vofi][acostdip]?[d]?)(\\d*)?(\\.[xyzw]{1,4})?","gi");
		var reg5 = new EReg("\\[.*\\]","ig");
		var reg6 = new EReg("^\\b[A-Za-z]{1,3}","ig");
		var reg7 = new EReg("\\d+","");
		var reg8 = new EReg("(\\.[xyzw]{1,4})","");
		var reg9 = new EReg("[A-Za-z]{1,3}","ig");
		var reg10 = new EReg("(\\.[xyzw]{1,1})","");
		var reg11 = new EReg("\\+\\d{1,3}","ig");
		var i = 0;
		while(i < lng && this.error == "") {
			var line = StringTools.trim(lines[i]);
			var startcomment = line.indexOf("//");
			if(startcomment != -1) {
				line = HxOverrides.substr(line,0,startcomment);
			}
			var optsi = reg1.match(line) ? reg1.matchedPos().pos : -1;
			var opts = null;
			if(optsi != -1) {
				opts = this.match(HxOverrides.substr(line,optsi,null),reg2);
				line = HxOverrides.substr(line,0,optsi);
			}
			var opCode = null;
			var opFound = null;
			if(reg3.match(line)) {
				opCode = reg3.matched(0);
				opFound = openfl_utils_AGALMiniAssembler.OPMAP.h[opCode];
			}
			if(opFound == null) {
				if(line.length >= 3) {
					lime_utils_Log.warn("warning: bad line " + i + ": " + lines[i],{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 262, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
				}
				++i;
				continue;
			}
			if(this.debugEnabled) {
				lime_utils_Log.info(opFound,{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 272, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
			}
			if(opFound == null) {
				if(line.length >= 3) {
					lime_utils_Log.warn("warning: bad line " + i + ": " + lines[i],{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 279, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
				}
				++i;
				continue;
			}
			line = HxOverrides.substr(line,line.indexOf(opFound.name) + opFound.name.length,null);
			if((opFound.flags & 256) != 0 && version < 2) {
				this.error = "error: opcode requires version 2.";
				break;
			}
			if((opFound.flags & 64) != 0 && isFrag) {
				this.error = "error: opcode is only allowed in vertex programs.";
				break;
			}
			if((opFound.flags & 32) != 0 && !isFrag) {
				this.error = "error: opcode is only allowed in fragment programs.";
				break;
			}
			if(this.verbose) {
				lime_utils_Log.info("emit opcode=" + Std.string(opFound),{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 308, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
			}
			this.agalcode.writeUnsignedInt(opFound.emitCode);
			++nops;
			if(nops > 4096) {
				this.error = "error: too many opcodes. maximum is " + 4096 + ".";
				break;
			}
			var regs = this.match(line,reg4);
			if(regs.length != opFound.numRegister) {
				this.error = "error: wrong number of operands. found " + regs.length + " but expected " + opFound.numRegister + ".";
				break;
			}
			var badreg = false;
			var pad = 160;
			var regLength = regs.length;
			var _g = 0;
			var _g1 = regLength;
			while(_g < _g1) {
				var j = _g++;
				var isRelative = false;
				var relreg = this.match(regs[j],reg5);
				if(relreg.length > 0) {
					regs[j] = StringTools.replace(regs[j],relreg[0],"0");
					if(this.verbose) {
						lime_utils_Log.info("IS REL",{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 344, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
					}
					isRelative = true;
				}
				var res = this.match(regs[j],reg6);
				if(res.length == 0) {
					this.error = "error: could not parse operand " + j + " (" + regs[j] + ").";
					badreg = true;
					break;
				}
				var regFound = openfl_utils_AGALMiniAssembler.REGMAP.h[res[0]];
				if(this.debugEnabled) {
					lime_utils_Log.info(regFound,{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 363, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
				}
				if(regFound == null) {
					this.error = "error: could not find register name for operand " + j + " (" + regs[j] + ").";
					badreg = true;
					break;
				}
				if(isFrag) {
					if((regFound.flags & 32) == 0) {
						this.error = "error: register operand " + j + " (" + regs[j] + ") only allowed in vertex programs.";
						badreg = true;
						break;
					}
					if(isRelative) {
						this.error = "error: register operand " + j + " (" + regs[j] + ") relative adressing not allowed in fragment programs.";
						badreg = true;
						break;
					}
				} else if((regFound.flags & 64) == 0) {
					this.error = "error: register operand " + j + " (" + regs[j] + ") only allowed in fragment programs.";
					badreg = true;
					break;
				}
				regs[j] = HxOverrides.substr(regs[j],regs[j].indexOf(regFound.name) + regFound.name.length,null);
				var idxmatch = isRelative ? this.match(relreg[0],reg7) : this.match(regs[j],reg7);
				var regidx = 0;
				if(idxmatch.length > 0) {
					regidx = Std.parseInt(idxmatch[0]);
				}
				if(UInt.gt(regidx,regFound.range)) {
					var tmp = regFound.range + 1;
					this.error = "error: register operand " + j + " (" + regs[j] + ") index exceeds limit of " + (tmp == null ? "null" : Std.string(UInt.toFloat(tmp))) + ".";
					badreg = true;
					break;
				}
				var regmask = 0;
				var maskmatch = this.match(regs[j],reg8);
				var isDest = j == 0 && (opFound.flags & 128) == 0;
				var isSampler = j == 2 && (opFound.flags & 8) != 0;
				var reltype = 0;
				var relsel = 0;
				var reloffset = 0;
				if(isDest && isRelative) {
					this.error = "error: relative can not be destination";
					badreg = true;
					break;
				}
				if(maskmatch.length > 0) {
					regmask = 0;
					var cv = 0;
					var maskLength = maskmatch[0].length;
					var k = 1;
					while(k < maskLength) {
						cv = HxOverrides.cca(maskmatch[0],k) - 120;
						if(UInt.gt(cv,2)) {
							cv = 3;
						}
						if(isDest) {
							regmask |= 1 << cv;
						} else {
							regmask = regmask | cv << (k - 1 << 1);
						}
						++k;
					}
					if(!isDest) {
						while(k <= 4) {
							regmask = regmask | cv << (k - 1 << 1);
							++k;
						}
					}
				} else {
					regmask = isDest ? 15 : 228;
				}
				if(isRelative) {
					var relname = this.match(relreg[0],reg9);
					var regFoundRel = openfl_utils_AGALMiniAssembler.REGMAP.h[relname[0]];
					if(regFoundRel == null) {
						this.error = "error: bad index register";
						badreg = true;
						break;
					}
					reltype = regFoundRel.emitCode;
					var selmatch = this.match(relreg[0],reg10);
					if(selmatch.length == 0) {
						this.error = "error: bad index register select";
						badreg = true;
						break;
					}
					relsel = HxOverrides.cca(selmatch[0],1) - 120;
					if(UInt.gt(relsel,2)) {
						relsel = 3;
					}
					var relofs = this.match(relreg[0],reg11);
					if(relofs.length > 0) {
						reloffset = Std.parseInt(relofs[0]);
					}
					if(reloffset < 0 || reloffset > 255) {
						this.error = "error: index offset " + reloffset + " out of bounds. [0..255]";
						badreg = true;
						break;
					}
					if(this.verbose) {
						lime_utils_Log.info("RELATIVE: type=" + reltype + "==" + relname[0] + " sel=" + (relsel == null ? "null" : Std.string(UInt.toFloat(relsel))) + "==" + selmatch[0] + " idx=" + (regidx == null ? "null" : Std.string(UInt.toFloat(regidx))) + " offset=" + reloffset,{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 518, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
					}
				}
				if(this.verbose) {
					lime_utils_Log.info("  emit argcode=" + Std.string(regFound) + "[" + (regidx == null ? "null" : Std.string(UInt.toFloat(regidx))) + "][" + regmask + "]",{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 525, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
				}
				if(isDest) {
					this.agalcode.writeShort(regidx);
					this.agalcode.writeByte(regmask);
					this.agalcode.writeByte(regFound.emitCode);
					pad -= 32;
				} else if(isSampler) {
					if(this.verbose) {
						lime_utils_Log.info("  emit sampler",{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 541, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
					}
					var samplerbits = 5;
					var optsLength = opts == null ? 0 : opts.length;
					var bias = 0.0;
					var _g2 = 0;
					var _g3 = optsLength;
					while(_g2 < _g3) {
						var k1 = _g2++;
						if(this.verbose) {
							lime_utils_Log.info("    opt: " + opts[k1],{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 552, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
						}
						var optfound = openfl_utils_AGALMiniAssembler.SAMPLEMAP.h[opts[k1]];
						if(optfound == null) {
							bias = parseFloat(opts[k1]);
							if(this.verbose) {
								lime_utils_Log.info("    bias: " + bias,{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 565, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
							}
						} else {
							if(optfound.flag != 16) {
								samplerbits &= ~(15 << optfound.flag);
							}
							samplerbits = samplerbits | optfound.mask << optfound.flag;
						}
					}
					this.agalcode.writeShort(regidx);
					this.agalcode.writeByte(bias * 8.0 | 0);
					this.agalcode.writeByte(0);
					this.agalcode.writeUnsignedInt(samplerbits);
					if(this.verbose) {
						lime_utils_Log.info("    bits: " + (samplerbits - 5),{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 586, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
					}
					pad -= 64;
				} else {
					if(j == 0) {
						this.agalcode.writeUnsignedInt(0);
						pad -= 32;
					}
					this.agalcode.writeShort(regidx);
					this.agalcode.writeByte(reloffset);
					this.agalcode.writeByte(regmask);
					this.agalcode.writeByte(regFound.emitCode);
					this.agalcode.writeByte(reltype);
					this.agalcode.writeShort(isRelative ? relsel | 32768 : 0);
					pad -= 64;
				}
			}
			var j1 = 0;
			while(j1 < pad) {
				this.agalcode.writeByte(0);
				j1 += 8;
			}
			if(badreg) {
				break;
			}
			++i;
		}
		if(this.error != "") {
			this.error += "\n  at line " + i + " " + lines[i];
			openfl_utils_ByteArray.set_length(this.agalcode,0);
			lime_utils_Log.info(this.error,{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 631, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
		}
		if(this.debugEnabled) {
			var dbgLine = "generated bytecode:";
			var agalLength = openfl_utils_ByteArray.get_length(this.agalcode);
			var _g = 0;
			var _g1 = agalLength;
			while(_g < _g1) {
				var index = _g++;
				if(index % 16 == 0) {
					dbgLine += "\n";
				}
				if(index % 4 == 0) {
					dbgLine += " ";
				}
				var byteStr = StringTools.hex(this.agalcode.b[index],2);
				if(byteStr.length < 2) {
					byteStr = "0" + byteStr;
				}
				dbgLine += byteStr;
			}
			lime_utils_Log.info(dbgLine,{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 662, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
		}
		if(this.verbose) {
			lime_utils_Log.info("AGALMiniAssembler.assemble time: " + (openfl_Lib.getTimer() - start) / 1000 + "s",{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 667, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
		}
		return this.agalcode;
	}
	,initregmap: function(version,ignorelimits) {
		var this1 = openfl_utils_AGALMiniAssembler.REGMAP;
		var v = new openfl_utils__$AGALMiniAssembler_Register("va","vertex attribute",0,ignorelimits ? 1024 : version == 1 || version == 2 ? 7 : 15,66);
		this1.h["va"] = v;
		var this1 = openfl_utils_AGALMiniAssembler.REGMAP;
		var v = new openfl_utils__$AGALMiniAssembler_Register("vc","vertex constant",1,ignorelimits ? 1024 : version == 1 ? 127 : 249,66);
		this1.h["vc"] = v;
		var this1 = openfl_utils_AGALMiniAssembler.REGMAP;
		var v = new openfl_utils__$AGALMiniAssembler_Register("vt","vertex temporary",2,ignorelimits ? 1024 : version == 1 ? 7 : 25,67);
		this1.h["vt"] = v;
		var this1 = openfl_utils_AGALMiniAssembler.REGMAP;
		var v = new openfl_utils__$AGALMiniAssembler_Register("vo","vertex output",3,ignorelimits ? 1024 : 0,65);
		this1.h["vo"] = v;
		var this1 = openfl_utils_AGALMiniAssembler.REGMAP;
		var v = new openfl_utils__$AGALMiniAssembler_Register("vi","varying",4,ignorelimits ? 1024 : version == 1 ? 7 : 9,99);
		this1.h["vi"] = v;
		var this1 = openfl_utils_AGALMiniAssembler.REGMAP;
		var v = new openfl_utils__$AGALMiniAssembler_Register("fc","fragment constant",1,ignorelimits ? 1024 : version == 1 ? 27 : version == 2 ? 63 : 199,34);
		this1.h["fc"] = v;
		var this1 = openfl_utils_AGALMiniAssembler.REGMAP;
		var v = new openfl_utils__$AGALMiniAssembler_Register("ft","fragment temporary",2,ignorelimits ? 1024 : version == 1 ? 7 : 25,35);
		this1.h["ft"] = v;
		var this1 = openfl_utils_AGALMiniAssembler.REGMAP;
		var v = new openfl_utils__$AGALMiniAssembler_Register("fs","texture sampler",5,ignorelimits ? 1024 : 7,34);
		this1.h["fs"] = v;
		var this1 = openfl_utils_AGALMiniAssembler.REGMAP;
		var v = new openfl_utils__$AGALMiniAssembler_Register("fo","fragment output",3,ignorelimits ? 1024 : version == 1 ? 0 : 3,33);
		this1.h["fo"] = v;
		var this1 = openfl_utils_AGALMiniAssembler.REGMAP;
		var v = new openfl_utils__$AGALMiniAssembler_Register("fd","fragment depth output",6,ignorelimits ? 1024 : version == 1 ? -1 : 0,33);
		this1.h["fd"] = v;
		var this1 = openfl_utils_AGALMiniAssembler.REGMAP;
		var v = new openfl_utils__$AGALMiniAssembler_Register("iid","instance id",7,ignorelimits ? 1024 : 0,66);
		this1.h["iid"] = v;
		var v = openfl_utils_AGALMiniAssembler.REGMAP.h["vo"];
		openfl_utils_AGALMiniAssembler.REGMAP.h["op"] = v;
		var v = openfl_utils_AGALMiniAssembler.REGMAP.h["vi"];
		openfl_utils_AGALMiniAssembler.REGMAP.h["i"] = v;
		var v = openfl_utils_AGALMiniAssembler.REGMAP.h["vi"];
		openfl_utils_AGALMiniAssembler.REGMAP.h["v"] = v;
		var v = openfl_utils_AGALMiniAssembler.REGMAP.h["fo"];
		openfl_utils_AGALMiniAssembler.REGMAP.h["oc"] = v;
		var v = openfl_utils_AGALMiniAssembler.REGMAP.h["fd"];
		openfl_utils_AGALMiniAssembler.REGMAP.h["od"] = v;
		var v = openfl_utils_AGALMiniAssembler.REGMAP.h["vi"];
		openfl_utils_AGALMiniAssembler.REGMAP.h["fi"] = v;
	}
	,match: function(value,reg) {
		var matches = [];
		var index = 0;
		var match;
		while(reg.matchSub(value,index)) {
			match = reg.matched(0);
			matches.push(match);
			index = reg.matchedPos().pos + match.length;
		}
		return matches;
	}
	,__class__: openfl_utils_AGALMiniAssembler
};
var openfl_utils__$AGALMiniAssembler_OpCode = function(name,numRegister,emitCode,flags) {
	this.name = name;
	this.numRegister = numRegister;
	this.emitCode = emitCode;
	this.flags = flags;
};
$hxClasses["openfl.utils._AGALMiniAssembler.OpCode"] = openfl_utils__$AGALMiniAssembler_OpCode;
openfl_utils__$AGALMiniAssembler_OpCode.__name__ = "openfl.utils._AGALMiniAssembler.OpCode";
openfl_utils__$AGALMiniAssembler_OpCode.prototype = {
	emitCode: null
	,flags: null
	,name: null
	,numRegister: null
	,toString: function() {
		return "[OpCode name=\"" + this.name + "\", numRegister=" + this.numRegister + ", emitCode=" + this.emitCode + ", flags=" + this.flags + "]";
	}
	,__class__: openfl_utils__$AGALMiniAssembler_OpCode
};
var openfl_utils__$AGALMiniAssembler_Register = function(name,longName,emitCode,range,flags) {
	this.name = name;
	this.longName = longName;
	this.emitCode = emitCode;
	this.range = range;
	this.flags = flags;
};
$hxClasses["openfl.utils._AGALMiniAssembler.Register"] = openfl_utils__$AGALMiniAssembler_Register;
openfl_utils__$AGALMiniAssembler_Register.__name__ = "openfl.utils._AGALMiniAssembler.Register";
openfl_utils__$AGALMiniAssembler_Register.prototype = {
	emitCode: null
	,name: null
	,longName: null
	,flags: null
	,range: null
	,toString: function() {
		return "[Register name=\"" + this.name + "\", longName=\"" + this.longName + "\", emitCode=" + (this.emitCode == null ? "null" : Std.string(UInt.toFloat(this.emitCode))) + ", range=" + (this.range == null ? "null" : Std.string(UInt.toFloat(this.range))) + ", flags=" + (this.flags == null ? "null" : Std.string(UInt.toFloat(this.flags))) + "]";
	}
	,__class__: openfl_utils__$AGALMiniAssembler_Register
};
var openfl_utils__$AGALMiniAssembler_Sampler = function(name,flag,mask) {
	this.name = name;
	this.flag = flag;
	this.mask = mask;
};
$hxClasses["openfl.utils._AGALMiniAssembler.Sampler"] = openfl_utils__$AGALMiniAssembler_Sampler;
openfl_utils__$AGALMiniAssembler_Sampler.__name__ = "openfl.utils._AGALMiniAssembler.Sampler";
openfl_utils__$AGALMiniAssembler_Sampler.prototype = {
	flag: null
	,mask: null
	,name: null
	,toString: function() {
		return "[Sampler name=\"" + this.name + "\", flag=\"" + (this.flag == null ? "null" : Std.string(UInt.toFloat(this.flag))) + "\", mask=" + (this.mask == null ? "null" : Std.string(UInt.toFloat(this.mask))) + "]";
	}
	,__class__: openfl_utils__$AGALMiniAssembler_Sampler
};
var openfl_utils_IAssetCache = function() { };
$hxClasses["openfl.utils.IAssetCache"] = openfl_utils_IAssetCache;
openfl_utils_IAssetCache.__name__ = "openfl.utils.IAssetCache";
openfl_utils_IAssetCache.__isInterface__ = true;
openfl_utils_IAssetCache.prototype = {
	get_enabled: null
	,set_enabled: null
	,clear: null
	,getBitmapData: null
	,getFont: null
	,getSound: null
	,hasBitmapData: null
	,hasFont: null
	,hasSound: null
	,removeBitmapData: null
	,removeFont: null
	,removeSound: null
	,setBitmapData: null
	,setFont: null
	,setSound: null
	,__class__: openfl_utils_IAssetCache
	,__properties__: {set_enabled:"set_enabled",get_enabled:"get_enabled"}
};
var openfl_utils_AssetCache = function() {
	this.__enabled = true;
	this.bitmapData = new haxe_ds_StringMap();
	this.font = new haxe_ds_StringMap();
	this.sound = new haxe_ds_StringMap();
};
$hxClasses["openfl.utils.AssetCache"] = openfl_utils_AssetCache;
openfl_utils_AssetCache.__name__ = "openfl.utils.AssetCache";
openfl_utils_AssetCache.__interfaces__ = [openfl_utils_IAssetCache];
openfl_utils_AssetCache.prototype = {
	bitmapData: null
	,font: null
	,sound: null
	,__enabled: null
	,clear: function(prefix) {
		if(prefix == null) {
			this.bitmapData = new haxe_ds_StringMap();
			this.font = new haxe_ds_StringMap();
			this.sound = new haxe_ds_StringMap();
		} else {
			var keys = haxe_ds_StringMap.keysIterator(this.bitmapData.h);
			var key = keys;
			while(key.hasNext()) {
				var key1 = key.next();
				if(StringTools.startsWith(key1,prefix)) {
					this.removeBitmapData(key1);
				}
			}
			var keys = haxe_ds_StringMap.keysIterator(this.font.h);
			var key = keys;
			while(key.hasNext()) {
				var key1 = key.next();
				if(StringTools.startsWith(key1,prefix)) {
					this.removeFont(key1);
				}
			}
			var keys = haxe_ds_StringMap.keysIterator(this.sound.h);
			var key = keys;
			while(key.hasNext()) {
				var key1 = key.next();
				if(StringTools.startsWith(key1,prefix)) {
					this.removeSound(key1);
				}
			}
		}
	}
	,getBitmapData: function(id) {
		return this.bitmapData.h[id];
	}
	,getFont: function(id) {
		return this.font.h[id];
	}
	,getSound: function(id) {
		return this.sound.h[id];
	}
	,hasBitmapData: function(id) {
		return Object.prototype.hasOwnProperty.call(this.bitmapData.h,id);
	}
	,hasFont: function(id) {
		return Object.prototype.hasOwnProperty.call(this.font.h,id);
	}
	,hasSound: function(id) {
		return Object.prototype.hasOwnProperty.call(this.sound.h,id);
	}
	,removeBitmapData: function(id) {
		var _this = lime_utils_Assets.cache.image;
		if(Object.prototype.hasOwnProperty.call(_this.h,id)) {
			delete(_this.h[id]);
		}
		var _this = this.bitmapData;
		if(Object.prototype.hasOwnProperty.call(_this.h,id)) {
			delete(_this.h[id]);
			return true;
		} else {
			return false;
		}
	}
	,removeFont: function(id) {
		var _this = lime_utils_Assets.cache.font;
		if(Object.prototype.hasOwnProperty.call(_this.h,id)) {
			delete(_this.h[id]);
		}
		var _this = this.font;
		if(Object.prototype.hasOwnProperty.call(_this.h,id)) {
			delete(_this.h[id]);
			return true;
		} else {
			return false;
		}
	}
	,removeSound: function(id) {
		var _this = lime_utils_Assets.cache.audio;
		if(Object.prototype.hasOwnProperty.call(_this.h,id)) {
			delete(_this.h[id]);
		}
		var _this = this.sound;
		if(Object.prototype.hasOwnProperty.call(_this.h,id)) {
			delete(_this.h[id]);
			return true;
		} else {
			return false;
		}
	}
	,setBitmapData: function(id,bitmapData) {
		this.bitmapData.h[id] = bitmapData;
	}
	,setFont: function(id,font) {
		this.font.h[id] = font;
	}
	,setSound: function(id,sound) {
		this.sound.h[id] = sound;
	}
	,get_enabled: function() {
		return this.__enabled;
	}
	,set_enabled: function(value) {
		return this.__enabled = value;
	}
	,__class__: openfl_utils_AssetCache
	,__properties__: {set_enabled:"set_enabled",get_enabled:"get_enabled"}
};
var openfl_utils_AssetLibrary = function() {
	lime_utils_AssetLibrary.call(this);
};
$hxClasses["openfl.utils.AssetLibrary"] = openfl_utils_AssetLibrary;
openfl_utils_AssetLibrary.__name__ = "openfl.utils.AssetLibrary";
openfl_utils_AssetLibrary.fromBytes = function(bytes,rootPath) {
	return openfl_utils_AssetLibrary.fromManifest(lime_utils_AssetManifest.fromBytes(openfl_utils_ByteArray.toBytes(bytes),rootPath));
};
openfl_utils_AssetLibrary.fromFile = function(path,rootPath) {
	return openfl_utils_AssetLibrary.fromManifest(lime_utils_AssetManifest.fromFile(path,rootPath));
};
openfl_utils_AssetLibrary.fromManifest = function(manifest) {
	var library = lime_utils_AssetLibrary.fromManifest(manifest);
	if(library != null) {
		if(((library) instanceof openfl_utils_AssetLibrary)) {
			return library;
		} else {
			var _library = new openfl_utils_AssetLibrary();
			_library.__proxy = library;
			return _library;
		}
	} else {
		return null;
	}
};
openfl_utils_AssetLibrary.loadFromBytes = function(bytes,rootPath) {
	return lime_utils_AssetManifest.loadFromBytes(openfl_utils_ByteArray.toBytes(bytes),rootPath).then(function(manifest) {
		return openfl_utils_AssetLibrary.loadFromManifest(manifest);
	});
};
openfl_utils_AssetLibrary.loadFromFile = function(path,rootPath) {
	return lime_utils_AssetManifest.loadFromFile(path,rootPath).then(function(manifest) {
		return openfl_utils_AssetLibrary.loadFromManifest(manifest);
	});
};
openfl_utils_AssetLibrary.loadFromManifest = function(manifest) {
	var library = openfl_utils_AssetLibrary.fromManifest(manifest);
	if(library != null) {
		return library.load().then(function(library) {
			return lime_app_Future.withValue(library);
		});
	} else {
		return lime_app_Future.withError("Could not load asset manifest");
	}
};
openfl_utils_AssetLibrary.__super__ = lime_utils_AssetLibrary;
openfl_utils_AssetLibrary.prototype = $extend(lime_utils_AssetLibrary.prototype,{
	__proxy: null
	,exists: function(id,type) {
		if(this.__proxy != null) {
			return this.__proxy.exists(id,type);
		} else {
			return lime_utils_AssetLibrary.prototype.exists.call(this,id,type);
		}
	}
	,getAsset: function(id,type) {
		if(this.__proxy != null) {
			return this.__proxy.getAsset(id,type);
		} else {
			return lime_utils_AssetLibrary.prototype.getAsset.call(this,id,type);
		}
	}
	,getAudioBuffer: function(id) {
		if(this.__proxy != null) {
			return this.__proxy.getAudioBuffer(id);
		} else {
			return lime_utils_AssetLibrary.prototype.getAudioBuffer.call(this,id);
		}
	}
	,getBytes: function(id) {
		if(this.__proxy != null) {
			return this.__proxy.getBytes(id);
		} else {
			return lime_utils_AssetLibrary.prototype.getBytes.call(this,id);
		}
	}
	,getFont: function(id) {
		if(this.__proxy != null) {
			return this.__proxy.getFont(id);
		} else {
			return lime_utils_AssetLibrary.prototype.getFont.call(this,id);
		}
	}
	,getImage: function(id) {
		if(this.__proxy != null) {
			return this.__proxy.getImage(id);
		} else {
			return lime_utils_AssetLibrary.prototype.getImage.call(this,id);
		}
	}
	,getMovieClip: function(id) {
		return null;
	}
	,getPath: function(id) {
		if(this.__proxy != null) {
			return this.__proxy.getPath(id);
		} else {
			return lime_utils_AssetLibrary.prototype.getPath.call(this,id);
		}
	}
	,getText: function(id) {
		if(this.__proxy != null) {
			return this.__proxy.getText(id);
		} else {
			return lime_utils_AssetLibrary.prototype.getText.call(this,id);
		}
	}
	,isLocal: function(id,type) {
		if(this.__proxy != null) {
			return this.__proxy.isLocal(id,type);
		} else {
			return lime_utils_AssetLibrary.prototype.isLocal.call(this,id,type);
		}
	}
	,list: function(type) {
		if(this.__proxy != null) {
			return this.__proxy.list(type);
		} else {
			return lime_utils_AssetLibrary.prototype.list.call(this,type);
		}
	}
	,loadAsset: function(id,type) {
		if(this.__proxy != null) {
			return this.__proxy.loadAsset(id,type);
		} else {
			return lime_utils_AssetLibrary.prototype.loadAsset.call(this,id,type);
		}
	}
	,load: function() {
		if(this.__proxy != null) {
			return this.__proxy.load();
		} else {
			return lime_utils_AssetLibrary.prototype.load.call(this);
		}
	}
	,loadAudioBuffer: function(id) {
		if(this.__proxy != null) {
			return this.__proxy.loadAudioBuffer(id);
		} else {
			return lime_utils_AssetLibrary.prototype.loadAudioBuffer.call(this,id);
		}
	}
	,loadBytes: function(id) {
		if(this.__proxy != null) {
			return this.__proxy.loadBytes(id);
		} else {
			return lime_utils_AssetLibrary.prototype.loadBytes.call(this,id);
		}
	}
	,loadFont: function(id) {
		if(this.__proxy != null) {
			return this.__proxy.loadFont(id);
		} else {
			return lime_utils_AssetLibrary.prototype.loadFont.call(this,id);
		}
	}
	,loadImage: function(id) {
		if(this.__proxy != null) {
			return this.__proxy.loadImage(id);
		} else {
			return lime_utils_AssetLibrary.prototype.loadImage.call(this,id);
		}
	}
	,loadMovieClip: function(id) {
		return lime_app_Future.withValue(this.getMovieClip(id));
	}
	,loadText: function(id) {
		if(this.__proxy != null) {
			return this.__proxy.loadText(id);
		} else {
			return lime_utils_AssetLibrary.prototype.loadText.call(this,id);
		}
	}
	,unload: function() {
		if(this.__proxy != null) {
			this.__proxy.unload();
			return;
		} else {
			lime_utils_AssetLibrary.prototype.unload.call(this);
			return;
		}
	}
	,__class__: openfl_utils_AssetLibrary
});
var openfl_utils_Assets = function() { };
$hxClasses["openfl.utils.Assets"] = openfl_utils_Assets;
openfl_utils_Assets.__name__ = "openfl.utils.Assets";
openfl_utils_Assets.addEventListener = function(type,listener,useCapture,priority,useWeakReference) {
	if(useWeakReference == null) {
		useWeakReference = false;
	}
	if(priority == null) {
		priority = 0;
	}
	if(useCapture == null) {
		useCapture = false;
	}
	if(!lime_utils_Assets.onChange.has(openfl_utils_Assets.LimeAssets_onChange)) {
		lime_utils_Assets.onChange.add(openfl_utils_Assets.LimeAssets_onChange);
	}
	openfl_utils_Assets.dispatcher.addEventListener(type,listener,useCapture,priority,useWeakReference);
};
openfl_utils_Assets.dispatchEvent = function(event) {
	return openfl_utils_Assets.dispatcher.dispatchEvent(event);
};
openfl_utils_Assets.exists = function(id,type) {
	return lime_utils_Assets.exists(id,type);
};
openfl_utils_Assets.getBitmapData = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	if(useCache && openfl_utils_Assets.cache.get_enabled() && openfl_utils_Assets.cache.hasBitmapData(id)) {
		var bitmapData = openfl_utils_Assets.cache.getBitmapData(id);
		if(openfl_utils_Assets.isValidBitmapData(bitmapData)) {
			return bitmapData;
		}
	}
	var image = lime_utils_Assets.getImage(id,false);
	if(image != null) {
		var bitmapData = openfl_display_BitmapData.fromImage(image);
		if(useCache && openfl_utils_Assets.cache.get_enabled()) {
			openfl_utils_Assets.cache.setBitmapData(id,bitmapData);
		}
		return bitmapData;
	}
	return null;
};
openfl_utils_Assets.getBytes = function(id) {
	return openfl_utils_ByteArray.fromBytes(lime_utils_Assets.getBytes(id));
};
openfl_utils_Assets.getFont = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	if(useCache && openfl_utils_Assets.cache.get_enabled() && openfl_utils_Assets.cache.hasFont(id)) {
		return openfl_utils_Assets.cache.getFont(id);
	}
	var limeFont = lime_utils_Assets.getFont(id,false);
	if(limeFont != null) {
		var font = new openfl_text_Font();
		font.__fromLimeFont(limeFont);
		if(useCache && openfl_utils_Assets.cache.get_enabled()) {
			openfl_utils_Assets.cache.setFont(id,font);
		}
		return font;
	}
	return new openfl_text_Font();
};
openfl_utils_Assets.getLibrary = function(name) {
	return lime_utils_Assets.getLibrary(name);
};
openfl_utils_Assets.getMovieClip = function(id) {
	var libraryName = id.substring(0,id.indexOf(":"));
	var symbolName = HxOverrides.substr(id,id.indexOf(":") + 1,null);
	var limeLibrary = openfl_utils_Assets.getLibrary(libraryName);
	if(limeLibrary != null) {
		if(((limeLibrary) instanceof openfl_utils_AssetLibrary)) {
			var library = limeLibrary;
			if(library.exists(symbolName,"MOVIE_CLIP")) {
				if(library.isLocal(symbolName,"MOVIE_CLIP")) {
					return library.getMovieClip(symbolName);
				} else {
					lime_utils_Log.error("MovieClip asset \"" + id + "\" exists, but only asynchronously",{ fileName : "openfl/utils/Assets.hx", lineNumber : 159, className : "openfl.utils.Assets", methodName : "getMovieClip"});
					return null;
				}
			}
		}
		lime_utils_Log.error("There is no MovieClip asset with an ID of \"" + id + "\"",{ fileName : "openfl/utils/Assets.hx", lineNumber : 165, className : "openfl.utils.Assets", methodName : "getMovieClip"});
	} else {
		lime_utils_Log.error("There is no asset library named \"" + libraryName + "\"",{ fileName : "openfl/utils/Assets.hx", lineNumber : 169, className : "openfl.utils.Assets", methodName : "getMovieClip"});
	}
	return null;
};
openfl_utils_Assets.getMusic = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	return openfl_utils_Assets.getSound(id,useCache);
};
openfl_utils_Assets.getPath = function(id) {
	return lime_utils_Assets.getPath(id);
};
openfl_utils_Assets.getSound = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	if(useCache && openfl_utils_Assets.cache.get_enabled() && openfl_utils_Assets.cache.hasSound(id)) {
		var sound = openfl_utils_Assets.cache.getSound(id);
		if(openfl_utils_Assets.isValidSound(sound)) {
			return sound;
		}
	}
	var buffer = lime_utils_Assets.getAudioBuffer(id,false);
	if(buffer != null) {
		var sound = openfl_media_Sound.fromAudioBuffer(buffer);
		if(useCache && openfl_utils_Assets.cache.get_enabled()) {
			openfl_utils_Assets.cache.setSound(id,sound);
		}
		return sound;
	}
	return null;
};
openfl_utils_Assets.getText = function(id) {
	return lime_utils_Assets.getText(id);
};
openfl_utils_Assets.hasEventListener = function(type) {
	return openfl_utils_Assets.dispatcher.hasEventListener(type);
};
openfl_utils_Assets.hasLibrary = function(name) {
	return lime_utils_Assets.hasLibrary(name);
};
openfl_utils_Assets.isLocal = function(id,type,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	if(useCache && openfl_utils_Assets.cache.get_enabled()) {
		if(type == "IMAGE" || type == null) {
			if(openfl_utils_Assets.cache.hasBitmapData(id)) {
				return true;
			}
		}
		if(type == "FONT" || type == null) {
			if(openfl_utils_Assets.cache.hasFont(id)) {
				return true;
			}
		}
		if(type == "SOUND" || type == "MUSIC" || type == null) {
			if(openfl_utils_Assets.cache.hasSound(id)) {
				return true;
			}
		}
	}
	var libraryName = id.substring(0,id.indexOf(":"));
	var symbolName = HxOverrides.substr(id,id.indexOf(":") + 1,null);
	var library = openfl_utils_Assets.getLibrary(libraryName);
	if(library != null) {
		return library.isLocal(symbolName,type);
	}
	return false;
};
openfl_utils_Assets.isValidBitmapData = function(bitmapData) {
	return bitmapData != null && bitmapData.image != null;
};
openfl_utils_Assets.isValidSound = function(sound) {
	return true;
};
openfl_utils_Assets.list = function(type) {
	return lime_utils_Assets.list(type);
};
openfl_utils_Assets.loadBitmapData = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	if(useCache == null) {
		useCache = true;
	}
	var promise = new lime_app_Promise();
	if(useCache && openfl_utils_Assets.cache.get_enabled() && openfl_utils_Assets.cache.hasBitmapData(id)) {
		var bitmapData = openfl_utils_Assets.cache.getBitmapData(id);
		if(openfl_utils_Assets.isValidBitmapData(bitmapData)) {
			promise.complete(bitmapData);
			return promise.future;
		}
	}
	lime_utils_Assets.loadImage(id,false).onComplete(function(image) {
		if(image != null) {
			var bitmapData = openfl_display_BitmapData.fromImage(image);
			if(useCache && openfl_utils_Assets.cache.get_enabled()) {
				openfl_utils_Assets.cache.setBitmapData(id,bitmapData);
			}
			promise.complete(bitmapData);
		} else {
			promise.error("[Assets] Could not load Image \"" + id + "\"");
		}
	}).onError($bind(promise,promise.error)).onProgress($bind(promise,promise.progress));
	return promise.future;
};
openfl_utils_Assets.loadBytes = function(id) {
	var promise = new lime_app_Promise();
	var future = lime_utils_Assets.loadBytes(id);
	future.onComplete(function(bytes) {
		promise.complete(openfl_utils_ByteArray.fromBytes(bytes));
	});
	future.onProgress(function(progress,total) {
		promise.progress(progress,total);
	});
	future.onError(function(msg) {
		promise.error(msg);
	});
	return promise.future;
};
openfl_utils_Assets.loadFont = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	if(useCache == null) {
		useCache = true;
	}
	var promise = new lime_app_Promise();
	if(useCache && openfl_utils_Assets.cache.get_enabled() && openfl_utils_Assets.cache.hasFont(id)) {
		promise.complete(openfl_utils_Assets.cache.getFont(id));
		return promise.future;
	}
	lime_utils_Assets.loadFont(id).onComplete(function(limeFont) {
		var font = new openfl_text_Font();
		font.__fromLimeFont(limeFont);
		if(useCache && openfl_utils_Assets.cache.get_enabled()) {
			openfl_utils_Assets.cache.setFont(id,font);
		}
		promise.complete(font);
	}).onError($bind(promise,promise.error)).onProgress($bind(promise,promise.progress));
	return promise.future;
};
openfl_utils_Assets.loadLibrary = function(name) {
	return lime_utils_Assets.loadLibrary(name).then(function(library) {
		var _library = null;
		if(library != null) {
			if(((library) instanceof openfl_utils_AssetLibrary)) {
				_library = library;
			} else {
				_library = new openfl_utils_AssetLibrary();
				_library.__proxy = library;
				lime_utils_Assets.registerLibrary(name,_library);
			}
		}
		return lime_app_Future.withValue(_library);
	});
};
openfl_utils_Assets.loadMusic = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	if(useCache == null) {
		useCache = true;
	}
	var future = new lime_app_Future(function() {
		return openfl_utils_Assets.getMusic(id,useCache);
	});
	return future;
};
openfl_utils_Assets.loadMovieClip = function(id) {
	var promise = new lime_app_Promise();
	var libraryName = id.substring(0,id.indexOf(":"));
	var symbolName = HxOverrides.substr(id,id.indexOf(":") + 1,null);
	var limeLibrary = openfl_utils_Assets.getLibrary(libraryName);
	if(limeLibrary != null) {
		if(((limeLibrary) instanceof openfl_utils_AssetLibrary)) {
			var library = limeLibrary;
			if(library.exists(symbolName,"MOVIE_CLIP")) {
				promise.completeWith(library.loadMovieClip(symbolName));
				return promise.future;
			}
		}
		promise.error("[Assets] There is no MovieClip asset with an ID of \"" + id + "\"");
	} else {
		promise.error("[Assets] There is no asset library named \"" + libraryName + "\"");
	}
	return promise.future;
};
openfl_utils_Assets.loadSound = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	if(useCache == null) {
		useCache = true;
	}
	var promise = new lime_app_Promise();
	lime_utils_Assets.loadAudioBuffer(id,useCache).onComplete(function(buffer) {
		if(buffer != null) {
			var sound = openfl_media_Sound.fromAudioBuffer(buffer);
			if(useCache && openfl_utils_Assets.cache.get_enabled()) {
				openfl_utils_Assets.cache.setSound(id,sound);
			}
			promise.complete(sound);
		} else {
			promise.error("[Assets] Could not load Sound \"" + id + "\"");
		}
	}).onError($bind(promise,promise.error)).onProgress($bind(promise,promise.progress));
	return promise.future;
};
openfl_utils_Assets.loadText = function(id) {
	var future = lime_utils_Assets.loadText(id);
	return future;
};
openfl_utils_Assets.registerLibrary = function(name,library) {
	lime_utils_Assets.registerLibrary(name,library);
};
openfl_utils_Assets.removeEventListener = function(type,listener,capture) {
	if(capture == null) {
		capture = false;
	}
	openfl_utils_Assets.dispatcher.removeEventListener(type,listener,capture);
};
openfl_utils_Assets.resolveClass = function(name) {
	return $hxClasses[name];
};
openfl_utils_Assets.resolveEnum = function(name) {
	var value = $hxEnums[name];
	return value;
};
openfl_utils_Assets.unloadLibrary = function(name) {
	lime_utils_Assets.unloadLibrary(name);
};
openfl_utils_Assets.LimeAssets_onChange = function() {
	openfl_utils_Assets.dispatchEvent(new openfl_events_Event("change"));
};
var openfl_utils_ByteArray = {};
openfl_utils_ByteArray.__properties__ = {set_position:"set_position",get_position:"get_position",set_length:"set_length",get_length:"get_length",get_bytesAvailable:"get_bytesAvailable",set_defaultObjectEncoding:"set_defaultObjectEncoding",get_defaultObjectEncoding:"get_defaultObjectEncoding",set_defaultEndian:"set_defaultEndian",get_defaultEndian:"get_defaultEndian"};
openfl_utils_ByteArray._new = function(length) {
	if(length == null) {
		length = 0;
	}
	var this1 = new openfl_utils_ByteArrayData(length);
	return this1;
};
openfl_utils_ByteArray.clear = function(this1) {
	this1.clear();
};
openfl_utils_ByteArray.compress = function(this1,algorithm) {
	this1.compress(algorithm);
};
openfl_utils_ByteArray.deflate = function(this1) {
	this1.deflate();
};
openfl_utils_ByteArray.fromArrayBuffer = function(buffer) {
	if(buffer == null) {
		return null;
	}
	return openfl_utils_ByteArrayData.fromBytes(haxe_io_Bytes.ofData(buffer));
};
openfl_utils_ByteArray.fromBytes = function(bytes) {
	if(bytes == null) {
		return null;
	}
	if(((bytes) instanceof openfl_utils_ByteArrayData)) {
		return bytes;
	} else {
		return openfl_utils_ByteArrayData.fromBytes(bytes);
	}
};
openfl_utils_ByteArray.fromBytesData = function(bytesData) {
	if(bytesData == null) {
		return null;
	}
	return openfl_utils_ByteArrayData.fromBytes(haxe_io_Bytes.ofData(bytesData));
};
openfl_utils_ByteArray.fromFile = function(path) {
	return openfl_utils_ByteArray.fromBytes(lime_utils_Bytes.fromFile(path));
};
openfl_utils_ByteArray.fromLimeBytes = function(bytes) {
	return openfl_utils_ByteArray.fromBytes(bytes);
};
openfl_utils_ByteArray.get = function(this1,index) {
	return this1.b[index];
};
openfl_utils_ByteArray.inflate = function(this1) {
	this1.inflate();
};
openfl_utils_ByteArray.loadFromBytes = function(bytes) {
	return lime_utils_Bytes.loadFromBytes(bytes).then(function(limeBytes) {
		var byteArray = openfl_utils_ByteArray.fromBytes(limeBytes);
		return lime_app_Future.withValue(byteArray);
	});
};
openfl_utils_ByteArray.loadFromFile = function(path) {
	return lime_utils_Bytes.loadFromFile(path).then(function(limeBytes) {
		var byteArray = openfl_utils_ByteArray.fromBytes(limeBytes);
		return lime_app_Future.withValue(byteArray);
	});
};
openfl_utils_ByteArray.readBoolean = function(this1) {
	return this1.readBoolean();
};
openfl_utils_ByteArray.readByte = function(this1) {
	return this1.readByte();
};
openfl_utils_ByteArray.readBytes = function(this1,bytes,offset,length) {
	if(length == null) {
		length = 0;
	}
	if(offset == null) {
		offset = 0;
	}
	this1.readBytes(bytes,offset,length);
};
openfl_utils_ByteArray.readDouble = function(this1) {
	return this1.readDouble();
};
openfl_utils_ByteArray.readFloat = function(this1) {
	return this1.readFloat();
};
openfl_utils_ByteArray.readInt = function(this1) {
	return this1.readInt();
};
openfl_utils_ByteArray.readMultiByte = function(this1,length,charSet) {
	return this1.readMultiByte(length,charSet);
};
openfl_utils_ByteArray.readObject = function(this1) {
	return this1.readObject();
};
openfl_utils_ByteArray.readShort = function(this1) {
	return this1.readShort();
};
openfl_utils_ByteArray.readUTF = function(this1) {
	return this1.readUTF();
};
openfl_utils_ByteArray.readUTFBytes = function(this1,length) {
	return this1.readUTFBytes(length);
};
openfl_utils_ByteArray.readUnsignedByte = function(this1) {
	return this1.readUnsignedByte();
};
openfl_utils_ByteArray.readUnsignedInt = function(this1) {
	return this1.readUnsignedInt();
};
openfl_utils_ByteArray.readUnsignedShort = function(this1) {
	return this1.readUnsignedShort();
};
openfl_utils_ByteArray.set = function(this1,index,value) {
	this1.__resize(index + 1);
	this1.b[index] = value & 255;
	return value;
};
openfl_utils_ByteArray.toArrayBuffer = function(byteArray) {
	return byteArray.b.bufferValue;
};
openfl_utils_ByteArray.toBytePointer = function(byteArray) {
	lime_utils_BytePointer.set(openfl_utils_ByteArray.__bytePointer,byteArray,null,null,byteArray.position);
	return openfl_utils_ByteArray.__bytePointer;
};
openfl_utils_ByteArray.toBytes = function(byteArray) {
	return byteArray;
};
openfl_utils_ByteArray.toBytesData = function(byteArray) {
	return byteArray.b.bufferValue;
};
openfl_utils_ByteArray.toLimeBytes = function(byteArray) {
	return openfl_utils_ByteArray.toBytes(openfl_utils_ByteArray.fromBytes(openfl_utils_ByteArray.toBytes(byteArray)));
};
openfl_utils_ByteArray.toString = function(this1) {
	return this1.toString();
};
openfl_utils_ByteArray.uncompress = function(this1,algorithm) {
	this1.uncompress(algorithm);
};
openfl_utils_ByteArray.writeBoolean = function(this1,value) {
	this1.writeBoolean(value);
};
openfl_utils_ByteArray.writeByte = function(this1,value) {
	this1.writeByte(value);
};
openfl_utils_ByteArray.writeBytes = function(this1,bytes,offset,length) {
	if(length == null) {
		length = 0;
	}
	if(offset == null) {
		offset = 0;
	}
	this1.writeBytes(bytes,offset,length);
};
openfl_utils_ByteArray.writeDouble = function(this1,value) {
	this1.writeDouble(value);
};
openfl_utils_ByteArray.writeFloat = function(this1,value) {
	this1.writeFloat(value);
};
openfl_utils_ByteArray.writeInt = function(this1,value) {
	this1.writeInt(value);
};
openfl_utils_ByteArray.writeMultiByte = function(this1,value,charSet) {
	this1.writeMultiByte(value,charSet);
};
openfl_utils_ByteArray.writeObject = function(this1,object) {
	this1.writeObject(object);
};
openfl_utils_ByteArray.writeShort = function(this1,value) {
	this1.writeShort(value);
};
openfl_utils_ByteArray.writeUTF = function(this1,value) {
	this1.writeUTF(value);
};
openfl_utils_ByteArray.writeUTFBytes = function(this1,value) {
	this1.writeUTFBytes(value);
};
openfl_utils_ByteArray.writeUnsignedInt = function(this1,value) {
	this1.writeUnsignedInt(value);
};
openfl_utils_ByteArray.get_bytesAvailable = function(this1) {
	return this1.length - this1.position;
};
openfl_utils_ByteArray.get_defaultEndian = function() {
	if(openfl_utils_ByteArrayData.__defaultEndian == null) {
		if(lime_system_System.get_endianness() == lime_system_Endian.LITTLE_ENDIAN) {
			openfl_utils_ByteArrayData.__defaultEndian = 1;
		} else {
			openfl_utils_ByteArrayData.__defaultEndian = 0;
		}
	}
	return openfl_utils_ByteArrayData.__defaultEndian;
};
openfl_utils_ByteArray.set_defaultEndian = function(value) {
	return openfl_utils_ByteArrayData.__defaultEndian = value;
};
openfl_utils_ByteArray.get_defaultObjectEncoding = function() {
	return openfl_utils_ByteArrayData.defaultObjectEncoding;
};
openfl_utils_ByteArray.set_defaultObjectEncoding = function(value) {
	return openfl_utils_ByteArrayData.defaultObjectEncoding = value;
};
openfl_utils_ByteArray.get_endian = function(this1) {
	return this1.__endian;
};
openfl_utils_ByteArray.set_endian = function(this1,value) {
	return this1.__endian = value;
};
openfl_utils_ByteArray.get_length = function(this1) {
	if(this1 == null) {
		return 0;
	} else {
		return this1.length;
	}
};
openfl_utils_ByteArray.set_length = function(this1,value) {
	if(value > 0) {
		this1.__resize(value);
		if(value < this1.position) {
			this1.position = value;
		}
	}
	this1.length = value;
	return value;
};
openfl_utils_ByteArray.get_objectEncoding = function(this1) {
	return this1.objectEncoding;
};
openfl_utils_ByteArray.set_objectEncoding = function(this1,value) {
	return this1.objectEncoding = value;
};
openfl_utils_ByteArray.get_position = function(this1) {
	return this1.position;
};
openfl_utils_ByteArray.set_position = function(this1,value) {
	return this1.position = value;
};
var openfl_utils_CompressionAlgorithm = {};
openfl_utils_CompressionAlgorithm.fromString = function(value) {
	switch(value) {
	case "deflate":
		return 0;
	case "lzma":
		return 1;
	case "zlib":
		return 2;
	default:
		return null;
	}
};
openfl_utils_CompressionAlgorithm.toString = function(this1) {
	switch(this1) {
	case 0:
		return "deflate";
	case 1:
		return "lzma";
	case 2:
		return "zlib";
	default:
		return null;
	}
};
var openfl_utils_Endian = {};
openfl_utils_Endian.fromLimeEndian = function(value) {
	switch(value._hx_index) {
	case 0:
		return 1;
	case 1:
		return 0;
	}
};
openfl_utils_Endian.fromString = function(value) {
	switch(value) {
	case "bigEndian":
		return 0;
	case "littleEndian":
		return 1;
	default:
		return null;
	}
};
openfl_utils_Endian.toLimeEndian = function(this1) {
	switch(this1) {
	case 0:
		return lime_system_Endian.BIG_ENDIAN;
	case 1:
		return lime_system_Endian.LITTLE_ENDIAN;
	default:
		return null;
	}
};
openfl_utils_Endian.toString = function(this1) {
	switch(this1) {
	case 0:
		return "bigEndian";
	case 1:
		return "littleEndian";
	default:
		return null;
	}
};
var openfl_utils_Object = {};
openfl_utils_Object._new = function() {
	var this1 = { };
	return this1;
};
openfl_utils_Object.hasOwnProperty = function(this1,name) {
	if(this1 != null) {
		return Object.prototype.hasOwnProperty.call(this1,name);
	} else {
		return false;
	}
};
openfl_utils_Object.isPrototypeOf = function(this1,theClass) {
	var c = js_Boot.getClass(this1);
	while(c != null) {
		if(c == theClass) {
			return true;
		}
		c = c.__super__;
	}
	return false;
};
openfl_utils_Object.iterator = function(this1) {
	var fields = Reflect.fields(this1);
	if(fields == null) {
		fields = [];
	}
	return new haxe_iterators_ArrayIterator(fields);
};
openfl_utils_Object.propertyIsEnumerable = function(this1,name) {
	if(this1 != null && Object.prototype.hasOwnProperty.call(this1,name)) {
		return js_Boot.__implements(Reflect.field(this1,name),haxe_lang_Iterable);
	} else {
		return false;
	}
};
openfl_utils_Object.toLocaleString = function(this1) {
	return Std.string(this1);
};
openfl_utils_Object.toString = function(this1) {
	return Std.string(this1);
};
openfl_utils_Object.valueOf = function(this1) {
	return this1;
};
openfl_utils_Object.__get = function(this1,key) {
	return Reflect.field(this1,key);
};
openfl_utils_Object.__set = function(this1,key,value) {
	this1[key] = value;
	return value;
};
var haxe_lang_Iterator = function() { };
$hxClasses["haxe.lang.Iterator"] = haxe_lang_Iterator;
haxe_lang_Iterator.__name__ = "haxe.lang.Iterator";
haxe_lang_Iterator.__isInterface__ = true;
haxe_lang_Iterator.prototype = {
	hasNext: null
	,next: null
	,__class__: haxe_lang_Iterator
};
var haxe_lang_Iterable = function() { };
$hxClasses["haxe.lang.Iterable"] = haxe_lang_Iterable;
haxe_lang_Iterable.__name__ = "haxe.lang.Iterable";
haxe_lang_Iterable.__isInterface__ = true;
haxe_lang_Iterable.prototype = {
	iterator: null
	,__class__: haxe_lang_Iterable
};
function $getIterator(o) { if( o instanceof Array ) return new haxe_iterators_ArrayIterator(o); else return o.iterator(); }
function $bind(o,m) { if( m == null ) return null; if( m.__id__ == null ) m.__id__ = $global.$haxeUID++; var f; if( o.hx__closures__ == null ) o.hx__closures__ = {}; else f = o.hx__closures__[m.__id__]; if( f == null ) { f = m.bind(o); o.hx__closures__[m.__id__] = f; } return f; }
$global.$haxeUID |= 0;
var _init = lime__$internal_backend_html5_HTML5Application;
var init = lime_app_Application;
haxe_ds_ObjectMap.count = 0;
if(typeof(performance) != "undefined" ? typeof(performance.now) == "function" : false) {
	HxOverrides.now = performance.now.bind(performance);
}
$hxClasses["Math"] = Math;
if( String.fromCodePoint == null ) String.fromCodePoint = function(c) { return c < 0x10000 ? String.fromCharCode(c) : String.fromCharCode((c>>10)+0xD7C0)+String.fromCharCode((c&0x3FF)+0xDC00); }
String.prototype.__class__ = $hxClasses["String"] = String;
String.__name__ = "String";
$hxClasses["Array"] = Array;
Array.__name__ = "Array";
Date.prototype.__class__ = $hxClasses["Date"] = Date;
Date.__name__ = "Date";
var Int = { };
var Dynamic = { };
var Float = Number;
var Bool = Boolean;
var Class = { };
var Enum = { };
js_Boot.__toStr = ({ }).toString;
haxe_Resource.content = [{ name : "__ASSET__:bitmap_flixel_system_debug_interaction_tools__Transform_GraphicTransformCursorScaleX", data : "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUFvQUFBQUtDQVlBQUFDTk1zKzlBQUFBQkhOQ1NWUUlDQWdJZkFoa2lBQUFBQWx3U0ZsekFBQUFUZ0FBQUU0QnNjMGZNd0FBQUJ4MFJWaDBVMjltZEhkaGNtVUFRV1J2WW1VZ1JtbHlaWGR2Y210eklFTlROdWk4c293QUFBQlBTVVJCVkJpVmpWQkJEc0F3Q0FLMy8vKzRZNWV5R05hREpoNVVCSlNTTUlrYW9RSW9BSXk1aktrOXRENWJHcmdBRkRVMGVZZGtMbjFXdUFsWHM5SGpzUlVmY3lWRHE4dlNQNWxUYi96SEY2VW9FeGRNWXJPSEFBQUFBRWxGVGtTdVFtQ0M"},{ name : "__ASSET__:bitmap_flixel_system_debug_stats__Stats_GraphicMaximizeButton", data : "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUFvQUFBQUtDQVlBQUFDTk1zKzlBQUFBQm1KTFIwUUEvd0QvQVArZ3ZhZVRBQUFBQ1hCSVdYTUFBQUIyQUFBQWRnRk9leVlJQUFBQUIzUkpUVVVIM2dNSkNSOFVCaGtEeVFBQUFFOUpSRUZVR05PdGtFRVN3REFJQW92Ly8vUDJvb2FhOUJaUFpvQXdxd0NlTlpMVUQ5ZkNIVzc2VFkyZmR3MklVOVVwZUhlVU5kMVlBRm5kTUFGUW1ndTV0eGFWM202VDV5bW9EL0gwT3ZrTFNBOUI4bis0Y2pvQUFBQUFTVVZPUks1Q1lJST0"},{ name : "__ASSET__:bitmap_flixel_addons_transition_GraphicTransTileDiamond", data : "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQWlBQUFBQWdDQVlBQUFBckZzTTFBQUFBR1hSRldIUlRiMlowZDJGeVpRQkJaRzlpWlNCSmJXRm5aVkpsWVdSNWNjbGxQQUFBQXlKcFZGaDBXRTFNT21OdmJTNWhaRzlpWlM1NGJYQUFBQUFBQUR3L2VIQmhZMnRsZENCaVpXZHBiajBpNzd1L0lpQnBaRDBpVnpWTk1FMXdRMlZvYVVoNmNtVlRlazVVWTNwcll6bGtJajgrSUR4NE9uaHRjRzFsZEdFZ2VHMXNibk02ZUQwaVlXUnZZbVU2Ym5NNmJXVjBZUzhpSUhnNmVHMXdkR3M5SWtGa2IySmxJRmhOVUNCRGIzSmxJRFV1TXkxak1ERXhJRFkyTGpFME5UWTJNU3dnTWpBeE1pOHdNaTh3TmkweE5EbzFOam95TnlBZ0lDQWdJQ0FnSWo0Z1BISmtaanBTUkVZZ2VHMXNibk02Y21SbVBTSm9kSFJ3T2k4dmQzZDNMbmN6TG05eVp5OHhPVGs1THpBeUx6SXlMWEprWmkxemVXNTBZWGd0Ym5NaklqNGdQSEprWmpwRVpYTmpjbWx3ZEdsdmJpQnlaR1k2WVdKdmRYUTlJaUlnZUcxc2JuTTZlRzF3UFNKb2RIUndPaTh2Ym5NdVlXUnZZbVV1WTI5dEwzaGhjQzh4TGpBdklpQjRiV3h1Y3pwNGJYQk5UVDBpYUhSMGNEb3ZMMjV6TG1Ga2IySmxMbU52YlM5NFlYQXZNUzR3TDIxdEx5SWdlRzFzYm5NNmMzUlNaV1k5SW1oMGRIQTZMeTl1Y3k1aFpHOWlaUzVqYjIwdmVHRndMekV1TUM5elZIbHdaUzlTWlhOdmRYSmpaVkpsWmlNaUlIaHRjRHBEY21WaGRHOXlWRzl2YkQwaVFXUnZZbVVnVUdodmRHOXphRzl3SUVOVE5pQW9WMmx1Wkc5M2N5a2lJSGh0Y0UxTk9rbHVjM1JoYm1ObFNVUTlJbmh0Y0M1cGFXUTZNek5HUmtFd05FSXhPRVV3TVRGRk5EazVRVGRDUlVVME56Z3lPVFkyT0RjaUlIaHRjRTFOT2tSdlkzVnRaVzUwU1VROUluaHRjQzVrYVdRNk16TkdSa0V3TkVNeE9FVXdNVEZGTkRrNVFUZENSVVUwTnpneU9UWTJPRGNpUGlBOGVHMXdUVTA2UkdWeWFYWmxaRVp5YjIwZ2MzUlNaV1k2YVc1emRHRnVZMlZKUkQwaWVHMXdMbWxwWkRvek0wWkdRVEEwT1RFNFJUQXhNVVUwT1RsQk4wSkZSVFEzT0RJNU5qWTROeUlnYzNSU1pXWTZaRzlqZFcxbGJuUkpSRDBpZUcxd0xtUnBaRG96TTBaR1FUQTBRVEU0UlRBeE1VVTBPVGxCTjBKRlJUUTNPREk1TmpZNE55SXZQaUE4TDNKa1pqcEVaWE5qY21sd2RHbHZiajRnUEM5eVpHWTZVa1JHUGlBOEwzZzZlRzF3YldWMFlUNGdQRDk0Y0dGamEyVjBJR1Z1WkQwaWNpSS9QckhzdVhJQUFBTHRTVVJCVkhqYTdOakJidVVnRUVUUk1QLy96NDRpelNhenlpakdYTGZPbGJLSnpLTUZEVlRWdXE3ckF3QmV4cjhYMXpvMDc4ZERkZnp2UmIwT3pYdFhIWGMvVE92UXZEK3Q0K21IZUIyYTl4dC8zR01BZnZGSVhJZm1QWEdCWHpkOTg4UmpmQjJhdDFKN1plOHF2VnVZa3dBQmNQc0ZkaDJhOThsTDlkcjA3YzdmT2pXMnNuYVYzcW1jblp3SUlVQ0FkNHNBQ1VURFBWZlNnMHJ0bGIycjlHN3U4UzlBZ0FEdkZSK24zVnZGdlZiY2UyVnNaZTBxdlZNNU8wUUlBUUxjZW9GSUlCcnV1WkllVkdxdjdGMmxkejMrQkFnd1NueWNkbThWOTFweDc1V3hsYldyOUU3bDdCQWhCQWh3NndVaWdXaTQ1MHA2VUttOXNuZVYzdlg0Z3dEQktQRngycjFWM0d2RnZWZkdWdGF1MGp1VnMwT0VnQURCclJlSUJLTGhuaXZwUWFYMnl0NVZldGZqRHdJRW84VEhhZmRXY2E4VjkxNFpXMW03U3U5VXpnNFJBZ0lFdDE0Z0VvaUdlNjZrQjVYYUszdFg2VjJQUDBDQWpCSWZwOTFieGIxVzNIdGxiR1h0S3IxVE9UdEVDRUNBM0hxQlNDQWE3cm1TSGxScXIreGRwWGM5L2dBQk1rcDhuSFp2RmZkYWNlK1ZzWlcxcS9STzVld1FJUUFCY3VzRklvRm91T2RLZWxDcHZiSjNsZDcxK0FNWUpVQUFBQUFCOGpqcjc5K0plWC95dnlmbWZhS085ZENZeW0rc1FYdFg2ZDNDbkFBSWtCR3NRNWZwT25TcHIwM2Y3dnl0VTJNcmExZnBuY3JaSVlJQUFtU1VDSkhBTk5LREhYVklZT2IwTHZFQkVDQjR1WXVVd1BUSFZ0YXUwanVWczBNRUFRVElLQkVpZ1dta0J6dnFrTURNNlYzaUF5QkE4SElYS1lIcGo2MnNYYVYzS21lSENBSUJnbEVpUkFMVFNBOTIxQ0dCbWRPN3hBY0lFT0RsTGxJQzB4OWJXYnRLNzFUT0RoRUVBZ1NqUklnRXBwRWU3S2hEQWpPbmQ0a1BFQ0RBeTEya0JLWS90ckoybGQ2cG5CMGlpQUFCUm9rUUNVd2pQZGhSaHdSbVR1OFNId1FJZ0plN1NBbE1mMnhsN1NxOVV6azdSQkFCQW93U0lSS1lSbnF3b3c0SnpKemVKVDRJRUFBdmQ1RVNtUDdZeXRwVmVxZHlkbklpaUFBQjhKc0xUQUxUU0E5MjFDR0JtZE83T2ZIeHhhY0FBd0RrMWZzODNpRUEyd0FBQUFCSlJVNUVya0pnZ2c9PQ"},{ name : "__ASSET__:bitmap_flixel_system_GraphicLogo", data : " "},{ name : "__ASSET__:file_flixel_system_VirtualInputData", data : "YmFzZSA9IDI2NiA0NiA4NCA4NA0KdGh1bWIgPSAyNjYgMTMxIDUyIDUyDQphID0gMCAwIDEzMiA0NQ0KYiA9IDAgNDYgMTMyIDQ1DQpjID0gMCA5MiAxMzIgNDUNCmRvd24gPSAwIDEzOCAxMzIgNDUNCmxlZnQgPSAxMzMgMCAxMzIgNDUNCnJpZ2h0ID0gMTMzIDQ2IDEzMiA0NQ0KdXAgPSAxMzMgOTIgMTMyIDQ1DQp4ID0gMjY2IDAgMTMyIDQ1DQp5ID0gMTMzIDEzOCAxMzIgNDUNCg"},{ name : "__ASSET__:bitmap_flixel_system_debug_GraphicCloseButton", data : "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUFnQUFBQUlDQVlBQUFERUQ3NkxBQUFBQkhOQ1NWUUlDQWdJZkFoa2lBQUFBQWx3U0ZsekFBQUFkZ0FBQUhZQlRuc21DQUFBQUJsMFJWaDBVMjltZEhkaGNtVUFkM2QzTG1sdWEzTmpZWEJsTG05eVo1dnVQQm9BQUFCL1NVUkJWQmlWVFkweENzSlFFQVhIYnlTZXdNdWxUV2R2YTZPbGxXSnBDQ0syaWsxT1krY3RRc1lpcS9rREM4dnM3bHZVU3UzVXBVcFdPN1ZDM1RqU3FXVU1EK0dldisxdGlKZDZ5dm95ajl3NzhWQVhLb21SR2JCaW9nY0dBTlNrTm5GNVY0L1IzOVNFMm9hNHF2TjRkdzUzS1lBMzBBRDFQeGJXUUFGOHZwYVlyTldBYU5WMEFBQUFBRWxGVGtTdVFtQ0M"},{ name : "__ASSET__:bitmap_flixel_system_debug_GraphicBitmapLog", data : "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUFzQUFBQUxDQVlBQUFDcHJIY21BQUFBQm1KTFIwUUFBQUFBQUFENVE3dC9BQUFBQ1hCSVdYTUFBQXNUQUFBTEV3RUFtcHdZQUFBQUIzUkpUVVVIM2dRWkV4c2Fka1ZHNHdBQUFFRkpSRUZVR05PVnpjc0pBREFJQk5FdDFUSnl0UFBKS2VSbnhBd3NlSGlnOUJOUW1mRURBU3REUUdXWTRRdStjQWhQN013cytqaU94cDR5dk9ZWkxrRkFIVzZYWUMwODhkcWRBQUFBQUVsRlRrU3VRbUND"},{ name : "__ASSET__:bitmap_flixel_system_debug_GraphicStats", data : "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUFzQUFBQUxDQVlBQUFDcHJIY21BQUFBQ1hCSVdYTUFBQXNUQUFBTEV3RUFtcHdZQUFBQUlHTklVazBBQUhvbEFBQ0Fnd0FBK2Y4QUFJRHBBQUIxTUFBQTZtQUFBRHFZQUFBWGI1SmZ4VVlBQUFBeFNVUkJWSGphWXZ6Ly96OERzWUNKZ1FSQWpPTC9VRXdkaytHbTBkVE5XQlZqdFpvK3ptQWtKUVlCQUFBQS8vOERBTDhIREFscWRHWVJBQUFBQUVsRlRrU3VRbUND"},{ name : "__ASSET__:bitmap_flixel_addons_transition_GraphicTransTileSquare", data : " "},{ name : "__ASSET__:bitmap_flixel_input_mouse__FlxMouse_GraphicCursor", data : "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUJnQUFBQWdDQVlBQUFBSVhyZzRBQUFBR1hSRldIUlRiMlowZDJGeVpRQkJaRzlpWlNCSmJXRm5aVkpsWVdSNWNjbGxQQUFBQW1SSlJFRlVlTnEwbHM5ckUwRVV4Nzg3MllTZ0psVFNTaVdwVnZyRElxaEZVSUtnK0NlSUlncWVGRS9pVFJDOHBMUVhqeUwwNGc5Q29tWFRKSVcwT1ZVRU1UZEJSSWs1VzZXdGtLSlNiR25EcHNuNlprMlczVFFicytua3dkdVpuVm0rbjMwenczc2pCVUxCQ0lBcGRNbGMrL3orZDlScTVMbHVBT1JhTzhrZkR5ZW5XMGJ5YU9LZVl3RGpEMDNUZEFnSlJFUkhJTkVlYUpWS0ZZeEprQ1NKajAzWVJYTC85bVZib2Q2QmtIMEV1bWxTdlNjMEVnTnc1ZXAxakE2UENJY1lnQU0rUDU0OG5zYXh3VUdoRUdaKzJTaFZNSjlLNCtqQUVXRVFDMkM3cEVKakhpeWswd2dGZzBJZ3JIRmdhYm1vaTJkbWt6amMzNzlueUM3QW44MHQvRjdmMFBlQ1F3NzE5UmtRT29xUlBRTzRmVjBwNnUzdzBCQXl5U1FDZ1VESGtLYUE0czkxYkc2VjlQN3hrVkU5a29NOVBSMUJtTjNFVWkwS2JpZkd4akNuS1BEN2ZJNGh0b0RWNGkrbzVSM2ovZlRKVXdSSk9JYllBbmgrK3I2NlpoazdNejRPSlI2SDErdHRHOEphVFg3N3NZWkt0V29aQzU4OWg5U3JtYlloTFFHcXVxTXZWYU9kRDRjeEU0M0M0M2JEVkU4aWpnR05tMjIyU3hjdUl2Nzh4WDhoY2l2eFdTV0dmUDRUYmV4K0VtcitLVjhxdFZ3MlEyQ3U4YmFBVk9JbEZ1YlQvejZTWFdBdTF1N1J0MENhQXJJa25Na2t3UXVjTE11UW1PUTBReGlRWFlEWGkxa2thR2tZWTVEZExqNzBsdnhCaDhuVVl3SGtjbThRaXo0MUw4a2lMM1pVbzdjN3Jja0c0T09IOXlnVThuQVRzMWI4cytUWFNGd1ZVbkMrRkQ3VFh4czNpemtSNGtZRUx1c0o0ZUkzbTRuYkxZT1RWS0dRM3hEeDU1YUxWNjBmSTcvRDg1ekltMTA5Z21ma3QwU0wxMi9YdmRUZTdkYjEvYThBQXdDWlVNUU16UW9keXdBQUFBQkpSVTVFcmtKZ2dnPT0"},{ name : "__ASSET__:bitmap_flixel_system_debug_interaction_tools__Transform_GraphicTransformCursorRotate", data : "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUFvQUFBQUtDQVlBQUFDTk1zKzlBQUFBQkhOQ1NWUUlDQWdJZkFoa2lBQUFBQWx3U0ZsekFBQUFUZ0FBQUU0QnNjMGZNd0FBQUJ4MFJWaDBVMjltZEhkaGNtVUFRV1J2WW1VZ1JtbHlaWGR2Y210eklFTlROdWk4c293QUFBQkVTVVJCVkJpVmRjNUpEZ0F3Q0FMQVl2ei9sK25KQkJjOFZaMFNRZkpKYVFOZDVFQndmUmhVaVZSNG9WVnA1cHp2TUhDZDRhQmlWR0k3MmlXSERCeHVVUEg1NFFNNWNROFhwbTRKVmdBQUFBQkpSVTVFcmtKZ2dnPT0"},{ name : "__ASSET__:bitmap_flixel_system_debug_stats__Stats_GraphicMinimizeButton", data : "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUFvQUFBQUtDQVlBQUFDTk1zKzlBQUFBQm1KTFIwUUEvd0QvQVArZ3ZhZVRBQUFBQ1hCSVdYTUFBQUIyQUFBQWRnRk9leVlJQUFBQUIzUkpUVVVIM2dNSkNSMDFlRVp4RlFBQUFEOUpSRUZVR05OaitQLy8vMzhHQWdDdUJzWkExb1JOREM2QnJoQ1p6L1QvLzM4bWZOWVQ0elR5QUNPNjhZeU1qRmpGbUpBbHNacUVMRWRVOEJBYjRBQzRjRkxGc3d1SW53QUFBQUJKUlU1RXJrSmdnZz09"},{ name : "__ASSET__:bitmap_flixel_system__FlxPreloader_GraphicLogoLight", data : "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUVBQUFBQkFDQVlBQUFDcWFYSGVBQUFBR1hSRldIUlRiMlowZDJGeVpRQkJaRzlpWlNCSmJXRm5aVkpsWVdSNWNjbGxQQUFBQnE1SlJFRlVlTnJVVzR0dTR6WVE1TktVYzNmcHQvYWYrcE01MjVLNFJRQ3gySnZiRi8xSTJ3Q0VaRWQyTk1QWnQwTGx6Ny9LQzMvb1NkL0RyN3JCOXNXZzZVN0E5Q295MmhjQXB3ZStpNFB2NC84Q0FSUzhSM2VBbE5ld3VBNC9RNCtTMEw0SU9EMWdDcFM0RC81cUFpeEFsSHd2SW9PVHBQQ0VtcDVHQUUwQ0orTzZqQk5rQjlSVFRLSTlDTndDR0wwWDdUd0xnS3lBWlllSUtUVTg2Z1ExSXNaN1ZRRS9TNEE4NzQ0S1h1b0RNdktPVm5XVWdJQ3NSUWNKRkpBeFJVeDdFSHlGY3dSY0EySTg4QU5rRjY5SlVRWTdEalEwaDVZQWI1RkFEdUFxRnNGNWhvQU93UHZ4K1E0cTZBYjR0Qis0eHdscTREWGdKK1cxWmc3c0VERFdMc0NpQ1hqK0ljd1ZXbkwzU1pFK0FwWkFjVlZGRmFSNGRqN0FzZ0MrSDUvWndROGcwRzRvd1EyUjdRNnZYNVhkSHlBYkFHOEtHZmdkMnU0UDRKczR4OWZqZm5ieG5YMDJTclNKM2RkMi9pU09UUnkxZFlMcjBRZDBBRDhBeTRYa2FVUjRvZkkzTWxvaXhkWGlPMG9ld1M2d21xSUdWSUFrUUlKZWp6WCszbVlrUldnS2x2Ui9lZDBtS2poTi9pY0Q5RmtjeitMMzQ5b0t6cENGbzBQZ0RmeUk1ZUZaMmUzeWlBL3draHEwOHdVQXY4SDVJb2lRU2tCUExuZitKcFpHZ0JWQ2krSVV6YWpRa3BWZURhUXZ3WDg3UUkvMVRmeE9tb1NtQUFSL0ZZUlI0RGhMMER0SU9VRnliSitVVUllN1AwQi9QNERMOVNaSWtHYkFRSUFFdjRqZEw0cGlNR21xQWp3Wi9RVFZDVklpSDdETW9BRUJBL0FuQ1QrTzQzZEJ6aG5zZWhBZzdmNFQvRThnQ3NIdlNzSlVJVzBtbzcvSVVSZ2tKd3lpL1dzRWZBSitQd2dZUzVyRzRoRHdDZjRDU2lsR2xyZ2JaS0FTckVZclo0b2hMZDNGMEhkV0NQaHhrUEN1S0dFUkpFb0h1QjdnaDBwSUFhOGxSaWVSTVZZbFd6VHJnMHd4cEJFaGZjRWlTSkFFSUFudmdvQXpSQUpwLzJkbDUyVitzRUtJYk1mN0o1RU00YkljSWJWRTFXZWx2bG9PZ0k0UUNaQ21nQXBZaGRldjRzWXQ4R05wOVlaSHdpOUtpRExCNGhSQUo4TVJuc0VSRG4vd0J4Q3dnTk5hUWZvTXdHVmtXSlQwR2plcVo3ckhUUWtSTldoalJabmdHWlNBSmpITW9JRUNic0lrQnZnQi9BMXlDU3Uxcm80RDU0d1BvQ0FaaWtwZ0xTcThLZUZ4Z0tuQ0I4aW9JTUZmSUwxdWlWTGJhNzJGWVRBVEZTaHdqTTFSeGpDUlJlejRKbXI5TTZUTkMrUU5sdXk5QnF4cEJqTzFnQlVleVZBRGtxRVJVK0hHUmlSb3prNlRrNm5TN0N5eUpZWVRzeDNpQW0xeEN0cG94ZWtZUlUzVnUwQVh1TW1aMlI4N0ZSZzcvVDJyMVYyVWZvRDNXYTk5bmhtcjNhMEE3WTk3N1d4TVQzZFk2MEV3SmtJYnRMMnNuUDllOEdZWUpLZU5aTzF3VDdTeE1HbTVpci9KSWd6dVVQL2Z4R2MyY2R3VVFsQTkzc3pBRElQUkdKcVYzbDBQMmxpeXJKV2xMWW5QVk1nRHJzcTZBUUdhU3Rnd3lSSjFoVnBDTWw3ZkhuY2VnVjlFL0Vid0MrUUJzZ3orT0k2WFl3MHlWa1VORmhIZUlOWE5BNnkrR2twdGQzYitDbVZ0aGZSMmhZS25ReW44QVNSY3dUUlFBWmFQaUtLYW1ncVQ0Z09zY1pVbCtjWG81bGdWWDRmTTd3T1dSOFNtQUk4YzVUOEthY2FPRjRNRWRxUXZuVnd6cXJvVkNDQWdZQld5bCtDUmdCV1VnSW9vR1FjWW1ZQVg0anFFdEhiY21CeVdrTkx4dllGUGtBckFqdEJGVVlFa3dsSUFubk1tQ2hSbnlvbzl0azNKNkc3S0VGVHVyblJ5NkJUeEd1bEFmOExTRklBT2taMlErRnRWT0JNR05UVnNrUGRYQXp6dVBqWkZPNWpCVGV5MGpBWVhKVS9ZamR6QWNvUnVGR0NuZHU0d2t4dm5ZMngxVlZTek83dGZ3UVIyVUFIbUJSZHh0SnhnRDU0eWNVM0E2NkdqS2V4S3I2REF6ck1DQ25jZkJ5TmFQbkZUdlArcWhNTTlDSU4zT1VFckJTYVIxR3lKTWZkTk5FS3QyV0EzU0pESHEyUDdtZDNIOUQ1VkRHbFBjZlNnNVl4Z21taDV6VXlIVjZXbXNNQjNweVpJSzhDZHBSdkFOeU5ibEFTY2xLNU9FVTdRZXo1Z0Qyb0JiL2VuTTBFdkg3Q2V5Y0dFYVFCcHg4MWxtcGRlaldFOUtUSlRLdk1qaVZCSlBKT3p3WmdMbldBTituajRqSkJHUkUvbS96elRGR21KM2ZjYURkM0lGYW80N2tyTHF6Z0U0UENUamVaSWxQV0Z1NS90Q211NUFRNGdHRVpaVlF3cHZhZkROQ2ZibmVKTEE1d3BnKzl1aVZId1hsZUlRSDlnTlRpTEUyVllxZTZpZmlGUE5IZW5HaUxraEVRQ1U4RHFyMExPRUQwMm55R2lPS0dPWnh1aldSTW9Tbmkwd2lRcFQyaVEwNGttQnp3N3RRZ0hOcDhpWW1ZeTVEMTBxRDJwVGNiTWdCTmtsNENFakpON3lmOExjS0tEck8yOE5ZTG53QXk4bHJ5MzAwODFnZG5Ka1VXSU5YVGxoQkl5NzAwUFJlNGx3RXFPTEFkcDNTQWxBSEJ5V0hNWCtHY29nQnhpSWpJeWl1STdydmt5QWlJMXpONGtUeWpqS2VDZlFVQlcyc1dwS1NJbitCTGd6eVlnVXNXak4vNi8rdS94NkticDN3QnEvZnd0d0FDRGVkRE1KazlyRWdBQUFBQkpSVTVFcmtKZ2dnPT0"},{ name : "__ASSET__:bitmap_flixel_system_debug_GraphicConsole", data : "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUFzQUFBQUxDQVlBQUFDcHJIY21BQUFBQ1hCSVdYTUFBQXNUQUFBTEV3RUFtcHdZQUFBQUlHTklVazBBQUhvbEFBQ0Fnd0FBK2Y4QUFJRHBBQUIxTUFBQTZtQUFBRHFZQUFBWGI1SmZ4VVlBQUFCVVNVUkJWSGphdEpIUkNVQWhEQVBqRzhVVjNNbmhuTVZaWE9IOFVTaFBoSW9ZeUUrNXRJRUdRRjU5T3BDRm82UXFLVzFwd0RvRERTaS91WUFGbmk0amxEM3d2SUlOWEcxMmQ0NUFCZEt1V25qMmxENEFLVWJYUXNkOGx3a0FBQUFBU1VWT1JLNUNZSUk9"},{ name : "__ASSET__:bitmap_flixel_system_debug_interaction_tools__Eraser_GraphicEraserTool", data : " "},{ name : "__ASSET__:bitmap_flixel_system_debug_interaction_tools__Transform_GraphicTransformCursorScaleXY", data : "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUFvQUFBQUtDQVlBQUFDTk1zKzlBQUFBQkhOQ1NWUUlDQWdJZkFoa2lBQUFBQWx3U0ZsekFBQUFUZ0FBQUU0QnNjMGZNd0FBQUJ4MFJWaDBVMjltZEhkaGNtVUFRV1J2WW1VZ1JtbHlaWGR2Y210eklFTlROdWk4c293QUFBQlBTVVJCVkJpVmxZOUJFb0F3Q0FNM0hmLy81WGdRMndyMFlJNndKRUcyelNaSkFraGpSZ2QxR3FkRkN5cjAxc2l4QUNVcVlJWEJBcnRyd0xudlZTS2V2WFpud0FWTXRXYmN2NjhQK3BTL0FmNTJIUmZ1cmtCMkFBQUFBRWxGVGtTdVFtQ0M"},{ name : "__ASSET__:bitmap_flixel_system_debug__FlxDebugger_GraphicDrawDebug", data : "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUFzQUFBQUxDQVlBQUFDcHJIY21BQUFBR1hSRldIUlRiMlowZDJGeVpRQkJaRzlpWlNCSmJXRm5aVkpsWVdSNWNjbGxQQUFBQUU5SlJFRlVlTnEwa01zTkFDQUlRNnRic3FCcjF2Z25haFFQTnVrRlhna3BTS0phZUZhWVFWSGg1WWdWbEFiZjFJN1E1UVRnc0pmZTBlTkJYMkFwajR4V2RxWnV4QUwzUnRJZ0dLdERGR0FBNGg0Vk01NWl5QnNBQUFBQVNVVk9SSzVDWUlJPQ"},{ name : "__ASSET__:bitmap_flixel_system_debug_GraphicArrowRight", data : "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUFzQUFBQUxDQVlBQUFDcHJIY21BQUFBR1hSRldIUlRiMlowZDJGeVpRQkJaRzlpWlNCSmJXRm5aVkpsWVdSNWNjbGxQQUFBQUQ1SlJFRlVlTnBpK1AvLy96SWdqZ1JpQmtJWVJNQUFRVTNJaWdscXdxWVlweVo4aWpFME1mNEhheUVLTENmSlpJcmRURlJvRUJYT1JNY2dRSUFCQU1xdGZ6aUhGZ2JoQUFBQUFFbEZUa1N1UW1DQw"},{ name : "__ASSET__:bitmap_flixel_system_debug_GraphicWatch", data : "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUFzQUFBQUxDQVlBQUFDcHJIY21BQUFBQ1hCSVdYTUFBQXNUQUFBTEV3RUFtcHdZQUFBQUlHTklVazBBQUhvbEFBQ0Fnd0FBK2Y4QUFJRHBBQUIxTUFBQTZtQUFBRHFZQUFBWGI1SmZ4VVlBQUFEY1NVUkJWSGphakpBaFM4TmhHTVIvZTFGWkdNSmd3U2FyVnNPS1dSSGJtcGo4Qkg0Q205L0JabDJ3R3NSZ0U5Um1GbHcwQ0NKWUxIZG44UDF2KzZ1SUIwOTU3cmk3NStrazRiOG9BTmdGZXhmN0d2c0ZlNHA5Z2oxb3FaTVFhVDlTSXQxSE9vNTBGdWs5MG1Xa2ZoS1N6TVRUU0xlUnVnMFI2VENTSXgwMHUxSUQxb0VIU3ZsWUNMMEJYb0ZodS9NWHNZYzlxamVzQWtkQXQzS3R6cHVSSGlPOVJicUtkRmR2T0krMDFOVG96RjVuYndEakd0c0hkb0JuWUp0U251Yk9peU90Uk9wRk9xM3VGeitkdjhOZUF5YkFNcVZzQVgrSWY4SG5BTlI0d3BRazlwRnhBQUFBQUVsRlRrU3VRbUND"},{ name : "__ASSET__:bitmap_flixel_system_debug_GraphicInteractive", data : "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUFzQUFBQUxDQVlBQUFDcHJIY21BQUFBQkhOQ1NWUUlDQWdJZkFoa2lBQUFBQWx3U0ZsekFBQUxFZ0FBQ3hJQjB0MSsvQUFBQUJ4MFJWaDBVMjltZEhkaGNtVUFRV1J2WW1VZ1JtbHlaWGR2Y210eklFTlROdWk4c293QUFBQndTVVJCVkJpVmpaR3hEWUF3REFSZnpNSTYyU0JTT3RaZ0tBWmdBYW9NUVU5SmRSUUprUXVjOE5MTHNuVitGeGFnanFQdEovbUtrdVphaXpxSkFiaXJvNWNjSlYyU1ZqTXJGNXpFQXpockRXL3liOURDeXdpMDhFNlJDelk0NTR4WitBUWJuRkxDTEN6ZWt3UnNneTgyUDZENlFrZUFUREtHQUFBQUFFbEZUa1N1UW1DQw"},{ name : "__ASSET__:bitmap_flixel_system_debug_interaction_tools_GraphicCursorCross", data : "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUFzQUFBQUxDQVlBQUFDcHJIY21BQUFBQkhOQ1NWUUlDQWdJZkFoa2lBQUFBQWx3U0ZsekFBQUxFZ0FBQ3hJQjB0MSsvQUFBQUJaMFJWaDBRM0psWVhScGIyNGdWR2x0WlFBd05TOHlPUzh4TnJ0VlFGa0FBQUFjZEVWWWRGTnZablIzWVhKbEFFRmtiMkpsSUVacGNtVjNiM0pyY3lCRFV6Ym92TEtNQUFBQUxrbEVRVlFZbFdQOC8vOC9BeGJ3bjRHQmdSRmRrQW1iU2x4Z2tDaG1ZWUI0Qmh2QUVHZGh3T0pyaG1FVUdnQjN1Z2NXZXB2bWtRQUFBQUJKUlU1RXJrSmdnZz09"},{ name : "__ASSET__:bitmap_flixel_system_debug_interaction_tools__Transform_GraphicTransformCursorScaleY", data : "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUFvQUFBQUtDQVlBQUFDTk1zKzlBQUFBQkhOQ1NWUUlDQWdJZkFoa2lBQUFBQWx3U0ZsekFBQUFUZ0FBQUU0QnNjMGZNd0FBQUJ4MFJWaDBVMjltZEhkaGNtVUFRV1J2WW1VZ1JtbHlaWGR2Y210eklFTlROdWk4c293QUFBQkdTVVJCVkJpVmZaQkpEZ0F3Q0FLbDZmKy9iRTl0RVlPY3pFaHdRV2FHNkFJd1hNYWtkVEcyYUdhYklLUTVqcllhamNBUEhZMzhFZDVSanltN2NpS2k2ekVkRFZQSEFlQm5EaFZYand5eEFBQUFBRWxGVGtTdVFtQ0M"},{ name : "__ASSET__:bitmap_flixel_system_GraphicVirtualInput", data : " "},{ name : "__ASSET__:bitmap_flixel_system_debug_GraphicArrowLeft", data : "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUFzQUFBQUxDQVlBQUFDcHJIY21BQUFBQm1KTFIwUUFBQUFBQUFENVE3dC9BQUFBQ1hCSVdYTUFBQXNUQUFBTEV3RUFtcHdZQUFBQUIzUkpUVVVIM2dRWkVqQTAzU0hjY2dBQUFFQkpSRUZVR05Oai9QLy9Qd01SSUpLQmdjR1g0Zi8vLy9odzVQLy8vNWY5aHdLaUZPRlNqRlVSdW1LOGlwQVZFMVJFdHNra3U1bXMwTUNyaVpHVUdBUUFzOU5wbXo4SWloRUFBQUFBU1VWT1JLNUNZSUk9"},{ name : "__ASSET__:bitmap_flixel_system_debug_GraphicLog", data : "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUFzQUFBQUxDQVlBQUFDcHJIY21BQUFBQ1hCSVdYTUFBQXNUQUFBTEV3RUFtcHdZQUFBQUlHTklVazBBQUhvbEFBQ0Fnd0FBK2Y4QUFJRHBBQUIxTUFBQTZtQUFBRHFZQUFBWGI1SmZ4VVlBQUFBa1NVUkJWSGphWXZ6Ly96OERzWUFGaVkxUEZ5TzZZc1pSa3dlSHlRQUFBQUQvL3dNQStmWUlMQWhqbnhZQUFBQUFTVVZPUks1Q1lJST0"},{ name : "__ASSET__:bitmap_flixel_system_debug__Window_GraphicWindowHandle", data : "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUFvQUFBQUtDQVlBQUFDTk1zKzlBQUFBR1hSRldIUlRiMlowZDJGeVpRQkJaRzlpWlNCSmJXRm5aVkpsWVdSNWNjbGxQQUFBQUZCSlJFRlVlTnFNandFS0FDQUlBeFgyeWg3b055MmpRa3lwUWJUMGRFU3FTblllRXZoWE5zRE1ZblhlelZHNHdBME5OVlJaSGpLUEgyaDYvNWwxVzBPaXgzTlRFbDFDSjdxS0MvNExraTdBQUQ1WWZydllMZlJQQUFBQUFFbEZUa1N1UW1DQw"},{ name : "__ASSET__:bitmap_flixel_addons_transition_GraphicTransTileCircle", data : " "},{ name : "__ASSET__:bitmap_flixel_system__FlxPreloader_GraphicLogoCorners", data : "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUVBQUFBQkFDQVlBQUFDcWFYSGVBQUFBR1hSRldIUlRiMlowZDJGeVpRQkJaRzlpWlNCSmJXRm5aVkpsWVdSNWNjbGxQQUFBQlkxSlJFRlVlTnJrV3d1eW16Z1FsR1Q4d1g1Sk52ZS9UUTYwdFhrdi9tRkFDNjRaMG01TEFwejFPaENxcHJEQnh1NmVuaGtKUnRZWTg2MnhkV1A3eG40MDloM3NIem4yMGRpeHNaTlkwZGlsc2JLeENxd0c4MkQ4M3NDZVg3ZWJoWDFyRHZacVdXTUwyUzhiV3dtT1RXTnZZbDhhKzlyWVg3TC9MTWZiejJ3Yk8yZHljQ2tBQ3JtZ0FTQkZ3QzZ5Ui9BZVNJZ0Jad0lZT0pPQVJDandSZUQ2K1BrTS9sc054OVlDZWlmN055VmdMeGQ5QjYrMzlyZnN2NHNLV2dXY3lmczFlVDRGT3VUOVBnSVFXRWdKQzFCQklZNjhpT20xVVNVWlhIZWhCSnprd0VHQUtoSHZRc0M3a0hRU0FpNEF1b29BcjhuTEtlQkRWR0FEUkRnaTRnSktacy9uNHZWYzNxL1VrVXFBRjVBZllrakNoNUNqM2k4SFNOMzBBQjlDZ0Uwb0FVbXdRa0JKdVVpUHJ5RG1jM205RkNJNkFpcngvZzhnUU1Hci9BdncvcEQ0N2dPYzh2eFFFcFNJQ3ZhbFhKc1Y4Q2J4bndNcFZTYmVMWUVBQkw2WDh5ZUsrMGRCRHdYK0tCRTFPQWdKVUd4YklzQm5VTmEwREI3azlSRkszeGtraGpFK3hMc2h3SDRrZUQrQUNFM0VXc1cwVkI0QW0xWUFMWmMyZzlwK0lQQUhxdmxWSk5iTlNFOC9vZ0QrYm93SXZMWVR4eDBCMTE0STJJZ3RNZ0NxSHp4Q3lWUFpsMVRxbmdteTcxcVdsR1poYjZqOEZZUnRUOGt3eXdUb2lZQVhFZkQxTDRKOGxCZzdrSFF2d0d2NDc1Y0F4b09RMEJHQTRNODB6T1doN2JNOVBsUUZzWE0xNUlRU0JrWWhFbFlaZ01haGJxeld2d0o4MzIvYWdBbzhPSzZDb1R1VFVDTUJPTkJoNzc4YThKakU2R2wwV29FS0NzQjYwaktJRTV3TGxic3hZL2ZmZ1FoV0ErYXVNa0NDeVFMU0x3Zkd2Zm5OeVdBVmxLU0VRc2NCUlVUNmZpS2VUeW1ocGx6QUpGd0pLQlAxZnFvSzRMQ3RZYUtFSkRoSDRLc1pTRDgwTnFnREpGd3R3emNrbWFtSGdROGt3NHBJV0RqeS90UVZFQ01pUmtMbElqYzFwK2oxUGdKOElDRldMbkZuMTgvTSsxWGdIdWFOQXVvQk56dW1Gdis5WWVBQ1NXL29sSGVxT2VER2hpcGc2dU9BS0JFdVVmYm1zREVKRlpQZ1RQcWh4bHhJQ0QybTZ3Z1krOGhxVHZuQXU1bDZQVFl6dkZPRCt3T2tINW9YZE9kY1l2dzg1ZEdnSHhvT3pveDdiaitYSE5BZGMyYittMDlNazQyYmFlSWJzbGtsd1A0cFlFUHZYZVFEcVMvUGFsTUZoR3lPS3Jqck8zSXpCODBLdm51czdoTGVueklwc2NmbmQ2cDNpVENZaStkakpEZ2t3TTI4SW9SYTdib2NNR2NWaE1CamE1M3JYZ1NJbUVNSkRMWGNJdVlGZGxzdUlpVE1EZnhObDZrTGdIZG1Yb21RUTBCYlp6c0N0SWRXRDA1OVlHUURCSEJ2c2JiUVpZN0FZM3hNT1JuYW52aS9VVUJHS3BoVFNXVHBZM2Q1aTNuWm5sanBtNTU4WUNlWStFS0xMQlRyQ2dsWXc0bU13c0JNWkdnY0d2bTVsUGVOdE1sZDI4YUZpQlVSNEdES1hKdGhEWXV2bnV2SEZJREFPd1VnQVdzS0IrNFB0aWJjbWhxN0RXVk11TkY1N08yc01mY2wrbGFWNE5xaXE3VUhOd0owQXlmTzhnVnNqMC9kWDdPSlAydi9ZKzhPbWVveStDVTRkdzFxdjRaQUxuOCtGK05HNlJBQi9oYzkrOHg1UG51ZFBhOXJCWElOQVNWZ0srQnpjN3MyQ0lIR1dtZTVXenNXTGo0U0Zxd2VQd0kwMzlwRHI3UGtOMkJyVkVDN3RZc0plRjBncnI3Z0xqSm53azlmWGxYdWVLaTdCTkNxN3EzNTJTNi9WUVZzNVlzS0h0dmxhMkFZMXduZVBXSXkvOCtUSkp1WTZOaEF0a2ZRT3lLZ2E1ZlBoVFgwUGk0OHhEc29xV2JLWnl1aER6eU84VlgyQ253WEljRXBBVXZ5UEpaQWpDdGRXZnFLbmlMYjQza3VkUnNCck10b1B4RUpMVzZMWlhCbjd0Y0xlQ0lnSXhYRXdpRkZRbXdNMFZmelkwdHBPZXVyOTNQQjlFbE1sYUR5YnovVExTc3pKdDR5YitCSGxrUlFUQWtwRXZ6STBoa2I0ckxzMmZ0YklPQU5iQXRWNExwZVlHZCtManIwZ2RLSGlhVnZQZEV6OGtIb2xyYUwxSHYydmtxL1hVWGVyaUQvVEdxb2NQSDB5ZHl2dXViWXFzejlpbTFWZ251Z01neXArVFl5ekkxTmNIQm1pM01aWFIxL3hLVCtyd0FEQUFKQmFpQW1tNXh3QUFBQUFFbEZUa1N1UW1DQw"},{ name : "__ASSET__:bitmap_flixel_system_debug_interaction_tools__Mover_GraphicMoverTool", data : " "},{ name : "__ASSET__:bitmap_flixel_system_debug_interaction_tools__Transform_GraphicTransformTool", data : "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUFzQUFBQUxDQVlBQUFDcHJIY21BQUFBQkhOQ1NWUUlDQWdJZkFoa2lBQUFBQWx3U0ZsekFBQUxFZ0FBQ3hJQjB0MSsvQUFBQUJ4MFJWaDBVMjltZEhkaGNtVUFRV1J2WW1VZ1JtbHlaWGR2Y210eklFTlROdWk4c293QUFBQThTVVJCVkJpVlkvei8vejhEQVFCWHdJSXVnQSt3SUxFWkNabk1SSVNCTUVNWWlWRU1CNE5JTWN5M3VJSVBMcytDUXdJclFGZU1MYXpoQmdBQTR2NE1GcEVTdzlBQUFBQUFTVVZPUks1Q1lJST0"},{ name : "__ASSET__:bitmap_flixel_addons_transition__TransitionFade_GraphicDiagonalGradient", data : " "},{ name : "__ASSET__:bitmap_flixel_system_debug__FlxDebugger_GraphicFlixel", data : " "},{ name : "__ASSET__:bitmap_flixel_system_debug_interaction_tools__Transform_GraphicTransformCursorDefault", data : "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQUFzQUFBQUxDQVlBQUFDcHJIY21BQUFBQkhOQ1NWUUlDQWdJZkFoa2lBQUFBQWx3U0ZsekFBQUxFZ0FBQ3hJQjB0MSsvQUFBQUJaMFJWaDBRM0psWVhScGIyNGdWR2x0WlFBd05TOHlPUzh4TnJ0VlFGa0FBQUFjZEVWWWRGTnZablIzWVhKbEFFRmtiMkpsSUVacGNtVjNiM0pyY3lCRFV6Ym92TEtNQUFBQUxrbEVRVlFZbFdQOC8vOC9BeGJ3bjRHQmdSRmRrQW1iU2x4Z2tDaG1ZWUI0Qmh2QUVHZGh3T0pyaG1FVUdnQjN1Z2NXZXB2bWtRQUFBQUJKUlU1RXJrSmdnZz09"}];
if(ArrayBuffer.prototype.slice == null) {
	ArrayBuffer.prototype.slice = js_lib__$ArrayBuffer_ArrayBufferCompat.sliceImpl;
}
var array = null;
var vector = null;
var view = null;
var buffer = null;
var len = null;
var this1 = new Uint32Array(256);
lime_math_RGBA.__alpha16 = this1;
var _g = 0;
while(_g < 256) {
	var i = _g++;
	lime_math_RGBA.__alpha16[i] = Math.ceil(i * 257.00392156862745);
}
var array = null;
var vector = null;
var view = null;
var buffer = null;
var len = null;
var this1 = new Uint8Array(511);
lime_math_RGBA.__clamp = this1;
var _g = 0;
while(_g < 255) {
	var i = _g++;
	lime_math_RGBA.__clamp[i] = i;
}
var _g = 255;
var _g1 = 511;
while(_g < _g1) {
	var i = _g++;
	lime_math_RGBA.__clamp[i] = 255;
}
lime_system_CFFI.available = false;
lime_system_CFFI.enabled = false;
lime_utils_Log.level = 3;
if(typeof console == "undefined") {
	console = {}
}
if(console.log == null) {
	console.log = function() {
	};
}
openfl_display__$internal_CanvasGraphics.hitTestCanvas = typeof(window) != "undefined" ? window.document.createElement("canvas") : null;
openfl_display__$internal_CanvasGraphics.hitTestContext = typeof(window) != "undefined" ? openfl_display__$internal_CanvasGraphics.hitTestCanvas.getContext("2d") : null;
openfl_ui_Multitouch.maxTouchPoints = 2;
openfl_ui_Multitouch.supportedGestures = null;
openfl_ui_Multitouch.supportsGestureEvents = false;
openfl_ui_Multitouch.inputMode = 2;
openfl_Vector.__meta__ = { statics : { toNullVector : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_DisplayObject.__meta__ = { fields : { __cairo : { SuppressWarnings : ["checkstyle:Dynamic"]}, addEventListener : { SuppressWarnings : ["checkstyle:Dynamic"]}, removeEventListener : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_DisplayObject.__broadcastEvents = new haxe_ds_StringMap();
openfl_display_DisplayObject.__instanceCount = 0;
openfl_display_DisplayObject.__tempStack = new lime_utils_ObjectPool(function() {
	return openfl_Vector.toObjectVector(null);
},function(stack) {
	stack.set_length(0);
});
AssetPaths.environments__json = "assets/data/environments.json";
AssetPaths.heroes__json = "assets/data/heroes.json";
AssetPaths.monsters__json = "assets/data/monsters.json";
AssetPaths.DejaVuSans__ttf = "assets/fonts/DejaVuSans.ttf";
AssetPaths.icon__png = "assets/icons/icon.png";
AssetPaths.axol_logo__png = "assets/images/axol_logo.png";
AssetPaths.background__png = "assets/images/background.png";
AssetPaths.barrier__png = "assets/images/barrier.png";
AssetPaths.cauldron__png = "assets/images/cauldron.png";
AssetPaths.close_button__png = "assets/images/close_button.png";
AssetPaths.combat_effects__png = "assets/images/combat_effects.png";
AssetPaths.credits_button__png = "assets/images/credits_button.png";
AssetPaths.cursor__png = "assets/images/cursor.png";
AssetPaths.dark_frame__png = "assets/images/dark_frame.png";
AssetPaths.demo__png = "assets/images/demo.png";
AssetPaths.demo__xml = "assets/images/demo.xml";
AssetPaths.door_indicator__png = "assets/images/door_indicator.png";
AssetPaths.down_button__png = "assets/images/down_button.png";
AssetPaths.environments__png = "assets/images/environments.png";
AssetPaths.exit_button__png = "assets/images/exit_button.png";
AssetPaths.explosion__png = "assets/images/explosion.png";
AssetPaths.explosion__xml = "assets/images/explosion.xml";
AssetPaths.fancy_font__png = "assets/images/fancy_font.png";
AssetPaths.fancy_font__xml = "assets/images/fancy_font.xml";
AssetPaths.GameFieldBorder__png = "assets/images/GameFieldBorder.png";
AssetPaths.GameFieldBottom__png = "assets/images/GameFieldBottom.png";
AssetPaths.game_over_scene__png = "assets/images/game_over_scene.png";
AssetPaths.grass_back__png = "assets/images/grass_back.png";
AssetPaths.grid_back__png = "assets/images/grid_back.png";
AssetPaths.heroes__png = "assets/images/heroes.png";
AssetPaths.info_back__png = "assets/images/info_back.png";
AssetPaths.injustice__png = "assets/images/injustice.png";
AssetPaths.juggler__png = "assets/images/juggler.png";
AssetPaths.juice__png = "assets/images/juice.png";
AssetPaths.large_numbers__png = "assets/images/large_numbers.png";
AssetPaths.large_numbers__xml = "assets/images/large_numbers.xml";
AssetPaths.lich_lord__png = "assets/images/lich_lord.png";
AssetPaths.map__png = "assets/images/map.png";
AssetPaths.map_node__png = "assets/images/map_node.png";
AssetPaths.map_path_0__png = "assets/images/map_path_0.png";
AssetPaths.map_path_1__png = "assets/images/map_path_1.png";
AssetPaths.map_path_2__png = "assets/images/map_path_2.png";
AssetPaths.map_path_3__png = "assets/images/map_path_3.png";
AssetPaths.map_path_4__png = "assets/images/map_path_4.png";
AssetPaths.map_path_5__png = "assets/images/map_path_5.png";
AssetPaths.meteor__png = "assets/images/meteor.png";
AssetPaths.monsters__png = "assets/images/monsters.png";
AssetPaths.ng_medal_popup_A__png = "assets/images/ng/ng-medal-popup-A.png";
AssetPaths.ng_medal_popup_B__png = "assets/images/ng/ng-medal-popup-B.png";
AssetPaths.ng_medal_popup_C__png = "assets/images/ng/ng-medal-popup-C.png";
AssetPaths.no_medal__png = "assets/images/ng/no-medal.png";
AssetPaths.party_indicator__png = "assets/images/party_indicator.png";
AssetPaths.pause_button__png = "assets/images/pause_button.png";
AssetPaths.play_button__png = "assets/images/play_button.png";
AssetPaths.pop__png = "assets/images/pop.png";
AssetPaths.potions__png = "assets/images/potions.png";
AssetPaths.progress_back__png = "assets/images/progress_back.png";
AssetPaths.progress_cap__png = "assets/images/progress_cap.png";
AssetPaths.prompt_back__png = "assets/images/prompt_back.png";
AssetPaths.quit_button__png = "assets/images/quit_button.png";
AssetPaths.refill_empty__png = "assets/images/refill_empty.png";
AssetPaths.refill_fill__png = "assets/images/refill_fill.png";
AssetPaths.replay_button__png = "assets/images/replay_button.png";
AssetPaths.resume_button__png = "assets/images/resume_button.png";
AssetPaths.score_back__png = "assets/images/score_back.png";
AssetPaths.screen_frame__png = "assets/images/screen_frame.png";
AssetPaths.selected__png = "assets/images/selected.png";
AssetPaths.selecting__png = "assets/images/selecting.png";
AssetPaths.simple_font__png = "assets/images/simple_font.png";
AssetPaths.simple_font__xml = "assets/images/simple_font.xml";
AssetPaths.skull__png = "assets/images/skull.png";
AssetPaths.sparkles__png = "assets/images/sparkles.png";
AssetPaths.spawn__png = "assets/images/spawn.png";
AssetPaths.spell_back__png = "assets/images/spell_back.png";
AssetPaths.StandardBGTile__png = "assets/images/StandardBGTile.png";
AssetPaths.story__png = "assets/images/story.png";
AssetPaths.striking_balls__png = "assets/images/striking-balls.png";
AssetPaths.tiny_digits__png = "assets/images/tiny_digits.png";
AssetPaths.tiny_digits__xml = "assets/images/tiny_digits.xml";
AssetPaths.title__png = "assets/images/title.png";
AssetPaths.title_logo__png = "assets/images/title_logo.png";
AssetPaths.transform__png = "assets/images/transform.png";
AssetPaths.tube__png = "assets/images/tube.png";
AssetPaths.tut_button__png = "assets/images/tut_button.png";
AssetPaths.up_button__png = "assets/images/up_button.png";
AssetPaths.victory_scene__png = "assets/images/victory_scene.png";
AssetPaths.gameloop__ogg = "assets/music/gameloop.ogg";
AssetPaths.title__ogg = "assets/music/title.ogg";
AssetPaths.block__wav = "assets/sounds/block.wav";
AssetPaths.boop_01__wav = "assets/sounds/boop_01.wav";
AssetPaths.boop_02__wav = "assets/sounds/boop_02.wav";
AssetPaths.boop_03__wav = "assets/sounds/boop_03.wav";
AssetPaths.boop_04__wav = "assets/sounds/boop_04.wav";
AssetPaths.click__wav = "assets/sounds/click.wav";
AssetPaths.damage__wav = "assets/sounds/damage.wav";
AssetPaths.death__wav = "assets/sounds/death.wav";
AssetPaths.drop__wav = "assets/sounds/drop.wav";
AssetPaths.finished_area__wav = "assets/sounds/finished_area.wav";
AssetPaths.hit_barrier__wav = "assets/sounds/hit_barrier.wav";
AssetPaths.hover_card__wav = "assets/sounds/hover_card.wav";
AssetPaths.make_barrier__wav = "assets/sounds/make_barrier.wav";
AssetPaths.match__wav = "assets/sounds/match.wav";
AssetPaths.meteor_impact_01__wav = "assets/sounds/meteor_impact_01.wav";
AssetPaths.meteor_impact_02__wav = "assets/sounds/meteor_impact_02.wav";
AssetPaths.meteor_impact_03__wav = "assets/sounds/meteor_impact_03.wav";
AssetPaths.new_blocks__wav = "assets/sounds/new_blocks.wav";
AssetPaths.ng_medal_GET__wav = "assets/sounds/ng_medal_GET.wav";
AssetPaths.ng_medal_GOT__wav = "assets/sounds/ng_medal_GOT.wav";
AssetPaths.potion__wav = "assets/sounds/potion.wav";
AssetPaths.skull_crush__wav = "assets/sounds/skull_crush.wav";
AssetPaths.spawn__wav = "assets/sounds/spawn.wav";
AssetPaths.spell__wav = "assets/sounds/spell.wav";
AssetPaths.spell_select__wav = "assets/sounds/spell_select.wav";
AssetPaths.step_01__wav = "assets/sounds/step_01.wav";
AssetPaths.step_02__wav = "assets/sounds/step_02.wav";
AssetPaths.swap__wav = "assets/sounds/swap.wav";
AssetPaths.thunder_01__wav = "assets/sounds/thunder_01.wav";
AssetPaths.thunder_02__wav = "assets/sounds/thunder_02.wav";
AssetPaths.to_skull__wav = "assets/sounds/to_skull.wav";
flixel_FlxBasic.idEnumerator = 0;
flixel_math_FlxRect._pool = new flixel_util_FlxPool_$flixel_$math_$FlxRect(flixel_math_FlxRect);
flixel_FlxObject.defaultPixelPerfectPosition = false;
flixel_FlxObject.SEPARATE_BIAS = 4;
flixel_FlxObject.LEFT = 1;
flixel_FlxObject.RIGHT = 16;
flixel_FlxObject.UP = 256;
flixel_FlxObject.DOWN = 4096;
flixel_FlxObject.NONE = 0;
flixel_FlxObject.CEILING = 256;
flixel_FlxObject.FLOOR = 4096;
flixel_FlxObject.WALL = 17;
flixel_FlxObject.ANY = 4369;
flixel_FlxObject._firstSeparateFlxRect = (function($this) {
	var $r;
	var _this = flixel_math_FlxRect._pool.get();
	var X = 0;
	var Y = 0;
	var Width = 0;
	var Height = 0;
	if(Height == null) {
		Height = 0;
	}
	if(Width == null) {
		Width = 0;
	}
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	_this.x = X;
	_this.y = Y;
	_this.width = Width;
	_this.height = Height;
	var rect = _this;
	rect._inPool = false;
	$r = rect;
	return $r;
}(this));
flixel_FlxObject._secondSeparateFlxRect = (function($this) {
	var $r;
	var _this = flixel_math_FlxRect._pool.get();
	var X = 0;
	var Y = 0;
	var Width = 0;
	var Height = 0;
	if(Height == null) {
		Height = 0;
	}
	if(Width == null) {
		Width = 0;
	}
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	_this.x = X;
	_this.y = Y;
	_this.width = Width;
	_this.height = Height;
	var rect = _this;
	rect._inPool = false;
	$r = rect;
	return $r;
}(this));
Keys.keys = (function($this) {
	var $r;
	var _g = new haxe_ds_StringMap();
	_g.h["axolapi"] = "\x00GITCRYPT\x00\nÿ\x12Ýs®JÑ¦\x0EÝÇÄåÜêX¿Ò$\x00·æb«ú¸—KÊI^§î\x0Cê¿Šw(–À\x18—";
	_g.h["ngappid"] = "\x00GITCRYPT\x00\x02±/Y”êt¯`–\x1Aý\x1Fót™E™ƒg�^H®`”";
	_g.h["ngenckey"] = "\x00GITCRYPT\x00M6$ ¦>JÔ-4nÜâ¡\t† yúÛ­1O­Åƒj\x10Î¯ˆO\x06'H;";
	$r = _g;
	return $r;
}(this));
Globals.AXOL_KEY = Keys.keys.h["axolapi"];
Globals.gameInitialized = false;
Globals.SeenTut = false;
openfl_text_Font.__fontByName = new haxe_ds_StringMap();
openfl_text_Font.__registeredFonts = [];
PlayState.SPAWNX = 8;
PlayState.SPAWNY = 99;
PlayState.HEROSTARTX = 146;
PlayState.HEROSTARTY = 98;
PlayState.MONSTERSTARTX = 98;
PlayState.MONSTERSTARTY = 98;
PlayState.TIME_BETWEEN_FIGHT = .4;
PlayState.PROGRESS_AMOUNT = .025;
PlayState.REFILL_TIME = 15;
Xml.Element = 0;
Xml.PCData = 1;
Xml.CData = 2;
Xml.Comment = 3;
Xml.DocType = 4;
Xml.ProcessingInstruction = 5;
Xml.Document = 6;
axollib_AxolAPI.VERSION = "2.0";
axollib_AxolAPI.URL = "https://axolstudio.com/api/" + "2.0";
axollib_AxolAPI.gameID = "";
axollib_AxolAPI.playerID = "";
axollib_AxolAPI.initialized = false;
axollib_AxolAPI.LoggedIn = false;
axollib_AxolAPI.UserNo = -1;
flixel_addons_transition_FlxTransitionableState.defaultTransIn = null;
flixel_addons_transition_FlxTransitionableState.defaultTransOut = null;
flixel_addons_transition_FlxTransitionableState.skipNextTransIn = false;
flixel_addons_transition_FlxTransitionableState.skipNextTransOut = false;
axollib_GraphicsCache.initialized = false;
axollib_TitleCase.exempt = ["a","an","the","at","by","for","in","of","on","to","up","and","as","but","or","nor"];
flixel_math_FlxPoint._pool = new flixel_util_FlxPool_$flixel_$math_$FlxPoint(flixel_math_FlxPoint);
lime_math_Matrix3.__identity = new lime_math_Matrix3();
openfl_geom_Matrix.__meta__ = { fields : { equals : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, to3DString : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, toMozString : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
openfl_geom_Matrix.__identity = new openfl_geom_Matrix();
openfl_geom_Matrix.__pool = new lime_utils_ObjectPool(function() {
	return new openfl_geom_Matrix();
},function(m) {
	m.identity();
});
openfl_geom_Matrix.__matrix3 = new lime_math_Matrix3();
openfl_geom_ColorTransform.__pool = new lime_utils_ObjectPool(function() {
	return new openfl_geom_ColorTransform();
},function(ct) {
	ct.__identity();
});
flixel_FlxCamera.drawVertices = openfl_Vector.toFloatVector(null);
flixel_FlxCamera.trianglesSprite = new openfl_display_Sprite();
flixel_FlxCamera.renderPoint = (function($this) {
	var $r;
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	$r = point;
	return $r;
}(this));
flixel_FlxCamera.renderRect = (function($this) {
	var $r;
	var _this = flixel_math_FlxRect._pool.get();
	var X = 0;
	var Y = 0;
	var Width = 0;
	var Height = 0;
	if(Height == null) {
		Height = 0;
	}
	if(Width == null) {
		Width = 0;
	}
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	_this.x = X;
	_this.y = Y;
	_this.width = Width;
	_this.height = Height;
	var rect = _this;
	rect._inPool = false;
	$r = rect;
	return $r;
}(this));
flixel_system_FlxVersion.sha = "76cdef5d7449488699c320e6aaaf640619befc37\n";
flixel_math_FlxRandom._arrayFloatHelper = null;
flixel_math_FlxRandom.MULTIPLIER = 48271.0;
flixel_math_FlxRandom.MODULUS = 2147483647;
flixel_FlxG.autoPause = true;
flixel_FlxG.fixedTimestep = true;
flixel_FlxG.timeScale = 1;
flixel_FlxG.worldDivisions = 6;
flixel_FlxG.VERSION = new flixel_system_FlxVersion(4,9,0);
flixel_FlxG.elapsed = 0;
flixel_FlxG.maxElapsed = 0.1;
flixel_FlxG.scaleMode = new flixel_system_scaleModes_RatioScaleMode();
flixel_FlxG.worldBounds = (function($this) {
	var $r;
	var _this = flixel_math_FlxRect._pool.get();
	var X = 0;
	var Y = 0;
	var Width = 0;
	var Height = 0;
	if(Height == null) {
		Height = 0;
	}
	if(Width == null) {
		Width = 0;
	}
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	_this.x = X;
	_this.y = Y;
	_this.width = Width;
	_this.height = Height;
	var rect = _this;
	rect._inPool = false;
	$r = rect;
	return $r;
}(this));
flixel_FlxG.save = new flixel_util_FlxSave();
flixel_FlxG.random = new flixel_math_FlxRandom();
flixel_FlxG.swipes = [];
flixel_FlxG.html5 = new flixel_system_frontEnds_HTML5FrontEnd();
flixel_FlxG.inputs = new flixel_system_frontEnds_InputFrontEnd();
flixel_FlxG.console = new flixel_system_frontEnds_ConsoleFrontEnd();
flixel_FlxG.log = new flixel_system_frontEnds_LogFrontEnd();
flixel_FlxG.bitmapLog = new flixel_system_frontEnds_BitmapLogFrontEnd();
flixel_FlxG.watch = new flixel_system_frontEnds_WatchFrontEnd();
flixel_FlxG.debugger = new flixel_system_frontEnds_DebuggerFrontEnd();
flixel_FlxG.bitmap = new flixel_system_frontEnds_BitmapFrontEnd();
flixel_FlxG.cameras = new flixel_system_frontEnds_CameraFrontEnd();
flixel_FlxG.initialWidth = 0;
flixel_FlxG.initialHeight = 0;
flixel_FlxG.initialZoom = 0;
flixel_FlxG.signals = new flixel_system_frontEnds_SignalFrontEnd();
flixel_addons_display_FlxSliceSprite.TOP_LEFT = 0;
flixel_addons_display_FlxSliceSprite.TOP = 1;
flixel_addons_display_FlxSliceSprite.TOP_RIGHT = 2;
flixel_addons_display_FlxSliceSprite.LEFT = 3;
flixel_addons_display_FlxSliceSprite.CENTER = 4;
flixel_addons_display_FlxSliceSprite.RIGHT = 5;
flixel_addons_display_FlxSliceSprite.BOTTOM_LEFT = 6;
flixel_addons_display_FlxSliceSprite.BOTTOM = 7;
flixel_addons_display_FlxSliceSprite.BOTTOM_RIGHT = 8;
flixel_addons_display_FlxSliceSprite.helperRect = new flixel_math_FlxRect();
flixel_addons_display_FlxSliceSprite.helperSize = new flixel_math_FlxPoint();
flixel_addons_display_FlxSliceSprite.helperDst = new flixel_math_FlxPoint();
flixel_addons_display_FlxSliceSprite.helperBdSize = new flixel_math_FlxPoint();
openfl_display_BitmapData.__meta__ = { fields : { image : { SuppressWarnings : ["checkstyle:Dynamic"]}, __framebufferContext : { SuppressWarnings : ["checkstyle:Dynamic"]}, __indexBufferContext : { SuppressWarnings : ["checkstyle:Dynamic"]}, __surface : { SuppressWarnings : ["checkstyle:Dynamic"]}, __textureContext : { SuppressWarnings : ["checkstyle:Dynamic"]}, __vertexBufferContext : { SuppressWarnings : ["checkstyle:Dynamic"]}, compare : { SuppressWarnings : ["checkstyle:Dynamic"]}, getSurface : { SuppressWarnings : ["checkstyle:Dynamic"]}, __fromImage : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_BitmapData.VERTEX_BUFFER_STRIDE = 14;
openfl_display_BitmapData.__supportsBGRA = null;
openfl_display_BitmapData.__tempVector = new lime_math_Vector2();
flixel_addons_transition_GraphicTransTileCircle.resourceType = "image/png";
flixel_addons_transition_GraphicTransTileCircle.resourceName = "__ASSET__:bitmap_flixel_addons_transition_GraphicTransTileCircle";
flixel_addons_transition_GraphicTransTileDiamond.resourceType = "image/png";
flixel_addons_transition_GraphicTransTileDiamond.resourceName = "__ASSET__:bitmap_flixel_addons_transition_GraphicTransTileDiamond";
flixel_addons_transition_GraphicTransTileSquare.resourceType = "image/png";
flixel_addons_transition_GraphicTransTileSquare.resourceName = "__ASSET__:bitmap_flixel_addons_transition_GraphicTransTileSquare";
flixel_addons_transition__$TransitionFade_GraphicDiagonalGradient.resourceType = "image/png";
flixel_addons_transition__$TransitionFade_GraphicDiagonalGradient.resourceName = "__ASSET__:bitmap_flixel_addons_transition__TransitionFade_GraphicDiagonalGradient";
flixel_animation_FlxPrerotatedAnimation.PREROTATED = "prerotated_animation";
flixel_effects_FlxFlicker._pool = new flixel_util_FlxPool_$flixel_$effects_$FlxFlicker(flixel_effects_FlxFlicker);
flixel_effects_FlxFlicker._boundObjects = new haxe_ds_ObjectMap();
flixel_graphics_FlxGraphic.defaultPersist = false;
openfl_geom_Point.__pool = new lime_utils_ObjectPool(function() {
	return new openfl_geom_Point();
},function(p) {
	p.setTo(0,0);
});
flixel_graphics_atlas_FlxAtlas.point = new openfl_geom_Point();
flixel_graphics_atlas_FlxAtlas.matrix = new openfl_geom_Matrix();
flixel_graphics_atlas_FlxAtlas.defaultMinSize = new flixel_math_FlxPoint(128,128);
flixel_graphics_atlas_FlxAtlas.defaultMaxSize = new flixel_math_FlxPoint(1024,1024);
openfl_geom_Rectangle.__pool = new lime_utils_ObjectPool(function() {
	return new openfl_geom_Rectangle();
},function(r) {
	r.setTo(0,0,0,0);
});
flixel_graphics_frames_FlxBitmapFont.SPACE_CODE = 32;
flixel_graphics_frames_FlxBitmapFont.TAB_CODE = 9;
flixel_graphics_frames_FlxBitmapFont.NEW_LINE_CODE = 10;
flixel_graphics_frames_FlxBitmapFont.DEFAULT_FONT_KEY = "DEFAULT_FONT_KEY";
flixel_graphics_frames_FlxBitmapFont.DEFAULT_FONT_DATA = " 36000000000000000000!26101010001000\"46101010100000000000000000#66010100111110010100111110010100000000$56001000111011000001101110000100%66100100000100001000010000010010000000&66011000100000011010100100011010000000'26101000000000(36010100100100010000)36100010010010100000*46000010100100101000000000+46000001001110010000000000,36000000000000010100-46000000001110000000000000.26000000001000/66000010000100001000010000100000000000056011001001010010100100110000000156011000010000100001000010000000256111000001001100100001111000000356111000001001100000101110000000456100101001010010011100001000000556111101000011100000101110000000656011001000011100100100110000000756111000001000010001100001000000856011001001001100100100110000000956011001001010010011100001000000:26001000100000;26001000101000<46001001001000010000100000=46000011100000111000000000>46100001000010010010000000?56111000001001100000000100000000@66011100100010101110101010011100000000A56011001001010010111101001000000B56111001001011100100101110000000C56011001001010000100100110000000D56111001001010010100101110000000E56111101000011000100001111000000F56111101000010000110001000000000G56011001000010110100100111000000H56100101001011110100101001000000I26101010101000J56000100001000010100100110000000K56100101001010010111001001000000L46100010001000100011100000M66100010100010110110101010100010000000N56100101001011010101101001000000O56011001001010010100100110000000P56111001001010010111001000000000Q56011001001010010100100110000010R56111001001010010111001001000000S56011101000001100000101110000000T46111001000100010001000000U56100101001010010100100110000000V56100101001010010101000100000000W66100010100010101010110110100010000000X56100101001001100100101001000000Y56100101001010010011100001001100Z56111100001001100100001111000000[36110100100100110000}46110001000010010011000000]36110010010010110000^46010010100000000000000000_46000000000000000011110000'26101000000000a56000000111010010100100111000000b56100001110010010100101110000000c46000001101000100001100000d56000100111010010100100111000000e56000000110010110110000110000000f46011010001000110010000000g5700000011001001010010011100001001100h56100001110010010100101001000000i26100010101000j37010000010010010010100k56100001001010010111001001000000l26101010101000m66000000111100101010101010101010000000n56000001110010010100101001000000o56000000110010010100100110000000p5700000111001001010010111001000010000q5700000011101001010010011100001000010r46000010101100100010000000s56000000111011000001101110000000t46100011001000100001100000u56000001001010010100100111000000v56000001001010010101000100000000w66000000101010101010101010011110000000x56000001001010010011001001000000y5700000100101001010010011100001001100z56000001111000100010001111000000{46011001001000010001100000|26101010101000}46110001000010010011000000~56010101010000000000000000000000\\46111010101010101011100000";
flixel_graphics_frames_FlxBitmapFont.DEFAULT_CHARS = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
flixel_graphics_frames_FlxBitmapFont.point = new openfl_geom_Point();
flixel_graphics_frames_FlxBitmapFont.flashRect = new openfl_geom_Rectangle();
flixel_graphics_tile_FlxDrawBaseItem.drawCalls = 0;
flixel_graphics_tile_FlxDrawQuadsItem.VERTICES_PER_QUAD = 4;
flixel_graphics_tile_FlxDrawTrianglesItem.point = (function($this) {
	var $r;
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	$r = point;
	return $r;
}(this));
flixel_graphics_tile_FlxDrawTrianglesItem.rect = (function($this) {
	var $r;
	var _this = flixel_math_FlxRect._pool.get();
	var X = 0;
	var Y = 0;
	var Width = 0;
	var Height = 0;
	if(Height == null) {
		Height = 0;
	}
	if(Width == null) {
		Width = 0;
	}
	if(Y == null) {
		Y = 0;
	}
	if(X == null) {
		X = 0;
	}
	_this.x = X;
	_this.y = Y;
	_this.width = Width;
	_this.height = Height;
	var rect = _this;
	rect._inPool = false;
	$r = rect;
	return $r;
}(this));
openfl_display_Shader.__meta__ = { fields : { glProgram : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
flixel_input_FlxPointer._cachedPoint = new flixel_math_FlxPoint();
flixel_input_keyboard_FlxKey.fromStringMap = (function($this) {
	var $r;
	var _g = new haxe_ds_StringMap();
	_g.h["ANY"] = -2;
	_g.h["A"] = 65;
	_g.h["B"] = 66;
	_g.h["C"] = 67;
	_g.h["D"] = 68;
	_g.h["E"] = 69;
	_g.h["F"] = 70;
	_g.h["G"] = 71;
	_g.h["H"] = 72;
	_g.h["I"] = 73;
	_g.h["J"] = 74;
	_g.h["K"] = 75;
	_g.h["L"] = 76;
	_g.h["M"] = 77;
	_g.h["N"] = 78;
	_g.h["O"] = 79;
	_g.h["P"] = 80;
	_g.h["Q"] = 81;
	_g.h["R"] = 82;
	_g.h["S"] = 83;
	_g.h["T"] = 84;
	_g.h["U"] = 85;
	_g.h["V"] = 86;
	_g.h["W"] = 87;
	_g.h["X"] = 88;
	_g.h["Y"] = 89;
	_g.h["Z"] = 90;
	_g.h["ZERO"] = 48;
	_g.h["ONE"] = 49;
	_g.h["TWO"] = 50;
	_g.h["THREE"] = 51;
	_g.h["FOUR"] = 52;
	_g.h["FIVE"] = 53;
	_g.h["SIX"] = 54;
	_g.h["SEVEN"] = 55;
	_g.h["EIGHT"] = 56;
	_g.h["NINE"] = 57;
	_g.h["PAGEUP"] = 33;
	_g.h["PAGEDOWN"] = 34;
	_g.h["HOME"] = 36;
	_g.h["END"] = 35;
	_g.h["INSERT"] = 45;
	_g.h["ESCAPE"] = 27;
	_g.h["MINUS"] = 189;
	_g.h["PLUS"] = 187;
	_g.h["DELETE"] = 46;
	_g.h["BACKSPACE"] = 8;
	_g.h["LBRACKET"] = 219;
	_g.h["RBRACKET"] = 221;
	_g.h["BACKSLASH"] = 220;
	_g.h["CAPSLOCK"] = 20;
	_g.h["SEMICOLON"] = 186;
	_g.h["QUOTE"] = 222;
	_g.h["ENTER"] = 13;
	_g.h["SHIFT"] = 16;
	_g.h["COMMA"] = 188;
	_g.h["PERIOD"] = 190;
	_g.h["SLASH"] = 191;
	_g.h["GRAVEACCENT"] = 192;
	_g.h["CONTROL"] = 17;
	_g.h["ALT"] = 18;
	_g.h["SPACE"] = 32;
	_g.h["UP"] = 38;
	_g.h["DOWN"] = 40;
	_g.h["LEFT"] = 37;
	_g.h["RIGHT"] = 39;
	_g.h["TAB"] = 9;
	_g.h["PRINTSCREEN"] = 301;
	_g.h["F1"] = 112;
	_g.h["F2"] = 113;
	_g.h["F3"] = 114;
	_g.h["F4"] = 115;
	_g.h["F5"] = 116;
	_g.h["F6"] = 117;
	_g.h["F7"] = 118;
	_g.h["F8"] = 119;
	_g.h["F9"] = 120;
	_g.h["F10"] = 121;
	_g.h["F11"] = 122;
	_g.h["F12"] = 123;
	_g.h["NUMPADZERO"] = 96;
	_g.h["NUMPADONE"] = 97;
	_g.h["NUMPADTWO"] = 98;
	_g.h["NUMPADTHREE"] = 99;
	_g.h["NUMPADFOUR"] = 100;
	_g.h["NUMPADFIVE"] = 101;
	_g.h["NUMPADSIX"] = 102;
	_g.h["NUMPADSEVEN"] = 103;
	_g.h["NUMPADEIGHT"] = 104;
	_g.h["NUMPADNINE"] = 105;
	_g.h["NUMPADMINUS"] = 109;
	_g.h["NUMPADPLUS"] = 107;
	_g.h["NUMPADPERIOD"] = 110;
	_g.h["NUMPADMULTIPLY"] = 106;
	$r = _g;
	return $r;
}(this));
flixel_input_keyboard_FlxKey.toStringMap = (function($this) {
	var $r;
	var _g = new haxe_ds_IntMap();
	_g.h[-2] = "ANY";
	_g.h[65] = "A";
	_g.h[66] = "B";
	_g.h[67] = "C";
	_g.h[68] = "D";
	_g.h[69] = "E";
	_g.h[70] = "F";
	_g.h[71] = "G";
	_g.h[72] = "H";
	_g.h[73] = "I";
	_g.h[74] = "J";
	_g.h[75] = "K";
	_g.h[76] = "L";
	_g.h[77] = "M";
	_g.h[78] = "N";
	_g.h[79] = "O";
	_g.h[80] = "P";
	_g.h[81] = "Q";
	_g.h[82] = "R";
	_g.h[83] = "S";
	_g.h[84] = "T";
	_g.h[85] = "U";
	_g.h[86] = "V";
	_g.h[87] = "W";
	_g.h[88] = "X";
	_g.h[89] = "Y";
	_g.h[90] = "Z";
	_g.h[48] = "ZERO";
	_g.h[49] = "ONE";
	_g.h[50] = "TWO";
	_g.h[51] = "THREE";
	_g.h[52] = "FOUR";
	_g.h[53] = "FIVE";
	_g.h[54] = "SIX";
	_g.h[55] = "SEVEN";
	_g.h[56] = "EIGHT";
	_g.h[57] = "NINE";
	_g.h[33] = "PAGEUP";
	_g.h[34] = "PAGEDOWN";
	_g.h[36] = "HOME";
	_g.h[35] = "END";
	_g.h[45] = "INSERT";
	_g.h[27] = "ESCAPE";
	_g.h[189] = "MINUS";
	_g.h[187] = "PLUS";
	_g.h[46] = "DELETE";
	_g.h[8] = "BACKSPACE";
	_g.h[219] = "LBRACKET";
	_g.h[221] = "RBRACKET";
	_g.h[220] = "BACKSLASH";
	_g.h[20] = "CAPSLOCK";
	_g.h[186] = "SEMICOLON";
	_g.h[222] = "QUOTE";
	_g.h[13] = "ENTER";
	_g.h[16] = "SHIFT";
	_g.h[188] = "COMMA";
	_g.h[190] = "PERIOD";
	_g.h[191] = "SLASH";
	_g.h[192] = "GRAVEACCENT";
	_g.h[17] = "CONTROL";
	_g.h[18] = "ALT";
	_g.h[32] = "SPACE";
	_g.h[38] = "UP";
	_g.h[40] = "DOWN";
	_g.h[37] = "LEFT";
	_g.h[39] = "RIGHT";
	_g.h[9] = "TAB";
	_g.h[301] = "PRINTSCREEN";
	_g.h[112] = "F1";
	_g.h[113] = "F2";
	_g.h[114] = "F3";
	_g.h[115] = "F4";
	_g.h[116] = "F5";
	_g.h[117] = "F6";
	_g.h[118] = "F7";
	_g.h[119] = "F8";
	_g.h[120] = "F9";
	_g.h[121] = "F10";
	_g.h[122] = "F11";
	_g.h[123] = "F12";
	_g.h[96] = "NUMPADZERO";
	_g.h[97] = "NUMPADONE";
	_g.h[98] = "NUMPADTWO";
	_g.h[99] = "NUMPADTHREE";
	_g.h[100] = "NUMPADFOUR";
	_g.h[101] = "NUMPADFIVE";
	_g.h[102] = "NUMPADSIX";
	_g.h[103] = "NUMPADSEVEN";
	_g.h[104] = "NUMPADEIGHT";
	_g.h[105] = "NUMPADNINE";
	_g.h[109] = "NUMPADMINUS";
	_g.h[107] = "NUMPADPLUS";
	_g.h[110] = "NUMPADPERIOD";
	_g.h[106] = "NUMPADMULTIPLY";
	$r = _g;
	return $r;
}(this));
flixel_input_keyboard_FlxKey.ANY = -2;
flixel_input_keyboard_FlxKey.NONE = -1;
flixel_input_keyboard_FlxKey.A = 65;
flixel_input_keyboard_FlxKey.B = 66;
flixel_input_keyboard_FlxKey.C = 67;
flixel_input_keyboard_FlxKey.D = 68;
flixel_input_keyboard_FlxKey.E = 69;
flixel_input_keyboard_FlxKey.F = 70;
flixel_input_keyboard_FlxKey.G = 71;
flixel_input_keyboard_FlxKey.H = 72;
flixel_input_keyboard_FlxKey.I = 73;
flixel_input_keyboard_FlxKey.J = 74;
flixel_input_keyboard_FlxKey.K = 75;
flixel_input_keyboard_FlxKey.L = 76;
flixel_input_keyboard_FlxKey.M = 77;
flixel_input_keyboard_FlxKey.N = 78;
flixel_input_keyboard_FlxKey.O = 79;
flixel_input_keyboard_FlxKey.P = 80;
flixel_input_keyboard_FlxKey.Q = 81;
flixel_input_keyboard_FlxKey.R = 82;
flixel_input_keyboard_FlxKey.S = 83;
flixel_input_keyboard_FlxKey.T = 84;
flixel_input_keyboard_FlxKey.U = 85;
flixel_input_keyboard_FlxKey.V = 86;
flixel_input_keyboard_FlxKey.W = 87;
flixel_input_keyboard_FlxKey.X = 88;
flixel_input_keyboard_FlxKey.Y = 89;
flixel_input_keyboard_FlxKey.Z = 90;
flixel_input_keyboard_FlxKey.ZERO = 48;
flixel_input_keyboard_FlxKey.ONE = 49;
flixel_input_keyboard_FlxKey.TWO = 50;
flixel_input_keyboard_FlxKey.THREE = 51;
flixel_input_keyboard_FlxKey.FOUR = 52;
flixel_input_keyboard_FlxKey.FIVE = 53;
flixel_input_keyboard_FlxKey.SIX = 54;
flixel_input_keyboard_FlxKey.SEVEN = 55;
flixel_input_keyboard_FlxKey.EIGHT = 56;
flixel_input_keyboard_FlxKey.NINE = 57;
flixel_input_keyboard_FlxKey.PAGEUP = 33;
flixel_input_keyboard_FlxKey.PAGEDOWN = 34;
flixel_input_keyboard_FlxKey.HOME = 36;
flixel_input_keyboard_FlxKey.END = 35;
flixel_input_keyboard_FlxKey.INSERT = 45;
flixel_input_keyboard_FlxKey.ESCAPE = 27;
flixel_input_keyboard_FlxKey.MINUS = 189;
flixel_input_keyboard_FlxKey.PLUS = 187;
flixel_input_keyboard_FlxKey.DELETE = 46;
flixel_input_keyboard_FlxKey.BACKSPACE = 8;
flixel_input_keyboard_FlxKey.LBRACKET = 219;
flixel_input_keyboard_FlxKey.RBRACKET = 221;
flixel_input_keyboard_FlxKey.BACKSLASH = 220;
flixel_input_keyboard_FlxKey.CAPSLOCK = 20;
flixel_input_keyboard_FlxKey.SEMICOLON = 186;
flixel_input_keyboard_FlxKey.QUOTE = 222;
flixel_input_keyboard_FlxKey.ENTER = 13;
flixel_input_keyboard_FlxKey.SHIFT = 16;
flixel_input_keyboard_FlxKey.COMMA = 188;
flixel_input_keyboard_FlxKey.PERIOD = 190;
flixel_input_keyboard_FlxKey.SLASH = 191;
flixel_input_keyboard_FlxKey.GRAVEACCENT = 192;
flixel_input_keyboard_FlxKey.CONTROL = 17;
flixel_input_keyboard_FlxKey.ALT = 18;
flixel_input_keyboard_FlxKey.SPACE = 32;
flixel_input_keyboard_FlxKey.UP = 38;
flixel_input_keyboard_FlxKey.DOWN = 40;
flixel_input_keyboard_FlxKey.LEFT = 37;
flixel_input_keyboard_FlxKey.RIGHT = 39;
flixel_input_keyboard_FlxKey.TAB = 9;
flixel_input_keyboard_FlxKey.PRINTSCREEN = 301;
flixel_input_keyboard_FlxKey.F1 = 112;
flixel_input_keyboard_FlxKey.F2 = 113;
flixel_input_keyboard_FlxKey.F3 = 114;
flixel_input_keyboard_FlxKey.F4 = 115;
flixel_input_keyboard_FlxKey.F5 = 116;
flixel_input_keyboard_FlxKey.F6 = 117;
flixel_input_keyboard_FlxKey.F7 = 118;
flixel_input_keyboard_FlxKey.F8 = 119;
flixel_input_keyboard_FlxKey.F9 = 120;
flixel_input_keyboard_FlxKey.F10 = 121;
flixel_input_keyboard_FlxKey.F11 = 122;
flixel_input_keyboard_FlxKey.F12 = 123;
flixel_input_keyboard_FlxKey.NUMPADZERO = 96;
flixel_input_keyboard_FlxKey.NUMPADONE = 97;
flixel_input_keyboard_FlxKey.NUMPADTWO = 98;
flixel_input_keyboard_FlxKey.NUMPADTHREE = 99;
flixel_input_keyboard_FlxKey.NUMPADFOUR = 100;
flixel_input_keyboard_FlxKey.NUMPADFIVE = 101;
flixel_input_keyboard_FlxKey.NUMPADSIX = 102;
flixel_input_keyboard_FlxKey.NUMPADSEVEN = 103;
flixel_input_keyboard_FlxKey.NUMPADEIGHT = 104;
flixel_input_keyboard_FlxKey.NUMPADNINE = 105;
flixel_input_keyboard_FlxKey.NUMPADMINUS = 109;
flixel_input_keyboard_FlxKey.NUMPADPLUS = 107;
flixel_input_keyboard_FlxKey.NUMPADPERIOD = 110;
flixel_input_keyboard_FlxKey.NUMPADMULTIPLY = 106;
flixel_input_mouse__$FlxMouse_GraphicCursor.resourceType = "image/png";
flixel_input_mouse__$FlxMouse_GraphicCursor.resourceName = "__ASSET__:bitmap_flixel_input_mouse__FlxMouse_GraphicCursor";
flixel_input_touch_FlxTouchManager.maxTouchPoints = 0;
flixel_math_FlxMath.MIN_VALUE_FLOAT = 0.0000000000000001;
flixel_math_FlxMath.MAX_VALUE_FLOAT = 1.79e+308;
flixel_math_FlxMath.MIN_VALUE_INT = -2147483647;
flixel_math_FlxMath.MAX_VALUE_INT = 2147483647;
flixel_math_FlxMath.SQUARE_ROOT_OF_TWO = 1.41421356237;
flixel_math_FlxMath.EPSILON = 0.0000001;
flixel_math_FlxVector.EPSILON = 0.0000001;
flixel_math_FlxVector.EPSILON_SQUARED = 9.9999999999999984e-015;
flixel_math_FlxVector._vector1 = (function($this) {
	var $r;
	var this1 = new flixel_math_FlxPoint(0,0);
	$r = this1;
	return $r;
}(this));
flixel_math_FlxVector._vector2 = (function($this) {
	var $r;
	var this1 = new flixel_math_FlxPoint(0,0);
	$r = this1;
	return $r;
}(this));
flixel_math_FlxVector._vector3 = (function($this) {
	var $r;
	var this1 = new flixel_math_FlxPoint(0,0);
	$r = this1;
	return $r;
}(this));
flixel_system_GraphicLogo.resourceType = "image/png";
flixel_system_GraphicLogo.resourceName = "__ASSET__:bitmap_flixel_system_GraphicLogo";
flixel_system_GraphicVirtualInput.resourceType = "image/png";
flixel_system_GraphicVirtualInput.resourceName = "__ASSET__:bitmap_flixel_system_GraphicVirtualInput";
openfl_utils_ByteArrayData.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_utils_ByteArrayData.defaultObjectEncoding = 10;
openfl_utils_ByteArrayData.__defaultEndian = null;
flixel_system_VirtualInputData.resourceName = "__ASSET__:file_flixel_system_VirtualInputData";
flixel_system_FlxAssets.FONT_DEFAULT = "Nokia Cellphone FC Small";
flixel_system_FlxAssets.FONT_DEBUGGER = "Monsterrat";
flixel_system_FlxBasePreloader.LOCAL = "localhost";
flixel_system_FlxLinkedList._NUM_CACHED_FLX_LIST = 0;
flixel_system__$FlxPreloader_GraphicLogoLight.resourceType = "image/png";
flixel_system__$FlxPreloader_GraphicLogoLight.resourceName = "__ASSET__:bitmap_flixel_system__FlxPreloader_GraphicLogoLight";
flixel_system__$FlxPreloader_GraphicLogoCorners.resourceType = "image/png";
flixel_system__$FlxPreloader_GraphicLogoCorners.resourceName = "__ASSET__:bitmap_flixel_system__FlxPreloader_GraphicLogoCorners";
flixel_system_FlxQuadTree.A_LIST = 0;
flixel_system_FlxQuadTree.B_LIST = 1;
flixel_system_FlxQuadTree._NUM_CACHED_QUAD_TREES = 0;
flixel_system_FlxSplash.muted = true;
flixel_system_debug__$FlxDebugger_GraphicFlixel.resourceType = "image/png";
flixel_system_debug__$FlxDebugger_GraphicFlixel.resourceName = "__ASSET__:bitmap_flixel_system_debug__FlxDebugger_GraphicFlixel";
flixel_system_debug__$FlxDebugger_GraphicDrawDebug.resourceType = "image/png";
flixel_system_debug__$FlxDebugger_GraphicDrawDebug.resourceName = "__ASSET__:bitmap_flixel_system_debug__FlxDebugger_GraphicDrawDebug";
flixel_system_debug_GraphicLog.resourceType = "image/png";
flixel_system_debug_GraphicLog.resourceName = "__ASSET__:bitmap_flixel_system_debug_GraphicLog";
flixel_system_debug_GraphicStats.resourceType = "image/png";
flixel_system_debug_GraphicStats.resourceName = "__ASSET__:bitmap_flixel_system_debug_GraphicStats";
flixel_system_debug_GraphicWatch.resourceType = "image/png";
flixel_system_debug_GraphicWatch.resourceName = "__ASSET__:bitmap_flixel_system_debug_GraphicWatch";
flixel_system_debug_GraphicBitmapLog.resourceType = "image/png";
flixel_system_debug_GraphicBitmapLog.resourceName = "__ASSET__:bitmap_flixel_system_debug_GraphicBitmapLog";
flixel_system_debug_GraphicConsole.resourceType = "image/png";
flixel_system_debug_GraphicConsole.resourceName = "__ASSET__:bitmap_flixel_system_debug_GraphicConsole";
flixel_system_debug_GraphicArrowLeft.resourceType = "image/png";
flixel_system_debug_GraphicArrowLeft.resourceName = "__ASSET__:bitmap_flixel_system_debug_GraphicArrowLeft";
flixel_system_debug_GraphicArrowRight.resourceType = "image/png";
flixel_system_debug_GraphicArrowRight.resourceName = "__ASSET__:bitmap_flixel_system_debug_GraphicArrowRight";
flixel_system_debug_GraphicCloseButton.resourceType = "image/png";
flixel_system_debug_GraphicCloseButton.resourceName = "__ASSET__:bitmap_flixel_system_debug_GraphicCloseButton";
flixel_system_debug_GraphicInteractive.resourceType = "image/png";
flixel_system_debug_GraphicInteractive.resourceName = "__ASSET__:bitmap_flixel_system_debug_GraphicInteractive";
flixel_system_debug_Tooltip._tooltips = [];
flixel_system_debug_TooltipOverlay.BG_COLOR = -12961222;
flixel_system_debug_TooltipOverlay.TEXT_ALPHA = 0.8;
flixel_system_debug_TooltipOverlay.MARGIN_X = 10;
flixel_system_debug_TooltipOverlay.MARGIN_Y = 10;
flixel_system_debug__$Window_GraphicWindowHandle.resourceType = "image/png";
flixel_system_debug__$Window_GraphicWindowHandle.resourceName = "__ASSET__:bitmap_flixel_system_debug__Window_GraphicWindowHandle";
flixel_system_debug_Window.BG_COLOR = -580952225;
flixel_system_debug_Window.HEADER_COLOR = -1157627904;
flixel_system_debug_Window.HEADER_ALPHA = 0.8;
flixel_system_debug_Window.HEADER_HEIGHT = 15;
flixel_system_debug_Window.WINDOW_AMOUNT = 0;
flixel_system_debug_completion_CompletionListEntry.WIDTH = 150;
flixel_system_debug_completion_CompletionListEntry.HEIGHT = 20;
flixel_system_debug_completion_CompletionListEntry.COLOR_NORMAL = -10526881;
flixel_system_debug_completion_CompletionListEntry.COLOR_HIGHLIGHT = -9605779;
flixel_system_debug_completion_CompletionListEntry.GUTTER = 4;
flixel_system_debug_completion_CompletionListScrollBar.BG_COLOR = -12303292;
flixel_system_debug_completion_CompletionListScrollBar.HANDLE_COLOR = -14540254;
flixel_system_debug_interaction_tools__$Eraser_GraphicEraserTool.resourceType = "image/png";
flixel_system_debug_interaction_tools__$Eraser_GraphicEraserTool.resourceName = "__ASSET__:bitmap_flixel_system_debug_interaction_tools__Eraser_GraphicEraserTool";
flixel_system_debug_interaction_tools__$Mover_GraphicMoverTool.resourceType = "image/png";
flixel_system_debug_interaction_tools__$Mover_GraphicMoverTool.resourceName = "__ASSET__:bitmap_flixel_system_debug_interaction_tools__Mover_GraphicMoverTool";
flixel_system_debug_interaction_tools_GraphicCursorCross.resourceType = "image/png";
flixel_system_debug_interaction_tools_GraphicCursorCross.resourceName = "__ASSET__:bitmap_flixel_system_debug_interaction_tools_GraphicCursorCross";
flixel_system_debug_interaction_tools__$Transform_GraphicTransformTool.resourceType = "image/png";
flixel_system_debug_interaction_tools__$Transform_GraphicTransformTool.resourceName = "__ASSET__:bitmap_flixel_system_debug_interaction_tools__Transform_GraphicTransformTool";
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorDefault.resourceType = "image/png";
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorDefault.resourceName = "__ASSET__:bitmap_flixel_system_debug_interaction_tools__Transform_GraphicTransformCursorDefault";
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleY.resourceType = "image/png";
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleY.resourceName = "__ASSET__:bitmap_flixel_system_debug_interaction_tools__Transform_GraphicTransformCursorScaleY";
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleX.resourceType = "image/png";
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleX.resourceName = "__ASSET__:bitmap_flixel_system_debug_interaction_tools__Transform_GraphicTransformCursorScaleX";
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleXY.resourceType = "image/png";
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorScaleXY.resourceName = "__ASSET__:bitmap_flixel_system_debug_interaction_tools__Transform_GraphicTransformCursorScaleXY";
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorRotate.resourceType = "image/png";
flixel_system_debug_interaction_tools__$Transform_GraphicTransformCursorRotate.resourceName = "__ASSET__:bitmap_flixel_system_debug_interaction_tools__Transform_GraphicTransformCursorRotate";
flixel_system_debug_interaction_tools_Transform.OUTLINE_PADDING = 5.0;
flixel_system_debug_interaction_tools_Transform.MARKER_SIZE = 3.0;
flixel_system_debug_interaction_tools_Transform.MARKER_INTERACTION_DISTANCE = 5.0;
flixel_system_debug_interaction_tools_Transform.RESIZE_STEP = 10.0;
flixel_system_debug_interaction_tools_Transform.CURSOR_ROTATE = "transformRotate";
flixel_system_debug_interaction_tools_Transform.CURSOR_SCALE_X = "transformScaleX";
flixel_system_debug_interaction_tools_Transform.CURSOR_SCALE_Y = "transformScaleY";
flixel_system_debug_interaction_tools_Transform.CURSOR_SCALE_XY = "transformScaleXY";
flixel_system_debug_interaction_tools_Transform.MARKER_ROTATE = 0;
flixel_system_debug_interaction_tools_Transform.MARKER_SCALE_X = 1;
flixel_system_debug_interaction_tools_Transform.MARKER_SCALE_XY = 2;
flixel_system_debug_interaction_tools_Transform.MARKER_SCALE_Y = 3;
flixel_system_debug_log_LogStyle.NORMAL = new flixel_system_debug_log_LogStyle();
flixel_system_debug_log_LogStyle.WARNING = new flixel_system_debug_log_LogStyle("[WARNING] ","D9F85C",12,false,false,false,"flixel/sounds/beep",true);
flixel_system_debug_log_LogStyle.ERROR = new flixel_system_debug_log_LogStyle("[ERROR] ","FF8888",12,false,false,false,"flixel/sounds/beep",true);
flixel_system_debug_log_LogStyle.NOTICE = new flixel_system_debug_log_LogStyle("[NOTICE] ","5CF878",12,false);
flixel_system_debug_log_LogStyle.CONSOLE = new flixel_system_debug_log_LogStyle("> ","5A96FA",12,false);
flixel_system_debug_stats__$Stats_GraphicMinimizeButton.resourceType = "image/png";
flixel_system_debug_stats__$Stats_GraphicMinimizeButton.resourceName = "__ASSET__:bitmap_flixel_system_debug_stats__Stats_GraphicMinimizeButton";
flixel_system_debug_stats__$Stats_GraphicMaximizeButton.resourceType = "image/png";
flixel_system_debug_stats__$Stats_GraphicMaximizeButton.resourceName = "__ASSET__:bitmap_flixel_system_debug_stats__Stats_GraphicMaximizeButton";
flixel_text_FlxText.VERTICAL_GUTTER = 4;
flixel_text_FlxTextAlign.LEFT = "left";
flixel_text_FlxTextAlign.CENTER = "center";
flixel_text_FlxTextAlign.RIGHT = "right";
flixel_text_FlxTextAlign.JUSTIFY = "justify";
flixel_tile_FlxBaseTilemap.offsetAutoTile = [0,0,0,0,2,2,0,3,0,0,0,0,0,0,0,0,11,11,0,0,13,13,0,14,0,0,0,0,18,18,0,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51,51,0,0,53,53,0,54,0,0,0,0,0,0,0,0,62,62,0,0,64,64,0,65,0,0,0,0,69,69,0,70,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,86,86,0,0,88,88,0,89,0,0,0,0,93,93,0,94,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,159,0,0,0,162,0,163,0,0,0,0,0,0,0,0,0,172,0,0,0,175,0,176,0,0,0,0,0,181,0,182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,199,0,0,0,202,0,203,0,0,0,0,0,208,0,209];
flixel_tweens_FlxEase.PI2 = Math.PI / 2;
flixel_tweens_FlxEase.EL = 2 * Math.PI / .45;
flixel_tweens_FlxEase.B1 = 0.36363636363636365;
flixel_tweens_FlxEase.B2 = 0.72727272727272729;
flixel_tweens_FlxEase.B3 = 0.54545454545454541;
flixel_tweens_FlxEase.B4 = 0.90909090909090906;
flixel_tweens_FlxEase.B5 = 0.81818181818181823;
flixel_tweens_FlxEase.B6 = 0.95454545454545459;
flixel_tweens_FlxEase.ELASTIC_AMPLITUDE = 1;
flixel_tweens_FlxEase.ELASTIC_PERIOD = 0.4;
flixel_tweens_FlxTween.PERSIST = 1;
flixel_tweens_FlxTween.LOOPING = 2;
flixel_tweens_FlxTween.PINGPONG = 4;
flixel_tweens_FlxTween.ONESHOT = 8;
flixel_tweens_FlxTween.BACKWARD = 16;
flixel_ui_FlxButton.NORMAL = 0;
flixel_ui_FlxButton.HIGHLIGHT = 1;
flixel_ui_FlxButton.PRESSED = 2;
flixel_util_FlxBitmapDataPool.maxLength = 8;
flixel_util_FlxBitmapDataPool.$length = 0;
flixel_util_FlxBitmapDataPool._head = null;
flixel_util_FlxBitmapDataPool._tail = null;
flixel_util_FlxBitmapDataPool._rect = new openfl_geom_Rectangle();
flixel_util_FlxBitmapDataUtil.matrix = new flixel_math_FlxMatrix();
flixel_util_FlxCollision.pointA = (function($this) {
	var $r;
	var this1 = new flixel_math_FlxPoint(0,0);
	$r = this1;
	return $r;
}(this));
flixel_util_FlxCollision.pointB = (function($this) {
	var $r;
	var this1 = new flixel_math_FlxPoint(0,0);
	$r = this1;
	return $r;
}(this));
flixel_util_FlxCollision.centerA = (function($this) {
	var $r;
	var this1 = new flixel_math_FlxPoint(0,0);
	$r = this1;
	return $r;
}(this));
flixel_util_FlxCollision.centerB = (function($this) {
	var $r;
	var this1 = new flixel_math_FlxPoint(0,0);
	$r = this1;
	return $r;
}(this));
flixel_util_FlxCollision.matrixA = new flixel_math_FlxMatrix();
flixel_util_FlxCollision.matrixB = new flixel_math_FlxMatrix();
flixel_util_FlxCollision.testMatrix = new flixel_math_FlxMatrix();
flixel_util_FlxCollision.boundsA = new flixel_math_FlxRect();
flixel_util_FlxCollision.boundsB = new flixel_math_FlxRect();
flixel_util_FlxCollision.intersect = new flixel_math_FlxRect();
flixel_util_FlxCollision.flashRect = new openfl_geom_Rectangle();
flixel_util_FlxColor.TRANSPARENT = 0;
flixel_util_FlxColor.WHITE = -1;
flixel_util_FlxColor.GRAY = -8355712;
flixel_util_FlxColor.BLACK = -16777216;
flixel_util_FlxColor.GREEN = -16744448;
flixel_util_FlxColor.LIME = -16711936;
flixel_util_FlxColor.YELLOW = -256;
flixel_util_FlxColor.ORANGE = -23296;
flixel_util_FlxColor.RED = -65536;
flixel_util_FlxColor.PURPLE = -8388480;
flixel_util_FlxColor.BLUE = -16776961;
flixel_util_FlxColor.BROWN = -7650029;
flixel_util_FlxColor.PINK = -16181;
flixel_util_FlxColor.MAGENTA = -65281;
flixel_util_FlxColor.CYAN = -16711681;
flixel_util_FlxColor.colorLookup = (function($this) {
	var $r;
	var _g = new haxe_ds_StringMap();
	_g.h["TRANSPARENT"] = 0;
	_g.h["WHITE"] = -1;
	_g.h["GRAY"] = -8355712;
	_g.h["BLACK"] = -16777216;
	_g.h["GREEN"] = -16744448;
	_g.h["LIME"] = -16711936;
	_g.h["YELLOW"] = -256;
	_g.h["ORANGE"] = -23296;
	_g.h["RED"] = -65536;
	_g.h["PURPLE"] = -8388480;
	_g.h["BLUE"] = -16776961;
	_g.h["BROWN"] = -7650029;
	_g.h["PINK"] = -16181;
	_g.h["MAGENTA"] = -65281;
	_g.h["CYAN"] = -16711681;
	$r = _g;
	return $r;
}(this));
flixel_util_FlxColor.COLOR_REGEX = new EReg("^(0x|#)(([A-F0-9]{2}){3,4})$","i");
flixel_util_FlxPath.FORWARD = 0;
flixel_util_FlxPath.BACKWARD = 1;
flixel_util_FlxPath.LOOP_FORWARD = 16;
flixel_util_FlxPath.LOOP_BACKWARD = 256;
flixel_util_FlxPath.YOYO = 4096;
flixel_util_FlxPath.HORIZONTAL_ONLY = 65536;
flixel_util_FlxPath.VERTICAL_ONLY = 1048576;
flixel_util_FlxPath._point = (function($this) {
	var $r;
	var point = flixel_math_FlxPoint._pool.get().set(0,0);
	point._inPool = false;
	$r = point;
	return $r;
}(this));
flixel_util_FlxSort.ASCENDING = -1;
flixel_util_FlxSort.DESCENDING = 1;
flixel_util_FlxSpriteUtil.flashGfxSprite = new openfl_display_Sprite();
flixel_util_FlxSpriteUtil.flashGfx = flixel_util_FlxSpriteUtil.flashGfxSprite.get_graphics();
flixel_util_LabelValuePair._pool = new flixel_util_FlxPool_$flixel_$util_$LabelValuePair(flixel_util_LabelValuePair);
haxe_Serializer.USE_CACHE = false;
haxe_Serializer.USE_ENUM_INDEX = false;
haxe_Serializer.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";
haxe_Serializer.BASE64_CODES = null;
haxe_Unserializer.DEFAULT_RESOLVER = new haxe__$Unserializer_DefaultResolver();
haxe_Unserializer.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";
haxe_Unserializer.CODES = null;
haxe_crypto_Base64.CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
haxe_crypto_Base64.BYTES = haxe_io_Bytes.ofString(haxe_crypto_Base64.CHARS);
haxe_io_FPHelper.i64tmp = (function($this) {
	var $r;
	var this1 = new haxe__$Int64__$_$_$Int64(0,0);
	$r = this1;
	return $r;
}(this));
haxe_io_FPHelper.helper = new DataView(new ArrayBuffer(8));
haxe_xml_Parser.escapes = (function($this) {
	var $r;
	var h = new haxe_ds_StringMap();
	h.h["lt"] = "<";
	h.h["gt"] = ">";
	h.h["amp"] = "&";
	h.h["quot"] = "\"";
	h.h["apos"] = "'";
	$r = h;
	return $r;
}(this));
haxe_zip_InflateImpl.LEN_EXTRA_BITS_TBL = [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,-1,-1];
haxe_zip_InflateImpl.LEN_BASE_VAL_TBL = [3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258];
haxe_zip_InflateImpl.DIST_EXTRA_BITS_TBL = [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,-1,-1];
haxe_zip_InflateImpl.DIST_BASE_VAL_TBL = [1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];
haxe_zip_InflateImpl.CODE_LENGTHS_POS = [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];
haxe_zip_InflateImpl.FIXED_HUFFMAN = null;
hscript_Parser.p1 = 0;
hscript_Parser.tokenMin = 0;
hscript_Parser.tokenMax = 0;
lime__$internal_backend_html5_HTML5HTTPRequest.OPTION_REVOKE_URL = 1;
lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests = 0;
lime__$internal_backend_html5_HTML5HTTPRequest.requestLimit = 17;
lime__$internal_backend_html5_HTML5HTTPRequest.requestQueue = new haxe_ds_List();
lime__$internal_backend_html5_HTML5Window.dummyCharacter = "";
lime__$internal_backend_html5_HTML5Window.windowID = 0;
lime__$internal_format_Base64.DICTIONARY = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
lime__$internal_format_Base64.EXTENDED_DICTIONARY = (function($this) {
	var $r;
	var result = [];
	{
		var _g = 0;
		var _g1 = lime__$internal_format_Base64.DICTIONARY;
		while(_g < _g1.length) {
			var a = _g1[_g];
			++_g;
			var _g2 = 0;
			var _g3 = lime__$internal_format_Base64.DICTIONARY;
			while(_g2 < _g3.length) {
				var b = _g3[_g2];
				++_g2;
				result.push(a + b);
			}
		}
	}
	$r = result;
	return $r;
}(this));
lime__$internal_graphics_StackBlur.MUL_TABLE = [1,171,205,293,57,373,79,137,241,27,391,357,41,19,283,265,497,469,443,421,25,191,365,349,335,161,155,149,9,278,269,261,505,245,475,231,449,437,213,415,405,395,193,377,369,361,353,345,169,331,325,319,313,307,301,37,145,285,281,69,271,267,263,259,509,501,493,243,479,118,465,459,113,446,55,435,429,423,209,413,51,403,199,393,97,3,379,375,371,367,363,359,355,351,347,43,85,337,333,165,327,323,5,317,157,311,77,305,303,75,297,294,73,289,287,71,141,279,277,275,68,135,67,133,33,262,260,129,511,507,503,499,495,491,61,121,481,477,237,235,467,232,115,457,227,451,7,445,221,439,218,433,215,427,425,211,419,417,207,411,409,203,202,401,399,396,197,49,389,387,385,383,95,189,47,187,93,185,23,183,91,181,45,179,89,177,11,175,87,173,345,343,341,339,337,21,167,83,331,329,327,163,81,323,321,319,159,79,315,313,39,155,309,307,153,305,303,151,75,299,149,37,295,147,73,291,145,289,287,143,285,71,141,281,35,279,139,69,275,137,273,17,271,135,269,267,133,265,33,263,131,261,130,259,129,257,1];
lime__$internal_graphics_StackBlur.SHG_TABLE = [0,9,10,11,9,12,10,11,12,9,13,13,10,9,13,13,14,14,14,14,10,13,14,14,14,13,13,13,9,14,14,14,15,14,15,14,15,15,14,15,15,15,14,15,15,15,15,15,14,15,15,15,15,15,15,12,14,15,15,13,15,15,15,15,16,16,16,15,16,14,16,16,14,16,13,16,16,16,15,16,13,16,15,16,14,9,16,16,16,16,16,16,16,16,16,13,14,16,16,15,16,16,10,16,15,16,14,16,16,14,16,16,14,16,16,14,15,16,16,16,14,15,14,15,13,16,16,15,17,17,17,17,17,17,14,15,17,17,16,16,17,16,15,17,16,17,11,17,16,17,16,17,16,17,17,16,17,17,16,17,17,16,16,17,17,17,16,14,17,17,17,17,15,16,14,16,15,16,13,16,15,16,14,16,15,16,12,16,15,16,17,17,17,17,17,13,16,15,17,17,17,16,15,17,17,17,16,15,17,17,14,16,17,17,16,17,17,16,15,17,16,14,17,16,15,17,16,17,17,16,17,15,16,17,14,17,16,15,17,16,17,13,17,16,17,17,16,17,14,17,16,17,16,17,16,17,9];
lime_graphics_cairo_CairoFTFontFace.FT_LOAD_FORCE_AUTOHINT = 32;
lime_graphics_opengl_GL.DEPTH_BUFFER_BIT = 256;
lime_graphics_opengl_GL.STENCIL_BUFFER_BIT = 1024;
lime_graphics_opengl_GL.COLOR_BUFFER_BIT = 16384;
lime_graphics_opengl_GL.POINTS = 0;
lime_graphics_opengl_GL.LINES = 1;
lime_graphics_opengl_GL.LINE_LOOP = 2;
lime_graphics_opengl_GL.LINE_STRIP = 3;
lime_graphics_opengl_GL.TRIANGLES = 4;
lime_graphics_opengl_GL.TRIANGLE_STRIP = 5;
lime_graphics_opengl_GL.TRIANGLE_FAN = 6;
lime_graphics_opengl_GL.ZERO = 0;
lime_graphics_opengl_GL.ONE = 1;
lime_graphics_opengl_GL.SRC_COLOR = 768;
lime_graphics_opengl_GL.ONE_MINUS_SRC_COLOR = 769;
lime_graphics_opengl_GL.SRC_ALPHA = 770;
lime_graphics_opengl_GL.ONE_MINUS_SRC_ALPHA = 771;
lime_graphics_opengl_GL.DST_ALPHA = 772;
lime_graphics_opengl_GL.ONE_MINUS_DST_ALPHA = 773;
lime_graphics_opengl_GL.DST_COLOR = 774;
lime_graphics_opengl_GL.ONE_MINUS_DST_COLOR = 775;
lime_graphics_opengl_GL.SRC_ALPHA_SATURATE = 776;
lime_graphics_opengl_GL.FUNC_ADD = 32774;
lime_graphics_opengl_GL.BLEND_EQUATION = 32777;
lime_graphics_opengl_GL.BLEND_EQUATION_RGB = 32777;
lime_graphics_opengl_GL.BLEND_EQUATION_ALPHA = 34877;
lime_graphics_opengl_GL.FUNC_SUBTRACT = 32778;
lime_graphics_opengl_GL.FUNC_REVERSE_SUBTRACT = 32779;
lime_graphics_opengl_GL.BLEND_DST_RGB = 32968;
lime_graphics_opengl_GL.BLEND_SRC_RGB = 32969;
lime_graphics_opengl_GL.BLEND_DST_ALPHA = 32970;
lime_graphics_opengl_GL.BLEND_SRC_ALPHA = 32971;
lime_graphics_opengl_GL.CONSTANT_COLOR = 32769;
lime_graphics_opengl_GL.ONE_MINUS_CONSTANT_COLOR = 32770;
lime_graphics_opengl_GL.CONSTANT_ALPHA = 32771;
lime_graphics_opengl_GL.ONE_MINUS_CONSTANT_ALPHA = 32772;
lime_graphics_opengl_GL.BLEND_COLOR = 32773;
lime_graphics_opengl_GL.ARRAY_BUFFER = 34962;
lime_graphics_opengl_GL.ELEMENT_ARRAY_BUFFER = 34963;
lime_graphics_opengl_GL.ARRAY_BUFFER_BINDING = 34964;
lime_graphics_opengl_GL.ELEMENT_ARRAY_BUFFER_BINDING = 34965;
lime_graphics_opengl_GL.STREAM_DRAW = 35040;
lime_graphics_opengl_GL.STATIC_DRAW = 35044;
lime_graphics_opengl_GL.DYNAMIC_DRAW = 35048;
lime_graphics_opengl_GL.BUFFER_SIZE = 34660;
lime_graphics_opengl_GL.BUFFER_USAGE = 34661;
lime_graphics_opengl_GL.CURRENT_VERTEX_ATTRIB = 34342;
lime_graphics_opengl_GL.FRONT = 1028;
lime_graphics_opengl_GL.BACK = 1029;
lime_graphics_opengl_GL.FRONT_AND_BACK = 1032;
lime_graphics_opengl_GL.CULL_FACE = 2884;
lime_graphics_opengl_GL.BLEND = 3042;
lime_graphics_opengl_GL.DITHER = 3024;
lime_graphics_opengl_GL.STENCIL_TEST = 2960;
lime_graphics_opengl_GL.DEPTH_TEST = 2929;
lime_graphics_opengl_GL.SCISSOR_TEST = 3089;
lime_graphics_opengl_GL.POLYGON_OFFSET_FILL = 32823;
lime_graphics_opengl_GL.SAMPLE_ALPHA_TO_COVERAGE = 32926;
lime_graphics_opengl_GL.SAMPLE_COVERAGE = 32928;
lime_graphics_opengl_GL.NO_ERROR = 0;
lime_graphics_opengl_GL.INVALID_ENUM = 1280;
lime_graphics_opengl_GL.INVALID_VALUE = 1281;
lime_graphics_opengl_GL.INVALID_OPERATION = 1282;
lime_graphics_opengl_GL.OUT_OF_MEMORY = 1285;
lime_graphics_opengl_GL.CW = 2304;
lime_graphics_opengl_GL.CCW = 2305;
lime_graphics_opengl_GL.LINE_WIDTH = 2849;
lime_graphics_opengl_GL.ALIASED_POINT_SIZE_RANGE = 33901;
lime_graphics_opengl_GL.ALIASED_LINE_WIDTH_RANGE = 33902;
lime_graphics_opengl_GL.CULL_FACE_MODE = 2885;
lime_graphics_opengl_GL.FRONT_FACE = 2886;
lime_graphics_opengl_GL.DEPTH_RANGE = 2928;
lime_graphics_opengl_GL.DEPTH_WRITEMASK = 2930;
lime_graphics_opengl_GL.DEPTH_CLEAR_VALUE = 2931;
lime_graphics_opengl_GL.DEPTH_FUNC = 2932;
lime_graphics_opengl_GL.STENCIL_CLEAR_VALUE = 2961;
lime_graphics_opengl_GL.STENCIL_FUNC = 2962;
lime_graphics_opengl_GL.STENCIL_FAIL = 2964;
lime_graphics_opengl_GL.STENCIL_PASS_DEPTH_FAIL = 2965;
lime_graphics_opengl_GL.STENCIL_PASS_DEPTH_PASS = 2966;
lime_graphics_opengl_GL.STENCIL_REF = 2967;
lime_graphics_opengl_GL.STENCIL_VALUE_MASK = 2963;
lime_graphics_opengl_GL.STENCIL_WRITEMASK = 2968;
lime_graphics_opengl_GL.STENCIL_BACK_FUNC = 34816;
lime_graphics_opengl_GL.STENCIL_BACK_FAIL = 34817;
lime_graphics_opengl_GL.STENCIL_BACK_PASS_DEPTH_FAIL = 34818;
lime_graphics_opengl_GL.STENCIL_BACK_PASS_DEPTH_PASS = 34819;
lime_graphics_opengl_GL.STENCIL_BACK_REF = 36003;
lime_graphics_opengl_GL.STENCIL_BACK_VALUE_MASK = 36004;
lime_graphics_opengl_GL.STENCIL_BACK_WRITEMASK = 36005;
lime_graphics_opengl_GL.VIEWPORT = 2978;
lime_graphics_opengl_GL.SCISSOR_BOX = 3088;
lime_graphics_opengl_GL.COLOR_CLEAR_VALUE = 3106;
lime_graphics_opengl_GL.COLOR_WRITEMASK = 3107;
lime_graphics_opengl_GL.UNPACK_ALIGNMENT = 3317;
lime_graphics_opengl_GL.PACK_ALIGNMENT = 3333;
lime_graphics_opengl_GL.MAX_TEXTURE_SIZE = 3379;
lime_graphics_opengl_GL.MAX_VIEWPORT_DIMS = 3386;
lime_graphics_opengl_GL.SUBPIXEL_BITS = 3408;
lime_graphics_opengl_GL.RED_BITS = 3410;
lime_graphics_opengl_GL.GREEN_BITS = 3411;
lime_graphics_opengl_GL.BLUE_BITS = 3412;
lime_graphics_opengl_GL.ALPHA_BITS = 3413;
lime_graphics_opengl_GL.DEPTH_BITS = 3414;
lime_graphics_opengl_GL.STENCIL_BITS = 3415;
lime_graphics_opengl_GL.POLYGON_OFFSET_UNITS = 10752;
lime_graphics_opengl_GL.POLYGON_OFFSET_FACTOR = 32824;
lime_graphics_opengl_GL.TEXTURE_BINDING_2D = 32873;
lime_graphics_opengl_GL.SAMPLE_BUFFERS = 32936;
lime_graphics_opengl_GL.SAMPLES = 32937;
lime_graphics_opengl_GL.SAMPLE_COVERAGE_VALUE = 32938;
lime_graphics_opengl_GL.SAMPLE_COVERAGE_INVERT = 32939;
lime_graphics_opengl_GL.NUM_COMPRESSED_TEXTURE_FORMATS = 34466;
lime_graphics_opengl_GL.COMPRESSED_TEXTURE_FORMATS = 34467;
lime_graphics_opengl_GL.DONT_CARE = 4352;
lime_graphics_opengl_GL.FASTEST = 4353;
lime_graphics_opengl_GL.NICEST = 4354;
lime_graphics_opengl_GL.GENERATE_MIPMAP_HINT = 33170;
lime_graphics_opengl_GL.BYTE = 5120;
lime_graphics_opengl_GL.UNSIGNED_BYTE = 5121;
lime_graphics_opengl_GL.SHORT = 5122;
lime_graphics_opengl_GL.UNSIGNED_SHORT = 5123;
lime_graphics_opengl_GL.INT = 5124;
lime_graphics_opengl_GL.UNSIGNED_INT = 5125;
lime_graphics_opengl_GL.FLOAT = 5126;
lime_graphics_opengl_GL.DEPTH_COMPONENT = 6402;
lime_graphics_opengl_GL.ALPHA = 6406;
lime_graphics_opengl_GL.RGB = 6407;
lime_graphics_opengl_GL.RGBA = 6408;
lime_graphics_opengl_GL.LUMINANCE = 6409;
lime_graphics_opengl_GL.LUMINANCE_ALPHA = 6410;
lime_graphics_opengl_GL.UNSIGNED_SHORT_4_4_4_4 = 32819;
lime_graphics_opengl_GL.UNSIGNED_SHORT_5_5_5_1 = 32820;
lime_graphics_opengl_GL.UNSIGNED_SHORT_5_6_5 = 33635;
lime_graphics_opengl_GL.FRAGMENT_SHADER = 35632;
lime_graphics_opengl_GL.VERTEX_SHADER = 35633;
lime_graphics_opengl_GL.MAX_VERTEX_ATTRIBS = 34921;
lime_graphics_opengl_GL.MAX_VERTEX_UNIFORM_VECTORS = 36347;
lime_graphics_opengl_GL.MAX_VARYING_VECTORS = 36348;
lime_graphics_opengl_GL.MAX_COMBINED_TEXTURE_IMAGE_UNITS = 35661;
lime_graphics_opengl_GL.MAX_VERTEX_TEXTURE_IMAGE_UNITS = 35660;
lime_graphics_opengl_GL.MAX_TEXTURE_IMAGE_UNITS = 34930;
lime_graphics_opengl_GL.MAX_FRAGMENT_UNIFORM_VECTORS = 36349;
lime_graphics_opengl_GL.SHADER_TYPE = 35663;
lime_graphics_opengl_GL.DELETE_STATUS = 35712;
lime_graphics_opengl_GL.LINK_STATUS = 35714;
lime_graphics_opengl_GL.VALIDATE_STATUS = 35715;
lime_graphics_opengl_GL.ATTACHED_SHADERS = 35717;
lime_graphics_opengl_GL.ACTIVE_UNIFORMS = 35718;
lime_graphics_opengl_GL.ACTIVE_ATTRIBUTES = 35721;
lime_graphics_opengl_GL.SHADING_LANGUAGE_VERSION = 35724;
lime_graphics_opengl_GL.CURRENT_PROGRAM = 35725;
lime_graphics_opengl_GL.NEVER = 512;
lime_graphics_opengl_GL.LESS = 513;
lime_graphics_opengl_GL.EQUAL = 514;
lime_graphics_opengl_GL.LEQUAL = 515;
lime_graphics_opengl_GL.GREATER = 516;
lime_graphics_opengl_GL.NOTEQUAL = 517;
lime_graphics_opengl_GL.GEQUAL = 518;
lime_graphics_opengl_GL.ALWAYS = 519;
lime_graphics_opengl_GL.KEEP = 7680;
lime_graphics_opengl_GL.REPLACE = 7681;
lime_graphics_opengl_GL.INCR = 7682;
lime_graphics_opengl_GL.DECR = 7683;
lime_graphics_opengl_GL.INVERT = 5386;
lime_graphics_opengl_GL.INCR_WRAP = 34055;
lime_graphics_opengl_GL.DECR_WRAP = 34056;
lime_graphics_opengl_GL.VENDOR = 7936;
lime_graphics_opengl_GL.RENDERER = 7937;
lime_graphics_opengl_GL.VERSION = 7938;
lime_graphics_opengl_GL.EXTENSIONS = 7939;
lime_graphics_opengl_GL.NEAREST = 9728;
lime_graphics_opengl_GL.LINEAR = 9729;
lime_graphics_opengl_GL.NEAREST_MIPMAP_NEAREST = 9984;
lime_graphics_opengl_GL.LINEAR_MIPMAP_NEAREST = 9985;
lime_graphics_opengl_GL.NEAREST_MIPMAP_LINEAR = 9986;
lime_graphics_opengl_GL.LINEAR_MIPMAP_LINEAR = 9987;
lime_graphics_opengl_GL.TEXTURE_MAG_FILTER = 10240;
lime_graphics_opengl_GL.TEXTURE_MIN_FILTER = 10241;
lime_graphics_opengl_GL.TEXTURE_WRAP_S = 10242;
lime_graphics_opengl_GL.TEXTURE_WRAP_T = 10243;
lime_graphics_opengl_GL.TEXTURE_2D = 3553;
lime_graphics_opengl_GL.TEXTURE = 5890;
lime_graphics_opengl_GL.TEXTURE_CUBE_MAP = 34067;
lime_graphics_opengl_GL.TEXTURE_BINDING_CUBE_MAP = 34068;
lime_graphics_opengl_GL.TEXTURE_CUBE_MAP_POSITIVE_X = 34069;
lime_graphics_opengl_GL.TEXTURE_CUBE_MAP_NEGATIVE_X = 34070;
lime_graphics_opengl_GL.TEXTURE_CUBE_MAP_POSITIVE_Y = 34071;
lime_graphics_opengl_GL.TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072;
lime_graphics_opengl_GL.TEXTURE_CUBE_MAP_POSITIVE_Z = 34073;
lime_graphics_opengl_GL.TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074;
lime_graphics_opengl_GL.MAX_CUBE_MAP_TEXTURE_SIZE = 34076;
lime_graphics_opengl_GL.TEXTURE0 = 33984;
lime_graphics_opengl_GL.TEXTURE1 = 33985;
lime_graphics_opengl_GL.TEXTURE2 = 33986;
lime_graphics_opengl_GL.TEXTURE3 = 33987;
lime_graphics_opengl_GL.TEXTURE4 = 33988;
lime_graphics_opengl_GL.TEXTURE5 = 33989;
lime_graphics_opengl_GL.TEXTURE6 = 33990;
lime_graphics_opengl_GL.TEXTURE7 = 33991;
lime_graphics_opengl_GL.TEXTURE8 = 33992;
lime_graphics_opengl_GL.TEXTURE9 = 33993;
lime_graphics_opengl_GL.TEXTURE10 = 33994;
lime_graphics_opengl_GL.TEXTURE11 = 33995;
lime_graphics_opengl_GL.TEXTURE12 = 33996;
lime_graphics_opengl_GL.TEXTURE13 = 33997;
lime_graphics_opengl_GL.TEXTURE14 = 33998;
lime_graphics_opengl_GL.TEXTURE15 = 33999;
lime_graphics_opengl_GL.TEXTURE16 = 34000;
lime_graphics_opengl_GL.TEXTURE17 = 34001;
lime_graphics_opengl_GL.TEXTURE18 = 34002;
lime_graphics_opengl_GL.TEXTURE19 = 34003;
lime_graphics_opengl_GL.TEXTURE20 = 34004;
lime_graphics_opengl_GL.TEXTURE21 = 34005;
lime_graphics_opengl_GL.TEXTURE22 = 34006;
lime_graphics_opengl_GL.TEXTURE23 = 34007;
lime_graphics_opengl_GL.TEXTURE24 = 34008;
lime_graphics_opengl_GL.TEXTURE25 = 34009;
lime_graphics_opengl_GL.TEXTURE26 = 34010;
lime_graphics_opengl_GL.TEXTURE27 = 34011;
lime_graphics_opengl_GL.TEXTURE28 = 34012;
lime_graphics_opengl_GL.TEXTURE29 = 34013;
lime_graphics_opengl_GL.TEXTURE30 = 34014;
lime_graphics_opengl_GL.TEXTURE31 = 34015;
lime_graphics_opengl_GL.ACTIVE_TEXTURE = 34016;
lime_graphics_opengl_GL.REPEAT = 10497;
lime_graphics_opengl_GL.CLAMP_TO_EDGE = 33071;
lime_graphics_opengl_GL.MIRRORED_REPEAT = 33648;
lime_graphics_opengl_GL.FLOAT_VEC2 = 35664;
lime_graphics_opengl_GL.FLOAT_VEC3 = 35665;
lime_graphics_opengl_GL.FLOAT_VEC4 = 35666;
lime_graphics_opengl_GL.INT_VEC2 = 35667;
lime_graphics_opengl_GL.INT_VEC3 = 35668;
lime_graphics_opengl_GL.INT_VEC4 = 35669;
lime_graphics_opengl_GL.BOOL = 35670;
lime_graphics_opengl_GL.BOOL_VEC2 = 35671;
lime_graphics_opengl_GL.BOOL_VEC3 = 35672;
lime_graphics_opengl_GL.BOOL_VEC4 = 35673;
lime_graphics_opengl_GL.FLOAT_MAT2 = 35674;
lime_graphics_opengl_GL.FLOAT_MAT3 = 35675;
lime_graphics_opengl_GL.FLOAT_MAT4 = 35676;
lime_graphics_opengl_GL.SAMPLER_2D = 35678;
lime_graphics_opengl_GL.SAMPLER_CUBE = 35680;
lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_ENABLED = 34338;
lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_SIZE = 34339;
lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_STRIDE = 34340;
lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_TYPE = 34341;
lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_NORMALIZED = 34922;
lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_POINTER = 34373;
lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 34975;
lime_graphics_opengl_GL.IMPLEMENTATION_COLOR_READ_TYPE = 35738;
lime_graphics_opengl_GL.IMPLEMENTATION_COLOR_READ_FORMAT = 35739;
lime_graphics_opengl_GL.VERTEX_PROGRAM_POINT_SIZE = 34370;
lime_graphics_opengl_GL.POINT_SPRITE = 34913;
lime_graphics_opengl_GL.COMPILE_STATUS = 35713;
lime_graphics_opengl_GL.LOW_FLOAT = 36336;
lime_graphics_opengl_GL.MEDIUM_FLOAT = 36337;
lime_graphics_opengl_GL.HIGH_FLOAT = 36338;
lime_graphics_opengl_GL.LOW_INT = 36339;
lime_graphics_opengl_GL.MEDIUM_INT = 36340;
lime_graphics_opengl_GL.HIGH_INT = 36341;
lime_graphics_opengl_GL.FRAMEBUFFER = 36160;
lime_graphics_opengl_GL.RENDERBUFFER = 36161;
lime_graphics_opengl_GL.RGBA4 = 32854;
lime_graphics_opengl_GL.RGB5_A1 = 32855;
lime_graphics_opengl_GL.RGB565 = 36194;
lime_graphics_opengl_GL.DEPTH_COMPONENT16 = 33189;
lime_graphics_opengl_GL.STENCIL_INDEX = 6401;
lime_graphics_opengl_GL.STENCIL_INDEX8 = 36168;
lime_graphics_opengl_GL.DEPTH_STENCIL = 34041;
lime_graphics_opengl_GL.RENDERBUFFER_WIDTH = 36162;
lime_graphics_opengl_GL.RENDERBUFFER_HEIGHT = 36163;
lime_graphics_opengl_GL.RENDERBUFFER_INTERNAL_FORMAT = 36164;
lime_graphics_opengl_GL.RENDERBUFFER_RED_SIZE = 36176;
lime_graphics_opengl_GL.RENDERBUFFER_GREEN_SIZE = 36177;
lime_graphics_opengl_GL.RENDERBUFFER_BLUE_SIZE = 36178;
lime_graphics_opengl_GL.RENDERBUFFER_ALPHA_SIZE = 36179;
lime_graphics_opengl_GL.RENDERBUFFER_DEPTH_SIZE = 36180;
lime_graphics_opengl_GL.RENDERBUFFER_STENCIL_SIZE = 36181;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 36048;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 36049;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 36050;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 36051;
lime_graphics_opengl_GL.COLOR_ATTACHMENT0 = 36064;
lime_graphics_opengl_GL.DEPTH_ATTACHMENT = 36096;
lime_graphics_opengl_GL.STENCIL_ATTACHMENT = 36128;
lime_graphics_opengl_GL.DEPTH_STENCIL_ATTACHMENT = 33306;
lime_graphics_opengl_GL.NONE = 0;
lime_graphics_opengl_GL.FRAMEBUFFER_COMPLETE = 36053;
lime_graphics_opengl_GL.FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 36054;
lime_graphics_opengl_GL.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 36055;
lime_graphics_opengl_GL.FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 36057;
lime_graphics_opengl_GL.FRAMEBUFFER_UNSUPPORTED = 36061;
lime_graphics_opengl_GL.FRAMEBUFFER_BINDING = 36006;
lime_graphics_opengl_GL.RENDERBUFFER_BINDING = 36007;
lime_graphics_opengl_GL.MAX_RENDERBUFFER_SIZE = 34024;
lime_graphics_opengl_GL.INVALID_FRAMEBUFFER_OPERATION = 1286;
lime_graphics_opengl_GL.UNPACK_FLIP_Y_WEBGL = 37440;
lime_graphics_opengl_GL.UNPACK_PREMULTIPLY_ALPHA_WEBGL = 37441;
lime_graphics_opengl_GL.CONTEXT_LOST_WEBGL = 37442;
lime_graphics_opengl_GL.UNPACK_COLORSPACE_CONVERSION_WEBGL = 37443;
lime_graphics_opengl_GL.BROWSER_DEFAULT_WEBGL = 37444;
lime_graphics_opengl_GL.READ_BUFFER = 3074;
lime_graphics_opengl_GL.UNPACK_ROW_LENGTH = 3314;
lime_graphics_opengl_GL.UNPACK_SKIP_ROWS = 3315;
lime_graphics_opengl_GL.UNPACK_SKIP_PIXELS = 3316;
lime_graphics_opengl_GL.PACK_ROW_LENGTH = 3330;
lime_graphics_opengl_GL.PACK_SKIP_ROWS = 3331;
lime_graphics_opengl_GL.PACK_SKIP_PIXELS = 3332;
lime_graphics_opengl_GL.TEXTURE_BINDING_3D = 32874;
lime_graphics_opengl_GL.UNPACK_SKIP_IMAGES = 32877;
lime_graphics_opengl_GL.UNPACK_IMAGE_HEIGHT = 32878;
lime_graphics_opengl_GL.MAX_3D_TEXTURE_SIZE = 32883;
lime_graphics_opengl_GL.MAX_ELEMENTS_VERTICES = 33000;
lime_graphics_opengl_GL.MAX_ELEMENTS_INDICES = 33001;
lime_graphics_opengl_GL.MAX_TEXTURE_LOD_BIAS = 34045;
lime_graphics_opengl_GL.MAX_FRAGMENT_UNIFORM_COMPONENTS = 35657;
lime_graphics_opengl_GL.MAX_VERTEX_UNIFORM_COMPONENTS = 35658;
lime_graphics_opengl_GL.MAX_ARRAY_TEXTURE_LAYERS = 35071;
lime_graphics_opengl_GL.MIN_PROGRAM_TEXEL_OFFSET = 35076;
lime_graphics_opengl_GL.MAX_PROGRAM_TEXEL_OFFSET = 35077;
lime_graphics_opengl_GL.MAX_VARYING_COMPONENTS = 35659;
lime_graphics_opengl_GL.FRAGMENT_SHADER_DERIVATIVE_HINT = 35723;
lime_graphics_opengl_GL.RASTERIZER_DISCARD = 35977;
lime_graphics_opengl_GL.VERTEX_ARRAY_BINDING = 34229;
lime_graphics_opengl_GL.MAX_VERTEX_OUTPUT_COMPONENTS = 37154;
lime_graphics_opengl_GL.MAX_FRAGMENT_INPUT_COMPONENTS = 37157;
lime_graphics_opengl_GL.MAX_SERVER_WAIT_TIMEOUT = 37137;
lime_graphics_opengl_GL.MAX_ELEMENT_INDEX = 36203;
lime_graphics_opengl_GL.RED = 6403;
lime_graphics_opengl_GL.RGB8 = 32849;
lime_graphics_opengl_GL.RGBA8 = 32856;
lime_graphics_opengl_GL.RGB10_A2 = 32857;
lime_graphics_opengl_GL.TEXTURE_3D = 32879;
lime_graphics_opengl_GL.TEXTURE_WRAP_R = 32882;
lime_graphics_opengl_GL.TEXTURE_MIN_LOD = 33082;
lime_graphics_opengl_GL.TEXTURE_MAX_LOD = 33083;
lime_graphics_opengl_GL.TEXTURE_BASE_LEVEL = 33084;
lime_graphics_opengl_GL.TEXTURE_MAX_LEVEL = 33085;
lime_graphics_opengl_GL.TEXTURE_COMPARE_MODE = 34892;
lime_graphics_opengl_GL.TEXTURE_COMPARE_FUNC = 34893;
lime_graphics_opengl_GL.SRGB = 35904;
lime_graphics_opengl_GL.SRGB8 = 35905;
lime_graphics_opengl_GL.SRGB8_ALPHA8 = 35907;
lime_graphics_opengl_GL.COMPARE_REF_TO_TEXTURE = 34894;
lime_graphics_opengl_GL.RGBA32F = 34836;
lime_graphics_opengl_GL.RGB32F = 34837;
lime_graphics_opengl_GL.RGBA16F = 34842;
lime_graphics_opengl_GL.RGB16F = 34843;
lime_graphics_opengl_GL.TEXTURE_2D_ARRAY = 35866;
lime_graphics_opengl_GL.TEXTURE_BINDING_2D_ARRAY = 35869;
lime_graphics_opengl_GL.R11F_G11F_B10F = 35898;
lime_graphics_opengl_GL.RGB9_E5 = 35901;
lime_graphics_opengl_GL.RGBA32UI = 36208;
lime_graphics_opengl_GL.RGB32UI = 36209;
lime_graphics_opengl_GL.RGBA16UI = 36214;
lime_graphics_opengl_GL.RGB16UI = 36215;
lime_graphics_opengl_GL.RGBA8UI = 36220;
lime_graphics_opengl_GL.RGB8UI = 36221;
lime_graphics_opengl_GL.RGBA32I = 36226;
lime_graphics_opengl_GL.RGB32I = 36227;
lime_graphics_opengl_GL.RGBA16I = 36232;
lime_graphics_opengl_GL.RGB16I = 36233;
lime_graphics_opengl_GL.RGBA8I = 36238;
lime_graphics_opengl_GL.RGB8I = 36239;
lime_graphics_opengl_GL.RED_INTEGER = 36244;
lime_graphics_opengl_GL.RGB_INTEGER = 36248;
lime_graphics_opengl_GL.RGBA_INTEGER = 36249;
lime_graphics_opengl_GL.R8 = 33321;
lime_graphics_opengl_GL.RG8 = 33323;
lime_graphics_opengl_GL.R16F = 33325;
lime_graphics_opengl_GL.R32F = 33326;
lime_graphics_opengl_GL.RG16F = 33327;
lime_graphics_opengl_GL.RG32F = 33328;
lime_graphics_opengl_GL.R8I = 33329;
lime_graphics_opengl_GL.R8UI = 33330;
lime_graphics_opengl_GL.R16I = 33331;
lime_graphics_opengl_GL.R16UI = 33332;
lime_graphics_opengl_GL.R32I = 33333;
lime_graphics_opengl_GL.R32UI = 33334;
lime_graphics_opengl_GL.RG8I = 33335;
lime_graphics_opengl_GL.RG8UI = 33336;
lime_graphics_opengl_GL.RG16I = 33337;
lime_graphics_opengl_GL.RG16UI = 33338;
lime_graphics_opengl_GL.RG32I = 33339;
lime_graphics_opengl_GL.RG32UI = 33340;
lime_graphics_opengl_GL.R8_SNORM = 36756;
lime_graphics_opengl_GL.RG8_SNORM = 36757;
lime_graphics_opengl_GL.RGB8_SNORM = 36758;
lime_graphics_opengl_GL.RGBA8_SNORM = 36759;
lime_graphics_opengl_GL.RGB10_A2UI = 36975;
lime_graphics_opengl_GL.TEXTURE_IMMUTABLE_FORMAT = 37167;
lime_graphics_opengl_GL.TEXTURE_IMMUTABLE_LEVELS = 33503;
lime_graphics_opengl_GL.UNSIGNED_INT_2_10_10_10_REV = 33640;
lime_graphics_opengl_GL.UNSIGNED_INT_10F_11F_11F_REV = 35899;
lime_graphics_opengl_GL.UNSIGNED_INT_5_9_9_9_REV = 35902;
lime_graphics_opengl_GL.FLOAT_32_UNSIGNED_INT_24_8_REV = 36269;
lime_graphics_opengl_GL.UNSIGNED_INT_24_8 = 34042;
lime_graphics_opengl_GL.HALF_FLOAT = 5131;
lime_graphics_opengl_GL.RG = 33319;
lime_graphics_opengl_GL.RG_INTEGER = 33320;
lime_graphics_opengl_GL.INT_2_10_10_10_REV = 36255;
lime_graphics_opengl_GL.CURRENT_QUERY = 34917;
lime_graphics_opengl_GL.QUERY_RESULT = 34918;
lime_graphics_opengl_GL.QUERY_RESULT_AVAILABLE = 34919;
lime_graphics_opengl_GL.ANY_SAMPLES_PASSED = 35887;
lime_graphics_opengl_GL.ANY_SAMPLES_PASSED_CONSERVATIVE = 36202;
lime_graphics_opengl_GL.MAX_DRAW_BUFFERS = 34852;
lime_graphics_opengl_GL.DRAW_BUFFER0 = 34853;
lime_graphics_opengl_GL.DRAW_BUFFER1 = 34854;
lime_graphics_opengl_GL.DRAW_BUFFER2 = 34855;
lime_graphics_opengl_GL.DRAW_BUFFER3 = 34856;
lime_graphics_opengl_GL.DRAW_BUFFER4 = 34857;
lime_graphics_opengl_GL.DRAW_BUFFER5 = 34858;
lime_graphics_opengl_GL.DRAW_BUFFER6 = 34859;
lime_graphics_opengl_GL.DRAW_BUFFER7 = 34860;
lime_graphics_opengl_GL.DRAW_BUFFER8 = 34861;
lime_graphics_opengl_GL.DRAW_BUFFER9 = 34862;
lime_graphics_opengl_GL.DRAW_BUFFER10 = 34863;
lime_graphics_opengl_GL.DRAW_BUFFER11 = 34864;
lime_graphics_opengl_GL.DRAW_BUFFER12 = 34865;
lime_graphics_opengl_GL.DRAW_BUFFER13 = 34866;
lime_graphics_opengl_GL.DRAW_BUFFER14 = 34867;
lime_graphics_opengl_GL.DRAW_BUFFER15 = 34868;
lime_graphics_opengl_GL.MAX_COLOR_ATTACHMENTS = 36063;
lime_graphics_opengl_GL.COLOR_ATTACHMENT1 = 36065;
lime_graphics_opengl_GL.COLOR_ATTACHMENT2 = 36066;
lime_graphics_opengl_GL.COLOR_ATTACHMENT3 = 36067;
lime_graphics_opengl_GL.COLOR_ATTACHMENT4 = 36068;
lime_graphics_opengl_GL.COLOR_ATTACHMENT5 = 36069;
lime_graphics_opengl_GL.COLOR_ATTACHMENT6 = 36070;
lime_graphics_opengl_GL.COLOR_ATTACHMENT7 = 36071;
lime_graphics_opengl_GL.COLOR_ATTACHMENT8 = 36072;
lime_graphics_opengl_GL.COLOR_ATTACHMENT9 = 36073;
lime_graphics_opengl_GL.COLOR_ATTACHMENT10 = 36074;
lime_graphics_opengl_GL.COLOR_ATTACHMENT11 = 36075;
lime_graphics_opengl_GL.COLOR_ATTACHMENT12 = 36076;
lime_graphics_opengl_GL.COLOR_ATTACHMENT13 = 36077;
lime_graphics_opengl_GL.COLOR_ATTACHMENT14 = 36078;
lime_graphics_opengl_GL.COLOR_ATTACHMENT15 = 36079;
lime_graphics_opengl_GL.SAMPLER_3D = 35679;
lime_graphics_opengl_GL.SAMPLER_2D_SHADOW = 35682;
lime_graphics_opengl_GL.SAMPLER_2D_ARRAY = 36289;
lime_graphics_opengl_GL.SAMPLER_2D_ARRAY_SHADOW = 36292;
lime_graphics_opengl_GL.SAMPLER_CUBE_SHADOW = 36293;
lime_graphics_opengl_GL.INT_SAMPLER_2D = 36298;
lime_graphics_opengl_GL.INT_SAMPLER_3D = 36299;
lime_graphics_opengl_GL.INT_SAMPLER_CUBE = 36300;
lime_graphics_opengl_GL.INT_SAMPLER_2D_ARRAY = 36303;
lime_graphics_opengl_GL.UNSIGNED_INT_SAMPLER_2D = 36306;
lime_graphics_opengl_GL.UNSIGNED_INT_SAMPLER_3D = 36307;
lime_graphics_opengl_GL.UNSIGNED_INT_SAMPLER_CUBE = 36308;
lime_graphics_opengl_GL.UNSIGNED_INT_SAMPLER_2D_ARRAY = 36311;
lime_graphics_opengl_GL.MAX_SAMPLES = 36183;
lime_graphics_opengl_GL.SAMPLER_BINDING = 35097;
lime_graphics_opengl_GL.PIXEL_PACK_BUFFER = 35051;
lime_graphics_opengl_GL.PIXEL_UNPACK_BUFFER = 35052;
lime_graphics_opengl_GL.PIXEL_PACK_BUFFER_BINDING = 35053;
lime_graphics_opengl_GL.PIXEL_UNPACK_BUFFER_BINDING = 35055;
lime_graphics_opengl_GL.COPY_READ_BUFFER = 36662;
lime_graphics_opengl_GL.COPY_WRITE_BUFFER = 36663;
lime_graphics_opengl_GL.COPY_READ_BUFFER_BINDING = 36662;
lime_graphics_opengl_GL.COPY_WRITE_BUFFER_BINDING = 36663;
lime_graphics_opengl_GL.FLOAT_MAT2x3 = 35685;
lime_graphics_opengl_GL.FLOAT_MAT2x4 = 35686;
lime_graphics_opengl_GL.FLOAT_MAT3x2 = 35687;
lime_graphics_opengl_GL.FLOAT_MAT3x4 = 35688;
lime_graphics_opengl_GL.FLOAT_MAT4x2 = 35689;
lime_graphics_opengl_GL.FLOAT_MAT4x3 = 35690;
lime_graphics_opengl_GL.UNSIGNED_INT_VEC2 = 36294;
lime_graphics_opengl_GL.UNSIGNED_INT_VEC3 = 36295;
lime_graphics_opengl_GL.UNSIGNED_INT_VEC4 = 36296;
lime_graphics_opengl_GL.UNSIGNED_NORMALIZED = 35863;
lime_graphics_opengl_GL.SIGNED_NORMALIZED = 36764;
lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_INTEGER = 35069;
lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_DIVISOR = 35070;
lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_BUFFER_MODE = 35967;
lime_graphics_opengl_GL.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 35968;
lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_VARYINGS = 35971;
lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_BUFFER_START = 35972;
lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_BUFFER_SIZE = 35973;
lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 35976;
lime_graphics_opengl_GL.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 35978;
lime_graphics_opengl_GL.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 35979;
lime_graphics_opengl_GL.INTERLEAVED_ATTRIBS = 35980;
lime_graphics_opengl_GL.SEPARATE_ATTRIBS = 35981;
lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_BUFFER = 35982;
lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_BUFFER_BINDING = 35983;
lime_graphics_opengl_GL.TRANSFORM_FEEDBACK = 36386;
lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_PAUSED = 36387;
lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_ACTIVE = 36388;
lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_BINDING = 36389;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 33296;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 33297;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_RED_SIZE = 33298;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 33299;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 33300;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 33301;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 33302;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 33303;
lime_graphics_opengl_GL.FRAMEBUFFER_DEFAULT = 33304;
lime_graphics_opengl_GL.DEPTH24_STENCIL8 = 35056;
lime_graphics_opengl_GL.DRAW_FRAMEBUFFER_BINDING = 36006;
lime_graphics_opengl_GL.READ_FRAMEBUFFER = 36008;
lime_graphics_opengl_GL.DRAW_FRAMEBUFFER = 36009;
lime_graphics_opengl_GL.READ_FRAMEBUFFER_BINDING = 36010;
lime_graphics_opengl_GL.RENDERBUFFER_SAMPLES = 36011;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 36052;
lime_graphics_opengl_GL.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 36182;
lime_graphics_opengl_GL.UNIFORM_BUFFER = 35345;
lime_graphics_opengl_GL.UNIFORM_BUFFER_BINDING = 35368;
lime_graphics_opengl_GL.UNIFORM_BUFFER_START = 35369;
lime_graphics_opengl_GL.UNIFORM_BUFFER_SIZE = 35370;
lime_graphics_opengl_GL.MAX_VERTEX_UNIFORM_BLOCKS = 35371;
lime_graphics_opengl_GL.MAX_FRAGMENT_UNIFORM_BLOCKS = 35373;
lime_graphics_opengl_GL.MAX_COMBINED_UNIFORM_BLOCKS = 35374;
lime_graphics_opengl_GL.MAX_UNIFORM_BUFFER_BINDINGS = 35375;
lime_graphics_opengl_GL.MAX_UNIFORM_BLOCK_SIZE = 35376;
lime_graphics_opengl_GL.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 35377;
lime_graphics_opengl_GL.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 35379;
lime_graphics_opengl_GL.UNIFORM_BUFFER_OFFSET_ALIGNMENT = 35380;
lime_graphics_opengl_GL.ACTIVE_UNIFORM_BLOCKS = 35382;
lime_graphics_opengl_GL.UNIFORM_TYPE = 35383;
lime_graphics_opengl_GL.UNIFORM_SIZE = 35384;
lime_graphics_opengl_GL.UNIFORM_BLOCK_INDEX = 35386;
lime_graphics_opengl_GL.UNIFORM_OFFSET = 35387;
lime_graphics_opengl_GL.UNIFORM_ARRAY_STRIDE = 35388;
lime_graphics_opengl_GL.UNIFORM_MATRIX_STRIDE = 35389;
lime_graphics_opengl_GL.UNIFORM_IS_ROW_MAJOR = 35390;
lime_graphics_opengl_GL.UNIFORM_BLOCK_BINDING = 35391;
lime_graphics_opengl_GL.UNIFORM_BLOCK_DATA_SIZE = 35392;
lime_graphics_opengl_GL.UNIFORM_BLOCK_ACTIVE_UNIFORMS = 35394;
lime_graphics_opengl_GL.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 35395;
lime_graphics_opengl_GL.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 35396;
lime_graphics_opengl_GL.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 35398;
lime_graphics_opengl_GL.OBJECT_TYPE = 37138;
lime_graphics_opengl_GL.SYNC_CONDITION = 37139;
lime_graphics_opengl_GL.SYNC_STATUS = 37140;
lime_graphics_opengl_GL.SYNC_FLAGS = 37141;
lime_graphics_opengl_GL.SYNC_FENCE = 37142;
lime_graphics_opengl_GL.SYNC_GPU_COMMANDS_COMPLETE = 37143;
lime_graphics_opengl_GL.UNSIGNALED = 37144;
lime_graphics_opengl_GL.SIGNALED = 37145;
lime_graphics_opengl_GL.ALREADY_SIGNALED = 37146;
lime_graphics_opengl_GL.TIMEOUT_EXPIRED = 37147;
lime_graphics_opengl_GL.CONDITION_SATISFIED = 37148;
lime_graphics_opengl_GL.WAIT_FAILED = 37149;
lime_graphics_opengl_GL.SYNC_FLUSH_COMMANDS_BIT = 1;
lime_graphics_opengl_GL.COLOR = 6144;
lime_graphics_opengl_GL.DEPTH = 6145;
lime_graphics_opengl_GL.STENCIL = 6146;
lime_graphics_opengl_GL.MIN = 32775;
lime_graphics_opengl_GL.MAX = 32776;
lime_graphics_opengl_GL.DEPTH_COMPONENT24 = 33190;
lime_graphics_opengl_GL.STREAM_READ = 35041;
lime_graphics_opengl_GL.STREAM_COPY = 35042;
lime_graphics_opengl_GL.STATIC_READ = 35045;
lime_graphics_opengl_GL.STATIC_COPY = 35046;
lime_graphics_opengl_GL.DYNAMIC_READ = 35049;
lime_graphics_opengl_GL.DYNAMIC_COPY = 35050;
lime_graphics_opengl_GL.DEPTH_COMPONENT32F = 36012;
lime_graphics_opengl_GL.DEPTH32F_STENCIL8 = 36013;
lime_graphics_opengl_GL.INVALID_INDEX = -1;
lime_graphics_opengl_GL.TIMEOUT_IGNORED = -1;
lime_graphics_opengl_GL.MAX_CLIENT_WAIT_TIMEOUT_WEBGL = 37447;
lime_math_ColorMatrix.__identity = [1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0];
lime_math_Matrix4.__identity = [1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0];
lime_media_openal_AL.NONE = 0;
lime_media_openal_AL.FALSE = 0;
lime_media_openal_AL.TRUE = 1;
lime_media_openal_AL.SOURCE_RELATIVE = 514;
lime_media_openal_AL.CONE_INNER_ANGLE = 4097;
lime_media_openal_AL.CONE_OUTER_ANGLE = 4098;
lime_media_openal_AL.PITCH = 4099;
lime_media_openal_AL.POSITION = 4100;
lime_media_openal_AL.DIRECTION = 4101;
lime_media_openal_AL.VELOCITY = 4102;
lime_media_openal_AL.LOOPING = 4103;
lime_media_openal_AL.BUFFER = 4105;
lime_media_openal_AL.GAIN = 4106;
lime_media_openal_AL.MIN_GAIN = 4109;
lime_media_openal_AL.MAX_GAIN = 4110;
lime_media_openal_AL.ORIENTATION = 4111;
lime_media_openal_AL.SOURCE_STATE = 4112;
lime_media_openal_AL.INITIAL = 4113;
lime_media_openal_AL.PLAYING = 4114;
lime_media_openal_AL.PAUSED = 4115;
lime_media_openal_AL.STOPPED = 4116;
lime_media_openal_AL.BUFFERS_QUEUED = 4117;
lime_media_openal_AL.BUFFERS_PROCESSED = 4118;
lime_media_openal_AL.REFERENCE_DISTANCE = 4128;
lime_media_openal_AL.ROLLOFF_FACTOR = 4129;
lime_media_openal_AL.CONE_OUTER_GAIN = 4130;
lime_media_openal_AL.MAX_DISTANCE = 4131;
lime_media_openal_AL.SEC_OFFSET = 4132;
lime_media_openal_AL.SAMPLE_OFFSET = 4133;
lime_media_openal_AL.BYTE_OFFSET = 4134;
lime_media_openal_AL.SOURCE_TYPE = 4135;
lime_media_openal_AL.STATIC = 4136;
lime_media_openal_AL.STREAMING = 4137;
lime_media_openal_AL.UNDETERMINED = 4144;
lime_media_openal_AL.FORMAT_MONO8 = 4352;
lime_media_openal_AL.FORMAT_MONO16 = 4353;
lime_media_openal_AL.FORMAT_STEREO8 = 4354;
lime_media_openal_AL.FORMAT_STEREO16 = 4355;
lime_media_openal_AL.FREQUENCY = 8193;
lime_media_openal_AL.BITS = 8194;
lime_media_openal_AL.CHANNELS = 8195;
lime_media_openal_AL.SIZE = 8196;
lime_media_openal_AL.NO_ERROR = 0;
lime_media_openal_AL.INVALID_NAME = 40961;
lime_media_openal_AL.INVALID_ENUM = 40962;
lime_media_openal_AL.INVALID_VALUE = 40963;
lime_media_openal_AL.INVALID_OPERATION = 40964;
lime_media_openal_AL.OUT_OF_MEMORY = 40965;
lime_media_openal_AL.VENDOR = 45057;
lime_media_openal_AL.VERSION = 45058;
lime_media_openal_AL.RENDERER = 45059;
lime_media_openal_AL.EXTENSIONS = 45060;
lime_media_openal_AL.DOPPLER_FACTOR = 49152;
lime_media_openal_AL.SPEED_OF_SOUND = 49155;
lime_media_openal_AL.DOPPLER_VELOCITY = 49153;
lime_media_openal_AL.DISTANCE_MODEL = 53248;
lime_media_openal_AL.INVERSE_DISTANCE = 53249;
lime_media_openal_AL.INVERSE_DISTANCE_CLAMPED = 53250;
lime_media_openal_AL.LINEAR_DISTANCE = 53251;
lime_media_openal_AL.LINEAR_DISTANCE_CLAMPED = 53252;
lime_media_openal_AL.EXPONENT_DISTANCE = 53253;
lime_media_openal_AL.EXPONENT_DISTANCE_CLAMPED = 53254;
lime_media_openal_AL.METERS_PER_UNIT = 131076;
lime_media_openal_AL.DIRECT_FILTER = 131077;
lime_media_openal_AL.AUXILIARY_SEND_FILTER = 131078;
lime_media_openal_AL.AIR_ABSORPTION_FACTOR = 131079;
lime_media_openal_AL.ROOM_ROLLOFF_FACTOR = 131080;
lime_media_openal_AL.CONE_OUTER_GAINHF = 131081;
lime_media_openal_AL.DIRECT_FILTER_GAINHF_AUTO = 131082;
lime_media_openal_AL.AUXILIARY_SEND_FILTER_GAIN_AUTO = 131083;
lime_media_openal_AL.AUXILIARY_SEND_FILTER_GAINHF_AUTO = 131084;
lime_media_openal_AL.REVERB_DENSITY = 1;
lime_media_openal_AL.REVERB_DIFFUSION = 2;
lime_media_openal_AL.REVERB_GAIN = 3;
lime_media_openal_AL.REVERB_GAINHF = 4;
lime_media_openal_AL.REVERB_DECAY_TIME = 5;
lime_media_openal_AL.REVERB_DECAY_HFRATIO = 6;
lime_media_openal_AL.REVERB_REFLECTIONS_GAIN = 7;
lime_media_openal_AL.REVERB_REFLECTIONS_DELAY = 8;
lime_media_openal_AL.REVERB_LATE_REVERB_GAIN = 9;
lime_media_openal_AL.REVERB_LATE_REVERB_DELAY = 10;
lime_media_openal_AL.REVERB_AIR_ABSORPTION_GAINHF = 11;
lime_media_openal_AL.REVERB_ROOM_ROLLOFF_FACTOR = 12;
lime_media_openal_AL.REVERB_DECAY_HFLIMIT = 13;
lime_media_openal_AL.EAXREVERB_DENSITY = 1;
lime_media_openal_AL.EAXREVERB_DIFFUSION = 2;
lime_media_openal_AL.EAXREVERB_GAIN = 3;
lime_media_openal_AL.EAXREVERB_GAINHF = 4;
lime_media_openal_AL.EAXREVERB_GAINLF = 5;
lime_media_openal_AL.EAXREVERB_DECAY_TIME = 6;
lime_media_openal_AL.EAXREVERB_DECAY_HFRATIO = 7;
lime_media_openal_AL.EAXREVERB_DECAY_LFRATIO = 8;
lime_media_openal_AL.EAXREVERB_REFLECTIONS_GAIN = 9;
lime_media_openal_AL.EAXREVERB_REFLECTIONS_DELAY = 10;
lime_media_openal_AL.EAXREVERB_REFLECTIONS_PAN = 11;
lime_media_openal_AL.EAXREVERB_LATE_REVERB_GAIN = 12;
lime_media_openal_AL.EAXREVERB_LATE_REVERB_DELAY = 13;
lime_media_openal_AL.EAXREVERB_LATE_REVERB_PAN = 14;
lime_media_openal_AL.EAXREVERB_ECHO_TIME = 15;
lime_media_openal_AL.EAXREVERB_ECHO_DEPTH = 16;
lime_media_openal_AL.EAXREVERB_MODULATION_TIME = 17;
lime_media_openal_AL.EAXREVERB_MODULATION_DEPTH = 18;
lime_media_openal_AL.EAXREVERB_AIR_ABSORPTION_GAINHF = 19;
lime_media_openal_AL.EAXREVERB_HFREFERENCE = 20;
lime_media_openal_AL.EAXREVERB_LFREFERENCE = 21;
lime_media_openal_AL.EAXREVERB_ROOM_ROLLOFF_FACTOR = 22;
lime_media_openal_AL.EAXREVERB_DECAY_HFLIMIT = 23;
lime_media_openal_AL.CHORUS_WAVEFORM = 1;
lime_media_openal_AL.CHORUS_PHASE = 2;
lime_media_openal_AL.CHORUS_RATE = 3;
lime_media_openal_AL.CHORUS_DEPTH = 4;
lime_media_openal_AL.CHORUS_FEEDBACK = 5;
lime_media_openal_AL.CHORUS_DELAY = 6;
lime_media_openal_AL.DISTORTION_EDGE = 1;
lime_media_openal_AL.DISTORTION_GAIN = 2;
lime_media_openal_AL.DISTORTION_LOWPASS_CUTOFF = 3;
lime_media_openal_AL.DISTORTION_EQCENTER = 4;
lime_media_openal_AL.DISTORTION_EQBANDWIDTH = 5;
lime_media_openal_AL.ECHO_DELAY = 1;
lime_media_openal_AL.ECHO_LRDELAY = 2;
lime_media_openal_AL.ECHO_DAMPING = 3;
lime_media_openal_AL.ECHO_FEEDBACK = 4;
lime_media_openal_AL.ECHO_SPREAD = 5;
lime_media_openal_AL.FLANGER_WAVEFORM = 1;
lime_media_openal_AL.FLANGER_PHASE = 2;
lime_media_openal_AL.FLANGER_RATE = 3;
lime_media_openal_AL.FLANGER_DEPTH = 4;
lime_media_openal_AL.FLANGER_FEEDBACK = 5;
lime_media_openal_AL.FLANGER_DELAY = 6;
lime_media_openal_AL.FREQUENCY_SHIFTER_FREQUENCY = 1;
lime_media_openal_AL.FREQUENCY_SHIFTER_LEFT_DIRECTION = 2;
lime_media_openal_AL.FREQUENCY_SHIFTER_RIGHT_DIRECTION = 3;
lime_media_openal_AL.VOCAL_MORPHER_PHONEMEA = 1;
lime_media_openal_AL.VOCAL_MORPHER_PHONEMEA_COARSE_TUNING = 2;
lime_media_openal_AL.VOCAL_MORPHER_PHONEMEB = 3;
lime_media_openal_AL.VOCAL_MORPHER_PHONEMEB_COARSE_TUNING = 4;
lime_media_openal_AL.VOCAL_MORPHER_WAVEFORM = 5;
lime_media_openal_AL.VOCAL_MORPHER_RATE = 6;
lime_media_openal_AL.PITCH_SHIFTER_COARSE_TUNE = 1;
lime_media_openal_AL.PITCH_SHIFTER_FINE_TUNE = 2;
lime_media_openal_AL.RING_MODULATOR_FREQUENCY = 1;
lime_media_openal_AL.RING_MODULATOR_HIGHPASS_CUTOFF = 2;
lime_media_openal_AL.RING_MODULATOR_WAVEFORM = 3;
lime_media_openal_AL.AUTOWAH_ATTACK_TIME = 1;
lime_media_openal_AL.AUTOWAH_RELEASE_TIME = 2;
lime_media_openal_AL.AUTOWAH_RESONANCE = 3;
lime_media_openal_AL.AUTOWAH_PEAK_GAIN = 4;
lime_media_openal_AL.COMPRESSOR_ONOFF = 1;
lime_media_openal_AL.EQUALIZER_LOW_GAIN = 1;
lime_media_openal_AL.EQUALIZER_LOW_CUTOFF = 2;
lime_media_openal_AL.EQUALIZER_MID1_GAIN = 3;
lime_media_openal_AL.EQUALIZER_MID1_CENTER = 4;
lime_media_openal_AL.EQUALIZER_MID1_WIDTH = 5;
lime_media_openal_AL.EQUALIZER_MID2_GAIN = 6;
lime_media_openal_AL.EQUALIZER_MID2_CENTER = 7;
lime_media_openal_AL.EQUALIZER_MID2_WIDTH = 8;
lime_media_openal_AL.EQUALIZER_HIGH_GAIN = 9;
lime_media_openal_AL.EQUALIZER_HIGH_CUTOFF = 10;
lime_media_openal_AL.EFFECT_FIRST_PARAMETER = 0;
lime_media_openal_AL.EFFECT_LAST_PARAMETER = 32768;
lime_media_openal_AL.EFFECT_TYPE = 32769;
lime_media_openal_AL.EFFECT_NULL = 0;
lime_media_openal_AL.EFFECT_EAXREVERB = 32768;
lime_media_openal_AL.EFFECT_REVERB = 1;
lime_media_openal_AL.EFFECT_CHORUS = 2;
lime_media_openal_AL.EFFECT_DISTORTION = 3;
lime_media_openal_AL.EFFECT_ECHO = 4;
lime_media_openal_AL.EFFECT_FLANGER = 5;
lime_media_openal_AL.EFFECT_FREQUENCY_SHIFTER = 6;
lime_media_openal_AL.EFFECT_VOCAL_MORPHER = 7;
lime_media_openal_AL.EFFECT_PITCH_SHIFTER = 8;
lime_media_openal_AL.EFFECT_RING_MODULATOR = 9;
lime_media_openal_AL.FFECT_AUTOWAH = 10;
lime_media_openal_AL.EFFECT_COMPRESSOR = 11;
lime_media_openal_AL.EFFECT_EQUALIZER = 12;
lime_media_openal_AL.EFFECTSLOT_EFFECT = 1;
lime_media_openal_AL.EFFECTSLOT_GAIN = 2;
lime_media_openal_AL.EFFECTSLOT_AUXILIARY_SEND_AUTO = 3;
lime_media_openal_AL.LOWPASS_GAIN = 1;
lime_media_openal_AL.LOWPASS_GAINHF = 2;
lime_media_openal_AL.HIGHPASS_GAIN = 1;
lime_media_openal_AL.HIGHPASS_GAINLF = 2;
lime_media_openal_AL.BANDPASS_GAIN = 1;
lime_media_openal_AL.BANDPASS_GAINLF = 2;
lime_media_openal_AL.BANDPASS_GAINHF = 3;
lime_media_openal_AL.FILTER_FIRST_PARAMETER = 0;
lime_media_openal_AL.FILTER_LAST_PARAMETER = 32768;
lime_media_openal_AL.FILTER_TYPE = 32769;
lime_media_openal_AL.FILTER_NULL = 0;
lime_media_openal_AL.FILTER_LOWPASS = 1;
lime_media_openal_AL.FILTER_HIGHPASS = 2;
lime_media_openal_AL.FILTER_BANDPASS = 3;
lime_media_openal_ALC.FALSE = 0;
lime_media_openal_ALC.TRUE = 1;
lime_media_openal_ALC.FREQUENCY = 4103;
lime_media_openal_ALC.REFRESH = 4104;
lime_media_openal_ALC.SYNC = 4105;
lime_media_openal_ALC.MONO_SOURCES = 4112;
lime_media_openal_ALC.STEREO_SOURCES = 4113;
lime_media_openal_ALC.NO_ERROR = 0;
lime_media_openal_ALC.INVALID_DEVICE = 40961;
lime_media_openal_ALC.INVALID_CONTEXT = 40962;
lime_media_openal_ALC.INVALID_ENUM = 40963;
lime_media_openal_ALC.INVALID_VALUE = 40964;
lime_media_openal_ALC.OUT_OF_MEMORY = 40965;
lime_media_openal_ALC.ATTRIBUTES_SIZE = 4098;
lime_media_openal_ALC.ALL_ATTRIBUTES = 4099;
lime_media_openal_ALC.DEFAULT_DEVICE_SPECIFIER = 4100;
lime_media_openal_ALC.DEVICE_SPECIFIER = 4101;
lime_media_openal_ALC.EXTENSIONS = 4102;
lime_media_openal_ALC.ENUMERATE_ALL_EXT = 1;
lime_media_openal_ALC.DEFAULT_ALL_DEVICES_SPECIFIER = 4114;
lime_media_openal_ALC.ALL_DEVICES_SPECIFIER = 4115;
lime_system_CFFI.__moduleNames = null;
lime_system_Clipboard.onUpdate = new lime_app__$Event_$Void_$Void();
lime_system_Sensor.sensorByID = new haxe_ds_IntMap();
lime_system_Sensor.sensors = [];
lime_system_System.__directories = new haxe_ds_IntMap();
lime_ui_Gamepad.devices = new haxe_ds_IntMap();
lime_ui_Gamepad.onConnect = new lime_app__$Event_$lime_$ui_$Gamepad_$Void();
lime_ui_GamepadAxis.LEFT_X = 0;
lime_ui_GamepadAxis.LEFT_Y = 1;
lime_ui_GamepadAxis.RIGHT_X = 2;
lime_ui_GamepadAxis.RIGHT_Y = 3;
lime_ui_GamepadAxis.TRIGGER_LEFT = 4;
lime_ui_GamepadAxis.TRIGGER_RIGHT = 5;
lime_ui_GamepadButton.A = 0;
lime_ui_GamepadButton.B = 1;
lime_ui_GamepadButton.X = 2;
lime_ui_GamepadButton.Y = 3;
lime_ui_GamepadButton.BACK = 4;
lime_ui_GamepadButton.GUIDE = 5;
lime_ui_GamepadButton.START = 6;
lime_ui_GamepadButton.LEFT_STICK = 7;
lime_ui_GamepadButton.RIGHT_STICK = 8;
lime_ui_GamepadButton.LEFT_SHOULDER = 9;
lime_ui_GamepadButton.RIGHT_SHOULDER = 10;
lime_ui_GamepadButton.DPAD_UP = 11;
lime_ui_GamepadButton.DPAD_DOWN = 12;
lime_ui_GamepadButton.DPAD_LEFT = 13;
lime_ui_GamepadButton.DPAD_RIGHT = 14;
lime_ui_Joystick.devices = new haxe_ds_IntMap();
lime_ui_Joystick.onConnect = new lime_app__$Event_$lime_$ui_$Joystick_$Void();
lime_ui_JoystickHatPosition.CENTER = 0;
lime_ui_JoystickHatPosition.DOWN = 4;
lime_ui_JoystickHatPosition.LEFT = 8;
lime_ui_JoystickHatPosition.RIGHT = 2;
lime_ui_JoystickHatPosition.UP = 1;
lime_ui_JoystickHatPosition.DOWN_LEFT = 12;
lime_ui_JoystickHatPosition.DOWN_RIGHT = 6;
lime_ui_JoystickHatPosition.UP_LEFT = 9;
lime_ui_JoystickHatPosition.UP_RIGHT = 3;
lime_ui_KeyCode.UNKNOWN = 0;
lime_ui_KeyCode.BACKSPACE = 8;
lime_ui_KeyCode.TAB = 9;
lime_ui_KeyCode.RETURN = 13;
lime_ui_KeyCode.ESCAPE = 27;
lime_ui_KeyCode.SPACE = 32;
lime_ui_KeyCode.EXCLAMATION = 33;
lime_ui_KeyCode.QUOTE = 34;
lime_ui_KeyCode.HASH = 35;
lime_ui_KeyCode.DOLLAR = 36;
lime_ui_KeyCode.PERCENT = 37;
lime_ui_KeyCode.AMPERSAND = 38;
lime_ui_KeyCode.SINGLE_QUOTE = 39;
lime_ui_KeyCode.LEFT_PARENTHESIS = 40;
lime_ui_KeyCode.RIGHT_PARENTHESIS = 41;
lime_ui_KeyCode.ASTERISK = 42;
lime_ui_KeyCode.PLUS = 43;
lime_ui_KeyCode.COMMA = 44;
lime_ui_KeyCode.MINUS = 45;
lime_ui_KeyCode.PERIOD = 46;
lime_ui_KeyCode.SLASH = 47;
lime_ui_KeyCode.NUMBER_0 = 48;
lime_ui_KeyCode.NUMBER_1 = 49;
lime_ui_KeyCode.NUMBER_2 = 50;
lime_ui_KeyCode.NUMBER_3 = 51;
lime_ui_KeyCode.NUMBER_4 = 52;
lime_ui_KeyCode.NUMBER_5 = 53;
lime_ui_KeyCode.NUMBER_6 = 54;
lime_ui_KeyCode.NUMBER_7 = 55;
lime_ui_KeyCode.NUMBER_8 = 56;
lime_ui_KeyCode.NUMBER_9 = 57;
lime_ui_KeyCode.COLON = 58;
lime_ui_KeyCode.SEMICOLON = 59;
lime_ui_KeyCode.LESS_THAN = 60;
lime_ui_KeyCode.EQUALS = 61;
lime_ui_KeyCode.GREATER_THAN = 62;
lime_ui_KeyCode.QUESTION = 63;
lime_ui_KeyCode.AT = 64;
lime_ui_KeyCode.LEFT_BRACKET = 91;
lime_ui_KeyCode.BACKSLASH = 92;
lime_ui_KeyCode.RIGHT_BRACKET = 93;
lime_ui_KeyCode.CARET = 94;
lime_ui_KeyCode.UNDERSCORE = 95;
lime_ui_KeyCode.GRAVE = 96;
lime_ui_KeyCode.A = 97;
lime_ui_KeyCode.B = 98;
lime_ui_KeyCode.C = 99;
lime_ui_KeyCode.D = 100;
lime_ui_KeyCode.E = 101;
lime_ui_KeyCode.F = 102;
lime_ui_KeyCode.G = 103;
lime_ui_KeyCode.H = 104;
lime_ui_KeyCode.I = 105;
lime_ui_KeyCode.J = 106;
lime_ui_KeyCode.K = 107;
lime_ui_KeyCode.L = 108;
lime_ui_KeyCode.M = 109;
lime_ui_KeyCode.N = 110;
lime_ui_KeyCode.O = 111;
lime_ui_KeyCode.P = 112;
lime_ui_KeyCode.Q = 113;
lime_ui_KeyCode.R = 114;
lime_ui_KeyCode.S = 115;
lime_ui_KeyCode.T = 116;
lime_ui_KeyCode.U = 117;
lime_ui_KeyCode.V = 118;
lime_ui_KeyCode.W = 119;
lime_ui_KeyCode.X = 120;
lime_ui_KeyCode.Y = 121;
lime_ui_KeyCode.Z = 122;
lime_ui_KeyCode.DELETE = 127;
lime_ui_KeyCode.CAPS_LOCK = 1073741881;
lime_ui_KeyCode.F1 = 1073741882;
lime_ui_KeyCode.F2 = 1073741883;
lime_ui_KeyCode.F3 = 1073741884;
lime_ui_KeyCode.F4 = 1073741885;
lime_ui_KeyCode.F5 = 1073741886;
lime_ui_KeyCode.F6 = 1073741887;
lime_ui_KeyCode.F7 = 1073741888;
lime_ui_KeyCode.F8 = 1073741889;
lime_ui_KeyCode.F9 = 1073741890;
lime_ui_KeyCode.F10 = 1073741891;
lime_ui_KeyCode.F11 = 1073741892;
lime_ui_KeyCode.F12 = 1073741893;
lime_ui_KeyCode.PRINT_SCREEN = 1073741894;
lime_ui_KeyCode.SCROLL_LOCK = 1073741895;
lime_ui_KeyCode.PAUSE = 1073741896;
lime_ui_KeyCode.INSERT = 1073741897;
lime_ui_KeyCode.HOME = 1073741898;
lime_ui_KeyCode.PAGE_UP = 1073741899;
lime_ui_KeyCode.END = 1073741901;
lime_ui_KeyCode.PAGE_DOWN = 1073741902;
lime_ui_KeyCode.RIGHT = 1073741903;
lime_ui_KeyCode.LEFT = 1073741904;
lime_ui_KeyCode.DOWN = 1073741905;
lime_ui_KeyCode.UP = 1073741906;
lime_ui_KeyCode.NUM_LOCK = 1073741907;
lime_ui_KeyCode.NUMPAD_DIVIDE = 1073741908;
lime_ui_KeyCode.NUMPAD_MULTIPLY = 1073741909;
lime_ui_KeyCode.NUMPAD_MINUS = 1073741910;
lime_ui_KeyCode.NUMPAD_PLUS = 1073741911;
lime_ui_KeyCode.NUMPAD_ENTER = 1073741912;
lime_ui_KeyCode.NUMPAD_1 = 1073741913;
lime_ui_KeyCode.NUMPAD_2 = 1073741914;
lime_ui_KeyCode.NUMPAD_3 = 1073741915;
lime_ui_KeyCode.NUMPAD_4 = 1073741916;
lime_ui_KeyCode.NUMPAD_5 = 1073741917;
lime_ui_KeyCode.NUMPAD_6 = 1073741918;
lime_ui_KeyCode.NUMPAD_7 = 1073741919;
lime_ui_KeyCode.NUMPAD_8 = 1073741920;
lime_ui_KeyCode.NUMPAD_9 = 1073741921;
lime_ui_KeyCode.NUMPAD_0 = 1073741922;
lime_ui_KeyCode.NUMPAD_PERIOD = 1073741923;
lime_ui_KeyCode.APPLICATION = 1073741925;
lime_ui_KeyCode.POWER = 1073741926;
lime_ui_KeyCode.NUMPAD_EQUALS = 1073741927;
lime_ui_KeyCode.F13 = 1073741928;
lime_ui_KeyCode.F14 = 1073741929;
lime_ui_KeyCode.F15 = 1073741930;
lime_ui_KeyCode.F16 = 1073741931;
lime_ui_KeyCode.F17 = 1073741932;
lime_ui_KeyCode.F18 = 1073741933;
lime_ui_KeyCode.F19 = 1073741934;
lime_ui_KeyCode.F20 = 1073741935;
lime_ui_KeyCode.F21 = 1073741936;
lime_ui_KeyCode.F22 = 1073741937;
lime_ui_KeyCode.F23 = 1073741938;
lime_ui_KeyCode.F24 = 1073741939;
lime_ui_KeyCode.EXECUTE = 1073741940;
lime_ui_KeyCode.HELP = 1073741941;
lime_ui_KeyCode.MENU = 1073741942;
lime_ui_KeyCode.SELECT = 1073741943;
lime_ui_KeyCode.STOP = 1073741944;
lime_ui_KeyCode.AGAIN = 1073741945;
lime_ui_KeyCode.UNDO = 1073741946;
lime_ui_KeyCode.CUT = 1073741947;
lime_ui_KeyCode.COPY = 1073741948;
lime_ui_KeyCode.PASTE = 1073741949;
lime_ui_KeyCode.FIND = 1073741950;
lime_ui_KeyCode.MUTE = 1073741951;
lime_ui_KeyCode.VOLUME_UP = 1073741952;
lime_ui_KeyCode.VOLUME_DOWN = 1073741953;
lime_ui_KeyCode.NUMPAD_COMMA = 1073741957;
lime_ui_KeyCode.ALT_ERASE = 1073741977;
lime_ui_KeyCode.SYSTEM_REQUEST = 1073741978;
lime_ui_KeyCode.CANCEL = 1073741979;
lime_ui_KeyCode.CLEAR = 1073741980;
lime_ui_KeyCode.PRIOR = 1073741981;
lime_ui_KeyCode.RETURN2 = 1073741982;
lime_ui_KeyCode.SEPARATOR = 1073741983;
lime_ui_KeyCode.OUT = 1073741984;
lime_ui_KeyCode.OPER = 1073741985;
lime_ui_KeyCode.CLEAR_AGAIN = 1073741986;
lime_ui_KeyCode.CRSEL = 1073741987;
lime_ui_KeyCode.EXSEL = 1073741988;
lime_ui_KeyCode.NUMPAD_00 = 1073742000;
lime_ui_KeyCode.NUMPAD_000 = 1073742001;
lime_ui_KeyCode.THOUSAND_SEPARATOR = 1073742002;
lime_ui_KeyCode.DECIMAL_SEPARATOR = 1073742003;
lime_ui_KeyCode.CURRENCY_UNIT = 1073742004;
lime_ui_KeyCode.CURRENCY_SUBUNIT = 1073742005;
lime_ui_KeyCode.NUMPAD_LEFT_PARENTHESIS = 1073742006;
lime_ui_KeyCode.NUMPAD_RIGHT_PARENTHESIS = 1073742007;
lime_ui_KeyCode.NUMPAD_LEFT_BRACE = 1073742008;
lime_ui_KeyCode.NUMPAD_RIGHT_BRACE = 1073742009;
lime_ui_KeyCode.NUMPAD_TAB = 1073742010;
lime_ui_KeyCode.NUMPAD_BACKSPACE = 1073742011;
lime_ui_KeyCode.NUMPAD_A = 1073742012;
lime_ui_KeyCode.NUMPAD_B = 1073742013;
lime_ui_KeyCode.NUMPAD_C = 1073742014;
lime_ui_KeyCode.NUMPAD_D = 1073742015;
lime_ui_KeyCode.NUMPAD_E = 1073742016;
lime_ui_KeyCode.NUMPAD_F = 1073742017;
lime_ui_KeyCode.NUMPAD_XOR = 1073742018;
lime_ui_KeyCode.NUMPAD_POWER = 1073742019;
lime_ui_KeyCode.NUMPAD_PERCENT = 1073742020;
lime_ui_KeyCode.NUMPAD_LESS_THAN = 1073742021;
lime_ui_KeyCode.NUMPAD_GREATER_THAN = 1073742022;
lime_ui_KeyCode.NUMPAD_AMPERSAND = 1073742023;
lime_ui_KeyCode.NUMPAD_DOUBLE_AMPERSAND = 1073742024;
lime_ui_KeyCode.NUMPAD_VERTICAL_BAR = 1073742025;
lime_ui_KeyCode.NUMPAD_DOUBLE_VERTICAL_BAR = 1073742026;
lime_ui_KeyCode.NUMPAD_COLON = 1073742027;
lime_ui_KeyCode.NUMPAD_HASH = 1073742028;
lime_ui_KeyCode.NUMPAD_SPACE = 1073742029;
lime_ui_KeyCode.NUMPAD_AT = 1073742030;
lime_ui_KeyCode.NUMPAD_EXCLAMATION = 1073742031;
lime_ui_KeyCode.NUMPAD_MEM_STORE = 1073742032;
lime_ui_KeyCode.NUMPAD_MEM_RECALL = 1073742033;
lime_ui_KeyCode.NUMPAD_MEM_CLEAR = 1073742034;
lime_ui_KeyCode.NUMPAD_MEM_ADD = 1073742035;
lime_ui_KeyCode.NUMPAD_MEM_SUBTRACT = 1073742036;
lime_ui_KeyCode.NUMPAD_MEM_MULTIPLY = 1073742037;
lime_ui_KeyCode.NUMPAD_MEM_DIVIDE = 1073742038;
lime_ui_KeyCode.NUMPAD_PLUS_MINUS = 1073742039;
lime_ui_KeyCode.NUMPAD_CLEAR = 1073742040;
lime_ui_KeyCode.NUMPAD_CLEAR_ENTRY = 1073742041;
lime_ui_KeyCode.NUMPAD_BINARY = 1073742042;
lime_ui_KeyCode.NUMPAD_OCTAL = 1073742043;
lime_ui_KeyCode.NUMPAD_DECIMAL = 1073742044;
lime_ui_KeyCode.NUMPAD_HEXADECIMAL = 1073742045;
lime_ui_KeyCode.LEFT_CTRL = 1073742048;
lime_ui_KeyCode.LEFT_SHIFT = 1073742049;
lime_ui_KeyCode.LEFT_ALT = 1073742050;
lime_ui_KeyCode.LEFT_META = 1073742051;
lime_ui_KeyCode.RIGHT_CTRL = 1073742052;
lime_ui_KeyCode.RIGHT_SHIFT = 1073742053;
lime_ui_KeyCode.RIGHT_ALT = 1073742054;
lime_ui_KeyCode.RIGHT_META = 1073742055;
lime_ui_KeyCode.MODE = 1073742081;
lime_ui_KeyCode.AUDIO_NEXT = 1073742082;
lime_ui_KeyCode.AUDIO_PREVIOUS = 1073742083;
lime_ui_KeyCode.AUDIO_STOP = 1073742084;
lime_ui_KeyCode.AUDIO_PLAY = 1073742085;
lime_ui_KeyCode.AUDIO_MUTE = 1073742086;
lime_ui_KeyCode.MEDIA_SELECT = 1073742087;
lime_ui_KeyCode.WWW = 1073742088;
lime_ui_KeyCode.MAIL = 1073742089;
lime_ui_KeyCode.CALCULATOR = 1073742090;
lime_ui_KeyCode.COMPUTER = 1073742091;
lime_ui_KeyCode.APP_CONTROL_SEARCH = 1073742092;
lime_ui_KeyCode.APP_CONTROL_HOME = 1073742093;
lime_ui_KeyCode.APP_CONTROL_BACK = 1073742094;
lime_ui_KeyCode.APP_CONTROL_FORWARD = 1073742095;
lime_ui_KeyCode.APP_CONTROL_STOP = 1073742096;
lime_ui_KeyCode.APP_CONTROL_REFRESH = 1073742097;
lime_ui_KeyCode.APP_CONTROL_BOOKMARKS = 1073742098;
lime_ui_KeyCode.BRIGHTNESS_DOWN = 1073742099;
lime_ui_KeyCode.BRIGHTNESS_UP = 1073742100;
lime_ui_KeyCode.DISPLAY_SWITCH = 1073742101;
lime_ui_KeyCode.BACKLIGHT_TOGGLE = 1073742102;
lime_ui_KeyCode.BACKLIGHT_DOWN = 1073742103;
lime_ui_KeyCode.BACKLIGHT_UP = 1073742104;
lime_ui_KeyCode.EJECT = 1073742105;
lime_ui_KeyCode.SLEEP = 1073742106;
lime_ui_KeyModifier.NONE = 0;
lime_ui_KeyModifier.LEFT_SHIFT = 1;
lime_ui_KeyModifier.RIGHT_SHIFT = 2;
lime_ui_KeyModifier.LEFT_CTRL = 64;
lime_ui_KeyModifier.RIGHT_CTRL = 128;
lime_ui_KeyModifier.LEFT_ALT = 256;
lime_ui_KeyModifier.RIGHT_ALT = 512;
lime_ui_KeyModifier.LEFT_META = 1024;
lime_ui_KeyModifier.RIGHT_META = 2048;
lime_ui_KeyModifier.NUM_LOCK = 4096;
lime_ui_KeyModifier.CAPS_LOCK = 8192;
lime_ui_KeyModifier.MODE = 16384;
lime_ui_KeyModifier.CTRL = 192;
lime_ui_KeyModifier.SHIFT = 3;
lime_ui_KeyModifier.ALT = 768;
lime_ui_KeyModifier.META = 3072;
lime_ui_ScanCode.UNKNOWN = 0;
lime_ui_ScanCode.BACKSPACE = 42;
lime_ui_ScanCode.TAB = 43;
lime_ui_ScanCode.RETURN = 40;
lime_ui_ScanCode.ESCAPE = 41;
lime_ui_ScanCode.SPACE = 44;
lime_ui_ScanCode.SINGLE_QUOTE = 52;
lime_ui_ScanCode.COMMA = 54;
lime_ui_ScanCode.MINUS = 45;
lime_ui_ScanCode.PERIOD = 55;
lime_ui_ScanCode.SLASH = 56;
lime_ui_ScanCode.NUMBER_0 = 39;
lime_ui_ScanCode.NUMBER_1 = 30;
lime_ui_ScanCode.NUMBER_2 = 31;
lime_ui_ScanCode.NUMBER_3 = 32;
lime_ui_ScanCode.NUMBER_4 = 33;
lime_ui_ScanCode.NUMBER_5 = 34;
lime_ui_ScanCode.NUMBER_6 = 35;
lime_ui_ScanCode.NUMBER_7 = 36;
lime_ui_ScanCode.NUMBER_8 = 37;
lime_ui_ScanCode.NUMBER_9 = 38;
lime_ui_ScanCode.SEMICOLON = 51;
lime_ui_ScanCode.EQUALS = 46;
lime_ui_ScanCode.LEFT_BRACKET = 47;
lime_ui_ScanCode.BACKSLASH = 49;
lime_ui_ScanCode.RIGHT_BRACKET = 48;
lime_ui_ScanCode.GRAVE = 53;
lime_ui_ScanCode.A = 4;
lime_ui_ScanCode.B = 5;
lime_ui_ScanCode.C = 6;
lime_ui_ScanCode.D = 7;
lime_ui_ScanCode.E = 8;
lime_ui_ScanCode.F = 9;
lime_ui_ScanCode.G = 10;
lime_ui_ScanCode.H = 11;
lime_ui_ScanCode.I = 12;
lime_ui_ScanCode.J = 13;
lime_ui_ScanCode.K = 14;
lime_ui_ScanCode.L = 15;
lime_ui_ScanCode.M = 16;
lime_ui_ScanCode.N = 17;
lime_ui_ScanCode.O = 18;
lime_ui_ScanCode.P = 19;
lime_ui_ScanCode.Q = 20;
lime_ui_ScanCode.R = 21;
lime_ui_ScanCode.S = 22;
lime_ui_ScanCode.T = 23;
lime_ui_ScanCode.U = 24;
lime_ui_ScanCode.V = 25;
lime_ui_ScanCode.W = 26;
lime_ui_ScanCode.X = 27;
lime_ui_ScanCode.Y = 28;
lime_ui_ScanCode.Z = 29;
lime_ui_ScanCode.DELETE = 76;
lime_ui_ScanCode.CAPS_LOCK = 57;
lime_ui_ScanCode.F1 = 58;
lime_ui_ScanCode.F2 = 59;
lime_ui_ScanCode.F3 = 60;
lime_ui_ScanCode.F4 = 61;
lime_ui_ScanCode.F5 = 62;
lime_ui_ScanCode.F6 = 63;
lime_ui_ScanCode.F7 = 64;
lime_ui_ScanCode.F8 = 65;
lime_ui_ScanCode.F9 = 66;
lime_ui_ScanCode.F10 = 67;
lime_ui_ScanCode.F11 = 68;
lime_ui_ScanCode.F12 = 69;
lime_ui_ScanCode.PRINT_SCREEN = 70;
lime_ui_ScanCode.SCROLL_LOCK = 71;
lime_ui_ScanCode.PAUSE = 72;
lime_ui_ScanCode.INSERT = 73;
lime_ui_ScanCode.HOME = 74;
lime_ui_ScanCode.PAGE_UP = 75;
lime_ui_ScanCode.END = 77;
lime_ui_ScanCode.PAGE_DOWN = 78;
lime_ui_ScanCode.RIGHT = 79;
lime_ui_ScanCode.LEFT = 80;
lime_ui_ScanCode.DOWN = 81;
lime_ui_ScanCode.UP = 82;
lime_ui_ScanCode.NUM_LOCK = 83;
lime_ui_ScanCode.NUMPAD_DIVIDE = 84;
lime_ui_ScanCode.NUMPAD_MULTIPLY = 85;
lime_ui_ScanCode.NUMPAD_MINUS = 86;
lime_ui_ScanCode.NUMPAD_PLUS = 87;
lime_ui_ScanCode.NUMPAD_ENTER = 88;
lime_ui_ScanCode.NUMPAD_1 = 89;
lime_ui_ScanCode.NUMPAD_2 = 90;
lime_ui_ScanCode.NUMPAD_3 = 91;
lime_ui_ScanCode.NUMPAD_4 = 92;
lime_ui_ScanCode.NUMPAD_5 = 93;
lime_ui_ScanCode.NUMPAD_6 = 94;
lime_ui_ScanCode.NUMPAD_7 = 95;
lime_ui_ScanCode.NUMPAD_8 = 96;
lime_ui_ScanCode.NUMPAD_9 = 97;
lime_ui_ScanCode.NUMPAD_0 = 98;
lime_ui_ScanCode.NUMPAD_PERIOD = 99;
lime_ui_ScanCode.APPLICATION = 101;
lime_ui_ScanCode.POWER = 102;
lime_ui_ScanCode.NUMPAD_EQUALS = 103;
lime_ui_ScanCode.F13 = 104;
lime_ui_ScanCode.F14 = 105;
lime_ui_ScanCode.F15 = 106;
lime_ui_ScanCode.F16 = 107;
lime_ui_ScanCode.F17 = 108;
lime_ui_ScanCode.F18 = 109;
lime_ui_ScanCode.F19 = 110;
lime_ui_ScanCode.F20 = 111;
lime_ui_ScanCode.F21 = 112;
lime_ui_ScanCode.F22 = 113;
lime_ui_ScanCode.F23 = 114;
lime_ui_ScanCode.F24 = 115;
lime_ui_ScanCode.EXECUTE = 116;
lime_ui_ScanCode.HELP = 117;
lime_ui_ScanCode.MENU = 118;
lime_ui_ScanCode.SELECT = 119;
lime_ui_ScanCode.STOP = 120;
lime_ui_ScanCode.AGAIN = 121;
lime_ui_ScanCode.UNDO = 122;
lime_ui_ScanCode.CUT = 123;
lime_ui_ScanCode.COPY = 124;
lime_ui_ScanCode.PASTE = 125;
lime_ui_ScanCode.FIND = 126;
lime_ui_ScanCode.MUTE = 127;
lime_ui_ScanCode.VOLUME_UP = 128;
lime_ui_ScanCode.VOLUME_DOWN = 129;
lime_ui_ScanCode.NUMPAD_COMMA = 133;
lime_ui_ScanCode.ALT_ERASE = 153;
lime_ui_ScanCode.SYSTEM_REQUEST = 154;
lime_ui_ScanCode.CANCEL = 155;
lime_ui_ScanCode.CLEAR = 156;
lime_ui_ScanCode.PRIOR = 157;
lime_ui_ScanCode.RETURN2 = 158;
lime_ui_ScanCode.SEPARATOR = 159;
lime_ui_ScanCode.OUT = 160;
lime_ui_ScanCode.OPER = 161;
lime_ui_ScanCode.CLEAR_AGAIN = 162;
lime_ui_ScanCode.CRSEL = 163;
lime_ui_ScanCode.EXSEL = 164;
lime_ui_ScanCode.NUMPAD_00 = 176;
lime_ui_ScanCode.NUMPAD_000 = 177;
lime_ui_ScanCode.THOUSAND_SEPARATOR = 178;
lime_ui_ScanCode.DECIMAL_SEPARATOR = 179;
lime_ui_ScanCode.CURRENCY_UNIT = 180;
lime_ui_ScanCode.CURRENCY_SUBUNIT = 181;
lime_ui_ScanCode.NUMPAD_LEFT_PARENTHESIS = 182;
lime_ui_ScanCode.NUMPAD_RIGHT_PARENTHESIS = 183;
lime_ui_ScanCode.NUMPAD_LEFT_BRACE = 184;
lime_ui_ScanCode.NUMPAD_RIGHT_BRACE = 185;
lime_ui_ScanCode.NUMPAD_TAB = 186;
lime_ui_ScanCode.NUMPAD_BACKSPACE = 187;
lime_ui_ScanCode.NUMPAD_A = 188;
lime_ui_ScanCode.NUMPAD_B = 189;
lime_ui_ScanCode.NUMPAD_C = 190;
lime_ui_ScanCode.NUMPAD_D = 191;
lime_ui_ScanCode.NUMPAD_E = 192;
lime_ui_ScanCode.NUMPAD_F = 193;
lime_ui_ScanCode.NUMPAD_XOR = 194;
lime_ui_ScanCode.NUMPAD_POWER = 195;
lime_ui_ScanCode.NUMPAD_PERCENT = 196;
lime_ui_ScanCode.NUMPAD_LESS_THAN = 197;
lime_ui_ScanCode.NUMPAD_GREATER_THAN = 198;
lime_ui_ScanCode.NUMPAD_AMPERSAND = 199;
lime_ui_ScanCode.NUMPAD_DOUBLE_AMPERSAND = 200;
lime_ui_ScanCode.NUMPAD_VERTICAL_BAR = 201;
lime_ui_ScanCode.NUMPAD_DOUBLE_VERTICAL_BAR = 202;
lime_ui_ScanCode.NUMPAD_COLON = 203;
lime_ui_ScanCode.NUMPAD_HASH = 204;
lime_ui_ScanCode.NUMPAD_SPACE = 205;
lime_ui_ScanCode.NUMPAD_AT = 206;
lime_ui_ScanCode.NUMPAD_EXCLAMATION = 207;
lime_ui_ScanCode.NUMPAD_MEM_STORE = 208;
lime_ui_ScanCode.NUMPAD_MEM_RECALL = 209;
lime_ui_ScanCode.NUMPAD_MEM_CLEAR = 210;
lime_ui_ScanCode.NUMPAD_MEM_ADD = 211;
lime_ui_ScanCode.NUMPAD_MEM_SUBTRACT = 212;
lime_ui_ScanCode.NUMPAD_MEM_MULTIPLY = 213;
lime_ui_ScanCode.NUMPAD_MEM_DIVIDE = 214;
lime_ui_ScanCode.NUMPAD_PLUS_MINUS = 215;
lime_ui_ScanCode.NUMPAD_CLEAR = 216;
lime_ui_ScanCode.NUMPAD_CLEAR_ENTRY = 217;
lime_ui_ScanCode.NUMPAD_BINARY = 218;
lime_ui_ScanCode.NUMPAD_OCTAL = 219;
lime_ui_ScanCode.NUMPAD_DECIMAL = 220;
lime_ui_ScanCode.NUMPAD_HEXADECIMAL = 221;
lime_ui_ScanCode.LEFT_CTRL = 224;
lime_ui_ScanCode.LEFT_SHIFT = 225;
lime_ui_ScanCode.LEFT_ALT = 226;
lime_ui_ScanCode.LEFT_META = 227;
lime_ui_ScanCode.RIGHT_CTRL = 228;
lime_ui_ScanCode.RIGHT_SHIFT = 229;
lime_ui_ScanCode.RIGHT_ALT = 230;
lime_ui_ScanCode.RIGHT_META = 231;
lime_ui_ScanCode.MODE = 257;
lime_ui_ScanCode.AUDIO_NEXT = 258;
lime_ui_ScanCode.AUDIO_PREVIOUS = 259;
lime_ui_ScanCode.AUDIO_STOP = 260;
lime_ui_ScanCode.AUDIO_PLAY = 261;
lime_ui_ScanCode.AUDIO_MUTE = 262;
lime_ui_ScanCode.MEDIA_SELECT = 263;
lime_ui_ScanCode.WWW = 264;
lime_ui_ScanCode.MAIL = 265;
lime_ui_ScanCode.CALCULATOR = 266;
lime_ui_ScanCode.COMPUTER = 267;
lime_ui_ScanCode.APP_CONTROL_SEARCH = 268;
lime_ui_ScanCode.APP_CONTROL_HOME = 269;
lime_ui_ScanCode.APP_CONTROL_BACK = 270;
lime_ui_ScanCode.APP_CONTROL_FORWARD = 271;
lime_ui_ScanCode.APP_CONTROL_STOP = 272;
lime_ui_ScanCode.APP_CONTROL_REFRESH = 273;
lime_ui_ScanCode.APP_CONTROL_BOOKMARKS = 274;
lime_ui_ScanCode.BRIGHTNESS_DOWN = 275;
lime_ui_ScanCode.BRIGHTNESS_UP = 276;
lime_ui_ScanCode.DISPLAY_SWITCH = 277;
lime_ui_ScanCode.BACKLIGHT_TOGGLE = 278;
lime_ui_ScanCode.BACKLIGHT_DOWN = 279;
lime_ui_ScanCode.BACKLIGHT_UP = 280;
lime_ui_ScanCode.EJECT = 281;
lime_ui_ScanCode.SLEEP = 282;
lime_ui_Touch.onCancel = new lime_app__$Event_$lime_$ui_$Touch_$Void();
lime_ui_Touch.onEnd = new lime_app__$Event_$lime_$ui_$Touch_$Void();
lime_ui_Touch.onMove = new lime_app__$Event_$lime_$ui_$Touch_$Void();
lime_ui_Touch.onStart = new lime_app__$Event_$lime_$ui_$Touch_$Void();
lime_utils_Assets.cache = new lime_utils_AssetCache();
lime_utils_Assets.onChange = new lime_app__$Event_$Void_$Void();
lime_utils_Assets.bundlePaths = new haxe_ds_StringMap();
lime_utils_Assets.libraries = new haxe_ds_StringMap();
lime_utils_Assets.libraryPaths = new haxe_ds_StringMap();
lime_utils_Float32Array.BYTES_PER_ELEMENT = 4;
lime_utils_Float64Array.BYTES_PER_ELEMENT = 8;
lime_utils_Int16Array.BYTES_PER_ELEMENT = 2;
lime_utils_Int32Array.BYTES_PER_ELEMENT = 4;
lime_utils_Int8Array.BYTES_PER_ELEMENT = 1;
lime_utils_Log.throwErrors = true;
lime_utils_LogLevel.NONE = 0;
lime_utils_LogLevel.ERROR = 1;
lime_utils_LogLevel.WARN = 2;
lime_utils_LogLevel.INFO = 3;
lime_utils_LogLevel.DEBUG = 4;
lime_utils_LogLevel.VERBOSE = 5;
lime_utils_UInt16Array.BYTES_PER_ELEMENT = 2;
lime_utils_UInt32Array.BYTES_PER_ELEMENT = 4;
lime_utils_UInt8Array.BYTES_PER_ELEMENT = 1;
lime_utils_UInt8ClampedArray.BYTES_PER_ELEMENT = 1;
openfl_Lib.__lastTimerID = 0;
openfl_Lib.__sentWarnings = new haxe_ds_StringMap();
openfl_Lib.__timers = new haxe_ds_IntMap();
openfl__$Vector_IVector.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl__$Vector_BoolVector.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { toJSON : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl__$Vector_FloatVector.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { toJSON : { SuppressWarnings : ["checkstyle:Dynamic"]}, _ : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl__$Vector_FunctionVector.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { toJSON : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl__$Vector_IntVector.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { toJSON : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl__$Vector_ObjectVector.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { concat : { SuppressWarnings : ["checkstyle:Dynamic"]}, toJSON : { SuppressWarnings : ["checkstyle:Dynamic"]}, _ : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl__$internal_Lib.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, statics : { notImplemented : { SuppressWarnings : ["checkstyle:NullableParameter"]}}};
openfl__$internal_Lib.__sentWarnings = new haxe_ds_StringMap();
openfl__$internal_formats_html_HTMLParser.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl__$internal_formats_html_HTMLParser.__regexAlign = new EReg("align\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i");
openfl__$internal_formats_html_HTMLParser.__regexBreakTag = new EReg("<br\\s*/?>","gi");
openfl__$internal_formats_html_HTMLParser.__regexBlockIndent = new EReg("blockindent\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i");
openfl__$internal_formats_html_HTMLParser.__regexColor = new EReg("color\\s?=\\s?(\"#([^\"]+)\"|'#([^']+)')","i");
openfl__$internal_formats_html_HTMLParser.__regexEntities = [new EReg("&quot;","g"),new EReg("&apos;","g"),new EReg("&amp;","g"),new EReg("&lt;","g"),new EReg("&gt;","g"),new EReg("&nbsp;","g")];
openfl__$internal_formats_html_HTMLParser.__regexFace = new EReg("face\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i");
openfl__$internal_formats_html_HTMLParser.__regexHTMLTag = new EReg("<.*?>","g");
openfl__$internal_formats_html_HTMLParser.__regexHref = new EReg("href\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i");
openfl__$internal_formats_html_HTMLParser.__regexIndent = new EReg(" indent\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i");
openfl__$internal_formats_html_HTMLParser.__regexLeading = new EReg("leading\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i");
openfl__$internal_formats_html_HTMLParser.__regexLeftMargin = new EReg("leftmargin\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i");
openfl__$internal_formats_html_HTMLParser.__regexRightMargin = new EReg("rightmargin\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i");
openfl__$internal_formats_html_HTMLParser.__regexSize = new EReg("size\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i");
openfl__$internal_formats_html_HTMLParser.__regexTabStops = new EReg("tabstops\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i");
openfl__$internal_utils_TouchData.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { touch : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl__$internal_utils_TouchData.__pool = new lime_utils_ObjectPool(function() {
	return new openfl__$internal_utils_TouchData();
},function(data) {
	data.reset();
});
openfl_display_Application.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display_BlendMode.ADD = 0;
openfl_display_BlendMode.ALPHA = 1;
openfl_display_BlendMode.DARKEN = 2;
openfl_display_BlendMode.DIFFERENCE = 3;
openfl_display_BlendMode.ERASE = 4;
openfl_display_BlendMode.HARDLIGHT = 5;
openfl_display_BlendMode.INVERT = 6;
openfl_display_BlendMode.LAYER = 7;
openfl_display_BlendMode.LIGHTEN = 8;
openfl_display_BlendMode.MULTIPLY = 9;
openfl_display_BlendMode.NORMAL = 10;
openfl_display_BlendMode.OVERLAY = 11;
openfl_display_BlendMode.SCREEN = 12;
openfl_display_BlendMode.SHADER = 13;
openfl_display_BlendMode.SUBTRACT = 14;
openfl_display_DisplayObjectRenderer.__meta__ = { fields : { __context : { SuppressWarnings : ["checkstyle:Dynamic"]}, __type : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_CairoRenderer.__meta__ = { fields : { cairo : { SuppressWarnings : ["checkstyle:Dynamic"]}, __matrix3 : { SuppressWarnings : ["checkstyle:Dynamic"]}, applyMatrix : { SuppressWarnings : ["checkstyle:Dynamic"]}, __setBlendModeCairo : { SuppressWarnings : ["checkstyle:Dynamic"]}, _ : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_CanvasRenderer.__meta__ = { fields : { context : { SuppressWarnings : ["checkstyle:Dynamic"]}, applySmoothing : { SuppressWarnings : ["checkstyle:Dynamic"]}, setTransform : { SuppressWarnings : ["checkstyle:Dynamic"]}, __setBlendModeContext : { SuppressWarnings : ["checkstyle:Dynamic"]}, _ : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_CapsStyle.NONE = 0;
openfl_display_CapsStyle.ROUND = 1;
openfl_display_CapsStyle.SQUARE = 2;
openfl_display_DOMRenderer.__meta__ = { fields : { element : { SuppressWarnings : ["checkstyle:Dynamic"]}, applyStyle : { SuppressWarnings : ["checkstyle:Dynamic"]}, clearStyle : { SuppressWarnings : ["checkstyle:Dynamic"]}, _ : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_GradientType.LINEAR = 0;
openfl_display_GradientType.RADIAL = 1;
openfl_display_Graphics.__meta__ = { fields : { overrideBlendMode : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
openfl_display_Graphics.maxTextureHeight = null;
openfl_display_Graphics.maxTextureWidth = null;
openfl_display_GraphicsPath.SIN45 = 0.70710678118654752440084436210485;
openfl_display_GraphicsPath.TAN22 = 0.4142135623730950488016887242097;
openfl_display_GraphicsPathWinding.EVEN_ODD = 0;
openfl_display_GraphicsPathWinding.NON_ZERO = 1;
openfl_display_InterpolationMethod.LINEAR_RGB = 0;
openfl_display_InterpolationMethod.RGB = 1;
openfl_display_JointStyle.BEVEL = 0;
openfl_display_JointStyle.MITER = 1;
openfl_display_JointStyle.ROUND = 2;
openfl_display_LineScaleMode.HORIZONTAL = 0;
openfl_display_LineScaleMode.NONE = 1;
openfl_display_LineScaleMode.NORMAL = 2;
openfl_display_LineScaleMode.VERTICAL = 3;
openfl_display_Loader.__meta__ = { fields : { BitmapData_onError : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_LoaderInfo.__meta__ = { statics : { create : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}, fields : { parameters : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_LoaderInfo.__rootURL = typeof(window) != "undefined" ? window.document.URL : "";
openfl_display_OpenGLRenderer.__meta__ = { fields : { gl : { SuppressWarnings : ["checkstyle:Dynamic"]}, __gl : { SuppressWarnings : ["checkstyle:Dynamic"]}, __matrix : { SuppressWarnings : ["checkstyle:Dynamic"]}, __projection : { SuppressWarnings : ["checkstyle:Dynamic"]}, __projectionFlipped : { SuppressWarnings : ["checkstyle:Dynamic"]}, getMatrix : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_OpenGLRenderer.__alphaValue = [1];
openfl_display_OpenGLRenderer.__colorMultipliersValue = [0,0,0,0];
openfl_display_OpenGLRenderer.__colorOffsetsValue = [0,0,0,0];
openfl_display_OpenGLRenderer.__defaultColorMultipliersValue = [1,1,1,1];
openfl_display_OpenGLRenderer.__emptyColorValue = [0,0,0,0];
openfl_display_OpenGLRenderer.__emptyAlphaValue = [1];
openfl_display_OpenGLRenderer.__hasColorTransformValue = [false];
openfl_display_OpenGLRenderer.__scissorRectangle = new openfl_geom_Rectangle();
openfl_display_OpenGLRenderer.__textureSizeValue = [0,0];
openfl_display_PixelSnapping.ALWAYS = 0;
openfl_display_PixelSnapping.AUTO = 1;
openfl_display_PixelSnapping.NEVER = 2;
openfl_display_Preloader.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { onComplete : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_DefaultPreloader.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display_ShaderInput.__meta__ = { fields : { index : { SuppressWarnings : ["checkstyle:Dynamic"]}, name : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
openfl_display_ShaderParameter.__meta__ = { fields : { index : { SuppressWarnings : ["checkstyle:Dynamic"]}, name : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
openfl_display_ShaderParameterType.BOOL = 0;
openfl_display_ShaderParameterType.BOOL2 = 1;
openfl_display_ShaderParameterType.BOOL3 = 2;
openfl_display_ShaderParameterType.BOOL4 = 3;
openfl_display_ShaderParameterType.FLOAT = 4;
openfl_display_ShaderParameterType.FLOAT2 = 5;
openfl_display_ShaderParameterType.FLOAT3 = 6;
openfl_display_ShaderParameterType.FLOAT4 = 7;
openfl_display_ShaderParameterType.INT = 8;
openfl_display_ShaderParameterType.INT2 = 9;
openfl_display_ShaderParameterType.INT3 = 10;
openfl_display_ShaderParameterType.INT4 = 11;
openfl_display_ShaderParameterType.MATRIX2X2 = 12;
openfl_display_ShaderParameterType.MATRIX2X3 = 13;
openfl_display_ShaderParameterType.MATRIX2X4 = 14;
openfl_display_ShaderParameterType.MATRIX3X2 = 15;
openfl_display_ShaderParameterType.MATRIX3X3 = 16;
openfl_display_ShaderParameterType.MATRIX3X4 = 17;
openfl_display_ShaderParameterType.MATRIX4X2 = 18;
openfl_display_ShaderParameterType.MATRIX4X3 = 19;
openfl_display_ShaderParameterType.MATRIX4X4 = 20;
openfl_display_ShaderPrecision.FAST = 0;
openfl_display_ShaderPrecision.FULL = 1;
openfl_display_SpreadMethod.PAD = 0;
openfl_display_SpreadMethod.REFLECT = 1;
openfl_display_SpreadMethod.REPEAT = 2;
openfl_display_Stage.__meta__ = { fields : { __broadcastEvent : { SuppressWarnings : ["checkstyle:Dynamic"]}, __dispatchEvent : { SuppressWarnings : [["checkstyle:Dynamic","checkstyle:LeftCurly"]]}, __dispatchStack : { SuppressWarnings : [["checkstyle:Dynamic","checkstyle:LeftCurly"]]}, __dispatchTarget : { SuppressWarnings : ["checkstyle:Dynamic"]}, __handleError : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_StageAlign.BOTTOM = 0;
openfl_display_StageAlign.BOTTOM_LEFT = 1;
openfl_display_StageAlign.BOTTOM_RIGHT = 2;
openfl_display_StageAlign.LEFT = 3;
openfl_display_StageAlign.RIGHT = 4;
openfl_display_StageAlign.TOP = 5;
openfl_display_StageAlign.TOP_LEFT = 6;
openfl_display_StageAlign.TOP_RIGHT = 7;
openfl_display_StageDisplayState.FULL_SCREEN = 0;
openfl_display_StageDisplayState.FULL_SCREEN_INTERACTIVE = 1;
openfl_display_StageDisplayState.NORMAL = 2;
openfl_display_StageQuality.BEST = 0;
openfl_display_StageQuality.HIGH = 1;
openfl_display_StageQuality.LOW = 2;
openfl_display_StageQuality.MEDIUM = 3;
openfl_display_StageScaleMode.EXACT_FIT = 0;
openfl_display_StageScaleMode.NO_BORDER = 1;
openfl_display_StageScaleMode.NO_SCALE = 2;
openfl_display_StageScaleMode.SHOW_ALL = 3;
openfl_display_TriangleCulling.NEGATIVE = 0;
openfl_display_TriangleCulling.NONE = 1;
openfl_display_TriangleCulling.POSITIVE = 2;
openfl_display_Window.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { _ : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display__$internal_AbstractNoise.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_CairoBitmap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_CairoDisplayObject.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_CairoGraphics.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_CairoTextField.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_CanvasBitmap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_CanvasDisplayObject.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_DrawCommandBuffer.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { o : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display__$internal_DrawCommandBuffer.empty = new openfl_display__$internal_DrawCommandBuffer();
openfl_display__$internal_CanvasGraphics.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, statics : { windingRule : { SuppressWarnings : ["checkstyle:Dynamic"]}, createBitmapFill : { SuppressWarnings : ["checkstyle:Dynamic"]}, createGradientPattern : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display__$internal_CanvasGraphics.SIN45 = 0.70710678118654752440084436210485;
openfl_display__$internal_CanvasGraphics.TAN22 = 0.4142135623730950488016887242097;
openfl_display__$internal_CanvasGraphics.fillCommands = new openfl_display__$internal_DrawCommandBuffer();
openfl_display__$internal_CanvasGraphics.strokeCommands = new openfl_display__$internal_DrawCommandBuffer();
openfl_display__$internal_CanvasShape.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_CanvasTextField.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_Context3DBitmap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_Context3DBuffer.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_Context3DBuffer.MAX_INDEX_BUFFER_LENGTH = 65535;
openfl_display__$internal_Context3DBuffer.MAX_QUADS_PER_INDEX_BUFFER = 10922;
openfl_display__$internal_Context3DBuffer.MAX_QUAD_INDEX_BUFFER_LENGTH = 65532;
openfl_display__$internal_Context3DDisplayObject.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_Context3DGraphics.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_Context3DGraphics.blankBitmapData = new openfl_display_BitmapData(1,1,false,0);
openfl_display__$internal_Context3DGraphics.tempColorTransform = new openfl_geom_ColorTransform(1,1,1,1,0,0,0,0);
openfl_display__$internal_Context3DMaskShader.opaqueBitmapData = new openfl_display_BitmapData(1,1,false,0);
openfl_display__$internal_Context3DShape.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_Context3DTextField.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_DOMBitmap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_DOMDisplayObject.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_DOMShape.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_DOMTextField.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_DOMTextField.__regexColor = new EReg("color=(\"#([^\"]+)\"|'#([^']+)')","i");
openfl_display__$internal_DOMTextField.__regexFace = new EReg("face=(\"([^\"]+)\"|'([^']+)')","i");
openfl_display__$internal_DOMTextField.__regexFont = new EReg("<font ([^>]+)>","gi");
openfl_display__$internal_DOMTextField.__regexCloseFont = new EReg("</font>","gi");
openfl_display__$internal_DOMTextField.__regexSize = new EReg("size=(\"([^\"]+)\"|'([^']+)')","i");
openfl_display__$internal_DrawCommandReader.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { obj : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display__$internal_PerlinNoise.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, statics : { P : { SuppressWarnings : ["checkstyle:ConstantName"]}}};
openfl_display__$internal_PerlinNoise.P = [151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180,151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180];
openfl_display__$internal_SamplerState.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_ShaderBuffer.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { overrideIntValues : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display3D_Context3D.supportsVideoTexture = true;
openfl_display3D_Context3D.__glDepthStencil = -1;
openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy = -1;
openfl_display3D_Context3D.__glMaxViewportDims = -1;
openfl_display3D_Context3D.__glMemoryCurrentAvailable = -1;
openfl_display3D_Context3D.__glMemoryTotalAvailable = -1;
openfl_display3D_Context3D.__glTextureMaxAnisotropy = -1;
openfl_display3D_Context3DBlendFactor.DESTINATION_ALPHA = 0;
openfl_display3D_Context3DBlendFactor.DESTINATION_COLOR = 1;
openfl_display3D_Context3DBlendFactor.ONE = 2;
openfl_display3D_Context3DBlendFactor.ONE_MINUS_DESTINATION_ALPHA = 3;
openfl_display3D_Context3DBlendFactor.ONE_MINUS_DESTINATION_COLOR = 4;
openfl_display3D_Context3DBlendFactor.ONE_MINUS_SOURCE_ALPHA = 5;
openfl_display3D_Context3DBlendFactor.ONE_MINUS_SOURCE_COLOR = 6;
openfl_display3D_Context3DBlendFactor.SOURCE_ALPHA = 7;
openfl_display3D_Context3DBlendFactor.SOURCE_COLOR = 8;
openfl_display3D_Context3DBlendFactor.ZERO = 9;
openfl_display3D_Context3DBufferUsage.DYNAMIC_DRAW = 0;
openfl_display3D_Context3DBufferUsage.STATIC_DRAW = 1;
openfl_display3D_Context3DCompareMode.ALWAYS = 0;
openfl_display3D_Context3DCompareMode.EQUAL = 1;
openfl_display3D_Context3DCompareMode.GREATER = 2;
openfl_display3D_Context3DCompareMode.GREATER_EQUAL = 3;
openfl_display3D_Context3DCompareMode.LESS = 4;
openfl_display3D_Context3DCompareMode.LESS_EQUAL = 5;
openfl_display3D_Context3DCompareMode.NEVER = 6;
openfl_display3D_Context3DCompareMode.NOT_EQUAL = 7;
openfl_display3D_Context3DMipFilter.MIPLINEAR = 0;
openfl_display3D_Context3DMipFilter.MIPNEAREST = 1;
openfl_display3D_Context3DMipFilter.MIPNONE = 2;
openfl_display3D_Context3DProfile.BASELINE = 0;
openfl_display3D_Context3DProfile.BASELINE_CONSTRAINED = 1;
openfl_display3D_Context3DProfile.BASELINE_EXTENDED = 2;
openfl_display3D_Context3DProfile.STANDARD = 3;
openfl_display3D_Context3DProfile.STANDARD_CONSTRAINED = 4;
openfl_display3D_Context3DProfile.STANDARD_EXTENDED = 5;
openfl_display3D_Context3DProgramFormat.AGAL = 0;
openfl_display3D_Context3DProgramFormat.GLSL = 1;
openfl_display3D_Context3DProgramType.FRAGMENT = 0;
openfl_display3D_Context3DProgramType.VERTEX = 1;
openfl_display3D_Context3DRenderMode.AUTO = 0;
openfl_display3D_Context3DRenderMode.SOFTWARE = 1;
openfl_display3D_Context3DStencilAction.DECREMENT_SATURATE = 0;
openfl_display3D_Context3DStencilAction.DECREMENT_WRAP = 1;
openfl_display3D_Context3DStencilAction.INCREMENT_SATURATE = 2;
openfl_display3D_Context3DStencilAction.INCREMENT_WRAP = 3;
openfl_display3D_Context3DStencilAction.INVERT = 4;
openfl_display3D_Context3DStencilAction.KEEP = 5;
openfl_display3D_Context3DStencilAction.SET = 6;
openfl_display3D_Context3DStencilAction.ZERO = 7;
openfl_display3D_Context3DTextureFilter.ANISOTROPIC16X = 0;
openfl_display3D_Context3DTextureFilter.ANISOTROPIC2X = 1;
openfl_display3D_Context3DTextureFilter.ANISOTROPIC4X = 2;
openfl_display3D_Context3DTextureFilter.ANISOTROPIC8X = 3;
openfl_display3D_Context3DTextureFilter.LINEAR = 4;
openfl_display3D_Context3DTextureFilter.NEAREST = 5;
openfl_display3D_Context3DTextureFormat.BGR_PACKED = 0;
openfl_display3D_Context3DTextureFormat.BGRA = 1;
openfl_display3D_Context3DTextureFormat.BGRA_PACKED = 2;
openfl_display3D_Context3DTextureFormat.COMPRESSED = 3;
openfl_display3D_Context3DTextureFormat.COMPRESSED_ALPHA = 4;
openfl_display3D_Context3DTextureFormat.RGBA_HALF_FLOAT = 5;
openfl_display3D_Context3DTriangleFace.BACK = 0;
openfl_display3D_Context3DTriangleFace.FRONT = 1;
openfl_display3D_Context3DTriangleFace.FRONT_AND_BACK = 2;
openfl_display3D_Context3DTriangleFace.NONE = 3;
openfl_display3D_Context3DVertexBufferFormat.BYTES_4 = 0;
openfl_display3D_Context3DVertexBufferFormat.FLOAT_1 = 1;
openfl_display3D_Context3DVertexBufferFormat.FLOAT_2 = 2;
openfl_display3D_Context3DVertexBufferFormat.FLOAT_3 = 3;
openfl_display3D_Context3DVertexBufferFormat.FLOAT_4 = 4;
openfl_display3D_Context3DWrapMode.CLAMP = 0;
openfl_display3D_Context3DWrapMode.CLAMP_U_REPEAT_V = 1;
openfl_display3D_Context3DWrapMode.REPEAT = 2;
openfl_display3D_Context3DWrapMode.REPEAT_U_CLAMP_V = 3;
openfl_display3D_Uniform.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display3D_UniformMap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display3D__$internal_Context3DState.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display3D__$internal_agal_AGALConverter.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display3D__$internal_agal_AGALConverter.limitedProfile = true;
openfl_display3D__$internal_agal__$AGALConverter_DestRegister.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display3D__$internal_agal_RegisterMap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display3D__$internal_agal__$AGALConverter_SamplerRegister.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display3D__$internal_agal__$AGALConverter_SourceRegister.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display3D__$internal_atf_ATFReader.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display3D_textures_TextureBase.__meta__ = { fields : { __textureContext : { SuppressWarnings : ["checkstyle:Dynamic"]}, __getGLFramebuffer : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display3D_textures_TextureBase.__supportsBGRA = null;
openfl_display3D_textures_Texture.__lowMemoryMode = false;
openfl_errors_Error.DEFAULT_TO_STRING = "Error";
openfl_events_Event.ACTIVATE = "activate";
openfl_events_Event.ADDED = "added";
openfl_events_Event.ADDED_TO_STAGE = "addedToStage";
openfl_events_Event.CANCEL = "cancel";
openfl_events_Event.CHANGE = "change";
openfl_events_Event.CLEAR = "clear";
openfl_events_Event.CLOSE = "close";
openfl_events_Event.COMPLETE = "complete";
openfl_events_Event.CONNECT = "connect";
openfl_events_Event.CONTEXT3D_CREATE = "context3DCreate";
openfl_events_Event.COPY = "copy";
openfl_events_Event.CUT = "cut";
openfl_events_Event.DEACTIVATE = "deactivate";
openfl_events_Event.ENTER_FRAME = "enterFrame";
openfl_events_Event.EXIT_FRAME = "exitFrame";
openfl_events_Event.FRAME_CONSTRUCTED = "frameConstructed";
openfl_events_Event.FRAME_LABEL = "frameLabel";
openfl_events_Event.FULLSCREEN = "fullScreen";
openfl_events_Event.ID3 = "id3";
openfl_events_Event.INIT = "init";
openfl_events_Event.MOUSE_LEAVE = "mouseLeave";
openfl_events_Event.OPEN = "open";
openfl_events_Event.PASTE = "paste";
openfl_events_Event.REMOVED = "removed";
openfl_events_Event.REMOVED_FROM_STAGE = "removedFromStage";
openfl_events_Event.RENDER = "render";
openfl_events_Event.RESIZE = "resize";
openfl_events_Event.SCROLL = "scroll";
openfl_events_Event.SELECT = "select";
openfl_events_Event.SELECT_ALL = "selectAll";
openfl_events_Event.SOUND_COMPLETE = "soundComplete";
openfl_events_Event.TAB_CHILDREN_CHANGE = "tabChildrenChange";
openfl_events_Event.TAB_ENABLED_CHANGE = "tabEnabledChange";
openfl_events_Event.TAB_INDEX_CHANGE = "tabIndexChange";
openfl_events_Event.TEXTURE_READY = "textureReady";
openfl_events_Event.UNLOAD = "unload";
openfl_events_AccelerometerEvent.UPDATE = "update";
openfl_events_ActivityEvent.ACTIVITY = "activity";
openfl_events_TextEvent.LINK = "link";
openfl_events_TextEvent.TEXT_INPUT = "textInput";
openfl_events_ErrorEvent.ERROR = "error";
openfl_events__$EventDispatcher_DispatchIterator.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_events__$EventDispatcher_Listener.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_events_FocusEvent.FOCUS_IN = "focusIn";
openfl_events_FocusEvent.FOCUS_OUT = "focusOut";
openfl_events_FocusEvent.KEY_FOCUS_CHANGE = "keyFocusChange";
openfl_events_FocusEvent.MOUSE_FOCUS_CHANGE = "mouseFocusChange";
openfl_events_FullScreenEvent.FULL_SCREEN = "fullScreen";
openfl_events_FullScreenEvent.FULL_SCREEN_INTERACTIVE_ACCEPTED = "fullScreenInteractiveAccepted";
openfl_events_GameInputEvent.DEVICE_ADDED = "deviceAdded";
openfl_events_GameInputEvent.DEVICE_REMOVED = "deviceRemoved";
openfl_events_GameInputEvent.DEVICE_UNUSABLE = "deviceUnusable";
openfl_events_HTTPStatusEvent.HTTP_RESPONSE_STATUS = "httpResponseStatus";
openfl_events_HTTPStatusEvent.HTTP_STATUS = "httpStatus";
openfl_events_IOErrorEvent.IO_ERROR = "ioError";
openfl_events_KeyboardEvent.KEY_DOWN = "keyDown";
openfl_events_KeyboardEvent.KEY_UP = "keyUp";
openfl_events_MouseEvent.CLICK = "click";
openfl_events_MouseEvent.DOUBLE_CLICK = "doubleClick";
openfl_events_MouseEvent.MIDDLE_CLICK = "middleClick";
openfl_events_MouseEvent.MIDDLE_MOUSE_DOWN = "middleMouseDown";
openfl_events_MouseEvent.MIDDLE_MOUSE_UP = "middleMouseUp";
openfl_events_MouseEvent.MOUSE_DOWN = "mouseDown";
openfl_events_MouseEvent.MOUSE_MOVE = "mouseMove";
openfl_events_MouseEvent.MOUSE_OUT = "mouseOut";
openfl_events_MouseEvent.MOUSE_OVER = "mouseOver";
openfl_events_MouseEvent.MOUSE_UP = "mouseUp";
openfl_events_MouseEvent.MOUSE_WHEEL = "mouseWheel";
openfl_events_MouseEvent.RELEASE_OUTSIDE = "releaseOutside";
openfl_events_MouseEvent.RIGHT_CLICK = "rightClick";
openfl_events_MouseEvent.RIGHT_MOUSE_DOWN = "rightMouseDown";
openfl_events_MouseEvent.RIGHT_MOUSE_UP = "rightMouseUp";
openfl_events_MouseEvent.ROLL_OUT = "rollOut";
openfl_events_MouseEvent.ROLL_OVER = "rollOver";
openfl_events_NetStatusEvent.NET_STATUS = "netStatus";
openfl_events_ProgressEvent.PROGRESS = "progress";
openfl_events_ProgressEvent.SOCKET_DATA = "socketData";
openfl_events_RenderEvent.CLEAR_DOM = "clearDOM";
openfl_events_RenderEvent.RENDER_CAIRO = "renderCairo";
openfl_events_RenderEvent.RENDER_CANVAS = "renderCanvas";
openfl_events_RenderEvent.RENDER_DOM = "renderDOM";
openfl_events_RenderEvent.RENDER_OPENGL = "renderOpenGL";
openfl_events_SecurityErrorEvent.SECURITY_ERROR = "securityError";
openfl_events_TouchEvent.__meta__ = { fields : { delta : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
openfl_events_TouchEvent.TOUCH_BEGIN = "touchBegin";
openfl_events_TouchEvent.TOUCH_END = "touchEnd";
openfl_events_TouchEvent.TOUCH_MOVE = "touchMove";
openfl_events_TouchEvent.TOUCH_OUT = "touchOut";
openfl_events_TouchEvent.TOUCH_OVER = "touchOver";
openfl_events_TouchEvent.TOUCH_ROLL_OUT = "touchRollOut";
openfl_events_TouchEvent.TOUCH_ROLL_OVER = "touchRollOver";
openfl_events_TouchEvent.TOUCH_TAP = "touchTap";
openfl_events_UncaughtErrorEvent.UNCAUGHT_ERROR = "uncaughtError";
openfl_geom_Matrix3D.__meta__ = { statics : { create2D : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, createABCD : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, createOrtho : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
openfl_geom_Orientation3D.AXIS_ANGLE = 0;
openfl_geom_Orientation3D.EULER_ANGLES = 1;
openfl_geom_Orientation3D.QUATERNION = 2;
openfl_media_SoundTransform.__meta__ = { fields : { clone : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
openfl_media_SoundMixer.MAX_ACTIVE_CHANNELS = 32;
openfl_media_SoundMixer.__soundChannels = [];
openfl_media_SoundMixer.__soundTransform = new openfl_media_SoundTransform();
openfl_net_NetConnection.__meta__ = { statics : { CONNECT_SUCCESS : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
openfl_net_NetConnection.CONNECT_SUCCESS = "NetConnection.Connect.Success";
openfl_net_NetStream.__meta__ = { fields : { audioCodec : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, decodedFrames : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, speed : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, requestVideoStatus : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
openfl_net_SharedObject.defaultObjectEncoding = 10;
openfl_net_SharedObjectFlushStatus.FLUSHED = 0;
openfl_net_SharedObjectFlushStatus.PENDING = 1;
openfl_net_URLLoaderDataFormat.BINARY = 0;
openfl_net_URLLoaderDataFormat.TEXT = 1;
openfl_net_URLLoaderDataFormat.VARIABLES = 2;
openfl_net_URLRequestDefaults.followRedirects = true;
openfl_net_URLRequestDefaults.idleTimeout = 0;
openfl_net_URLRequestDefaults.manageCookies = false;
openfl_sensors_Accelerometer.currentX = 0.0;
openfl_sensors_Accelerometer.currentY = 1.0;
openfl_sensors_Accelerometer.currentZ = 0.0;
openfl_sensors_Accelerometer.defaultInterval = 34;
openfl_sensors_Accelerometer.initialized = false;
openfl_sensors_Accelerometer.supported = false;
openfl_system_ApplicationDomain.currentDomain = new openfl_system_ApplicationDomain(null);
openfl_system_SecurityDomain.__meta__ = { obj : { SuppressWarnings : ["checkstyle:UnnecessaryConstructor"]}};
openfl_system_SecurityDomain.currentDomain = new openfl_system_SecurityDomain();
openfl_system_System.useCodePage = false;
openfl_text_AntiAliasType.ADVANCED = 0;
openfl_text_AntiAliasType.NORMAL = 1;
openfl_text_FontStyle.BOLD = 0;
openfl_text_FontStyle.BOLD_ITALIC = 1;
openfl_text_FontStyle.ITALIC = 2;
openfl_text_FontStyle.REGULAR = 3;
openfl_text_FontType.DEVICE = 0;
openfl_text_FontType.EMBEDDED = 1;
openfl_text_FontType.EMBEDDED_CFF = 2;
openfl_text_GridFitType.NONE = 0;
openfl_text_GridFitType.PIXEL = 1;
openfl_text_GridFitType.SUBPIXEL = 2;
openfl_text_TextField.__missingFontWarning = new haxe_ds_StringMap();
openfl_text_TextFieldAutoSize.CENTER = 0;
openfl_text_TextFieldAutoSize.LEFT = 1;
openfl_text_TextFieldAutoSize.NONE = 2;
openfl_text_TextFieldAutoSize.RIGHT = 3;
openfl_text_TextFieldType.DYNAMIC = 0;
openfl_text_TextFieldType.INPUT = 1;
openfl_text_TextFormat.__meta__ = { fields : { clone : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
openfl_text_TextFormatAlign.CENTER = 0;
openfl_text_TextFormatAlign.END = 1;
openfl_text_TextFormatAlign.JUSTIFY = 2;
openfl_text_TextFormatAlign.LEFT = 3;
openfl_text_TextFormatAlign.RIGHT = 4;
openfl_text_TextFormatAlign.START = 5;
openfl_text__$internal_GlyphPosition.__meta__ = { obj : { SuppressWarnings : [["checkstyle:FieldDocComment","checkstyle:Dynamic"]]}};
openfl_text__$internal_TextEngine.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { __cairoFont : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_text__$internal_TextEngine.GUTTER = 2;
openfl_text__$internal_TextEngine.UTF8_TAB = 9;
openfl_text__$internal_TextEngine.UTF8_ENDLINE = 10;
openfl_text__$internal_TextEngine.UTF8_SPACE = 32;
openfl_text__$internal_TextEngine.UTF8_HYPHEN = 45;
openfl_text__$internal_TextEngine.__defaultFonts = new haxe_ds_StringMap();
openfl_text__$internal_TextLayout.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { glyphs : { SuppressWarnings : ["checkstyle:Dynamic"]}, __handle : { SuppressWarnings : ["checkstyle:Dynamic"]}, __hbBuffer : { SuppressWarnings : ["checkstyle:Dynamic"]}, __hbFont : { SuppressWarnings : ["checkstyle:Dynamic"]}, get_glyphs : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_text__$internal_TextLayout.FT_LOAD_DEFAULT = 0;
openfl_text__$internal_TextLayout.FT_LOAD_NO_SCALE = 1;
openfl_text__$internal_TextLayout.FT_LOAD_NO_HINTING = 2;
openfl_text__$internal_TextLayout.FT_LOAD_RENDER = 4;
openfl_text__$internal_TextLayout.FT_LOAD_NO_BITMAP = 8;
openfl_text__$internal_TextLayout.FT_LOAD_VERTICAL_LAYOUT = 16;
openfl_text__$internal_TextLayout.FT_LOAD_FORCE_AUTOHINT = 32;
openfl_text__$internal_TextLayout.FT_LOAD_CROP_BITMAP = 64;
openfl_text__$internal_TextLayout.FT_LOAD_PEDANTIC = 128;
openfl_text__$internal_TextLayout.FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH = 256;
openfl_text__$internal_TextLayout.FT_LOAD_NO_RECURSE = 512;
openfl_text__$internal_TextLayout.FT_LOAD_IGNORE_TRANSFORM = 1024;
openfl_text__$internal_TextLayout.FT_LOAD_MONOCHROME = 2048;
openfl_text__$internal_TextLayout.FT_LOAD_LINEAR_DESIGN = 4096;
openfl_text__$internal_TextLayout.FT_LOAD_NO_AUTOHINT = 8192;
openfl_text__$internal_TextLayout.FT_LOAD_COLOR = 16384;
openfl_text__$internal_TextLayout.FT_LOAD_COMPUTE_METRICS = 32768;
openfl_text__$internal_TextLayout.FT_LOAD_BITMAP_METRICS_ONLY = 65536;
openfl_text__$internal_TextLayout.FT_LOAD_TARGET_NORMAL = 0;
openfl_text__$internal_TextLayout.FT_LOAD_TARGET_LIGHT = 0;
openfl_text__$internal_TextDirection.INVALID = 0;
openfl_text__$internal_TextDirection.LEFT_TO_RIGHT = 4;
openfl_text__$internal_TextDirection.RIGHT_TO_LEFT = 5;
openfl_text__$internal_TextDirection.TOP_TO_BOTTOM = 6;
openfl_text__$internal_TextDirection.BOTTOM_TO_TOP = 7;
openfl_text__$internal_TextScript.COMMON = "Zyyy";
openfl_text__$internal_TextScript.INHERITED = "Zinh";
openfl_text__$internal_TextScript.UNKNOWN = "Zzzz";
openfl_text__$internal_TextScript.ARABIC = "Arab";
openfl_text__$internal_TextScript.ARMENIAN = "Armn";
openfl_text__$internal_TextScript.BENGALI = "Beng";
openfl_text__$internal_TextScript.CYRILLIC = "Cyrl";
openfl_text__$internal_TextScript.DEVANAGARI = "Deva";
openfl_text__$internal_TextScript.GEORGIAN = "Geor";
openfl_text__$internal_TextScript.GREEK = "Grek";
openfl_text__$internal_TextScript.GUJARATI = "Gujr";
openfl_text__$internal_TextScript.GURMUKHI = "Guru";
openfl_text__$internal_TextScript.HANGUL = "Hang";
openfl_text__$internal_TextScript.HAN = "Hani";
openfl_text__$internal_TextScript.HEBREW = "Hebr";
openfl_text__$internal_TextScript.HIRAGANA = "Hira";
openfl_text__$internal_TextScript.KANNADA = "Knda";
openfl_text__$internal_TextScript.KATAKANA = "Kana";
openfl_text__$internal_TextScript.LAO = "Laoo";
openfl_text__$internal_TextScript.LATIN = "Latn";
openfl_text__$internal_TextScript.MALAYALAM = "Mlym";
openfl_text__$internal_TextScript.ORIYA = "Orya";
openfl_text__$internal_TextScript.TAMIL = "Taml";
openfl_text__$internal_TextScript.TELUGA = "Telu";
openfl_text__$internal_TextScript.THAI = "Thai";
openfl_text__$internal_TextScript.TIBETAN = "Tibt";
openfl_text__$internal_TextScript.BOPOMOFO = "Bopo";
openfl_text__$internal_TextScript.BRAILLE = "Brai";
openfl_text__$internal_TextScript.CANADIAN_SYLLABICS = "Cans";
openfl_text__$internal_TextScript.CHEROKEE = "Cher";
openfl_text__$internal_TextScript.ETHIOPIC = "Ethi";
openfl_text__$internal_TextScript.KHMER = "Khmr";
openfl_text__$internal_TextScript.MONGOLIAN = "Mong";
openfl_text__$internal_TextScript.MYANMAR = "Mymr";
openfl_text__$internal_TextScript.OGHAM = "Ogam";
openfl_text__$internal_TextScript.RUNIC = "Runr";
openfl_text__$internal_TextScript.SINHALA = "Sinh";
openfl_text__$internal_TextScript.SYRIAC = "Syrc";
openfl_text__$internal_TextScript.THAANA = "Thaa";
openfl_text__$internal_TextScript.YI = "Yiii";
openfl_text__$internal_TextScript.DESERET = "Dsrt";
openfl_text__$internal_TextScript.GOTHIC = "Goth";
openfl_text__$internal_TextScript.OLD_ITALIC = "Ital";
openfl_text__$internal_TextScript.BUHID = "Buhd";
openfl_text__$internal_TextScript.HANUNOO = "Hano";
openfl_text__$internal_TextScript.TAGALOG = "Tglg";
openfl_text__$internal_TextScript.TAGBANWA = "Tagb";
openfl_text__$internal_TextScript.CYPRIOT = "Cprt";
openfl_text__$internal_TextScript.LIMBU = "Limb";
openfl_text__$internal_TextScript.LINEAR_B = "Linb";
openfl_text__$internal_TextScript.OSMANYA = "Osma";
openfl_text__$internal_TextScript.SHAVIAN = "Shaw";
openfl_text__$internal_TextScript.TAI_LE = "Tale";
openfl_text__$internal_TextScript.UGARITIC = "Ugar";
openfl_text__$internal_TextScript.BUGINESE = "Bugi";
openfl_text__$internal_TextScript.COPTIC = "Copt";
openfl_text__$internal_TextScript.GLAGOLITIC = "Glag";
openfl_text__$internal_TextScript.KHAROSHTHI = "Khar";
openfl_text__$internal_TextScript.NEW_TAI_LUE = "Talu";
openfl_text__$internal_TextScript.OLD_PERSIAN = "Xpeo";
openfl_text__$internal_TextScript.SYLOTI_NAGRI = "Sylo";
openfl_text__$internal_TextScript.TIFINAGH = "Tfng";
openfl_text__$internal_TextScript.BALINESE = "Bali";
openfl_text__$internal_TextScript.CUNEIFORM = "Xsux";
openfl_text__$internal_TextScript.NKO = "Nkoo";
openfl_text__$internal_TextScript.PHAGS_PA = "Phag";
openfl_text__$internal_TextScript.PHOENICIAN = "Phnx";
openfl_text__$internal_TextScript.CARIAN = "Cari";
openfl_text__$internal_TextScript.CHAM = "Cham";
openfl_text__$internal_TextScript.KAYAH_LI = "Kali";
openfl_text__$internal_TextScript.LEPCHA = "Lepc";
openfl_text__$internal_TextScript.LYCIAN = "Lyci";
openfl_text__$internal_TextScript.LYDIAN = "Lydi";
openfl_text__$internal_TextScript.OL_CHIKI = "Olck";
openfl_text__$internal_TextScript.REJANG = "Rjng";
openfl_text__$internal_TextScript.SAURASHTRA = "Saur";
openfl_text__$internal_TextScript.SUNDANESE = "Sund";
openfl_text__$internal_TextScript.VAI = "Vaii";
openfl_text__$internal_TextScript.AVESTAN = "Avst";
openfl_text__$internal_TextScript.BAMUM = "Bamu";
openfl_text__$internal_TextScript.EGYPTIAN_HIEROGLYPHS = "Egyp";
openfl_text__$internal_TextScript.IMPERIAL_ARAMAIC = "Armi";
openfl_text__$internal_TextScript.INSCRIPTIONAL_PAHLAVI = "Phli";
openfl_text__$internal_TextScript.INSCRIPTIONAL_PARTHIAN = "Prti";
openfl_text__$internal_TextScript.JAVANESE = "Java";
openfl_text__$internal_TextScript.KAITHI = "Kthi";
openfl_text__$internal_TextScript.LISU = "Lisu";
openfl_text__$internal_TextScript.MEETEI_MAYEK = "Mtei";
openfl_text__$internal_TextScript.OLD_SOUTH_ARABIAN = "Sarb";
openfl_text__$internal_TextScript.OLD_TURKIC = "Orkh";
openfl_text__$internal_TextScript.SAMARITAN = "Samr";
openfl_text__$internal_TextScript.TAI_THAM = "Lana";
openfl_text__$internal_TextScript.TAI_VIET = "Tavt";
openfl_text__$internal_TextScript.BATAK = "Batk";
openfl_text__$internal_TextScript.BRAHMI = "Brah";
openfl_text__$internal_TextScript.MANDAIC = "Mand";
openfl_text__$internal_TextScript.CHAKMA = "Cakm";
openfl_text__$internal_TextScript.MEROITIC_CURSIVE = "Merc";
openfl_text__$internal_TextScript.MEROITIC_HIEROGLYPHS = "Mero";
openfl_text__$internal_TextScript.MIAO = "Plrd";
openfl_text__$internal_TextScript.SHARADA = "Shrd";
openfl_text__$internal_TextScript.SORA_SOMPENG = "Sora";
openfl_text__$internal_TextScript.TAKRI = "Takr";
openfl_text__$internal_TextScript.BASSA_VAH = "Bass";
openfl_text__$internal_TextScript.CAUCASIAN_ALBANIAN = "Aghb";
openfl_text__$internal_TextScript.DUPLOYAN = "Dupl";
openfl_text__$internal_TextScript.ELBASAN = "Elba";
openfl_text__$internal_TextScript.GRANTHA = "Gran";
openfl_text__$internal_TextScript.KHOJKI = "Khoj";
openfl_text__$internal_TextScript.KHUDAWADI = "Sind";
openfl_text__$internal_TextScript.LINEAR_A = "Lina";
openfl_text__$internal_TextScript.MAHAJANI = "Mahj";
openfl_text__$internal_TextScript.MANICHAEAN = "Mani";
openfl_text__$internal_TextScript.MENDE_KIKAKUI = "Mend";
openfl_text__$internal_TextScript.MODI = "Modi";
openfl_text__$internal_TextScript.MRO = "Mroo";
openfl_text__$internal_TextScript.NABATAEAN = "Nbat";
openfl_text__$internal_TextScript.OLD_NORTH_ARABIAN = "Narb";
openfl_text__$internal_TextScript.OLD_PERMIC = "Perm";
openfl_text__$internal_TextScript.PAHAWH_HMONG = "Hmng";
openfl_text__$internal_TextScript.PALMYRENE = "Palm";
openfl_text__$internal_TextScript.PAU_CIN_HAU = "Pauc";
openfl_text__$internal_TextScript.PSALTER_PAHLAVI = "Phlp";
openfl_text__$internal_TextScript.SIDDHAM = "Sidd";
openfl_text__$internal_TextScript.TIRHUTA = "Tirh";
openfl_text__$internal_TextScript.WARANG_CITI = "Wara";
openfl_text__$internal_TextLayoutGroup.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_ui_GameInput.__meta__ = { fields : { addEventListener : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_ui_GameInput.isSupported = true;
openfl_ui_GameInput.numDevices = 0;
openfl_ui_GameInput.__deviceList = [];
openfl_ui_GameInput.__instances = [];
openfl_ui_GameInput.__devices = new haxe_ds_ObjectMap();
openfl_ui_GameInputDevice.MAX_BUFFER_SIZE = 32000;
openfl_ui_Keyboard.__meta__ = { statics : { BREAK : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, NUMLOCK : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
openfl_ui_Keyboard.NUMBER_0 = 48;
openfl_ui_Keyboard.NUMBER_1 = 49;
openfl_ui_Keyboard.NUMBER_2 = 50;
openfl_ui_Keyboard.NUMBER_3 = 51;
openfl_ui_Keyboard.NUMBER_4 = 52;
openfl_ui_Keyboard.NUMBER_5 = 53;
openfl_ui_Keyboard.NUMBER_6 = 54;
openfl_ui_Keyboard.NUMBER_7 = 55;
openfl_ui_Keyboard.NUMBER_8 = 56;
openfl_ui_Keyboard.NUMBER_9 = 57;
openfl_ui_Keyboard.A = 65;
openfl_ui_Keyboard.B = 66;
openfl_ui_Keyboard.C = 67;
openfl_ui_Keyboard.D = 68;
openfl_ui_Keyboard.E = 69;
openfl_ui_Keyboard.F = 70;
openfl_ui_Keyboard.G = 71;
openfl_ui_Keyboard.H = 72;
openfl_ui_Keyboard.I = 73;
openfl_ui_Keyboard.J = 74;
openfl_ui_Keyboard.K = 75;
openfl_ui_Keyboard.L = 76;
openfl_ui_Keyboard.M = 77;
openfl_ui_Keyboard.N = 78;
openfl_ui_Keyboard.O = 79;
openfl_ui_Keyboard.P = 80;
openfl_ui_Keyboard.Q = 81;
openfl_ui_Keyboard.R = 82;
openfl_ui_Keyboard.S = 83;
openfl_ui_Keyboard.T = 84;
openfl_ui_Keyboard.U = 85;
openfl_ui_Keyboard.V = 86;
openfl_ui_Keyboard.W = 87;
openfl_ui_Keyboard.X = 88;
openfl_ui_Keyboard.Y = 89;
openfl_ui_Keyboard.Z = 90;
openfl_ui_Keyboard.NUMPAD_0 = 96;
openfl_ui_Keyboard.NUMPAD_1 = 97;
openfl_ui_Keyboard.NUMPAD_2 = 98;
openfl_ui_Keyboard.NUMPAD_3 = 99;
openfl_ui_Keyboard.NUMPAD_4 = 100;
openfl_ui_Keyboard.NUMPAD_5 = 101;
openfl_ui_Keyboard.NUMPAD_6 = 102;
openfl_ui_Keyboard.NUMPAD_7 = 103;
openfl_ui_Keyboard.NUMPAD_8 = 104;
openfl_ui_Keyboard.NUMPAD_9 = 105;
openfl_ui_Keyboard.NUMPAD_MULTIPLY = 106;
openfl_ui_Keyboard.NUMPAD_ADD = 107;
openfl_ui_Keyboard.NUMPAD_ENTER = 108;
openfl_ui_Keyboard.NUMPAD_SUBTRACT = 109;
openfl_ui_Keyboard.NUMPAD_DECIMAL = 110;
openfl_ui_Keyboard.NUMPAD_DIVIDE = 111;
openfl_ui_Keyboard.F1 = 112;
openfl_ui_Keyboard.F2 = 113;
openfl_ui_Keyboard.F3 = 114;
openfl_ui_Keyboard.F4 = 115;
openfl_ui_Keyboard.F5 = 116;
openfl_ui_Keyboard.F6 = 117;
openfl_ui_Keyboard.F7 = 118;
openfl_ui_Keyboard.F8 = 119;
openfl_ui_Keyboard.F9 = 120;
openfl_ui_Keyboard.F10 = 121;
openfl_ui_Keyboard.F11 = 122;
openfl_ui_Keyboard.F12 = 123;
openfl_ui_Keyboard.F13 = 124;
openfl_ui_Keyboard.F14 = 125;
openfl_ui_Keyboard.F15 = 126;
openfl_ui_Keyboard.BACKSPACE = 8;
openfl_ui_Keyboard.TAB = 9;
openfl_ui_Keyboard.ALTERNATE = 18;
openfl_ui_Keyboard.ENTER = 13;
openfl_ui_Keyboard.COMMAND = 15;
openfl_ui_Keyboard.SHIFT = 16;
openfl_ui_Keyboard.CONTROL = 17;
openfl_ui_Keyboard.BREAK = 19;
openfl_ui_Keyboard.CAPS_LOCK = 20;
openfl_ui_Keyboard.NUMPAD = 21;
openfl_ui_Keyboard.ESCAPE = 27;
openfl_ui_Keyboard.SPACE = 32;
openfl_ui_Keyboard.PAGE_UP = 33;
openfl_ui_Keyboard.PAGE_DOWN = 34;
openfl_ui_Keyboard.END = 35;
openfl_ui_Keyboard.HOME = 36;
openfl_ui_Keyboard.LEFT = 37;
openfl_ui_Keyboard.RIGHT = 39;
openfl_ui_Keyboard.UP = 38;
openfl_ui_Keyboard.DOWN = 40;
openfl_ui_Keyboard.INSERT = 45;
openfl_ui_Keyboard.DELETE = 46;
openfl_ui_Keyboard.NUMLOCK = 144;
openfl_ui_Keyboard.SEMICOLON = 186;
openfl_ui_Keyboard.EQUAL = 187;
openfl_ui_Keyboard.COMMA = 188;
openfl_ui_Keyboard.MINUS = 189;
openfl_ui_Keyboard.PERIOD = 190;
openfl_ui_Keyboard.SLASH = 191;
openfl_ui_Keyboard.BACKQUOTE = 192;
openfl_ui_Keyboard.LEFTBRACKET = 219;
openfl_ui_Keyboard.BACKSLASH = 220;
openfl_ui_Keyboard.RIGHTBRACKET = 221;
openfl_ui_Keyboard.QUOTE = 222;
openfl_ui_Mouse.supportsCursor = true;
openfl_ui_Mouse.supportsNativeCursor = true;
openfl_ui_Mouse.__cursor = "auto";
openfl_ui_MouseCursor.ARROW = "arrow";
openfl_ui_MouseCursor.AUTO = "auto";
openfl_ui_MouseCursor.BUTTON = "button";
openfl_ui_MouseCursor.HAND = "hand";
openfl_ui_MouseCursor.IBEAM = "ibeam";
openfl_ui_MouseCursor.__CROSSHAIR = "crosshair";
openfl_ui_MouseCursor.__CUSTOM = "custom";
openfl_ui_MouseCursor.__MOVE = "move";
openfl_ui_MouseCursor.__RESIZE_NESW = "resize_nesw";
openfl_ui_MouseCursor.__RESIZE_NS = "resize_ns";
openfl_ui_MouseCursor.__RESIZE_NWSE = "resize_nwse";
openfl_ui_MouseCursor.__RESIZE_WE = "resize_we";
openfl_ui_MouseCursor.__WAIT = "wait";
openfl_ui_MouseCursor.__WAIT_ARROW = "waitarrow";
openfl_ui_MultitouchInputMode.GESTURE = 0;
openfl_ui_MultitouchInputMode.NONE = 1;
openfl_ui_MultitouchInputMode.TOUCH_POINT = 2;
openfl_utils_AGALMiniAssembler.__meta__ = { obj : { SuppressWarnings : [["checkstyle:ConstantName","checkstyle:FieldDocComment"]]}};
openfl_utils_AGALMiniAssembler.OPMAP = new haxe_ds_StringMap();
openfl_utils_AGALMiniAssembler.REGMAP = new haxe_ds_StringMap();
openfl_utils_AGALMiniAssembler.SAMPLEMAP = new haxe_ds_StringMap();
openfl_utils_AGALMiniAssembler.MAX_NESTING = 4;
openfl_utils_AGALMiniAssembler.MAX_OPCODES = 4096;
openfl_utils_AGALMiniAssembler.FRAGMENT = "fragment";
openfl_utils_AGALMiniAssembler.VERTEX = "vertex";
openfl_utils_AGALMiniAssembler.SAMPLER_TYPE_SHIFT = 8;
openfl_utils_AGALMiniAssembler.SAMPLER_DIM_SHIFT = 12;
openfl_utils_AGALMiniAssembler.SAMPLER_SPECIAL_SHIFT = 16;
openfl_utils_AGALMiniAssembler.SAMPLER_REPEAT_SHIFT = 20;
openfl_utils_AGALMiniAssembler.SAMPLER_MIPMAP_SHIFT = 24;
openfl_utils_AGALMiniAssembler.SAMPLER_FILTER_SHIFT = 28;
openfl_utils_AGALMiniAssembler.REG_WRITE = 1;
openfl_utils_AGALMiniAssembler.REG_READ = 2;
openfl_utils_AGALMiniAssembler.REG_FRAG = 32;
openfl_utils_AGALMiniAssembler.REG_VERT = 64;
openfl_utils_AGALMiniAssembler.OP_SCALAR = 1;
openfl_utils_AGALMiniAssembler.OP_SPECIAL_TEX = 8;
openfl_utils_AGALMiniAssembler.OP_SPECIAL_MATRIX = 16;
openfl_utils_AGALMiniAssembler.OP_FRAG_ONLY = 32;
openfl_utils_AGALMiniAssembler.OP_VERT_ONLY = 64;
openfl_utils_AGALMiniAssembler.OP_NO_DEST = 128;
openfl_utils_AGALMiniAssembler.OP_VERSION2 = 256;
openfl_utils_AGALMiniAssembler.OP_INCNEST = 512;
openfl_utils_AGALMiniAssembler.OP_DECNEST = 1024;
openfl_utils_AGALMiniAssembler.MOV = "mov";
openfl_utils_AGALMiniAssembler.ADD = "add";
openfl_utils_AGALMiniAssembler.SUB = "sub";
openfl_utils_AGALMiniAssembler.MUL = "mul";
openfl_utils_AGALMiniAssembler.DIV = "div";
openfl_utils_AGALMiniAssembler.RCP = "rcp";
openfl_utils_AGALMiniAssembler.MIN = "min";
openfl_utils_AGALMiniAssembler.MAX = "max";
openfl_utils_AGALMiniAssembler.FRC = "frc";
openfl_utils_AGALMiniAssembler.SQT = "sqt";
openfl_utils_AGALMiniAssembler.RSQ = "rsq";
openfl_utils_AGALMiniAssembler.POW = "pow";
openfl_utils_AGALMiniAssembler.LOG = "log";
openfl_utils_AGALMiniAssembler.EXP = "exp";
openfl_utils_AGALMiniAssembler.NRM = "nrm";
openfl_utils_AGALMiniAssembler.SIN = "sin";
openfl_utils_AGALMiniAssembler.COS = "cos";
openfl_utils_AGALMiniAssembler.CRS = "crs";
openfl_utils_AGALMiniAssembler.DP3 = "dp3";
openfl_utils_AGALMiniAssembler.DP4 = "dp4";
openfl_utils_AGALMiniAssembler.ABS = "abs";
openfl_utils_AGALMiniAssembler.NEG = "neg";
openfl_utils_AGALMiniAssembler.SAT = "sat";
openfl_utils_AGALMiniAssembler.M33 = "m33";
openfl_utils_AGALMiniAssembler.M44 = "m44";
openfl_utils_AGALMiniAssembler.M34 = "m34";
openfl_utils_AGALMiniAssembler.DDX = "ddx";
openfl_utils_AGALMiniAssembler.DDY = "ddy";
openfl_utils_AGALMiniAssembler.IFE = "ife";
openfl_utils_AGALMiniAssembler.INE = "ine";
openfl_utils_AGALMiniAssembler.IFG = "ifg";
openfl_utils_AGALMiniAssembler.IFL = "ifl";
openfl_utils_AGALMiniAssembler.IEG = "ieg";
openfl_utils_AGALMiniAssembler.IEL = "iel";
openfl_utils_AGALMiniAssembler.ELS = "els";
openfl_utils_AGALMiniAssembler.EIF = "eif";
openfl_utils_AGALMiniAssembler.TED = "ted";
openfl_utils_AGALMiniAssembler.KIL = "kil";
openfl_utils_AGALMiniAssembler.TEX = "tex";
openfl_utils_AGALMiniAssembler.SGE = "sge";
openfl_utils_AGALMiniAssembler.SLT = "slt";
openfl_utils_AGALMiniAssembler.SGN = "sgn";
openfl_utils_AGALMiniAssembler.SEQ = "seq";
openfl_utils_AGALMiniAssembler.SNE = "sne";
openfl_utils_AGALMiniAssembler.VA = "va";
openfl_utils_AGALMiniAssembler.VC = "vc";
openfl_utils_AGALMiniAssembler.VT = "vt";
openfl_utils_AGALMiniAssembler.VO = "vo";
openfl_utils_AGALMiniAssembler.VI = "vi";
openfl_utils_AGALMiniAssembler.FC = "fc";
openfl_utils_AGALMiniAssembler.FT = "ft";
openfl_utils_AGALMiniAssembler.FS = "fs";
openfl_utils_AGALMiniAssembler.FO = "fo";
openfl_utils_AGALMiniAssembler.FD = "fd";
openfl_utils_AGALMiniAssembler.IID = "iid";
openfl_utils_AGALMiniAssembler.D2 = "2d";
openfl_utils_AGALMiniAssembler.D3 = "3d";
openfl_utils_AGALMiniAssembler.CUBE = "cube";
openfl_utils_AGALMiniAssembler.MIPNEAREST = "mipnearest";
openfl_utils_AGALMiniAssembler.MIPLINEAR = "miplinear";
openfl_utils_AGALMiniAssembler.MIPNONE = "mipnone";
openfl_utils_AGALMiniAssembler.NOMIP = "nomip";
openfl_utils_AGALMiniAssembler.NEAREST = "nearest";
openfl_utils_AGALMiniAssembler.LINEAR = "linear";
openfl_utils_AGALMiniAssembler.ANISOTROPIC2X = "anisotropic2x";
openfl_utils_AGALMiniAssembler.ANISOTROPIC4X = "anisotropic4x";
openfl_utils_AGALMiniAssembler.ANISOTROPIC8X = "anisotropic8x";
openfl_utils_AGALMiniAssembler.ANISOTROPIC16X = "anisotropic16x";
openfl_utils_AGALMiniAssembler.CENTROID = "centroid";
openfl_utils_AGALMiniAssembler.SINGLE = "single";
openfl_utils_AGALMiniAssembler.IGNORESAMPLER = "ignoresampler";
openfl_utils_AGALMiniAssembler.REPEAT = "repeat";
openfl_utils_AGALMiniAssembler.WRAP = "wrap";
openfl_utils_AGALMiniAssembler.CLAMP = "clamp";
openfl_utils_AGALMiniAssembler.REPEAT_U_CLAMP_V = "repeat_u_clamp_v";
openfl_utils_AGALMiniAssembler.CLAMP_U_REPEAT_V = "clamp_u_repeat_v";
openfl_utils_AGALMiniAssembler.RGBA = "rgba";
openfl_utils_AGALMiniAssembler.COMPRESSED = "compressed";
openfl_utils_AGALMiniAssembler.COMPRESSEDALPHA = "compressedalpha";
openfl_utils_AGALMiniAssembler.DXT1 = "dxt1";
openfl_utils_AGALMiniAssembler.DXT5 = "dxt5";
openfl_utils_AGALMiniAssembler.VIDEO = "video";
openfl_utils_AGALMiniAssembler.initialized = false;
openfl_utils__$AGALMiniAssembler_OpCode.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_utils__$AGALMiniAssembler_Register.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_utils__$AGALMiniAssembler_Sampler.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_utils_Assets.cache = new openfl_utils_AssetCache();
openfl_utils_Assets.dispatcher = new openfl_events_EventDispatcher();
openfl_utils_ByteArray.__bytePointer = (function($this) {
	var $r;
	var this1 = new lime_utils_BytePointerData(null,0);
	$r = this1;
	return $r;
}(this));
openfl_utils_CompressionAlgorithm.DEFLATE = 0;
openfl_utils_CompressionAlgorithm.LZMA = 1;
openfl_utils_CompressionAlgorithm.ZLIB = 2;
openfl_utils_Endian.BIG_ENDIAN = 0;
openfl_utils_Endian.LITTLE_ENDIAN = 1;
openfl_utils_Object.__meta__ = { statics : { iterator : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, __get : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, __set : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
haxe_lang_Iterator.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
haxe_lang_Iterable.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
ApplicationMain.main();
})(typeof exports != "undefined" ? exports : typeof window != "undefined" ? window : typeof self != "undefined" ? self : this, typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this);

});
$hx_exports.lime = $hx_exports.lime || {};
$hx_exports.lime.$scripts = $hx_exports.lime.$scripts || {};
$hx_exports.lime.$scripts["MonsterMatch"] = $hx_script;
$hx_exports.lime.embed = function(projectName) { var exports = {};
	var script = $hx_exports.lime.$scripts[projectName];
	if (!script) throw Error("Cannot find project name \"" + projectName + "\"");
	script(exports, $global);
	for (var key in exports) $hx_exports[key] = $hx_exports[key] || exports[key];
	var lime = exports.lime || window.lime;
	if (lime && lime.embed && this != lime.embed) lime.embed.apply(lime, arguments);
	return exports;
};
if(typeof define == "function" && define.amd) {
	define([], function() { return $hx_exports.lime; });
	define.__amd = define.amd;
	define.amd = null;
}
})(typeof exports != "undefined" ? exports : typeof define == "function" && define.amd ? {} : typeof window != "undefined" ? window : typeof self != "undefined" ? self : this, typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this);

/*! howler.js v2.1.1 | (c) 2013-2018, James Simpson of GoldFire Studios | MIT License | howlerjs.com */
!function(){"use strict";var e=function(){this.init()};e.prototype={init:function(){var e=this||n;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=!1,e._volume=1,e._canPlayEvent="canplaythrough",e._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=!1,e.usingWebAudio=!0,e.autoSuspend=!0,e.ctx=null,e.autoUnlock=!0,e._setup(),e},volume:function(e){var o=this||n;if(e=parseFloat(e),o.ctx||_(),void 0!==e&&e>=0&&e<=1){if(o._volume=e,o._muted)return o;o.usingWebAudio&&o.masterGain.gain.setValueAtTime(e,n.ctx.currentTime);for(var t=0;t<o._howls.length;t++)if(!o._howls[t]._webAudio)for(var r=o._howls[t]._getSoundIds(),a=0;a<r.length;a++){var u=o._howls[t]._soundById(r[a]);u&&u._node&&(u._node.volume=u._volume*e)}return o}return o._volume},mute:function(e){var o=this||n;o.ctx||_(),o._muted=e,o.usingWebAudio&&o.masterGain.gain.setValueAtTime(e?0:o._volume,n.ctx.currentTime);for(var t=0;t<o._howls.length;t++)if(!o._howls[t]._webAudio)for(var r=o._howls[t]._getSoundIds(),a=0;a<r.length;a++){var u=o._howls[t]._soundById(r[a]);u&&u._node&&(u._node.muted=!!e||u._muted)}return o},unload:function(){for(var e=this||n,o=e._howls.length-1;o>=0;o--)e._howls[o].unload();return e.usingWebAudio&&e.ctx&&void 0!==e.ctx.close&&(e.ctx.close(),e.ctx=null,_()),e},codecs:function(e){return(this||n)._codecs[e.replace(/^x-/,"")]},_setup:function(){var e=this||n;if(e.state=e.ctx?e.ctx.state||"suspended":"suspended",e._autoSuspend(),!e.usingWebAudio)if("undefined"!=typeof Audio)try{var o=new Audio;void 0===o.oncanplaythrough&&(e._canPlayEvent="canplay")}catch(n){e.noAudio=!0}else e.noAudio=!0;try{var o=new Audio;o.muted&&(e.noAudio=!0)}catch(e){}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||n,o=null;try{o="undefined"!=typeof Audio?new Audio:null}catch(n){return e}if(!o||"function"!=typeof o.canPlayType)return e;var t=o.canPlayType("audio/mpeg;").replace(/^no$/,""),r=e._navigator&&e._navigator.userAgent.match(/OPR\/([0-6].)/g),a=r&&parseInt(r[0].split("/")[1],10)<33;return e._codecs={mp3:!(a||!t&&!o.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!t,opus:!!o.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!o.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!o.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!o.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),aac:!!o.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!o.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(o.canPlayType("audio/x-m4a;")||o.canPlayType("audio/m4a;")||o.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(o.canPlayType("audio/x-mp4;")||o.canPlayType("audio/mp4;")||o.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!o.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,""),webm:!!o.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,""),dolby:!!o.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(o.canPlayType("audio/x-flac;")||o.canPlayType("audio/flac;")).replace(/^no$/,"")},e},_unlockAudio:function(){var e=this||n,o=/iPhone|iPad|iPod|Android|BlackBerry|BB10|Silk|Mobi|Chrome|Safari/i.test(e._navigator&&e._navigator.userAgent);if(!e._audioUnlocked&&e.ctx&&o){e._audioUnlocked=!1,e.autoUnlock=!1,e._mobileUnloaded||44100===e.ctx.sampleRate||(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var t=function(n){for(var o=0;o<e.html5PoolSize;o++){var r=new Audio;r._unlocked=!0,e._releaseHtml5Audio(r)}for(var o=0;o<e._howls.length;o++)if(!e._howls[o]._webAudio)for(var a=e._howls[o]._getSoundIds(),u=0;u<a.length;u++){var i=e._howls[o]._soundById(a[u]);i&&i._node&&!i._node._unlocked&&(i._node._unlocked=!0,i._node.load())}e._autoResume();var d=e.ctx.createBufferSource();d.buffer=e._scratchBuffer,d.connect(e.ctx.destination),void 0===d.start?d.noteOn(0):d.start(0),"function"==typeof e.ctx.resume&&e.ctx.resume(),d.onended=function(){d.disconnect(0),e._audioUnlocked=!0,document.removeEventListener("touchstart",t,!0),document.removeEventListener("touchend",t,!0),document.removeEventListener("click",t,!0);for(var n=0;n<e._howls.length;n++)e._howls[n]._emit("unlock")}};return document.addEventListener("touchstart",t,!0),document.addEventListener("touchend",t,!0),document.addEventListener("click",t,!0),e}},_obtainHtml5Audio:function(){var e=this||n;if(e._html5AudioPool.length)return e._html5AudioPool.pop();var o=(new Audio).play();return o&&"undefined"!=typeof Promise&&(o instanceof Promise||"function"==typeof o.then)&&o.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(e){var o=this||n;return e._unlocked&&o._html5AudioPool.push(e),o},_autoSuspend:function(){var e=this;if(e.autoSuspend&&e.ctx&&void 0!==e.ctx.suspend&&n.usingWebAudio){for(var o=0;o<e._howls.length;o++)if(e._howls[o]._webAudio)for(var t=0;t<e._howls[o]._sounds.length;t++)if(!e._howls[o]._sounds[t]._paused)return e;return e._suspendTimer&&clearTimeout(e._suspendTimer),e._suspendTimer=setTimeout(function(){e.autoSuspend&&(e._suspendTimer=null,e.state="suspending",e.ctx.suspend().then(function(){e.state="suspended",e._resumeAfterSuspend&&(delete e._resumeAfterSuspend,e._autoResume())}))},3e4),e}},_autoResume:function(){var e=this;if(e.ctx&&void 0!==e.ctx.resume&&n.usingWebAudio)return"running"===e.state&&e._suspendTimer?(clearTimeout(e._suspendTimer),e._suspendTimer=null):"suspended"===e.state?(e.ctx.resume().then(function(){e.state="running";for(var n=0;n<e._howls.length;n++)e._howls[n]._emit("resume")}),e._suspendTimer&&(clearTimeout(e._suspendTimer),e._suspendTimer=null)):"suspending"===e.state&&(e._resumeAfterSuspend=!0),e}};var n=new e,o=function(e){var n=this;if(!e.src||0===e.src.length)return void console.error("An array of source files must be passed with any new Howl.");n.init(e)};o.prototype={init:function(e){var o=this;return n.ctx||_(),o._autoplay=e.autoplay||!1,o._format="string"!=typeof e.format?e.format:[e.format],o._html5=e.html5||!1,o._muted=e.mute||!1,o._loop=e.loop||!1,o._pool=e.pool||5,o._preload="boolean"!=typeof e.preload||e.preload,o._rate=e.rate||1,o._sprite=e.sprite||{},o._src="string"!=typeof e.src?e.src:[e.src],o._volume=void 0!==e.volume?e.volume:1,o._xhrWithCredentials=e.xhrWithCredentials||!1,o._duration=0,o._state="unloaded",o._sounds=[],o._endTimers={},o._queue=[],o._playLock=!1,o._onend=e.onend?[{fn:e.onend}]:[],o._onfade=e.onfade?[{fn:e.onfade}]:[],o._onload=e.onload?[{fn:e.onload}]:[],o._onloaderror=e.onloaderror?[{fn:e.onloaderror}]:[],o._onplayerror=e.onplayerror?[{fn:e.onplayerror}]:[],o._onpause=e.onpause?[{fn:e.onpause}]:[],o._onplay=e.onplay?[{fn:e.onplay}]:[],o._onstop=e.onstop?[{fn:e.onstop}]:[],o._onmute=e.onmute?[{fn:e.onmute}]:[],o._onvolume=e.onvolume?[{fn:e.onvolume}]:[],o._onrate=e.onrate?[{fn:e.onrate}]:[],o._onseek=e.onseek?[{fn:e.onseek}]:[],o._onunlock=e.onunlock?[{fn:e.onunlock}]:[],o._onresume=[],o._webAudio=n.usingWebAudio&&!o._html5,void 0!==n.ctx&&n.ctx&&n.autoUnlock&&n._unlockAudio(),n._howls.push(o),o._autoplay&&o._queue.push({event:"play",action:function(){o.play()}}),o._preload&&o.load(),o},load:function(){var e=this,o=null;if(n.noAudio)return void e._emit("loaderror",null,"No audio support.");"string"==typeof e._src&&(e._src=[e._src]);for(var r=0;r<e._src.length;r++){var u,i;if(e._format&&e._format[r])u=e._format[r];else{if("string"!=typeof(i=e._src[r])){e._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}u=/^data:audio\/([^;,]+);/i.exec(i),u||(u=/\.([^.]+)$/.exec(i.split("?",1)[0])),u&&(u=u[1].toLowerCase())}if(u||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),u&&n.codecs(u)){o=e._src[r];break}}return o?(e._src=o,e._state="loading","https:"===window.location.protocol&&"http:"===o.slice(0,5)&&(e._html5=!0,e._webAudio=!1),new t(e),e._webAudio&&a(e),e):void e._emit("loaderror",null,"No codec support for selected audio sources.")},play:function(e,o){var t=this,r=null;if("number"==typeof e)r=e,e=null;else{if("string"==typeof e&&"loaded"===t._state&&!t._sprite[e])return null;if(void 0===e&&(e="__default",!t._playLock)){for(var a=0,u=0;u<t._sounds.length;u++)t._sounds[u]._paused&&!t._sounds[u]._ended&&(a++,r=t._sounds[u]._id);1===a?e=null:r=null}}var i=r?t._soundById(r):t._inactiveSound();if(!i)return null;if(r&&!e&&(e=i._sprite||"__default"),"loaded"!==t._state){i._sprite=e,i._ended=!1;var d=i._id;return t._queue.push({event:"play",action:function(){t.play(d)}}),d}if(r&&!i._paused)return o||t._loadQueue("play"),i._id;t._webAudio&&n._autoResume();var _=Math.max(0,i._seek>0?i._seek:t._sprite[e][0]/1e3),s=Math.max(0,(t._sprite[e][0]+t._sprite[e][1])/1e3-_),l=1e3*s/Math.abs(i._rate),c=t._sprite[e][0]/1e3,f=(t._sprite[e][0]+t._sprite[e][1])/1e3,p=!(!i._loop&&!t._sprite[e][2]);i._sprite=e,i._ended=!1;var m=function(){i._paused=!1,i._seek=_,i._start=c,i._stop=f,i._loop=p};if(_>=f)return void t._ended(i);var v=i._node;if(t._webAudio){var h=function(){t._playLock=!1,m(),t._refreshBuffer(i);var e=i._muted||t._muted?0:i._volume;v.gain.setValueAtTime(e,n.ctx.currentTime),i._playStart=n.ctx.currentTime,void 0===v.bufferSource.start?i._loop?v.bufferSource.noteGrainOn(0,_,86400):v.bufferSource.noteGrainOn(0,_,s):i._loop?v.bufferSource.start(0,_,86400):v.bufferSource.start(0,_,s),l!==1/0&&(t._endTimers[i._id]=setTimeout(t._ended.bind(t,i),l)),o||setTimeout(function(){t._emit("play",i._id),t._loadQueue()},0)};"running"===n.state?h():(t._playLock=!0,t.once("resume",h),t._clearTimer(i._id))}else{var y=function(){v.currentTime=_,v.muted=i._muted||t._muted||n._muted||v.muted,v.volume=i._volume*n.volume(),v.playbackRate=i._rate;try{var r=v.play();if(r&&"undefined"!=typeof Promise&&(r instanceof Promise||"function"==typeof r.then)?(t._playLock=!0,m(),r.then(function(){t._playLock=!1,v._unlocked=!0,o||(t._emit("play",i._id),t._loadQueue())}).catch(function(){t._playLock=!1,t._emit("playerror",i._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),i._ended=!0,i._paused=!0})):o||(t._playLock=!1,m(),t._emit("play",i._id),t._loadQueue()),v.playbackRate=i._rate,v.paused)return void t._emit("playerror",i._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==e||i._loop?t._endTimers[i._id]=setTimeout(t._ended.bind(t,i),l):(t._endTimers[i._id]=function(){t._ended(i),v.removeEventListener("ended",t._endTimers[i._id],!1)},v.addEventListener("ended",t._endTimers[i._id],!1))}catch(e){t._emit("playerror",i._id,e)}},g=window&&window.ejecta||!v.readyState&&n._navigator.isCocoonJS;if(v.readyState>=3||g)y();else{t._playLock=!0;var b=function(){y(),v.removeEventListener(n._canPlayEvent,b,!1)};v.addEventListener(n._canPlayEvent,b,!1),t._clearTimer(i._id)}}return i._id},pause:function(e){var n=this;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"pause",action:function(){n.pause(e)}}),n;for(var o=n._getSoundIds(e),t=0;t<o.length;t++){n._clearTimer(o[t]);var r=n._soundById(o[t]);if(r&&!r._paused&&(r._seek=n.seek(o[t]),r._rateSeek=0,r._paused=!0,n._stopFade(o[t]),r._node))if(n._webAudio){if(!r._node.bufferSource)continue;void 0===r._node.bufferSource.stop?r._node.bufferSource.noteOff(0):r._node.bufferSource.stop(0),n._cleanBuffer(r._node)}else isNaN(r._node.duration)&&r._node.duration!==1/0||r._node.pause();arguments[1]||n._emit("pause",r?r._id:null)}return n},stop:function(e,n){var o=this;if("loaded"!==o._state||o._playLock)return o._queue.push({event:"stop",action:function(){o.stop(e)}}),o;for(var t=o._getSoundIds(e),r=0;r<t.length;r++){o._clearTimer(t[r]);var a=o._soundById(t[r]);a&&(a._seek=a._start||0,a._rateSeek=0,a._paused=!0,a._ended=!0,o._stopFade(t[r]),a._node&&(o._webAudio?a._node.bufferSource&&(void 0===a._node.bufferSource.stop?a._node.bufferSource.noteOff(0):a._node.bufferSource.stop(0),o._cleanBuffer(a._node)):isNaN(a._node.duration)&&a._node.duration!==1/0||(a._node.currentTime=a._start||0,a._node.pause())),n||o._emit("stop",a._id))}return o},mute:function(e,o){var t=this;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"mute",action:function(){t.mute(e,o)}}),t;if(void 0===o){if("boolean"!=typeof e)return t._muted;t._muted=e}for(var r=t._getSoundIds(o),a=0;a<r.length;a++){var u=t._soundById(r[a]);u&&(u._muted=e,u._interval&&t._stopFade(u._id),t._webAudio&&u._node?u._node.gain.setValueAtTime(e?0:u._volume,n.ctx.currentTime):u._node&&(u._node.muted=!!n._muted||e),t._emit("mute",u._id))}return t},volume:function(){var e,o,t=this,r=arguments;if(0===r.length)return t._volume;if(1===r.length||2===r.length&&void 0===r[1]){t._getSoundIds().indexOf(r[0])>=0?o=parseInt(r[0],10):e=parseFloat(r[0])}else r.length>=2&&(e=parseFloat(r[0]),o=parseInt(r[1],10));var a;if(!(void 0!==e&&e>=0&&e<=1))return a=o?t._soundById(o):t._sounds[0],a?a._volume:0;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"volume",action:function(){t.volume.apply(t,r)}}),t;void 0===o&&(t._volume=e),o=t._getSoundIds(o);for(var u=0;u<o.length;u++)(a=t._soundById(o[u]))&&(a._volume=e,r[2]||t._stopFade(o[u]),t._webAudio&&a._node&&!a._muted?a._node.gain.setValueAtTime(e,n.ctx.currentTime):a._node&&!a._muted&&(a._node.volume=e*n.volume()),t._emit("volume",a._id));return t},fade:function(e,o,t,r){var a=this;if("loaded"!==a._state||a._playLock)return a._queue.push({event:"fade",action:function(){a.fade(e,o,t,r)}}),a;e=parseFloat(e),o=parseFloat(o),t=parseFloat(t),a.volume(e,r);for(var u=a._getSoundIds(r),i=0;i<u.length;i++){var d=a._soundById(u[i]);if(d){if(r||a._stopFade(u[i]),a._webAudio&&!d._muted){var _=n.ctx.currentTime,s=_+t/1e3;d._volume=e,d._node.gain.setValueAtTime(e,_),d._node.gain.linearRampToValueAtTime(o,s)}a._startFadeInterval(d,e,o,t,u[i],void 0===r)}}return a},_startFadeInterval:function(e,n,o,t,r,a){var u=this,i=n,d=o-n,_=Math.abs(d/.01),s=Math.max(4,_>0?t/_:t),l=Date.now();e._fadeTo=o,e._interval=setInterval(function(){var r=(Date.now()-l)/t;l=Date.now(),i+=d*r,i=Math.max(0,i),i=Math.min(1,i),i=Math.round(100*i)/100,u._webAudio?e._volume=i:u.volume(i,e._id,!0),a&&(u._volume=i),(o<n&&i<=o||o>n&&i>=o)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,u.volume(o,e._id),u._emit("fade",e._id))},s)},_stopFade:function(e){var o=this,t=o._soundById(e);return t&&t._interval&&(o._webAudio&&t._node.gain.cancelScheduledValues(n.ctx.currentTime),clearInterval(t._interval),t._interval=null,o.volume(t._fadeTo,e),t._fadeTo=null,o._emit("fade",e)),o},loop:function(){var e,n,o,t=this,r=arguments;if(0===r.length)return t._loop;if(1===r.length){if("boolean"!=typeof r[0])return!!(o=t._soundById(parseInt(r[0],10)))&&o._loop;e=r[0],t._loop=e}else 2===r.length&&(e=r[0],n=parseInt(r[1],10));for(var a=t._getSoundIds(n),u=0;u<a.length;u++)(o=t._soundById(a[u]))&&(o._loop=e,t._webAudio&&o._node&&o._node.bufferSource&&(o._node.bufferSource.loop=e,e&&(o._node.bufferSource.loopStart=o._start||0,o._node.bufferSource.loopEnd=o._stop)));return t},rate:function(){var e,o,t=this,r=arguments;if(0===r.length)o=t._sounds[0]._id;else if(1===r.length){var a=t._getSoundIds(),u=a.indexOf(r[0]);u>=0?o=parseInt(r[0],10):e=parseFloat(r[0])}else 2===r.length&&(e=parseFloat(r[0]),o=parseInt(r[1],10));var i;if("number"!=typeof e)return i=t._soundById(o),i?i._rate:t._rate;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"rate",action:function(){t.rate.apply(t,r)}}),t;void 0===o&&(t._rate=e),o=t._getSoundIds(o);for(var d=0;d<o.length;d++)if(i=t._soundById(o[d])){t.playing(o[d])&&(i._rateSeek=t.seek(o[d]),i._playStart=t._webAudio?n.ctx.currentTime:i._playStart),i._rate=e,t._webAudio&&i._node&&i._node.bufferSource?i._node.bufferSource.playbackRate.setValueAtTime(e,n.ctx.currentTime):i._node&&(i._node.playbackRate=e);var _=t.seek(o[d]),s=(t._sprite[i._sprite][0]+t._sprite[i._sprite][1])/1e3-_,l=1e3*s/Math.abs(i._rate);!t._endTimers[o[d]]&&i._paused||(t._clearTimer(o[d]),t._endTimers[o[d]]=setTimeout(t._ended.bind(t,i),l)),t._emit("rate",i._id)}return t},seek:function(){var e,o,t=this,r=arguments;if(0===r.length)o=t._sounds[0]._id;else if(1===r.length){var a=t._getSoundIds(),u=a.indexOf(r[0]);u>=0?o=parseInt(r[0],10):t._sounds.length&&(o=t._sounds[0]._id,e=parseFloat(r[0]))}else 2===r.length&&(e=parseFloat(r[0]),o=parseInt(r[1],10));if(void 0===o)return t;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"seek",action:function(){t.seek.apply(t,r)}}),t;var i=t._soundById(o);if(i){if(!("number"==typeof e&&e>=0)){if(t._webAudio){var d=t.playing(o)?n.ctx.currentTime-i._playStart:0,_=i._rateSeek?i._rateSeek-i._seek:0;return i._seek+(_+d*Math.abs(i._rate))}return i._node.currentTime}var s=t.playing(o);s&&t.pause(o,!0),i._seek=e,i._ended=!1,t._clearTimer(o),t._webAudio||!i._node||isNaN(i._node.duration)||(i._node.currentTime=e);var l=function(){t._emit("seek",o),s&&t.play(o,!0)};if(s&&!t._webAudio){var c=function(){t._playLock?setTimeout(c,0):l()};setTimeout(c,0)}else l()}return t},playing:function(e){var n=this;if("number"==typeof e){var o=n._soundById(e);return!!o&&!o._paused}for(var t=0;t<n._sounds.length;t++)if(!n._sounds[t]._paused)return!0;return!1},duration:function(e){var n=this,o=n._duration,t=n._soundById(e);return t&&(o=n._sprite[t._sprite][1]/1e3),o},state:function(){return this._state},unload:function(){for(var e=this,o=e._sounds,t=0;t<o.length;t++){if(o[t]._paused||e.stop(o[t]._id),!e._webAudio){/MSIE |Trident\//.test(n._navigator&&n._navigator.userAgent)||(o[t]._node.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"),o[t]._node.removeEventListener("error",o[t]._errorFn,!1),o[t]._node.removeEventListener(n._canPlayEvent,o[t]._loadFn,!1),n._releaseHtml5Audio(o[t]._node)}delete o[t]._node,e._clearTimer(o[t]._id)}var a=n._howls.indexOf(e);a>=0&&n._howls.splice(a,1);var u=!0;for(t=0;t<n._howls.length;t++)if(n._howls[t]._src===e._src||e._src.indexOf(n._howls[t]._src)>=0){u=!1;break}return r&&u&&delete r[e._src],n.noAudio=!1,e._state="unloaded",e._sounds=[],e=null,null},on:function(e,n,o,t){var r=this,a=r["_on"+e];return"function"==typeof n&&a.push(t?{id:o,fn:n,once:t}:{id:o,fn:n}),r},off:function(e,n,o){var t=this,r=t["_on"+e],a=0;if("number"==typeof n&&(o=n,n=null),n||o)for(a=0;a<r.length;a++){var u=o===r[a].id;if(n===r[a].fn&&u||!n&&u){r.splice(a,1);break}}else if(e)t["_on"+e]=[];else{var i=Object.keys(t);for(a=0;a<i.length;a++)0===i[a].indexOf("_on")&&Array.isArray(t[i[a]])&&(t[i[a]]=[])}return t},once:function(e,n,o){var t=this;return t.on(e,n,o,1),t},_emit:function(e,n,o){for(var t=this,r=t["_on"+e],a=r.length-1;a>=0;a--)r[a].id&&r[a].id!==n&&"load"!==e||(setTimeout(function(e){e.call(this,n,o)}.bind(t,r[a].fn),0),r[a].once&&t.off(e,r[a].fn,r[a].id));return t._loadQueue(e),t},_loadQueue:function(e){var n=this;if(n._queue.length>0){var o=n._queue[0];o.event===e&&(n._queue.shift(),n._loadQueue()),e||o.action()}return n},_ended:function(e){var o=this,t=e._sprite;if(!o._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime<e._stop)return setTimeout(o._ended.bind(o,e),100),o;var r=!(!e._loop&&!o._sprite[t][2]);if(o._emit("end",e._id),!o._webAudio&&r&&o.stop(e._id,!0).play(e._id),o._webAudio&&r){o._emit("play",e._id),e._seek=e._start||0,e._rateSeek=0,e._playStart=n.ctx.currentTime;var a=1e3*(e._stop-e._start)/Math.abs(e._rate);o._endTimers[e._id]=setTimeout(o._ended.bind(o,e),a)}return o._webAudio&&!r&&(e._paused=!0,e._ended=!0,e._seek=e._start||0,e._rateSeek=0,o._clearTimer(e._id),o._cleanBuffer(e._node),n._autoSuspend()),o._webAudio||r||o.stop(e._id,!0),o},_clearTimer:function(e){var n=this;if(n._endTimers[e]){if("function"!=typeof n._endTimers[e])clearTimeout(n._endTimers[e]);else{var o=n._soundById(e);o&&o._node&&o._node.removeEventListener("ended",n._endTimers[e],!1)}delete n._endTimers[e]}return n},_soundById:function(e){for(var n=this,o=0;o<n._sounds.length;o++)if(e===n._sounds[o]._id)return n._sounds[o];return null},_inactiveSound:function(){var e=this;e._drain();for(var n=0;n<e._sounds.length;n++)if(e._sounds[n]._ended)return e._sounds[n].reset();return new t(e)},_drain:function(){var e=this,n=e._pool,o=0,t=0;if(!(e._sounds.length<n)){for(t=0;t<e._sounds.length;t++)e._sounds[t]._ended&&o++;for(t=e._sounds.length-1;t>=0;t--){if(o<=n)return;e._sounds[t]._ended&&(e._webAudio&&e._sounds[t]._node&&e._sounds[t]._node.disconnect(0),e._sounds.splice(t,1),o--)}}},_getSoundIds:function(e){var n=this;if(void 0===e){for(var o=[],t=0;t<n._sounds.length;t++)o.push(n._sounds[t]._id);return o}return[e]},_refreshBuffer:function(e){var o=this;return e._node.bufferSource=n.ctx.createBufferSource(),e._node.bufferSource.buffer=r[o._src],e._panner?e._node.bufferSource.connect(e._panner):e._node.bufferSource.connect(e._node),e._node.bufferSource.loop=e._loop,e._loop&&(e._node.bufferSource.loopStart=e._start||0,e._node.bufferSource.loopEnd=e._stop||0),e._node.bufferSource.playbackRate.setValueAtTime(e._rate,n.ctx.currentTime),o},_cleanBuffer:function(e){var o=this,t=n._navigator&&n._navigator.vendor.indexOf("Apple")>=0;if(n._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),t))try{e.bufferSource.buffer=n._scratchBuffer}catch(e){}return e.bufferSource=null,o}};var t=function(e){this._parent=e,this.init()};t.prototype={init:function(){var e=this,o=e._parent;return e._muted=o._muted,e._loop=o._loop,e._volume=o._volume,e._rate=o._rate,e._seek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++n._counter,o._sounds.push(e),e.create(),e},create:function(){var e=this,o=e._parent,t=n._muted||e._muted||e._parent._muted?0:e._volume;return o._webAudio?(e._node=void 0===n.ctx.createGain?n.ctx.createGainNode():n.ctx.createGain(),e._node.gain.setValueAtTime(t,n.ctx.currentTime),e._node.paused=!0,e._node.connect(n.masterGain)):(e._node=n._obtainHtml5Audio(),e._errorFn=e._errorListener.bind(e),e._node.addEventListener("error",e._errorFn,!1),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(n._canPlayEvent,e._loadFn,!1),e._node.src=o._src,e._node.preload="auto",e._node.volume=t*n.volume(),e._node.load()),e},reset:function(){var e=this,o=e._parent;return e._muted=o._muted,e._loop=o._loop,e._volume=o._volume,e._rate=o._rate,e._seek=0,e._rateSeek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++n._counter,e},_errorListener:function(){var e=this;e._parent._emit("loaderror",e._id,e._node.error?e._node.error.code:0),e._node.removeEventListener("error",e._errorFn,!1)},_loadListener:function(){var e=this,o=e._parent;o._duration=Math.ceil(10*e._node.duration)/10,0===Object.keys(o._sprite).length&&(o._sprite={__default:[0,1e3*o._duration]}),"loaded"!==o._state&&(o._state="loaded",o._emit("load"),o._loadQueue()),e._node.removeEventListener(n._canPlayEvent,e._loadFn,!1)}};var r={},a=function(e){var n=e._src;if(r[n])return e._duration=r[n].duration,void d(e);if(/^data:[^;]+;base64,/.test(n)){for(var o=atob(n.split(",")[1]),t=new Uint8Array(o.length),a=0;a<o.length;++a)t[a]=o.charCodeAt(a);i(t.buffer,e)}else{var _=new XMLHttpRequest;_.open("GET",n,!0),_.withCredentials=e._xhrWithCredentials,_.responseType="arraybuffer",_.onload=function(){var n=(_.status+"")[0];if("0"!==n&&"2"!==n&&"3"!==n)return void e._emit("loaderror",null,"Failed loading audio file with status: "+_.status+".");i(_.response,e)},_.onerror=function(){e._webAudio&&(e._html5=!0,e._webAudio=!1,e._sounds=[],delete r[n],e.load())},u(_)}},u=function(e){try{e.send()}catch(n){e.onerror()}},i=function(e,o){var t=function(){o._emit("loaderror",null,"Decoding audio data failed.")},a=function(e){e&&o._sounds.length>0?(r[o._src]=e,d(o,e)):t()};"undefined"!=typeof Promise&&1===n.ctx.decodeAudioData.length?n.ctx.decodeAudioData(e).then(a).catch(t):n.ctx.decodeAudioData(e,a,t)},d=function(e,n){n&&!e._duration&&(e._duration=n.duration),0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue())},_=function(){if(n.usingWebAudio){try{"undefined"!=typeof AudioContext?n.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?n.ctx=new webkitAudioContext:n.usingWebAudio=!1}catch(e){n.usingWebAudio=!1}n.ctx||(n.usingWebAudio=!1);var e=/iP(hone|od|ad)/.test(n._navigator&&n._navigator.platform),o=n._navigator&&n._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),t=o?parseInt(o[1],10):null;if(e&&t&&t<9){var r=/safari/.test(n._navigator&&n._navigator.userAgent.toLowerCase());(n._navigator&&n._navigator.standalone&&!r||n._navigator&&!n._navigator.standalone&&!r)&&(n.usingWebAudio=!1)}n.usingWebAudio&&(n.masterGain=void 0===n.ctx.createGain?n.ctx.createGainNode():n.ctx.createGain(),n.masterGain.gain.setValueAtTime(n._muted?0:1,n.ctx.currentTime),n.masterGain.connect(n.ctx.destination)),n._setup()}};"function"==typeof define&&define.amd&&define([],function(){return{Howler:n,Howl:o}}),"undefined"!=typeof exports&&(exports.Howler=n,exports.Howl=o),"undefined"!=typeof window?(window.HowlerGlobal=e,window.Howler=n,window.Howl=o,window.Sound=t):"undefined"!=typeof global&&(global.HowlerGlobal=e,global.Howler=n,global.Howl=o,global.Sound=t)}();
/*! Spatial Plugin */
!function(){"use strict";HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){var n=this;if(!n.ctx||!n.ctx.listener)return n;for(var t=n._howls.length-1;t>=0;t--)n._howls[t].stereo(e);return n},HowlerGlobal.prototype.pos=function(e,n,t){var r=this;return r.ctx&&r.ctx.listener?(n="number"!=typeof n?r._pos[1]:n,t="number"!=typeof t?r._pos[2]:t,"number"!=typeof e?r._pos:(r._pos=[e,n,t],void 0!==r.ctx.listener.positionX?(r.ctx.listener.positionX.setTargetAtTime(r._pos[0],Howler.ctx.currentTime,.1),r.ctx.listener.positionY.setTargetAtTime(r._pos[1],Howler.ctx.currentTime,.1),r.ctx.listener.positionZ.setTargetAtTime(r._pos[2],Howler.ctx.currentTime,.1)):r.ctx.listener.setPosition(r._pos[0],r._pos[1],r._pos[2]),r)):r},HowlerGlobal.prototype.orientation=function(e,n,t,r,o,i){var a=this;if(!a.ctx||!a.ctx.listener)return a;var s=a._orientation;return n="number"!=typeof n?s[1]:n,t="number"!=typeof t?s[2]:t,r="number"!=typeof r?s[3]:r,o="number"!=typeof o?s[4]:o,i="number"!=typeof i?s[5]:i,"number"!=typeof e?s:(a._orientation=[e,n,t,r,o,i],void 0!==a.ctx.listener.forwardX?(a.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),a.ctx.listener.forwardY.setTargetAtTime(n,Howler.ctx.currentTime,.1),a.ctx.listener.forwardZ.setTargetAtTime(t,Howler.ctx.currentTime,.1),a.ctx.listener.upX.setTargetAtTime(e,Howler.ctx.currentTime,.1),a.ctx.listener.upY.setTargetAtTime(n,Howler.ctx.currentTime,.1),a.ctx.listener.upZ.setTargetAtTime(t,Howler.ctx.currentTime,.1)):a.ctx.listener.setOrientation(e,n,t,r,o,i),a)},Howl.prototype.init=function(e){return function(n){var t=this;return t._orientation=n.orientation||[1,0,0],t._stereo=n.stereo||null,t._pos=n.pos||null,t._pannerAttr={coneInnerAngle:void 0!==n.coneInnerAngle?n.coneInnerAngle:360,coneOuterAngle:void 0!==n.coneOuterAngle?n.coneOuterAngle:360,coneOuterGain:void 0!==n.coneOuterGain?n.coneOuterGain:0,distanceModel:void 0!==n.distanceModel?n.distanceModel:"inverse",maxDistance:void 0!==n.maxDistance?n.maxDistance:1e4,panningModel:void 0!==n.panningModel?n.panningModel:"HRTF",refDistance:void 0!==n.refDistance?n.refDistance:1,rolloffFactor:void 0!==n.rolloffFactor?n.rolloffFactor:1},t._onstereo=n.onstereo?[{fn:n.onstereo}]:[],t._onpos=n.onpos?[{fn:n.onpos}]:[],t._onorientation=n.onorientation?[{fn:n.onorientation}]:[],e.call(this,n)}}(Howl.prototype.init),Howl.prototype.stereo=function(n,t){var r=this;if(!r._webAudio)return r;if("loaded"!==r._state)return r._queue.push({event:"stereo",action:function(){r.stereo(n,t)}}),r;var o=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===t){if("number"!=typeof n)return r._stereo;r._stereo=n,r._pos=[n,0,0]}for(var i=r._getSoundIds(t),a=0;a<i.length;a++){var s=r._soundById(i[a]);if(s){if("number"!=typeof n)return s._stereo;s._stereo=n,s._pos=[n,0,0],s._node&&(s._pannerAttr.panningModel="equalpower",s._panner&&s._panner.pan||e(s,o),"spatial"===o?void 0!==s._panner.positionX?(s._panner.positionX.setValueAtTime(n,Howler.ctx.currentTime),s._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),s._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):s._panner.setPosition(n,0,0):s._panner.pan.setValueAtTime(n,Howler.ctx.currentTime)),r._emit("stereo",s._id)}}return r},Howl.prototype.pos=function(n,t,r,o){var i=this;if(!i._webAudio)return i;if("loaded"!==i._state)return i._queue.push({event:"pos",action:function(){i.pos(n,t,r,o)}}),i;if(t="number"!=typeof t?0:t,r="number"!=typeof r?-.5:r,void 0===o){if("number"!=typeof n)return i._pos;i._pos=[n,t,r]}for(var a=i._getSoundIds(o),s=0;s<a.length;s++){var p=i._soundById(a[s]);if(p){if("number"!=typeof n)return p._pos;p._pos=[n,t,r],p._node&&(p._panner&&!p._panner.pan||e(p,"spatial"),void 0!==p._panner.positionX?(p._panner.positionX.setValueAtTime(n,Howler.ctx.currentTime),p._panner.positionY.setValueAtTime(t,Howler.ctx.currentTime),p._panner.positionZ.setValueAtTime(r,Howler.ctx.currentTime)):p._panner.setPosition(n,t,r)),i._emit("pos",p._id)}}return i},Howl.prototype.orientation=function(n,t,r,o){var i=this;if(!i._webAudio)return i;if("loaded"!==i._state)return i._queue.push({event:"orientation",action:function(){i.orientation(n,t,r,o)}}),i;if(t="number"!=typeof t?i._orientation[1]:t,r="number"!=typeof r?i._orientation[2]:r,void 0===o){if("number"!=typeof n)return i._orientation;i._orientation=[n,t,r]}for(var a=i._getSoundIds(o),s=0;s<a.length;s++){var p=i._soundById(a[s]);if(p){if("number"!=typeof n)return p._orientation;p._orientation=[n,t,r],p._node&&(p._panner||(p._pos||(p._pos=i._pos||[0,0,-.5]),e(p,"spatial")),void 0!==p._panner.orientationX?(p._panner.orientationX.setValueAtTime(n,Howler.ctx.currentTime),p._panner.orientationY.setValueAtTime(t,Howler.ctx.currentTime),p._panner.orientationZ.setValueAtTime(r,Howler.ctx.currentTime)):p._panner.setOrientation(n,t,r)),i._emit("orientation",p._id)}}return i},Howl.prototype.pannerAttr=function(){var n,t,r,o=this,i=arguments;if(!o._webAudio)return o;if(0===i.length)return o._pannerAttr;if(1===i.length){if("object"!=typeof i[0])return r=o._soundById(parseInt(i[0],10)),r?r._pannerAttr:o._pannerAttr;n=i[0],void 0===t&&(n.pannerAttr||(n.pannerAttr={coneInnerAngle:n.coneInnerAngle,coneOuterAngle:n.coneOuterAngle,coneOuterGain:n.coneOuterGain,distanceModel:n.distanceModel,maxDistance:n.maxDistance,refDistance:n.refDistance,rolloffFactor:n.rolloffFactor,panningModel:n.panningModel}),o._pannerAttr={coneInnerAngle:void 0!==n.pannerAttr.coneInnerAngle?n.pannerAttr.coneInnerAngle:o._coneInnerAngle,coneOuterAngle:void 0!==n.pannerAttr.coneOuterAngle?n.pannerAttr.coneOuterAngle:o._coneOuterAngle,coneOuterGain:void 0!==n.pannerAttr.coneOuterGain?n.pannerAttr.coneOuterGain:o._coneOuterGain,distanceModel:void 0!==n.pannerAttr.distanceModel?n.pannerAttr.distanceModel:o._distanceModel,maxDistance:void 0!==n.pannerAttr.maxDistance?n.pannerAttr.maxDistance:o._maxDistance,refDistance:void 0!==n.pannerAttr.refDistance?n.pannerAttr.refDistance:o._refDistance,rolloffFactor:void 0!==n.pannerAttr.rolloffFactor?n.pannerAttr.rolloffFactor:o._rolloffFactor,panningModel:void 0!==n.pannerAttr.panningModel?n.pannerAttr.panningModel:o._panningModel})}else 2===i.length&&(n=i[0],t=parseInt(i[1],10));for(var a=o._getSoundIds(t),s=0;s<a.length;s++)if(r=o._soundById(a[s])){var p=r._pannerAttr;p={coneInnerAngle:void 0!==n.coneInnerAngle?n.coneInnerAngle:p.coneInnerAngle,coneOuterAngle:void 0!==n.coneOuterAngle?n.coneOuterAngle:p.coneOuterAngle,coneOuterGain:void 0!==n.coneOuterGain?n.coneOuterGain:p.coneOuterGain,distanceModel:void 0!==n.distanceModel?n.distanceModel:p.distanceModel,maxDistance:void 0!==n.maxDistance?n.maxDistance:p.maxDistance,refDistance:void 0!==n.refDistance?n.refDistance:p.refDistance,rolloffFactor:void 0!==n.rolloffFactor?n.rolloffFactor:p.rolloffFactor,panningModel:void 0!==n.panningModel?n.panningModel:p.panningModel};var c=r._panner;c?(c.coneInnerAngle=p.coneInnerAngle,c.coneOuterAngle=p.coneOuterAngle,c.coneOuterGain=p.coneOuterGain,c.distanceModel=p.distanceModel,c.maxDistance=p.maxDistance,c.refDistance=p.refDistance,c.rolloffFactor=p.rolloffFactor,c.panningModel=p.panningModel):(r._pos||(r._pos=o._pos||[0,0,-.5]),e(r,"spatial"))}return o},Sound.prototype.init=function(e){return function(){var n=this,t=n._parent;n._orientation=t._orientation,n._stereo=t._stereo,n._pos=t._pos,n._pannerAttr=t._pannerAttr,e.call(this),n._stereo?t.stereo(n._stereo):n._pos&&t.pos(n._pos[0],n._pos[1],n._pos[2],n._id)}}(Sound.prototype.init),Sound.prototype.reset=function(e){return function(){var n=this,t=n._parent;return n._orientation=t._orientation,n._stereo=t._stereo,n._pos=t._pos,n._pannerAttr=t._pannerAttr,n._stereo?t.stereo(n._stereo):n._pos?t.pos(n._pos[0],n._pos[1],n._pos[2],n._id):n._panner&&(n._panner.disconnect(0),n._panner=void 0,t._refreshBuffer(n)),e.call(this)}}(Sound.prototype.reset);var e=function(e,n){n=n||"spatial","spatial"===n?(e._panner=Howler.ctx.createPanner(),e._panner.coneInnerAngle=e._pannerAttr.coneInnerAngle,e._panner.coneOuterAngle=e._pannerAttr.coneOuterAngle,e._panner.coneOuterGain=e._pannerAttr.coneOuterGain,e._panner.distanceModel=e._pannerAttr.distanceModel,e._panner.maxDistance=e._pannerAttr.maxDistance,e._panner.refDistance=e._pannerAttr.refDistance,e._panner.rolloffFactor=e._pannerAttr.rolloffFactor,e._panner.panningModel=e._pannerAttr.panningModel,void 0!==e._panner.positionX?(e._panner.positionX.setValueAtTime(e._pos[0],Howler.ctx.currentTime),e._panner.positionY.setValueAtTime(e._pos[1],Howler.ctx.currentTime),e._panner.positionZ.setValueAtTime(e._pos[2],Howler.ctx.currentTime)):e._panner.setPosition(e._pos[0],e._pos[1],e._pos[2]),void 0!==e._panner.orientationX?(e._panner.orientationX.setValueAtTime(e._orientation[0],Howler.ctx.currentTime),e._panner.orientationY.setValueAtTime(e._orientation[1],Howler.ctx.currentTime),e._panner.orientationZ.setValueAtTime(e._orientation[2],Howler.ctx.currentTime)):e._panner.setOrientation(e._orientation[0],e._orientation[1],e._orientation[2])):(e._panner=Howler.ctx.createStereoPanner(),e._panner.pan.setValueAtTime(e._stereo,Howler.ctx.currentTime)),e._panner.connect(e._node),e._paused||e._parent.pause(e._id,!0).play(e._id,!0)}}();
/* pako 1.0.2 nodeca/pako */
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.pako=t()}}(function(){return function t(e,a,i){function n(s,o){if(!a[s]){if(!e[s]){var l="function"==typeof require&&require;if(!o&&l)return l(s,!0);if(r)return r(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var d=a[s]={exports:{}};e[s][0].call(d.exports,function(t){var a=e[s][1][t];return n(a?a:t)},d,d.exports,t,e,a,i)}return a[s].exports}for(var r="function"==typeof require&&require,s=0;s<i.length;s++)n(i[s]);return n}({1:[function(t,e,a){"use strict";function i(t){if(!(this instanceof i))return new i(t);this.options=l.assign({level:w,method:v,chunkSize:16384,windowBits:15,memLevel:8,strategy:p,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var a=o.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==b)throw new Error(d[a]);if(e.header&&o.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(n="string"==typeof e.dictionary?h.string2buf(e.dictionary):"[object ArrayBuffer]"===_.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=o.deflateSetDictionary(this.strm,n),a!==b)throw new Error(d[a]);this._dict_set=!0}}function n(t,e){var a=new i(e);if(a.push(t,!0),a.err)throw a.msg;return a.result}function r(t,e){return e=e||{},e.raw=!0,n(t,e)}function s(t,e){return e=e||{},e.gzip=!0,n(t,e)}var o=t("./zlib/deflate"),l=t("./utils/common"),h=t("./utils/strings"),d=t("./zlib/messages"),f=t("./zlib/zstream"),_=Object.prototype.toString,u=0,c=4,b=0,g=1,m=2,w=-1,p=0,v=8;i.prototype.push=function(t,e){var a,i,n=this.strm,r=this.options.chunkSize;if(this.ended)return!1;i=e===~~e?e:e===!0?c:u,"string"==typeof t?n.input=h.string2buf(t):"[object ArrayBuffer]"===_.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;do{if(0===n.avail_out&&(n.output=new l.Buf8(r),n.next_out=0,n.avail_out=r),a=o.deflate(n,i),a!==g&&a!==b)return this.onEnd(a),this.ended=!0,!1;0!==n.avail_out&&(0!==n.avail_in||i!==c&&i!==m)||("string"===this.options.to?this.onData(h.buf2binstring(l.shrinkBuf(n.output,n.next_out))):this.onData(l.shrinkBuf(n.output,n.next_out)))}while((n.avail_in>0||0===n.avail_out)&&a!==g);return i===c?(a=o.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===b):i!==m||(this.onEnd(b),n.avail_out=0,!0)},i.prototype.onData=function(t){this.chunks.push(t)},i.prototype.onEnd=function(t){t===b&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=l.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},a.Deflate=i,a.deflate=n,a.deflateRaw=r,a.gzip=s},{"./utils/common":3,"./utils/strings":4,"./zlib/deflate":8,"./zlib/messages":13,"./zlib/zstream":15}],2:[function(t,e,a){"use strict";function i(t){if(!(this instanceof i))return new i(t);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0===(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var a=s.inflateInit2(this.strm,e.windowBits);if(a!==h.Z_OK)throw new Error(d[a]);this.header=new _,s.inflateGetHeader(this.strm,this.header)}function n(t,e){var a=new i(e);if(a.push(t,!0),a.err)throw a.msg;return a.result}function r(t,e){return e=e||{},e.raw=!0,n(t,e)}var s=t("./zlib/inflate"),o=t("./utils/common"),l=t("./utils/strings"),h=t("./zlib/constants"),d=t("./zlib/messages"),f=t("./zlib/zstream"),_=t("./zlib/gzheader"),u=Object.prototype.toString;i.prototype.push=function(t,e){var a,i,n,r,d,f,_=this.strm,c=this.options.chunkSize,b=this.options.dictionary,g=!1;if(this.ended)return!1;i=e===~~e?e:e===!0?h.Z_FINISH:h.Z_NO_FLUSH,"string"==typeof t?_.input=l.binstring2buf(t):"[object ArrayBuffer]"===u.call(t)?_.input=new Uint8Array(t):_.input=t,_.next_in=0,_.avail_in=_.input.length;do{if(0===_.avail_out&&(_.output=new o.Buf8(c),_.next_out=0,_.avail_out=c),a=s.inflate(_,h.Z_NO_FLUSH),a===h.Z_NEED_DICT&&b&&(f="string"==typeof b?l.string2buf(b):"[object ArrayBuffer]"===u.call(b)?new Uint8Array(b):b,a=s.inflateSetDictionary(this.strm,f)),a===h.Z_BUF_ERROR&&g===!0&&(a=h.Z_OK,g=!1),a!==h.Z_STREAM_END&&a!==h.Z_OK)return this.onEnd(a),this.ended=!0,!1;_.next_out&&(0!==_.avail_out&&a!==h.Z_STREAM_END&&(0!==_.avail_in||i!==h.Z_FINISH&&i!==h.Z_SYNC_FLUSH)||("string"===this.options.to?(n=l.utf8border(_.output,_.next_out),r=_.next_out-n,d=l.buf2string(_.output,n),_.next_out=r,_.avail_out=c-r,r&&o.arraySet(_.output,_.output,n,r,0),this.onData(d)):this.onData(o.shrinkBuf(_.output,_.next_out)))),0===_.avail_in&&0===_.avail_out&&(g=!0)}while((_.avail_in>0||0===_.avail_out)&&a!==h.Z_STREAM_END);return a===h.Z_STREAM_END&&(i=h.Z_FINISH),i===h.Z_FINISH?(a=s.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===h.Z_OK):i!==h.Z_SYNC_FLUSH||(this.onEnd(h.Z_OK),_.avail_out=0,!0)},i.prototype.onData=function(t){this.chunks.push(t)},i.prototype.onEnd=function(t){t===h.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},a.Inflate=i,a.inflate=n,a.inflateRaw=r,a.ungzip=n},{"./utils/common":3,"./utils/strings":4,"./zlib/constants":6,"./zlib/gzheader":9,"./zlib/inflate":11,"./zlib/messages":13,"./zlib/zstream":15}],3:[function(t,e,a){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;a.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var a=e.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(var i in a)a.hasOwnProperty(i)&&(t[i]=a[i])}}return t},a.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var n={arraySet:function(t,e,a,i,n){if(e.subarray&&t.subarray)return void t.set(e.subarray(a,a+i),n);for(var r=0;r<i;r++)t[n+r]=e[a+r]},flattenChunks:function(t){var e,a,i,n,r,s;for(i=0,e=0,a=t.length;e<a;e++)i+=t[e].length;for(s=new Uint8Array(i),n=0,e=0,a=t.length;e<a;e++)r=t[e],s.set(r,n),n+=r.length;return s}},r={arraySet:function(t,e,a,i,n){for(var r=0;r<i;r++)t[n+r]=e[a+r]},flattenChunks:function(t){return[].concat.apply([],t)}};a.setTyped=function(t){t?(a.Buf8=Uint8Array,a.Buf16=Uint16Array,a.Buf32=Int32Array,a.assign(a,n)):(a.Buf8=Array,a.Buf16=Array,a.Buf32=Array,a.assign(a,r))},a.setTyped(i)},{}],4:[function(t,e,a){"use strict";function i(t,e){if(e<65537&&(t.subarray&&s||!t.subarray&&r))return String.fromCharCode.apply(null,n.shrinkBuf(t,e));for(var a="",i=0;i<e;i++)a+=String.fromCharCode(t[i]);return a}var n=t("./common"),r=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(t){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){s=!1}for(var o=new n.Buf8(256),l=0;l<256;l++)o[l]=l>=252?6:l>=248?5:l>=240?4:l>=224?3:l>=192?2:1;o[254]=o[254]=1,a.string2buf=function(t){var e,a,i,r,s,o=t.length,l=0;for(r=0;r<o;r++)a=t.charCodeAt(r),55296===(64512&a)&&r+1<o&&(i=t.charCodeAt(r+1),56320===(64512&i)&&(a=65536+(a-55296<<10)+(i-56320),r++)),l+=a<128?1:a<2048?2:a<65536?3:4;for(e=new n.Buf8(l),s=0,r=0;s<l;r++)a=t.charCodeAt(r),55296===(64512&a)&&r+1<o&&(i=t.charCodeAt(r+1),56320===(64512&i)&&(a=65536+(a-55296<<10)+(i-56320),r++)),a<128?e[s++]=a:a<2048?(e[s++]=192|a>>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},a.buf2binstring=function(t){return i(t,t.length)},a.binstring2buf=function(t){for(var e=new n.Buf8(t.length),a=0,i=e.length;a<i;a++)e[a]=t.charCodeAt(a);return e},a.buf2string=function(t,e){var a,n,r,s,l=e||t.length,h=new Array(2*l);for(n=0,a=0;a<l;)if(r=t[a++],r<128)h[n++]=r;else if(s=o[r],s>4)h[n++]=65533,a+=s-1;else{for(r&=2===s?31:3===s?15:7;s>1&&a<l;)r=r<<6|63&t[a++],s--;s>1?h[n++]=65533:r<65536?h[n++]=r:(r-=65536,h[n++]=55296|r>>10&1023,h[n++]=56320|1023&r)}return i(h,n)},a.utf8border=function(t,e){var a;for(e=e||t.length,e>t.length&&(e=t.length),a=e-1;a>=0&&128===(192&t[a]);)a--;return a<0?e:0===a?e:a+o[t[a]]>e?a:e}},{"./common":3}],5:[function(t,e,a){"use strict";function i(t,e,a,i){for(var n=65535&t|0,r=t>>>16&65535|0,s=0;0!==a;){s=a>2e3?2e3:a,a-=s;do n=n+e[i++]|0,r=r+n|0;while(--s);n%=65521,r%=65521}return n|r<<16|0}e.exports=i},{}],6:[function(t,e,a){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],7:[function(t,e,a){"use strict";function i(){for(var t,e=[],a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}function n(t,e,a,i){var n=r,s=i+a;t^=-1;for(var o=i;o<s;o++)t=t>>>8^n[255&(t^e[o])];return t^-1}var r=i();e.exports=n},{}],8:[function(t,e,a){"use strict";function i(t,e){return t.msg=D[e],e}function n(t){return(t<<1)-(t>4?9:0)}function r(t){for(var e=t.length;--e>=0;)t[e]=0}function s(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(R.arraySet(t.output,e.pending_buf,e.pending_out,a,t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))}function o(t,e){C._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,s(t.strm)}function l(t,e){t.pending_buf[t.pending++]=e}function h(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function d(t,e,a,i){var n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,R.arraySet(e,t.input,t.next_in,n,a),1===t.state.wrap?t.adler=N(t.adler,e,n,a):2===t.state.wrap&&(t.adler=O(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)}function f(t,e){var a,i,n=t.max_chain_length,r=t.strstart,s=t.prev_length,o=t.nice_match,l=t.strstart>t.w_size-ft?t.strstart-(t.w_size-ft):0,h=t.window,d=t.w_mask,f=t.prev,_=t.strstart+dt,u=h[r+s-1],c=h[r+s];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do if(a=e,h[a+s]===c&&h[a+s-1]===u&&h[a]===h[r]&&h[++a]===h[r+1]){r+=2,a++;do;while(h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&r<_);if(i=dt-(_-r),r=_-dt,i>s){if(t.match_start=e,s=i,i>=o)break;u=h[r+s-1],c=h[r+s]}}while((e=f[e&d])>l&&0!==--n);return s<=t.lookahead?s:t.lookahead}function _(t){var e,a,i,n,r,s=t.w_size;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-ft)){R.arraySet(t.window,t.window,s,s,0),t.match_start-=s,t.strstart-=s,t.block_start-=s,a=t.hash_size,e=a;do i=t.head[--e],t.head[e]=i>=s?i-s:0;while(--a);a=s,e=a;do i=t.prev[--e],t.prev[e]=i>=s?i-s:0;while(--a);n+=s}if(0===t.strm.avail_in)break;if(a=d(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=a,t.lookahead+t.insert>=ht)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=(t.ins_h<<t.hash_shift^t.window[r+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[r+ht-1])&t.hash_mask,t.prev[r&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=r,r++,t.insert--,!(t.lookahead+t.insert<ht)););}while(t.lookahead<ft&&0!==t.strm.avail_in)}function u(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(_(t),0===t.lookahead&&e===I)return vt;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+a;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,o(t,!1),0===t.strm.avail_out))return vt;if(t.strstart-t.block_start>=t.w_size-ft&&(o(t,!1),0===t.strm.avail_out))return vt}return t.insert=0,e===F?(o(t,!0),0===t.strm.avail_out?yt:xt):t.strstart>t.block_start&&(o(t,!1),0===t.strm.avail_out)?vt:vt}function c(t,e){for(var a,i;;){if(t.lookahead<ft){if(_(t),t.lookahead<ft&&e===I)return vt;if(0===t.lookahead)break}if(a=0,t.lookahead>=ht&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+ht-1])&t.hash_mask,a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-ft&&(t.match_length=f(t,a)),t.match_length>=ht)if(i=C._tr_tally(t,t.strstart-t.match_start,t.match_length-ht),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=ht){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+ht-1])&t.hash_mask,a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else i=C._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(o(t,!1),0===t.strm.avail_out))return vt}return t.insert=t.strstart<ht-1?t.strstart:ht-1,e===F?(o(t,!0),0===t.strm.avail_out?yt:xt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?vt:kt}function b(t,e){for(var a,i,n;;){if(t.lookahead<ft){if(_(t),t.lookahead<ft&&e===I)return vt;if(0===t.lookahead)break}if(a=0,t.lookahead>=ht&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+ht-1])&t.hash_mask,a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=ht-1,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-ft&&(t.match_length=f(t,a),t.match_length<=5&&(t.strategy===q||t.match_length===ht&&t.strstart-t.match_start>4096)&&(t.match_length=ht-1)),t.prev_length>=ht&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-ht,i=C._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-ht),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=n&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+ht-1])&t.hash_mask,a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(0!==--t.prev_length);if(t.match_available=0,t.match_length=ht-1,t.strstart++,i&&(o(t,!1),0===t.strm.avail_out))return vt}else if(t.match_available){if(i=C._tr_tally(t,0,t.window[t.strstart-1]),i&&o(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return vt}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=C._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<ht-1?t.strstart:ht-1,e===F?(o(t,!0),0===t.strm.avail_out?yt:xt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?vt:kt}function g(t,e){for(var a,i,n,r,s=t.window;;){if(t.lookahead<=dt){if(_(t),t.lookahead<=dt&&e===I)return vt;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=ht&&t.strstart>0&&(n=t.strstart-1,i=s[n],i===s[++n]&&i===s[++n]&&i===s[++n])){r=t.strstart+dt;do;while(i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&n<r);t.match_length=dt-(r-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=ht?(a=C._tr_tally(t,1,t.match_length-ht),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=C._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(o(t,!1),0===t.strm.avail_out))return vt}return t.insert=0,e===F?(o(t,!0),0===t.strm.avail_out?yt:xt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?vt:kt}function m(t,e){for(var a;;){if(0===t.lookahead&&(_(t),0===t.lookahead)){if(e===I)return vt;break}if(t.match_length=0,a=C._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(o(t,!1),0===t.strm.avail_out))return vt}return t.insert=0,e===F?(o(t,!0),0===t.strm.avail_out?yt:xt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?vt:kt}function w(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}function p(t){t.window_size=2*t.w_size,r(t.head),t.max_lazy_match=Z[t.level].max_lazy,t.good_match=Z[t.level].good_length,t.nice_match=Z[t.level].nice_length,t.max_chain_length=Z[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=ht-1,t.match_available=0,t.ins_h=0}function v(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=V,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new R.Buf16(2*ot),this.dyn_dtree=new R.Buf16(2*(2*rt+1)),this.bl_tree=new R.Buf16(2*(2*st+1)),r(this.dyn_ltree),r(this.dyn_dtree),r(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new R.Buf16(lt+1),this.heap=new R.Buf16(2*nt+1),r(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new R.Buf16(2*nt+1),r(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function k(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=Q,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?ut:wt,t.adler=2===e.wrap?0:1,e.last_flush=I,C._tr_init(e),H):i(t,K)}function y(t){var e=k(t);return e===H&&p(t.state),e}function x(t,e){return t&&t.state?2!==t.state.wrap?K:(t.state.gzhead=e,H):K}function z(t,e,a,n,r,s){if(!t)return K;var o=1;if(e===Y&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),r<1||r>$||a!==V||n<8||n>15||e<0||e>9||s<0||s>W)return i(t,K);8===n&&(n=9);var l=new v;return t.state=l,l.strm=t,l.wrap=o,l.gzhead=null,l.w_bits=n,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=r+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+ht-1)/ht),l.window=new R.Buf8(2*l.w_size),l.head=new R.Buf16(l.hash_size),l.prev=new R.Buf16(l.w_size),l.lit_bufsize=1<<r+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new R.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=e,l.strategy=s,l.method=a,y(t)}function B(t,e){return z(t,e,V,tt,et,J)}function S(t,e){var a,o,d,f;if(!t||!t.state||e>L||e<0)return t?i(t,K):K;if(o=t.state,!t.output||!t.input&&0!==t.avail_in||o.status===pt&&e!==F)return i(t,0===t.avail_out?P:K);if(o.strm=t,a=o.last_flush,o.last_flush=e,o.status===ut)if(2===o.wrap)t.adler=0,l(o,31),l(o,139),l(o,8),o.gzhead?(l(o,(o.gzhead.text?1:0)+(o.gzhead.hcrc?2:0)+(o.gzhead.extra?4:0)+(o.gzhead.name?8:0)+(o.gzhead.comment?16:0)),l(o,255&o.gzhead.time),l(o,o.gzhead.time>>8&255),l(o,o.gzhead.time>>16&255),l(o,o.gzhead.time>>24&255),l(o,9===o.level?2:o.strategy>=G||o.level<2?4:0),l(o,255&o.gzhead.os),o.gzhead.extra&&o.gzhead.extra.length&&(l(o,255&o.gzhead.extra.length),l(o,o.gzhead.extra.length>>8&255)),o.gzhead.hcrc&&(t.adler=O(t.adler,o.pending_buf,o.pending,0)),o.gzindex=0,o.status=ct):(l(o,0),l(o,0),l(o,0),l(o,0),l(o,0),l(o,9===o.level?2:o.strategy>=G||o.level<2?4:0),l(o,zt),o.status=wt);else{var _=V+(o.w_bits-8<<4)<<8,u=-1;u=o.strategy>=G||o.level<2?0:o.level<6?1:6===o.level?2:3,_|=u<<6,0!==o.strstart&&(_|=_t),_+=31-_%31,o.status=wt,h(o,_),0!==o.strstart&&(h(o,t.adler>>>16),h(o,65535&t.adler)),t.adler=1}if(o.status===ct)if(o.gzhead.extra){for(d=o.pending;o.gzindex<(65535&o.gzhead.extra.length)&&(o.pending!==o.pending_buf_size||(o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),s(t),d=o.pending,o.pending!==o.pending_buf_size));)l(o,255&o.gzhead.extra[o.gzindex]),o.gzindex++;o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),o.gzindex===o.gzhead.extra.length&&(o.gzindex=0,o.status=bt)}else o.status=bt;if(o.status===bt)if(o.gzhead.name){d=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),s(t),d=o.pending,o.pending===o.pending_buf_size)){f=1;break}f=o.gzindex<o.gzhead.name.length?255&o.gzhead.name.charCodeAt(o.gzindex++):0,l(o,f)}while(0!==f);o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),0===f&&(o.gzindex=0,o.status=gt)}else o.status=gt;if(o.status===gt)if(o.gzhead.comment){d=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),s(t),d=o.pending,o.pending===o.pending_buf_size)){f=1;break}f=o.gzindex<o.gzhead.comment.length?255&o.gzhead.comment.charCodeAt(o.gzindex++):0,l(o,f)}while(0!==f);o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),0===f&&(o.status=mt)}else o.status=mt;if(o.status===mt&&(o.gzhead.hcrc?(o.pending+2>o.pending_buf_size&&s(t),o.pending+2<=o.pending_buf_size&&(l(o,255&t.adler),l(o,t.adler>>8&255),t.adler=0,o.status=wt)):o.status=wt),0!==o.pending){if(s(t),0===t.avail_out)return o.last_flush=-1,H}else if(0===t.avail_in&&n(e)<=n(a)&&e!==F)return i(t,P);if(o.status===pt&&0!==t.avail_in)return i(t,P);if(0!==t.avail_in||0!==o.lookahead||e!==I&&o.status!==pt){var c=o.strategy===G?m(o,e):o.strategy===X?g(o,e):Z[o.level].func(o,e);if(c!==yt&&c!==xt||(o.status=pt),c===vt||c===yt)return 0===t.avail_out&&(o.last_flush=-1),H;if(c===kt&&(e===U?C._tr_align(o):e!==L&&(C._tr_stored_block(o,0,0,!1),e===T&&(r(o.head),0===o.lookahead&&(o.strstart=0,o.block_start=0,o.insert=0))),s(t),0===t.avail_out))return o.last_flush=-1,H}return e!==F?H:o.wrap<=0?j:(2===o.wrap?(l(o,255&t.adler),l(o,t.adler>>8&255),l(o,t.adler>>16&255),l(o,t.adler>>24&255),l(o,255&t.total_in),l(o,t.total_in>>8&255),l(o,t.total_in>>16&255),l(o,t.total_in>>24&255)):(h(o,t.adler>>>16),h(o,65535&t.adler)),s(t),o.wrap>0&&(o.wrap=-o.wrap),0!==o.pending?H:j)}function E(t){var e;return t&&t.state?(e=t.state.status,e!==ut&&e!==ct&&e!==bt&&e!==gt&&e!==mt&&e!==wt&&e!==pt?i(t,K):(t.state=null,e===wt?i(t,M):H)):K}function A(t,e){var a,i,n,s,o,l,h,d,f=e.length;if(!t||!t.state)return K;if(a=t.state,s=a.wrap,2===s||1===s&&a.status!==ut||a.lookahead)return K;for(1===s&&(t.adler=N(t.adler,e,f,0)),a.wrap=0,f>=a.w_size&&(0===s&&(r(a.head),a.strstart=0,a.block_start=0,a.insert=0),d=new R.Buf8(a.w_size),R.arraySet(d,e,f-a.w_size,a.w_size,0),e=d,f=a.w_size),o=t.avail_in,l=t.next_in,h=t.input,t.avail_in=f,t.next_in=0,t.input=e,_(a);a.lookahead>=ht;){i=a.strstart,n=a.lookahead-(ht-1);do a.ins_h=(a.ins_h<<a.hash_shift^a.window[i+ht-1])&a.hash_mask,a.prev[i&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=i,i++;while(--n);a.strstart=i,a.lookahead=ht-1,_(a)}return a.strstart+=a.lookahead,a.block_start=a.strstart,a.insert=a.lookahead,a.lookahead=0,a.match_length=a.prev_length=ht-1,a.match_available=0,t.next_in=l,t.input=h,t.avail_in=o,a.wrap=s,H}var Z,R=t("../utils/common"),C=t("./trees"),N=t("./adler32"),O=t("./crc32"),D=t("./messages"),I=0,U=1,T=3,F=4,L=5,H=0,j=1,K=-2,M=-3,P=-5,Y=-1,q=1,G=2,X=3,W=4,J=0,Q=2,V=8,$=9,tt=15,et=8,at=29,it=256,nt=it+1+at,rt=30,st=19,ot=2*nt+1,lt=15,ht=3,dt=258,ft=dt+ht+1,_t=32,ut=42,ct=69,bt=73,gt=91,mt=103,wt=113,pt=666,vt=1,kt=2,yt=3,xt=4,zt=3;Z=[new w(0,0,0,0,u),new w(4,4,8,4,c),new w(4,5,16,8,c),new w(4,6,32,32,c),new w(4,4,16,16,b),new w(8,16,32,32,b),new w(8,16,128,128,b),new w(8,32,128,256,b),new w(32,128,258,1024,b),new w(32,258,258,4096,b)],a.deflateInit=B,a.deflateInit2=z,a.deflateReset=y,a.deflateResetKeep=k,a.deflateSetHeader=x,a.deflate=S,a.deflateEnd=E,a.deflateSetDictionary=A,a.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":3,"./adler32":5,"./crc32":7,"./messages":13,"./trees":14}],9:[function(t,e,a){"use strict";function i(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}e.exports=i},{}],10:[function(t,e,a){"use strict";var i=30,n=12;e.exports=function(t,e){var a,r,s,o,l,h,d,f,_,u,c,b,g,m,w,p,v,k,y,x,z,B,S,E,A;a=t.state,r=t.next_in,E=t.input,s=r+(t.avail_in-5),o=t.next_out,A=t.output,l=o-(e-t.avail_out),h=o+(t.avail_out-257),d=a.dmax,f=a.wsize,_=a.whave,u=a.wnext,c=a.window,b=a.hold,g=a.bits,m=a.lencode,w=a.distcode,p=(1<<a.lenbits)-1,v=(1<<a.distbits)-1;t:do{g<15&&(b+=E[r++]<<g,g+=8,b+=E[r++]<<g,g+=8),k=m[b&p];e:for(;;){if(y=k>>>24,b>>>=y,g-=y,y=k>>>16&255,0===y)A[o++]=65535&k;else{if(!(16&y)){if(0===(64&y)){k=m[(65535&k)+(b&(1<<y)-1)];continue e}if(32&y){a.mode=n;break t}t.msg="invalid literal/length code",a.mode=i;break t}x=65535&k,y&=15,y&&(g<y&&(b+=E[r++]<<g,g+=8),x+=b&(1<<y)-1,b>>>=y,g-=y),g<15&&(b+=E[r++]<<g,g+=8,b+=E[r++]<<g,g+=8),k=w[b&v];a:for(;;){if(y=k>>>24,b>>>=y,g-=y,y=k>>>16&255,!(16&y)){if(0===(64&y)){k=w[(65535&k)+(b&(1<<y)-1)];continue a}t.msg="invalid distance code",a.mode=i;break t}if(z=65535&k,y&=15,g<y&&(b+=E[r++]<<g,g+=8,g<y&&(b+=E[r++]<<g,g+=8)),z+=b&(1<<y)-1,z>d){t.msg="invalid distance too far back",a.mode=i;break t}if(b>>>=y,g-=y,y=o-l,z>y){if(y=z-y,y>_&&a.sane){t.msg="invalid distance too far back",a.mode=i;break t}if(B=0,S=c,0===u){if(B+=f-y,y<x){x-=y;do A[o++]=c[B++];while(--y);B=o-z,S=A}}else if(u<y){if(B+=f+u-y,y-=u,y<x){x-=y;do A[o++]=c[B++];while(--y);if(B=0,u<x){y=u,x-=y;do A[o++]=c[B++];while(--y);B=o-z,S=A}}}else if(B+=u-y,y<x){x-=y;do A[o++]=c[B++];while(--y);B=o-z,S=A}for(;x>2;)A[o++]=S[B++],A[o++]=S[B++],A[o++]=S[B++],x-=3;x&&(A[o++]=S[B++],x>1&&(A[o++]=S[B++]))}else{B=o-z;do A[o++]=A[B++],A[o++]=A[B++],A[o++]=A[B++],x-=3;while(x>2);x&&(A[o++]=A[B++],x>1&&(A[o++]=A[B++]))}break}}break}}while(r<s&&o<h);x=g>>3,r-=x,g-=x<<3,b&=(1<<g)-1,t.next_in=r,t.next_out=o,t.avail_in=r<s?5+(s-r):5-(r-s),t.avail_out=o<h?257+(h-o):257-(o-h),a.hold=b,a.bits=g}},{}],11:[function(t,e,a){"use strict";function i(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function n(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new w.Buf16(320),this.work=new w.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function r(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=T,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new w.Buf32(bt),e.distcode=e.distdyn=new w.Buf32(gt),e.sane=1,e.back=-1,Z):N}function s(t){var e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,r(t)):N}function o(t,e){var a,i;return t&&t.state?(i=t.state,e<0?(a=0,e=-e):(a=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15)?N:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,s(t))):N}function l(t,e){var a,i;return t?(i=new n,t.state=i,i.window=null,a=o(t,e),a!==Z&&(t.state=null),a):N}function h(t){return l(t,wt)}function d(t){if(pt){var e;for(g=new w.Buf32(512),m=new w.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(y(z,t.lens,0,288,g,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;y(B,t.lens,0,32,m,0,t.work,{bits:5}),pt=!1}t.lencode=g,t.lenbits=9,t.distcode=m,t.distbits=5}function f(t,e,a,i){var n,r=t.state;return null===r.window&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new w.Buf8(r.wsize)),i>=r.wsize?(w.arraySet(r.window,e,a-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):(n=r.wsize-r.wnext,n>i&&(n=i),w.arraySet(r.window,e,a-i,n,r.wnext),i-=n,i?(w.arraySet(r.window,e,a-i,i,0),r.wnext=i,r.whave=r.wsize):(r.wnext+=n,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=n))),0}function _(t,e){var a,n,r,s,o,l,h,_,u,c,b,g,m,bt,gt,mt,wt,pt,vt,kt,yt,xt,zt,Bt,St=0,Et=new w.Buf8(4),At=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return N;a=t.state,a.mode===X&&(a.mode=W),o=t.next_out,r=t.output,h=t.avail_out,s=t.next_in,n=t.input,l=t.avail_in,_=a.hold,u=a.bits,c=l,b=h,xt=Z;t:for(;;)switch(a.mode){case T:if(0===a.wrap){a.mode=W;break}for(;u<16;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(2&a.wrap&&35615===_){a.check=0,Et[0]=255&_,Et[1]=_>>>8&255,a.check=v(a.check,Et,2,0),_=0,u=0,a.mode=F;break}if(a.flags=0,a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&_)<<8)+(_>>8))%31){t.msg="incorrect header check",a.mode=_t;break}if((15&_)!==U){t.msg="unknown compression method",a.mode=_t;break}if(_>>>=4,u-=4,yt=(15&_)+8,0===a.wbits)a.wbits=yt;else if(yt>a.wbits){t.msg="invalid window size",a.mode=_t;break}a.dmax=1<<yt,t.adler=a.check=1,a.mode=512&_?q:X,_=0,u=0;break;case F:for(;u<16;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(a.flags=_,(255&a.flags)!==U){t.msg="unknown compression method",a.mode=_t;break}if(57344&a.flags){t.msg="unknown header flags set",a.mode=_t;break}a.head&&(a.head.text=_>>8&1),512&a.flags&&(Et[0]=255&_,Et[1]=_>>>8&255,a.check=v(a.check,Et,2,0)),_=0,u=0,a.mode=L;case L:for(;u<32;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.head&&(a.head.time=_),512&a.flags&&(Et[0]=255&_,Et[1]=_>>>8&255,Et[2]=_>>>16&255,Et[3]=_>>>24&255,a.check=v(a.check,Et,4,0)),_=0,u=0,a.mode=H;case H:for(;u<16;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.head&&(a.head.xflags=255&_,a.head.os=_>>8),512&a.flags&&(Et[0]=255&_,Et[1]=_>>>8&255,a.check=v(a.check,Et,2,0)),_=0,u=0,a.mode=j;case j:if(1024&a.flags){for(;u<16;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.length=_,a.head&&(a.head.extra_len=_),512&a.flags&&(Et[0]=255&_,Et[1]=_>>>8&255,a.check=v(a.check,Et,2,0)),_=0,u=0}else a.head&&(a.head.extra=null);a.mode=K;case K:if(1024&a.flags&&(g=a.length,g>l&&(g=l),g&&(a.head&&(yt=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Array(a.head.extra_len)),w.arraySet(a.head.extra,n,s,g,yt)),512&a.flags&&(a.check=v(a.check,n,g,s)),l-=g,s+=g,a.length-=g),a.length))break t;a.length=0,a.mode=M;case M:if(2048&a.flags){if(0===l)break t;g=0;do yt=n[s+g++],a.head&&yt&&a.length<65536&&(a.head.name+=String.fromCharCode(yt));while(yt&&g<l);if(512&a.flags&&(a.check=v(a.check,n,g,s)),l-=g,s+=g,yt)break t}else a.head&&(a.head.name=null);a.length=0,a.mode=P;case P:if(4096&a.flags){if(0===l)break t;g=0;do yt=n[s+g++],a.head&&yt&&a.length<65536&&(a.head.comment+=String.fromCharCode(yt));while(yt&&g<l);if(512&a.flags&&(a.check=v(a.check,n,g,s)),l-=g,s+=g,yt)break t}else a.head&&(a.head.comment=null);a.mode=Y;case Y:if(512&a.flags){for(;u<16;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(_!==(65535&a.check)){t.msg="header crc mismatch",a.mode=_t;break}_=0,u=0}a.head&&(a.head.hcrc=a.flags>>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=X;break;case q:for(;u<32;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}t.adler=a.check=i(_),_=0,u=0,a.mode=G;case G:if(0===a.havedict)return t.next_out=o,t.avail_out=h,t.next_in=s,t.avail_in=l,a.hold=_,a.bits=u,C;t.adler=a.check=1,a.mode=X;case X:if(e===E||e===A)break t;case W:if(a.last){_>>>=7&u,u-=7&u,a.mode=ht;break}for(;u<3;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}switch(a.last=1&_,_>>>=1,u-=1,3&_){case 0:a.mode=J;break;case 1:if(d(a),a.mode=at,e===A){_>>>=2,u-=2;break t}break;case 2:a.mode=$;break;case 3:t.msg="invalid block type",a.mode=_t}_>>>=2,u-=2;break;case J:for(_>>>=7&u,u-=7&u;u<32;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if((65535&_)!==(_>>>16^65535)){t.msg="invalid stored block lengths",a.mode=_t;break}if(a.length=65535&_,_=0,u=0,a.mode=Q,e===A)break t;case Q:a.mode=V;case V:if(g=a.length){if(g>l&&(g=l),g>h&&(g=h),0===g)break t;w.arraySet(r,n,s,g,o),l-=g,s+=g,h-=g,o+=g,a.length-=g;break}a.mode=X;break;case $:for(;u<14;){if(0===l)break t;
l--,_+=n[s++]<<u,u+=8}if(a.nlen=(31&_)+257,_>>>=5,u-=5,a.ndist=(31&_)+1,_>>>=5,u-=5,a.ncode=(15&_)+4,_>>>=4,u-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=_t;break}a.have=0,a.mode=tt;case tt:for(;a.have<a.ncode;){for(;u<3;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.lens[At[a.have++]]=7&_,_>>>=3,u-=3}for(;a.have<19;)a.lens[At[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,zt={bits:a.lenbits},xt=y(x,a.lens,0,19,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid code lengths set",a.mode=_t;break}a.have=0,a.mode=et;case et:for(;a.have<a.nlen+a.ndist;){for(;St=a.lencode[_&(1<<a.lenbits)-1],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(wt<16)_>>>=gt,u-=gt,a.lens[a.have++]=wt;else{if(16===wt){for(Bt=gt+2;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(_>>>=gt,u-=gt,0===a.have){t.msg="invalid bit length repeat",a.mode=_t;break}yt=a.lens[a.have-1],g=3+(3&_),_>>>=2,u-=2}else if(17===wt){for(Bt=gt+3;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=gt,u-=gt,yt=0,g=3+(7&_),_>>>=3,u-=3}else{for(Bt=gt+7;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=gt,u-=gt,yt=0,g=11+(127&_),_>>>=7,u-=7}if(a.have+g>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=_t;break}for(;g--;)a.lens[a.have++]=yt}}if(a.mode===_t)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=_t;break}if(a.lenbits=9,zt={bits:a.lenbits},xt=y(z,a.lens,0,a.nlen,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid literal/lengths set",a.mode=_t;break}if(a.distbits=6,a.distcode=a.distdyn,zt={bits:a.distbits},xt=y(B,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,zt),a.distbits=zt.bits,xt){t.msg="invalid distances set",a.mode=_t;break}if(a.mode=at,e===A)break t;case at:a.mode=it;case it:if(l>=6&&h>=258){t.next_out=o,t.avail_out=h,t.next_in=s,t.avail_in=l,a.hold=_,a.bits=u,k(t,b),o=t.next_out,r=t.output,h=t.avail_out,s=t.next_in,n=t.input,l=t.avail_in,_=a.hold,u=a.bits,a.mode===X&&(a.back=-1);break}for(a.back=0;St=a.lencode[_&(1<<a.lenbits)-1],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(mt&&0===(240&mt)){for(pt=gt,vt=mt,kt=wt;St=a.lencode[kt+((_&(1<<pt+vt)-1)>>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=pt,u-=pt,a.back+=pt}if(_>>>=gt,u-=gt,a.back+=gt,a.length=wt,0===mt){a.mode=lt;break}if(32&mt){a.back=-1,a.mode=X;break}if(64&mt){t.msg="invalid literal/length code",a.mode=_t;break}a.extra=15&mt,a.mode=nt;case nt:if(a.extra){for(Bt=a.extra;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.length+=_&(1<<a.extra)-1,_>>>=a.extra,u-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=rt;case rt:for(;St=a.distcode[_&(1<<a.distbits)-1],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(0===(240&mt)){for(pt=gt,vt=mt,kt=wt;St=a.distcode[kt+((_&(1<<pt+vt)-1)>>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=pt,u-=pt,a.back+=pt}if(_>>>=gt,u-=gt,a.back+=gt,64&mt){t.msg="invalid distance code",a.mode=_t;break}a.offset=wt,a.extra=15&mt,a.mode=st;case st:if(a.extra){for(Bt=a.extra;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.offset+=_&(1<<a.extra)-1,_>>>=a.extra,u-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=_t;break}a.mode=ot;case ot:if(0===h)break t;if(g=b-h,a.offset>g){if(g=a.offset-g,g>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=_t;break}g>a.wnext?(g-=a.wnext,m=a.wsize-g):m=a.wnext-g,g>a.length&&(g=a.length),bt=a.window}else bt=r,m=o-a.offset,g=a.length;g>h&&(g=h),h-=g,a.length-=g;do r[o++]=bt[m++];while(--g);0===a.length&&(a.mode=it);break;case lt:if(0===h)break t;r[o++]=a.length,h--,a.mode=it;break;case ht:if(a.wrap){for(;u<32;){if(0===l)break t;l--,_|=n[s++]<<u,u+=8}if(b-=h,t.total_out+=b,a.total+=b,b&&(t.adler=a.check=a.flags?v(a.check,r,b,o-b):p(a.check,r,b,o-b)),b=h,(a.flags?_:i(_))!==a.check){t.msg="incorrect data check",a.mode=_t;break}_=0,u=0}a.mode=dt;case dt:if(a.wrap&&a.flags){for(;u<32;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(_!==(4294967295&a.total)){t.msg="incorrect length check",a.mode=_t;break}_=0,u=0}a.mode=ft;case ft:xt=R;break t;case _t:xt=O;break t;case ut:return D;case ct:default:return N}return t.next_out=o,t.avail_out=h,t.next_in=s,t.avail_in=l,a.hold=_,a.bits=u,(a.wsize||b!==t.avail_out&&a.mode<_t&&(a.mode<ht||e!==S))&&f(t,t.output,t.next_out,b-t.avail_out)?(a.mode=ut,D):(c-=t.avail_in,b-=t.avail_out,t.total_in+=c,t.total_out+=b,a.total+=b,a.wrap&&b&&(t.adler=a.check=a.flags?v(a.check,r,b,t.next_out-b):p(a.check,r,b,t.next_out-b)),t.data_type=a.bits+(a.last?64:0)+(a.mode===X?128:0)+(a.mode===at||a.mode===Q?256:0),(0===c&&0===b||e===S)&&xt===Z&&(xt=I),xt)}function u(t){if(!t||!t.state)return N;var e=t.state;return e.window&&(e.window=null),t.state=null,Z}function c(t,e){var a;return t&&t.state?(a=t.state,0===(2&a.wrap)?N:(a.head=e,e.done=!1,Z)):N}function b(t,e){var a,i,n,r=e.length;return t&&t.state?(a=t.state,0!==a.wrap&&a.mode!==G?N:a.mode===G&&(i=1,i=p(i,e,r,0),i!==a.check)?O:(n=f(t,e,r,r))?(a.mode=ut,D):(a.havedict=1,Z)):N}var g,m,w=t("../utils/common"),p=t("./adler32"),v=t("./crc32"),k=t("./inffast"),y=t("./inftrees"),x=0,z=1,B=2,S=4,E=5,A=6,Z=0,R=1,C=2,N=-2,O=-3,D=-4,I=-5,U=8,T=1,F=2,L=3,H=4,j=5,K=6,M=7,P=8,Y=9,q=10,G=11,X=12,W=13,J=14,Q=15,V=16,$=17,tt=18,et=19,at=20,it=21,nt=22,rt=23,st=24,ot=25,lt=26,ht=27,dt=28,ft=29,_t=30,ut=31,ct=32,bt=852,gt=592,mt=15,wt=mt,pt=!0;a.inflateReset=s,a.inflateReset2=o,a.inflateResetKeep=r,a.inflateInit=h,a.inflateInit2=l,a.inflate=_,a.inflateEnd=u,a.inflateGetHeader=c,a.inflateSetDictionary=b,a.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":3,"./adler32":5,"./crc32":7,"./inffast":10,"./inftrees":12}],12:[function(t,e,a){"use strict";var i=t("../utils/common"),n=15,r=852,s=592,o=0,l=1,h=2,d=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],f=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],_=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],u=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,a,c,b,g,m,w){var p,v,k,y,x,z,B,S,E,A=w.bits,Z=0,R=0,C=0,N=0,O=0,D=0,I=0,U=0,T=0,F=0,L=null,H=0,j=new i.Buf16(n+1),K=new i.Buf16(n+1),M=null,P=0;for(Z=0;Z<=n;Z++)j[Z]=0;for(R=0;R<c;R++)j[e[a+R]]++;for(O=A,N=n;N>=1&&0===j[N];N--);if(O>N&&(O=N),0===N)return b[g++]=20971520,b[g++]=20971520,w.bits=1,0;for(C=1;C<N&&0===j[C];C++);for(O<C&&(O=C),U=1,Z=1;Z<=n;Z++)if(U<<=1,U-=j[Z],U<0)return-1;if(U>0&&(t===o||1!==N))return-1;for(K[1]=0,Z=1;Z<n;Z++)K[Z+1]=K[Z]+j[Z];for(R=0;R<c;R++)0!==e[a+R]&&(m[K[e[a+R]]++]=R);if(t===o?(L=M=m,z=19):t===l?(L=d,H-=257,M=f,P-=257,z=256):(L=_,M=u,z=-1),F=0,R=0,Z=C,x=g,D=O,I=0,k=-1,T=1<<O,y=T-1,t===l&&T>r||t===h&&T>s)return 1;for(var Y=0;;){Y++,B=Z-I,m[R]<z?(S=0,E=m[R]):m[R]>z?(S=M[P+m[R]],E=L[H+m[R]]):(S=96,E=0),p=1<<Z-I,v=1<<D,C=v;do v-=p,b[x+(F>>I)+v]=B<<24|S<<16|E|0;while(0!==v);for(p=1<<Z-1;F&p;)p>>=1;if(0!==p?(F&=p-1,F+=p):F=0,R++,0===--j[Z]){if(Z===N)break;Z=e[a+m[R]]}if(Z>O&&(F&y)!==k){for(0===I&&(I=O),x+=C,D=Z-I,U=1<<D;D+I<N&&(U-=j[D+I],!(U<=0));)D++,U<<=1;if(T+=1<<D,t===l&&T>r||t===h&&T>s)return 1;k=F&y,b[k]=O<<24|D<<16|x-g|0}}return 0!==F&&(b[x+F]=Z-I<<24|64<<16|0),w.bits=O,0}},{"../utils/common":3}],13:[function(t,e,a){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],14:[function(t,e,a){"use strict";function i(t){for(var e=t.length;--e>=0;)t[e]=0}function n(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function r(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function s(t){return t<256?lt[t]:lt[256+(t>>>7)]}function o(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function l(t,e,a){t.bi_valid>W-a?(t.bi_buf|=e<<t.bi_valid&65535,o(t,t.bi_buf),t.bi_buf=e>>W-t.bi_valid,t.bi_valid+=a-W):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)}function h(t,e,a){l(t,a[2*e],a[2*e+1])}function d(t,e){var a=0;do a|=1&t,t>>>=1,a<<=1;while(--e>0);return a>>>1}function f(t){16===t.bi_valid?(o(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function _(t,e){var a,i,n,r,s,o,l=e.dyn_tree,h=e.max_code,d=e.stat_desc.static_tree,f=e.stat_desc.has_stree,_=e.stat_desc.extra_bits,u=e.stat_desc.extra_base,c=e.stat_desc.max_length,b=0;for(r=0;r<=X;r++)t.bl_count[r]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<G;a++)i=t.heap[a],r=l[2*l[2*i+1]+1]+1,r>c&&(r=c,b++),l[2*i+1]=r,i>h||(t.bl_count[r]++,s=0,i>=u&&(s=_[i-u]),o=l[2*i],t.opt_len+=o*(r+s),f&&(t.static_len+=o*(d[2*i+1]+s)));if(0!==b){do{for(r=c-1;0===t.bl_count[r];)r--;t.bl_count[r]--,t.bl_count[r+1]+=2,t.bl_count[c]--,b-=2}while(b>0);for(r=c;0!==r;r--)for(i=t.bl_count[r];0!==i;)n=t.heap[--a],n>h||(l[2*n+1]!==r&&(t.opt_len+=(r-l[2*n+1])*l[2*n],l[2*n+1]=r),i--)}}function u(t,e,a){var i,n,r=new Array(X+1),s=0;for(i=1;i<=X;i++)r[i]=s=s+a[i-1]<<1;for(n=0;n<=e;n++){var o=t[2*n+1];0!==o&&(t[2*n]=d(r[o]++,o))}}function c(){var t,e,a,i,r,s=new Array(X+1);for(a=0,i=0;i<K-1;i++)for(dt[i]=a,t=0;t<1<<et[i];t++)ht[a++]=i;for(ht[a-1]=i,r=0,i=0;i<16;i++)for(ft[i]=r,t=0;t<1<<at[i];t++)lt[r++]=i;for(r>>=7;i<Y;i++)for(ft[i]=r<<7,t=0;t<1<<at[i]-7;t++)lt[256+r++]=i;for(e=0;e<=X;e++)s[e]=0;for(t=0;t<=143;)st[2*t+1]=8,t++,s[8]++;for(;t<=255;)st[2*t+1]=9,t++,s[9]++;for(;t<=279;)st[2*t+1]=7,t++,s[7]++;for(;t<=287;)st[2*t+1]=8,t++,s[8]++;for(u(st,P+1,s),t=0;t<Y;t++)ot[2*t+1]=5,ot[2*t]=d(t,5);_t=new n(st,et,M+1,P,X),ut=new n(ot,at,0,Y,X),ct=new n(new Array(0),it,0,q,J)}function b(t){var e;for(e=0;e<P;e++)t.dyn_ltree[2*e]=0;for(e=0;e<Y;e++)t.dyn_dtree[2*e]=0;for(e=0;e<q;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*Q]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function g(t){t.bi_valid>8?o(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function m(t,e,a,i){g(t),i&&(o(t,a),o(t,~a)),N.arraySet(t.pending_buf,t.window,e,a,t.pending),t.pending+=a}function w(t,e,a,i){var n=2*e,r=2*a;return t[n]<t[r]||t[n]===t[r]&&i[e]<=i[a]}function p(t,e,a){for(var i=t.heap[a],n=a<<1;n<=t.heap_len&&(n<t.heap_len&&w(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!w(e,i,t.heap[n],t.depth));)t.heap[a]=t.heap[n],a=n,n<<=1;t.heap[a]=i}function v(t,e,a){var i,n,r,o,d=0;if(0!==t.last_lit)do i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],n=t.pending_buf[t.l_buf+d],d++,0===i?h(t,n,e):(r=ht[n],h(t,r+M+1,e),o=et[r],0!==o&&(n-=dt[r],l(t,n,o)),i--,r=s(i),h(t,r,a),o=at[r],0!==o&&(i-=ft[r],l(t,i,o)));while(d<t.last_lit);h(t,Q,e)}function k(t,e){var a,i,n,r=e.dyn_tree,s=e.stat_desc.static_tree,o=e.stat_desc.has_stree,l=e.stat_desc.elems,h=-1;for(t.heap_len=0,t.heap_max=G,a=0;a<l;a++)0!==r[2*a]?(t.heap[++t.heap_len]=h=a,t.depth[a]=0):r[2*a+1]=0;for(;t.heap_len<2;)n=t.heap[++t.heap_len]=h<2?++h:0,r[2*n]=1,t.depth[n]=0,t.opt_len--,o&&(t.static_len-=s[2*n+1]);for(e.max_code=h,a=t.heap_len>>1;a>=1;a--)p(t,r,a);n=l;do a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],p(t,r,1),i=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=i,r[2*n]=r[2*a]+r[2*i],t.depth[n]=(t.depth[a]>=t.depth[i]?t.depth[a]:t.depth[i])+1,r[2*a+1]=r[2*i+1]=n,t.heap[1]=n++,p(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],_(t,e),u(r,h,t.bl_count)}function y(t,e,a){var i,n,r=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=s,s=e[2*(i+1)+1],++o<l&&n===s||(o<h?t.bl_tree[2*n]+=o:0!==n?(n!==r&&t.bl_tree[2*n]++,t.bl_tree[2*V]++):o<=10?t.bl_tree[2*$]++:t.bl_tree[2*tt]++,o=0,r=n,0===s?(l=138,h=3):n===s?(l=6,h=3):(l=7,h=4))}function x(t,e,a){var i,n,r=-1,s=e[1],o=0,d=7,f=4;for(0===s&&(d=138,f=3),i=0;i<=a;i++)if(n=s,s=e[2*(i+1)+1],!(++o<d&&n===s)){if(o<f){do h(t,n,t.bl_tree);while(0!==--o)}else 0!==n?(n!==r&&(h(t,n,t.bl_tree),o--),h(t,V,t.bl_tree),l(t,o-3,2)):o<=10?(h(t,$,t.bl_tree),l(t,o-3,3)):(h(t,tt,t.bl_tree),l(t,o-11,7));o=0,r=n,0===s?(d=138,f=3):n===s?(d=6,f=3):(d=7,f=4)}}function z(t){var e;for(y(t,t.dyn_ltree,t.l_desc.max_code),y(t,t.dyn_dtree,t.d_desc.max_code),k(t,t.bl_desc),e=q-1;e>=3&&0===t.bl_tree[2*nt[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function B(t,e,a,i){var n;for(l(t,e-257,5),l(t,a-1,5),l(t,i-4,4),n=0;n<i;n++)l(t,t.bl_tree[2*nt[n]+1],3);x(t,t.dyn_ltree,e-1),x(t,t.dyn_dtree,a-1)}function S(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return D;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return I;for(e=32;e<M;e++)if(0!==t.dyn_ltree[2*e])return I;return D}function E(t){bt||(c(),bt=!0),t.l_desc=new r(t.dyn_ltree,_t),t.d_desc=new r(t.dyn_dtree,ut),t.bl_desc=new r(t.bl_tree,ct),t.bi_buf=0,t.bi_valid=0,b(t)}function A(t,e,a,i){l(t,(T<<1)+(i?1:0),3),m(t,e,a,!0)}function Z(t){l(t,F<<1,3),h(t,Q,st),f(t)}function R(t,e,a,i){var n,r,s=0;t.level>0?(t.strm.data_type===U&&(t.strm.data_type=S(t)),k(t,t.l_desc),k(t,t.d_desc),s=z(t),n=t.opt_len+3+7>>>3,r=t.static_len+3+7>>>3,r<=n&&(n=r)):n=r=a+5,a+4<=n&&e!==-1?A(t,e,a,i):t.strategy===O||r===n?(l(t,(F<<1)+(i?1:0),3),v(t,st,ot)):(l(t,(L<<1)+(i?1:0),3),B(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),v(t,t.dyn_ltree,t.dyn_dtree)),b(t),i&&g(t)}function C(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(ht[a]+M+1)]++,t.dyn_dtree[2*s(e)]++),t.last_lit===t.lit_bufsize-1}var N=t("../utils/common"),O=4,D=0,I=1,U=2,T=0,F=1,L=2,H=3,j=258,K=29,M=256,P=M+1+K,Y=30,q=19,G=2*P+1,X=15,W=16,J=7,Q=256,V=16,$=17,tt=18,et=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],at=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],it=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],nt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],rt=512,st=new Array(2*(P+2));i(st);var ot=new Array(2*Y);i(ot);var lt=new Array(rt);i(lt);var ht=new Array(j-H+1);i(ht);var dt=new Array(K);i(dt);var ft=new Array(Y);i(ft);var _t,ut,ct,bt=!1;a._tr_init=E,a._tr_stored_block=A,a._tr_flush_block=R,a._tr_tally=C,a._tr_align=Z},{"../utils/common":3}],15:[function(t,e,a){"use strict";function i(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}e.exports=i},{}],"/":[function(t,e,a){"use strict";var i=t("./lib/utils/common").assign,n=t("./lib/deflate"),r=t("./lib/inflate"),s=t("./lib/zlib/constants"),o={};i(o,n,r,s),e.exports=o},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/")});

/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
var saveAs=saveAs||function(e){"use strict";if(typeof e==="undefined"||typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in r,a=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},i=/constructor/i.test(e.HTMLElement)||e.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),u=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},s="application/octet-stream",d=1e3*40,c=function(e){var t=function(){if(typeof e==="string"){n().revokeObjectURL(e)}else{e.remove()}};setTimeout(t,d)},l=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var o=e["on"+t[r]];if(typeof o==="function"){try{o.call(e,n||e)}catch(a){u(a)}}}},p=function(e){if(/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)){return new Blob([String.fromCharCode(65279),e],{type:e.type})}return e},v=function(t,u,d){if(!d){t=p(t)}var v=this,w=t.type,m=w===s,y,h=function(){l(v,"writestart progress write writeend".split(" "))},S=function(){if((f||m&&i)&&e.FileReader){var r=new FileReader;r.onloadend=function(){var t=f?r.result:r.result.replace(/^data:[^;]*;/,"data:attachment/file;");var n=e.open(t,"_blank");if(!n)e.location.href=t;t=undefined;v.readyState=v.DONE;h()};r.readAsDataURL(t);v.readyState=v.INIT;return}if(!y){y=n().createObjectURL(t)}if(m){e.location.href=y}else{var o=e.open(y,"_blank");if(!o){e.location.href=y}}v.readyState=v.DONE;h();c(y)};v.readyState=v.INIT;if(o){y=n().createObjectURL(t);setTimeout(function(){r.href=y;r.download=u;a(r);h();c(y);v.readyState=v.DONE});return}S()},w=v.prototype,m=function(e,t,n){return new v(e,t||e.name||"download",n)};if(typeof navigator!=="undefined"&&navigator.msSaveOrOpenBlob){return function(e,t,n){t=t||e.name||"download";if(!n){e=p(e)}return navigator.msSaveOrOpenBlob(e,t)}}w.abort=function(){};w.readyState=w.INIT=0;w.WRITING=1;w.DONE=2;w.error=w.onwritestart=w.onprogress=w.onwrite=w.onabort=w.onerror=w.onwriteend=null;return m}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||this.content);if(typeof module!=="undefined"&&module.exports){module.exports.saveAs=saveAs}else if(typeof define!=="undefined"&&define!==null&&define.amd!==null){define("FileSaver.js",function(){return saveAs})}

if(typeof define == "function" && define.__amd) {
	define.amd = define.__amd;
	delete define.__amd;
}