fastened masterbrightness on max brighten(=allwhite)/max darken(=allblack)

This commit is contained in:
mightymax 2007-01-10 13:25:26 +00:00
parent f75f24b53d
commit d166860a5f
1 changed files with 42 additions and 27 deletions

View File

@ -419,6 +419,13 @@ static INLINE void GPU_ligne(Screen * screen, u16 l)
masterBrightFactor = masterBrightFactor > 16 ? 16 : masterBrightFactor;
if (!masterBrightFactor) break ; /* when we wont do anything, we dont need to loop */
if (masterBrightFactor == 16)
{
/* the formular would create only white, as (r + (31-r)) = 31 */
/* white = enable all bits */
memset(dst,0xFF, 256*sizeof(COLOR)) ;
} else
{
for(i16 = 0; i16 < 256; ++i16)
{
@ -434,7 +441,7 @@ static INLINE void GPU_ligne(Screen * screen, u16 l)
dstColor.bitfield.blue = min(31,(b + ((31-b)*masterBrightFactor)/16));
T2WriteWord (dst, i16 << 1, dstColor.val);
}
}
break;
}
@ -452,6 +459,13 @@ static INLINE void GPU_ligne(Screen * screen, u16 l)
masterBrightFactor = masterBrightFactor > 16 ? 16 : masterBrightFactor;
if (!masterBrightFactor) break ; /* when we wont do anything, we dont need to loop */
if (masterBrightFactor == 16)
{
/* the formular would create only black, as (r - r) = 0 */
/* black = disable all bits */
memset(dst,0, 256*sizeof(COLOR)) ;
} else
{
for(i16 = 0; i16 < 256; ++i16)
{
@ -467,6 +481,7 @@ static INLINE void GPU_ligne(Screen * screen, u16 l)
dstColor.bitfield.blue = min(31,(b - (b*masterBrightFactor)/16));
T2WriteWord (dst, i16 << 1, dstColor.val);
}
}
break;
}