Merge branch 'v3' into v3_dll

Conflicts:
	cocos/base/ccUtils.h
This commit is contained in:
Huabing.Xu 2014-07-17 14:12:10 +08:00
commit 3c6e87d34e
154 changed files with 2062 additions and 2591 deletions

View File

@ -888,6 +888,7 @@ Developers:
Added TextField::getStringLength() Added TextField::getStringLength()
Add shadow, outline, glow filter support for UIText Add shadow, outline, glow filter support for UIText
Fix UITextField IME can't auto detach Fix UITextField IME can't auto detach
Add getChildByName method for get a node that can be cast to Type T
QiuleiWang QiuleiWang
Fix the bug that calculated height of multi-line string was incorrect on iOS Fix the bug that calculated height of multi-line string was incorrect on iOS
@ -912,6 +913,9 @@ Developers:
chareice chareice
Make `setup.py` work on zsh Make `setup.py` work on zsh
taug
Could add seach path and resolution order path in front.
Retired Core Developers: Retired Core Developers:
WenSheng Yang WenSheng Yang

View File

@ -1,4 +1,7 @@
cocos2d-x-3.2 ?? cocos2d-x-3.2 ??
[NEW] Node: added getChildByName method for get a node that can be cast to Type T
[NEW] FileUtils: could add seach path and resolution order path in front
[FIX] Animation3D: getOrCreate is deprecated and replaced with Animation3D::create [FIX] Animation3D: getOrCreate is deprecated and replaced with Animation3D::create
[FIX] Animate3D: setSpeed() accept negtive value, which means play reverse, getPlayback and setPlayBack are deprecated [FIX] Animate3D: setSpeed() accept negtive value, which means play reverse, getPlayback and setPlayBack are deprecated
[FIX] EditBox: can not set/get text in password mode on Mac OS X [FIX] EditBox: can not set/get text in password mode on Mac OS X
@ -7,6 +10,7 @@ cocos2d-x-3.2 ??
[FIX] Lua-binding: support UIVideoPlayer [FIX] Lua-binding: support UIVideoPlayer
[FIX] Node: setRotation3D not work based on anchor point [FIX] Node: setRotation3D not work based on anchor point
[FIX] Node: modify regular of enumerateChildren, now it just searchs its children [FIX] Node: modify regular of enumerateChildren, now it just searchs its children
[FIX] ScrollViewDelegate: make the scrollView delegate methods optional
[FIX] Setup.py: not work if using zsh [FIX] Setup.py: not work if using zsh
[FIX] SpriteBatchNode: opacity can not work [FIX] SpriteBatchNode: opacity can not work
[FIX] Sprite3D: may crash on Android if playing animation and replace Scene after come from background [FIX] Sprite3D: may crash on Android if playing animation and replace Scene after come from background

View File

