Skip to content

Commit

Permalink
fix: formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
NuclearRedeye committed Apr 2, 2024
1 parent 972f344 commit 7ac2c53
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/ts/data/levels/level00.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const level00: Level = {
[i(2), i(2), sw(5), i(2), i(2), i(2), i(2), i(2), i(2), i(2)],
[i(2), sf(2), sf(2), sf(2), sf(2), sf(2), sf(2), sf(2), sf(2), i(2)],
[i(2), sf(2), sf(2), sf(5), sf(5), sf(2), sf(2), sf(2), st([4, 1, 1, 1, 1, 1]), i(2)],
[i(2), f([2, 2, 2, 2, 6, 7]), sf(2), sf(5), sf(5), sw(2), d(2,10), sw(2), sf(2), i(2)],
[i(2), f([2, 2, 2, 2, 6, 7]), sf(2), sf(5), sf(5), sw(2), d(2, 10), sw(2), sf(2), i(2)],
[i(2), sf(2), sf(2), sf(2), sf(2), sf(2), sf(2), sf(2), sf(2), i(2)],
[sw(2), sf(2), sf(2), sf(2), sf(2), sf(2), sf(2), sf(2), sf(2), sw(2)],
[ssc(10), sf(2), sf(2), w([6, 7, 8, 9, 2, 2]), sf(2), sf(2), sf(2), w([2, 5, 2, 5, 2, 2]), sf(2), sw(2)],
Expand Down
4 changes: 2 additions & 2 deletions src/ts/raycaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ export function renderSprite(context: CanvasRenderingContext2D, entity: Entity,
}

const textureCroppedWidth = (clipRectangle.width / destinationRectangle.width) * texture.width;
const textureCroppedX = (clipRectangle.x > destinationRectangle.x) ? texture.width - textureCroppedWidth : 0;
const textureCroppedX = clipRectangle.x > destinationRectangle.x ? texture.width - textureCroppedWidth : 0;

// The slice of the texture that we want to render to the framebuffer.
const sourceRectangle: Rectangle = {
Expand All @@ -447,7 +447,7 @@ export function renderSprite(context: CanvasRenderingContext2D, entity: Entity,
// If 'debug' is on, draw some additional borders.
if (debug) {
drawBorderRectangle(context, destinationRectangle);
drawBorderRectangle(context, clipRectangle, "green");
drawBorderRectangle(context, clipRectangle, 'green');
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/ts/utils/canvas-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ export function drawSkybox(context: CanvasRenderingContext2D, start: Point, end:
context.drawImage(texture.canvas as HTMLCanvasElement, texturePositionX, 0, 1, (wallHeight / context.canvas.height) * texture.height, start.x, start.y, 1, wallHeight);
}

export function drawBorderRectangle(context: CanvasRenderingContext2D, destination: Rectangle, colour: string = "white") {
export function drawBorderRectangle(context: CanvasRenderingContext2D, destination: Rectangle, colour: string = 'white') {
context.save();
context.strokeStyle = colour;
context.lineWidth = 1;
context.strokeRect(destination.x, destination.y, destination.width, destination.height);
context.restore();
}
}

0 comments on commit 7ac2c53

Please sign in to comment.