Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Longi94 committed Oct 19, 2019
1 parent b44387e commit 0c3ff80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/utils/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ export class ImageTextureLoader {
load(url: string, onLoad: (buffer: any) => void, onProgress?: (event: ProgressEvent) => void,
onError?: (event: ErrorEvent) => void) {
this.loader.load(url, img => {
if (this.format == TextureFormat.TGA) {
if (this.format === TextureFormat.TGA) {
onLoad(img);
}

const canvas = new OffscreenCanvas(img.width, img.height);
const context = canvas.getContext('2d') as OffscreenCanvasRenderingContext2D;
context.drawImage(img, 0, 0 );
const imageData = context.getImageData(0, 0, img.width, img.height)
const imageData = context.getImageData(0, 0, img.width, img.height);
onLoad(imageData);
}, onProgress, onError);
}
Expand Down
4 changes: 2 additions & 2 deletions src/utils/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ export function getAssetUrl(path: string, rocketConfig: RocketConfig): string {
return undefined;
}
if (path.startsWith('textures/') && path.endsWith('.tga')) {
if (rocketConfig.textureQuality == TextureQuality.LOW) {
if (rocketConfig.textureQuality === TextureQuality.LOW) {
path = path.replace('.tga', '_S.tga');
}
if (rocketConfig.textureFormat == TextureFormat.PNG) {
if (rocketConfig.textureFormat === TextureFormat.PNG) {
path = path.replace('.tga', '.png');
}
}
Expand Down

0 comments on commit 0c3ff80

Please sign in to comment.