Skip to content

Commit c86439e

Browse files
committed
Fix linting errors
1 parent 51ea354 commit c86439e

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

src/platform/graphics/texture.js

+9-7
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,10 @@ class Texture {
218218
*/
219219
constructor(graphicsDevice, options = {}) {
220220
this.device = graphicsDevice;
221-
Debug.assert(this.device, "Texture constructor requires a graphicsDevice to be valid");
222-
Debug.assert(!options.width || Number.isInteger(options.width), "Texture width must be an integer number, got", options);
223-
Debug.assert(!options.height || Number.isInteger(options.height), "Texture height must be an integer number, got", options);
224-
Debug.assert(!options.layers || Number.isInteger(options.layers), "Texture layers must be an integer number, got", options);
221+
Debug.assert(this.device, 'Texture constructor requires a graphicsDevice to be valid');
222+
Debug.assert(!options.width || Number.isInteger(options.width), 'Texture width must be an integer number, got', options);
223+
Debug.assert(!options.height || Number.isInteger(options.height), 'Texture height must be an integer number, got', options);
224+
Debug.assert(!options.layers || Number.isInteger(options.layers), 'Texture layers must be an integer number, got', options);
225225

226226
this.name = options.name ?? '';
227227

@@ -235,7 +235,7 @@ class Texture {
235235

236236
this._layers = Math.floor(options.layers ?? (this._dimension === TEXTUREDIMENSION_CUBE ? 6 : 1));
237237

238-
Debug.assert((this._dimension === TEXTUREDIMENSION_CUBE ? this._layers === 6 : true), "Texture cube map must have 6 layers");
238+
Debug.assert((this._dimension === TEXTUREDIMENSION_CUBE ? this._layers === 6 : true), 'Texture cube map must have 6 layers');
239239

240240
this._format = options.format ?? PIXELFORMAT_RGBA8;
241241
this._compressed = isCompressedPixelFormat(this._format);
@@ -942,8 +942,9 @@ class Texture {
942942
if (!invalid) {
943943
// mark levels as updated
944944
for (let i = 0; i < this._layers; i++) {
945-
if (this._levels[0][i] !== source[i])
945+
if (this._levels[0][i] !== source[i]) {
946946
this._levelsUpdated[0][i] = true;
947+
}
947948
}
948949
}
949950
} else {
@@ -954,8 +955,9 @@ class Texture {
954955

955956
if (!invalid) {
956957
// mark level as updated
957-
if (source !== this._levels[0])
958+
if (source !== this._levels[0]) {
958959
this._levelsUpdated[0] = true;
960+
}
959961

960962
width = source.width;
961963
height = source.height;

src/platform/graphics/webgl/webgl-texture.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -643,11 +643,12 @@ class WebglTexture {
643643
this._glPixelType,
644644
mipObject);
645645
}
646-
} else if (texture.array && typeof mipObject === "object") {
646+
} else if (texture.array && typeof mipObject === 'object') {
647647
if (texture._compressed) {
648648
for (let index = 0; index < texture._layers; index++) {
649-
if (!texture._levelsUpdated[0][index] || !mipObject[index])
649+
if (!texture._levelsUpdated[0][index] || !mipObject[index]) {
650650
continue;
651+
}
651652
gl.compressedTexSubImage3D(
652653
gl.TEXTURE_2D_ARRAY,
653654
mipLevel,
@@ -663,8 +664,9 @@ class WebglTexture {
663664
}
664665
} else {
665666
for (let index = 0; index < texture.layers; index++) {
666-
if (!texture._levelsUpdated[0][index] || !mipObject[index])
667+
if (!texture._levelsUpdated[0][index] || !mipObject[index]) {
667668
continue;
669+
}
668670
gl.texSubImage3D(
669671
gl.TEXTURE_2D_ARRAY,
670672
mipLevel,

0 commit comments

Comments
 (0)