This commit is contained in:
edwardzhou 2014-07-18 15:36:54 +08:00
commit 6b9e79629f
312 changed files with 6286 additions and 7396 deletions

11
AUTHORS
View File

@ -828,6 +828,7 @@ Developers:
Added missing Text Font and Placeholder feature of EditBox for Mac platform Added missing Text Font and Placeholder feature of EditBox for Mac platform
HttpRequest uses std::function as callback HttpRequest uses std::function as callback
EditBox: mac secure input EditBox: mac secure input
Fix a bug that can not get/set text in password mode on Mac OS X
iSevenDays iSevenDays
Fixed a bug that the result of 'malloc' is incompatible with type 'unsigned char *' in Image::saveImageToPNG Fixed a bug that the result of 'malloc' is incompatible with type 'unsigned char *' in Image::saveImageToPNG
@ -887,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
@ -896,7 +898,8 @@ Developers:
kyokomi kyokomi
Fix the bug that UIButton doesn't support TTF font Fix the bug that UIButton doesn't support TTF font
Fix a but of TextReader Fix a bug of TextReader
Fix a bug that UITextField doesn't support TTF font
gin0606 gin0606
Add a new line at the end of a file Add a new line at the end of a file
@ -911,6 +914,12 @@ 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.
CaiCQ
Fix a but that LabelTTF may lost chinese characters on linux
Retired Core Developers: Retired Core Developers:
WenSheng Yang WenSheng Yang
Author of windows port, CCTextField, Author of windows port, CCTextField,

View File

