Skip to content

Commit 0d3fbe2

Browse files
committed
Fix linting errors
1 parent fc30e64 commit 0d3fbe2

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
@@ -217,10 +217,10 @@ class Texture {
217217
*/
218218
constructor(graphicsDevice, options = {}) {
219219
this.device = graphicsDevice;
220-
Debug.assert(this.device, "Texture constructor requires a graphicsDevice to be valid");
221-
Debug.assert(!options.width || Number.isInteger(options.width), "Texture width must be an integer number, got", options);
222-
Debug.assert(!options.height || Number.isInteger(options.height), "Texture height must be an integer number, got", options);
223-
Debug.assert(!options.layers || Number.isInteger(options.layers), "Texture layers must be an integer number, got", options);
220+
Debug.assert(this.device, 'Texture constructor requires a graphicsDevice to be valid');
221+
Debug.assert(!options.width || Number.isInteger(options.width), 'Texture width must be an integer number, got', options);
222+
Debug.assert(!options.height || Number.isInteger(options.height), 'Texture height must be an integer number, got', options);
223+
Debug.assert(!options.layers || Number.isInteger(options.layers), 'Texture layers must be an integer number, got', options);
224224

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

@@ -234,7 +234,7 @@ class Texture {
234234

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

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

239239
this._format = options.format ?? PIXELFORMAT_RGBA8;
240240
this._compressed = isCompressedPixelFormat(this._format);
@@ -941,8 +941,9 @@ class Texture {
941941
if (!invalid) {
942942
// mark levels as updated
943943
for (let i = 0; i < this._layers; i++) {
944-
if (this._levels[0][i] !== source[i])
944+
if (this._levels[0][i] !== source[i]) {
945945
this._levelsUpdated[0][i] = true;
946+
}
946947
}
947948
}
948949
} else {
@@ -953,8 +954,9 @@ class Texture {
953954

954955
if (!invalid) {
955956
// mark level as updated
956-
if (source !== this._levels[0])
957+
if (source !== this._levels[0]) {
957958
this._levelsUpdated[0] = true;
959+
}
958960

959961
width = source.width;
960962
height = source.height;

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -626,11 +626,12 @@ class WebglTexture {
626626
this._glPixelType,
627627
mipObject);
628628
}
629-
} else if (texture.array && typeof mipObject === "object") {
629+
} else if (texture.array && typeof mipObject === 'object') {
630630
if (texture._compressed) {
631631
for (let index = 0; index < texture._layers; index++) {
632-
if (!texture._levelsUpdated[0][index] || !mipObject[index])
632+
if (!texture._levelsUpdated[0][index] || !mipObject[index]) {
633633
continue;
634+
}
634635
gl.compressedTexSubImage3D(
635636
gl.TEXTURE_2D_ARRAY,
636637
mipLevel,
@@ -646,8 +647,9 @@ class WebglTexture {
646647
}
647648
} else {
648649
for (let index = 0; index < texture.layers; index++) {
649-
if (!texture._levelsUpdated[0][index] || !mipObject[index])
650+
if (!texture._levelsUpdated[0][index] || !mipObject[index]) {
650651
continue;
652+
}
651653
gl.texSubImage3D(
652654
gl.TEXTURE_2D_ARRAY,
653655
mipLevel,

0 commit comments

Comments
 (0)