core: Fix failing builds without avm_debug feature

This commit is contained in:
Adrian Wielgosik 2022-12-06 19:14:16 +01:00 committed by Adrian Wielgosik
parent 1d6820c55b
commit 2bb4e2e549
3 changed files with 17 additions and 11 deletions

View File

@ -1336,6 +1336,9 @@ pub trait TDisplayObject<'gc>:
render_base((*self).into(), context) render_base((*self).into(), context)
} }
#[cfg(not(feature = "avm_debug"))]
fn display_render_tree(&self, _depth: usize) {}
#[cfg(feature = "avm_debug")] #[cfg(feature = "avm_debug")]
fn display_render_tree(&self, depth: usize) { fn display_render_tree(&self, depth: usize) {
let self_str = format!("{:?}", self); let self_str = format!("{:?}", self);

View File

@ -444,6 +444,9 @@ pub trait TDisplayObjectContainer<'gc>:
} }
} }
#[cfg(not(feature = "avm_debug"))]
fn recurse_render_tree(&self, _depth: usize) {}
#[cfg(feature = "avm_debug")] #[cfg(feature = "avm_debug")]
fn recurse_render_tree(&self, depth: usize) { fn recurse_render_tree(&self, depth: usize) {
for child in self.iter_render_list() { for child in self.iter_render_list() {

View File

@ -799,23 +799,23 @@ impl Player {
/// Event handling is a complicated affair, involving several different /// Event handling is a complicated affair, involving several different
/// concerns that need to resolve with specific priority. /// concerns that need to resolve with specific priority.
/// ///
/// 1. (In `avm_debug` builds) If Ctrl-Alt-V is pressed, dump all AVM1 /// 1. (In `avm_debug` builds)
/// variables in the player. /// If Ctrl-Alt-V is pressed, dump all AVM1 variables in the player.
/// 2. (In `avm_debug` builds) If Ctrl-Alt-D is pressed, toggle debug /// If Ctrl-Alt-D is pressed, toggle debug output for AVM1 and AVM2.
/// output for AVM1 and AVM2. /// If Ctrl-Alt-F is pressed, dump the display object tree.
/// 3. If the incoming event is text input or key input that could be /// 2. If the incoming event is text input or key input that could be
/// related to text input (e.g. pressing a letter key), we dispatch a /// related to text input (e.g. pressing a letter key), we dispatch a
/// key press event onto the stage. /// key press event onto the stage.
/// 4. If the event from step 3 was not handled, we check if an `EditText` /// 3. If the event from step 3 was not handled, we check if an `EditText`
/// object is in focus and dispatch a text-control event to said object. /// object is in focus and dispatch a text-control event to said object.
/// 5. If the incoming event is text input, and neither step 3 nor step 4 /// 4. If the incoming event is text input, and neither step 3 nor step 4
/// resulted in an event being handled, we dispatch a text input event /// resulted in an event being handled, we dispatch a text input event
/// to the currently focused `EditText` (if present). /// to the currently focused `EditText` (if present).
/// 6. Regardless of all prior event handling, we dispatch the event /// 5. Regardless of all prior event handling, we dispatch the event
/// through the stage normally. /// through the stage normally.
/// 7. Then, we dispatch the event through AVM1 global listener objects. /// 6. Then, we dispatch the event through AVM1 global listener objects.
/// 8. The AVM1 action queue is drained. /// 7. The AVM1 action queue is drained.
/// 9. Mouse state is updated. This triggers button rollovers, which are a /// 8. Mouse state is updated. This triggers button rollovers, which are a
/// second wave of event processing. /// second wave of event processing.
pub fn handle_event(&mut self, event: PlayerEvent) { pub fn handle_event(&mut self, event: PlayerEvent) {
let prev_is_mouse_down = self.input.is_mouse_down(); let prev_is_mouse_down = self.input.is_mouse_down();