page.setColor(Color.white);
page.fillRect(0, 0, this.getWidth(), this.getHeight());
Vector2i tmp = new Vector2i();
int s = 1;
long t0 = System.currentTimeMillis();
HeightMap hm = null;
int cx = this.getWidth()/2;
int cy = this.getHeight()/2;
int rx = this.getWidth()/s/2;
int ry = this.getHeight()/s/2;
for (int x = -rx; x < rx; x++) {
for (int y = -ry; y < ry; y++) {
int hx = x+xshift;
int hy = y+yshift;
if (hm == null || !hm.containsPoint(hx, hy)){
hm = tmg.getHeightMapAtXY(hx, hy, tmp, null);
}
int h = tmg.getHeight(hx, hy, tmp, hm);
int wh = tmg.getWaterHeight(hx, hy, tmp);
if (wh > h){