Skip to content

Commit

Permalink
avm1: Implement FileReference
Browse files Browse the repository at this point in the history
  • Loading branch information
CUB3D authored and Dinnerbone committed Nov 3, 2023
1 parent 8f15aa3 commit af38664
Show file tree
Hide file tree
Showing 51 changed files with 1,960 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt install -y libasound2-dev libxcb-shape0-dev libxcb-xfixes0-dev libgtk-3-dev mesa-vulkan-drivers
sudo apt install -y libasound2-dev libxcb-shape0-dev libxcb-xfixes0-dev libgtk-3-dev mesa-vulkan-drivers libpango1.0-dev
- name: Cache Cargo output
uses: Swatinem/rust-cache@v2
Expand Down
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions core/src/avm1/globals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pub(crate) mod displacement_map_filter;
pub(crate) mod drop_shadow_filter;
pub(crate) mod error;
mod external_interface;
pub(crate) mod file_reference;
mod function;
pub(crate) mod glow_filter;
pub(crate) mod gradient_filter;
Expand Down Expand Up @@ -681,6 +682,7 @@ pub fn create_globals<'gc>(
let geom = ScriptObject::new(gc_context, Some(object_proto));
let filters = ScriptObject::new(gc_context, Some(object_proto));
let display = ScriptObject::new(gc_context, Some(object_proto));
let net = ScriptObject::new(gc_context, Some(object_proto));

let matrix = matrix::create_matrix_object(context, matrix_proto, function_proto);
let point = point::create_point_object(context, point_proto, function_proto);
Expand Down Expand Up @@ -866,6 +868,23 @@ pub fn create_globals<'gc>(
Attribute::empty(),
);

flash.define_value(gc_context, "net", net.into(), Attribute::empty());

let file_reference_obj = file_reference::create_constructor(
context,
object_proto,
function_proto,
array_proto,
broadcaster_functions,
);

net.define_value(
gc_context,
"FileReference",
file_reference_obj.into(),
Attribute::empty(),
);

let globals = ScriptObject::new(gc_context, None);
globals.define_value(
gc_context,
Expand Down
Loading

0 comments on commit af38664

Please sign in to comment.