avm1: Return proper root object for Avm1::root_object
Was returning start_clip instead. Also call DisplayObject::post_instantiation for root after it's created in Player::new.
This commit is contained in:
parent
4477e8458f
commit
574ede0541
|
@ -986,7 +986,7 @@ impl<'gc> Avm1<'gc> {
|
|||
|
||||
/// Obtain the value of `_root`.
|
||||
pub fn root_object(&self, context: &mut ActionContext<'_, 'gc, '_>) -> Value<'gc> {
|
||||
context.start_clip.read().object()
|
||||
context.root.read().object()
|
||||
}
|
||||
|
||||
/// Obtain the value of `_global`.
|
||||
|
|
|
@ -127,6 +127,13 @@ impl<Audio: AudioBackend, Renderer: RenderBackend, Navigator: NavigatorBackend>
|
|||
is_mouse_down: false,
|
||||
};
|
||||
|
||||
player.gc_arena.mutate(|gc_context, gc_root| {
|
||||
gc_root
|
||||
.root
|
||||
.write(gc_context)
|
||||
.post_instantiation(gc_context, gc_root.root)
|
||||
});
|
||||
|
||||
player.build_matrices();
|
||||
player.preload();
|
||||
|
||||
|
|
Loading…
Reference in New Issue