public void renderSprites(int xScroll, int yScroll, Screen screen) {
        screen.setOffset(xScroll, yScroll);
        
        int x0 = xScroll >> 4;
        int x1 = (xScroll + screen.width + 16) >> 4;
        int y0 = yScroll >> 4;
        int y1 = (yScroll + screen.height + 16) >> 4;

        for (int y = y0; y < y1; y++){
            for (int x = x0; x < x1; x++){
                if (x < 0 || y < 0 || x >= width || y >= height) 
                    continue;
                rowSprites.addAll(entitiesInTiles[x + y * this.width]);
            }
            if (rowSprites.size() > 0) {
                sortAndRender(screen, rowSprites);
            }
            
            rowSprites.clear(); //wtf?
        }
        screen.setOffset(0, 0);
    }