Skip to content

Commit

Permalink
core: Random SWF-related cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
relrelb authored and Herschel committed Oct 8, 2021
1 parent d069b8d commit 54df49f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions core/src/avm1/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ pub struct Avm1Function<'gc> {

/// A reference to the underlying SWF data.
data: SwfSlice,

/// The name of the function, if not anonymous.
name: Option<AvmString<'gc>>,

Expand Down
6 changes: 3 additions & 3 deletions core/src/display_object/avm1_button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ impl<'gc> TDisplayObject<'gc> for Avm1Button<'gc> {
}

fn movie(&self) -> Option<Arc<SwfMovie>> {
Some(self.0.read().static_data.read().swf.clone())
Some(self.0.read().movie())
}

fn post_instantiation(
Expand Down Expand Up @@ -285,7 +285,7 @@ impl<'gc> TDisplayObject<'gc> for Avm1Button<'gc> {
if record.states.contains(swf::ButtonState::HIT_TEST) {
match context
.library
.library_for_movie_mut(read.static_data.read().swf.clone())
.library_for_movie_mut(read.movie())
.instantiate_by_id(record.id, context.gc_context)
{
Ok(child) => {
Expand Down Expand Up @@ -594,7 +594,7 @@ impl From<ButtonState> for swf::ButtonState {

#[derive(Clone, Debug)]
struct ButtonAction {
action_data: crate::tag_utils::SwfSlice,
action_data: SwfSlice,
condition: swf::ButtonActionCondition,
key_code: Option<ButtonKeyCode>,
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/tag_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ impl From<Arc<SwfMovie>> for SwfSlice {
impl AsRef<[u8]> for SwfSlice {
#[inline]
fn as_ref(&self) -> &[u8] {
&self.movie.data()[self.start..self.end]
self.data()
}
}

Expand Down

0 comments on commit 54df49f

Please sign in to comment.