- if (x3>0 && y3>0 && x3<fun->w && y3<fun->h) c=getpixel(fun,x3,y3); else c=0;
- tg=(c>>GSHIFT)&0xff;
- if (x4>0 && y4>0 && x4<fun->w && y4<fun->h) c=getpixel(fun,x4,y4); else c=0;
- g=(c>>GSHIFT)&0xff;
+ if (x3>0 && y3>0 && x3<fun->w && y3<fun->h) c=getpixel(fun,x3,y3); else c=SDL_MapRGB(fun->format,0,0,0);
+ SDL_GetRGB(c,fun->format,&t,&tg,&t);
+ if (x4>0 && y4>0 && x4<fun->w && y4<fun->h) c=getpixel(fun,x4,y4); else c=SDL_MapRGB(fun->format,0,0,0);
+ SDL_GetRGB(c,fun->format,&t,&g,&t);