Commit Graph

642 Commits

Author SHA1 Message Date
Mike Welsh 01f47d675c core: Move UpdateContext into context submodule 2019-10-27 13:49:47 -07:00
Mike Welsh dddfb42e1e core: Merge ActionContext into UpdateContext 2019-10-27 13:49:47 -07:00
Mike Welsh 21c4ab255d
core: Merge #104, move display objects to display_object module
core: Move display objects to display_object module
2019-10-26 15:34:54 -07:00
Mike Welsh c4c895c6c9 core: Move display objects to display_object module 2019-10-26 15:04:52 -07:00
Mike Welsh c4426bf377
core: Merge #103, improve execution order of ActionScript and gotos
core: Improve execution order of ActionScript and gotos
2019-10-26 13:43:04 -07:00
Mike Welsh 2cdb8d3656 tests: execution_order -> execution_order1 2019-10-26 03:35:58 -07:00
Mike Welsh 247fd3b9c6 core: Run gotos immediately
Gotos now goto the specified frames immediately as opposed to
queuing. Actions on the new frame will still be queued,
and are executed after any current actions are completed.
2019-10-26 03:35:58 -07:00
Mike Welsh e78be0f06f core: Remove avm from UpdateContext 2019-10-26 02:21:48 -07:00
Mike Welsh c718a6c8cb core: Add more properties to ActionContext
ActionContext needs to be able to call goto, so it needs access
to most of UpdateContext.

TODO: Remove ActionContext, and only have UpdateContext?
2019-10-26 02:21:46 -07:00
Mike Welsh 09fa755405 core: Make Library::device_font optional 2019-10-26 02:20:42 -07:00
Mike Welsh 57a737357b core: Remove RefMut/Ref from UpdateContext 2019-10-26 02:20:42 -07:00
Mike Welsh 838944b5a1 tests: Add tests for goto execution order 2019-10-26 02:20:42 -07:00
Mike Welsh 863801371b tests: Better output when regression test fails 2019-10-26 01:52:42 -07:00
Mike Welsh 6da55f4fc2 tests: Remove ignore on execution order test 2019-10-26 01:52:42 -07:00
Mike Welsh a4bed6c643 core: Improve execution order of AS 2019-10-26 01:52:42 -07:00
Mike Welsh 666075c651 tests: Allow attributes in swf_tests macro
Also ignore failing execution_order test
2019-10-26 01:52:42 -07:00
Mike Welsh 008581f1bd tests: Add test for parent-child execution order
(currently fails)
2019-10-26 01:52:42 -07:00
Mike Welsh e02204a78f
avm1: Merge #97, impl From<*> for Value
Implement From<*> for Value for better dev ergonomics
2019-10-21 11:43:29 -07:00
Nathan Adams 6a2806b44a chore: Allow Into<Value> for test results 2019-10-21 17:22:03 +02:00
Nathan Adams 348e7f6adb chore: Impl From<numeric> for Value, better dev ergonomics 2019-10-21 17:14:00 +02:00
Nathan Adams 83b7d679ed chore: Impl From<GcCell<'gc, Object<'gc>>> for Value, better dev ergonomics 2019-10-21 13:00:52 +02:00
Nathan Adams fa5616a4f9 chore: Impl From<bool> for Value, better dev ergonomics 2019-10-21 12:55:17 +02:00
Nathan Adams 4c81ac8a6d chore: Take Into<Value> for Object.(force_)set 2019-10-21 12:48:45 +02:00
Nathan Adams 0ba9cef2f0 chore: Take Into<Value> for tests 2019-10-21 12:44:21 +02:00
Nathan Adams f24ab37810 chore: Impl From<&str> for Value, better dev ergonomics 2019-10-21 12:33:49 +02:00
Nathan Adams 796c641b3b chore: Impl From<String> for Value, better dev ergonomics 2019-10-21 12:30:59 +02:00
Mike Welsh 6bd4ed22a1
core: Merge #91, add some global conversion functions 2019-10-21 02:29:51 -07:00
Mike Welsh 84cb00b44b chore: Fix clippy lint in Value::as_bool 2019-10-21 02:11:50 -07:00
Will Brindle 019ea79551 core: return true for objects as boolean 2019-10-20 10:00:18 +01:00
Will Brindle d3006cb37b chore fix formatting 2019-10-19 10:36:24 +01:00
Will Brindle 5b298a0814 chore: refactor test code to share common methods 2019-10-19 10:31:37 +01:00
Will Brindle 3fa198d8f2 core: Add extra test cases for Number function and resolve the issues they highlight 2019-10-19 10:29:26 +01:00
Will Brindle 463d0fc352 core: implement isNaN and Number functions. Involves updating to_number function in Value. Note: this varies a little from the ECMA spec such as not allowing spaces in numbers (i.e. ' 5' => NaN). No definitive reference for this but was found experimentally. Same with not supporting 'Infinity' 2019-10-19 10:29:26 +01:00
Will Brindle 38c66b5b8d core: implement Boolean function 2019-10-19 10:29:26 +01:00
Mike Welsh 45a5eae86a
avm1: Merge #84, AVM1 function cleanup 2019-10-15 17:39:40 -07:00
Mike Welsh b0624a3654 tests: Add define_function2 and register test 2019-10-15 17:20:48 -07:00
Mike Welsh f5710854b2 avm1: Fix off-by-one bug in Activation::has_local_register 2019-10-15 17:10:34 -07:00
Mike Welsh e315fcb6b3 swf: Store register count from DefineFunction2
Also update avm1::Function to use register_count.
2019-10-15 17:09:14 -07:00
David Wendt ad17166c63 Store the player version in `Avm1` so that `current_swf_version` doesn't require the context. 2019-10-13 18:55:39 -04:00
David Wendt 7e2cf03789 Implement register underflow behavior.
This has the side effect of letting us remove the `Option` on register_count since setting this to `0` is equivalent now. Furthermore, we can skip an allocation if a function requests no registers.
2019-10-13 18:41:07 -04:00
David Wendt 911cf64cb0 Fix clippy lints 2019-10-13 17:58:21 -04:00
David Wendt e830273fe5 Don't pull multiple borrows on the same `GcCell` 2019-10-13 17:54:09 -04:00
David Wendt 911de06584 Only version MovieClips. Unversioned display objects recursively read their parents' versions, or the default version otherwise. 2019-10-13 17:27:04 -04:00
David Wendt 269775c0e1 Implement the SWF5 version negotiation algorithm.
On SWF5, the SWF version of the callee depends on it's this parameter. Calling it as a function rather than a method downgrades the callee. SWF6+ use the callee's inherent SWF version and do not allow changing the SWF version like this.
2019-10-12 10:39:55 -04:00
David Wendt d543e67528 Inline the first 8 registers with a `SmallVec`. 2019-10-12 10:39:54 -04:00
David Wendt ff7fe94e90 Add test for `_global`, `_root`, and `_parent` as movie clip properties 2019-10-12 10:39:54 -04:00
David Wendt b3c955b4d8 Install the remainder of tests that currently pass, but needed to have child clips removed 2019-10-12 10:39:54 -04:00
David Wendt d909fb01bb Use player version as a fallback when the current SWF version is requested without a valid stack. 2019-10-12 10:39:53 -04:00
David Wendt 17b1e0429c Explicitly allow `_global` and `_root` to be overwritten. 2019-10-12 10:39:53 -04:00
David Wendt 4709d2d0b4 Revert "Allow overwriting virtual properties via setting `set` to `None`."
This reverts commit 0a8adfca6e5fce8835552c1c7aba063649ba3aeb.
2019-10-12 10:39:53 -04:00