10
|
1 public void decode(Renderer renderer, ByteBuffer header, FramebufferUpdateRectangle rect, ByteBuffer buf, int zippedLength, TreeRFBProto rfbProto) throws TransportException {
|
|
2 int offset = zippedLength;
|
|
3 int maxX = rect.x + rect.width;
|
|
4 int maxY = rect.y + rect.height;
|
|
5 byte[] bytes = buf.array();
|
|
6 WifiMulticast = rfbProto;
|
|
7
|
|
8 TileLoop tileloop = new TileLoop(rfbProto, zippedLength);
|
|
9 if (WifiMulticast) {
|
|
10 tileloop.zrleeBlocking(rfbProto, header, rect, bytes);
|
|
11 }
|
|
12 for (int tileY = rect.y; tileY < maxY; tileY += MAX_TILE_SIZE) {
|
|
13 int tileHeight = Math.min(maxY - tileY, MAX_TILE_SIZE);
|
|
14 if (tileloop.blocking) {
|
|
15 tileloop.c1rect.height += tileHeight;
|
|
16 }
|
|
17 for (int tileX = rect.x; tileX < maxX; tileX += MAX_TILE_SIZE) {
|
|
18 int tileWidth = Math.min(maxX - tileX, MAX_TILE_SIZE);
|
|
19 offset += decodePacked(bytes, offset, renderer, paletteSize, tileX, tileY, tileWidth, tileHeight);
|
|
20 if (WifiMulticast) {
|
11
|
21 tileloop.multicastPut(rfbProto, false, bytes, offset, tileWidth, tileHeight, tileX, tileY);
|
10
|
22 }
|
|
23 }
|
|
24 }
|
|
25 }
|