Commit graph

106 commits

Author SHA1 Message Date
Ray Schamp
b47912dce4 Store asset objects on costumes and sounds
Stop using storage for in-memory storage, and keep these on the vm objects. Towards https://github.com/LLK/scratch-vm/issues/1577
2018-10-23 11:10:50 +01:00
DD
06cb8e4b8a Consistently return promises from functions that say they return promises 2018-10-03 14:58:36 -04:00
DD Liu
46918f266e Add bitmap resolution so that required proptype warning stops 2018-07-12 17:25:53 -04:00
DD Liu
1c74c9028c Better error handling 2018-07-12 17:18:38 -04:00
DD Liu
0258a7390f Convert to node style callback and convert to bitmap resolution 2 always 2018-07-12 14:33:38 -04:00
DD Liu
747b4d1aed Add bitmap resolution 2018-07-10 11:59:10 -04:00
DD Liu
6aefd13af6 Break load costume into more functions, and update how bitmaps are loaded 2018-07-10 10:30:38 -04:00
Ray Schamp
9afe401dca Revert "Revert #1260, #1258, #1239"
This reverts commit 28f90648b0.
2018-06-22 09:33:08 -04:00
Ray Schamp
28f90648b0 Revert #1260, #1258, #1239
This reverts commits
c268bbae47
61dacfc915
30b8cb8eb1
2018-06-22 09:30:17 -04:00
Michael "Z" Goddard
c268bbae47 add decoded SoundPlayer's to a Sprite's SoundBank (#1260) 2018-06-21 17:23:33 -04:00
DD
7874ea9b1a Allow rotation centers with zeros 2018-05-25 16:54:54 -04:00
DD
78e17b4842 Pass in argument to indicate compat mode 2018-05-11 14:24:07 -04:00
DD
589dd7d5e0 Attach the svg renderer instead of providing it in order to fix VM tests 2018-05-10 12:03:38 -04:00
DD
aae1e083bc Switched textEncoder to costumeAsset.encodeTextData, and pass in version as an argument instead of in costume 2018-05-09 15:48:49 -04:00
DD
b9ce26918d Fix review comments 2018-05-08 18:30:52 -04:00
DD
928245d5c9 Fix Edge 2018-05-08 14:25:32 -04:00
DD
296af1a079 Run quirks mode fixes on costumes loaded from sb2s 2018-05-08 12:03:34 -04:00
Karishma Chadha
af7ed61016 Fix bitmap support. In Scratch 3.0, we are defaulting to bitmapResolution = 2 for all costumes. 2018-04-22 21:22:03 -04:00
Karishma Chadha
54b52ba96c Use calculated rotation center from renderer when rotation center is not provided with the costume being loaded. 2018-04-20 00:04:08 -04:00
Karishma Chadha
d6f28f2266 Correct what is being passed into scratch-render if some metadata (rotationCenter, bitmapResolution) is missing. 2018-04-18 14:21:29 -04:00
Karishma Chadha
e71e51866f Fix typo. 2018-04-13 11:28:04 -04:00
Karishma Chadha
dca9270730 Use sound returned from audio engine to set sample rate and sample count since the sound gets resampled by the audio engine. Also, check for an mp3 format in deserialize assets, and otherwise default to wav. 2018-04-13 11:20:16 -04:00
kchadha
8739a524eb
Merge pull request #1031 from kchadha/block_serialization_compression
Block serialization compression
2018-04-11 19:17:42 -04:00
Karishma Chadha
6c538d0659 Sounds should still get loaded from storage even if there is not an audio engine present. This is analagous to costumes getting loaded even if there is no renderer present. 2018-04-11 10:28:22 -04:00
Paul Kaplan
89eb1ce39b Set the costume asset size when a costume is loaded or modified. 2018-04-10 09:51:29 -04:00
Paul Kaplan
4a7ba534c1 Fix linter 2017-09-11 15:15:30 -04:00
Paul Kaplan
81370f7625 Refactor method exports to fix linting and CWF comment 2017-09-11 10:11:48 -04:00
Paul Kaplan
b68b874067 Add sprite duplication method 2017-09-07 11:51:21 -04:00
Paul Kaplan
44298fd71b Use soundId instead of md5 for playing sounds 2017-07-25 12:20:32 -04:00
Christopher Willis-Ford
88e44c65eb Remember the data format when an asset is imported 2017-06-12 12:31:49 -07:00
Christopher Willis-Ford
eb931fd99b Specify dataFormat when loading asset for import
When importing a project we know the file extension for each asset to be
loaded. This change provides that information to the storage system so
that we can load assets which don't use the default. For example, this
allows loading JPG-format backdrops.

In support of this change, there's a new function on `StringUtil` called
`splitFirst`, which splits a string on the first instance of a separator
character. This change includes unit tests for this new function.
2017-05-24 15:35:10 -07:00
Ray Schamp
2181e51c38 Don't store costume data uris on costumes 2017-05-04 12:29:28 -04:00
Ray Schamp
c5cf6d9b40 Use asset id reference on sounds 2017-05-04 12:29:10 -04:00
Ray Schamp
c9ce6776aa Get SB3 imports working
For now, store the md5 + extension on costumes in the VM. This way we can load them the same way as we load SB2 assets.
2017-04-27 17:08:06 -04:00
Ray Schamp
a4cdb027ab Merge branch 'develop' of github.com:morantsur/scratch-vm into feature/serialization
# Conflicts:
#	src/playground/index.html
#	src/serialization/sb2.js
#	src/sprites/rendered-target.js
#	src/virtual-machine.js
#	test/unit/serialization_sb2.js
2017-04-26 11:44:53 -04:00
Christopher Willis-Ford
c750f53c81 Get Asset and AssetType from storage instance 2017-04-20 16:12:17 -07:00
Ray Schamp
9c34b692c0 Fix ES6 lint after merge 2017-04-19 17:54:52 -04:00
Ray Schamp
e96807b399 Merge branch 'develop' of https://github.com/LLK/scratch-vm into es6
# Conflicts:
#	src/import/sb2import.js
#	src/virtual-machine.js
#	webpack.config.js
2017-04-19 17:54:31 -04:00
Ray Schamp
d2343e3601 Fix up some auto-converted weirdness 2017-04-19 17:36:33 -04:00
Paul Kaplan
4b5e7a57a5 Fix binding issues 2017-04-19 08:53:07 -04:00
Paul Kaplan
f161640876 Update tests 2017-04-18 11:55:38 -04:00
Paul Kaplan
d86fe6a075 Do not add targets to runtime until they are fully loaded 2017-04-18 09:27:58 -04:00
Ray Schamp
4455b0694f Fix remaining no-var and no-use-before-define's 2017-04-17 17:15:19 -04:00
Ray Schamp
e01c4ae108 Pass with --fix 2017-04-17 15:10:04 -04:00
Paul Kaplan
771f18e23b Merge pull request #516 from paulkaplan/add-sound-public-api
Expose VM#addSound publicly
2017-04-04 09:05:45 -04:00
Paul Kaplan
2d6eaae01e Update jsdoc 2017-04-03 16:00:58 -04:00
Paul Kaplan
33f436811c return sound in promise 2017-04-03 16:00:31 -04:00
Ray Schamp
57e73a68a6 Add costume dataURI to costumes from storage (#517)
* Add costume dataURI to costumes from storage

Towards #515, LLK/scratch-gui#279

* Fix tests

* Load costumes incrementally

Some of our tests assume that at least some of our costume data is available before the costume data is loaded. So, provide as much costume data as is available.

* Remove unnecessary filter for null costumes

Resolved when we updated to load costumes incrementally.

/ht @cwillisf
2017-04-03 15:58:13 -04:00
Paul Kaplan
251244ce9c Expose VM#addSound publicly 2017-04-03 09:33:23 -04:00
Paul Kaplan
828f7bfd1c Merge pull request #514 from paulkaplan/fix-costume-backdrop-loading
Use costume loading from importer in public costume and backdrop loader
2017-03-31 12:52:06 -04:00