[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: W2K connects



> 
> I still have some problems with bitmaps which are not
> displayed correctly, because rdesktop receives
> unknown bitmap opcodes, 0x09 and 0x0A.
> 

In fact, because FillOrMix_1 and FillOrMix_2 bitmap orders
are not implemented. Here is my implementation.


-- 
Philippe MARTIN
ERIDAN Informatique
http://www.eridan-info.fr
--- rdesktop-1.0.0/bitmap.c	Sun Oct  8 03:59:25 2000
+++ rdesktop-w2k/bitmap.c	Thu Nov 30 17:26:17 2000
@@ -24,7 +24,7 @@
 #define SVAL(p)   ((*((p++) + 1) << 8) | CVAL(p))
 
 #define REPEAT(statement) { while ((count > 0) && (x < width)) { statement; count--; x++; } }
-#define MASK_UPDATE() { mixmask <<= 1; if (mixmask == 0) { mask = CVAL(input); mixmask = 1; } }
+#define MASK_UPDATE() { mixmask <<= 1; if (mixmask == 0) { mask = fom_mask ? fom_mask : CVAL(input); mixmask = 1; } }
 
 BOOL bitmap_decompress(unsigned char *output, int width, int height,
 		       unsigned char *input, int size)
@@ -35,9 +35,11 @@
 	int lastopcode = -1, insertmix = False, bicolour = False;
 	uint8 code, colour1 = 0, colour2 = 0;
 	uint8 mixmask, mask = 0, mix = 0xff;
+	int fom_mask = 0;
 
 	while (input < end)
 	{
+	        fom_mask = 0;
 		code = CVAL(input);
 		opcode = code >> 4;
 
@@ -54,7 +56,7 @@
 
 			case 0xf:
 				opcode = code & 0xf;
-				count = (opcode < 13) ? SVAL(input) : 1;
+				count = (opcode < 9) ? SVAL(input) : (opcode < 0xD) ? 8 : 1;
 				offset = 0;
 				break;
 
@@ -101,6 +103,18 @@
 			case 7: /* SetMix/FillOrMix */
 				mix = CVAL(input);
 				opcode -= 5;
+				break;
+ 		        case 9: /* FillOrMix_1 */
+		                mix = 1;
+				mask = 0x03;
+				opcode = 0x02;
+				fom_mask = 3;
+				break;
+		        case 0x0a: /* FillOrMix_2 */
+			        mix = 1;
+				mask = 0x05;
+				opcode = 0x02;
+				fom_mask = 5;
 				break;
 		}
 		lastopcode = opcode;