ABC files are always pre-loaded.
Frame actions are handled as syntactic sugar on top of a `MovieClip` subclass and event handlers. ABC scripts do not live on the normal timeline.
This commit is contained in:
parent
502936f0fe
commit
560900e708
|
@ -68,16 +68,10 @@ impl<'gc> Avm2<'gc> {
|
||||||
/// Load an ABC file embedded in a `SwfSlice`.
|
/// Load an ABC file embedded in a `SwfSlice`.
|
||||||
///
|
///
|
||||||
/// The `SwfSlice` must resolve to the contents of an ABC file.
|
/// The `SwfSlice` must resolve to the contents of an ABC file.
|
||||||
///
|
|
||||||
/// The `preload` flag indicates if the file is being encountered as part
|
|
||||||
/// of a preloading operation. If false, then this file has actually been
|
|
||||||
/// encountered as part of normal movie playback and it's final script
|
|
||||||
/// should be executed.
|
|
||||||
pub fn load_abc(
|
pub fn load_abc(
|
||||||
&mut self,
|
&mut self,
|
||||||
abc: SwfSlice,
|
abc: SwfSlice,
|
||||||
context: &mut UpdateContext<'_, 'gc, '_>,
|
context: &mut UpdateContext<'_, 'gc, '_>,
|
||||||
preload: bool,
|
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let mut read = Reader::new(abc.as_ref());
|
let mut read = Reader::new(abc.as_ref());
|
||||||
|
|
||||||
|
|
|
@ -252,10 +252,6 @@ pub enum ActionType<'gc> {
|
||||||
name: String,
|
name: String,
|
||||||
is_lazy_initialize: bool,
|
is_lazy_initialize: bool,
|
||||||
abc: SwfSlice,
|
abc: SwfSlice,
|
||||||
|
|
||||||
/// Whether or not this ABC file was encountered during the preloading
|
|
||||||
/// step.
|
|
||||||
preload: bool,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -294,13 +290,11 @@ impl fmt::Debug for ActionType<'_> {
|
||||||
name,
|
name,
|
||||||
is_lazy_initialize,
|
is_lazy_initialize,
|
||||||
abc,
|
abc,
|
||||||
preload,
|
|
||||||
} => f
|
} => f
|
||||||
.debug_struct("ActionType::DoABC")
|
.debug_struct("ActionType::DoABC")
|
||||||
.field("name", name)
|
.field("name", name)
|
||||||
.field("is_lazy_initialize", is_lazy_initialize)
|
.field("is_lazy_initialize", is_lazy_initialize)
|
||||||
.field("bytecode", abc)
|
.field("bytecode", abc)
|
||||||
.field("preload", preload)
|
|
||||||
.finish(),
|
.finish(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -431,7 +431,6 @@ impl<'gc> MovieClip<'gc> {
|
||||||
name,
|
name,
|
||||||
is_lazy_initialize,
|
is_lazy_initialize,
|
||||||
abc: slice,
|
abc: slice,
|
||||||
preload: true,
|
|
||||||
},
|
},
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
|
|
|
@ -872,9 +872,8 @@ impl Player {
|
||||||
name,
|
name,
|
||||||
is_lazy_initialize,
|
is_lazy_initialize,
|
||||||
abc,
|
abc,
|
||||||
preload,
|
|
||||||
} => {
|
} => {
|
||||||
if let Err(e) = avm2.load_abc(abc, context, preload) {
|
if let Err(e) = avm2.load_abc(abc, context) {
|
||||||
log::warn!("Error loading ABC file: {}", e);
|
log::warn!("Error loading ABC file: {}", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue