feat: include size 32 (catalog icon) sprites in nitro bundles
The SWF-to-Nitro converter previously dropped the size 32 visualization and any sprite image whose name contained '_32_', so bundles lacked the small/catalog render size. Keep them so each furniture bundle renders correctly at every scale the client requests. - xml-processor: stop skipping visualization size === 32 - index.ts: stop excluding '_32_' sprite assets/images from the sheet
This commit is contained in:
1 parent
53db4a858b
commit
2996ae3ab0
2 files changed
+6
-10
No files matched your search
@@ -203,12 +203,7 @@ export function convertSwfToNitro(
|
|||||||
: findChild(assetsRoot, "assets") || assetsRoot;
|
: findChild(assetsRoot, "assets") || assetsRoot;
|
||||||
for (const asset of findChildren(assetsNode, "asset")) {
|
for (const asset of findChildren(assetsNode, "asset")) {
|
||||||
const assetName = asset.attrs.name || "";
|
const assetName = asset.attrs.name || "";
|
||||||
if (
|
if (!assetName || assetName.startsWith("sh_")) continue;
|
||||||
!assetName ||
|
|
||||||
assetName.startsWith("sh_") ||
|
|
||||||
assetName.includes("_32_")
|
|
||||||
)
|
|
||||||
continue;
|
|
||||||
if (!asset.attrs.source) {
|
if (!asset.attrs.source) {
|
||||||
neededSprites.add(assetName);
|
neededSprites.add(assetName);
|
||||||
} else {
|
} else {
|
||||||
@@ -225,7 +220,7 @@ export function convertSwfToNitro(
|
|||||||
if (!rawName) continue;
|
if (!rawName) continue;
|
||||||
const name = stripPrefix(rawName);
|
const name = stripPrefix(rawName);
|
||||||
|
|
||||||
if (name.startsWith("sh_") || name.includes("_32_")) continue;
|
if (name.startsWith("sh_")) continue;
|
||||||
if (neededSprites.size > 0 && !neededSprites.has(name)) continue;
|
if (neededSprites.size > 0 && !neededSprites.has(name)) continue;
|
||||||
|
|
||||||
namedImages.push({
|
namedImages.push({
|
||||||
@@ -290,7 +285,7 @@ export function convertSwfToNitro(
|
|||||||
for (const asset of findChildren(assetsNode, "asset")) {
|
for (const asset of findChildren(assetsNode, "asset")) {
|
||||||
const assetName = asset.attrs.name || "";
|
const assetName = asset.attrs.name || "";
|
||||||
if (!assetName) continue;
|
if (!assetName) continue;
|
||||||
if (assetName.startsWith("sh_") || assetName.includes("_32_")) continue;
|
if (assetName.startsWith("sh_")) continue;
|
||||||
|
|
||||||
const x = parseInt(asset.attrs.x || "0", 10);
|
const x = parseInt(asset.attrs.x || "0", 10);
|
||||||
const y = parseInt(asset.attrs.y || "0", 10);
|
const y = parseInt(asset.attrs.y || "0", 10);
|
||||||
|
|||||||
@@ -426,8 +426,9 @@ export function processVisualization(xml: string): NitroVisualization[] {
|
|||||||
|
|
||||||
for (const viz of findChildren(graphics, "visualization")) {
|
for (const viz of findChildren(graphics, "visualization")) {
|
||||||
const size = parseInt(viz.attrs.size || "64", 10);
|
const size = parseInt(viz.attrs.size || "64", 10);
|
||||||
// Skip size 32 (small catalog icons) – only keep size 1 (special) and 64 (standard)
|
// Keep size 1 (special), 32 (small catalog icons) and 64 (standard) so the
|
||||||
if (size === 32) continue;
|
// bundle renders correctly at every scale the client requests.
|
||||||
|
if (size <= 0) continue;
|
||||||
|
|
||||||
const layerCount = parseInt(viz.attrs.layerCount || "1", 10);
|
const layerCount = parseInt(viz.attrs.layerCount || "1", 10);
|
||||||
const angle = parseInt(viz.attrs.angle || "45", 10);
|
const angle = parseInt(viz.attrs.angle || "45", 10);
|
||||||
|
|||||||
Reference in new issue
Block a user