Skip to content

Commit

Permalink
chore: Reformat filter files with spaces instead of tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
Lord-McSweeney authored and Lord-McSweeney committed Dec 13, 2024
1 parent 77e5ab3 commit a6f789a
Show file tree
Hide file tree
Showing 10 changed files with 417 additions and 416 deletions.
140 changes: 70 additions & 70 deletions core/src/avm2/globals/flash/filters/BevelFilter.as
Original file line number Diff line number Diff line change
@@ -1,86 +1,86 @@
package flash.filters {
public final class BevelFilter extends BitmapFilter {
// FIXME these should all be getters/setters to match Flash
public final class BevelFilter extends BitmapFilter {
// FIXME these should all be getters/setters to match Flash

[Ruffle(InternalSlot)]
public var angle : Number;
[Ruffle(InternalSlot)]
public var angle : Number;

[Ruffle(InternalSlot)]
public var blurX : Number;
[Ruffle(InternalSlot)]
public var blurX : Number;

[Ruffle(InternalSlot)]
public var blurY : Number;
[Ruffle(InternalSlot)]
public var blurY : Number;

[Ruffle(InternalSlot)]
public var distance : Number;
[Ruffle(InternalSlot)]
public var distance : Number;

[Ruffle(InternalSlot)]
public var highlightAlpha : Number;
[Ruffle(InternalSlot)]
public var highlightAlpha : Number;

[Ruffle(InternalSlot)]
public var highlightColor : uint;
[Ruffle(InternalSlot)]
public var highlightColor : uint;

[Ruffle(InternalSlot)]
public var knockout : Boolean;
[Ruffle(InternalSlot)]
public var knockout : Boolean;

[Ruffle(InternalSlot)]
public var quality : int;
[Ruffle(InternalSlot)]
public var quality : int;

[Ruffle(InternalSlot)]
public var shadowAlpha : Number;
[Ruffle(InternalSlot)]
public var shadowAlpha : Number;

[Ruffle(InternalSlot)]
public var shadowColor : uint;
[Ruffle(InternalSlot)]
public var shadowColor : uint;

[Ruffle(InternalSlot)]
public var strength : Number;
[Ruffle(InternalSlot)]
public var strength : Number;

[Ruffle(InternalSlot)]
public var type : String;
[Ruffle(InternalSlot)]
public var type : String;

public function BevelFilter(
distance:Number = 4.0,
angle:Number = 45,
highlightColor:uint = 0xFFFFFF,
highlightAlpha:Number = 1.0,
shadowColor:uint = 0x000000,
shadowAlpha:Number = 1.0,
blurX:Number = 4.0,
blurY:Number = 4.0,
strength:Number = 1,
quality:int = 1,
type:String = "inner",
knockout:Boolean = false
) {
this.angle = angle;
this.blurX = blurX;
this.blurY = blurY;
this.distance = distance;
this.highlightAlpha = highlightAlpha;
this.highlightColor = highlightColor;
this.knockout = knockout;
this.quality = quality;
this.shadowAlpha = shadowAlpha;
this.shadowColor = shadowColor;
this.strength = strength;
this.type = type;
}
public function BevelFilter(
distance:Number = 4.0,
angle:Number = 45,
highlightColor:uint = 0xFFFFFF,
highlightAlpha:Number = 1.0,
shadowColor:uint = 0x000000,
shadowAlpha:Number = 1.0,
blurX:Number = 4.0,
blurY:Number = 4.0,
strength:Number = 1,
quality:int = 1,
type:String = "inner",
knockout:Boolean = false
) {
this.angle = angle;
this.blurX = blurX;
this.blurY = blurY;
this.distance = distance;
this.highlightAlpha = highlightAlpha;
this.highlightColor = highlightColor;
this.knockout = knockout;
this.quality = quality;
this.shadowAlpha = shadowAlpha;
this.shadowColor = shadowColor;
this.strength = strength;
this.type = type;
}

override public function clone(): BitmapFilter {
return new BevelFilter(
this.distance,
this.angle,
this.highlightColor,
this.highlightAlpha,
this.shadowColor,
this.shadowAlpha,
this.blurX,
this.blurY,
this.strength,
this.quality,
this.type,
this.knockout
);
}
}
override public function clone(): BitmapFilter {
return new BevelFilter(
this.distance,
this.angle,
this.highlightColor,
this.highlightAlpha,
this.shadowColor,
this.shadowAlpha,
this.blurX,
this.blurY,
this.strength,
this.quality,
this.type,
this.knockout
);
}
}
}
10 changes: 5 additions & 5 deletions core/src/avm2/globals/flash/filters/BitmapFilter.as
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package flash.filters {
public class BitmapFilter {
public function clone(): BitmapFilter {
return null;
}
}
public class BitmapFilter {
public function clone(): BitmapFilter {
return null;
}
}
}
32 changes: 16 additions & 16 deletions core/src/avm2/globals/flash/filters/BlurFilter.as
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
package flash.filters {
public final class BlurFilter extends BitmapFilter {
[Ruffle(InternalSlot)]
public var blurX: Number;
public final class BlurFilter extends BitmapFilter {
[Ruffle(InternalSlot)]
public var blurX: Number;

[Ruffle(InternalSlot)]
public var blurY: Number;
[Ruffle(InternalSlot)]
public var blurY: Number;

[Ruffle(InternalSlot)]
public var quality: int;
[Ruffle(InternalSlot)]
public var quality: int;

public function BlurFilter(blurX: Number = 4.0, blurY: Number = 4.0, quality: int = 1) {
this.blurX = blurX;
this.blurY = blurY;
this.quality = quality;
}
public function BlurFilter(blurX: Number = 4.0, blurY: Number = 4.0, quality: int = 1) {
this.blurX = blurX;
this.blurY = blurY;
this.quality = quality;
}

override public function clone(): BitmapFilter {
return new BlurFilter(this.blurX, this.blurY, this.quality);
}
}
override public function clone(): BitmapFilter {
return new BlurFilter(this.blurX, this.blurY, this.quality);
}
}
}
58 changes: 29 additions & 29 deletions core/src/avm2/globals/flash/filters/ColorMatrixFilter.as
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
package flash.filters {
public final class ColorMatrixFilter extends BitmapFilter {
[Ruffle(InternalSlot)]
private var _matrix: Array;
public final class ColorMatrixFilter extends BitmapFilter {
[Ruffle(InternalSlot)]
private var _matrix: Array;

public function ColorMatrixFilter(matrix: Array = null) {
if (matrix == null) {
matrix = [
1, 0, 0, 0, 0,
0, 1, 0, 0, 0,
0, 0, 1, 0, 0,
0, 0, 0, 1, 0
];
}
this.matrix = matrix;
}
public function ColorMatrixFilter(matrix: Array = null) {
if (matrix == null) {
matrix = [
1, 0, 0, 0, 0,
0, 1, 0, 0, 0,
0, 0, 1, 0, 0,
0, 0, 0, 1, 0
];
}
this.matrix = matrix;
}

// From the Flash docs, we need to make a copy of the `Array`,
// as modifying the `filter.matrix` directly should have no effect.
// We call the method in the AS3 namespace, as some SWFS define a
// extend `Array` and declare a *public* 'concat' method with a
// different signature.
// From the Flash docs, we need to make a copy of the `Array`,
// as modifying the `filter.matrix` directly should have no effect.
// We call the method in the AS3 namespace, as some SWFS define a
// extend `Array` and declare a *public* 'concat' method with a
// different signature.

public function get matrix(): Array {
return this._matrix.AS3::concat();
}
public function get matrix(): Array {
return this._matrix.AS3::concat();
}

public function set matrix(matrix:Array):void {
this._matrix = matrix.AS3::concat();
}
public function set matrix(matrix:Array):void {
this._matrix = matrix.AS3::concat();
}

override public function clone(): BitmapFilter {
return new ColorMatrixFilter(this.matrix.AS3::concat());
}
}
override public function clone(): BitmapFilter {
return new ColorMatrixFilter(this.matrix.AS3::concat());
}
}
}
108 changes: 54 additions & 54 deletions core/src/avm2/globals/flash/filters/ConvolutionFilter.as
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
package flash.filters {
public final class ConvolutionFilter extends BitmapFilter {
[Ruffle(InternalSlot)]
public var alpha : Number;

[Ruffle(InternalSlot)]
public var bias : Number;

[Ruffle(InternalSlot)]
public var clamp : Boolean;

[Ruffle(InternalSlot)]
public var color : uint;

[Ruffle(InternalSlot)]
public var divisor : Number;

[Ruffle(InternalSlot)]
public var matrix : Array;

[Ruffle(InternalSlot)]
public var matrixX : Number;

[Ruffle(InternalSlot)]
public var matrixY : Number;

[Ruffle(InternalSlot)]
public var preserveAlpha : Boolean;

public function ConvolutionFilter(
matrixX:Number = 0,
matrixY:Number = 0,
matrix:Array = null,
divisor:Number = 1.0,
bias:Number = 0.0,
preserveAlpha:Boolean = true,
clamp:Boolean = true,
color:uint = 0,
alpha:Number = 0.0
) {
this.alpha = alpha;
this.bias = bias;
this.clamp = clamp;
this.color = color;
this.divisor = divisor;
this.matrix = matrix;
this.matrixX = matrixX;
this.matrixY = matrixY;
this.preserveAlpha = preserveAlpha;
}

override public function clone(): BitmapFilter {
return new ConvolutionFilter(this.matrixX, this.matrixY, this.matrixull, this.divisor, this.bias, this.preserveAlpharue, this.clamprue, this.color, this.alpha);
}
}
public final class ConvolutionFilter extends BitmapFilter {
[Ruffle(InternalSlot)]
public var alpha : Number;

[Ruffle(InternalSlot)]
public var bias : Number;

[Ruffle(InternalSlot)]
public var clamp : Boolean;

[Ruffle(InternalSlot)]
public var color : uint;

[Ruffle(InternalSlot)]
public var divisor : Number;

[Ruffle(InternalSlot)]
public var matrix : Array;

[Ruffle(InternalSlot)]
public var matrixX : Number;

[Ruffle(InternalSlot)]
public var matrixY : Number;

[Ruffle(InternalSlot)]
public var preserveAlpha : Boolean;

public function ConvolutionFilter(
matrixX:Number = 0,
matrixY:Number = 0,
matrix:Array = null,
divisor:Number = 1.0,
bias:Number = 0.0,
preserveAlpha:Boolean = true,
clamp:Boolean = true,
color:uint = 0,
alpha:Number = 0.0
) {
this.alpha = alpha;
this.bias = bias;
this.clamp = clamp;
this.color = color;
this.divisor = divisor;
this.matrix = matrix;
this.matrixX = matrixX;
this.matrixY = matrixY;
this.preserveAlpha = preserveAlpha;
}

override public function clone(): BitmapFilter {
return new ConvolutionFilter(this.matrixX, this.matrixY, this.matrixull, this.divisor, this.bias, this.preserveAlpharue, this.clamprue, this.color, this.alpha);
}
}
}
Loading

0 comments on commit a6f789a

Please sign in to comment.