public static void drawPortal(
		QTRenderNode n, float nodeSize, float ncx, float ncy, float distance,
		Display disp, float scx, float scy, float scale
	) throws ResourceNotFound {
		// clip to actual region on screen being drawn at
		
		float dscale = scale/distance; // Scale, taking distance into account
		
		float screenNodeSize = nodeSize*dscale;
		float screenX = scx + (ncx-nodeSize/2)*dscale;
		float screenY = scy + (ncy-nodeSize/2)*dscale;
		
		if( !disp.hitClip(screenX, screenY, screenNodeSize, screenNodeSize) ) return;
		
		disp.saveClip();
		disp.clip( screenX, screenY, screenNodeSize, screenNodeSize );
		
		if( n.background != null ) {
			drawPortal(
				n.background, n.backgroundSize, ncx+n.backgroundCenterX, ncy+n.backgroundCenterY, distance+n.backgroundDistance,
				disp, scx, scy, scale
			);
		}
		for( ImageHandle ih : n.tileImages ) {
			disp.draw(ih, screenX, screenY, screenNodeSize, screenNodeSize);
		}
		float halfSize = nodeSize/2f;
		float quarterSize = halfSize/2;
		if( n.n0 != null ) drawPortal( n.n0, halfSize, ncx-quarterSize, ncy-quarterSize, distance, disp, scx, scy, scale);
		if( n.n1 != null ) drawPortal( n.n1, halfSize, ncx+quarterSize, ncy-quarterSize, distance, disp, scx, scy, scale);
		if( n.n2 != null ) drawPortal( n.n2, halfSize, ncx-quarterSize, ncy+quarterSize, distance, disp, scx, scy, scale);
		if( n.n3 != null ) drawPortal( n.n3, halfSize, ncx+quarterSize, ncy+quarterSize, distance, disp, scx, scy, scale);
		for( int si=0; si<n.sprites.length; ++si ) {
			Sprite s = n.sprites[si];
			float sdscale = scale/(distance-s.z);
			disp.draw(s.image, scx + (ncx+s.x)*sdscale, scy + (ncy+s.y)*sdscale, s.w*sdscale, s.h*sdscale);
		}
		disp.restoreClip();
	}