2010-11-13 11:34:49 +08:00
|
|
|
/****************************************************************************
|
2011-03-19 10:59:01 +08:00
|
|
|
Copyright (c) 2009-2010 Ricardo Quesada
|
2014-01-07 11:25:07 +08:00
|
|
|
Copyright (c) 2010-2012 cocos2d-x.org
|
2011-07-04 14:11:43 +08:00
|
|
|
Copyright (c) 2011 Zynga Inc.
|
2018-01-29 16:25:32 +08:00
|
|
|
Copyright (c) 2013-2016 Chukong Technologies Inc.
|
|
|
|
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
2010-11-13 11:34:49 +08:00
|
|
|
|
2022-08-08 18:02:17 +08:00
|
|
|
https://axys1.github.io/
|
2010-11-13 11:34:49 +08:00
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
****************************************************************************/
|
2011-03-23 22:16:20 +08:00
|
|
|
|
2022-07-15 19:17:01 +08:00
|
|
|
#ifndef __AX_TM_XML_PARSER__
|
|
|
|
#define __AX_TM_XML_PARSER__
|
2011-01-15 18:05:35 +08:00
|
|
|
|
2015-03-24 20:23:51 +08:00
|
|
|
/// @cond DO_NOT_SHOW
|
|
|
|
|
2021-10-23 23:27:14 +08:00
|
|
|
#include "math/CCMath.h"
|
2014-05-17 05:36:00 +08:00
|
|
|
#include "platform/CCSAXParser.h"
|
2014-04-27 01:35:57 +08:00
|
|
|
#include "base/CCVector.h"
|
2020-08-28 16:33:52 +08:00
|
|
|
#include "base/CCMap.h"
|
2014-04-27 01:35:57 +08:00
|
|
|
#include "base/CCValue.h"
|
2021-12-25 10:04:45 +08:00
|
|
|
#include "2d/CCTMXObjectGroup.h" // needed for Vector<TMXObjectGroup*> for binding
|
2014-02-20 10:53:49 +08:00
|
|
|
|
2012-03-20 17:27:06 +08:00
|
|
|
#include <string>
|
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
NS_AX_BEGIN
|
2012-03-20 15:04:53 +08:00
|
|
|
|
2013-11-29 11:36:42 +08:00
|
|
|
class TMXLayerInfo;
|
|
|
|
class TMXTilesetInfo;
|
2012-03-20 15:04:53 +08:00
|
|
|
|
|
|
|
/** @file
|
2021-12-25 10:04:45 +08:00
|
|
|
* Internal TMX parser
|
|
|
|
*
|
|
|
|
* IMPORTANT: These classed should not be documented using doxygen strings
|
|
|
|
* since the user should not use them.
|
|
|
|
*
|
|
|
|
*/
|
2012-03-20 15:04:53 +08:00
|
|
|
|
2012-06-20 18:09:11 +08:00
|
|
|
/**
|
|
|
|
* @addtogroup tilemap_parallax_nodes
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
TMXLayerAttribNone = 1 << 0,
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXLayerAttribBase64 = 1 << 1,
|
2021-12-25 10:04:45 +08:00
|
|
|
TMXLayerAttribGzip = 1 << 2,
|
|
|
|
TMXLayerAttribZlib = 1 << 3,
|
|
|
|
TMXLayerAttribCSV = 1 << 4,
|
2012-03-20 15:04:53 +08:00
|
|
|
};
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
enum
|
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
TMXPropertyNone,
|
|
|
|
TMXPropertyMap,
|
|
|
|
TMXPropertyLayer,
|
|
|
|
TMXPropertyObjectGroup,
|
|
|
|
TMXPropertyObject,
|
2020-08-28 16:33:52 +08:00
|
|
|
TMXPropertyTile,
|
|
|
|
TMXPropertyAnimation
|
2012-03-20 15:04:53 +08:00
|
|
|
};
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
typedef enum TMXTileFlags_
|
|
|
|
{
|
|
|
|
kTMXTileHorizontalFlag = 0x80000000,
|
|
|
|
kTMXTileVerticalFlag = 0x40000000,
|
|
|
|
kTMXTileDiagonalFlag = 0x20000000,
|
|
|
|
kTMXFlipedAll = (kTMXTileHorizontalFlag | kTMXTileVerticalFlag | kTMXTileDiagonalFlag),
|
|
|
|
kTMXFlippedMask = ~(kTMXFlipedAll)
|
2014-02-08 10:11:17 +08:00
|
|
|
} TMXTileFlags;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2020-08-28 15:42:40 +08:00
|
|
|
/**
|
|
|
|
* @addtogroup _2d
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
/** Possible orientations of the TMX map. */
|
2020-08-28 15:42:40 +08:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
/** Orthogonal orientation. */
|
|
|
|
TMXOrientationOrtho,
|
|
|
|
|
|
|
|
/** Hexagonal orientation. */
|
|
|
|
TMXOrientationHex,
|
|
|
|
|
|
|
|
/** Isometric orientation. */
|
|
|
|
TMXOrientationIso,
|
|
|
|
|
|
|
|
/** Isometric staggered orientation. */
|
|
|
|
TMXOrientationStaggered,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** Possible stagger axis of the TMX map. */
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
/** Stagger Axis x. */
|
|
|
|
TMXStaggerAxis_X,
|
|
|
|
|
|
|
|
/** Stagger Axis y. */
|
|
|
|
TMXStaggerAxis_Y,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** Possible stagger index of the TMX map. */
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
/** Stagger Index: Odd */
|
|
|
|
TMXStaggerIndex_Odd,
|
|
|
|
|
|
|
|
/** Stagger Index: Even */
|
|
|
|
TMXStaggerIndex_Even,
|
|
|
|
};
|
|
|
|
|
2020-08-28 16:33:52 +08:00
|
|
|
/** @brief TMXTileAnimFrame contains the information about the frame of a animated tile like:
|
|
|
|
- Frame gid
|
|
|
|
- duration of this frame
|
|
|
|
|
|
|
|
This information is obtained from the TMX file.
|
|
|
|
*/
|
2022-07-15 19:17:01 +08:00
|
|
|
struct AX_DLL TMXTileAnimFrame
|
2020-08-28 16:33:52 +08:00
|
|
|
{
|
|
|
|
TMXTileAnimFrame(uint32_t tileID, float duration);
|
|
|
|
/** gid of the frame */
|
|
|
|
uint32_t _tileID = 0;
|
|
|
|
/** duration of the frame */
|
|
|
|
float _duration = 0.0f;
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @brief TMXTileAnimInfo contains the information about the animated tile like:
|
|
|
|
- Animated Tile gid
|
|
|
|
- frames the animated tile contains
|
|
|
|
|
|
|
|
This information is obtained from the TMX file.
|
|
|
|
*/
|
2022-07-15 19:17:01 +08:00
|
|
|
struct AX_DLL TMXTileAnimInfo : public Ref
|
2020-08-28 16:33:52 +08:00
|
|
|
{
|
2021-12-25 10:04:45 +08:00
|
|
|
static TMXTileAnimInfo* create(uint32_t tileID);
|
|
|
|
explicit TMXTileAnimInfo(uint32_t tileID);
|
2020-08-28 16:33:52 +08:00
|
|
|
uint32_t _tileID = 0;
|
|
|
|
std::vector<TMXTileAnimFrame> _frames;
|
|
|
|
};
|
|
|
|
|
2012-03-20 15:04:53 +08:00
|
|
|
// Bits on the far end of the 32-bit global tile ID (GID's) are used for tile flags
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
/** @brief TMXLayerInfo contains the information about the layers like:
|
2012-03-20 15:04:53 +08:00
|
|
|
- Layer name
|
|
|
|
- Layer size
|
|
|
|
- Layer opacity at creation time (it can be modified at runtime)
|
|
|
|
- Whether the layer is visible (if it's not visible, then the CocosNode won't be created)
|
|
|
|
|
|
|
|
This information is obtained from the TMX file.
|
|
|
|
*/
|
2022-07-15 19:17:01 +08:00
|
|
|
class AX_DLL TMXLayerInfo : public Ref
|
2012-03-20 15:04:53 +08:00
|
|
|
{
|
|
|
|
public:
|
2013-09-13 16:46:31 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
2013-07-20 04:16:38 +08:00
|
|
|
TMXLayerInfo();
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-07-20 04:16:38 +08:00
|
|
|
virtual ~TMXLayerInfo();
|
|
|
|
|
2013-12-04 17:46:57 +08:00
|
|
|
void setProperties(ValueMap properties);
|
2014-01-05 18:20:29 +08:00
|
|
|
ValueMap& getProperties();
|
2013-07-20 04:16:38 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
ValueMap _properties;
|
|
|
|
std::string _name;
|
|
|
|
Vec2 _layerSize;
|
|
|
|
uint32_t* _tiles;
|
|
|
|
bool _visible;
|
|
|
|
unsigned char _opacity;
|
|
|
|
bool _ownTiles;
|
|
|
|
Vec2 _offset;
|
2012-03-20 15:04:53 +08:00
|
|
|
};
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
/** @brief TMXTilesetInfo contains the information about the tilesets like:
|
2012-03-20 15:04:53 +08:00
|
|
|
- Tileset name
|
2012-09-17 15:02:24 +08:00
|
|
|
- Tileset spacing
|
2012-03-20 15:04:53 +08:00
|
|
|
- Tileset margin
|
|
|
|
- size of the tiles
|
|
|
|
- Image used for the tiles
|
|
|
|
- Image size
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
This information is obtained from the TMX file.
|
2012-03-20 15:04:53 +08:00
|
|
|
*/
|
2022-07-15 19:17:01 +08:00
|
|
|
class AX_DLL TMXTilesetInfo : public Ref
|
2012-03-20 15:04:53 +08:00
|
|
|
{
|
|
|
|
public:
|
2021-12-25 10:04:45 +08:00
|
|
|
std::string _name;
|
|
|
|
int _firstGid;
|
|
|
|
Vec2 _tileSize;
|
|
|
|
int _spacing;
|
|
|
|
int _margin;
|
|
|
|
Vec2 _tileOffset;
|
2012-04-19 14:35:52 +08:00
|
|
|
//! filename containing the tiles (should be spritesheet / texture atlas)
|
2021-12-25 10:04:45 +08:00
|
|
|
std::string _sourceImage;
|
2012-04-19 14:35:52 +08:00
|
|
|
//! size in pixels of the image
|
2021-12-25 10:04:45 +08:00
|
|
|
Vec2 _imageSize;
|
|
|
|
std::string _originSourceImage;
|
2020-08-28 16:33:52 +08:00
|
|
|
//! map from gid of animated tile to its animation info
|
|
|
|
Map<uint32_t, TMXTileAnimInfo*> _animationInfo;
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2012-03-20 15:04:53 +08:00
|
|
|
public:
|
2013-09-13 16:46:31 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
TMXTilesetInfo();
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
virtual ~TMXTilesetInfo();
|
2014-02-08 10:33:30 +08:00
|
|
|
Rect getRectForGID(uint32_t gid);
|
2012-03-20 15:04:53 +08:00
|
|
|
};
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
/** @brief TMXMapInfo contains the information about the map like:
|
2012-03-20 15:04:53 +08:00
|
|
|
- Map orientation (hexagonal, isometric or orthogonal)
|
|
|
|
- Tile size
|
|
|
|
- Map size
|
|
|
|
|
|
|
|
And it also contains:
|
|
|
|
- Layers (an array of TMXLayerInfo objects)
|
|
|
|
- Tilesets (an array of TMXTilesetInfo objects)
|
|
|
|
- ObjectGroups (an array of TMXObjectGroupInfo objects)
|
|
|
|
|
|
|
|
This information is obtained from the TMX file.
|
|
|
|
|
|
|
|
*/
|
2022-07-15 19:17:01 +08:00
|
|
|
class AX_DLL TMXMapInfo : public Ref, public SAXDelegator
|
2021-12-25 10:04:45 +08:00
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
/** creates a TMX Format with a tmx file */
|
2021-12-26 23:26:34 +08:00
|
|
|
static TMXMapInfo* create(std::string_view tmxFile);
|
2012-04-19 14:35:52 +08:00
|
|
|
/** creates a TMX Format with an XML string and a TMX resource path */
|
2021-12-26 23:26:34 +08:00
|
|
|
static TMXMapInfo* createWithXML(std::string_view tmxString, std::string_view resourcePath);
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2013-09-13 16:46:31 +08:00
|
|
|
/**
|
|
|
|
* @js ctor
|
|
|
|
*/
|
2013-07-23 18:26:26 +08:00
|
|
|
TMXMapInfo();
|
2013-09-13 13:52:42 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2013-07-23 18:26:26 +08:00
|
|
|
virtual ~TMXMapInfo();
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2012-09-17 15:02:24 +08:00
|
|
|
/** initializes a TMX format with a tmx file */
|
2021-12-26 23:26:34 +08:00
|
|
|
bool initWithTMXFile(std::string_view tmxFile);
|
2012-04-19 14:35:52 +08:00
|
|
|
/** initializes a TMX format with an XML string and a TMX resource path */
|
2021-12-26 23:26:34 +08:00
|
|
|
bool initWithXML(std::string_view tmxString, std::string_view resourcePath);
|
2012-09-17 15:02:24 +08:00
|
|
|
/** initializes parsing of an XML file, either a tmx (Map) file or tsx (Tileset) file */
|
2021-12-26 23:26:34 +08:00
|
|
|
bool parseXMLFile(std::string_view xmlFilename);
|
2012-09-17 15:02:24 +08:00
|
|
|
/* initializes parsing of an XML string, either a tmx (Map) string or tsx (Tileset) string */
|
2021-12-26 23:26:34 +08:00
|
|
|
bool parseXMLString(std::string_view xmlString);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-12-26 22:07:20 +08:00
|
|
|
ValueMapIntKey& getTileProperties() { return _tileProperties; };
|
2021-12-25 10:04:45 +08:00
|
|
|
void setTileProperties(const ValueMapIntKey& tileProperties) { _tileProperties = tileProperties; }
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-07-23 18:26:26 +08:00
|
|
|
/// map orientation
|
2016-09-12 09:44:21 +08:00
|
|
|
int getOrientation() const { return _orientation; }
|
|
|
|
void setOrientation(int orientation) { _orientation = orientation; }
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2016-07-02 06:51:00 +08:00
|
|
|
/// map staggeraxis
|
2016-09-12 09:44:21 +08:00
|
|
|
int getStaggerAxis() const { return _staggerAxis; }
|
|
|
|
void setStaggerAxis(int staggerAxis) { _staggerAxis = staggerAxis; }
|
2016-07-02 06:51:00 +08:00
|
|
|
|
|
|
|
/// map stagger index
|
2016-09-12 09:44:21 +08:00
|
|
|
int getStaggerIndex() const { return _staggerIndex; }
|
|
|
|
void setStaggerIndex(int staggerIndex) { _staggerIndex = staggerIndex; }
|
2016-07-02 06:51:00 +08:00
|
|
|
|
|
|
|
/// map hexsidelength
|
2016-09-12 09:44:21 +08:00
|
|
|
int getHexSideLength() const { return _hexSideLength; }
|
|
|
|
void setHexSideLength(int hexSideLength) { _hexSideLength = hexSideLength; }
|
2013-07-23 18:26:26 +08:00
|
|
|
|
|
|
|
/// map width & height
|
2021-10-23 23:27:14 +08:00
|
|
|
const Vec2& getMapSize() const { return _mapSize; }
|
|
|
|
void setMapSize(const Vec2& mapSize) { _mapSize = mapSize; }
|
2013-07-23 18:26:26 +08:00
|
|
|
|
|
|
|
/// tiles width & height
|
2021-10-23 23:27:14 +08:00
|
|
|
const Vec2& getTileSize() const { return _tileSize; }
|
|
|
|
void setTileSize(const Vec2& tileSize) { _tileSize = tileSize; }
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2013-07-23 18:26:26 +08:00
|
|
|
/// Layers
|
2016-09-12 09:44:21 +08:00
|
|
|
const Vector<TMXLayerInfo*>& getLayers() const { return _layers; }
|
|
|
|
Vector<TMXLayerInfo*>& getLayers() { return _layers; }
|
2021-12-25 10:04:45 +08:00
|
|
|
void setLayers(const Vector<TMXLayerInfo*>& layers) { _layers = layers; }
|
2013-07-23 18:26:26 +08:00
|
|
|
|
|
|
|
/// tilesets
|
2016-09-12 09:44:21 +08:00
|
|
|
const Vector<TMXTilesetInfo*>& getTilesets() const { return _tilesets; }
|
|
|
|
Vector<TMXTilesetInfo*>& getTilesets() { return _tilesets; }
|
2021-12-25 10:04:45 +08:00
|
|
|
void setTilesets(const Vector<TMXTilesetInfo*>& tilesets) { _tilesets = tilesets; }
|
2013-07-23 18:26:26 +08:00
|
|
|
|
|
|
|
/// ObjectGroups
|
2016-09-12 09:44:21 +08:00
|
|
|
const Vector<TMXObjectGroup*>& getObjectGroups() const { return _objectGroups; }
|
|
|
|
Vector<TMXObjectGroup*>& getObjectGroups() { return _objectGroups; }
|
2021-12-25 10:04:45 +08:00
|
|
|
void setObjectGroups(const Vector<TMXObjectGroup*>& groups) { _objectGroups = groups; }
|
2013-07-23 18:26:26 +08:00
|
|
|
|
|
|
|
/// parent element
|
2016-09-12 09:44:21 +08:00
|
|
|
int getParentElement() const { return _parentElement; }
|
|
|
|
void setParentElement(int element) { _parentElement = element; }
|
2013-07-23 18:26:26 +08:00
|
|
|
|
|
|
|
/// parent GID
|
2016-09-12 09:44:21 +08:00
|
|
|
int getParentGID() const { return _parentGID; }
|
|
|
|
void setParentGID(int gid) { _parentGID = gid; }
|
2013-07-23 18:26:26 +08:00
|
|
|
|
|
|
|
/// layer attribs
|
2016-09-12 09:44:21 +08:00
|
|
|
int getLayerAttribs() const { return _layerAttribs; }
|
|
|
|
void setLayerAttribs(int layerAttribs) { _layerAttribs = layerAttribs; }
|
2013-07-23 18:26:26 +08:00
|
|
|
|
|
|
|
/// is storing characters?
|
2016-09-12 09:44:21 +08:00
|
|
|
bool isStoringCharacters() const { return _storingCharacters; }
|
|
|
|
void setStoringCharacters(bool storingCharacters) { _storingCharacters = storingCharacters; }
|
2013-07-23 18:26:26 +08:00
|
|
|
|
|
|
|
/// properties
|
2016-09-12 09:44:21 +08:00
|
|
|
const ValueMap& getProperties() const { return _properties; }
|
|
|
|
ValueMap& getProperties() { return _properties; }
|
2021-12-25 10:04:45 +08:00
|
|
|
void setProperties(const ValueMap& properties) { _properties = properties; }
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
// implement pure virtual methods of SAXDelegator
|
2013-09-13 11:41:20 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
void startElement(void* ctx, const char* name, const char** atts) override;
|
2013-09-13 11:41:20 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
void endElement(void* ctx, const char* name) override;
|
2013-09-13 11:41:20 +08:00
|
|
|
/**
|
|
|
|
* @js NA
|
|
|
|
* @lua NA
|
|
|
|
*/
|
2021-12-25 10:04:45 +08:00
|
|
|
void textHandler(void* ctx, const char* ch, size_t len) override;
|
|
|
|
|
2021-12-26 23:26:34 +08:00
|
|
|
std::string_view getCurrentString() const { return _currentString; }
|
|
|
|
void setCurrentString(std::string_view currentString) { _currentString = currentString; }
|
|
|
|
std::string_view getTMXFileName() const { return _TMXFileName; }
|
|
|
|
void setTMXFileName(std::string_view fileName) { _TMXFileName = fileName; }
|
|
|
|
std::string_view getExternalTilesetFileName() const { return _externalTilesetFilename; }
|
2013-11-07 09:05:13 +08:00
|
|
|
|
2012-03-20 15:04:53 +08:00
|
|
|
protected:
|
2021-12-26 23:26:34 +08:00
|
|
|
void internalInit(std::string_view tmxFileName, std::string_view resourcePath);
|
2013-07-23 18:26:26 +08:00
|
|
|
|
|
|
|
/// map orientation
|
2021-12-25 10:04:45 +08:00
|
|
|
int _orientation;
|
|
|
|
/// map staggerAxis
|
|
|
|
int _staggerAxis;
|
|
|
|
/// map staggerIndex
|
|
|
|
int _staggerIndex;
|
|
|
|
/// map hexsidelength
|
|
|
|
int _hexSideLength;
|
2013-07-23 18:26:26 +08:00
|
|
|
/// map width & height
|
2021-10-23 23:27:14 +08:00
|
|
|
Vec2 _mapSize;
|
2013-07-23 18:26:26 +08:00
|
|
|
/// tiles width & height
|
2021-10-23 23:27:14 +08:00
|
|
|
Vec2 _tileSize;
|
2013-07-23 18:26:26 +08:00
|
|
|
/// Layers
|
2013-11-29 11:36:42 +08:00
|
|
|
Vector<TMXLayerInfo*> _layers;
|
2013-07-23 18:26:26 +08:00
|
|
|
/// tilesets
|
2013-11-29 11:36:42 +08:00
|
|
|
Vector<TMXTilesetInfo*> _tilesets;
|
2013-07-23 18:26:26 +08:00
|
|
|
/// ObjectGroups
|
2013-11-29 11:36:42 +08:00
|
|
|
Vector<TMXObjectGroup*> _objectGroups;
|
2013-07-23 18:26:26 +08:00
|
|
|
/// parent element
|
|
|
|
int _parentElement;
|
|
|
|
/// parent GID
|
2013-12-20 09:50:53 +08:00
|
|
|
int _parentGID;
|
2013-07-23 18:26:26 +08:00
|
|
|
/// layer attribs
|
|
|
|
int _layerAttribs;
|
|
|
|
/// is storing characters?
|
|
|
|
bool _storingCharacters;
|
|
|
|
/// properties
|
2013-12-04 17:46:57 +08:00
|
|
|
ValueMap _properties;
|
2014-02-19 10:41:12 +08:00
|
|
|
//! xml format tile index
|
|
|
|
int _xmlTileIndex;
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
//! tmx filename
|
2013-06-15 14:03:30 +08:00
|
|
|
std::string _TMXFileName;
|
2012-04-19 14:35:52 +08:00
|
|
|
// tmx resource path
|
2013-06-15 14:03:30 +08:00
|
|
|
std::string _resources;
|
2012-04-19 14:35:52 +08:00
|
|
|
//! current string
|
2013-06-15 14:03:30 +08:00
|
|
|
std::string _currentString;
|
2012-04-19 14:35:52 +08:00
|
|
|
//! tile properties
|
2013-12-26 22:07:20 +08:00
|
|
|
ValueMapIntKey _tileProperties;
|
2013-12-20 09:50:53 +08:00
|
|
|
int _currentFirstGID;
|
2013-12-23 10:37:46 +08:00
|
|
|
bool _recordFirstGID;
|
2015-11-12 09:49:49 +08:00
|
|
|
std::string _externalTilesetFilename;
|
2012-03-20 15:04:53 +08:00
|
|
|
};
|
|
|
|
|
2012-06-20 18:09:11 +08:00
|
|
|
// end of tilemap_parallax_nodes group
|
|
|
|
/// @}
|
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
NS_AX_END
|
2010-11-13 11:34:49 +08:00
|
|
|
|
2015-03-24 20:23:51 +08:00
|
|
|
/// @endcond
|
2011-03-23 22:16:20 +08:00
|
|
|
#endif
|