private void btnOK_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            var tileSets = gameRef.level.TileSets;

            gameRef.level = new TileMap((int)numWidth.Value, (int)numHeight.Value);

            if (cboGeneration.SelectedIndex != 0)
            {
                foreach (TileSet s in tileSets)
                {
                    gameRef.level.AddTileSet(s);
                }
            }
            else
            {
                gameRef.level.AddTileSet(new TileSet(@"TileSheets\dirt.png", Engine.TileWidth, Engine.TileHeight));
            }

            var layer1 = new MapLayer(gameRef.level);
            var layer2 = new MapLayer(gameRef.level);
            var layer3 = new MapLayer(gameRef.level);

            switch (cboGeneration.SelectedIndex)
            {
            case 1:
                // TODO: Generate level with dungeon algorithm
                for (int x = 0; x < layer1.WidthInTiles; x++)
                {
                    for (int y = 0; y < layer1.HeightInTiles; y++)
                    {
                        layer1.SetTile(x, y, new Tile(groundTile_Layer1, selectedTileSet_Layer1));
                    }
                }


                layer2 = MapLayer.GenerateFromAlgorithm(MapLayer.GenerationAlgorithm.Dungeon_DrunkenWalk,
                                                        gameRef.level, selectedTileSet_Layer2, wallTile: wallTile_Layer2);

                break;

            case 2:
                // TODO: Generate level with perlin algorithm
                break;
            }

            gameRef.level.AddLayer(layer1);
            gameRef.level.AddLayer(layer2);
            gameRef.level.AddLayer(layer3);

            Camera.MaxClamp = new Vector2(gameRef.level.WidthInPixels - Canvas.CANVAS_WIDTH,
                                          gameRef.level.HeightInPixels - Canvas.CANVAS_HEIGHT);

            this.Close();
        }