本文整理汇总了C++中TMXObjectGroup::release方法的典型用法代码示例。如果您正苦于以下问题:C++ TMXObjectGroup::release方法的具体用法?C++ TMXObjectGroup::release怎么用?C++ TMXObjectGroup::release使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TMXObjectGroup
的用法示例。
在下文中一共展示了TMXObjectGroup::release方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: startElement
//.........这里部分代码省略.........
_recordFirstGID = false;
tmxMapInfo->parseXMLFile(externalTilesetFilename);
}
else
{
TMXTilesetInfo *tileset = new (std::nothrow) TMXTilesetInfo();
tileset->_name = attributeDict["name"].asString();
if (_recordFirstGID)
{
// unset before, so this is tmx file.
tileset->_firstGid = attributeDict["firstgid"].asInt();
if (tileset->_firstGid < 0)
{
tileset->_firstGid = 0;
}
}
else
{
tileset->_firstGid = _currentFirstGID;
_currentFirstGID = 0;
}
tileset->_spacing = attributeDict["spacing"].asInt();
tileset->_margin = attributeDict["margin"].asInt();
Size s;
s.width = attributeDict["tilewidth"].asFloat();
s.height = attributeDict["tileheight"].asFloat();
tileset->_tileSize = s;
tmxMapInfo->getTilesets().pushBack(tileset);
tileset->release();
}
}
else if (elementName == "tile")
{
if (tmxMapInfo->getParentElement() == TMXPropertyLayer)
{
TMXLayerInfo* layer = tmxMapInfo->getLayers().back();
Size layerSize = layer->_layerSize;
uint32_t gid = static_cast<uint32_t>(attributeDict["gid"].asInt());
int tilesAmount = layerSize.width*layerSize.height;
if (_xmlTileIndex < tilesAmount)
{
layer->_tiles[_xmlTileIndex++] = gid;
}
}
else
{
TMXTilesetInfo* info = tmxMapInfo->getTilesets().back();
tmxMapInfo->setParentGID(info->_firstGid + attributeDict["id"].asInt());
tmxMapInfo->getTileProperties()[tmxMapInfo->getParentGID()] = Value(ValueMap());
tmxMapInfo->setParentElement(TMXPropertyTile);
}
}
else if (elementName == "layer")
{
TMXLayerInfo *layer = new (std::nothrow) TMXLayerInfo();
layer->_name = attributeDict["name"].asString();
Size s;
s.width = attributeDict["width"].asFloat();
s.height = attributeDict["height"].asFloat();