Re: [AD] small bug in 15 and 16 bit asm color converters |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Thinking about this.. now color 0/0/0 gets 7/3/7. This needs a better
soltuion - but my asm skills aren't good enough for that :| And it will
probably get slower, since it will need a lookup table (like the C
version). Or maybe there's some clever trick to get this "almost" right?
Like, use some clever shift-rotate instructions which will leave the 0
bits as 0 for small color components, and only fill the 1 bits in for
high ones?
So rgb -> r000g00b000 for colors < 80/80/80, and rgb -> r111g11b111 for
other colors? Or even better, if it could be per-component.
--
Elias Pschernig