Commit Graph

1921 Commits

Author SHA1 Message Date
Brian Gontowski 31dd2729e2 web: Add an onFSCommand callback into JavaScript 2021-01-31 18:03:31 -08:00
EmperorBale 4122e8a1b0
core: Implement TextField.password property 2021-01-31 12:26:58 -08:00
relrelb 7431cd9b10
core: Merge InputBackend into UiBackend 2021-01-30 16:36:45 -08:00
CUB3D 206ac43703 avm1: Correct ToInteger for undefined, null and object inputs 2021-01-29 19:44:32 -08:00
relrelb 02dfb23c67 core: Remove unneeded pub 2021-01-29 13:05:37 -08:00
relrelb eaf0441f9a avm1: Small refactors 2021-01-29 13:05:37 -08:00
relrelb beff73b815 core: Small refactor 2021-01-29 13:05:37 -08:00
Mike Welsh 477fa06daf avm1: Fix off-by-one error in String.lastIndexOf
Fixes #2873.

Co-authored-by: Toad06 <gd.productions@laposte.net>
2021-01-29 02:59:14 -08:00
Mike Welsh 008f0f596c core: Clip event slices are from parent movie in PlaceObject
Since 19034b7, clip event scripts are returned as slices from the
SWF. This caused a panic when a movie was loaded into a clip,
because the loaded clip's `movie` would be used as the source for
clip events. However, clip events are placed by the parent's
PlaceObject tags, so the movie in this case should be the parent's
movie.

Fixes #2870.
2021-01-28 16:36:42 -08:00
Mads Marquart 39aa7536df core: Remove unsafe NonZeroU32 creation in shape utils 2021-01-28 14:39:35 -08:00
Mike Welsh 0f5bab3e78 core: Use dirty flag for updating sound transforms 2021-01-27 15:25:04 -08:00
Mike Welsh 7eb5389630 core: Avoid vec allocation in AudioManager::update_sounds 2021-01-27 15:25:04 -08:00
Mike Welsh a4699a3ca5 audio: Sound transforms apply to stream sounds
This unifies the code path for event sounds and stream sounds.
Both `AudioBackend::start_stream` and `start_sound` return a
`SoundHandle`. `stop_stream` is removed (`stop_sound` can be
used for both cases).

Also removes references to `CharacterId` from the `AudioBackend`
(instead, an increasing ID is returned to identiy streams while
loading).
2021-01-27 15:25:04 -08:00
Mike Welsh 95ce2abf17 audio: Remove AudioBackend::stop_sounds_with_handle/is_sound_playing_with_handle 2021-01-27 15:25:04 -08:00
Mike Welsh da2dd3b36c core: Implement sound transforms and Sound.setPan 2021-01-27 15:25:04 -08:00
Mike Welsh 98e6c54c3b avm1: Implement Sound.onSoundComplete 2021-01-27 15:25:04 -08:00
Mike Welsh 34f60b127a core: Add AudioManager to handle actively playing sounds
Add an AudioManager struct to handle this list of actively playing
sounds. This will maintain information for each sound instance,
such as the owning display object, AVM1 object, etc.

