[SDL] 1.2.8 -> 1.2.11 Upgrade

hinko.kocevar at cetrtapot.si hinko.kocevar at cetrtapot.si
Fri Feb 2 02:22:02 PST 2007


Torsten Giebl wrote:
> Hello !
> 
> 
>> I've upgraded SDL version from 1.2.8 to 1.2.11 and I'm noticing that
>> colors are not the same. SDL is used on an embedded device with 8bpp,
>> 320x240 sized LCD.
>> My first investigations were around blitting code of the surface and I
>> found out that several changes were made in that section
>> (src/video/SDL_blit* files).
> 
> 
> Did you also recompile your app with SDL 1.2.11 ?
> If not, maybe test this too.

Yes I've done that ...

> 
> When you know that you will only have 8bpp available,
> then you should use your own palettes with it.
> 
> Even if the new SDL code may be broken,
> with using palettes you will be sure
> that the app looks the way you want.

Hmm, can you elaborate a bit... In my app I'm using code very similar to 
the example found in SDL SDL_SetColors() man page at init time. Eg.

     int rval, l, i, g, b;
     u32 ops = SDL_SWSURFACE;
     SDL_Color Barve[256];

     if ((rval = SDL_Init (SDL_INIT_VIDEO)) < 0)
         return (false);

     if (gui_config_full_screen ())
	ops = (ops | SDL_FULLSCREEN);

     screen = SDL_SetVideoMode (w, h, gui_config_bpp (), ops);

     if (screen == NULL)
         return (false);

     for (l = 0; l < 8; ++l)
     {
         for (g = 0; g < 8; ++g)
         {
             for (b = 0; b < 4; ++b)
             {
                 i = ((l << 5) | (g << 2) | b);
                 Barve[i].r = l << 5;
                 Barve[i].g = g << 5;
                 Barve[i].b = b << 6;
             }
         }
     }

     SDL_SetColors (screen, (SDL_Color *) & Barve, 0, 256);

     SDL_EventState (SDL_MOUSEMOTION, SDL_IGNORE);
     SDL_EventState (SDL_MOUSEBUTTONUP, SDL_IGNORE);
     SDL_EventState (SDL_SYSWMEVENT, SDL_ENABLE);

     SDL_FillRect (screen, NULL, GUIDRAW_COLOR_GREY);
     return (true);

best regards,
hinko

-- 
ČETRTA POT, d.o.o., Kranj
Planina 3
4000 Kranj
Slovenia, Europe
Tel. +386 (0) 4 280 66 03
E-mail: hinko.kocevar at cetrtapot.si
Http: www.cetrtapot.si



More information about the SDL mailing list