Browse Source

quick fix to PG zip download

David Catuhe 8 years ago
parent
commit
39ed4a07e9
1 changed files with 4 additions and 4 deletions
  1. 4 4
      Playground/js/index.js

+ 4 - 4
Playground/js/index.js

@@ -458,13 +458,13 @@
                 return;
                 return;
             }
             }
 
 
-            if (textures[index].isRenderTarget || textures[index] instanceof BABYLON.DynamicTexture) {
+            if (textures[index].isRenderTarget || textures[index] instanceof BABYLON.DynamicTexture || textures[index].name.indexOf("data:") !== -1) {
                 addTexturesToZip(zip, index + 1, textures, folder, then);
                 addTexturesToZip(zip, index + 1, textures, folder, then);
                 return;
                 return;
             }
             }
 
 
             if (textures[index].isCube) {
             if (textures[index].isCube) {
-                if (textures[index]._extensions) {
+                if (textures[index]._extensions && textures[index].name.indexOf("dds") === -1) {
                     for (var i = 0; i < 6; i++) {
                     for (var i = 0; i < 6; i++) {
                         textures.push({ name: textures[index].name + textures[index]._extensions[i] });
                         textures.push({ name: textures[index].name + textures[index]._extensions[i] });
                     }
                     }
@@ -486,10 +486,10 @@
                 url = textures[index].video.currentSrc;
                 url = textures[index].video.currentSrc;
             } else {
             } else {
                 // url = textures[index].name;
                 // url = textures[index].name;
-                url = textures[index].url;
+                url = textures[index].url ? textures[index].url : textures[index].name;
             }
             }
 
 
-            var name = textures[index].name;
+            var name = textures[index].name.replace("textures/", "");
             // var name = url.substr(url.lastIndexOf("/") + 1);
             // var name = url.substr(url.lastIndexOf("/") + 1);
 
 
             if (url != null) {
             if (url != null) {