I have some functions that read, write, and display bitmaps. My problem is that I can't seem to get the padding right for 16 color bitmaps. I first tried calculating with (4-width%4) & 3. However, this fails sometimes. I'm not sure whether my algorithm is wrong or what else it could be. Suggestions?



LinkBack URL
About LinkBacks



For those interested I'm using offset = (4-((w>>1)+(w&1))%4) & 3. And Hershlag, I'm sorry for saying you were wrong when you were right from the beginning, we just overlooked the 16bit padding issue. Thanks for the help everyone!