[Tux4kids-tuxtype-dev] [Tuxmath-devel] libt4k_common update
Brendan Luchen
cheezmeister at gmail.com
Fri Jun 25 04:25:03 UTC 2010
Wenyuan,
> Just a quick question: when we eventually move to use libt4k_common
> with tuxmath, what changes do we need to make to the current source
> code of tuxmath? Is it as easy as to remove implementations of the
> shared functions and relink with the common lib? Do function
> signatures change between the two?
No, signatures won't change a bit. The only thing that has to change
is the function call--a function like LoadImage has a common lib
counterpart T4K_LoadImage with the same signature (and usually the
same code, too). What I've been doing so far is using the preprocessor
to redirect the calls instead of manually adding T4K all over the
place. Here's an example from SDL_extras.h in TuxMath's
commonification branch
#ifndef HAVE_LIBT4K_COMMON
void DrawButton(SDL_Rect* target_rect, int radius, Uint8 r,
Uint8 g, Uint8 b, Uint8 a);
#else
# define DrawButton T4K_DrawButton
#endif
This seems to be the least invasive way to do things, but I'd be glad
to hear any ideas you have :)
Best,
Brendan
More information about the Tux4kids-tuxtype-dev
mailing list