From d78c0d66e5108f0316f3bcac2a2119aa3a680ff9 Mon Sep 17 00:00:00 2001 From: SushiTee Date: Tue, 12 Jul 2011 03:14:46 +0200 Subject: ability to name groups and layers --- src/game/mapitems.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/game/mapitems.h') diff --git a/src/game/mapitems.h b/src/game/mapitems.h index d99d6724..4daf139b 100644 --- a/src/game/mapitems.h +++ b/src/game/mapitems.h @@ -114,13 +114,15 @@ struct CMapItemGroup_v1 struct CMapItemGroup : public CMapItemGroup_v1 { - enum { CURRENT_VERSION=2 }; + enum { CURRENT_VERSION=3 }; int m_UseClipping; int m_ClipX; int m_ClipY; int m_ClipW; int m_ClipH; + + int m_aName[3]; } ; struct CMapItemLayer @@ -145,6 +147,8 @@ struct CMapItemLayerTilemap int m_Image; int m_Data; + + int m_aName[3]; } ; struct CMapItemLayerQuads @@ -155,6 +159,8 @@ struct CMapItemLayerQuads int m_NumQuads; int m_Data; int m_Image; + + int m_aName[3]; } ; struct CMapItemVersion -- cgit 1.4.1 From c2e8bf5035cbe3f41a71c454e348fc408f17a991 Mon Sep 17 00:00:00 2001 From: Choupom Date: Mon, 18 Jul 2011 10:31:57 +0200 Subject: made a constant for game layer flag --- src/game/editor/io.cpp | 6 +++--- src/game/mapitems.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/game/mapitems.h') diff --git a/src/game/editor/io.cpp b/src/game/editor/io.cpp index 9ce6d1f1..768f0fa5 100644 --- a/src/game/editor/io.cpp +++ b/src/game/editor/io.cpp @@ -295,7 +295,7 @@ int CEditorMap::Save(class IStorage *pStorage, const char *pFileName) Item.m_Width = pLayer->m_Width; Item.m_Height = pLayer->m_Height; - Item.m_Flags = pLayer->m_Game; + Item.m_Flags = pLayer->m_Game ? TILESLAYERFLAG_GAME : 0; Item.m_Image = pLayer->m_Image; Item.m_Data = df.AddData(pLayer->m_Width*pLayer->m_Height*sizeof(CTile), pLayer->m_pTiles); @@ -516,7 +516,7 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName, int Storag CMapItemLayerTilemap *pTilemapItem = (CMapItemLayerTilemap *)pLayerItem; CLayerTiles *pTiles = 0; - if(pTilemapItem->m_Flags&1) + if(pTilemapItem->m_Flags&TILESLAYERFLAG_GAME) { pTiles = new CLayerGame(pTilemapItem->m_Width, pTilemapItem->m_Height); MakeGameLayer(pTiles); @@ -537,7 +537,7 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName, int Storag pGroup->AddLayer(pTiles); void *pData = DataFile.GetData(pTilemapItem->m_Data); pTiles->m_Image = pTilemapItem->m_Image; - pTiles->m_Game = pTilemapItem->m_Flags&1; + pTiles->m_Game = pTilemapItem->m_Flags&TILESLAYERFLAG_GAME; // load layer name if(pTilemapItem->m_Version >= 3) diff --git a/src/game/mapitems.h b/src/game/mapitems.h index 4daf139b..fb66e12d 100644 --- a/src/game/mapitems.h +++ b/src/game/mapitems.h @@ -53,6 +53,7 @@ enum TILEFLAG_ROTATE=8, LAYERFLAG_DETAIL=1, + TILESLAYERFLAG_GAME=1, ENTITY_OFFSET=255-16*4, }; -- cgit 1.4.1