examples/vncviewer/rfbclient.js
function nextTile()
    {
        clog('nextTile');
        rect.emit('tile', tile);
        tile = {};
        if (rect.tilex < rect.widthTiles)
        {
            rect.tilex++;
            //clog([rect.tilex, rect.tiley]);
            return cli.readHextileTile(rect, cb);
        } else {
            clog('===================== new row! ' + rect.tiley);
            rect.tilex = 0;
            if (rect.tiley < rect.heightTiles)
            {
                rect.tiley++;
                //clog([rect.tilex, rect.tiley]);
                return cli.readHextileTile(rect, cb);
            } else {
                clog('====================')
                clog(rect);
                return cb();
            }
        }   
    }
function nextTile()
    {
        clog('nextTile');
        rect.emit('tile', tile);
        tile = {};
        if (rect.tilex < rect.widthTiles)
        {
            rect.tilex++;
            //clog([rect.tilex, rect.tiley]);
            return cli.readHextileTile(rect, cb);
        } else {
            clog('===================== new row! ' + rect.tiley);
            rect.tilex = 0;
            if (rect.tiley < rect.heightTiles)
            {
                rect.tiley++;
                //clog([rect.tilex, rect.tiley]);
                return cli.readHextileTile(rect, cb);
            } else {
                clog('====================')
                clog(rect);
                return cb();
            }
        }   
    }
function nextTile ( ) { clog ( 'nextTile' ) ; rect . emit ( 'tile' , tile ) ; tile = { } ; if ( rect . tilex < rect . widthTiles ) { rect . tilex ++ ; //clog([rect.tilex, rect.tiley]); return cli . readHextileTile ( rect , cb ) ; } else { clog ( '===================== new row! ' + rect . tiley ) ; rect . tilex = 0 ; if ( rect . tiley < rect . heightTiles ) { rect . tiley ++ ; //clog([rect.tilex, rect.tiley]); return cli . readHextileTile ( rect , cb ) ; } else { clog ( '====================' ) clog ( rect ) ; return cb ( ) ; } } }
calculate next tilex & tiley and move up 'stack' if we at the last tile
calculate next tilex & tiley and move up stack if we at the last tile