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.
-	
+
 	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`.
 	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.
-		
+
 		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.
 	**/

+ 10 - 10
h2d/Camera.hx

@@ -4,11 +4,11 @@ package h2d;
 	A 2D camera representation attached to `h2d.Scene`.
 
 	Enables ability to move, scale and rotate the scene viewport.
-	
+
 	Scene supports usage of multiple Camera instances.
 	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`.
-	
+
 	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.
 **/
@@ -80,7 +80,7 @@ class Camera {
 
 	/**
 		Camera visibility.
-		
+
 		Does not affect the user input when Camera is set as interactive camera.
 	**/
 	public var visible : Bool;
@@ -141,7 +141,7 @@ class Camera {
 		Does not affect the user input when Camera is set as interactive camera.
 
 		Usage example:
-		
+
 		```haxe
 		final LAYER_SHARED = 0;
 		final LAYER_PLAYER_1 = 2;
@@ -164,7 +164,7 @@ class Camera {
 	public dynamic function layerVisible( layer : Int ) : Bool {
 		return true;
 	}
-	
+
 	/**
 		<span class="label">Internal usage</span>
 
@@ -305,7 +305,7 @@ class Camera {
 	// Screen <-> Camera
 	/**
 		Convert screen position into a local camera position.
-		
+
 		Requires Camera being attached to a Scene.
 	**/
 	inline function screenXToCamera( mx : Float, my : Float ) : Float {
@@ -314,7 +314,7 @@ class Camera {
 
 	/**
 		Convert screen position into a local camera position.
-		
+
 		Requires Camera being attached to a Scene.
 	**/
 	inline function screenYToCamera( mx : Float, my : Float ) : Float {
@@ -323,7 +323,7 @@ class Camera {
 
 	/**
 		Convert local camera position to absolute screen position.
-		
+
 		Requires Camera being attached to a Scene.
 	**/
 	inline function cameraXToScreen( mx : Float, my : Float ) : Float {
@@ -332,7 +332,7 @@ class Camera {
 
 	/**
 		Convert local camera position to absolute screen position.
-		
+
 		Requires Camera being attached to a Scene.
 	**/
 	inline function cameraYToScreen( mx : Float, my : Float ) : Float {
@@ -427,7 +427,7 @@ class Camera {
 	/**
 		Convert local camera position into absolute scene position.
 		Does not represent screen position, see `Camera.cameraToScreen` to convert position with accounting of `scaleMode`.
-		
+
 		Requires Camera being attached to a Scene.
 	**/
 	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
-	
+
 	/**
 		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.
-		
+
 		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`.
 		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.
-	
+
 	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.
@@ -59,7 +59,7 @@ class Dropdown extends Flow {
 		A Tile used to visualize and arrow of the dropdown when the list is open.
 	**/
 	public var tileArrowOpen : h2d.Tile;
-	
+
 	/**
 		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);
 			indexes = null;
 		}
-		
+
 		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 ) {
 	}
-	
+
 	/**
 		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
 	so the various transforms are inherited to its children.
-	
+
 	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.
 

+ 4 - 4
h2d/Particles.hx

@@ -345,7 +345,7 @@ class ParticleGroup {
 		Optional color gradient texture for tinting.
 	**/
 	public var colorGradient(default,set) : h3d.mat.Texture;
-	
+
 	/**
 		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.
@@ -413,7 +413,7 @@ class ParticleGroup {
 	inline function set_frameDivisionY(v) { frameDivisionY = v; makeTiles(); return v; }
 	inline function set_animationRepeat(v) return animationRepeat = v;
 	inline function set_isRelative(v) { needRebuild = true; return isRelative = v; }
-	
+
 	/**
 		Create a new particle group instance.
 		@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);
 				p.vx = Math.cos(g.emitAngle);
 				p.vy = Math.sin(g.emitAngle);
-				
+
 				var r = g.emitStartDist + g.emitDist * rand();
 				p.x += r * Math.cos(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;
 			var rot = Math.atan2(parts.matB / p.scaleY, parts.matA / p.scaleX);
 			p.rotation += rot;
-			
+
 			// Also rotate velocity.
 			var cos = Math.cos(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.
-	
+
 	Passed during `Object.sync` and `Object.drawRec` and can be accessed directly via `Scene.renderer`.
 **/
 @:access(h2d.Scene)
@@ -72,7 +72,7 @@ class RenderContext extends h3d.impl.RenderContext {
 
 	/**
 		<span class="label">Internal usage</span>
-		
+
 		Used to calculate filter rendering bounds.
 	**/
 	@:dox(hide)
@@ -156,7 +156,7 @@ class RenderContext extends h3d.impl.RenderContext {
 
 	/**
 		<span class="label">Internal usage</span>
-		
+
 		Prepares RenderContext to begin rendering a new frame.
 	**/
 	public function begin() {
@@ -256,7 +256,7 @@ class RenderContext extends h3d.impl.RenderContext {
 		entry.vd = tmpD;
 		entry.vx = viewX;
 		entry.vy = viewY;
-		
+
 		viewA = cam.matA * tmpA + cam.matB * tmpC;
 		viewB = cam.matA * tmpB + cam.matB * tmpD;
 		viewC = cam.matC * tmpA + cam.matD * tmpC;
@@ -331,7 +331,7 @@ class RenderContext extends h3d.impl.RenderContext {
 		flush();
 		engine.pushTarget(t);
 		initShaders(baseShaderList);
-		
+
 		var entry = targetsStack[targetsStackIndex++];
 		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 };
@@ -485,7 +485,7 @@ class RenderContext extends h3d.impl.RenderContext {
 			w = rx2 - rx1;
 			h = ry2 - ry1;
 		}
-		
+
 		engine.setRenderZone(
 			Std.int(x * scaleX + (scene.viewportX+1) * (engine.width / 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)
 		);
 	}
-	
+
 	inline function clearRZ() {
 		hasRenderZone = false;
 		engine.setRenderZone();

+ 1 - 1
h2d/ScaleGrid.hx

@@ -27,7 +27,7 @@ class ScaleGrid extends h2d.TileGroup {
 	public var height(default,set) : Float;
 	/**
 		When enabled, borders will be tiled along the edges instead of stretching to match the desired dimensions.
-		
+
 		Center tile is always stretched.
 	**/
 	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`.
 		@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`.
-		
+
 	**/
 	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 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`.
-		
+
 	**/
 	Fixed(width : Int, height: Int, zoom : Float, ?horizontalAlign : ScaleModeAlign, ?verticalAlign : ScaleModeAlign);
 
@@ -89,12 +89,12 @@ enum ScaleMode {
 		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`.
-		
+
 		@param minWidth The minimum width 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.
 		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);
 }
@@ -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.
-		
+
 		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.
 
@@ -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`.
-		
+
 		@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.
 	**/

+ 1 - 1
h2d/Slider.hx

@@ -8,7 +8,7 @@ class Slider extends h2d.Interactive {
 		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.
-		
+
 		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;

+ 1 - 1
h2d/SpriteBatch.hx

@@ -179,7 +179,7 @@ class BasicElement extends BatchElement {
 
 /**
 	An active batched tile renderer.
-	
+
 	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.
 	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.
 
 		Otherwise edge is at the `0` coordinate of the Text instance.
-		
+
 		See Text sample for showcase.
 	**/
 	Right;
 	/**
 		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.
 
 		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;
 	/**
 		Calculated text height.
-		
+
 		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.
 	**/
@@ -405,7 +405,7 @@ class Text extends Drawable {
 		case Left:
 			x = 0;
 		}
-		
+
 		for( i in 0...t.length ) {
 			var cc = t.charCodeAt(i);
 			var e = font.getChar(cc);

+ 3 - 3
h2d/Tile.hx

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

+ 9 - 9
h2d/Video.hx

@@ -100,12 +100,12 @@ class Video extends Drawable {
 		return playing ? haxe.Timer.stamp() - playTime : 0;
 		#end
 	}
-	
+
 	@:dox(hide) @:noCompletion
 	public inline function get_loop() {
 		return loopVideo;
 	}
-	
+
 	@:dox(hide) @:noCompletion
 	public function set_loop(value : Bool) : Bool {
 		#if js
@@ -177,11 +177,11 @@ class Video extends Drawable {
 		v.autoplay = true;
 		v.muted = true;
 		v.loop = loopVideo;
-		
+
 		videoPlaying = false;
 		videoTimeupdate = false;
 		this.onReady = onReady;
-		
+
 		v.addEventListener("playing", checkReady, true);
 		v.addEventListener("timeupdate", checkReady, true);
 		v.addEventListener("ended", endHandler, true);
@@ -192,9 +192,9 @@ class Video extends Drawable {
 		onError("Video not supported on this platform");
 		#end
 	}
-	
+
 	#if js
-	
+
 	function errorHandler(e : js.html.Event) {
 		#if (haxe_ver >= 4)
 		onError(v.error.code + ": " + v.error.message);
@@ -202,11 +202,11 @@ class Video extends Drawable {
 		onError(Std.string(v.error.code));
 		#end
 	}
-	
+
 	function endHandler(e : js.html.Event) {
 		onEnd();
 	}
-	
+
 	function checkReady(e : js.html.Event) {
 		if (e.type == "playing") {
 			videoPlaying = true;
@@ -215,7 +215,7 @@ class Video extends Drawable {
 			videoTimeupdate = true;
 			v.removeEventListener("timeupdate", checkReady, true);
 		}
-		
+
 		if (videoPlaying && videoTimeupdate) {
 			frameReady = true;
 			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.
 
 	For optimization to work properly, all opaque objects should have `Object.blendMode` set to `None`.
-	
+
 	Rendering is done in two passes:
 	* 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.
 
 	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.
 **/
 @:access(h2d.RenderContext)

+ 3 - 3
h2d/col/Bounds.hx

@@ -13,7 +13,7 @@ class Bounds {
 	public var xMin : Float;
 	/** Y-axis top-most bounding box point. **/
 	public var yMin : Float;
-	
+
 	/** X-axis right-most bounding box point. **/
 	public var xMax : Float;
 	/** 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`.
-		
+
 		Equivalent of `Bounds.addBounds`.
 	**/
 	public inline function doUnion( b : Bounds ) {
@@ -342,7 +342,7 @@ class Bounds {
 	public function toString() : String {
 		return "{" + getMin() + "," + getSize() + "}";
 	}
-	
+
 	/**
 		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.
-	
+
 	Note that it checks as `channel > cutoff`, not `channel >= cutoff`, hence cutoff value of 255 would never pass the test.
 **/
 class PixelsCollider implements Collider {

+ 1 - 1
h2d/col/Polygon.hx

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

+ 1 - 1
h2d/col/Polygons.hx

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

+ 1 - 1
h2d/col/Ray.hx

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

+ 1 - 1
h2d/col/Segment.hx

@@ -62,7 +62,7 @@ class Segment {
 		lenSq = dx * dx + dy * dy;
 		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.
 	**/

+ 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.
-	
+
 	Segments must be connected to form a complete polygonal shape.
 	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) {
 		return b.angle > a.angle ? 1 : (b.angle < a.angle ? -1 : 0);
 	}
-	
+
 	/**
 		Returns a list of the neighboring cells.
 	**/
@@ -1523,7 +1523,7 @@ class Voronoi {
 							va = vb;
 							// fall through
 						} 
-						
+
 						if (this.equalWithepsilon(va.y,yb) && this.lessThanWithepsilon(va.x,xr)) {
 							lastBorderSegment = this.equalWithepsilon(vz.y,yb);
 							vb = this.createVertex(lastBorderSegment ? vz.x : xr, yb);
@@ -1535,7 +1535,7 @@ class Voronoi {
 							va = vb;
 							// fall through
 						} 
-						
+
 						if (this.equalWithepsilon(va.x,xr) && this.greaterThanWithepsilon(va.y,yt)) {
 							lastBorderSegment = this.equalWithepsilon(vz.x,xr);
 							vb = this.createVertex(xr, lastBorderSegment ? vz.y : yt);
@@ -1547,7 +1547,7 @@ class Voronoi {
 							va = vb;
 							// fall through
 						} 
-						
+
 						if (this.equalWithepsilon(va.y,yt) && this.greaterThanWithepsilon(va.x,xl)) {
 							lastBorderSegment = this.equalWithepsilon(vz.y,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.
-	
+
 	Not intended to be used directly.
 
 	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;
 	/**
 		The Object contents of which serve as a mask to the filtered Object.
-		
+
 		Masking Objects have following limitations:
 		* It cannot be a parent of the filtered Object.
 		* 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, 0, 1]
 	```
-	
+
 	@see `Ambient`
 **/
 class ColorMatrix extends Filter {

+ 1 - 1
h2d/filter/Filter.hx

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

+ 2 - 2
h2d/filter/Group.hx

@@ -24,13 +24,13 @@ class Group extends Filter {
 		super();
 		this.filters = filters == null ? [] : filters;
 	}
-	
+
 	override function get_enable() {
 		if( !enable ) return false;
 		for( f in filters ) if( enable ) return true;
 		return false;
 	}
-	
+
 	/**
 		Adds new Filter `f` to the Group.  
 		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 {
 		static var SRC = {
 			@param var texture : Sampler2D;
-			
+
 			function fragment() {
 				var pixel : Vec4 = texture.get(calculatedUV);
 				// Premultiply alpha to ensure correct transparency.

+ 1 - 1
h2d/impl/BatchDrawState.hx

@@ -187,7 +187,7 @@ private class StateEntry {
 		A size of batch state.
 	**/
 	public var count : Int;
-	
+
 
 	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);
 	}
 }
-	
+
 private class CopyShader extends h3d.shader.ScreenShader {
 
 	static var SRC = {

+ 1 - 1
h3d/shader/AlphaMap.hx

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

+ 2 - 2
h3d/shader/SignedDistanceField.hx

@@ -3,7 +3,7 @@ package h3d.shader;
 class SignedDistanceField extends hxsl.Shader {
 
 	static var SRC = {
-		
+
 		@:import h3d.shader.Base2d;
 
 		// 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 == 3) textureSample.a;
 				else median(textureSample.r, textureSample.g, textureSample.b);
-			
+
 			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;
 
 class SkinBase extends hxsl.Shader {
-	
+
 	static var SRC = {
-		
+
 		var relativePosition : Vec3;
 		var transformedPosition : Vec3;
 		var transformedNormal : Vec3;
 
 		@const var MaxBones : Int;
 		@ignore @param var bonesMatrixes : Array<Mat3x4,MaxBones>;
-		
+
 	};
 
 	public function new() {
 		super();
 		MaxBones = 34;
 	}
-	
+
 }

+ 1 - 1
hxd/Charset.hx

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

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

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

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

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

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

@@ -4,7 +4,7 @@ import haxe.io.Output;
 
 @:access(h2d.Font)
 class Writer {
-	
+
 	static inline var VERSION : Int = 1;
 	// V1 format:
 	// [BFNT][0x00][0x01]
@@ -16,13 +16,13 @@ class Writer {
 	//     [prevChar:i4][advance:i2]
 	//   [kerning-terminator:0x00000000] or [kerning]
 	// [glyph-terminator:0x00000000] or [glyph]
-	
+
 	var out : Output;
-	
+
 	public function new( out : Output ) {
 		this.out = out;
 	}
-	
+
 	public function write( font : h2d.Font ) {
 		out.writeString("BFNT");
 		out.writeByte(0);
@@ -45,11 +45,11 @@ class Writer {
 		} else {
 			out.writeInt32(0);
 		}
-		
+
 		for ( id in font.glyphs.keys() ) {
-			
+
 			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 t = glyph.t;
 			out.writeInt32(id);
@@ -72,7 +72,7 @@ class Writer {
 		}
 		out.writeInt32(0);
 	}
-	
+
 	inline function writeString( s : String ) {
 		if ( s == null ) 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);
 
 			if (b.code == 'ENDB') break;
-			
+
 			blocks.push(b);
 			b.blend = this;
 

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

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

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

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

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

@@ -34,7 +34,7 @@ class FileSeek {
 	#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; }
 	#end
-	
+
 	public static function seek( f : FileInput, pos : Float, mode : FileSeekMode ) {
 		#if (hl && hl_ver >= version("1.12.0"))
 		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 };
 			}
-			
+
 			// remove first element if index started at 1 instead of 0
 			for( tl in contents )
 				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.bits = new Array();
 	}
-	
+
 	static public function sortOnHeight( a : BDFFontChar, b : BDFFontChar ) {
 		return b.height - a.height; // Largest first
 	}
@@ -56,7 +56,7 @@ class BDFFont extends Resource {
 	@:access(h2d.Font)
 	public function toFont() : h2d.Font {
 		if ( font != null ) return font;
-		
+
 		// File starts with STARTFONT
 		if ( (entry.getBytes().getInt32(0) != 0x52415453) || (entry.getBytes().getInt32(8) != 0x2E322054) )
 			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 font;
 	}
-	
+
 	/**
 	 * 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,
@@ -219,7 +219,7 @@ class BDFFont extends Resource {
 			} // glyphs
 
 		} // lines
-		
+
 		// Return linenum we are up to
 		return linenum;
 	}
@@ -240,7 +240,7 @@ class BDFFont extends Resource {
 		for ( d in glyphData ) volume += ( d.width * d.height );
 		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})';
-		
+
 		// Create the bitmap
 		var bitmapData : hxd.BitmapData = new hxd.BitmapData( bitmapWidth, bitmapWidth );
 		bitmapData.lock();
@@ -358,7 +358,7 @@ class BDFFont extends Resource {
 			else
 				font.lineHeight = a.t.height * 2; 
 		}
-		
+
 		// Estimate a baseline
 		var space = font.glyphs.get( " ".code );
 		var padding : Float = ( space.t.height * .5 );
@@ -379,7 +379,7 @@ class BDFFont extends Resource {
 		if( fallback == null )
 			fallback = font.glyphs.get( " ".code );
 		font.defaultChar = fallback;
-		
+
 		// Cleanup
 		bitmapData.dispose();
 		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;
 			out.blit(outPos, frame, offset, frame.length - offset);
 			outPos += frame.length - offset;
-			
+
 			sampleCount -= writeSamples;
 			currentSample += writeSamples;
 			seekFrame(currentFrame + 1);
@@ -213,7 +213,7 @@ class Mp3Data extends Data {
 		currentFrame = to;
 		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 {
 		return null;
 	}

+ 12 - 12
hxd/snd/NativeChannel.hx

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

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

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

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

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

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

@@ -69,7 +69,7 @@ class BufferPlayback {
 	public var ends : Float;
 
 	public var currentSample(get, never):Int;
-	
+
 	static inline var FADE_SAMPLES = 10; // Click prevent at the start.
 
 	var lastSamples:Int;
@@ -134,7 +134,7 @@ class BufferPlayback {
 		if (consumed || node == null) return ends;
 		var ctx = source.driver.ctx;
 		var shiftTime = ctx.currentTime;// + 16 / buffer.inst.sampleRate;
-		
+
 		node.playbackRate.setValueAtTime(source.pitch, shiftTime);
 		var elapsed = shiftTime - starts;
 		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.
 **/
 class Context {
-	
+
 	static var ctx : AudioContext;
 	static var suspended : Bool;
 	static var bufferPool : Array<BufferPool>;
@@ -40,7 +40,7 @@ class Context {
 			// see https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#webaudio
 			if ( ctx.state == SUSPENDED ) waitForPageInput();
 			ctx.addEventListener("statechange", function(_) if ( ctx.state == SUSPENDED ) waitForPageInput() );
-			
+
 			bufferPool = [];
 			gainPool = [];
 
@@ -50,7 +50,7 @@ class Context {
 		}
 		return ctx;
 	}
-	
+
 	public static inline function getGain():GainNode
 	{
 		return gainPool.length != 0 ? gainPool.pop() : ctx.createGain();
@@ -63,7 +63,7 @@ class Context {
 
 	static function waitForPageInput() {
 		if ( !suspended ) {
-			
+
 			js.Browser.document.addEventListener("click", resumeContext);
 			js.Browser.document.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 {
 		return Context.getBuffer(channels, sampleCount, rate);
 	}
-	
+
 	/**
 		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 {
 		source.gain.gain.value = value;
 	}
-	
+
 	public function destroySource (source : SourceHandle) : Void {
 		stopSource(source);
 		source.gain.disconnect();
@@ -111,7 +111,7 @@ class Driver implements hxd.snd.Driver {
 		b.samples = 0;
 		return b;
 	}
-	
+
 	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);
 		buffer.samples = sampleCount;

+ 1 - 1
hxsl/CacheFileBuilder.hx

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

+ 1 - 1
hxsl/Serializer.hx

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

+ 1 - 1
samples/Camera2D.hx

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

+ 7 - 7
samples/Cursor.hx

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

+ 6 - 6
samples/Generator.hx

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

+ 2 - 2
samples/Interactive2D.hx

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

+ 36 - 36
samples/Particles2d.hx

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

+ 1 - 1
samples/Sound.hx

@@ -56,7 +56,7 @@ class Sound extends SampleApp {
 		// 	music.position = slider.value * music.duration;
 		// };
 		// musicPosition.setPosition(460, 80);
-		
+
 		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; });
 		addButton("Play noise", function() {

+ 2 - 2
samples/Text.hx

@@ -186,9 +186,9 @@ class Text extends hxd.App {
 			var f2 = createFlow(flow);
 			createText(f2, multilineText, Align.Left);
 		}
-		
+
 		yoffset += flow.getBounds().height + 10;
-		
+
 		// Showcases all supported font formats.
 		var flow = createFlow(s2d);
 		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, 3, TILE_SIZE);
 	}
-		
+
 	function drawLayer(map:TiledMapData, tiles:h2d.Tile, layer:Int, size:Int) {
 		var tileGroup = new h2d.TileGroup(tiles);
 		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);
 			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 reg = ~/[0-9]+\.[0-9]+/;
 			var version : String = gl.getParameter(GL.SHADING_LANGUAGE_VERSION);
@@ -178,7 +178,7 @@ class Main {
 				glsl.glES = Std.parseFloat(reg.matched(0));
 				glsl.version = Math.round( Std.parseFloat(reg.matched(0)) * 100 );
 			}
-			
+
 			var vertexSource = glsl.run(r.vertex.data);
 			var fragmentSource = glsl.run(r.fragment.data);
 			codes.set(GLSL, vertexSource+"\n\n" + fragmentSource);