Hi,

I'm working on a bigendian platform with 24bpp RGB framebuffer.
The following patch was needed to fix some alignment and
endianess issues.

--Mark

Index: src/core/surfaces.c
===================================================================
RCS file: /cvs/cvsfiles/devo/directfb/src/core/surfaces.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 surfaces.c
1052a1053,1057
> #ifdef WORDS_BIGENDIAN
>                          buf_p[n3+0] = data8[n3+0];
>                          buf_p[n3+1] = data8[n3+1];
>                          buf_p[n3+2] = data8[n3+2];
> #else
1055a1061
> #endif
Index: src/misc/gfx_util.c
===================================================================
RCS file: /cvs/cvsfiles/devo/directfb/src/misc/gfx_util.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 gfx_util.c
110a111,115
> #ifdef WORDS_BIGENDIAN
>                *dst++ = r;
>                *dst++ = g;
>                *dst   = b;
> #else
113a119
> #endif
Index: wm/default/default.c
===================================================================
RCS file: /cvs/cvsfiles/devo/directfb/wm/default/default.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 default.c
394a395
>                             __u8 *p;
405,408c406,412
<                                    case DSPF_RGB24:   //endianess? boh...
<                                         pixel = (*(__u32*)(data +
<                                                            3 * wx + pitch * 
wy))
<                                                 & 0x00ffffff;
---
>                                    case DSPF_RGB24:
>                                         p = (data + 3 * wx + pitch * wy);
> #ifdef WORDS_BIGENDIAN
>                                         pixel = (p[0] << 16) | (p[1] << 8) | 
> p[2];
> #else
>                                         pixel = (p[2] << 16) | (p[1] << 8) | 
> p[0];
> #endif




Reply via email to