Commit Graph

853 Commits

Author SHA1 Message Date
Mike Welsh f9b23c6e0c web: Handle gaps between SoundStreamBlocks 2019-10-29 23:36:51 -07:00
Mike Welsh ab58c37feb core: Handle gaps between StreamSoundBlocks 2019-10-29 23:36:51 -07:00
Mike Welsh 443dcfaeea core: Stop stream sound when gaps are encountered
Generally there is one SoundStreamBlock per frame in a MovieClip.
However, if there are gaps between stream sounds, the stream must
stop and then pick up when the next block is encountered.

TODO: Sometimes Flash will do weird stuff and export a stream that
is plainly out of sync if there are gaps between sounds (the old
trick was to put a silent stream across the entire timeline to fix
this). This happens when the streams are too close together with
MP3 encoding. Investigate this more.
2019-10-29 23:36:51 -07:00
Mike Welsh 1a7959b96d audio: Initial syncing of stream sound to MovieClip timeline 2019-10-29 23:36:51 -07:00
Mike Welsh 9e83f27afd tests: Add test for DoInitAction 2019-10-29 11:11:25 -07:00
David Wendt 6a81b5327d Implement `DoInitAction`.
This pushes an extra `undefined` onto the stack to fix underflow in AS2 interface declarations.

It is currently unknown if this is a miscompilation or if some other value is supposed to be there.

# Conflicts:
#	core/src/avm1.rs
#	core/src/avm1/object.rs
2019-10-29 11:11:25 -07:00
Mike Welsh 33c0bbd0ce desktop: Fix incorrect rendering of bitmaps w/ color transforms
The premultiplied alpha was not properly considered when there was
a color transform on a bitmap. Now the shader unmultiplies the
alpha before applying the color transform, and the remultiplies it.
2019-10-29 00:03:29 -07:00
Mike Welsh 35be57553e desktop: Improve animation sync
The timing on desktop was causing the movie to run too slow,
causing it to get out of sync. Now it should run at the correct
speed.
2019-10-28 21:05:18 -07:00
Mike Welsh cb26342a24 core: Fix regression in goto when replacing a previous child
Goto forward that did a replace was not replacing the previous child.
TODO: Figure out how to write a regression test for this; will
need a special test harness probably because this only happens with
Graphics, not MovieClips, so we can't attach AS to them to get
trace output.
2019-10-28 03:47:57 -07:00
Mike Welsh f07dfb4eb6 web: Implement ADPCM stream sounds on web 2019-10-28 02:51:46 -07:00
Mike Welsh eaea6aaf20 audio: Fix audio for ADPCM stream sounds
When a stream sound uses ADPCM compression, the ADPCM header is
included in each SoundStreamBlock (as opposed to stream sounds
in the other formats). This header wasn't being parsed, resulting
in corrupted audio (see https://homestarrunner.com/main12.swf).
2019-10-28 02:51:46 -07:00
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