@ -1,19 +1,32 @@
cocos2d-x-3.2 ?? cocos2d-x-3.2 Jul.17 2014
[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] Game Controller: joystick y value inversed on iOS
[FIX] GLView: cursor position is not correct if design resolution is different from device resolution [FIX] GLView: cursor position is not correct if design resolution is different from device resolution
[FIX] Label: color can not be set correctly if using system font [FIX] Label: color can not be set correctly if using system font on iOS
[FIX] LabelTTF: may lost chinese characters on linux
[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] Setup.py: not work if using zsh [FIX] Physics integration: body shape will be wrong when using negative value to scale
[FIX] ScrollViewDelegate: make the scrollView delegate methods optional
[FIX] Setup.py: will crash on windows because of checking `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
[FIX] UIdget: opacity is wrong when replace texture [FIX] UIwidget: opacity is wrong when replace texture
[FIX] UIRichText: will crash when using utf8 string and the length exceed specified length
[FIX] UIText: can not wrap words automatically
[FIX] UITextField: keyboard can not hide if touching space outside of keyboard [FIX] UITextField: keyboard can not hide if touching space outside of keyboard
[FIX] UITextField: can not wrap words automatically
[FIX] UIVideoPlayer: can not exit full screen mode on Android
[FIX] Others: don't release singleton objects correctly that are needed in the whole game, which will be treated [FIX] Others: don't release singleton objects correctly that are needed in the whole game, which will be treated
as memory leak when using VLD. as memory leak when using VLD.
[FIX] Others: compiling error when building for iOS 64-bit devices with Xcode6 beta3
cocos2d-x-3.2rc0 Jul.7 2014 cocos2d-x-3.2rc0 Jul.7 2014

View File

@ -7475,15 +7475,6 @@
"\"$(SRCROOT)/../external/websockets/prebuilt/ios\"", "\"$(SRCROOT)/../external/websockets/prebuilt/ios\"",
"\"$(SRCROOT)/../external/curl/prebuilt/ios\"", "\"$(SRCROOT)/../external/curl/prebuilt/ios\"",
); );
"OTHER_LDFLAGS[arch=arm64]" = (
"-lcurl_arm64",
"-ljpeg_arm64",
"-lpng_arm64",
"-ltiff_arm64",
"-lwebp_arm64",
"-lwebsockets_arm64",
"-lfreetype_arm64",
);
SDKROOT = iphoneos; SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/websockets/include/ios $(SRCROOT)/../external/freetype2/include/ios $(SRCROOT)/../external/curl/include/ios $(SRCROOT)/../external/webp/include/ios $(SRCROOT)/../external/tiff/include/ios $(SRCROOT)/../external/jpeg/include/ios $(SRCROOT)/../external/png/include/ios"; USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/websockets/include/ios $(SRCROOT)/../external/freetype2/include/ios $(SRCROOT)/../external/curl/include/ios $(SRCROOT)/../external/webp/include/ios $(SRCROOT)/../external/tiff/include/ios $(SRCROOT)/../external/jpeg/include/ios $(SRCROOT)/../external/png/include/ios";
@ -7515,15 +7506,6 @@
"\"$(SRCROOT)/../external/websockets/prebuilt/ios\"", "\"$(SRCROOT)/../external/websockets/prebuilt/ios\"",
"\"$(SRCROOT)/../external/curl/prebuilt/ios\"", "\"$(SRCROOT)/../external/curl/prebuilt/ios\"",
); );
"OTHER_LDFLAGS[arch=arm64]" = (
"-lcurl_arm64",
"-ljpeg_arm64",
"-lpng_arm64",
"-ltiff_arm64",
"-lwebp_arm64",
"-lwebsockets_arm64",
"-lfreetype_arm64",
);
SDKROOT = iphoneos; SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/websockets/include/ios $(SRCROOT)/../external/freetype2/include/ios $(SRCROOT)/../external/curl/include/ios $(SRCROOT)/../external/webp/include/ios $(SRCROOT)/../external/tiff/include/ios $(SRCROOT)/../external/jpeg/include/ios $(SRCROOT)/../external/png/include/ios"; USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../external/websockets/include/ios $(SRCROOT)/../external/freetype2/include/ios $(SRCROOT)/../external/curl/include/ios $(SRCROOT)/../external/webp/include/ios $(SRCROOT)/../external/tiff/include/ios $(SRCROOT)/../external/jpeg/include/ios $(SRCROOT)/../external/png/include/ios";

View File

@ -58,6 +58,9 @@
1503FAC418DA8B6C00F6518C /* tp.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB118DA8B6C00F6518C /* tp.lua */; }; 1503FAC418DA8B6C00F6518C /* tp.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB118DA8B6C00F6518C /* tp.lua */; };
1503FAC518DA8B6C00F6518C /* url.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB218DA8B6C00F6518C /* url.lua */; }; 1503FAC518DA8B6C00F6518C /* url.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB218DA8B6C00F6518C /* url.lua */; };
1503FAC618DA8B6C00F6518C /* url.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB218DA8B6C00F6518C /* url.lua */; }; 1503FAC618DA8B6C00F6518C /* url.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB218DA8B6C00F6518C /* url.lua */; };
156229331973D400009C9067 /* bitExtend.lua in Resources */ = {isa = PBXBuildFile; fileRef = 156229321973D400009C9067 /* bitExtend.lua */; };
156229341973D400009C9067 /* bitExtend.lua in Resources */ = {isa = PBXBuildFile; fileRef = 156229321973D400009C9067 /* bitExtend.lua */; };
156EAE071977D0BD00F53709 /* ActionTimeline in Resources */ = {isa = PBXBuildFile; fileRef = 38FA2E75194AECF800FF2BE4 /* ActionTimeline */; };
15AECE0B195C0F8A00907DB0 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EA0FB65191B933000B170C8 /* MediaPlayer.framework */; }; 15AECE0B195C0F8A00907DB0 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EA0FB65191B933000B170C8 /* MediaPlayer.framework */; };
15AECE0F195C1FDD00907DB0 /* cocosvideo.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 3EA0FB5D191B92F100B170C8 /* cocosvideo.mp4 */; }; 15AECE0F195C1FDD00907DB0 /* cocosvideo.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 3EA0FB5D191B92F100B170C8 /* cocosvideo.mp4 */; };
15AECE1F195D0EC500907DB0 /* experimentalConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AECE1E195D0EC500907DB0 /* experimentalConstants.lua */; }; 15AECE1F195D0EC500907DB0 /* experimentalConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AECE1E195D0EC500907DB0 /* experimentalConstants.lua */; };
@ -1393,6 +1396,7 @@
1503FAB018DA8B6C00F6518C /* socket.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = socket.lua; path = ../external/lua/luasocket/socket.lua; sourceTree = "<group>"; }; 1503FAB018DA8B6C00F6518C /* socket.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = socket.lua; path = ../external/lua/luasocket/socket.lua; sourceTree = "<group>"; };
1503FAB118DA8B6C00F6518C /* tp.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = tp.lua; path = ../external/lua/luasocket/tp.lua; sourceTree = "<group>"; }; 1503FAB118DA8B6C00F6518C /* tp.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = tp.lua; path = ../external/lua/luasocket/tp.lua; sourceTree = "<group>"; };
1503FAB218DA8B6C00F6518C /* url.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = url.lua; path = ../external/lua/luasocket/url.lua; sourceTree = "<group>"; }; 1503FAB218DA8B6C00F6518C /* url.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = url.lua; path = ../external/lua/luasocket/url.lua; sourceTree = "<group>"; };
156229321973D400009C9067 /* bitExtend.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = bitExtend.lua; path = "../cocos/scripting/lua-bindings/script/bitExtend.lua"; sourceTree = "<group>"; };
15AECE1E195D0EC500907DB0 /* experimentalConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = experimentalConstants.lua; path = "../cocos/scripting/lua-bindings/script/experimentalConstants.lua"; sourceTree = "<group>"; }; 15AECE1E195D0EC500907DB0 /* experimentalConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = experimentalConstants.lua; path = "../cocos/scripting/lua-bindings/script/experimentalConstants.lua"; sourceTree = "<group>"; };
15C64822165F391E007D4F18 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Cocoa.framework; sourceTree = DEVELOPER_DIR; }; 15C64822165F391E007D4F18 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Cocoa.framework; sourceTree = DEVELOPER_DIR; };
15C64824165F3934007D4F18 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/OpenGL.framework; sourceTree = DEVELOPER_DIR; }; 15C64824165F3934007D4F18 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/OpenGL.framework; sourceTree = DEVELOPER_DIR; };
@ -5531,6 +5535,7 @@
1ABCA36418CD9E060087CE3A /* Lua Common */ = { 1ABCA36418CD9E060087CE3A /* Lua Common */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
156229321973D400009C9067 /* bitExtend.lua */,
15AECE1E195D0EC500907DB0 /* experimentalConstants.lua */, 15AECE1E195D0EC500907DB0 /* experimentalConstants.lua */,
1503FAA918DA8B6C00F6518C /* ftp.lua */, 1503FAA918DA8B6C00F6518C /* ftp.lua */,
1503FAAA18DA8B6C00F6518C /* headers.lua */, 1503FAAA18DA8B6C00F6518C /* headers.lua */,
@ -7866,6 +7871,7 @@
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
156EAE071977D0BD00F53709 /* ActionTimeline in Resources */,
15E66FD6192DC8C700C20A52 /* Sprite3DTest in Resources */, 15E66FD6192DC8C700C20A52 /* Sprite3DTest in Resources */,
1AC35DC318CEE65100F37B72 /* Misc in Resources */, 1AC35DC318CEE65100F37B72 /* Misc in Resources */,
1AC35DC618CEE65100F37B72 /* Shaders in Resources */, 1AC35DC618CEE65100F37B72 /* Shaders in Resources */,
@ -7897,6 +7903,7 @@
15C90B4918E66C2A00D69802 /* tp.lua in Resources */, 15C90B4918E66C2A00D69802 /* tp.lua in Resources */,
1AC35DE918CEE65900F37B72 /* effect1.wav in Resources */, 1AC35DE918CEE65900F37B72 /* effect1.wav in Resources */,
1ABCA38E18CD9E180087CE3A /* GuiConstants.lua in Resources */, 1ABCA38E18CD9E180087CE3A /* GuiConstants.lua in Resources */,
156229331973D400009C9067 /* bitExtend.lua in Resources */,
15C90B3F18E66C0C00D69802 /* ltn12.lua in Resources */, 15C90B3F18E66C0C00D69802 /* ltn12.lua in Resources */,
15C90B4718E66C2400D69802 /* socket.lua in Resources */, 15C90B4718E66C2400D69802 /* socket.lua in Resources */,
15C90B3A18E66BE200D69802 /* ftp.lua in Resources */, 15C90B3A18E66BE200D69802 /* ftp.lua in Resources */,
@ -7939,6 +7946,7 @@
15B0870D195AD52000D6F62B /* ActionTimeline in Resources */, 15B0870D195AD52000D6F62B /* ActionTimeline in Resources */,
15E66FC8192D957100C20A52 /* Sprite3DTest in Resources */, 15E66FC8192D957100C20A52 /* Sprite3DTest in Resources */,
15C90B4418E66C1800D69802 /* mime.lua in Resources */, 15C90B4418E66C1800D69802 /* mime.lua in Resources */,
156229341973D400009C9067 /* bitExtend.lua in Resources */,
15C90B4C18E66C3100D69802 /* url.lua in Resources */, 15C90B4C18E66C3100D69802 /* url.lua in Resources */,
1AC35DD618CEE65200F37B72 /* Misc in Resources */, 1AC35DD618CEE65200F37B72 /* Misc in Resources */,
1ABCA37B18CD9E180087CE3A /* CCBReaderLoad.lua in Resources */, 1ABCA37B18CD9E180087CE3A /* CCBReaderLoad.lua in Resources */,

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,13 +176,15 @@ 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
#endif //__CCTMX_TILE_MAP2_H__ #endif //__CCTMX_TILE_MAP2_H__

View File

@ -22,11 +22,11 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
****************************************************************************/ ****************************************************************************/
#include <sstream>
#include "2d/CCFontAtlasCache.h" #include "2d/CCFontAtlasCache.h"
#include <iostream>
#include <sstream>
#include "2d/CCFontFNT.h" #include "2d/CCFontFNT.h"
#include "2d/CCFontFreeType.h" #include "2d/CCFontFreeType.h"
#include "CCFontCharMap.h" #include "CCFontCharMap.h"

View File

@ -26,7 +26,6 @@
#ifndef _CCFontAtlasCache_h_ #ifndef _CCFontAtlasCache_h_
#define _CCFontAtlasCache_h_ #define _CCFontAtlasCache_h_
#include <iostream>
#include <unordered_map> #include <unordered_map>
#include "2d/CCFontAtlas.h" #include "2d/CCFontAtlas.h"

View File

@ -186,7 +186,7 @@ bool LabelTextFormatter::alignText(Label *theLabel)
int i = 0; int i = 0;
int lineNumber = 0; int lineNumber = 0;
int strLen = static_cast<int>(theLabel->_currentUTF16String.length()); int strLen = theLabel->_limitShowCount;
std::vector<char16_t> lastLine; std::vector<char16_t> lastLine;
auto strWhole = theLabel->_currentUTF16String; auto strWhole = theLabel->_currentUTF16String;

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

@ -94,6 +94,9 @@ RenderTexture::~RenderTexture()
void RenderTexture::listenToBackground(EventCustom *event) void RenderTexture::listenToBackground(EventCustom *event)
{ {
// We have not found a way to dispatch the enter background message before the texture data are destroyed.
// So we disable this pair of message handler at present.
#if 0
#if CC_ENABLE_CACHE_TEXTURE_DATA #if CC_ENABLE_CACHE_TEXTURE_DATA
CC_SAFE_DELETE(_UITextureImage); CC_SAFE_DELETE(_UITextureImage);
@ -118,10 +121,12 @@ void RenderTexture::listenToBackground(EventCustom *event)
glDeleteFramebuffers(1, &_FBO); glDeleteFramebuffers(1, &_FBO);
_FBO = 0; _FBO = 0;
#endif #endif
#endif
} }
void RenderTexture::listenToForeground(EventCustom *event) void RenderTexture::listenToForeground(EventCustom *event)
{ {
#if 0
#if CC_ENABLE_CACHE_TEXTURE_DATA #if CC_ENABLE_CACHE_TEXTURE_DATA
// -- regenerate frame buffer object and attach the texture // -- regenerate frame buffer object and attach the texture
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_oldFBO); glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_oldFBO);
@ -139,6 +144,7 @@ void RenderTexture::listenToForeground(EventCustom *event)
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, _texture->getName(), 0); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, _texture->getName(), 0);
glBindFramebuffer(GL_FRAMEBUFFER, _oldFBO); glBindFramebuffer(GL_FRAMEBUFFER, _oldFBO);
#endif #endif
#endif
} }
RenderTexture * RenderTexture::create(int w, int h, Texture2D::PixelFormat eFormat) RenderTexture * RenderTexture::create(int w, int h, Texture2D::PixelFormat eFormat)
@ -564,6 +570,14 @@ void RenderTexture::onBegin()
Mat4::createOrthographicOffCenter((float)-1.0 / widthRatio, (float)1.0 / widthRatio, (float)-1.0 / heightRatio, (float)1.0 / heightRatio, -1, 1, &orthoMatrix); Mat4::createOrthographicOffCenter((float)-1.0 / widthRatio, (float)1.0 / widthRatio, (float)-1.0 / heightRatio, (float)1.0 / heightRatio, -1, 1, &orthoMatrix);
director->multiplyMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, orthoMatrix); director->multiplyMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, orthoMatrix);
} }
else
{
#if CC_TARGET_PLATFORM == CC_PLATFORM_WP8
Mat4 modifiedProjection = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
modifiedProjection = CCEGLView::sharedOpenGLView()->getReverseOrientationMatrix() * modifiedProjection;
director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, modifiedProjection);
#endif
}
//calculate viewport //calculate viewport
{ {

View File

@ -153,7 +153,7 @@ public:
// //
virtual void onEnter() override; virtual void onEnter() override;
protected: CC_CONSTRUCTOR_ACCESS:
TransitionRotoZoom(); TransitionRotoZoom();
virtual ~TransitionRotoZoom(); virtual ~TransitionRotoZoom();
@ -175,7 +175,7 @@ public:
// //
virtual void onEnter() override; virtual void onEnter() override;
protected: CC_CONSTRUCTOR_ACCESS:
TransitionJumpZoom(); TransitionJumpZoom();
virtual ~TransitionJumpZoom(); virtual ~TransitionJumpZoom();
@ -201,10 +201,11 @@ public:
// //
virtual void onEnter() override; virtual void onEnter() override;
protected: CC_CONSTRUCTOR_ACCESS:
TransitionMoveInL(); TransitionMoveInL();
virtual ~TransitionMoveInL(); virtual ~TransitionMoveInL();
protected:
/** initializes the scenes */ /** initializes the scenes */
virtual void initScenes(); virtual void initScenes();
@ -220,10 +221,11 @@ class CC_DLL TransitionMoveInR : public TransitionMoveInL
public: public:
static TransitionMoveInR* create(float t, Scene* scene); static TransitionMoveInR* create(float t, Scene* scene);
protected: CC_CONSTRUCTOR_ACCESS:
TransitionMoveInR(); TransitionMoveInR();
virtual ~TransitionMoveInR(); virtual ~TransitionMoveInR();
protected:
virtual void initScenes(); virtual void initScenes();
private: private:
@ -238,10 +240,11 @@ class CC_DLL TransitionMoveInT : public TransitionMoveInL
public: public:
static TransitionMoveInT* create(float t, Scene* scene); static TransitionMoveInT* create(float t, Scene* scene);
protected: CC_CONSTRUCTOR_ACCESS:
TransitionMoveInT(); TransitionMoveInT();
virtual ~TransitionMoveInT(); virtual ~TransitionMoveInT();
protected:
virtual void initScenes(); virtual void initScenes();
private: private:
@ -256,10 +259,11 @@ class CC_DLL TransitionMoveInB : public TransitionMoveInL
public: public:
static TransitionMoveInB* create(float t, Scene* scene); static TransitionMoveInB* create(float t, Scene* scene);
protected: CC_CONSTRUCTOR_ACCESS:
TransitionMoveInB(); TransitionMoveInB();
virtual ~TransitionMoveInB(); virtual ~TransitionMoveInB();
protected:
virtual void initScenes(); virtual void initScenes();
private: private:
@ -284,10 +288,11 @@ public:
// //
virtual void onEnter() override; virtual void onEnter() override;
protected: CC_CONSTRUCTOR_ACCESS:
TransitionSlideInL(); TransitionSlideInL();
virtual ~TransitionSlideInL(); virtual ~TransitionSlideInL();
protected:
/** initializes the scenes */ /** initializes the scenes */
virtual void initScenes(void); virtual void initScenes(void);
@ -308,10 +313,11 @@ public:
/** returns the action that will be performed by the incoming and outgoing scene */ /** returns the action that will be performed by the incoming and outgoing scene */
virtual ActionInterval* action(void); virtual ActionInterval* action(void);
protected: CC_CONSTRUCTOR_ACCESS:
TransitionSlideInR(); TransitionSlideInR();
virtual ~TransitionSlideInR(); virtual ~TransitionSlideInR();
protected:
/** initializes the scenes */ /** initializes the scenes */
virtual void initScenes(void); virtual void initScenes(void);
@ -332,10 +338,11 @@ public:
/** returns the action that will be performed by the incoming and outgoing scene */ /** returns the action that will be performed by the incoming and outgoing scene */
virtual ActionInterval* action(void); virtual ActionInterval* action(void);
protected: CC_CONSTRUCTOR_ACCESS:
TransitionSlideInB(); TransitionSlideInB();
virtual ~TransitionSlideInB(); virtual ~TransitionSlideInB();
protected:
/** initializes the scenes */ /** initializes the scenes */
virtual void initScenes(); virtual void initScenes();
@ -356,10 +363,11 @@ public:
/** returns the action that will be performed by the incoming and outgoing scene */ /** returns the action that will be performed by the incoming and outgoing scene */
virtual ActionInterval* action(void); virtual ActionInterval* action(void);
protected: CC_CONSTRUCTOR_ACCESS:
TransitionSlideInT(); TransitionSlideInT();
virtual ~TransitionSlideInT(); virtual ~TransitionSlideInT();
protected:
/** initializes the scenes */ /** initializes the scenes */
virtual void initScenes(void); virtual void initScenes(void);
@ -387,7 +395,7 @@ public:
virtual void onEnter() override; virtual void onEnter() override;
virtual ActionInterval* easeActionWithAction(ActionInterval * action) override; virtual ActionInterval* easeActionWithAction(ActionInterval * action) override;
protected: CC_CONSTRUCTOR_ACCESS:
TransitionShrinkGrow(); TransitionShrinkGrow();
virtual ~TransitionShrinkGrow(); virtual ~TransitionShrinkGrow();
@ -414,7 +422,7 @@ public:
*/ */
virtual void onEnter() override; virtual void onEnter() override;
protected: CC_CONSTRUCTOR_ACCESS:
TransitionFlipX(); TransitionFlipX();
virtual ~TransitionFlipX(); virtual ~TransitionFlipX();
@ -441,7 +449,7 @@ public:
*/ */
virtual void onEnter() override; virtual void onEnter() override;
protected: CC_CONSTRUCTOR_ACCESS:
TransitionFlipY(); TransitionFlipY();
virtual ~TransitionFlipY(); virtual ~TransitionFlipY();
@ -468,7 +476,7 @@ public:
*/ */
virtual void onEnter() override; virtual void onEnter() override;
protected: CC_CONSTRUCTOR_ACCESS:
TransitionFlipAngular(); TransitionFlipAngular();
virtual ~TransitionFlipAngular(); virtual ~TransitionFlipAngular();
@ -495,7 +503,7 @@ public:
*/ */
virtual void onEnter() override; virtual void onEnter() override;
protected: CC_CONSTRUCTOR_ACCESS:
TransitionZoomFlipX(); TransitionZoomFlipX();
virtual ~TransitionZoomFlipX(); virtual ~TransitionZoomFlipX();
@ -522,7 +530,7 @@ public:
*/ */
virtual void onEnter() override; virtual void onEnter() override;
protected: CC_CONSTRUCTOR_ACCESS:
TransitionZoomFlipY(); TransitionZoomFlipY();
virtual ~TransitionZoomFlipY(); virtual ~TransitionZoomFlipY();
@ -549,7 +557,7 @@ public:
*/ */
virtual void onEnter() override; virtual void onEnter() override;
protected: CC_CONSTRUCTOR_ACCESS:
TransitionZoomFlipAngular(); TransitionZoomFlipAngular();
virtual ~TransitionZoomFlipAngular(); virtual ~TransitionZoomFlipAngular();
@ -625,7 +633,7 @@ public :
*/ */
virtual void onExit() override; virtual void onExit() override;
protected: CC_CONSTRUCTOR_ACCESS:
TransitionCrossFade(); TransitionCrossFade();
virtual ~TransitionCrossFade(); virtual ~TransitionCrossFade();
@ -653,10 +661,11 @@ public :
virtual ActionInterval * easeActionWithAction(ActionInterval * action) override; virtual ActionInterval * easeActionWithAction(ActionInterval * action) override;
virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override; virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override;
protected: CC_CONSTRUCTOR_ACCESS:
TransitionTurnOffTiles(); TransitionTurnOffTiles();
virtual ~TransitionTurnOffTiles(); virtual ~TransitionTurnOffTiles();
protected:
virtual void sceneOrder() override; virtual void sceneOrder() override;
NodeGrid* _outSceneProxy; NodeGrid* _outSceneProxy;
@ -685,9 +694,12 @@ public:
virtual ActionInterval * easeActionWithAction(ActionInterval * action) override; virtual ActionInterval * easeActionWithAction(ActionInterval * action) override;
virtual void onExit() override; virtual void onExit() override;
virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override; virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override;
protected:
CC_CONSTRUCTOR_ACCESS:
TransitionSplitCols(); TransitionSplitCols();
virtual ~TransitionSplitCols(); virtual ~TransitionSplitCols();
protected:
void switchTargetToInscene(); void switchTargetToInscene();
NodeGrid* _gridProxy; NodeGrid* _gridProxy;
private: private:
@ -707,7 +719,7 @@ public:
// //
virtual ActionInterval* action(void) override; virtual ActionInterval* action(void) override;
protected: CC_CONSTRUCTOR_ACCESS:
TransitionSplitRows(); TransitionSplitRows();
virtual ~TransitionSplitRows(); virtual ~TransitionSplitRows();
@ -736,10 +748,12 @@ public:
virtual ActionInterval* easeActionWithAction(ActionInterval * action) override; virtual ActionInterval* easeActionWithAction(ActionInterval * action) override;
virtual void onExit() override; virtual void onExit() override;
virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override; virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override;
protected:
CC_CONSTRUCTOR_ACCESS:
TransitionFadeTR(); TransitionFadeTR();
virtual ~TransitionFadeTR(); virtual ~TransitionFadeTR();
protected:
virtual void sceneOrder(); virtual void sceneOrder();
NodeGrid* _outSceneProxy; NodeGrid* _outSceneProxy;
@ -761,7 +775,7 @@ public:
// //
virtual ActionInterval* actionWithSize(const Size& size) override; virtual ActionInterval* actionWithSize(const Size& size) override;
protected: CC_CONSTRUCTOR_ACCESS:
TransitionFadeBL(); TransitionFadeBL();
virtual ~TransitionFadeBL(); virtual ~TransitionFadeBL();
@ -782,7 +796,7 @@ public:
// //
virtual ActionInterval* actionWithSize(const Size& size) override; virtual ActionInterval* actionWithSize(const Size& size) override;
protected: CC_CONSTRUCTOR_ACCESS:
TransitionFadeUp(); TransitionFadeUp();
virtual ~TransitionFadeUp(); virtual ~TransitionFadeUp();
@ -803,7 +817,7 @@ public:
// //
virtual ActionInterval* actionWithSize(const Size& size) override; virtual ActionInterval* actionWithSize(const Size& size) override;
protected: CC_CONSTRUCTOR_ACCESS:
TransitionFadeDown(); TransitionFadeDown();
virtual ~TransitionFadeDown(); virtual ~TransitionFadeDown();

View File

@ -59,15 +59,6 @@ public:
* scene is being turned from left over the outgoing scene. * scene is being turned from left over the outgoing scene.
*/ */
static TransitionPageTurn* create(float t,Scene* scene,bool backwards); static TransitionPageTurn* create(float t,Scene* scene,bool backwards);
/**
* @js ctor
*/
TransitionPageTurn();
/**
* @js NA
* @lua NA
*/
virtual ~TransitionPageTurn();
// //
// Overrides // Overrides
@ -89,6 +80,17 @@ public:
virtual void onEnter() override; virtual void onEnter() override;
virtual void onExit() override; virtual void onExit() override;
CC_CONSTRUCTOR_ACCESS:
/**
* @js ctor
*/
TransitionPageTurn();
/**
* @js NA
* @lua NA
*/
virtual ~TransitionPageTurn();
protected: protected:
virtual void sceneOrder() override; virtual void sceneOrder() override;

View File

@ -44,14 +44,16 @@ class CC_DLL TransitionProgress : public TransitionScene
public: public:
static TransitionProgress* create(float t, Scene* scene); static TransitionProgress* create(float t, Scene* scene);
TransitionProgress();
// //
// Overrides // Overrides
// //
virtual void onEnter() override; virtual void onEnter() override;
virtual void onExit() override; virtual void onExit() override;
CC_CONSTRUCTOR_ACCESS:
TransitionProgress();
virtual ~TransitionProgress(){}
protected: protected:
virtual void sceneOrder() override; virtual void sceneOrder() override;
@ -74,6 +76,13 @@ class CC_DLL TransitionProgressRadialCCW : public TransitionProgress
public: public:
static TransitionProgressRadialCCW* create(float t, Scene* scene); static TransitionProgressRadialCCW* create(float t, Scene* scene);
CC_CONSTRUCTOR_ACCESS:
/**
* @js ctor
*/
TransitionProgressRadialCCW(){}
virtual ~TransitionProgressRadialCCW(){}
protected: protected:
// //
// Overrides // Overrides
@ -91,6 +100,13 @@ class CC_DLL TransitionProgressRadialCW : public TransitionProgress
public: public:
static TransitionProgressRadialCW* create(float t, Scene* scene); static TransitionProgressRadialCW* create(float t, Scene* scene);
CC_CONSTRUCTOR_ACCESS:
/**
* @js ctor
*/
TransitionProgressRadialCW(){}
virtual ~TransitionProgressRadialCW(){}
protected: protected:
// //
// Overrides // Overrides
@ -107,6 +123,13 @@ class CC_DLL TransitionProgressHorizontal : public TransitionProgress
public: public:
static TransitionProgressHorizontal* create(float t, Scene* scene); static TransitionProgressHorizontal* create(float t, Scene* scene);
CC_CONSTRUCTOR_ACCESS:
/**
* @js ctor
*/
TransitionProgressHorizontal(){}
virtual ~TransitionProgressHorizontal(){}
protected: protected:
// //
// Overrides // Overrides
@ -119,6 +142,13 @@ class CC_DLL TransitionProgressVertical : public TransitionProgress
public: public:
static TransitionProgressVertical* create(float t, Scene* scene); static TransitionProgressVertical* create(float t, Scene* scene);
CC_CONSTRUCTOR_ACCESS:
/**
* @js ctor
*/
TransitionProgressVertical(){}
virtual ~TransitionProgressVertical(){}
protected: protected:
// //
// Overrides // Overrides
@ -131,6 +161,13 @@ class CC_DLL TransitionProgressInOut : public TransitionProgress
public: public:
static TransitionProgressInOut* create(float t, Scene* scene); static TransitionProgressInOut* create(float t, Scene* scene);
CC_CONSTRUCTOR_ACCESS:
/**
* @js ctor
*/
TransitionProgressInOut(){}
virtual ~TransitionProgressInOut(){}
protected: protected:
// //
// Overrides // Overrides
@ -145,6 +182,13 @@ class CC_DLL TransitionProgressOutIn : public TransitionProgress
public: public:
static TransitionProgressOutIn* create(float t, Scene* scene); static TransitionProgressOutIn* create(float t, Scene* scene);
CC_CONSTRUCTOR_ACCESS:
/**
* @js ctor
*/
TransitionProgressOutIn(){}
virtual ~TransitionProgressOutIn(){}
protected: protected:
// //
// Overrides // Overrides

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

@ -223,9 +223,9 @@ LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dxandroid_static
# define the macro to compile through support/zip_support/ioapi.c # define the macro to compile through support/zip_support/ioapi.c
LOCAL_CFLAGS := -DUSE_FILE32API LOCAL_CFLAGS := -DUSE_FILE32API
LOCAL_CPPFLAGS := -Wno-deprecated-declarations LOCAL_CPPFLAGS := -Wno-deprecated-declarations -Wno-extern-c-compat
LOCAL_EXPORT_CFLAGS := -DUSE_FILE32API LOCAL_EXPORT_CFLAGS := -DUSE_FILE32API
LOCAL_EXPORT_CPPFLAGS := -Wno-deprecated-declarations LOCAL_EXPORT_CPPFLAGS := -Wno-deprecated-declarations -Wno-extern-c-compat
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)

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

@ -196,7 +196,7 @@ void Controller::registerListeners()
}; };
_impl->_gcController.extendedGamepad.leftThumbstick.yAxis.valueChangedHandler = ^(GCControllerAxisInput *axis, float value){ _impl->_gcController.extendedGamepad.leftThumbstick.yAxis.valueChangedHandler = ^(GCControllerAxisInput *axis, float value){
onAxisEvent(Key::JOYSTICK_LEFT_Y, value, axis.isAnalog); onAxisEvent(Key::JOYSTICK_LEFT_Y, -value, axis.isAnalog);
}; };
_impl->_gcController.extendedGamepad.rightThumbstick.xAxis.valueChangedHandler = ^(GCControllerAxisInput *axis, float value){ _impl->_gcController.extendedGamepad.rightThumbstick.xAxis.valueChangedHandler = ^(GCControllerAxisInput *axis, float value){
@ -204,7 +204,7 @@ void Controller::registerListeners()
}; };
_impl->_gcController.extendedGamepad.rightThumbstick.yAxis.valueChangedHandler = ^(GCControllerAxisInput *axis, float value){ _impl->_gcController.extendedGamepad.rightThumbstick.yAxis.valueChangedHandler = ^(GCControllerAxisInput *axis, float value){
onAxisEvent(Key::JOYSTICK_RIGHT_Y, value, axis.isAnalog); onAxisEvent(Key::JOYSTICK_RIGHT_Y, -value, axis.isAnalog);
}; };
_impl->_gcController.extendedGamepad.valueChangedHandler = ^(GCExtendedGamepad *gamepad, GCControllerElement *element){ _impl->_gcController.extendedGamepad.valueChangedHandler = ^(GCExtendedGamepad *gamepad, GCControllerElement *element){

View File

@ -100,7 +100,7 @@ ssize_t Data::getSize() const
return _size; return _size;
} }
void Data::copy(unsigned char* bytes, const ssize_t size) void Data::copy(const unsigned char* bytes, const ssize_t size)
{ {
clear(); clear();

View File

@ -63,7 +63,7 @@ public:
* Developer should free the pointer after invoking this method. * Developer should free the pointer after invoking this method.
* @see Data::fastSet * @see Data::fastSet
*/ */
void copy(unsigned char* bytes, const ssize_t size); void copy(const unsigned char* bytes, const ssize_t size);
/** Fast set the buffer pointer and its size. Please use it carefully. /** Fast set the buffer pointer and its size. Please use it carefully.
* @param bytes The buffer pointer, note that it have to be allocated by 'malloc' or 'calloc', * @param bytes The buffer pointer, note that it have to be allocated by 'malloc' or 'calloc',

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"
@ -161,6 +164,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);
}
} }
NS_CC_END NS_CC_END

View File

@ -73,6 +73,11 @@ namespace utils
* @since v3.2 * @since v3.2
*/ */
std::vector<Node*> findChildren(const Node &node, const std::string &name); std::vector<Node*> 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

@ -31,7 +31,7 @@ NS_CC_BEGIN
const char* cocos2dVersion() const char* cocos2dVersion()
{ {
return "cocos2d-x 3.2beta0"; return "cocos2d-x 3.2";
} }
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

@ -157,8 +157,8 @@ void Timeline::binarySearchKeyFrame(int frameIndex)
break; break;
} }
int target = -1; long target = -1;
int low=0,high=length-1,mid; long low=0,high=length-1,mid=0;
while(low<=high){ while(low<=high){
mid=(low+high)/2; mid=(low+high)/2;
if(frameIndex >= _frames.at(mid)->getFrameIndex() && frameIndex < _frames.at(mid+1)->getFrameIndex()) if(frameIndex >= _frames.at(mid)->getFrameIndex() && frameIndex < _frames.at(mid+1)->getFrameIndex())

View File

@ -42,7 +42,12 @@ ActionManagerEx* ActionManagerEx::getInstance()
void ActionManagerEx::destroyInstance() void ActionManagerEx::destroyInstance()
{ {
CC_SAFE_DELETE(sharedActionManager); if(sharedActionManager != nullptr)
{
sharedActionManager->releaseActions();
CC_SAFE_DELETE(sharedActionManager);
}
} }
ActionManagerEx::ActionManagerEx() ActionManagerEx::ActionManagerEx()
@ -154,6 +159,13 @@ void ActionManagerEx::releaseActions()
for (iter = _actionDic.begin(); iter != _actionDic.end(); iter++) for (iter = _actionDic.begin(); iter != _actionDic.end(); iter++)
{ {
cocos2d::Vector<ActionObject*> objList = iter->second; cocos2d::Vector<ActionObject*> objList = iter->second;
int listCount = objList.size();
for (int i = 0; i < listCount; i++) {
ActionObject* action = objList.at(i);
if (action != nullptr) {
action->stop();
}
}
objList.clear(); objList.clear();
} }

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

@ -160,6 +160,7 @@ void Skin::updateTransform()
// //
// calculate the Quad based on the Affine Matrix // calculate the Quad based on the Affine Matrix
// //
Mat4 transform = getNodeToParentTransform();
Size &size = _rect.size; Size &size = _rect.size;
@ -169,13 +170,13 @@ void Skin::updateTransform()
float x2 = x1 + size.width; float x2 = x1 + size.width;
float y2 = y1 + size.height; float y2 = y1 + size.height;
float x = _transform.m[12]; float x = transform.m[12];
float y = _transform.m[13]; float y = transform.m[13];
float cr = _transform.m[0]; float cr = transform.m[0];
float sr = _transform.m[1]; float sr = transform.m[1];
float cr2 = _transform.m[5]; float cr2 = transform.m[5];
float sr2 = -_transform.m[4]; float sr2 = -transform.m[4];
float ax = x1 * cr - y1 * sr2 + x; float ax = x1 * cr - y1 * sr2 + x;
float ay = x1 * sr + y1 * cr2 + y; float ay = x1 * sr + y1 * cr2 + y;

View File

@ -195,27 +195,6 @@ bool CocoLoader::ReadCocoBinBuff(char* pBinBuff)
return true; return true;
} }
stExpCocoObjectDesc* CocoLoader::GetCocoObjectDesc(const char* szObjDesc)
{
for(int i = 0 ; i < m_pFileHeader->m_ObjectCount ; i++)
{
if(0 == strcmp((char*)m_pObjectDescArray[i].m_szName,szObjDesc))
{
return &m_pObjectDescArray[i];
}
}
return nullptr;
}
stExpCocoObjectDesc* CocoLoader::GetCocoObjectDesc(int vIndex)
{
if(vIndex >= 0 && vIndex < m_pFileHeader->m_ObjectCount)
{
return &m_pObjectDescArray[vIndex];
}
return nullptr;
}
char* CocoLoader::GetMemoryAddr_AttribDesc() char* CocoLoader::GetMemoryAddr_AttribDesc()
{ {
return m_pMemoryBuff + m_pFileHeader->m_lAttribMemAddr ; return m_pMemoryBuff + m_pFileHeader->m_lAttribMemAddr ;

View File

@ -104,8 +104,6 @@ public:
stCocoFileHeader* GetFileHeader(){return m_pFileHeader;} stCocoFileHeader* GetFileHeader(){return m_pFileHeader;}
stExpCocoNode* GetRootCocoNode(){return m_pRootNode;} stExpCocoNode* GetRootCocoNode(){return m_pRootNode;}
stExpCocoObjectDesc* GetCocoObjectDescArray(){return m_pObjectDescArray;} stExpCocoObjectDesc* GetCocoObjectDescArray(){return m_pObjectDescArray;}
stExpCocoObjectDesc* GetCocoObjectDesc(const char* szObjDesc);
stExpCocoObjectDesc* GetCocoObjectDesc(int vIndex);
char* GetMemoryAddr_AttribDesc(); char* GetMemoryAddr_AttribDesc();
char* GetMemoryAddr_CocoNode(); char* GetMemoryAddr_CocoNode();
char* GetMemoryAddr_String(); char* GetMemoryAddr_String();

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); int event = atoi(str1);
if (str1 == nullptr) if (event < 0)
{ {
continue; continue;
} }
int event = atoi(str1); char* buf = new char[10];
if (event < 0) sprintf(buf, "%d", event);
{ std::string custom_event_name(buf);
continue; CC_SAFE_DELETE_ARRAY(buf);
}
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){ EventListenerCustom* listener = EventListenerCustom::create(custom_event_name, [=](EventCustom* evt){
if (detect()) if (detect())
{ {
done(); done();
} }
}); });
_listeners.pushBack(listener); _listeners.pushBack(listener);
TriggerMng::getInstance()->addEventListenerWithFixedPriority(listener, 1); 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

@ -453,7 +453,7 @@ void PhysicsShapeCircle::update(float delta)
if (_dirty) if (_dirty)
{ {
cpFloat factor = PhysicsHelper::float2cpfloat( _newScaleX / _scaleX ); cpFloat factor = std::abs(PhysicsHelper::float2cpfloat( _newScaleX / _scaleX ));
cpShape* shape = _info->getShapes().front(); cpShape* shape = _info->getShapes().front();
cpVect v = cpCircleShapeGetOffset(shape); cpVect v = cpCircleShapeGetOffset(shape);
@ -710,6 +710,17 @@ void PhysicsShapePolygon::update(float delta)
vects[i].y *= factorY; vects[i].y *= factorY;
} }
// convert hole to clockwise
if ( factorX * factorY < 0 )
{
for (int i = 0; i < count / 2; ++i)
{
cpVect v = vects[i];
vects[i] = vects[count - i - 1];
vects[count - i - 1] = v;
}
}
for (int i = 0; i < count; ++i) for (int i = 0; i < count; ++i)
{ {
cpVect n = cpvnormalize(cpvperp(cpvsub(vects[i], vects[(i + 1) % count]))); cpVect n = cpvnormalize(cpvperp(cpvsub(vects[i], vects[(i + 1) % count])));

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) {
@ -62,6 +61,10 @@ 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

@ -292,6 +292,7 @@ public class Cocos2dxGLSurfaceView extends GLSurfaceView {
public boolean onKeyDown(final int pKeyCode, final KeyEvent pKeyEvent) { public boolean onKeyDown(final int pKeyCode, final KeyEvent pKeyEvent) {
switch (pKeyCode) { switch (pKeyCode) {
case KeyEvent.KEYCODE_BACK: case KeyEvent.KEYCODE_BACK:
Cocos2dxVideoHelper.mVideoHandler.sendEmptyMessage(Cocos2dxVideoHelper.KeyEventBack);
case KeyEvent.KEYCODE_MENU: case KeyEvent.KEYCODE_MENU:
case KeyEvent.KEYCODE_DPAD_LEFT: case KeyEvent.KEYCODE_DPAD_LEFT:
case KeyEvent.KEYCODE_DPAD_RIGHT: case KeyEvent.KEYCODE_DPAD_RIGHT:

View File

@ -40,7 +40,7 @@ public class Cocos2dxVideoHelper {
private FrameLayout mLayout = null; private FrameLayout mLayout = null;
private Cocos2dxActivity mActivity = null; private Cocos2dxActivity mActivity = null;
private SparseArray<Cocos2dxVideoView> sVideoViews = null; private SparseArray<Cocos2dxVideoView> sVideoViews = null;
private static VideoHandler mVideoHandler = null; static VideoHandler mVideoHandler = null;
Cocos2dxVideoHelper(Cocos2dxActivity activity,FrameLayout layout) Cocos2dxVideoHelper(Cocos2dxActivity activity,FrameLayout layout)
{ {
@ -64,6 +64,8 @@ public class Cocos2dxVideoHelper {
private final static int VideoTaskSetVisible = 9; private final static int VideoTaskSetVisible = 9;
private final static int VideoTaskRestart = 10; private final static int VideoTaskRestart = 10;
private final static int VideoTaskKeepRatio = 11; private final static int VideoTaskKeepRatio = 11;
private final static int VideoTaskFullScreen = 12;
final static int KeyEventBack = 1000;
static class VideoHandler extends Handler{ static class VideoHandler extends Handler{
WeakReference<Cocos2dxVideoHelper> mReference; WeakReference<Cocos2dxVideoHelper> mReference;
@ -101,6 +103,16 @@ public class Cocos2dxVideoHelper {
helper._setVideoRect(msg.arg1, rect.left, rect.top, rect.right, rect.bottom); helper._setVideoRect(msg.arg1, rect.left, rect.top, rect.right, rect.bottom);
break; break;
} }
case VideoTaskFullScreen:{
Cocos2dxVideoHelper helper = mReference.get();
Rect rect = (Rect)msg.obj;
if (msg.arg2 == 1) {
helper._setFullScreenEnabled(msg.arg1, true, rect.right, rect.bottom);
} else {
helper._setFullScreenEnabled(msg.arg1, false, rect.right, rect.bottom);
}
break;
}
case VideoTaskPause: { case VideoTaskPause: {
Cocos2dxVideoHelper helper = mReference.get(); Cocos2dxVideoHelper helper = mReference.get();
helper._pauseVideo(msg.arg1); helper._pauseVideo(msg.arg1);
@ -144,6 +156,11 @@ public class Cocos2dxVideoHelper {
} }
break; break;
} }
case KeyEventBack: {
Cocos2dxVideoHelper helper = mReference.get();
helper.onBackKeyEvent();
break;
}
default: default:
break; break;
} }
@ -255,6 +272,38 @@ public class Cocos2dxVideoHelper {
} }
} }
public static void setFullScreenEnabled(int index,boolean enabled, int width,int height) {
Message msg = new Message();
msg.what = VideoTaskFullScreen;
msg.arg1 = index;
if (enabled) {
msg.arg2 = 1;
} else {
msg.arg2 = 0;
}
msg.obj = new Rect(0, 0, width, height);
mVideoHandler.sendMessage(msg);
}
private void _setFullScreenEnabled(int index, boolean enabled, int width,int height) {
Cocos2dxVideoView videoView = sVideoViews.get(index);
if (videoView != null) {
videoView.setFullScreenEnabled(enabled, width, height);
}
}
private void onBackKeyEvent() {
int viewCount = sVideoViews.size();
for (int i = 0; i < viewCount; i++) {
int key = sVideoViews.keyAt(i);
Cocos2dxVideoView videoView = sVideoViews.get(key);
if (videoView != null) {
videoView.setFullScreenEnabled(false, 0, 0);
mActivity.runOnGLThread(new VideoEventRunnable(key, KeyEventBack));
}
}
}
public static void startVideo(int index) { public static void startVideo(int index) {
Message msg = new Message(); Message msg = new Message();
msg.what = VideoTaskStart; msg.what = VideoTaskStart;

View File

@ -18,7 +18,6 @@
package org.cocos2dx.lib; package org.cocos2dx.lib;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.res.AssetFileDescriptor; import android.content.res.AssetFileDescriptor;
@ -27,7 +26,6 @@ import android.media.AudioManager;
import android.media.MediaPlayer; import android.media.MediaPlayer;
import android.media.MediaPlayer.OnErrorListener; import android.media.MediaPlayer.OnErrorListener;
import android.net.Uri; import android.net.Uri;
import android.util.AttributeSet;
import android.util.Log; import android.util.Log;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.SurfaceHolder; import android.view.SurfaceHolder;
@ -75,7 +73,7 @@ public class Cocos2dxVideoView extends SurfaceView implements MediaPlayerControl
// recording the seek position while preparing // recording the seek position while preparing
private int mSeekWhenPrepared; private int mSeekWhenPrepared;
protected Context mContext = null; protected Cocos2dxActivity mCocos2dxActivity = null;
protected int mViewLeft = 0; protected int mViewLeft = 0;
protected int mViewTop = 0; protected int mViewTop = 0;
@ -87,27 +85,17 @@ public class Cocos2dxVideoView extends SurfaceView implements MediaPlayerControl
protected int mVisibleWidth = 0; protected int mVisibleWidth = 0;
protected int mVisibleHeight = 0; protected int mVisibleHeight = 0;
protected boolean mFullScreenEnabled = false;
protected int mFullScreenWidth = 0;
protected int mFullScreenHeight = 0;
private int mViewTag = 0; private int mViewTag = 0;
public Cocos2dxVideoView(Context context,int tag) { public Cocos2dxVideoView(Cocos2dxActivity activity,int tag) {
super(context); super(activity);
mViewTag = tag; mViewTag = tag;
mContext = context; mCocos2dxActivity = activity;
initVideoView();
}
public Cocos2dxVideoView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
mContext = context;
initVideoView();
}
public Cocos2dxVideoView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
mContext = context;
initVideoView(); initVideoView();
} }
@ -115,11 +103,11 @@ public class Cocos2dxVideoView extends SurfaceView implements MediaPlayerControl
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (mVideoWidth == 0 || mVideoHeight == 0) { if (mVideoWidth == 0 || mVideoHeight == 0) {
setMeasuredDimension(mViewWidth, mViewHeight); setMeasuredDimension(mViewWidth, mViewHeight);
Log.e(TAG, ""+mViewWidth+ ":" +mViewHeight); Log.i(TAG, ""+mViewWidth+ ":" +mViewHeight);
} }
else { else {
setMeasuredDimension(mVisibleWidth, mVisibleHeight); setMeasuredDimension(mVisibleWidth, mVisibleHeight);
Log.e(TAG, ""+mVisibleWidth+ ":" +mVisibleHeight); Log.i(TAG, ""+mVisibleWidth+ ":" +mVisibleHeight);
} }
} }
@ -131,6 +119,18 @@ public class Cocos2dxVideoView extends SurfaceView implements MediaPlayerControl
mViewHeight = maxHeight; mViewHeight = maxHeight;
if (mVideoWidth != 0 && mVideoHeight != 0) { if (mVideoWidth != 0 && mVideoHeight != 0) {
fixSize(mViewLeft, mViewTop, mViewWidth, mVideoHeight);
}
}
public void setFullScreenEnabled(boolean enabled, int width, int height) {
if (mFullScreenEnabled != enabled) {
mFullScreenEnabled = enabled;
if (width != 0 && height != 0) {
mFullScreenWidth = width;
mFullScreenHeight = height;
}
fixSize(); fixSize();
} }
} }
@ -265,7 +265,7 @@ public class Cocos2dxVideoView extends SurfaceView implements MediaPlayerControl
// TODO: these constants need to be published somewhere in the framework. // TODO: these constants need to be published somewhere in the framework.
Intent i = new Intent("com.android.music.musicservicecommand"); Intent i = new Intent("com.android.music.musicservicecommand");
i.putExtra("command", "pause"); i.putExtra("command", "pause");
mContext.sendBroadcast(i); mCocos2dxActivity.sendBroadcast(i);
// we shouldn't clear the target state, because somebody might have // we shouldn't clear the target state, because somebody might have
// called start() previously // called start() previously
@ -288,10 +288,10 @@ public class Cocos2dxVideoView extends SurfaceView implements MediaPlayerControl
mDuration = -1; mDuration = -1;
mCurrentBufferPercentage = 0; mCurrentBufferPercentage = 0;
if (isAssetRouse) { if (isAssetRouse) {
AssetFileDescriptor afd = mContext.getAssets().openFd(fileName); AssetFileDescriptor afd = mCocos2dxActivity.getAssets().openFd(fileName);
mMediaPlayer.setDataSource(afd.getFileDescriptor(),afd.getStartOffset(),afd.getLength()); mMediaPlayer.setDataSource(afd.getFileDescriptor(),afd.getStartOffset(),afd.getLength());
} else { } else {
mMediaPlayer.setDataSource(mContext, mUri); mMediaPlayer.setDataSource(mCocos2dxActivity, mUri);
} }
mMediaPlayer.prepareAsync(); mMediaPlayer.prepareAsync();
@ -321,27 +321,35 @@ public class Cocos2dxVideoView extends SurfaceView implements MediaPlayerControl
} }
public void fixSize() { public void fixSize() {
if (mViewWidth != 0 && mViewHeight != 0) { if (mFullScreenEnabled) {
fixSize(0, 0, mFullScreenWidth, mFullScreenHeight);
} else {
fixSize(mViewLeft, mViewTop, mViewWidth, mVideoHeight);
}
}
public void fixSize(int left,int top,int width,int height) {
if (width != 0 && height != 0) {
if (mKeepRatio) { if (mKeepRatio) {
if ( mVideoWidth * mViewHeight > mViewWidth * mVideoHeight ) { if ( mVideoWidth * height > width * mVideoHeight ) {
mVisibleWidth = mViewWidth; mVisibleWidth = width;
mVisibleHeight = mViewWidth * mVideoHeight / mVideoWidth; mVisibleHeight = width * mVideoHeight / mVideoWidth;
} else if ( mVideoWidth * mViewHeight < mViewWidth * mVideoHeight ) { } else if ( mVideoWidth * height < width * mVideoHeight ) {
mVisibleWidth = mViewHeight * mVideoWidth / mVideoHeight; mVisibleWidth = height * mVideoWidth / mVideoHeight;
mVisibleHeight = mViewHeight; mVisibleHeight = height;
} }
mVisibleLeft = mViewLeft + (mViewWidth - mVisibleWidth) / 2; mVisibleLeft = left + (width - mVisibleWidth) / 2;
mVisibleTop = mViewTop + (mViewHeight - mVisibleHeight) / 2; mVisibleTop = top + (height - mVisibleHeight) / 2;
} else { } else {
mVisibleLeft = mViewLeft; mVisibleLeft = left;
mVisibleTop = mViewTop; mVisibleTop = top;
mVisibleWidth = mViewWidth; mVisibleWidth = width;
mVisibleHeight = mViewHeight; mVisibleHeight = height;
} }
} }
else { else {
mVisibleLeft = mViewLeft; mVisibleLeft = left;
mVisibleTop = mViewTop; mVisibleTop = top;
mVisibleWidth = mVideoWidth; mVisibleWidth = mVideoWidth;
mVisibleHeight = mVideoHeight; mVisibleHeight = mVideoHeight;
} }
@ -437,7 +445,7 @@ public class Cocos2dxVideoView extends SurfaceView implements MediaPlayerControl
* longer have a window, don't bother showing the user an error. * longer have a window, don't bother showing the user an error.
*/ */
if (getWindowToken() != null) { if (getWindowToken() != null) {
Resources r = mContext.getResources(); Resources r = mCocos2dxActivity.getResources();
int messageId; int messageId;
if (framework_err == MediaPlayer.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK) { if (framework_err == MediaPlayer.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK) {
@ -451,7 +459,7 @@ public class Cocos2dxVideoView extends SurfaceView implements MediaPlayerControl
int titleId = r.getIdentifier("VideoView_error_title", "string", "android"); int titleId = r.getIdentifier("VideoView_error_title", "string", "android");
int buttonStringId = r.getIdentifier("VideoView_error_button", "string", "android"); int buttonStringId = r.getIdentifier("VideoView_error_button", "string", "android");
new AlertDialog.Builder(mContext) new AlertDialog.Builder(mCocos2dxActivity)
.setTitle(r.getString(titleId)) .setTitle(r.getString(titleId))
.setMessage(messageId) .setMessage(messageId)
.setPositiveButton(r.getString(buttonStringId), .setPositiveButton(r.getString(buttonStringId),

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,

View File

@ -215,7 +215,7 @@ public:
return false; return false;
} }
if (isspace(unicode)) { if (iswspace(unicode)) {
currentPaintPosition += face->glyph->metrics.horiAdvance >> 6; currentPaintPosition += face->glyph->metrics.horiAdvance >> 6;
prevGlyphIndex = glyphIndex; prevGlyphIndex = glyphIndex;
prevCharacter = unicode; prevCharacter = unicode;

File diff suppressed because it is too large Load Diff

View File

@ -23,6 +23,7 @@ LOCAL_SRC_FILES := manual/CCLuaBridge.cpp \
manual/lua_cocos2dx_ui_manual.cpp \ manual/lua_cocos2dx_ui_manual.cpp \
manual/lua_cocos2dx_spine_manual.cpp \ manual/lua_cocos2dx_spine_manual.cpp \
manual/lua_cocos2dx_physics_manual.cpp \ manual/lua_cocos2dx_physics_manual.cpp \
manual/lua_cocos2dx_experimental_manual.cpp \
manual/lua_cocos2dx_experimental_video_manual.cpp \ manual/lua_cocos2dx_experimental_video_manual.cpp \
manual/lua_cocos2dx_deprecated.cpp \ manual/lua_cocos2dx_deprecated.cpp \
manual/lua_xml_http_request.cpp \ manual/lua_xml_http_request.cpp \
@ -36,6 +37,7 @@ LOCAL_SRC_FILES := manual/CCLuaBridge.cpp \
auto/lua_cocos2dx_ui_auto.cpp \ auto/lua_cocos2dx_ui_auto.cpp \
auto/lua_cocos2dx_spine_auto.cpp \ auto/lua_cocos2dx_spine_auto.cpp \
auto/lua_cocos2dx_physics_auto.cpp \ auto/lua_cocos2dx_physics_auto.cpp \
auto/lua_cocos2dx_experimental_auto.cpp \
auto/lua_cocos2dx_experimental_video_auto.cpp \ auto/lua_cocos2dx_experimental_video_auto.cpp \
../../../external/lua/tolua/tolua_event.c \ ../../../external/lua/tolua/tolua_event.c \
../../../external/lua/tolua/tolua_is.c \ ../../../external/lua/tolua/tolua_is.c \

View File

@ -5,6 +5,7 @@ set(LUABINDING_SRC
auto/lua_cocos2dx_ui_auto.cpp auto/lua_cocos2dx_ui_auto.cpp
auto/lua_cocos2dx_spine_auto.cpp auto/lua_cocos2dx_spine_auto.cpp
auto/lua_cocos2dx_physics_auto.cpp auto/lua_cocos2dx_physics_auto.cpp
auto/lua_cocos2dx_experimental_auto.cpp
manual/tolua_fix.cpp manual/tolua_fix.cpp
manual/CCLuaBridge.cpp manual/CCLuaBridge.cpp
manual/CCLuaEngine.cpp manual/CCLuaEngine.cpp
@ -24,6 +25,7 @@ set(LUABINDING_SRC
manual/lua_cocos2dx_deprecated.cpp manual/lua_cocos2dx_deprecated.cpp
manual/lua_xml_http_request.cpp manual/lua_xml_http_request.cpp
manual/LuaSkeletonAnimation.cpp manual/LuaSkeletonAnimation.cpp
manual/lua_cocos2dx_experimental_manual.cpp
) )
include_directories( include_directories(

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

@ -6,7 +6,7 @@
-------------------------------- --------------------------------
-- @function [parent=#Application] getTargetPlatform -- @function [parent=#Application] getTargetPlatform
-- @param self -- @param self
-- @return ApplicationProtocol::Platform#ApplicationProtocol::Platform ret (return value: cc.ApplicationProtocol::Platform) -- @return int#int ret (return value: int)
-------------------------------- --------------------------------
-- @function [parent=#Application] getCurrentLanguageCode -- @function [parent=#Application] getCurrentLanguageCode
@ -16,7 +16,7 @@
-------------------------------- --------------------------------
-- @function [parent=#Application] getCurrentLanguage -- @function [parent=#Application] getCurrentLanguage
-- @param self -- @param self
-- @return LanguageType#LanguageType ret (return value: cc.LanguageType) -- @return int#int ret (return value: int)
-------------------------------- --------------------------------
-- @function [parent=#Application] setAnimationInterval -- @function [parent=#Application] setAnimationInterval

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

@ -60,7 +60,7 @@
-------------------------------- --------------------------------
-- @function [parent=#Bone] getDisplayRenderNodeType -- @function [parent=#Bone] getDisplayRenderNodeType
-- @param self -- @param self
-- @return DisplayType#DisplayType ret (return value: ccs.DisplayType) -- @return int#int ret (return value: int)
-------------------------------- --------------------------------
-- @function [parent=#Bone] removeDisplay -- @function [parent=#Bone] removeDisplay
@ -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

@ -43,7 +43,7 @@
-- @function [parent=#Button] loadTextureDisabled -- @function [parent=#Button] loadTextureDisabled
-- @param self -- @param self
-- @param #string str -- @param #string str
-- @param #ccui.Widget::TextureResType texturerestype -- @param #int texturerestype
-------------------------------- --------------------------------
-- @function [parent=#Button] setTitleText -- @function [parent=#Button] setTitleText
@ -59,7 +59,7 @@
-- @function [parent=#Button] loadTexturePressed -- @function [parent=#Button] loadTexturePressed
-- @param self -- @param self
-- @param #string str -- @param #string str
-- @param #ccui.Widget::TextureResType texturerestype -- @param #int texturerestype
-------------------------------- --------------------------------
-- @function [parent=#Button] setTitleFontName -- @function [parent=#Button] setTitleFontName
@ -82,7 +82,7 @@
-- @param #string str -- @param #string str
-- @param #string str -- @param #string str
-- @param #string str -- @param #string str
-- @param #ccui.Widget::TextureResType texturerestype -- @param #int texturerestype
-------------------------------- --------------------------------
-- @function [parent=#Button] isScale9Enabled -- @function [parent=#Button] isScale9Enabled
@ -93,7 +93,7 @@
-- @function [parent=#Button] loadTextureNormal -- @function [parent=#Button] loadTextureNormal
-- @param self -- @param self
-- @param #string str -- @param #string str
-- @param #ccui.Widget::TextureResType texturerestype -- @param #int texturerestype
-------------------------------- --------------------------------
-- @function [parent=#Button] setCapInsetsPressedRenderer -- @function [parent=#Button] setCapInsetsPressedRenderer
@ -121,16 +121,14 @@
-- @param #bool bool -- @param #bool bool
-------------------------------- --------------------------------
-- overload function: create(string, string, string, ccui.Widget::TextureResType) -- @overload self, string, string, string, int
-- -- @overload self
-- overload function: create()
--
-- @function [parent=#Button] create -- @function [parent=#Button] create
-- @param self -- @param self
-- @param #string str -- @param #string str
-- @param #string str -- @param #string str
-- @param #string str -- @param #string str
-- @param #ccui.Widget::TextureResType texturerestype -- @param #int texturerestype
-- @return Button#Button ret (retunr value: ccui.Button) -- @return Button#Button ret (retunr value: ccui.Button)
-------------------------------- --------------------------------

View File

@ -101,7 +101,7 @@
-------------------------------- --------------------------------
-- @function [parent=#CCBAnimationManager] addDocumentCallbackControlEvents -- @function [parent=#CCBAnimationManager] addDocumentCallbackControlEvents
-- @param self -- @param self
-- @param #cc.Control::EventType eventtype -- @param #int eventtype
-------------------------------- --------------------------------
-- @function [parent=#CCBAnimationManager] init -- @function [parent=#CCBAnimationManager] init

View File

@ -17,7 +17,7 @@
-------------------------------- --------------------------------
-- @function [parent=#CCBReader] addDocumentCallbackControlEvents -- @function [parent=#CCBReader] addDocumentCallbackControlEvents
-- @param self -- @param self
-- @param #cc.Control::EventType eventtype -- @param #int eventtype
-------------------------------- --------------------------------
-- @function [parent=#CCBReader] setCCBRootPath -- @function [parent=#CCBReader] setCCBRootPath
@ -63,7 +63,7 @@
-------------------------------- --------------------------------
-- @function [parent=#CCBReader] addOwnerCallbackControlEvents -- @function [parent=#CCBReader] addOwnerCallbackControlEvents
-- @param self -- @param self
-- @param #cc.Control::EventType eventtype -- @param #int eventtype
-------------------------------- --------------------------------
-- @function [parent=#CCBReader] getOwnerOutletNames -- @function [parent=#CCBReader] getOwnerOutletNames
@ -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

@ -13,13 +13,13 @@
-- @function [parent=#CheckBox] loadTextureBackGroundSelected -- @function [parent=#CheckBox] loadTextureBackGroundSelected
-- @param self -- @param self
-- @param #string str -- @param #string str
-- @param #ccui.Widget::TextureResType texturerestype -- @param #int texturerestype
-------------------------------- --------------------------------
-- @function [parent=#CheckBox] loadTextureBackGroundDisabled -- @function [parent=#CheckBox] loadTextureBackGroundDisabled
-- @param self -- @param self
-- @param #string str -- @param #string str
-- @param #ccui.Widget::TextureResType texturerestype -- @param #int texturerestype
-------------------------------- --------------------------------
-- @function [parent=#CheckBox] addEventListener -- @function [parent=#CheckBox] addEventListener
@ -30,7 +30,7 @@
-- @function [parent=#CheckBox] loadTextureFrontCross -- @function [parent=#CheckBox] loadTextureFrontCross
-- @param self -- @param self
-- @param #string str -- @param #string str
-- @param #ccui.Widget::TextureResType texturerestype -- @param #int texturerestype
-------------------------------- --------------------------------
-- @function [parent=#CheckBox] loadTextures -- @function [parent=#CheckBox] loadTextures
@ -40,13 +40,13 @@
-- @param #string str -- @param #string str
-- @param #string str -- @param #string str
-- @param #string str -- @param #string str
-- @param #ccui.Widget::TextureResType texturerestype -- @param #int texturerestype
-------------------------------- --------------------------------
-- @function [parent=#CheckBox] loadTextureBackGround -- @function [parent=#CheckBox] loadTextureBackGround
-- @param self -- @param self
-- @param #string str -- @param #string str
-- @param #ccui.Widget::TextureResType texturerestype -- @param #int texturerestype
-------------------------------- --------------------------------
-- @function [parent=#CheckBox] setSelectedState -- @function [parent=#CheckBox] setSelectedState
@ -57,13 +57,11 @@
-- @function [parent=#CheckBox] loadTextureFrontCrossDisabled -- @function [parent=#CheckBox] loadTextureFrontCrossDisabled
-- @param self -- @param self
-- @param #string str -- @param #string str
-- @param #ccui.Widget::TextureResType texturerestype -- @param #int texturerestype
-------------------------------- --------------------------------
-- overload function: create(string, string, string, string, string, ccui.Widget::TextureResType) -- @overload self, string, string, string, string, string, int
-- -- @overload self
-- overload function: create()
--
-- @function [parent=#CheckBox] create -- @function [parent=#CheckBox] create
-- @param self -- @param self
-- @param #string str -- @param #string str
@ -71,7 +69,7 @@
-- @param #string str -- @param #string str
-- @param #string str -- @param #string str
-- @param #string str -- @param #string str
-- @param #ccui.Widget::TextureResType texturerestype -- @param #int texturerestype
-- @return CheckBox#CheckBox ret (retunr value: ccui.CheckBox) -- @return CheckBox#CheckBox ret (retunr value: ccui.CheckBox)
-------------------------------- --------------------------------

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

@ -18,7 +18,7 @@
-------------------------------- --------------------------------
-- @function [parent=#Control] getState -- @function [parent=#Control] getState
-- @param self -- @param self
-- @return Control::State#Control::State ret (return value: cc.Control::State) -- @return int#int ret (return value: int)
-------------------------------- --------------------------------
-- @function [parent=#Control] onTouchEnded -- @function [parent=#Control] onTouchEnded
@ -29,7 +29,7 @@
-------------------------------- --------------------------------
-- @function [parent=#Control] sendActionsForControlEvents -- @function [parent=#Control] sendActionsForControlEvents
-- @param self -- @param self
-- @param #cc.Control::EventType eventtype -- @param #int eventtype
-------------------------------- --------------------------------
-- @function [parent=#Control] setSelected -- @function [parent=#Control] setSelected

View File

@ -18,7 +18,7 @@
-- @function [parent=#ControlButton] setTitleLabelForState -- @function [parent=#ControlButton] setTitleLabelForState
-- @param self -- @param self
-- @param #cc.Node node -- @param #cc.Node node
-- @param #cc.Control::State state -- @param #int state
-------------------------------- --------------------------------
-- @function [parent=#ControlButton] setAdjustBackgroundImage -- @function [parent=#ControlButton] setAdjustBackgroundImage
@ -39,7 +39,7 @@
-- @function [parent=#ControlButton] setTitleForState -- @function [parent=#ControlButton] setTitleForState
-- @param self -- @param self
-- @param #string str -- @param #string str
-- @param #cc.Control::State state -- @param #int state
-------------------------------- --------------------------------
-- @function [parent=#ControlButton] setLabelAnchorPoint -- @function [parent=#ControlButton] setLabelAnchorPoint
@ -54,20 +54,20 @@
-------------------------------- --------------------------------
-- @function [parent=#ControlButton] getTitleTTFSizeForState -- @function [parent=#ControlButton] getTitleTTFSizeForState
-- @param self -- @param self
-- @param #cc.Control::State state -- @param #int state
-- @return float#float ret (return value: float) -- @return float#float ret (return value: float)
-------------------------------- --------------------------------
-- @function [parent=#ControlButton] setTitleTTFForState -- @function [parent=#ControlButton] setTitleTTFForState
-- @param self -- @param self
-- @param #string str -- @param #string str
-- @param #cc.Control::State state -- @param #int state
-------------------------------- --------------------------------
-- @function [parent=#ControlButton] setTitleTTFSizeForState -- @function [parent=#ControlButton] setTitleTTFSizeForState
-- @param self -- @param self
-- @param #float float -- @param #float float
-- @param #cc.Control::State state -- @param #int state
-------------------------------- --------------------------------
-- @function [parent=#ControlButton] setTitleLabel -- @function [parent=#ControlButton] setTitleLabel
@ -92,7 +92,7 @@
-------------------------------- --------------------------------
-- @function [parent=#ControlButton] getBackgroundSpriteForState -- @function [parent=#ControlButton] getBackgroundSpriteForState
-- @param self -- @param self
-- @param #cc.Control::State state -- @param #int state
-- @return Scale9Sprite#Scale9Sprite ret (return value: cc.Scale9Sprite) -- @return Scale9Sprite#Scale9Sprite ret (return value: cc.Scale9Sprite)
-------------------------------- --------------------------------
@ -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)
@ -121,7 +119,7 @@
-------------------------------- --------------------------------
-- @function [parent=#ControlButton] getTitleTTFForState -- @function [parent=#ControlButton] getTitleTTFForState
-- @param self -- @param self
-- @param #cc.Control::State state -- @param #int state
-- @return string#string ret (return value: string) -- @return string#string ret (return value: string)
-------------------------------- --------------------------------
@ -132,14 +130,14 @@
-------------------------------- --------------------------------
-- @function [parent=#ControlButton] getTitleColorForState -- @function [parent=#ControlButton] getTitleColorForState
-- @param self -- @param self
-- @param #cc.Control::State state -- @param #int state
-- @return color3b_table#color3b_table ret (return value: color3b_table) -- @return color3b_table#color3b_table ret (return value: color3b_table)
-------------------------------- --------------------------------
-- @function [parent=#ControlButton] setTitleColorForState -- @function [parent=#ControlButton] setTitleColorForState
-- @param self -- @param self
-- @param #color3b_table color3b -- @param #color3b_table color3b
-- @param #cc.Control::State state -- @param #int state
-------------------------------- --------------------------------
-- @function [parent=#ControlButton] doesAdjustBackgroundImage -- @function [parent=#ControlButton] doesAdjustBackgroundImage
@ -150,13 +148,13 @@
-- @function [parent=#ControlButton] setBackgroundSpriteFrameForState -- @function [parent=#ControlButton] setBackgroundSpriteFrameForState
-- @param self -- @param self
-- @param #cc.SpriteFrame spriteframe -- @param #cc.SpriteFrame spriteframe
-- @param #cc.Control::State state -- @param #int state
-------------------------------- --------------------------------
-- @function [parent=#ControlButton] setBackgroundSpriteForState -- @function [parent=#ControlButton] setBackgroundSpriteForState
-- @param self -- @param self
-- @param #cc.Scale9Sprite scale9sprite -- @param #cc.Scale9Sprite scale9sprite
-- @param #cc.Control::State state -- @param #int state
-------------------------------- --------------------------------
-- @function [parent=#ControlButton] setScaleRatio -- @function [parent=#ControlButton] setScaleRatio
@ -186,7 +184,7 @@
-------------------------------- --------------------------------
-- @function [parent=#ControlButton] getTitleLabelForState -- @function [parent=#ControlButton] getTitleLabelForState
-- @param self -- @param self
-- @param #cc.Control::State state -- @param #int state
-- @return Node#Node ret (return value: cc.Node) -- @return Node#Node ret (return value: cc.Node)
-------------------------------- --------------------------------
@ -199,12 +197,12 @@
-- @function [parent=#ControlButton] setTitleBMFontForState -- @function [parent=#ControlButton] setTitleBMFontForState
-- @param self -- @param self
-- @param #string str -- @param #string str
-- @param #cc.Control::State state -- @param #int state
-------------------------------- --------------------------------
-- @function [parent=#ControlButton] getTitleBMFontForState -- @function [parent=#ControlButton] getTitleBMFontForState
-- @param self -- @param self
-- @param #cc.Control::State state -- @param #int state
-- @return string#string ret (return value: string) -- @return string#string ret (return value: string)
-------------------------------- --------------------------------
@ -215,18 +213,14 @@
-------------------------------- --------------------------------
-- @function [parent=#ControlButton] getTitleForState -- @function [parent=#ControlButton] getTitleForState
-- @param self -- @param self
-- @param #cc.Control::State state -- @param #int state
-- @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

@ -23,7 +23,7 @@
-- @function [parent=#ControlColourPicker] hueSliderValueChanged -- @function [parent=#ControlColourPicker] hueSliderValueChanged
-- @param self -- @param self
-- @param #cc.Ref ref -- @param #cc.Ref ref
-- @param #cc.Control::EventType eventtype -- @param #int eventtype
-------------------------------- --------------------------------
-- @function [parent=#ControlColourPicker] getcolourPicker -- @function [parent=#ControlColourPicker] getcolourPicker
@ -49,7 +49,7 @@
-- @function [parent=#ControlColourPicker] colourSliderValueChanged -- @function [parent=#ControlColourPicker] colourSliderValueChanged
-- @param self -- @param self
-- @param #cc.Ref ref -- @param #cc.Ref ref
-- @param #cc.Control::EventType eventtype -- @param #int eventtype
-------------------------------- --------------------------------
-- @function [parent=#ControlColourPicker] setHuePicker -- @function [parent=#ControlColourPicker] setHuePicker

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

@ -40,7 +40,7 @@
-------------------------------- --------------------------------
-- @function [parent=#Director] pushMatrix -- @function [parent=#Director] pushMatrix
-- @param self -- @param self
-- @param #cc.MATRIX_STACK_TYPE matrix_stack_type -- @param #int matrix_stack_type
-------------------------------- --------------------------------
-- @function [parent=#Director] setGLDefaultValues -- @function [parent=#Director] setGLDefaultValues
@ -63,7 +63,7 @@
-------------------------------- --------------------------------
-- @function [parent=#Director] loadMatrix -- @function [parent=#Director] loadMatrix
-- @param self -- @param self
-- @param #cc.MATRIX_STACK_TYPE matrix_stack_type -- @param #int matrix_stack_type
-- @param #mat4_table mat4 -- @param #mat4_table mat4
-------------------------------- --------------------------------
@ -217,7 +217,7 @@
-------------------------------- --------------------------------
-- @function [parent=#Director] getMatrix -- @function [parent=#Director] getMatrix
-- @param self -- @param self
-- @param #cc.MATRIX_STACK_TYPE matrix_stack_type -- @param #int matrix_stack_type
-- @return mat4_table#mat4_table ret (return value: mat4_table) -- @return mat4_table#mat4_table ret (return value: mat4_table)
-------------------------------- --------------------------------
@ -232,12 +232,12 @@
-------------------------------- --------------------------------
-- @function [parent=#Director] setProjection -- @function [parent=#Director] setProjection
-- @param self -- @param self
-- @param #cc.Director::Projection projection -- @param #int projection
-------------------------------- --------------------------------
-- @function [parent=#Director] loadIdentityMatrix -- @function [parent=#Director] loadIdentityMatrix
-- @param self -- @param self
-- @param #cc.MATRIX_STACK_TYPE matrix_stack_type -- @param #int matrix_stack_type
-------------------------------- --------------------------------
-- @function [parent=#Director] setNextDeltaTimeZero -- @function [parent=#Director] setNextDeltaTimeZero
@ -251,7 +251,7 @@
-------------------------------- --------------------------------
-- @function [parent=#Director] popMatrix -- @function [parent=#Director] popMatrix
-- @param self -- @param self
-- @param #cc.MATRIX_STACK_TYPE matrix_stack_type -- @param #int matrix_stack_type
-------------------------------- --------------------------------
-- @function [parent=#Director] getVisibleSize -- @function [parent=#Director] getVisibleSize
@ -296,7 +296,7 @@
-------------------------------- --------------------------------
-- @function [parent=#Director] multiplyMatrix -- @function [parent=#Director] multiplyMatrix
-- @param self -- @param self
-- @param #cc.MATRIX_STACK_TYPE matrix_stack_type -- @param #int matrix_stack_type
-- @param #mat4_table mat4 -- @param #mat4_table mat4
-------------------------------- --------------------------------

View File

@ -17,7 +17,7 @@
-------------------------------- --------------------------------
-- @function [parent=#DisplayManager] getDisplayRenderNodeType -- @function [parent=#DisplayManager] getDisplayRenderNodeType
-- @param self -- @param self
-- @return DisplayType#DisplayType ret (return value: ccs.DisplayType) -- @return int#int ret (return value: int)
-------------------------------- --------------------------------
-- @function [parent=#DisplayManager] removeDisplay -- @function [parent=#DisplayManager] removeDisplay
@ -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

@ -32,7 +32,7 @@
-------------------------------- --------------------------------
-- @function [parent=#EditBox] setInputMode -- @function [parent=#EditBox] setInputMode
-- @param self -- @param self
-- @param #cc.EditBox::InputMode inputmode -- @param #int inputmode
-------------------------------- --------------------------------
-- @function [parent=#EditBox] setPlaceholderFontColor -- @function [parent=#EditBox] setPlaceholderFontColor
@ -70,12 +70,12 @@
-------------------------------- --------------------------------
-- @function [parent=#EditBox] setReturnType -- @function [parent=#EditBox] setReturnType
-- @param self -- @param self
-- @param #cc.EditBox::KeyboardReturnType keyboardreturntype -- @param #int keyboardreturntype
-------------------------------- --------------------------------
-- @function [parent=#EditBox] setInputFlag -- @function [parent=#EditBox] setInputFlag
-- @param self -- @param self
-- @param #cc.EditBox::InputFlag inputflag -- @param #int inputflag
-------------------------------- --------------------------------
-- @function [parent=#EditBox] getMaxLength -- @function [parent=#EditBox] getMaxLength

View File

@ -12,7 +12,7 @@
-------------------------------- --------------------------------
-- @function [parent=#Event] getType -- @function [parent=#Event] getType
-- @param self -- @param self
-- @return Event::Type#Event::Type ret (return value: cc.Event::Type) -- @return int#int ret (return value: int)
-------------------------------- --------------------------------
-- @function [parent=#Event] getCurrentTarget -- @function [parent=#Event] getCurrentTarget

View File

@ -7,7 +7,7 @@
-------------------------------- --------------------------------
-- @function [parent=#EventController] getControllerEventType -- @function [parent=#EventController] getControllerEventType
-- @param self -- @param self
-- @return EventController::ControllerEventType#EventController::ControllerEventType ret (return value: cc.EventController::ControllerEventType) -- @return int#int ret (return value: int)
-------------------------------- --------------------------------
-- @function [parent=#EventController] setConnectStatus -- @function [parent=#EventController] setConnectStatus
@ -35,13 +35,11 @@
-- @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, int, cc.Controller, bool
-- -- @overload self, int, 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 #int controllereventtype
-- @param #cc.Controller controller -- @param #cc.Controller controller
-- @param #int int -- @param #int int

View File

@ -79,7 +79,7 @@
-------------------------------- --------------------------------
-- @function [parent=#EventDispatcher] removeEventListenersForType -- @function [parent=#EventDispatcher] removeEventListenersForType
-- @param self -- @param self
-- @param #cc.EventListener::Type type -- @param #int type
-------------------------------- --------------------------------
-- @function [parent=#EventDispatcher] EventDispatcher -- @function [parent=#EventDispatcher] EventDispatcher

View File

@ -7,7 +7,7 @@
-------------------------------- --------------------------------
-- @function [parent=#EventKeyboard] EventKeyboard -- @function [parent=#EventKeyboard] EventKeyboard
-- @param self -- @param self
-- @param #cc.EventKeyboard::KeyCode keycode -- @param #int keycode
-- @param #bool bool -- @param #bool bool
return nil return nil

View File

@ -49,6 +49,6 @@
-------------------------------- --------------------------------
-- @function [parent=#EventMouse] EventMouse -- @function [parent=#EventMouse] EventMouse
-- @param self -- @param self
-- @param #cc.EventMouse::MouseEventType mouseeventtype -- @param #int mouseeventtype
return nil return nil

View File

@ -7,12 +7,12 @@
-------------------------------- --------------------------------
-- @function [parent=#EventTouch] getEventCode -- @function [parent=#EventTouch] getEventCode
-- @param self -- @param self
-- @return EventTouch::EventCode#EventTouch::EventCode ret (return value: cc.EventTouch::EventCode) -- @return int#int ret (return value: int)
-------------------------------- --------------------------------
-- @function [parent=#EventTouch] setEventCode -- @function [parent=#EventTouch] setEventCode
-- @param self -- @param self
-- @param #cc.EventTouch::EventCode eventcode -- @param #int eventcode
-------------------------------- --------------------------------
-- @function [parent=#EventTouch] EventTouch -- @function [parent=#EventTouch] EventTouch

View File

@ -1,146 +0,0 @@
--------------------------------
-- @module FastTMXLayer
-- @extend Node
-- @parent_module cc
--------------------------------
-- @function [parent=#FastTMXLayer] getPositionAt
-- @param self
-- @param #vec2_table vec2
-- @return vec2_table#vec2_table ret (return value: vec2_table)
--------------------------------
-- @function [parent=#FastTMXLayer] setLayerOrientation
-- @param self
-- @param #int int
--------------------------------
-- @function [parent=#FastTMXLayer] getLayerSize
-- @param self
-- @return size_table#size_table ret (return value: size_table)
--------------------------------
-- @function [parent=#FastTMXLayer] setMapTileSize
-- @param self
-- @param #size_table size
--------------------------------
-- @function [parent=#FastTMXLayer] getLayerOrientation
-- @param self
-- @return int#int ret (return value: int)
--------------------------------
-- @function [parent=#FastTMXLayer] setProperties
-- @param self
-- @param #map_table map
--------------------------------
-- @function [parent=#FastTMXLayer] setLayerName
-- @param self
-- @param #string str
--------------------------------
-- @function [parent=#FastTMXLayer] removeTileAt
-- @param self
-- @param #vec2_table vec2
--------------------------------
-- overload function: getProperties()
--
-- overload function: getProperties()
--
-- @function [parent=#FastTMXLayer] getProperties
-- @param self
-- @return map_table#map_table ret (retunr value: map_table)
--------------------------------
-- @function [parent=#FastTMXLayer] setupTiles
-- @param self
--------------------------------
-- @function [parent=#FastTMXLayer] setupTileSprite
-- @param self
-- @param #cc.Sprite sprite
-- @param #vec2_table vec2
-- @param #int int
--------------------------------
-- overload function: setTileGID(int, vec2_table, cc.TMXTileFlags_)
--
-- overload function: setTileGID(int, vec2_table)
--
-- @function [parent=#FastTMXLayer] setTileGID
-- @param self
-- @param #int int
-- @param #vec2_table vec2
-- @param #cc.TMXTileFlags_ tmxtileflags_
--------------------------------
-- @function [parent=#FastTMXLayer] getMapTileSize
-- @param self
-- @return size_table#size_table ret (return value: size_table)
--------------------------------
-- @function [parent=#FastTMXLayer] getProperty
-- @param self
-- @param #string str
-- @return Value#Value ret (return value: cc.Value)
--------------------------------
-- @function [parent=#FastTMXLayer] setLayerSize
-- @param self
-- @param #size_table size
--------------------------------
-- @function [parent=#FastTMXLayer] getLayerName
-- @param self
-- @return string#string ret (return value: string)
--------------------------------
-- @function [parent=#FastTMXLayer] setTileSet
-- @param self
-- @param #cc.TMXTilesetInfo tmxtilesetinfo
--------------------------------
-- @function [parent=#FastTMXLayer] getTileSet
-- @param self
-- @return TMXTilesetInfo#TMXTilesetInfo ret (return value: cc.TMXTilesetInfo)
--------------------------------
-- @function [parent=#FastTMXLayer] getTileAt
-- @param self
-- @param #vec2_table vec2
-- @return Sprite#Sprite ret (return value: cc.Sprite)
--------------------------------
-- @function [parent=#FastTMXLayer] create
-- @param self
-- @param #cc.TMXTilesetInfo tmxtilesetinfo
-- @param #cc.TMXLayerInfo tmxlayerinfo
-- @param #cc.TMXMapInfo map
-- @return FastTMXLayer#FastTMXLayer ret (return value: cc.FastTMXLayer)
--------------------------------
-- @function [parent=#FastTMXLayer] removeChild
-- @param self
-- @param #cc.Node node
-- @param #bool bool
--------------------------------
-- @function [parent=#FastTMXLayer] draw
-- @param self
-- @param #cc.Renderer renderer
-- @param #mat4_table mat4
-- @param #unsigned int int
--------------------------------
-- @function [parent=#FastTMXLayer] getDescription
-- @param self
-- @return string#string ret (return value: string)
--------------------------------
-- @function [parent=#FastTMXLayer] FastTMXLayer
-- @param self
return nil

View File

@ -1,103 +0,0 @@
--------------------------------
-- @module FastTMXTiledMap
-- @extend Node
-- @parent_module cc
--------------------------------
-- @function [parent=#FastTMXTiledMap] setObjectGroups
-- @param self
-- @param #array_table array
--------------------------------
-- @function [parent=#FastTMXTiledMap] getProperty
-- @param self
-- @param #string str
-- @return Value#Value ret (return value: cc.Value)
--------------------------------
-- @function [parent=#FastTMXTiledMap] setMapSize
-- @param self
-- @param #size_table size
--------------------------------
-- @function [parent=#FastTMXTiledMap] getObjectGroup
-- @param self
-- @param #string str
-- @return TMXObjectGroup#TMXObjectGroup ret (return value: cc.TMXObjectGroup)
--------------------------------
-- overload function: getObjectGroups()
--
-- overload function: getObjectGroups()
--
-- @function [parent=#FastTMXTiledMap] getObjectGroups
-- @param self
-- @return array_table#array_table ret (retunr value: array_table)
--------------------------------
-- @function [parent=#FastTMXTiledMap] getTileSize
-- @param self
-- @return size_table#size_table ret (return value: size_table)
--------------------------------
-- @function [parent=#FastTMXTiledMap] getMapSize
-- @param self
-- @return size_table#size_table ret (return value: size_table)
--------------------------------
-- @function [parent=#FastTMXTiledMap] getProperties
-- @param self
-- @return map_table#map_table ret (return value: map_table)
--------------------------------
-- @function [parent=#FastTMXTiledMap] getPropertiesForGID
-- @param self
-- @param #int int
-- @return Value#Value ret (return value: cc.Value)
--------------------------------
-- @function [parent=#FastTMXTiledMap] setTileSize
-- @param self
-- @param #size_table size
--------------------------------
-- @function [parent=#FastTMXTiledMap] setProperties
-- @param self
-- @param #map_table map
--------------------------------
-- @function [parent=#FastTMXTiledMap] getLayer
-- @param self
-- @param #string str
-- @return FastTMXLayer#FastTMXLayer ret (return value: cc.FastTMXLayer)
--------------------------------
-- @function [parent=#FastTMXTiledMap] getMapOrientation
-- @param self
-- @return int#int ret (return value: int)
--------------------------------
-- @function [parent=#FastTMXTiledMap] setMapOrientation
-- @param self
-- @param #int int
--------------------------------
-- @function [parent=#FastTMXTiledMap] create
-- @param self
-- @param #string str
-- @return FastTMXTiledMap#FastTMXTiledMap ret (return value: cc.FastTMXTiledMap)
--------------------------------
-- @function [parent=#FastTMXTiledMap] createWithXML
-- @param self
-- @param #string str
-- @param #string str
-- @return FastTMXTiledMap#FastTMXTiledMap ret (return value: cc.FastTMXTiledMap)
--------------------------------
-- @function [parent=#FastTMXTiledMap] getDescription
-- @param self
-- @return string#string ret (return value: string)
return nil

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

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