Nicolas Cannasse пре 4 година
родитељ
комит
2c3ae9c064
65 измењених фајлова са 250 додато и 250 уклоњено
  1. 1 1
      h2d/Anim.hx
  2. 1 1
      h2d/Bitmap.hx
  3. 10 10
      h2d/Camera.hx
  4. 1 1
      h2d/Console.hx
  5. 1 1
      h2d/Drawable.hx
  6. 2 2
      h2d/Dropdown.hx
  7. 1 1
      h2d/Graphics.hx
  8. 1 1
      h2d/Interactive.hx
  9. 1 1
      h2d/Object.hx
  10. 4 4
      h2d/Particles.hx
  11. 7 7
      h2d/RenderContext.hx
  12. 1 1
      h2d/ScaleGrid.hx
  13. 6 6
      h2d/Scene.hx
  14. 1 1
      h2d/Slider.hx
  15. 1 1
      h2d/SpriteBatch.hx
  16. 4 4
      h2d/Text.hx
  17. 3 3
      h2d/Tile.hx
  18. 9 9
      h2d/Video.hx
  19. 2 2
      h2d/ZGroup.hx
  20. 3 3
      h2d/col/Bounds.hx
  21. 1 1
      h2d/col/PixelsCollider.hx
  22. 1 1
      h2d/col/Polygon.hx
  23. 1 1
      h2d/col/Polygons.hx
  24. 1 1
      h2d/col/Ray.hx
  25. 1 1
      h2d/col/Segment.hx
  26. 1 1
      h2d/col/Segments.hx
  27. 4 4
      h2d/col/Voronoi.hx
  28. 2 2
      h2d/filter/AbstractMask.hx
  29. 1 1
      h2d/filter/ColorMatrix.hx
  30. 1 1
      h2d/filter/Filter.hx
  31. 2 2
      h2d/filter/Group.hx
  32. 1 1
      h2d/filter/Shader.hx
  33. 1 1
      h2d/impl/BatchDrawState.hx
  34. 1 1
      h3d/pass/Copy.hx
  35. 1 1
      h3d/shader/AlphaMap.hx
  36. 2 2
      h3d/shader/SignedDistanceField.hx
  37. 4 4
      h3d/shader/SkinBase.hx
  38. 1 1
      hxd/Charset.hx
  39. 18 18
      hxd/fmt/bfnt/FontParser.hx
  40. 9 9
      hxd/fmt/bfnt/Reader.hx
  41. 8 8
      hxd/fmt/bfnt/Writer.hx
  42. 1 1
      hxd/fmt/blend/Data.hx
  43. 30 30
      hxd/fmt/fbx/Parser.hx
  44. 3 3
      hxd/fmt/hmd/Reader.hx
  45. 1 1
      hxd/fmt/pak/FileSystem.hx
  46. 1 1
      hxd/res/Atlas.hx
  47. 7 7
      hxd/res/BDFFont.hx
  48. 2 2
      hxd/snd/Mp3Data.hx
  49. 12 12
      hxd/snd/NativeChannel.hx
  50. 1 1
      hxd/snd/effect/Pitch.hx
  51. 1 1
      hxd/snd/openal/LowPassDriver.hx
  52. 2 2
      hxd/snd/webaudio/AudioTypes.hx
  53. 4 4
      hxd/snd/webaudio/Context.hx
  54. 3 3
      hxd/snd/webaudio/Driver.hx
  55. 1 1
      hxsl/CacheFileBuilder.hx
  56. 1 1
      hxsl/Serializer.hx
  57. 1 1
      samples/Camera2D.hx
  58. 7 7
      samples/Cursor.hx
  59. 6 6
      samples/Generator.hx
  60. 2 2
      samples/Interactive2D.hx
  61. 36 36
      samples/Particles2d.hx
  62. 1 1
      samples/Sound.hx
  63. 2 2
      samples/Text.hx
  64. 1 1
      samples/Tiled.hx
  65. 2 2
      tools/hxsl/Main.hx

+ 1 - 1
h2d/Anim.hx

@@ -2,7 +2,7 @@ package h2d;
 
 
 /**
 /**
 	Displays an animated sequence of bitmap Tiles on the screen.
 	Displays an animated sequence of bitmap Tiles on the screen.
-	
+
 	Anim does not provide animation sequence management and it's up to user on how to implement it.
 	Anim does not provide animation sequence management and it's up to user on how to implement it.
 	Another limitation is framerate. Anim runs at a fixed framerate dictated by `Anim.speed`.
 	Another limitation is framerate. Anim runs at a fixed framerate dictated by `Anim.speed`.
 	Switching animations can be done through `Anim.play` method.
 	Switching animations can be done through `Anim.play` method.

+ 1 - 1
h2d/Bitmap.hx

@@ -16,7 +16,7 @@ class Bitmap extends Drawable {
 
 
 	/**
 	/**
 		If set, rescale the tile to match the given width, keeping the aspect ratio unless `height` is also set.
 		If set, rescale the tile to match the given width, keeping the aspect ratio unless `height` is also set.
-		
+
 		Note that both `width` and `height` are `null` by default and in order to retrieve bitmap dimensions with
 		Note that both `width` and `height` are `null` by default and in order to retrieve bitmap dimensions with
 		scaling accurately, call `getSize` method or address `tile.width/height` to get unscaled dimensions.
 		scaling accurately, call `getSize` method or address `tile.width/height` to get unscaled dimensions.
 	**/
 	**/

+ 10 - 10
h2d/Camera.hx

@@ -4,11 +4,11 @@ package h2d;
 	A 2D camera representation attached to `h2d.Scene`.
 	A 2D camera representation attached to `h2d.Scene`.
 
 
 	Enables ability to move, scale and rotate the scene viewport.
 	Enables ability to move, scale and rotate the scene viewport.
-	
+
 	Scene supports usage of multiple Camera instances.
 	Scene supports usage of multiple Camera instances.
 	To configure which layers each Camera renders - `Camera.layerVisible` method should be overridden.
 	To configure which layers each Camera renders - `Camera.layerVisible` method should be overridden.
 	By default, camera does not clip out the contents that are outside camera bounding box, which can be enabled through `Camera.clipViewport`.
 	By default, camera does not clip out the contents that are outside camera bounding box, which can be enabled through `Camera.clipViewport`.
-	
+
 	Due to Heaps event handling structure, only one Camera instance can handle the mouse/touch input, and can be set through `h2d.Scene.interactiveCamera` variable.
 	Due to Heaps event handling structure, only one Camera instance can handle the mouse/touch input, and can be set through `h2d.Scene.interactiveCamera` variable.
 	Note that during even handing, interactive camera does not check if the Camera itself is visible nor the layers filters as well as `clipViewport` is not applied.
 	Note that during even handing, interactive camera does not check if the Camera itself is visible nor the layers filters as well as `clipViewport` is not applied.
 **/
 **/
