diff --git a/packages/assets/src/AssetManager.ts b/packages/assets/src/AssetManager.ts index ca94dd5..2e3be47 100644 --- a/packages/assets/src/AssetManager.ts +++ b/packages/assets/src/AssetManager.ts @@ -41,8 +41,6 @@ export class AssetManager implements IAssetManager return existing; } - NitroLogger.warn(`AssetManager: Asset not found: ${name}`); - return null; } @@ -99,7 +97,6 @@ export class AssetManager implements IAssetManager { if(!url || !url.length) return false; - // ✅ NEW: Local bundled assets (no generic.asset.url) if(url.startsWith('local://')) { const key = url.substring('local://'.length); @@ -173,52 +170,32 @@ export class AssetManager implements IAssetManager } } - /** - * ✅ Loads room assets from bundled code: - * - /packages/assets/src/assets/room/room.asset.json - * - /packages/assets/src/assets/room/images/*.png - * - * This loads individual PNG files instead of a spritesheet, then uses - * the JSON asset definitions for proper x, y offsets, flipH settings, etc. - */ private async loadLocalRoom(): Promise { - // 1) Load room JSON locally (bundled) const roomDataModule = await import('./assets/room/room.asset.json'); const roomData = (roomDataModule.default ?? roomDataModule) as IAssetData; - - // 2) Create collection WITHOUT spritesheet - // Note: Constructor calls define(), but assets won't be created since textures don't exist yet const collection = this.createCollection(roomData, null) as GraphicAssetCollection; if(!collection) return; - // 3) Load all images from the bundled assets const roomImages = import.meta.glob('./assets/room/*.png', { eager: true }); const roomImagesSub = import.meta.glob('./assets/room/images/*.png', { eager: true }); const merged = { ...roomImages, ...roomImagesSub }; - // 4) Register textures in the collection's _textures map - // getLibraryAsset() prepends collection name, so for asset 'wall_texture_64_0_wall_white' - // it looks for 'room_wall_texture_64_0_wall_white' in _textures for(const path in merged) { const mod = merged[path]; const imageUrl = (mod.default ?? mod) as string; const file = path.split('/').pop()!; - const rawName = file.replace(/\.png$/i, ''); // e.g., "room_wall_texture_64_0_wall_white" + const rawName = file.replace(/\.png$/i, ''); const texture = await Assets.load(imageUrl); if(!texture) continue; - // Register in AssetManager's global _textures for direct lookups this.setTexture(rawName, texture); - // Register in collection's _textures with the full name (room_...) - // This is what getLibraryAsset() will look for when defining assets collection.textures.set(rawName, texture); - // Also register without the "room_" prefix for direct lookups if(rawName.startsWith('room_')) { const normalizedName = rawName.substring('room_'.length); @@ -227,8 +204,6 @@ export class AssetManager implements IAssetManager } } - // 5) Now call define() again to process asset definitions with correct x, y offsets - // Assets that were skipped before (no textures) will now be created properly collection.define(roomData); } diff --git a/packages/assets/src/assets/room/room.asset.json b/packages/assets/src/assets/room/room.asset.json index 83bfce9..c8c0bcf 100644 --- a/packages/assets/src/assets/room/room.asset.json +++ b/packages/assets/src/assets/room/room.asset.json @@ -5606,8 +5606,7 @@ "size": 64, "allLayers": [ { - "color": 8703727, - "backgroundColor": "#84C6DF" + "color": 8703727 }, { "items": [ diff --git a/packages/room/src/object/visualization/room/RoomPlane.ts b/packages/room/src/object/visualization/room/RoomPlane.ts index da10b15..b9f6efd 100644 --- a/packages/room/src/object/visualization/room/RoomPlane.ts +++ b/packages/room/src/object/visualization/room/RoomPlane.ts @@ -413,7 +413,6 @@ export class RoomPlane implements IRoomPlane const animationLayers: PlaneVisualizationAnimationLayer[] = []; if(planeType === RoomPlane.TYPE_LANDSCAPE && planeVisualization?.allLayers) { - // Always use the room collection for animation assets (clouds etc.) since they are stored there const animationAssetCollection = roomCollection; for(const layer of planeVisualization.allLayers) { @@ -554,7 +553,6 @@ export class RoomPlane implements IRoomPlane if(this._lastLandscapeDebugSignature !== landscapeDebugSignature) { this._lastLandscapeDebugSignature = landscapeDebugSignature; - console.debug('[RoomPlane] Loaded landscape background', landscapeDebugPayload); } this._planeSprite = new TilingSprite({ diff --git a/packages/room/src/object/visualization/room/animated/PlaneVisualizationAnimationLayer.ts b/packages/room/src/object/visualization/room/animated/PlaneVisualizationAnimationLayer.ts index 8588a0f..169650e 100644 --- a/packages/room/src/object/visualization/room/animated/PlaneVisualizationAnimationLayer.ts +++ b/packages/room/src/object/visualization/room/animated/PlaneVisualizationAnimationLayer.ts @@ -120,25 +120,21 @@ export class PlaneVisualizationAnimationLayer const assetWidth = item.bitmapData.width; const assetHeight = item.bitmapData.height; - // Render at primary position if(this.isVisible(point.x, point.y, assetWidth, assetHeight, canvas.width, canvas.height)) { this.renderSprite(item, point.x, point.y, canvas); } - // Wrap horizontally (left side) if(this.isVisible(point.x - maxX, point.y, assetWidth, assetHeight, canvas.width, canvas.height)) { this.renderSprite(item, point.x - maxX, point.y, canvas); } - // Wrap vertically (top side) if(this.isVisible(point.x, point.y - maxY, assetWidth, assetHeight, canvas.width, canvas.height)) { this.renderSprite(item, point.x, point.y - maxY, canvas); } - // Wrap both (top-left corner) if(this.isVisible(point.x - maxX, point.y - maxY, assetWidth, assetHeight, canvas.width, canvas.height)) { this.renderSprite(item, point.x - maxX, point.y - maxY, canvas);