about summary refs log tree commit diff
path: root/src/game/editor/ed_io.cpp
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2010-10-16 18:50:05 +0200
committeroy <Tom_Adams@web.de>2010-10-16 18:50:05 +0200
commit0edad8e6407ea4768a7bfd14c7b7c27d2459b384 (patch)
treee2706ff2e12a039e0d4c1365e354aec6669f4d8f /src/game/editor/ed_io.cpp
parent85fd27284621d335dd76ee66da7349b19004adc1 (diff)
downloadzcatch-0edad8e6407ea4768a7bfd14c7b7c27d2459b384.tar.gz
zcatch-0edad8e6407ea4768a7bfd14c7b7c27d2459b384.zip
made it possible to specify which layers/groups should be saved within the map
Diffstat (limited to 'src/game/editor/ed_io.cpp')
-rw-r--r--src/game/editor/ed_io.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/game/editor/ed_io.cpp b/src/game/editor/ed_io.cpp
index 1d77a7de..6684a4a9 100644
--- a/src/game/editor/ed_io.cpp
+++ b/src/game/editor/ed_io.cpp
@@ -240,10 +240,13 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName)
 	}
 	
 	// save layers
-	int LayerCount = 0;
+	int LayerCount = 0, GroupCount = 0;
 	for(int g = 0; g < m_lGroups.size(); g++)
 	{
 		CLayerGroup *pGroup = m_lGroups[g];
+		if(!pGroup->m_SaveToMap)
+			continue;
+
 		CMapItemGroup GItem;
 		GItem.m_Version = CMapItemGroup::CURRENT_VERSION;
 		
@@ -261,6 +264,9 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName)
 		
 		for(int l = 0; l < pGroup->m_lLayers.size(); l++)
 		{
+			if(!pGroup->m_lLayers[l]->m_SaveToMap)
+				continue;
+
 			if(pGroup->m_lLayers[l]->m_Type == LAYERTYPE_TILES)
 			{
 				m_pEditor->Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "editor", "saving tiles layer");
@@ -316,7 +322,7 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName)
 			}
 		}
 		
-		df.AddItem(MAPITEMTYPE_GROUP, g, sizeof(GItem), &GItem);
+		df.AddItem(MAPITEMTYPE_GROUP, GroupCount++, sizeof(GItem), &GItem);
 	}
 	
 	// save envelopes