/[rdesktop]/sourceforge.net/trunk/rdesktop/xwin.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/xwin.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 521 by stargo, Tue Oct 28 09:02:46 2003 UTC revision 524 by matthewc, Wed Oct 29 06:29:05 2003 UTC
# Line 57  static BOOL g_mouse_in_wnd; Line 57  static BOOL g_mouse_in_wnd;
57  /* endianness */  /* endianness */
58  static BOOL g_host_be;  static BOOL g_host_be;
59  static BOOL g_xserver_be;  static BOOL g_xserver_be;
60    static BOOL g_xserver_bgr;
61    
62  /* software backing store */  /* software backing store */
63  static BOOL g_ownbackstore;  static BOOL g_ownbackstore;
# Line 202  make_colour16(PixelColour pc) Line 203  make_colour16(PixelColour pc)
203          pc.red = (pc.red * 0x1f) / 0xff;          pc.red = (pc.red * 0x1f) / 0xff;
204          pc.green = (pc.green * 0x3f) / 0xff;          pc.green = (pc.green * 0x3f) / 0xff;
205          pc.blue = (pc.blue * 0x1f) / 0xff;          pc.blue = (pc.blue * 0x1f) / 0xff;
206          return (pc.red << 11) | (pc.green << 5) | pc.blue;          if (g_xserver_bgr)
207                    return (pc.blue << 11) | (pc.green << 5) | pc.red;
208            else
209                    return (pc.red << 11) | (pc.green << 5) | pc.blue;
210                    
211  }  }
212    
213  static uint32  static uint32
214  make_colour24(PixelColour pc)  make_colour24(PixelColour pc)
215  {  {
216          if (g_xserver_be)          if (g_xserver_bgr)
217          {                  return (pc.blue << 16) | (pc.green << 8) | pc.red;
                 return pc.red | (pc.green << 8) | (pc.blue << 16);  
         }  
218          else          else
         {  
219                  return (pc.red << 16) | (pc.green << 8) | pc.blue;                  return (pc.red << 16) | (pc.green << 8) | pc.blue;
         }  
220  }  }
221    
222  static uint32  static uint32
223  make_colour32(PixelColour pc)  make_colour32(PixelColour pc)
224  {  {
225          if (g_xserver_be)          if (g_xserver_bgr)
226          {                  return (pc.blue << 16) | (pc.green << 8) | pc.red;
                 return pc.red | (pc.green << 8) | (pc.blue << 16);  
         }  
227          else          else
         {  
228                  return (pc.red << 16) | (pc.green << 8) | pc.blue;                  return (pc.red << 16) | (pc.green << 8) | pc.blue;
         }  
229  }  }
230    
231  #define BSWAP16(x) { x = (((x & 0xff) << 8) | (x >> 8)); }  #define BSWAP16(x) { x = (((x & 0xff) << 8) | (x >> 8)); }
# Line 772  ui_init(void) Line 769  ui_init(void)
769          test = 1;          test = 1;
770          g_host_be = !(BOOL) (*(uint8 *) (&test));          g_host_be = !(BOOL) (*(uint8 *) (&test));
771          g_xserver_be = (ImageByteOrder(g_display) == MSBFirst);          g_xserver_be = (ImageByteOrder(g_display) == MSBFirst);
772            g_xserver_bgr = (g_visual->blue_mask > g_visual->red_mask);
773    
774          /*          /*
775           * Determine desktop size           * Determine desktop size

Legend:
Removed from v.521  
changed lines
  Added in v.524

  ViewVC Help
Powered by ViewVC 1.1.26