#include <CCDataReaderHelper.h>
Public Member Functions | |
DataReaderHelper () | |
~DataReaderHelper () | |
void | addDataFromFile (const std::string &filePath) |
void | addDataFromFileAsync (const std::string &imagePath, const std::string &plistPath, const std::string &filePath, cocos2d::Ref *target, cocos2d::SEL_SCHEDULE selector) |
void | addDataAsyncCallBack (float dt) |
void | removeConfigFile (const std::string &configFile) |
Static Public Member Functions | |
static CC_DEPRECATED_ATTRIBUTE DataReaderHelper * | sharedDataReaderHelper () |
@ More... | |
static DataReaderHelper * | getInstance () |
static void | setPositionReadScale (float scale) |
Scale the position data, used for multiresolution adapter It won't effect the data already read. More... | |
static float | getPositionReadScale () |
static void | purge () |
static void | addDataFromCache (const std::string &pFileContent, DataInfo *dataInfo=nullptr) |
Translate XML export from Dragon Bone flash tool to datas, and save them. More... | |
static ArmatureData * | decodeArmature (tinyxml2::XMLElement *armatureXML, DataInfo *dataInfo) |
Decode Armature Datas from xml export from Dragon Bone flash tool. More... | |
static BoneData * | decodeBone (tinyxml2::XMLElement *boneXML, tinyxml2::XMLElement *parentXML, DataInfo *dataInfo) |
static DisplayData * | decodeBoneDisplay (tinyxml2::XMLElement *displayXML, DataInfo *dataInfo) |
static AnimationData * | decodeAnimation (tinyxml2::XMLElement *animationXML, DataInfo *dataInfo) |
Decode ArmatureAnimation Datas from xml export from Dragon Bone flash tool. More... | |
static MovementData * | decodeMovement (tinyxml2::XMLElement *movementXML, ArmatureData *armatureData, DataInfo *dataInfo) |
static MovementBoneData * | decodeMovementBone (tinyxml2::XMLElement *movBoneXml, tinyxml2::XMLElement *parentXml, BoneData *boneData, DataInfo *dataInfo) |
static FrameData * | decodeFrame (tinyxml2::XMLElement *frameXML, tinyxml2::XMLElement *parentFrameXml, BoneData *boneData, DataInfo *dataInfo) |
static TextureData * | decodeTexture (tinyxml2::XMLElement *textureXML, DataInfo *dataInfo) |
Decode Texture Datas from xml export from Dragon Bone flash tool. More... | |
static ContourData * | decodeContour (tinyxml2::XMLElement *contourXML, DataInfo *dataInfo) |
Decode Contour Datas from xml export from Dragon Bone flash tool. More... | |
static void | addDataFromJsonCache (const std::string &fileContent, DataInfo *dataInfo=nullptr) |
static ArmatureData * | decodeArmature (const rapidjson::Value &json, DataInfo *dataInfo) |
static BoneData * | decodeBone (const rapidjson::Value &json, DataInfo *dataInfo) |
static DisplayData * | decodeBoneDisplay (const rapidjson::Value &json, DataInfo *dataInfo) |
static AnimationData * | decodeAnimation (const rapidjson::Value &json, DataInfo *dataInfo) |
static MovementData * | decodeMovement (const rapidjson::Value &json, DataInfo *dataInfo) |
static MovementBoneData * | decodeMovementBone (const rapidjson::Value &json, DataInfo *dataInfo) |
static FrameData * | decodeFrame (const rapidjson::Value &json, DataInfo *dataInfo) |
static TextureData * | decodeTexture (const rapidjson::Value &json) |
static ContourData * | decodeContour (const rapidjson::Value &json) |
static void | decodeNode (BaseData *node, const rapidjson::Value &json, DataInfo *dataInfo) |
Protected Types | |
enum | ConfigType { DragonBone_XML, CocoStudio_JSON } |
Protected Member Functions | |
void | loadData () |
Protected Attributes | |
std::condition_variable | _sleepCondition |
std::thread * | _loadingThread |
std::mutex | _sleepMutex |
std::mutex | _asyncStructQueueMutex |
std::mutex | _dataInfoMutex |
std::mutex | _addDataMutex |
std::mutex | _getFileMutex |
unsigned long | _asyncRefCount |
unsigned long | _asyncRefTotalCount |
bool | need_quit |
std::queue< AsyncStruct * > * | _asyncStructQueue |
std::queue< DataInfo * > * | _dataQueue |
Static Protected Attributes | |
static std::vector< std::string > | _configFileList |
static DataReaderHelper * | _dataReaderHelper |
Additional Inherited Members | |
Private Member Functions inherited from Ref | |
void | retain () |
Retains the ownership. More... | |
void | release () |
Release the ownership immediately. More... | |
Ref * | autorelease () |
Release the ownership sometime soon automatically. More... | |
unsigned int | getReferenceCount () const |
Returns the Ref's current reference count. More... | |
virtual | ~Ref () |
Ref () | |
Constructor. More... | |
|
protected |
DataReaderHelper | ( | ) |
~DataReaderHelper | ( | ) |
void addDataAsyncCallBack | ( | float | dt) |
|
static |
Translate XML export from Dragon Bone flash tool to datas, and save them.
When you add a new xml, the data already saved will be keeped.
xmlPath | The cache of the xml |
void addDataFromFile | ( | const std::string & | filePath) |
void addDataFromFileAsync | ( | const std::string & | imagePath, |
const std::string & | plistPath, | ||
const std::string & | filePath, | ||
cocos2d::Ref * | target, | ||
cocos2d::SEL_SCHEDULE | selector | ||
) |
|
static |
|
static |
Decode ArmatureAnimation Datas from xml export from Dragon Bone flash tool.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Decode Contour Datas from xml export from Dragon Bone flash tool.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Decode Texture Datas from xml export from Dragon Bone flash tool.
|
static |
|
static |
|
static |
|
protected |
|
static |
void removeConfigFile | ( | const std::string & | configFile) |
|
static |
Scale the position data, used for multiresolution adapter It won't effect the data already read.
|
inlinestatic |
@
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |