[AD] bug in getpixel |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
How's that for an attention grabbing subject ? :) In 24 bit modes, when the last pixel of a memory BITMAP is right on the end of a page, the assembler getpixel will trigger a page fault by reading an unaligned int for the three bytes of the pixel (in the last page) and a random byte (in the next page) which will then get masked out, but the damage is done. I've tried changing the code to either read 3 bytes and or the results, or read aligned and shift for odd addresses, but both are slower than the unaligned reads, so I've just added 1 to the allocated memory for 24 bit BITMAPs. Not a nice solution, but it works. ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________
Attachment:
getpixel24.diff
Description: getpixel24.diff
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |