This commit is contained in:
Jan Racek
2026-03-27 18:31:35 +01:00
parent 1c48b8b425
commit 24d0c1fa07
27 changed files with 779 additions and 609 deletions

View File

@@ -154,6 +154,18 @@ namespace SplashEdit.RuntimeCode
G = (ushort)(pixel.g * 31),
B = (ushort)(pixel.b * 31)
};
// PS1: color 0x0000 is transparent. If the source pixel is opaque
// but quantized to pure black, bump to near-black (1,1,1) with bit15
// set so the hardware doesn't treat it as see-through.
if (vramPixel.Pack() == 0x0000 && pixel.a > 0f)
{
vramPixel.R = 1;
vramPixel.G = 1;
vramPixel.B = 1;
vramPixel.SemiTransparent = true;
}
psxTex.ImageData[x, y] = vramPixel;
}
}
@@ -169,6 +181,18 @@ namespace SplashEdit.RuntimeCode
{
Color pixel = new Color(color.x, color.y, color.z);
VRAMPixel vramPixel = new VRAMPixel { R = (ushort)(pixel.r * 31), G = (ushort)(pixel.g * 31), B = (ushort)(pixel.b * 31) };
// PS1: palette entry 0x0000 is transparent. Any non-transparent palette
// color that quantizes to pure black must be bumped to near-black (1,1,1)
// with bit15 set to avoid the hardware treating it as see-through.
if (vramPixel.Pack() == 0x0000)
{
vramPixel.R = 1;
vramPixel.G = 1;
vramPixel.B = 1;
vramPixel.SemiTransparent = true;
}
psxTex.ColorPalette.Add(vramPixel);
}