Skip to content
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

avm2: Always create four Stage3D instances #19084

Merged
merged 1 commit into from
Dec 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions core/src/display_object/stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -783,19 +783,22 @@ impl<'gc> TDisplayObject<'gc> for Stage<'gc> {
stage_constr,
);

// Just create a single Stage3D for now
let stage3d = activation
.avm2()
.classes()
.stage3d
.construct(&mut activation, &[])
.expect("Failed to construct Stage3D");

match avm2_stage {
Ok(avm2_stage) => {
// Always create 4 Stage3D instances for now, which matches the flash projector behavior
let stage3ds: Vec<_> = (0..4)
.map(|_| {
activation
.avm2()
.classes()
.stage3d
.construct(&mut activation, &[])
.expect("Failed to construct Stage3D")
})
.collect();
let mut write = self.0.write(activation.gc());
write.avm2_object = Some(avm2_stage.into());
write.stage3ds = vec![stage3d];
write.stage3ds = stage3ds;
}
Err(e) => tracing::error!("Unable to construct AVM2 Stage: {}", e),
}
Expand Down
Loading