avm2: Replaced stubs in bitmapdata with new format

This commit is contained in:
Nathan Adams 2023-01-31 18:20:20 +01:00
parent 10ec9a1a74
commit fb0578ee26
2 changed files with 24 additions and 4 deletions

View File

@ -9,6 +9,7 @@ use crate::avm2::Error;
use crate::avm2::Multiname;
use crate::avm2::Namespace;
use crate::avm2::QName;
use crate::avm2_stub_method;
use crate::bitmap::bitmap_data::IBitmapDrawable;
use crate::bitmap::bitmap_data::{BitmapData, ChannelOptions, Color};
use crate::bitmap::is_size_valid;
@ -684,11 +685,11 @@ pub fn get_color_bounds_rect<'gc>(
}
pub fn lock<'gc>(
_activation: &mut Activation<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
_this: Option<Object<'gc>>,
_args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
tracing::warn!("BitmapData.lock - not yet implemented");
avm2_stub_method!(activation, "flash.display.BitmapData", "lock");
Ok(Value::Undefined)
}
@ -850,11 +851,11 @@ pub fn rect<'gc>(
/// Implement `BitmapData.applyFilter`
pub fn apply_filter<'gc>(
_activation: &mut Activation<'_, 'gc>,
activation: &mut Activation<'_, 'gc>,
_this: Option<Object<'gc>>,
_args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
tracing::warn!("BitmapData.applyFilter: Not yet implemented");
avm2_stub_method!(activation, "flash.display.BitmapData", "applyFilter");
Ok(Value::Undefined)
}

View File

@ -14,6 +14,11 @@ pub enum Stub {
method: &'static str,
specifics: Option<&'static str>,
},
Avm2Method {
class: &'static str,
method: &'static str,
specifics: Option<&'static str>,
},
Avm2Getter {
class: &'static str,
property: &'static str,
@ -45,6 +50,20 @@ impl Display for Stub {
} => {
write!(f, "AVM1 {class}.{method}() {specifics}")
}
Stub::Avm2Method {
class,
method,
specifics: None,
} => {
write!(f, "AVM2 {class}.{method}()")
}
Stub::Avm2Method {
class,
method,
specifics: Some(specifics),
} => {
write!(f, "AVM2 {class}.{method}() {specifics}")
}
Stub::Avm2Getter {
class,
property: field,