public MapEditor(string dataPath)
{
mapEditorProperties = new MapEditorProperties(this);
InitializeComponent();
mapRenderer = new MapRenderer(this.mapDisplayPicture.Handle, this.tileSetPicture.Handle, mapEditorProperties);
this.mapEditorProperties.CurrentLayer = Map.Layers.Ground;
this.dataPath = dataPath;
this.LoadMaps();
this.tileSetScrollX.Maximum = (int)mapRenderer.CurrentTileSetWidth / 32;
this.tileSetScrollY.Maximum = (int)mapRenderer.CurrentTileSetHeight / 32;
this.mapScrollY.SmallChange = 1;
this.mapScrollY.LargeChange = 1;
this.mapScrollX.SmallChange = 1;
this.mapScrollX.LargeChange = 1;
this.mapPropertyGrid.SelectedObject = mapEditorProperties;
}