Fixed ui textures
This commit is contained in:
@@ -287,9 +287,10 @@ namespace SplashEdit.RuntimeCode
|
||||
data.ClutY = (ushort)tex.ClutPackingY;
|
||||
data.U0 = (byte)(tex.PackingX * expander);
|
||||
data.V0 = (byte)tex.PackingY;
|
||||
// Width is already in source pixels = texture-pixel units
|
||||
data.U1 = (byte)(tex.PackingX * expander + tex.Width);
|
||||
data.V1 = (byte)(tex.PackingY + tex.Height);
|
||||
// U1/V1 are the LAST texel (inclusive), not one-past-end.
|
||||
// Without -1, values >= 256 overflow byte to 0.
|
||||
data.U1 = (byte)(tex.PackingX * expander + tex.Width - 1);
|
||||
data.V1 = (byte)(tex.PackingY + tex.Height - 1);
|
||||
data.BitDepthIndex = tex.BitDepth switch
|
||||
{
|
||||
PSXBPP.TEX_4BIT => 0,
|
||||
@@ -297,6 +298,16 @@ namespace SplashEdit.RuntimeCode
|
||||
PSXBPP.TEX_16BIT => 2,
|
||||
_ => 2
|
||||
};
|
||||
|
||||
Debug.Log($"[UIImage] '{img.ElementName}' src='{(tex.OriginalTexture ? tex.OriginalTexture.name : "null")}' " +
|
||||
$"bpp={(int)tex.BitDepth} W={tex.Width} H={tex.Height} QW={tex.QuantizedWidth} " +
|
||||
$"packXY=({tex.PackingX},{tex.PackingY}) tpage=({tex.TexpageX},{tex.TexpageY}) " +
|
||||
$"clutXY=({tex.ClutPackingX},{tex.ClutPackingY}) " +
|
||||
$"UV=({data.U0},{data.V0})->({data.U1},{data.V1}) expander={expander} bitIdx={data.BitDepthIndex}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[UIImage] '{img.ElementName}' has NULL PackedTexture!");
|
||||
}
|
||||
|
||||
elements.Add(data);
|
||||
|
||||
Reference in New Issue
Block a user