/[rdesktop]/sourceforge.net/trunk/rdesktop/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 /sourceforge.net/trunk/rdesktop/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 318 by astrand, Mon Feb 10 12:58:51 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)],
663                           width * Bpp);
664          }          }
665    
666          bitmap = ui_create_bitmap(width, height, inverted);          bitmap = ui_create_bitmap(width, height, inverted);
# Line 674  process_bmpcache(STREAM s) Line 674  process_bmpcache(STREAM s)
674  {  {
675          HBITMAP bitmap;          HBITMAP bitmap;
676          uint16 cache_idx, size;          uint16 cache_idx, size;
677          uint8 cache_id, width, height, bpp;          uint8 cache_id, width, height, bpp, Bpp;
678          uint8 *data, *bmpdata;          uint8 *data, *bmpdata;
679    
680          in_uint8(s, cache_id);          in_uint8(s, cache_id);
# Line 682  process_bmpcache(STREAM s) Line 682  process_bmpcache(STREAM s)
682          in_uint8(s, width);          in_uint8(s, width);
683          in_uint8(s, height);          in_uint8(s, height);
684          in_uint8(s, bpp);          in_uint8(s, bpp);
685            Bpp = (bpp + 7) / 8;
686          in_uint8s(s, 2);        /* bufsize */          in_uint8s(s, 2);        /* bufsize */
687          in_uint16_le(s, cache_idx);          in_uint16_le(s, cache_idx);
688          in_uint8s(s, 2);        /* pad */          in_uint8s(s, 2);        /* pad */
689          in_uint16_le(s, size);          in_uint16_le(s, size);
690          in_uint8s(s, 4);        /* row_size, final_size */          in_uint8s(s, 4);        /* row_size, final_size */
691          in_uint8p(s, data, size);          in_uint8p(s, data, size);
         if (bpp != 8) /* todo */  
                 return;  
692    
693          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));
694    
695          bmpdata = xmalloc(width * height);          bmpdata = xmalloc(width * height * Bpp);
696    
697          if (bitmap_decompress(bmpdata, width, height, data, size, bpp))          if (bitmap_decompress(bmpdata, width, height, data, size, Bpp))
698          {          {
699                  bitmap = ui_create_bitmap(width, height, bmpdata);                  bitmap = ui_create_bitmap(width, height, bmpdata);
700                  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.318

  ViewVC Help
Powered by ViewVC 1.1.26