core: Cleanup PlaceObject comments

This commit is contained in:
Mike Welsh 2022-05-01 21:15:09 -07:00
parent 0833bd0d18
commit 82ed6fcba7
2 changed files with 16 additions and 19 deletions

View File

@ -1298,10 +1298,11 @@ pub trait TDisplayObject<'gc>:
self.set_opaque_background(context.gc_context, color); self.set_opaque_background(context.gc_context, color);
} }
} }
// Purposely omitted: name, clip_depth, clip_actions // Purposely omitted properties:
// name, clip_depth, clip_actions
// These properties are only set on initial placement in `MovieClip::instantiate_child` // These properties are only set on initial placement in `MovieClip::instantiate_child`
// and can not be modified by subsequent PlaceObject tags. // and can not be modified by subsequent PlaceObject tags.
// TODO: Others will go here eventually. // TODO: Filters need to be applied here.
} }
} }

View File

@ -1165,6 +1165,7 @@ impl<'gc> MovieClip<'gc> {
log::error!("No movie when trying to set clip event"); log::error!("No movie when trying to set clip event");
} }
} }
// TODO: Missing PlaceObject properties: amf_data, filters
// Run first frame. // Run first frame.
child.construct_frame(context); child.construct_frame(context);
@ -3340,15 +3341,16 @@ impl<'a> GotoPlaceObject<'a> {
if place_object.is_bitmap_cached.is_none() { if place_object.is_bitmap_cached.is_none() {
place_object.is_bitmap_cached = Some(Default::default()); place_object.is_bitmap_cached = Some(Default::default());
} }
if place_object.class_name.is_none() {
place_object.class_name = Some(Default::default());
}
if place_object.background_color.is_none() { if place_object.background_color.is_none() {
place_object.background_color = Some(Color::from_rgba(0)); place_object.background_color = Some(Color::from_rgba(0));
} }
// Deliberately omitted: // Purposely omitted properties:
// clip_depth: Can only be set on initial creation // name, clip_depth, clip_actions, amf_data
// `is_visible` purposely skipped; flag carries over during rewind. // These properties are only set on initial placement in `MovieClip::instantiate_child`
// and can not be modified by subsequent PlaceObject tags.
// Also, is_visible flag persists during rewind unlike all other properties.
// TODO: Filters need to be applied here. Rewinding will erase filters if initial
// PlaceObject tag has none.
} }
} }
@ -3386,12 +3388,6 @@ impl<'a> GotoPlaceObject<'a> {
if next_place.ratio.is_some() { if next_place.ratio.is_some() {
cur_place.ratio = next_place.ratio.take(); cur_place.ratio = next_place.ratio.take();
} }
if next_place.clip_depth.is_some() {
cur_place.clip_depth = next_place.clip_depth.take();
}
if next_place.class_name.is_some() {
cur_place.class_name = next_place.class_name.take();
}
if next_place.blend_mode.is_some() { if next_place.blend_mode.is_some() {
cur_place.blend_mode = next_place.blend_mode.take(); cur_place.blend_mode = next_place.blend_mode.take();
} }
@ -3404,11 +3400,11 @@ impl<'a> GotoPlaceObject<'a> {
if next_place.background_color.is_some() { if next_place.background_color.is_some() {
cur_place.background_color = next_place.background_color.take(); cur_place.background_color = next_place.background_color.take();
} }
// Deliberately omitted: (can only be set once on instantiation) // Purposely omitted properties:
// clip_actions // name, clip_depth, clip_actions, amf_data
// clip_depth // These properties are only set on initial placement in `MovieClip::instantiate_child`
// name: // and can not be modified by subsequent PlaceObject tags.
// TODO: Other stuff. // TODO: Filters need to be applied here. New filters will overwrite old filters.
} }
} }