Merge pull request #62 from duckietm/Dev

🆙 Fixed the Door not visable when window is on wall
This commit is contained in:
DuckieTM
2026-05-04 12:02:40 +02:00
committed by GitHub
3 changed files with 28 additions and 6 deletions
+5 -5
View File
@@ -12,13 +12,13 @@
},
"repository": {
"type": "git",
"url": "https://github.com/billsonnn/nitro-renderer.git"
"url": "https://github.com/duckietm/Nitro_Render_V3.git"
},
"license": "GPL-3.0",
"bugs": {
"url": "https://github.com/billsonnn/nitro-renderer/issues"
"url": "https://github.com/duckietm/Nitro_Render_V3/issues"
},
"homepage": "https://github.com/billsonnn/nitro-renderer",
"homepage": "https://github.com/duckietm/Nitro_Render_V3",
"scripts": {
"build": "vite build",
"compile": "tsc --project ./tsconfig.json --noEmit false",
@@ -49,7 +49,7 @@
"tslib": "^2.6.3",
"typescript": "~5.8.2",
"typescript-eslint": "^8.26.1",
"vite": "^5.4.9",
"vitest": "^4.0.18"
"vite": "^8.0.10",
"vitest": "^4.1.5"
}
}
@@ -5,7 +5,7 @@ import { RoomObjectUpdateMessage } from './RoomObjectUpdateMessage';
export class ObjectRoomMaskUpdateMessage extends RoomObjectUpdateMessage
{
public static ADD_MASK: string = 'RORMUM_ADD_MASK';
public static REMOVE_MASK: string = 'RORMUM_ADD_MASK';
public static REMOVE_MASK: string = 'RORMUM_REMOVE_MASK';
public static DOOR: string = 'door';
public static WINDOW: string = 'window';
public static HOLE: string = 'hole';
@@ -812,6 +812,24 @@ export class RoomPlane implements IRoomPlane
layerContainer.destroy({ children: true });
}
private applyPlaneSpriteMasksTo(container: Container): void
{
if(!this._planeSprite || !this._planeSprite.children) return;
for(const child of this._planeSprite.children)
{
if(child instanceof Sprite)
{
const maskClone = new Sprite(child.texture);
maskClone.position.copyFrom(child.position);
maskClone.scale.copyFrom(child.scale);
container.addChild(maskClone);
}
}
if(this._maskFilter && (container.children.length > 1)) container.filters = [this._maskFilter];
}
private renderBackgroundColor(): void
{
if(!this._planeTexture || this._landscapeBackgroundColor === null) return;
@@ -828,6 +846,8 @@ export class RoomPlane implements IRoomPlane
const colorContainer = new Container();
colorContainer.addChild(colorGraphics);
this.applyPlaneSpriteMasksTo(colorContainer);
const transform = this.getMatrixForDimensions(canvasWidth, canvasHeight);
GetRenderer().render({
@@ -869,6 +889,8 @@ export class RoomPlane implements IRoomPlane
const colorContainer = new Container();
colorContainer.addChild(colorGraphics);
this.applyPlaneSpriteMasksTo(colorContainer);
const transform = this.getMatrixForDimensions(canvasWidth, canvasHeight);
GetRenderer().render({