/[rdesktop]/jpeg/rdesktop/trunk/orders.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 /jpeg/rdesktop/trunk/orders.c

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

revision 309 by jsorg71, Tue Feb 4 05:32:13 2003 UTC revision 314 by jsorg71, Fri Feb 7 23:43:37 2003 UTC
# Line 641  process_raw_bmpcache(STREAM s) Line 641  process_raw_bmpcache(STREAM s)
641  {  {
642          HBITMAP bitmap;          HBITMAP bitmap;
643          uint16 cache_idx, bufsize;          uint16 cache_idx, bufsize;
644          uint8 cache_id, width, height, bpp;          uint8 cache_id, width, height, bpp, Bpp;
645          uint8 *data, *inverted;          uint8 *data, *inverted;
646          int y;          int y;
647    
# Line 650  process_raw_bmpcache(STREAM s) Line 650  process_raw_bmpcache(STREAM s)
650          in_uint8(s, width);          in_uint8(s, width);
651          in_uint8(s, height);          in_uint8(s, height);
652          in_uint8(s, bpp);          in_uint8(s, bpp);
653            Bpp = (bpp + 7) / 8;
654          in_uint16_le(s, bufsize);          in_uint16_le(s, bufsize);
655          in_uint16_le(s, cache_idx);          in_uint16_le(s, cache_idx);
656          in_uint8p(s, data, bufsize);          in_uint8p(s, data, bufsize);
         if (bpp != 8) /* todo */  
                 return;  
657    
658          DEBUG(("RAW_BMPCACHE(cx=%d,cy=%d,id=%d,idx=%d)\n", width, height, cache_id, cache_idx));          DEBUG(("RAW_BMPCACHE(cx=%d,cy=%d,id=%d,idx=%d)\n", width, height, cache_id, cache_idx));
659          inverted = xmalloc(width * height);          inverted = xmalloc(width * height * Bpp);
660          for (y = 0; y < height; y++)          for (y = 0; y < height; y++)
661          {          {
662                  memcpy(&inverted[(height - y - 1) * width], &data[y * width], width);                  memcpy(&inverted[(height - y - 1) * (width * Bpp)], &data[y * (width * Bpp)], width * Bpp);
663          }          }
664    
665          bitmap = ui_create_bitmap(width, height, inverted);          bitmap = ui_create_bitmap(width, height, inverted);
# Line 674  process_bmpcache(STREAM s) Line 673  process_bmpcache(STREAM s)
673  {  {
674          HBITMAP bitmap;          HBITMAP bitmap;
675          uint16 cache_idx, size;          uint16 cache_idx, size;
676          uint8 cache_id, width, height, bpp;          uint8 cache_id, width, height, bpp, Bpp;
677          uint8 *data, *bmpdata;          uint8 *data, *bmpdata;
678    
679          in_uint8(s, cache_id);          in_uint8(s, cache_id);
# Line 682  process_bmpcache(STREAM s) Line 681  process_bmpcache(STREAM s)
681          in_uint8(s, width);          in_uint8(s, width);
682          in_uint8(s, height);          in_uint8(s, height);
683          in_uint8(s, bpp);          in_uint8(s, bpp);
684            Bpp = (bpp + 7) / 8;
685          in_uint8s(s, 2);        /* bufsize */          in_uint8s(s, 2);        /* bufsize */
686          in_uint16_le(s, cache_idx);          in_uint16_le(s, cache_idx);
687          in_uint8s(s, 2);        /* pad */          in_uint8s(s, 2);        /* pad */
688          in_uint16_le(s, size);          in_uint16_le(s, size);
689          in_uint8s(s, 4);        /* row_size, final_size */          in_uint8s(s, 4);        /* row_size, final_size */
690          in_uint8p(s, data, size);          in_uint8p(s, data, size);
         if (bpp != 8) /* todo */  
                 return;  
691    
692          DEBUG(("BMPCACHE(cx=%d,cy=%d,id=%d,idx=%d)\n", width, height, cache_id, cache_idx));          DEBUG(("BMPCACHE(cx=%d,cy=%d,id=%d,idx=%d)\n", width, height, cache_id, cache_idx));
693    
694          bmpdata = xmalloc(width * height);          bmpdata = xmalloc(width * height * Bpp);
695    
696          if (bitmap_decompress(bmpdata, width, height, data, size, bpp))          if (bitmap_decompress(bmpdata, width, height, data, size, Bpp))
697          {          {
698                  bitmap = ui_create_bitmap(width, height, bmpdata);                  bitmap = ui_create_bitmap(width, height, bmpdata);
699                  cache_put_bitmap(cache_id, cache_idx, bitmap);                  cache_put_bitmap(cache_id, cache_idx, bitmap);

Legend:
Removed from v.309  
changed lines
  Added in v.314

  ViewVC Help
Powered by ViewVC 1.1.26