@ -49,15 +49,16 @@ THE SOFTWARE.
#include <algorithm> #include <algorithm>
NS_CC_BEGIN NS_CC_BEGIN
namespace experimental {
const int FastTMXLayer::FAST_TMX_ORIENTATION_ORTHO = 0; const int TMXLayer::FAST_TMX_ORIENTATION_ORTHO = 0;
const int FastTMXLayer::FAST_TMX_ORIENTATION_HEX = 1; const int TMXLayer::FAST_TMX_ORIENTATION_HEX = 1;
const int FastTMXLayer::FAST_TMX_ORIENTATION_ISO = 2; const int TMXLayer::FAST_TMX_ORIENTATION_ISO = 2;
// FastTMXLayer - init & alloc & dealloc // FastTMXLayer - init & alloc & dealloc
FastTMXLayer * FastTMXLayer::create(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo) TMXLayer * TMXLayer::create(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo)
{ {
FastTMXLayer *ret = new FastTMXLayer(); TMXLayer *ret = new TMXLayer();
if (ret->initWithTilesetInfo(tilesetInfo, layerInfo, mapInfo)) if (ret->initWithTilesetInfo(tilesetInfo, layerInfo, mapInfo))
{ {
ret->autorelease(); ret->autorelease();
@ -66,7 +67,7 @@ FastTMXLayer * FastTMXLayer::create(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *l
return nullptr; return nullptr;
} }
bool FastTMXLayer::initWithTilesetInfo(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo) bool TMXLayer::initWithTilesetInfo(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo)
{ {
if( tilesetInfo ) if( tilesetInfo )
@ -108,7 +109,7 @@ bool FastTMXLayer::initWithTilesetInfo(TMXTilesetInfo *tilesetInfo, TMXLayerInfo
return true; return true;
} }
FastTMXLayer::FastTMXLayer() TMXLayer::TMXLayer()
: _layerName("") : _layerName("")
, _layerSize(Size::ZERO) , _layerSize(Size::ZERO)
, _mapTileSize(Size::ZERO) , _mapTileSize(Size::ZERO)
@ -124,7 +125,7 @@ FastTMXLayer::FastTMXLayer()
_buffersVBO[0] = _buffersVBO[1] = 0; _buffersVBO[0] = _buffersVBO[1] = 0;
} }
FastTMXLayer::~FastTMXLayer() TMXLayer::~TMXLayer()
{ {
CC_SAFE_RELEASE(_tileSet); CC_SAFE_RELEASE(_tileSet);
CC_SAFE_RELEASE(_texture); CC_SAFE_RELEASE(_texture);
@ -140,7 +141,7 @@ FastTMXLayer::~FastTMXLayer()
} }
} }
void FastTMXLayer::draw(Renderer *renderer, const Mat4& transform, uint32_t flags) void TMXLayer::draw(Renderer *renderer, const Mat4& transform, uint32_t flags)
{ {
updateTotalQuads(); updateTotalQuads();
@ -169,13 +170,13 @@ void FastTMXLayer::draw(Renderer *renderer, const Mat4& transform, uint32_t flag
auto& cmd = _renderCommands[index++]; auto& cmd = _renderCommands[index++];
cmd.init(iter.first); cmd.init(iter.first);
cmd.func = CC_CALLBACK_0(FastTMXLayer::onDraw, this, _indicesVertexZOffsets[iter.first], iter.second); cmd.func = CC_CALLBACK_0(TMXLayer::onDraw, this, _indicesVertexZOffsets[iter.first], iter.second);
renderer->addCommand(&cmd); renderer->addCommand(&cmd);
} }
} }
void FastTMXLayer::onDraw(int offset, int count) void TMXLayer::onDraw(int offset, int count)
{ {
GL::bindTexture2D(_texture->getName()); GL::bindTexture2D(_texture->getName());
getGLProgramState()->apply(_modelViewTransform); getGLProgramState()->apply(_modelViewTransform);
@ -194,7 +195,7 @@ void FastTMXLayer::onDraw(int offset, int count)
CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, count * 4); CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, count * 4);
} }
void FastTMXLayer::updateTiles(const Rect& culledRect) void TMXLayer::updateTiles(const Rect& culledRect)
{ {
Rect visibleTiles = culledRect; Rect visibleTiles = culledRect;
Size mapTileSize = CC_SIZE_PIXELS_TO_POINTS(_mapTileSize); Size mapTileSize = CC_SIZE_PIXELS_TO_POINTS(_mapTileSize);
@ -287,7 +288,7 @@ void FastTMXLayer::updateTiles(const Rect& culledRect)
} }
void FastTMXLayer::updateVertexBuffer() void TMXLayer::updateVertexBuffer()
{ {
GL::bindVAO(0); GL::bindVAO(0);
if(!glIsBuffer(_buffersVBO[0])) if(!glIsBuffer(_buffersVBO[0]))
@ -300,7 +301,7 @@ void FastTMXLayer::updateVertexBuffer()
glBindBuffer(GL_ARRAY_BUFFER, 0); glBindBuffer(GL_ARRAY_BUFFER, 0);
} }
void FastTMXLayer::updateIndexBuffer() void TMXLayer::updateIndexBuffer()
{ {
if(!glIsBuffer(_buffersVBO[1])) if(!glIsBuffer(_buffersVBO[1]))
{ {
@ -312,7 +313,7 @@ void FastTMXLayer::updateIndexBuffer()
} }
// FastTMXLayer - setup Tiles // FastTMXLayer - setup Tiles
void FastTMXLayer::setupTiles() void TMXLayer::setupTiles()
{ {
// Optimization: quick hack that sets the image size on the tileset // Optimization: quick hack that sets the image size on the tileset
_tileSet->_imageSize = _texture->getContentSizeInPixels(); _tileSet->_imageSize = _texture->getContentSizeInPixels();
@ -352,7 +353,7 @@ void FastTMXLayer::setupTiles()
} }
Mat4 FastTMXLayer::tileToNodeTransform() Mat4 TMXLayer::tileToNodeTransform()
{ {
float w = _mapTileSize.width / CC_CONTENT_SCALE_FACTOR(); float w = _mapTileSize.width / CC_CONTENT_SCALE_FACTOR();
float h = _mapTileSize.height / CC_CONTENT_SCALE_FACTOR(); float h = _mapTileSize.height / CC_CONTENT_SCALE_FACTOR();
@ -404,7 +405,7 @@ Mat4 FastTMXLayer::tileToNodeTransform()
} }
void FastTMXLayer::updateTotalQuads() void TMXLayer::updateTotalQuads()
{ {
if(_quadsDirty) if(_quadsDirty)
{ {
@ -536,7 +537,7 @@ void FastTMXLayer::updateTotalQuads()
} }
// removing / getting tiles // removing / getting tiles
Sprite* FastTMXLayer::getTileAt(const Vec2& tileCoordinate) Sprite* TMXLayer::getTileAt(const Vec2& tileCoordinate)
{ {
CCASSERT( tileCoordinate.x < _layerSize.width && tileCoordinate.y < _layerSize.height && tileCoordinate.x >=0 && tileCoordinate.y >=0, "TMXLayer: invalid position"); CCASSERT( tileCoordinate.x < _layerSize.width && tileCoordinate.y < _layerSize.height && tileCoordinate.x >=0 && tileCoordinate.y >=0, "TMXLayer: invalid position");
CCASSERT( _tiles, "TMXLayer: the tiles map has been released"); CCASSERT( _tiles, "TMXLayer: the tiles map has been released");
@ -576,7 +577,7 @@ Sprite* FastTMXLayer::getTileAt(const Vec2& tileCoordinate)
return tile; return tile;
} }
int FastTMXLayer::getTileGIDAt(const Vec2& tileCoordinate, TMXTileFlags* flags/* = nullptr*/) int TMXLayer::getTileGIDAt(const Vec2& tileCoordinate, TMXTileFlags* flags/* = nullptr*/)
{ {
CCASSERT(tileCoordinate.x < _layerSize.width && tileCoordinate.y < _layerSize.height && tileCoordinate.x >=0 && tileCoordinate.y >=0, "TMXLayer: invalid position"); CCASSERT(tileCoordinate.x < _layerSize.width && tileCoordinate.y < _layerSize.height && tileCoordinate.x >=0 && tileCoordinate.y >=0, "TMXLayer: invalid position");
CCASSERT(_tiles, "TMXLayer: the tiles map has been released"); CCASSERT(_tiles, "TMXLayer: the tiles map has been released");
@ -602,12 +603,12 @@ int FastTMXLayer::getTileGIDAt(const Vec2& tileCoordinate, TMXTileFlags* flags/*
return (tile & kTMXFlippedMask); return (tile & kTMXFlippedMask);
} }
Vec2 FastTMXLayer::getPositionAt(const Vec2& pos) Vec2 TMXLayer::getPositionAt(const Vec2& pos)
{ {
return PointApplyTransform(pos, _tileToNodeTransform); return PointApplyTransform(pos, _tileToNodeTransform);
} }
int FastTMXLayer::getVertexZForPos(const Vec2& pos) int TMXLayer::getVertexZForPos(const Vec2& pos)
{ {
int ret = 0; int ret = 0;
int maxVal = 0; int maxVal = 0;
@ -638,7 +639,7 @@ int FastTMXLayer::getVertexZForPos(const Vec2& pos)
return ret; return ret;
} }
void FastTMXLayer::removeTileAt(const Vec2& tileCoordinate) void TMXLayer::removeTileAt(const Vec2& tileCoordinate)
{ {
CCASSERT( tileCoordinate.x < _layerSize.width && tileCoordinate.y < _layerSize.height && tileCoordinate.x >=0 && tileCoordinate.y >=0, "TMXLayer: invalid position"); CCASSERT( tileCoordinate.x < _layerSize.width && tileCoordinate.y < _layerSize.height && tileCoordinate.x >=0 && tileCoordinate.y >=0, "TMXLayer: invalid position");
@ -661,7 +662,7 @@ void FastTMXLayer::removeTileAt(const Vec2& tileCoordinate)
} }
} }
void FastTMXLayer::setFlaggedTileGIDByIndex(int index, int gid) void TMXLayer::setFlaggedTileGIDByIndex(int index, int gid)
{ {
if(gid == _tiles[index]) return; if(gid == _tiles[index]) return;
_tiles[index] = gid; _tiles[index] = gid;
@ -669,7 +670,7 @@ void FastTMXLayer::setFlaggedTileGIDByIndex(int index, int gid)
_dirty = true; _dirty = true;
} }
void FastTMXLayer::removeChild(Node* node, bool cleanup) void TMXLayer::removeChild(Node* node, bool cleanup)
{ {
int tag = node->getTag(); int tag = node->getTag();
auto it = _spriteContainer.find(tag); auto it = _spriteContainer.find(tag);
@ -680,8 +681,8 @@ void FastTMXLayer::removeChild(Node* node, bool cleanup)
Node::removeChild(node, cleanup); Node::removeChild(node, cleanup);
} }
// FastTMXLayer - Properties // TMXLayer - Properties
Value FastTMXLayer::getProperty(const std::string& propertyName) const Value TMXLayer::getProperty(const std::string& propertyName) const
{ {
if (_properties.find(propertyName) != _properties.end()) if (_properties.find(propertyName) != _properties.end())
return _properties.at(propertyName); return _properties.at(propertyName);
@ -689,7 +690,7 @@ Value FastTMXLayer::getProperty(const std::string& propertyName) const
return Value(); return Value();
} }
void FastTMXLayer::parseInternalProperties() void TMXLayer::parseInternalProperties()
{ {
auto vertexz = getProperty("cc_vertexz"); auto vertexz = getProperty("cc_vertexz");
if (vertexz.isNull()) return; if (vertexz.isNull()) return;
@ -719,7 +720,7 @@ void FastTMXLayer::parseInternalProperties()
} }
//CCTMXLayer2 - obtaining positions, offset //CCTMXLayer2 - obtaining positions, offset
Vec2 FastTMXLayer::calculateLayerOffset(const Vec2& pos) Vec2 TMXLayer::calculateLayerOffset(const Vec2& pos)
{ {
Vec2 ret = Vec2::ZERO; Vec2 ret = Vec2::ZERO;
switch (_layerOrientation) switch (_layerOrientation)
@ -740,12 +741,12 @@ Vec2 FastTMXLayer::calculateLayerOffset(const Vec2& pos)
} }
// TMXLayer - adding / remove tiles // TMXLayer - adding / remove tiles
void FastTMXLayer::setTileGID(int gid, const Vec2& tileCoordinate) void TMXLayer::setTileGID(int gid, const Vec2& tileCoordinate)
{ {
setTileGID(gid, tileCoordinate, (TMXTileFlags)0); setTileGID(gid, tileCoordinate, (TMXTileFlags)0);
} }
void FastTMXLayer::setTileGID(int gid, const Vec2& tileCoordinate, TMXTileFlags flags) void TMXLayer::setTileGID(int gid, const Vec2& tileCoordinate, TMXTileFlags flags)
{ {
CCASSERT(tileCoordinate.x < _layerSize.width && tileCoordinate.y < _layerSize.height && tileCoordinate.x >=0 && tileCoordinate.y >=0, "TMXLayer: invalid position"); CCASSERT(tileCoordinate.x < _layerSize.width && tileCoordinate.y < _layerSize.height && tileCoordinate.x >=0 && tileCoordinate.y >=0, "TMXLayer: invalid position");
CCASSERT(_tiles, "TMXLayer: the tiles map has been released"); CCASSERT(_tiles, "TMXLayer: the tiles map has been released");
@ -796,7 +797,7 @@ void FastTMXLayer::setTileGID(int gid, const Vec2& tileCoordinate, TMXTileFlags
} }
} }
void FastTMXLayer::setupTileSprite(Sprite* sprite, Vec2 pos, int gid) void TMXLayer::setupTileSprite(Sprite* sprite, Vec2 pos, int gid)
{ {
sprite->setPosition(getPositionAt(pos)); sprite->setPosition(getPositionAt(pos));
sprite->setPositionZ((float)getVertexZForPos(pos)); sprite->setPositionZ((float)getVertexZForPos(pos));
@ -852,9 +853,11 @@ void FastTMXLayer::setupTileSprite(Sprite* sprite, Vec2 pos, int gid)
} }
} }
std::string FastTMXLayer::getDescription() const std::string TMXLayer::getDescription() const
{ {
return StringUtils::format("<FastTMXLayer | tag = %d, size = %d,%d>", _tag, (int)_mapTileSize.width, (int)_mapTileSize.height); return StringUtils::format("<FastTMXLayer | tag = %d, size = %d,%d>", _tag, (int)_mapTileSize.width, (int)_mapTileSize.height);
} }
} //end of namespace experimental
NS_CC_END NS_CC_END

View File

@ -45,6 +45,8 @@ class Texture2D;
class Sprite; class Sprite;
struct _ccCArray; struct _ccCArray;
namespace experimental{
/** /**
* @addtogroup tilemap_parallax_nodes * @addtogroup tilemap_parallax_nodes
* @{ * @{
@ -76,20 +78,20 @@ http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:tiled_maps
@since v3.2 @since v3.2
*/ */
class CC_DLL FastTMXLayer : public Node class CC_DLL TMXLayer : public Node
{ {
public: public:
/** creates a FastTMXLayer with an tileset info, a layer info and a map info */ /** creates a FastTMXLayer with an tileset info, a layer info and a map info */
static FastTMXLayer * create(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo); static TMXLayer * create(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo);
/** /**
* @js ctor * @js ctor
*/ */
FastTMXLayer(); TMXLayer();
/** /**
* @js NA * @js NA
* @lua NA * @lua NA
*/ */
virtual ~FastTMXLayer(); virtual ~TMXLayer();
/** returns the tile gid at a given tile coordinate. It also returns the tile flags. /** returns the tile gid at a given tile coordinate. It also returns the tile flags.
*/ */
@ -256,7 +258,7 @@ public:
// end of tilemap_parallax_nodes group // end of tilemap_parallax_nodes group
/// @} /// @}
} //end of namespace experimental
NS_CC_END NS_CC_END
#endif //__CCTMX_LAYER2_H__ #endif //__CCTMX_LAYER2_H__

View File

@ -34,12 +34,13 @@ THE SOFTWARE.
#include "deprecated/CCString.h" #include "deprecated/CCString.h"
NS_CC_BEGIN NS_CC_BEGIN
namespace experimental {
// implementation FastTMXTiledMap // implementation FastTMXTiledMap
FastTMXTiledMap * FastTMXTiledMap::create(const std::string& tmxFile) TMXTiledMap * TMXTiledMap::create(const std::string& tmxFile)
{ {
FastTMXTiledMap *ret = new FastTMXTiledMap(); TMXTiledMap *ret = new TMXTiledMap();
if (ret->initWithTMXFile(tmxFile)) if (ret->initWithTMXFile(tmxFile))
{ {
ret->autorelease(); ret->autorelease();
@ -49,9 +50,9 @@ FastTMXTiledMap * FastTMXTiledMap::create(const std::string& tmxFile)
return nullptr; return nullptr;
} }
FastTMXTiledMap* FastTMXTiledMap::createWithXML(const std::string& tmxString, const std::string& resourcePath) TMXTiledMap* TMXTiledMap::createWithXML(const std::string& tmxString, const std::string& resourcePath)
{ {
FastTMXTiledMap *ret = new FastTMXTiledMap(); TMXTiledMap *ret = new TMXTiledMap();
if (ret->initWithXML(tmxString, resourcePath)) if (ret->initWithXML(tmxString, resourcePath))
{ {
ret->autorelease(); ret->autorelease();
@ -61,7 +62,7 @@ FastTMXTiledMap* FastTMXTiledMap::createWithXML(const std::string& tmxString, co
return nullptr; return nullptr;
} }
bool FastTMXTiledMap::initWithTMXFile(const std::string& tmxFile) bool TMXTiledMap::initWithTMXFile(const std::string& tmxFile)
{ {
CCASSERT(tmxFile.size()>0, "FastTMXTiledMap: tmx file should not be empty"); CCASSERT(tmxFile.size()>0, "FastTMXTiledMap: tmx file should not be empty");
@ -79,7 +80,7 @@ bool FastTMXTiledMap::initWithTMXFile(const std::string& tmxFile)
return true; return true;
} }
bool FastTMXTiledMap::initWithXML(const std::string& tmxString, const std::string& resourcePath) bool TMXTiledMap::initWithXML(const std::string& tmxString, const std::string& resourcePath)
{ {
setContentSize(Size::ZERO); setContentSize(Size::ZERO);
@ -91,21 +92,21 @@ bool FastTMXTiledMap::initWithXML(const std::string& tmxString, const std::strin
return true; return true;
} }
FastTMXTiledMap::FastTMXTiledMap() TMXTiledMap::TMXTiledMap()
:_mapSize(Size::ZERO) :_mapSize(Size::ZERO)
,_tileSize(Size::ZERO) ,_tileSize(Size::ZERO)
{ {
} }
FastTMXTiledMap::~FastTMXTiledMap() TMXTiledMap::~TMXTiledMap()
{ {
} }
// private // private
FastTMXLayer * FastTMXTiledMap::parseLayer(TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo) TMXLayer * TMXTiledMap::parseLayer(TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo)
{ {
TMXTilesetInfo *tileset = tilesetForLayer(layerInfo, mapInfo); TMXTilesetInfo *tileset = tilesetForLayer(layerInfo, mapInfo);
FastTMXLayer *layer = FastTMXLayer::create(tileset, layerInfo, mapInfo); TMXLayer *layer = TMXLayer::create(tileset, layerInfo, mapInfo);
// tell the layerinfo to release the ownership of the tiles map. // tell the layerinfo to release the ownership of the tiles map.
layerInfo->_ownTiles = false; layerInfo->_ownTiles = false;
@ -114,7 +115,7 @@ FastTMXLayer * FastTMXTiledMap::parseLayer(TMXLayerInfo *layerInfo, TMXMapInfo *
return layer; return layer;
} }
TMXTilesetInfo * FastTMXTiledMap::tilesetForLayer(TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo) TMXTilesetInfo * TMXTiledMap::tilesetForLayer(TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo)
{ {
Size size = layerInfo->_layerSize; Size size = layerInfo->_layerSize;
auto& tilesets = mapInfo->getTilesets(); auto& tilesets = mapInfo->getTilesets();
@ -155,7 +156,7 @@ TMXTilesetInfo * FastTMXTiledMap::tilesetForLayer(TMXLayerInfo *layerInfo, TMXMa
return nullptr; return nullptr;
} }
void FastTMXTiledMap::buildWithMapInfo(TMXMapInfo* mapInfo) void TMXTiledMap::buildWithMapInfo(TMXMapInfo* mapInfo)
{ {
_mapSize = mapInfo->getMapSize(); _mapSize = mapInfo->getMapSize();
_tileSize = mapInfo->getTileSize(); _tileSize = mapInfo->getTileSize();
@ -173,7 +174,7 @@ void FastTMXTiledMap::buildWithMapInfo(TMXMapInfo* mapInfo)
for(const auto &layerInfo : layers) { for(const auto &layerInfo : layers) {
if (layerInfo->_visible) if (layerInfo->_visible)
{ {
FastTMXLayer *child = parseLayer(layerInfo, mapInfo); TMXLayer *child = parseLayer(layerInfo, mapInfo);
addChild(child, idx, idx); addChild(child, idx, idx);
// update content size with the max size // update content size with the max size
@ -189,13 +190,13 @@ void FastTMXTiledMap::buildWithMapInfo(TMXMapInfo* mapInfo)
} }
// public // public
FastTMXLayer * FastTMXTiledMap::getLayer(const std::string& layerName) const TMXLayer * TMXTiledMap::getLayer(const std::string& layerName) const
{ {
CCASSERT(layerName.size() > 0, "Invalid layer name!"); CCASSERT(layerName.size() > 0, "Invalid layer name!");
for (auto& child : _children) for (auto& child : _children)
{ {
FastTMXLayer* layer = dynamic_cast<FastTMXLayer*>(child); TMXLayer* layer = dynamic_cast<TMXLayer*>(child);
if(layer) if(layer)
{ {
if(layerName.compare( layer->getLayerName()) == 0) if(layerName.compare( layer->getLayerName()) == 0)
@ -209,7 +210,7 @@ FastTMXLayer * FastTMXTiledMap::getLayer(const std::string& layerName) const
return nullptr; return nullptr;
} }
TMXObjectGroup * FastTMXTiledMap::getObjectGroup(const std::string& groupName) const TMXObjectGroup * TMXTiledMap::getObjectGroup(const std::string& groupName) const
{ {
CCASSERT(groupName.size() > 0, "Invalid group name!"); CCASSERT(groupName.size() > 0, "Invalid group name!");
@ -230,7 +231,7 @@ TMXObjectGroup * FastTMXTiledMap::getObjectGroup(const std::string& groupName) c
return nullptr; return nullptr;
} }
Value FastTMXTiledMap::getProperty(const std::string& propertyName) const Value TMXTiledMap::getProperty(const std::string& propertyName) const
{ {
if (_properties.find(propertyName) != _properties.end()) if (_properties.find(propertyName) != _properties.end())
return _properties.at(propertyName); return _properties.at(propertyName);
@ -238,7 +239,7 @@ Value FastTMXTiledMap::getProperty(const std::string& propertyName) const
return Value(); return Value();
} }
Value FastTMXTiledMap::getPropertiesForGID(int GID) const Value TMXTiledMap::getPropertiesForGID(int GID) const
{ {
if (_tileProperties.find(GID) != _tileProperties.end()) if (_tileProperties.find(GID) != _tileProperties.end())
return _tileProperties.at(GID); return _tileProperties.at(GID);
@ -246,11 +247,12 @@ Value FastTMXTiledMap::getPropertiesForGID(int GID) const
return Value(); return Value();
} }
std::string FastTMXTiledMap::getDescription() const std::string TMXTiledMap::getDescription() const
{ {
return StringUtils::format("<FastTMXTiledMap | Tag = %d, Layers = %d", _tag, static_cast<int>(_children.size())); return StringUtils::format("<FastTMXTiledMap | Tag = %d, Layers = %d", _tag, static_cast<int>(_children.size()));
} }
} //end of namespace experimental
NS_CC_END NS_CC_END

View File

@ -33,11 +33,14 @@ THE SOFTWARE.
NS_CC_BEGIN NS_CC_BEGIN
class TMXObjectGroup; class TMXObjectGroup;
class FastTMXLayer;
class TMXLayerInfo; class TMXLayerInfo;
class TMXTilesetInfo; class TMXTilesetInfo;
class TMXMapInfo; class TMXMapInfo;
namespace experimental {
class TMXLayer;
/** @brief FastTMXTiledMap knows how to parse and render a TMX map. /** @brief FastTMXTiledMap knows how to parse and render a TMX map.
It adds support for the TMX tiled map format used by http://www.mapeditor.org It adds support for the TMX tiled map format used by http://www.mapeditor.org
@ -89,17 +92,17 @@ object->getProperty(name_of_the_property);
@since v3.2 @since v3.2
*/ */
class CC_DLL FastTMXTiledMap : public Node class CC_DLL TMXTiledMap : public Node
{ {
public: public:
/** creates a TMX Tiled Map with a TMX file.*/ /** creates a TMX Tiled Map with a TMX file.*/
static FastTMXTiledMap* create(const std::string& tmxFile); static TMXTiledMap* create(const std::string& tmxFile);
/** initializes a TMX Tiled Map with a TMX formatted XML string and a path to TMX resources */ /** initializes a TMX Tiled Map with a TMX formatted XML string and a path to TMX resources */
static FastTMXTiledMap* createWithXML(const std::string& tmxString, const std::string& resourcePath); static TMXTiledMap* createWithXML(const std::string& tmxString, const std::string& resourcePath);
/** return the FastTMXLayer for the specific layer */ /** return the FastTMXLayer for the specific layer */
FastTMXLayer* getLayer(const std::string& layerName) const; TMXLayer* getLayer(const std::string& layerName) const;
/** return the TMXObjectGroup for the specific group */ /** return the TMXObjectGroup for the specific group */
TMXObjectGroup* getObjectGroup(const std::string& groupName) const; TMXObjectGroup* getObjectGroup(const std::string& groupName) const;
@ -141,12 +144,12 @@ protected:
/** /**
* @js ctor * @js ctor
*/ */
FastTMXTiledMap(); TMXTiledMap();
/** /**
* @js NA * @js NA
* @lua NA * @lua NA
*/ */
virtual ~FastTMXTiledMap(); virtual ~TMXTiledMap();
/** initializes a TMX Tiled Map with a TMX file */ /** initializes a TMX Tiled Map with a TMX file */
bool initWithTMXFile(const std::string& tmxFile); bool initWithTMXFile(const std::string& tmxFile);
@ -154,7 +157,7 @@ protected:
/** initializes a TMX Tiled Map with a TMX formatted XML string and a path to TMX resources */ /** initializes a TMX Tiled Map with a TMX formatted XML string and a path to TMX resources */
bool initWithXML(const std::string& tmxString, const std::string& resourcePath); bool initWithXML(const std::string& tmxString, const std::string& resourcePath);
FastTMXLayer * parseLayer(TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo); TMXLayer * parseLayer(TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo);
TMXTilesetInfo * tilesetForLayer(TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo); TMXTilesetInfo * tilesetForLayer(TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo);
void buildWithMapInfo(TMXMapInfo* mapInfo); void buildWithMapInfo(TMXMapInfo* mapInfo);
@ -173,12 +176,14 @@ protected:
ValueMapIntKey _tileProperties; ValueMapIntKey _tileProperties;
private: private:
CC_DISALLOW_COPY_AND_ASSIGN(FastTMXTiledMap); CC_DISALLOW_COPY_AND_ASSIGN(TMXTiledMap);
}; };
// end of tilemap_parallax_nodes group // end of tilemap_parallax_nodes group
/// @} /// @}
} //end of namespace experimental
NS_CC_END NS_CC_END

View File

@ -712,6 +712,15 @@ public:
* @since v3.2 * @since v3.2
*/ */
virtual Node* getChildByName(const std::string& name) const; virtual Node* getChildByName(const std::string& name) const;
/**
* Gets a child from the container with its name that can be cast to Type T
*
* @param name An identifier to find the child node.
*
* @return a Node with the given name that can be cast to Type T
*/
template <typename T>
inline T getChildByName(const std::string& name) const { return static_cast<T>(getChildByName(name)); }
/** Search the children of the receiving node to perform processing for nodes which share a name. /** Search the children of the receiving node to perform processing for nodes which share a name.
* *
* @param name The name to search for, supports c++11 regular expression. * @param name The name to search for, supports c++11 regular expression.

View File

@ -28,6 +28,7 @@
#include "CCObjLoader.h" #include "CCObjLoader.h"
#include "platform/CCFileUtils.h" #include "platform/CCFileUtils.h"
#include "base/ccUtils.h"
NS_CC_BEGIN NS_CC_BEGIN
@ -102,7 +103,7 @@ static inline int parseInt(const char*& token)
static inline float parseFloat(const char*& token) static inline float parseFloat(const char*& token)
{ {
token += strspn(token, " \t"); token += strspn(token, " \t");
float f = (float)atof(token); float f = (float)utils::atof(token);
token += strcspn(token, " \t\r"); token += strcspn(token, " \t\r");
return f; return f;
} }

View File

@ -63,6 +63,7 @@
#include "renderer/CCTextureCache.h" #include "renderer/CCTextureCache.h"
#include "CCGLView.h" #include "CCGLView.h"
#include "base/base64.h" #include "base/base64.h"
#include "base/ccUtils.h"
NS_CC_BEGIN NS_CC_BEGIN
extern const char* cocos2dVersion(void); extern const char* cocos2dVersion(void);
@ -660,8 +661,8 @@ void Console::commandTouch(int fd, const std::string& args)
if((argv.size() == 3) && (isFloat(argv[1]) && isFloat(argv[2]))) if((argv.size() == 3) && (isFloat(argv[1]) && isFloat(argv[2])))
{ {
float x = std::atof(argv[1].c_str()); float x = utils::atof(argv[1].c_str());
float y = std::atof(argv[2].c_str()); float y = utils::atof(argv[2].c_str());
srand ((unsigned)time(nullptr)); srand ((unsigned)time(nullptr));
_touchId = rand(); _touchId = rand();
@ -686,10 +687,10 @@ void Console::commandTouch(int fd, const std::string& args)
&& (isFloat(argv[3])) && (isFloat(argv[4]))) && (isFloat(argv[3])) && (isFloat(argv[4])))
{ {
float x1 = std::atof(argv[1].c_str()); float x1 = utils::atof(argv[1].c_str());
float y1 = std::atof(argv[2].c_str()); float y1 = utils::atof(argv[2].c_str());
float x2 = std::atof(argv[3].c_str()); float x2 = utils::atof(argv[3].c_str());
float y2 = std::atof(argv[4].c_str()); float y2 = utils::atof(argv[4].c_str());
srand ((unsigned)time(nullptr)); srand ((unsigned)time(nullptr));
_touchId = rand(); _touchId = rand();

View File

@ -28,6 +28,8 @@ THE SOFTWARE.
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include "base/ccUtils.h"
using namespace std; using namespace std;
NS_CC_BEGIN NS_CC_BEGIN
@ -133,10 +135,10 @@ Rect RectFromString(const std::string& str)
strArray sizeInfo; strArray sizeInfo;
CC_BREAK_IF(!splitWithForm(sizeStr.c_str(), sizeInfo)); CC_BREAK_IF(!splitWithForm(sizeStr.c_str(), sizeInfo));
float x = (float) atof(pointInfo[0].c_str()); float x = (float) utils::atof(pointInfo[0].c_str());
float y = (float) atof(pointInfo[1].c_str()); float y = (float) utils::atof(pointInfo[1].c_str());
float width = (float) atof(sizeInfo[0].c_str()); float width = (float) utils::atof(sizeInfo[0].c_str());
float height = (float) atof(sizeInfo[1].c_str()); float height = (float) utils::atof(sizeInfo[1].c_str());
result = Rect(x, y, width, height); result = Rect(x, y, width, height);
} while (0); } while (0);
@ -153,8 +155,8 @@ Vec2 PointFromString(const std::string& str)
strArray strs; strArray strs;
CC_BREAK_IF(!splitWithForm(str, strs)); CC_BREAK_IF(!splitWithForm(str, strs));
float x = (float) atof(strs[0].c_str()); float x = (float) utils::atof(strs[0].c_str());
float y = (float) atof(strs[1].c_str()); float y = (float) utils::atof(strs[1].c_str());
ret = Vec2(x, y); ret = Vec2(x, y);
} while (0); } while (0);
@ -171,8 +173,8 @@ Size SizeFromString(const std::string& pszContent)
strArray strs; strArray strs;
CC_BREAK_IF(!splitWithForm(pszContent, strs)); CC_BREAK_IF(!splitWithForm(pszContent, strs));
float width = (float) atof(strs[0].c_str()); float width = (float) utils::atof(strs[0].c_str());
float height = (float) atof(strs[1].c_str()); float height = (float) utils::atof(strs[1].c_str());
ret = Size(width, height); ret = Size(width, height);
} while (0); } while (0);

View File

@ -27,6 +27,7 @@ THE SOFTWARE.
#include "platform/CCFileUtils.h" #include "platform/CCFileUtils.h"
#include "tinyxml2.h" #include "tinyxml2.h"
#include "base/base64.h" #include "base/base64.h"
#include "base/ccUtils.h"
#if (CC_TARGET_PLATFORM != CC_PLATFORM_IOS && CC_TARGET_PLATFORM != CC_PLATFORM_MAC && CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) #if (CC_TARGET_PLATFORM != CC_PLATFORM_IOS && CC_TARGET_PLATFORM != CC_PLATFORM_MAC && CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID)
@ -250,7 +251,7 @@ double UserDefault::getDoubleForKey(const char* pKey, double defaultValue)
if (value) if (value)
{ {
ret = atof(value); ret = utils::atof(value);
} }
if (doc) delete doc; if (doc) delete doc;

View File

@ -24,6 +24,7 @@ THE SOFTWARE.
****************************************************************************/ ****************************************************************************/
#include "base/CCUserDefault.h" #include "base/CCUserDefault.h"
#include "base/CCPlatformConfig.h" #include "base/CCPlatformConfig.h"
#include "base/ccUtils.h"
#include "platform/CCCommon.h" #include "platform/CCCommon.h"
#include "base/base64.h" #include "base/base64.h"
@ -243,7 +244,7 @@ float UserDefault::getFloatForKey(const char* pKey, float defaultValue)
{ {
if (node->FirstChild()) if (node->FirstChild())
{ {
float ret = atof((const char*)node->FirstChild()->Value()); float ret = utils::atof((const char*)node->FirstChild()->Value());
// set value in NSUserDefaults // set value in NSUserDefaults
setFloatForKey(pKey, ret); setFloatForKey(pKey, ret);
@ -279,7 +280,7 @@ double UserDefault::getDoubleForKey(const char* pKey, double defaultValue)
{ {
if (node->FirstChild()) if (node->FirstChild())
{ {
double ret = atof((const char*)node->FirstChild()->Value()); double ret = utils::atof((const char*)node->FirstChild()->Value());
// set value in NSUserDefaults // set value in NSUserDefaults
setDoubleForKey(pKey, ret); setDoubleForKey(pKey, ret);

View File

@ -25,6 +25,7 @@
#include "base/CCValue.h" #include "base/CCValue.h"
#include <sstream> #include <sstream>
#include <iomanip> #include <iomanip>
#include "base/ccUtils.h"
NS_CC_BEGIN NS_CC_BEGIN
@ -504,7 +505,7 @@ float Value::asFloat() const
if (_type == Type::STRING) if (_type == Type::STRING)
{ {
return atof(_field.strVal->c_str()); return utils::atof(_field.strVal->c_str());
} }
if (_type == Type::INTEGER) if (_type == Type::INTEGER)
@ -540,7 +541,7 @@ double Value::asDouble() const
if (_type == Type::STRING) if (_type == Type::STRING)
{ {
return static_cast<double>(atof(_field.strVal->c_str())); return static_cast<double>(utils::atof(_field.strVal->c_str()));
} }
if (_type == Type::INTEGER) if (_type == Type::INTEGER)

View File

@ -24,6 +24,9 @@ THE SOFTWARE.
****************************************************************************/ ****************************************************************************/
#include "base/ccUtils.h" #include "base/ccUtils.h"
#include <stdlib.h>
#include "base/CCDirector.h" #include "base/CCDirector.h"
#include "renderer/CCCustomCommand.h" #include "renderer/CCCustomCommand.h"
#include "renderer/CCRenderer.h" #include "renderer/CCRenderer.h"
@ -160,6 +163,27 @@ std::vector<Node*> findChildren(const Node &node, const std::string &name)
return vec; return vec;
} }
#define MAX_ITOA_BUFFER_SIZE 256
double atof(const char* str)
{
if (str == nullptr)
{
return 0.0;
}
char buf[MAX_ITOA_BUFFER_SIZE];
strncpy(buf, str, MAX_ITOA_BUFFER_SIZE);
// strip string, only remain 7 numbers after '.'
char* dot = strchr(buf, '.');
if (dot != nullptr && dot - buf + 8 < MAX_ITOA_BUFFER_SIZE)
{
dot[8] = '\0';
}
return ::atof(buf);
}
} }

View File

@ -73,6 +73,11 @@ namespace utils
* @since v3.2 * @since v3.2
*/ */
std::vector<Node*> CC_DLL findChildren(const Node &node, const std::string &name); std::vector<Node*> CC_DLL findChildren(const Node &node, const std::string &name);
/** Same to ::atof, but strip the string, remain 7 numbers after '.' before call atof。
* Why we need this? Because in android c++_static, atof ( and std::atof ) is unsupported for numbers have long decimal part and contain several numbers can approximate to 1 like 90.099998474121094 ), it will return inf. this function is used to fix this bug.
*/
double atof(const char* str);
} }
NS_CC_END NS_CC_END

View File

@ -29,6 +29,7 @@ Copyright (c) 2013-2014 Chukong Technologies
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include "CCArray.h" #include "CCArray.h"
#include "base/ccUtils.h"
NS_CC_BEGIN NS_CC_BEGIN
@ -118,7 +119,7 @@ float __String::floatValue() const
{ {
return 0.0f; return 0.0f;
} }
return (float)atof(_string.c_str()); return (float)utils::atof(_string.c_str());
} }
double __String::doubleValue() const double __String::doubleValue() const
@ -127,7 +128,7 @@ double __String::doubleValue() const
{ {
return 0.0; return 0.0;
} }
return atof(_string.c_str()); return utils::atof(_string.c_str());
} }
bool __String::boolValue() const bool __String::boolValue() const

View File

@ -28,6 +28,7 @@ THE SOFTWARE.
#include "ui/UIWidget.h" #include "ui/UIWidget.h"
#include "ui/UIHelper.h" #include "ui/UIHelper.h"
#include "cocostudio/CocoLoader.h" #include "cocostudio/CocoLoader.h"
#include "base/ccUtils.h"
using namespace cocos2d; using namespace cocos2d;
using namespace ui; using namespace ui;
@ -184,7 +185,7 @@ void ActionNode::initWithDictionary(const rapidjson::Value& dic, Ref* root)
} }
float ActionNode::valueToFloat(const std::string& value) float ActionNode::valueToFloat(const std::string& value)
{ {
return atof(value.c_str()); return utils::atof(value.c_str());
} }
void ActionNode::initWithBinary(CocoLoader *cocoLoader, void ActionNode::initWithBinary(CocoLoader *cocoLoader,

View File

@ -29,6 +29,7 @@ THE SOFTWARE.
#include "base/CCDirector.h" #include "base/CCDirector.h"
#include "base/CCScheduler.h" #include "base/CCScheduler.h"
#include "2d/CCActionInstant.h" #include "2d/CCActionInstant.h"
#include "base/ccUtils.h"
using namespace cocos2d; using namespace cocos2d;
@ -189,7 +190,7 @@ bool ActionObject::valueToBool(const std::string& value)
} }
float ActionObject::valueToFloat(const std::string& value) float ActionObject::valueToFloat(const std::string& value)
{ {
return atof(value.c_str()); return utils::atof(value.c_str());
} }
void ActionObject::addActionNode(ActionNode* node) void ActionObject::addActionNode(ActionNode* node)

View File

@ -25,6 +25,7 @@ THE SOFTWARE.
#include "platform/CCFileUtils.h" #include "platform/CCFileUtils.h"
#include "base/CCDirector.h" #include "base/CCDirector.h"
#include "base/CCScheduler.h" #include "base/CCScheduler.h"
#include "base/ccUtils.h"
#include "tinyxml2.h" #include "tinyxml2.h"
@ -1763,7 +1764,7 @@ void DataReaderHelper::decodeNode(BaseData *node, const rapidjson::Value& json,
if (key.compare(CONTENT_SCALE) == 0) if (key.compare(CONTENT_SCALE) == 0)
{ {
std::string value = tpChildArray[i].GetValue(&tCocoLoader); std::string value = tpChildArray[i].GetValue(&tCocoLoader);
dataInfo->contentScale = atof(value.c_str()); dataInfo->contentScale = utils::atof(value.c_str());
} }
else if ( 0 == key.compare(ARMATURE_DATA)) else if ( 0 == key.compare(ARMATURE_DATA))
{ {
@ -1879,7 +1880,7 @@ void DataReaderHelper::decodeNode(BaseData *node, const rapidjson::Value& json,
armatureData->name = name; armatureData->name = name;
} }
float version = atof(pAramtureDataArray[1].GetValue(cocoLoader)); float version = utils::atof(pAramtureDataArray[1].GetValue(cocoLoader));
dataInfo->cocoStudioVersion = armatureData->dataVersion = version; //DICTOOL->getFloatValue_json(json, VERSION, 0.1f); dataInfo->cocoStudioVersion = armatureData->dataVersion = version; //DICTOOL->getFloatValue_json(json, VERSION, 0.1f);
int length = pAramtureDataArray[3].GetChildNum(); //DICTOOL->getArrayCount_json(json, BONE_DATA, 0); int length = pAramtureDataArray[3].GetChildNum(); //DICTOOL->getArrayCount_json(json, BONE_DATA, 0);
@ -1989,27 +1990,27 @@ void DataReaderHelper::decodeNode(BaseData *node, const rapidjson::Value& json,
str = SkinDataValue[i].GetValue(cocoLoader); str = SkinDataValue[i].GetValue(cocoLoader);
if (key.compare(A_X) == 0) if (key.compare(A_X) == 0)
{ {
sdd->skinData.x = atof(str) * s_PositionReadScale; sdd->skinData.x = utils::atof(str) * s_PositionReadScale;
} }
else if (key.compare(A_Y) == 0) else if (key.compare(A_Y) == 0)
{ {
sdd->skinData.y = atof(str) * s_PositionReadScale; sdd->skinData.y = utils::atof(str) * s_PositionReadScale;
} }
else if (key.compare(A_SCALE_X) == 0) else if (key.compare(A_SCALE_X) == 0)
{ {
sdd->skinData.scaleX = atof(str); sdd->skinData.scaleX = utils::atof(str);
} }
else if (key.compare(A_SCALE_Y) == 0) else if (key.compare(A_SCALE_Y) == 0)
{ {
sdd->skinData.scaleY = atof(str); sdd->skinData.scaleY = utils::atof(str);
} }
else if (key.compare(A_SKEW_X) == 0) else if (key.compare(A_SKEW_X) == 0)
{ {
sdd->skinData.skewX = atof(str); sdd->skinData.skewX = utils::atof(str);
} }
else if (key.compare(A_SKEW_Y) == 0) else if (key.compare(A_SKEW_Y) == 0)
{ {
sdd->skinData.skewY = atof(str); sdd->skinData.skewY = utils::atof(str);
} }
} }
@ -2168,7 +2169,7 @@ void DataReaderHelper::decodeNode(BaseData *node, const rapidjson::Value& json,
movementData->scale = 1.0; movementData->scale = 1.0;
if(str != nullptr) if(str != nullptr)
{ {
movementData->scale = atof(str); movementData->scale = utils::atof(str);
} }
} }
else if (key.compare(A_TWEEN_EASING) == 0) else if (key.compare(A_TWEEN_EASING) == 0)
@ -2220,7 +2221,7 @@ void DataReaderHelper::decodeNode(BaseData *node, const rapidjson::Value& json,
{ {
if(str != nullptr) if(str != nullptr)
{ {
movementBoneData->delay = atof(str); movementBoneData->delay = utils::atof(str);
} }
} }
else if (key.compare(FRAME_DATA) == 0) else if (key.compare(FRAME_DATA) == 0)
@ -2382,7 +2383,7 @@ void DataReaderHelper::decodeNode(BaseData *node, const rapidjson::Value& json,
str = pFrameData[ii].GetValue(cocoLoader); str = pFrameData[ii].GetValue(cocoLoader);
if (str != nullptr) if (str != nullptr)
{ {
frameData->easingParams[ii] = atof(str); frameData->easingParams[ii] = utils::atof(str);
} }
} }
} }
@ -2421,28 +2422,28 @@ void DataReaderHelper::decodeNode(BaseData *node, const rapidjson::Value& json,
{ {
if(str != nullptr) if(str != nullptr)
{ {
textureData->width = atof(str); textureData->width = utils::atof(str);
} }
} }
else if (key.compare(A_HEIGHT) == 0) else if (key.compare(A_HEIGHT) == 0)
{ {
if(str != nullptr) if(str != nullptr)
{ {
textureData->height = atof(str); textureData->height = utils::atof(str);
} }
} }
else if (key.compare(A_PIVOT_X) == 0) else if (key.compare(A_PIVOT_X) == 0)
{ {
if(str != nullptr) if(str != nullptr)
{ {
textureData->pivotX = atof(str); textureData->pivotX = utils::atof(str);
} }
} }
else if (key.compare(A_PIVOT_Y) == 0) else if (key.compare(A_PIVOT_Y) == 0)
{ {
if(str != nullptr) if(str != nullptr)
{ {
textureData->pivotY = atof(str); textureData->pivotY = utils::atof(str);
} }
} }
else if (key.compare(CONTOUR_DATA) == 0) else if (key.compare(CONTOUR_DATA) == 0)
@ -2481,8 +2482,8 @@ void DataReaderHelper::decodeNode(BaseData *node, const rapidjson::Value& json,
{ {
pVerTexPoint = pVerTexPointArray[ii].GetChildArray(cocoLoader); pVerTexPoint = pVerTexPointArray[ii].GetChildArray(cocoLoader);
Vec2 vertex; Vec2 vertex;
vertex.x = atof(pVerTexPoint[0].GetValue(cocoLoader)); vertex.x = utils::atof(pVerTexPoint[0].GetValue(cocoLoader));
vertex.y = atof(pVerTexPoint[1].GetValue(cocoLoader)); vertex.y = utils::atof(pVerTexPoint[1].GetValue(cocoLoader));
contourData->vertexList.push_back(vertex); } contourData->vertexList.push_back(vertex); }
break; break;
} }
@ -2505,11 +2506,11 @@ void DataReaderHelper::decodeNode(BaseData *node, const rapidjson::Value& json,
str = child->GetValue(cocoLoader); str = child->GetValue(cocoLoader);
if (key.compare(A_X) == 0) if (key.compare(A_X) == 0)
{ {
node->x = atof(str) * dataInfo->contentScale; node->x = utils::atof(str) * dataInfo->contentScale;
} }
else if (key.compare(A_Y) == 0) else if (key.compare(A_Y) == 0)
{ {
node->y = atof(str) * dataInfo->contentScale; node->y = utils::atof(str) * dataInfo->contentScale;
} }
else if (key.compare(A_Z) == 0) else if (key.compare(A_Z) == 0)
{ {
@ -2517,19 +2518,19 @@ void DataReaderHelper::decodeNode(BaseData *node, const rapidjson::Value& json,
} }
else if (key.compare(A_SKEW_X) == 0) else if (key.compare(A_SKEW_X) == 0)
{ {
node->skewX = atof(str); node->skewX = utils::atof(str);
} }
else if (key.compare(A_SKEW_Y) == 0) else if (key.compare(A_SKEW_Y) == 0)
{ {
node->skewY = atof(str); node->skewY = utils::atof(str);
} }
else if (key.compare(A_SCALE_X) == 0) else if (key.compare(A_SCALE_X) == 0)
{ {
node->scaleX = atof(str); node->scaleX = utils::atof(str);
} }
else if (key.compare(A_SCALE_Y) == 0) else if (key.compare(A_SCALE_Y) == 0)
{ {
node->scaleY = atof(str); node->scaleY = utils::atof(str);
} }
else if (key.compare(COLOR_INFO) == 0) else if (key.compare(COLOR_INFO) == 0)
{ {

View File

@ -1241,9 +1241,9 @@ Widget* WidgetPropertiesReader0300::createWidget(const rapidjson::Value& data, c
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(file); SpriteFrameCache::getInstance()->addSpriteFramesWithFile(file);
} }
}else if (key == "designWidth"){ }else if (key == "designWidth"){
fileDesignWidth = atof(tpChildArray[i].GetValue(cocoLoader)); fileDesignWidth = utils::atof(tpChildArray[i].GetValue(cocoLoader));
}else if (key == "designHeight"){ }else if (key == "designHeight"){
fileDesignHeight = atof(tpChildArray[i].GetValue(cocoLoader)); fileDesignHeight = utils::atof(tpChildArray[i].GetValue(cocoLoader));
}else if (key == "widgetTree"){ }else if (key == "widgetTree"){
if (fileDesignWidth <= 0 || fileDesignHeight <= 0) { if (fileDesignWidth <= 0 || fileDesignHeight <= 0) {

View File

@ -510,12 +510,12 @@ void SceneReader::setPropertyFromJsonDict(CocoLoader *cocoLoader, stExpCocoNode
if (key == "x") if (key == "x")
{ {
x = atof(value.c_str()); x = utils::atof(value.c_str());
node->setPositionX(x); node->setPositionX(x);
} }
else if (key == "y") else if (key == "y")
{ {
y = atof(value.c_str()); y = utils::atof(value.c_str());
node->setPositionY(y); node->setPositionY(y);
} }
else if (key == "visible") else if (key == "visible")
@ -535,7 +535,7 @@ void SceneReader::setPropertyFromJsonDict(CocoLoader *cocoLoader, stExpCocoNode
} }
else if(key == "scalex") else if(key == "scalex")
{ {
fScaleX = atof(value.c_str()); fScaleX = utils::atof(value.c_str());
node->setScaleX(fScaleX); node->setScaleX(fScaleX);
} }
else if(key == "scaley") else if(key == "scaley")
@ -545,7 +545,7 @@ void SceneReader::setPropertyFromJsonDict(CocoLoader *cocoLoader, stExpCocoNode
} }
else if(key == "rotation") else if(key == "rotation")
{ {
fRotationZ = atof(value.c_str()); fRotationZ = utils::atof(value.c_str());
node->setRotation(fRotationZ); node->setRotation(fRotationZ);
} }
} }

View File

@ -191,7 +191,7 @@ bool TriggerMng::isEmpty(void) const
} }
void TriggerMng::buildJson(rapidjson::Document &document, cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode) void TriggerMng::buildJson(rapidjson::Document &document, cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode)
{ {
int count = pCocoNode[13].GetChildNum(); int count = pCocoNode[13].GetChildNum();
int length = 0; int length = 0;
@ -262,15 +262,15 @@ bool TriggerMng::isEmpty(void) const
} }
else else
{ {
rapidjson::Type type = pDataItemArray[i4].GetType(pCocoLoader); rapidjson::Type type = pDataItemArray[i5].GetType(pCocoLoader);
if (type == rapidjson::kStringType) if (type == rapidjson::kStringType)
{ {
dataitem.AddMember("value", str3, allocator); dataitem.AddMember("value", str3, allocator);
} }
else if(type == rapidjson::kNumberType) else
{ {
int nV = atoi(str3); int nV = atoi(str3);
float fV = atof(str3); float fV = utils::atof(str3);
if (fabs(nV - fV) < 0.0000001) if (fabs(nV - fV) < 0.0000001)
{ {
dataitem.AddMember("value", nV, allocator); dataitem.AddMember("value", nV, allocator);
@ -343,10 +343,10 @@ bool TriggerMng::isEmpty(void) const
{ {
dataitem.AddMember("value", str5, allocator); dataitem.AddMember("value", str5, allocator);
} }
else if(type == rapidjson::kNumberType) else
{ {
int nV = atoi(str5); int nV = atoi(str5);
float fV = atof(str5); float fV = utils::atof(str5);
if (fabs(nV - fV) < 0.0000001) if (fabs(nV - fV) < 0.0000001)
{ {
dataitem.AddMember("value", nV, allocator); dataitem.AddMember("value", nV, allocator);

View File

@ -241,98 +241,98 @@ void TriggerObj::serialize(const rapidjson::Value &val)
} }
void TriggerObj::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode) void TriggerObj::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCocoNode *pCocoNode)
{
int length = pCocoNode->GetChildNum();
int count = 0;
int num = 0;
stExpCocoNode *pTriggerObjArray = pCocoNode->GetChildArray(pCocoLoader);
for (int i0 = 0; i0 < length; ++i0)
{ {
int length = pCocoNode->GetChildNum(); std::string key = pTriggerObjArray[i0].GetName(pCocoLoader);
int count = 0; const char* str0 = pTriggerObjArray[i0].GetValue(pCocoLoader);
int num = 0; if (key.compare("id") == 0)
stExpCocoNode *pTriggerObjArray = pCocoNode->GetChildArray(pCocoLoader);
for (int i0 = 0; i0 < length; ++i0)
{ {
std::string key = pTriggerObjArray[i0].GetName(pCocoLoader); if (str0 != nullptr)
const char* str0 = pTriggerObjArray[i0].GetValue(pCocoLoader);
if (key.compare("id") == 0)
{ {
if (str0 != nullptr) _id = atoi(str0);
{
_id = atoi(str0); //(unsigned int)(DICTOOL->getIntValue_json(val, "id"));
}
} }
else if (key.compare("conditions") == 0) }
else if (key.compare("conditions") == 0)
{
count = pTriggerObjArray[i0].GetChildNum();
stExpCocoNode *pConditionsArray = pTriggerObjArray[i0].GetChildArray(pCocoLoader);
for (int i1 = 0; i1 < count; ++i1)
{ {
count = pTriggerObjArray[i0].GetChildNum(); num = pConditionsArray[i1].GetChildNum();
stExpCocoNode *pConditionsArray = pTriggerObjArray[i0].GetChildArray(pCocoLoader); stExpCocoNode *pConditionArray = pConditionsArray[i1].GetChildArray(pCocoLoader);
for (int i1 = 0; i1 < count; ++i1) const char *classname = pConditionArray[0].GetValue(pCocoLoader);
if (classname == nullptr)
{ {
num = pConditionsArray[i1].GetChildNum(); continue;
stExpCocoNode *pConditionArray = pConditionsArray[i1].GetChildArray(pCocoLoader);
const char *classname = pConditionArray[0].GetValue(pCocoLoader);
if (classname == nullptr)
{
continue;
}
BaseTriggerCondition *con = dynamic_cast<BaseTriggerCondition*>(ObjectFactory::getInstance()->createObject(classname));
CCAssert(con != nullptr, "class named classname can not implement!");
con->serialize(pCocoLoader, &pConditionArray[1]);
con->init();
_cons.pushBack(con);
} }
BaseTriggerCondition *con = dynamic_cast<BaseTriggerCondition*>(ObjectFactory::getInstance()->createObject(classname));
CCAssert(con != nullptr, "class named classname can not implement!");
con->serialize(pCocoLoader, &pConditionArray[1]);
con->init();
_cons.pushBack(con);
} }
else if (key.compare("actions") == 0) }
else if (key.compare("actions") == 0)
{
count = pTriggerObjArray[i0].GetChildNum();
stExpCocoNode *pActionsArray = pTriggerObjArray[i0].GetChildArray(pCocoLoader);
for (int i2 = 0; i2 < count; ++i2)
{ {
count = pTriggerObjArray[i0].GetChildNum(); num = pActionsArray[i2].GetChildNum();
stExpCocoNode *pActionsArray = pTriggerObjArray[i0].GetChildArray(pCocoLoader); stExpCocoNode *pActionArray = pActionsArray[i2].GetChildArray(pCocoLoader);
for (int i2 = 0; i2 < count; ++i2) const char *classname = pActionArray[0].GetValue(pCocoLoader);
if (classname == nullptr)
{ {
num = pActionsArray[i2].GetChildNum(); continue;
stExpCocoNode *pActionArray = pActionsArray[i2].GetChildArray(pCocoLoader);
const char *classname = pActionArray[0].GetValue(pCocoLoader);
if (classname == nullptr)
{
continue;
}
BaseTriggerAction *act = dynamic_cast<BaseTriggerAction*>(ObjectFactory::getInstance()->createObject(classname));
CCAssert(act != nullptr, "class named classname can not implement!");
act->serialize(pCocoLoader, &pActionArray[1]);
act->init();
_acts.pushBack(act);
} }
BaseTriggerAction *act = dynamic_cast<BaseTriggerAction*>(ObjectFactory::getInstance()->createObject(classname));
CCAssert(act != nullptr, "class named classname can not implement!");
act->serialize(pCocoLoader, &pActionArray[1]);
act->init();
_acts.pushBack(act);
} }
else if (key.compare("events") == 0) }
else if (key.compare("events") == 0)
{
count = pTriggerObjArray[i0].GetChildNum();
stExpCocoNode *pEventsArray = pTriggerObjArray[i0].GetChildArray(pCocoLoader);
for (int i3 = 0; i3 < count; ++i3)
{ {
count = pTriggerObjArray[i0].GetChildNum(); num = pEventsArray[i3].GetChildNum();
stExpCocoNode *pEventsArray = pTriggerObjArray[i0].GetChildArray(pCocoLoader); stExpCocoNode *pEventArray = pEventsArray[i3].GetChildArray(pCocoLoader);
for (int i3 = 0; i3 < count; ++i3) const char *str1 = pEventArray[0].GetValue(pCocoLoader);
if (str1 == nullptr)
{ {
num = pEventsArray[i3].GetChildNum(); continue;
stExpCocoNode *pEventArray = pEventsArray[i3].GetChildArray(pCocoLoader);
const char *str1 = pEventArray[0].GetValue(pCocoLoader);
if (str1 == nullptr)
{
continue;
}
int event = atoi(str1);
if (event < 0)
{
continue;
}
char* buf = new char[10];
sprintf(buf, "%d", event);
std::string custom_event_name(buf);
CC_SAFE_DELETE_ARRAY(buf);
EventListenerCustom* listener = EventListenerCustom::create(custom_event_name, [=](EventCustom* evt){
if (detect())
{
done();
}
});
_listeners.pushBack(listener);
TriggerMng::getInstance()->addEventListenerWithFixedPriority(listener, 1);
} }
int event = atoi(str1);
if (event < 0)
{
continue;
}
char* buf = new char[10];
sprintf(buf, "%d", event);
std::string custom_event_name(buf);
CC_SAFE_DELETE_ARRAY(buf);
EventListenerCustom* listener = EventListenerCustom::create(custom_event_name, [=](EventCustom* evt){
if (detect())
{
done();
}
});
_listeners.pushBack(listener);
TriggerMng::getInstance()->addEventListenerWithFixedPriority(listener, 1);
} }
} }
} }
}

View File

@ -87,7 +87,7 @@ namespace cocostudio
}; };
valueToFloat = [=](const std::string& str) -> float{ valueToFloat = [=](const std::string& str) -> float{
return atof(str.c_str()); return utils::atof(str.c_str());
}; };
} }

View File

@ -31,6 +31,7 @@ THE SOFTWARE.
#include "base/ccMacros.h" #include "base/ccMacros.h"
#include "base/CCDirector.h" #include "base/CCDirector.h"
#include "platform/CCSAXParser.h" #include "platform/CCSAXParser.h"
#include "base/ccUtils.h"
#include "tinyxml2.h" #include "tinyxml2.h"
#include "unzip.h" #include "unzip.h"
@ -257,7 +258,7 @@ public:
else if (sName == "integer") else if (sName == "integer")
_curArray->push_back(Value(atoi(_curValue.c_str()))); _curArray->push_back(Value(atoi(_curValue.c_str())));
else else
_curArray->push_back(Value(atof(_curValue.c_str()))); _curArray->push_back(Value(utils::atof(_curValue.c_str())));
} }
else if (SAX_DICT == curState) else if (SAX_DICT == curState)
{ {
@ -266,7 +267,7 @@ public:
else if (sName == "integer") else if (sName == "integer")
(*_curDict)[_curKey] = Value(atoi(_curValue.c_str())); (*_curDict)[_curKey] = Value(atoi(_curValue.c_str()));
else else
(*_curDict)[_curKey] = Value(atof(_curValue.c_str())); (*_curDict)[_curKey] = Value(utils::atof(_curValue.c_str()));
} }
_curValue.clear(); _curValue.clear();
@ -765,13 +766,16 @@ void FileUtils::setSearchResolutionsOrder(const std::vector<std::string>& search
} }
} }
void FileUtils::addSearchResolutionsOrder(const std::string &order) void FileUtils::addSearchResolutionsOrder(const std::string &order,const bool front)
{ {
std::string resOrder = order; std::string resOrder = order;
if (!resOrder.empty() && resOrder[resOrder.length()-1] != '/') if (!resOrder.empty() && resOrder[resOrder.length()-1] != '/')
resOrder.append("/"); resOrder.append("/");
if (front) {
_searchResolutionsOrderArray.push_back(resOrder); _searchResolutionsOrderArray.insert(_searchResolutionsOrderArray.begin(), resOrder);
} else {
_searchResolutionsOrderArray.push_back(resOrder);
}
} }
const std::vector<std::string>& FileUtils::getSearchResolutionsOrder() const std::vector<std::string>& FileUtils::getSearchResolutionsOrder()
@ -818,7 +822,7 @@ void FileUtils::setSearchPaths(const std::vector<std::string>& searchPaths)
} }
} }
void FileUtils::addSearchPath(const std::string &searchpath) void FileUtils::addSearchPath(const std::string &searchpath,const bool front)
{ {
std::string prefix; std::string prefix;
if (!isAbsolutePath(searchpath)) if (!isAbsolutePath(searchpath))
@ -829,7 +833,11 @@ void FileUtils::addSearchPath(const std::string &searchpath)
{ {
path += "/"; path += "/";
} }
_searchPathArray.push_back(path); if (front) {
_searchPathArray.insert(_searchPathArray.begin(), path);
} else {
_searchPathArray.push_back(path);
}
} }
void FileUtils::setFilenameLookupDictionary(const ValueMap& filenameLookupDict) void FileUtils::setFilenameLookupDictionary(const ValueMap& filenameLookupDict)

View File

@ -229,7 +229,7 @@ public:
* @see setSearchResolutionsOrder(), fullPathForFilename(). * @see setSearchResolutionsOrder(), fullPathForFilename().
* @since v2.1 * @since v2.1
*/ */
virtual void addSearchResolutionsOrder(const std::string &order); virtual void addSearchResolutionsOrder(const std::string &order,const bool front=false);
/** /**
* Gets the array that contains the search order of the resources. * Gets the array that contains the search order of the resources.
@ -266,7 +266,7 @@ public:
* *
* @since v2.1 * @since v2.1
*/ */
void addSearchPath(const std::string & path); void addSearchPath(const std::string & path, const bool front=false);
/** /**
* Gets the array of search paths. * Gets the array of search paths.

View File

@ -270,7 +270,7 @@ public abstract class GameControllerActivity extends Cocos2dxActivity implements
mControllerOuya.onResume(); mControllerOuya.onResume();
} }
mControllerHelper.gatherControllers(); GameControllerHelper.gatherControllers(mControllerHelper.mGameController);
} }
@Override @Override

View File

@ -80,6 +80,7 @@ public class GameControllerHelper {
int deviceId = event.getDeviceId(); int deviceId = event.getDeviceId();
String deviceName = event.getDevice().getName(); String deviceName = event.getDevice().getName();
if(mGameController.get(deviceId) == null){ if(mGameController.get(deviceId) == null){
gatherControllers(mGameController);
mGameController.append(deviceId, deviceName); mGameController.append(deviceId, deviceName);
} }
@ -167,6 +168,7 @@ public class GameControllerHelper {
String deviceName = event.getDevice().getName(); String deviceName = event.getDevice().getName();
if(mGameController.get(deviceId) == null){ if(mGameController.get(deviceId) == null){
gatherControllers(mGameController);
mGameController.append(deviceId, deviceName); mGameController.append(deviceId, deviceName);
} }
@ -224,7 +226,7 @@ public class GameControllerHelper {
} }
void onInputDeviceChanged(int deviceId){ void onInputDeviceChanged(int deviceId){
gatherControllers(); gatherControllers(mGameController);
} }
void onInputDeviceRemoved(int deviceId) { void onInputDeviceRemoved(int deviceId) {
@ -234,20 +236,20 @@ public class GameControllerHelper {
} }
} }
void gatherControllers(){ static void gatherControllers(SparseArray<String> controllers){
int controllerCount = mGameController.size(); int controllerCount = controllers.size();
for (int i = 0; i < controllerCount; i++) { for (int i = 0; i < controllerCount; i++) {
try { try {
int controllerDeveceId = mGameController.keyAt(i); int controllerDeveceId = controllers.keyAt(i);
InputDevice device = InputDevice.getDevice(controllerDeveceId); InputDevice device = InputDevice.getDevice(controllerDeveceId);
if (device == null) { if (device == null) {
GameControllerAdapter.onDisconnected(mGameController.get(controllerDeveceId), controllerDeveceId); GameControllerAdapter.onDisconnected(controllers.get(controllerDeveceId), controllerDeveceId);
mGameController.delete(controllerDeveceId); controllers.delete(controllerDeveceId);
} }
} catch (Exception e) { } catch (Exception e) {
int controllerDeveceId = mGameController.keyAt(i); int controllerDeveceId = controllers.keyAt(i);
GameControllerAdapter.onDisconnected(mGameController.get(controllerDeveceId), controllerDeveceId); GameControllerAdapter.onDisconnected(controllers.get(controllerDeveceId), controllerDeveceId);
mGameController.delete(controllerDeveceId); controllers.delete(controllerDeveceId);
e.printStackTrace(); e.printStackTrace();
} }
} }

View File

@ -113,7 +113,7 @@ OnSimpleStickListener, OnAccListener, OnGyroListener, OnStateListener, GameContr
{ {
if( !mControllerService.hasDeviceConnected() ){ if( !mControllerService.hasDeviceConnected() ){
Bundle bun = new Bundle(); Bundle bun = new Bundle();
bun.putBoolean(ControllerService.FLAG_IS_SHOW_GAMEPAD_TIP, true); bun.putBoolean(ControllerService.FLAG_IS_SHOW_GAMEPAD_TIP, false);
try { try {
mControllerService.showDeviceManagerUI(mContext, bun); mControllerService.showDeviceManagerUI(mContext, bun);
} catch (ControllerServiceException e) { } catch (ControllerServiceException e) {

View File

@ -5,6 +5,7 @@ import org.cocos2dx.lib.GameControllerDelegate;
import tv.ouya.console.api.OuyaController; import tv.ouya.console.api.OuyaController;
import android.content.Context; import android.content.Context;
import android.util.SparseArray;
import android.util.SparseIntArray; import android.util.SparseIntArray;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.MotionEvent; import android.view.MotionEvent;
@ -13,6 +14,8 @@ public class GameControllerOuya implements GameControllerDelegate{
private SparseIntArray mKeyMap; private SparseIntArray mKeyMap;
private SparseArray<String> mGameController = new SparseArray<String>();
public GameControllerOuya(){ public GameControllerOuya(){
mKeyMap = new SparseIntArray(20); mKeyMap = new SparseIntArray(20);
mKeyMap.put(OuyaController.BUTTON_A, GameControllerDelegate.BUTTON_B); mKeyMap.put(OuyaController.BUTTON_A, GameControllerDelegate.BUTTON_B);
@ -25,13 +28,9 @@ public class GameControllerOuya implements GameControllerDelegate{
mKeyMap.put(OuyaController.BUTTON_DPAD_UP, GameControllerDelegate.BUTTON_DPAD_UP); mKeyMap.put(OuyaController.BUTTON_DPAD_UP, GameControllerDelegate.BUTTON_DPAD_UP);
mKeyMap.put(OuyaController.BUTTON_L1, GameControllerDelegate.BUTTON_LEFT_SHOULDER); mKeyMap.put(OuyaController.BUTTON_L1, GameControllerDelegate.BUTTON_LEFT_SHOULDER);
mKeyMap.put(OuyaController.BUTTON_R1, GameControllerDelegate.BUTTON_RIGHT_SHOULDER); mKeyMap.put(OuyaController.BUTTON_R1, GameControllerDelegate.BUTTON_RIGHT_SHOULDER);
mKeyMap.put(OuyaController.AXIS_L2, GameControllerDelegate.BUTTON_LEFT_TRIGGER);
mKeyMap.put(OuyaController.AXIS_R2, GameControllerDelegate.BUTTON_RIGHT_TRIGGER);
mKeyMap.put(OuyaController.AXIS_LS_X, GameControllerDelegate.BUTTON_LEFT_THUMBSTICK); mKeyMap.put(OuyaController.BUTTON_L3, GameControllerDelegate.BUTTON_LEFT_THUMBSTICK);
mKeyMap.put(OuyaController.AXIS_LS_Y, GameControllerDelegate.BUTTON_LEFT_THUMBSTICK); mKeyMap.put(OuyaController.BUTTON_R3, GameControllerDelegate.BUTTON_RIGHT_THUMBSTICK);
mKeyMap.put(OuyaController.AXIS_RS_X, GameControllerDelegate.BUTTON_RIGHT_THUMBSTICK);
mKeyMap.put(OuyaController.AXIS_RS_Y, GameControllerDelegate.BUTTON_RIGHT_THUMBSTICK);
} }
public void onCreate(Context context) { public void onCreate(Context context) {
@ -61,7 +60,11 @@ public class GameControllerOuya implements GameControllerDelegate{
{ {
int deviceId = event.getDeviceId(); int deviceId = event.getDeviceId();
String deviceName = event.getDevice().getName(); String deviceName = event.getDevice().getName();
OuyaController c = OuyaController.getControllerByDeviceId(deviceId); OuyaController c = OuyaController.getControllerByDeviceId(deviceId);
if (mGameController.get(deviceId) == null) {
GameControllerHelper.gatherControllers(mGameController);
mGameController.append(deviceId, deviceName);
}
float newLeftTrigger = c.getAxisValue(OuyaController.AXIS_L2); float newLeftTrigger = c.getAxisValue(OuyaController.AXIS_L2);
if (Float.compare(newLeftTrigger, mOldLeftTrigger) != 0) { if (Float.compare(newLeftTrigger, mOldLeftTrigger) != 0) {
@ -125,10 +128,6 @@ public class GameControllerOuya implements GameControllerDelegate{
int action = event.getAction(); int action = event.getAction();
int keyCode = event.getKeyCode(); int keyCode = event.getKeyCode();
if (keyCode == KeyEvent.KEYCODE_BUTTON_L2 || keyCode == KeyEvent.KEYCODE_BUTTON_R2) {
return true;
}
if (action == KeyEvent.ACTION_DOWN) { if (action == KeyEvent.ACTION_DOWN) {
handled = OuyaController.onKeyDown(keyCode, event); handled = OuyaController.onKeyDown(keyCode, event);
} }
@ -143,10 +142,17 @@ public class GameControllerOuya implements GameControllerDelegate{
isAnalog = true; isAnalog = true;
} }
int deviceId = event.getDeviceId();
String deviceName = event.getDevice().getName();
if (mGameController.get(deviceId) == null) {
GameControllerHelper.gatherControllers(mGameController);
mGameController.append(deviceId, deviceName);
}
if (action == KeyEvent.ACTION_DOWN) { if (action == KeyEvent.ACTION_DOWN) {
mControllerEventListener.onButtonEvent(event.getDevice().getName(), event.getDeviceId(), mKeyMap.get(keyCode), true, 1.0f, isAnalog); mControllerEventListener.onButtonEvent(deviceName, deviceId, mKeyMap.get(keyCode), true, 1.0f, isAnalog);
}else { }else {
mControllerEventListener.onButtonEvent(event.getDevice().getName(), event.getDeviceId(), mKeyMap.get(keyCode), false, 0.0f, isAnalog); mControllerEventListener.onButtonEvent(deviceName, deviceId, mKeyMap.get(keyCode), false, 0.0f, isAnalog);
} }
} }

View File

@ -30,6 +30,7 @@ THE SOFTWARE.
#include "base/CCEventKeyboard.h" #include "base/CCEventKeyboard.h"
#include "base/CCEventMouse.h" #include "base/CCEventMouse.h"
#include "base/CCIMEDispatcher.h" #include "base/CCIMEDispatcher.h"
#include "base/ccUtils.h"
#include <unordered_map> #include <unordered_map>
@ -356,7 +357,7 @@ bool GLView::initWithRect(const std::string& viewName, Rect rect, float frameZoo
// check OpenGL version at first // check OpenGL version at first
const GLubyte* glVersion = glGetString(GL_VERSION); const GLubyte* glVersion = glGetString(GL_VERSION);
if ( atof((const char*)glVersion) < 1.5 ) if ( utils::atof((const char*)glVersion) < 1.5 )
{ {
char strComplain[256] = {0}; char strComplain[256] = {0};
sprintf(strComplain, sprintf(strComplain,

File diff suppressed because it is too large Load Diff

View File

@ -5,10 +5,8 @@
-- @parent_module cc -- @parent_module cc
-------------------------------- --------------------------------
-- overload function: setEye(float, float, float) -- @overload self, float, float, float
-- -- @overload self, vec3_table
-- overload function: setEye(vec3_table)
--
-- @function [parent=#ActionCamera] setEye -- @function [parent=#ActionCamera] setEye
-- @param self -- @param self
-- @param #float float -- @param #float float

View File

@ -5,10 +5,8 @@
-- @parent_module ccs -- @parent_module ccs
-------------------------------- --------------------------------
-- overload function: getAction(float, ccs.ActionFrame) -- @overload self, float, ccs.ActionFrame
-- -- @overload self, float
-- overload function: getAction(float)
--
-- @function [parent=#ActionFrame] getAction -- @function [parent=#ActionFrame] getAction
-- @param self -- @param self
-- @param #float float -- @param #float float

View File

@ -5,10 +5,8 @@
-- @parent_module ccs -- @parent_module ccs
-------------------------------- --------------------------------
-- overload function: playActionByName(char, char, cc.CallFunc) -- @overload self, char, char, cc.CallFunc
-- -- @overload self, char, char
-- overload function: playActionByName(char, char)
--
-- @function [parent=#ActionManagerEx] playActionByName -- @function [parent=#ActionManagerEx] playActionByName
-- @param self -- @param self
-- @param #char char -- @param #char char
@ -23,14 +21,6 @@
-- @param #char char -- @param #char char
-- @return ActionObject#ActionObject ret (return value: ccs.ActionObject) -- @return ActionObject#ActionObject ret (return value: ccs.ActionObject)
--------------------------------
-- @function [parent=#ActionManagerEx] initWithBinary
-- @param self
-- @param #char char
-- @param #cc.Ref ref
-- @param #ccs.CocoLoader cocoloader
-- @param #ccs.stExpCocoNode stexpcoconode
-------------------------------- --------------------------------
-- @function [parent=#ActionManagerEx] releaseActions -- @function [parent=#ActionManagerEx] releaseActions
-- @param self -- @param self

View File

@ -38,10 +38,8 @@
-- @param self -- @param self
-------------------------------- --------------------------------
-- overload function: play(cc.CallFunc) -- @overload self, cc.CallFunc
-- -- @overload self
-- overload function: play()
--
-- @function [parent=#ActionObject] play -- @function [parent=#ActionObject] play
-- @param self -- @param self
-- @param #cc.CallFunc callfunc -- @param #cc.CallFunc callfunc
@ -61,13 +59,6 @@
-- @param self -- @param self
-- @return bool#bool ret (return value: bool) -- @return bool#bool ret (return value: bool)
--------------------------------
-- @function [parent=#ActionObject] initWithBinary
-- @param self
-- @param #ccs.CocoLoader cocoloader
-- @param #ccs.stExpCocoNode stexpcoconode
-- @param #cc.Ref ref
-------------------------------- --------------------------------
-- @function [parent=#ActionObject] addActionNode -- @function [parent=#ActionObject] addActionNode
-- @param self -- @param self

View File

@ -10,10 +10,8 @@
-- @param #float float -- @param #float float
-------------------------------- --------------------------------
-- overload function: getAction(float, ccs.ActionFrame) -- @overload self, float, ccs.ActionFrame
-- -- @overload self, float
-- overload function: getAction(float)
--
-- @function [parent=#ActionRotationFrame] getAction -- @function [parent=#ActionRotationFrame] getAction
-- @param self -- @param self
-- @param #float float -- @param #float float

View File

@ -83,14 +83,10 @@
-- @return bool#bool ret (return value: bool) -- @return bool#bool ret (return value: bool)
-------------------------------- --------------------------------
-- overload function: gotoFrameAndPlay(int, bool) -- @overload self, int, bool
-- -- @overload self, int
-- overload function: gotoFrameAndPlay(int) -- @overload self, int, int, bool
-- -- @overload self, int, int, int, bool
-- overload function: gotoFrameAndPlay(int, int, bool)
--
-- overload function: gotoFrameAndPlay(int, int, int, bool)
--
-- @function [parent=#ActionTimeline] gotoFrameAndPlay -- @function [parent=#ActionTimeline] gotoFrameAndPlay
-- @param self -- @param self
-- @param #int int -- @param #int int

View File

@ -5,10 +5,8 @@
-- @parent_module cc -- @parent_module cc
-------------------------------- --------------------------------
-- overload function: getAnimation() -- @overload self
-- -- @overload self
-- overload function: getAnimation()
--
-- @function [parent=#Animate] getAnimation -- @function [parent=#Animate] getAnimation
-- @param self -- @param self
-- @return Animation#Animation ret (retunr value: cc.Animation) -- @return Animation#Animation ret (retunr value: cc.Animation)

View File

@ -25,10 +25,8 @@
-- @return float#float ret (return value: float) -- @return float#float ret (return value: float)
-------------------------------- --------------------------------
-- overload function: create(cc.Animation3D, float, float) -- @overload self, cc.Animation3D, float, float
-- -- @overload self, cc.Animation3D
-- overload function: create(cc.Animation3D)
--
-- @function [parent=#Animate3D] create -- @function [parent=#Animate3D] create
-- @param self -- @param self
-- @param #cc.Animation3D animation3d -- @param #cc.Animation3D animation3d

View File

@ -76,10 +76,8 @@
-- @param #rect_table rect -- @param #rect_table rect
-------------------------------- --------------------------------
-- overload function: create(array_table, float, unsigned int) -- @overload self, array_table, float, unsigned int
-- -- @overload self
-- overload function: create()
--
-- @function [parent=#Animation] create -- @function [parent=#Animation] create
-- @param self -- @param self
-- @param #array_table array -- @param #array_table array

View File

@ -10,10 +10,8 @@
-- @param #cc.SpriteFrame spriteframe -- @param #cc.SpriteFrame spriteframe
-------------------------------- --------------------------------
-- overload function: getUserInfo() -- @overload self
-- -- @overload self
-- overload function: getUserInfo()
--
-- @function [parent=#AnimationFrame] getUserInfo -- @function [parent=#AnimationFrame] getUserInfo
-- @param self -- @param self
-- @return map_table#map_table ret (retunr value: map_table) -- @return map_table#map_table ret (retunr value: map_table)

View File

@ -59,12 +59,9 @@
-- @return BatchNode#BatchNode ret (return value: ccs.BatchNode) -- @return BatchNode#BatchNode ret (return value: ccs.BatchNode)
-------------------------------- --------------------------------
-- overload function: init(string) -- @overload self, string
-- -- @overload self
-- overload function: init() -- @overload self, string, ccs.Bone
--
-- overload function: init(string, ccs.Bone)
--
-- @function [parent=#Armature] init -- @function [parent=#Armature] init
-- @param self -- @param self
-- @param #string str -- @param #string str
@ -117,12 +114,9 @@
-- @return map_table#map_table ret (return value: map_table) -- @return map_table#map_table ret (return value: map_table)
-------------------------------- --------------------------------
-- overload function: create(string) -- @overload self, string
-- -- @overload self
-- overload function: create() -- @overload self, string, ccs.Bone
--
-- overload function: create(string, ccs.Bone)
--
-- @function [parent=#Armature] create -- @function [parent=#Armature] create
-- @param self -- @param self
-- @param #string str -- @param #string str

View File

@ -22,10 +22,8 @@
-- @param #string str -- @param #string str
-------------------------------- --------------------------------
-- overload function: addArmatureFileInfo(string, string, string) -- @overload self, string, string, string
-- -- @overload self, string
-- overload function: addArmatureFileInfo(string)
--
-- @function [parent=#ArmatureDataManager] addArmatureFileInfo -- @function [parent=#ArmatureDataManager] addArmatureFileInfo
-- @param self -- @param self
-- @param #string str -- @param #string str

View File

@ -15,10 +15,8 @@
-- @return BatchNode#BatchNode ret (return value: ccs.BatchNode) -- @return BatchNode#BatchNode ret (return value: ccs.BatchNode)
-------------------------------- --------------------------------
-- overload function: addChild(cc.Node, int, string) -- @overload self, cc.Node, int, string
-- -- @overload self, cc.Node, int, int
-- overload function: addChild(cc.Node, int, int)
--
-- @function [parent=#BatchNode] addChild -- @function [parent=#BatchNode] addChild
-- @param self -- @param self
-- @param #cc.Node node -- @param #cc.Node node

View File

@ -73,10 +73,8 @@
-- @param #ccs.BoneData bonedata -- @param #ccs.BoneData bonedata
-------------------------------- --------------------------------
-- overload function: init(string) -- @overload self, string
-- -- @overload self
-- overload function: init()
--
-- @function [parent=#Bone] init -- @function [parent=#Bone] init
-- @param self -- @param self
-- @param #string str -- @param #string str
@ -88,10 +86,8 @@
-- @param #ccs.Bone bone -- @param #ccs.Bone bone
-------------------------------- --------------------------------
-- overload function: addDisplay(cc.Node, int) -- @overload self, cc.Node, int
-- -- @overload self, ccs.DisplayData, int
-- overload function: addDisplay(ccs.DisplayData, int)
--
-- @function [parent=#Bone] addDisplay -- @function [parent=#Bone] addDisplay
-- @param self -- @param self
-- @param #ccs.DisplayData displaydata -- @param #ccs.DisplayData displaydata
@ -171,10 +167,8 @@
-- @return BoneData#BoneData ret (return value: ccs.BoneData) -- @return BoneData#BoneData ret (return value: ccs.BoneData)
-------------------------------- --------------------------------
-- overload function: create(string) -- @overload self, string
-- -- @overload self
-- overload function: create()
--
-- @function [parent=#Bone] create -- @function [parent=#Bone] create
-- @param self -- @param self
-- @param #string str -- @param #string str

View File

@ -121,10 +121,8 @@
-- @param #bool bool -- @param #bool bool
-------------------------------- --------------------------------
-- overload function: create(string, string, string, ccui.Widget::TextureResType) -- @overload self, string, string, string, ccui.Widget::TextureResType
-- -- @overload self
-- overload function: create()
--
-- @function [parent=#Button] create -- @function [parent=#Button] create
-- @param self -- @param self
-- @param #string str -- @param #string str

View File

@ -102,12 +102,9 @@
-- @param #float float -- @param #float float
-------------------------------- --------------------------------
-- overload function: CCBReader(cc.CCBReader) -- @overload self, cc.CCBReader
-- -- @overload self, cc.NodeLoaderLibrary, cc.CCBMemberVariableAssigner, cc.CCBSelectorResolver, cc.NodeLoaderListener
-- overload function: CCBReader(cc.NodeLoaderLibrary, cc.CCBMemberVariableAssigner, cc.CCBSelectorResolver, cc.NodeLoaderListener) -- @overload self
--
-- overload function: CCBReader()
--
-- @function [parent=#CCBReader] CCBReader -- @function [parent=#CCBReader] CCBReader
-- @param self -- @param self
-- @param #cc.NodeLoaderLibrary nodeloaderlibrary -- @param #cc.NodeLoaderLibrary nodeloaderlibrary

View File

@ -60,10 +60,8 @@
-- @param #ccui.Widget::TextureResType texturerestype -- @param #ccui.Widget::TextureResType texturerestype
-------------------------------- --------------------------------
-- overload function: create(string, string, string, string, string, ccui.Widget::TextureResType) -- @overload self, string, string, string, string, string, ccui.Widget::TextureResType
-- -- @overload self
-- overload function: create()
--
-- @function [parent=#CheckBox] create -- @function [parent=#CheckBox] create
-- @param self -- @param self
-- @param #string str -- @param #string str

View File

@ -35,10 +35,8 @@
-- @param #float float -- @param #float float
-------------------------------- --------------------------------
-- overload function: create(cc.Node) -- @overload self, cc.Node
-- -- @overload self
-- overload function: create()
--
-- @function [parent=#ClippingNode] create -- @function [parent=#ClippingNode] create
-- @param self -- @param self
-- @param #cc.Node node -- @param #cc.Node node

View File

@ -38,10 +38,8 @@
-- @param self -- @param self
-------------------------------- --------------------------------
-- overload function: stopBackgroundMusic() -- @overload self
-- -- @overload self, bool
-- overload function: stopBackgroundMusic(bool)
--
-- @function [parent=#ComAudio] stopBackgroundMusic -- @function [parent=#ComAudio] stopBackgroundMusic
-- @param self -- @param self
-- @param #bool bool -- @param #bool bool
@ -74,24 +72,18 @@
-- @param #char char -- @param #char char
-------------------------------- --------------------------------
-- overload function: playBackgroundMusic(char) -- @overload self, char
-- -- @overload self, char, bool
-- overload function: playBackgroundMusic(char, bool) -- @overload self
--
-- overload function: playBackgroundMusic()
--
-- @function [parent=#ComAudio] playBackgroundMusic -- @function [parent=#ComAudio] playBackgroundMusic
-- @param self -- @param self
-- @param #char char -- @param #char char
-- @param #bool bool -- @param #bool bool
-------------------------------- --------------------------------
-- overload function: playEffect(char) -- @overload self, char
-- -- @overload self, char, bool
-- overload function: playEffect(char, bool) -- @overload self
--
-- overload function: playEffect()
--
-- @function [parent=#ComAudio] playEffect -- @function [parent=#ComAudio] playEffect
-- @param self -- @param self
-- @param #char char -- @param #char char

View File

@ -15,10 +15,8 @@
-- @return Node#Node ret (return value: cc.Node) -- @return Node#Node ret (return value: cc.Node)
-------------------------------- --------------------------------
-- overload function: create(cc.Node, char) -- @overload self, cc.Node, char
-- -- @overload self
-- overload function: create()
--
-- @function [parent=#ComRender] create -- @function [parent=#ComRender] create
-- @param self -- @param self
-- @param #cc.Node node -- @param #cc.Node node

View File

@ -105,10 +105,8 @@
-- @param self -- @param self
-------------------------------- --------------------------------
-- overload function: getCurrentTitle() -- @overload self
-- -- @overload self
-- overload function: getCurrentTitle()
--
-- @function [parent=#ControlButton] getCurrentTitle -- @function [parent=#ControlButton] getCurrentTitle
-- @param self -- @param self
-- @return string#string ret (retunr value: string) -- @return string#string ret (retunr value: string)
@ -219,14 +217,10 @@
-- @return string#string ret (return value: string) -- @return string#string ret (return value: string)
-------------------------------- --------------------------------
-- overload function: create(cc.Scale9Sprite) -- @overload self, cc.Scale9Sprite
-- -- @overload self
-- overload function: create() -- @overload self, cc.Node, cc.Scale9Sprite
-- -- @overload self, string, string, float
-- overload function: create(cc.Node, cc.Scale9Sprite)
--
-- overload function: create(string, string, float)
--
-- @function [parent=#ControlButton] create -- @function [parent=#ControlButton] create
-- @param self -- @param self
-- @param #string str -- @param #string str

View File

@ -80,10 +80,8 @@
-- @return Sprite#Sprite ret (return value: cc.Sprite) -- @return Sprite#Sprite ret (return value: cc.Sprite)
-------------------------------- --------------------------------
-- overload function: initWithSprites(cc.Sprite, cc.Sprite, cc.Sprite, cc.Sprite) -- @overload self, cc.Sprite, cc.Sprite, cc.Sprite, cc.Sprite
-- -- @overload self, cc.Sprite, cc.Sprite, cc.Sprite
-- overload function: initWithSprites(cc.Sprite, cc.Sprite, cc.Sprite)
--
-- @function [parent=#ControlSlider] initWithSprites -- @function [parent=#ControlSlider] initWithSprites
-- @param self -- @param self
-- @param #cc.Sprite sprite -- @param #cc.Sprite sprite
@ -129,14 +127,10 @@
-- @param #float float -- @param #float float
-------------------------------- --------------------------------
-- overload function: create(cc.Sprite, cc.Sprite, cc.Sprite) -- @overload self, cc.Sprite, cc.Sprite, cc.Sprite
-- -- @overload self, char, char, char
-- overload function: create(char, char, char) -- @overload self, char, char, char, char
-- -- @overload self, cc.Sprite, cc.Sprite, cc.Sprite, cc.Sprite
-- overload function: create(char, char, char, char)
--
-- overload function: create(cc.Sprite, cc.Sprite, cc.Sprite, cc.Sprite)
--
-- @function [parent=#ControlSlider] create -- @function [parent=#ControlSlider] create
-- @param self -- @param self
-- @param #cc.Sprite sprite -- @param #cc.Sprite sprite

View File

@ -10,10 +10,8 @@
-- @param #bool bool -- @param #bool bool
-------------------------------- --------------------------------
-- overload function: setOn(bool) -- @overload self, bool
-- -- @overload self, bool, bool
-- overload function: setOn(bool, bool)
--
-- @function [parent=#ControlSwitch] setOn -- @function [parent=#ControlSwitch] setOn
-- @param self -- @param self
-- @param #bool bool -- @param #bool bool
@ -25,10 +23,8 @@
-- @return bool#bool ret (return value: bool) -- @return bool#bool ret (return value: bool)
-------------------------------- --------------------------------
-- overload function: initWithMaskSprite(cc.Sprite, cc.Sprite, cc.Sprite, cc.Sprite, cc.Label, cc.Label) -- @overload self, cc.Sprite, cc.Sprite, cc.Sprite, cc.Sprite, cc.Label, cc.Label
-- -- @overload self, cc.Sprite, cc.Sprite, cc.Sprite, cc.Sprite
-- overload function: initWithMaskSprite(cc.Sprite, cc.Sprite, cc.Sprite, cc.Sprite)
--
-- @function [parent=#ControlSwitch] initWithMaskSprite -- @function [parent=#ControlSwitch] initWithMaskSprite
-- @param self -- @param self
-- @param #cc.Sprite sprite -- @param #cc.Sprite sprite
@ -51,10 +47,8 @@
-- @return vec2_table#vec2_table ret (return value: vec2_table) -- @return vec2_table#vec2_table ret (return value: vec2_table)
-------------------------------- --------------------------------
-- overload function: create(cc.Sprite, cc.Sprite, cc.Sprite, cc.Sprite) -- @overload self, cc.Sprite, cc.Sprite, cc.Sprite, cc.Sprite
-- -- @overload self, cc.Sprite, cc.Sprite, cc.Sprite, cc.Sprite, cc.Label, cc.Label
-- overload function: create(cc.Sprite, cc.Sprite, cc.Sprite, cc.Sprite, cc.Label, cc.Label)
--
-- @function [parent=#ControlSwitch] create -- @function [parent=#ControlSwitch] create
-- @param self -- @param self
-- @param #cc.Sprite sprite -- @param #cc.Sprite sprite

View File

@ -46,20 +46,16 @@
-- @return rect_table#rect_table ret (return value: rect_table) -- @return rect_table#rect_table ret (return value: rect_table)
-------------------------------- --------------------------------
-- overload function: addDisplay(cc.Node, int) -- @overload self, cc.Node, int
-- -- @overload self, ccs.DisplayData, int
-- overload function: addDisplay(ccs.DisplayData, int)
--
-- @function [parent=#DisplayManager] addDisplay -- @function [parent=#DisplayManager] addDisplay
-- @param self -- @param self
-- @param #ccs.DisplayData displaydata -- @param #ccs.DisplayData displaydata
-- @param #int int -- @param #int int
-------------------------------- --------------------------------
-- overload function: containPoint(float, float) -- @overload self, float, float
-- -- @overload self, vec2_table
-- overload function: containPoint(vec2_table)
--
-- @function [parent=#DisplayManager] containPoint -- @function [parent=#DisplayManager] containPoint
-- @param self -- @param self
-- @param #float float -- @param #float float

View File

@ -5,10 +5,8 @@
-- @parent_module cc -- @parent_module cc
-------------------------------- --------------------------------
-- overload function: create(cc.ActionInterval) -- @overload self, cc.ActionInterval
-- -- @overload self, cc.ActionInterval, float
-- overload function: create(cc.ActionInterval, float)
--
-- @function [parent=#EaseElasticIn] create -- @function [parent=#EaseElasticIn] create
-- @param self -- @param self
-- @param #cc.ActionInterval actioninterval -- @param #cc.ActionInterval actioninterval

View File

@ -5,10 +5,8 @@
-- @parent_module cc -- @parent_module cc
-------------------------------- --------------------------------
-- overload function: create(cc.ActionInterval) -- @overload self, cc.ActionInterval
-- -- @overload self, cc.ActionInterval, float
-- overload function: create(cc.ActionInterval, float)
--
-- @function [parent=#EaseElasticInOut] create -- @function [parent=#EaseElasticInOut] create
-- @param self -- @param self
-- @param #cc.ActionInterval actioninterval -- @param #cc.ActionInterval actioninterval

View File

@ -5,10 +5,8 @@
-- @parent_module cc -- @parent_module cc
-------------------------------- --------------------------------
-- overload function: create(cc.ActionInterval) -- @overload self, cc.ActionInterval
-- -- @overload self, cc.ActionInterval, float
-- overload function: create(cc.ActionInterval, float)
--
-- @function [parent=#EaseElasticOut] create -- @function [parent=#EaseElasticOut] create
-- @param self -- @param self
-- @param #cc.ActionInterval actioninterval -- @param #cc.ActionInterval actioninterval

View File

@ -35,10 +35,8 @@
-- @return int#int ret (return value: int) -- @return int#int ret (return value: int)
-------------------------------- --------------------------------
-- overload function: EventController(cc.EventController::ControllerEventType, cc.Controller, bool) -- @overload self, cc.EventController::ControllerEventType, cc.Controller, bool
-- -- @overload self, cc.EventController::ControllerEventType, cc.Controller, int
-- overload function: EventController(cc.EventController::ControllerEventType, cc.Controller, int)
--
-- @function [parent=#EventController] EventController -- @function [parent=#EventController] EventController
-- @param self -- @param self
-- @param #cc.EventController::ControllerEventType controllereventtype -- @param #cc.EventController::ControllerEventType controllereventtype

View File

@ -46,10 +46,8 @@
-- @param #vec2_table vec2 -- @param #vec2_table vec2
-------------------------------- --------------------------------
-- overload function: getProperties() -- @overload self
-- -- @overload self
-- overload function: getProperties()
--
-- @function [parent=#FastTMXLayer] getProperties -- @function [parent=#FastTMXLayer] getProperties
-- @param self -- @param self
-- @return map_table#map_table ret (retunr value: map_table) -- @return map_table#map_table ret (retunr value: map_table)
@ -66,10 +64,8 @@
-- @param #int int -- @param #int int
-------------------------------- --------------------------------
-- overload function: setTileGID(int, vec2_table, cc.TMXTileFlags_) -- @overload self, int, vec2_table, cc.TMXTileFlags_
-- -- @overload self, int, vec2_table
-- overload function: setTileGID(int, vec2_table)
--
-- @function [parent=#FastTMXLayer] setTileGID -- @function [parent=#FastTMXLayer] setTileGID
-- @param self -- @param self
-- @param #int int -- @param #int int

View File

@ -27,10 +27,8 @@
-- @return TMXObjectGroup#TMXObjectGroup ret (return value: cc.TMXObjectGroup) -- @return TMXObjectGroup#TMXObjectGroup ret (return value: cc.TMXObjectGroup)
-------------------------------- --------------------------------
-- overload function: getObjectGroups() -- @overload self
-- -- @overload self
-- overload function: getObjectGroups()
--
-- @function [parent=#FastTMXTiledMap] getObjectGroups -- @function [parent=#FastTMXTiledMap] getObjectGroups
-- @param self -- @param self
-- @return array_table#array_table ret (retunr value: array_table) -- @return array_table#array_table ret (retunr value: array_table)

View File

@ -74,11 +74,13 @@
-- @function [parent=#FileUtils] addSearchResolutionsOrder -- @function [parent=#FileUtils] addSearchResolutionsOrder
-- @param self -- @param self
-- @param #string str -- @param #string str
-- @param #bool bool
-------------------------------- --------------------------------
-- @function [parent=#FileUtils] addSearchPath -- @function [parent=#FileUtils] addSearchPath
-- @param self -- @param self
-- @param #string str -- @param #string str
-- @param #bool bool
-------------------------------- --------------------------------
-- @function [parent=#FileUtils] isFileExist -- @function [parent=#FileUtils] isFileExist

View File

@ -33,10 +33,8 @@
-- @return string#string ret (return value: string) -- @return string#string ret (return value: string)
-------------------------------- --------------------------------
-- overload function: setUniformsForBuiltins(mat4_table) -- @overload self, mat4_table
-- -- @overload self
-- overload function: setUniformsForBuiltins()
--
-- @function [parent=#GLProgram] setUniformsForBuiltins -- @function [parent=#GLProgram] setUniformsForBuiltins
-- @param self -- @param self
-- @param #mat4_table mat4 -- @param #mat4_table mat4

View File

@ -5,24 +5,18 @@
-- @parent_module cc -- @parent_module cc
-------------------------------- --------------------------------
-- overload function: setUniformTexture(string, unsigned int) -- @overload self, string, unsigned int
-- -- @overload self, string, cc.Texture2D
-- overload function: setUniformTexture(string, cc.Texture2D) -- @overload self, int, cc.Texture2D
-- -- @overload self, int, unsigned int
-- overload function: setUniformTexture(int, cc.Texture2D)
--
-- overload function: setUniformTexture(int, unsigned int)
--
-- @function [parent=#GLProgramState] setUniformTexture -- @function [parent=#GLProgramState] setUniformTexture
-- @param self -- @param self
-- @param #int int -- @param #int int
-- @param #unsigned int int -- @param #unsigned int int
-------------------------------- --------------------------------
-- overload function: setUniformMat4(int, mat4_table) -- @overload self, int, mat4_table
-- -- @overload self, string, mat4_table
-- overload function: setUniformMat4(string, mat4_table)
--
-- @function [parent=#GLProgramState] setUniformMat4 -- @function [parent=#GLProgramState] setUniformMat4
-- @param self -- @param self
-- @param #string str -- @param #string str
@ -47,30 +41,24 @@
-- @param self -- @param self
-------------------------------- --------------------------------
-- overload function: setUniformFloat(int, float) -- @overload self, int, float
-- -- @overload self, string, float
-- overload function: setUniformFloat(string, float)
--
-- @function [parent=#GLProgramState] setUniformFloat -- @function [parent=#GLProgramState] setUniformFloat
-- @param self -- @param self
-- @param #string str -- @param #string str
-- @param #float float -- @param #float float
-------------------------------- --------------------------------
-- overload function: setUniformVec3(int, vec3_table) -- @overload self, int, vec3_table
-- -- @overload self, string, vec3_table
-- overload function: setUniformVec3(string, vec3_table)
--
-- @function [parent=#GLProgramState] setUniformVec3 -- @function [parent=#GLProgramState] setUniformVec3
-- @param self -- @param self
-- @param #string str -- @param #string str
-- @param #vec3_table vec3 -- @param #vec3_table vec3
-------------------------------- --------------------------------
-- overload function: setUniformInt(int, int) -- @overload self, int, int
-- -- @overload self, string, int
-- overload function: setUniformInt(string, int)
--
-- @function [parent=#GLProgramState] setUniformInt -- @function [parent=#GLProgramState] setUniformInt
-- @param self -- @param self
-- @param #string str -- @param #string str
@ -82,10 +70,8 @@
-- @return long#long ret (return value: long) -- @return long#long ret (return value: long)
-------------------------------- --------------------------------
-- overload function: setUniformVec4(int, vec4_table) -- @overload self, int, vec4_table
-- -- @overload self, string, vec4_table
-- overload function: setUniformVec4(string, vec4_table)
--
-- @function [parent=#GLProgramState] setUniformVec4 -- @function [parent=#GLProgramState] setUniformVec4
-- @param self -- @param self
-- @param #string str -- @param #string str
@ -97,10 +83,8 @@
-- @param #cc.GLProgram glprogram -- @param #cc.GLProgram glprogram
-------------------------------- --------------------------------
-- overload function: setUniformVec2(int, vec2_table) -- @overload self, int, vec2_table
-- -- @overload self, string, vec2_table
-- overload function: setUniformVec2(string, vec2_table)
--
-- @function [parent=#GLProgramState] setUniformVec2 -- @function [parent=#GLProgramState] setUniformVec2
-- @param self -- @param self
-- @param #string str -- @param #string str

View File

@ -5,10 +5,8 @@
-- @parent_module cc -- @parent_module cc
-------------------------------- --------------------------------
-- overload function: create(size_table) -- @overload self, size_table
-- -- @overload self, size_table, cc.Texture2D, bool
-- overload function: create(size_table, cc.Texture2D, bool)
--
-- @function [parent=#Grid3D] create -- @function [parent=#Grid3D] create
-- @param self -- @param self
-- @param #size_table size -- @param #size_table size

View File

@ -66,10 +66,8 @@
-- @return int#int ret (return value: int) -- @return int#int ret (return value: int)
-------------------------------- --------------------------------
-- overload function: initWithSize(size_table) -- @overload self, size_table
-- -- @overload self, size_table, cc.Texture2D, bool
-- overload function: initWithSize(size_table, cc.Texture2D, bool)
--
-- @function [parent=#GridBase] initWithSize -- @function [parent=#GridBase] initWithSize
-- @param self -- @param self
-- @param #size_table size -- @param #size_table size
@ -92,10 +90,8 @@
-- @param self -- @param self
-------------------------------- --------------------------------
-- overload function: create(size_table) -- @overload self, size_table
-- -- @overload self, size_table, cc.Texture2D, bool
-- overload function: create(size_table, cc.Texture2D, bool)
--
-- @function [parent=#GridBase] create -- @function [parent=#GridBase] create
-- @param self -- @param self
-- @param #size_table size -- @param #size_table size

View File

@ -5,10 +5,8 @@
-- @parent_module ccui -- @parent_module ccui
-------------------------------- --------------------------------
-- overload function: create(size_table) -- @overload self, size_table
-- -- @overload self
-- overload function: create()
--
-- @function [parent=#HBox] create -- @function [parent=#HBox] create
-- @param self -- @param self
-- @param #size_table size -- @param #size_table size

View File

@ -36,10 +36,8 @@
-- @return bool#bool ret (return value: bool) -- @return bool#bool ret (return value: bool)
-------------------------------- --------------------------------
-- overload function: create(string, ccui.Widget::TextureResType) -- @overload self, string, ccui.Widget::TextureResType
-- -- @overload self
-- overload function: create()
--
-- @function [parent=#ImageView] create -- @function [parent=#ImageView] create
-- @param self -- @param self
-- @param #string str -- @param #string str

View File

@ -127,12 +127,9 @@
-- @return float#float ret (return value: float) -- @return float#float ret (return value: float)
-------------------------------- --------------------------------
-- overload function: setCharMap(cc.Texture2D, int, int, int) -- @overload self, cc.Texture2D, int, int, int
-- -- @overload self, string, int, int, int
-- overload function: setCharMap(string, int, int, int) -- @overload self, string
--
-- overload function: setCharMap(string)
--
-- @function [parent=#Label] setCharMap -- @function [parent=#Label] setCharMap
-- @param self -- @param self
-- @param #string str -- @param #string str
@ -228,10 +225,8 @@
-- @param #cc.TextHAlignment texthalignment -- @param #cc.TextHAlignment texthalignment
-------------------------------- --------------------------------
-- overload function: setAlignment(cc.TextHAlignment, cc.TextVAlignment) -- @overload self, cc.TextHAlignment, cc.TextVAlignment
-- -- @overload self, cc.TextHAlignment
-- overload function: setAlignment(cc.TextHAlignment)
--
-- @function [parent=#Label] setAlignment -- @function [parent=#Label] setAlignment
-- @param self -- @param self
-- @param #cc.TextHAlignment texthalignment -- @param #cc.TextHAlignment texthalignment
@ -253,12 +248,9 @@
-- @return Label#Label ret (return value: cc.Label) -- @return Label#Label ret (return value: cc.Label)
-------------------------------- --------------------------------
-- overload function: createWithCharMap(cc.Texture2D, int, int, int) -- @overload self, cc.Texture2D, int, int, int
-- -- @overload self, string, int, int, int
-- overload function: createWithCharMap(string, int, int, int) -- @overload self, string
--
-- overload function: createWithCharMap(string)
--
-- @function [parent=#Label] createWithCharMap -- @function [parent=#Label] createWithCharMap
-- @param self -- @param self
-- @param #string str -- @param #string str

View File

@ -10,12 +10,9 @@
-- @param #string str -- @param #string str
-------------------------------- --------------------------------
-- overload function: initWithString(string, string) -- @overload self, string, string
-- -- @overload self, string, string, int, int, int
-- overload function: initWithString(string, string, int, int, int) -- @overload self, string, cc.Texture2D, int, int, int
--
-- overload function: initWithString(string, cc.Texture2D, int, int, int)
--
-- @function [parent=#LabelAtlas] initWithString -- @function [parent=#LabelAtlas] initWithString
-- @param self -- @param self
-- @param #string str -- @param #string str
@ -35,12 +32,9 @@
-- @return string#string ret (return value: string) -- @return string#string ret (return value: string)
-------------------------------- --------------------------------
-- overload function: create(string, string, int, int, int) -- @overload self, string, string, int, int, int
-- -- @overload self
-- overload function: create() -- @overload self, string, string
--
-- overload function: create(string, string)
--
-- @function [parent=#LabelAtlas] create -- @function [parent=#LabelAtlas] create
-- @param self -- @param self
-- @param #string str -- @param #string str

View File

@ -21,12 +21,9 @@
-- @param #float float -- @param #float float
-------------------------------- --------------------------------
-- overload function: create(color4b_table, float, float) -- @overload self, color4b_table, float, float
-- -- @overload self
-- overload function: create() -- @overload self, color4b_table
--
-- overload function: create(color4b_table)
--
-- @function [parent=#LayerColor] create -- @function [parent=#LayerColor] create
-- @param self -- @param self
-- @param #color4b_table color4b -- @param #color4b_table color4b

View File

@ -65,12 +65,9 @@
-- @param #color3b_table color3b -- @param #color3b_table color3b
-------------------------------- --------------------------------
-- overload function: create(color4b_table, color4b_table) -- @overload self, color4b_table, color4b_table
-- -- @overload self
-- overload function: create() -- @overload self, color4b_table, color4b_table, vec2_table
--
-- overload function: create(color4b_table, color4b_table, vec2_table)
--
-- @function [parent=#LayerGradient] create -- @function [parent=#LayerGradient] create
-- @param self -- @param self
-- @param #color4b_table color4b -- @param #color4b_table color4b

View File

@ -70,10 +70,8 @@
-- @param #ccui.Widget::TextureResType texturerestype -- @param #ccui.Widget::TextureResType texturerestype
-------------------------------- --------------------------------
-- overload function: setBackGroundColor(color3b_table, color3b_table) -- @overload self, color3b_table, color3b_table
-- -- @overload self, color3b_table
-- overload function: setBackGroundColor(color3b_table)
--
-- @function [parent=#Layout] setBackGroundColor -- @function [parent=#Layout] setBackGroundColor
-- @param self -- @param self
-- @param #color3b_table color3b -- @param #color3b_table color3b
@ -179,14 +177,10 @@
-- @return Ref#Ref ret (return value: cc.Ref) -- @return Ref#Ref ret (return value: cc.Ref)
-------------------------------- --------------------------------
-- overload function: addChild(cc.Node, int) -- @overload self, cc.Node, int
-- -- @overload self, cc.Node
-- overload function: addChild(cc.Node) -- @overload self, cc.Node, int, int
-- -- @overload self, cc.Node, int, string
-- overload function: addChild(cc.Node, int, int)
--
-- overload function: addChild(cc.Node, int, string)
--
-- @function [parent=#Layout] addChild -- @function [parent=#Layout] addChild
-- @param self -- @param self
-- @param #cc.Node node -- @param #cc.Node node

View File

@ -107,14 +107,10 @@
-- @return Ref#Ref ret (return value: cc.Ref) -- @return Ref#Ref ret (return value: cc.Ref)
-------------------------------- --------------------------------
-- overload function: addChild(cc.Node, int) -- @overload self, cc.Node, int
-- -- @overload self, cc.Node
-- overload function: addChild(cc.Node) -- @overload self, cc.Node, int, int
-- -- @overload self, cc.Node, int, string
-- overload function: addChild(cc.Node, int, int)
--
-- overload function: addChild(cc.Node, int, string)
--
-- @function [parent=#ListView] addChild -- @function [parent=#ListView] addChild
-- @param self -- @param self
-- @param #cc.Node node -- @param #cc.Node node

View File

@ -51,10 +51,8 @@
-- @return float#float ret (return value: float) -- @return float#float ret (return value: float)
-------------------------------- --------------------------------
-- overload function: create(string, float) -- @overload self, string, float
-- -- @overload self
-- overload function: create()
--
-- @function [parent=#LoadingBar] create -- @function [parent=#LoadingBar] create
-- @param self -- @param self
-- @param #string str -- @param #string str

View File

@ -33,14 +33,10 @@
-- @param self -- @param self
-------------------------------- --------------------------------
-- overload function: addChild(cc.Node, int) -- @overload self, cc.Node, int
-- -- @overload self, cc.Node
-- overload function: addChild(cc.Node) -- @overload self, cc.Node, int, int
-- -- @overload self, cc.Node, int, string
-- overload function: addChild(cc.Node, int, int)
--
-- overload function: addChild(cc.Node, int, string)
--
-- @function [parent=#Menu] addChild -- @function [parent=#Menu] addChild
-- @param self -- @param self
-- @param #cc.Node node -- @param #cc.Node node

View File

@ -44,10 +44,8 @@
-- @param #bool bool -- @param #bool bool
-------------------------------- --------------------------------
-- overload function: create(float, float, float, color3b_table, cc.Texture2D) -- @overload self, float, float, float, color3b_table, cc.Texture2D
-- -- @overload self, float, float, float, color3b_table, string
-- overload function: create(float, float, float, color3b_table, string)
--
-- @function [parent=#MotionStreak] create -- @function [parent=#MotionStreak] create
-- @param self -- @param self
-- @param #float float -- @param #float float
@ -98,20 +96,16 @@
-- @return unsigned char#unsigned char ret (return value: unsigned char) -- @return unsigned char#unsigned char ret (return value: unsigned char)
-------------------------------- --------------------------------
-- overload function: setPosition(float, float) -- @overload self, float, float
-- -- @overload self, vec2_table
-- overload function: setPosition(vec2_table)
--
-- @function [parent=#MotionStreak] setPosition -- @function [parent=#MotionStreak] setPosition
-- @param self -- @param self
-- @param #float float -- @param #float float
-- @param #float float -- @param #float float
-------------------------------- --------------------------------
-- overload function: getPosition(float, float) -- @overload self, float, float
-- -- @overload self
-- overload function: getPosition()
--
-- @function [parent=#MotionStreak] getPosition -- @function [parent=#MotionStreak] getPosition
-- @param self -- @param self
-- @param #float float -- @param #float float

View File

@ -5,14 +5,10 @@
-- @parent_module cc -- @parent_module cc
-------------------------------- --------------------------------
-- overload function: addChild(cc.Node, int) -- @overload self, cc.Node, int
-- -- @overload self, cc.Node
-- overload function: addChild(cc.Node) -- @overload self, cc.Node, int, int
-- -- @overload self, cc.Node, int, string
-- overload function: addChild(cc.Node, int, int)
--
-- overload function: addChild(cc.Node, int, string)
--
-- @function [parent=#Node] addChild -- @function [parent=#Node] addChild
-- @param self -- @param self
-- @param #cc.Node node -- @param #cc.Node node
@ -51,10 +47,8 @@
-- @param #bool bool -- @param #bool bool
-------------------------------- --------------------------------
-- overload function: getChildren() -- @overload self
-- -- @overload self
-- overload function: getChildren()
--
-- @function [parent=#Node] getChildren -- @function [parent=#Node] getChildren
-- @param self -- @param self
-- @return array_table#array_table ret (retunr value: array_table) -- @return array_table#array_table ret (retunr value: array_table)
@ -134,11 +128,6 @@
-- @param self -- @param self
-- @return int#int ret (return value: int) -- @return int#int ret (return value: int)
--------------------------------
-- @function [parent=#Node] getonEnterTransitionDidFinishCallback
-- @param self
-- @return function#function ret (return value: function)
-------------------------------- --------------------------------
-- @function [parent=#Node] getGLProgram -- @function [parent=#Node] getGLProgram
-- @param self -- @param self
@ -213,10 +202,8 @@
-- @return vec2_table#vec2_table ret (return value: vec2_table) -- @return vec2_table#vec2_table ret (return value: vec2_table)
-------------------------------- --------------------------------
-- overload function: removeAllChildrenWithCleanup(bool) -- @overload self, bool
-- -- @overload self
-- overload function: removeAllChildrenWithCleanup()
--
-- @function [parent=#Node] removeAllChildrenWithCleanup -- @function [parent=#Node] removeAllChildrenWithCleanup
-- @param self -- @param self
-- @param #bool bool -- @param #bool bool
@ -257,11 +244,6 @@
-- @param #cc.Touch touch -- @param #cc.Touch touch
-- @return vec2_table#vec2_table ret (return value: vec2_table) -- @return vec2_table#vec2_table ret (return value: vec2_table)
--------------------------------
-- @function [parent=#Node] getOnEnterCallback
-- @param self
-- @return function#function ret (return value: function)
-------------------------------- --------------------------------
-- @function [parent=#Node] convertToNodeSpace -- @function [parent=#Node] convertToNodeSpace
-- @param self -- @param self
@ -278,10 +260,8 @@
-- @return PhysicsBody#PhysicsBody ret (return value: cc.PhysicsBody) -- @return PhysicsBody#PhysicsBody ret (return value: cc.PhysicsBody)
-------------------------------- --------------------------------
-- overload function: setPosition(float, float) -- @overload self, float, float
-- -- @overload self, vec2_table
-- overload function: setPosition(vec2_table)
--
-- @function [parent=#Node] setPosition -- @function [parent=#Node] setPosition
-- @param self -- @param self
-- @param #float float -- @param #float float
@ -391,10 +371,8 @@
-- @return vec2_table#vec2_table ret (return value: vec2_table) -- @return vec2_table#vec2_table ret (return value: vec2_table)
-------------------------------- --------------------------------
-- overload function: visit() -- @overload self
-- -- @overload self, cc.Renderer, mat4_table, unsigned int
-- overload function: visit(cc.Renderer, mat4_table, unsigned int)
--
-- @function [parent=#Node] visit -- @function [parent=#Node] visit
-- @param self -- @param self
-- @param #cc.Renderer renderer -- @param #cc.Renderer renderer
@ -448,10 +426,8 @@
-- @param #string str -- @param #string str
-------------------------------- --------------------------------
-- overload function: setAdditionalTransform(cc.AffineTransform) -- @overload self, cc.AffineTransform
-- -- @overload self, mat4_table
-- overload function: setAdditionalTransform(mat4_table)
--
-- @function [parent=#Node] setAdditionalTransform -- @function [parent=#Node] setAdditionalTransform
-- @param self -- @param self
-- @param #mat4_table mat4 -- @param #mat4_table mat4
@ -467,10 +443,8 @@
-- @return int#int ret (return value: int) -- @return int#int ret (return value: int)
-------------------------------- --------------------------------
-- overload function: getScheduler() -- @overload self
-- -- @overload self
-- overload function: getScheduler()
--
-- @function [parent=#Node] getScheduler -- @function [parent=#Node] getScheduler
-- @param self -- @param self
-- @return Scheduler#Scheduler ret (retunr value: cc.Scheduler) -- @return Scheduler#Scheduler ret (retunr value: cc.Scheduler)
@ -501,10 +475,8 @@
-- @return bool#bool ret (return value: bool) -- @return bool#bool ret (return value: bool)
-------------------------------- --------------------------------
-- overload function: getParent() -- @overload self
-- -- @overload self
-- overload function: getParent()
--
-- @function [parent=#Node] getParent -- @function [parent=#Node] getParent
-- @param self -- @param self
-- @return Node#Node ret (retunr value: cc.Node) -- @return Node#Node ret (retunr value: cc.Node)
@ -561,20 +533,13 @@
-- @param #float float -- @param #float float
-------------------------------- --------------------------------
-- overload function: setScale(float, float) -- @overload self, float, float
-- -- @overload self, float
-- overload function: setScale(float)
--
-- @function [parent=#Node] setScale -- @function [parent=#Node] setScale
-- @param self -- @param self
-- @param #float float -- @param #float float
-- @param #float float -- @param #float float
--------------------------------
-- @function [parent=#Node] getOnExitCallback
-- @param self
-- @return function#function ret (return value: function)
-------------------------------- --------------------------------
-- @function [parent=#Node] getChildByTag -- @function [parent=#Node] getChildByTag
-- @param self -- @param self
@ -657,10 +622,8 @@
-- @return float#float ret (return value: float) -- @return float#float ret (return value: float)
-------------------------------- --------------------------------
-- overload function: draw() -- @overload self
-- -- @overload self, cc.Renderer, mat4_table, unsigned int
-- overload function: draw(cc.Renderer, mat4_table, unsigned int)
--
-- @function [parent=#Node] draw -- @function [parent=#Node] draw
-- @param self -- @param self
-- @param #cc.Renderer renderer -- @param #cc.Renderer renderer
@ -673,15 +636,8 @@
-- @param #cc.Ref ref -- @param #cc.Ref ref
-------------------------------- --------------------------------
-- @function [parent=#Node] getonExitTransitionDidStartCallback -- @overload self, bool
-- @param self -- @overload self
-- @return function#function ret (return value: function)
--------------------------------
-- overload function: removeFromParentAndCleanup(bool)
--
-- overload function: removeFromParentAndCleanup()
--
-- @function [parent=#Node] removeFromParentAndCleanup -- @function [parent=#Node] removeFromParentAndCleanup
-- @param self -- @param self
-- @param #bool bool -- @param #bool bool
@ -741,10 +697,8 @@
-- @param #cc.Action action -- @param #cc.Action action
-------------------------------- --------------------------------
-- overload function: getActionManager() -- @overload self
-- -- @overload self
-- overload function: getActionManager()
--
-- @function [parent=#Node] getActionManager -- @function [parent=#Node] getActionManager
-- @param self -- @param self
-- @return ActionManager#ActionManager ret (retunr value: cc.ActionManager) -- @return ActionManager#ActionManager ret (retunr value: cc.ActionManager)

View File

@ -10,10 +10,8 @@
-- @param #cc.Node node -- @param #cc.Node node
-------------------------------- --------------------------------
-- overload function: getGrid() -- @overload self
-- -- @overload self
-- overload function: getGrid()
--
-- @function [parent=#NodeGrid] getGrid -- @function [parent=#NodeGrid] getGrid
-- @param self -- @param self
-- @return GridBase#GridBase ret (retunr value: cc.GridBase) -- @return GridBase#GridBase ret (retunr value: cc.GridBase)

View File

@ -23,10 +23,8 @@
-- @return ParallaxNode#ParallaxNode ret (return value: cc.ParallaxNode) -- @return ParallaxNode#ParallaxNode ret (return value: cc.ParallaxNode)
-------------------------------- --------------------------------
-- overload function: addChild(cc.Node, int, string) -- @overload self, cc.Node, int, string
-- -- @overload self, cc.Node, int, int
-- overload function: addChild(cc.Node, int, int)
--
-- @function [parent=#ParallaxNode] addChild -- @function [parent=#ParallaxNode] addChild
-- @param self -- @param self
-- @param #cc.Node node -- @param #cc.Node node

View File

@ -61,10 +61,8 @@
-- @return ParticleBatchNode#ParticleBatchNode ret (return value: cc.ParticleBatchNode) -- @return ParticleBatchNode#ParticleBatchNode ret (return value: cc.ParticleBatchNode)
-------------------------------- --------------------------------
-- overload function: addChild(cc.Node, int, string) -- @overload self, cc.Node, int, string
-- -- @overload self, cc.Node, int, int
-- overload function: addChild(cc.Node, int, int)
--
-- @function [parent=#ParticleBatchNode] addChild -- @function [parent=#ParticleBatchNode] addChild
-- @param self -- @param self
-- @param #cc.Node node -- @param #cc.Node node

View File

@ -21,12 +21,9 @@
-- @param #cc.EventCustom eventcustom -- @param #cc.EventCustom eventcustom
-------------------------------- --------------------------------
-- overload function: create(string) -- @overload self, string
-- -- @overload self
-- overload function: create() -- @overload self, map_table
--
-- overload function: create(map_table)
--
-- @function [parent=#ParticleSystemQuad] create -- @function [parent=#ParticleSystemQuad] create
-- @param self -- @param self
-- @param #map_table map -- @param #map_table map

View File

@ -49,10 +49,8 @@
-- @return float#float ret (return value: float) -- @return float#float ret (return value: float)
-------------------------------- --------------------------------
-- overload function: applyImpulse(vec2_table, vec2_table) -- @overload self, vec2_table, vec2_table
-- -- @overload self, vec2_table
-- overload function: applyImpulse(vec2_table)
--
-- @function [parent=#PhysicsBody] applyImpulse -- @function [parent=#PhysicsBody] applyImpulse
-- @param self -- @param self
-- @param #vec2_table vec2 -- @param #vec2_table vec2
@ -64,10 +62,8 @@
-- @param #float float -- @param #float float
-------------------------------- --------------------------------
-- overload function: applyForce(vec2_table, vec2_table) -- @overload self, vec2_table, vec2_table
-- -- @overload self, vec2_table
-- overload function: applyForce(vec2_table)
--
-- @function [parent=#PhysicsBody] applyForce -- @function [parent=#PhysicsBody] applyForce
-- @param self -- @param self
-- @param #vec2_table vec2 -- @param #vec2_table vec2
@ -222,10 +218,8 @@
-- @return bool#bool ret (return value: bool) -- @return bool#bool ret (return value: bool)
-------------------------------- --------------------------------
-- overload function: removeShape(int, bool) -- @overload self, int, bool
-- -- @overload self, cc.PhysicsShape, bool
-- overload function: removeShape(cc.PhysicsShape, bool)
--
-- @function [parent=#PhysicsBody] removeShape -- @function [parent=#PhysicsBody] removeShape
-- @param self -- @param self
-- @param #cc.PhysicsShape physicsshape -- @param #cc.PhysicsShape physicsshape
@ -346,12 +340,9 @@
-- @return PhysicsBody#PhysicsBody ret (return value: cc.PhysicsBody) -- @return PhysicsBody#PhysicsBody ret (return value: cc.PhysicsBody)
-------------------------------- --------------------------------
-- overload function: create(float) -- @overload self, float
-- -- @overload self
-- overload function: create() -- @overload self, float, float
--
-- overload function: create(float, float)
--
-- @function [parent=#PhysicsBody] create -- @function [parent=#PhysicsBody] create
-- @param self -- @param self
-- @param #float float -- @param #float float

View File

@ -45,10 +45,8 @@
-- @param #float float -- @param #float float
-------------------------------- --------------------------------
-- overload function: construct(cc.PhysicsBody, cc.PhysicsBody, vec2_table, vec2_table, float, float) -- @overload self, cc.PhysicsBody, cc.PhysicsBody, vec2_table, vec2_table, float, float
-- -- @overload self, cc.PhysicsBody, cc.PhysicsBody, vec2_table, vec2_table
-- overload function: construct(cc.PhysicsBody, cc.PhysicsBody, vec2_table, vec2_table)
--
-- @function [parent=#PhysicsJointLimit] construct -- @function [parent=#PhysicsJointLimit] construct
-- @param self -- @param self
-- @param #cc.PhysicsBody physicsbody -- @param #cc.PhysicsBody physicsbody

View File

@ -25,10 +25,8 @@
-- @return float#float ret (return value: float) -- @return float#float ret (return value: float)
-------------------------------- --------------------------------
-- overload function: construct(cc.PhysicsBody, cc.PhysicsBody) -- @overload self, cc.PhysicsBody, cc.PhysicsBody
-- -- @overload self, cc.PhysicsBody, cc.PhysicsBody, float, float
-- overload function: construct(cc.PhysicsBody, cc.PhysicsBody, float, float)
--
-- @function [parent=#PhysicsJointRotaryLimit] construct -- @function [parent=#PhysicsJointRotaryLimit] construct
-- @param self -- @param self
-- @param #cc.PhysicsBody physicsbody -- @param #cc.PhysicsBody physicsbody

View File

@ -24,10 +24,8 @@
-- @return float#float ret (return value: float) -- @return float#float ret (return value: float)
-------------------------------- --------------------------------
-- overload function: removeBody(int) -- @overload self, int
-- -- @overload self, cc.PhysicsBody
-- overload function: removeBody(cc.PhysicsBody)
--
-- @function [parent=#PhysicsWorld] removeBody -- @function [parent=#PhysicsWorld] removeBody
-- @param self -- @param self
-- @param #cc.PhysicsBody physicsbody -- @param #cc.PhysicsBody physicsbody

View File

@ -45,10 +45,8 @@
-- @return vec2_table#vec2_table ret (return value: vec2_table) -- @return vec2_table#vec2_table ret (return value: vec2_table)
-------------------------------- --------------------------------
-- overload function: setReverseDirection(bool) -- @overload self, bool
-- -- @overload self, bool
-- overload function: setReverseDirection(bool)
--
-- @function [parent=#ProgressTimer] setReverseDirection -- @function [parent=#ProgressTimer] setReverseDirection
-- @param self -- @param self
-- @param #bool bool -- @param #bool bool

View File

@ -5,12 +5,9 @@
-- @parent_module cc -- @parent_module cc
-------------------------------- --------------------------------
-- overload function: addProtectedChild(cc.Node, int) -- @overload self, cc.Node, int
-- -- @overload self, cc.Node
-- overload function: addProtectedChild(cc.Node) -- @overload self, cc.Node, int, int
--
-- overload function: addProtectedChild(cc.Node, int, int)
--
-- @function [parent=#ProtectedNode] addProtectedChild -- @function [parent=#ProtectedNode] addProtectedChild
-- @param self -- @param self
-- @param #cc.Node node -- @param #cc.Node node

View File

@ -5,10 +5,8 @@
-- @parent_module ccui -- @parent_module ccui
-------------------------------- --------------------------------
-- overload function: create(size_table) -- @overload self, size_table
-- -- @overload self
-- overload function: create()
--
-- @function [parent=#RelativeBox] create -- @function [parent=#RelativeBox] create
-- @param self -- @param self
-- @param #size_table size -- @param #size_table size

View File

@ -65,10 +65,8 @@
-- @param self -- @param self
-------------------------------- --------------------------------
-- overload function: saveToFile(string, cc.Image::Format, bool) -- @overload self, string, cc.Image::Format, bool
-- -- @overload self, string, bool
-- overload function: saveToFile(string, bool)
--
-- @function [parent=#RenderTexture] saveToFile -- @function [parent=#RenderTexture] saveToFile
-- @param self -- @param self
-- @param #string str -- @param #string str
@ -91,12 +89,9 @@
-- @param self -- @param self
-------------------------------- --------------------------------
-- overload function: beginWithClear(float, float, float, float, float) -- @overload self, float, float, float, float, float
-- -- @overload self, float, float, float, float
-- overload function: beginWithClear(float, float, float, float) -- @overload self, float, float, float, float, float, int
--
-- overload function: beginWithClear(float, float, float, float, float, int)
--
-- @function [parent=#RenderTexture] beginWithClear -- @function [parent=#RenderTexture] beginWithClear
-- @param self -- @param self
-- @param #float float -- @param #float float
@ -140,10 +135,8 @@
-- @param #float float -- @param #float float
-------------------------------- --------------------------------
-- overload function: initWithWidthAndHeight(int, int, cc.Texture2D::PixelFormat, unsigned int) -- @overload self, int, int, cc.Texture2D::PixelFormat, unsigned int
-- -- @overload self, int, int, cc.Texture2D::PixelFormat
-- overload function: initWithWidthAndHeight(int, int, cc.Texture2D::PixelFormat)
--
-- @function [parent=#RenderTexture] initWithWidthAndHeight -- @function [parent=#RenderTexture] initWithWidthAndHeight
-- @param self -- @param self
-- @param #int int -- @param #int int
@ -153,12 +146,9 @@
-- @return bool#bool ret (retunr value: bool) -- @return bool#bool ret (retunr value: bool)
-------------------------------- --------------------------------
-- overload function: create(int, int, cc.Texture2D::PixelFormat) -- @overload self, int, int, cc.Texture2D::PixelFormat
-- -- @overload self, int, int, cc.Texture2D::PixelFormat, unsigned int
-- overload function: create(int, int, cc.Texture2D::PixelFormat, unsigned int) -- @overload self, int, int
--
-- overload function: create(int, int)
--
-- @function [parent=#RenderTexture] create -- @function [parent=#RenderTexture] create
-- @param self -- @param self
-- @param #int int -- @param #int int

View File

@ -35,10 +35,8 @@
-- @param self -- @param self
-------------------------------- --------------------------------
-- overload function: removeElement(ccui.RichElement) -- @overload self, ccui.RichElement
-- -- @overload self, int
-- overload function: removeElement(int)
--
-- @function [parent=#RichText] removeElement -- @function [parent=#RichText] removeElement
-- @param self -- @param self
-- @param #int int -- @param #int int

View File

@ -5,12 +5,9 @@
-- @parent_module cc -- @parent_module cc
-------------------------------- --------------------------------
-- overload function: create(float, float, float) -- @overload self, float, float, float
-- -- @overload self, float, float
-- overload function: create(float, float) -- @overload self, float, vec3_table
--
-- overload function: create(float, vec3_table)
--
-- @function [parent=#RotateBy] create -- @function [parent=#RotateBy] create
-- @param self -- @param self
-- @param #float float -- @param #float float

View File

@ -5,10 +5,8 @@
-- @parent_module cc -- @parent_module cc
-------------------------------- --------------------------------
-- overload function: create(float, float) -- @overload self, float, float
-- -- @overload self, float, float, float
-- overload function: create(float, float, float)
--
-- @function [parent=#RotateTo] create -- @function [parent=#RotateTo] create
-- @param self -- @param self
-- @param #float float -- @param #float float

View File

@ -16,10 +16,8 @@
-- @param #float float -- @param #float float
-------------------------------- --------------------------------
-- overload function: initWithSpriteFrameName(string) -- @overload self, string
-- -- @overload self, string, rect_table
-- overload function: initWithSpriteFrameName(string, rect_table)
--
-- @function [parent=#Scale9Sprite] initWithSpriteFrameName -- @function [parent=#Scale9Sprite] initWithSpriteFrameName
-- @param self -- @param self
-- @param #string str -- @param #string str
@ -47,10 +45,8 @@
-- @param #cc.SpriteFrame spriteframe -- @param #cc.SpriteFrame spriteframe
-------------------------------- --------------------------------
-- overload function: initWithBatchNode(cc.SpriteBatchNode, rect_table, rect_table) -- @overload self, cc.SpriteBatchNode, rect_table, rect_table
-- -- @overload self, cc.SpriteBatchNode, rect_table, bool, rect_table
-- overload function: initWithBatchNode(cc.SpriteBatchNode, rect_table, bool, rect_table)
--
-- @function [parent=#Scale9Sprite] initWithBatchNode -- @function [parent=#Scale9Sprite] initWithBatchNode
-- @param self -- @param self
-- @param #cc.SpriteBatchNode spritebatchnode -- @param #cc.SpriteBatchNode spritebatchnode
@ -89,14 +85,10 @@
-- @return size_table#size_table ret (return value: size_table) -- @return size_table#size_table ret (return value: size_table)
-------------------------------- --------------------------------
-- overload function: initWithFile(string, rect_table) -- @overload self, string, rect_table
-- -- @overload self, string, rect_table, rect_table
-- overload function: initWithFile(string, rect_table, rect_table) -- @overload self, rect_table, string
-- -- @overload self, string
-- overload function: initWithFile(rect_table, string)
--
-- overload function: initWithFile(string)
--
-- @function [parent=#Scale9Sprite] initWithFile -- @function [parent=#Scale9Sprite] initWithFile
-- @param self -- @param self
-- @param #string str -- @param #string str
@ -115,10 +107,8 @@
-- @param #float float -- @param #float float
-------------------------------- --------------------------------
-- overload function: initWithSpriteFrame(cc.SpriteFrame) -- @overload self, cc.SpriteFrame
-- -- @overload self, cc.SpriteFrame, rect_table
-- overload function: initWithSpriteFrame(cc.SpriteFrame, rect_table)
--
-- @function [parent=#Scale9Sprite] initWithSpriteFrame -- @function [parent=#Scale9Sprite] initWithSpriteFrame
-- @param self -- @param self
-- @param #cc.SpriteFrame spriteframe -- @param #cc.SpriteFrame spriteframe
@ -146,16 +136,11 @@
-- @param #float float -- @param #float float
-------------------------------- --------------------------------
-- overload function: create(string, rect_table, rect_table) -- @overload self, string, rect_table, rect_table
-- -- @overload self
-- overload function: create() -- @overload self, rect_table, string
-- -- @overload self, string, rect_table
-- overload function: create(rect_table, string) -- @overload self, string
--
-- overload function: create(string, rect_table)
--
-- overload function: create(string)
--
-- @function [parent=#Scale9Sprite] create -- @function [parent=#Scale9Sprite] create
-- @param self -- @param self
-- @param #string str -- @param #string str
@ -164,10 +149,8 @@
-- @return Scale9Sprite#Scale9Sprite ret (retunr value: cc.Scale9Sprite) -- @return Scale9Sprite#Scale9Sprite ret (retunr value: cc.Scale9Sprite)
-------------------------------- --------------------------------
-- overload function: createWithSpriteFrameName(string, rect_table) -- @overload self, string, rect_table
-- -- @overload self, string
-- overload function: createWithSpriteFrameName(string)
--
-- @function [parent=#Scale9Sprite] createWithSpriteFrameName -- @function [parent=#Scale9Sprite] createWithSpriteFrameName
-- @param self -- @param self
-- @param #string str -- @param #string str
@ -175,10 +158,8 @@
-- @return Scale9Sprite#Scale9Sprite ret (retunr value: cc.Scale9Sprite) -- @return Scale9Sprite#Scale9Sprite ret (retunr value: cc.Scale9Sprite)
-------------------------------- --------------------------------
-- overload function: createWithSpriteFrame(cc.SpriteFrame, rect_table) -- @overload self, cc.SpriteFrame, rect_table
-- -- @overload self, cc.SpriteFrame
-- overload function: createWithSpriteFrame(cc.SpriteFrame)
--
-- @function [parent=#Scale9Sprite] createWithSpriteFrame -- @function [parent=#Scale9Sprite] createWithSpriteFrame
-- @param self -- @param self
-- @param #cc.SpriteFrame spriteframe -- @param #cc.SpriteFrame spriteframe

View File

@ -5,12 +5,9 @@
-- @parent_module cc -- @parent_module cc
-------------------------------- --------------------------------
-- overload function: create(float, float, float) -- @overload self, float, float, float
-- -- @overload self, float, float
-- overload function: create(float, float) -- @overload self, float, float, float, float
--
-- overload function: create(float, float, float, float)
--
-- @function [parent=#ScaleBy] create -- @function [parent=#ScaleBy] create
-- @param self -- @param self
-- @param #float float -- @param #float float

View File

@ -5,12 +5,9 @@
-- @parent_module cc -- @parent_module cc
-------------------------------- --------------------------------
-- overload function: create(float, float, float) -- @overload self, float, float, float
-- -- @overload self, float, float
-- overload function: create(float, float) -- @overload self, float, float, float, float
--
-- overload function: create(float, float, float, float)
--
-- @function [parent=#ScaleTo] create -- @function [parent=#ScaleTo] create
-- @param self -- @param self
-- @param #float float -- @param #float float

View File

@ -41,10 +41,8 @@
-- @param #float float -- @param #float float
-------------------------------- --------------------------------
-- overload function: addChild(cc.Node, int, string) -- @overload self, cc.Node, int, string
-- -- @overload self, cc.Node, int, int
-- overload function: addChild(cc.Node, int, int)
--
-- @function [parent=#Scene] addChild -- @function [parent=#Scene] addChild
-- @param self -- @param self
-- @param #cc.Node node -- @param #cc.Node node

View File

@ -181,14 +181,10 @@
-- @return Ref#Ref ret (return value: cc.Ref) -- @return Ref#Ref ret (return value: cc.Ref)
-------------------------------- --------------------------------
-- overload function: addChild(cc.Node, int) -- @overload self, cc.Node, int
-- -- @overload self, cc.Node
-- overload function: addChild(cc.Node) -- @overload self, cc.Node, int, int
-- -- @overload self, cc.Node, int, string
-- overload function: addChild(cc.Node, int, int)
--
-- overload function: addChild(cc.Node, int, string)
--
-- @function [parent=#ScrollView] addChild -- @function [parent=#ScrollView] addChild
-- @param self -- @param self
-- @param #cc.Node node -- @param #cc.Node node
@ -239,10 +235,8 @@
-- @param #bool bool -- @param #bool bool
-------------------------------- --------------------------------
-- overload function: getChildren() -- @overload self
-- -- @overload self
-- overload function: getChildren()
--
-- @function [parent=#ScrollView] getChildren -- @function [parent=#ScrollView] getChildren
-- @param self -- @param self
-- @return array_table#array_table ret (retunr value: array_table) -- @return array_table#array_table ret (retunr value: array_table)

View File

@ -19,12 +19,4 @@
-- @function [parent=#SkeletonAnimation] clearTrack -- @function [parent=#SkeletonAnimation] clearTrack
-- @param self -- @param self
--------------------------------
-- @function [parent=#SkeletonAnimation] onAnimationStateEvent
-- @param self
-- @param #int int
-- @param #spEventType speventtype
-- @param #spEvent spevent
-- @param #int int
return nil return nil

Some files were not shown because too many files have changed in this diff Show More