瀏覽代碼

Removed conflicts

julien-moreau 11 年之前
父節點
當前提交
4aef561dbd

+ 8 - 12
Babylon/Materials/textures/babylon.texture.js

@@ -8,11 +8,9 @@ var BABYLON;
 (function (BABYLON) {
     var Texture = (function (_super) {
         __extends(Texture, _super);
-<<<<<<< HEAD
-        function Texture(url, scene, noMipmap, invertY, samplingMode, buffer, deleteBuffer) {
-=======
-        function Texture(url, scene, noMipmap, invertY, samplingMode, onLoad, onError) {
->>>>>>> 08f8d5bd302ffec3b0c263e3d9b3a73544899aa5
+
+        function Texture(url, scene, noMipmap, invertY, samplingMode, onLoad, onError, buffer, deleteBuffer) {
+
             if (typeof samplingMode === "undefined") { samplingMode = Texture.TRILINEAR_SAMPLINGMODE; }
             if (typeof onLoad === "undefined") { onLoad = null; }
             if (typeof onError === "undefined") { onError = null; }
@@ -41,14 +39,12 @@ var BABYLON;
 
             if (!this._texture) {
                 if (!scene.useDelayedTextureLoading) {
-<<<<<<< HEAD
-                    this._texture = scene.getEngine().createTexture(url, noMipmap, invertY, scene, this._samplingMode, this._buffer);
-                    if (deleteBuffer) {
+
+                    this._texture = scene.getEngine().createTexture(url, noMipmap, invertY, scene, this._samplingMode, onLoad, onError, this._buffer);
+					if (deleteBuffer) {
                         delete this._buffer;
                     }
-=======
-                    this._texture = scene.getEngine().createTexture(url, noMipmap, invertY, scene, this._samplingMode, onLoad, onError);
->>>>>>> 08f8d5bd302ffec3b0c263e3d9b3a73544899aa5
+
                 } else {
                     this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_NOTLOADED;
                 }
@@ -63,7 +59,7 @@ var BABYLON;
             this._texture = this._getFromCache(this.url, this._noMipmap);
 
             if (!this._texture) {
-                this._texture = this.getScene().getEngine().createTexture(this.url, this._noMipmap, this._invertY, this.getScene(), this._samplingMode, this._buffer);
+                this._texture = this.getScene().getEngine().createTexture(this.url, this._noMipmap, this._invertY, this.getScene(), this._samplingMode, null, null, this._buffer);
                 if (this._deleteBuffer) {
                     delete this._buffer;
                 }

+ 3 - 13
Babylon/Materials/textures/babylon.texture.ts

@@ -47,11 +47,7 @@
         private _buffer: any;
         private _deleteBuffer: boolean;
 
-<<<<<<< HEAD
-        constructor(url: string, scene: Scene, noMipmap?: boolean, invertY?: boolean, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, buffer: any = null, deleteBuffer: boolean = false) {
-=======
-        constructor(url: string, scene: Scene, noMipmap?: boolean, invertY?: boolean, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, onLoad: () => void = null, onError: () => void = null) {
->>>>>>> 08f8d5bd302ffec3b0c263e3d9b3a73544899aa5
+        constructor(url: string, scene: Scene, noMipmap?: boolean, invertY?: boolean, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, onLoad: () => void = null, onError: () => void = null, buffer: any = null, deleteBuffer: boolean = false) {
             super(scene);
 
             this.name = url;
@@ -66,20 +62,14 @@
                 return;
             }
 
-            console.log('coucou');
-
             this._texture = this._getFromCache(url, noMipmap);
 
             if (!this._texture) {
                 if (!scene.useDelayedTextureLoading) {
-<<<<<<< HEAD
-                    this._texture = scene.getEngine().createTexture(url, noMipmap, invertY, scene, this._samplingMode, this._buffer);
+                    this._texture = scene.getEngine().createTexture(url, noMipmap, invertY, scene, this._samplingMode, onLoad, onError, this._buffer);
                     if (deleteBuffer) {
                         delete this._buffer;
                     }
-=======
-                    this._texture = scene.getEngine().createTexture(url, noMipmap, invertY, scene, this._samplingMode, onLoad, onError);
->>>>>>> 08f8d5bd302ffec3b0c263e3d9b3a73544899aa5
                 } else {
                     this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_NOTLOADED;
                 }
@@ -95,7 +85,7 @@
             this._texture = this._getFromCache(this.url, this._noMipmap);
 
             if (!this._texture) {
-                this._texture = this.getScene().getEngine().createTexture(this.url, this._noMipmap, this._invertY, this.getScene(), this._samplingMode, this._buffer);
+                this._texture = this.getScene().getEngine().createTexture(this.url, this._noMipmap, this._invertY, this.getScene(), this._samplingMode, null, null, this._buffer);
                 if (this._deleteBuffer) {
                     delete this._buffer;
                 }

+ 8 - 20
Babylon/babylon.engine.js

@@ -1172,12 +1172,8 @@
 
             gl.bindTexture(gl.TEXTURE_2D, null);
         };
-
-<<<<<<< HEAD
-        Engine.prototype.createTexture = function (url, noMipmap, invertY, scene, samplingMode, buffer) {
-=======
-        Engine.prototype.createTexture = function (url, noMipmap, invertY, scene, samplingMode, onLoad, onError) {
->>>>>>> 08f8d5bd302ffec3b0c263e3d9b3a73544899aa5
+
+        Engine.prototype.createTexture = function (url, noMipmap, invertY, scene, samplingMode, onLoad, onError, buffer) {
             var _this = this;
             if (typeof samplingMode === "undefined") { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
             if (typeof onLoad === "undefined") { onLoad = null; }
@@ -1229,18 +1225,14 @@
                         if (onLoad) {
                             onLoad();
                         }
-                    }, samplingMode);
-<<<<<<< HEAD
+                    }, samplingMode);
                 };
 
                 if (!(fromData instanceof Array))
-                    BABYLON.Tools.LoadFile(url, callback, null, scene.database, true);
+                    BABYLON.Tools.LoadFile(url, callback, onerror, scene.database, true);
                 else
                     callback(buffer);
-
-=======
-                }, onerror, scene.database, true);
->>>>>>> 08f8d5bd302ffec3b0c263e3d9b3a73544899aa5
+
             } else if (isDDS) {
                 var callback = function (data) {
                     var info = BABYLON.Internals.DDSTools.GetDDSInfo(data);
@@ -1252,18 +1244,14 @@
                         if (onLoad) {
                             onLoad();
                         }
-                    }, samplingMode);
-<<<<<<< HEAD
+                    }, samplingMode);
                 };
 
                 if (!(fromData instanceof Array))
-                    BABYLON.Tools.LoadFile(url, callback, null, scene.database, true);
+                    BABYLON.Tools.LoadFile(url, callback, onerror, scene.database, true);
                 else
                     callback(buffer);
-
-=======
-                }, onerror, scene.database, true);
->>>>>>> 08f8d5bd302ffec3b0c263e3d9b3a73544899aa5
+
             } else {
                 var onload = function (img) {
                     prepareWebGLTexture(texture, _this._gl, scene, img.width, img.height, invertY, noMipmap, false, function (potWidth, potHeight) {

+ 5 - 16
Babylon/babylon.engine.ts

@@ -1185,11 +1185,8 @@
             gl.bindTexture(gl.TEXTURE_2D, null);
         }
 
-<<<<<<< HEAD
-        public createTexture(url: string, noMipmap: boolean, invertY: boolean, scene: Scene, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, buffer: any = null): WebGLTexture {
-=======
-        public createTexture(url: string, noMipmap: boolean, invertY: boolean, scene: Scene, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, onLoad: () => void = null, onError: () => void = null): WebGLTexture {
->>>>>>> 08f8d5bd302ffec3b0c263e3d9b3a73544899aa5
+        public createTexture(url: string, noMipmap: boolean, invertY: boolean, scene: Scene, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, onLoad: () => void = null, onError: () => void = null, buffer:any = null): WebGLTexture {
+
             var texture = this._gl.createTexture();
 
             var extension: string;
@@ -1237,19 +1234,15 @@
                             onLoad();
                         }
                     }, samplingMode);
-<<<<<<< HEAD
                 };
 
                 if (!(fromData instanceof Array))
                     BABYLON.Tools.LoadFile(url, arrayBuffer => {
                         callback(arrayBuffer);
-                    }, null, scene.database, true);
+                    }, onerror, scene.database, true);
                 else
                     callback(buffer);
 
-=======
-                }, onerror, scene.database, true);
->>>>>>> 08f8d5bd302ffec3b0c263e3d9b3a73544899aa5
             } else if (isDDS) {
                 var callback = (data) => {
                     var info = BABYLON.Internals.DDSTools.GetDDSInfo(data);
@@ -1263,19 +1256,15 @@
                             onLoad();
                         }
                     }, samplingMode);
-<<<<<<< HEAD
-                }
+                };
 
                 if (!(fromData instanceof Array))
                     BABYLON.Tools.LoadFile(url, data => {
                         callback(data);
-                    }, null, scene.database, true);
+                    }, onerror, scene.database, true);
                 else
                     callback(buffer);
 
-=======
-                }, onerror, scene.database, true);
->>>>>>> 08f8d5bd302ffec3b0c263e3d9b3a73544899aa5
             } else {
                 var onload = (img) => {
                     prepareWebGLTexture(texture, this._gl, scene, img.width, img.height, invertY, noMipmap, false, (potWidth, potHeight) => {