/[rdesktop]/sourceforge.net/trunk/rdesktop/bitmap.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/bitmap.c

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

revision 9 by matty, Tue Jul 25 12:34:29 2000 UTC revision 19 by matty, Sun Oct 8 01:59:25 2000 UTC
# Line 18  Line 18 
18     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  */  */
20    
21  #include "includes.h"  #include "rdesktop.h"
22    
23  #define CVAL(p)   (*(p++))  #define CVAL(p)   (*(p++))
24  #define SVAL(p)   ((*((p++) + 1) << 8) | CVAL(p))  #define SVAL(p)   ((*((p++) + 1) << 8) | CVAL(p))
# Line 30  BOOL bitmap_decompress(unsigned char *ou Line 30  BOOL bitmap_decompress(unsigned char *ou
30                         unsigned char *input, int size)                         unsigned char *input, int size)
31  {  {
32          unsigned char *end = input + size;          unsigned char *end = input + size;
33          unsigned char *prevline, *line = NULL;          unsigned char *prevline = NULL, *line = NULL;
34          int opcode, count, offset, isfillormix, x = width;          int opcode, count, offset, isfillormix, x = width;
35          int lastopcode = -1, insertmix = False;          int lastopcode = -1, insertmix = False, bicolour = False;
36          uint8 code, colour1, colour2, mask, mixmask;          uint8 code, colour1 = 0, colour2 = 0;
37          uint8 mix = 0xff;          uint8 mixmask, mask = 0, mix = 0xff;
38    
39          while (input < end)          while (input < end)
40          {          {
# Line 88  BOOL bitmap_decompress(unsigned char *ou Line 88  BOOL bitmap_decompress(unsigned char *ou
88                  switch (opcode)                  switch (opcode)
89                  {                  {
90                          case 0: /* Fill */                          case 0: /* Fill */
91                                  if ((lastopcode == opcode) && (x != width))                                  if ((lastopcode == opcode)
92                                        && !((x == width) && (prevline == NULL)))
93                                          insertmix = True;                                          insertmix = True;
94                                  break;                                  break;
95                          case 8: /* Bicolour */                          case 8: /* Bicolour */
# Line 177  BOOL bitmap_decompress(unsigned char *ou Line 178  BOOL bitmap_decompress(unsigned char *ou
178                                          break;                                          break;
179    
180                                  case 8: /* Bicolour */                                  case 8: /* Bicolour */
181                                          REPEAT(line[x] = colour1; line[++x] = colour2)                                          REPEAT(
182                                                    if (bicolour)
183                                                    {
184                                                            line[x] = colour2;
185                                                            bicolour = False;
186                                                    }
187                                                    else
188                                                    {
189                                                            line[x] = colour1;
190                                                            bicolour = True;
191                                                            count++;
192                                                    }
193                                            )
194                                          break;                                          break;
195    
196                                  case 13: /* White */                                  case 13: /* White */

Legend:
Removed from v.9  
changed lines
  Added in v.19

  ViewVC Help
Powered by ViewVC 1.1.26