Question: layer problem: is it bug of lice? How to overcome it?
Asked by ruchira (202.129.232.x) on October 19 2010, 6:37pm
Reply on October 19 2010, 9:21pm (edited at October 19 2010, 9:28pm):I think it is a LICE bug, yeah. Working on a fix now.
OK, got it. Sorry for the delay. in lice_combine.h, replace the following two classes with these versions:
class _LICE_CombinePixelsCopySourceAlphaIgnoreAlphaParmNoClamp
{
public:
static inline void doPix(LICE_pixel_chan *dest, int r, int g, int b, int a, int alpha)
{
if (a)
{
if (a==255)
{
_LICE_MakePixelNoClamp(dest,r,g,b,a);
}
else
{
int sc=(255-a);
_LICE_MakePixelNoClamp(dest,
r + ((dest[LICE_PIXEL_R]-r)*sc)/256,
g + ((dest[LICE_PIXEL_G]-g)*sc)/256,
b + ((dest[LICE_PIXEL_B]-b)*sc)/256,
a + ((dest[LICE_PIXEL_A]-a)*sc)/256);
}
}
}
};
class _LICE_CombinePixelsCopySourceAlphaIgnoreAlphaParmClamp
{
public:
static inline void doPix(LICE_pixel_chan *dest, int r, int g, int b, int a, int alpha)
{
if (a)
{
if (a==255)
{
_LICE_MakePixelClamp(dest,r,g,b,a);
}
else
{
int sc=(255-a);
_LICE_MakePixelClamp(dest,
r + ((dest[LICE_PIXEL_R]-r)*sc)/256,
g + ((dest[LICE_PIXEL_G]-g)*sc)/256,
b + ((dest[LICE_PIXEL_B]-b)*sc)/256,
a + ((dest[LICE_PIXEL_A]-a)*sc)/256);
}
}
}
};