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: Stub AVM1Movie #11785

Merged
merged 1 commit into from
Jun 29, 2023
Merged
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
1 change: 1 addition & 0 deletions core/src/avm2/globals/flash/display.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! `flash.display` namespace

pub mod avm1movie;
pub mod bitmap;
pub mod bitmap_data;
pub mod display_object;
19 changes: 19 additions & 0 deletions core/src/avm2/globals/flash/display/AVM1Movie.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package flash.display {
import __ruffle__.stub_method;

[Ruffle(InstanceAllocator)]
public class AVM1Movie extends DisplayObject {
public function AVM1Movie() {
// Should be inaccessible
}

public function call(functionName:String, ... rest):* {
stub_method("flash.display.AVM1Movie", "call");
return null;
}

public function addCallback(name:String, fn:Function):void {
stub_method("flash.display.AVM1Movie", "addCallback");
}
}
}
12 changes: 12 additions & 0 deletions core/src/avm2/globals/flash/display/avm1movie.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use crate::avm2::{error::argument_error, Activation, ClassObject, Error, Object};

pub fn avm1movie_allocator<'gc>(
_class: ClassObject<'gc>,
activation: &mut Activation<'_, 'gc>,
) -> Result<Object<'gc>, Error<'gc>> {
return Err(Error::AvmError(argument_error(
activation,
"Error #2012: AVM1Movie$ class cannot be instantiated.",
2012,
)?));
}
1 change: 1 addition & 0 deletions core/src/avm2/globals/globals.as
Original file line number Diff line number Diff line change
@@ -51,6 +51,7 @@ include "flash/display/LoaderInfo.as"
include "flash/display/Stage.as"

include "flash/display/ActionScriptVersion.as"
include "flash/display/AVM1Movie.as"
include "flash/display/BitmapDataChannel.as"
include "flash/display/BitmapEncodingColorSpace.as"
include "flash/display/BlendMode.as"