From 24478ff43f56991c570f0945f8f6039e65e0ffe3 Mon Sep 17 00:00:00 2001 From: MartySVK <10010569+MartySVK@users.noreply.github.com> Date: Tue, 13 Aug 2024 08:32:23 +0200 Subject: [PATCH] avm2: Add missing [API()] to flash.geom --- core/src/avm2/globals/flash/geom/Matrix.as | 6 ++++++ core/src/avm2/globals/flash/geom/Matrix3D.as | 7 +++++++ core/src/avm2/globals/flash/geom/Point.as | 2 ++ core/src/avm2/globals/flash/geom/Rectangle.as | 1 + core/src/avm2/globals/flash/geom/Vector3D.as | 2 ++ 5 files changed, 18 insertions(+) diff --git a/core/src/avm2/globals/flash/geom/Matrix.as b/core/src/avm2/globals/flash/geom/Matrix.as index e263dec24514..46eda5ada246 100644 --- a/core/src/avm2/globals/flash/geom/Matrix.as +++ b/core/src/avm2/globals/flash/geom/Matrix.as @@ -36,11 +36,13 @@ package flash.geom { this.ty = ty; } + [API("674")] public function copyColumnFrom(column:uint, vector3D:Vector3D):void { // FP BUG: For some reason these methods are identical this.copyRowFrom(column, vector3D); } + [API("674")] public function copyColumnTo(column:uint, vector3D:Vector3D):void { if(column == 0) { vector3D.x = this.a; @@ -59,6 +61,7 @@ package flash.geom { } // otherwise vector is unchanged } + [API("674")] public function copyFrom(sourceMatrix: Matrix): void { this.a = sourceMatrix.a; this.b = sourceMatrix.b; @@ -68,6 +71,7 @@ package flash.geom { this.ty = sourceMatrix.ty; } + [API("674")] public function copyRowFrom(row: uint, vector3D: Vector3D): void { if (row == 0) { this.a = vector3D.x; @@ -80,6 +84,7 @@ package flash.geom { } // otherwise matrix is unchanged } + [API("674")] public function copyRowTo(row:uint, vector3D:Vector3D):void { if(row == 0) { vector3D.x = this.a; @@ -167,6 +172,7 @@ package flash.geom { this.ty *= sy; } + [API("674")] public function setTo(aa:Number, ba:Number, ca:Number, da:Number, txa:Number, tya:Number):void { this.a = aa; this.b = ba; diff --git a/core/src/avm2/globals/flash/geom/Matrix3D.as b/core/src/avm2/globals/flash/geom/Matrix3D.as index 83bac62febfc..e6126af20bdc 100644 --- a/core/src/avm2/globals/flash/geom/Matrix3D.as +++ b/core/src/avm2/globals/flash/geom/Matrix3D.as @@ -90,6 +90,7 @@ package flash.geom { this.append(m); } + [API("674")] public function copyRawDataFrom(vector:Vector., index:uint = 0, transpose:Boolean = false):void { if (transpose) { this.transpose(); @@ -107,6 +108,7 @@ package flash.geom { } // Based on https://github.com/openfl/openfl/blob/develop/src/openfl/geom/Matrix3D.hx#L542C1-L573 + [API("674")] public function copyRowTo(row:uint, vector3D:Vector3D):void { if (row > 3) { throw new ArgumentError("Error #2004: One of the parameters is invalid.", 2004); @@ -141,6 +143,7 @@ package flash.geom { } // Based on https://github.com/openfl/openfl/blob/develop/src/openfl/geom/Matrix3D.hx#L504-L534 + [API("674")] public function copyRowFrom(row:uint, vector3D:Vector3D):void { if (row > 3) { throw new ArgumentError("Error #2004: One of the parameters is invalid.", 2004); @@ -377,11 +380,13 @@ package flash.geom { this.prepend(m); } + [API("674")] public function copyFrom(other:Matrix3D):void { // This makes a copy of other.rawData this._rawData = other.rawData; } + [API("674")] public function copyRawDataTo(vector:Vector., index:uint = 0, transpose:Boolean = false):void { if (transpose) { this.transpose(); @@ -502,6 +507,7 @@ package flash.geom { return !(components[2].x == 0 || components[2].y == 0 || components[2].y == 0); } + [API("674")] public function copyColumnTo(column:uint, vector3D:Vector3D):void { if (column > 3) { throw new ArgumentError("Error #2004: One of the parameters is invalid.", 2004); @@ -537,6 +543,7 @@ package flash.geom { } } + [API("674")] public function copyColumnFrom(column:uint, vector3D:Vector3D):void { if (column > 3) { throw new ArgumentError("Error #2004: One of the parameters is invalid.", 2004); diff --git a/core/src/avm2/globals/flash/geom/Point.as b/core/src/avm2/globals/flash/geom/Point.as index 7c29af434d7c..a2265e8eae93 100644 --- a/core/src/avm2/globals/flash/geom/Point.as +++ b/core/src/avm2/globals/flash/geom/Point.as @@ -28,6 +28,7 @@ package flash.geom { return new Point(this.x, this.y); } + [API("674")] public function copyFrom(sourcePoint:Point):void { this.x = sourcePoint.x; this.y = sourcePoint.y; @@ -51,6 +52,7 @@ package flash.geom { this.y += dy; } + [API("674")] public function setTo(xa:Number, ya:Number):void { this.x = xa; this.y = ya; diff --git a/core/src/avm2/globals/flash/geom/Rectangle.as b/core/src/avm2/globals/flash/geom/Rectangle.as index 330e7164ee3b..51d443c35184 100644 --- a/core/src/avm2/globals/flash/geom/Rectangle.as +++ b/core/src/avm2/globals/flash/geom/Rectangle.as @@ -191,6 +191,7 @@ package flash.geom { this.height = sourceRect.height; } + [API("674")] public function setTo(xa: Number, ya: Number, widtha: Number, heighta: Number): void { this.x = xa; this.y = ya; diff --git a/core/src/avm2/globals/flash/geom/Vector3D.as b/core/src/avm2/globals/flash/geom/Vector3D.as index f9b2dc55514b..e9c5ec352a40 100644 --- a/core/src/avm2/globals/flash/geom/Vector3D.as +++ b/core/src/avm2/globals/flash/geom/Vector3D.as @@ -66,6 +66,7 @@ package flash.geom { return new Vector3D(this.x, this.y, this.z, this.w); } + [API("674")] public function copyFrom(sourceVector3D:Vector3D):void { this.x = sourceVector3D.x; this.y = sourceVector3D.y; @@ -87,6 +88,7 @@ package flash.geom { && (!allFour || Math.abs(toCompare.w) < tolerance); // FP BUG } + [API("674")] public function setTo(xa:Number, ya:Number, za: Number):void { this.x = xa; this.y = ya;