This will allow us to implement the awkward AVM1 Sound API in a
fairly backend-agnostic way.
2021-01-27 15:25:04 -08:00
TÖRÖK Attila a89eb6b9b8 avm1: Implement BitmapData.perlinNoise() 2021-01-27 11:53:05 -08:00
Adrian Wielgosik 937b371e30 core: Support grayscale JPEGs 2021-01-26 17:14:27 -08:00
Mike Welsh 306d2ead7f core: Avoid panic in EditText::on_changed (fix #2809) 2021-01-24 19:52:30 -08:00
paq e9ad1587a4 chore: Rename Namespace::public_namespace to Namespace::public 2021-01-24 11:53:43 -08:00
paq b58fcf3b05 chore: Use Namespace::public_namespace() instead of Namespace::package("") 2021-01-24 11:53:43 -08:00
Adrian Wielgosik 0a64c34e73 Make avm11::Value Copy 2021-01-23 12:04:47 -08:00
Adrian Wielgosik 2065812d1a Preallocate AVM1 Values when preparing constant pool 2021-01-23 12:04:47 -08:00
relrelb 19662503ca swf: Convert ButtonActionCondition to bitflags 2021-01-23 11:59:24 -08:00
relrelb 7f4845d777 swf: Convert ButtonState to bitflags 2021-01-23 11:59:24 -08:00
CUB3D 0cf3a4abed core: Invert pixel fill order for BitmapData.noise 2021-01-22 13:16:19 -08:00
CUB3D d57fd172f9 core: More special casing for noise 2021-01-22 13:16:19 -08:00
CUB3D 00fe7b6468 avm1: Generate correct values for negative seeds for BitmapData.noise() 2021-01-22 13:16:19 -08:00
CUB3D 9ba38784ef avm1: Properly implement BitmapData.noise() for positive seeds 2021-01-22 13:16:19 -08:00
Mike Welsh 82fd9dfd4e chore: Appease clippy 2021-01-21 18:52:43 -08:00
Mike Welsh 78f85d96f0 chore: Remove some debug spew 2021-01-21 18:22:42 -08:00
Aaron Hill b2f5f807de avm2: Print full multiname for "Property does not exist" errors (#2740)
This makes it easy to see when the error is a result of something in the
"flash" package being unimplemented.
2021-01-21 17:52:17 -08:00
relrelb b05c6540e1
chore: Migrate from enumset to bitflags 2021-01-21 16:35:46 -08:00
Toad06 9866a4baef web: Use enum instead of arbitrary values 2021-01-21 14:52:52 -08:00
Mike Welsh 60a95f3ea0 core: Gracefully handle tag length past EOF 2021-01-21 14:04:46 -08:00
Mike Welsh 34e0763cfe avm1: Don't unwrap in ColorTransform methods 2021-01-21 11:48:26 -08:00
Mike Welsh 5582da9f8a avm1: create_bare_object should properly wire up proto
When a native class was extended, most native types were grabbing
their normal prototype instead of using the user's supplied prototype.
e.g. `class MyColorTransform extends ColorTransform`.
2021-01-21 11:48:26 -08:00
Mike Welsh a6ea28d9b4 avm1: Create proper underlying type when extending native objects (fix #2682) 2021-01-21 11:48:26 -08:00
Mike Welsh 66256dd3be swf: SwfStr no longer contains encoding
SwfStr is now an unsized slice analogous to `str` or `bstr`.
The desired encoding must be supplied when converting to String.
2021-01-20 15:02:31 -08:00
Mike Welsh 61628a74fc swf: Rename and organize some util methods
* SwfRead -> SwfReadExt
 * SwfWrite -> SwfWriteExt
 * read_swf_header -> decompress_swf
 * read_swf -> parse_swf
2021-01-20 15:02:31 -08:00
Mike Welsh 1d9c11e145 swf: Add SwfStr type to handle encodings in SWF<6 2021-01-20 15:02:31 -08:00
Mike Welsh 19034b76e4 swf: Return slices in swf::Reader
Avoid copies by returning slices of the decompressed input.
2021-01-20 15:02:31 -08:00
klemens 9488a3fb97 spelling fixes 2021-01-18 22:07:39 -08:00
Mike Welsh da1e2801a2 chore: Appease clippy 2021-01-18 21:23:50 -08:00
relrelb abfa08c964 core: Allow exports to be overridden
Per SWF19 p.54, the latter export name is used.
2021-01-15 11:48:29 -08:00
TÖRÖK Attila a01ea70514 core/avm1: Implement BitmapData.copyPixels() 2021-01-14 13:02:55 -08:00
cheezeygeek 1911708ad1 avm1: Fix onChange firing, remove unwraps, revert as_broadcaster 2021-01-13 15:47:20 -08:00
cheezeygeek b3cd9b0f89 avm1: Implement listeners and onChanged for TextField (close #2297) 2021-01-13 15:47:20 -08:00
Mike Welsh 3c31336c93 chore: Rename some getters 2021-01-13 15:38:38 -08:00