/[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 471 by astrand, Mon Sep 15 08:03:30 2003 UTC revision 472 by jsorg71, Thu Sep 25 22:23:42 2003 UTC
# Line 201  make_colour16(PixelColour pc) Line 201  make_colour16(PixelColour pc)
201  static uint32  static uint32
202  make_colour24(PixelColour pc)  make_colour24(PixelColour pc)
203  {  {
204          return (pc.red << 16) | (pc.green << 8) | pc.blue;          if (g_xserver_be)
205            {
206                    return pc.red | (pc.green << 8) | (pc.blue << 16);
207            }
208            else
209            {
210                    return (pc.red << 16) | (pc.green << 8) | pc.blue;
211            }
212  }  }
213    
214  static uint32  static uint32
215  make_colour32(PixelColour pc)  make_colour32(PixelColour pc)
216  {  {
217          return (pc.red << 16) | (pc.green << 8) | pc.blue;          if (g_xserver_be)
218            {
219                    return pc.red | (pc.green << 8) | (pc.blue << 16);
220            }
221            else
222            {
223                    return (pc.red << 16) | (pc.green << 8) | pc.blue;
224            }
225  }  }
226    
227  #define BSWAP16(x) { x = (((x & 0xff) << 8) | (x >> 8)); }  #define BSWAP16(x) { x = (((x & 0xff) << 8) | (x >> 8)); }
# Line 344  translate15to24(uint16 * data, uint8 * o Line 358  translate15to24(uint16 * data, uint8 * o
358  static void  static void
359  translate15to32(uint16 * data, uint32 * out, uint32 * end)  translate15to32(uint16 * data, uint32 * out, uint32 * end)
360  {  {
361            uint16 pixel;
362    
363          while (out < end)          while (out < end)
364                  *(out++) = make_colour32(split_colour15(*(data++)));          {
365                    if (g_host_be)
366                    {
367                            pixel = *(data++);
368                            pixel = (pixel & 0xff) << 8 | (pixel & 0xff00) >> 8;
369                            *(out++) = make_colour32(split_colour15(pixel));
370                    }
371                    else
372                    {
373                            *(out++) = make_colour32(split_colour15(*(data++)));
374                    }
375            }
376  }  }
377    
378  static void  static void
# Line 373  translate16to24(uint16 * data, uint8 * o Line 400  translate16to24(uint16 * data, uint8 * o
400  static void  static void
401  translate16to32(uint16 * data, uint32 * out, uint32 * end)  translate16to32(uint16 * data, uint32 * out, uint32 * end)
402  {  {
403            uint16 pixel;
404    
405          while (out < end)          while (out < end)
406                  *(out++) = make_colour32(split_colour16(*(data++)));          {
407                    if (g_host_be)
408                    {
409                            pixel = *(data++);
410                            pixel = (pixel & 0xff) << 8 | (pixel & 0xff00) >> 8;
411                            *(out++) = make_colour32(split_colour16(pixel));
412                    }
413                    else
414                    {
415                            *(out++) = make_colour32(split_colour16(*(data++)));
416                    }
417            }
418  }  }
419    
420  static void  static void
# Line 405  translate24to32(uint8 * data, uint32 * o Line 445  translate24to32(uint8 * data, uint32 * o
445          uint32 pixel = 0;          uint32 pixel = 0;
446          while (out < end)          while (out < end)
447          {          {
448                  pixel = *(data++);                  if (g_host_be)
449                  pixel |= *(data++) << 8;                  {
450                  pixel |= *(data++) << 16;                          pixel = *(data++) << 16;
451                            pixel |= *(data++) << 8;
452                            pixel |= *(data++);
453                    }
454                    else
455                    {
456                            pixel = *(data++);
457                            pixel |= *(data++) << 8;
458                            pixel |= *(data++) << 16;
459                    }
460                  *(out++) = pixel;                  *(out++) = pixel;
461          }          }
462  }  }

Legend:
Removed from v.471  
changed lines
  Added in v.472

  ViewVC Help
Powered by ViewVC 1.1.26