On Mon, 2005-01-10 at 16:09, Bill Kendrick wrote: > On Mon, Jan 10, 2005 at 03:17:13PM -0500, Albert Cahalan wrote: > > Ensure that FreeType is compiled with -fno-strict-aliasing > > or, slower, with -O0. FreeType violates the C standard, > > which now damn-near prohibits casting pointers. BTW, there > > are violations in the Tux Paint getpixel/putpixel code too. > > Yeah, getpixel/putpixel were pretty much straight out of the example code > for SDL. > > I've been thinking maybe we should use function pointers, so that /every/ > getpixel/putpixel didn't have to say: > > "wait, what BPP am I again?" > > We could even use an array of function pointers, such that: > > getpixel[8] = getpixel8(); > getpixel[16] = getpixel16(); > > etc. > > Then the decision as to which getpixel/putpixel to use could happen > much less often. > > Thoughts?
I like it, though it won't fix the C standard violation. Loading a wrong-sized image with a starter uses an unusual bpp value. It isn't converted to the screen bpp before use. If that were fixed, then an array wouldn't be needed. _______________________________________________ Tuxpaint-dev mailing list [email protected] http://tux4kids.net/mailman/listinfo/tuxpaint-dev
