issue 67, modify constructor

This commit is contained in:
Walzer 2010-08-31 10:11:31 +00:00
parent 300e89d8fc
commit ff3d907846
7 changed files with 44 additions and 14 deletions

View File

@ -100,7 +100,7 @@ namespace cocos2d {
// size in pixels of the image
CGSize m_tImageSize;
public:
CCTMXTilesetInfo(){}
CCTMXTilesetInfo();
virtual ~CCTMXTilesetInfo();
CGRect rectForGID(unsigned int gid);
};
@ -146,7 +146,7 @@ namespace cocos2d {
// properties
CCX_SYNTHESIZE(StringToStringDictionary*, m_pProperties, Properties);
public:
CCTMXMapInfo(){}
CCTMXMapInfo();
virtual ~CCTMXMapInfo();
/** creates a TMX Format with a tmx file */
static CCTMXMapInfo * formatWithTMXFile(const char *tmxFile);

View File

@ -51,7 +51,7 @@ namespace cocos2d {
/** TileMap info */
CCX_PROPERTY(tImageTGA*, m_pTGAInfo, TGAInfo);
public:
CCTileMapAtlas(){}
CCTileMapAtlas();
virtual ~CCTileMapAtlas();
/** creates a CCTileMap with a tile file (atlas) with a map file and the width and height of each tile.
The tile file will be loaded using the TextureMgr.

View File

@ -101,6 +101,9 @@ namespace cocos2d {
,m_pProperties(NULL)
,m_pReusedTile(NULL)
,m_pAtlasIndexArray(NULL)
,m_tLayerSize(CGSizeZero)
,m_tMapTileSize(CGSizeZero)
,m_sLayerName("")
{}
CCTMXLayer::~CCTMXLayer()
{
@ -152,7 +155,7 @@ namespace cocos2d {
// - difficult to scale / rotate / etc.
m_pobTextureAtlas->getTexture()->setAliasTexParameters();
// CFByteOrder o = CFByteOrderGetCurrent();
//CFByteOrder o = CFByteOrderGetCurrent();
// Parse cocos2d properties
this->parseInternalProperties();

View File

@ -38,9 +38,9 @@ namespace cocos2d {
//implementation CCTMXObjectGroup
CCTMXObjectGroup::CCTMXObjectGroup()
:m_sGroupName("")
,m_tPositionOffset(CGPointZero)
{
m_sGroupName = "";
m_tPositionOffset = CGPointZero;
m_pObjects = new std::vector<StringToStringDictionary*>();
m_pProperties = new StringToStringDictionary();
}

View File

@ -86,8 +86,12 @@ namespace cocos2d{
return true;
}
CCTMXTiledMap::CCTMXTiledMap()
:m_tTileSize(CGSizeZero)
,m_tMapSize(CGSizeZero)
,m_pObjectGroups(NULL)
,m_pProperties(NULL)
,m_pTileProperties(NULL)
{
}
CCTMXTiledMap::~CCTMXTiledMap()
{

View File

@ -40,13 +40,13 @@ namespace cocos2d {
// implementation CCTMXLayerInfo
CCTMXLayerInfo::CCTMXLayerInfo()
:m_bOwnTiles(true)
,m_uMinGID(100000)
,m_uMaxGID(0)
,m_sName("")
,m_pTiles(NULL)
,m_tOffset(CGPointZero)
{
m_bOwnTiles = true;
m_uMinGID = 100000;
m_uMaxGID = 0;
m_sName = "";
m_pTiles = NULL;
m_tOffset = CGPointZero;
m_pProperties= new StringToStringDictionary();;
}
CCTMXLayerInfo::~CCTMXLayerInfo()
@ -65,6 +65,14 @@ namespace cocos2d {
}
// implementation CCTMXTilesetInfo
CCTMXTilesetInfo::CCTMXTilesetInfo()
:m_uFirstGid(0)
,m_tTileSize(CGSizeZero)
,m_uSpacing(0)
,m_uMargin(0)
,m_tImageSize(CGSizeZero)
{
}
CCTMXTilesetInfo::~CCTMXTilesetInfo()
{
CCLOGINFO("cocos2d: deallocing.");
@ -111,6 +119,15 @@ namespace cocos2d {
return parseXMLFile(m_sFilename.c_str());
}
CCTMXMapInfo::CCTMXMapInfo()
:m_bStoringCharacters(false)
,m_nLayerAttribs(0)
,m_tMapSize(CGSizeZero)
,m_tTileSize(CGSizeZero)
,m_pLayers(NULL)
,m_pTilesets(NULL)
{
}
CCTMXMapInfo::~CCTMXMapInfo()
{
CCLOGINFO("cocos2d: deallocing.");

View File

@ -55,6 +55,12 @@ namespace cocos2d {
}
return false;
}
CCTileMapAtlas::CCTileMapAtlas()
:m_pPosToAtlasIndex(NULL)
,m_pTGAInfo(NULL)
,m_nItemsToRender(0)
{
}
CCTileMapAtlas::~CCTileMapAtlas()
{
if (m_pTGAInfo)