@urso/core 0.7.25 → 0.7.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,9 +38,21 @@ class ModulesAssetsController {
38
38
  this.getInstance('Service').startLoad(assetsSpace, callback);
39
39
  }
40
40
 
41
+ /**
42
+ * load assets group bu name
43
+ * @param {String} name
44
+ * @param {Function} callback
45
+ */
41
46
  loadGroup(name, callback) {
42
47
  this.getInstance('Service').loadGroup(null, name, callback);
43
48
  }
49
+
50
+ /**
51
+ * system; check webP support
52
+ */
53
+ checkWebPSupport() {
54
+ this.getInstance('Service').checkWebPSupport();
55
+ }
44
56
  }
45
57
 
46
58
  module.exports = ModulesAssetsController;
@@ -11,6 +11,14 @@ class ModulesAssetsService {
11
11
  this.lazyLoadProcessStarted = false;
12
12
  };
13
13
 
14
+ /**
15
+ * system; check webP support
16
+ */
17
+ checkWebPSupport() {
18
+ if (Urso.device.webP)
19
+ Urso.addInstancesMode('webP');
20
+ }
21
+
14
22
  /**
15
23
  * get current quality
16
24
  * @returns {String}
@@ -169,8 +177,8 @@ class ModulesAssetsService {
169
177
  * @param {Object} assetsSpace
170
178
  * @param {String} group
171
179
  */
172
- _processLoadedAtlases(assetsSpace, group) {
173
- const atlases = assetsSpace[group].filter(assetModel => assetModel.type === Urso.types.assets.ATLAS);
180
+ _processLoadedAtlases(group) {
181
+ const atlases = this.assets[group].filter(assetModel => assetModel.type === Urso.types.assets.ATLAS);
174
182
 
175
183
  for (let assetModel of atlases) {
176
184
  const assetKey = assetModel.key;
@@ -186,6 +194,11 @@ class ModulesAssetsService {
186
194
  newFilename = folderPath + '/' + frame.filename;
187
195
 
188
196
  Urso.cache.addFile(newFilename, texture);
197
+
198
+ if(assetModel.cacheTextures) {
199
+ const textureKey = newFilename.split('/').pop().split('.')[0];
200
+ Urso.cache.addTexture(textureKey, texture);
201
+ }
189
202
  }
190
203
  }
191
204
  }