The code doesn't try to pack 16bpp cluts anymore

This commit is contained in:
2025-03-11 14:28:21 +01:00
parent ad1eb12636
commit 5221a98fdb
2 changed files with 8 additions and 4 deletions

View File

@@ -134,11 +134,14 @@ public class VRAMEditorWindow : EditorWindow
Debug.Log($"Packing {texture} at: x:{ta.PositionX + texture.PackingX} y:{ta.PositionY + texture.PackingY}");
PasteTexture(vramImage, texture.GenerateVramPreview(), ta.PositionX + texture.PackingX, ta.PositionY + texture.PackingY);
Debug.Log($"Texpage: {texture.TexpageNum} Offset:({texture.PackingX},{texture.PackingY})");
for(int i = 0; i < texture.ColorPalette.Count; i++) {
vramImage.SetPixel(texture.ClutPackingX+i, texture.ClutPackingY, texture.ColorPalette[i].GetUnityColor());
if (texture.BitDepth != PSXBPP.TEX_16BIT)
{
for (int i = 0; i < texture.ColorPalette.Count; i++)
{
vramImage.SetPixel(texture.ClutPackingX + i, texture.ClutPackingY, texture.ColorPalette[i].GetUnityColor());
}
vramImage.Apply();
}
vramImage.Apply();
}
}
}

View File

@@ -142,6 +142,7 @@ namespace PSXSplash.RuntimeCode
psxTex.ImageData[i] = vramPixel.Pack();
i++;
}
psxTex.ColorPalette = null;
return psxTex;
}