On Sunday 17 February 2008 10:45:21 Richard Hainsworth wrote: > <parrot_dir>/examples/sdl/blue_font.pir > works but produces random colors even though it should be blue > while .../blue_rect.pir gives a solid blue > > The native SDL routine for font needs to have a color integer (as for > rectangles) not a color pmc (as currently). The signature for the font > rendering routines needs to be changed too.
It doesn't really take an integer though. It takes a struct (not a pointer to a struct) composed of four unsigned integers: typedef struct SDL_Color { Uint8 r; Uint8 g; Uint8 b; Uint8 unused; } SDL_Color; SDL_Surface * SDLCALL TTF_RenderText_Solid(TTF_Font *font, const char *text, SDL_Color fg); Passing a pointer is definitely wrong, but it looks to me like we should review the shifts of the individual components of the integer. That makes me wonder if there's an endianness problem somewhere. > Files changed: > <parrot_dir>/runtime/parrot/library/SDL.pir > - change to _init_ttf > - change to signatures for TTF_Render* functions. > > <parrot_dir>/runtime/parrot/library/SDL/Font.pir > - change render_text method Can you send these as unified diffs next time? They're difficult to apply this way. -- c