Skip to content

Commit

Permalink
2.5.0 rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
KylinLove committed Mar 4, 2020
1 parent 7195535 commit 7d6abe4
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 41 deletions.
32 changes: 22 additions & 10 deletions build/as/jslibs/laya.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -18585,15 +18585,11 @@ window.Laya= (function (exports) {
var _this = this;
if (isformatURL)
url = URL.formatURL(url);
var onLoaded;
var onError = function () {
_this.event(Event.ERROR, "Load image failed");
};
if (this._type === "nativeimage") {
onLoaded = (image) => {
this.onLoaded(image);
};
this._loadHtmlImage(url, this, onLoaded, this, onError);
this._loadHtmlImage(url, this, this.onLoaded, this, onError);
}
else {
var ext = Utils.getFileExtension(url);
Expand Down Expand Up @@ -18661,24 +18657,32 @@ window.Laya= (function (exports) {
tex.wrapModeU = exports.WarpMode.Clamp;
tex.wrapModeV = exports.WarpMode.Clamp;
tex.setCompressData(data);
tex._setCreateURL(url);
tex._setCreateURL(this.url);
}
else {
else if (!(data instanceof Texture2D)) {
var tex = new Texture2D(data.width, data.height, 1, false, false);
tex.wrapModeU = exports.WarpMode.Clamp;
tex.wrapModeV = exports.WarpMode.Clamp;
tex.loadImageSource(data, true);
tex._setCreateURL(this.url);
tex._setCreateURL(data.src);
}
var texture = new Texture(tex);
texture.url = this._url;
this.complete(texture);
}
else if (type === Loader.SOUND || type === "htmlimage" || type === "nativeimage") {
else if (type === Loader.SOUND || type === "nativeimage") {
this.complete(data);
}
else if (type === "htmlimage") {
var tex = new Texture2D(data.width, data.height, 1, false, false);
tex.wrapModeU = exports.WarpMode.Clamp;
tex.wrapModeV = exports.WarpMode.Clamp;
tex.loadImageSource(data, true);
tex._setCreateURL(data.src);
this.complete(tex);
}
else if (type === Loader.ATLAS) {
if (!(data instanceof Texture2D)) {
if (data.frames) {
var toloadPics = [];
if (!this._data) {
this._data = data;
Expand Down Expand Up @@ -18714,6 +18718,14 @@ window.Laya= (function (exports) {
return this._loadResourceFilter(Loader.IMAGE, toloadPics.pop());
}
else {
if (!(data instanceof Texture2D)) {
var tex = new Texture2D(data.width, data.height, 1, false, false);
tex.wrapModeU = BaseTexture.WARPMODE_CLAMP;
tex.wrapModeV = BaseTexture.WARPMODE_CLAMP;
tex.loadImageSource(data, true);
tex._setCreateURL(data.src);
data = tex;
}
this._data.pics.push(data);
if (this._data.toLoads.length > 0) {
this.event(Event.PROGRESS, 0.3 + 1 / this._data.toLoads.length * 0.6);
Expand Down
32 changes: 22 additions & 10 deletions build/js/libs/laya.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -18585,15 +18585,11 @@ window.Laya= (function (exports) {
var _this = this;
if (isformatURL)
url = URL.formatURL(url);
var onLoaded;
var onError = function () {
_this.event(Event.ERROR, "Load image failed");
};
if (this._type === "nativeimage") {
onLoaded = (image) => {
this.onLoaded(image);
};
this._loadHtmlImage(url, this, onLoaded, this, onError);
this._loadHtmlImage(url, this, this.onLoaded, this, onError);
}
else {
var ext = Utils.getFileExtension(url);
Expand Down Expand Up @@ -18661,24 +18657,32 @@ window.Laya= (function (exports) {
tex.wrapModeU = exports.WarpMode.Clamp;
tex.wrapModeV = exports.WarpMode.Clamp;
tex.setCompressData(data);
tex._setCreateURL(url);
tex._setCreateURL(this.url);
}
else {
else if (!(data instanceof Texture2D)) {
var tex = new Texture2D(data.width, data.height, 1, false, false);
tex.wrapModeU = exports.WarpMode.Clamp;
tex.wrapModeV = exports.WarpMode.Clamp;
tex.loadImageSource(data, true);
tex._setCreateURL(this.url);
tex._setCreateURL(data.src);
}
var texture = new Texture(tex);
texture.url = this._url;
this.complete(texture);
}
else if (type === Loader.SOUND || type === "htmlimage" || type === "nativeimage") {
else if (type === Loader.SOUND || type === "nativeimage") {
this.complete(data);
}
else if (type === "htmlimage") {
var tex = new Texture2D(data.width, data.height, 1, false, false);
tex.wrapModeU = exports.WarpMode.Clamp;
tex.wrapModeV = exports.WarpMode.Clamp;
tex.loadImageSource(data, true);
tex._setCreateURL(data.src);
this.complete(tex);
}
else if (type === Loader.ATLAS) {
if (!(data instanceof Texture2D)) {
if (data.frames) {
var toloadPics = [];
if (!this._data) {
this._data = data;
Expand Down Expand Up @@ -18714,6 +18718,14 @@ window.Laya= (function (exports) {
return this._loadResourceFilter(Loader.IMAGE, toloadPics.pop());
}
else {
if (!(data instanceof Texture2D)) {
var tex = new Texture2D(data.width, data.height, 1, false, false);
tex.wrapModeU = BaseTexture.WARPMODE_CLAMP;
tex.wrapModeV = BaseTexture.WARPMODE_CLAMP;
tex.loadImageSource(data, true);
tex._setCreateURL(data.src);
data = tex;
}
this._data.pics.push(data);
if (this._data.toLoads.length > 0) {
this.event(Event.PROGRESS, 0.3 + 1 / this._data.toLoads.length * 0.6);
Expand Down
32 changes: 22 additions & 10 deletions build/ts/libs/laya.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -18585,15 +18585,11 @@ window.Laya= (function (exports) {
var _this = this;
if (isformatURL)
url = URL.formatURL(url);
var onLoaded;
var onError = function () {
_this.event(Event.ERROR, "Load image failed");
};
if (this._type === "nativeimage") {
onLoaded = (image) => {
this.onLoaded(image);
};
this._loadHtmlImage(url, this, onLoaded, this, onError);
this._loadHtmlImage(url, this, this.onLoaded, this, onError);
}
else {
var ext = Utils.getFileExtension(url);
Expand Down Expand Up @@ -18661,24 +18657,32 @@ window.Laya= (function (exports) {
tex.wrapModeU = exports.WarpMode.Clamp;
tex.wrapModeV = exports.WarpMode.Clamp;
tex.setCompressData(data);
tex._setCreateURL(url);
tex._setCreateURL(this.url);
}
else {
else if (!(data instanceof Texture2D)) {
var tex = new Texture2D(data.width, data.height, 1, false, false);
tex.wrapModeU = exports.WarpMode.Clamp;
tex.wrapModeV = exports.WarpMode.Clamp;
tex.loadImageSource(data, true);
tex._setCreateURL(this.url);
tex._setCreateURL(data.src);
}
var texture = new Texture(tex);
texture.url = this._url;
this.complete(texture);
}
else if (type === Loader.SOUND || type === "htmlimage" || type === "nativeimage") {
else if (type === Loader.SOUND || type === "nativeimage") {
this.complete(data);
}
else if (type === "htmlimage") {
var tex = new Texture2D(data.width, data.height, 1, false, false);
tex.wrapModeU = exports.WarpMode.Clamp;
tex.wrapModeV = exports.WarpMode.Clamp;
tex.loadImageSource(data, true);
tex._setCreateURL(data.src);
this.complete(tex);
}
else if (type === Loader.ATLAS) {
if (!(data instanceof Texture2D)) {
if (data.frames) {
var toloadPics = [];
if (!this._data) {
this._data = data;
Expand Down Expand Up @@ -18714,6 +18718,14 @@ window.Laya= (function (exports) {
return this._loadResourceFilter(Loader.IMAGE, toloadPics.pop());
}
else {
if (!(data instanceof Texture2D)) {
var tex = new Texture2D(data.width, data.height, 1, false, false);
tex.wrapModeU = BaseTexture.WARPMODE_CLAMP;
tex.wrapModeV = BaseTexture.WARPMODE_CLAMP;
tex.loadImageSource(data, true);
tex._setCreateURL(data.src);
data = tex;
}
this._data.pics.push(data);
if (this._data.toLoads.length > 0) {
this.event(Event.PROGRESS, 0.3 + 1 / this._data.toLoads.length * 0.6);
Expand Down
35 changes: 24 additions & 11 deletions build/ts_new/libs/laya/net/Loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,15 +305,11 @@ export class Loader extends EventDispatcher {
var _this = this;
if(isformatURL)
url = URL.formatURL(url);
var onLoaded: Function;
var onError: Function = function (): void {
_this.event(Event.ERROR, "Load image failed");
}
if (this._type === "nativeimage") {
onLoaded = (image: any) => {
this.onLoaded(image);
}
this._loadHtmlImage(url, this, onLoaded, this, onError);
this._loadHtmlImage(url, this, this.onLoaded, this, onError);
} else {

var ext: string = Utils.getFileExtension(url);
Expand Down Expand Up @@ -395,23 +391,31 @@ export class Loader extends EventDispatcher {
tex.wrapModeU = WarpMode.Clamp;
tex.wrapModeV = WarpMode.Clamp;
tex.setCompressData(data);
tex._setCreateURL(url);
} else {
tex._setCreateURL(this.url);
} else if(!(data instanceof Texture2D)){
var tex: Texture2D = new Texture2D(data.width, data.height, 1, false, false);
tex.wrapModeU = WarpMode.Clamp;
tex.wrapModeV = WarpMode.Clamp;
tex.loadImageSource(data, true);
tex._setCreateURL(this.url);
tex._setCreateURL(data.src);
}
var texture: Texture = new Texture(tex);
texture.url = this._url;
this.complete(texture);

} else if (type === Loader.SOUND || type === "htmlimage" || type === "nativeimage") {
} else if (type === Loader.SOUND || type === "nativeimage") {
this.complete(data);
} else if (type === Loader.ATLAS) {
} else if(type === "htmlimage" ){
var tex: Texture2D = new Texture2D(data.width, data.height, 1, false, false);
tex.wrapModeU = WarpMode.Clamp;
tex.wrapModeV = WarpMode.Clamp;
tex.loadImageSource(data, true);
tex._setCreateURL(data.src);
this.complete(tex);
}
else if (type === Loader.ATLAS) {
//处理图集
if (!(data instanceof Texture2D)) {
if (data.frames) {
var toloadPics: string[] = [];
if (!this._data) {
this._data = data;
Expand Down Expand Up @@ -455,6 +459,15 @@ export class Loader extends EventDispatcher {
this.event(Event.PROGRESS, 0.3 + 1 / toloadPics.length * 0.6);
return this._loadResourceFilter(Loader.IMAGE, toloadPics.pop() as string);
} else {
if(!(data instanceof Texture2D))
{
var tex: Texture2D = new Texture2D(data.width, data.height, 1, false, false);
tex.wrapModeU = BaseTexture.WARPMODE_CLAMP;
tex.wrapModeV = BaseTexture.WARPMODE_CLAMP;
tex.loadImageSource(data, true);
tex._setCreateURL(data.src);
data = tex;
}
this._data.pics.push(data);
if (this._data.toLoads.length > 0) {
this.event(Event.PROGRESS, 0.3 + 1 / this._data.toLoads.length * 0.6);
Expand Down

0 comments on commit 7d6abe4

Please sign in to comment.