@@ -80,7 +80,7 @@ class Camera {
 
 
 	/**
 	/**
 		Camera visibility.
 		Camera visibility.
-		
+
 		Does not affect the user input when Camera is set as interactive camera.
 		Does not affect the user input when Camera is set as interactive camera.
 	**/
 	**/
 	public var visible : Bool;
 	public var visible : Bool;
@@ -141,7 +141,7 @@ class Camera {
 		Does not affect the user input when Camera is set as interactive camera.
 		Does not affect the user input when Camera is set as interactive camera.
 
 
 		Usage example:
 		Usage example:
-		
+
 		```haxe
 		```haxe
 		final LAYER_SHARED = 0;
 		final LAYER_SHARED = 0;
 		final LAYER_PLAYER_1 = 2;
 		final LAYER_PLAYER_1 = 2;
@@ -164,7 +164,7 @@ class Camera {
 	public dynamic function layerVisible( layer : Int ) : Bool {
 	public dynamic function layerVisible( layer : Int ) : Bool {
 		return true;
 		return true;
 	}
 	}
-	
+
 	/**
 	/**
 		<span class="label">Internal usage</span>
 		<span class="label">Internal usage</span>
 
 
@@ -305,7 +305,7 @@ class Camera {
 	// Screen <-> Camera
 	// Screen <-> Camera
 	/**
 	/**
 		Convert screen position into a local camera position.
 		Convert screen position into a local camera position.
-		
+
 		Requires Camera being attached to a Scene.
 		Requires Camera being attached to a Scene.
 	**/
 	**/
 	inline function screenXToCamera( mx : Float, my : Float ) : Float {
 	inline function screenXToCamera( mx : Float, my : Float ) : Float {
@@ -314,7 +314,7 @@ class Camera {
 
 
 	/**
 	/**
 		Convert screen position into a local camera position.
 		Convert screen position into a local camera position.
-		
+
 		Requires Camera being attached to a Scene.
 		Requires Camera being attached to a Scene.
 	**/
 	**/
 	inline function screenYToCamera( mx : Float, my : Float ) : Float {
 	inline function screenYToCamera( mx : Float, my : Float ) : Float {
@@ -323,7 +323,7 @@ class Camera {
 
 
 	/**
 	/**
 		Convert local camera position to absolute screen position.
 		Convert local camera position to absolute screen position.
-		
+
 		Requires Camera being attached to a Scene.
 		Requires Camera being attached to a Scene.
 	**/
 	**/
 	inline function cameraXToScreen( mx : Float, my : Float ) : Float {
 	inline function cameraXToScreen( mx : Float, my : Float ) : Float {
@@ -332,7 +332,7 @@ class Camera {
 
 
 	/**
 	/**
 		Convert local camera position to absolute screen position.
 		Convert local camera position to absolute screen position.
-		
+
 		Requires Camera being attached to a Scene.
 		Requires Camera being attached to a Scene.
 	**/
 	**/
 	inline function cameraYToScreen( mx : Float, my : Float ) : Float {
 	inline function cameraYToScreen( mx : Float, my : Float ) : Float {
@@ -427,7 +427,7 @@ class Camera {
 	/**
 	/**
 		Convert local camera position into absolute scene position.
 		Convert local camera position into absolute scene position.
 		Does not represent screen position, see `Camera.cameraToScreen` to convert position with accounting of `scaleMode`.
 		Does not represent screen position, see `Camera.cameraToScreen` to convert position with accounting of `scaleMode`.
-		
+
 		Requires Camera being attached to a Scene.
 		Requires Camera being attached to a Scene.
 	**/
 	**/
 	public function cameraToScene( pt : h2d.col.Point ) {
 	public function cameraToScene( pt : h2d.col.Point ) {

+ 1 - 1
h2d/Console.hx

@@ -144,7 +144,7 @@ class Console #if !macro extends h2d.Object #end {
 	}
 	}
 
 
 	#end
 	#end
-	
+
 	/**
 	/**
 		Add a new command to console. <span class="label">Macro method</span>
 		Add a new command to console. <span class="label">Macro method</span>
 
 

+ 1 - 1
h2d/Drawable.hx

@@ -21,7 +21,7 @@ class Drawable extends Object {
 
 
 	/**
 	/**
 		Enables texture uv wrap for this Drawable, causing tiles with uv exceeding the texture size to repeat instead of clamping on edges.
 		Enables texture uv wrap for this Drawable, causing tiles with uv exceeding the texture size to repeat instead of clamping on edges.
-		
+
 		Note that `tileWrap` does not use the `Tile` region as a wrapping area but instead uses underlying `h3d.mat.Texture` size.
 		Note that `tileWrap` does not use the `Tile` region as a wrapping area but instead uses underlying `h3d.mat.Texture` size.
 		This is due to implementation specifics, as it just sets the `Texture.wrap` to either `Repeat` or `Clamp`.
 		This is due to implementation specifics, as it just sets the `Texture.wrap` to either `Repeat` or `Clamp`.
 		Because of that, proper Tile tiling can be expected only when the tile covers an entire Texture area.
 		Because of that, proper Tile tiling can be expected only when the tile covers an entire Texture area.

+ 2 - 2
h2d/Dropdown.hx

@@ -32,7 +32,7 @@ private class Fake extends Object {
 
 
 /**
 /**
 	A simple UI component that creates an interactive drop-down list.
 	A simple UI component that creates an interactive drop-down list.
-	
+
 	Dropdown will add an `h2d.Flow` to the `Scene` when opening in order to be visible above other objects. See `Dropdown.dropdownLayer` for more details.
 	Dropdown will add an `h2d.Flow` to the `Scene` when opening in order to be visible above other objects. See `Dropdown.dropdownLayer` for more details.
 
 
 	There is no handling of user input on items, and implementation of selection and other actions is up to the user.
 	There is no handling of user input on items, and implementation of selection and other actions is up to the user.
@@ -59,7 +59,7 @@ class Dropdown extends Flow {
 		A Tile used to visualize and arrow of the dropdown when the list is open.
 		A Tile used to visualize and arrow of the dropdown when the list is open.
 	**/
 	**/
 	public var tileArrowOpen : h2d.Tile;
 	public var tileArrowOpen : h2d.Tile;
-	
+
 	/**
 	/**
 		When disabled, the user would not be able to change the selected item.
 		When disabled, the user would not be able to change the selected item.
 	**/
 	**/

+ 1 - 1
h2d/Graphics.hx

@@ -131,7 +131,7 @@ private class GraphicsContent extends h3d.prim.Primitive {
 			Allocator.get().disposeIndexBuffer(indexes);
 			Allocator.get().disposeIndexBuffer(indexes);
 			indexes = null;
 			indexes = null;
 		}
 		}
-		
+
 		super.dispose();
 		super.dispose();
 	}
 	}
 
 

+ 1 - 1
h2d/Interactive.hx

@@ -377,7 +377,7 @@ class Interactive extends Drawable implements hxd.SceneEvents.Interactive {
 	**/
 	**/
 	public dynamic function onMove( e : hxd.Event ) {
 	public dynamic function onMove( e : hxd.Event ) {
 	}
 	}
-	
+
 	/**
 	/**
 		Sent when user scrolls mouse wheel above the Interactive. Wheel delta can be obtained through the `Event.wheelDelta`.
 		Sent when user scrolls mouse wheel above the Interactive. Wheel delta can be obtained through the `Event.wheelDelta`.
 	**/
 	**/

+ 1 - 1
h2d/Object.hx

@@ -6,7 +6,7 @@ import hxd.Math;
 
 
 	Serves as a virtual container that does not display anything but can contain other objects
 	Serves as a virtual container that does not display anything but can contain other objects
 	so the various transforms are inherited to its children.
 	so the various transforms are inherited to its children.
-	
+
 	Private events `Object.onAdd`, `Object.onRemove` and `Object.onHierarchyChanged` can be used
 	Private events `Object.onAdd`, `Object.onRemove` and `Object.onHierarchyChanged` can be used
 	to capture when Object is added/removed from the currently active scene as well as being moved withing the object tree.
 	to capture when Object is added/removed from the currently active scene as well as being moved withing the object tree.
 
 

+ 4 - 4
h2d/Particles.hx

@@ -345,7 +345,7 @@ class ParticleGroup {
 		Optional color gradient texture for tinting.
 		Optional color gradient texture for tinting.
 	**/
 	**/
 	public var colorGradient(default,set) : h3d.mat.Texture;
 	public var colorGradient(default,set) : h3d.mat.Texture;
-	
+
 	/**
 	/**
 		When enabled, causes particles to always render relative to the emitter position, moving along with it.
 		When enabled, causes particles to always render relative to the emitter position, moving along with it.
 		Otherwise, once emitted, particles won't follow the emitter, and will render relative to the scene origin.
 		Otherwise, once emitted, particles won't follow the emitter, and will render relative to the scene origin.
@@ -413,7 +413,7 @@ class ParticleGroup {
 	inline function set_frameDivisionY(v) { frameDivisionY = v; makeTiles(); return v; }
 	inline function set_frameDivisionY(v) { frameDivisionY = v; makeTiles(); return v; }
 	inline function set_animationRepeat(v) return animationRepeat = v;
 	inline function set_animationRepeat(v) return animationRepeat = v;
 	inline function set_isRelative(v) { needRebuild = true; return isRelative = v; }
 	inline function set_isRelative(v) { needRebuild = true; return isRelative = v; }
-	
+
 	/**
 	/**
 		Create a new particle group instance.
 		Create a new particle group instance.
 		@param p The parent Particles instance. Group does not automatically adds itself to the Particles.
 		@param p The parent Particles instance. Group does not automatically adds itself to the Particles.
@@ -525,7 +525,7 @@ class ParticleGroup {
 				speed = Math.abs(speed);
 				speed = Math.abs(speed);
 				p.vx = Math.cos(g.emitAngle);
 				p.vx = Math.cos(g.emitAngle);
 				p.vy = Math.sin(g.emitAngle);
 				p.vy = Math.sin(g.emitAngle);
-				
+
 				var r = g.emitStartDist + g.emitDist * rand();
 				var r = g.emitStartDist + g.emitDist * rand();
 				p.x += r * Math.cos(g.emitAngle - Math.PI / 2);
 				p.x += r * Math.cos(g.emitAngle - Math.PI / 2);
 				p.y += r * Math.sin(g.emitAngle - Math.PI / 2);
 				p.y += r * Math.sin(g.emitAngle - Math.PI / 2);
@@ -559,7 +559,7 @@ class ParticleGroup {
 			p.scaleY = Math.sqrt((parts.matB * parts.matB) + (parts.matD * parts.matD)) * size;
 			p.scaleY = Math.sqrt((parts.matB * parts.matB) + (parts.matD * parts.matD)) * size;
 			var rot = Math.atan2(parts.matB / p.scaleY, parts.matA / p.scaleX);
 			var rot = Math.atan2(parts.matB / p.scaleY, parts.matA / p.scaleX);
 			p.rotation += rot;
 			p.rotation += rot;
-			
+
 			// Also rotate velocity.
 			// Also rotate velocity.
 			var cos = Math.cos(rot);
 			var cos = Math.cos(rot);
 			var sin = Math.sin(rot);
 			var sin = Math.sin(rot);

+ 7 - 7
h2d/RenderContext.hx

@@ -11,7 +11,7 @@ private typedef RenderZoneStack = { hasRZ:Bool, x:Float, y:Float, w:Float, h:Flo
 
 
 /**
 /**
 	A 2D scene renderer.
 	A 2D scene renderer.
-	
+
 	Passed during `Object.sync` and `Object.drawRec` and can be accessed directly via `Scene.renderer`.
 	Passed during `Object.sync` and `Object.drawRec` and can be accessed directly via `Scene.renderer`.
 **/
 **/
 @:access(h2d.Scene)
 @:access(h2d.Scene)
@@ -72,7 +72,7 @@ class RenderContext extends h3d.impl.RenderContext {
 
 
 	/**
 	/**
 		<span class="label">Internal usage</span>
 		<span class="label">Internal usage</span>
-		
+
 		Used to calculate filter rendering bounds.
 		Used to calculate filter rendering bounds.
 	**/
 	**/
 	@:dox(hide)
 	@:dox(hide)
@@ -156,7 +156,7 @@ class RenderContext extends h3d.impl.RenderContext {
 
 
 	/**
 	/**
 		<span class="label">Internal usage</span>
 		<span class="label">Internal usage</span>
-		
+
 		Prepares RenderContext to begin rendering a new frame.
 		Prepares RenderContext to begin rendering a new frame.
 	**/
 	**/
 	public function begin() {
 	public function begin() {
@@ -256,7 +256,7 @@ class RenderContext extends h3d.impl.RenderContext {
 		entry.vd = tmpD;
 		entry.vd = tmpD;
 		entry.vx = viewX;
 		entry.vx = viewX;
 		entry.vy = viewY;
 		entry.vy = viewY;
-		
+
 		viewA = cam.matA * tmpA + cam.matB * tmpC;
 		viewA = cam.matA * tmpA + cam.matB * tmpC;
 		viewB = cam.matA * tmpB + cam.matB * tmpD;
 		viewB = cam.matA * tmpB + cam.matB * tmpD;
 		viewC = cam.matC * tmpA + cam.matD * tmpC;
 		viewC = cam.matC * tmpA + cam.matD * tmpC;
@@ -331,7 +331,7 @@ class RenderContext extends h3d.impl.RenderContext {
 		flush();
 		flush();
 		engine.pushTarget(t);
 		engine.pushTarget(t);
 		initShaders(baseShaderList);
 		initShaders(baseShaderList);
-		
+
 		var entry = targetsStack[targetsStackIndex++];
 		var entry = targetsStack[targetsStackIndex++];
 		if ( entry == null ) {
 		if ( entry == null ) {
 			entry = { t: null, va: 0, vb: 0, vc: 0, vd: 0, vx: 0, vy: 0, hasRZ: false, rzX: 0, rzY: 0, rzW: 0, rzH: 0 };
 			entry = { t: null, va: 0, vb: 0, vc: 0, vd: 0, vx: 0, vy: 0, hasRZ: false, rzX: 0, rzY: 0, rzW: 0, rzH: 0 };
@@ -485,7 +485,7 @@ class RenderContext extends h3d.impl.RenderContext {
 			w = rx2 - rx1;
 			w = rx2 - rx1;
 			h = ry2 - ry1;
 			h = ry2 - ry1;
 		}
 		}
-		
+
 		engine.setRenderZone(
 		engine.setRenderZone(
 			Std.int(x * scaleX + (scene.viewportX+1) * (engine.width / 2) + 1e-10),
 			Std.int(x * scaleX + (scene.viewportX+1) * (engine.width / 2) + 1e-10),
 			Std.int(y * scaleY + (scene.viewportY+1) * (engine.height / 2) + 1e-10),
 			Std.int(y * scaleY + (scene.viewportY+1) * (engine.height / 2) + 1e-10),
@@ -493,7 +493,7 @@ class RenderContext extends h3d.impl.RenderContext {
 			Std.int(h * scaleY + 1e-10)
 			Std.int(h * scaleY + 1e-10)
 		);
 		);
 	}
 	}
-	
+
 	inline function clearRZ() {
 	inline function clearRZ() {
 		hasRenderZone = false;
 		hasRenderZone = false;
 		engine.setRenderZone();
 		engine.setRenderZone();

+ 1 - 1
h2d/ScaleGrid.hx

@@ -27,7 +27,7 @@ class ScaleGrid extends h2d.TileGroup {
 	public var height(default,set) : Float;
 	public var height(default,set) : Float;
 	/**
 	/**
 		When enabled, borders will be tiled along the edges instead of stretching to match the desired dimensions.
 		When enabled, borders will be tiled along the edges instead of stretching to match the desired dimensions.
-		
+
 		Center tile is always stretched.
 		Center tile is always stretched.
 	**/
 	**/
 	public var tileBorders(default, set) : Bool;
 	public var tileBorders(default, set) : Bool;

+ 6 - 6
h2d/Scene.hx

@@ -54,7 +54,7 @@ enum ScaleMode {
 		While enabled, the Scene won't be downscaled when internal viewport is larger than the window size and will remain at 1x zoom. Default: `false`.
 		While enabled, the Scene won't be downscaled when internal viewport is larger than the window size and will remain at 1x zoom. Default: `false`.
 		@param horizontalAlign The horizontal viewport anchoring rule. Accepted values are `Left`, `Center` and `Right`. Default: `Center`.
 		@param horizontalAlign The horizontal viewport anchoring rule. Accepted values are `Left`, `Center` and `Right`. Default: `Center`.
 		@param verticalAlign The vertical viewport anchoring rule. Accepted values are `Top`, `Center` and `Bottom`. Default: `Center`.
 		@param verticalAlign The vertical viewport anchoring rule. Accepted values are `Top`, `Center` and `Bottom`. Default: `Center`.
-		
+
 	**/
 	**/
 	LetterBox(width : Int, height : Int, ?integerScale : Bool, ?horizontalAlign : ScaleModeAlign, ?verticalAlign : ScaleModeAlign);
 	LetterBox(width : Int, height : Int, ?integerScale : Bool, ?horizontalAlign : ScaleModeAlign, ?verticalAlign : ScaleModeAlign);
 
 
@@ -68,7 +68,7 @@ enum ScaleMode {
 		@param zoom The scaling multiplier of internal viewport when rendering onto the screen.
 		@param zoom The scaling multiplier of internal viewport when rendering onto the screen.
 		@param horizontalAlign The horizontal viewport anchoring rule. Accepted values are `Left`, `Center` and `Right`. Default: `Center`.
 		@param horizontalAlign The horizontal viewport anchoring rule. Accepted values are `Left`, `Center` and `Right`. Default: `Center`.
 		@param verticalAlign The vertical viewport anchoring rule. Accepted values are `Top`, `Center` and `Bottom`. Default: `Center`.
 		@param verticalAlign The vertical viewport anchoring rule. Accepted values are `Top`, `Center` and `Bottom`. Default: `Center`.
-		
+
 	**/
 	**/
 	Fixed(width : Int, height: Int, zoom : Float, ?horizontalAlign : ScaleModeAlign, ?verticalAlign : ScaleModeAlign);
 	Fixed(width : Int, height: Int, zoom : Float, ?horizontalAlign : ScaleModeAlign, ?verticalAlign : ScaleModeAlign);
 
 
@@ -89,12 +89,12 @@ enum ScaleMode {
 		If both are `0`, results are undefined.
 		If both are `0`, results are undefined.
 
 
 		With `800x600` window, `AutoZoom(320, 260, false)` will result in the Scene size of `347x260`. `AutoZoom(320, 260, true)` will result in the size of `400x300`.
 		With `800x600` window, `AutoZoom(320, 260, false)` will result in the Scene size of `347x260`. `AutoZoom(320, 260, true)` will result in the size of `400x300`.
-		
+
 		@param minWidth The minimum width of the internal Scene viewport.
 		@param minWidth The minimum width of the internal Scene viewport.
 		@param minHeight The minimum height of the internal Scene viewport.
 		@param minHeight The minimum height of the internal Scene viewport.
 		@param integerScale When enabled, upscaling is performed only with integer increments (1x, 2x, 3x, etc) and can be used to achieve pixel-perfect scaling.
 		@param integerScale When enabled, upscaling is performed only with integer increments (1x, 2x, 3x, etc) and can be used to achieve pixel-perfect scaling.
 		While enabled, the Scene won't be downscaled when internal viewport is larger than the window size and will remain at 1x zoom. Default: `false`.
 		While enabled, the Scene won't be downscaled when internal viewport is larger than the window size and will remain at 1x zoom. Default: `false`.
-		
+
 	**/
 	**/
 	AutoZoom(minWidth : Int, minHeight : Int, ?integerScaling : Bool);
 	AutoZoom(minWidth : Int, minHeight : Int, ?integerScaling : Bool);
 }
 }
@@ -600,7 +600,7 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 
 
 	/**
 	/**
 		Starts input events capture and redirects them to `onEvent` method until `Scene.stopDrag` is called.
 		Starts input events capture and redirects them to `onEvent` method until `Scene.stopDrag` is called.
-		
+
 		While the method name may imply that only mouse events would be captured: This is not the case,
 		While the method name may imply that only mouse events would be captured: This is not the case,
 		as it will also capture all other input events, including keyboard events.
 		as it will also capture all other input events, including keyboard events.
 
 
@@ -851,7 +851,7 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 
 
 	/**
 	/**
 		Capture the scene into a texture and returns the resulting `h2d.Bitmap`.
 		Capture the scene into a texture and returns the resulting `h2d.Bitmap`.
-		
+
 		@param target Optional Tile to render onto. If not set, new Texture with interval Scene viewport dimensions is allocated,
 		@param target Optional Tile to render onto. If not set, new Texture with interval Scene viewport dimensions is allocated,
 		otherwise Tile boundaries and Texture are used.
 		otherwise Tile boundaries and Texture are used.
 	**/
 	**/

+ 1 - 1
h2d/Slider.hx

@@ -8,7 +8,7 @@ class Slider extends h2d.Interactive {
 		The slider background tile.
 		The slider background tile.
 
 
 		If Tile width does not match with Slider width, it will be resized through `Tile.setSize` to match the Slider width.
 		If Tile width does not match with Slider width, it will be resized through `Tile.setSize` to match the Slider width.
-		
+
 		Defaults to the monocolor 0x808080 Tile with the size of `Slider.width x 4` and centered vertically within `Slider.height`.
 		Defaults to the monocolor 0x808080 Tile with the size of `Slider.width x 4` and centered vertically within `Slider.height`.
 	**/
 	**/
 	public var tile : h2d.Tile;
 	public var tile : h2d.Tile;

+ 1 - 1
h2d/SpriteBatch.hx

@@ -179,7 +179,7 @@ class BasicElement extends BatchElement {
 
 
 /**
 /**
 	An active batched tile renderer.
 	An active batched tile renderer.
-	
+
 	Compared to `TileGroup` which is expected to be used as a static geometry,
 	Compared to `TileGroup` which is expected to be used as a static geometry,
 	SpriteBatch uploads GPU buffer each frame by collecting data from added `BatchElement` instance.
 	SpriteBatch uploads GPU buffer each frame by collecting data from added `BatchElement` instance.
 	Due to that, dynamically removing and adding new geometry is fairly simple.
 	Due to that, dynamically removing and adding new geometry is fairly simple.

+ 4 - 4
h2d/Text.hx

@@ -14,13 +14,13 @@ enum Align {
 		When `Text.maxWidth` is set and/or Text size is constrained (see `Object.constraintSize`), right edge is considered the smallest of the two.
 		When `Text.maxWidth` is set and/or Text size is constrained (see `Object.constraintSize`), right edge is considered the smallest of the two.
 
 
 		Otherwise edge is at the `0` coordinate of the Text instance.
 		Otherwise edge is at the `0` coordinate of the Text instance.
-		
+
 		See Text sample for showcase.
 		See Text sample for showcase.
 	**/
 	**/
 	Right;
 	Right;
 	/**
 	/**
 		Centers the text alignment.
 		Centers the text alignment.
-		
+
 		When `Text.maxWidth` is set and/or Text size is constrained (see `Object.constraintSize`), center is calculated from 0 to the smallest of the two.
 		When `Text.maxWidth` is set and/or Text size is constrained (see `Object.constraintSize`), center is calculated from 0 to the smallest of the two.
 
 
 		Otherwise text is centered around `0` coordinate of the Text instance.
 		Otherwise text is centered around `0` coordinate of the Text instance.
@@ -89,7 +89,7 @@ class Text extends Drawable {
 	public var textWidth(get, null) : Float;
 	public var textWidth(get, null) : Float;
 	/**
 	/**
 		Calculated text height.
 		Calculated text height.
-		
+
 		Not a completely precise text metric and increments in the `Font.lineHeight` steps.
 		Not a completely precise text metric and increments in the `Font.lineHeight` steps.
 		In `HtmlText`, can be increased by various values depending on the active line font and `HtmlText.lineHeightMode` value.
 		In `HtmlText`, can be increased by various values depending on the active line font and `HtmlText.lineHeightMode` value.
 	**/
 	**/
@@ -405,7 +405,7 @@ class Text extends Drawable {
 		case Left:
 		case Left:
 			x = 0;
 			x = 0;
 		}
 		}
-		
+
 		for( i in 0...t.length ) {
 		for( i in 0...t.length ) {
 			var cc = t.charCodeAt(i);
 			var cc = t.charCodeAt(i);
 			var e = font.getChar(cc);
 			var e = font.getChar(cc);

+ 3 - 3
h2d/Tile.hx

@@ -54,7 +54,7 @@ class Tile {
 		Cannot be modified directly, use `Tile.setSize` instead.
 		Cannot be modified directly, use `Tile.setSize` instead.
 	**/
 	**/
 	public var height(default,null) : Float;
 	public var height(default,null) : Float;
-	
+
 	/**
 	/**
 		The flip state of the Tile.
 		The flip state of the Tile.
 		@see `Tile.flipX`
 		@see `Tile.flipX`
@@ -265,7 +265,7 @@ class Tile {
 		t.v2 = v2;
 		t.v2 = v2;
 		return t;
 		return t;
 	}
 	}
-	
+
 	function get_xFlip() return u2 < u;
 	function get_xFlip() return u2 < u;
 	function get_yFlip() return v2 < v;
 	function get_yFlip() return v2 < v;
 	function set_xFlip(v) {
 	function set_xFlip(v) {
@@ -303,7 +303,7 @@ class Tile {
 
 
 	/**
 	/**
 		Split the tile into a list of tiles of Size x Size pixels.
 		Split the tile into a list of tiles of Size x Size pixels.
-		
+
 		@param size The width and height of the new Tiles.
 		@param size The width and height of the new Tiles.
 		@param dx Optional visual offset of the new Tiles along the X axis.
 		@param dx Optional visual offset of the new Tiles along the X axis.
 		@param dy Optional visual offset of the new Tiles along the Y axis.
 		@param dy Optional visual offset of the new Tiles along the Y axis.

+ 9 - 9
h2d/Video.hx

@@ -100,12 +100,12 @@ class Video extends Drawable {
 		return playing ? haxe.Timer.stamp() - playTime : 0;
 		return playing ? haxe.Timer.stamp() - playTime : 0;
 		#end
 		#end
 	}
 	}
-	
+
 	@:dox(hide) @:noCompletion
 	@:dox(hide) @:noCompletion
 	public inline function get_loop() {
 	public inline function get_loop() {
 		return loopVideo;
 		return loopVideo;
 	}
 	}
-	
+
 	@:dox(hide) @:noCompletion
 	@:dox(hide) @:noCompletion
 	public function set_loop(value : Bool) : Bool {
 	public function set_loop(value : Bool) : Bool {
 		#if js
 		#if js
@@ -177,11 +177,11 @@ class Video extends Drawable {
 		v.autoplay = true;
 		v.autoplay = true;
 		v.muted = true;
 		v.muted = true;
 		v.loop = loopVideo;
 		v.loop = loopVideo;
-		
+
 		videoPlaying = false;
 		videoPlaying = false;
 		videoTimeupdate = false;
 		videoTimeupdate = false;
 		this.onReady = onReady;
 		this.onReady = onReady;
-		
+
 		v.addEventListener("playing", checkReady, true);
 		v.addEventListener("playing", checkReady, true);
 		v.addEventListener("timeupdate", checkReady, true);
 		v.addEventListener("timeupdate", checkReady, true);
 		v.addEventListener("ended", endHandler, true);
 		v.addEventListener("ended", endHandler, true);
@@ -192,9 +192,9 @@ class Video extends Drawable {
 		onError("Video not supported on this platform");
 		onError("Video not supported on this platform");
 		#end
 		#end
 	}
 	}
-	
+
 	#if js
 	#if js
-	
+
 	function errorHandler(e : js.html.Event) {
 	function errorHandler(e : js.html.Event) {
 		#if (haxe_ver >= 4)
 		#if (haxe_ver >= 4)
 		onError(v.error.code + ": " + v.error.message);
 		onError(v.error.code + ": " + v.error.message);
@@ -202,11 +202,11 @@ class Video extends Drawable {
 		onError(Std.string(v.error.code));
 		onError(Std.string(v.error.code));
 		#end
 		#end
 	}
 	}
-	
+
 	function endHandler(e : js.html.Event) {
 	function endHandler(e : js.html.Event) {
 		onEnd();
 		onEnd();
 	}
 	}
-	
+
 	function checkReady(e : js.html.Event) {
 	function checkReady(e : js.html.Event) {
 		if (e.type == "playing") {
 		if (e.type == "playing") {
 			videoPlaying = true;
 			videoPlaying = true;
@@ -215,7 +215,7 @@ class Video extends Drawable {
 			videoTimeupdate = true;
 			videoTimeupdate = true;
 			v.removeEventListener("timeupdate", checkReady, true);
 			v.removeEventListener("timeupdate", checkReady, true);
 		}
 		}
-		
+
 		if (videoPlaying && videoTimeupdate) {
 		if (videoPlaying && videoTimeupdate) {
 			frameReady = true;
 			frameReady = true;
 			videoWidth = v.videoWidth;
 			videoWidth = v.videoWidth;

+ 2 - 2
h2d/ZGroup.hx

@@ -120,13 +120,13 @@ class DepthMap {
 	An advanced double-pass rendering class that utilizes a z-culling on an opaque objects.
 	An advanced double-pass rendering class that utilizes a z-culling on an opaque objects.
 
 
 	For optimization to work properly, all opaque objects should have `Object.blendMode` set to `None`.
 	For optimization to work properly, all opaque objects should have `Object.blendMode` set to `None`.
-	
+
 	Rendering is done in two passes:
 	Rendering is done in two passes:
 	* An opaque pass only renders objects with `blendeMode = None`, with `RenderContext.front2back` and `RenderContext.killAlpha` enabled.
 	* An opaque pass only renders objects with `blendeMode = None`, with `RenderContext.front2back` and `RenderContext.killAlpha` enabled.
 	* Transparent pass renders the rest of the objects (which are not marked as opaque) as usual.
 	* Transparent pass renders the rest of the objects (which are not marked as opaque) as usual.
 
 
 	That allows to perform a z-cull depth test on the objects and reduce the overall GPU strain.
 	That allows to perform a z-cull depth test on the objects and reduce the overall GPU strain.
-	
+
 	Additionally, ZGroup places a limitation on filter usage. They are not drawn in opaque pass, which can lead to undefined behavior.
 	Additionally, ZGroup places a limitation on filter usage. They are not drawn in opaque pass, which can lead to undefined behavior.
 **/
 **/
 @:access(h2d.RenderContext)
 @:access(h2d.RenderContext)

+ 3 - 3
h2d/col/Bounds.hx

@@ -13,7 +13,7 @@ class Bounds {
 	public var xMin : Float;
 	public var xMin : Float;
 	/** Y-axis top-most bounding box point. **/
 	/** Y-axis top-most bounding box point. **/
 	public var yMin : Float;
 	public var yMin : Float;
-	
+
 	/** X-axis right-most bounding box point. **/
 	/** X-axis right-most bounding box point. **/
 	public var xMax : Float;
 	public var xMax : Float;
 	/** Y-axis bottom-most bounding box point. **/
 	/** Y-axis bottom-most bounding box point. **/
@@ -140,7 +140,7 @@ class Bounds {
 
 
 	/**
 	/**
 		Sets this bounding box min/max values to a result of combining this Bounds and the given Bounds `b`.
 		Sets this bounding box min/max values to a result of combining this Bounds and the given Bounds `b`.
-		
+
 		Equivalent of `Bounds.addBounds`.
 		Equivalent of `Bounds.addBounds`.
 	**/
 	**/
 	public inline function doUnion( b : Bounds ) {
 	public inline function doUnion( b : Bounds ) {
@@ -342,7 +342,7 @@ class Bounds {
 	public function toString() : String {
 	public function toString() : String {
 		return "{" + getMin() + "," + getSize() + "}";
 		return "{" + getMin() + "," + getSize() + "}";
 	}
 	}
-	
+
 	/**
 	/**
 		Returns the bounding circle which includes all the bounds.
 		Returns the bounding circle which includes all the bounds.
 	**/
 	**/

+ 1 - 1
h2d/col/PixelsCollider.hx

@@ -2,7 +2,7 @@ package h2d.col;
 
 
 /**
 /**
 	An `hxd.Pixels`-based collider. Checks for pixel color value under point to be above the cutoff value.
 	An `hxd.Pixels`-based collider. Checks for pixel color value under point to be above the cutoff value.
-	
+
 	Note that it checks as `channel > cutoff`, not `channel >= cutoff`, hence cutoff value of 255 would never pass the test.
 	Note that it checks as `channel > cutoff`, not `channel >= cutoff`, hence cutoff value of 255 would never pass the test.
 **/
 **/
 class PixelsCollider implements Collider {
 class PixelsCollider implements Collider {

+ 1 - 1
h2d/col/Polygon.hx

@@ -7,7 +7,7 @@ import hxd.Math;
 **/
 **/
 @:forward(push,remove,insert,copy)
 @:forward(push,remove,insert,copy)
 abstract Polygon(Array<Point>) from Array<Point> to Array<Point> {
 abstract Polygon(Array<Point>) from Array<Point> to Array<Point> {
-	
+
 	/**
 	/**
 		The underlying Array of vertices.
 		The underlying Array of vertices.
 	**/
 	**/

+ 1 - 1
h2d/col/Polygons.hx

@@ -7,7 +7,7 @@ import hxd.Math;
 **/
 **/
 @:forward(push,remove)
 @:forward(push,remove)
 abstract Polygons(Array<Polygon>) from Array<Polygon> to Array<Polygon> {
 abstract Polygons(Array<Polygon>) from Array<Polygon> to Array<Polygon> {
-	
+
 	/**
 	/**
 		An underlying Polygon array.
 		An underlying Polygon array.
 	**/
 	**/

+ 1 - 1
h2d/col/Ray.hx

@@ -41,7 +41,7 @@ class Ray {
 	public inline function getPos() {
 	public inline function getPos() {
 		return new Point(px, py);
 		return new Point(px, py);
 	}
 	}
-	
+
 	/**
 	/**
 		Returns new Point containing Ray direction.
 		Returns new Point containing Ray direction.
 	**/
 	**/

+ 1 - 1
h2d/col/Segment.hx

@@ -62,7 +62,7 @@ class Segment {
 		lenSq = dx * dx + dy * dy;
 		lenSq = dx * dx + dy * dy;
 		invLenSq = 1 / lenSq;
 		invLenSq = 1 / lenSq;
 	}
 	}
-	
+
 	/**
 	/**
 		Returns a positive value if Point `p` is on the right side of the Segment axis and negative if it's on the left.
 		Returns a positive value if Point `p` is on the right side of the Segment axis and negative if it's on the left.
 	**/
 	**/

+ 1 - 1
h2d/col/Segments.hx

@@ -3,7 +3,7 @@ import hxd.Math;
 
 
 /**
 /**
 	An abstract over the list of `Segment`s. Alternative representation of a polygon.
 	An abstract over the list of `Segment`s. Alternative representation of a polygon.
-	
+
 	Segments must be connected to form a complete polygonal shape.
 	Segments must be connected to form a complete polygonal shape.
 	Provides a more efficient distance calculus.
 	Provides a more efficient distance calculus.
 
 

+ 4 - 4
h2d/col/Voronoi.hx

@@ -396,7 +396,7 @@ class Cell {
 	static function sortByAngle(a:Halfedge, b:Halfedge) {
 	static function sortByAngle(a:Halfedge, b:Halfedge) {
 		return b.angle > a.angle ? 1 : (b.angle < a.angle ? -1 : 0);
 		return b.angle > a.angle ? 1 : (b.angle < a.angle ? -1 : 0);
 	}
 	}
-	
+
 	/**
 	/**
 		Returns a list of the neighboring cells.
 		Returns a list of the neighboring cells.
 	**/
 	**/
@@ -1523,7 +1523,7 @@ class Voronoi {
 							va = vb;
 							va = vb;
 							// fall through
 							// fall through
 						} 
 						} 
-						
+
 						if (this.equalWithepsilon(va.y,yb) && this.lessThanWithepsilon(va.x,xr)) {
 						if (this.equalWithepsilon(va.y,yb) && this.lessThanWithepsilon(va.x,xr)) {
 							lastBorderSegment = this.equalWithepsilon(vz.y,yb);
 							lastBorderSegment = this.equalWithepsilon(vz.y,yb);
 							vb = this.createVertex(lastBorderSegment ? vz.x : xr, yb);
 							vb = this.createVertex(lastBorderSegment ? vz.x : xr, yb);
@@ -1535,7 +1535,7 @@ class Voronoi {
 							va = vb;
 							va = vb;
 							// fall through
 							// fall through
 						} 
 						} 
-						
+
 						if (this.equalWithepsilon(va.x,xr) && this.greaterThanWithepsilon(va.y,yt)) {
 						if (this.equalWithepsilon(va.x,xr) && this.greaterThanWithepsilon(va.y,yt)) {
 							lastBorderSegment = this.equalWithepsilon(vz.x,xr);
 							lastBorderSegment = this.equalWithepsilon(vz.x,xr);
 							vb = this.createVertex(xr, lastBorderSegment ? vz.y : yt);
 							vb = this.createVertex(xr, lastBorderSegment ? vz.y : yt);
@@ -1547,7 +1547,7 @@ class Voronoi {
 							va = vb;
 							va = vb;
 							// fall through
 							// fall through
 						} 
 						} 
-						
+
 						if (this.equalWithepsilon(va.y,yt) && this.greaterThanWithepsilon(va.x,xl)) {
 						if (this.equalWithepsilon(va.y,yt) && this.greaterThanWithepsilon(va.x,xl)) {
 							lastBorderSegment = this.equalWithepsilon(vz.y,yt);
 							lastBorderSegment = this.equalWithepsilon(vz.y,yt);
 							vb = this.createVertex(lastBorderSegment ? vz.x : xl, yt);
 							vb = this.createVertex(lastBorderSegment ? vz.x : xl, yt);

+ 2 - 2
h2d/filter/AbstractMask.hx

@@ -22,7 +22,7 @@ class Hide extends Filter {
 
 
 /**
 /**
 	A base class for filters that utilize separate Objects as a masking object.
 	A base class for filters that utilize separate Objects as a masking object.
-	
+
 	Not intended to be used directly.
 	Not intended to be used directly.
 
 
 	Masking objects have a number of restrictions on them, see `AbstractMask.mask` for details.
 	Masking objects have a number of restrictions on them, see `AbstractMask.mask` for details.
@@ -36,7 +36,7 @@ class AbstractMask extends Filter {
 	var bindCount : Int = 0;
 	var bindCount : Int = 0;
 	/**
 	/**
 		The Object contents of which serve as a mask to the filtered Object.
 		The Object contents of which serve as a mask to the filtered Object.
-		
+
 		Masking Objects have following limitations:
 		Masking Objects have following limitations:
 		* It cannot be a parent of the filtered Object.
 		* It cannot be a parent of the filtered Object.
 		* It should not contain any filters.
 		* It should not contain any filters.

+ 1 - 1
h2d/filter/ColorMatrix.hx

@@ -18,7 +18,7 @@ package h2d.filter;
 	[0, 0, 1, 0]
 	[0, 0, 1, 0]
 	[0, 0, 0, 1]
 	[0, 0, 0, 1]
 	```
 	```
-	
+
 	@see `Ambient`
 	@see `Ambient`
 **/
 **/
 class ColorMatrix extends Filter {
 class ColorMatrix extends Filter {

+ 1 - 1
h2d/filter/Filter.hx

@@ -41,7 +41,7 @@ class Filter {
 
 
 	function new() {
 	function new() {
 	}
 	}
-	
+
 	function get_enable() return enable;
 	function get_enable() return enable;
 	function set_enable(v) return enable = v;
 	function set_enable(v) return enable = v;
 
 

+ 2 - 2
h2d/filter/Group.hx

@@ -24,13 +24,13 @@ class Group extends Filter {
 		super();
 		super();
 		this.filters = filters == null ? [] : filters;
 		this.filters = filters == null ? [] : filters;
 	}
 	}
-	
+
 	override function get_enable() {
 	override function get_enable() {
 		if( !enable ) return false;
 		if( !enable ) return false;
 		for( f in filters ) if( enable ) return true;
 		for( f in filters ) if( enable ) return true;
 		return false;
 		return false;
 	}
 	}
-	
+
 	/**
 	/**
 		Adds new Filter `f` to the Group.  
 		Adds new Filter `f` to the Group.  
 		Due to implementation specifics, if Group was already bound, new filters won't receive a `bind` call.
 		Due to implementation specifics, if Group was already bound, new filters won't receive a `bind` call.

+ 1 - 1
h2d/filter/Shader.hx

@@ -12,7 +12,7 @@ package h2d.filter;
 	class InvertColorShader extends h3d.shader.ScreenShader {
 	class InvertColorShader extends h3d.shader.ScreenShader {
 		static var SRC = {
 		static var SRC = {
 			@param var texture : Sampler2D;
 			@param var texture : Sampler2D;
-			
+
 			function fragment() {
 			function fragment() {
 				var pixel : Vec4 = texture.get(calculatedUV);
 				var pixel : Vec4 = texture.get(calculatedUV);
 				// Premultiply alpha to ensure correct transparency.
 				// Premultiply alpha to ensure correct transparency.

+ 1 - 1
h2d/impl/BatchDrawState.hx

@@ -187,7 +187,7 @@ private class StateEntry {
 		A size of batch state.
 		A size of batch state.
 	**/
 	**/
 	public var count : Int;
 	public var count : Int;
-	
+
 
 
 	public var next:StateEntry;
 	public var next:StateEntry;
 
 

+ 1 - 1
h3d/pass/Copy.hx

@@ -67,7 +67,7 @@ class ArrayCopy extends ScreenFx<ArrayCopyShader> {
 		return inst.apply(from, fromLayer, to, blend, pass, layer);
 		return inst.apply(from, fromLayer, to, blend, pass, layer);
 	}
 	}
 }
 }
-	
+
 private class CopyShader extends h3d.shader.ScreenShader {
 private class CopyShader extends h3d.shader.ScreenShader {
 
 
 	static var SRC = {
 	static var SRC = {

+ 1 - 1
h3d/shader/AlphaMap.hx

@@ -6,7 +6,7 @@ class AlphaMap extends hxsl.Shader {
 		var calculatedUV : Vec2;
 		var calculatedUV : Vec2;
 		var pixelColor : Vec4;
 		var pixelColor : Vec4;
 		@input var input : { uv : Vec2 };
 		@input var input : { uv : Vec2 };
-		
+
 		@param var texture : Sampler2D;
 		@param var texture : Sampler2D;
 		@param var uvScale : Vec2;
 		@param var uvScale : Vec2;
 		@param var uvDelta : Vec2;
 		@param var uvDelta : Vec2;

+ 2 - 2
h3d/shader/SignedDistanceField.hx

@@ -3,7 +3,7 @@ package h3d.shader;
 class SignedDistanceField extends hxsl.Shader {
 class SignedDistanceField extends hxsl.Shader {
 
 
 	static var SRC = {
 	static var SRC = {
-		
+
 		@:import h3d.shader.Base2d;
 		@:import h3d.shader.Base2d;
 
 
 		// Mode of operation - single-channel or multi-channel.
 		// Mode of operation - single-channel or multi-channel.
@@ -31,7 +31,7 @@ class SignedDistanceField extends hxsl.Shader {
 				else if (channel == 2) textureSample.b;
 				else if (channel == 2) textureSample.b;
 				else if (channel == 3) textureSample.a;
 				else if (channel == 3) textureSample.a;
 				else median(textureSample.r, textureSample.g, textureSample.b);
 				else median(textureSample.r, textureSample.g, textureSample.b);
-			
+
 			textureColor = vec4(1.0, 1.0, 1.0, smoothstep(alphaCutoff - smoothing, alphaCutoff + smoothing, distance));
 			textureColor = vec4(1.0, 1.0, 1.0, smoothstep(alphaCutoff - smoothing, alphaCutoff + smoothing, distance));
 		}
 		}
 	}
 	}

+ 4 - 4
h3d/shader/SkinBase.hx

@@ -1,21 +1,21 @@
 package h3d.shader;
 package h3d.shader;
 
 
 class SkinBase extends hxsl.Shader {
 class SkinBase extends hxsl.Shader {
-	
+
 	static var SRC = {
 	static var SRC = {
-		
+
 		var relativePosition : Vec3;
 		var relativePosition : Vec3;
 		var transformedPosition : Vec3;
 		var transformedPosition : Vec3;
 		var transformedNormal : Vec3;
 		var transformedNormal : Vec3;
 
 
 		@const var MaxBones : Int;
 		@const var MaxBones : Int;
 		@ignore @param var bonesMatrixes : Array<Mat3x4,MaxBones>;
 		@ignore @param var bonesMatrixes : Array<Mat3x4,MaxBones>;
-		
+
 	};
 	};
 
 
 	public function new() {
 	public function new() {
 		super();
 		super();
 		MaxBones = 34;
 		MaxBones = 34;
 	}
 	}
-	
+
 }
 }

+ 1 - 1
hxd/Charset.hx

@@ -21,7 +21,7 @@ class Charset {
 		Polish support
 		Polish support
 	**/
 	**/
 	public static var POLISH = "ĄĆĘŁŃÓŚŹŻąćęłńóśźż";
 	public static var POLISH = "ĄĆĘŁŃÓŚŹŻąćęłńóśźż";
-	
+
 	/**
 	/**
 		Turkish support
 		Turkish support
 	**/
 	**/

+ 18 - 18
hxd/fmt/bfnt/FontParser.hx

@@ -10,18 +10,18 @@ class FontParser {
 
 
 	@:access(h2d.Font)
 	@:access(h2d.Font)
 	public static function parse(bytes : haxe.io.Bytes, path : String, resolveTile: String -> h2d.Tile ) : h2d.Font {
 	public static function parse(bytes : haxe.io.Bytes, path : String, resolveTile: String -> h2d.Tile ) : h2d.Font {
-		
+
 		// TODO: Support multiple textures per font.
 		// TODO: Support multiple textures per font.
-		
+
 		var tile : h2d.Tile = null;
 		var tile : h2d.Tile = null;
 		var font : h2d.Font = new h2d.Font(null, 0);
 		var font : h2d.Font = new h2d.Font(null, 0);
 		var glyphs = font.glyphs;
 		var glyphs = font.glyphs;
-		
+
 		inline function resolveTileSameName() {
 		inline function resolveTileSameName() {
 			font.tilePath = new haxe.io.Path(path).file + ".png";
 			font.tilePath = new haxe.io.Path(path).file + ".png";
 			tile = resolveTile(haxe.io.Path.withExtension(path, "png"));
 			tile = resolveTile(haxe.io.Path.withExtension(path, "png"));
 		}
 		}
-		
+
 		inline function resolveTileWithFallback( tilePath : String ) {
 		inline function resolveTileWithFallback( tilePath : String ) {
 			try {
 			try {
 				font.tilePath = tilePath;
 				font.tilePath = tilePath;
@@ -31,7 +31,7 @@ class FontParser {
 				resolveTileSameName();
 				resolveTileSameName();
 			}
 			}
 		}
 		}
-		
+
 		// Supported formats:
 		// Supported formats:
 		// Littera formats: XML and Text
 		// Littera formats: XML and Text
 		// http://kvazars.com/littera/
 		// http://kvazars.com/littera/
@@ -41,9 +41,9 @@ class FontParser {
 		// https://github.com/andryblack/fontbuilder/downloads
 		// https://github.com/andryblack/fontbuilder/downloads
 		// Hiero from LibGDX is BMF Text format and supported as well.
 		// Hiero from LibGDX is BMF Text format and supported as well.
 		// https://github.com/libgdx/libgdx
 		// https://github.com/libgdx/libgdx
-		
+
 		font.baseLine = 0;
 		font.baseLine = 0;
-		
+
 		switch( bytes.getInt32(0) ) {
 		switch( bytes.getInt32(0) ) {
 		case 0x544E4642: // Internal BFNT
 		case 0x544E4642: // Internal BFNT
 			return hxd.fmt.bfnt.Reader.parse(bytes, function( tp : String ) { resolveTileWithFallback(tp); return tile; });
 			return hxd.fmt.bfnt.Reader.parse(bytes, function( tp : String ) { resolveTileWithFallback(tp); return tile; });
@@ -58,7 +58,7 @@ class FontParser {
 				font.size = font.initSize = Std.parseInt(xml.node.info.att.size);
 				font.size = font.initSize = Std.parseInt(xml.node.info.att.size);
 				font.lineHeight = Std.parseInt(xml.node.common.att.lineHeight);
 				font.lineHeight = Std.parseInt(xml.node.common.att.lineHeight);
 				font.baseLine = Std.parseInt(xml.node.common.att.base);
 				font.baseLine = Std.parseInt(xml.node.common.att.base);
-				
+
 				for ( p in xml.node.pages.elements ) {
 				for ( p in xml.node.pages.elements ) {
 					if ( p.att.id == "0" ) {
 					if ( p.att.id == "0" ) {
 						resolveTileWithFallback(p.att.file);
 						resolveTileWithFallback(p.att.file);
@@ -66,7 +66,7 @@ class FontParser {
 						trace("Warning: BMF format only supports one page at the moment.");
 						trace("Warning: BMF format only supports one page at the moment.");
 					}
 					}
 				}
 				}
-				
+
 				var chars = xml.node.chars.elements;
 				var chars = xml.node.chars.elements;
 				for( c in chars) {
 				for( c in chars) {
 					var t = tile.sub(Std.parseInt(c.att.x), Std.parseInt(c.att.y), Std.parseInt(c.att.width), Std.parseInt(c.att.height), Std.parseInt(c.att.xoffset), Std.parseInt(c.att.yoffset));
 					var t = tile.sub(Std.parseInt(c.att.x), Std.parseInt(c.att.y), Std.parseInt(c.att.width), Std.parseInt(c.att.height), Std.parseInt(c.att.xoffset), Std.parseInt(c.att.yoffset));
@@ -81,7 +81,7 @@ class FontParser {
 			} else {
 			} else {
 				// support for the FontBuilder/Divo format
 				// support for the FontBuilder/Divo format
 				resolveTileSameName();
 				resolveTileSameName();
-				
+
 				font.name = xml.att.family;
 				font.name = xml.att.family;
 				font.size = font.initSize = Std.parseInt(xml.att.size);
 				font.size = font.initSize = Std.parseInt(xml.att.size);
 				font.lineHeight = Std.parseInt(xml.att.height);
 				font.lineHeight = Std.parseInt(xml.att.height);
@@ -115,11 +115,11 @@ class FontParser {
 			// BFont text format, version 3 (starts with info ...)
 			// BFont text format, version 3 (starts with info ...)
 			// Can be produced by Littera Text format as well
 			// Can be produced by Littera Text format as well
 			var lines = bytes.toString().split("\n");
 			var lines = bytes.toString().split("\n");
-			
+
 			// BMFont pads values with spaces, littera doesn't.
 			// BMFont pads values with spaces, littera doesn't.
 			var reg = ~/ *?([0-9a-zA-Z]+)=("[^"]+"|.+?)(?:[ \r]|$)/;
 			var reg = ~/ *?([0-9a-zA-Z]+)=("[^"]+"|.+?)(?:[ \r]|$)/;
 			var idx : Int;
 			var idx : Int;
-			
+
 			inline function next() : Void {
 			inline function next() : Void {
 				var pos = reg.matchedPos();
 				var pos = reg.matchedPos();
 				idx = pos.pos + pos.len;
 				idx = pos.pos + pos.len;
@@ -132,9 +132,9 @@ class FontParser {
 			inline function extractInt() : Int {
 			inline function extractInt() : Int {
 				return Std.parseInt(processValue());
 				return Std.parseInt(processValue());
 			}
 			}
-			
+
 			var pageCount = 0;
 			var pageCount = 0;
-			
+
 			for ( line in lines ) {
 			for ( line in lines ) {
 				idx = line.indexOf(" ");
 				idx = line.indexOf(" ");
 				switch(line.substr(0, idx))
 				switch(line.substr(0, idx))
@@ -203,12 +203,12 @@ class FontParser {
 			var bytes = new haxe.io.BytesInput(bytes);
 			var bytes = new haxe.io.BytesInput(bytes);
 			bytes.position += 4; // Signature
 			bytes.position += 4; // Signature
 			var pageCount : Int = 0;
 			var pageCount : Int = 0;
-			
+
 			while ( bytes.position < bytes.length ) {
 			while ( bytes.position < bytes.length ) {
 				var id = bytes.readByte();
 				var id = bytes.readByte();
 				var length = bytes.readInt32();
 				var length = bytes.readInt32();
 				var pos = bytes.position;
 				var pos = bytes.position;
-				
+
 				switch (id) {
 				switch (id) {
 					case 1: // info
 					case 1: // info
 						font.size = font.initSize = bytes.readInt16();
 						font.size = font.initSize = bytes.readInt16();
@@ -248,7 +248,7 @@ class FontParser {
 							count--;
 							count--;
 						}
 						}
 				}
 				}
-				
+
 				bytes.position = pos + length;
 				bytes.position = pos + length;
 			}
 			}
 		case sign:
 		case sign:
@@ -286,5 +286,5 @@ class FontParser {
 
 
 		return font;
 		return font;
 	}
 	}
-	
+
 }
 }

+ 9 - 9
hxd/fmt/bfnt/Reader.hx

@@ -4,19 +4,19 @@ import haxe.io.Input;
 
 
 @:access(h2d.Font)
 @:access(h2d.Font)
 class Reader {
 class Reader {
-	
+
 	var i : Input;
 	var i : Input;
-	
+
 	public function new( i : Input ) {
 	public function new( i : Input ) {
 		this.i = i;
 		this.i = i;
 	}
 	}
-	
+
 	public function read( resolveTile: String -> h2d.Tile ) : h2d.Font {
 	public function read( resolveTile: String -> h2d.Tile ) : h2d.Font {
-		
+
 		if (i.readString(4) != "BFNT" || i.readByte() != 0) throw "Not a BFNT file!";
 		if (i.readString(4) != "BFNT" || i.readByte() != 0) throw "Not a BFNT file!";
-		
+
 		var font : h2d.Font = null;
 		var font : h2d.Font = null;
-		
+
 		switch (i.readByte()) {
 		switch (i.readByte()) {
 			case 1:
 			case 1:
 				font = new h2d.Font(i.readString(i.readUInt16()), i.readInt16());
 				font = new h2d.Font(i.readString(i.readUInt16()), i.readInt16());
@@ -31,7 +31,7 @@ class Reader {
 					var glyph = new h2d.Font.FontChar(t, i.readInt16());
 					var glyph = new h2d.Font.FontChar(t, i.readInt16());
 					font.glyphs.set(id, glyph);
 					font.glyphs.set(id, glyph);
 					if (id == defaultChar) font.defaultChar = glyph;
 					if (id == defaultChar) font.defaultChar = glyph;
-					
+
 					var prevChar : Int;
 					var prevChar : Int;
 					while ( ( prevChar = i.readInt32() ) != 0 ) {
 					while ( ( prevChar = i.readInt32() ) != 0 ) {
 						glyph.addKerning(prevChar, i.readInt16());
 						glyph.addKerning(prevChar, i.readInt16());
@@ -40,10 +40,10 @@ class Reader {
 			case ver:
 			case ver:
 				throw "Unknown BFNT version: " + ver;
 				throw "Unknown BFNT version: " + ver;
 		}
 		}
-		
+
 		return font;
 		return font;
 	}
 	}
-	
+
 	public static inline function parse(bytes : haxe.io.Bytes, resolveTile : String -> h2d.Tile ) : h2d.Font {
 	public static inline function parse(bytes : haxe.io.Bytes, resolveTile : String -> h2d.Tile ) : h2d.Font {
 		return new Reader(new haxe.io.BytesInput(bytes)).read(resolveTile);
 		return new Reader(new haxe.io.BytesInput(bytes)).read(resolveTile);
 	}
 	}

+ 8 - 8
hxd/fmt/bfnt/Writer.hx

@@ -4,7 +4,7 @@ import haxe.io.Output;
 
 
 @:access(h2d.Font)
 @:access(h2d.Font)
 class Writer {
 class Writer {
-	
+
 	static inline var VERSION : Int = 1;
 	static inline var VERSION : Int = 1;
 	// V1 format:
 	// V1 format:
 	// [BFNT][0x00][0x01]
 	// [BFNT][0x00][0x01]
@@ -16,13 +16,13 @@ class Writer {
 	//     [prevChar:i4][advance:i2]
 	//     [prevChar:i4][advance:i2]
 	//   [kerning-terminator:0x00000000] or [kerning]
 	//   [kerning-terminator:0x00000000] or [kerning]
 	// [glyph-terminator:0x00000000] or [glyph]
 	// [glyph-terminator:0x00000000] or [glyph]
-	
+
 	var out : Output;
 	var out : Output;
-	
+
 	public function new( out : Output ) {
 	public function new( out : Output ) {
 		this.out = out;
 		this.out = out;
 	}
 	}
-	
+
 	public function write( font : h2d.Font ) {
 	public function write( font : h2d.Font ) {
 		out.writeString("BFNT");
 		out.writeString("BFNT");
 		out.writeByte(0);
 		out.writeByte(0);
@@ -45,11 +45,11 @@ class Writer {
 		} else {
 		} else {
 			out.writeInt32(0);
 			out.writeInt32(0);
 		}
 		}
-		
+
 		for ( id in font.glyphs.keys() ) {
 		for ( id in font.glyphs.keys() ) {
-			
+
 			if (id == 0) continue; // Safety measure if for some reason there's actually a character with ID 0.
 			if (id == 0) continue; // Safety measure if for some reason there's actually a character with ID 0.
-			
+
 			var glyph = font.glyphs.get(id);
 			var glyph = font.glyphs.get(id);
 			var t = glyph.t;
 			var t = glyph.t;
 			out.writeInt32(id);
 			out.writeInt32(id);
@@ -72,7 +72,7 @@ class Writer {
 		}
 		}
 		out.writeInt32(0);
 		out.writeInt32(0);
 	}
 	}
-	
+
 	inline function writeString( s : String ) {
 	inline function writeString( s : String ) {
 		if ( s == null ) s = "";
 		if ( s == null ) s = "";
 		var bytes = haxe.io.Bytes.ofString(s);
 		var bytes = haxe.io.Bytes.ofString(s);

+ 1 - 1
hxd/fmt/blend/Data.hx

@@ -95,7 +95,7 @@ class Blend {
 			b.code = readChars(4);
 			b.code = readChars(4);
 
 
 			if (b.code == 'ENDB') break;
 			if (b.code == 'ENDB') break;
-			
+
 			blocks.push(b);
 			blocks.push(b);
 			b.blend = this;
 			b.blend = this;
 
 

+ 30 - 30
hxd/fmt/fbx/Parser.hx

@@ -24,7 +24,7 @@ class Parser {
 	var token : Null<Token>;
 	var token : Null<Token>;
 	var binary : Bool;
 	var binary : Bool;
 	var fbxVersion:Int;
 	var fbxVersion:Int;
-	
+
 	function new() {
 	function new() {
 	}
 	}
 
 
@@ -46,25 +46,25 @@ class Parser {
 		this.pos = 0;
 		this.pos = 0;
 		this.line = 0;
 		this.line = 0;
 		this.binary = (bytes.getString(0, 20) == "Kaydara FBX Binary  ") && bytes.get(20) == 0;
 		this.binary = (bytes.getString(0, 20) == "Kaydara FBX Binary  ") && bytes.get(20) == 0;
-		
+
 		token = null;
 		token = null;
 		if (this.binary) {
 		if (this.binary) {
 			// Skip header, magic [0x1A, 0x00] and version number.
 			// Skip header, magic [0x1A, 0x00] and version number.
 			fbxVersion = bytes.getInt32(0x17);
 			fbxVersion = bytes.getInt32(0x17);
-			
+
 			this.pos = 21 + 2 + 4;
 			this.pos = 21 + 2 + 4;
 			var firstNode = parseBinaryNode(getVersionedInt32());
 			var firstNode = parseBinaryNode(getVersionedInt32());
 			if (firstNode.name != "") {
 			if (firstNode.name != "") {
-				
+
 				// Root was omitted, read until all data obtained.
 				// Root was omitted, read until all data obtained.
 				var nodes : Array<FbxNode> = [firstNode];
 				var nodes : Array<FbxNode> = [firstNode];
 				var size:Int = getVersionedInt32();
 				var size:Int = getVersionedInt32();
-				
+
 				while (size != 0) {
 				while (size != 0) {
 					nodes.push(parseBinaryNode(size));
 					nodes.push(parseBinaryNode(size));
 					size = getVersionedInt32();
 					size = getVersionedInt32();
 				}
 				}
-				
+
 				return {
 				return {
 					name: "Root",
 					name: "Root",
 					props: [PInt(0), PString("Root"), PString("Root")],
 					props: [PInt(0), PString("Root"), PString("Root")],
@@ -76,7 +76,7 @@ class Parser {
 				return firstNode;
 				return firstNode;
 			}
 			}
 		}
 		}
-		
+
 		return {
 		return {
 			name: "Root",
 			name: "Root",
 			props : [PInt(0),PString("Root"),PString("Root")],
 			props : [PInt(0),PString("Root"),PString("Root")],
@@ -172,7 +172,7 @@ class Parser {
 		if( childs == null ) childs = [];
 		if( childs == null ) childs = [];
 		return { name : name, props : props, childs : childs };
 		return { name : name, props : props, childs : childs };
 	}
 	}
-	
+
 	function parseBinaryNodes( output : Array<FbxNode> ) {
 	function parseBinaryNodes( output : Array<FbxNode> ) {
 		var size : Int = getVersionedInt32();
 		var size : Int = getVersionedInt32();
 		while (size != 0)
 		while (size != 0)
@@ -181,7 +181,7 @@ class Parser {
 			size = getVersionedInt32();
 			size = getVersionedInt32();
 		}
 		}
 	}
 	}
-	
+
 	function readBinaryString( length : Int ) : String {
 	function readBinaryString( length : Int ) : String {
 		if  (length == 0 ) return "";
 		if  (length == 0 ) return "";
 		var str = bytes.getString(pos, length);
 		var str = bytes.getString(pos, length);
@@ -196,45 +196,45 @@ class Parser {
 		}
 		}
 		return str;
 		return str;
 	}
 	}
-	
+
 	function parseBinaryNode( nextRecord : Int ) : FbxNode {
 	function parseBinaryNode( nextRecord : Int ) : FbxNode {
-		
+
 		var numProperties : Int = getVersionedInt32();
 		var numProperties : Int = getVersionedInt32();
 		var propertyListLength : UInt = getVersionedInt32();
 		var propertyListLength : UInt = getVersionedInt32();
 		var name : String = readBinaryString(getByte());
 		var name : String = readBinaryString(getByte());
-		
+
 		var props : Array<FbxProp> = new Array();
 		var props : Array<FbxProp> = new Array();
 		var childs : Array<FbxNode> = new Array();
 		var childs : Array<FbxNode> = new Array();
-		
+
 		var propStart : Int = pos;
 		var propStart : Int = pos;
-		
+
 		for ( i in 0...numProperties ) {
 		for ( i in 0...numProperties ) {
 			props.push(readBinaryProperty());
 			props.push(readBinaryProperty());
 		}
 		}
-		
+
 		pos = propStart + propertyListLength;
 		pos = propStart + propertyListLength;
-		
+
 		if ( pos < nextRecord ) {
 		if ( pos < nextRecord ) {
 			parseBinaryNodes(childs);
 			parseBinaryNodes(childs);
 		}
 		}
 		pos = nextRecord;
 		pos = nextRecord;
-		
+
 		return { name: name, props: props, childs: childs };
 		return { name: name, props: props, childs: childs };
 	}
 	}
-	
+
 	function readBinaryProperty() : FbxProp {
 	function readBinaryProperty() : FbxProp {
-		
+
 		var arrayLen : Int = 0;
 		var arrayLen : Int = 0;
 		var arrayEncoding:Int;
 		var arrayEncoding:Int;
 		var arrayCompressedLen:Int;
 		var arrayCompressedLen:Int;
 		var arrayBytes:Bytes = null;
 		var arrayBytes:Bytes = null;
 		var arrayBytesPos:Int = 0;
 		var arrayBytesPos:Int = 0;
-		
+
 		inline function readArray(entrySize:Int) {
 		inline function readArray(entrySize:Int) {
 			arrayLen = getInt32();
 			arrayLen = getInt32();
 			arrayEncoding = getInt32();
 			arrayEncoding = getInt32();
 			arrayCompressedLen = getInt32();
 			arrayCompressedLen = getInt32();
-			
+
 			switch( arrayEncoding ) {
 			switch( arrayEncoding ) {
 				case 0:
 				case 0:
 					arrayBytes = bytes;
 					arrayBytes = bytes;
@@ -248,11 +248,11 @@ class Parser {
 					error("Unsupported array encoding: " + arrayEncoding);
 					error("Unsupported array encoding: " + arrayEncoding);
 			}
 			}
 		}
 		}
-		
+
 		// Limitations:
 		// Limitations:
 		// Int64 records are converted to Floats with top bits being lost.
 		// Int64 records are converted to Floats with top bits being lost.
 		// Raw binary data converted to Strings.
 		// Raw binary data converted to Strings.
-		
+
 		var type : Int = getByte();
 		var type : Int = getByte();
 		switch( type ) {
 		switch( type ) {
 			case 'Y'.code:
 			case 'Y'.code:
@@ -373,43 +373,43 @@ class Parser {
 	inline function nextChar() {
 	inline function nextChar() {
 		return StringTools.fastCodeAt(buf, pos++);
 		return StringTools.fastCodeAt(buf, pos++);
 	}
 	}
-	
+
 	inline function getVersionedInt32() {
 	inline function getVersionedInt32() {
 		var i : Int = bytes.getInt32(pos);
 		var i : Int = bytes.getInt32(pos);
 		// No support for file sizes over Int32.
 		// No support for file sizes over Int32.
 		pos += fbxVersion >= 7500 ? 8 : 4;
 		pos += fbxVersion >= 7500 ? 8 : 4;
 		return i;
 		return i;
 	}
 	}
-	
+
 	inline function getInt32() {
 	inline function getInt32() {
 		var i : Int = bytes.getInt32(pos);
 		var i : Int = bytes.getInt32(pos);
 		pos += 4;
 		pos += 4;
 		return i;
 		return i;
 	}
 	}
-	
+
 	inline function getInt16() {
 	inline function getInt16() {
 		var i : Int = bytes.get(pos) | (bytes.get(pos + 1) << 8);
 		var i : Int = bytes.get(pos) | (bytes.get(pos + 1) << 8);
 		pos += 2;
 		pos += 2;
 		return i;
 		return i;
 	}
 	}
-	
+
 	inline function getFloat() {
 	inline function getFloat() {
 		var f : Float = bytes.getFloat(pos);
 		var f : Float = bytes.getFloat(pos);
 		pos += 4;
 		pos += 4;
 		return f;
 		return f;
 	}
 	}
-	
+
 	inline function getDouble() {
 	inline function getDouble() {
 		var d : Float = bytes.getDouble(pos);
 		var d : Float = bytes.getDouble(pos);
 		pos += 8;
 		pos += 8;
 		return d;
 		return d;
 	}
 	}
-	
+
 	inline function i64ToFloat( i64 : haxe.Int64 ) : Float {
 	inline function i64ToFloat( i64 : haxe.Int64 ) : Float {
 		return (i64.high * 4294967296) + 
 		return (i64.high * 4294967296) + 
 						( (i64.low & 0x80000000) != 0 ? ((i64.low & 0x7fffffff) + 2147483648) : i64.low );
 						( (i64.low & 0x80000000) != 0 ? ((i64.low & 0x7fffffff) + 2147483648) : i64.low );
 	}
 	}
-	
+
 	inline function getByte() {
 	inline function getByte() {
 		return bytes.get(pos++);
 		return bytes.get(pos++);
 	}
 	}

+ 3 - 3
hxd/fmt/hmd/Reader.hx

@@ -40,10 +40,10 @@ class Reader {
 		if( b == 0xFF ) return null;
 		if( b == 0xFF ) return null;
 		return i.readString(b);
 		return i.readString(b);
 	}
 	}
-	
-	
+
+
 	static var HMD_STRINGS : Map<String,String>;
 	static var HMD_STRINGS : Map<String,String>;
-	
+
 	// make sure some strings are reused between models
 	// make sure some strings are reused between models
 	// in order to prevent many similar String to be kept into memory
 	// in order to prevent many similar String to be kept into memory
 	function readCachedName() {
 	function readCachedName() {

+ 1 - 1
hxd/fmt/pak/FileSystem.hx

@@ -34,7 +34,7 @@ class FileSeek {
 	#if (hl && hl_ver >= version("1.12.0"))
 	#if (hl && hl_ver >= version("1.12.0"))
 	@:hlNative("std","file_seek2") static function seek2( f : sys.io.File.FileHandle, pos : Float, cur : Int ) : Bool { return false; }
 	@:hlNative("std","file_seek2") static function seek2( f : sys.io.File.FileHandle, pos : Float, cur : Int ) : Bool { return false; }
 	#end
 	#end
-	
+
 	public static function seek( f : FileInput, pos : Float, mode : FileSeekMode ) {
 	public static function seek( f : FileInput, pos : Float, mode : FileSeekMode ) {
 		#if (hl && hl_ver >= version("1.12.0"))
 		#if (hl && hl_ver >= version("1.12.0"))
 		if( !seek2(@:privateAccess f.__f,pos,mode.getIndex()) )
 		if( !seek2(@:privateAccess f.__f,pos,mode.getIndex()) )

+ 1 - 1
hxd/res/Atlas.hx

@@ -128,7 +128,7 @@ class Atlas extends Resource {
 				}
 				}
 				tl[index] = { t : t, width : origW, height : origH };
 				tl[index] = { t : t, width : origW, height : origH };
 			}
 			}
-			
+
 			// remove first element if index started at 1 instead of 0
 			// remove first element if index started at 1 instead of 0
 			for( tl in contents )
 			for( tl in contents )
 				if( tl.length > 1 && tl[0] == null ) tl.shift();
 				if( tl.length > 1 && tl[0] == null ) tl.shift();

+ 7 - 7
hxd/res/BDFFont.hx

@@ -26,7 +26,7 @@ using StringTools;
 		this.stride = stride;
 		this.stride = stride;
 		this.bits = new Array();
 		this.bits = new Array();
 	}
 	}
-	
+
 	static public function sortOnHeight( a : BDFFontChar, b : BDFFontChar ) {
 	static public function sortOnHeight( a : BDFFontChar, b : BDFFontChar ) {
 		return b.height - a.height; // Largest first
 		return b.height - a.height; // Largest first
 	}
 	}
@@ -56,7 +56,7 @@ class BDFFont extends Resource {
 	@:access(h2d.Font)
 	@:access(h2d.Font)
 	public function toFont() : h2d.Font {
 	public function toFont() : h2d.Font {
 		if ( font != null ) return font;
 		if ( font != null ) return font;
-		
+
 		// File starts with STARTFONT
 		// File starts with STARTFONT
 		if ( (entry.getBytes().getInt32(0) != 0x52415453) || (entry.getBytes().getInt32(8) != 0x2E322054) )
 		if ( (entry.getBytes().getInt32(0) != 0x52415453) || (entry.getBytes().getInt32(8) != 0x2E322054) )
 			throw 'File does not appear to be a BDF file. Expecting STARTFONT';
 			throw 'File does not appear to be a BDF file. Expecting STARTFONT';
@@ -78,7 +78,7 @@ class BDFFont extends Resource {
 		// Return the generated font
 		// Return the generated font
 		return font;
 		return font;
 	}
 	}
-	
+
 	/**
 	/**
 	 * Extract what we can from the font header. Unlike other font formats supported by heaps, some
 	 * Extract what we can from the font header. Unlike other font formats supported by heaps, some
 	 * of the values need to be infered from what is given (e.g. line height is not specificed directly,
 	 * of the values need to be infered from what is given (e.g. line height is not specificed directly,
@@ -219,7 +219,7 @@ class BDFFont extends Resource {
 			} // glyphs
 			} // glyphs
 
 
 		} // lines
 		} // lines
-		
+
 		// Return linenum we are up to
 		// Return linenum we are up to
 		return linenum;
 		return linenum;
 	}
 	}
@@ -240,7 +240,7 @@ class BDFFont extends Resource {
 		for ( d in glyphData ) volume += ( d.width * d.height );
 		for ( d in glyphData ) volume += ( d.width * d.height );
 		var bitmapWidth : Int = Math.ceil( Math.sqrt( volume * (1 + BitmapPad) ) );
 		var bitmapWidth : Int = Math.ceil( Math.sqrt( volume * (1 + BitmapPad) ) );
 		if ( bitmapWidth > BitmapMaxWidth ) throw 'The font bitmap is too big: ${bitmapWidth}x${bitmapWidth} (max ${BitmapMaxWidth}x${BitmapMaxWidth})';
 		if ( bitmapWidth > BitmapMaxWidth ) throw 'The font bitmap is too big: ${bitmapWidth}x${bitmapWidth} (max ${BitmapMaxWidth}x${BitmapMaxWidth})';
-		
+
 		// Create the bitmap
 		// Create the bitmap
 		var bitmapData : hxd.BitmapData = new hxd.BitmapData( bitmapWidth, bitmapWidth );
 		var bitmapData : hxd.BitmapData = new hxd.BitmapData( bitmapWidth, bitmapWidth );
 		bitmapData.lock();
 		bitmapData.lock();
@@ -358,7 +358,7 @@ class BDFFont extends Resource {
 			else
 			else
 				font.lineHeight = a.t.height * 2; 
 				font.lineHeight = a.t.height * 2; 
 		}
 		}
-		
+
 		// Estimate a baseline
 		// Estimate a baseline
 		var space = font.glyphs.get( " ".code );
 		var space = font.glyphs.get( " ".code );
 		var padding : Float = ( space.t.height * .5 );
 		var padding : Float = ( space.t.height * .5 );
@@ -379,7 +379,7 @@ class BDFFont extends Resource {
 		if( fallback == null )
 		if( fallback == null )
 			fallback = font.glyphs.get( " ".code );
 			fallback = font.glyphs.get( " ".code );
 		font.defaultChar = fallback;
 		font.defaultChar = fallback;
-		
+
 		// Cleanup
 		// Cleanup
 		bitmapData.dispose();
 		bitmapData.dispose();
 		this.glyphData = null; // No longer required
 		this.glyphData = null; // No longer required

+ 2 - 2
hxd/snd/Mp3Data.hx

@@ -180,7 +180,7 @@ class Mp3Data extends Data {
 			offset = (currentSample - frameStart) * 4 * channels;
 			offset = (currentSample - frameStart) * 4 * channels;
 			out.blit(outPos, frame, offset, frame.length - offset);
 			out.blit(outPos, frame, offset, frame.length - offset);
 			outPos += frame.length - offset;
 			outPos += frame.length - offset;
-			
+
 			sampleCount -= writeSamples;
 			sampleCount -= writeSamples;
 			currentSample += writeSamples;
 			currentSample += writeSamples;
 			seekFrame(currentFrame + 1);
 			seekFrame(currentFrame + 1);
@@ -213,7 +213,7 @@ class Mp3Data extends Data {
 		currentFrame = to;
 		currentFrame = to;
 		mp3_decode_frame(reader, bytes, bytes.length, frameOffsets[to], frame, frame.length, 0);
 		mp3_decode_frame(reader, bytes, bytes.length, frameOffsets[to], frame, frame.length, 0);
 	}
 	}
-	
+
 	@:hlNative("fmt", "mp3_open") static function mp3_open( bytes : hl.Bytes, size : Int ) : Mp3File {
 	@:hlNative("fmt", "mp3_open") static function mp3_open( bytes : hl.Bytes, size : Int ) : Mp3File {
 		return null;
 		return null;
 	}
 	}

+ 12 - 12
hxd/snd/NativeChannel.hx

@@ -11,7 +11,7 @@ private class ALChannel {
 
 
 	static var nativeUpdate : haxe.MainLoop.MainEvent;
 	static var nativeUpdate : haxe.MainLoop.MainEvent;
 	static var nativeChannels : Array<ALChannel>;
 	static var nativeChannels : Array<ALChannel>;
-	
+
 	static function updateChannels() {
 	static function updateChannels() {
 		var i = 0;
 		var i = 0;
 		// Should ensure ordering if it was removed during update?
 		// Should ensure ordering if it was removed during update?
@@ -46,7 +46,7 @@ private class ALChannel {
 		buffers = [driver.createBuffer(), driver.createBuffer()];
 		buffers = [driver.createBuffer(), driver.createBuffer()];
 		src = driver.createSource();
 		src = driver.createSource();
 		bufPos = 0;
 		bufPos = 0;
-		
+
 		// AL.sourcef(src,AL.PITCH,1.0);
 		// AL.sourcef(src,AL.PITCH,1.0);
 		// AL.sourcef(src,AL.GAIN,1.0);
 		// AL.sourcef(src,AL.GAIN,1.0);
 		fbuf = haxe.io.Bytes.alloc( samples<<3 );
 		fbuf = haxe.io.Bytes.alloc( samples<<3 );
@@ -111,7 +111,7 @@ class NativeChannel {
 	// Avoid excessive buffer allocation when playing many sounds.
 	// Avoid excessive buffer allocation when playing many sounds.
 	// bufferSamples is constant and never change at runtime, so it's safe to use general pool.
 	// bufferSamples is constant and never change at runtime, so it's safe to use general pool.
 	static var bufferPool : Array<haxe.io.Float32Array> = new Array();
 	static var bufferPool : Array<haxe.io.Float32Array> = new Array();
-	
+
 	var front : js.html.audio.AudioBuffer;
 	var front : js.html.audio.AudioBuffer;
 	var back : js.html.audio.AudioBuffer;
 	var back : js.html.audio.AudioBuffer;
 	var current : js.html.audio.AudioBufferSourceNode;
 	var current : js.html.audio.AudioBufferSourceNode;
@@ -136,16 +136,16 @@ class NativeChannel {
 		var rate = Std.int(ctx.sampleRate);
 		var rate = Std.int(ctx.sampleRate);
 		front = hxd.snd.webaudio.Context.getBuffer(2, bufferSamples, rate);
 		front = hxd.snd.webaudio.Context.getBuffer(2, bufferSamples, rate);
 		back = hxd.snd.webaudio.Context.getBuffer(2, bufferSamples, rate);
 		back = hxd.snd.webaudio.Context.getBuffer(2, bufferSamples, rate);
-		
+
 		if ( bufferPool.length > 0 ) tmpBuffer = bufferPool.pop();
 		if ( bufferPool.length > 0 ) tmpBuffer = bufferPool.pop();
 		else tmpBuffer = new haxe.io.Float32Array(bufferSamples * 2);
 		else tmpBuffer = new haxe.io.Float32Array(bufferSamples * 2);
 
 
 		gain = hxd.snd.webaudio.Context.getGain();
 		gain = hxd.snd.webaudio.Context.getGain();
 		gain.connect(hxd.snd.webaudio.Context.destination);
 		gain.connect(hxd.snd.webaudio.Context.destination);
-		
+
 		fill(front);
 		fill(front);
 		fill(back);
 		fill(back);
-		
+
 		current = ctx.createBufferSource();
 		current = ctx.createBufferSource();
 		current.buffer = front;
 		current.buffer = front;
 		current.addEventListener("ended", swap);
 		current.addEventListener("ended", swap);
@@ -154,12 +154,12 @@ class NativeChannel {
 		queued.buffer = back;
 		queued.buffer = back;
 		queued.addEventListener("ended", swap);
 		queued.addEventListener("ended", swap);
 		queued.connect(gain);
 		queued.connect(gain);
-		
+
 		var currTime : Float = ctx.currentTime;
 		var currTime : Float = ctx.currentTime;
 		current.start(currTime);
 		current.start(currTime);
 		time = currTime + front.duration;
 		time = currTime + front.duration;
 		queued.start(time);
 		queued.start(time);
-		
+
 		#elseif hlopenal
 		#elseif hlopenal
 		channel = new ALChannel(bufferSamples, this);
 		channel = new ALChannel(bufferSamples, this);
 		#end
 		#end
@@ -182,7 +182,7 @@ class NativeChannel {
 		front = back;
 		front = back;
 		back = tmp;
 		back = tmp;
 		fill(tmp);
 		fill(tmp);
-		
+
 		current.removeEventListener("ended", swap);
 		current.removeEventListener("ended", swap);
 		// current.disconnect(); // Should not be required as it's a one-shot object by design.
 		// current.disconnect(); // Should not be required as it's a one-shot object by design.
 		current = queued;
 		current = queued;
@@ -191,11 +191,11 @@ class NativeChannel {
 		queued.buffer = tmp;
 		queued.buffer = tmp;
 		queued.addEventListener("ended", swap);
 		queued.addEventListener("ended", swap);
 		queued.connect(gain);
 		queued.connect(gain);
-		
+
 		time += front.duration;
 		time += front.duration;
 		queued.start(time);
 		queued.start(time);
 	}
 	}
-	
+
 	inline function fill( buffer : js.html.audio.AudioBuffer ) {
 	inline function fill( buffer : js.html.audio.AudioBuffer ) {
 		onSample(tmpBuffer);
 		onSample(tmpBuffer);
 		// split the channels and copy to output
 		// split the channels and copy to output
@@ -238,7 +238,7 @@ class NativeChannel {
 
 
 			hxd.snd.webaudio.Context.putBuffer(front);
 			hxd.snd.webaudio.Context.putBuffer(front);
 			hxd.snd.webaudio.Context.putBuffer(back);
 			hxd.snd.webaudio.Context.putBuffer(back);
-			
+
 			bufferPool.push(tmpBuffer);
 			bufferPool.push(tmpBuffer);
 			tmpBuffer = null;
 			tmpBuffer = null;
 		}
 		}

+ 1 - 1
hxd/snd/effect/Pitch.hx

@@ -2,7 +2,7 @@ package hxd.snd.effect;
 
 
 class Pitch extends hxd.snd.Effect {
 class Pitch extends hxd.snd.Effect {
 	public var value : Float;
 	public var value : Float;
-	
+
 	public function new(value = 1.0) {
 	public function new(value = 1.0) {
 		super("pitch");
 		super("pitch");
 		this.value =  value;
 		this.value =  value;

+ 1 - 1
hxd/snd/openal/LowPassDriver.hx

@@ -11,7 +11,7 @@ class LowPassDriver extends hxd.snd.Driver.EffectDriver<LowPass> {
 		super();
 		super();
 		this.driver = driver;
 		this.driver = driver;
 	}
 	}
-	
+
 	override function acquire() : Void {
 	override function acquire() : Void {
 		var bytes = driver.getTmpBytes(4);
 		var bytes = driver.getTmpBytes(4);
 		EFX.genFilters(1, bytes);
 		EFX.genFilters(1, bytes);

+ 2 - 2
hxd/snd/webaudio/AudioTypes.hx

@@ -69,7 +69,7 @@ class BufferPlayback {
 	public var ends : Float;
 	public var ends : Float;
 
 
 	public var currentSample(get, never):Int;
 	public var currentSample(get, never):Int;
-	
+
 	static inline var FADE_SAMPLES = 10; // Click prevent at the start.
 	static inline var FADE_SAMPLES = 10; // Click prevent at the start.
 
 
 	var lastSamples:Int;
 	var lastSamples:Int;
@@ -134,7 +134,7 @@ class BufferPlayback {
 		if (consumed || node == null) return ends;
 		if (consumed || node == null) return ends;
 		var ctx = source.driver.ctx;
 		var ctx = source.driver.ctx;
 		var shiftTime = ctx.currentTime;// + 16 / buffer.inst.sampleRate;
 		var shiftTime = ctx.currentTime;// + 16 / buffer.inst.sampleRate;
-		
+
 		node.playbackRate.setValueAtTime(source.pitch, shiftTime);
 		node.playbackRate.setValueAtTime(source.pitch, shiftTime);
 		var elapsed = shiftTime - starts;
 		var elapsed = shiftTime - starts;
 		if ( elapsed < 0 ) {
 		if ( elapsed < 0 ) {

+ 4 - 4
hxd/snd/webaudio/Context.hx

@@ -10,7 +10,7 @@ import js.html.audio.AudioContext;
 	Common part between webaudio and OpenAL emulator - AudioContext and masterGain.
 	Common part between webaudio and OpenAL emulator - AudioContext and masterGain.
 **/
 **/
 class Context {
 class Context {
-	
+
 	static var ctx : AudioContext;
 	static var ctx : AudioContext;
 	static var suspended : Bool;
 	static var suspended : Bool;
 	static var bufferPool : Array<BufferPool>;
 	static var bufferPool : Array<BufferPool>;
@@ -40,7 +40,7 @@ class Context {
 			// see https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#webaudio
 			// see https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#webaudio
 			if ( ctx.state == SUSPENDED ) waitForPageInput();
 			if ( ctx.state == SUSPENDED ) waitForPageInput();
 			ctx.addEventListener("statechange", function(_) if ( ctx.state == SUSPENDED ) waitForPageInput() );
 			ctx.addEventListener("statechange", function(_) if ( ctx.state == SUSPENDED ) waitForPageInput() );
-			
+
 			bufferPool = [];
 			bufferPool = [];
 			gainPool = [];
 			gainPool = [];
 
 
@@ -50,7 +50,7 @@ class Context {
 		}
 		}
 		return ctx;
 		return ctx;
 	}
 	}
-	
+
 	public static inline function getGain():GainNode
 	public static inline function getGain():GainNode
 	{
 	{
 		return gainPool.length != 0 ? gainPool.pop() : ctx.createGain();
 		return gainPool.length != 0 ? gainPool.pop() : ctx.createGain();
@@ -63,7 +63,7 @@ class Context {
 
 
 	static function waitForPageInput() {
 	static function waitForPageInput() {
 		if ( !suspended ) {
 		if ( !suspended ) {
-			
+
 			js.Browser.document.addEventListener("click", resumeContext);
 			js.Browser.document.addEventListener("click", resumeContext);
 			js.Browser.document.addEventListener("keydown", resumeContext);
 			js.Browser.document.addEventListener("keydown", resumeContext);
 			js.Browser.document.body.addEventListener("keydown", resumeContext);
 			js.Browser.document.body.addEventListener("keydown", resumeContext);

+ 3 - 3
hxd/snd/webaudio/Driver.hx

@@ -26,7 +26,7 @@ class Driver implements hxd.snd.Driver {
 	public inline function getBuffer(channels : Int, sampleCount : Int, rate : Int) : AudioBuffer {
 	public inline function getBuffer(channels : Int, sampleCount : Int, rate : Int) : AudioBuffer {
 		return Context.getBuffer(channels, sampleCount, rate);
 		return Context.getBuffer(channels, sampleCount, rate);
 	}
 	}
-	
+
 	/**
 	/**
 		Puts AudioBuufer back to it's pool.
 		Puts AudioBuufer back to it's pool.
 	**/
 	**/
@@ -91,7 +91,7 @@ class Driver implements hxd.snd.Driver {
 	public function setSourceVolume (source : SourceHandle, value : Float) : Void {
 	public function setSourceVolume (source : SourceHandle, value : Float) : Void {
 		source.gain.gain.value = value;
 		source.gain.gain.value = value;
 	}
 	}
-	
+
 	public function destroySource (source : SourceHandle) : Void {
 	public function destroySource (source : SourceHandle) : Void {
 		stopSource(source);
 		stopSource(source);
 		source.gain.disconnect();
 		source.gain.disconnect();
@@ -111,7 +111,7 @@ class Driver implements hxd.snd.Driver {
 		b.samples = 0;
 		b.samples = 0;
 		return b;
 		return b;
 	}
 	}
-	
+
 	public function setBufferData (buffer : BufferHandle, data : haxe.io.Bytes, size : Int, format : Data.SampleFormat, channelCount : Int, samplingRate : Int) : Void {
 	public function setBufferData (buffer : BufferHandle, data : haxe.io.Bytes, size : Int, format : Data.SampleFormat, channelCount : Int, samplingRate : Int) : Void {
 		var sampleCount = Std.int(size / hxd.snd.Data.formatBytes(format) / channelCount);
 		var sampleCount = Std.int(size / hxd.snd.Data.formatBytes(format) / channelCount);
 		buffer.samples = sampleCount;
 		buffer.samples = sampleCount;

+ 1 - 1
hxsl/CacheFileBuilder.hx

@@ -17,7 +17,7 @@ private class CustomCacheFile extends CacheFile {
 		this.build = build;
 		this.build = build;
 		super(true, true);
 		super(true, true);
 	}
 	}
-	
+
 	override function load() {
 	override function load() {
 		allowSave = true;
 		allowSave = true;
 		super.load();
 		super.load();

+ 1 - 1
hxsl/Serializer.hx

@@ -418,7 +418,7 @@ class Serializer {
 			expr : readExpr(),
 			expr : readExpr(),
 		};
 		};
 	}
 	}
-	
+
 	static var SIGN = 0x8B741D; // will be encoded to HXSL
 	static var SIGN = 0x8B741D; // will be encoded to HXSL
 
 
 	public function unserialize( data : String ) : ShaderData {
 	public function unserialize( data : String ) : ShaderData {

+ 1 - 1
samples/Camera2D.hx

@@ -65,7 +65,7 @@ class Camera2D extends SampleApp {
 
 
 	override private function init() {
 	override private function init() {
 		super.init();
 		super.init();
-		
+
 		// Second camera for sample controls
 		// Second camera for sample controls
 		var uiCamera = new Camera();
 		var uiCamera = new Camera();
 		// layerVisible allows to filter out layers that camera should not render.
 		// layerVisible allows to filter out layers that camera should not render.

+ 7 - 7
samples/Cursor.hx

@@ -1,5 +1,5 @@
 class Cursor extends SampleApp {
 class Cursor extends SampleApp {
-	
+
 	override function init() {
 	override function init() {
 		super.init();
 		super.init();
 
 
@@ -11,12 +11,12 @@ class Cursor extends SampleApp {
 		bmp.line(0, 0, 0, 31, 0xFF0000FF);
 		bmp.line(0, 0, 0, 31, 0xFF0000FF);
 		bmp.line(0, 31, 31, 31, 0xFFFF0000);
 		bmp.line(0, 31, 31, 31, 0xFFFF0000);
 		bmp.line(31, 0, 31, 31, 0xFF00FF00);
 		bmp.line(31, 0, 31, 31, 0xFF00FF00);
-		
+
 		var animationSupported = false;
 		var animationSupported = false;
 		#if (flash || js || hldx || hlsdl)
 		#if (flash || js || hldx || hlsdl)
 		animationSupported = true;
 		animationSupported = true;
 		#end
 		#end
-		
+
 		var animatedFrames = [bmp];
 		var animatedFrames = [bmp];
 		if (animationSupported)
 		if (animationSupported)
 		{
 		{
@@ -29,7 +29,7 @@ class Cursor extends SampleApp {
 			bmp2.fill(15, 15, 2, 2, 0xFFFF00FF);
 			bmp2.fill(15, 15, 2, 2, 0xFFFF00FF);
 			animatedFrames.push(bmp2);
 			animatedFrames.push(bmp2);
 		}
 		}
-		
+
 		var cursors : Array<hxd.Cursor> = [Default,Button,Move,TextInput,Hide,Custom(new hxd.Cursor.CustomCursor([bmp],10,16,16)),Custom(new hxd.Cursor.CustomCursor(animatedFrames,10,16,16))];
 		var cursors : Array<hxd.Cursor> = [Default,Button,Move,TextInput,Hide,Custom(new hxd.Cursor.CustomCursor([bmp],10,16,16)),Custom(new hxd.Cursor.CustomCursor(animatedFrames,10,16,16))];
 		var pos = 3;
 		var pos = 3;
 		for( c in cursors ) {
 		for( c in cursors ) {
@@ -44,10 +44,10 @@ class Cursor extends SampleApp {
 			i.backgroundColor = Std.random(0x1000000) | 0xFF000000;
 			i.backgroundColor = Std.random(0x1000000) | 0xFF000000;
 			i.onOver = function(_) tf.alpha = 0.5;
 			i.onOver = function(_) tf.alpha = 0.5;
 			i.onOut = function(_) tf.alpha = 1;
 			i.onOut = function(_) tf.alpha = 1;
-			
+
 			switch(c) {
 			switch(c) {
 				case Custom(cur):
 				case Custom(cur):
-					
+
 					if (@:privateAccess cur.frames.length > 1) {
 					if (@:privateAccess cur.frames.length > 1) {
 						tf.text = "Custom (animated)";
 						tf.text = "Custom (animated)";
 						if (!animationSupported) {
 						if (!animationSupported) {
@@ -55,7 +55,7 @@ class Cursor extends SampleApp {
 							tf.textColor = 0xFF0000;
 							tf.textColor = 0xFF0000;
 						}
 						}
 					}
 					}
-					
+
 				default:
 				default:
 			}
 			}
 		}
 		}

+ 6 - 6
samples/Generator.hx

@@ -5,7 +5,7 @@ class Generator {
 		Sys.setCwd("build");
 		Sys.setCwd("build");
 		var cwd = Sys.getCwd();
 		var cwd = Sys.getCwd();
 		var installedLibs = new Map<String,Bool>();
 		var installedLibs = new Map<String,Bool>();
-		
+
 		function hasLib( l ) {
 		function hasLib( l ) {
 			if( installedLibs.exists(l) )
 			if( installedLibs.exists(l) )
 				return installedLibs.get(l);
 				return installedLibs.get(l);
@@ -13,7 +13,7 @@ class Generator {
 			installedLibs.set(l,ok);
 			installedLibs.set(l,ok);
 			return ok;
 			return ok;
 		}
 		}
-		
+
 		for( f in sys.FileSystem.readDirectory(".") ) {
 		for( f in sys.FileSystem.readDirectory(".") ) {
 			if( !sys.FileSystem.isDirectory(f) )
 			if( !sys.FileSystem.isDirectory(f) )
 				continue;
 				continue;
@@ -25,7 +25,7 @@ class Generator {
 				if( f != name ) name = f+"/"+name;
 				if( f != name ) name = f+"/"+name;
 				var pass = false;
 				var pass = false;
 				Sys.println(name);
 				Sys.println(name);
-				
+
 				var hxml = sys.io.File.getContent(d);
 				var hxml = sys.io.File.getContent(d);
 				var r_libs = ~/\-lib ([A-Za-z0-9_]+)/;
 				var r_libs = ~/\-lib ([A-Za-z0-9_]+)/;
 				var skip = false;
 				var skip = false;
@@ -39,7 +39,7 @@ class Generator {
 					hxml = r_libs.matchedRight();
 					hxml = r_libs.matchedRight();
 				}
 				}
 				if( skip ) continue;
 				if( skip ) continue;
-				
+
 				if( StringTools.endsWith(name,"_hl") )
 				if( StringTools.endsWith(name,"_hl") )
 					d = "-lib hlsdl "+d;
 					d = "-lib hlsdl "+d;
 				try {
 				try {
@@ -78,7 +78,7 @@ class Generator {
 		sys.io.File.saveContent("build/README.txt","This directory is automatically generated by samples/Script.hx using samples/templates");
 		sys.io.File.saveContent("build/README.txt","This directory is automatically generated by samples/Script.hx using samples/templates");
 
 
 		var hasHxBit = Sys.command("haxelib path hxbit") == 0;
 		var hasHxBit = Sys.command("haxelib path hxbit") == 0;
-			
+
 		for( f in sys.FileSystem.readDirectory(".") ) {
 		for( f in sys.FileSystem.readDirectory(".") ) {
 
 
 			if( sys.FileSystem.isDirectory(f) || !StringTools.endsWith(f,".hx") )
 			if( sys.FileSystem.isDirectory(f) || !StringTools.endsWith(f,".hx") )
@@ -109,7 +109,7 @@ class Generator {
 			#if !silent
 			#if !silent
 			Sys.println(name);
 			Sys.println(name);
 			#end
 			#end
-			
+
 			sys.io.File.saveContent('build/$name/$f', sys.io.File.getContent(f));
 			sys.io.File.saveContent('build/$name/$f', sys.io.File.getContent(f));
 
 
 			var interp = new hscript.Interp();
 			var interp = new hscript.Interp();

+ 2 - 2
samples/Interactive2D.hx

@@ -65,7 +65,7 @@ class Interactive2D extends SampleApp {
 			hover = false;
 			hover = false;
 			redrawGraphics();
 			redrawGraphics();
 		}
 		}
-		
+
 		addCheck("isEllipse", function() return interactive.isEllipse, function(v) interactive.isEllipse = v);
 		addCheck("isEllipse", function() return interactive.isEllipse, function(v) interactive.isEllipse = v);
 		addCheck("Rotate", function() return shouldRotate, function(v) {
 		addCheck("Rotate", function() return shouldRotate, function(v) {
 			shouldRotate = v;
 			shouldRotate = v;
@@ -132,7 +132,7 @@ class Interactive2D extends SampleApp {
 			case 3: interactive.shape = rectShape;
 			case 3: interactive.shape = rectShape;
 			case 4: interactive.shape = null;
 			case 4: interactive.shape = null;
 		}
 		}
-		
+
 		redrawGraphics();
 		redrawGraphics();
 		setRotation(interactive.rotation);
 		setRotation(interactive.rotation);
 	}
 	}

+ 36 - 36
samples/Particles2d.hx

@@ -8,21 +8,21 @@ class Particles2d extends SampleApp {
 	var particles : Particles;
 	var particles : Particles;
 	var movableParticleGroup : ParticleGroup;
 	var movableParticleGroup : ParticleGroup;
 	var time : Float;
 	var time : Float;
-	
+
 	var arrow : Texture;
 	var arrow : Texture;
 	var square : Texture;
 	var square : Texture;
 	var moving : Bool = false;
 	var moving : Bool = false;
 
 
 	override function init() {
 	override function init() {
 		super.init();
 		super.init();
-		
+
 		square = null;// h2d.Tile.fromColor(0xFFFFFF, 16, 16).getTexture();
 		square = null;// h2d.Tile.fromColor(0xFFFFFF, 16, 16).getTexture();
 		arrow = Res.arrow.toTexture();
 		arrow = Res.arrow.toTexture();
-		
+
 		particles = new Particles(s2d);
 		particles = new Particles(s2d);
 		g = new ParticleGroup(particles);
 		g = new ParticleGroup(particles);
 		particles.addGroup(g);
 		particles.addGroup(g);
-		
+
 		addSlider("Amount", function() return g.nparts, function(v) g.nparts = Std.int(v), 1, 1000);
 		addSlider("Amount", function() return g.nparts, function(v) g.nparts = Std.int(v), 1, 1000);
 		addCheck("Sort", function() return g.sortMode == Dynamic, function(v) g.sortMode = v ? Dynamic : None);
 		addCheck("Sort", function() return g.sortMode == Dynamic, function(v) g.sortMode = v ? Dynamic : None);
 		addCheck("Loop", function() return g.emitLoop, function(v) { g.emitLoop = v; });
 		addCheck("Loop", function() return g.emitLoop, function(v) { g.emitLoop = v; });
@@ -47,14 +47,14 @@ class Particles2d extends SampleApp {
 		// addButton("PartEmitMode.Box Demo", changeToBoxDemo);
 		// addButton("PartEmitMode.Box Demo", changeToBoxDemo);
 		// addButton("PartEmitMode.Direction Demo", changeToDirectionDemo);
 		// addButton("PartEmitMode.Direction Demo", changeToDirectionDemo);
 		// addButton("PartEmitMode.Direction + emitDirectionAsAngle Demo", changeToDirectionAndDirectionAsAngleDemo);
 		// addButton("PartEmitMode.Direction + emitDirectionAsAngle Demo", changeToDirectionAndDirectionAsAngleDemo);
-		
+
 		changeToPointDemo();
 		changeToPointDemo();
 	}
 	}
-	
+
 	function changeToPointDemo() {
 	function changeToPointDemo() {
 		// clear();
 		// clear();
 		reset();
 		reset();
-		
+
 		// g = new ParticleGroup(particles);
 		// g = new ParticleGroup(particles);
 		g.sizeRand = .2;
 		g.sizeRand = .2;
 		g.life = 1;
 		g.life = 1;
@@ -67,14 +67,14 @@ class Particles2d extends SampleApp {
 		g.fadeOut = 0;
 		g.fadeOut = 0;
 		g.dx = cast s2d.width / 2;
 		g.dx = cast s2d.width / 2;
 		g.dy = cast s2d.height / 2;
 		g.dy = cast s2d.height / 2;
-		
+
 		// particles.addGroup(g);
 		// particles.addGroup(g);
 	}
 	}
-	
+
 	function changeToPointAndDirectionAsAngleDemo() {
 	function changeToPointAndDirectionAsAngleDemo() {
 		// clear();
 		// clear();
 		reset();
 		reset();
-		
+
 		// g = new ParticleGroup(particles);
 		// g = new ParticleGroup(particles);
 		g.size = .8;
 		g.size = .8;
 		g.sizeRand = .2;
 		g.sizeRand = .2;
@@ -87,14 +87,14 @@ class Particles2d extends SampleApp {
 		g.fadeOut = 0;
 		g.fadeOut = 0;
 		g.dx = cast s2d.width / 2;
 		g.dx = cast s2d.width / 2;
 		g.dy = cast s2d.height / 2;
 		g.dy = cast s2d.height / 2;
-		
+
 		// particles.addGroup(g);
 		// particles.addGroup(g);
 	}
 	}
-	
+
 	function changeToConeDemo() {
 	function changeToConeDemo() {
 		// clear();
 		// clear();
 		reset();
 		reset();
-		
+
 		// g = new ParticleGroup(particles);
 		// g = new ParticleGroup(particles);
 		g.size = .2;
 		g.size = .2;
 		g.gravity = 1;
 		g.gravity = 1;
@@ -109,14 +109,14 @@ class Particles2d extends SampleApp {
 		g.fadeOut = 1;
 		g.fadeOut = 1;
 		g.dx = cast s2d.width / 2;
 		g.dx = cast s2d.width / 2;
 		g.dy = cast s2d.height / 2;
 		g.dy = cast s2d.height / 2;
-		
+
 		// particles.addGroup(g);
 		// particles.addGroup(g);
 	}
 	}
-	
+
 	function changeToBoxDemo() {
 	function changeToBoxDemo() {
 		// clear();
 		// clear();
 		reset();
 		reset();
-		
+
 		// g = new ParticleGroup(particles);
 		// g = new ParticleGroup(particles);
 		g.size = .2;
 		g.size = .2;
 		g.gravity = 1;
 		g.gravity = 1;
@@ -128,14 +128,14 @@ class Particles2d extends SampleApp {
 		g.emitDist = s2d.width;
 		g.emitDist = s2d.width;
 		g.emitDistY = s2d.height;
 		g.emitDistY = s2d.height;
 		g.dx = cast s2d.width / 2;
 		g.dx = cast s2d.width / 2;
-		
+
 		// particles.addGroup(g);
 		// particles.addGroup(g);
 	}
 	}
-	
+
 	function changeToDirectionDemo() {
 	function changeToDirectionDemo() {
 		// clear();
 		// clear();
 		reset();
 		reset();
-		
+
 		// g = new ParticleGroup(particles);
 		// g = new ParticleGroup(particles);
 		g.size = .2;
 		g.size = .2;
 		g.gravity = 1;
 		g.gravity = 1;
@@ -146,14 +146,14 @@ class Particles2d extends SampleApp {
 		g.emitDist = s2d.width;
 		g.emitDist = s2d.width;
 		g.emitAngle = Math.PI / 2;
 		g.emitAngle = Math.PI / 2;
 		g.fadeOut = .5;
 		g.fadeOut = .5;
-		
+
 		// particles.addGroup(g);
 		// particles.addGroup(g);
 	}
 	}
-	
+
 	function changeToDirectionAndDirectionAsAngleDemo() {
 	function changeToDirectionAndDirectionAsAngleDemo() {
 		// clear();
 		// clear();
 		reset();
 		reset();
-		
+
 		// g = new ParticleGroup(particles);
 		// g = new ParticleGroup(particles);
 		g.size = .8;
 		g.size = .8;
 		g.sizeRand = .2;
 		g.sizeRand = .2;
@@ -165,16 +165,16 @@ class Particles2d extends SampleApp {
 		g.emitAngle = Math.PI / 4;
 		g.emitAngle = Math.PI / 4;
 		g.fadeIn = 0;
 		g.fadeIn = 0;
 		g.fadeOut = 0;
 		g.fadeOut = 0;
-		
-		
+
+
 		// particles.addGroup(g);
 		// particles.addGroup(g);
 	}
 	}
-	
+
 	static function main() {
 	static function main() {
 		Res.initEmbed();
 		Res.initEmbed();
 		new Particles2d();
 		new Particles2d();
 	}
 	}
-	
+
 	function reset() {
 	function reset() {
 		g.dx = 0;
 		g.dx = 0;
 		g.dy = 0;
 		g.dy = 0;
@@ -184,50 +184,50 @@ class Particles2d extends SampleApp {
 		g.emitSync = 0;
 		g.emitSync = 0;
 		g.emitDelay = 0;
 		g.emitDelay = 0;
 		g.emitStartDist = 0.;
 		g.emitStartDist = 0.;
-		
+
 		g.life = 1;
 		g.life = 1;
 		g.lifeRand = 0;
 		g.lifeRand = 0;
-		
+
 		g.sizeIncr = 0;
 		g.sizeIncr = 0;
 		g.incrX = true;
 		g.incrX = true;
 		g.incrY = true;
 		g.incrY = true;
 		g.size = 1;
 		g.size = 1;
 		g.sizeRand = 0;
 		g.sizeRand = 0;
-		
+
 		g.speed = 50.;
 		g.speed = 50.;
 		g.speedRand = 0;
 		g.speedRand = 0;
 		g.speedIncr = 0;
 		g.speedIncr = 0;
 		g.gravity = 0;
 		g.gravity = 0;
 		g.gravityAngle = 0;
 		g.gravityAngle = 0;
-		
+
 		g.rotInit = 0;
 		g.rotInit = 0;
 		g.rotSpeed = 0;
 		g.rotSpeed = 0;
 		g.rotSpeedRand = 0;
 		g.rotSpeedRand = 0;
 		g.rotAuto = false;
 		g.rotAuto = false;
-		
+
 		g.fadeIn = .2;
 		g.fadeIn = .2;
 		g.fadeOut = .8;
 		g.fadeOut = .8;
 		g.fadePower = 1;
 		g.fadePower = 1;
-		
+
 		particles.x = 0;
 		particles.x = 0;
 		particles.y = 0;
 		particles.y = 0;
 	}
 	}
-	
+
 	function clear():Void {
 	function clear():Void {
 		time = 0;
 		time = 0;
 		if (movableParticleGroup != null) movableParticleGroup = null;
 		if (movableParticleGroup != null) movableParticleGroup = null;
 		if (g != null) particles.removeGroup(g);
 		if (g != null) particles.removeGroup(g);
 	}
 	}
-	
+
 	override function update(dt:Float) {
 	override function update(dt:Float) {
 		super.update(dt);
 		super.update(dt);
-		
+
 		if( moving ) {
 		if( moving ) {
 			time += dt * 0.6;
 			time += dt * 0.6;
 			particles.x = Math.cos(time) * (s2d.width / 4);
 			particles.x = Math.cos(time) * (s2d.width / 4);
 			particles.y = Math.sin(time) * (s2d.height / 4);
 			particles.y = Math.sin(time) * (s2d.height / 4);
 		}
 		}
-		
+
 		// if (movableParticleGroup != null)
 		// if (movableParticleGroup != null)
 		// {
 		// {
 		// 	time += dt * 0.01;
 		// 	time += dt * 0.01;

+ 1 - 1
samples/Sound.hx

@@ -56,7 +56,7 @@ class Sound extends SampleApp {
 		// 	music.position = slider.value * music.duration;
 		// 	music.position = slider.value * music.duration;
 		// };
 		// };
 		// musicPosition.setPosition(460, 80);
 		// musicPosition.setPosition(460, 80);
-		
+
 		addSlider("Global vol", function() { return hxd.snd.Manager.get().masterVolume; }, function(v) { hxd.snd.Manager.get().masterVolume = v; });
 		addSlider("Global vol", function() { return hxd.snd.Manager.get().masterVolume; }, function(v) { hxd.snd.Manager.get().masterVolume = v; });
 		addCheck("Beeper", function() { return beeper; }, function(v) { beeper = v; });
 		addCheck("Beeper", function() { return beeper; }, function(v) { beeper = v; });
 		addButton("Play noise", function() {
 		addButton("Play noise", function() {

+ 2 - 2
samples/Text.hx

@@ -186,9 +186,9 @@ class Text extends hxd.App {
 			var f2 = createFlow(flow);
 			var f2 = createFlow(flow);
 			createText(f2, multilineText, Align.Left);
 			createText(f2, multilineText, Align.Left);
 		}
 		}
-		
+
 		yoffset += flow.getBounds().height + 10;
 		yoffset += flow.getBounds().height + 10;
-		
+
 		// Showcases all supported font formats.
 		// Showcases all supported font formats.
 		var flow = createFlow(s2d);
 		var flow = createFlow(s2d);
 		flow.debug = false;
 		flow.debug = false;

+ 1 - 1
samples/Tiled.hx

@@ -22,7 +22,7 @@ class Tiled extends hxd.App {
 		drawLayer(tiledMapData, tiles, 2, TILE_SIZE);
 		drawLayer(tiledMapData, tiles, 2, TILE_SIZE);
 		drawLayer(tiledMapData, tiles, 3, TILE_SIZE);
 		drawLayer(tiledMapData, tiles, 3, TILE_SIZE);
 	}
 	}
-		
+
 	function drawLayer(map:TiledMapData, tiles:h2d.Tile, layer:Int, size:Int) {
 	function drawLayer(map:TiledMapData, tiles:h2d.Tile, layer:Int, size:Int) {
 		var tileGroup = new h2d.TileGroup(tiles);
 		var tileGroup = new h2d.TileGroup(tiles);
 		var tileSetArray = tiles.gridFlatten(TILE_SIZE, 0, 0);
 		var tileSetArray = tiles.gridFlatten(TILE_SIZE, 0, 0);

+ 2 - 2
tools/hxsl/Main.hx

@@ -170,7 +170,7 @@ class Main {
 			var r = @:privateAccess cache.buildRuntimeShader(dce.vertex, dce.fragment, paramVars);
 			var r = @:privateAccess cache.buildRuntimeShader(dce.vertex, dce.fragment, paramVars);
 			codes.set(Flatten, formatHxsl(r.vertex.data) + "\n\n" + formatHxsl(r.fragment.data)); // todo : add mapping of constants to buffers
 			codes.set(Flatten, formatHxsl(r.vertex.data) + "\n\n" + formatHxsl(r.fragment.data)); // todo : add mapping of constants to buffers
 
 
-		
+
 			var glsl = new hxsl.GlslOut();
 			var glsl = new hxsl.GlslOut();
 			var reg = ~/[0-9]+\.[0-9]+/;
 			var reg = ~/[0-9]+\.[0-9]+/;
 			var version : String = gl.getParameter(GL.SHADING_LANGUAGE_VERSION);
 			var version : String = gl.getParameter(GL.SHADING_LANGUAGE_VERSION);
@@ -178,7 +178,7 @@ class Main {
 				glsl.glES = Std.parseFloat(reg.matched(0));
 				glsl.glES = Std.parseFloat(reg.matched(0));
 				glsl.version = Math.round( Std.parseFloat(reg.matched(0)) * 100 );
 				glsl.version = Math.round( Std.parseFloat(reg.matched(0)) * 100 );
 			}
 			}
-			
+
 			var vertexSource = glsl.run(r.vertex.data);
 			var vertexSource = glsl.run(r.vertex.data);
 			var fragmentSource = glsl.run(r.fragment.data);
 			var fragmentSource = glsl.run(r.fragment.data);
 			codes.set(GLSL, vertexSource+"\n\n" + fragmentSource);
 			codes.set(GLSL, vertexSource+"\n\n" + fragmentSource);