/[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 19 by matty, Sun Oct 8 01:59:25 2000 UTC revision 24 by matty, Sat Jan 6 03:12:10 2001 UTC
# Line 87  BOOL bitmap_decompress(unsigned char *ou Line 87  BOOL bitmap_decompress(unsigned char *ou
87                  mixmask = 0;                  mixmask = 0;
88                  switch (opcode)                  switch (opcode)
89                  {                  {
90                          case 0: /* Fill */                          case 0: /* Fill */
91                                  if ((lastopcode == opcode)                                  if ((lastopcode == opcode)
92                                      && !((x == width) && (prevline == NULL)))                                      && !((x == width) && (prevline == NULL)))
93                                          insertmix = True;                                          insertmix = True;
94                                  break;                                  break;
95                          case 8: /* Bicolour */                          case 8: /* Bicolour */
96                                  colour1 = CVAL(input);                                  colour1 = CVAL(input);
97                          case 3: /* Colour */                          case 3: /* Colour */
98                                  colour2 = CVAL(input);                                  colour2 = CVAL(input);
99                                  break;                                  break;
100                          case 6: /* SetMix/Mix */                          case 6: /* SetMix/Mix */
101                          case 7: /* SetMix/FillOrMix */                          case 7: /* SetMix/FillOrMix */
102                                  mix = CVAL(input);                                  mix = CVAL(input);
103                                  opcode -= 5;                                  opcode -= 5;
104                                  break;                                  break;
# Line 122  BOOL bitmap_decompress(unsigned char *ou Line 122  BOOL bitmap_decompress(unsigned char *ou
122    
123                          switch (opcode)                          switch (opcode)
124                          {                          {
125                                  case 0: /* Fill */                                  case 0: /* Fill */
126                                          if (insertmix)                                          if (insertmix)
127                                          {                                          {
128                                                  if (prevline == NULL)                                                  if (prevline == NULL)
129                                                          line[x] = mix;                                                          line[x] = mix;
130                                                  else                                                  else
131                                                          line[x] = prevline[x] ^ mix;                                                          line[x] =
132                                                                    prevline[x] ^
133                                                                    mix;
134    
135                                                  insertmix = False;                                                  insertmix = False;
136                                                  count--;                                                  count--;
# Line 136  BOOL bitmap_decompress(unsigned char *ou Line 138  BOOL bitmap_decompress(unsigned char *ou
138                                          }                                          }
139    
140                                          if (prevline == NULL)                                          if (prevline == NULL)
141                                                  REPEAT(line[x] = 0)                                          {
142                                                    REPEAT(line[x] = 0);
143                                            }
144                                          else                                          else
145                                                  REPEAT(line[x] = prevline[x])                                          {
146                                                    REPEAT(line[x] = prevline[x]);
147                                            }
148                                          break;                                          break;
149    
150                                  case 1: /* Mix */                                  case 1: /* Mix */
151                                          if (prevline == NULL)                                          if (prevline == NULL)
152                                                  REPEAT(line[x] = mix)                                          {
153                                                    REPEAT(line[x] = mix);
154                                            }
155                                          else                                          else
156                                                  REPEAT(line[x] = prevline[x] ^ mix)                                          {
157                                                    REPEAT(line[x] =
158                                                           prevline[x] ^ mix);
159                                            }
160                                          break;                                          break;
161    
162                                  case 2: /* Fill or Mix */                                  case 2: /* Fill or Mix */
163                                          if (prevline == NULL)                                          if (prevline == NULL)
164                                              REPEAT(                                          {
165                                                     MASK_UPDATE();                                                  REPEAT(MASK_UPDATE();
166                                                           if (mask & mixmask)
167                                                     if (mask & mixmask)                                                         line[x] = mix;
168                                                          line[x] = mix;                                                         else
169                                                     else                                                         line[x] = 0;);
170                                                          line[x] = 0;                                          }
                                             )  
171                                          else                                          else
172                                              REPEAT(                                          {
173                                                     MASK_UPDATE();                                                  REPEAT(MASK_UPDATE();
174                                                           if (mask & mixmask)
175                                                     if (mask & mixmask)                                                         line[x] =
176                                                          line[x] = prevline[x] ^ mix;                                                         prevline[x] ^ mix;
177                                                     else                                                         else
178                                                          line[x] = prevline[x];                                                         line[x] =
179                                              )                                                         prevline[x];);
180                                            }
181                                          break;                                          break;
182    
183                                  case 3: /* Colour */                                  case 3: /* Colour */
184                                          REPEAT(line[x] = colour2)                                          REPEAT(line[x] = colour2);
185                                          break;                                          break;
186    
187                                  case 4: /* Copy */                                  case 4: /* Copy */
188                                          REPEAT(line[x] = CVAL(input))                                          REPEAT(line[x] = CVAL(input));
189                                          break;                                          break;
190    
191                                  case 8: /* Bicolour */                                  case 8: /* Bicolour */
192                                          REPEAT(                                          REPEAT(if (bicolour)
193                                                  if (bicolour)                                                 {
194                                                  {                                                 line[x] = colour2;
195                                                          line[x] = colour2;                                                 bicolour = False;}
196                                                          bicolour = False;                                                 else
197                                                  }                                                 {
198                                                  else                                                 line[x] = colour1;
199                                                  {                                                 bicolour = True; count++;}
200                                                          line[x] = colour1;                                          );
                                                         bicolour = True;  
                                                         count++;  
                                                 }  
                                         )  
201                                          break;                                          break;
202    
203                                  case 13: /* White */                                  case 13:        /* White */
204                                          REPEAT(line[x] = 0xff)                                          REPEAT(line[x] = 0xff);
205                                          break;                                          break;
206    
207                                  case 14: /* Black */                                  case 14:        /* Black */
208                                          REPEAT(line[x] = 0x00)                                          REPEAT(line[x] = 0x00);
209                                          break;                                          break;
210    
211                                  default:                                  default:
212                                          NOTIMP("bitmap opcode 0x%x\n", opcode);                                          NOTIMP("bitmap opcode 0x%x\n",
213                                                   opcode);
214                                          return False;                                          return False;
215                          }                          }
216                  }                  }

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

  ViewVC Help
Powered by ViewVC 1.1.26