bugfixes
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user