public void update()
	{
		if (!blnLoaded)
		{
			return;
		}
		int x,
			y,
			i,
			i2;

		x=0;
		y=0;
		for (i=0; i<=numMapImages; i++)
		{
			gD_p.drawImage(imgMapPalette,
							x*intImageSizePalette,y*intImageSizePalette,
							(x+1)*intImageSizePalette,(y+1)*intImageSizePalette,
							i*intImageSizePalette,0,
							(i+1)*intImageSizePalette,intImageSizePalette,
							null);
			x++;
			if (x > 24)
			{
				y++;
				x = 0;
			}
		}
		gD_p.setColor(Color.green);
		gD_p.drawRoundRect((int)(pfX*intImageSizePalette),(int)(pfY*intImageSizePalette),
					intImageSizePalette-1,intImageSizePalette-1,intImageSizePalette/3,intImageSizePalette/3);
		gD_f.drawImage(imgOriginalMap,
							0,0,
							intImageOriginalSize,intImageOriginalSize,
							ForeGroundTile*intImageOriginalSize,0,
							(ForeGroundTile+1)*intImageOriginalSize,intImageOriginalSize,
							null);

		int sx = frame.scrollHorz.getValue();
		int sy = frame.scrollVert.getValue();
		int sx1 = sx + frame.scrollHorz.getVisibleAmount();
		int sy1 = sy + frame.scrollVert.getVisibleAmount();

		if ((sx1+sx) >= MapColumns)
		{
			sx1 = MapColumns - sx - 1;
		}
		if ((sy1+sy) >= MapRows)
		{
			sy1 = MapRows - sy - 1;
		}

		for (i=0;i<=sx1;i++)
		{
			for (i2=0;i2<=sy1;i2++)
			{
				//Draw map(background)
				drawTile(imgMap,i,i2,shrMap[i+sx][i2+sy]);
			}
		}
		if (blnActiveSelection)
		{
			Color highlight = new Color(255,255,255,128);
			gD.setColor(highlight);
			int rx,
				ry,
				startX,
				startY,
				stopX,
				stopY,
				width,
				height;
			startX = min(selectStartX,selectStopX);
			stopX = max(selectStartX,selectStopX);
			startY = min(selectStartY,selectStopY);
			stopY = max(selectStartY,selectStopY);
			rx = (startX-sx)*intImageSize;
			width = ((stopX-sx+1)*intImageSize) - rx;
			ry = (startY-sy)*intImageSize;
			height = ((stopY-sy+1)*intImageSize) - ry;
			gD.fillRect(rx,ry,width,height);
		}
	}