diff src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java @ 498:8d95d64c33bf

add multicastPut
author oshiro
date Fri, 15 Feb 2019 20:11:47 +0900
parents 0f9b3de45fb2
children 5455c62a3775
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java	Tue Feb 12 16:55:23 2019 +0900
+++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java	Fri Feb 15 20:11:47 2019 +0900
@@ -27,6 +27,7 @@
 import com.glavsoft.drawing.Renderer;
 import com.glavsoft.exceptions.TransportException;
 import com.glavsoft.transport.Reader;
+import jp.ac.u_ryukyu.treevnc.TreeRFBProto;
 
 public class ZRLEDecoder extends ZlibDecoder {
 	private static final int MAX_TILE_SIZE = 64;
@@ -40,14 +41,16 @@
 		if (0 == zippedLength) return;
 		int length = rect.width * rect.height * renderer.getBytesPerPixel();
 		byte[] bytes = unzip(reader, zippedLength, length, rect.getEncodingType());
-		decode1(renderer, rect, bytes, zippedLength);
+		decode1(renderer, rect, bytes, zippedLength, null);
     }
     
 	public void decode1(Renderer renderer,
-			FramebufferUpdateRectangle rect, byte[] bytes, int zippedLength) throws TransportException {
+						FramebufferUpdateRectangle rect, byte[] bytes, int zippedLength, TreeRFBProto rfbProto) throws TransportException {
 		int offset = zippedLength;
 		int maxX = rect.x + rect.width;
 		int maxY = rect.y + rect.height;
+		int prevoffset = offset;
+		System.out.println("decode1: "+rect);
         if (null == palette) {
             palette = new int [128];
         }
@@ -86,6 +89,8 @@
 					}
 				}
 			}
+			rfbProto.multicastPut(byte, prevoffset, offset);
+			prevoffset = offset;
 		}
 	}