Commit Graph

7949 Commits

Author SHA1 Message Date
Mark Richins 9941701b3a Fix: change twips_2d to use x and y and fix bug 2022-11-23 20:45:37 -07:00
Mark Richins 63a291ac4b Fix promblems caused by moving Twips 2022-11-23 20:45:37 -07:00
Mark Richins ca6c98785a Rename Twips2d.rs to twips_2d.rs 2022-11-23 20:45:37 -07:00
Mark Richins 331fd09953 Remove struct Twips from types.rs 2022-11-23 20:45:37 -07:00
Mark Richins 53df2bc8f5 add code to Twips2d.rs
TODO: redo comments
2022-11-23 20:45:37 -07:00
Mark Richins db4031ccc5 Create Twips2d.rs
see issue #6973
2022-11-23 20:45:37 -07:00
EmperorBale 7a0f3d5d32 chore: Formatting 2022-11-23 17:28:28 -07:00
EmperorBale e922a118d8 avm2: Improve inlining of stack related functions 2022-11-23 17:28:28 -07:00
EmperorBale c919890a1e chore: Use if/else instead of matching cmp 2022-11-23 17:28:28 -07:00
EmperorBale 657f54b2f1 chore: Cleanup clippy lint 2022-11-23 17:28:28 -07:00
EmperorBale 35219cf592 avm2: `op_get_scope_object` should start at the scope depth. 2022-11-23 17:28:28 -07:00
EmperorBale eb9ce4073e avm2: Clear stack & scope when execution is complete. 2022-11-23 17:28:28 -07:00
EmperorBale 4d151931f8 chore: Improve doc comments 2022-11-23 17:28:28 -07:00
EmperorBale 601f36df33 avm2: Introduce `clear_stack` & `clear_scope`. 2022-11-23 17:28:28 -07:00
EmperorBale 98d3b8f3c1 avm2: Enforce max scope depth & minimum scope depth
when pushing/popping from scope stack.
2022-11-23 17:28:28 -07:00
EmperorBale 7a48014d36 avm2: Enforce max stack & stack depth when pushing/popping from stack 2022-11-23 17:28:28 -07:00
EmperorBale d46b2c39ca avm2: Share scope stack across AVM2 2022-11-23 17:28:28 -07:00
EmperorBale 16805a350b avm2: Store stack information in activations 2022-11-23 17:28:28 -07:00
Moulins c10244b0a4 core: Only unload D.O.s when they are removed from the render list
D.O.s removed by the timeline may only be removed from the depth list
(if they were manipulated by AS3 scripts), but their unload method
would still be called, which is wrong.
2022-11-23 16:44:38 -07:00
Moulins 53010544db core: Simplify core::do::container::Lists bitflags into boolean enum
Callsites only ever used two values, as children in the display list are
always in the render list.
2022-11-23 16:44:38 -07:00
Moulins 58e39623a5 core: Make all ChildContainer's methods private
And also, remove some dead code
2022-11-23 16:44:38 -07:00
Aaron Hill 4b8cd45f4b
avm2: Partially implement StaticText (#8343)
This is linked to the legacy DisplayObject::Text, which can
only be created by Flash CS6 (but is allowed in AVM2 swfs).

The 'StaticText' class cannot be constructed from ActionScript.
To support this, I've added support for native initializers to
playerglobal. This allows us to throw an exception in the
ActionScript constructor in Test.as, and do nothing in the native
intiializer (so that we can construct it from a DisplayObject).

I've left StaticText.text unimplemented for now, since it will require
dealing with Glyphs

Co-authored-by: kmeisthax <dcrkid@yahoo.com>
2022-11-23 18:30:47 -05:00
Moulins 9529a1cbdb avm1: address Scope nitpicks 2022-11-23 15:50:45 -07:00
Moulins 05e3e6434b avm1: Remove all allocations in `Activation::from_nothing`
This is done by:
  - using the global constant pool instead of a fresh empty one:
    - OK, as no call-site is directly executing arbitrary bytecode that
      could care about the contents of the constant pool.
  - pre-allocating the global scope object in the `Avm1` context
  - using the global scope directly instead of allocating a local scope:
    - OK, because no call-site is directly defining locals on the
      returned Activation's scope.
2022-11-23 15:50:45 -07:00
Moulins 5faba34eb2 avm1: remove 'globals' parameter from Activation::from_nothing
Across all invocations, this is always set to the global object so it
can be hard-coded inside the call.
2022-11-23 15:50:45 -07:00
Moulins ea03aa04b8 avm1: make scope references immutable; they were never actually modified
Rewrite Scope::new_target_scope, as the previous approach is unusable
now that Scope doesn't have interior mutability anymore.
2022-11-23 15:50:45 -07:00
Moulins 8cb0b47d1f avm1: make constant pool reference immutable; it was never actually modified 2022-11-23 15:50:45 -07:00
TÖRÖK Attila a9c94513a0 avm2,audio: Implement leftPeak and rightPeak in SoundChannel 2022-11-23 15:38:41 -07:00
michiel2005 50724448c8 Update array.rs 2022-11-23 15:19:07 -07:00
michiel2005 7c5f2805ef Avoid code duplication
Avoided code duplication in avm1 array.rs as asked
2022-11-23 15:19:07 -07:00
Moulins 2fa3d31732 Appease Clippy on nightly 2022-11-23 22:39:45 +01:00
Toad06 eb2ee06588 avm1: Fix `ExternalInterface.call` with blank strings in SWFv8 2022-11-22 16:51:59 -07:00
Aaron Hill bdadb17a95 render: Don't use BitmapHandle in tessellator
Currently, we rely on ShapeTessellator being able to get a BitmapHandle
without a RenderBackend. With the upcoming BitmapData refactor,
we will always need a RenderBackend to get a BitmapHandle, which creates
borrow-checker issues in ShapeTessellator (which is stored in a
RenderBackend).

To solve this, we split BitmapSource.bitmap into two methods -
BitmapSource.bitmap and BitmapSource.bitmap_handle. ShapeTessellator
continues to use BitmapSource.bitmap, and uses the u16 bitmap id
instead of a BitmapHandle. The BitmapSource.bitmap_handle method
is used inside each render backend to convert the id to a BitmapHandle,
avoiding borrow-checker issues.
2022-11-21 21:04:40 -07:00
David Wendt 0aec23b468 chore: Upgrade deprecated timezone code.
This doesn't actually add any new places for code to panic, since the deprecated functions all `unwrap`'d internally.
2022-11-21 18:50:46 -07:00
David Wendt bc3f6f2494 chore: Update Chrono to the version that complains 2022-11-21 18:50:46 -07:00
dependabot[bot] 1b6e91393e build(deps): bump indexmap from 1.9.1 to 1.9.2
Bumps [indexmap](https://github.com/bluss/indexmap) from 1.9.1 to 1.9.2.
- [Release notes](https://github.com/bluss/indexmap/releases)
- [Changelog](https://github.com/bluss/indexmap/blob/master/RELEASES.md)
- [Commits](https://github.com/bluss/indexmap/compare/1.9.1...1.9.2)

---
updated-dependencies:
- dependency-name: indexmap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-21 18:27:58 -07:00
dependabot[bot] ccb1fa1b1b build(deps): bump clap from 4.0.24 to 4.0.26
Bumps [clap](https://github.com/clap-rs/clap) from 4.0.24 to 4.0.26.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.0.24...v4.0.26)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-21 18:07:28 -07:00
dependabot[bot] 6ab797b213 build(deps): bump rayon from 1.5.3 to 1.6.0
Bumps [rayon](https://github.com/rayon-rs/rayon) from 1.5.3 to 1.6.0.
- [Release notes](https://github.com/rayon-rs/rayon/releases)
- [Changelog](https://github.com/rayon-rs/rayon/blob/master/RELEASES.md)
- [Commits](https://github.com/rayon-rs/rayon/compare/v1.5.3...rayon-core-v1.6.0)

---
updated-dependencies:
- dependency-name: rayon
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-21 17:43:05 -07:00
dependabot[bot] 25664778f3 build(deps): bump bitstream-io from 1.5.0 to 1.6.0
Bumps [bitstream-io](https://github.com/tuffy/bitstream-io) from 1.5.0 to 1.6.0.
- [Release notes](https://github.com/tuffy/bitstream-io/releases)
- [Commits](https://github.com/tuffy/bitstream-io/compare/v1.5.0...v1.6.0)

---
updated-dependencies:
- dependency-name: bitstream-io
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-21 17:16:38 -07:00
dependabot[bot] cf8217f2ff build(deps): bump serde_json from 1.0.87 to 1.0.88
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.87 to 1.0.88.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.87...v1.0.88)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-21 16:31:02 -07:00
dependabot[bot] c2319da673 build(deps): bump gif from 0.11.4 to 0.12.0
Bumps [gif](https://github.com/image-rs/image-gif) from 0.11.4 to 0.12.0.
- [Release notes](https://github.com/image-rs/image-gif/releases)
- [Changelog](https://github.com/image-rs/image-gif/blob/master/Changes.md)
- [Commits](https://github.com/image-rs/image-gif/compare/v0.11.4...v0.12.0)

---
updated-dependencies:
- dependency-name: gif
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-21 16:12:02 -07:00
dependabot[bot] 78dac5e8ea build(deps): bump insta from 1.21.0 to 1.21.1
Bumps [insta](https://github.com/mitsuhiko/insta) from 1.21.0 to 1.21.1.
- [Release notes](https://github.com/mitsuhiko/insta/releases)
- [Changelog](https://github.com/mitsuhiko/insta/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mitsuhiko/insta/commits/1.21.1)

---
updated-dependencies:
- dependency-name: insta
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-21 15:21:32 -07:00
Toad06 caecc519cd avm1: Minimal implementation of `LoadVars.getBytesTotal` and `LoadVars.getBytesLoaded` 2022-11-20 22:00:36 -07:00
David Wendt 4c0099c39c tests: Reduce the epsilons on `as3_edittext_getlinemetrics` and `gettextextent` to more reasonable values 2022-11-20 17:13:48 -07:00
David Wendt ecdef4c6f4 core: Empty text lines should still have a height. 2022-11-20 17:13:48 -07:00
David Wendt 425bea45f8 avm1: `TextFormat.getTextExtent` uses the height of all boxes in the layout 2022-11-20 17:13:48 -07:00
David Wendt 728b198c9d tests: Re-run the `gettextextent` in an environment that actually sees Noto Sans as a system font. 2022-11-20 17:13:48 -07:00
David Wendt 51d8a196a4 tests: `gettextextent` should be an approx test.
Also, yes, `TextFormat.getTextExtent` returns a bare object.
2022-11-20 17:13:48 -07:00
David Wendt 66bf03908b avm1: Implement `TextFormat.getTextExtent` 2022-11-20 17:13:48 -07:00
David Wendt 83db53202e core: Add empty boxes for empty lines *without* breaking multiple-format lines. 2022-11-20 17:13:48 -07:00