Example #1
0
	void TerrainLayerDlg::_notifyAddLayer(Event * _sender)
	{
		if (mLayerInfoDlg->GetLayer()) // is edit
			return ;

		Terrain * tn = Environment::Instance()->GetTerrain();

		Terrain::Layer layer;

		layer.detail = mLayerInfoDlg->GetDiffuseMap();
		layer.normal = mLayerInfoDlg->GetNormalMap();
		layer.specular = mLayerInfoDlg->GetSpecularMap();
		layer.scale = mLayerInfoDlg->GetUVScale();
		layer.material = -1;

		int id = tn->AddLayer(layer);

		mLayerList->insertItemAt(mLayerList->getItemCount(), layer.detail.c_str());

		mLayerIds.PushBack(id);
	}