-
-
Notifications
You must be signed in to change notification settings - Fork 926
core: Run frames for AVM2 movies loaded into AVM1 #21959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a78c62b to
196baac
Compare
core/src/orphan_manager.rs
Outdated
| // Also, we consider AVM2 MovieClips loaded into an AVM1 parent to always | ||
| // be orphans, since we know they were placed by AVM1 code and not by | ||
| // the timeline. | ||
| dobj.placed_by_script() || has_avm1_parent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't such movies be placed by script anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, from what I understand, placed_by_script is only used by AVM2? As in, AVM1 code won't set_placed_by_script on DOs that it creates?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, but in this case you have placed_by_avm1_script. As a side note, I think we should aim at merging these two.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, but actually we don't really care about placed_by_avm1_script? As the comment says, we consider AVM2 MovieClips loaded into an AVM1 parent to be orphans no matter what, even if the AVM1 parent was placed by the timeline, because we need that AVM2 movie to tick its frames no matter what.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm misunderstanding something, but the comment says that we do that exactly because the object couldn't have been placed by the timeline. In which case it makes sense to check placed_by_avm1_script instead of using this assumption, right?
I'm looking into merging placed_by_avm1_script and placed_by_avm2_script into one
2316a64 to
6cec69f
Compare
6cec69f to
7271017
Compare
7271017 to
76e859d
Compare
Instead, do it explicitly everywhere it would've been done before. This allows us to make `TDisplayObject::object2` take a `Mutation` instead of an `UpdateContext`
76e859d to
68d9350
Compare
|
|
||
| /// The next MovieClip in the AVM1 execution list. | ||
| /// | ||
| /// `None` in an AVM2 movie. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate here when it's None vs Some? IIUC it's Some when either this movie clip or the root MC is from AVM1. Because without a comment I'd assume it's for AVM1 only.
| if !self.movie().is_action_script_3() { | ||
| // Run my load/enterFrame clip event. | ||
| // Run my load/enterFrame clip event. | ||
| if !self.movie().is_action_script_3() || !context.root_swf.is_action_script_3() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also add a comment here explaining this situation? I.e. why it is being run for an AVM2 movie
| // To detect this, we check 'placed_by_avm2_script'. This flag get set to 'true' | ||
| // To detect this, we check 'placed_by_script'. This flag get set to 'true' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 2 changes should be reverted
|
This is the wrong approach- when AVM1 loads an AVM2 movie, we probably want to interpret the loaded movie as actually being AVM1, except for the running of DoAction tags |
Fixes #21007