/[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 527 by matthewc, Wed Oct 29 08:15:02 2003 UTC revision 532 by astrand, Wed Oct 29 14:14:46 2003 UTC
# Line 245  translate8to16(uint8 * data, uint8 * out Line 245  translate8to16(uint8 * data, uint8 * out
245          while (out < end)          while (out < end)
246          {          {
247                  value = (uint16) g_colmap[*(data++)];                  value = (uint16) g_colmap[*(data++)];
248                    
249                  if (g_xserver_be)                  if (g_xserver_be)
250                  {                  {
251                          *(out++) = value >> 8;                          *(out++) = value >> 8;
# Line 268  translate8to24(uint8 * data, uint8 * out Line 268  translate8to24(uint8 * data, uint8 * out
268          while (out < end)          while (out < end)
269          {          {
270                  value = g_colmap[*(data++)];                  value = g_colmap[*(data++)];
271                    
272                  if (g_xserver_be)                  if (g_xserver_be)
273                  {                  {
274                          *(out++) = value >> 16;                          *(out++) = value >> 16;
# Line 408  translate15to32(uint16 * data, uint8 * o Line 408  translate15to32(uint16 * data, uint8 * o
408  }  }
409    
410  static void  static void
411  translate16to16(uint16 * data, uint16 * out, uint16 * end)  translate16to16(uint16 * data, uint8 * out, uint8 * end)
412  {  {
413            uint16 pixel;
414          uint16 value;          uint16 value;
415    
416          if (g_xserver_be)          while (out < end)
417          {          {
418                  while (out < end)                  pixel = *(data++);
419    
420                    if (g_host_be)
421                  {                  {
422                          value = *data;                          BSWAP16(pixel);
                         BSWAP16(value);  
                         *out = value;  
                         data++;  
                         out++;  
423                  }                  }
424    
425          }                  value = make_colour(split_colour16(pixel));
426          else  
427          {                  if (g_xserver_be)
428                  while (out < end)                  {
429                            *(out++) = value >> 8;
430                            *(out++) = value;
431                    }
432                    else
433                  {                  {
434                          *out = *data;                          *(out++) = value;
435                          out++;                          *(out++) = value >> 8;
                         data++;  
436                  }                  }
437          }          }
438  }  }
439    
   
440  static void  static void
441  translate16to24(uint16 * data, uint8 * out, uint8 * end)  translate16to24(uint16 * data, uint8 * out, uint8 * end)
442  {  {
# Line 591  translate_image(int width, int height, u Line 592  translate_image(int width, int height, u
592                                          translate16to24((uint16 *) data, out, end);                                          translate16to24((uint16 *) data, out, end);
593                                          break;                                          break;
594                                  case 16:                                  case 16:
595                                          translate16to16((uint16 *) data, (uint16 *) out,                                          translate16to16((uint16 *) data, out, end);
                                                         (uint16 *) end);  
596                                          break;                                          break;
597                          }                          }
598                          break;                          break;
# Line 700  ui_init(void) Line 700  ui_init(void)
700    
701                  g_visual = vi.visual;                  g_visual = vi.visual;
702                  g_owncolmap = False;                  g_owncolmap = False;
703                  calculate_shifts(vi.red_mask,   &g_red_shift_r,   &g_red_shift_l);                  calculate_shifts(vi.red_mask, &g_red_shift_r, &g_red_shift_l);
704                  calculate_shifts(vi.blue_mask,  &g_blue_shift_r,  &g_blue_shift_l);                  calculate_shifts(vi.blue_mask, &g_blue_shift_r, &g_blue_shift_l);
705                  calculate_shifts(vi.green_mask, &g_green_shift_r, &g_green_shift_l);                  calculate_shifts(vi.green_mask, &g_green_shift_r, &g_green_shift_l);
706          }          }
707    
# Line 821  ui_deinit(void) Line 821  ui_deinit(void)
821    
822  #define NULL_POINTER_MASK       "\x80"  #define NULL_POINTER_MASK       "\x80"
823  #define NULL_POINTER_DATA       "\x0\x0\x0"  #define NULL_POINTER_DATA       "\x0\x0\x0"
824            
825  BOOL  BOOL
826  ui_create_window(void)  ui_create_window(void)
827  {  {
# Line 916  void Line 916  void
916  ui_destroy_window(void)  ui_destroy_window(void)
917  {  {
918          ui_destroy_cursor(g_null_cursor);          ui_destroy_cursor(g_null_cursor);
919            
920          if (g_IC != NULL)          if (g_IC != NULL)
921                  XDestroyIC(g_IC);                  XDestroyIC(g_IC);
922    

Legend:
Removed from v.527  
changed lines
  Added in v.532

  ViewVC Help
Powered by ViewVC 1.1.26