From d9ab38fd4206fd3f18e8735bf36e8c5b87f39680 Mon Sep 17 00:00:00 2001 From: u0u0 Date: Thu, 26 Dec 2019 15:54:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A3=81=E5=88=87=20FastTMXTiledMap=E3=80=81Ti?= =?UTF-8?q?leMapAtlas=E3=80=81purge()=E7=AD=89=E6=8E=A5=E5=8F=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cocos/2d/CCFastTMXLayer.cpp | 914 ------- cocos/2d/CCFastTMXLayer.h | 361 --- cocos/2d/CCFastTMXTiledMap.cpp | 260 -- cocos/2d/CCFastTMXTiledMap.h | 248 -- cocos/2d/CCTileMapAtlas.cpp | 259 -- cocos/2d/CCTileMapAtlas.h | 122 - cocos/2d/CMakeLists.txt | 6 - cocos/3d/Android.mk | 36 - cocos/cocos2d.h | 3 - .../cocostudio/ActionTimeline/CCFrame.h | 4 - .../cocostudio/ActionTimeline/CSLoader.cpp | 4 - .../cocostudio/ActionTimeline/CSLoader.h | 2 - .../editor-support/cocostudio/CCArmature.cpp | 46 - cocos/editor-support/cocostudio/CCArmature.h | 31 - .../cocostudio/CCArmatureAnimation.cpp | 29 +- .../cocostudio/CCArmatureAnimation.h | 29 - .../cocostudio/CCArmatureDataManager.h | 8 +- cocos/editor-support/cocostudio/CCBone.cpp | 10 - cocos/editor-support/cocostudio/CCBone.h | 10 - .../cocostudio/CCDataReaderHelper.h | 4 - .../cocostudio/CCDisplayManager.h | 6 - .../cocostudio/CCInputDelegate.cpp | 29 - .../cocostudio/CCInputDelegate.h | 38 - .../editor-support/cocostudio/CCSGUIReader.h | 2 - .../cocostudio/CCSpriteFrameCacheHelper.h | 3 - .../cocostudio/FlatBuffersSerialize.cpp | 7 - .../cocostudio/FlatBuffersSerialize.h | 3 - .../ArmatureNodeReader/ArmatureNodeReader.h | 2 - .../ButtonReader/ButtonReader.cpp | 5 - .../WidgetReader/ButtonReader/ButtonReader.h | 2 - .../CheckBoxReader/CheckBoxReader.h | 2 - .../ComAudioReader/ComAudioReader.cpp | 5 - .../ComAudioReader/ComAudioReader.h | 2 - .../GameMapReader/GameMapReader.h | 2 - .../GameNode3DReader/GameNode3DReader.cpp | 5 - .../GameNode3DReader/GameNode3DReader.h | 2 - .../ImageViewReader/ImageViewReader.h | 2 - .../WidgetReader/LayoutReader/LayoutReader.h | 2 - .../Light3DReader/Light3DReader.cpp | 5 - .../Light3DReader/Light3DReader.h | 2 - .../ListViewReader/ListViewReader.h | 2 - .../LoadingBarReader/LoadingBarReader.h | 2 - .../Node3DReader/Node3DReader.cpp | 5 - .../WidgetReader/Node3DReader/Node3DReader.h | 2 - .../WidgetReader/NodeReader/NodeReader.h | 2 - .../PageViewReader/PageViewReader.h | 2 - .../Particle3DReader/Particle3DReader.cpp | 5 - .../Particle3DReader/Particle3DReader.h | 2 - .../ParticleReader/ParticleReader.cpp | 5 - .../ParticleReader/ParticleReader.h | 2 - .../ProjectNodeReader/ProjectNodeReader.cpp | 5 - .../ProjectNodeReader/ProjectNodeReader.h | 2 - .../ScrollViewReader/ScrollViewReader.h | 2 - .../SingleNodeReader/SingleNodeReader.cpp | 5 - .../SingleNodeReader/SingleNodeReader.h | 2 - .../SkeletonReader/BoneNodeReader.h | 2 - .../SkeletonReader/SkeletonNodeReader.h | 4 +- .../WidgetReader/SliderReader/SliderReader.h | 2 - .../Sprite3DReader/Sprite3DReader.cpp | 5 - .../Sprite3DReader/Sprite3DReader.h | 2 - .../SpriteReader/SpriteReader.cpp | 5 - .../WidgetReader/SpriteReader/SpriteReader.h | 2 - .../TextAtlasReader/TextAtlasReader.h | 2 - .../TextBMFontReader/TextBMFontReader.h | 2 - .../TextFieldReader/TextFieldReader.h | 2 - .../WidgetReader/TextReader/TextReader.h | 2 - .../UserCameraReader/UserCameraReader.cpp | 5 - .../UserCameraReader/UserCameraReader.h | 2 - .../cocostudio/WidgetReader/WidgetReader.cpp | 5 - .../cocostudio/WidgetReader/WidgetReader.h | 2 - cocos/editor-support/spine/Android.mk | 67 - cocos/scripting/lua-bindings/CMakeLists.txt | 2 - .../lua-bindings/auto/lua_cocos2dx_auto.cpp | 2179 ----------------- .../lua-bindings/manual/CCLuaEngine.h | 6 - .../lua-bindings/manual/LuaBasicConversions.h | 15 - .../manual/cocos2d/lua_cocos2dx_manual.cpp | 81 - .../lua_cocos2dx_coco_studio_manual.cpp | 4 +- .../lua_cocos2dx_extension_manual.cpp | 1 - .../script/cocos2d/DeprecatedCocos2dClass.lua | 1767 ------------- .../script/cocos2d/DeprecatedCocos2dEnum.lua | 76 - .../script/cocos2d/DeprecatedCocos2dFunc.lua | 1003 -------- .../script/cocos2d/DrawPrimitives.lua | 384 --- .../lua-bindings/script/cocos2d/bitExtend.lua | 96 - .../script/cocos2d/deprecated.lua | 15 - .../script/cocosdenshion/AudioEngine.lua | 111 - .../cocostudio/DeprecatedCocoStudioClass.lua | 307 --- .../cocostudio/DeprecatedCocoStudioFunc.lua | 81 - .../extension/DeprecatedExtensionClass.lua | 134 - .../extension/DeprecatedExtensionEnum.lua | 26 - .../extension/DeprecatedExtensionFunc.lua | 32 - .../script/extension/ExtensionConstants.lua | 70 - cocos/scripting/lua-bindings/script/init.lua | 38 +- .../script/network/DeprecatedNetworkClass.lua | 19 - .../script/network/DeprecatedNetworkEnum.lua | 13 - .../script/network/DeprecatedNetworkFunc.lua | 27 - .../script/ui/DeprecatedUIEnum.lua | 96 - .../script/ui/DeprecatedUIFunc.lua | 245 -- extensions/CMakeLists.txt | 6 - extensions/ExtensionExport.h | 57 - extensions/ExtensionMacros.h | 35 - extensions/cocos-ext.h | 6 - .../physics-nodes/CCPhysicsDebugNode.cpp | 232 -- extensions/physics-nodes/CCPhysicsDebugNode.h | 74 - extensions/physics-nodes/CCPhysicsSprite.cpp | 455 ---- extensions/physics-nodes/CCPhysicsSprite.h | 154 -- external/Box2D/prebuilt/android/Android.mk | 10 - external/android-specific/pvmp3dec/Android.mk | 64 - external/android-specific/tremolo/Android.mk | 47 - external/bullet/prebuilt/android/Android.mk | 52 - external/chipmunk/prebuilt/android/Android.mk | 8 - external/curl/prebuilt/android/Android.mk | 10 - external/flatbuffers/Android.mk | 26 - .../freetype2/prebuilt/android/Android.mk | 9 - external/jpeg/prebuilt/android/Android.mk | 8 - .../lua/luajit/prebuilt/android/Android.mk | 8 - external/openssl/prebuilt/android/Android.mk | 15 - external/png/prebuilt/android/Android.mk | 8 - external/recast/Android.mk | 34 - external/uv/prebuilt/android/Android.mk | 8 - external/webp/prebuilt/android/Android.mk | 17 - .../websockets/prebuilt/android/Android.mk | 15 - external/zlib/prebuilt/android/Android.mk | 8 - templates/lua-template-default/src/config.lua | 3 - 123 files changed, 6 insertions(+), 10859 deletions(-) delete mode 100644 cocos/2d/CCFastTMXLayer.cpp delete mode 100644 cocos/2d/CCFastTMXLayer.h delete mode 100644 cocos/2d/CCFastTMXTiledMap.cpp delete mode 100644 cocos/2d/CCFastTMXTiledMap.h delete mode 100644 cocos/2d/CCTileMapAtlas.cpp delete mode 100644 cocos/2d/CCTileMapAtlas.h delete mode 100644 cocos/3d/Android.mk delete mode 100644 cocos/editor-support/spine/Android.mk delete mode 100644 cocos/scripting/lua-bindings/script/cocos2d/DeprecatedCocos2dClass.lua delete mode 100644 cocos/scripting/lua-bindings/script/cocos2d/DeprecatedCocos2dEnum.lua delete mode 100644 cocos/scripting/lua-bindings/script/cocos2d/DeprecatedCocos2dFunc.lua delete mode 100644 cocos/scripting/lua-bindings/script/cocos2d/DrawPrimitives.lua delete mode 100644 cocos/scripting/lua-bindings/script/cocos2d/bitExtend.lua delete mode 100644 cocos/scripting/lua-bindings/script/cocos2d/deprecated.lua delete mode 100644 cocos/scripting/lua-bindings/script/cocosdenshion/AudioEngine.lua delete mode 100644 cocos/scripting/lua-bindings/script/cocostudio/DeprecatedCocoStudioClass.lua delete mode 100644 cocos/scripting/lua-bindings/script/cocostudio/DeprecatedCocoStudioFunc.lua delete mode 100644 cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionClass.lua delete mode 100644 cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionEnum.lua delete mode 100644 cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionFunc.lua delete mode 100644 cocos/scripting/lua-bindings/script/extension/ExtensionConstants.lua delete mode 100644 cocos/scripting/lua-bindings/script/network/DeprecatedNetworkClass.lua delete mode 100644 cocos/scripting/lua-bindings/script/network/DeprecatedNetworkEnum.lua delete mode 100644 cocos/scripting/lua-bindings/script/network/DeprecatedNetworkFunc.lua delete mode 100644 cocos/scripting/lua-bindings/script/ui/DeprecatedUIEnum.lua delete mode 100644 cocos/scripting/lua-bindings/script/ui/DeprecatedUIFunc.lua delete mode 100644 extensions/ExtensionExport.h delete mode 100644 extensions/ExtensionMacros.h delete mode 100644 extensions/physics-nodes/CCPhysicsDebugNode.cpp delete mode 100644 extensions/physics-nodes/CCPhysicsDebugNode.h delete mode 100644 extensions/physics-nodes/CCPhysicsSprite.cpp delete mode 100644 extensions/physics-nodes/CCPhysicsSprite.h delete mode 100755 external/Box2D/prebuilt/android/Android.mk delete mode 100644 external/android-specific/pvmp3dec/Android.mk delete mode 100644 external/android-specific/tremolo/Android.mk delete mode 100755 external/bullet/prebuilt/android/Android.mk delete mode 100755 external/chipmunk/prebuilt/android/Android.mk delete mode 100644 external/curl/prebuilt/android/Android.mk delete mode 100644 external/flatbuffers/Android.mk delete mode 100755 external/freetype2/prebuilt/android/Android.mk delete mode 100755 external/jpeg/prebuilt/android/Android.mk delete mode 100755 external/lua/luajit/prebuilt/android/Android.mk delete mode 100644 external/openssl/prebuilt/android/Android.mk delete mode 100755 external/png/prebuilt/android/Android.mk delete mode 100644 external/recast/Android.mk delete mode 100644 external/uv/prebuilt/android/Android.mk delete mode 100755 external/webp/prebuilt/android/Android.mk delete mode 100755 external/websockets/prebuilt/android/Android.mk delete mode 100755 external/zlib/prebuilt/android/Android.mk diff --git a/cocos/2d/CCFastTMXLayer.cpp b/cocos/2d/CCFastTMXLayer.cpp deleted file mode 100644 index 5a38a1a..0000000 --- a/cocos/2d/CCFastTMXLayer.cpp +++ /dev/null @@ -1,914 +0,0 @@ -/**************************************************************************** -Copyright (c) 2008-2010 Ricardo Quesada -Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2011 Zynga Inc. -Copyright (c) 2013-2016 Chukong Technologies Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -Copyright (c) 2011 HKASoftware - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ - -/* - Original rewrite of TMXLayer was based on HKTMXTiledMap by HKASoftware http://hkasoftware.com - Further info: http://www.cocos2d-iphone.org/forums/topic/hktmxtiledmap/ - - It was rewritten again, and only a small part of the original HK ideas/code remains in this implementation - - */ -#include "2d/CCFastTMXLayer.h" -#include // offsetof -#include "base/ccTypes.h" -#include "2d/CCFastTMXTiledMap.h" -#include "2d/CCSprite.h" -#include "2d/CCCamera.h" -#include "renderer/CCTextureCache.h" -#include "renderer/CCRenderer.h" -#include "renderer/ccShaders.h" -#include "renderer/backend/Device.h" -#include "renderer/backend/Buffer.h" -#include "base/CCDirector.h" -#include "base/ccUTF8.h" -#include "renderer/backend/ProgramState.h" - -NS_CC_BEGIN - -const int FastTMXLayer::FAST_TMX_ORIENTATION_ORTHO = 0; -const int FastTMXLayer::FAST_TMX_ORIENTATION_HEX = 1; -const int FastTMXLayer::FAST_TMX_ORIENTATION_ISO = 2; - -// FastTMXLayer - init & alloc & dealloc -FastTMXLayer * FastTMXLayer::create(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo) -{ - FastTMXLayer *ret = new (std::nothrow) FastTMXLayer(); - if (ret->initWithTilesetInfo(tilesetInfo, layerInfo, mapInfo)) - { - ret->autorelease(); - return ret; - } - CC_SAFE_DELETE(ret); - return nullptr; -} - -bool FastTMXLayer::initWithTilesetInfo(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo) -{ - - if( tilesetInfo ) - { - _texture = Director::getInstance()->getTextureCache()->addImage(tilesetInfo->_sourceImage); - _texture->retain(); - } - - // layerInfo - _layerName = layerInfo->_name; - _layerSize = layerInfo->_layerSize; - _tiles = layerInfo->_tiles; - _quadsDirty = true; - setOpacity( layerInfo->_opacity ); - setProperties(layerInfo->getProperties()); - - // tilesetInfo - _tileSet = tilesetInfo; - CC_SAFE_RETAIN(_tileSet); - - // mapInfo - _mapTileSize = mapInfo->getTileSize(); - _layerOrientation = mapInfo->getOrientation(); - - // offset (after layer orientation is set); - Vec2 offset = this->calculateLayerOffset(layerInfo->_offset); - this->setPosition(CC_POINT_PIXELS_TO_POINTS(offset)); - - this->setContentSize(CC_SIZE_PIXELS_TO_POINTS(Size(_layerSize.width * _mapTileSize.width, _layerSize.height * _mapTileSize.height))); - - this->tileToNodeTransform(); - - _useAutomaticVertexZ = false; - _vertexZvalue = 0; - - return true; -} - -FastTMXLayer::FastTMXLayer() -{ -} - -FastTMXLayer::~FastTMXLayer() -{ - CC_SAFE_RELEASE(_tileSet); - CC_SAFE_RELEASE(_texture); - CC_SAFE_FREE(_tiles); - CC_SAFE_RELEASE(_vertexBuffer); - CC_SAFE_RELEASE(_indexBuffer); - - for (auto& e : _customCommands) - { - CC_SAFE_RELEASE(e.second->getPipelineDescriptor().programState); - delete e.second; - } -} - -void FastTMXLayer::draw(Renderer *renderer, const Mat4& transform, uint32_t flags) -{ - updateTotalQuads(); - - if( flags != 0 || _dirty || _quadsDirty) - { - Size s = Director::getInstance()->getVisibleSize(); - const Vec2 &anchor = getAnchorPoint(); - auto rect = Rect(Camera::getVisitingCamera()->getPositionX() - s.width * (anchor.x == 0.0f ? 0.5f : anchor.x), - Camera::getVisitingCamera()->getPositionY() - s.height * (anchor.y == 0.0f ? 0.5f : anchor.y), - s.width, - s.height); - - - Mat4 inv = transform; - inv.inverse(); - rect = RectApplyTransform(rect, inv); - - updateTiles(rect); - updateIndexBuffer(); - updatePrimitives(); - _dirty = false; - } - - const auto& projectionMat = Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); - Mat4 finalMat = projectionMat * _modelViewTransform; - for (const auto& e : _customCommands) - { - if (e.second->getIndexDrawCount() > 0) - { - auto mvpmatrixLocation = e.second->getPipelineDescriptor().programState->getUniformLocation("u_MVPMatrix"); - e.second->getPipelineDescriptor().programState->setUniform(mvpmatrixLocation, finalMat.m, sizeof(finalMat.m)); - renderer->addCommand(e.second); - } - } -} - -void FastTMXLayer::updateTiles(const Rect& culledRect) -{ - Rect visibleTiles = Rect(culledRect.origin, culledRect.size * Director::getInstance()->getContentScaleFactor()); - Size mapTileSize = CC_SIZE_PIXELS_TO_POINTS(_mapTileSize); - Size tileSize = CC_SIZE_PIXELS_TO_POINTS(_tileSet->_tileSize); - Mat4 nodeToTileTransform = _tileToNodeTransform.getInversed(); - //transform to tile - visibleTiles = RectApplyTransform(visibleTiles, nodeToTileTransform); - // tile coordinate is upside-down, so we need to make the tile coordinate use top-left for the start point. - visibleTiles.origin.y += 1; - - // if x=0.7, width=9.5, we need to draw number 0~10 of tiles, and so is height. - visibleTiles.size.width = ceil(visibleTiles.origin.x + visibleTiles.size.width) - floor(visibleTiles.origin.x); - visibleTiles.size.height = ceil(visibleTiles.origin.y + visibleTiles.size.height) - floor(visibleTiles.origin.y); - visibleTiles.origin.x = floor(visibleTiles.origin.x); - visibleTiles.origin.y = floor(visibleTiles.origin.y); - - // for the bigger tiles. - int tilesOverX = 0; - int tilesOverY = 0; - // for diagonal orientation tiles - float tileSizeMax = std::max(tileSize.width, tileSize.height); - if (_layerOrientation == FAST_TMX_ORIENTATION_ORTHO) - { - tilesOverX = (int)ceil(tileSizeMax / mapTileSize.width) - 1; - tilesOverY = (int)ceil(tileSizeMax / mapTileSize.height) - 1; - - if (tilesOverX < 0) tilesOverX = 0; - if (tilesOverY < 0) tilesOverY = 0; - } - else if(_layerOrientation == FAST_TMX_ORIENTATION_ISO) - { - Rect overTileRect(0, 0, tileSizeMax - mapTileSize.width, tileSizeMax - mapTileSize.height); - if (overTileRect.size.width < 0) overTileRect.size.width = 0; - if (overTileRect.size.height < 0) overTileRect.size.height = 0; - overTileRect = RectApplyTransform(overTileRect, nodeToTileTransform); - - tilesOverX = (int)(ceil(overTileRect.origin.x + overTileRect.size.width) - floor(overTileRect.origin.x)); - tilesOverY = (int)(ceil(overTileRect.origin.y + overTileRect.size.height) - floor(overTileRect.origin.y)); - } - else - { - //do nothing, do not support - //CCASSERT(0, "TMX invalid value"); - } - - _indicesVertexZNumber.clear(); - - for(const auto& iter : _indicesVertexZOffsets) - { - _indicesVertexZNumber[iter.first] = iter.second; - } - - int yBegin = static_cast(std::max(0.f,visibleTiles.origin.y - tilesOverY)); - int yEnd = static_cast(std::min(_layerSize.height,visibleTiles.origin.y + visibleTiles.size.height + tilesOverY)); - int xBegin = static_cast(std::max(0.f,visibleTiles.origin.x - tilesOverX)); - int xEnd = static_cast(std::min(_layerSize.width,visibleTiles.origin.x + visibleTiles.size.width + tilesOverX)); - - for (int y = yBegin; y < yEnd; ++y) - { - for (int x = xBegin; x < xEnd; ++x) - { - int tileIndex = getTileIndexByPos(x, y); - if(_tiles[tileIndex] == 0) continue; - - int vertexZ = getVertexZForPos(Vec2((float)x,(float)y)); - auto iter = _indicesVertexZNumber.find(vertexZ); - int offset = iter->second; - iter->second++; - - unsigned short quadIndex = static_cast(_tileToQuadIndex[tileIndex]); - _indices[6 * offset + 0] = quadIndex * 4 + 0; - _indices[6 * offset + 1] = quadIndex * 4 + 1; - _indices[6 * offset + 2] = quadIndex * 4 + 2; - _indices[6 * offset + 3] = quadIndex * 4 + 3; - _indices[6 * offset + 4] = quadIndex * 4 + 2; - _indices[6 * offset + 5] = quadIndex * 4 + 1; - - } // for x - } // for y - - for(const auto& iter : _indicesVertexZOffsets) - { - _indicesVertexZNumber[iter.first] -= iter.second; - if(_indicesVertexZNumber[iter.first] == 0) - { - _indicesVertexZNumber.erase(iter.first); - } - } - -} - -void FastTMXLayer::updateVertexBuffer() -{ - unsigned int vertexBufferSize = (unsigned int)(sizeof(V3F_C4B_T2F) * _totalQuads.size() * 4); - if (!_vertexBuffer) - { - auto device = backend::Device::getInstance(); - _vertexBuffer = device->newBuffer(vertexBufferSize, backend::BufferType::VERTEX, backend::BufferUsage::STATIC); - } - _vertexBuffer->updateData(&_totalQuads[0], vertexBufferSize); -} - -void FastTMXLayer::updateIndexBuffer() -{ -#ifdef CC_FAST_TILEMAP_32_BIT_INDICES - unsigned int indexBufferSize = (unsigned int)(sizeof(unsigned int) * _indices.size()); -#else - unsigned int indexBufferSize = (unsigned int)(sizeof(unsigned short) * _indices.size()); -#endif - if (!_indexBuffer) - { - auto device = backend::Device::getInstance(); - _indexBuffer = device->newBuffer(indexBufferSize, backend::BufferType::INDEX, backend::BufferUsage::DYNAMIC); - } - _indexBuffer->updateData(&_indices[0], indexBufferSize); -} - -// FastTMXLayer - setup Tiles -void FastTMXLayer::setupTiles() -{ - // Optimization: quick hack that sets the image size on the tileset - _tileSet->_imageSize = _texture->getContentSizeInPixels(); - - // By default all the tiles are aliased - // pros: easier to render - // cons: difficult to scale / rotate / etc. - _texture->setAliasTexParameters(); - - //CFByteOrder o = CFByteOrderGetCurrent(); - - // Parse cocos2d properties - this->parseInternalProperties(); - - Size screenSize = Director::getInstance()->getWinSize(); - - switch (_layerOrientation) - { - case FAST_TMX_ORIENTATION_ORTHO: - _screenGridSize.width = ceil(screenSize.width / _mapTileSize.width) + 1; - _screenGridSize.height = ceil(screenSize.height / _mapTileSize.height) + 1; - - // tiles could be bigger than the grid, add additional rows if needed - _screenGridSize.height += _tileSet->_tileSize.height / _mapTileSize.height; - break; - case FAST_TMX_ORIENTATION_ISO: - _screenGridSize.width = ceil(screenSize.width / _mapTileSize.width) + 2; - _screenGridSize.height = ceil(screenSize.height / (_mapTileSize.height/2)) + 4; - break; - case FAST_TMX_ORIENTATION_HEX: - default: - CCLOGERROR("FastTMX does not support type %d", _layerOrientation); - break; - } - - _screenTileCount = (int)(_screenGridSize.width * _screenGridSize.height); - -} - -Mat4 FastTMXLayer::tileToNodeTransform() -{ - float w = _mapTileSize.width / CC_CONTENT_SCALE_FACTOR(); - float h = _mapTileSize.height / CC_CONTENT_SCALE_FACTOR(); - float offY = (_layerSize.height - 1) * h; - - switch(_layerOrientation) - { - case FAST_TMX_ORIENTATION_ORTHO: - { - _tileToNodeTransform = Mat4 - ( - w, 0.0f, 0.0f, 0.0f, - 0.0f, -h, 0.0f, offY, - 0.0f, 0.0f, 1.0f, 0.0f, - 0.0f, 0.0, 0.0f, 1.0f - ); - - return _tileToNodeTransform; - } - case FAST_TMX_ORIENTATION_ISO: - { - float offX = (_layerSize.width - 1) * w / 2; - _tileToNodeTransform = Mat4 - ( - w/2, -w/2, 0.0f, offX, - -h/2, -h/2, 0.0f, offY, - 0.0f, 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f - ); - return _tileToNodeTransform; - } - case FAST_TMX_ORIENTATION_HEX: - { - _tileToNodeTransform = Mat4 - ( - h * sqrtf(0.75), 0, 0, 0, - -h/2, -h, 0, offY, - 0, 0, 1, 0, - 0, 0, 0, 1 - ); - return _tileToNodeTransform; - } - default: - { - _tileToNodeTransform = Mat4::IDENTITY; - return _tileToNodeTransform; - } - } - -} - -void FastTMXLayer::updatePrimitives() -{ - auto blendfunc = _texture->hasPremultipliedAlpha() ? BlendFunc::ALPHA_PREMULTIPLIED : BlendFunc::ALPHA_NON_PREMULTIPLIED; - for(const auto& iter : _indicesVertexZNumber) - { - int start = _indicesVertexZOffsets.at(iter.first); - - auto commandIter = _customCommands.find(iter.first); - if (_customCommands.end() == commandIter) - { - auto command = new CustomCommand(); - command->setVertexBuffer(_vertexBuffer); - - CustomCommand::IndexFormat indexFormat = CustomCommand::IndexFormat::U_SHORT; -#if CC_FAST_TILEMAP_32_BIT_INDICES - indexFormat = CustomCommand::IndexFormat::U_INT; -#endif - command->setIndexBuffer(_indexBuffer, indexFormat); - - command->setIndexDrawInfo(start * 6, iter.second * 6); - - auto& pipelineDescriptor = command->getPipelineDescriptor(); - - if (_useAutomaticVertexZ) - { - CC_SAFE_RELEASE(pipelineDescriptor.programState); - auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::POSITION_TEXTURE_COLOR_ALPHA_TEST); - auto programState = new (std::nothrow) backend::ProgramState(program); - pipelineDescriptor.programState = programState; - _alphaValueLocation = pipelineDescriptor.programState->getUniformLocation("u_alpha_value"); - pipelineDescriptor.programState->setUniform(_alphaValueLocation, &_alphaFuncValue, sizeof(_alphaFuncValue)); - } - else - { - CC_SAFE_RELEASE(pipelineDescriptor.programState); - auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::POSITION_TEXTURE_COLOR); - auto programState = new (std::nothrow) backend::ProgramState(program); - pipelineDescriptor.programState = programState; - } - auto vertexLayout = pipelineDescriptor.programState->getVertexLayout(); - const auto& attributeInfo = pipelineDescriptor.programState->getProgram()->getActiveAttributes(); - auto iterAttribute = attributeInfo.find("a_position"); - if(iterAttribute != attributeInfo.end()) - { - vertexLayout->setAttribute("a_position", iterAttribute->second.location, backend::VertexFormat::FLOAT3, 0, false); - } - iterAttribute = attributeInfo.find("a_texCoord"); - if(iterAttribute != attributeInfo.end()) - { - vertexLayout->setAttribute("a_texCoord", iterAttribute->second.location, backend::VertexFormat::FLOAT2, offsetof(V3F_C4B_T2F, texCoords), false); - } - iterAttribute = attributeInfo.find("a_color"); - if(iterAttribute != attributeInfo.end()) - { - vertexLayout->setAttribute("a_color", iterAttribute->second.location, backend::VertexFormat::UBYTE4, offsetof(V3F_C4B_T2F, colors), true); - } - vertexLayout->setLayout(sizeof(V3F_C4B_T2F)); - _mvpMatrixLocaiton = pipelineDescriptor.programState->getUniformLocation("u_MVPMatrix"); - _textureLocation = pipelineDescriptor.programState->getUniformLocation("u_texture"); - pipelineDescriptor.programState->setTexture(_textureLocation, 0, _texture->getBackendTexture()); - command->init(_globalZOrder, blendfunc); - - _customCommands[iter.first] = command; - } - else - { - commandIter->second->setIndexDrawInfo(start * 6, iter.second * 6); - } - } -} - -void FastTMXLayer::setOpacity(uint8_t opacity) -{ - Node::setOpacity(opacity); - _quadsDirty = true; -} - - -void FastTMXLayer::updateTotalQuads() -{ - if(_quadsDirty) - { - Size tileSize = CC_SIZE_PIXELS_TO_POINTS(_tileSet->_tileSize); - Size texSize = _tileSet->_imageSize; - _tileToQuadIndex.clear(); - _totalQuads.resize(int(_layerSize.width * _layerSize.height)); - _indices.resize(6 * int(_layerSize.width * _layerSize.height)); - _tileToQuadIndex.resize(int(_layerSize.width * _layerSize.height),-1); - _indicesVertexZOffsets.clear(); - - auto color = Color4B::WHITE; - color.a = getDisplayedOpacity(); - - if (_texture->hasPremultipliedAlpha()) - { - auto alpha = color.a / 255.0f; - color.r = static_cast(color.r * alpha); - color.g = static_cast(color.g * alpha); - color.b = static_cast(color.b * alpha); - } - - int quadIndex = 0; - for(int y = 0; y < _layerSize.height; ++y) - { - for(int x =0; x < _layerSize.width; ++x) - { - int tileIndex = getTileIndexByPos(x, y); - int tileGID = _tiles[tileIndex]; - - if(tileGID == 0) continue; - - _tileToQuadIndex[tileIndex] = quadIndex; - - auto& quad = _totalQuads[quadIndex]; - - Vec3 nodePos(float(x), float(y), 0); - _tileToNodeTransform.transformPoint(&nodePos); - - float left, right, top, bottom, z; - - int zPos = getVertexZForPos(Vec2((float)x, (float)y)); - z = (float)zPos; - auto iter = _indicesVertexZOffsets.find(zPos); - if(iter == _indicesVertexZOffsets.end()) - { - _indicesVertexZOffsets[zPos] = 1; - } - else - { - iter->second++; - } - // vertices - if (tileGID & kTMXTileDiagonalFlag) - { - left = nodePos.x; - right = nodePos.x + tileSize.height; - bottom = nodePos.y + tileSize.width; - top = nodePos.y; - } - else - { - left = nodePos.x; - right = nodePos.x + tileSize.width; - bottom = nodePos.y + tileSize.height; - top = nodePos.y; - } - - if(tileGID & kTMXTileVerticalFlag) - std::swap(top, bottom); - if(tileGID & kTMXTileHorizontalFlag) - std::swap(left, right); - - if(tileGID & kTMXTileDiagonalFlag) - { - // FIXME: not working correctly - quad.bl.vertices.x = left; - quad.bl.vertices.y = bottom; - quad.bl.vertices.z = z; - quad.br.vertices.x = left; - quad.br.vertices.y = top; - quad.br.vertices.z = z; - quad.tl.vertices.x = right; - quad.tl.vertices.y = bottom; - quad.tl.vertices.z = z; - quad.tr.vertices.x = right; - quad.tr.vertices.y = top; - quad.tr.vertices.z = z; - } - else - { - quad.bl.vertices.x = left; - quad.bl.vertices.y = bottom; - quad.bl.vertices.z = z; - quad.br.vertices.x = right; - quad.br.vertices.y = bottom; - quad.br.vertices.z = z; - quad.tl.vertices.x = left; - quad.tl.vertices.y = top; - quad.tl.vertices.z = z; - quad.tr.vertices.x = right; - quad.tr.vertices.y = top; - quad.tr.vertices.z = z; - } - - // texcoords - Rect tileTexture = _tileSet->getRectForGID(tileGID); - left = (tileTexture.origin.x / texSize.width); - right = left + (tileTexture.size.width / texSize.width); - bottom = (tileTexture.origin.y / texSize.height); - top = bottom + (tileTexture.size.height / texSize.height); - - quad.bl.texCoords.u = left; - quad.bl.texCoords.v = bottom; - quad.br.texCoords.u = right; - quad.br.texCoords.v = bottom; - quad.tl.texCoords.u = left; - quad.tl.texCoords.v = top; - quad.tr.texCoords.u = right; - quad.tr.texCoords.v = top; - - quad.bl.colors = color; - quad.br.colors = color; - quad.tl.colors = color; - quad.tr.colors = color; - - - ++quadIndex; - } - } - - int offset = 0; - for(auto& vertexZOffset : _indicesVertexZOffsets) - { - std::swap(offset, vertexZOffset.second); - offset += vertexZOffset.second; - } - updateVertexBuffer(); - - _quadsDirty = false; - } -} - -// removing / getting tiles -Sprite* FastTMXLayer::getTileAt(const Vec2& tileCoordinate) -{ - 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"); - - Sprite *tile = nullptr; - int gid = this->getTileGIDAt(tileCoordinate); - - // if GID == 0, then no tile is present - if( gid ) { - int index = (int) tileCoordinate.x + (int)(tileCoordinate.y * _layerSize.width); - - auto it = _spriteContainer.find(index); - if (it != _spriteContainer.end()) - { - tile = it->second.first; - } - else - { - // tile not created yet. create it - Rect rect = _tileSet->getRectForGID(gid); - rect = CC_RECT_PIXELS_TO_POINTS(rect); - tile = Sprite::createWithTexture(_texture, rect); - - Vec2 p = this->getPositionAt(tileCoordinate); - tile->setAnchorPoint(Vec2::ZERO); - tile->setPosition(p); - tile->setPositionZ((float)getVertexZForPos(tileCoordinate)); - tile->setOpacity(this->getOpacity()); - tile->setTag(index); - this->addChild(tile, index); - _spriteContainer.insert(std::pair >(index, std::pair(tile, gid))); - - // tile is converted to sprite. - setFlaggedTileGIDByIndex(index, 0); - } - } - return tile; -} - -int FastTMXLayer::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(_tiles, "TMXLayer: the tiles map has been released"); - - int idx = static_cast(((int) tileCoordinate.x + (int) tileCoordinate.y * _layerSize.width)); - - // Bits on the far end of the 32-bit global tile ID are used for tile flags - int tile = _tiles[idx]; - auto it = _spriteContainer.find(idx); - - // converted to sprite. - if (tile == 0 && it != _spriteContainer.end()) - { - tile = it->second.second; - } - - // issue1264, flipped tiles can be changed dynamically - if (flags) - { - *flags = (TMXTileFlags)(tile & kTMXFlipedAll); - } - - return (tile & kTMXFlippedMask); -} - -Vec2 FastTMXLayer::getPositionAt(const Vec2& pos) -{ - return PointApplyTransform(pos, _tileToNodeTransform); -} - -int FastTMXLayer::getVertexZForPos(const Vec2& pos) -{ - int ret = 0; - int maxVal = 0; - if (_useAutomaticVertexZ) - { - switch (_layerOrientation) - { - case FAST_TMX_ORIENTATION_ISO: - maxVal = static_cast(_layerSize.width + _layerSize.height); - ret = static_cast(-(maxVal - (pos.x + pos.y))); - break; - case FAST_TMX_ORIENTATION_ORTHO: - ret = static_cast(-(_layerSize.height-pos.y)); - break; - case FAST_TMX_ORIENTATION_HEX: - CCASSERT(0, "TMX Hexa vertexZ not supported"); - break; - default: - CCASSERT(0, "TMX invalid value"); - break; - } - } - else - { - ret = _vertexZvalue; - } - - return ret; -} - -void FastTMXLayer::removeTileAt(const Vec2& tileCoordinate) -{ - - CCASSERT( tileCoordinate.x < _layerSize.width && tileCoordinate.y < _layerSize.height && tileCoordinate.x >=0 && tileCoordinate.y >=0, "TMXLayer: invalid position"); - - int gid = this->getTileGIDAt(tileCoordinate); - - if( gid ) { - - int z = (int) tileCoordinate.x + (int)(tileCoordinate.y * _layerSize.width); - - // remove tile from GID map - setFlaggedTileGIDByIndex(z, 0); - - // remove it from sprites - auto it = _spriteContainer.find(z); - if (it != _spriteContainer.end()) - { - this->removeChild(it->second.first); - } - } -} - -void FastTMXLayer::setFlaggedTileGIDByIndex(int index, uint32_t gid) -{ - if(gid == _tiles[index]) return; - _tiles[index] = gid; - _quadsDirty = true; - _dirty = true; -} - -void FastTMXLayer::removeChild(Node* node, bool cleanup) -{ - int tag = node->getTag(); - auto it = _spriteContainer.find(tag); - if (it != _spriteContainer.end() && it->second.first == node) - { - _spriteContainer.erase(it); - } - Node::removeChild(node, cleanup); -} - -// TMXLayer - Properties -Value FastTMXLayer::getProperty(const std::string& propertyName) const -{ - auto propItr = _properties.find(propertyName); - if (propItr != _properties.end()) - return propItr->second; - - return Value(); -} - -void FastTMXLayer::parseInternalProperties() -{ - auto vertexz = getProperty("cc_vertexz"); - if (vertexz.isNull()) return; - - std::string vertexZStr = vertexz.asString(); - // If "automatic" is on, then parse the "cc_alpha_func" too - if (vertexZStr == "automatic") - { - _useAutomaticVertexZ = true; - auto alphaFuncVal = getProperty("cc_alpha_func"); - _alphaFuncValue = alphaFuncVal.asFloat(); - } - else - { - _vertexZvalue = vertexz.asInt(); - } -} - -//CCTMXLayer2 - obtaining positions, offset -Vec2 FastTMXLayer::calculateLayerOffset(const Vec2& pos) -{ - Vec2 ret; - switch (_layerOrientation) - { - case FAST_TMX_ORIENTATION_ORTHO: - ret.set( pos.x * _mapTileSize.width, -pos.y *_mapTileSize.height); - break; - case FAST_TMX_ORIENTATION_ISO: - ret.set((_mapTileSize.width /2) * (pos.x - pos.y), - (_mapTileSize.height /2 ) * (-pos.x - pos.y)); - break; - case FAST_TMX_ORIENTATION_HEX: - default: - CCASSERT(pos.isZero(), "offset for this map not implemented yet"); - break; - } - return ret; -} - -// TMXLayer - adding / remove tiles -void FastTMXLayer::setTileGID(int gid, const Vec2& tileCoordinate) -{ - setTileGID(gid, tileCoordinate, (TMXTileFlags)0); -} - -void FastTMXLayer::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(_tiles, "TMXLayer: the tiles map has been released"); - CCASSERT(gid == 0 || gid >= _tileSet->_firstGid, "TMXLayer: invalid gid" ); - - TMXTileFlags currentFlags; - int currentGID = getTileGIDAt(tileCoordinate, ¤tFlags); - - if (currentGID == gid && currentFlags == flags) return; - - uint32_t gidAndFlags = gid | flags; - - // setting gid=0 is equal to remove the tile - if (gid == 0) - { - removeTileAt(tileCoordinate); - } - // empty tile. create a new one - else if (currentGID == 0) - { - int z = (int) tileCoordinate.x + (int)(tileCoordinate.y * _layerSize.width); - setFlaggedTileGIDByIndex(z, gidAndFlags); - } - // modifying an existing tile with a non-empty tile - else - { - int z = (int) tileCoordinate.x + (int)(tileCoordinate.y * _layerSize.width); - auto it = _spriteContainer.find(z); - if (it != _spriteContainer.end()) - { - Sprite *sprite = it->second.first; - Rect rect = _tileSet->getRectForGID(gid); - rect = CC_RECT_PIXELS_TO_POINTS(rect); - - sprite->setTextureRect(rect, false, rect.size); - this->reorderChild(sprite, z); - if (flags) - { - setupTileSprite(sprite, sprite->getPosition(), gidAndFlags); - } - - it->second.second = gidAndFlags; - } - else - { - setFlaggedTileGIDByIndex(z, gidAndFlags); - } - } -} - -void FastTMXLayer::setupTileSprite(Sprite* sprite, const Vec2& pos, uint32_t gid) -{ - sprite->setPosition(getPositionAt(pos)); - sprite->setPositionZ((float)getVertexZForPos(pos)); - sprite->setAnchorPoint(Vec2::ZERO); - sprite->setOpacity(this->getOpacity()); - - //issue 1264, flip can be undone as well - sprite->setFlippedX(false); - sprite->setFlippedY(false); - sprite->setRotation(0.0f); - - // Rotation in tiled is achieved using 3 flipped states, flipping across the horizontal, vertical, and diagonal axes of the tiles. - if (gid & kTMXTileDiagonalFlag) - { - // put the anchor in the middle for ease of rotation. - sprite->setAnchorPoint(Vec2(0.5f,0.5f)); - sprite->setPosition(getPositionAt(pos).x + sprite->getContentSize().height/2, - getPositionAt(pos).y + sprite->getContentSize().width/2 ); - - uint32_t flag = gid & (kTMXTileHorizontalFlag | kTMXTileVerticalFlag ); - - // handle the 4 diagonally flipped states. - if (flag == kTMXTileHorizontalFlag) - { - sprite->setRotation(90.0f); - } - else if (flag == kTMXTileVerticalFlag) - { - sprite->setRotation(270.0f); - } - else if (flag == (kTMXTileVerticalFlag | kTMXTileHorizontalFlag) ) - { - sprite->setRotation(90.0f); - sprite->setFlippedX(true); - } - else - { - sprite->setRotation(270.0f); - sprite->setFlippedX(true); - } - } - else - { - if (gid & kTMXTileHorizontalFlag) - { - sprite->setFlippedX(true); - } - - if (gid & kTMXTileVerticalFlag) - { - sprite->setFlippedY(true); - } - } -} - -std::string FastTMXLayer::getDescription() const -{ - return StringUtils::format("", _tag, (int)_mapTileSize.width, (int)_mapTileSize.height); -} - - -NS_CC_END diff --git a/cocos/2d/CCFastTMXLayer.h b/cocos/2d/CCFastTMXLayer.h deleted file mode 100644 index e3071c6..0000000 --- a/cocos/2d/CCFastTMXLayer.h +++ /dev/null @@ -1,361 +0,0 @@ -/**************************************************************************** -Copyright (c) 2008-2010 Ricardo Quesada -Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2011 Zynga Inc. -Copyright (c) 2013-2016 Chukong Technologies Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ -#pragma once - -#include -#include "2d/CCNode.h" -#include "2d/CCTMXXMLParser.h" -#include "renderer/CCCustomCommand.h" - -NS_CC_BEGIN - -class TMXMapInfo; -class TMXLayerInfo; -class TMXTilesetInfo; -class Texture2D; -class Sprite; - -namespace backend -{ - class Buffer; -} - -/** - * @addtogroup _2d - * @{ - */ - -/** @brief FastTMXLayer represents the TMX layer. - - * It is a subclass of SpriteBatchNode. By default the tiles are rendered using a TextureAtlas. - * If you modify a tile on runtime, then, that tile will become a Sprite, otherwise no Sprite objects are created. - * The benefits of using Sprite objects as tiles are: - * - tiles (Sprite) can be rotated/scaled/moved with a nice API. - - * If the layer contains a property named "cc_vertexz" with an integer (in can be positive or negative), - * then all the tiles belonging to the layer will use that value as their OpenGL vertex Z for depth. - - * On the other hand, if the "cc_vertexz" property has the "automatic" value, then the tiles will use an automatic vertex Z value. - * Also before drawing the tiles, GL_ALPHA_TEST will be enabled, and disabled after drawing them. The used alpha func will be: - - * glAlphaFunc( GL_GREATER, value ). - - * "value" by default is 0, but you can change it from Tiled by adding the "cc_alpha_func" property to the layer. - * The value 0 should work for most cases, but if you have tiles that are semi-transparent, then you might want to use a different - * value, like 0.5. - - * For further information, please see the programming guide: - * http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:tiled_maps - - * @since v3.2 - * @js NA - */ - -class CC_DLL FastTMXLayer : public Node -{ -public: - /** Possible orientations of the TMX map */ - static const int FAST_TMX_ORIENTATION_ORTHO; - static const int FAST_TMX_ORIENTATION_HEX; - static const int FAST_TMX_ORIENTATION_ISO; - - /** Creates a FastTMXLayer with an tileset info, a layer info and a map info. - * - * @param tilesetInfo An tileset info. - * @param layerInfo A layer info. - * @param mapInfo A map info. - * @return Return an autorelease object. - */ - static FastTMXLayer * create(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo); - /** - * @js ctor - */ - FastTMXLayer(); - /** - * @js NA - * @lua NA - */ - virtual ~FastTMXLayer(); - - /** Returns the tile gid at a given tile coordinate. It also returns the tile flags. - * - * @param tileCoordinate The tile coordinate. - * @param flags A TMXTileFlags. - * @return The tile gid at a given tile coordinate. It also returns the tile flags. - */ - int getTileGIDAt(const Vec2& tileCoordinate, TMXTileFlags* flags = nullptr); - - /** Sets the tile gid (gid = tile global id) at a given tile coordinate. - * The Tile GID can be obtained by using the method "tileGIDAt" or by using the TMX editor -> Tileset Mgr +1. - * If a tile is already placed at that position, then it will be removed. - * @param gid The gid value. - * @param tileCoordinate The tile coordinate. - */ - void setTileGID(int gid, const Vec2& tileCoordinate); - - /** Sets the tile gid (gid = tile global id) at a given tile coordinate. - * The Tile GID can be obtained by using the method "tileGIDAt" or by using the TMX editor -> Tileset Mgr +1. - * If a tile is already placed at that position, then it will be removed. - * Use withFlags if the tile flags need to be changed as well. - * - * @param gid A integer value,it will be sets the tile gid. - * @param tileCoordinate The tile coordinate. - * @param flags A TMXTileFlags. - */ - void setTileGID(int gid, const Vec2& tileCoordinate, TMXTileFlags flags); - - /** Removes a tile at given tile coordinate. - * - * @param tileCoordinate The tile Coordinate. - */ - void removeTileAt(const Vec2& tileCoordinate); - - /** Returns the position in points of a given tile coordinate. - * - * @param tileCoordinate The tile Coordinate. - * @return The position in points of a given tile coordinate. - */ - Vec2 getPositionAt(const Vec2& tileCoordinate); - - /** Return the value for the specific property name. - * - * @param propertyName The value for the specific property name. - * @return The value for the specific property name. - */ - Value getProperty(const std::string& propertyName) const; - - /** Creates the tiles. */ - void setupTiles(); - - /** Get the tile layer name. - * - * @return The tile layer name. - */ - const std::string& getLayerName() { return _layerName; } - - /** Set the tile layer name. - * - * @param layerName The new layer name. - */ - void setLayerName(const std::string& layerName) { _layerName = layerName; } - - /** Size of the layer in tiles. - * - * @return Size of the layer in tiles. - */ - const Size& getLayerSize() const { return _layerSize; } - - /** Set the size of the layer in tiles. - * - * @param size The new size of the layer in tiles. - */ - void setLayerSize(const Size& size) { _layerSize = size; } - - /** Size of the map's tile (could be different from the tile's size). - * - * @return Size of the map's tile (could be different from the tile's size). - */ - const Size& getMapTileSize() const { return _mapTileSize; } - - /** Set the size of the map's tile. - * - * @param size The new size of the map's tile. - */ - void setMapTileSize(const Size& size) { _mapTileSize = size; } - - /** Pointer to the map of tiles. - * @js NA - * @lua NA - * @return The pointer to the map of tiles. - */ - const uint32_t* getTiles() const { return _tiles; }; - - /** Set the pointer to the map of tiles. - * - * @param tiles The pointer to the map of tiles. - */ - void setTiles(uint32_t* tiles) { _tiles = tiles; _quadsDirty = true;}; - - /** Tileset information for the layer. - * - * @return Tileset information for the layer. - */ - TMXTilesetInfo* getTileSet() const { return _tileSet; } - - /** Set the tileset information for the layer. - * - * @param info The new tileset information for the layer. - */ - void setTileSet(TMXTilesetInfo* info) { - CC_SAFE_RETAIN(info); - CC_SAFE_RELEASE(_tileSet); - _tileSet = info; - } - - /** Layer orientation, which is the same as the map orientation. - * - * @return Layer orientation, which is the same as the map orientation. - */ - int getLayerOrientation() const { return _layerOrientation; } - - /** Set Layer orientation, which is the same as the map orientation. - * - * @param orientation Layer orientation, which is the same as the map orientation. - */ - void setLayerOrientation(int orientation) { _layerOrientation = orientation; } - - /** Properties from the layer. They can be added using Tiled. - * - * @return Properties from the layer. They can be added using Tiled. - */ - const ValueMap& getProperties() const { return _properties; } - - /** Properties from the layer. They can be added using Tiled. - * - * @return Properties from the layer. They can be added using Tiled. - */ - ValueMap& getProperties() { return _properties; } - - /** Set the properties to the layer. - * - * @param properties The properties to the layer. - */ - void setProperties(const ValueMap& properties) - { - _properties = properties; - } - - /** Returns the tile (Sprite) at a given a tile coordinate. - * The returned Sprite will be already added to the TMXLayer. Don't add it again. - * The Sprite can be treated like any other Sprite: rotated, scaled, translated, opacity, color, etc. - * You can remove either by calling: - * - layer->removeChild(sprite, cleanup); - * - * @return Returns the tile (Sprite) at a given a tile coordinate. - */ - Sprite* getTileAt(const Vec2& tileCoordinate); - - /** Set an sprite to the tile,with the tile coordinate and gid. - * - * @param sprite A Sprite. - * @param pos The tile coordinate. - * @param gid The tile gid. - */ - void setupTileSprite(Sprite* sprite, const Vec2& pos, uint32_t gid); - - // - // Override - // - virtual std::string getDescription() const override; - virtual void draw(Renderer *renderer, const Mat4& transform, uint32_t flags) override; - void removeChild(Node* child, bool cleanup = true) override; - -protected: - virtual void setOpacity(uint8_t opacity) override; - - bool initWithTilesetInfo(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo); - void updateTiles(const Rect& culledRect); - Vec2 calculateLayerOffset(const Vec2& offset); - - /* The layer recognizes some special properties, like cc_vertexz */ - void parseInternalProperties(); - - Mat4 tileToNodeTransform(); - Rect tileBoundsForClipTransform(const Mat4 &tileToClip); - - int getVertexZForPos(const Vec2& pos); - - //Flip flags is packed into gid - void setFlaggedTileGIDByIndex(int index, uint32_t gid); - - // - void updateTotalQuads(); - - int getTileIndexByPos(int x, int y) const { return x + y * (int) _layerSize.width; } - - void updateVertexBuffer(); - void updateIndexBuffer(); - void updatePrimitives(); - - //! name of the layer - std::string _layerName; - - /** size of the layer in tiles */ - Size _layerSize; - /** size of the map's tile (could be different from the tile's size) */ - Size _mapTileSize; - /** pointer to the map of tiles */ - uint32_t* _tiles = nullptr; - /** Tileset information for the layer */ - TMXTilesetInfo* _tileSet = nullptr; - /** Layer orientation, which is the same as the map orientation */ - int _layerOrientation = FAST_TMX_ORIENTATION_ORTHO; - /** properties from the layer. They can be added using Tiled */ - ValueMap _properties; - - Texture2D *_texture = nullptr; - - /** container for sprite children. map > */ - std::map > _spriteContainer; - - Size _screenGridSize; - Rect _screenGridRect; - int _screenTileCount = 0; - - int _vertexZvalue = 0; - bool _useAutomaticVertexZ = false; - - /** tile coordinate to node coordinate transform */ - Mat4 _tileToNodeTransform; - /** data for rendering */ - bool _quadsDirty = true; - std::vector _tileToQuadIndex; - std::vector _totalQuads; -#ifdef CC_FAST_TILEMAP_32_BIT_INDICES - std::vector _indices; -#else - std::vector _indices; -#endif - std::map _indicesVertexZOffsets; - std::unordered_map _indicesVertexZNumber; - bool _dirty = true; - - backend::Buffer* _vertexBuffer = nullptr; - backend::Buffer* _indexBuffer = nullptr; - - float _alphaFuncValue = 0.f; - std::unordered_map _customCommands; - - backend::UniformLocation _mvpMatrixLocaiton; - backend::UniformLocation _textureLocation; - backend::UniformLocation _alphaValueLocation; -}; - -// end of tilemap_parallax_nodes group -/// @} -NS_CC_END diff --git a/cocos/2d/CCFastTMXTiledMap.cpp b/cocos/2d/CCFastTMXTiledMap.cpp deleted file mode 100644 index 1a7e5ff..0000000 --- a/cocos/2d/CCFastTMXTiledMap.cpp +++ /dev/null @@ -1,260 +0,0 @@ -/**************************************************************************** -Copyright (c) 2009-2010 Ricardo Quesada -Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2011 Zynga Inc. -Copyright (c) 2013-2016 Chukong Technologies Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ -#include "2d/CCFastTMXTiledMap.h" -#include "2d/CCFastTMXLayer.h" -#include "base/ccUTF8.h" - -NS_CC_BEGIN - -// implementation FastTMXTiledMap - -FastTMXTiledMap * FastTMXTiledMap::create(const std::string& tmxFile) -{ - FastTMXTiledMap *ret = new (std::nothrow) FastTMXTiledMap(); - if (ret->initWithTMXFile(tmxFile)) - { - ret->autorelease(); - return ret; - } - CC_SAFE_DELETE(ret); - return nullptr; -} - -FastTMXTiledMap* FastTMXTiledMap::createWithXML(const std::string& tmxString, const std::string& resourcePath) -{ - FastTMXTiledMap *ret = new (std::nothrow) FastTMXTiledMap(); - if (ret->initWithXML(tmxString, resourcePath)) - { - ret->autorelease(); - return ret; - } - CC_SAFE_DELETE(ret); - return nullptr; -} - -bool FastTMXTiledMap::initWithTMXFile(const std::string& tmxFile) -{ - CCASSERT(tmxFile.size()>0, "FastTMXTiledMap: tmx file should not be empty"); - - setContentSize(Size::ZERO); - - TMXMapInfo *mapInfo = TMXMapInfo::create(tmxFile); - - if (! mapInfo) - { - return false; - } - CCASSERT( !mapInfo->getTilesets().empty(), "FastTMXTiledMap: Map not found. Please check the filename."); - buildWithMapInfo(mapInfo); - - return true; -} - -bool FastTMXTiledMap::initWithXML(const std::string& tmxString, const std::string& resourcePath) -{ - setContentSize(Size::ZERO); - - TMXMapInfo *mapInfo = TMXMapInfo::createWithXML(tmxString, resourcePath); - - CCASSERT( !mapInfo->getTilesets().empty(), "FastTMXTiledMap: Map not found. Please check the filename."); - buildWithMapInfo(mapInfo); - - return true; -} - -FastTMXTiledMap::FastTMXTiledMap() - :_mapSize(Size::ZERO) - ,_tileSize(Size::ZERO) -{ -} - -FastTMXTiledMap::~FastTMXTiledMap() -{ -} - -// private -FastTMXLayer * FastTMXTiledMap::parseLayer(TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo) -{ - TMXTilesetInfo *tileset = tilesetForLayer(layerInfo, mapInfo); - if (tileset == nullptr) - return nullptr; - - FastTMXLayer *layer = FastTMXLayer::create(tileset, layerInfo, mapInfo); - - // tell the layerinfo to release the ownership of the tiles map. - layerInfo->_ownTiles = false; - layer->setupTiles(); - - return layer; -} - -TMXTilesetInfo * FastTMXTiledMap::tilesetForLayer(TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo) -{ - Size size = layerInfo->_layerSize; - auto& tilesets = mapInfo->getTilesets(); - - for (auto iter = tilesets.crbegin(), iterCrend = tilesets.crend(); iter != iterCrend; ++iter) - { - TMXTilesetInfo* tilesetInfo = *iter; - if (tilesetInfo) - { - for( int y=0; y < size.height; y++ ) - { - for( int x=0; x < size.width; x++ ) - { - uint32_t pos = static_cast(x + size.width * y); - uint32_t gid = layerInfo->_tiles[ pos ]; - - // gid are stored in little endian. - // if host is big endian, then swap - //if( o == CFByteOrderBigEndian ) - // gid = CFSwapInt32( gid ); - /* We support little endian.*/ - - // FIXME: gid == 0 --> empty tile - if( gid != 0 ) - { - // Optimization: quick return - // if the layer is invalid (more than 1 tileset per layer) an CCAssert will be thrown later - if( (gid & kTMXFlippedMask) - >= static_cast(tilesetInfo->_firstGid)) - { - return tilesetInfo; - } - } - } - } - } - } - - // If all the tiles are 0, return empty tileset - CCLOG("cocos2d: Warning: TMX Layer '%s' has no tiles", layerInfo->_name.c_str()); - return nullptr; -} - -void FastTMXTiledMap::buildWithMapInfo(TMXMapInfo* mapInfo) -{ - _mapSize = mapInfo->getMapSize(); - _tileSize = mapInfo->getTileSize(); - _mapOrientation = mapInfo->getOrientation(); - - _objectGroups = mapInfo->getObjectGroups(); - - _properties = mapInfo->getProperties(); - - _tileProperties = mapInfo->getTileProperties(); - - int idx=0; - - auto& layers = mapInfo->getLayers(); - for(const auto &layerInfo : layers) { - if (layerInfo->_visible) - { - FastTMXLayer *child = parseLayer(layerInfo, mapInfo); - if (child == nullptr) { - idx++; - continue; - } - addChild(child, idx, idx); - - // update content size with the max size - const Size& childSize = child->getContentSize(); - Size currentSize = this->getContentSize(); - currentSize.width = std::max( currentSize.width, childSize.width ); - currentSize.height = std::max( currentSize.height, childSize.height ); - this->setContentSize(currentSize); - - idx++; - } - } -} - -// public -FastTMXLayer * FastTMXTiledMap::getLayer(const std::string& layerName) const -{ - CCASSERT(layerName.size() > 0, "Invalid layer name!"); - - for (auto& child : _children) - { - FastTMXLayer* layer = dynamic_cast(child); - if(layer) - { - if(layerName.compare( layer->getLayerName()) == 0) - { - return layer; - } - } - } - - // layer not found - return nullptr; -} - -TMXObjectGroup * FastTMXTiledMap::getObjectGroup(const std::string& groupName) const -{ - CCASSERT(groupName.size() > 0, "Invalid group name!"); - - if (_objectGroups.size()>0) - { - for (const auto& objectGroup : _objectGroups) - { - if (objectGroup && objectGroup->getGroupName() == groupName) - { - return objectGroup; - } - } - } - - // objectGroup not found - return nullptr; -} - -Value FastTMXTiledMap::getProperty(const std::string& propertyName) const -{ - auto propsItr = _properties.find(propertyName); - if (propsItr != _properties.end()) - return propsItr->second; - - return Value(); -} - -Value FastTMXTiledMap::getPropertiesForGID(int GID) const -{ - auto propsItr = _tileProperties.find(GID); - if (propsItr != _tileProperties.end()) - return propsItr->second; - - return Value(); -} - -std::string FastTMXTiledMap::getDescription() const -{ - return StringUtils::format("(_children.size())); -} - -NS_CC_END diff --git a/cocos/2d/CCFastTMXTiledMap.h b/cocos/2d/CCFastTMXTiledMap.h deleted file mode 100644 index 9b344dd..0000000 --- a/cocos/2d/CCFastTMXTiledMap.h +++ /dev/null @@ -1,248 +0,0 @@ -/**************************************************************************** -Copyright (c) 2009-2010 Ricardo Quesada -Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2011 Zynga Inc. -Copyright (c) 2013-2016 Chukong Technologies Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ -#pragma once - -#include "2d/CCNode.h" -#include "2d/CCTMXObjectGroup.h" - -NS_CC_BEGIN - -class TMXLayerInfo; -class TMXTilesetInfo; -class TMXMapInfo; -class FastTMXLayer; -/** - * @addtogroup _2d - * @{ - */ - -/** @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 supports isometric, hexagonal and orthogonal tiles. - * It also supports object groups, objects, and properties. - - * Features: - * - Each tile will be treated as an Sprite. - * - The sprites are created on demand. They will be created only when you call "layer->tileAt(position)". - * - Each tile can be rotated / moved / scaled / tinted / "opaqued", since each tile is a Sprite. - * - Tiles can be added/removed in runtime. - * - The z-order of the tiles can be modified in runtime. - * - Each tile has an anchorPoint of (0,0). - * - The anchorPoint of the TMXTileMap is (0,0). - * - The TMX layers will be added as a child. - * - The TMX layers will be aliased by default. - * - The tileset image will be loaded using the TextureCache. - * - Each tile will have a unique tag. - * - Each tile will have a unique z value. top-left: z=1, bottom-right: z=max z. - * - Each object group will be treated as an MutableArray. - * - Object class which will contain all the properties in a dictionary. - * - Properties can be assigned to the Map, Layer, Object Group, and Object. - - * Limitations: - * - It only supports one tileset per layer. - * - Embedded images are not supported. - * - It only supports the XML format (the JSON format is not supported). - - * Technical description: - * Each layer is created using an FastTMXLayer (subclass of SpriteBatchNode). If you have 5 layers, then 5 FastTMXLayer will be created, - * unless the layer visibility is off. In that case, the layer won't be created at all. - * You can obtain the layers (FastTMXLayer objects) at runtime by: - * - map->getChildByTag(tag_number); // 0=1st layer, 1=2nd layer, 2=3rd layer, etc... - * - map->getLayer(name_of_the_layer); - - * Each object group is created using a TMXObjectGroup which is a subclass of MutableArray. - * You can obtain the object groups at runtime by: - * - map->getObjectGroup(name_of_the_object_group); - - * Each object is a TMXObject. - - * Each property is stored as a key-value pair in an MutableDictionary. - * You can obtain the properties at runtime by: - - * map->getProperty(name_of_the_property); - * layer->getProperty(name_of_the_property); - * objectGroup->getProperty(name_of_the_property); - * object->getProperty(name_of_the_property); - - * @since v3.2 - * @js NA - */ -class CC_DLL FastTMXTiledMap : public Node -{ -public: - /** Creates a TMX Tiled Map with a TMX file. - * - * @return An autorelease object. - */ - static FastTMXTiledMap* create(const std::string& tmxFile); - - /** Initializes a TMX Tiled Map with a TMX formatted XML string and a path to TMX resources. - * - * @param tmxString A TMX formatted XML string. - * @param resourcePath A path to TMX resources. - * @return An autorelease object. - */ - static FastTMXTiledMap* createWithXML(const std::string& tmxString, const std::string& resourcePath); - - /** Return the FastTMXLayer for the specific layer. - * - * @return Return the FastTMXLayer for the specific layer. - */ - FastTMXLayer* getLayer(const std::string& layerName) const; - - /** Return the TMXObjectGroup for the specific group. - * - * @return Return the TMXObjectGroup for the specific group. - */ - TMXObjectGroup* getObjectGroup(const std::string& groupName) const; - - /** Return the value for the specific property name. - * - * @return Return the value for the specific property name. - */ - Value getProperty(const std::string& propertyName) const; - - /** Return properties dictionary for tile GID. - * - * @return Return properties dictionary for tile GID. - */ - Value getPropertiesForGID(int GID) const; - - /** The map's size property measured in tiles. - * - * @return The map's size property measured in tiles. - */ - const Size& getMapSize() const { return _mapSize; } - - /** Set the map's size property measured in tiles. - * - * @param mapSize The map's size property measured in tiles. - */ - void setMapSize(const Size& mapSize) { _mapSize = mapSize; } - - /** The tiles's size property measured in pixels. - * - * @return The tiles's size property measured in pixels. - */ - const Size& getTileSize() const { return _tileSize; } - - /** Set the tiles's size property measured in pixels. - * - * @param tileSize The tiles's size property measured in pixels. - */ - void setTileSize(const Size& tileSize) { _tileSize = tileSize; } - - /** Get map orientation. - * - * @return The map orientation. - */ - int getMapOrientation() const { return _mapOrientation; } - - /** Set map orientation. - * - * @param mapOrientation The map orientation. - */ - void setMapOrientation(int mapOrientation) { _mapOrientation = mapOrientation; } - - /** Get object groups. - * - * @return Object groups. - */ - const Vector& getObjectGroups() const { return _objectGroups; } - Vector& getObjectGroups() { return _objectGroups; } - - /** Set object groups. - * - * @param groups An object groups. - */ - void setObjectGroups(const Vector& groups) { - _objectGroups = groups; - } - - /** Get properties. - * - * @return Properties. - */ - const ValueMap& getProperties() const { return _properties; } - - /** Set properties. - * - * @param properties An ValueMap Properties. - */ - void setProperties(const ValueMap& properties) { - _properties = properties; - } - - virtual std::string getDescription() const override; - -protected: - /** - * @js ctor - */ - FastTMXTiledMap(); - /** - * @js NA - * @lua NA - */ - virtual ~FastTMXTiledMap(); - - /** initializes a TMX Tiled Map with a TMX file */ - bool initWithTMXFile(const std::string& tmxFile); - - /** 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); - - FastTMXLayer * parseLayer(TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo); - TMXTilesetInfo * tilesetForLayer(TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo); - void buildWithMapInfo(TMXMapInfo* mapInfo); - - /** the map's size property measured in tiles */ - Size _mapSize; - /** the tiles's size property measured in pixels */ - Size _tileSize; - /** map orientation */ - int _mapOrientation; - /** object groups */ - Vector _objectGroups; - /** properties */ - ValueMap _properties; - - //! tile properties - ValueMapIntKey _tileProperties; - -private: - CC_DISALLOW_COPY_AND_ASSIGN(FastTMXTiledMap); - -}; - -// end of tilemap_parallax_nodes group -/** @} */ - - -NS_CC_END diff --git a/cocos/2d/CCTileMapAtlas.cpp b/cocos/2d/CCTileMapAtlas.cpp deleted file mode 100644 index 18a7565..0000000 --- a/cocos/2d/CCTileMapAtlas.cpp +++ /dev/null @@ -1,259 +0,0 @@ -/**************************************************************************** -Copyright (c) 2008-2010 Ricardo Quesada -Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2011 Zynga Inc. -Copyright (c) 2013-2016 Chukong Technologies Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ -#include "2d/CCTileMapAtlas.h" -#include "platform/CCFileUtils.h" -#include "renderer/CCTextureAtlas.h" -#include "base/TGAlib.h" -#include "base/CCDirector.h" -#include "base/ccUTF8.h" - -NS_CC_BEGIN - -// implementation TileMapAtlas - -TileMapAtlas * TileMapAtlas::create(const std::string& tile, const std::string& mapFile, int tileWidth, int tileHeight) -{ - TileMapAtlas *ret = new (std::nothrow) TileMapAtlas(); - if (ret->initWithTileFile(tile, mapFile, tileWidth, tileHeight)) - { - ret->autorelease(); - return ret; - } - CC_SAFE_DELETE(ret); - return nullptr; -} - -bool TileMapAtlas::initWithTileFile(const std::string& tile, const std::string& mapFile, int tileWidth, int tileHeight) -{ - this->loadTGAfile(mapFile); - this->calculateItemsToRender(); - - if( AtlasNode::initWithTileFile(tile, tileWidth, tileHeight, _itemsToRender) ) - { - this->updateAtlasValues(); - this->setContentSize(Size((float)(_TGAInfo->width*_itemWidth), - (float)(_TGAInfo->height*_itemHeight))); - return true; - } - return false; -} - -TileMapAtlas::TileMapAtlas() - : _itemsToRender(0) - , _TGAInfo(nullptr) -{ -} - -TileMapAtlas::~TileMapAtlas() -{ - if (_TGAInfo) - { - tgaDestroy(_TGAInfo); - } -} - -void TileMapAtlas::releaseMap() -{ - if (_TGAInfo) - { - tgaDestroy(_TGAInfo); - } - _TGAInfo = nullptr; -} - -void TileMapAtlas::calculateItemsToRender() -{ - CCASSERT( _TGAInfo != nullptr, "tgaInfo must be non-nil"); - - _itemsToRender = 0; - for(int x=0;x < _TGAInfo->width; x++ ) - { - for( int y=0; y < _TGAInfo->height; y++ ) - { - Color3B *ptr = (Color3B*) _TGAInfo->imageData; - Color3B value = ptr[x + y * _TGAInfo->width]; - if( value.r ) - { - ++_itemsToRender; - } - } - } -} - -void TileMapAtlas::loadTGAfile(const std::string& file) -{ - std::string fullPath = FileUtils::getInstance()->fullPathForFilename(file); - - // //Find the path of the file - // NSBundle *mainBndl = [Director sharedDirector].loadingBundle; - // String *resourcePath = [mainBndl resourcePath]; - // String * path = [resourcePath stringByAppendingPathComponent:file]; - - _TGAInfo = tgaLoad( fullPath.c_str() ); -#if 1 - if( _TGAInfo->status != TGA_OK ) - { - CCASSERT(0, "TileMapAtlasLoadTGA : TileMapAtlas cannot load TGA file"); - } -#endif -} - -// TileMapAtlas - Atlas generation / updates -void TileMapAtlas::setTile(const Color3B& tile, const Vec2& position) -{ - CCASSERT(_TGAInfo != nullptr, "tgaInfo must not be nil"); - CCASSERT(position.x < _TGAInfo->width, "Invalid position.x"); - CCASSERT(position.y < _TGAInfo->height, "Invalid position.x"); - CCASSERT(tile.r != 0, "R component must be non 0"); - - Color3B *ptr = (Color3B*)_TGAInfo->imageData; - Color3B value = ptr[(unsigned int)(position.x + position.y * _TGAInfo->width)]; - if( value.r == 0 ) - { - CCLOG("cocos2d: Value.r must be non 0."); - } - else - { - ptr[(unsigned int)(position.x + position.y * _TGAInfo->width)] = tile; - - // FIXME:: this method consumes a lot of memory - // FIXME:: a tree of something like that shall be implemented - std::string key = StringUtils::toString(position.x) + "," + StringUtils::toString(position.y); - int num = _posToAtlasIndex[key].asInt(); - - this->updateAtlasValueAt(position, tile, num); - } -} - -Color3B TileMapAtlas::getTileAt(const Vec2& position) const -{ - CCASSERT( _TGAInfo != nullptr, "tgaInfo must not be nil"); - CCASSERT( position.x < _TGAInfo->width, "Invalid position.x"); - CCASSERT( position.y < _TGAInfo->height, "Invalid position.y"); - - Color3B *ptr = (Color3B*)_TGAInfo->imageData; - Color3B value = ptr[(unsigned int)(position.x + position.y * _TGAInfo->width)]; - - return value; -} - -void TileMapAtlas::updateAtlasValueAt(const Vec2& pos, const Color3B& value, int index) -{ - CCASSERT( index >= 0 && index < _textureAtlas->getCapacity(), "updateAtlasValueAt: Invalid index"); - - V3F_C4B_T2F_Quad* quad = &((_textureAtlas->getQuads())[index]); - - int x = pos.x; - int y = pos.y; - float row = (float) (value.r % _itemsPerRow); - float col = (float) (value.r / _itemsPerRow); - - float textureWide = (float) (_textureAtlas->getTexture()->getPixelsWide()); - float textureHigh = (float) (_textureAtlas->getTexture()->getPixelsHigh()); - - float itemWidthInPixels = _itemWidth * CC_CONTENT_SCALE_FACTOR(); - float itemHeightInPixels = _itemHeight * CC_CONTENT_SCALE_FACTOR(); - -#if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL - float left = (2 * row * itemWidthInPixels + 1) / (2 * textureWide); - float right = left + (itemWidthInPixels * 2 - 2) / (2 * textureWide); - float top = (2 * col * itemHeightInPixels + 1) / (2 * textureHigh); - float bottom = top + (itemHeightInPixels * 2 - 2) / (2 * textureHigh); -#else - float left = (row * itemWidthInPixels) / textureWide; - float right = left + itemWidthInPixels / textureWide; - float top = (col * itemHeightInPixels) / textureHigh; - float bottom = top + itemHeightInPixels / textureHigh; -#endif - - quad->tl.texCoords.u = left; - quad->tl.texCoords.v = top; - quad->tr.texCoords.u = right; - quad->tr.texCoords.v = top; - quad->bl.texCoords.u = left; - quad->bl.texCoords.v = bottom; - quad->br.texCoords.u = right; - quad->br.texCoords.v = bottom; - - quad->bl.vertices.x = (float) (x * _itemWidth); - quad->bl.vertices.y = (float) (y * _itemHeight); - quad->bl.vertices.z = 0.0f; - quad->br.vertices.x = (float)(x * _itemWidth + _itemWidth); - quad->br.vertices.y = (float)(y * _itemHeight); - quad->br.vertices.z = 0.0f; - quad->tl.vertices.x = (float)(x * _itemWidth); - quad->tl.vertices.y = (float)(y * _itemHeight + _itemHeight); - quad->tl.vertices.z = 0.0f; - quad->tr.vertices.x = (float)(x * _itemWidth + _itemWidth); - quad->tr.vertices.y = (float)(y * _itemHeight + _itemHeight); - quad->tr.vertices.z = 0.0f; - - Color4B color(_displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity); - quad->tr.colors = color; - quad->tl.colors = color; - quad->br.colors = color; - quad->bl.colors = color; - - _textureAtlas->setDirty(true); - ssize_t totalQuads = _textureAtlas->getTotalQuads(); - if (index + 1 > totalQuads) { - _textureAtlas->increaseTotalQuadsWith(index + 1 - totalQuads); - } -} - -void TileMapAtlas::updateAtlasValues() -{ - CCASSERT( _TGAInfo != nullptr, "tgaInfo must be non-nil"); - - int total = 0; - - for(int x=0;x < _TGAInfo->width; x++ ) - { - for( int y=0; y < _TGAInfo->height; y++ ) - { - if( total < _itemsToRender ) - { - Color3B *ptr = (Color3B*) _TGAInfo->imageData; - Color3B value = ptr[x + y * _TGAInfo->width]; - - if( value.r != 0 ) - { - this->updateAtlasValueAt(Vec2(x,y), value, total); - - std::string key = StringUtils::toString(x) + "," + StringUtils::toString(y); - _posToAtlasIndex[key] = total; - - total++; - } - } - } - } -} - - -NS_CC_END diff --git a/cocos/2d/CCTileMapAtlas.h b/cocos/2d/CCTileMapAtlas.h deleted file mode 100644 index 5689791..0000000 --- a/cocos/2d/CCTileMapAtlas.h +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** -Copyright (c) 2008-2010 Ricardo Quesada -Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2011 Zynga Inc. -Copyright (c) 2013-2016 Chukong Technologies Inc. -Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ -#ifndef __CCTILE_MAP_ATLAS__ -#define __CCTILE_MAP_ATLAS__ - -#include "2d/CCAtlasNode.h" -#include "base/CCValue.h" - -NS_CC_BEGIN - -/// @cond DO_NOT_SHOW - -struct sImageTGA; - -/** @brief TileMapAtlas is a subclass of AtlasNode. - -It knows how to render a map based of tiles. -The tiles must be in a .PNG format while the map must be a .TGA file. - -For more information regarding the format, please see this post: -http://www.cocos2d-iphone.org/archives/27 - -All features from AtlasNode are valid in TileMapAtlas - -IMPORTANT: -This class is deprecated. It is maintained for compatibility reasons only. -You SHOULD not use this class. -Instead, use the newer TMX file format: TMXTiledMap -@js NA -*/ -class CC_DLL TileMapAtlas : public AtlasNode -{ -public: - /** creates a TileMap with a tile file (atlas) with a map file and the width and height of each tile in points. - The tile file will be loaded using the TextureMgr. - */ - static TileMapAtlas * create(const std::string& tile, const std::string& mapFile, int tileWidth, int tileHeight); - /** - * @js ctor - */ - TileMapAtlas(); - /** - * @js NA - * @lua NA - */ - virtual ~TileMapAtlas(); - - /** initializes a TileMap with a tile file (atlas) with a map file and the width and height of each tile in points. - The file will be loaded using the TextureMgr. - */ - bool initWithTileFile(const std::string& tile, const std::string& mapFile, int tileWidth, int tileHeight); - /** - * Returns a tile from position x,y. - *For the moment only channel R is used - */ - Color3B getTileAt(const Vec2& position) const; - - /** sets a tile at position x,y. - For the moment only channel R is used - */ - void setTile(const Color3B& tile, const Vec2& position); - /** dealloc the map from memory */ - void releaseMap(); - - /** - * Query TGA image info. - *@return The TGA image info. - */ - struct sImageTGA* getTGAInfo() const { return _TGAInfo; } - - /** - * Set the TGA image info for TileMapAtlas - *@param TGAInfo The TGA info in sImageTGA. - */ - void setTGAInfo(struct sImageTGA* TGAInfo) { _TGAInfo = TGAInfo; } - -protected: - void loadTGAfile(const std::string& file); - void calculateItemsToRender(); - void updateAtlasValueAt(const Vec2& pos, const Color3B& value, int index); - void updateAtlasValues(); - - - //! x,y to atlas dictionary - ValueMap _posToAtlasIndex; - //! numbers of tiles to render - int _itemsToRender; - /** TileMap info */ - struct sImageTGA* _TGAInfo; -}; - -/// @endcond - -NS_CC_END - -#endif //__CCTILE_MAP_ATLAS__ - diff --git a/cocos/2d/CMakeLists.txt b/cocos/2d/CMakeLists.txt index 11395a9..f7f8c08 100644 --- a/cocos/2d/CMakeLists.txt +++ b/cocos/2d/CMakeLists.txt @@ -34,13 +34,11 @@ set(COCOS_2D_HEADER 2d/CCProtectedNode.h 2d/CCTextFieldTTF.h 2d/CCAnimationCache.h - 2d/CCFastTMXLayer.h 2d/CCFontAtlasCache.h 2d/CCFont.h 2d/CCParticleSystemQuad.h 2d/CCActionGrid3D.h 2d/CCCameraBackgroundBrush.h - 2d/CCFastTMXTiledMap.h 2d/CCLabelTextFormatter.h 2d/CCFontFNT.h 2d/CCSpriteBatchNode.h @@ -56,7 +54,6 @@ set(COCOS_2D_HEADER 2d/CCFontCharMap.h 2d/CCParticleSystem.h 2d/CCProgressTimer.h - 2d/CCTileMapAtlas.h 2d/CCActionTiledGrid.h 2d/CCActionManager.h 2d/CCMotionStreak.h @@ -91,8 +88,6 @@ set(COCOS_2D_SRC 2d/CCComponentContainer.cpp 2d/CCComponent.cpp 2d/CCDrawNode.cpp - 2d/CCFastTMXLayer.cpp - 2d/CCFastTMXTiledMap.cpp 2d/CCFontAtlasCache.cpp 2d/CCFontAtlas.cpp 2d/CCFontCharMap.cpp @@ -123,7 +118,6 @@ set(COCOS_2D_SRC 2d/CCSpriteFrame.cpp 2d/CCAutoPolygon.cpp 2d/CCTextFieldTTF.cpp - 2d/CCTileMapAtlas.cpp 2d/CCTMXLayer.cpp 2d/CCTMXObjectGroup.cpp 2d/CCTMXTiledMap.cpp diff --git a/cocos/3d/Android.mk b/cocos/3d/Android.mk deleted file mode 100644 index 09e419d..0000000 --- a/cocos/3d/Android.mk +++ /dev/null @@ -1,36 +0,0 @@ -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE := cc3d -LOCAL_ARM_MODE := arm - -LOCAL_MODULE_FILENAME := libc3d - -LOCAL_SRC_FILES := \ -CCRay.cpp \ -CCAABB.cpp \ -CCOBB.cpp \ -CCAnimate3D.cpp \ -CCAnimation3D.cpp \ -CCAttachNode.cpp \ -CCBillBoard.cpp \ -CCBundle3D.cpp \ -CCBundleReader.cpp \ -CCMesh.cpp \ -CCMeshSkin.cpp \ -CCMeshVertexIndexData.cpp \ -CCMotionStreak3D.cpp \ -CCSprite3DMaterial.cpp \ -CCObjLoader.cpp \ -CCSkeleton3D.cpp \ -CCSprite3D.cpp \ -CCTerrain.cpp \ -CCSkybox.cpp - -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. - -LOCAL_STATIC_LIBRARIES := cc_core - -include $(BUILD_STATIC_LIBRARY) diff --git a/cocos/cocos2d.h b/cocos/cocos2d.h index e4e9718..c156d6d 100644 --- a/cocos/cocos2d.h +++ b/cocos/cocos2d.h @@ -238,9 +238,6 @@ THE SOFTWARE. #include "2d/CCTMXObjectGroup.h" #include "2d/CCTMXTiledMap.h" #include "2d/CCTMXXMLParser.h" -#include "2d/CCTileMapAtlas.h" -#include "2d/CCFastTMXLayer.h" -#include "2d/CCFastTMXTiledMap.h" // component #include "2d/CCComponent.h" diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.h b/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.h index 5b2de96..bf555fa 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.h +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.h @@ -322,10 +322,6 @@ public: virtual void onEnter(Frame *nextFrame, int currentFrameIndex) override; virtual Frame* clone() override; - /** @deprecated Use method setAlpha() and getAlpha() of AlphaFrame instead */ - CC_DEPRECATED_ATTRIBUTE inline void setAlpha(uint8_t alpha) { _alpha = alpha; } - CC_DEPRECATED_ATTRIBUTE inline uint8_t getAlpha() const { return _alpha; } - inline void setColor(const cocos2d::Color3B& color) { _color = color; } inline cocos2d::Color3B getColor() const { return _color; } diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp index 12af2ef..cd4be99 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp @@ -232,10 +232,6 @@ CSLoader::CSLoader() CREATE_CLASS_NODE_READER_INFO(SkeletonNodeReader); } -void CSLoader::purge() -{ -} - void CSLoader::init() { using namespace std::placeholders; diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.h b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.h index 14371cb..55c23cb 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.h +++ b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.h @@ -75,8 +75,6 @@ public: static void destroyInstance(); CSLoader(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE void purge(); void init(); diff --git a/cocos/editor-support/cocostudio/CCArmature.cpp b/cocos/editor-support/cocostudio/CCArmature.cpp index 48f49bc..31f4983 100644 --- a/cocos/editor-support/cocostudio/CCArmature.cpp +++ b/cocos/editor-support/cocostudio/CCArmature.cpp @@ -588,52 +588,6 @@ void Armature::setColliderFilter(ColliderFilter *filter) element.second->setColliderFilter(filter); } } -#elif ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX - -void Armature::drawContour() -{ - for(auto& element : _boneDic) - { - Bone *bone = element.second; - ColliderDetector *detector = bone->getColliderDetector(); - - if (!detector) - continue; - - const cocos2d::Vector& bodyList = detector->getColliderBodyList(); - - for (auto& object : bodyList) - { - ColliderBody *body = static_cast(object); - const std::vector &vertexList = body->getCalculatedVertexList(); - - unsigned long length = vertexList.size(); - Vec2 *points = new (std::nothrow) Vec2[length]; - for (unsigned long i = 0; i= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#elif _MSC_VER >= 1400 //vs 2005 or higher -#pragma warning (push) -#pragma warning (disable: 4996) -#endif - cocos2d::log("TODO in %s %s %d", __FILE__, __FUNCTION__, __LINE__); - -#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) -#pragma GCC diagnostic warning "-Wdeprecated-declarations" -#elif _MSC_VER >= 1400 //vs 2005 or higher -#pragma warning (pop) -#endif - - delete []points; - } - } -} #endif diff --git a/cocos/editor-support/cocostudio/CCArmature.h b/cocos/editor-support/cocostudio/CCArmature.h index 5205474..d0197e2 100644 --- a/cocos/editor-support/cocostudio/CCArmature.h +++ b/cocos/editor-support/cocostudio/CCArmature.h @@ -40,35 +40,6 @@ struct cpBody; namespace cocostudio { -CC_DEPRECATED_ATTRIBUTE typedef ProcessBase CCProcessBase; -CC_DEPRECATED_ATTRIBUTE typedef BaseData CCBaseData; -CC_DEPRECATED_ATTRIBUTE typedef DisplayData CCDisplayData; -CC_DEPRECATED_ATTRIBUTE typedef SpriteDisplayData CCSpriteDisplayData; -CC_DEPRECATED_ATTRIBUTE typedef ArmatureDisplayData CCArmatureDisplayData; -CC_DEPRECATED_ATTRIBUTE typedef ParticleDisplayData CCParticleDisplayData; -CC_DEPRECATED_ATTRIBUTE typedef BoneData CCBoneData; -CC_DEPRECATED_ATTRIBUTE typedef FrameData CCFrameData; -CC_DEPRECATED_ATTRIBUTE typedef MovementBoneData CCMovementBoneData; -CC_DEPRECATED_ATTRIBUTE typedef MovementData CCMovementData; -CC_DEPRECATED_ATTRIBUTE typedef AnimationData CCAnimationData; -CC_DEPRECATED_ATTRIBUTE typedef ContourData CCContourData; -CC_DEPRECATED_ATTRIBUTE typedef TextureData CCTextureData; -CC_DEPRECATED_ATTRIBUTE typedef DecorativeDisplay CCDecorativeDisplay; -CC_DEPRECATED_ATTRIBUTE typedef DisplayData CCDisplayData; -CC_DEPRECATED_ATTRIBUTE typedef DisplayFactory CCDisplayFactory; -CC_DEPRECATED_ATTRIBUTE typedef BatchNode CCBatchNode; -CC_DEPRECATED_ATTRIBUTE typedef DecorativeDisplay CCDecorativeDisplay; -CC_DEPRECATED_ATTRIBUTE typedef DisplayManager CCDisplayManager; -CC_DEPRECATED_ATTRIBUTE typedef ColliderBody CCColliderBody; -CC_DEPRECATED_ATTRIBUTE typedef ColliderDetector CCColliderDetector; -CC_DEPRECATED_ATTRIBUTE typedef SpriteFrameCacheHelper CCSpriteFrameCacheHelper; -CC_DEPRECATED_ATTRIBUTE typedef ArmatureData CCArmatureData; -CC_DEPRECATED_ATTRIBUTE typedef Bone CCBone; -CC_DEPRECATED_ATTRIBUTE typedef ArmatureAnimation CCArmatureAnimation; -CC_DEPRECATED_ATTRIBUTE typedef Armature CCArmature; -CC_DEPRECATED_ATTRIBUTE typedef ArmatureDataManager CCArmatureDataManager; -CC_DEPRECATED_ATTRIBUTE typedef cocos2d::tweenfunc::TweenType CCTweenType; - class CC_STUDIO_DLL Armature : public cocos2d::Node, public cocos2d::BlendProtocol { @@ -195,8 +166,6 @@ public: #if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT virtual void setColliderFilter(ColliderFilter *filter); -#elif ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX - CC_DEPRECATED_ATTRIBUTE virtual void drawContour(); #endif diff --git a/cocos/editor-support/cocostudio/CCArmatureAnimation.cpp b/cocos/editor-support/cocostudio/CCArmatureAnimation.cpp index 9f3487e..4627254 100644 --- a/cocos/editor-support/cocostudio/CCArmatureAnimation.cpp +++ b/cocos/editor-support/cocostudio/CCArmatureAnimation.cpp @@ -124,17 +124,6 @@ void ArmatureAnimation::stop() ProcessBase::stop(); } -void ArmatureAnimation::setAnimationScale(float animationScale ) -{ - setSpeedScale(animationScale); -} - -float ArmatureAnimation::getAnimationScale() const -{ - return getSpeedScale(); -} - - void ArmatureAnimation::setSpeedScale(float speedScale) { if(speedScale == _speedScale) @@ -257,11 +246,6 @@ void ArmatureAnimation::play(const std::string& animationName, int durationTo, _armature->update(0); } -void ArmatureAnimation::playByIndex(int animationIndex, int durationTo, int loop) -{ - playWithIndex(animationIndex, durationTo, loop); -} - void ArmatureAnimation::playWithIndex(int animationIndex, int durationTo, int loop) { std::vector &movName = _animationData->movementNames; @@ -470,22 +454,11 @@ std::string ArmatureAnimation::getCurrentMovementID() const return _movementID; } -void ArmatureAnimation::setMovementEventCallFunc(Ref *target, SEL_MovementEventCallFunc callFunc) -{ - _movementEventTarget = target; - _movementEventCallFunc = callFunc; -} - -void ArmatureAnimation::setFrameEventCallFunc(Ref *target, SEL_FrameEventCallFunc callFunc) -{ - _frameEventTarget = target; - _frameEventCallFunc = callFunc; -} - void ArmatureAnimation::setMovementEventCallFunc(std::function listener) { _movementEventListener = listener; } + void ArmatureAnimation::setFrameEventCallFunc(std::function listener) { _frameEventListener = listener; diff --git a/cocos/editor-support/cocostudio/CCArmatureAnimation.h b/cocos/editor-support/cocostudio/CCArmatureAnimation.h index 43de286..ae5ce54 100644 --- a/cocos/editor-support/cocostudio/CCArmatureAnimation.h +++ b/cocos/editor-support/cocostudio/CCArmatureAnimation.h @@ -92,14 +92,6 @@ public: */ virtual bool init(Armature *armature); - /** - * Scale animation play speed. - * This method is deprecated, please use setSpeedScale. - * @param animationScale Scale value - */ - CC_DEPRECATED_ATTRIBUTE virtual void setAnimationScale(float animationScale); - CC_DEPRECATED_ATTRIBUTE virtual float getAnimationScale() const; - /** * Scale animation play speed. * @param animationScale Scale value @@ -107,9 +99,6 @@ public: virtual void setSpeedScale(float speedScale); virtual float getSpeedScale() const; - //! The animation update speed - CC_DEPRECATED_ATTRIBUTE virtual void setAnimationInternal(float animationInternal) {} - using ProcessBase::play; /** * Play animation by animation name. @@ -127,12 +116,6 @@ public: */ virtual void play(const std::string& animationName, int durationTo = -1, int loop = -1); - /** - * Play animation by index, the other param is the same to play. - * @deprecated, please use playWithIndex - * @param animationIndex the animation index you want to play - */ - CC_DEPRECATED_ATTRIBUTE virtual void playByIndex(int animationIndex, int durationTo = -1, int loop = -1); virtual void playWithIndex(int animationIndex, int durationTo = -1, int loop = -1); virtual void playWithNames(const std::vector& movementNames, int durationTo = -1, bool loop = true); @@ -181,18 +164,6 @@ public: * @return The name of current movement */ std::string getCurrentMovementID() const; - - /** - * Set armature's movement event callback function - * To disconnect this event, just setMovementEventCallFunc(nullptr, nullptr); - */ - CC_DEPRECATED_ATTRIBUTE void setMovementEventCallFunc(cocos2d::Ref *target, SEL_MovementEventCallFunc callFunc); - - /** - * Set armature's frame event callback function - * To disconnect this event, just setFrameEventCallFunc(nullptr, nullptr); - */ - CC_DEPRECATED_ATTRIBUTE void setFrameEventCallFunc(cocos2d::Ref *target, SEL_FrameEventCallFunc callFunc); void setMovementEventCallFunc(std::function listener); void setFrameEventCallFunc(std::function listener); diff --git a/cocos/editor-support/cocostudio/CCArmatureDataManager.h b/cocos/editor-support/cocostudio/CCArmatureDataManager.h index 577202a..ad5d01d 100644 --- a/cocos/editor-support/cocostudio/CCArmatureDataManager.h +++ b/cocos/editor-support/cocostudio/CCArmatureDataManager.h @@ -45,13 +45,7 @@ struct RelativeData */ class CC_STUDIO_DLL ArmatureDataManager : public cocos2d::Ref { -public: - /** @deprecated Use getInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static ArmatureDataManager *sharedArmatureDataManager() { return ArmatureDataManager::getInstance(); } - - /** @deprecated Use destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge() { ArmatureDataManager::destroyInstance(); }; - +public: static ArmatureDataManager *getInstance(); static void destroyInstance(); diff --git a/cocos/editor-support/cocostudio/CCBone.cpp b/cocos/editor-support/cocostudio/CCBone.cpp index 6064ba0..1c3af05 100644 --- a/cocos/editor-support/cocostudio/CCBone.cpp +++ b/cocos/editor-support/cocostudio/CCBone.cpp @@ -418,16 +418,6 @@ void Bone::removeDisplay(int index) _displayManager->removeDisplay(index); } -void Bone::changeDisplayByIndex(int index, bool force) -{ - changeDisplayWithIndex(index, force); -} - -void Bone::changeDisplayByName(const std::string &name, bool force) -{ - changeDisplayWithName(name, force); -} - void Bone::changeDisplayWithIndex(int index, bool force) { _displayManager->changeDisplayWithIndex(index, force); diff --git a/cocos/editor-support/cocostudio/CCBone.h b/cocos/editor-support/cocostudio/CCBone.h index 0d1116a..063e057 100644 --- a/cocos/editor-support/cocostudio/CCBone.h +++ b/cocos/editor-support/cocostudio/CCBone.h @@ -94,9 +94,6 @@ public: void removeDisplay(int index); - CC_DEPRECATED_ATTRIBUTE void changeDisplayByIndex(int index, bool force); - CC_DEPRECATED_ATTRIBUTE void changeDisplayByName(const std::string& name, bool force); - void changeDisplayWithIndex(int index, bool force); void changeDisplayWithName(const std::string& name, bool force); @@ -188,13 +185,6 @@ public: virtual void setIgnoreMovementBoneData(bool ignore) { _ignoreMovementBoneData = ignore; } virtual bool isIgnoreMovementBoneData() const { return _ignoreMovementBoneData; } - /* - * This function is deprecated, please use isIgnoreMovementBoneData() - * @lua NA - */ - CC_DEPRECATED_ATTRIBUTE virtual bool getIgnoreMovementBoneData() const { return isIgnoreMovementBoneData(); } - - /* * Set blend function */ diff --git a/cocos/editor-support/cocostudio/CCDataReaderHelper.h b/cocos/editor-support/cocostudio/CCDataReaderHelper.h index 5817976..1e18164 100644 --- a/cocos/editor-support/cocostudio/CCDataReaderHelper.h +++ b/cocos/editor-support/cocostudio/CCDataReaderHelper.h @@ -89,10 +89,6 @@ protected: } DataInfo; public: - - /** @deprecated Use getInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static DataReaderHelper *sharedDataReaderHelper() { return DataReaderHelper::getInstance(); } - static DataReaderHelper *getInstance(); /** diff --git a/cocos/editor-support/cocostudio/CCDisplayManager.h b/cocos/editor-support/cocostudio/CCDisplayManager.h index 08f3c52..815f9d2 100644 --- a/cocos/editor-support/cocostudio/CCDisplayManager.h +++ b/cocos/editor-support/cocostudio/CCDisplayManager.h @@ -75,12 +75,6 @@ public: void removeDisplay(int index); const cocos2d::Vector& getDecorativeDisplayList() const; - - /* - * @deprecated, please use changeDisplayWithIndex and changeDisplayWithName - */ - CC_DEPRECATED_ATTRIBUTE void changeDisplayByIndex(int index, bool force); - CC_DEPRECATED_ATTRIBUTE void changeDisplayByName(const std::string& name, bool force); /** * Change display by index. You can just use this method to change display in the display list. diff --git a/cocos/editor-support/cocostudio/CCInputDelegate.cpp b/cocos/editor-support/cocostudio/CCInputDelegate.cpp index a0907d4..0ccbbf1 100644 --- a/cocos/editor-support/cocostudio/CCInputDelegate.cpp +++ b/cocos/editor-support/cocostudio/CCInputDelegate.cpp @@ -56,35 +56,6 @@ InputDelegate::~InputDelegate() dispatcher->removeEventListener(_accelerometerListener); Device::setAccelerometerEnabled(false); } - -void InputDelegate::didAccelerate(cocos2d::Acceleration* /*accelerationValue*/) -{} - -bool InputDelegate::ccTouchBegan(cocos2d::Touch* /*touch*/, cocos2d::Event* /*event*/) -{ - return false; -} - -void InputDelegate::ccTouchMoved(cocos2d::Touch* /*touch*/, cocos2d::Event* /*event*/) -{} - -void InputDelegate::ccTouchEnded(cocos2d::Touch* /*touch*/, cocos2d::Event* /*event*/) -{} - -void InputDelegate::ccTouchCancelled(cocos2d::Touch* /*touch*/, cocos2d::Event* /*event*/) -{} - -void InputDelegate::ccTouchesBegan(cocos2d::__Set* /*touches*/, cocos2d::Event* /*event*/) -{} - -void InputDelegate::ccTouchesMoved(cocos2d::__Set* /*touches*/, cocos2d::Event* /*event*/) -{} - -void InputDelegate::ccTouchesEnded(cocos2d::__Set* /*touches*/, cocos2d::Event* /*event*/) -{} - -void InputDelegate::ccTouchesCancelled(cocos2d::__Set* /*touches*/, cocos2d::Event* /*event*/) -{} void InputDelegate::onAcceleration(cocos2d::Acceleration* /*acc*/, cocos2d::Event* /*event*/) {} diff --git a/cocos/editor-support/cocostudio/CCInputDelegate.h b/cocos/editor-support/cocostudio/CCInputDelegate.h index c95ad35..4b56738 100644 --- a/cocos/editor-support/cocostudio/CCInputDelegate.h +++ b/cocos/editor-support/cocostudio/CCInputDelegate.h @@ -66,44 +66,6 @@ public: virtual cocos2d::Touch::DispatchMode getTouchMode() const; virtual void setTouchPriority(int priority); virtual int getTouchPriority() const; - /** @deprecated Please override onAcceleration */ - /** - * @js NA - */ - CC_DEPRECATED_ATTRIBUTE virtual void didAccelerate(cocos2d::Acceleration* accelerationValue) final; - // Deprecated touch callbacks. - /** - * @js NA - */ - CC_DEPRECATED_ATTRIBUTE virtual bool ccTouchBegan(cocos2d::Touch* touch, cocos2d::Event* event) final; - /** - * @js NA - */ - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchMoved(cocos2d::Touch* touch, cocos2d::Event* event) final; - /** - * @js NA - */ - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchEnded(cocos2d::Touch* touch, cocos2d::Event* event) final; - /** - * @js NA - */ - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchCancelled(cocos2d::Touch* touch, cocos2d::Event* event) final; - /** - * @js NA - */ - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesBegan(cocos2d::__Set* touches, cocos2d::Event* event) final; - /** - * @js NA - */ - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesMoved(cocos2d::__Set* touches, cocos2d::Event* event) final; - /** - * @js NA - */ - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesEnded(cocos2d::__Set* touches, cocos2d::Event* event) final; - /** - * @js NA - */ - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesCancelled(cocos2d::__Set* touches, cocos2d::Event* event) final; /** * @js NA */ diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.h b/cocos/editor-support/cocostudio/CCSGUIReader.h index 8c64dc0..c0362ab 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.h +++ b/cocos/editor-support/cocostudio/CCSGUIReader.h @@ -57,8 +57,6 @@ namespace cocostudio { class CC_STUDIO_DLL GUIReader : public cocos2d::Ref { public: - CC_DEPRECATED_ATTRIBUTE static GUIReader* shareReader() { return GUIReader::getInstance(); }; - CC_DEPRECATED_ATTRIBUTE static void purgeGUIReader() { GUIReader::destroyInstance(); }; static GUIReader* getInstance(); static void destroyInstance(); diff --git a/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h b/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h index 8da755e..6944d32 100644 --- a/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h +++ b/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h @@ -45,9 +45,6 @@ namespace cocostudio { class CC_STUDIO_DLL SpriteFrameCacheHelper { public: - /** @deprecated Use getInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static SpriteFrameCacheHelper *sharedSpriteFrameCacheHelper(){ return SpriteFrameCacheHelper::getInstance(); } - static SpriteFrameCacheHelper *getInstance(); static void purge(); diff --git a/cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp b/cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp index 375cfe5..09d2b23 100644 --- a/cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp +++ b/cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp @@ -128,17 +128,10 @@ FlatBuffersSerialize* FlatBuffersSerialize::getInstance() return _instanceFlatBuffersSerialize; } - -void FlatBuffersSerialize::purge() -{ - CC_SAFE_DELETE(_instanceFlatBuffersSerialize); - -} void FlatBuffersSerialize::destroyInstance() { CC_SAFE_DELETE(_instanceFlatBuffersSerialize); - } void FlatBuffersSerialize::deleteFlatBufferBuilder() diff --git a/cocos/editor-support/cocostudio/FlatBuffersSerialize.h b/cocos/editor-support/cocostudio/FlatBuffersSerialize.h index 994eaa2..183e233 100644 --- a/cocos/editor-support/cocostudio/FlatBuffersSerialize.h +++ b/cocos/editor-support/cocostudio/FlatBuffersSerialize.h @@ -29,7 +29,6 @@ #include #include -#include "ExtensionMacros.h" #include "editor-support/cocostudio/CocosStudioExport.h" #include "platform/CCPlatformMacros.h" #include "ui/UIWidget.h" @@ -98,8 +97,6 @@ class CC_STUDIO_DLL FlatBuffersSerialize public: static FlatBuffersSerialize* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); FlatBuffersSerialize(); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h b/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h index d35838c..aeba312 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h @@ -49,8 +49,6 @@ public: ~ArmatureNodeReader(); static ArmatureNodeReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp index 88430fe..03f0ea4 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp @@ -87,11 +87,6 @@ namespace cocostudio return instanceButtonReader; } - void ButtonReader::purge() - { - CC_SAFE_DELETE(instanceButtonReader); - } - void ButtonReader::destroyInstance() { CC_SAFE_DELETE(instanceButtonReader); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.h b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.h index 231d811..e9ceae0 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.h @@ -40,8 +40,6 @@ namespace cocostudio virtual ~ButtonReader(); static ButtonReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, diff --git a/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h b/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h index d1a3ccd..6225fb4 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h @@ -40,8 +40,6 @@ namespace cocostudio virtual ~CheckBoxReader(); static CheckBoxReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp index e2cb34f..ad16c68 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp @@ -59,11 +59,6 @@ namespace cocostudio return _instanceComAudioReader; } - void ComAudioReader::purge() - { - CC_SAFE_DELETE(_instanceComAudioReader); - } - void ComAudioReader::destroyInstance() { CC_SAFE_DELETE(_instanceComAudioReader); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h b/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h index b89d7dd..e55c58e 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h @@ -43,8 +43,6 @@ namespace cocostudio ~ComAudioReader(); static ComAudioReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/GameMapReader/GameMapReader.h b/cocos/editor-support/cocostudio/WidgetReader/GameMapReader/GameMapReader.h index e41eab7..f531f93 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/GameMapReader/GameMapReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/GameMapReader/GameMapReader.h @@ -42,8 +42,6 @@ namespace cocostudio ~GameMapReader(); static GameMapReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.cpp index 8507303..140d30a 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.cpp @@ -71,11 +71,6 @@ namespace cocostudio return _sceneBrushInstance; } - void GameNode3DReader::purge() - { - CC_SAFE_DELETE(_instanceNode3DReader); - } - void GameNode3DReader::destroyInstance() { CC_SAFE_DELETE(_instanceNode3DReader); diff --git a/cocos/editor-support/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.h b/cocos/editor-support/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.h index 1349b88..fc99868 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/GameNode3DReader/GameNode3DReader.h @@ -48,8 +48,6 @@ namespace cocostudio static GameNode3DReader* getInstance(); static cocos2d::CameraBackgroundBrush* getSceneBrushInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h b/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h index 1af986c..d36fd51 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h @@ -42,8 +42,6 @@ namespace cocostudio virtual ~ImageViewReader(); static ImageViewReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.h b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.h index 8c62f46..56616d9 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.h @@ -41,8 +41,6 @@ namespace cocostudio virtual ~LayoutReader(); static LayoutReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/Light3DReader/Light3DReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/Light3DReader/Light3DReader.cpp index e094fb4..30cbc5d 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Light3DReader/Light3DReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/Light3DReader/Light3DReader.cpp @@ -64,11 +64,6 @@ namespace cocostudio return _instanceLight3DReader; } - void Light3DReader::purge() - { - CC_SAFE_DELETE(_instanceLight3DReader); - } - void Light3DReader::destroyInstance() { CC_SAFE_DELETE(_instanceLight3DReader); diff --git a/cocos/editor-support/cocostudio/WidgetReader/Light3DReader/Light3DReader.h b/cocos/editor-support/cocostudio/WidgetReader/Light3DReader/Light3DReader.h index 97df32e..ff987e6 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Light3DReader/Light3DReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/Light3DReader/Light3DReader.h @@ -46,8 +46,6 @@ namespace cocostudio ~Light3DReader(); static Light3DReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.h b/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.h index 24b6f76..c746f37 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.h @@ -40,8 +40,6 @@ namespace cocostudio virtual ~ListViewReader(); static ListViewReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h b/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h index dcb7ec2..8bdf83a 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h @@ -40,8 +40,6 @@ namespace cocostudio virtual ~LoadingBarReader(); static LoadingBarReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp index 2f0d4c2..387b0b7 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp @@ -63,11 +63,6 @@ namespace cocostudio return _instanceNode3DReader; } - void Node3DReader::purge() - { - CC_SAFE_DELETE(_instanceNode3DReader); - } - void Node3DReader::destroyInstance() { CC_SAFE_DELETE(_instanceNode3DReader); diff --git a/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.h b/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.h index 4c6fe85..88086a6 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.h @@ -47,8 +47,6 @@ namespace cocostudio ~Node3DReader(); static Node3DReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.h b/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.h index 3444517..2bd5ff5 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.h @@ -42,8 +42,6 @@ namespace cocostudio ~NodeReader(); static NodeReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.h b/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.h index 069c8f2..beef687 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.h @@ -40,8 +40,6 @@ namespace cocostudio virtual ~PageViewReader(); static PageViewReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp index 30afbad..082ca68 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp @@ -65,11 +65,6 @@ namespace cocostudio return _instanceParticle3DReader; } - void Particle3DReader::purge() - { - CC_SAFE_DELETE(_instanceParticle3DReader); - } - void Particle3DReader::destroyInstance() { CC_SAFE_DELETE(_instanceParticle3DReader); diff --git a/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h b/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h index 68e3069..9cdf288 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h @@ -41,8 +41,6 @@ namespace cocostudio ~Particle3DReader(); static Particle3DReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp index 47c25aa..ae848d5 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp @@ -64,11 +64,6 @@ namespace cocostudio return _instanceParticleReader; } - void ParticleReader::purge() - { - CC_SAFE_DELETE(_instanceParticleReader); - } - void ParticleReader::destroyInstance() { CC_SAFE_DELETE(_instanceParticleReader); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.h b/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.h index f2426a6..a686d55 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.h @@ -42,8 +42,6 @@ namespace cocostudio ~ParticleReader(); static ParticleReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp index f78241b..fbc4956 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp @@ -58,11 +58,6 @@ namespace cocostudio return _instanceProjectNodeReader; } - void ProjectNodeReader::purge() - { - CC_SAFE_DELETE(_instanceProjectNodeReader); - } - void ProjectNodeReader::destroyInstance() { CC_SAFE_DELETE(_instanceProjectNodeReader); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h b/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h index 89b5339..36b15a2 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h @@ -41,8 +41,6 @@ namespace cocostudio ~ProjectNodeReader(); static ProjectNodeReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h b/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h index 26cdf4e..5e27c77 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h @@ -40,8 +40,6 @@ namespace cocostudio virtual ~ScrollViewReader(); static ScrollViewReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp index 7ca462e..a1379f4 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp @@ -63,11 +63,6 @@ namespace cocostudio return _instanceSingleNodeReader; } - void SingleNodeReader::purge() - { - CC_SAFE_DELETE(_instanceSingleNodeReader); - } - void SingleNodeReader::destroyInstance() { CC_SAFE_DELETE(_instanceSingleNodeReader); diff --git a/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h b/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h index 7933bd5..ffb59bd 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h @@ -42,8 +42,6 @@ namespace cocostudio ~SingleNodeReader(); static SingleNodeReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.h b/cocos/editor-support/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.h index 906e169..a8545f0 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/SkeletonReader/BoneNodeReader.h @@ -39,8 +39,6 @@ public: ~BoneNodeReader(); static BoneNodeReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.h b/cocos/editor-support/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.h index f5a1819..f3f6215 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/SkeletonReader/SkeletonNodeReader.h @@ -38,10 +38,8 @@ public: ~SkeletonNodeReader(); static SkeletonNodeReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); cocos2d::Node* createNodeWithFlatBuffers(const flatbuffers::Table* boneOptions) override; }; -#endif //_SKELETONNODEREADER_H_ \ No newline at end of file +#endif //_SKELETONNODEREADER_H_ diff --git a/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.h b/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.h index f8bf585..6f067e5 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.h @@ -40,8 +40,6 @@ namespace cocostudio virtual ~SliderReader(); static SliderReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.cpp index 2d34e86..0dc011a 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.cpp @@ -68,11 +68,6 @@ namespace cocostudio return _instanceSprite3DReader; } - void Sprite3DReader::purge() - { - CC_SAFE_DELETE(_instanceSprite3DReader); - } - void Sprite3DReader::destroyInstance() { CC_SAFE_DELETE(_instanceSprite3DReader); diff --git a/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.h b/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.h index 3c68a4a..8db649f 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.h @@ -47,8 +47,6 @@ namespace cocostudio ~Sprite3DReader(); static Sprite3DReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp index ea0841e..ec8937a 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp @@ -67,11 +67,6 @@ namespace cocostudio return _instanceSpriteReader; } - void SpriteReader::purge() - { - CC_SAFE_DELETE(_instanceSpriteReader); - } - void SpriteReader::destroyInstance() { CC_SAFE_DELETE(_instanceSpriteReader); diff --git a/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.h b/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.h index 8d8e966..54938f6 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.h @@ -42,8 +42,6 @@ namespace cocostudio ~SpriteReader(); static SpriteReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h b/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h index f61c2ae..c11f668 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h @@ -40,8 +40,6 @@ namespace cocostudio virtual ~TextAtlasReader(); static TextAtlasReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h b/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h index d10581f..f7b1c3b 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h @@ -40,8 +40,6 @@ namespace cocostudio virtual ~TextBMFontReader(); static TextBMFontReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h b/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h index 57b04a2..6e51447 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h @@ -40,8 +40,6 @@ namespace cocostudio virtual ~TextFieldReader(); static TextFieldReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.h b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.h index 91da9f0..066eae3 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.h @@ -40,8 +40,6 @@ namespace cocostudio virtual ~TextReader(); static TextReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp index aee7c9d..ac70e8b 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp @@ -66,11 +66,6 @@ namespace cocostudio return _instanceUserCameraReader; } - void UserCameraReader::purge() - { - CC_SAFE_DELETE(_instanceUserCameraReader); - } - void UserCameraReader::destroyInstance() { CC_SAFE_DELETE(_instanceUserCameraReader); diff --git a/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h b/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h index 5e82f5c..e01f071 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h @@ -47,8 +47,6 @@ namespace cocostudio ~UserCameraReader(); static UserCameraReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, diff --git a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp index c018cbf..bc43e28 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp @@ -160,11 +160,6 @@ namespace cocostudio return instanceWidgetReader; } - void WidgetReader::purge() - { - CC_SAFE_DELETE(instanceWidgetReader); - } - void WidgetReader::destroyInstance() { CC_SAFE_DELETE(instanceWidgetReader); diff --git a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h index 5702682..5aee2d8 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h @@ -47,8 +47,6 @@ namespace cocostudio virtual ~WidgetReader(); static WidgetReader* getInstance(); - /** @deprecated Use method destroyInstance() instead */ - CC_DEPRECATED_ATTRIBUTE static void purge(); static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, diff --git a/cocos/editor-support/spine/Android.mk b/cocos/editor-support/spine/Android.mk deleted file mode 100644 index 5ab8ea3..0000000 --- a/cocos/editor-support/spine/Android.mk +++ /dev/null @@ -1,67 +0,0 @@ - - - -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE := spine - -LOCAL_MODULE_FILENAME := libspine - -LOCAL_ARM_MODE := arm - -LOCAL_SRC_FILES := \ -Animation.c \ -AnimationState.c \ -AnimationStateData.c \ -Array.c \ -Atlas.c \ -AtlasAttachmentLoader.c \ -Attachment.c \ -AttachmentLoader.c \ -AttachmentVertices.cpp \ -Bone.c \ -BoneData.c \ -BoundingBoxAttachment.c \ -ClippingAttachment.c \ -Cocos2dAttachmentLoader.cpp \ -Color.c \ -Event.c \ -EventData.c \ -IkConstraint.c \ -IkConstraintData.c \ -Json.c \ -MeshAttachment.c \ -PathAttachment.c \ -PathConstraint.c \ -PathConstraintData.c \ -PointAttachment.c \ -RegionAttachment.c \ -Skeleton.c \ -SkeletonAnimation.cpp \ -SkeletonBatch.cpp \ -SkeletonBinary.c \ -SkeletonBounds.c \ -SkeletonClipping.c \ -SkeletonData.c \ -SkeletonJson.c \ -SkeletonRenderer.cpp \ -SkeletonTwoColorBatch.cpp \ -Skin.c \ -Slot.c \ -SlotData.c \ -TransformConstraint.c \ -TransformConstraintData.c \ -Triangulator.c \ -VertexAttachment.c \ -VertexEffect.c \ -extension.c \ -spine-cocos2dx.cpp - -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. - -LOCAL_STATIC_LIBRARIES := cc_core - -include $(BUILD_STATIC_LIBRARY) diff --git a/cocos/scripting/lua-bindings/CMakeLists.txt b/cocos/scripting/lua-bindings/CMakeLists.txt index 017df1e..a2a128c 100644 --- a/cocos/scripting/lua-bindings/CMakeLists.txt +++ b/cocos/scripting/lua-bindings/CMakeLists.txt @@ -144,12 +144,10 @@ endif() set(lua_bindings_files ${lua_bindings_manual_files} ${lua_bindings_auto_files} - ${COCOS_DEPRECATED_SRC} ) set(lua_bindings_headers ${lua_bindings_manual_headers} ${lua_bindings_auto_headers} - ${COCOS_DEPRECATED_HEADER} ) list(APPEND lua_bindings_files ${lua_bindings_headers}) diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index c9d61af..0b3b970 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -99461,2182 +99461,6 @@ int lua_register_cocos2dx_TMXTiledMap(lua_State* tolua_S) return 1; } -int lua_cocos2dx_TileMapAtlas_initWithTileFile(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::TileMapAtlas* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.TileMapAtlas",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::TileMapAtlas*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_TileMapAtlas_initWithTileFile'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 4) - { - std::string arg0; - std::string arg1; - int arg2; - int arg3; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.TileMapAtlas:initWithTileFile"); - - ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.TileMapAtlas:initWithTileFile"); - - ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.TileMapAtlas:initWithTileFile"); - - ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3, "cc.TileMapAtlas:initWithTileFile"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TileMapAtlas_initWithTileFile'", nullptr); - return 0; - } - bool ret = cobj->initWithTileFile(arg0, arg1, arg2, arg3); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.TileMapAtlas:initWithTileFile",argc, 4); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_TileMapAtlas_initWithTileFile'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_TileMapAtlas_releaseMap(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::TileMapAtlas* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.TileMapAtlas",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::TileMapAtlas*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_TileMapAtlas_releaseMap'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TileMapAtlas_releaseMap'", nullptr); - return 0; - } - cobj->releaseMap(); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.TileMapAtlas:releaseMap",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_TileMapAtlas_releaseMap'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_TileMapAtlas_getTileAt(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::TileMapAtlas* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.TileMapAtlas",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::TileMapAtlas*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_TileMapAtlas_getTileAt'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Vec2 arg0; - - ok &= luaval_to_vec2(tolua_S, 2, &arg0, "cc.TileMapAtlas:getTileAt"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TileMapAtlas_getTileAt'", nullptr); - return 0; - } - cocos2d::Color3B ret = cobj->getTileAt(arg0); - color3b_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.TileMapAtlas:getTileAt",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_TileMapAtlas_getTileAt'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_TileMapAtlas_setTile(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::TileMapAtlas* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.TileMapAtlas",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::TileMapAtlas*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_TileMapAtlas_setTile'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 2) - { - cocos2d::Color3B arg0; - cocos2d::Vec2 arg1; - - ok &= luaval_to_color3b(tolua_S, 2, &arg0, "cc.TileMapAtlas:setTile"); - - ok &= luaval_to_vec2(tolua_S, 3, &arg1, "cc.TileMapAtlas:setTile"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TileMapAtlas_setTile'", nullptr); - return 0; - } - cobj->setTile(arg0, arg1); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.TileMapAtlas:setTile",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_TileMapAtlas_setTile'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_TileMapAtlas_create(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.TileMapAtlas",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 4) - { - std::string arg0; - std::string arg1; - int arg2; - int arg3; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.TileMapAtlas:create"); - ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.TileMapAtlas:create"); - ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.TileMapAtlas:create"); - ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3, "cc.TileMapAtlas:create"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TileMapAtlas_create'", nullptr); - return 0; - } - cocos2d::TileMapAtlas* ret = cocos2d::TileMapAtlas::create(arg0, arg1, arg2, arg3); - object_to_luaval(tolua_S, "cc.TileMapAtlas",(cocos2d::TileMapAtlas*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.TileMapAtlas:create",argc, 4); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_TileMapAtlas_create'.",&tolua_err); -#endif - return 0; -} -int lua_cocos2dx_TileMapAtlas_constructor(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::TileMapAtlas* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TileMapAtlas_constructor'", nullptr); - return 0; - } - cobj = new cocos2d::TileMapAtlas(); - cobj->autorelease(); - int ID = (int)cobj->_ID ; - int* luaID = &cobj->_luaID ; - toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,"cc.TileMapAtlas"); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.TileMapAtlas:TileMapAtlas",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_TileMapAtlas_constructor'.",&tolua_err); -#endif - - return 0; -} - -static int lua_cocos2dx_TileMapAtlas_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (TileMapAtlas)"); - return 0; -} - -int lua_register_cocos2dx_TileMapAtlas(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"cc.TileMapAtlas"); - tolua_cclass(tolua_S,"TileMapAtlas","cc.TileMapAtlas","cc.AtlasNode",nullptr); - - tolua_beginmodule(tolua_S,"TileMapAtlas"); - tolua_function(tolua_S,"new",lua_cocos2dx_TileMapAtlas_constructor); - tolua_function(tolua_S,"initWithTileFile",lua_cocos2dx_TileMapAtlas_initWithTileFile); - tolua_function(tolua_S,"releaseMap",lua_cocos2dx_TileMapAtlas_releaseMap); - tolua_function(tolua_S,"getTileAt",lua_cocos2dx_TileMapAtlas_getTileAt); - tolua_function(tolua_S,"setTile",lua_cocos2dx_TileMapAtlas_setTile); - tolua_function(tolua_S,"create", lua_cocos2dx_TileMapAtlas_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(cocos2d::TileMapAtlas).name(); - g_luaType[typeName] = "cc.TileMapAtlas"; - g_typeCast["TileMapAtlas"] = "cc.TileMapAtlas"; - return 1; -} - -int lua_cocos2dx_FastTMXLayer_getPositionAt(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXLayer* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_getPositionAt'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Vec2 arg0; - - ok &= luaval_to_vec2(tolua_S, 2, &arg0, "cc.FastTMXLayer:getPositionAt"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXLayer_getPositionAt'", nullptr); - return 0; - } - cocos2d::Vec2 ret = cobj->getPositionAt(arg0); - vec2_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXLayer:getPositionAt",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_getPositionAt'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXLayer_setLayerOrientation(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXLayer* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_setLayerOrientation'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - int arg0; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.FastTMXLayer:setLayerOrientation"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXLayer_setLayerOrientation'", nullptr); - return 0; - } - cobj->setLayerOrientation(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXLayer:setLayerOrientation",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_setLayerOrientation'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXLayer_getLayerSize(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXLayer* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_getLayerSize'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXLayer_getLayerSize'", nullptr); - return 0; - } - const cocos2d::Size& ret = cobj->getLayerSize(); - size_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXLayer:getLayerSize",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_getLayerSize'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXLayer_setMapTileSize(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXLayer* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_setMapTileSize'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Size arg0; - - ok &= luaval_to_size(tolua_S, 2, &arg0, "cc.FastTMXLayer:setMapTileSize"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXLayer_setMapTileSize'", nullptr); - return 0; - } - cobj->setMapTileSize(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXLayer:setMapTileSize",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_setMapTileSize'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXLayer_getLayerOrientation(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXLayer* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_getLayerOrientation'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXLayer_getLayerOrientation'", nullptr); - return 0; - } - int ret = cobj->getLayerOrientation(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXLayer:getLayerOrientation",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_getLayerOrientation'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXLayer_setProperties(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXLayer* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_setProperties'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::ValueMap arg0; - - ok &= luaval_to_ccvaluemap(tolua_S, 2, &arg0, "cc.FastTMXLayer:setProperties"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXLayer_setProperties'", nullptr); - return 0; - } - cobj->setProperties(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXLayer:setProperties",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_setProperties'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXLayer_setLayerName(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXLayer* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_setLayerName'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - std::string arg0; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.FastTMXLayer:setLayerName"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXLayer_setLayerName'", nullptr); - return 0; - } - cobj->setLayerName(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXLayer:setLayerName",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_setLayerName'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXLayer_removeTileAt(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXLayer* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_removeTileAt'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Vec2 arg0; - - ok &= luaval_to_vec2(tolua_S, 2, &arg0, "cc.FastTMXLayer:removeTileAt"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXLayer_removeTileAt'", nullptr); - return 0; - } - cobj->removeTileAt(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXLayer:removeTileAt",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_removeTileAt'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXLayer_getProperties(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXLayer* cobj = nullptr; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_getProperties'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 0) { - cocos2d::ValueMap& ret = cobj->getProperties(); - ccvaluemap_to_luaval(tolua_S, ret); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 0) { - const cocos2d::ValueMap& ret = cobj->getProperties(); - ccvaluemap_to_luaval(tolua_S, ret); - return 1; - } - }while(0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXLayer:getProperties",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_getProperties'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXLayer_setupTiles(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXLayer* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_setupTiles'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXLayer_setupTiles'", nullptr); - return 0; - } - cobj->setupTiles(); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXLayer:setupTiles",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_setupTiles'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXLayer_setupTileSprite(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXLayer* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_setupTileSprite'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 3) - { - cocos2d::Sprite* arg0; - cocos2d::Vec2 arg1; - unsigned int arg2; - - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0, "cc.FastTMXLayer:setupTileSprite"); - - ok &= luaval_to_vec2(tolua_S, 3, &arg1, "cc.FastTMXLayer:setupTileSprite"); - - ok &= luaval_to_uint32(tolua_S, 4,&arg2, "cc.FastTMXLayer:setupTileSprite"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXLayer_setupTileSprite'", nullptr); - return 0; - } - cobj->setupTileSprite(arg0, arg1, arg2); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXLayer:setupTileSprite",argc, 3); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_setupTileSprite'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXLayer_setTileGID(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXLayer* cobj = nullptr; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_setTileGID'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 3) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.FastTMXLayer:setTileGID"); - - if (!ok) { break; } - cocos2d::Vec2 arg1; - ok &= luaval_to_vec2(tolua_S, 3, &arg1, "cc.FastTMXLayer:setTileGID"); - - if (!ok) { break; } - cocos2d::TMXTileFlags_ arg2; - ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.FastTMXLayer:setTileGID"); - - if (!ok) { break; } - cobj->setTileGID(arg0, arg1, arg2); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.FastTMXLayer:setTileGID"); - - if (!ok) { break; } - cocos2d::Vec2 arg1; - ok &= luaval_to_vec2(tolua_S, 3, &arg1, "cc.FastTMXLayer:setTileGID"); - - if (!ok) { break; } - cobj->setTileGID(arg0, arg1); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXLayer:setTileGID",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_setTileGID'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXLayer_getMapTileSize(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXLayer* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_getMapTileSize'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXLayer_getMapTileSize'", nullptr); - return 0; - } - const cocos2d::Size& ret = cobj->getMapTileSize(); - size_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXLayer:getMapTileSize",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_getMapTileSize'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXLayer_getProperty(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXLayer* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_getProperty'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - std::string arg0; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.FastTMXLayer:getProperty"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXLayer_getProperty'", nullptr); - return 0; - } - cocos2d::Value ret = cobj->getProperty(arg0); - ccvalue_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXLayer:getProperty",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_getProperty'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXLayer_setLayerSize(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXLayer* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_setLayerSize'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Size arg0; - - ok &= luaval_to_size(tolua_S, 2, &arg0, "cc.FastTMXLayer:setLayerSize"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXLayer_setLayerSize'", nullptr); - return 0; - } - cobj->setLayerSize(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXLayer:setLayerSize",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_setLayerSize'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXLayer_getLayerName(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXLayer* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_getLayerName'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXLayer_getLayerName'", nullptr); - return 0; - } - const std::string& ret = cobj->getLayerName(); - lua_pushlstring(tolua_S,ret.c_str(),ret.length()); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXLayer:getLayerName",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_getLayerName'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXLayer_setTileSet(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXLayer* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_setTileSet'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::TMXTilesetInfo* arg0; - - ok &= luaval_to_object(tolua_S, 2, "cc.TMXTilesetInfo",&arg0, "cc.FastTMXLayer:setTileSet"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXLayer_setTileSet'", nullptr); - return 0; - } - cobj->setTileSet(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXLayer:setTileSet",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_setTileSet'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXLayer_getTileSet(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXLayer* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_getTileSet'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXLayer_getTileSet'", nullptr); - return 0; - } - cocos2d::TMXTilesetInfo* ret = cobj->getTileSet(); - object_to_luaval(tolua_S, "cc.TMXTilesetInfo",(cocos2d::TMXTilesetInfo*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXLayer:getTileSet",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_getTileSet'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXLayer_getTileAt(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXLayer* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_getTileAt'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Vec2 arg0; - - ok &= luaval_to_vec2(tolua_S, 2, &arg0, "cc.FastTMXLayer:getTileAt"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXLayer_getTileAt'", nullptr); - return 0; - } - cocos2d::Sprite* ret = cobj->getTileAt(arg0); - object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXLayer:getTileAt",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_getTileAt'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXLayer_create(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 3) - { - cocos2d::TMXTilesetInfo* arg0; - cocos2d::TMXLayerInfo* arg1; - cocos2d::TMXMapInfo* arg2; - ok &= luaval_to_object(tolua_S, 2, "cc.TMXTilesetInfo",&arg0, "cc.FastTMXLayer:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.TMXLayerInfo",&arg1, "cc.FastTMXLayer:create"); - ok &= luaval_to_object(tolua_S, 4, "cc.TMXMapInfo",&arg2, "cc.FastTMXLayer:create"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXLayer_create'", nullptr); - return 0; - } - cocos2d::FastTMXLayer* ret = cocos2d::FastTMXLayer::create(arg0, arg1, arg2); - object_to_luaval(tolua_S, "cc.FastTMXLayer",(cocos2d::FastTMXLayer*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.FastTMXLayer:create",argc, 3); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_create'.",&tolua_err); -#endif - return 0; -} -int lua_cocos2dx_FastTMXLayer_constructor(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXLayer* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXLayer_constructor'", nullptr); - return 0; - } - cobj = new cocos2d::FastTMXLayer(); - cobj->autorelease(); - int ID = (int)cobj->_ID ; - int* luaID = &cobj->_luaID ; - toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,"cc.FastTMXLayer"); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXLayer:FastTMXLayer",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_constructor'.",&tolua_err); -#endif - - return 0; -} - -static int lua_cocos2dx_FastTMXLayer_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (FastTMXLayer)"); - return 0; -} - -int lua_register_cocos2dx_FastTMXLayer(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"cc.FastTMXLayer"); - tolua_cclass(tolua_S,"FastTMXLayer","cc.FastTMXLayer","cc.Node",nullptr); - - tolua_beginmodule(tolua_S,"FastTMXLayer"); - tolua_function(tolua_S,"new",lua_cocos2dx_FastTMXLayer_constructor); - tolua_function(tolua_S,"getPositionAt",lua_cocos2dx_FastTMXLayer_getPositionAt); - tolua_function(tolua_S,"setLayerOrientation",lua_cocos2dx_FastTMXLayer_setLayerOrientation); - tolua_function(tolua_S,"getLayerSize",lua_cocos2dx_FastTMXLayer_getLayerSize); - tolua_function(tolua_S,"setMapTileSize",lua_cocos2dx_FastTMXLayer_setMapTileSize); - tolua_function(tolua_S,"getLayerOrientation",lua_cocos2dx_FastTMXLayer_getLayerOrientation); - tolua_function(tolua_S,"setProperties",lua_cocos2dx_FastTMXLayer_setProperties); - tolua_function(tolua_S,"setLayerName",lua_cocos2dx_FastTMXLayer_setLayerName); - tolua_function(tolua_S,"removeTileAt",lua_cocos2dx_FastTMXLayer_removeTileAt); - tolua_function(tolua_S,"getProperties",lua_cocos2dx_FastTMXLayer_getProperties); - tolua_function(tolua_S,"setupTiles",lua_cocos2dx_FastTMXLayer_setupTiles); - tolua_function(tolua_S,"setupTileSprite",lua_cocos2dx_FastTMXLayer_setupTileSprite); - tolua_function(tolua_S,"setTileGID",lua_cocos2dx_FastTMXLayer_setTileGID); - tolua_function(tolua_S,"getMapTileSize",lua_cocos2dx_FastTMXLayer_getMapTileSize); - tolua_function(tolua_S,"getProperty",lua_cocos2dx_FastTMXLayer_getProperty); - tolua_function(tolua_S,"setLayerSize",lua_cocos2dx_FastTMXLayer_setLayerSize); - tolua_function(tolua_S,"getLayerName",lua_cocos2dx_FastTMXLayer_getLayerName); - tolua_function(tolua_S,"setTileSet",lua_cocos2dx_FastTMXLayer_setTileSet); - tolua_function(tolua_S,"getTileSet",lua_cocos2dx_FastTMXLayer_getTileSet); - tolua_function(tolua_S,"getTileAt",lua_cocos2dx_FastTMXLayer_getTileAt); - tolua_function(tolua_S,"create", lua_cocos2dx_FastTMXLayer_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(cocos2d::FastTMXLayer).name(); - g_luaType[typeName] = "cc.FastTMXLayer"; - g_typeCast["FastTMXLayer"] = "cc.FastTMXLayer"; - return 1; -} - -int lua_cocos2dx_FastTMXTiledMap_setObjectGroups(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXTiledMap* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_setObjectGroups'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Vector arg0; - - ok &= luaval_to_ccvector(tolua_S, 2, &arg0, "cc.FastTMXTiledMap:setObjectGroups"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXTiledMap_setObjectGroups'", nullptr); - return 0; - } - cobj->setObjectGroups(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXTiledMap:setObjectGroups",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_setObjectGroups'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXTiledMap_getProperty(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXTiledMap* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_getProperty'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - std::string arg0; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.FastTMXTiledMap:getProperty"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXTiledMap_getProperty'", nullptr); - return 0; - } - cocos2d::Value ret = cobj->getProperty(arg0); - ccvalue_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXTiledMap:getProperty",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_getProperty'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXTiledMap_setMapSize(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXTiledMap* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_setMapSize'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Size arg0; - - ok &= luaval_to_size(tolua_S, 2, &arg0, "cc.FastTMXTiledMap:setMapSize"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXTiledMap_setMapSize'", nullptr); - return 0; - } - cobj->setMapSize(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXTiledMap:setMapSize",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_setMapSize'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXTiledMap_getObjectGroup(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXTiledMap* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_getObjectGroup'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - std::string arg0; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.FastTMXTiledMap:getObjectGroup"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXTiledMap_getObjectGroup'", nullptr); - return 0; - } - cocos2d::TMXObjectGroup* ret = cobj->getObjectGroup(arg0); - object_to_luaval(tolua_S, "cc.TMXObjectGroup",(cocos2d::TMXObjectGroup*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXTiledMap:getObjectGroup",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_getObjectGroup'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXTiledMap_getObjectGroups(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXTiledMap* cobj = nullptr; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_getObjectGroups'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 0) { - cocos2d::Vector& ret = cobj->getObjectGroups(); - ccvector_to_luaval(tolua_S, ret); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 0) { - const cocos2d::Vector& ret = cobj->getObjectGroups(); - ccvector_to_luaval(tolua_S, ret); - return 1; - } - }while(0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXTiledMap:getObjectGroups",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_getObjectGroups'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXTiledMap_getTileSize(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXTiledMap* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_getTileSize'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXTiledMap_getTileSize'", nullptr); - return 0; - } - const cocos2d::Size& ret = cobj->getTileSize(); - size_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXTiledMap:getTileSize",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_getTileSize'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXTiledMap_getMapSize(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXTiledMap* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_getMapSize'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXTiledMap_getMapSize'", nullptr); - return 0; - } - const cocos2d::Size& ret = cobj->getMapSize(); - size_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXTiledMap:getMapSize",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_getMapSize'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXTiledMap_getProperties(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXTiledMap* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_getProperties'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXTiledMap_getProperties'", nullptr); - return 0; - } - const cocos2d::ValueMap& ret = cobj->getProperties(); - ccvaluemap_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXTiledMap:getProperties",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_getProperties'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXTiledMap_getPropertiesForGID(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXTiledMap* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_getPropertiesForGID'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - int arg0; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.FastTMXTiledMap:getPropertiesForGID"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXTiledMap_getPropertiesForGID'", nullptr); - return 0; - } - cocos2d::Value ret = cobj->getPropertiesForGID(arg0); - ccvalue_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXTiledMap:getPropertiesForGID",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_getPropertiesForGID'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXTiledMap_setTileSize(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXTiledMap* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_setTileSize'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Size arg0; - - ok &= luaval_to_size(tolua_S, 2, &arg0, "cc.FastTMXTiledMap:setTileSize"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXTiledMap_setTileSize'", nullptr); - return 0; - } - cobj->setTileSize(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXTiledMap:setTileSize",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_setTileSize'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXTiledMap_setProperties(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXTiledMap* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_setProperties'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::ValueMap arg0; - - ok &= luaval_to_ccvaluemap(tolua_S, 2, &arg0, "cc.FastTMXTiledMap:setProperties"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXTiledMap_setProperties'", nullptr); - return 0; - } - cobj->setProperties(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXTiledMap:setProperties",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_setProperties'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXTiledMap_getLayer(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXTiledMap* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_getLayer'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - std::string arg0; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.FastTMXTiledMap:getLayer"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXTiledMap_getLayer'", nullptr); - return 0; - } - cocos2d::FastTMXLayer* ret = cobj->getLayer(arg0); - object_to_luaval(tolua_S, "cc.FastTMXLayer",(cocos2d::FastTMXLayer*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXTiledMap:getLayer",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_getLayer'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXTiledMap_getMapOrientation(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXTiledMap* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_getMapOrientation'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXTiledMap_getMapOrientation'", nullptr); - return 0; - } - int ret = cobj->getMapOrientation(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXTiledMap:getMapOrientation",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_getMapOrientation'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXTiledMap_setMapOrientation(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXTiledMap* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_setMapOrientation'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - int arg0; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.FastTMXTiledMap:setMapOrientation"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXTiledMap_setMapOrientation'", nullptr); - return 0; - } - cobj->setMapOrientation(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXTiledMap:setMapOrientation",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_setMapOrientation'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_FastTMXTiledMap_create(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 1) - { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.FastTMXTiledMap:create"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXTiledMap_create'", nullptr); - return 0; - } - cocos2d::FastTMXTiledMap* ret = cocos2d::FastTMXTiledMap::create(arg0); - object_to_luaval(tolua_S, "cc.FastTMXTiledMap",(cocos2d::FastTMXTiledMap*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.FastTMXTiledMap:create",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_create'.",&tolua_err); -#endif - return 0; -} -int lua_cocos2dx_FastTMXTiledMap_createWithXML(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 2) - { - std::string arg0; - std::string arg1; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.FastTMXTiledMap:createWithXML"); - ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.FastTMXTiledMap:createWithXML"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_FastTMXTiledMap_createWithXML'", nullptr); - return 0; - } - cocos2d::FastTMXTiledMap* ret = cocos2d::FastTMXTiledMap::createWithXML(arg0, arg1); - object_to_luaval(tolua_S, "cc.FastTMXTiledMap",(cocos2d::FastTMXTiledMap*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.FastTMXTiledMap:createWithXML",argc, 2); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_createWithXML'.",&tolua_err); -#endif - return 0; -} -static int lua_cocos2dx_FastTMXTiledMap_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (FastTMXTiledMap)"); - return 0; -} - -int lua_register_cocos2dx_FastTMXTiledMap(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"cc.FastTMXTiledMap"); - tolua_cclass(tolua_S,"FastTMXTiledMap","cc.FastTMXTiledMap","cc.Node",nullptr); - - tolua_beginmodule(tolua_S,"FastTMXTiledMap"); - tolua_function(tolua_S,"setObjectGroups",lua_cocos2dx_FastTMXTiledMap_setObjectGroups); - tolua_function(tolua_S,"getProperty",lua_cocos2dx_FastTMXTiledMap_getProperty); - tolua_function(tolua_S,"setMapSize",lua_cocos2dx_FastTMXTiledMap_setMapSize); - tolua_function(tolua_S,"getObjectGroup",lua_cocos2dx_FastTMXTiledMap_getObjectGroup); - tolua_function(tolua_S,"getObjectGroups",lua_cocos2dx_FastTMXTiledMap_getObjectGroups); - tolua_function(tolua_S,"getTileSize",lua_cocos2dx_FastTMXTiledMap_getTileSize); - tolua_function(tolua_S,"getMapSize",lua_cocos2dx_FastTMXTiledMap_getMapSize); - tolua_function(tolua_S,"getProperties",lua_cocos2dx_FastTMXTiledMap_getProperties); - tolua_function(tolua_S,"getPropertiesForGID",lua_cocos2dx_FastTMXTiledMap_getPropertiesForGID); - tolua_function(tolua_S,"setTileSize",lua_cocos2dx_FastTMXTiledMap_setTileSize); - tolua_function(tolua_S,"setProperties",lua_cocos2dx_FastTMXTiledMap_setProperties); - tolua_function(tolua_S,"getLayer",lua_cocos2dx_FastTMXTiledMap_getLayer); - tolua_function(tolua_S,"getMapOrientation",lua_cocos2dx_FastTMXTiledMap_getMapOrientation); - tolua_function(tolua_S,"setMapOrientation",lua_cocos2dx_FastTMXTiledMap_setMapOrientation); - tolua_function(tolua_S,"create", lua_cocos2dx_FastTMXTiledMap_create); - tolua_function(tolua_S,"createWithXML", lua_cocos2dx_FastTMXTiledMap_createWithXML); - tolua_endmodule(tolua_S); - std::string typeName = typeid(cocos2d::FastTMXTiledMap).name(); - g_luaType[typeName] = "cc.FastTMXTiledMap"; - g_typeCast["FastTMXTiledMap"] = "cc.FastTMXTiledMap"; - return 1; -} - int lua_cocos2dx_MotionStreak3D_reset(lua_State* tolua_S) { int argc = 0; @@ -102661,7 +100485,6 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_TransitionMoveInL(tolua_S); lua_register_cocos2dx_TransitionMoveInB(tolua_S); lua_register_cocos2dx_AtlasNode(tolua_S); - lua_register_cocos2dx_TileMapAtlas(tolua_S); lua_register_cocos2dx_TransitionMoveInT(tolua_S); lua_register_cocos2dx_TMXTilesetInfo(tolua_S); lua_register_cocos2dx_TransitionMoveInR(tolua_S); @@ -102796,7 +100619,6 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_EaseBounceIn(tolua_S); lua_register_cocos2dx_Camera(tolua_S); lua_register_cocos2dx_TMXObjectGroup(tolua_S); - lua_register_cocos2dx_FastTMXTiledMap(tolua_S); lua_register_cocos2dx_ParticleGalaxy(tolua_S); lua_register_cocos2dx_Twirl(tolua_S); lua_register_cocos2dx_EaseQuinticActionIn(tolua_S); @@ -102829,7 +100651,6 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_SpriteFrame(tolua_S); lua_register_cocos2dx_Liquid(tolua_S); lua_register_cocos2dx_UserDefault(tolua_S); - lua_register_cocos2dx_FastTMXLayer(tolua_S); lua_register_cocos2dx_TransitionZoomFlipX(tolua_S); lua_register_cocos2dx_EventFocus(tolua_S); lua_register_cocos2dx_TransitionFade(tolua_S); diff --git a/cocos/scripting/lua-bindings/manual/CCLuaEngine.h b/cocos/scripting/lua-bindings/manual/CCLuaEngine.h index 19cb33d..eab741a 100644 --- a/cocos/scripting/lua-bindings/manual/CCLuaEngine.h +++ b/cocos/scripting/lua-bindings/manual/CCLuaEngine.h @@ -60,12 +60,6 @@ public: * @return the instance of LuaEngine. */ static LuaEngine* getInstance(void); - /** - * Get defaultEngine of LuaEngine, it was deprecated. - * - * @return the instance of LuaEngine. - */ - CC_DEPRECATED_ATTRIBUTE static LuaEngine* defaultEngine(void) { return LuaEngine::getInstance(); } /** * Destructor of LuaEngine. diff --git a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h index 3ebc3f2..3e999a5 100644 --- a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h +++ b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h @@ -452,15 +452,6 @@ static inline bool luaval_to_point(lua_State* L,int lo,cocos2d::Vec2* outValue, return luaval_to_vec2(L, lo, outValue); } -CC_DEPRECATED_ATTRIBUTE static inline bool luaval_to_kmMat4(lua_State* L, int lo, cocos2d::Mat4* outValue , const char* funcName = "") -{ - return luaval_to_mat4(L, lo, outValue); -} -CC_DEPRECATED_ATTRIBUTE static inline bool luaval_to_array_of_Point(lua_State* L,int lo,cocos2d::Vec2 **points, int *numPoints, const char* funcName = "") -{ - return luaval_to_array_of_vec2(L, lo, points, numPoints); -} - /** * Get a cocos2d::Vector of type T objects by the argc numbers of Lua values in the stack. * @@ -988,12 +979,6 @@ static inline void point_to_luaval(lua_State* L,const cocos2d::Vec2& pt) vec2_to_luaval(L, pt); } - -CC_DEPRECATED_ATTRIBUTE static inline void points_to_luaval(lua_State* L,const cocos2d::Vec2* points, int count) -{ - vec2_array_to_luaval(L, points, count); -} - /** * Push a table converted from a cocos2d::Vector object into the Lua stack. * The format of table as follows: {userdata1, userdata2, ..., userdataVectorSize} diff --git a/cocos/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.cpp b/cocos/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.cpp index 53ced2b..9d99c90 100644 --- a/cocos/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.cpp @@ -46,8 +46,6 @@ #include "2d/CCSpriteBatchNode.h" #include "2d/CCTMXLayer.h" #include "2d/CCTMXTiledMap.h" -#include "2d/CCFastTMXLayer.h" -#include "2d/CCFastTMXTiledMap.h" #include "2d/CCRenderTexture.h" #include "base/CCEventDispatcher.h" #include "base/CCEventListenerKeyboard.h" @@ -2385,7 +2383,6 @@ int lua_cocos2dx_Scene_setPhysics3DDebugCamera(lua_State* tolua_S) { int argc = 0; cocos2d::Scene* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; @@ -4672,83 +4669,6 @@ static void extendTMXLayer(lua_State* tolua_S) lua_pop(tolua_S, 1); } -static int lua_cocos2dx_FastTMXLayer_getTileGIDAt(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::FastTMXLayer* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_getTileGIDAt'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Vec2 arg0; - - ok &= luaval_to_vec2(tolua_S, 2, &arg0, "cc.FastTMXLayer:getTileGIDAt"); - if(!ok) - return 0; - int ret = cobj->getTileGIDAt(arg0); - tolua_pushnumber(tolua_S,(lua_Number)ret); - tolua_pushnumber(tolua_S,(lua_Number)0); - return 2; - } - if (argc == 2) - { - cocos2d::Vec2 arg0; - int arg1 = 0; - - ok &= luaval_to_vec2(tolua_S, 2, &arg0, "cc.FastTMXLayer:getTileGIDAt"); - ok &= luaval_to_int32(tolua_S, 3, &arg1, "cc.FastTMXLayer:getTileGIDAt"); - - if(!ok) - return 0; - - unsigned int ret = cobj->getTileGIDAt(arg0, (cocos2d::TMXTileFlags*)&arg1); - tolua_pushnumber(tolua_S,(lua_Number)ret); - tolua_pushnumber(tolua_S,(lua_Number)arg1); - return 2; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.FastTMXLayer:getTileGIDAt",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_getTileGIDAt'.",&tolua_err); -#endif - - return 0; -} - -static void extendFastTMXLayer(lua_State* tolua_S) -{ - lua_pushstring(tolua_S, "cc.FastTMXLayer"); - lua_rawget(tolua_S, LUA_REGISTRYINDEX); - if (lua_istable(tolua_S,-1)) - { - tolua_function(tolua_S, "getTileGIDAt", lua_cocos2dx_FastTMXLayer_getTileGIDAt); - } - lua_pop(tolua_S, 1); -} - - int lua_cocos2dx_Application_isIOS64bit(lua_State* tolua_S) { int argc = 0; @@ -5682,7 +5602,6 @@ int register_all_cocos2dx_manual(lua_State* tolua_S) extendConsole(tolua_S); extendOrbitCamera(tolua_S); extendTMXLayer(tolua_S); - extendFastTMXLayer(tolua_S); extendApplication(tolua_S); extendTextureCache(tolua_S); extendGLView(tolua_S); diff --git a/cocos/scripting/lua-bindings/manual/cocostudio/lua_cocos2dx_coco_studio_manual.cpp b/cocos/scripting/lua-bindings/manual/cocostudio/lua_cocos2dx_coco_studio_manual.cpp index cfe727f..8d2dbb6 100644 --- a/cocos/scripting/lua-bindings/manual/cocostudio/lua_cocos2dx_coco_studio_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/cocostudio/lua_cocos2dx_coco_studio_manual.cpp @@ -384,7 +384,7 @@ static int lua_cocos2dx_extension_Bone_getIgnoreMovementBoneData(lua_State* L) if (0 == argc) { - tolua_pushboolean(L, self->getIgnoreMovementBoneData()); + tolua_pushboolean(L, self->isIgnoreMovementBoneData()); return 1; } @@ -405,7 +405,7 @@ static void extendBone(lua_State* L) if (lua_istable(L,-1)) { tolua_function(L, "setIgnoreMovementBoneData", lua_cocos2dx_extension_Bone_setIgnoreMovementBoneData); - tolua_function(L, "getIgnoreMovementBoneData", lua_cocos2dx_extension_Bone_getIgnoreMovementBoneData); + tolua_function(L, "isIgnoreMovementBoneData", lua_cocos2dx_extension_Bone_getIgnoreMovementBoneData); } lua_pop(L, 1); } diff --git a/cocos/scripting/lua-bindings/manual/extension/lua_cocos2dx_extension_manual.cpp b/cocos/scripting/lua-bindings/manual/extension/lua_cocos2dx_extension_manual.cpp index cce82aa..c8fb7d9 100644 --- a/cocos/scripting/lua-bindings/manual/extension/lua_cocos2dx_extension_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/extension/lua_cocos2dx_extension_manual.cpp @@ -33,7 +33,6 @@ #include "scripting/lua-bindings/manual/cocos2d/LuaScriptHandlerMgr.h" USING_NS_CC; -USING_NS_CC_EXT; int lua_cocos2dx_extension_ParticleSystem3D_getParticlePool(lua_State* tolua_S) diff --git a/cocos/scripting/lua-bindings/script/cocos2d/DeprecatedCocos2dClass.lua b/cocos/scripting/lua-bindings/script/cocos2d/DeprecatedCocos2dClass.lua deleted file mode 100644 index 3228789..0000000 --- a/cocos/scripting/lua-bindings/script/cocos2d/DeprecatedCocos2dClass.lua +++ /dev/null @@ -1,1767 +0,0 @@ --- This is the DeprecatedClass - -DeprecatedClass = {} or DeprecatedClass - ---tip -local function deprecatedTip(old_name,new_name) - print("\n********** \n"..old_name.." was deprecated please use ".. new_name .. " instead.\n**********") -end - ---CCProgressTo class will be Deprecated,begin -function DeprecatedClass.CCProgressTo() - deprecatedTip("CCProgressTo","cc.ProgressTo") - return cc.ProgressTo -end -_G["CCProgressTo"] = DeprecatedClass.CCProgressTo() ---CCProgressTo class will be Deprecated,end - ---CCHide class will be Deprecated,begin -function DeprecatedClass.CCHide() - deprecatedTip("CCHide","cc.Hide") - return cc.Hide -end -_G["CCHide"] = DeprecatedClass.CCHide() ---CCHide class will be Deprecated,end - ---CCTransitionMoveInB class will be Deprecated,begin -function DeprecatedClass.CCTransitionMoveInB() - deprecatedTip("CCTransitionMoveInB","cc.TransitionMoveInB") - return cc.TransitionMoveInB -end -_G["CCTransitionMoveInB"] = DeprecatedClass.CCTransitionMoveInB() ---CCTransitionMoveInB class will be Deprecated,end - ---CCEaseSineIn class will be Deprecated,begin -function DeprecatedClass.CCEaseSineIn() - deprecatedTip("CCEaseSineIn","cc.EaseSineIn") - return cc.EaseSineIn -end -_G["CCEaseSineIn"] = DeprecatedClass.CCEaseSineIn() ---CCEaseSineIn class will be Deprecated,end - ---CCTransitionMoveInL class will be Deprecated,begin -function DeprecatedClass.CCTransitionMoveInL() - deprecatedTip("CCTransitionMoveInL","cc.TransitionMoveInL") - return cc.TransitionMoveInL -end -_G["CCTransitionMoveInL"] = DeprecatedClass.CCTransitionMoveInL() ---CCTransitionMoveInL class will be Deprecated,end - ---CCEaseInOut class will be Deprecated,begin -function DeprecatedClass.CCEaseInOut() - deprecatedTip("CCEaseInOut","cc.EaseInOut") - return cc.EaseInOut -end -_G["CCEaseInOut"] = DeprecatedClass.CCEaseInOut() ---CCEaseInOut class will be Deprecated,end - ---CCTransitionMoveInT class will be Deprecated,begin -function DeprecatedClass.CCTransitionMoveInT() - deprecatedTip("CCTransitionMoveInT","cc.TransitionMoveInT") - return cc.TransitionMoveInT -end -_G["CCTransitionMoveInT"] = DeprecatedClass.CCTransitionMoveInT() ---CCTransitionMoveInT class will be Deprecated,end - ---CCTransitionMoveInR class will be Deprecated,begin -function DeprecatedClass.CCTransitionMoveInR() - deprecatedTip("CCTransitionMoveInR","cc.TransitionMoveInR") - return cc.TransitionMoveInR -end -_G["CCTransitionMoveInR"] = DeprecatedClass.CCTransitionMoveInR() ---CCTransitionMoveInR class will be Deprecated,end - ---CCParticleSnow class will be Deprecated,begin -function DeprecatedClass.CCParticleSnow() - deprecatedTip("CCParticleSnow","cc.ParticleSnow") - return cc.ParticleSnow -end -_G["CCParticleSnow"] = DeprecatedClass.CCParticleSnow() ---CCParticleSnow class will be Deprecated,end - ---CCActionCamera class will be Deprecated,begin -function DeprecatedClass.CCActionCamera() - deprecatedTip("CCActionCamera","cc.ActionCamera") - return cc.ActionCamera -end -_G["CCActionCamera"] = DeprecatedClass.CCActionCamera() ---CCActionCamera class will be Deprecated,end - ---CCProgressFromTo class will be Deprecated,begin -function DeprecatedClass.CCProgressFromTo() - deprecatedTip("CCProgressFromTo","cc.ProgressFromTo") - return cc.ProgressFromTo -end -_G["CCProgressFromTo"] = DeprecatedClass.CCProgressFromTo() ---CCProgressFromTo class will be Deprecated,end - ---CCMoveTo class will be Deprecated,begin -function DeprecatedClass.CCMoveTo() - deprecatedTip("CCMoveTo","cc.MoveTo") - return cc.MoveTo -end -_G["CCMoveTo"] = DeprecatedClass.CCMoveTo() ---CCMoveTo class will be Deprecated,end - ---CCJumpBy class will be Deprecated,begin -function DeprecatedClass.CCJumpBy() - deprecatedTip("CCJumpBy","cc.JumpBy") - return cc.JumpBy -end -_G["CCJumpBy"] = DeprecatedClass.CCJumpBy() ---CCJumpBy class will be Deprecated,end - ---CCObject class will be Deprecated,begin -function DeprecatedClass.CCObject() - deprecatedTip("CCObject","cc.Object") - return cc.Object -end -_G["CCObject"] = DeprecatedClass.CCObject() ---CCObject class will be Deprecated,end - ---CCTransitionRotoZoom class will be Deprecated,begin -function DeprecatedClass.CCTransitionRotoZoom() - deprecatedTip("CCTransitionRotoZoom","cc.TransitionRotoZoom") - return cc.TransitionRotoZoom -end -_G["CCTransitionRotoZoom"] = DeprecatedClass.CCTransitionRotoZoom() ---CCTransitionRotoZoom class will be Deprecated,end - ---CCDirector class will be Deprecated,begin -function DeprecatedClass.CCDirector() - deprecatedTip("CCDirector","cc.Director") - return cc.Director -end -_G["CCDirector"] = DeprecatedClass.CCDirector() ---CCDirector class will be Deprecated,end - ---CCScheduler class will be Deprecated,begin -function DeprecatedClass.CCScheduler() - deprecatedTip("CCScheduler","cc.Scheduler") - return cc.Scheduler -end -_G["CCScheduler"] = DeprecatedClass.CCScheduler() ---CCScheduler class will be Deprecated,end - ---CCEaseElasticOut class will be Deprecated,begin -function DeprecatedClass.CCEaseElasticOut() - deprecatedTip("CCEaseElasticOut","cc.EaseElasticOut") - return cc.EaseElasticOut -end -_G["CCEaseElasticOut"] = DeprecatedClass.CCEaseElasticOut() ---CCEaseElasticOut class will be Deprecated,end - ---CCTableViewCell class will be Deprecated,begin -function DeprecatedClass.CCTableViewCell() - deprecatedTip("CCTableViewCell","cc.TableViewCell") - return cc.TableViewCell -end -_G["CCTableViewCell"] = DeprecatedClass.CCTableViewCell() ---CCTableViewCell class will be Deprecated,end - - ---CCEaseBackOut class will be Deprecated,begin -function DeprecatedClass.CCEaseBackOut() - deprecatedTip("CCEaseBackOut","cc.EaseBackOut") - return cc.EaseBackOut -end -_G["CCEaseBackOut"] = DeprecatedClass.CCEaseBackOut() ---CCEaseBackOut class will be Deprecated,end - ---CCParticleSystemQuad class will be Deprecated,begin -function DeprecatedClass.CCParticleSystemQuad() - deprecatedTip("CCParticleSystemQuad","cc.ParticleSystemQuad") - return cc.ParticleSystemQuad -end -_G["CCParticleSystemQuad"] = DeprecatedClass.CCParticleSystemQuad() ---CCParticleSystemQuad class will be Deprecated,end - ---CCMenuItemToggle class will be Deprecated,begin -function DeprecatedClass.CCMenuItemToggle() - deprecatedTip("CCMenuItemToggle","cc.MenuItemToggle") - return cc.MenuItemToggle -end -_G["CCMenuItemToggle"] = DeprecatedClass.CCMenuItemToggle() ---CCMenuItemToggle class will be Deprecated,end - ---CCStopGrid class will be Deprecated,begin -function DeprecatedClass.CCStopGrid() - deprecatedTip("CCStopGrid","cc.StopGrid") - return cc.StopGrid -end -_G["CCStopGrid"] = DeprecatedClass.CCStopGrid() ---CCStopGrid class will be Deprecated,end - ---CCTransitionScene class will be Deprecated,begin -function DeprecatedClass.CCTransitionScene() - deprecatedTip("CCTransitionScene","cc.TransitionScene") - return cc.TransitionScene -end -_G["CCTransitionScene"] = DeprecatedClass.CCTransitionScene() ---CCTransitionScene class will be Deprecated,end - ---CCSkewBy class will be Deprecated,begin -function DeprecatedClass.CCSkewBy() - deprecatedTip("CCSkewBy","cc.SkewBy") - return cc.SkewBy -end -_G["CCSkewBy"] = DeprecatedClass.CCSkewBy() ---CCSkewBy class will be Deprecated,end - ---CCLayer class will be Deprecated,begin -function DeprecatedClass.CCLayer() - deprecatedTip("CCLayer","cc.Layer") - return cc.Layer -end -_G["CCLayer"] = DeprecatedClass.CCLayer() ---CCLayer class will be Deprecated,end - ---CCEaseElastic class will be Deprecated,begin -function DeprecatedClass.CCEaseElastic() - deprecatedTip("CCEaseElastic","cc.EaseElastic") - return cc.EaseElastic -end -_G["CCEaseElastic"] = DeprecatedClass.CCEaseElastic() ---CCEaseElastic class will be Deprecated,end - ---CCTMXTiledMap class will be Deprecated,begin -function DeprecatedClass.CCTMXTiledMap() - deprecatedTip("CCTMXTiledMap","cc.TMXTiledMap") - return cc.TMXTiledMap -end -_G["CCTMXTiledMap"] = DeprecatedClass.CCTMXTiledMap() ---CCTMXTiledMap class will be Deprecated,end - ---CCGrid3DAction class will be Deprecated,begin -function DeprecatedClass.CCGrid3DAction() - deprecatedTip("CCGrid3DAction","cc.Grid3DAction") - return cc.Grid3DAction -end -_G["CCGrid3DAction"] = DeprecatedClass.CCGrid3DAction() ---CCGrid3DAction class will be Deprecated,end - ---CCFadeIn class will be Deprecated,begin -function DeprecatedClass.CCFadeIn() - deprecatedTip("CCFadeIn","cc.FadeIn") - return cc.FadeIn -end -_G["CCFadeIn"] = DeprecatedClass.CCFadeIn() ---CCFadeIn class will be Deprecated,end - ---CCNodeRGBA class will be Deprecated,begin -function DeprecatedClass.CCNodeRGBA() - deprecatedTip("CCNodeRGBA","cc.Node") - return cc.Node -end -_G["CCNodeRGBA"] = DeprecatedClass.CCNodeRGBA() ---CCNodeRGBA class will be Deprecated,end - ---NodeRGBA class will be Deprecated,begin -function DeprecatedClass.NodeRGBA() - deprecatedTip("cc.NodeRGBA","cc.Node") - return cc.Node -end -_G["cc"]["NodeRGBA"] = DeprecatedClass.NodeRGBA() ---NodeRGBA class will be Deprecated,end - ---CCAnimationCache class will be Deprecated,begin -function DeprecatedClass.CCAnimationCache() - deprecatedTip("CCAnimationCache","cc.AnimationCache") - return cc.AnimationCache -end -_G["CCAnimationCache"] = DeprecatedClass.CCAnimationCache() ---CCAnimationCache class will be Deprecated,end - ---CCFlipY3D class will be Deprecated,begin -function DeprecatedClass.CCFlipY3D() - deprecatedTip("CCFlipY3D","cc.FlipY3D") - return cc.FlipY3D -end -_G["CCFlipY3D"] = DeprecatedClass.CCFlipY3D() ---CCFlipY3D class will be Deprecated,end - ---CCEaseSineInOut class will be Deprecated,begin -function DeprecatedClass.CCEaseSineInOut() - deprecatedTip("CCEaseSineInOut","cc.EaseSineInOut") - return cc.EaseSineInOut -end -_G["CCEaseSineInOut"] = DeprecatedClass.CCEaseSineInOut() ---CCEaseSineInOut class will be Deprecated,end - ---CCTransitionFlipAngular class will be Deprecated,begin -function DeprecatedClass.CCTransitionFlipAngular() - deprecatedTip("CCTransitionFlipAngular","cc.TransitionFlipAngular") - return cc.TransitionFlipAngular -end -_G["CCTransitionFlipAngular"] = DeprecatedClass.CCTransitionFlipAngular() ---CCTransitionFlipAngular class will be Deprecated,end - ---CCEaseElasticInOut class will be Deprecated,begin -function DeprecatedClass.CCEaseElasticInOut() - deprecatedTip("CCEaseElasticInOut","cc.EaseElasticInOut") - return cc.EaseElasticInOut -end -_G["CCEaseElasticInOut"] = DeprecatedClass.CCEaseElasticInOut() ---CCEaseElasticInOut class will be Deprecated,end - ---CCEaseBounce class will be Deprecated,begin -function DeprecatedClass.CCEaseBounce() - deprecatedTip("CCEaseBounce","cc.EaseBounce") - return cc.EaseBounce -end -_G["CCEaseBounce"] = DeprecatedClass.CCEaseBounce() ---CCEaseBounce class will be Deprecated,end - ---CCShow class will be Deprecated,begin -function DeprecatedClass.CCShow() - deprecatedTip("CCShow","cc.Show") - return cc.Show -end -_G["CCShow"] = DeprecatedClass.CCShow() ---CCShow class will be Deprecated,end - ---CCFadeOut class will be Deprecated,begin -function DeprecatedClass.CCFadeOut() - deprecatedTip("CCFadeOut","cc.FadeOut") - return cc.FadeOut -end -_G["CCFadeOut"] = DeprecatedClass.CCFadeOut() ---CCFadeOut class will be Deprecated,end - ---CCCallFunc class will be Deprecated,begin -function DeprecatedClass.CCCallFunc() - deprecatedTip("CCCallFunc","cc.CallFunc") - return cc.CallFunc -end -_G["CCCallFunc"] = DeprecatedClass.CCCallFunc() ---CCCallFunc class will be Deprecated,end - ---CCWaves3D class will be Deprecated,begin -function DeprecatedClass.CCWaves3D() - deprecatedTip("CCWaves3D","cc.Waves3D") - return cc.Waves3D -end -_G["CCWaves3D"] = DeprecatedClass.CCWaves3D() ---CCWaves3D class will be Deprecated,end - ---CCFlipX3D class will be Deprecated,begin -function DeprecatedClass.CCFlipX3D() - deprecatedTip("CCFlipX3D","cc.FlipX3D") - return cc.FlipX3D -end -_G["CCFlipX3D"] = DeprecatedClass.CCFlipX3D() ---CCFlipX3D class will be Deprecated,end - ---CCParticleFireworks class will be Deprecated,begin -function DeprecatedClass.CCParticleFireworks() - deprecatedTip("CCParticleFireworks","cc.ParticleFireworks") - return cc.ParticleFireworks -end -_G["CCParticleFireworks"] = DeprecatedClass.CCParticleFireworks() ---CCParticleFireworks class will be Deprecated,end - ---CCMenuItemImage class will be Deprecated,begin -function DeprecatedClass.CCMenuItemImage() - deprecatedTip("CCMenuItemImage","cc.MenuItemImage") - return cc.MenuItemImage -end -_G["CCMenuItemImage"] = DeprecatedClass.CCMenuItemImage() ---CCMenuItemImage class will be Deprecated,end - ---CCParticleFire class will be Deprecated,begin -function DeprecatedClass.CCParticleFire() - deprecatedTip("CCParticleFire","cc.ParticleFire") - return cc.ParticleFire -end -_G["CCParticleFire"] = DeprecatedClass.CCParticleFire() ---CCParticleFire class will be Deprecated,end - ---CCMenuItem class will be Deprecated,begin -function DeprecatedClass.CCMenuItem() - deprecatedTip("CCMenuItem","cc.MenuItem") - return cc.MenuItem -end -_G["CCMenuItem"] = DeprecatedClass.CCMenuItem() ---CCMenuItem class will be Deprecated,end - ---CCActionEase class will be Deprecated,begin -function DeprecatedClass.CCActionEase() - deprecatedTip("CCActionEase","cc.ActionEase") - return cc.ActionEase -end -_G["CCActionEase"] = DeprecatedClass.CCActionEase() ---CCActionEase class will be Deprecated,end - ---CCTransitionSceneOriented class will be Deprecated,begin -function DeprecatedClass.CCTransitionSceneOriented() - deprecatedTip("CCTransitionSceneOriented","cc.TransitionSceneOriented") - return cc.TransitionSceneOriented -end -_G["CCTransitionSceneOriented"] = DeprecatedClass.CCTransitionSceneOriented() ---CCTransitionSceneOriented class will be Deprecated,end - ---CCTransitionZoomFlipAngular class will be Deprecated,begin -function DeprecatedClass.CCTransitionZoomFlipAngular() - deprecatedTip("CCTransitionZoomFlipAngular","cc.TransitionZoomFlipAngular") - return cc.TransitionZoomFlipAngular -end -_G["CCTransitionZoomFlipAngular"] = DeprecatedClass.CCTransitionZoomFlipAngular() ---CCTransitionZoomFlipAngular class will be Deprecated,end - ---CCEaseIn class will be Deprecated,begin -function DeprecatedClass.CCEaseIn() - deprecatedTip("CCEaseIn","cc.EaseIn") - return cc.EaseIn -end -_G["CCEaseIn"] = DeprecatedClass.CCEaseIn() ---CCEaseIn class will be Deprecated,end - ---CCEaseExponentialInOut class will be Deprecated,begin -function DeprecatedClass.CCEaseExponentialInOut() - deprecatedTip("CCEaseExponentialInOut","cc.EaseExponentialInOut") - return cc.EaseExponentialInOut -end -_G["CCEaseExponentialInOut"] = DeprecatedClass.CCEaseExponentialInOut() ---CCEaseExponentialInOut class will be Deprecated,end - ---CCTransitionFlipX class will be Deprecated,begin -function DeprecatedClass.CCTransitionFlipX() - deprecatedTip("CCTransitionFlipX","cc.TransitionFlipX") - return cc.TransitionFlipX -end -_G["CCTransitionFlipX"] = DeprecatedClass.CCTransitionFlipX() ---CCTransitionFlipX class will be Deprecated,end - ---CCEaseExponentialOut class will be Deprecated,begin -function DeprecatedClass.CCEaseExponentialOut() - deprecatedTip("CCEaseExponentialOut","cc.EaseExponentialOut") - return cc.EaseExponentialOut -end -_G["CCEaseExponentialOut"] = DeprecatedClass.CCEaseExponentialOut() ---CCEaseExponentialOut class will be Deprecated,end - ---CCLabel class will be Deprecated,begin -function DeprecatedClass.CCLabel() - deprecatedTip("CCLabel","cc.Label") - return cc.Label -end -_G["CCLabel"] = DeprecatedClass.CCLabel() ---CCLabel class will be Deprecated,end - ---CCApplication class will be Deprecated,begin -function DeprecatedClass.CCApplication() - deprecatedTip("CCApplication","cc.Application") - return cc.Application -end -_G["CCApplication"] = DeprecatedClass.CCApplication() ---CCApplication class will be Deprecated,end - ---CCDelayTime class will be Deprecated,begin -function DeprecatedClass.CCDelayTime() - deprecatedTip("CCDelayTime","cc.DelayTime") - return cc.DelayTime -end -_G["CCDelayTime"] = DeprecatedClass.CCDelayTime() ---CCDelayTime class will be Deprecated,end - ---CCLabelAtlas class will be Deprecated,begin -function DeprecatedClass.CCLabelAtlas() - deprecatedTip("CCLabelAtlas","cc.LabelAtlas") - return cc.LabelAtlas -end -_G["CCLabelAtlas"] = DeprecatedClass.CCLabelAtlas() ---CCLabelAtlas class will be Deprecated,end - ---CCLabelBMFont class will be Deprecated,begin -function DeprecatedClass.CCLabelBMFont() - deprecatedTip("CCLabelBMFont","cc.LabelBMFont") - return cc.LabelBMFont -end -_G["CCLabelBMFont"] = DeprecatedClass.CCLabelBMFont() ---CCLabelBMFont class will be Deprecated,end - ---CCFadeOutTRTiles class will be Deprecated,begin -function DeprecatedClass.CCFadeOutTRTiles() - deprecatedTip("CCFadeOutTRTiles","cc.FadeOutTRTiles") - return cc.FadeOutTRTiles -end -_G["CCFadeOutTRTiles"] = DeprecatedClass.CCFadeOutTRTiles() ---CCFadeOutTRTiles class will be Deprecated,end - ---CCEaseElasticIn class will be Deprecated,begin -function DeprecatedClass.CCEaseElasticIn() - deprecatedTip("CCEaseElasticIn","cc.EaseElasticIn") - return cc.EaseElasticIn -end -_G["CCEaseElasticIn"] = DeprecatedClass.CCEaseElasticIn() ---CCEaseElasticIn class will be Deprecated,end - ---CCParticleSpiral class will be Deprecated,begin -function DeprecatedClass.CCParticleSpiral() - deprecatedTip("CCParticleSpiral","cc.ParticleSpiral") - return cc.ParticleSpiral -end -_G["CCParticleSpiral"] = DeprecatedClass.CCParticleSpiral() ---CCParticleSpiral class will be Deprecated,end - ---CCFiniteTimeAction class will be Deprecated,begin -function DeprecatedClass.CCFiniteTimeAction() - deprecatedTip("CCFiniteTimeAction","cc.FiniteTimeAction") - return cc.FiniteTimeAction -end -_G["CCFiniteTimeAction"] = DeprecatedClass.CCFiniteTimeAction() ---CCFiniteTimeAction class will be Deprecated,end - ---CCFadeOutDownTiles class will be Deprecated,begin -function DeprecatedClass.CCFadeOutDownTiles() - deprecatedTip("CCFadeOutDownTiles","cc.FadeOutDownTiles") - return cc.FadeOutDownTiles -end -_G["CCFadeOutDownTiles"] = DeprecatedClass.CCFadeOutDownTiles() ---CCFadeOutDownTiles class will be Deprecated,end - ---CCJumpTiles3D class will be Deprecated,begin -function DeprecatedClass.CCJumpTiles3D() - deprecatedTip("CCJumpTiles3D","cc.JumpTiles3D") - return cc.JumpTiles3D -end -_G["CCJumpTiles3D"] = DeprecatedClass.CCJumpTiles3D() ---CCJumpTiles3D class will be Deprecated,end - ---CCEaseBackIn class will be Deprecated,begin -function DeprecatedClass.CCEaseBackIn() - deprecatedTip("CCEaseBackIn","cc.EaseBackIn") - return cc.EaseBackIn -end -_G["CCEaseBackIn"] = DeprecatedClass.CCEaseBackIn() ---CCEaseBackIn class will be Deprecated,end - ---CCSpriteBatchNode class will be Deprecated,begin -function DeprecatedClass.CCSpriteBatchNode() - deprecatedTip("CCSpriteBatchNode","cc.SpriteBatchNode") - return cc.SpriteBatchNode -end -_G["CCSpriteBatchNode"] = DeprecatedClass.CCSpriteBatchNode() ---CCSpriteBatchNode class will be Deprecated,end - ---CCParticleSystem class will be Deprecated,begin -function DeprecatedClass.CCParticleSystem() - deprecatedTip("CCParticleSystem","cc.ParticleSystem") - return cc.ParticleSystem -end -_G["CCParticleSystem"] = DeprecatedClass.CCParticleSystem() ---CCParticleSystem class will be Deprecated,end - ---CCActionTween class will be Deprecated,begin -function DeprecatedClass.CCActionTween() - deprecatedTip("CCActionTween","cc.ActionTween") - return cc.ActionTween -end -_G["CCActionTween"] = DeprecatedClass.CCActionTween() ---CCActionTween class will be Deprecated,end - ---CCTransitionFadeDown class will be Deprecated,begin -function DeprecatedClass.CCTransitionFadeDown() - deprecatedTip("CCTransitionFadeDown","cc.TransitionFadeDown") - return cc.TransitionFadeDown -end -_G["CCTransitionFadeDown"] = DeprecatedClass.CCTransitionFadeDown() ---CCTransitionFadeDown class will be Deprecated,end - ---CCParticleSun class will be Deprecated,begin -function DeprecatedClass.CCParticleSun() - deprecatedTip("CCParticleSun","cc.ParticleSun") - return cc.ParticleSun -end -_G["CCParticleSun"] = DeprecatedClass.CCParticleSun() ---CCParticleSun class will be Deprecated,end - ---CCTransitionProgressHorizontal class will be Deprecated,begin -function DeprecatedClass.CCTransitionProgressHorizontal() - deprecatedTip("CCTransitionProgressHorizontal","cc.TransitionProgressHorizontal") - return cc.TransitionProgressHorizontal -end -_G["CCTransitionProgressHorizontal"] = DeprecatedClass.CCTransitionProgressHorizontal() ---CCTransitionProgressHorizontal class will be Deprecated,end - ---CCRipple3D class will be Deprecated,begin -function DeprecatedClass.CCRipple3D() - deprecatedTip("CCRipple3D","cc.Ripple3D") - return cc.Ripple3D -end -_G["CCRipple3D"] = DeprecatedClass.CCRipple3D() ---CCRipple3D class will be Deprecated,end - ---CCTMXLayer class will be Deprecated,begin -function DeprecatedClass.CCTMXLayer() - deprecatedTip("CCTMXLayer","cc.TMXLayer") - return cc.TMXLayer -end -_G["CCTMXLayer"] = DeprecatedClass.CCTMXLayer() ---CCTMXLayer class will be Deprecated,end - ---CCFlipX class will be Deprecated,begin -function DeprecatedClass.CCFlipX() - deprecatedTip("CCFlipX","cc.FlipX") - return cc.FlipX -end -_G["CCFlipX"] = DeprecatedClass.CCFlipX() ---CCFlipX class will be Deprecated,end - ---CCFlipY class will be Deprecated,begin -function DeprecatedClass.CCFlipY() - deprecatedTip("CCFlipY","cc.FlipY") - return cc.FlipY -end -_G["CCFlipY"] = DeprecatedClass.CCFlipY() ---CCFlipY class will be Deprecated,end - ---CCTransitionSplitCols class will be Deprecated,begin -function DeprecatedClass.CCTransitionSplitCols() - deprecatedTip("CCTransitionSplitCols","cc.TransitionSplitCols") - return cc.TransitionSplitCols -end -_G["CCTransitionSplitCols"] = DeprecatedClass.CCTransitionSplitCols() ---CCTransitionSplitCols class will be Deprecated,end - ---CCTimer class will be Deprecated,begin -function DeprecatedClass.CCTimer() - deprecatedTip("CCTimer","cc.Timer") - return cc.Timer -end -_G["CCTimer"] = DeprecatedClass.CCTimer() ---CCTimer class will be Deprecated,end - ---CCFadeTo class will be Deprecated,begin -function DeprecatedClass.CCFadeTo() - deprecatedTip("CCFadeTo","cc.FadeTo") - return cc.FadeTo -end -_G["CCFadeTo"] = DeprecatedClass.CCFadeTo() ---CCFadeTo class will be Deprecated,end - ---CCRepeatForever class will be Deprecated,begin -function DeprecatedClass.CCRepeatForever() - deprecatedTip("CCRepeatForever","cc.RepeatForever") - return cc.RepeatForever -end -_G["CCRepeatForever"] = DeprecatedClass.CCRepeatForever() ---CCRepeatForever class will be Deprecated,end - ---CCPlace class will be Deprecated,begin -function DeprecatedClass.CCPlace() - deprecatedTip("CCPlace","cc.Place") - return cc.Place -end -_G["CCPlace"] = DeprecatedClass.CCPlace() ---CCPlace class will be Deprecated,end - - ---CCGLProgram class will be Deprecated,begin -function DeprecatedClass.CCGLProgram() - deprecatedTip("CCGLProgram","cc.GLProgram") - return cc.GLProgram -end -_G["CCGLProgram"] = DeprecatedClass.CCGLProgram() ---CCGLProgram class will be Deprecated,end - ---CCEaseBounceOut class will be Deprecated,begin -function DeprecatedClass.CCEaseBounceOut() - deprecatedTip("CCEaseBounceOut","cc.EaseBounceOut") - return cc.EaseBounceOut -end -_G["CCEaseBounceOut"] = DeprecatedClass.CCEaseBounceOut() ---CCEaseBounceOut class will be Deprecated,end - ---CCCardinalSplineBy class will be Deprecated,begin -function DeprecatedClass.CCCardinalSplineBy() - deprecatedTip("CCCardinalSplineBy","cc.CardinalSplineBy") - return cc.CardinalSplineBy -end -_G["CCCardinalSplineBy"] = DeprecatedClass.CCCardinalSplineBy() ---CCCardinalSplineBy class will be Deprecated,end - ---CCSpriteFrameCache class will be Deprecated,begin -function DeprecatedClass.CCSpriteFrameCache() - deprecatedTip("CCSpriteFrameCache","cc.SpriteFrameCache") - return cc.SpriteFrameCache -end -_G["CCSpriteFrameCache"] = DeprecatedClass.CCSpriteFrameCache() ---CCSpriteFrameCache class will be Deprecated,end - ---CCTransitionShrinkGrow class will be Deprecated,begin -function DeprecatedClass.CCTransitionShrinkGrow() - deprecatedTip("CCTransitionShrinkGrow","cc.TransitionShrinkGrow") - return cc.TransitionShrinkGrow -end -_G["CCTransitionShrinkGrow"] = DeprecatedClass.CCTransitionShrinkGrow() ---CCTransitionShrinkGrow class will be Deprecated,end - ---CCSplitCols class will be Deprecated,begin -function DeprecatedClass.CCSplitCols() - deprecatedTip("CCSplitCols","cc.SplitCols") - return cc.SplitCols -end -_G["CCSplitCols"] = DeprecatedClass.CCSplitCols() ---CCSplitCols class will be Deprecated,end - ---CCClippingNode class will be Deprecated,begin -function DeprecatedClass.CCClippingNode() - deprecatedTip("CCClippingNode","cc.ClippingNode") - return cc.ClippingNode -end -_G["CCClippingNode"] = DeprecatedClass.CCClippingNode() ---CCClippingNode class will be Deprecated,end - ---CCEaseBounceInOut class will be Deprecated,begin -function DeprecatedClass.CCEaseBounceInOut() - deprecatedTip("CCEaseBounceInOut","cc.EaseBounceInOut") - return cc.EaseBounceInOut -end -_G["CCEaseBounceInOut"] = DeprecatedClass.CCEaseBounceInOut() ---CCEaseBounceInOut class will be Deprecated,end - ---CCLiquid class will be Deprecated,begin -function DeprecatedClass.CCLiquid() - deprecatedTip("CCLiquid","cc.Liquid") - return cc.Liquid -end -_G["CCLiquid"] = DeprecatedClass.CCLiquid() ---CCLiquid class will be Deprecated,end - ---CCParticleFlower class will be Deprecated,begin -function DeprecatedClass.CCParticleFlower() - deprecatedTip("CCParticleFlower","cc.ParticleFlower") - return cc.ParticleFlower -end -_G["CCParticleFlower"] = DeprecatedClass.CCParticleFlower() ---CCParticleFlower class will be Deprecated,end - ---CCParticleSmoke class will be Deprecated,begin -function DeprecatedClass.CCParticleSmoke() - deprecatedTip("CCParticleSmoke","cc.ParticleSmoke") - return cc.ParticleSmoke -end -_G["CCParticleSmoke"] = DeprecatedClass.CCParticleSmoke() ---CCParticleSmoke class will be Deprecated,end - ---CCImage class will be Deprecated,begin -function DeprecatedClass.CCImage() - deprecatedTip("CCImage","cc.Image") - return cc.Image -end -_G["CCImage"] = DeprecatedClass.CCImage() ---CCImage class will be Deprecated,end - ---CCTurnOffTiles class will be Deprecated,begin -function DeprecatedClass.CCTurnOffTiles() - deprecatedTip("CCTurnOffTiles","cc.TurnOffTiles") - return cc.TurnOffTiles -end -_G["CCTurnOffTiles"] = DeprecatedClass.CCTurnOffTiles() ---CCTurnOffTiles class will be Deprecated,end - ---CCBlink class will be Deprecated,begin -function DeprecatedClass.CCBlink() - deprecatedTip("CCBlink","cc.Blink") - return cc.Blink -end -_G["CCBlink"] = DeprecatedClass.CCBlink() ---CCBlink class will be Deprecated,end - ---CCShaderCache class will be Deprecated,begin -function DeprecatedClass.CCShaderCache() - deprecatedTip("CCShaderCache","cc.ShaderCache") - return cc.ShaderCache -end -_G["CCShaderCache"] = DeprecatedClass.CCShaderCache() ---CCShaderCache class will be Deprecated,end - ---CCJumpTo class will be Deprecated,begin -function DeprecatedClass.CCJumpTo() - deprecatedTip("CCJumpTo","cc.JumpTo") - return cc.JumpTo -end -_G["CCJumpTo"] = DeprecatedClass.CCJumpTo() ---CCJumpTo class will be Deprecated,end - ---CCAtlasNode class will be Deprecated,begin -function DeprecatedClass.CCAtlasNode() - deprecatedTip("CCAtlasNode","cc.AtlasNode") - return cc.AtlasNode -end -_G["CCAtlasNode"] = DeprecatedClass.CCAtlasNode() ---CCAtlasNode class will be Deprecated,end - ---CCTransitionJumpZoom class will be Deprecated,begin -function DeprecatedClass.CCTransitionJumpZoom() - deprecatedTip("CCTransitionJumpZoom","cc.TransitionJumpZoom") - return cc.TransitionJumpZoom -end -_G["CCTransitionJumpZoom"] = DeprecatedClass.CCTransitionJumpZoom() ---CCTransitionJumpZoom class will be Deprecated,end - ---CCTransitionProgressVertical class will be Deprecated,begin -function DeprecatedClass.CCTransitionProgressVertical() - deprecatedTip("CCTransitionProgressVertical","cc.TransitionProgressVertical") - return cc.TransitionProgressVertical -end -_G["CCTransitionProgressVertical"] = DeprecatedClass.CCTransitionProgressVertical() ---CCTransitionProgressVertical class will be Deprecated,end - ---CCAnimationFrame class will be Deprecated,begin -function DeprecatedClass.CCAnimationFrame() - deprecatedTip("CCAnimationFrame","cc.AnimationFrame") - return cc.AnimationFrame -end -_G["CCAnimationFrame"] = DeprecatedClass.CCAnimationFrame() ---CCAnimationFrame class will be Deprecated,end - ---CCTintTo class will be Deprecated,begin -function DeprecatedClass.CCTintTo() - deprecatedTip("CCTintTo","cc.TintTo") - return cc.TintTo -end -_G["CCTintTo"] = DeprecatedClass.CCTintTo() ---CCTintTo class will be Deprecated,end - ---CCTiledGrid3DAction class will be Deprecated,begin -function DeprecatedClass.CCTiledGrid3DAction() - deprecatedTip("CCTiledGrid3DAction","cc.TiledGrid3DAction") - return cc.TiledGrid3DAction -end -_G["CCTiledGrid3DAction"] = DeprecatedClass.CCTiledGrid3DAction() ---CCTiledGrid3DAction class will be Deprecated,end - ---CCTMXTilesetInfo class will be Deprecated,begin -function DeprecatedClass.CCTMXTilesetInfo() - deprecatedTip("CCTMXTilesetInfo","cc.TMXTilesetInfo") - return cc.TMXTilesetInfo -end -_G["CCTMXTilesetInfo"] = DeprecatedClass.CCTMXTilesetInfo() ---CCTMXTilesetInfo class will be Deprecated,end - ---CCTMXObjectGroup class will be Deprecated,begin -function DeprecatedClass.CCTMXObjectGroup() - deprecatedTip("CCTMXObjectGroup","cc.TMXObjectGroup") - return cc.TMXObjectGroup -end -_G["CCTMXObjectGroup"] = DeprecatedClass.CCTMXObjectGroup() ---CCTMXObjectGroup class will be Deprecated,end - ---CCParticleGalaxy class will be Deprecated,begin -function DeprecatedClass.CCParticleGalaxy() - deprecatedTip("CCParticleGalaxy","cc.ParticleGalaxy") - return cc.ParticleGalaxy -end -_G["CCParticleGalaxy"] = DeprecatedClass.CCParticleGalaxy() ---CCParticleGalaxy class will be Deprecated,end - ---CCTwirl class will be Deprecated,begin -function DeprecatedClass.CCTwirl() - deprecatedTip("CCTwirl","cc.Twirl") - return cc.Twirl -end -_G["CCTwirl"] = DeprecatedClass.CCTwirl() ---CCTwirl class will be Deprecated,end - ---CCMenuItemLabel class will be Deprecated,begin -function DeprecatedClass.CCMenuItemLabel() - deprecatedTip("CCMenuItemLabel","cc.MenuItemLabel") - return cc.MenuItemLabel -end -_G["CCMenuItemLabel"] = DeprecatedClass.CCMenuItemLabel() ---CCMenuItemLabel class will be Deprecated,end - ---CCLayerColor class will be Deprecated,begin -function DeprecatedClass.CCLayerColor() - deprecatedTip("CCLayerColor","cc.LayerColor") - return cc.LayerColor -end -_G["CCLayerColor"] = DeprecatedClass.CCLayerColor() ---CCLayerColor class will be Deprecated,end - ---CCFadeOutBLTiles class will be Deprecated,begin -function DeprecatedClass.CCFadeOutBLTiles() - deprecatedTip("CCFadeOutBLTiles","cc.FadeOutBLTiles") - return cc.FadeOutBLTiles -end -_G["CCFadeOutBLTiles"] = DeprecatedClass.CCFadeOutBLTiles() ---CCFadeOutBLTiles class will be Deprecated,end - ---CCTransitionProgress class will be Deprecated,begin -function DeprecatedClass.CCTransitionProgress() - deprecatedTip("CCTransitionProgress","cc.TransitionProgress") - return cc.TransitionProgress -end -_G["CCTransitionProgress"] = DeprecatedClass.CCTransitionProgress() ---CCTransitionProgress class will be Deprecated,end - ---CCEaseRateAction class will be Deprecated,begin -function DeprecatedClass.CCEaseRateAction() - deprecatedTip("CCEaseRateAction","cc.EaseRateAction") - return cc.EaseRateAction -end -_G["CCEaseRateAction"] = DeprecatedClass.CCEaseRateAction() ---CCEaseRateAction class will be Deprecated,end - ---CCLayerGradient class will be Deprecated,begin -function DeprecatedClass.CCLayerGradient() - deprecatedTip("CCLayerGradient","cc.LayerGradient") - return cc.LayerGradient -end -_G["CCLayerGradient"] = DeprecatedClass.CCLayerGradient() ---CCLayerGradient class will be Deprecated,end - ---CCMenuItemSprite class will be Deprecated,begin -function DeprecatedClass.CCMenuItemSprite() - deprecatedTip("CCMenuItemSprite","cc.MenuItemSprite") - return cc.MenuItemSprite -end -_G["CCMenuItemSprite"] = DeprecatedClass.CCMenuItemSprite() ---CCMenuItemSprite class will be Deprecated,end - ---CCNode class will be Deprecated,begin -function DeprecatedClass.CCNode() - deprecatedTip("CCNode","cc.Node") - return cc.Node -end -_G["CCNode"] = DeprecatedClass.CCNode() ---CCNode class will be Deprecated,end - ---CCToggleVisibility class will be Deprecated,begin -function DeprecatedClass.CCToggleVisibility() - deprecatedTip("CCToggleVisibility","cc.ToggleVisibility") - return cc.ToggleVisibility -end -_G["CCToggleVisibility"] = DeprecatedClass.CCToggleVisibility() ---CCToggleVisibility class will be Deprecated,end - ---CCRepeat class will be Deprecated,begin -function DeprecatedClass.CCRepeat() - deprecatedTip("CCRepeat","cc.Repeat") - return cc.Repeat -end -_G["CCRepeat"] = DeprecatedClass.CCRepeat() ---CCRepeat class will be Deprecated,end - ---CCRenderTexture class will be Deprecated,begin -function DeprecatedClass.CCRenderTexture() - deprecatedTip("CCRenderTexture","cc.RenderTexture") - return cc.RenderTexture -end -_G["CCRenderTexture"] = DeprecatedClass.CCRenderTexture() ---CCRenderTexture class will be Deprecated,end - ---CCTransitionFlipY class will be Deprecated,begin -function DeprecatedClass.CCTransitionFlipY() - deprecatedTip("CCTransitionFlipY","cc.TransitionFlipY") - return cc.TransitionFlipY -end -_G["CCTransitionFlipY"] = DeprecatedClass.CCTransitionFlipY() ---CCTransitionFlipY class will be Deprecated,end - ---CCLayerMultiplex class will be Deprecated,begin -function DeprecatedClass.CCLayerMultiplex() - deprecatedTip("CCLayerMultiplex","cc.LayerMultiplex") - return cc.LayerMultiplex -end -_G["CCLayerMultiplex"] = DeprecatedClass.CCLayerMultiplex() ---CCLayerMultiplex class will be Deprecated,end - ---CCTMXLayerInfo class will be Deprecated,begin -function DeprecatedClass.CCTMXLayerInfo() - deprecatedTip("CCTMXLayerInfo","cc.TMXLayerInfo") - return cc.TMXLayerInfo -end -_G["CCTMXLayerInfo"] = DeprecatedClass.CCTMXLayerInfo() ---CCTMXLayerInfo class will be Deprecated,end - ---CCEaseBackInOut class will be Deprecated,begin -function DeprecatedClass.CCEaseBackInOut() - deprecatedTip("CCEaseBackInOut","cc.EaseBackInOut") - return cc.EaseBackInOut -end -_G["CCEaseBackInOut"] = DeprecatedClass.CCEaseBackInOut() ---CCEaseBackInOut class will be Deprecated,end - ---CCActionInstant class will be Deprecated,begin -function DeprecatedClass.CCActionInstant() - deprecatedTip("CCActionInstant","cc.ActionInstant") - return cc.ActionInstant -end -_G["CCActionInstant"] = DeprecatedClass.CCActionInstant() ---CCActionInstant class will be Deprecated,end - ---CCTargetedAction class will be Deprecated,begin -function DeprecatedClass.CCTargetedAction() - deprecatedTip("CCTargetedAction","cc.TargetedAction") - return cc.TargetedAction -end -_G["CCTargetedAction"] = DeprecatedClass.CCTargetedAction() ---CCTargetedAction class will be Deprecated,end - ---CCDrawNode class will be Deprecated,begin -function DeprecatedClass.CCDrawNode() - deprecatedTip("CCDrawNode","cc.DrawNode") - return cc.DrawNode -end -_G["CCDrawNode"] = DeprecatedClass.CCDrawNode() ---CCDrawNode class will be Deprecated,end - ---CCTransitionTurnOffTiles class will be Deprecated,begin -function DeprecatedClass.CCTransitionTurnOffTiles() - deprecatedTip("CCTransitionTurnOffTiles","cc.TransitionTurnOffTiles") - return cc.TransitionTurnOffTiles -end -_G["CCTransitionTurnOffTiles"] = DeprecatedClass.CCTransitionTurnOffTiles() ---CCTransitionTurnOffTiles class will be Deprecated,end - ---CCRotateTo class will be Deprecated,begin -function DeprecatedClass.CCRotateTo() - deprecatedTip("CCRotateTo","cc.RotateTo") - return cc.RotateTo -end -_G["CCRotateTo"] = DeprecatedClass.CCRotateTo() ---CCRotateTo class will be Deprecated,end - ---CCTransitionSplitRows class will be Deprecated,begin -function DeprecatedClass.CCTransitionSplitRows() - deprecatedTip("CCTransitionSplitRows","cc.TransitionSplitRows") - return cc.TransitionSplitRows -end -_G["CCTransitionSplitRows"] = DeprecatedClass.CCTransitionSplitRows() ---CCTransitionSplitRows class will be Deprecated,end - ---CCTransitionProgressRadialCCW class will be Deprecated,begin -function DeprecatedClass.CCTransitionProgressRadialCCW() - deprecatedTip("CCTransitionProgressRadialCCW","cc.TransitionProgressRadialCCW") - return cc.TransitionProgressRadialCCW -end -_G["CCTransitionProgressRadialCCW"] = DeprecatedClass.CCTransitionProgressRadialCCW() ---CCTransitionProgressRadialCCW class will be Deprecated,end - ---CCScaleTo class will be Deprecated,begin -function DeprecatedClass.CCScaleTo() - deprecatedTip("CCScaleTo","cc.ScaleTo") - return cc.ScaleTo -end -_G["CCScaleTo"] = DeprecatedClass.CCScaleTo() ---CCScaleTo class will be Deprecated,end - ---CCTransitionPageTurn class will be Deprecated,begin -function DeprecatedClass.CCTransitionPageTurn() - deprecatedTip("CCTransitionPageTurn","cc.TransitionPageTurn") - return cc.TransitionPageTurn -end -_G["CCTransitionPageTurn"] = DeprecatedClass.CCTransitionPageTurn() ---CCTransitionPageTurn class will be Deprecated,end - ---CCParticleExplosion class will be Deprecated,begin -function DeprecatedClass.CCParticleExplosion() - deprecatedTip("CCParticleExplosion","cc.ParticleExplosion") - return cc.ParticleExplosion -end -_G["CCParticleExplosion"] = DeprecatedClass.CCParticleExplosion() ---CCParticleExplosion class will be Deprecated,end - ---CCMenu class will be Deprecated,begin -function DeprecatedClass.CCMenu() - deprecatedTip("CCMenu","cc.Menu") - return cc.Menu -end -_G["CCMenu"] = DeprecatedClass.CCMenu() ---CCMenu class will be Deprecated,end - ---CCTexture2D class will be Deprecated,begin -function DeprecatedClass.CCTexture2D() - deprecatedTip("CCTexture2D","cc.Texture2D") - return cc.Texture2D -end -_G["CCTexture2D"] = DeprecatedClass.CCTexture2D() ---CCTexture2D class will be Deprecated,end - ---CCActionManager class will be Deprecated,begin -function DeprecatedClass.CCActionManager() - deprecatedTip("CCActionManager","cc.ActionManager") - return cc.ActionManager -end -_G["CCActionManager"] = DeprecatedClass.CCActionManager() ---CCActionManager class will be Deprecated,end - ---CCParticleBatchNode class will be Deprecated,begin -function DeprecatedClass.CCParticleBatchNode() - deprecatedTip("CCParticleBatchNode","cc.ParticleBatchNode") - return cc.ParticleBatchNode -end -_G["CCParticleBatchNode"] = DeprecatedClass.CCParticleBatchNode() ---CCParticleBatchNode class will be Deprecated,end - ---CCTransitionZoomFlipX class will be Deprecated,begin -function DeprecatedClass.CCTransitionZoomFlipX() - deprecatedTip("CCTransitionZoomFlipX","cc.TransitionZoomFlipX") - return cc.TransitionZoomFlipX -end -_G["CCTransitionZoomFlipX"] = DeprecatedClass.CCTransitionZoomFlipX() ---CCTransitionZoomFlipX class will be Deprecated,end - ---CCScaleBy class will be Deprecated,begin -function DeprecatedClass.CCScaleBy() - deprecatedTip("CCScaleBy","cc.ScaleBy") - return cc.ScaleBy -end -_G["CCScaleBy"] = DeprecatedClass.CCScaleBy() ---CCScaleBy class will be Deprecated,end - ---CCTileMapAtlas class will be Deprecated,begin -function DeprecatedClass.CCTileMapAtlas() - deprecatedTip("CCTileMapAtlas","cc.TileMapAtlas") - return cc.TileMapAtlas -end -_G["CCTileMapAtlas"] = DeprecatedClass.CCTileMapAtlas() ---CCTileMapAtlas class will be Deprecated,end - ---CCAction class will be Deprecated,begin -function DeprecatedClass.CCAction() - deprecatedTip("CCAction","cc.Action") - return cc.Action -end -_G["CCAction"] = DeprecatedClass.CCAction() ---CCAction class will be Deprecated,end - ---CCLens3D class will be Deprecated,begin -function DeprecatedClass.CCLens3D() - deprecatedTip("CCLens3D","cc.Lens3D") - return cc.Lens3D -end -_G["CCLens3D"] = DeprecatedClass.CCLens3D() ---CCLens3D class will be Deprecated,end - ---CCAnimation class will be Deprecated,begin -function DeprecatedClass.CCAnimation() - deprecatedTip("CCAnimation","cc.Animation") - return cc.Animation -end -_G["CCAnimation"] = DeprecatedClass.CCAnimation() ---CCAnimation class will be Deprecated,end - ---CCTransitionSlideInT class will be Deprecated,begin -function DeprecatedClass.CCTransitionSlideInT() - deprecatedTip("CCTransitionSlideInT","cc.TransitionSlideInT") - return cc.TransitionSlideInT -end -_G["CCTransitionSlideInT"] = DeprecatedClass.CCTransitionSlideInT() ---CCTransitionSlideInT class will be Deprecated,end - ---CCSpawn class will be Deprecated,begin -function DeprecatedClass.CCSpawn() - deprecatedTip("CCSpawn","cc.Spawn") - return cc.Spawn -end -_G["CCSpawn"] = DeprecatedClass.CCSpawn() ---CCSpawn class will be Deprecated,end - ---CCSet class will be Deprecated,begin -function DeprecatedClass.CCSet() - deprecatedTip("CCSet","cc.Set") - return cc.Set -end -_G["CCSet"] = DeprecatedClass.CCSet() ---CCSet class will be Deprecated,end - ---CCShakyTiles3D class will be Deprecated,begin -function DeprecatedClass.CCShakyTiles3D() - deprecatedTip("CCShakyTiles3D","cc.ShakyTiles3D") - return cc.ShakyTiles3D -end -_G["CCShakyTiles3D"] = DeprecatedClass.CCShakyTiles3D() ---CCShakyTiles3D class will be Deprecated,end - ---CCPageTurn3D class will be Deprecated,begin -function DeprecatedClass.CCPageTurn3D() - deprecatedTip("CCPageTurn3D","cc.PageTurn3D") - return cc.PageTurn3D -end -_G["CCPageTurn3D"] = DeprecatedClass.CCPageTurn3D() ---CCPageTurn3D class will be Deprecated,end - ---CCGrid3D class will be Deprecated,begin -function DeprecatedClass.CCGrid3D() - deprecatedTip("CCGrid3D","cc.Grid3D") - return cc.Grid3D -end -_G["CCGrid3D"] = DeprecatedClass.CCGrid3D() ---CCGrid3D class will be Deprecated,end - ---CCTransitionProgressInOut class will be Deprecated,begin -function DeprecatedClass.CCTransitionProgressInOut() - deprecatedTip("CCTransitionProgressInOut","cc.TransitionProgressInOut") - return cc.TransitionProgressInOut -end -_G["CCTransitionProgressInOut"] = DeprecatedClass.CCTransitionProgressInOut() ---CCTransitionProgressInOut class will be Deprecated,end - ---CCTransitionFadeBL class will be Deprecated,begin -function DeprecatedClass.CCTransitionFadeBL() - deprecatedTip("CCTransitionFadeBL","cc.TransitionFadeBL") - return cc.TransitionFadeBL -end -_G["CCTransitionFadeBL"] = DeprecatedClass.CCTransitionFadeBL() ---CCTransitionFadeBL class will be Deprecated,end - ---CCCamera class will be Deprecated,begin -function DeprecatedClass.CCCamera() - deprecatedTip("CCCamera","cc.Camera") - return cc.Camera -end -_G["CCCamera"] = DeprecatedClass.CCCamera() ---CCCamera class will be Deprecated,end - ---CCLayerRGBA class will be Deprecated,begin -function DeprecatedClass.CCLayerRGBA() - deprecatedTip("CCLayerRGBA","cc.Layer") - return cc.Layer -end -_G["CCLayerRGBA"] = DeprecatedClass.CCLayerRGBA() ---CCLayerRGBA class will be Deprecated,end - ---LayerRGBA class will be Deprecated,begin -function DeprecatedClass.LayerRGBA() - deprecatedTip("cc.LayerRGBA","cc.Layer") - return cc.Layer -end -_G["cc"]["LayerRGBA"] = DeprecatedClass.LayerRGBA() ---LayerRGBA class will be Deprecated,end - ---CCBezierTo class will be Deprecated,begin -function DeprecatedClass.CCBezierTo() - deprecatedTip("CCBezierTo","cc.BezierTo") - return cc.BezierTo -end -_G["CCBezierTo"] = DeprecatedClass.CCBezierTo() ---CCBezierTo class will be Deprecated,end - ---CCFollow class will be Deprecated,begin -function DeprecatedClass.CCFollow() - deprecatedTip("CCFollow","cc.Follow") - return cc.Follow -end -_G["CCFollow"] = DeprecatedClass.CCFollow() ---CCFollow class will be Deprecated,end - ---CCTintBy class will be Deprecated,begin -function DeprecatedClass.CCTintBy() - deprecatedTip("CCTintBy","cc.TintBy") - return cc.TintBy -end -_G["CCTintBy"] = DeprecatedClass.CCTintBy() ---CCTintBy class will be Deprecated,end - ---CCActionInterval class will be Deprecated,begin -function DeprecatedClass.CCActionInterval() - deprecatedTip("CCActionInterval","cc.ActionInterval") - return cc.ActionInterval -end -_G["CCActionInterval"] = DeprecatedClass.CCActionInterval() ---CCActionInterval class will be Deprecated,end - ---CCAnimate class will be Deprecated,begin -function DeprecatedClass.CCAnimate() - deprecatedTip("CCAnimate","cc.Animate") - return cc.Animate -end -_G["CCAnimate"] = DeprecatedClass.CCAnimate() ---CCAnimate class will be Deprecated,end - ---CCProgressTimer class will be Deprecated,begin -function DeprecatedClass.CCProgressTimer() - deprecatedTip("CCProgressTimer","cc.ProgressTimer") - return cc.ProgressTimer -end -_G["CCProgressTimer"] = DeprecatedClass.CCProgressTimer() ---CCProgressTimer class will be Deprecated,end - ---CCParticleMeteor class will be Deprecated,begin -function DeprecatedClass.CCParticleMeteor() - deprecatedTip("CCParticleMeteor","cc.ParticleMeteor") - return cc.ParticleMeteor -end -_G["CCParticleMeteor"] = DeprecatedClass.CCParticleMeteor() ---CCParticleMeteor class will be Deprecated,end - ---CCTransitionFadeTR class will be Deprecated,begin -function DeprecatedClass.CCTransitionFadeTR() - deprecatedTip("CCTransitionFadeTR","cc.TransitionFadeTR") - return cc.TransitionFadeTR -end -_G["CCTransitionFadeTR"] = DeprecatedClass.CCTransitionFadeTR() ---CCTransitionFadeTR class will be Deprecated,end - ---CCCatmullRomTo class will be Deprecated,begin -function DeprecatedClass.CCCatmullRomTo() - deprecatedTip("CCCatmullRomTo","cc.CatmullRomTo") - return cc.CatmullRomTo -end -_G["CCCatmullRomTo"] = DeprecatedClass.CCCatmullRomTo() ---CCCatmullRomTo class will be Deprecated,end - ---CCTransitionZoomFlipY class will be Deprecated,begin -function DeprecatedClass.CCTransitionZoomFlipY() - deprecatedTip("CCTransitionZoomFlipY","cc.TransitionZoomFlipY") - return cc.TransitionZoomFlipY -end -_G["CCTransitionZoomFlipY"] = DeprecatedClass.CCTransitionZoomFlipY() ---CCTransitionZoomFlipY class will be Deprecated,end - ---CCTransitionCrossFade class will be Deprecated,begin -function DeprecatedClass.CCTransitionCrossFade() - deprecatedTip("CCTransitionCrossFade","cc.TransitionCrossFade") - return cc.TransitionCrossFade -end -_G["CCTransitionCrossFade"] = DeprecatedClass.CCTransitionCrossFade() ---CCTransitionCrossFade class will be Deprecated,end - ---CCGridBase class will be Deprecated,begin -function DeprecatedClass.CCGridBase() - deprecatedTip("CCGridBase","cc.GridBase") - return cc.GridBase -end -_G["CCGridBase"] = DeprecatedClass.CCGridBase() ---CCGridBase class will be Deprecated,end - ---CCSkewTo class will be Deprecated,begin -function DeprecatedClass.CCSkewTo() - deprecatedTip("CCSkewTo","cc.SkewTo") - return cc.SkewTo -end -_G["CCSkewTo"] = DeprecatedClass.CCSkewTo() ---CCSkewTo class will be Deprecated,end - ---CCCardinalSplineTo class will be Deprecated,begin -function DeprecatedClass.CCCardinalSplineTo() - deprecatedTip("CCCardinalSplineTo","cc.CardinalSplineTo") - return cc.CardinalSplineTo -end -_G["CCCardinalSplineTo"] = DeprecatedClass.CCCardinalSplineTo() ---CCCardinalSplineTo class will be Deprecated,end - ---CCTMXMapInfo class will be Deprecated,begin -function DeprecatedClass.CCTMXMapInfo() - deprecatedTip("CCTMXMapInfo","cc.TMXMapInfo") - return cc.TMXMapInfo -end -_G["CCTMXMapInfo"] = DeprecatedClass.CCTMXMapInfo() ---CCTMXMapInfo class will be Deprecated,end - ---CCEaseExponentialIn class will be Deprecated,begin -function DeprecatedClass.CCEaseExponentialIn() - deprecatedTip("CCEaseExponentialIn","cc.EaseExponentialIn") - return cc.EaseExponentialIn -end -_G["CCEaseExponentialIn"] = DeprecatedClass.CCEaseExponentialIn() ---CCEaseExponentialIn class will be Deprecated,end - ---CCReuseGrid class will be Deprecated,begin -function DeprecatedClass.CCReuseGrid() - deprecatedTip("CCReuseGrid","cc.ReuseGrid") - return cc.ReuseGrid -end -_G["CCReuseGrid"] = DeprecatedClass.CCReuseGrid() ---CCReuseGrid class will be Deprecated,end - ---CCMenuItemAtlasFont class will be Deprecated,begin -function DeprecatedClass.CCMenuItemAtlasFont() - deprecatedTip("CCMenuItemAtlasFont","cc.MenuItemAtlasFont") - return cc.MenuItemAtlasFont -end -_G["CCMenuItemAtlasFont"] = DeprecatedClass.CCMenuItemAtlasFont() ---CCMenuItemAtlasFont class will be Deprecated,end - ---CCSpriteFrame class will be Deprecated,begin -function DeprecatedClass.CCSpriteFrame() - deprecatedTip("CCSpriteFrame","cc.SpriteFrame") - return cc.SpriteFrame -end -_G["CCSpriteFrame"] = DeprecatedClass.CCSpriteFrame() ---CCSpriteFrame class will be Deprecated,end - ---CCSplitRows class will be Deprecated,begin -function DeprecatedClass.CCSplitRows() - deprecatedTip("CCSplitRows","cc.SplitRows") - return cc.SplitRows -end -_G["CCSplitRows"] = DeprecatedClass.CCSplitRows() ---CCSplitRows class will be Deprecated,end - ---CCSprite class will be Deprecated,begin -function DeprecatedClass.CCSprite() - deprecatedTip("CCSprite","cc.Sprite") - return cc.Sprite -end -_G["CCSprite"] = DeprecatedClass.CCSprite() ---CCSprite class will be Deprecated,end - ---CCOrbitCamera class will be Deprecated,begin -function DeprecatedClass.CCOrbitCamera() - deprecatedTip("CCOrbitCamera","cc.OrbitCamera") - return cc.OrbitCamera -end -_G["CCOrbitCamera"] = DeprecatedClass.CCOrbitCamera() ---CCOrbitCamera class will be Deprecated,end - ---CCUserDefault class will be Deprecated,begin -function DeprecatedClass.CCUserDefault() - deprecatedTip("CCUserDefault","cc.UserDefault") - return cc.UserDefault -end -_G["CCUserDefault"] = DeprecatedClass.CCUserDefault() ---CCUserDefault class will be Deprecated,end - ---CCFadeOutUpTiles class will be Deprecated,begin -function DeprecatedClass.CCFadeOutUpTiles() - deprecatedTip("CCFadeOutUpTiles","cc.FadeOutUpTiles") - return cc.FadeOutUpTiles -end -_G["CCFadeOutUpTiles"] = DeprecatedClass.CCFadeOutUpTiles() ---CCFadeOutUpTiles class will be Deprecated,end - ---CCParticleRain class will be Deprecated,begin -function DeprecatedClass.CCParticleRain() - deprecatedTip("CCParticleRain","cc.ParticleRain") - return cc.ParticleRain -end -_G["CCParticleRain"] = DeprecatedClass.CCParticleRain() ---CCParticleRain class will be Deprecated,end - ---CCWaves class will be Deprecated,begin -function DeprecatedClass.CCWaves() - deprecatedTip("CCWaves","cc.Waves") - return cc.Waves -end -_G["CCWaves"] = DeprecatedClass.CCWaves() ---CCWaves class will be Deprecated,end - ---CCEaseOut class will be Deprecated,begin -function DeprecatedClass.CCEaseOut() - deprecatedTip("CCEaseOut","cc.EaseOut") - return cc.EaseOut -end -_G["CCEaseOut"] = DeprecatedClass.CCEaseOut() ---CCEaseOut class will be Deprecated,end - ---CCEaseBounceIn class will be Deprecated,begin -function DeprecatedClass.CCEaseBounceIn() - deprecatedTip("CCEaseBounceIn","cc.EaseBounceIn") - return cc.EaseBounceIn -end -_G["CCEaseBounceIn"] = DeprecatedClass.CCEaseBounceIn() ---CCEaseBounceIn class will be Deprecated,end - ---CCMenuItemFont class will be Deprecated,begin -function DeprecatedClass.CCMenuItemFont() - deprecatedTip("CCMenuItemFont","cc.MenuItemFont") - return cc.MenuItemFont -end -_G["CCMenuItemFont"] = DeprecatedClass.CCMenuItemFont() ---CCMenuItemFont class will be Deprecated,end - ---CCEaseSineOut class will be Deprecated,begin -function DeprecatedClass.CCEaseSineOut() - deprecatedTip("CCEaseSineOut","cc.EaseSineOut") - return cc.EaseSineOut -end -_G["CCEaseSineOut"] = DeprecatedClass.CCEaseSineOut() ---CCEaseSineOut class will be Deprecated,end - ---CCTextureCache class will be Deprecated,begin -function DeprecatedClass.CCTextureCache() - deprecatedTip("CCTextureCache","cc.TextureCache") - return cc.TextureCache -end -_G["CCTextureCache"] = DeprecatedClass.CCTextureCache() ---CCTextureCache class will be Deprecated,end - ---CCTiledGrid3D class will be Deprecated,begin -function DeprecatedClass.CCTiledGrid3D() - deprecatedTip("CCTiledGrid3D","cc.TiledGrid3D") - return cc.TiledGrid3D -end -_G["CCTiledGrid3D"] = DeprecatedClass.CCTiledGrid3D() ---CCTiledGrid3D class will be Deprecated,end - ---CCRemoveSelf class will be Deprecated,begin -function DeprecatedClass.CCRemoveSelf() - deprecatedTip("CCRemoveSelf","cc.RemoveSelf") - return cc.RemoveSelf -end -_G["CCRemoveSelf"] = DeprecatedClass.CCRemoveSelf() ---CCRemoveSelf class will be Deprecated,end - ---CCLabelTTF class will be Deprecated,begin -function DeprecatedClass.CCLabelTTF() - deprecatedTip("CCLabelTTF","cc.LabelTTF") - return cc.LabelTTF -end -_G["CCLabelTTF"] = DeprecatedClass.CCLabelTTF() ---CCLabelTTF class will be Deprecated,end - ---CCTouch class will be Deprecated,begin -function DeprecatedClass.CCTouch() - deprecatedTip("CCTouch","cc.Touch") - return cc.Touch -end -_G["CCTouch"] = DeprecatedClass.CCTouch() ---CCTouch class will be Deprecated,end - ---CCMoveBy class will be Deprecated,begin -function DeprecatedClass.CCMoveBy() - deprecatedTip("CCMoveBy","cc.MoveBy") - return cc.MoveBy -end -_G["CCMoveBy"] = DeprecatedClass.CCMoveBy() ---CCMoveBy class will be Deprecated,end - ---CCMotionStreak class will be Deprecated,begin -function DeprecatedClass.CCMotionStreak() - deprecatedTip("CCMotionStreak","cc.MotionStreak") - return cc.MotionStreak -end -_G["CCMotionStreak"] = DeprecatedClass.CCMotionStreak() ---CCMotionStreak class will be Deprecated,end - ---CCRotateBy class will be Deprecated,begin -function DeprecatedClass.CCRotateBy() - deprecatedTip("CCRotateBy","cc.RotateBy") - return cc.RotateBy -end -_G["CCRotateBy"] = DeprecatedClass.CCRotateBy() ---CCRotateBy class will be Deprecated,end - ---CCFileUtils class will be Deprecated,begin -function DeprecatedClass.CCFileUtils() - deprecatedTip("CCFileUtils","cc.FileUtils") - return cc.FileUtils -end -_G["CCFileUtils"] = DeprecatedClass.CCFileUtils() ---CCFileUtils class will be Deprecated,end - ---CCBezierBy class will be Deprecated,begin -function DeprecatedClass.CCBezierBy() - deprecatedTip("CCBezierBy","cc.BezierBy") - return cc.BezierBy -end -_G["CCBezierBy"] = DeprecatedClass.CCBezierBy() ---CCBezierBy class will be Deprecated,end - ---CCTransitionFade class will be Deprecated,begin -function DeprecatedClass.CCTransitionFade() - deprecatedTip("CCTransitionFade","cc.TransitionFade") - return cc.TransitionFade -end -_G["CCTransitionFade"] = DeprecatedClass.CCTransitionFade() ---CCTransitionFade class will be Deprecated,end - ---CCTransitionProgressOutIn class will be Deprecated,begin -function DeprecatedClass.CCTransitionProgressOutIn() - deprecatedTip("CCTransitionProgressOutIn","cc.TransitionProgressOutIn") - return cc.TransitionProgressOutIn -end -_G["CCTransitionProgressOutIn"] = DeprecatedClass.CCTransitionProgressOutIn() ---CCTransitionProgressOutIn class will be Deprecated,end - ---CCCatmullRomBy class will be Deprecated,begin -function DeprecatedClass.CCCatmullRomBy() - deprecatedTip("CCCatmullRomBy","cc.CatmullRomBy") - return cc.CatmullRomBy -end -_G["CCCatmullRomBy"] = DeprecatedClass.CCCatmullRomBy() ---CCCatmullRomBy class will be Deprecated,end - ---CCGridAction class will be Deprecated,begin -function DeprecatedClass.CCGridAction() - deprecatedTip("CCGridAction","cc.GridAction") - return cc.GridAction -end -_G["CCGridAction"] = DeprecatedClass.CCGridAction() ---CCGridAction class will be Deprecated,end - ---CCShaky3D class will be Deprecated,begin -function DeprecatedClass.CCShaky3D() - deprecatedTip("CCShaky3D","cc.Shaky3D") - return cc.Shaky3D -end -_G["CCShaky3D"] = DeprecatedClass.CCShaky3D() ---CCShaky3D class will be Deprecated,end - ---CCTransitionEaseScene class will be Deprecated,begin -function DeprecatedClass.CCTransitionEaseScene() - deprecatedTip("CCTransitionEaseScene","cc.TransitionEaseScene") - return cc.TransitionEaseScene -end -_G["CCTransitionEaseScene"] = DeprecatedClass.CCTransitionEaseScene() ---CCTransitionEaseScene class will be Deprecated,end - ---CCSequence class will be Deprecated,begin -function DeprecatedClass.CCSequence() - deprecatedTip("CCSequence","cc.Sequence") - return cc.Sequence -end -_G["CCSequence"] = DeprecatedClass.CCSequence() ---CCSequence class will be Deprecated,end - ---CCTransitionFadeUp class will be Deprecated,begin -function DeprecatedClass.CCTransitionFadeUp() - deprecatedTip("CCTransitionFadeUp","cc.TransitionFadeUp") - return cc.TransitionFadeUp -end -_G["CCTransitionFadeUp"] = DeprecatedClass.CCTransitionFadeUp() ---CCTransitionFadeUp class will be Deprecated,end - ---CCTransitionProgressRadialCW class will be Deprecated,begin -function DeprecatedClass.CCTransitionProgressRadialCW() - deprecatedTip("CCTransitionProgressRadialCW","cc.TransitionProgressRadialCW") - return cc.TransitionProgressRadialCW -end -_G["CCTransitionProgressRadialCW"] = DeprecatedClass.CCTransitionProgressRadialCW() ---CCTransitionProgressRadialCW class will be Deprecated,end - ---CCShuffleTiles class will be Deprecated,begin -function DeprecatedClass.CCShuffleTiles() - deprecatedTip("CCShuffleTiles","cc.ShuffleTiles") - return cc.ShuffleTiles -end -_G["CCShuffleTiles"] = DeprecatedClass.CCShuffleTiles() ---CCShuffleTiles class will be Deprecated,end - ---CCTransitionSlideInR class will be Deprecated,begin -function DeprecatedClass.CCTransitionSlideInR() - deprecatedTip("CCTransitionSlideInR","cc.TransitionSlideInR") - return cc.TransitionSlideInR -end -_G["CCTransitionSlideInR"] = DeprecatedClass.CCTransitionSlideInR() ---CCTransitionSlideInR class will be Deprecated,end - ---CCScene class will be Deprecated,begin -function DeprecatedClass.CCScene() - deprecatedTip("CCScene","cc.Scene") - return cc.Scene -end -_G["CCScene"] = DeprecatedClass.CCScene() ---CCScene class will be Deprecated,end - ---CCParallaxNode class will be Deprecated,begin -function DeprecatedClass.CCParallaxNode() - deprecatedTip("CCParallaxNode","cc.ParallaxNode") - return cc.ParallaxNode -end -_G["CCParallaxNode"] = DeprecatedClass.CCParallaxNode() ---CCParallaxNode class will be Deprecated,end - ---CCTransitionSlideInL class will be Deprecated,begin -function DeprecatedClass.CCTransitionSlideInL() - deprecatedTip("CCTransitionSlideInL","cc.TransitionSlideInL") - return cc.TransitionSlideInL -end -_G["CCTransitionSlideInL"] = DeprecatedClass.CCTransitionSlideInL() ---CCTransitionSlideInL class will be Deprecated,end - ---CCWavesTiles3D class will be Deprecated,begin -function DeprecatedClass.CCWavesTiles3D() - deprecatedTip("CCWavesTiles3D","cc.WavesTiles3D") - return cc.WavesTiles3D -end -_G["CCWavesTiles3D"] = DeprecatedClass.CCWavesTiles3D() ---CCWavesTiles3D class will be Deprecated,end - ---CCTransitionSlideInB class will be Deprecated,begin -function DeprecatedClass.CCTransitionSlideInB() - deprecatedTip("CCTransitionSlideInB","cc.TransitionSlideInB") - return cc.TransitionSlideInB -end -_G["CCTransitionSlideInB"] = DeprecatedClass.CCTransitionSlideInB() ---CCTransitionSlideInB class will be Deprecated,end - ---CCSpeed class will be Deprecated,begin -function DeprecatedClass.CCSpeed() - deprecatedTip("CCSpeed","cc.Speed") - return cc.Speed -end -_G["CCSpeed"] = DeprecatedClass.CCSpeed() ---CCSpeed class will be Deprecated,end - ---CCShatteredTiles3D class will be Deprecated,begin -function DeprecatedClass.CCShatteredTiles3D() - deprecatedTip("CCShatteredTiles3D","cc.ShatteredTiles3D") - return cc.ShatteredTiles3D -end -_G["CCShatteredTiles3D"] = DeprecatedClass.CCShatteredTiles3D() ---CCShatteredTiles3D class will be Deprecated,end - ---CCCallFuncN class will be Deprecated,begin -function DeprecatedClass.CCCallFuncN() - deprecatedTip("CCCallFuncN","cc.CallFunc") - return cc.CallFunc -end -_G["CCCallFuncN"] = DeprecatedClass.CCCallFuncN() ---CCCallFuncN class will be Deprecated,end - ---CCEGLViewProtocol class will be Deprecated,begin -function DeprecatedClass.CCEGLViewProtocol() - deprecatedTip("CCEGLViewProtocol","cc.GLViewProtocol") - return cc.GLViewProtocol -end -_G["CCEGLViewProtocol"] = DeprecatedClass.CCEGLViewProtocol() ---CCEGLViewProtocol class will be Deprecated,end - ---CCEGLView class will be Deprecated,begin -function DeprecatedClass.CCEGLView() - deprecatedTip("CCEGLView","cc.GLView") - return cc.GLView -end - -_G["CCEGLView"] = DeprecatedClass.CCEGLView() ---CCEGLView class will be Deprecated,end - ---XMLHttpRequest class will be Deprecated,begin -function DeprecatedClass.XMLHttpRequest() - deprecatedTip("XMLHttpRequest","cc.XMLHttpRequest") - return cc.XMLHttpRequest -end -_G["XMLHttpRequest"] = DeprecatedClass.XMLHttpRequest() ---XMLHttpRequest class will be Deprecated,end - ---EGLViewProtocol class will be Deprecated,begin -function DeprecatedClass.EGLViewProtocol() - deprecatedTip("cc.EGLViewProtocol","cc.GLViewProtocol") - return cc.GLViewProtocol -end -_G["cc.EGLViewProtocol"] = DeprecatedClass.EGLViewProtocol() ---EGLViewProtocol class will be Deprecated,end - ---EGLView class will be Deprecated,begin -function DeprecatedClass.EGLView() - deprecatedTip("cc.EGLView","cc.GLView") - return cc.GLView -end -_G["cc.EGLView"] = DeprecatedClass.EGLView() ---EGLView class will be Deprecated,end - ---EGLView class will be Deprecated,begin -function DeprecatedClass.EGLView() - deprecatedTip("cc.EGLView","cc.GLView") - print(cc.GLView) - return cc.GLView -end -_G["cc.EGLView"] = DeprecatedClass.EGLView() ---EGLView class will be Deprecated,end - ---ShaderCache class will be Deprecated,begin -function DeprecatedClass.ShaderCache() - deprecatedTip("cc.ShaderCache","cc.GLProgramCache") - return cc.GLProgramCache -end -cc.ShaderCache = DeprecatedClass.ShaderCache() ---ShaderCache class will be Deprecated,end - - - diff --git a/cocos/scripting/lua-bindings/script/cocos2d/DeprecatedCocos2dEnum.lua b/cocos/scripting/lua-bindings/script/cocos2d/DeprecatedCocos2dEnum.lua deleted file mode 100644 index 995e7a7..0000000 --- a/cocos/scripting/lua-bindings/script/cocos2d/DeprecatedCocos2dEnum.lua +++ /dev/null @@ -1,76 +0,0 @@ - ---Enums will be deprecated,begin -_G.kCCTextAlignmentLeft = cc.TEXT_ALIGNMENT_LEFT -_G.kCCTextAlignmentRight = cc.TEXT_ALIGNMENT_RIGHT -_G.kCCTextAlignmentCenter = cc.TEXT_ALIGNMENT_CENTER -_G.kCCVerticalTextAlignmentTop = cc.VERTICAL_TEXT_ALIGNMENT_TOP -_G.kCCVerticalTextAlignmentCenter = cc.VERTICAL_TEXT_ALIGNMENT_CENTER -_G.kCCVerticalTextAlignmentBottom = cc.VERTICAL_TEXT_ALIGNMENT_BOTTOM -_G.kCCDirectorProjection3D = cc.DIRECTOR_PROJECTION3_D -_G.kCCDirectorProjection2D = cc.DIRECTOR_PROJECTION2_D -_G.kCCDirectorProjectionCustom = cc.DIRECTOR_PROJECTION_CUSTOM -_G.kCCDirectorProjectionDefault = cc.DIRECTOR_PROJECTION_DEFAULT -_G.kCCNodeTagInvalid = cc.NODE_TAG_INVALID -_G.kCCNodeOnEnter = cc.NODE_ON_ENTER -_G.kCCNodeOnExit = cc.NODE_ON_EXIT -_G.kCCTexture2DPixelFormat_RGBA8888 = cc.TEXTURE2_D_PIXEL_FORMAT_RGB_A8888 -_G.kCCTexture2DPixelFormat_RGB888 = cc.TEXTURE2_D_PIXEL_FORMAT_RG_B888 -_G.kCCTexture2DPixelFormat_RGB565 = cc.TEXTURE2_D_PIXEL_FORMAT_RG_B565 -_G.kCCTexture2DPixelFormat_A8 = cc.TEXTURE2_D_PIXEL_FORMAT_A8 -_G.kCCTexture2DPixelFormat_I8 = cc.TEXTURE2_D_PIXEL_FORMAT_I8 -_G.kCCTexture2DPixelFormat_AI88 = cc.TEXTURE2_D_PIXEL_FORMAT_A_I88 -_G.kCCTexture2DPixelFormat_RGBA4444 = cc.TEXTURE2_D_PIXEL_FORMAT_RGB_A4444 -_G.kCCTexture2DPixelFormat_RGB5A1 = cc.TEXTURE2_D_PIXEL_FORMAT_RGB5_A1 -_G.kCCTexture2DPixelFormat_PVRTC4 = cc.TEXTURE2_D_PIXEL_FORMAT_PVRTC4 -_G.kCCTexture2DPixelFormat_PVRTC2 = cc.TEXTURE2_D_PIXEL_FORMAT_PVRTC2 -_G.kCCTexture2DPixelFormat_Default = cc.TEXTURE2_D_PIXEL_FORMAT_DEFAULT -_G.kCCImageFormatPNG = cc.IMAGE_FORMAT_PNG -_G.kCCImageFormatJPEG = cc.IMAGE_FORMAT_JPEG -_G.kCCTouchesOneByOne = cc.TOUCHES_ONE_BY_ONE -_G.kCCTouchesAllAtOnce = cc.TOUCHES_ALL_AT_ONCE -_G.kCCTransitionOrientationLeftOver = cc.TRANSITION_ORIENTATION_LEFT_OVER -_G.kCCTransitionOrientationRightOver = cc.TRANSITION_ORIENTATION_RIGHT_OVER -_G.kCCTransitionOrientationUpOver = cc.TRANSITION_ORIENTATION_UP_OVER -_G.kCCTransitionOrientationDownOver = cc.TRANSITION_ORIENTATION_DOWN_OVER -_G.kCCActionTagInvalid = cc.ACTION_TAG_INVALID -_G.kCCLabelAutomaticWidth = cc.LABEL_AUTOMATIC_WIDTH -_G.kCCMenuStateWaiting = cc.MENU_STATE_WAITING -_G.kCCMenuStateTrackingTouch = cc.MENU_STATE_TRACKING_TOUCH -_G.kCCMenuHandlerPriority = cc.MENU_HANDLER_PRIORITY -_G.kCCParticleDurationInfinity = cc.PARTICLE_DURATION_INFINITY -_G.kCCParticleStartSizeEqualToEndSize = cc.PARTICLE_START_SIZE_EQUAL_TO_END_SIZE -_G.kCCParticleStartRadiusEqualToEndRadius = cc.PARTICLE_START_RADIUS_EQUAL_TO_END_RADIUS -_G.kCCParticleModeGravity = cc.PARTICLE_MODE_GRAVITY -_G.kCCParticleModeRadius = cc.PARTICLE_MODE_RADIUS -_G.kCCPositionTypeFree = cc.POSITION_TYPE_FREE -_G.kCCPositionTypeRelative = cc.POSITION_TYPE_RELATIVE -_G.kCCPositionTypeGrouped = cc.POSITION_TYPE_GROUPED -_G.kCCProgressTimerTypeRadial = cc.PROGRESS_TIMER_TYPE_RADIAL -_G.kCCProgressTimerTypeBar = cc.PROGRESS_TIMER_TYPE_BAR -_G.kCCTMXTileHorizontalFlag = cc.TMX_TILE_HORIZONTAL_FLAG -_G.kCCTMXTileVerticalFlag = cc.TMX_TILE_VERTICAL_FLAG -_G.kCCTMXTileDiagonalFlag = cc.TMX_TILE_DIAGONAL_FLAG -_G.kCCFlipedAll = cc.FLIPED_ALL -_G.kCCFlippedMask = cc.FLIPPED_MASK - -_G.kLanguageEnglish = cc.LANGUAGE_ENGLISH -_G.kLanguageChinese = cc.LANGUAGE_CHINESE -_G.kLanguageFrench = cc.LANGUAGE_FRENCH -_G.kLanguageItalian = cc.LANGUAGE_ITALIAN -_G.kLanguageGerman = cc.LANGUAGE_GERMAN -_G.kLanguageSpanish = cc.LANGUAGE_SPANISH -_G.kLanguageRussian = cc.LANGUAGE_RUSSIAN -_G.kLanguageKorean = cc.LANGUAGE_KOREAN -_G.kLanguageJapanese = cc.LANGUAGE_JAPANESE -_G.kLanguageHungarian = cc.LANGUAGE_HUNGARIAN -_G.kLanguagePortuguese = cc.LANGUAGE_PORTUGUESE -_G.kLanguageArabic = cc.LANGUAGE_ARABIC -_G.kTargetWindows = cc.PLATFORM_OS_WINDOWS -_G.kTargetLinux = cc.PLATFORM_OS_LINUX -_G.kTargetMacOS = cc.PLATFORM_OS_MAC -_G.kTargetAndroid = cc.PLATFORM_OS_ANDROID -_G.kTargetIphone = cc.PLATFORM_OS_IPHONE -_G.kTargetIpad = cc.PLATFORM_OS_IPAD -_G.kTargetBlackBerry = cc.PLATFORM_OS_BLACKBERRY - -cc.TEXTURE_PIXELFORMAT_DEFAULT = cc.TEXTURE2_D_PIXEL_FORMAT_DEFAULT diff --git a/cocos/scripting/lua-bindings/script/cocos2d/DeprecatedCocos2dFunc.lua b/cocos/scripting/lua-bindings/script/cocos2d/DeprecatedCocos2dFunc.lua deleted file mode 100644 index bdc6a52..0000000 --- a/cocos/scripting/lua-bindings/script/cocos2d/DeprecatedCocos2dFunc.lua +++ /dev/null @@ -1,1003 +0,0 @@ - ---tip -local function deprecatedTip(old_name,new_name) - print("\n********** \n"..old_name.." was deprecated please use ".. new_name .. " instead.\n**********") -end - ---functions of CCDirector will be deprecated,begin -local CCDirectorDeprecated = { } -function CCDirectorDeprecated.sharedDirector() - deprecatedTip("CCDirector:sharedDirector","cc.Director:getInstance") - return cc.Director:getInstance() -end -CCDirector.sharedDirector = CCDirectorDeprecated.sharedDirector ---functions of CCDirector will be deprecated,end - - ---functions of CCTextureCache will be deprecated begin -local TextureCacheDeprecated = {} -function TextureCacheDeprecated.getInstance(self) - deprecatedTip("cc.TextureCache:getInstance","cc.Director:getInstance():getTextureCache") - return cc.Director:getInstance():getTextureCache() -end -cc.TextureCache.getInstance = TextureCacheDeprecated.getInstance - -function TextureCacheDeprecated.destroyInstance(self) - deprecatedTip("cc.TextureCache:destroyInstance","cc.Director:getInstance():destroyTextureCache") - return cc.Director:getInstance():destroyTextureCache() -end -cc.TextureCache.destroyInstance = TextureCacheDeprecated.destroyInstance - -function TextureCacheDeprecated.dumpCachedTextureInfo(self) - deprecatedTip("self:dumpCachedTextureInfo","self:getCachedTextureInfo") - return print(self:getCachedTextureInfo()) -end -cc.TextureCache.dumpCachedTextureInfo = TextureCacheDeprecated.dumpCachedTextureInfo - -local CCTextureCacheDeprecated = { } -function CCTextureCacheDeprecated.sharedTextureCache() - deprecatedTip("CCTextureCache:sharedTextureCache","CCTextureCache:getInstance") - return cc.TextureCache:getInstance() -end -rawset(CCTextureCache,"sharedTextureCache",CCTextureCacheDeprecated.sharedTextureCache) - -function CCTextureCacheDeprecated.purgeSharedTextureCache() - deprecatedTip("CCTextureCache:purgeSharedTextureCache","CCTextureCache:destroyInstance") - return cc.TextureCache:destroyInstance() -end -rawset(CCTextureCache,"purgeSharedTextureCache",CCTextureCacheDeprecated.purgeSharedTextureCache) - -function CCTextureCacheDeprecated.addUIImage(self, image, key) - deprecatedTip("CCTextureCache:addUIImage","CCTextureCache:addImage") - return self:addImage(image,key) -end -CCTextureCache.addUIImage = CCTextureCacheDeprecated.addUIImage ---functions of CCTextureCache will be deprecated end - ---functions of CCAnimation will be deprecated begin -local CCAnimationDeprecated = {} -function CCAnimationDeprecated.addSpriteFrameWithFileName(self,...) - deprecatedTip("CCAnimationDeprecated:addSpriteFrameWithFileName","cc.Animation:addSpriteFrameWithFile") - return self:addSpriteFrameWithFile(...) -end -CCAnimation.addSpriteFrameWithFileName = CCAnimationDeprecated.addSpriteFrameWithFileName ---functions of CCAnimation will be deprecated end - - ---functions of CCAnimationCache will be deprecated begin -local CCAnimationCacheDeprecated = { } -function CCAnimationCacheDeprecated.sharedAnimationCache() - deprecatedTip("CCAnimationCache:sharedAnimationCache","CCAnimationCache:getInstance") - return CCAnimationCache:getInstance() -end -CCAnimationCache.sharedAnimationCache = CCAnimationCacheDeprecated.sharedAnimationCache - -function CCAnimationCacheDeprecated.purgeSharedAnimationCache() - deprecatedTip("CCAnimationCache:purgeSharedAnimationCache","CCAnimationCache:destroyInstance") - return CCAnimationCache:destroyInstance() -end -CCAnimationCache.purgeSharedAnimationCache = CCAnimationCacheDeprecated.purgeSharedAnimationCache - -function CCAnimationCacheDeprecated.addAnimationsWithFile(self,...) - deprecatedTip("CCAnimationCache:addAnimationsWithFile","cc.AnimationCache:addAnimations") - return self:addAnimations(...) -end -CCAnimationCache.addAnimationsWithFile = CCAnimationCacheDeprecated.addAnimationsWithFile - -function CCAnimationCacheDeprecated.animationByName(self,...) - deprecatedTip("CCAnimationCache:animationByName","cc.AnimationCache:getAnimation") - return self:getAnimation(...) -end -CCAnimationCache.animationByName = CCAnimationCacheDeprecated.animationByName - -function CCAnimationCacheDeprecated.removeAnimationByName(self) - deprecatedTip("CCAnimationCache:removeAnimationByName","cc.AnimationCache:removeAnimation") - return self:removeAnimation() -end -CCAnimationCache.removeAnimationByName = CCAnimationCacheDeprecated.removeAnimationByName ---functions of CCAnimationCache will be deprecated end - ---functions of CCFileUtils will be deprecated end -local CCFileUtilsDeprecated = { } -function CCFileUtilsDeprecated.sharedFileUtils() - deprecatedTip("CCFileUtils:sharedFileUtils","CCFileUtils:getInstance") - return cc.FileUtils:getInstance() -end -CCFileUtils.sharedFileUtils = CCFileUtilsDeprecated.sharedFileUtils - -function CCFileUtilsDeprecated.purgeFileUtils() - deprecatedTip("CCFileUtils:purgeFileUtils","CCFileUtils:destroyInstance") - return cc.FileUtils:destroyInstance() -end -CCFileUtils.purgeFileUtils = CCFileUtilsDeprecated.purgeFileUtils ---functions of CCFileUtils will be deprecated end - ---functions of CCMenu will be deprecated begin -local CCMenuDeprecated = { } -function CCMenuDeprecated.createWithItem(self,...) - deprecatedTip("CCMenuDeprecated:createWithItem","cc.Menu:createWithItem") - return self:create(...) -end -CCMenu.createWithItem = CCMenuDeprecated.createWithItem - -function CCMenuDeprecated.setHandlerPriority(self) - print("\n********** \n".."setHandlerPriority was deprecated in 3.0. \n**********") -end -CCMenu.setHandlerPriority = CCMenuDeprecated.setHandlerPriority ---functions of CCMenu will be deprecated end - ---functions of CCNode will be deprecated begin -local CCNodeDeprecated = { } - -function CCNodeDeprecated.boundingBox(self) - deprecatedTip("CCNode:boundingBox","cc.Node:getBoundingBox") - return self:getBoundingBox() -end -CCNode.boundingBox = CCNodeDeprecated.boundingBox - - -function CCNodeDeprecated.numberOfRunningActions(self) - deprecatedTip("CCNode:numberOfRunningActions","cc.Node:getNumberOfRunningActions") - return self:getNumberOfRunningActions() -end -CCNode.numberOfRunningActions = CCNodeDeprecated.numberOfRunningActions - - -function CCNodeDeprecated.removeFromParentAndCleanup(self,...) - deprecatedTip("CCNode:removeFromParentAndCleanup","cc.Node:removeFromParent") - return self:removeFromParent(...) -end -CCNode.removeFromParentAndCleanup = CCNodeDeprecated.removeFromParentAndCleanup ---functions of CCNode will be deprecated end - ---CCDrawPrimitives will be deprecated begin -local function CCDrawPrimitivesClassDeprecated() - deprecatedTip("CCDrawPrimitives","cc.DrawPrimitives") - return cc.DrawPrimitives -end -_G.CCDrawPrimitives = CCDrawPrimitivesClassDeprecated() ---functions of CCDrawPrimitives will be deprecated begin -local CCDrawPrimitivesDeprecated = { } -function CCDrawPrimitivesDeprecated.ccDrawPoint(pt) - deprecatedTip("ccDrawPoint","cc.DrawPrimitives.drawPoint") - return cc.DrawPrimitives.drawPoint(pt) -end -_G.ccDrawPoint = CCDrawPrimitivesDeprecated.ccDrawPoint - -function CCDrawPrimitivesDeprecated.ccDrawLine(origin,destination) - deprecatedTip("ccDrawLine","cc.DrawPrimitives.drawLine") - return cc.DrawPrimitives.drawLine(origin,destination) -end -_G.ccDrawLine = CCDrawPrimitivesDeprecated.ccDrawLine - -function CCDrawPrimitivesDeprecated.ccDrawRect(origin,destination) - deprecatedTip("ccDrawRect","cc.DrawPrimitives.drawRect") - return cc.DrawPrimitives.drawRect(origin,destination) -end -_G.ccDrawRect = CCDrawPrimitivesDeprecated.ccDrawRect - -function CCDrawPrimitivesDeprecated.ccDrawSolidRect(origin,destination,color) - deprecatedTip("ccDrawSolidRect","cc.DrawPrimitives.drawSolidRect") - return cc.DrawPrimitives.drawSolidRect(origin,destination,color) -end -_G.ccDrawSolidRect = CCDrawPrimitivesDeprecated.ccDrawSolidRect - --- params:... may represent two param(xScale,yScale) or nil -function CCDrawPrimitivesDeprecated.ccDrawCircle(center,radius,angle,segments,drawLineToCenter,...) - deprecatedTip("ccDrawCircle","cc.DrawPrimitives.drawCircle") - return cc.DrawPrimitives.drawCircle(center,radius,angle,segments,drawLineToCenter,...) -end -_G.ccDrawCircle = CCDrawPrimitivesDeprecated.ccDrawCircle - --- params:... may represent two param(xScale,yScale) or nil -function CCDrawPrimitivesDeprecated.ccDrawSolidCircle(center,radius,angle,segments,...) - deprecatedTip("ccDrawSolidCircle","cc.DrawPrimitives.drawSolidCircle") - return cc.DrawPrimitives.drawSolidCircle(center,radius,angle,segments,...) -end -_G.ccDrawSolidCircle = CCDrawPrimitivesDeprecated.ccDrawSolidCircle - -function CCDrawPrimitivesDeprecated.ccDrawQuadBezier(origin,control,destination,segments) - deprecatedTip("ccDrawQuadBezier","cc.DrawPrimitives.drawQuadBezier") - return cc.DrawPrimitives.drawQuadBezier(origin,control,destination,segments) -end -_G.ccDrawQuadBezier = CCDrawPrimitivesDeprecated.ccDrawQuadBezier - -function CCDrawPrimitivesDeprecated.ccDrawCubicBezier(origin,control1,control2,destination,segments) - deprecatedTip("ccDrawCubicBezier","cc.DrawPrimitives.drawCubicBezier") - return cc.DrawPrimitives.drawCubicBezier(origin,control1,control2,destination,segments) -end -_G.ccDrawCubicBezier = CCDrawPrimitivesDeprecated.ccDrawCubicBezier - -function CCDrawPrimitivesDeprecated.ccDrawCatmullRom(arrayOfControlPoints,segments) - deprecatedTip("ccDrawCatmullRom","cc.DrawPrimitives.drawCatmullRom") - return cc.DrawPrimitives.drawCatmullRom(arrayOfControlPoints,segments) -end -_G.ccDrawCatmullRom = CCDrawPrimitivesDeprecated.ccDrawCatmullRom - -function CCDrawPrimitivesDeprecated.ccDrawCardinalSpline(config,tension,segments) - deprecatedTip("ccDrawCardinalSpline","cc.DrawPrimitives.drawCardinalSpline") - return cc.DrawPrimitives.drawCardinalSpline(config,tension,segments) -end -_G.ccDrawCardinalSpline = CCDrawPrimitivesDeprecated.ccDrawCardinalSpline - -function CCDrawPrimitivesDeprecated.ccDrawColor4B(r,g,b,a) - deprecatedTip("ccDrawColor4B","cc.DrawPrimitives.drawColor4B") - return cc.DrawPrimitives.drawColor4B(r,g,b,a) -end -_G.ccDrawColor4B = CCDrawPrimitivesDeprecated.ccDrawColor4B - -function CCDrawPrimitivesDeprecated.ccDrawColor4F(r,g,b,a) - deprecatedTip("ccDrawColor4F","cc.DrawPrimitives.drawColor4F") - return cc.DrawPrimitives.drawColor4F(r,g,b,a) -end -_G.ccDrawColor4F = CCDrawPrimitivesDeprecated.ccDrawColor4F - -function CCDrawPrimitivesDeprecated.ccPointSize(pointSize) - deprecatedTip("ccPointSize","cc.DrawPrimitives.setPointSize") - return cc.DrawPrimitives.setPointSize(pointSize) -end -_G.ccPointSize = CCDrawPrimitivesDeprecated.ccPointSize ---functions of CCDrawPrimitives will be deprecated end ---CCDrawPrimitives will be deprecated end - -local CCProgressTimerDeprecated = {} -function CCProgressTimerDeprecated.setReverseProgress(self,...) - deprecatedTip("CCProgressTimer","CCProgressTimer:setReverseDirection") - return self:setReverseDirection(...) -end -CCProgressTimer.setReverseProgress = CCProgressTimerDeprecated.setReverseProgress - ---functions of CCSpriteFrameCache will be deprecated begin -local CCSpriteFrameCacheDeprecated = { } -function CCSpriteFrameCacheDeprecated.spriteFrameByName(self,szName) - deprecatedTip("CCSpriteFrameCache:spriteFrameByName","CCSpriteFrameCache:getSpriteFrameByName") - return self:getSpriteFrameByName(szName) -end -CCSpriteFrameCache.spriteFrameByName = CCSpriteFrameCacheDeprecated.spriteFrameByName - -function CCSpriteFrameCacheDeprecated.sharedSpriteFrameCache() - deprecatedTip("CCSpriteFrameCache:sharedSpriteFrameCache","CCSpriteFrameCache:getInstance") - return CCSpriteFrameCache:getInstance() -end -CCSpriteFrameCache.sharedSpriteFrameCache = CCSpriteFrameCacheDeprecated.sharedSpriteFrameCache - -function CCSpriteFrameCacheDeprecated.purgeSharedSpriteFrameCache() - deprecatedTip("CCSpriteFrameCache:purgeSharedSpriteFrameCache","CCSpriteFrameCache:destroyInstance") - return CCSpriteFrameCache:destroyInstance() -end -CCSpriteFrameCache.purgeSharedSpriteFrameCache = CCSpriteFrameCacheDeprecated.purgeSharedSpriteFrameCache - -function CCSpriteFrameCacheDeprecated.addSpriteFramesWithFile(self,...) - deprecatedTip("CCSpriteFrameCache:addSpriteFramesWithFile","CCSpriteFrameCache:addSpriteFrames") - return self:addSpriteFrames(...) -end -rawset(CCSpriteFrameCache,"addSpriteFramesWithFile",CCSpriteFrameCacheDeprecated.addSpriteFramesWithFile) - -function CCSpriteFrameCacheDeprecated.getSpriteFrameByName(self,...) - deprecatedTip("CCSpriteFrameCache:getSpriteFrameByName","CCSpriteFrameCache:getSpriteFrame") - return self:getSpriteFrame(...) -end -CCSpriteFrameCache.getSpriteFrameByName = CCSpriteFrameCacheDeprecated.getSpriteFrameByName ---functions of CCSpriteFrameCache will be deprecated end - ---functions of CCLabelAtlas will be deprecated begin -local CCLabelAtlasDeprecated = {} -function CCLabelAtlasDeprecated.create(self,...) - deprecatedTip("CCLabelAtlas:create","CCLabelAtlas:_create") - return self:_create(...) -end -CCLabelAtlas.create = CCLabelAtlasDeprecated.create ---functions of CCLabelAtlas will be deprecated end - - ---------------------------- ---global functions will be deprecated, begin -local function CCRectMake(x,y,width,height) - deprecatedTip("CCRectMake(x,y,width,height)","cc.rect(x,y,width,height) in lua") - return cc.rect(x,y,width,height) -end -_G.CCRectMake = CCRectMake - -local function ccc3(r,g,b) - deprecatedTip("ccc3(r,g,b)","cc.c3b(r,g,b)") - return cc.c3b(r,g,b) -end -_G.ccc3 = ccc3 - -local function ccp(x,y) - deprecatedTip("ccp(x,y)","cc.p(x,y)") - return cc.p(x,y) -end -_G.ccp = ccp - -local function CCSizeMake(width,height) - deprecatedTip("CCSizeMake(width,height)","cc.size(width,height)") - return cc.size(width,height) -end -_G.CCSizeMake = CCSizeMake - -local function ccc4(r,g,b,a) - deprecatedTip("ccc4(r,g,b,a)","cc.c4b(r,g,b,a)") - return cc.c4b(r,g,b,a) -end -_G.ccc4 = ccc4 - -local function ccc4FFromccc3B(color3B) - deprecatedTip("ccc4FFromccc3B(color3B)","cc.c4f(color3B.r / 255.0,color3B.g / 255.0,color3B.b / 255.0,1.0)") - return cc.c4f(color3B.r/255.0, color3B.g/255.0, color3B.b/255.0, 1.0) -end -_G.ccc4FFromccc3B = ccc4FFromccc3B - -local function ccc4f(r,g,b,a) - deprecatedTip("ccc4f(r,g,b,a)","cc.c4f(r,g,b,a)") - return cc.c4f(r,g,b,a) -end -_G.ccc4f = ccc4f - -local function ccc4FFromccc4B(color4B) - deprecatedTip("ccc4FFromccc4B(color4B)","cc.c4f(color4B.r/255.0, color4B.g/255.0, color4B.b/255.0, color4B.a/255.0)") - return cc.c4f(color4B.r/255.0, color4B.g/255.0, color4B.b/255.0, color4B.a/255.0) -end -_G.ccc4FFromccc4B = ccc4FFromccc4B - -local function ccc4FEqual(a,b) - deprecatedTip("ccc4FEqual(a,b)","a:equals(b)") - return a:equals(b) -end -_G.ccc4FEqual = ccc4FEqual ---global functions will be deprecated, end - - ---functions of _G will be deprecated begin -local function ccpLineIntersect(a,b,c,d,s,t) - deprecatedTip("ccpLineIntersect","cc.pIsLineIntersect") - return cc.pIsLineIntersect(a,b,c,d,s,t) -end -_G.ccpLineIntersect = ccpLineIntersect - - -local function CCPointMake(x,y) - deprecatedTip("CCPointMake(x,y)","cc.p(x,y)") - return cc.p(x,y) -end -_G.CCPointMake = CCPointMake - - - -local function ccpNeg(pt) - deprecatedTip("ccpNeg","cc.pSub") - return cc.pSub({x = 0,y = 0}, pt) -end -_G.ccpNeg = ccpNeg - -local function ccpAdd(pt1,pt2) - deprecatedTip("ccpAdd","cc.pAdd") - return cc.pAdd(pt1,pt2) -end -_G.ccpAdd = ccpAdd - -local function ccpSub(pt1,pt2) - deprecatedTip("ccpSub","cc.pSub") - return cc.pSub(pt1,pt2) -end -_G.ccpSub = ccpSub - -local function ccpMult(pt,factor) - deprecatedTip("ccpMult","cc.pMul") - return cc.pMul(pt,factor) -end -_G.ccpMult = ccpMult - -local function ccpMidpoint(pt1,pt2) - deprecatedTip("ccpMidpoint","cc.pMidpoint") - return cc.pMidpoint(pt1,pt2) -end -_G.ccpMidpoint = ccpMidpoint - -local function ccpDot(pt1,pt2) - deprecatedTip("ccpDot","cc.pDot") - return cc.pDot(pt1,pt2) -end -_G.ccpDot = ccpDot - -local function ccpCross(pt1,pt2) - deprecatedTip("ccpCross","cc.pCross") - return cc.pCross(pt1, pt2) -end -_G.ccpCross = ccpCross - -local function ccpPerp(pt) - deprecatedTip("ccpPerp","cc.pPerp") - return cc.pPerp(pt) -end -_G.ccpPerp = ccpPerp - -local function ccpRPerp(pt) - deprecatedTip("ccpRPerp","cc.RPerp") - return cc.RPerp(pt) -end -_G.ccpRPerp = ccpRPerp - -local function ccpProject(pt1,pt2) - deprecatedTip("ccpProject","cc.pProject") - return cc.pProject(pt1,pt2) -end -_G.ccpProject = ccpProject - -local function ccpRotate(pt1,pt2) - deprecatedTip("ccpRotate","cc.pRotate") - return cc.pRotate(pt1,pt2) -end -_G.ccpRotate = ccpRotate - -local function ccpUnrotate(pt1,pt2) - deprecatedTip("ccpUnrotate","cc.pUnrotate") - return cc.pUnrotate(pt1,pt2) -end -_G.ccpUnrotate = ccpUnrotate - -local function ccpLengthSQ(pt) - deprecatedTip("ccpLengthSQ","cc.pLengthSQ") - return cc.pLengthSQ(pt) -end -_G.ccpLengthSQ = ccpLengthSQ - -local function ccpDistanceSQ(pt1,pt2) - deprecatedTip("ccpDistanceSQ","cc.pDistanceSQ") - return cc.pDistanceSQ(pt1,pt2) -end -_G.ccpDistanceSQ = ccpDistanceSQ - -local function ccpLength(pt) - deprecatedTip("ccpLength","cc.pGetLength") - return cc.pGetLength(pt) -end -_G.ccpLength = ccpLength - -local function ccpDistance(pt1,pt2) - deprecatedTip("ccpDistance","cc.pGetDistance") - return cc.pGetDistance(pt1, pt2) -end -_G.ccpDistance = ccpDistance - -local function ccpNormalize(pt) - deprecatedTip("ccpNormalize","cc.pNormalize") - return cc.pNormalize(pt) -end -_G.ccpNormalize = ccpNormalize - -local function ccpForAngle(angle) - deprecatedTip("ccpForAngle","cc.pForAngle") - return cc.pForAngle(angle) -end -_G.ccpForAngle = ccpForAngle - -local function ccpToAngle(pt) - deprecatedTip("ccpToAngle","cc.pToAngleSelf") - return cc.pToAngleSelf(pt) -end -_G.ccpToAngle = ccpToAngle - -local function ccpClamp(pt1,pt2,pt3) - deprecatedTip("ccpClamp","cc.pGetClampPoint") - return cc.pGetClampPoint(pt1,pt2,pt3) -end -_G.ccpClamp = ccpClamp - - -local function ccpFromSize(sz) - deprecatedTip("ccpFromSize(sz)","cc.pFromSize") - return cc.pFromSize(sz) -end -_G.ccpFromSize = ccpFromSize - -local function ccpLerp(pt1,pt2,alpha) - deprecatedTip("ccpLerp","cc.pLerp") - return cc.pLerp(pt1,pt2,alpha) -end -_G.ccpLerp = ccpLerp - -local function ccpFuzzyEqual(pt1,pt2,variance) - deprecatedTip("ccpFuzzyEqual","cc.pFuzzyEqual") - return cc.pFuzzyEqual(pt1,pt2,variance) -end -_G.ccpFuzzyEqual = ccpFuzzyEqual - -local function ccpCompMult(pt1,pt2) - deprecatedTip("ccpCompMult","cc.p") - return cc.p(pt1.x * pt2.x , pt1.y * pt2.y) -end -_G.ccpCompMult = ccpCompMult - -local function ccpAngleSigned(pt1,pt2) - deprecatedTip("ccpAngleSigned","cc.pGetAngle") - return cc.pGetAngle(pt1, pt2) -end -_G.ccpAngleSigned = ccpAngleSigned - -local function ccpAngle(pt1,pt2) - deprecatedTip("ccpAngle","cc.pGetAngle") - return cc.pGetAngle(pt1,ptw) -end -_G.ccpAngle = ccpAngle - -local function ccpRotateByAngle(pt1,pt2,angle) - deprecatedTip("ccpRotateByAngle","cc.pRotateByAngle") - return cc.pRotateByAngle(pt1, pt2, angle) -end -_G.ccpRotateByAngle = ccpRotateByAngle - -local function ccpSegmentIntersect(pt1,pt2,pt3,pt4) - deprecatedTip("ccpSegmentIntersect","cc.pIsSegmentIntersect") - return cc.pIsSegmentIntersect(pt1,pt2,pt3,pt4) -end -_G.ccpSegmentIntersect = ccpSegmentIntersect - -local function ccpIntersectPoint(pt1,pt2,pt3,pt4) - deprecatedTip("ccpIntersectPoint","cc.pGetIntersectPoint") - return cc.pGetIntersectPoint(pt1,pt2,pt3,pt4) -end -_G.ccpIntersectPoint = ccpIntersectPoint - - -local function vertex2(x,y) - deprecatedTip("vertex2(x,y)","cc.vertex2F(x,y)") - return cc.vertex2F(x,y) -end -_G.vertex2 = vertex2 - -local function vertex3(x,y,z) - deprecatedTip("vertex3(x,y,z)","cc.Vertex3F(x,y,z)") - return cc.Vertex3F(x,y,z) -end -_G.vertex3 = vertex3 - -local function tex2(u,v) - deprecatedTip("tex2(u,v)","cc.tex2f(u,v)") - return cc.tex2f(u,v) -end -_G.tex2 = tex2 - -local function ccc4BFromccc4F(color4F) - deprecatedTip("ccc4BFromccc4F(color4F)","Color4B(color4F.r * 255.0, color4F.g * 255.0, color4F.b * 255.0, color4B.a * 255.0)") - return Color4B(color4F.r * 255.0, color4F.g * 255.0, color4F.b * 255.0, color4B.a * 255.0) -end -_G.ccc4BFromccc4F = ccc4BFromccc4F - -local function ccColor3BDeprecated() - deprecatedTip("ccColor3B","cc.c3b(0,0,0)") - return cc.c3b(0,0,0) -end -_G.ccColor3B = ccColor3BDeprecated - -local function ccColor4BDeprecated() - deprecatedTip("ccColor4B","cc.c4b(0,0,0,0)") - return cc.c4b(0,0,0,0) -end -_G.ccColor4B = ccColor4BDeprecated - -local function ccColor4FDeprecated() - deprecatedTip("ccColor4F","cc.c4f(0.0,0.0,0.0,0.0)") - return cc.c4f(0.0,0.0,0.0,0.0) -end -_G.ccColor4F = ccColor4FDeprecated - -local function ccVertex2FDeprecated() - deprecatedTip("ccVertex2F","cc.vertex2F(0.0,0.0)") - return cc.vertex2F(0.0,0.0) -end -_G.ccVertex2F = ccVertex2FDeprecated - -local function ccVertex3FDeprecated() - deprecatedTip("ccVertex3F","cc.Vertex3F(0.0, 0.0, 0.0)") - return cc.Vertex3F(0.0, 0.0, 0.0) -end -_G.ccVertex3F = ccVertex3FDeprecated - -local function ccTex2FDeprecated() - deprecatedTip("ccTex2F","cc.tex2F(0.0, 0.0)") - return cc.tex2F(0.0, 0.0) -end -_G.ccTex2F = ccTex2FDeprecated - -local function ccPointSpriteDeprecated() - deprecatedTip("ccPointSprite","cc.PointSprite(cc.vertex2F(0.0, 0.0),cc.c4b(0.0, 0.0, 0.0),0)") - return cc.PointSprite(cc.vertex2F(0.0, 0.0),cc.c4b(0.0, 0.0, 0.0),0) -end -_G.ccPointSprite = ccPointSpriteDeprecated - -local function ccQuad2Deprecated() - deprecatedTip("ccQuad2","cc.Quad2(cc.vertex2F(0.0, 0.0), cc.vertex2F(0.0, 0.0), cc.vertex2F(0.0, 0.0), cc.vertex2F(0.0, 0.0))") - return cc.Quad2(cc.vertex2F(0.0, 0.0), cc.vertex2F(0.0, 0.0), cc.vertex2F(0.0, 0.0), cc.vertex2F(0.0, 0.0)) -end -_G.ccQuad2 = ccQuad2Deprecated - -local function ccQuad3Deprecated() - deprecatedTip("ccQuad3","cc.Quad3(cc.Vertex3F(0.0, 0.0 ,0.0), cc.Vertex3F(0.0, 0.0 ,0.0), cc.Vertex3F(0.0, 0.0 ,0.0), cc.Vertex3F(0.0, 0.0 ,0.0))") - return cc.Quad3(cc.Vertex3F(0.0, 0.0 ,0.0), cc.Vertex3F(0.0, 0.0 ,0.0), cc.Vertex3F(0.0, 0.0 ,0.0), cc.Vertex3F(0.0, 0.0 ,0.0)) -end -_G.ccQuad3 = ccQuad3Deprecated - -local function ccV2FC4BT2FDeprecated() - deprecatedTip("ccV2F_C4B_T2F","cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0))") - return cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)) -end -_G.ccV2F_C4B_T2F = ccV2FC4BT2FDeprecated - - -local function ccV2FC4FT2FDeprecated() - deprecatedTip("ccV2F_C4F_T2F","cc.V2F_C4F_T2F(cc.vertex2F(0.0, 0.0), cc.c4f(0.0 , 0.0 , 0.0 , 0.0 ), cc.tex2F(0.0, 0.0))") - return cc.V2F_C4F_T2F(cc.vertex2F(0.0, 0.0), cc.c4f(0.0 , 0.0 , 0.0 , 0.0), cc.tex2F(0.0, 0.0)) -end -_G.ccV2F_C4F_T2F = ccV2FC4FT2FDeprecated - -local function ccV3FC4BT2FDeprecated() - deprecatedTip("ccV3F_C4B_T2F","cc.V3F_C4B_T2F(cc.vertex3F(0.0, 0.0, 0.0), cc.c4b(0 , 0 , 0, 0 ), cc.tex2F(0.0, 0.0))") - return cc.V3F_C4B_T2F(cc.vertex3F(0.0, 0.0, 0.0), cc.c4b(0 , 0 , 0, 0 ), cc.tex2F(0.0, 0.0)) -end -_G.ccV3F_C4B_T2F = ccV3FC4BT2FDeprecated - -local function ccV2FC4BT2FQuadDeprecated() - deprecatedTip("ccV2F_C4B_T2F_Quad","cc.V2F_C4B_T2F_Quad(cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)))") - return cc.V2F_C4B_T2F_Quad(cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0))) -end -_G.ccV2F_C4B_T2F_Quad = ccV2FC4BT2FQuadDeprecated - -local function ccV3FC4BT2FQuadDeprecated() - deprecatedTip("ccV3F_C4B_T2F_Quad","cc.V3F_C4B_T2F_Quad(_tl, _bl, _tr, _br)") - return cc.V3F_C4B_T2F_Quad(cc.V3F_C4B_T2F(cc.vertex3F(0.0, 0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V3F_C4B_T2F(cc.vertex3F(0.0, 0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V3F_C4B_T2F(cc.vertex3F(0.0, 0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V3F_C4B_T2F(cc.vertex3F(0.0, 0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0))) -end -_G.ccV3F_C4B_T2F_Quad = ccV3FC4BT2FQuadDeprecated - -local function ccV2FC4FT2FQuadDeprecated() - deprecatedTip("ccV2F_C4F_T2F_Quad","cc.V2F_C4F_T2F_Quad(_bl, _br, _tl, _tr)") - return cc.V2F_C4F_T2F_Quad(cc.V2F_C4F_T2F(cc.vertex2F(0.0, 0.0), cc.c4f(0.0 , 0.0, 0.0, 0.0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4F_T2F(cc.vertex2F(0.0, 0.0), cc.c4f(0.0 , 0.0, 0.0, 0.0 ), cc.tex2F(0.0, 0.0)), cc.V3F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4f(0.0 , 0.0, 0.0, 0.0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4F_T2F(cc.vertex2F(0.0, 0.0), cc.c4f(0.0 , 0.0, 0.0, 0.0 ), cc.tex2F(0.0, 0.0))) -end -_G.ccV2F_C4F_T2F_Quad = ccV2FC4FT2FQuadDeprecated - -local function ccT2FQuadDeprecated() - deprecatedTip("ccT2F_Quad","cc.T2F_Quad(_bl, _br, _tl, _tr)") - return cc.T2F_Quad(cc.tex2F(0.0,0.0), cc.tex2F(0.0,0.0), cc.tex2F(0.0,0.0), cc.tex2F(0.0,0.0)) -end -_G.ccT2F_Quad = ccT2FQuadDeprecated - -local function ccAnimationFrameDataDeprecated() - deprecatedTip("ccAnimationFrameData","cc.AnimationFrameData( _texCoords, _delay, _size)") - return cc.AnimationFrameData(cc.T2F_Quad(cc.tex2F(0.0,0.0), cc.tex2F(0.0,0.0), cc.tex2F(0.0,0.0), cc.tex2F(0.0,0.0)), 0, cc.size(0,0)) -end -_G.ccAnimationFrameData = ccAnimationFrameDataDeprecated - - - -local function tex2(u,v) - deprecatedTip("tex2(u,v)","cc.tex2f(u,v)") - return cc.tex2f(u,v) -end -_G.tex2 = tex2 - - ---functions of CCApplication will be deprecated end -local CCApplicationDeprecated = { } -function CCApplicationDeprecated.sharedApplication() - deprecatedTip("CCApplication:sharedApplication","CCApplication:getInstance") - return CCApplication:getInstance() -end -CCApplication.sharedApplication = CCApplicationDeprecated.sharedApplication ---functions of CCApplication will be deprecated end - - ---functions of CCDirector will be deprecated end -local CCDirectorDeprecated = { } -function CCDirectorDeprecated.sharedDirector() - deprecatedTip("CCDirector:sharedDirector","CCDirector:getInstance") - return CCDirector:getInstance() -end -CCDirector.sharedDirector = CCDirectorDeprecated.sharedDirector ---functions of CCDirector will be deprecated end - - ---functions of CCUserDefault will be deprecated end -local CCUserDefaultDeprecated = { } -function CCUserDefaultDeprecated.sharedUserDefault() - deprecatedTip("CCUserDefault:sharedUserDefault","CCUserDefault:getInstance") - return CCUserDefault:getInstance() -end -CCUserDefault.sharedUserDefault = CCUserDefaultDeprecated.sharedUserDefault - -function CCUserDefaultDeprecated.purgeSharedUserDefault() - deprecatedTip("CCUserDefault:purgeSharedUserDefault","CCUserDefault:destroyInstance") - return CCUserDefault:destroyInstance() -end -CCUserDefault.purgeSharedUserDefault = CCUserDefaultDeprecated.purgeSharedUserDefault ---functions of CCUserDefault will be deprecated end - ---functions of CCGrid3DAction will be deprecated begin -local CCGrid3DActionDeprecated = { } -function CCGrid3DActionDeprecated.vertex(self,pt) - deprecatedTip("vertex","CCGrid3DAction:getVertex") - return self:getVertex(pt) -end -CCGrid3DAction.vertex = CCGrid3DActionDeprecated.vertex - -function CCGrid3DActionDeprecated.originalVertex(self,pt) - deprecatedTip("originalVertex","CCGrid3DAction:getOriginalVertex") - return self:getOriginalVertex(pt) -end -CCGrid3DAction.originalVertex = CCGrid3DActionDeprecated.originalVertex ---functions of CCGrid3DAction will be deprecated end - - ---functions of CCTiledGrid3DAction will be deprecated begin -local CCTiledGrid3DActionDeprecated = { } -function CCTiledGrid3DActionDeprecated.tile(self,pt) - deprecatedTip("tile","CCTiledGrid3DAction:getTile") - return self:getTile(pt) -end -CCTiledGrid3DAction.tile = CCTiledGrid3DActionDeprecated.tile - -function CCTiledGrid3DActionDeprecated.originalTile(self,pt) - deprecatedTip("originalTile","CCTiledGrid3DAction:getOriginalTile") - return self:getOriginalTile(pt) -end -CCTiledGrid3DAction.originalTile = CCTiledGrid3DActionDeprecated.originalTile ---functions of CCTiledGrid3DAction will be deprecated end - - ---functions of CCTexture2D will be deprecated begin -local CCTexture2DDeprecated = { } -function CCTexture2DDeprecated.stringForFormat(self) - deprecatedTip("Texture2D:stringForFormat","Texture2D:getStringForFormat") - return self:getStringForFormat() -end -CCTexture2D.stringForFormat = CCTexture2DDeprecated.stringForFormat - -function CCTexture2DDeprecated.bitsPerPixelForFormat(self) - deprecatedTip("Texture2D:bitsPerPixelForFormat","Texture2D:getBitsPerPixelForFormat") - return self:getBitsPerPixelForFormat() -end -CCTexture2D.bitsPerPixelForFormat = CCTexture2DDeprecated.bitsPerPixelForFormat - -function CCTexture2DDeprecated.bitsPerPixelForFormat(self,pixelFormat) - deprecatedTip("Texture2D:bitsPerPixelForFormat","Texture2D:getBitsPerPixelForFormat") - return self:getBitsPerPixelForFormat(pixelFormat) -end -CCTexture2D.bitsPerPixelForFormat = CCTexture2DDeprecated.bitsPerPixelForFormat - -function CCTexture2DDeprecated.defaultAlphaPixelFormat(self) - deprecatedTip("Texture2D:defaultAlphaPixelFormat","Texture2D:getDefaultAlphaPixelFormat") - return self:getDefaultAlphaPixelFormat() -end -CCTexture2D.defaultAlphaPixelFormat = CCTexture2DDeprecated.defaultAlphaPixelFormat ---functions of CCTexture2D will be deprecated end - - ---functions of CCTimer will be deprecated begin -local CCTimerDeprecated = { } -function CCTimerDeprecated.timerWithScriptHandler(handler,seconds) - deprecatedTip("CCTimer:timerWithScriptHandler","CCTimer:createWithScriptHandler") - return CCTimer:createWithScriptHandler(handler,seconds) -end -CCTimer.timerWithScriptHandler = CCTimerDeprecated.timerWithScriptHandler - -function CCTimerDeprecated.numberOfRunningActionsInTarget(self,target) - deprecatedTip("CCActionManager:numberOfRunningActionsInTarget","CCActionManager:getNumberOfRunningActionsInTarget") - return self:getNumberOfRunningActionsInTarget(target) -end -CCTimer.numberOfRunningActionsInTarget = CCTimerDeprecated.numberOfRunningActionsInTarget ---functions of CCTimer will be deprecated end - - ---functions of CCMenuItemFont will be deprecated begin -local CCMenuItemFontDeprecated = { } -function CCMenuItemFontDeprecated.fontSize() - deprecatedTip("CCMenuItemFont:fontSize","CCMenuItemFont:getFontSize") - return CCMenuItemFont:getFontSize() -end -CCMenuItemFont.fontSize = CCMenuItemFontDeprecated.fontSize - -function CCMenuItemFontDeprecated.fontName() - deprecatedTip("CCMenuItemFont:fontName","CCMenuItemFont:getFontName") - return CCMenuItemFont:getFontName() -end -CCMenuItemFont.fontName = CCMenuItemFontDeprecated.fontName - -function CCMenuItemFontDeprecated.fontSizeObj(self) - deprecatedTip("CCMenuItemFont:fontSizeObj","CCMenuItemFont:getFontSizeObj") - return self:getFontSizeObj() -end -CCMenuItemFont.fontSizeObj = CCMenuItemFontDeprecated.fontSizeObj - -function CCMenuItemFontDeprecated.fontNameObj(self) - deprecatedTip("CCMenuItemFont:fontNameObj","CCMenuItemFont:getFontNameObj") - return self:getFontNameObj() -end -CCMenuItemFont.fontNameObj = CCMenuItemFontDeprecated.fontNameObj ---functions of CCMenuItemFont will be deprecated end - - ---functions of CCMenuItemToggle will be deprecated begin -local CCMenuItemToggleDeprecated = { } -function CCMenuItemToggleDeprecated.selectedItem(self) - deprecatedTip("CCMenuItemToggle:selectedItem","CCMenuItemToggle:getSelectedItem") - return self:getSelectedItem() -end -CCMenuItemToggle.selectedItem = CCMenuItemToggleDeprecated.selectedItem ---functions of CCMenuItemToggle will be deprecated end - - ---functions of CCTileMapAtlas will be deprecated begin -local CCTileMapAtlasDeprecated = { } -function CCTileMapAtlasDeprecated.tileAt(self,pos) - deprecatedTip("CCTileMapAtlas:tileAt","CCTileMapAtlas:getTileAt") - return self:getTileAt(pos) -end -CCTileMapAtlas.tileAt = CCTileMapAtlasDeprecated.tileAt ---functions of CCTileMapAtlas will be deprecated end - - ---functions of CCTMXLayer will be deprecated begin -local CCTMXLayerDeprecated = { } -function CCTMXLayerDeprecated.tileAt(self,tileCoordinate) - deprecatedTip("CCTMXLayer:tileAt","CCTMXLayer:getTileAt") - return self:getTileAt(tileCoordinate) -end -CCTMXLayer.tileAt = CCTMXLayerDeprecated.tileAt - -function CCTMXLayerDeprecated.tileGIDAt(self,tileCoordinate) - deprecatedTip("CCTMXLayer:tileGIDAt","CCTMXLayer:getTileGIDAt") - return self:getTileGIDAt(tileCoordinate) -end -CCTMXLayer.tileGIDAt = CCTMXLayerDeprecated.tileGIDAt - -function CCTMXLayerDeprecated.positionAt(self,tileCoordinate) - deprecatedTip("CCTMXLayer:positionAt","CCTMXLayer:getPositionAt") - return self:getPositionAt(tileCoordinate) -end -CCTMXLayer.positionAt = CCTMXLayerDeprecated.positionAt - -function CCTMXLayerDeprecated.propertyNamed(self,propertyName) - deprecatedTip("CCTMXLayer:propertyNamed","CCTMXLayer:getProperty") - return self:getProperty(propertyName) -end -CCTMXLayer.propertyNamed = CCTMXLayerDeprecated.propertyNamed ---functions of CCTMXLayer will be deprecated end - ---functions of CCTMXTiledMap will be deprecated begin -local CCTMXTiledMapDeprecated = { } -function CCTMXTiledMapDeprecated.layerNamed(self,layerName) - deprecatedTip("CCTMXTiledMap:layerNamed","CCTMXTiledMap:getLayer") - return self:getLayer(layerName) -end -CCTMXTiledMap.layerNamed = CCTMXTiledMapDeprecated.layerNamed - -function CCTMXTiledMapDeprecated.propertyNamed(self,propertyName) - deprecatedTip("CCTMXTiledMap:propertyNamed","CCTMXTiledMap:getProperty") - return self:getProperty(propertyName) -end -CCTMXTiledMap.propertyNamed = CCTMXTiledMapDeprecated.propertyNamed - -function CCTMXTiledMapDeprecated.propertiesForGID(self,GID) - deprecatedTip("CCTMXTiledMap:propertiesForGID","CCTMXTiledMap:getPropertiesForGID") - return self:getPropertiesForGID(GID) -end -CCTMXTiledMap.propertiesForGID = CCTMXTiledMapDeprecated.propertiesForGID - -function CCTMXTiledMapDeprecated.objectGroupNamed(self,groupName) - deprecatedTip("CCTMXTiledMap:objectGroupNamed","CCTMXTiledMap:getObjectGroup") - return self:getObjectGroup(groupName) -end -CCTMXTiledMap.objectGroupNamed = CCTMXTiledMapDeprecated.objectGroupNamed ---functions of CCTMXTiledMap will be deprecated end - - ---functions of CCTMXMapInfo will be deprecated begin -local CCTMXMapInfoDeprecated = { } -function CCTMXMapInfoDeprecated.getStoringCharacters(self) - deprecatedTip("CCTMXMapInfo:getStoringCharacters","CCTMXMapInfo:isStoringCharacters") - return self:isStoringCharacters() -end -CCTMXMapInfo.getStoringCharacters = CCTMXMapInfoDeprecated.getStoringCharacters - -function CCTMXMapInfoDeprecated.formatWithTMXFile(infoTable,tmxFile) - deprecatedTip("CCTMXMapInfo:formatWithTMXFile","CCTMXMapInfo:create") - return CCTMXMapInfo:create(tmxFile) -end -CCTMXMapInfo.formatWithTMXFile = CCTMXMapInfoDeprecated.formatWithTMXFile - -function CCTMXMapInfoDeprecated.formatWithXML(infoTable,tmxString,resourcePath) - deprecatedTip("CCTMXMapInfo:formatWithXML","TMXMapInfo:createWithXML") - return CCTMXMapInfo:createWithXML(tmxString,resourcePath) -end -CCTMXMapInfo.formatWithXML = CCTMXMapInfoDeprecated.formatWithXML ---functions of CCTMXMapInfo will be deprecated end - - ---functions of CCTMXObject will be deprecated begin -local CCTMXObjectGroupDeprecated = { } -function CCTMXObjectGroupDeprecated.propertyNamed(self,propertyName) - deprecatedTip("CCTMXObjectGroup:propertyNamed","CCTMXObjectGroup:getProperty") - return self:getProperty(propertyName) -end -CCTMXObjectGroup.propertyNamed = CCTMXObjectGroupDeprecated.propertyNamed - -function CCTMXObjectGroupDeprecated.objectNamed(self, objectName) - deprecatedTip("CCTMXObjectGroup:objectNamed","CCTMXObjectGroup:getObject") - return self:getObject(objectName) -end -CCTMXObjectGroup.objectNamed = CCTMXObjectGroupDeprecated.objectNamed ---functions of CCTMXObject will be deprecated end - ---functions of CCRenderTexture will be deprecated begin -local CCRenderTextureDeprecated = { } -function CCRenderTextureDeprecated.newCCImage(self) - deprecatedTip("CCRenderTexture:newCCImage","CCRenderTexture:newImage") - return self:newImage() -end -CCRenderTexture.newCCImage = CCRenderTextureDeprecated.newCCImage ---functions of CCRenderTexture will be deprecated end - ---functions of Sprite will be deprecated begin -local CCSpriteDeprecated = { } -function CCSpriteDeprecated.setFlipX(self,flag) - deprecatedTip("CCSpriteDeprecated:setFlipX","CCSpriteDeprecated:setFlippedX") - return self:setFlippedX(flag) -end -cc.Sprite.setFlipX = CCSpriteDeprecated.setFlipX - -function CCSpriteDeprecated.setFlipY(self,flag) - deprecatedTip("CCSpriteDeprecated:setFlipY","CCSpriteDeprecated:setFlippedY") - return self:setFlippedY(flag) -end -cc.Sprite.setFlipY = CCSpriteDeprecated.setFlipY ---functions of Sprite will be deprecated end - - ---functions of Layer will be deprecated begin -local CCLayerDeprecated = {} -function CCLayerDeprecated.setKeypadEnabled( self, enabled) - return self:setKeyboardEnabled(enabled) -end -cc.Layer.setKeypadEnabled = CCLayerDeprecated.setKeypadEnabled - -function CCLayerDeprecated.isKeypadEnabled(self) - return self:isKeyboardEnabled() -end -cc.Layer.isKeypadEnabled = CCLayerDeprecated.isKeypadEnabled ---functions of Layer will be deprecated end - ---functions of cc.Node will be deprecated begin -local NodeDeprecated = { } -function NodeDeprecated.setZOrder(self,zOrder) - deprecatedTip("cc.Node:setZOrder","cc.Node:setLocalZOrder") - return self:setLocalZOrder(zOrder) -end -cc.Node.setZOrder = NodeDeprecated.setZOrder - -function NodeDeprecated.getZOrder(self) - deprecatedTip("cc.Node:getZOrder","cc.Node:getLocalZOrder") - return self:getLocalZOrder() -end -cc.Node.getZOrder = NodeDeprecated.getZOrder - -function NodeDeprecated.setVertexZ(self,vertexZ) - deprecatedTip("cc.Node:setVertexZ", "cc.Node:setPositionZ") - return self:setPositionZ(vertexZ) -end -cc.Node.setVertexZ = NodeDeprecated.setVertexZ - -function NodeDeprecated.getVertexZ(self) - deprecatedTip("cc.Node:getVertexZ", "cc.Node:getPositionZ") - return self:getPositionZ() -end -cc.Node.getVertexZ = NodeDeprecated.getVertexZ - -function NodeDeprecated.ignoreAnchorPointForPosition(self,ignore) - deprecatedTip("cc.Node:ignoreAnchorPointForPosition", "cc.Node:setIgnoreAnchorPointForPosition") - return self:setIgnoreAnchorPointForPosition(ignore) -end - -cc.Node.ignoreAnchorPointForPosition = NodeDeprecated.ignoreAnchorPointForPosition ---functions of cc.Node will be deprecated end - ---functions of cc.GLProgram will be deprecated begin ---functions of cc.GLProgram will be deprecated end diff --git a/cocos/scripting/lua-bindings/script/cocos2d/DrawPrimitives.lua b/cocos/scripting/lua-bindings/script/cocos2d/DrawPrimitives.lua deleted file mode 100644 index e4f50a9..0000000 --- a/cocos/scripting/lua-bindings/script/cocos2d/DrawPrimitives.lua +++ /dev/null @@ -1,384 +0,0 @@ - -local dp_initialized = false -local dp_shader = nil -local dp_colorLocation = -1 -local dp_color = { 1.0, 1.0, 1.0, 1.0 } -local dp_pointSizeLocation = -1 -local dp_pointSize = 1.0 - -local SHADER_NAME_POSITION_U_COLOR = "ShaderPosition_uColor" - -local targetPlatform = cc.Application:getInstance():getTargetPlatform() - -local function lazy_init() - if not dp_initialized then - dp_shader = cc.ShaderCache:getInstance():getProgram(SHADER_NAME_POSITION_U_COLOR) - --dp_shader:retain() - if nil ~= dp_shader then - dp_colorLocation = gl.getUniformLocation( dp_shader:getProgram(), "u_color") - dp_pointSizeLocation = gl.getUniformLocation( dp_shader:getProgram(), "u_pointSize") - dp_Initialized = true - end - end - - if nil == dp_shader then - print("Error:dp_shader is nil!") - return false - end - - return true -end - -local function setDrawProperty() - gl.glEnableVertexAttribs( CCConstants.VERTEX_ATTRIB_FLAG_POSITION ) - dp_shader:use() - dp_shader:setUniformsForBuiltins() - dp_shader:setUniformLocationWith4fv(dp_colorLocation, dp_color, 1) -end - -function ccDrawInit() - lazy_init() -end - -function ccDrawFree() - dp_initialized = false -end - -function ccDrawColor4f(r,g,b,a) - dp_color[1] = r - dp_color[2] = g - dp_color[3] = b - dp_color[4] = a -end - -function ccPointSize(pointSize) - dp_pointSize = pointSize * cc.Director:getInstance():getContentScaleFactor() -end - -function ccDrawColor4B(r,g,b,a) - dp_color[1] = r / 255.0 - dp_color[2] = g / 255.0 - dp_color[3] = b / 255.0 - dp_color[4] = a / 255.0 -end - -function ccDrawPoint(point) - if not lazy_init() then - return - end - - local vertexBuffer = { } - - local function initBuffer() - vertexBuffer.buffer_id = gl.createBuffer() - gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id) - local vertices = { point.x,point.y} - gl.bufferData(gl.ARRAY_BUFFER,2,vertices,gl.STATIC_DRAW) - gl.bindBuffer(gl.ARRAY_BUFFER, 0) - end - - initBuffer() - - setDrawProperty() - - dp_shader:setUniformLocationWith1f(dp_pointSizeLocation, dp_pointSize) - - gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id) - gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0) - gl.drawArrays(gl.POINTS,0,1) - gl.bindBuffer(gl.ARRAY_BUFFER,0) -end - -function ccDrawPoints(points,numOfPoint) - if not lazy_init() then - return - end - - local vertexBuffer = {} - local i = 1 - - local function initBuffer() - vertexBuffer.buffer_id = gl.createBuffer() - gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer.buffer_id) - local vertices = {} - for i = 1, numOfPoint do - vertices[2 * i - 1] = points[i].x - vertices[2 * i] = points[i].y - end - gl.bufferData(gl.ARRAY_BUFFER, numOfPoint * 2, vertices, gl.STATIC_DRAW) - gl.bindBuffer(gl.ARRAY_BUFFER, 0) - end - - initBuffer() - - setDrawProperty() - - dp_shader:setUniformLocationWith1f(dp_pointSizeLocation, dp_pointSize) - - gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id) - gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0) - gl.drawArrays(gl.POINTS,0,numOfPoint) - gl.bindBuffer(gl.ARRAY_BUFFER,0) -end - -function ccDrawLine(origin,destination) - if not lazy_init() then - return - end - - local vertexBuffer = {} - - local function initBuffer() - vertexBuffer.buffer_id = gl.createBuffer() - gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer.buffer_id) - local vertices = { origin.x, origin.y, destination.x, destination.y} - gl.bufferData(gl.ARRAY_BUFFER,4,vertices,gl.STATIC_DRAW) - gl.bindBuffer(gl.ARRAY_BUFFER, 0) - end - - initBuffer() - - setDrawProperty() - - gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id) - gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0) - gl.drawArrays(gl.LINES ,0,2) - gl.bindBuffer(gl.ARRAY_BUFFER,0) -end - -function ccDrawPoly(points,numOfPoints,closePolygon) - if not lazy_init() then - return - end - - local vertexBuffer = {} - local i = 1 - - local function initBuffer() - vertexBuffer.buffer_id = gl.createBuffer() - gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer.buffer_id) - local vertices = {} - for i = 1, numOfPoints do - vertices[2 * i - 1] = points[i].x - vertices[2 * i] = points[i].y - end - gl.bufferData(gl.ARRAY_BUFFER, numOfPoints * 2, vertices, gl.STATIC_DRAW) - gl.bindBuffer(gl.ARRAY_BUFFER, 0) - end - - initBuffer() - - setDrawProperty() - - gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id) - gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0) - if closePolygon then - gl.drawArrays(gl.LINE_LOOP , 0, numOfPoints) - else - gl.drawArrays(gl.LINE_STRIP, 0, numOfPoints) - end - gl.bindBuffer(gl.ARRAY_BUFFER,0) -end - -function ccDrawSolidPoly(points,numOfPoints,color) - if not lazy_init() then - return - end - - local vertexBuffer = {} - local i = 1 - - local function initBuffer() - vertexBuffer.buffer_id = gl.createBuffer() - gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer.buffer_id) - local vertices = {} - for i = 1, numOfPoints do - vertices[2 * i - 1] = points[i].x - vertices[2 * i] = points[i].y - - end - gl.bufferData(gl.ARRAY_BUFFER, numOfPoints * 2, vertices, gl.STATIC_DRAW) - gl.bindBuffer(gl.ARRAY_BUFFER, 0) - end - - initBuffer() - - gl.glEnableVertexAttribs( CCConstants.VERTEX_ATTRIB_FLAG_POSITION ) - dp_shader:use() - dp_shader:setUniformsForBuiltins() - dp_shader:setUniformLocationWith4fv(dp_colorLocation, color, 1) - - gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id) - gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0) - gl.drawArrays(gl.TRIANGLE_FAN , 0, numOfPoints) - gl.bindBuffer(gl.ARRAY_BUFFER,0) -end - -function ccDrawRect(origin,destination) - ccDrawLine(CCPoint:__call(origin.x, origin.y), CCPoint:__call(destination.x, origin.y)) - ccDrawLine(CCPoint:__call(destination.x, origin.y), CCPoint:__call(destination.x, destination.y)) - ccDrawLine(CCPoint:__call(destination.x, destination.y), CCPoint:__call(origin.x, destination.y)) - ccDrawLine(CCPoint:__call(origin.x, destination.y), CCPoint:__call(origin.x, origin.y)) -end - -function ccDrawSolidRect( origin,destination,color ) - local vertices = { origin, CCPoint:__call(destination.x, origin.y) , destination, CCPoint:__call(origin.x, destination.y) } - ccDrawSolidPoly(vertices,4,color) -end - -function ccDrawCircleScale( center, radius, angle, segments,drawLineToCenter,scaleX,scaleY) - if not lazy_init() then - return - end - - local additionalSegment = 1 - if drawLineToCenter then - additionalSegment = additionalSegment + 1 - end - - local vertexBuffer = { } - - local function initBuffer() - local coef = 2.0 * math.pi / segments - local i = 1 - local vertices = {} - vertexBuffer.buffer_id = gl.createBuffer() - gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer.buffer_id) - for i = 1, segments + 1 do - local rads = (i - 1) * coef - local j = radius * math.cos(rads + angle) * scaleX + center.x - local k = radius * math.sin(rads + angle) * scaleY + center.y - vertices[i * 2 - 1] = j - vertices[i * 2] = k - end - vertices[(segments + 2) * 2 - 1] = center.x - vertices[(segments + 2) * 2] = center.y - - gl.bufferData(gl.ARRAY_BUFFER, (segments + 2) * 2, vertices, gl.STATIC_DRAW) - gl.bindBuffer(gl.ARRAY_BUFFER, 0) - end - - initBuffer() - - setDrawProperty() - - gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id) - gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0) - gl.drawArrays(gl.LINE_STRIP , 0, segments + additionalSegment) - gl.bindBuffer(gl.ARRAY_BUFFER,0) -end - -function ccDrawCircle(center, radius, angle, segments, drawLineToCenter) - ccDrawCircleScale(center, radius, angle, segments, drawLineToCenter, 1.0, 1.0) -end - -function ccDrawSolidCircle(center, radius, angle, segments,scaleX,scaleY) - if not lazy_init() then - return - end - - local vertexBuffer = { } - - local function initBuffer() - local coef = 2.0 * math.pi / segments - local i = 1 - local vertices = {} - vertexBuffer.buffer_id = gl.createBuffer() - gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer.buffer_id) - for i = 1, segments + 1 do - local rads = (i - 1) * coef - local j = radius * math.cos(rads + angle) * scaleX + center.x - local k = radius * math.sin(rads + angle) * scaleY + center.y - vertices[i * 2 - 1] = j - vertices[i * 2] = k - end - vertices[(segments + 2) * 2 - 1] = center.x - vertices[(segments + 2) * 2] = center.y - - gl.bufferData(gl.ARRAY_BUFFER, (segments + 2) * 2, vertices, gl.STATIC_DRAW) - gl.bindBuffer(gl.ARRAY_BUFFER, 0) - end - - initBuffer() - - setDrawProperty() - - gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id) - gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0) - gl.drawArrays(gl.TRIANGLE_FAN , 0, segments + 1) - gl.bindBuffer(gl.ARRAY_BUFFER,0) -end - -function ccDrawQuadBezier(origin, control, destination, segments) - if not lazy_init() then - return - end - - local vertexBuffer = { } - - local function initBuffer() - local vertices = { } - local i = 1 - local t = 0.0 - - for i = 1, segments do - vertices[2 * i - 1] = math.pow(1 - t,2) * origin.x + 2.0 * (1 - t) * t * control.x + t * t * destination.x - vertices[2 * i] = math.pow(1 - t,2) * origin.y + 2.0 * (1 - t) * t * control.y + t * t * destination.y - t = t + 1.0 / segments - end - - vertices[2 * (segments + 1) - 1] = destination.x - vertices[2 * (segments + 1)] = destination.y - - vertexBuffer.buffer_id = gl.createBuffer() - gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer.buffer_id) - gl.bufferData(gl.ARRAY_BUFFER, (segments + 1) * 2, vertices, gl.STATIC_DRAW) - gl.bindBuffer(gl.ARRAY_BUFFER, 0) - end - - initBuffer() - - setDrawProperty() - - gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id) - gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0) - gl.drawArrays(gl.LINE_STRIP , 0, segments + 1) - gl.bindBuffer(gl.ARRAY_BUFFER,0) -end - -function ccDrawCubicBezier(origin, control1, control2, destination, segments) - if not lazy_init then - return - end - - local vertexBuffer = { } - - local function initBuffer() - local vertices = { } - local t = 0 - local i = 1 - - for i = 1, segments do - vertices[2 * i - 1] = math.pow(1 - t,3) * origin.x + 3.0 * math.pow(1 - t, 2) * t * control1.x + 3.0 * (1 - t) * t * t * control2.x + t * t * t * destination.x - vertices[2 * i] = math.pow(1 - t,3) * origin.y + 3.0 * math.pow(1 - t, 2) * t * control1.y + 3.0 * (1 - t) * t * t * control2.y + t * t * t * destination.y - t = t + 1.0 / segments - end - - vertices[2 * (segments + 1) - 1] = destination.x - vertices[2 * (segments + 1)] = destination.y - - vertexBuffer.buffer_id = gl.createBuffer() - gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer.buffer_id) - gl.bufferData(gl.ARRAY_BUFFER, (segments + 1) * 2, vertices, gl.STATIC_DRAW) - gl.bindBuffer(gl.ARRAY_BUFFER, 0) - end - - initBuffer() - - setDrawProperty() - - gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id) - gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0) - gl.drawArrays(gl.LINE_STRIP , 0, segments + 1) - gl.bindBuffer(gl.ARRAY_BUFFER,0) -end diff --git a/cocos/scripting/lua-bindings/script/cocos2d/bitExtend.lua b/cocos/scripting/lua-bindings/script/cocos2d/bitExtend.lua deleted file mode 100644 index fe024aa..0000000 --- a/cocos/scripting/lua-bindings/script/cocos2d/bitExtend.lua +++ /dev/null @@ -1,96 +0,0 @@ --- bit operation - -bit = bit or {} -bit.data32 = {} - -for i=1,32 do - bit.data32[i]=2^(32-i) -end - -function bit._b2d(arg) - local nr=0 - for i=1,32 do - if arg[i] ==1 then - nr=nr+bit.data32[i] - end - end - return nr -end - -function bit._d2b(arg) - arg = arg >= 0 and arg or (0xFFFFFFFF + arg + 1) - local tr={} - for i=1,32 do - if arg >= bit.data32[i] then - tr[i]=1 - arg=arg-bit.data32[i] - else - tr[i]=0 - end - end - return tr -end - -function bit._and(a,b) - local op1=bit._d2b(a) - local op2=bit._d2b(b) - local r={} - - for i=1,32 do - if op1[i]==1 and op2[i]==1 then - r[i]=1 - else - r[i]=0 - end - end - return bit._b2d(r) - -end - -function bit._rshift(a,n) - local op1=bit._d2b(a) - n = n <= 32 and n or 32 - n = n >= 0 and n or 0 - - for i=32, n+1, -1 do - op1[i] = op1[i-n] - end - for i=1, n do - op1[i] = 0 - end - - return bit._b2d(op1) -end - -function bit._not(a) - local op1=bit._d2b(a) - local r={} - - for i=1,32 do - if op1[i]==1 then - r[i]=0 - else - r[i]=1 - end - end - return bit._b2d(r) -end - -function bit._or(a,b) - local op1=bit._d2b(a) - local op2=bit._d2b(b) - local r={} - - for i=1,32 do - if op1[i]==1 or op2[i]==1 then - r[i]=1 - else - r[i]=0 - end - end - return bit._b2d(r) -end - -bit.band = bit.band or bit._and -bit.rshift = bit.rshift or bit._rshift -bit.bnot = bit.bnot or bit._not diff --git a/cocos/scripting/lua-bindings/script/cocos2d/deprecated.lua b/cocos/scripting/lua-bindings/script/cocos2d/deprecated.lua deleted file mode 100644 index 9c82fa8..0000000 --- a/cocos/scripting/lua-bindings/script/cocos2d/deprecated.lua +++ /dev/null @@ -1,15 +0,0 @@ - -function schedule(node, callback, delay) - local delay = cc.DelayTime:create(delay) - local sequence = cc.Sequence:create(delay, cc.CallFunc:create(callback)) - local action = cc.RepeatForever:create(sequence) - node:runAction(action) - return action -end - -function performWithDelay(node, callback, delay) - local delay = cc.DelayTime:create(delay) - local sequence = cc.Sequence:create(delay, cc.CallFunc:create(callback)) - node:runAction(sequence) - return sequence -end diff --git a/cocos/scripting/lua-bindings/script/cocosdenshion/AudioEngine.lua b/cocos/scripting/lua-bindings/script/cocosdenshion/AudioEngine.lua deleted file mode 100644 index deea904..0000000 --- a/cocos/scripting/lua-bindings/script/cocosdenshion/AudioEngine.lua +++ /dev/null @@ -1,111 +0,0 @@ -if nil == cc.SimpleAudioEngine then - return -end ---Encapsulate SimpleAudioEngine to AudioEngine,Play music and sound effects. -local M = {} - -function M.stopAllEffects() - cc.SimpleAudioEngine:getInstance():stopAllEffects() -end - -function M.getMusicVolume() - return cc.SimpleAudioEngine:getInstance():getMusicVolume() -end - -function M.isMusicPlaying() - return cc.SimpleAudioEngine:getInstance():isMusicPlaying() -end - -function M.getEffectsVolume() - return cc.SimpleAudioEngine:getInstance():getEffectsVolume() -end - -function M.setMusicVolume(volume) - cc.SimpleAudioEngine:getInstance():setMusicVolume(volume) -end - -function M.stopEffect(handle) - cc.SimpleAudioEngine:getInstance():stopEffect(handle) -end - -function M.stopMusic(isReleaseData) - local releaseDataValue = false - if nil ~= isReleaseData then - releaseDataValue = isReleaseData - end - cc.SimpleAudioEngine:getInstance():stopMusic(releaseDataValue) -end - -function M.playMusic(filename, isLoop) - local loopValue = false - if nil ~= isLoop then - loopValue = isLoop - end - cc.SimpleAudioEngine:getInstance():playMusic(filename, loopValue) -end - -function M.pauseAllEffects() - cc.SimpleAudioEngine:getInstance():pauseAllEffects() -end - -function M.preloadMusic(filename) - cc.SimpleAudioEngine:getInstance():preloadMusic(filename) -end - -function M.resumeMusic() - cc.SimpleAudioEngine:getInstance():resumeMusic() -end - -function M.playEffect(filename, isLoop) - local loopValue = false - if nil ~= isLoop then - loopValue = isLoop - end - return cc.SimpleAudioEngine:getInstance():playEffect(filename, loopValue) -end - -function M.rewindMusic() - cc.SimpleAudioEngine:getInstance():rewindMusic() -end - -function M.willPlayMusic() - return cc.SimpleAudioEngine:getInstance():willPlayMusic() -end - -function M.unloadEffect(filename) - cc.SimpleAudioEngine:getInstance():unloadEffect(filename) -end - -function M.preloadEffect(filename) - cc.SimpleAudioEngine:getInstance():preloadEffect(filename) -end - -function M.setEffectsVolume(volume) - cc.SimpleAudioEngine:getInstance():setEffectsVolume(volume) -end - -function M.pauseEffect(handle) - cc.SimpleAudioEngine:getInstance():pauseEffect(handle) -end - -function M.resumeAllEffects(handle) - cc.SimpleAudioEngine:getInstance():resumeAllEffects() -end - -function M.pauseMusic() - cc.SimpleAudioEngine:getInstance():pauseMusic() -end - -function M.resumeEffect(handle) - cc.SimpleAudioEngine:getInstance():resumeEffect(handle) -end - -function M.getInstance() - return cc.SimpleAudioEngine:getInstance() -end - -function M.destroyInstance() - return cc.SimpleAudioEngine:destroyInstance() -end - -AudioEngine = M diff --git a/cocos/scripting/lua-bindings/script/cocostudio/DeprecatedCocoStudioClass.lua b/cocos/scripting/lua-bindings/script/cocostudio/DeprecatedCocoStudioClass.lua deleted file mode 100644 index 712886b..0000000 --- a/cocos/scripting/lua-bindings/script/cocostudio/DeprecatedCocoStudioClass.lua +++ /dev/null @@ -1,307 +0,0 @@ -if nil == ccs then - return -end --- This is the DeprecatedExtensionClass - -DeprecatedExtensionClass = {} or DeprecatedExtensionClass - ---tip -local function deprecatedTip(old_name,new_name) - print("\n********** \n"..old_name.." was deprecated please use ".. new_name .. " instead.\n**********") -end - ---CCArmature class will be Deprecated,begin -function DeprecatedExtensionClass.CCArmature() - deprecatedTip("CCArmature","ccs.Armature") - return ccs.Armature -end -_G["CCArmature"] = DeprecatedExtensionClass.CCArmature() ---CCArmature class will be Deprecated,end - ---CCArmatureAnimation class will be Deprecated,begin -function DeprecatedExtensionClass.CCArmatureAnimation() - deprecatedTip("CCArmatureAnimation","ccs.ArmatureAnimation") - return ccs.ArmatureAnimation -end -_G["CCArmatureAnimation"] = DeprecatedExtensionClass.CCArmatureAnimation() ---CCArmatureAnimation class will be Deprecated,end - ---CCSkin class will be Deprecated,begin -function DeprecatedExtensionClass.CCSkin() - deprecatedTip("CCSkin","ccs.Skin") - return ccs.Skin -end -_G["CCSkin"] = DeprecatedExtensionClass.CCSkin() ---CCSkin class will be Deprecated,end - ---CCBone class will be Deprecated,begin -function DeprecatedExtensionClass.CCBone() - deprecatedTip("CCBone","ccs.Bone") - return ccs.Bone -end -_G["CCBone"] = DeprecatedExtensionClass.CCBone() ---CCBone class will be Deprecated,end - ---CCArmatureDataManager class will be Deprecated,begin -function DeprecatedExtensionClass.CCArmatureDataManager() - deprecatedTip("CCArmatureDataManager","ccs.ArmatureDataManager") - return ccs.ArmatureDataManager -end -_G["CCArmatureDataManager"] = DeprecatedExtensionClass.CCArmatureDataManager() ---CCArmatureDataManager class will be Deprecated,end - ---CCBatchNode class will be Deprecated,begin -function DeprecatedExtensionClass.CCBatchNode() - deprecatedTip("CCBatchNode","ccs.BatchNode") - return ccs.BatchNode -end -_G["CCBatchNode"] = DeprecatedExtensionClass.CCBatchNode() ---CCBatchNode class will be Deprecated,end - ---CCTween class will be Deprecated,begin -function DeprecatedExtensionClass.CCTween() - deprecatedTip("CCTween","ccs.Tween") - return ccs.Tween -end -_G["CCTween"] = DeprecatedExtensionClass.CCTween() ---CCTween class will be Deprecated,end - ---CCBaseData class will be Deprecated,begin -function DeprecatedExtensionClass.CCBaseData() - deprecatedTip("CCBaseData","ccs.BaseData") - return ccs.BaseData -end -_G["CCBaseData"] = DeprecatedExtensionClass.CCBaseData() ---CCBaseData class will be Deprecated,end - ---CCDisplayManager class will be Deprecated,begin -function DeprecatedExtensionClass.CCDisplayManager() - deprecatedTip("CCDisplayManager","ccs.DisplayManager") - return ccs.DisplayManager -end -_G["CCDisplayManager"] = DeprecatedExtensionClass.CCDisplayManager() ---CCDisplayManager class will be Deprecated,end - ---UIHelper class will be Deprecated,begin -function DeprecatedExtensionClass.UIHelper() - deprecatedTip("UIHelper","ccs.UIHelper") - return ccs.UIHelper -end -_G["UIHelper"] = DeprecatedExtensionClass.UIHelper() ---UIHelper class will be Deprecated,end - ---UILayout class will be Deprecated,begin -function DeprecatedExtensionClass.UILayout() - deprecatedTip("UILayout","ccs.UILayout") - return ccs.UILayout -end -_G["UILayout"] = DeprecatedExtensionClass.UILayout() ---UILayout class will be Deprecated,end - ---UIWidget class will be Deprecated,begin -function DeprecatedExtensionClass.UIWidget() - deprecatedTip("UIWidget","ccs.UIWidget") - return ccs.UIWidget -end -_G["UIWidget"] = DeprecatedExtensionClass.UIWidget() ---UIWidget class will be Deprecated,end - ---UILayer class will be Deprecated,begin -function DeprecatedExtensionClass.UILayer() - deprecatedTip("UILayer","ccs.UILayer") - return ccs.UILayer -end -_G["UILayer"] = DeprecatedExtensionClass.UILayer() ---UILayer class will be Deprecated,end - ---UIButton class will be Deprecated,begin -function DeprecatedExtensionClass.UIButton() - deprecatedTip("UIButton","ccs.UIButton") - return ccs.UIButton -end -_G["UIButton"] = DeprecatedExtensionClass.UIButton() ---UIButton class will be Deprecated,end - ---UICheckBox class will be Deprecated,begin -function DeprecatedExtensionClass.UICheckBox() - deprecatedTip("UICheckBox","ccs.UICheckBox") - return ccs.UICheckBox -end -_G["UICheckBox"] = DeprecatedExtensionClass.UICheckBox() ---UICheckBox class will be Deprecated,end - ---UIImageView class will be Deprecated,begin -function DeprecatedExtensionClass.UIImageView() - deprecatedTip("UIImageView","ccs.UIImageView") - return ccs.UIImageView -end -_G["UIImageView"] = DeprecatedExtensionClass.UIImageView() ---UIImageView class will be Deprecated,end - ---UILabel class will be Deprecated,begin -function DeprecatedExtensionClass.UILabel() - deprecatedTip("UILabel","ccs.UILabel") - return ccs.UILabel -end -_G["UILabel"] = DeprecatedExtensionClass.UILabel() ---UILabel class will be Deprecated,end - ---UILabelAtlas class will be Deprecated,begin -function DeprecatedExtensionClass.UILabelAtlas() - deprecatedTip("UILabelAtlas","ccs.UILabelAtlas") - return ccs.UILabelAtlas -end -_G["UILabelAtlas"] = DeprecatedExtensionClass.UILabelAtlas() ---UILabelAtlas class will be Deprecated,end - ---UILabelBMFont class will be Deprecated,begin -function DeprecatedExtensionClass.UILabelBMFont() - deprecatedTip("UILabelBMFont","ccs.UILabelBMFont") - return ccs.UILabelBMFont -end -_G["UILabelBMFont"] = DeprecatedExtensionClass.UILabelBMFont() ---UILabelBMFont class will be Deprecated,end - ---UILoadingBar class will be Deprecated,begin -function DeprecatedExtensionClass.UILoadingBar() - deprecatedTip("UILoadingBar","ccs.UILoadingBar") - return ccs.UILoadingBar -end -_G["UILoadingBar"] = DeprecatedExtensionClass.UILoadingBar() ---UILoadingBar class will be Deprecated,end - ---UISlider class will be Deprecated,begin -function DeprecatedExtensionClass.UISlider() - deprecatedTip("UISlider","ccs.UISlider") - return ccs.UISlider -end -_G["UISlider"] = DeprecatedExtensionClass.UISlider() ---UISlider class will be Deprecated,end - ---UITextField class will be Deprecated,begin -function DeprecatedExtensionClass.UITextField() - deprecatedTip("UITextField","ccs.UITextField") - return ccs.UITextField -end -_G["UITextField"] = DeprecatedExtensionClass.UITextField() ---UITextField class will be Deprecated,end - ---UIScrollView class will be Deprecated,begin -function DeprecatedExtensionClass.UIScrollView() - deprecatedTip("UIScrollView","ccs.UIScrollView") - return ccs.UIScrollView -end -_G["UIScrollView"] = DeprecatedExtensionClass.UIScrollView() ---UIScrollView class will be Deprecated,end - ---UIPageView class will be Deprecated,begin -function DeprecatedExtensionClass.UIPageView() - deprecatedTip("UIPageView","ccs.UIPageView") - return ccs.UIPageView -end -_G["UIPageView"] = DeprecatedExtensionClass.UIPageView() ---UIPageView class will be Deprecated,end - ---UIListView class will be Deprecated,begin -function DeprecatedExtensionClass.UIListView() - deprecatedTip("UIListView","ccs.UIListView") - return ccs.UIListView -end -_G["UIListView"] = DeprecatedExtensionClass.UIListView() ---UIListView class will be Deprecated,end - ---UILayoutParameter class will be Deprecated,begin -function DeprecatedExtensionClass.UILayoutParameter() - deprecatedTip("UILayoutParameter","ccs.UILayoutParameter") - return ccs.UILayoutParameter -end -_G["UILayoutParameter"] = DeprecatedExtensionClass.UILayoutParameter() ---UILayoutParameter class will be Deprecated,end - ---UILinearLayoutParameter class will be Deprecated,begin -function DeprecatedExtensionClass.UILinearLayoutParameter() - deprecatedTip("UILinearLayoutParameter","ccs.UILinearLayoutParameter") - return ccs.UILinearLayoutParameter -end -_G["UILinearLayoutParameter"] = DeprecatedExtensionClass.UILinearLayoutParameter() ---UILinearLayoutParameter class will be Deprecated,end - ---UIRelativeLayoutParameter class will be Deprecated,begin -function DeprecatedExtensionClass.UIRelativeLayoutParameter() - deprecatedTip("UIRelativeLayoutParameter","ccs.UIRelativeLayoutParameter") - return ccs.UIRelativeLayoutParameter -end -_G["UIRelativeLayoutParameter"] = DeprecatedExtensionClass.UIRelativeLayoutParameter() ---UIRelativeLayoutParameter class will be Deprecated,end - ---CCComController class will be Deprecated,begin -function DeprecatedExtensionClass.CCComController() - deprecatedTip("CCComController","ccs.ComController") - return ccs.CCComController -end -_G["CCComController"] = DeprecatedExtensionClass.CCComController() ---CCComController class will be Deprecated,end - ---CCComAudio class will be Deprecated,begin -function DeprecatedExtensionClass.CCComAudio() - deprecatedTip("CCComAudio","ccs.ComAudio") - return ccs.ComAudio -end -_G["CCComAudio"] = DeprecatedExtensionClass.CCComAudio() ---CCComAudio class will be Deprecated,end - ---CCComAttribute class will be Deprecated,begin -function DeprecatedExtensionClass.CCComAttribute() - deprecatedTip("CCComAttribute","ccs.ComAttribute") - return ccs.ComAttribute -end -_G["CCComAttribute"] = DeprecatedExtensionClass.CCComAttribute() ---CCComAttribute class will be Deprecated,end - ---CCComRender class will be Deprecated,begin -function DeprecatedExtensionClass.CCComRender() - deprecatedTip("CCComRender","ccs.ComRender") - return ccs.ComRender -end -_G["CCComRender"] = DeprecatedExtensionClass.CCComRender() ---CCComRender class will be Deprecated,end - ---ActionManager class will be Deprecated,begin -function DeprecatedExtensionClass.ActionManager() - deprecatedTip("ActionManager","ccs.ActionManagerEx") - return ccs.ActionManagerEx -end -_G["ActionManager"] = DeprecatedExtensionClass.ActionManager() ---CCComRender class will be Deprecated,end - ---SceneReader class will be Deprecated,begin -function DeprecatedExtensionClass.SceneReader() - deprecatedTip("SceneReader","ccs.SceneReader") - return ccs.SceneReader -end -_G["SceneReader"] = DeprecatedExtensionClass.SceneReader() ---SceneReader class will be Deprecated,end - ---GUIReader class will be Deprecated,begin -function DeprecatedExtensionClass.GUIReader() - deprecatedTip("GUIReader","ccs.GUIReader") - return ccs.GUIReader -end -_G["GUIReader"] = DeprecatedExtensionClass.GUIReader() ---GUIReader class will be Deprecated,end - ---UIRootWidget class will be Deprecated,begin -function DeprecatedExtensionClass.UIRootWidget() - deprecatedTip("UIRootWidget","ccs.UIRootWidget") - return ccs.UIRootWidget -end -_G["UIRootWidget"] = DeprecatedExtensionClass.UIRootWidget() ---UIRootWidget class will be Deprecated,end - ---ActionObject class will be Deprecated,begin -function DeprecatedExtensionClass.ActionObject() - deprecatedTip("ActionObject","ccs.ActionObject") - return ccs.ActionObject -end -_G["ActionObject"] = DeprecatedExtensionClass.ActionObject() ---ActionObject class will be Deprecated,end \ No newline at end of file diff --git a/cocos/scripting/lua-bindings/script/cocostudio/DeprecatedCocoStudioFunc.lua b/cocos/scripting/lua-bindings/script/cocostudio/DeprecatedCocoStudioFunc.lua deleted file mode 100644 index f8e867d..0000000 --- a/cocos/scripting/lua-bindings/script/cocostudio/DeprecatedCocoStudioFunc.lua +++ /dev/null @@ -1,81 +0,0 @@ -if nil == ccs then - return -end - ---tip -local function deprecatedTip(old_name,new_name) - print("\n********** \n"..old_name.." was deprecated please use ".. new_name .. " instead.\n**********") -end - ---functions of GUIReader will be deprecated begin -local GUIReaderDeprecated = { } -function GUIReaderDeprecated.shareReader() - deprecatedTip("GUIReader:shareReader","ccs.GUIReader:getInstance") - return ccs.GUIReader:getInstance() -end -GUIReader.shareReader = GUIReaderDeprecated.shareReader - -function GUIReaderDeprecated.purgeGUIReader() - deprecatedTip("GUIReader:purgeGUIReader","ccs.GUIReader:destroyInstance") - return ccs.GUIReader:destroyInstance() -end -GUIReader.purgeGUIReader = GUIReaderDeprecated.purgeGUIReader ---functions of GUIReader will be deprecated end - ---functions of SceneReader will be deprecated begin -local SceneReaderDeprecated = { } -function SceneReaderDeprecated.sharedSceneReader() - deprecatedTip("SceneReader:sharedSceneReader","ccs.SceneReader:getInstance") - return ccs.SceneReader:getInstance() -end -SceneReader.sharedSceneReader = SceneReaderDeprecated.sharedSceneReader - -function SceneReaderDeprecated.purgeSceneReader(self) - deprecatedTip("SceneReader:purgeSceneReader","ccs.SceneReader:destroyInstance") - return self:destroyInstance() -end -SceneReader.purgeSceneReader = SceneReaderDeprecated.purgeSceneReader ---functions of SceneReader will be deprecated end - - ---functions of ccs.GUIReader will be deprecated begin -local CCSGUIReaderDeprecated = { } -function CCSGUIReaderDeprecated.purgeGUIReader() - deprecatedTip("ccs.GUIReader:purgeGUIReader","ccs.GUIReader:destroyInstance") - return ccs.GUIReader:destroyInstance() -end -ccs.GUIReader.purgeGUIReader = CCSGUIReaderDeprecated.purgeGUIReader ---functions of ccs.GUIReader will be deprecated end - ---functions of ccs.ActionManagerEx will be deprecated begin -local CCSActionManagerExDeprecated = { } -function CCSActionManagerExDeprecated.destroyActionManager() - deprecatedTip("ccs.ActionManagerEx:destroyActionManager","ccs.ActionManagerEx:destroyInstance") - return ccs.ActionManagerEx:destroyInstance() -end -ccs.ActionManagerEx.destroyActionManager = CCSActionManagerExDeprecated.destroyActionManager ---functions of ccs.ActionManagerEx will be deprecated end - ---functions of ccs.SceneReader will be deprecated begin -local CCSSceneReaderDeprecated = { } -function CCSSceneReaderDeprecated.destroySceneReader(self) - deprecatedTip("ccs.SceneReader:destroySceneReader","ccs.SceneReader:destroyInstance") - return self:destroyInstance() -end -ccs.SceneReader.destroySceneReader = CCSSceneReaderDeprecated.destroySceneReader ---functions of ccs.SceneReader will be deprecated end - ---functions of CCArmatureDataManager will be deprecated begin -local CCArmatureDataManagerDeprecated = { } -function CCArmatureDataManagerDeprecated.sharedArmatureDataManager() - deprecatedTip("CCArmatureDataManager:sharedArmatureDataManager","ccs.ArmatureDataManager:getInstance") - return ccs.ArmatureDataManager:getInstance() -end -CCArmatureDataManager.sharedArmatureDataManager = CCArmatureDataManagerDeprecated.sharedArmatureDataManager - -function CCArmatureDataManagerDeprecated.purge() - deprecatedTip("CCArmatureDataManager:purge","ccs.ArmatureDataManager:destoryInstance") - return ccs.ArmatureDataManager:destoryInstance() -end -CCArmatureDataManager.purge = CCArmatureDataManagerDeprecated.purge ---functions of CCArmatureDataManager will be deprecated end diff --git a/cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionClass.lua b/cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionClass.lua deleted file mode 100644 index a5a5930..0000000 --- a/cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionClass.lua +++ /dev/null @@ -1,134 +0,0 @@ -if nil == cc.Control then - return -end - --- This is the DeprecatedExtensionClass -DeprecatedExtensionClass = {} or DeprecatedExtensionClass - ---tip -local function deprecatedTip(old_name,new_name) - print("\n********** \n"..old_name.." was deprecated please use ".. new_name .. " instead.\n**********") -end - ---CCControl class will be Deprecated,begin -function DeprecatedExtensionClass.CCControl() - deprecatedTip("CCControl","cc.Control") - return cc.Control -end -_G["CCControl"] = DeprecatedExtensionClass.CCControl() ---CCControl class will be Deprecated,end - ---CCScrollView class will be Deprecated,begin -function DeprecatedExtensionClass.CCScrollView() - deprecatedTip("CCScrollView","cc.ScrollView") - return cc.ScrollView -end -_G["CCScrollView"] = DeprecatedExtensionClass.CCScrollView() ---CCScrollView class will be Deprecated,end - ---CCTableView class will be Deprecated,begin -function DeprecatedExtensionClass.CCTableView() - deprecatedTip("CCTableView","cc.TableView") - return cc.TableView -end -_G["CCTableView"] = DeprecatedExtensionClass.CCTableView() ---CCTableView class will be Deprecated,end - ---CCControlPotentiometer class will be Deprecated,begin -function DeprecatedExtensionClass.CCControlPotentiometer() - deprecatedTip("CCControlPotentiometer","cc.ControlPotentiometer") - return cc.ControlPotentiometer -end -_G["CCControlPotentiometer"] = DeprecatedExtensionClass.CCControlPotentiometer() ---CCControlPotentiometer class will be Deprecated,end - ---CCControlStepper class will be Deprecated,begin -function DeprecatedExtensionClass.CCControlStepper() - deprecatedTip("CCControlStepper","cc.ControlStepper") - return cc.ControlStepper -end -_G["CCControlStepper"] = DeprecatedExtensionClass.CCControlStepper() ---CCControlStepper class will be Deprecated,end - ---CCControlHuePicker class will be Deprecated,begin -function DeprecatedExtensionClass.CCControlHuePicker() - deprecatedTip("CCControlHuePicker","cc.ControlHuePicker") - return cc.ControlHuePicker -end -_G["CCControlHuePicker"] = DeprecatedExtensionClass.CCControlHuePicker() ---CCControlHuePicker class will be Deprecated,end - ---CCControlSlider class will be Deprecated,begin -function DeprecatedExtensionClass.CCControlSlider() - deprecatedTip("CCControlSlider","cc.ControlSlider") - return cc.ControlSlider -end -_G["CCControlSlider"] = DeprecatedExtensionClass.CCControlSlider() ---CCControlSlider class will be Deprecated,end - ---CCControlSaturationBrightnessPicker class will be Deprecated,begin -function DeprecatedExtensionClass.CCControlSaturationBrightnessPicker() - deprecatedTip("CCControlSaturationBrightnessPicker","cc.ControlSaturationBrightnessPicker") - return cc.ControlSaturationBrightnessPicker -end -_G["CCControlSaturationBrightnessPicker"] = DeprecatedExtensionClass.CCControlSaturationBrightnessPicker() ---CCControlSaturationBrightnessPicker class will be Deprecated,end - ---CCControlSwitch class will be Deprecated,begin -function DeprecatedExtensionClass.CCControlSwitch() - deprecatedTip("CCControlSwitch","cc.ControlSwitch") - return cc.ControlSwitch -end -_G["CCControlSwitch"] = DeprecatedExtensionClass.CCControlSwitch() ---CCControlSwitch class will be Deprecated,end - ---CCControlButton class will be Deprecated,begin -function DeprecatedExtensionClass.CCControlButton() - deprecatedTip("CCControlButton","cc.ControlButton") - return cc.ControlButton -end -_G["CCControlButton"] = DeprecatedExtensionClass.CCControlButton() ---CCControlButton class will be Deprecated,end - ---CCControlColourPicker class will be Deprecated,begin -function DeprecatedExtensionClass.CCControlColourPicker() - deprecatedTip("CCControlColourPicker","cc.ControlColourPicker") - return cc.ControlColourPicker -end -_G["CCControlColourPicker"] = DeprecatedExtensionClass.CCControlColourPicker() ---CCControlColourPicker class will be Deprecated,end - - -if nil == ccui then - return -end - ---CCEditBox class will be Deprecated,begin -function DeprecatedExtensionClass.CCEditBox() - deprecatedTip("CCEditBox","ccui.EditBox") - return ccui.EditBox -end -_G["CCEditBox"] = DeprecatedExtensionClass.CCEditBox() - -function DeprecatedExtensionClass.CCUIEditBox() - deprecatedTip("cc.EditBox","ccui.EditBox") - return ccui.EditBox -end -_G["cc"]["EditBox"] = DeprecatedExtensionClass.CCUIEditBox() - ---CCEditBox class will be Deprecated,end - ---CCScale9Sprite class will be Deprecated,begin -function DeprecatedExtensionClass.CCScale9Sprite() - deprecatedTip("CCScale9Sprite","ccui.Scale9Sprite") - return ccui.Scale9Sprite -end -_G["CCScale9Sprite"] = DeprecatedExtensionClass.CCScale9Sprite() - -function DeprecatedExtensionClass.UIScale9Sprite() - deprecatedTip("cc.Scale9Sprite","ccui.Scale9Sprite") - return ccui.Scale9Sprite -end -_G["cc"]["Scale9Sprite"] = DeprecatedExtensionClass.UIScale9Sprite() ---CCScale9Sprite class will be Deprecated,end - diff --git a/cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionEnum.lua b/cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionEnum.lua deleted file mode 100644 index 9483df0..0000000 --- a/cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionEnum.lua +++ /dev/null @@ -1,26 +0,0 @@ -if nil == cc.Control then - return -end - -_G.kCCControlStepperPartMinus = cc.CONTROL_STEPPER_PART_MINUS -_G.kCCControlStepperPartPlus = cc.CONTROL_STEPPER_PART_PLUS -_G.kCCControlStepperPartNone = cc.CONTROL_STEPPER_PART_NONE - -_G.CCControlEventTouchDown = cc.CONTROL_EVENTTYPE_TOUCH_DOWN -_G.CCControlEventTouchDragInside = cc.CONTROL_EVENTTYPE_DRAG_INSIDE -_G.CCControlEventTouchDragOutside = cc.CONTROL_EVENTTYPE_DRAG_OUTSIDE -_G.CCControlEventTouchDragEnter = cc.CONTROL_EVENTTYPE_DRAG_ENTER -_G.CCControlEventTouchDragExit = cc.CONTROL_EVENTTYPE_DRAG_EXIT -_G.CCControlEventTouchUpInside = cc.CONTROL_EVENTTYPE_TOUCH_UP_INSIDE -_G.CCControlEventTouchUpOutside = cc.CONTROL_EVENTTYPE_TOUCH_UP_OUTSIDE -_G.CCControlEventTouchCancel = cc.CONTROL_EVENTTYPE_TOUCH_CANCEL -_G.CCControlEventValueChanged = cc.CONTROL_EVENTTYPE_VALUE_CHANGED -_G.CCControlStateNormal = cc.CONTROL_STATE_NORMAL -_G.CCControlStateHighlighted = cc.CONTROL_STATE_HIGH_LIGHTED -_G.CCControlStateDisabled = cc.CONTROL_STATE_DISABLED -_G.CCControlStateSelected = cc.CONTROL_STATE_SELECTED - -_G.kCCScrollViewDirectionHorizontal = cc.SCROLLVIEW_DIRECTION_HORIZONTAL -_G.kCCScrollViewDirectionVertical = cc.SCROLLVIEW_DIRECTION_VERTICAL -_G.kCCTableViewFillTopDown = cc.TABLEVIEW_FILL_TOPDOWN -_G.kCCTableViewFillBottomUp = cc.TABLEVIEW_FILL_BOTTOMUP diff --git a/cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionFunc.lua b/cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionFunc.lua deleted file mode 100644 index 2b617fc..0000000 --- a/cocos/scripting/lua-bindings/script/extension/DeprecatedExtensionFunc.lua +++ /dev/null @@ -1,32 +0,0 @@ -if nil == cc.Control then - return -end - ---tip -local function deprecatedTip(old_name,new_name) - print("\n********** \n"..old_name.." was deprecated please use ".. new_name .. " instead.\n**********") -end - ---functions of CCControl will be deprecated end -local CCControlDeprecated = { } -function CCControlDeprecated.addHandleOfControlEvent(self,func,controlEvent) - deprecatedTip("addHandleOfControlEvent","registerControlEventHandler") - print("come in addHandleOfControlEvent") - self:registerControlEventHandler(func,controlEvent) -end -CCControl.addHandleOfControlEvent = CCControlDeprecated.addHandleOfControlEvent ---functions of CCControl will be deprecated end - ---Enums of CCTableView will be deprecated begin -CCTableView.kTableViewScroll = cc.SCROLLVIEW_SCRIPT_SCROLL -CCTableView.kTableViewZoom = cc.SCROLLVIEW_SCRIPT_ZOOM -CCTableView.kTableCellTouched = cc.TABLECELL_TOUCHED -CCTableView.kTableCellSizeForIndex = cc.TABLECELL_SIZE_FOR_INDEX -CCTableView.kTableCellSizeAtIndex = cc.TABLECELL_SIZE_AT_INDEX -CCTableView.kNumberOfCellsInTableView = cc.NUMBER_OF_CELLS_IN_TABLEVIEW ---Enums of CCTableView will be deprecated end - ---Enums of CCScrollView will be deprecated begin -CCScrollView.kScrollViewScroll = cc.SCROLLVIEW_SCRIPT_SCROLL -CCScrollView.kScrollViewZoom = cc.SCROLLVIEW_SCRIPT_ZOOM ---Enums of CCScrollView will be deprecated end diff --git a/cocos/scripting/lua-bindings/script/extension/ExtensionConstants.lua b/cocos/scripting/lua-bindings/script/extension/ExtensionConstants.lua deleted file mode 100644 index 0bfc8f8..0000000 --- a/cocos/scripting/lua-bindings/script/extension/ExtensionConstants.lua +++ /dev/null @@ -1,70 +0,0 @@ -if nil == cc.Control then - return -end - -cc.CONTROL_STATE_NORMAL = 1 -cc.CONTROL_STATE_HIGH_LIGHTED = 2 -cc.CONTROL_STATE_DISABLED = 4 -cc.CONTROL_STATE_SELECTED = 8 - -cc.CONTROL_STEPPER_PART_MINUS = 0 -cc.CONTROL_STEPPER_PART_PLUS = 1 -cc.CONTROL_STEPPER_PART_NONE = 2 - -cc.TABLEVIEW_FILL_TOPDOWN = 0 -cc.TABLEVIEW_FILL_BOTTOMUP = 1 - -cc.SCROLLVIEW_SCRIPT_SCROLL = 0 -cc.SCROLLVIEW_SCRIPT_ZOOM = 1 -cc.TABLECELL_TOUCHED = 2 -cc.TABLECELL_HIGH_LIGHT = 3 -cc.TABLECELL_UNHIGH_LIGHT = 4 -cc.TABLECELL_WILL_RECYCLE = 5 -cc.TABLECELL_SIZE_FOR_INDEX = 6 -cc.TABLECELL_SIZE_AT_INDEX = 7 -cc.NUMBER_OF_CELLS_IN_TABLEVIEW = 8 - -cc.SCROLLVIEW_DIRECTION_NONE = -1 -cc.SCROLLVIEW_DIRECTION_HORIZONTAL = 0 -cc.SCROLLVIEW_DIRECTION_VERTICAL = 1 -cc.SCROLLVIEW_DIRECTION_BOTH = 2 - -cc.CONTROL_EVENTTYPE_TOUCH_DOWN = 1 -cc.CONTROL_EVENTTYPE_DRAG_INSIDE = 2 -cc.CONTROL_EVENTTYPE_DRAG_OUTSIDE = 4 -cc.CONTROL_EVENTTYPE_DRAG_ENTER = 8 -cc.CONTROL_EVENTTYPE_DRAG_EXIT = 16 -cc.CONTROL_EVENTTYPE_TOUCH_UP_INSIDE = 32 -cc.CONTROL_EVENTTYPE_TOUCH_UP_OUTSIDE = 64 -cc.CONTROL_EVENTTYPE_TOUCH_CANCEL = 128 -cc.CONTROL_EVENTTYPE_VALUE_CHANGED = 256 - -cc.EDITBOX_INPUT_MODE_ANY = 0 -cc.EDITBOX_INPUT_MODE_EMAILADDR = 1 -cc.EDITBOX_INPUT_MODE_NUMERIC = 2 -cc.EDITBOX_INPUT_MODE_PHONENUMBER = 3 -cc.EDITBOX_INPUT_MODE_URL = 4 -cc.EDITBOX_INPUT_MODE_DECIMAL = 5 -cc.EDITBOX_INPUT_MODE_SINGLELINE = 6 - -cc.EDITBOX_INPUT_FLAG_PASSWORD = 0 -cc.EDITBOX_INPUT_FLAG_SENSITIVE = 1 -cc.EDITBOX_INPUT_FLAG_INITIAL_CAPS_WORD = 2 -cc.EDITBOX_INPUT_FLAG_INITIAL_CAPS_SENTENCE = 3 -cc.EDITBOX_INPUT_FLAG_INITIAL_CAPS_ALL_CHARACTERS = 4 - -cc.KEYBOARD_RETURNTYPE_DEFAULT = 0 -cc.KEYBOARD_RETURNTYPE_DONE = 1 -cc.KEYBOARD_RETURNTYPE_SEND = 2 -cc.KEYBOARD_RETURNTYPE_SEARCH = 3 -cc.KEYBOARD_RETURNTYPE_GO = 4 - -cc.ASSETSMANAGER_CREATE_FILE = 0 -cc.ASSETSMANAGER_NETWORK = 1 -cc.ASSETSMANAGER_NO_NEW_VERSION = 2 -cc.ASSETSMANAGER_UNCOMPRESS = 3 - -cc.ASSETSMANAGER_PROTOCOL_PROGRESS = 0 -cc.ASSETSMANAGER_PROTOCOL_SUCCESS = 1 -cc.ASSETSMANAGER_PROTOCOL_ERROR = 2 - diff --git a/cocos/scripting/lua-bindings/script/init.lua b/cocos/scripting/lua-bindings/script/init.lua index 6c8eeb2..670ae48 100644 --- a/cocos/scripting/lua-bindings/script/init.lua +++ b/cocos/scripting/lua-bindings/script/init.lua @@ -32,8 +32,6 @@ __G__TRACKBACK__ = function(msg) return msg end --- audio -require "cocos.cocosdenshion.AudioEngine" -- cocosstudio if nil ~= ccs then require "cocos.cocostudio.CocoStudio" @@ -52,41 +50,7 @@ if nil ~= sp then require "cocos.spine.SpineConstants" end --- require "cocos.cocos2d.deprecated" - --- Lua extensions -require "cocos.cocos2d.bitExtend" - --- CCLuaEngine --- require "cocos.cocos2d.DeprecatedCocos2dClass" --- require "cocos.cocos2d.DeprecatedCocos2dEnum" --- require "cocos.cocos2d.DeprecatedCocos2dFunc" - --- register_cocostudio_module --- if nil ~= ccs then --- require "cocos.cocostudio.DeprecatedCocoStudioClass" --- require "cocos.cocostudio.DeprecatedCocoStudioFunc" --- end - --- register_extension_module --- require "cocos.extension.DeprecatedExtensionClass" --- require "cocos.extension.DeprecatedExtensionEnum" --- require "cocos.extension.DeprecatedExtensionFunc" - --- register_network_module --- require "cocos.network.DeprecatedNetworkClass" --- require "cocos.network.DeprecatedNetworkEnum" --- require "cocos.network.DeprecatedNetworkFunc" - --- register_ui_module --- if nil ~= ccui then --- require "cocos.ui.DeprecatedUIEnum" --- require "cocos.ui.DeprecatedUIFunc" --- end - -- physics3d require "cocos.physics3d.physics3d-constants" -if CC_USE_FRAMEWORK then - require "cocos.framework.init" -end +require "cocos.framework.init" diff --git a/cocos/scripting/lua-bindings/script/network/DeprecatedNetworkClass.lua b/cocos/scripting/lua-bindings/script/network/DeprecatedNetworkClass.lua deleted file mode 100644 index 06e280b..0000000 --- a/cocos/scripting/lua-bindings/script/network/DeprecatedNetworkClass.lua +++ /dev/null @@ -1,19 +0,0 @@ -if nil == cc.XMLHttpRequest then - return -end --- This is the DeprecatedNetworkClass - -DeprecatedNetworkClass = {} or DeprecatedNetworkClass - ---tip -local function deprecatedTip(old_name,new_name) - print("\n********** \n"..old_name.." was deprecated please use ".. new_name .. " instead.\n**********") -end - ---WebSocket class will be Deprecated,begin -function DeprecatedNetworkClass.WebSocket() - deprecatedTip("WebSocket","cc.WebSocket") - return cc.WebSocket -end -_G["WebSocket"] = DeprecatedNetworkClass.WebSocket() ---WebSocket class will be Deprecated,end diff --git a/cocos/scripting/lua-bindings/script/network/DeprecatedNetworkEnum.lua b/cocos/scripting/lua-bindings/script/network/DeprecatedNetworkEnum.lua deleted file mode 100644 index da08d35..0000000 --- a/cocos/scripting/lua-bindings/script/network/DeprecatedNetworkEnum.lua +++ /dev/null @@ -1,13 +0,0 @@ -if nil == cc.XMLHttpRequest then - return -end - -_G.kWebSocketScriptHandlerOpen = cc.WEBSOCKET_OPEN -_G.kWebSocketScriptHandlerMessage = cc.WEBSOCKET_MESSAGE -_G.kWebSocketScriptHandlerClose = cc.WEBSOCKET_CLOSE -_G.kWebSocketScriptHandlerError = cc.WEBSOCKET_ERROR - -_G.kStateConnecting = cc.WEBSOCKET_STATE_CONNECTING -_G.kStateOpen = cc.WEBSOCKET_STATE_OPEN -_G.kStateClosing = cc.WEBSOCKET_STATE_CLOSING -_G.kStateClosed = cc.WEBSOCKET_STATE_CLOSED diff --git a/cocos/scripting/lua-bindings/script/network/DeprecatedNetworkFunc.lua b/cocos/scripting/lua-bindings/script/network/DeprecatedNetworkFunc.lua deleted file mode 100644 index f114392..0000000 --- a/cocos/scripting/lua-bindings/script/network/DeprecatedNetworkFunc.lua +++ /dev/null @@ -1,27 +0,0 @@ -if nil == cc.XMLHttpRequest then - return -end - ---tip -local function deprecatedTip(old_name,new_name) - print("\n********** \n"..old_name.." was deprecated please use ".. new_name .. " instead.\n**********") -end - ---functions of WebSocket will be deprecated begin -local targetPlatform = CCApplication:getInstance():getTargetPlatform() -if (kTargetIphone == targetPlatform) or (kTargetIpad == targetPlatform) or (kTargetAndroid == targetPlatform) or (kTargetWindows == targetPlatform) then - local WebSocketDeprecated = { } - function WebSocketDeprecated.sendTextMsg(self, string) - deprecatedTip("WebSocket:sendTextMsg","WebSocket:sendString") - return self:sendString(string) - end - WebSocket.sendTextMsg = WebSocketDeprecated.sendTextMsg - - function WebSocketDeprecated.sendBinaryMsg(self, table,tablesize) - deprecatedTip("WebSocket:sendBinaryMsg","WebSocket:sendString") - string.char(unpack(table)) - return self:sendString(string.char(unpack(table))) - end - WebSocket.sendBinaryMsg = WebSocketDeprecated.sendBinaryMsg -end ---functions of WebSocket will be deprecated end diff --git a/cocos/scripting/lua-bindings/script/ui/DeprecatedUIEnum.lua b/cocos/scripting/lua-bindings/script/ui/DeprecatedUIEnum.lua deleted file mode 100644 index 219d4db..0000000 --- a/cocos/scripting/lua-bindings/script/ui/DeprecatedUIEnum.lua +++ /dev/null @@ -1,96 +0,0 @@ -if nil == ccui then - return -end - -LAYOUT_COLOR_NONE = ccui.LayoutBackGroundColorType.none -LAYOUT_COLOR_SOLID = ccui.LayoutBackGroundColorType.solid -LAYOUT_COLOR_GRADIENT = ccui.LayoutBackGroundColorType.gradient - -LAYOUT_ABSOLUTE = ccui.LayoutType.ABSOLUTE -LAYOUT_LINEAR_VERTICAL = ccui.LayoutType.VERTICAL -LAYOUT_LINEAR_HORIZONTAL = ccui.LayoutType.HORIZONTAL -LAYOUT_RELATIVE = ccui.LayoutType.RELATIVE - -BRIGHT_NONE = ccui.BrightStyle.none -BRIGHT_NORMAL = ccui.BrightStyle.normal -BRIGHT_HIGHLIGHT = ccui.BrightStyle.highlight - -UI_TEX_TYPE_LOCAL = ccui.TextureResType.localType -UI_TEX_TYPE_PLIST = ccui.TextureResType.plistType - -TOUCH_EVENT_BEGAN = ccui.TouchEventType.began -TOUCH_EVENT_MOVED = ccui.TouchEventType.moved -TOUCH_EVENT_ENDED = ccui.TouchEventType.ended -TOUCH_EVENT_CANCELED = ccui.TouchEventType.canceled - -SIZE_ABSOLUTE = ccui.SizeType.absolute -SIZE_PERCENT = ccui.SizeType.percent - -POSITION_ABSOLUTE = ccui.PositionType.absolute -POSITION_PERCENT = ccui.PositionType.percent - -CHECKBOX_STATE_EVENT_SELECTED = ccui.CheckBoxEventType.selected -CHECKBOX_STATE_EVENT_UNSELECTED = ccui.CheckBoxEventType.unselected - -CHECKBOX_STATE_EVENT_SELECTED = ccui.CheckBoxEventType.selected -CHECKBOX_STATE_EVENT_UNSELECTED = ccui.CheckBoxEventType.unselected - -LoadingBarTypeLeft = ccui.LoadingBarDirection.LEFT -LoadingBarTypeRight = ccui.LoadingBarDirection.RIGHT - -LoadingBarTypeRight = ccui.SliderEventType.percent_changed - -TEXTFIELD_EVENT_ATTACH_WITH_IME = ccui.TextFiledEventType.attach_with_ime -TEXTFIELD_EVENT_DETACH_WITH_IME = ccui.TextFiledEventType.detach_with_ime -TEXTFIELD_EVENT_INSERT_TEXT = ccui.TextFiledEventType.insert_text -TEXTFIELD_EVENT_DELETE_BACKWARD = ccui.TextFiledEventType.delete_backward - -SCROLLVIEW_EVENT_SCROLL_TO_TOP = ccui.ScrollViewDir.none -SCROLLVIEW_DIR_VERTICAL = ccui.ScrollViewDir.vertical -SCROLLVIEW_DIR_HORIZONTAL = ccui.ScrollViewDir.horizontal -SCROLLVIEW_DIR_BOTH = ccui.ScrollViewDir.both - -SCROLLVIEW_EVENT_SCROLL_TO_TOP = ccui.ScrollviewEventType.scrollToTop -SCROLLVIEW_EVENT_SCROLL_TO_BOTTOM = ccui.ScrollviewEventType.scrollToBottom -SCROLLVIEW_EVENT_SCROLL_TO_LEFT = ccui.ScrollviewEventType.scrollToLeft -SCROLLVIEW_EVENT_SCROLL_TO_RIGHT = ccui.ScrollviewEventType.scrollToRight -SCROLLVIEW_EVENT_SCROLLING = ccui.ScrollviewEventType.scrolling -SCROLLVIEW_EVENT_BOUNCE_TOP = ccui.ScrollviewEventType.bounceTop -SCROLLVIEW_EVENT_BOUNCE_BOTTOM = ccui.ScrollviewEventType.bounceBottom -SCROLLVIEW_EVENT_BOUNCE_LEFT = ccui.ScrollviewEventType.bounceLeft -SCROLLVIEW_EVENT_BOUNCE_RIGHT = ccui.ScrollviewEventType.bounceRight -SCROLLVIEW_EVENT_CONTAINER_MOVED = ccui.ScrollviewEventType.containerMoved -SCROLLVIEW_EVENT_AUTOSCROLL_ENDED = ccui.ScrollviewEventType.autoscrollEnded - -PAGEVIEW_EVENT_TURNING = ccui.PageViewEventType.turning - -PAGEVIEW_TOUCHLEFT = ccui.PVTouchDir.touch_left -PAGEVIEW_TOUCHRIGHT = ccui.PVTouchDir.touch_right - -LISTVIEW_DIR_NONE = ccui.ListViewDirection.none -LISTVIEW_DIR_VERTICAL = ccui.ListViewDirection.vertical -LISTVIEW_DIR_HORIZONTAL = ccui.ListViewDirection.horizontal - -LISTVIEW_MOVE_DIR_NONE = ccui.ListViewMoveDirection.none -LISTVIEW_MOVE_DIR_UP = ccui.ListViewMoveDirection.up -LISTVIEW_MOVE_DIR_DOWN = ccui.ListViewMoveDirection.down -LISTVIEW_MOVE_DIR_LEFT = ccui.ListViewMoveDirection.left -LISTVIEW_MOVE_DIR_RIGHT = ccui.ListViewMoveDirection.right - -LISTVIEW_EVENT_INIT_CHILD = ccui.ListViewEventType.init_child -LISTVIEW_EVENT_UPDATE_CHILD = ccui.ListViewEventType.update_child - -LAYOUT_PARAMETER_NONE = ccui.LayoutParameterType.none -LAYOUT_PARAMETER_LINEAR = ccui.LayoutParameterType.linear -LAYOUT_PARAMETER_RELATIVE = ccui.LayoutParameterType.relative - -ccui.LoadingBarType = ccui.LoadingBarDirection -ccui.LoadingBarType.left = ccui.LoadingBarDirection.LEFT -ccui.LoadingBarType.right = ccui.LoadingBarDirection.RIGHT - -ccui.LayoutType.absolute = ccui.LayoutType.ABSOLUTE -ccui.LayoutType.linearVertical = ccui.LayoutType.VERTICAL -ccui.LayoutType.linearHorizontal = ccui.LayoutType.HORIZONTAL -ccui.LayoutType.relative = ccui.LayoutType.RELATIVE - -ccui.ListViewEventType.onsSelectedItem = ccui.ListViewEventType.ONSELECTEDITEM_START diff --git a/cocos/scripting/lua-bindings/script/ui/DeprecatedUIFunc.lua b/cocos/scripting/lua-bindings/script/ui/DeprecatedUIFunc.lua deleted file mode 100644 index 97b1445..0000000 --- a/cocos/scripting/lua-bindings/script/ui/DeprecatedUIFunc.lua +++ /dev/null @@ -1,245 +0,0 @@ -if nil == ccui then - return -end - ---tip -local function deprecatedTip(old_name,new_name) - print("\n********** \n"..old_name.." was deprecated please use ".. new_name .. " instead.\n**********") -end - ---functions of ccui.Text will be deprecated begin -local TextDeprecated = { } -function TextDeprecated.setText(self, str) - deprecatedTip("ccui.Text:setText","ccui.Text:setString") - return self:setString(str) -end -ccui.Text.setText = TextDeprecated.setText - -function TextDeprecated.getStringValue(self) - deprecatedTip("ccui.Text:getStringValue","ccui.Text:getString") - return self:getString() -end -ccui.Text.getStringValue = TextDeprecated.getStringValue - ---functions of ccui.Text will be deprecated begin - ---functions of ccui.TextAtlas will be deprecated begin -local TextAtlasDeprecated = { } -function TextAtlasDeprecated.setStringValue(self, str) - deprecatedTip("ccui.TextAtlas:setStringValue","ccui.TextAtlas:setString") - return self:setString(str) -end -ccui.TextAtlas.setStringValue = TextAtlasDeprecated.setStringValue - -function TextAtlasDeprecated.getStringValue(self) - deprecatedTip("ccui.TextAtlas:getStringValue","ccui.TextAtlas:getString") - return self:getString() -end -ccui.TextAtlas.getStringValue = TextAtlasDeprecated.getStringValue ---functions of ccui.TextAtlas will be deprecated begin - - ---functions of ccui.TextBMFont will be deprecated begin -local TextBMFontDeprecated = { } -function TextBMFontDeprecated.setText(self, str) - deprecatedTip("ccui.TextBMFont:setText","ccui.TextBMFont:setString") - return self:setString(str) -end -ccui.TextBMFont.setText = TextBMFontDeprecated.setText - -function TextBMFontDeprecated.getStringValue(self) - deprecatedTip("ccui.Text:getStringValue","ccui.TextBMFont:getString") - return self:getString() -end -ccui.Text.getStringValue = TextBMFontDeprecated.getStringValue ---functions of ccui.TextBMFont will be deprecated begin - ---functions of cc.ShaderCache will be deprecated begin -local ShaderCacheDeprecated = { } -function ShaderCacheDeprecated.getProgram(self,strShader) - deprecatedTip("cc.ShaderCache:getProgram","cc.ShaderCache:getGLProgram") - return self:getGLProgram(strShader) -end -cc.ShaderCache.getProgram = ShaderCacheDeprecated.getProgram ---functions of ccui.TextBMFont will be deprecated begin - ---functions of ccui.Widget will be deprecated begin -local UIWidgetDeprecated = { } -function UIWidgetDeprecated.getLeftInParent(self) - deprecatedTip("ccui.Widget:getLeftInParent","ccui.Widget:getLeftBoundary") - return self:getLeftBoundary() -end -ccui.Widget.getLeftInParent = UIWidgetDeprecated.getLeftInParent - -function UIWidgetDeprecated.getBottomInParent(self) - deprecatedTip("ccui.Widget:getBottomInParent","ccui.Widget:getBottomBoundary") - return self:getBottomBoundary() -end -ccui.Widget.getBottomInParent = UIWidgetDeprecated.getBottomInParent - -function UIWidgetDeprecated.getRightInParent(self) - deprecatedTip("ccui.Widget:getRightInParent","ccui.Widget:getRightBoundary") - return self:getRightBoundary() -end -ccui.Widget.getRightInParent = UIWidgetDeprecated.getRightInParent - -function UIWidgetDeprecated.getTopInParent(self) - deprecatedTip("ccui.Widget:getTopInParent","ccui.Widget:getTopBoundary") - return self:getTopBoundary() -end -ccui.Widget.getTopInParent = UIWidgetDeprecated.getTopInParent - -function UIWidgetDeprecated.getSize(self) - deprecatedTip("ccui.Widget:getSize","ccui.Widget:getContentSize") - return self:getContentSize() -end -ccui.Widget.getSize = UIWidgetDeprecated.getSize - -function UIWidgetDeprecated.setSize(self, ...) - deprecatedTip("ccui.Widget:setSize","ccui.Widget:setContentSize") - return self:setContentSize(...) -end -ccui.Widget.setSize = UIWidgetDeprecated.setSize - ---functions of ccui.Widget will be deprecated end - ---functions of ccui.CheckBox will be deprecated begin -local UICheckBoxDeprecated = { } -function UICheckBoxDeprecated.addEventListenerCheckBox(self,handler) - deprecatedTip("ccui.CheckBox:addEventListenerCheckBox","ccui.CheckBox:addEventListener") - return self:addEventListener(handler) -end -ccui.CheckBox.addEventListenerCheckBox = UICheckBoxDeprecated.addEventListenerCheckBox - -function UICheckBoxDeprecated.setSelectedState(self,flag) - deprecatedTip("ccui.CheckBox:setSelectedState", "ccui.CheckBox:setSelected") - return self:setSelected(flag) -end -ccui.CheckBox.setSelectedState = UICheckBoxDeprecated.setSelectedState - -function UICheckBoxDeprecated.getSelectedState(self) - deprecatedTip("ccui.CheckBox:getSelectedState", "ccui.CheckBox:getSelected") - return self:getSelected() -end -ccui.CheckBox.getSelectedState = UICheckBoxDeprecated.setSelectedState - ---functions of ccui.CheckBox will be deprecated end - ---functions of ccui.Slider will be deprecated begin -local UISliderDeprecated = { } -function UISliderDeprecated.addEventListenerSlider(self,handler) - deprecatedTip("ccui.Slider:addEventListenerSlider","ccui.Slider:addEventListener") - return self:addEventListener(handler) -end -ccui.Slider.addEventListenerSlider = UISliderDeprecated.addEventListenerSlider ---functions of ccui.Slider will be deprecated end - ---functions of ccui.TextField will be deprecated begin -local UITextFieldDeprecated = { } -function UITextFieldDeprecated.addEventListenerTextField(self,handler) - deprecatedTip("ccui.TextField:addEventListenerTextField","ccui.TextField:addEventListener") - return self:addEventListener(handler) -end -ccui.TextField.addEventListenerTextField = UITextFieldDeprecated.addEventListenerTextField - -function UITextFieldDeprecated.setText(self, str) - deprecatedTip("ccui.TextField:setText","ccui.TextField:setString") - return self:setString(str) -end -ccui.TextField.setText = UITextFieldDeprecated.setText - -function UITextFieldDeprecated.getStringValue(self) - deprecatedTip("ccui.TextField:getStringValue","ccui.TextField:getString") - return self:getString() -end -ccui.TextField.getStringValue = UITextFieldDeprecated.getStringValue ---functions of ccui.TextField will be deprecated end - ---functions of ccui.PageView will be deprecated begin -local UIPageViewDeprecated = { } -function UIPageViewDeprecated.addEventListenerPageView(self,handler) - deprecatedTip("ccui.PageView:addEventListenerPageView","ccui.PageView:addEventListener") - return self:addEventListener(handler) -end -ccui.PageView.addEventListenerPageView = UIPageViewDeprecated.addEventListenerPageView - -function UIPageViewDeprecated.addWidgetToPage(self, widget, pageIdx) - deprecatedTip("ccui.PageView:addWidgetToPage","ccui.PageView:insertPage") - return self:insertPage(widget, pageIdx) -end -ccui.PageView.addWidgetToPage = UIPageViewDeprecated.addWidgetToPage - -function UIPageViewDeprecated.getCurPageIndex(self) - deprecatedTip("ccui.PageView:getCurPageIndex","ccui.PageView:getCurrentPageIndex") - return self:getCurrentPageIndex() -end -ccui.PageView.getCurPageIndex = UIPageViewDeprecated.getCurPageIndex - -function UIPageViewDeprecated.setCurPageIndex(self, index) - deprecatedTip("ccui.PageView:setCurPageIndex","ccui.PageView:setCurrentPageIndex") - return self:setCurrentPageIndex(index) -end -ccui.PageView.setCurPageIndex = UIPageViewDeprecated.setCurPageIndex - -function UIPageViewDeprecated.getPages(self) - deprecatedTip("ccui.PageView:getPages","ccui.PageView:getItems") - return self:getItems() -end -ccui.PageView.getPages = UIPageViewDeprecated.getPages - -function UIPageViewDeprecated.getPage(self, index) - deprecatedTip("ccui.PageView:getPage","ccui.PageView:getItem") - return self:getItem(index) -end -ccui.PageView.getPage = UIPageViewDeprecated.getPage - -function UIPageViewDeprecated.setCustomScrollThreshold(self) - print("Since v3.9, this method has no effect.") -end -ccui.PageView.setCustomScrollThreshold = UIPageViewDeprecated.setCustomScrollThreshold - -function UIPageViewDeprecated.getCustomScrollThreshold(self) - print("Since v3.9, this method has no effect.") -end -ccui.PageView.getCustomScrollThreshold = UIPageViewDeprecated.getCustomScrollThreshold - -function UIPageViewDeprecated.isUsingCustomScrollThreshold(self) - print("Since v3.9, this method has no effect.") -end -ccui.PageView.isUsingCustomScrollThreshold = UIPageViewDeprecated.isUsingCustomScrollThreshold - -function UIPageViewDeprecated.setUsingCustomScrollThreshold(self) - print("Since v3.9, this method has no effect.") -end -ccui.PageView.setUsingCustomScrollThreshold = UIPageViewDeprecated.setUsingCustomScrollThreshold ---functions of ccui.PageView will be deprecated end - ---functions of ccui.ScrollView will be deprecated begin -local UIScrollViewDeprecated = { } -function UIScrollViewDeprecated.addEventListenerScrollView(self,handler) - deprecatedTip("ccui.ScrollView:addEventListenerScrollView","ccui.ScrollView:addEventListener") - return self:addEventListener(handler) -end -ccui.ScrollView.addEventListenerScrollView = UIScrollViewDeprecated.addEventListenerScrollView ---functions of ccui.ScrollView will be deprecated end - ---functions of ccui.ListView will be deprecated begin -local UIListViewDeprecated = { } -function UIListViewDeprecated.addEventListenerListView(self,handler) - deprecatedTip("ccui.ListView:addEventListenerListView","ccui.ListView:addEventListener") - return self:addEventListener(handler) -end -ccui.ListView.addEventListenerListView = UIListViewDeprecated.addEventListenerListView - -function UIListViewDeprecated.requestRefreshView(self) - deprecatedTip("ccui.ListView:requestRefreshView","ccui.ListView:forceDoLayout") - return self:forceDoLayout() -end -ccui.ListView.requestRefreshView = UIListViewDeprecated.requestRefreshView - -function UIListViewDeprecated.refreshView(self) - deprecatedTip("ccui.ListView:refreshView","ccui.ListView:refreshView") - return self:forceDoLayout() -end -ccui.ListView.refreshView = UIListViewDeprecated.refreshView ---functions of ccui.ListView will be deprecated end diff --git a/extensions/CMakeLists.txt b/extensions/CMakeLists.txt index 1cf3d6a..50efec5 100644 --- a/extensions/CMakeLists.txt +++ b/extensions/CMakeLists.txt @@ -1,7 +1,4 @@ set(COCOS_EXTENSIONS_HEADER - ../extensions/ExtensionMacros.h - ../extensions/physics-nodes/CCPhysicsSprite.h - ../extensions/physics-nodes/CCPhysicsDebugNode.h ../extensions/Particle3D/CCParticleSystem3D.h ../extensions/Particle3D/PU/CCPUDoExpireEventHandler.h ../extensions/Particle3D/PU/CCPUParticleSystem3D.h @@ -154,13 +151,10 @@ set(COCOS_EXTENSIONS_HEADER ../extensions/Particle3D/CCParticle3DAffector.h ../extensions/Particle3D/CCParticle3DRender.h ../extensions/cocos-ext.h - ../extensions/ExtensionExport.h ) set(COCOS_EXTENSIONS_SRC - ../extensions/physics-nodes/CCPhysicsDebugNode.cpp - ../extensions/physics-nodes/CCPhysicsSprite.cpp ../extensions/Particle3D/CCParticle3DAffector.cpp ../extensions/Particle3D/CCParticle3DEmitter.cpp ../extensions/Particle3D/CCParticle3DRender.cpp diff --git a/extensions/ExtensionExport.h b/extensions/ExtensionExport.h deleted file mode 100644 index 009f2d0..0000000 --- a/extensions/ExtensionExport.h +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __CCEXTENSIONEXPORT_H__ -#define __CCEXTENSIONEXPORT_H__ - -#if (defined(WIN32) && defined(_WINDOWS)) || defined(WINRT) || defined(WP8) - #ifdef __MINGW32__ - #include - #endif - - #if defined(CC_STATIC) - #define CC_EX_DLL - #else - #if defined(_USREXDLL) - #define CC_EX_DLL __declspec(dllexport) - #else /* use a DLL library */ - #define CC_EX_DLL __declspec(dllimport) - #endif - #endif - - /* Define NULL pointer value */ - #ifndef NULL - #ifdef __cplusplus - #define NULL 0 - #else - #define NULL ((void *)0) - #endif - #endif -#elif defined(_SHARED_) - #define CC_EX_DLL __attribute__((visibility("default"))) -#else - #define CC_EX_DLL -#endif - -#endif /* __CCEXTENSIONEXPORT_H__*/ \ No newline at end of file diff --git a/extensions/ExtensionMacros.h b/extensions/ExtensionMacros.h deleted file mode 100644 index 1d9970e..0000000 --- a/extensions/ExtensionMacros.h +++ /dev/null @@ -1,35 +0,0 @@ -/**************************************************************************** - Copyright (c) 2012 cocos2d-x.org - Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __EXTENSIONMARCROS_H__ -#define __EXTENSIONMARCROS_H__ - -#define NS_CC_EXT_BEGIN namespace cocos2d { namespace extension { -#define NS_CC_EXT_END }} -#define USING_NS_CC_EXT using namespace cocos2d::extension - - -#endif /* __EXTENSIONMARCROS_H__ */ - diff --git a/extensions/cocos-ext.h b/extensions/cocos-ext.h index 2f94200..9d90a9f 100644 --- a/extensions/cocos-ext.h +++ b/extensions/cocos-ext.h @@ -25,12 +25,6 @@ #ifndef __COCOS2D_EXT_H__ #define __COCOS2D_EXT_H__ -#include "ExtensionMacros.h" - -// Physics integration -#include "physics-nodes/CCPhysicsDebugNode.h" -#include "physics-nodes/CCPhysicsSprite.h" - // Particle System, include Particle Universe Particle System #include "Particle3D/CCParticle3DRender.h" #include "Particle3D/CCParticleSystem3D.h" diff --git a/extensions/physics-nodes/CCPhysicsDebugNode.cpp b/extensions/physics-nodes/CCPhysicsDebugNode.cpp deleted file mode 100644 index 1e97561..0000000 --- a/extensions/physics-nodes/CCPhysicsDebugNode.cpp +++ /dev/null @@ -1,232 +0,0 @@ -/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software - * Copyright (c) 2012 cocos2d-x.org - * Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#include "CCPhysicsDebugNode.h" - -#if CC_ENABLE_CHIPMUNK_INTEGRATION -#include "chipmunk/chipmunk_private.h" -#endif - -#include "base/ccTypes.h" -#include "math/CCGeometry.h" - - -#include -#include -#include -#include -#include - -NS_CC_EXT_BEGIN - -#if CC_ENABLE_CHIPMUNK_INTEGRATION -/* - IMPORTANT - READ ME! - - This file sets pokes around in the private API a lot to provide efficient - debug rendering given nothing more than reference to a Chipmunk space. - It is not recommended to write rendering code like this in your own games - as the private API may change with little or no warning. - */ - -static Color4F ColorForBody(cpBody *body) -{ - if (CP_BODY_TYPE_STATIC == cpBodyGetType(body) || cpBodyIsSleeping(body)) - { - return Color4F(0.5f, 0.5f, 0.5f ,0.5f); - } - else if (body->sleeping.idleTime > cpBodyGetSpace(body)->sleepTimeThreshold) - { - return Color4F(0.33f, 0.33f, 0.33f, 0.5f); - } - else - { - return Color4F(1.0f, 0.0f, 0.0f, 0.5f); - } -} - -static Vec2 cpVert2Point(const cpVect &vert) -{ - return Vec2(vert.x, vert.y); -} - -static void DrawShape(cpShape *shape, DrawNode *renderer) -{ - cpBody *body = cpShapeGetBody(shape); - Color4F color = ColorForBody(body); - - switch (shape->CP_PRIVATE(klass)->type) - { - case CP_CIRCLE_SHAPE: - { - cpCircleShape *circle = (cpCircleShape *)shape; - cpVect center = circle->tc; - cpFloat radius = circle->r; - renderer->drawDot(cpVert2Point(center), cpfmax(radius, 1.0), color); - renderer->drawSegment(cpVert2Point(center), cpVert2Point(cpvadd(center, cpvmult(cpBodyGetRotation(body), radius))), 1.0, color); - } - break; - case CP_SEGMENT_SHAPE: - { - cpSegmentShape *seg = (cpSegmentShape *)shape; - renderer->drawSegment(cpVert2Point(seg->ta), cpVert2Point(seg->tb), cpfmax(seg->r, 2.0), color); - } - break; - case CP_POLY_SHAPE: - { - cpPolyShape* poly = (cpPolyShape*)shape; - Color4F line = color; - line.a = cpflerp(color.a, 1.0, 0.5); - int num = poly->count; - Vec2* pPoints = new (std::nothrow) Vec2[num]; - for(int i=0;iplanes[i].v0); - renderer->drawPolygon(pPoints, num, color, 1.0, line); - CC_SAFE_DELETE_ARRAY(pPoints); - } - break; - default: - cpAssertHard(false, "Bad assertion in DrawShape()"); - } -} - -static Color4F CONSTRAINT_COLOR(0, 1, 0, 0.5); - -static void DrawConstraint(cpConstraint *constraint, DrawNode *renderer) -{ - cpBody *body_a = cpConstraintGetBodyA(constraint); - cpBody *body_b = cpConstraintGetBodyB(constraint); - - if(cpConstraintIsPinJoint(constraint)) - { - cpVect a = cpvadd(cpBodyGetPosition(body_a), cpvrotate(cpPinJointGetAnchorA(constraint), cpBodyGetRotation(body_a))); - cpVect b = cpvadd(cpBodyGetPosition(body_b), cpvrotate(cpPinJointGetAnchorB(constraint), cpBodyGetRotation(body_b))); - - renderer->drawDot(cpVert2Point(a), 3.0, CONSTRAINT_COLOR); - renderer->drawDot(cpVert2Point(b), 3.0, CONSTRAINT_COLOR); - renderer->drawSegment(cpVert2Point(a), cpVert2Point(b), 1.0, CONSTRAINT_COLOR); - } - else if(cpConstraintIsSlideJoint(constraint)) - { - cpVect a = cpvadd(cpBodyGetPosition(body_a), cpvrotate(cpSlideJointGetAnchorA(constraint), cpBodyGetRotation(body_a))); - cpVect b = cpvadd(cpBodyGetPosition(body_b), cpvrotate(cpSlideJointGetAnchorB(constraint), cpBodyGetRotation(body_b))); - - renderer->drawDot(cpVert2Point(a), 3.0, CONSTRAINT_COLOR); - renderer->drawDot(cpVert2Point(b), 3.0, CONSTRAINT_COLOR); - renderer->drawSegment(cpVert2Point(a), cpVert2Point(b), 1.0, CONSTRAINT_COLOR); - } - else if(cpConstraintIsPivotJoint(constraint)) - { - cpVect a = cpvadd(cpBodyGetPosition(body_a), cpvrotate(cpPivotJointGetAnchorA(constraint), cpBodyGetRotation(body_a))); - cpVect b = cpvadd(cpBodyGetPosition(body_b), cpvrotate(cpPivotJointGetAnchorB(constraint), cpBodyGetRotation(body_b))); - - renderer->drawDot(cpVert2Point(a), 3.0, CONSTRAINT_COLOR); - renderer->drawDot(cpVert2Point(b), 3.0, CONSTRAINT_COLOR); - } - else if(cpConstraintIsGrooveJoint(constraint)) - { - cpVect a = cpvadd(cpBodyGetPosition(body_a), cpvrotate(cpGrooveJointGetGrooveA(constraint), cpBodyGetRotation(body_a))); - cpVect b = cpvadd(cpBodyGetPosition(body_a), cpvrotate(cpGrooveJointGetGrooveB(constraint), cpBodyGetRotation(body_a))); - cpVect c = cpvadd(cpBodyGetPosition(body_b), cpvrotate(cpGrooveJointGetAnchorB(constraint), cpBodyGetRotation(body_b))); - - renderer->drawDot(cpVert2Point(c), 3.0, CONSTRAINT_COLOR); - renderer->drawSegment(cpVert2Point(a), cpVert2Point(b), 1.0, CONSTRAINT_COLOR); - } - else if(cpConstraintIsDampedSpring(constraint)) - { - // TODO: uninplemented - } - else - { - // printf("Cannot draw constraint\n"); - } -} -#endif // #if CC_ENABLE_CHIPMUNK_INTEGRATION - -// implementation of PhysicsDebugNode - -void PhysicsDebugNode::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) -{ - if (! _spacePtr) - { - return; - } -#if CC_ENABLE_CHIPMUNK_INTEGRATION - // clear the shapes information before draw current shapes. - DrawNode::clear(); - - cpSpaceEachShape(_spacePtr, (cpSpaceShapeIteratorFunc)DrawShape, this); - cpSpaceEachConstraint(_spacePtr, (cpSpaceConstraintIteratorFunc)DrawConstraint, this); - - DrawNode::draw(renderer, transform, flags); -#endif -} - -PhysicsDebugNode::PhysicsDebugNode() -: _spacePtr(nullptr) -{} - -PhysicsDebugNode* PhysicsDebugNode::create(cpSpace *space) -{ - PhysicsDebugNode *node = new (std::nothrow) PhysicsDebugNode(); - if (node) - { - node->init(); -#if CC_ENABLE_CHIPMUNK_INTEGRATION - node->_spacePtr = space; -#else - CCASSERT(false, "CC_ENABLE_CHIPMUNK_INTEGRATION was not enabled!"); -#endif - node->autorelease(); - } - else - { - CC_SAFE_DELETE(node); - } - - return node; -} - -PhysicsDebugNode::~PhysicsDebugNode() -{ -} - -cpSpace* PhysicsDebugNode::getSpace() const -{ -#if CC_ENABLE_CHIPMUNK_INTEGRATION - return _spacePtr; -#else - CCASSERT(false, "Can't call chipmunk methods when Chipmunk is disabled"); - return nullptr; -#endif -} - -void PhysicsDebugNode::setSpace(cpSpace *space) -{ -#if CC_ENABLE_CHIPMUNK_INTEGRATION - _spacePtr = space; -#else - CCASSERT(false, "Can't call chipmunk methods when Chipmunk is disabled"); -#endif -} - -NS_CC_EXT_END diff --git a/extensions/physics-nodes/CCPhysicsDebugNode.h b/extensions/physics-nodes/CCPhysicsDebugNode.h deleted file mode 100644 index e48b4ae..0000000 --- a/extensions/physics-nodes/CCPhysicsDebugNode.h +++ /dev/null @@ -1,74 +0,0 @@ -/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software - * Copyright (c) 2012 cocos2d-x.org - * Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#ifndef __PHYSICSNODES_DEBUGNODE_H__ -#define __PHYSICSNODES_DEBUGNODE_H__ - -#include "extensions/ExtensionMacros.h" -#include "2d/CCDrawNode.h" -#include "extensions/ExtensionExport.h" - -struct cpSpace; - -NS_CC_EXT_BEGIN - -/** - * A BaseData that draws the components of a physics engine. - - * Supported physics engines: - * - Chipmunk - * - Objective-Chipmunk - * @since v2.1 - * @lua NA - */ - -class CC_EX_DLL PhysicsDebugNode : public DrawNode -{ - -public: - /** Create a debug node for a regular Chipmunk space. */ - static PhysicsDebugNode* create(cpSpace *space); - /** - * @js ctor - */ - PhysicsDebugNode(); - /** - * @js NA - */ - virtual ~PhysicsDebugNode(); - - - cpSpace* getSpace() const; - void setSpace(cpSpace *space); - - // Overrides - virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override; - -protected: - cpSpace *_spacePtr; - -}; - -NS_CC_EXT_END - -#endif // __PHYSICSNODES_DEBUGNODE_H__ diff --git a/extensions/physics-nodes/CCPhysicsSprite.cpp b/extensions/physics-nodes/CCPhysicsSprite.cpp deleted file mode 100644 index c766546..0000000 --- a/extensions/physics-nodes/CCPhysicsSprite.cpp +++ /dev/null @@ -1,455 +0,0 @@ -/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software - * Copyright (c) 2012 cocos2d-x.org - * Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "CCPhysicsSprite.h" -#include "base/CCDirector.h" -#include "base/CCEventDispatcher.h" - -#if (CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION) - -#if (CC_ENABLE_CHIPMUNK_INTEGRATION && CC_ENABLE_BOX2D_INTEGRATION) -#error "Either Chipmunk or Box2d should be enabled, but not both at the same time" -#endif - -#if CC_ENABLE_CHIPMUNK_INTEGRATION -#include "chipmunk/chipmunk.h" -#elif CC_ENABLE_BOX2D_INTEGRATION -#include "Box2D/Box2D.h" -#endif - -NS_CC_EXT_BEGIN - -PhysicsSprite::PhysicsSprite() -: _ignoreBodyRotation(false) -, _CPBody(nullptr) -, _pB2Body(nullptr) -, _PTMRatio(0.0f) -, _syncTransform(nullptr) -{} - -PhysicsSprite* PhysicsSprite::create() -{ - PhysicsSprite* pRet = new (std::nothrow) PhysicsSprite(); - if (pRet && pRet->init()) - { - pRet->autorelease(); - } - else - { - CC_SAFE_DELETE(pRet); - } - - return pRet; -} - -PhysicsSprite* PhysicsSprite::createWithTexture(Texture2D *pTexture) -{ - PhysicsSprite* pRet = new (std::nothrow) PhysicsSprite(); - if (pRet && pRet->initWithTexture(pTexture)) - { - pRet->autorelease(); - } - else - { - CC_SAFE_DELETE(pRet); - } - - return pRet; -} - -PhysicsSprite* PhysicsSprite::createWithTexture(Texture2D *pTexture, const Rect& rect) -{ - PhysicsSprite* pRet = new (std::nothrow) PhysicsSprite(); - if (pRet && pRet->initWithTexture(pTexture, rect)) - { - pRet->autorelease(); - } - else - { - CC_SAFE_DELETE(pRet); - } - - return pRet; -} - -PhysicsSprite* PhysicsSprite::createWithSpriteFrame(SpriteFrame *pSpriteFrame) -{ - PhysicsSprite* pRet = new (std::nothrow) PhysicsSprite(); - if (pRet && pRet->initWithSpriteFrame(pSpriteFrame)) - { - pRet->autorelease(); - } - else - { - CC_SAFE_DELETE(pRet); - } - - return pRet; -} - -PhysicsSprite* PhysicsSprite::createWithSpriteFrameName(const char *pszSpriteFrameName) -{ - PhysicsSprite* pRet = new (std::nothrow) PhysicsSprite(); - if (pRet && pRet->initWithSpriteFrameName(pszSpriteFrameName)) - { - pRet->autorelease(); - } - else - { - CC_SAFE_DELETE(pRet); - } - - return pRet; -} - -PhysicsSprite* PhysicsSprite::create(const char *pszFileName) -{ - PhysicsSprite* pRet = new (std::nothrow) PhysicsSprite(); - if (pRet && pRet->initWithFile(pszFileName)) - { - pRet->autorelease(); - } - else - { - CC_SAFE_DELETE(pRet); - } - - return pRet; -} - -PhysicsSprite* PhysicsSprite::create(const char *pszFileName, const Rect& rect) -{ - PhysicsSprite* pRet = new (std::nothrow) PhysicsSprite(); - if (pRet && pRet->initWithFile(pszFileName, rect)) - { - pRet->autorelease(); - } - else - { - CC_SAFE_DELETE(pRet); - } - - return pRet; -} - -// this method will only get called if the sprite is batched. -// return YES if the physic's values (angles, position ) changed. -// If you return NO, then getNodeToParentTransform won't be called. -bool PhysicsSprite::isDirty() const -{ - return true; -} - -bool PhysicsSprite::isIgnoreBodyRotation() const -{ - return _ignoreBodyRotation; -} - -void PhysicsSprite::setIgnoreBodyRotation(bool bIgnoreBodyRotation) -{ - _ignoreBodyRotation = bIgnoreBodyRotation; -} - -// Override the setters and getters to always reflect the body's properties. -const Vec2& PhysicsSprite::getPosition() const -{ - return getPosFromPhysics(); -} - -void PhysicsSprite::getPosition(float* x, float* y) const -{ - if (x == nullptr || y == nullptr) { - return; - } - const Vec2& pos = getPosFromPhysics(); - *x = pos.x; - *y = pos.y; -} - -float PhysicsSprite::getPositionX() const -{ - return getPosFromPhysics().x; -} - -float PhysicsSprite::getPositionY() const -{ - return getPosFromPhysics().y; -} - -Vec3 PhysicsSprite::getPosition3D() const -{ - Vec2 pos = getPosFromPhysics(); - return Vec3(pos.x, pos.y, 0); -} - -// -// Chipmunk only -// - - - -cpBody* PhysicsSprite::getCPBody() const -{ -#if CC_ENABLE_CHIPMUNK_INTEGRATION - return _CPBody; -#else - CCASSERT(false, "Can't call chipmunk methods when Chipmunk is disabled"); - return nullptr; -#endif -} - -void PhysicsSprite::setCPBody(cpBody *pBody) -{ -#if CC_ENABLE_CHIPMUNK_INTEGRATION - _CPBody = pBody; -#else - CCASSERT(false, "Can't call chipmunk methods when Chipmunk is disabled"); -#endif -} - -b2Body* PhysicsSprite::getB2Body() const -{ -#if CC_ENABLE_BOX2D_INTEGRATION - return _pB2Body; -#else - CCASSERT(false, "Can't call box2d methods when Box2d is disabled"); - return nullptr; -#endif -} - -void PhysicsSprite::setB2Body(b2Body *pBody) -{ -#if CC_ENABLE_BOX2D_INTEGRATION - _pB2Body = pBody; -#else - CC_UNUSED_PARAM(pBody); - CCASSERT(false, "Can't call box2d methods when Box2d is disabled"); -#endif -} - -float PhysicsSprite::getPTMRatio() const -{ -#if CC_ENABLE_BOX2D_INTEGRATION - return _PTMRatio; -#else - CCASSERT(false, "Can't call box2d methods when Box2d is disabled"); - return 0; -#endif -} - -void PhysicsSprite::setPTMRatio(float fRatio) -{ -#if CC_ENABLE_BOX2D_INTEGRATION - _PTMRatio = fRatio; -#else - CC_UNUSED_PARAM(fRatio); - CCASSERT(false, "Can't call box2d methods when Box2d is disabled"); -#endif -} - -// -// Common to Box2d and Chipmunk -// - -const Vec2& PhysicsSprite::getPosFromPhysics() const -{ - static Vec2 s_physicPosion; -#if CC_ENABLE_CHIPMUNK_INTEGRATION - - cpVect cpPos = cpBodyGetPosition(_CPBody); - s_physicPosion = Vec2(cpPos.x, cpPos.y); - -#elif CC_ENABLE_BOX2D_INTEGRATION - - b2Vec2 pos = _pB2Body->GetPosition(); - float x = pos.x * _PTMRatio; - float y = pos.y * _PTMRatio; - s_physicPosion.set(x,y); -#endif - return s_physicPosion; -} - -void PhysicsSprite::setPosition(float x, float y) -{ -#if CC_ENABLE_CHIPMUNK_INTEGRATION - - cpVect cpPos = cpv(x, y); - cpBodySetPosition(_CPBody, cpPos); - -#elif CC_ENABLE_BOX2D_INTEGRATION - - float angle = _pB2Body->GetAngle(); - _pB2Body->SetTransform(b2Vec2(x / _PTMRatio, y / _PTMRatio), angle); -#endif -} - -void PhysicsSprite::setPosition(const Vec2 &pos) -{ - setPosition(pos.x, pos.y); -} - -void PhysicsSprite::setPositionX(float x) -{ - setPosition(x, getPositionY()); -} - -void PhysicsSprite::setPositionY(float y) -{ - setPosition(getPositionX(), y); -} - -void PhysicsSprite::setPosition3D(const Vec3& position) -{ - setPosition(position.x, position.y); -} - -float PhysicsSprite::getRotation() const -{ -#if CC_ENABLE_CHIPMUNK_INTEGRATION - - return (_ignoreBodyRotation ? Sprite::getRotation() : -CC_RADIANS_TO_DEGREES(cpBodyGetAngle(_CPBody))); - -#elif CC_ENABLE_BOX2D_INTEGRATION - - return (_ignoreBodyRotation ? Sprite::getRotation() : - CC_RADIANS_TO_DEGREES(_pB2Body->GetAngle())); -#else - return 0.0f; -#endif - -} - -void PhysicsSprite::setRotation(float fRotation) -{ - if (_ignoreBodyRotation) - { - Sprite::setRotation(fRotation); - } - -#if CC_ENABLE_CHIPMUNK_INTEGRATION - else - { - cpBodySetAngle(_CPBody, -CC_DEGREES_TO_RADIANS(fRotation)); - } - -#elif CC_ENABLE_BOX2D_INTEGRATION - else - { - b2Vec2 p = _pB2Body->GetPosition(); - float radians = CC_DEGREES_TO_RADIANS(fRotation); - _pB2Body->SetTransform(p, radians); - } -#endif - -} - -void PhysicsSprite::syncPhysicsTransform() const -{ - // Although scale is not used by physics engines, it is calculated just in case - // the sprite is animated (scaled up/down) using actions. - // For more info see: http://www.cocos2d-iphone.org/forum/topic/68990 - -#if CC_ENABLE_CHIPMUNK_INTEGRATION - - cpVect rot = (_ignoreBodyRotation ? cpvforangle(-CC_DEGREES_TO_RADIANS(_rotationX)) : cpBodyGetRotation(_CPBody)); - float x = cpBodyGetPosition(_CPBody).x + rot.x * -_anchorPointInPoints.x * _scaleX - rot.y * -_anchorPointInPoints.y * _scaleY; - float y = cpBodyGetPosition(_CPBody).y + rot.y * -_anchorPointInPoints.x * _scaleX + rot.x * -_anchorPointInPoints.y * _scaleY; - - if (_ignoreAnchorPointForPosition) - { - x += _anchorPointInPoints.x; - y += _anchorPointInPoints.y; - } - - float mat[] = { (float)rot.x * _scaleX, (float)rot.y * _scaleX, 0, 0, - (float)-rot.y * _scaleY, (float)rot.x * _scaleY, 0, 0, - 0, 0, 1, 0, - x, y, 0, 1}; - - - _transform.set(mat); - -#elif CC_ENABLE_BOX2D_INTEGRATION - - b2Vec2 pos = _pB2Body->GetPosition(); - - float x = pos.x * _PTMRatio; - float y = pos.y * _PTMRatio; - - if (_ignoreAnchorPointForPosition) - { - x += _anchorPointInPoints.x; - y += _anchorPointInPoints.y; - } - - // Make matrix - float radians = _pB2Body->GetAngle(); - float c = cosf(radians); - float s = sinf(radians); - - if (!_anchorPointInPoints.isZero()) - { - x += ((c * -_anchorPointInPoints.x * _scaleX) + (-s * -_anchorPointInPoints.y * _scaleY)); - y += ((s * -_anchorPointInPoints.x * _scaleX) + (c * -_anchorPointInPoints.y * _scaleY)); - } - - // Rot, Translate Matrix - - float mat[] = { (float)c * _scaleX, (float)s * _scaleX, 0, 0, - (float)-s * _scaleY, (float)c * _scaleY, 0, 0, - 0, 0, 1, 0, - x, y, 0, 1}; - - _transform.set(mat); -#endif -} - -void PhysicsSprite::onEnter() -{ - Node::onEnter(); - _syncTransform = Director::getInstance()->getEventDispatcher()->addCustomEventListener(Director::EVENT_AFTER_UPDATE, std::bind(&PhysicsSprite::afterUpdate, this, std::placeholders::_1)); - _syncTransform->retain(); -} - -void PhysicsSprite::onExit() -{ - if (_syncTransform != nullptr) - { - Director::getInstance()->getEventDispatcher()->removeEventListener(_syncTransform); - _syncTransform->release(); - } - Node::onExit(); -} - -void PhysicsSprite::afterUpdate(EventCustom* /*event*/) -{ - syncPhysicsTransform(); - - _transformDirty = false; - _transformUpdated = true; - setDirtyRecursively(true); -} - -NS_CC_EXT_END - -#endif // CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION diff --git a/extensions/physics-nodes/CCPhysicsSprite.h b/extensions/physics-nodes/CCPhysicsSprite.h deleted file mode 100644 index c094e14..0000000 --- a/extensions/physics-nodes/CCPhysicsSprite.h +++ /dev/null @@ -1,154 +0,0 @@ -/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software - * Copyright (c) 2012 cocos2d-x.org - * Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#ifndef __PHYSICSNODES_CCPHYSICSSPRITE_H__ -#define __PHYSICSNODES_CCPHYSICSSPRITE_H__ - -#include "2d/CCSprite.h" -#include "extensions/ExtensionMacros.h" -#include "extensions/ExtensionExport.h" -#include "base/CCEventListenerCustom.h" - -#if (CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION) - -struct cpBody; -class b2Body; - -NS_CC_EXT_BEGIN - -/** A Sprite subclass that is bound to a physics body. - It works with: - - Chipmunk: Preprocessor macro CC_ENABLE_CHIPMUNK_INTEGRATION should be defined - - Objective-Chipmunk: Preprocessor macro CC_ENABLE_CHIPMUNK_INTEGRATION should be defined - - Box2d: Preprocessor macro CC_ENABLE_BOX2D_INTEGRATION should be defined - - Features and Limitations: - - Scale and Skew properties are ignored. - - Position and rotation are going to updated from the physics body - - If you update the rotation or position manually, the physics body will be updated - - You can't enble both Chipmunk support and Box2d support at the same time. Only one can be enabled at compile time - * @lua NA - */ -class CC_EX_DLL PhysicsSprite : public Sprite -{ -public: - - static PhysicsSprite* create(); - /** Creates an sprite with a texture. - The rect used will be the size of the texture. - The offset will be (0,0). - */ - static PhysicsSprite* createWithTexture(Texture2D *pTexture); - - /** Creates an sprite with a texture and a rect. - The offset will be (0,0). - */ - static PhysicsSprite* createWithTexture(Texture2D *pTexture, const Rect& rect); - - /** Creates an sprite with an sprite frame. */ - static PhysicsSprite* createWithSpriteFrame(SpriteFrame *pSpriteFrame); - - /** Creates an sprite with an sprite frame name. - An SpriteFrame will be fetched from the SpriteFrameCache by name. - If the SpriteFrame doesn't exist it will raise an exception. - @since v0.9 - */ - static PhysicsSprite* createWithSpriteFrameName(const char *pszSpriteFrameName); - - /** Creates an sprite with an image filename. - The rect used will be the size of the image. - The offset will be (0,0). - */ - static PhysicsSprite* create(const char *pszFileName); - - /** Creates an sprite with an image filename and a rect. - The offset will be (0,0). - */ - static PhysicsSprite* create(const char *pszFileName, const Rect& rect); - - PhysicsSprite(); - - virtual bool isDirty() const override; - - /** Keep the sprite's rotation separate from the body. */ - bool isIgnoreBodyRotation() const; - void setIgnoreBodyRotation(bool bIgnoreBodyRotation); - - // - // Chipmunk specific - // - /** Body accessor when using regular Chipmunk */ - cpBody* getCPBody() const; - void setCPBody(cpBody *pBody); - - // - // Box2d specific - // - /** Body accessor when using box2d */ - b2Body* getB2Body() const; - void setB2Body(b2Body *pBody); - - float getPTMRatio() const; - void setPTMRatio(float fPTMRatio); - virtual void syncPhysicsTransform() const; - - // overrides - virtual const Vec2& getPosition() const override; - virtual void getPosition(float* x, float* y) const override; - virtual float getPositionX() const override; - virtual float getPositionY() const override; - virtual Vec3 getPosition3D() const override; - virtual void setPosition(const Vec2 &position) override; - virtual void setPosition(float x, float y) override; - virtual void setPositionX(float x) override; - virtual void setPositionY(float y) override; - virtual void setPosition3D(const Vec3& position) override; - virtual float getRotation() const override; - virtual void setRotation(float fRotation) override; - - virtual void onEnter() override; - virtual void onExit() override; - -protected: - const Vec2& getPosFromPhysics() const; - void afterUpdate(EventCustom *event); - -protected: - bool _ignoreBodyRotation; - - // chipmunk specific - cpBody *_CPBody; - - // box2d specific - b2Body *_pB2Body; - float _PTMRatio; - - // Event for update synchronise physic transform - cocos2d::EventListenerCustom* _syncTransform; -}; - -NS_CC_EXT_END - -#endif // CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION - -#endif // __PHYSICSNODES_CCPHYSICSSPRITE_H__ diff --git a/external/Box2D/prebuilt/android/Android.mk b/external/Box2D/prebuilt/android/Android.mk deleted file mode 100755 index d691292..0000000 --- a/external/Box2D/prebuilt/android/Android.mk +++ /dev/null @@ -1,10 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := ext_box2d -LOCAL_MODULE_FILENAME := box2d -LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libbox2d.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include -LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/../../include -include $(PREBUILT_STATIC_LIBRARY) diff --git a/external/android-specific/pvmp3dec/Android.mk b/external/android-specific/pvmp3dec/Android.mk deleted file mode 100644 index 1d70da5..0000000 --- a/external/android-specific/pvmp3dec/Android.mk +++ /dev/null @@ -1,64 +0,0 @@ -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - src/pvmp3_normalize.cpp \ - src/pvmp3_alias_reduction.cpp \ - src/pvmp3_crc.cpp \ - src/pvmp3_decode_header.cpp \ - src/pvmp3_decode_huff_cw.cpp \ - src/pvmp3_getbits.cpp \ - src/pvmp3_dequantize_sample.cpp \ - src/pvmp3_framedecoder.cpp \ - src/pvmp3_get_main_data_size.cpp \ - src/pvmp3_get_side_info.cpp \ - src/pvmp3_get_scale_factors.cpp \ - src/pvmp3_mpeg2_get_scale_data.cpp \ - src/pvmp3_mpeg2_get_scale_factors.cpp \ - src/pvmp3_mpeg2_stereo_proc.cpp \ - src/pvmp3_huffman_decoding.cpp \ - src/pvmp3_huffman_parsing.cpp \ - src/pvmp3_tables.cpp \ - src/pvmp3_imdct_synth.cpp \ - src/pvmp3_mdct_6.cpp \ - src/pvmp3_dct_6.cpp \ - src/pvmp3_poly_phase_synthesis.cpp \ - src/pvmp3_equalizer.cpp \ - src/pvmp3_seek_synch.cpp \ - src/pvmp3_stereo_proc.cpp \ - src/pvmp3_reorder.cpp \ - -ifeq ($(TARGET_ARCH),arm) -LOCAL_SRC_FILES += \ - src/asm/pvmp3_polyphase_filter_window_gcc.s \ - src/asm/pvmp3_mdct_18_gcc.s \ - src/asm/pvmp3_dct_9_gcc.s \ - src/asm/pvmp3_dct_16_gcc.s -else -LOCAL_SRC_FILES += \ - src/pvmp3_polyphase_filter_window.cpp \ - src/pvmp3_mdct_18.cpp \ - src/pvmp3_dct_9.cpp \ - src/pvmp3_dct_16.cpp -endif - -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH)/src \ - $(LOCAL_PATH)/include - -LOCAL_EXPORT_C_INCLUDES := \ - $(LOCAL_PATH)/src \ - $(LOCAL_PATH)/include - -LOCAL_CFLAGS := \ - -D"OSCL_UNUSED_ARG(x)=(void)(x)" - -LOCAL_CFLAGS += -Werror -LOCAL_CLANG := true -LOCAL_SANITIZE := signed-integer-overflow - -LOCAL_MODULE := ext_pvmp3dec - -LOCAL_ARM_MODE := arm - -include $(BUILD_STATIC_LIBRARY) diff --git a/external/android-specific/tremolo/Android.mk b/external/android-specific/tremolo/Android.mk deleted file mode 100644 index 8241bae..0000000 --- a/external/android-specific/tremolo/Android.mk +++ /dev/null @@ -1,47 +0,0 @@ -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES = \ - Tremolo/bitwise.c \ - Tremolo/codebook.c \ - Tremolo/dsp.c \ - Tremolo/floor0.c \ - Tremolo/floor1.c \ - Tremolo/floor_lookup.c \ - Tremolo/framing.c \ - Tremolo/mapping0.c \ - Tremolo/mdct.c \ - Tremolo/misc.c \ - Tremolo/res012.c \ - Tremolo/treminfo.c \ - Tremolo/vorbisfile.c - -# Disable arm optimization which will cause the issue https://github.com/cocos2d/cocos2d-x/issues/17148 -# ifeq ($(TARGET_ARCH),arm) -# LOCAL_SRC_FILES += \ -# Tremolo/bitwiseARM.s \ -# Tremolo/dpen.s \ -# Tremolo/floor1ARM.s \ -# Tremolo/mdctARM.s -# LOCAL_CFLAGS += \ -# -D_ARM_ASSEM_ -# # Assembly code in asm_arm.h does not compile with Clang. -# LOCAL_CLANG_ASFLAGS_arm += \ -# -no-integrated-as -# else -LOCAL_CFLAGS += \ - -DONLY_C -# endif -LOCAL_CFLAGS+= -O2 - -LOCAL_C_INCLUDES:= \ - $(LOCAL_PATH)/Tremolo - -LOCAL_EXPORT_C_INCLUDES := \ - $(LOCAL_PATH) - -LOCAL_ARM_MODE := arm - -LOCAL_MODULE := ext_vorbisidec - -include $(BUILD_STATIC_LIBRARY) diff --git a/external/bullet/prebuilt/android/Android.mk b/external/bullet/prebuilt/android/Android.mk deleted file mode 100755 index e07565a..0000000 --- a/external/bullet/prebuilt/android/Android.mk +++ /dev/null @@ -1,52 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := ext_bullet -LOCAL_MODULE_FILENAME := bullet -LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libLinearMath.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include -LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/../../include/bullet -LOCAL_STATIC_LIBRARIES += bulletc -LOCAL_STATIC_LIBRARIES += bulletd -LOCAL_STATIC_LIBRARIES += bulletm -LOCAL_STATIC_LIBRARIES += minicl -include $(PREBUILT_STATIC_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_MODULE := bulletc -LOCAL_MODULE_FILENAME := bulletcollision -LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libBulletCollision.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include -LOCAL_STATIC_LIBRARIES += linearmath -include $(PREBUILT_STATIC_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_MODULE := bulletd -LOCAL_MODULE_FILENAME := bulletdynamics -LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libBulletDynamics.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include -LOCAL_STATIC_LIBRARIES += bulletc -LOCAL_STATIC_LIBRARIES += linearmath -include $(PREBUILT_STATIC_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_MODULE := bulletm -LOCAL_MODULE_FILENAME := bulletmultithreaded -LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libBulletMultiThreaded.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include -include $(PREBUILT_STATIC_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_MODULE := linearmath -LOCAL_MODULE_FILENAME := linearmath -LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libLinearMath.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include -include $(PREBUILT_STATIC_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_MODULE := minicl -LOCAL_MODULE_FILENAME := minicl -LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libMiniCL.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include -include $(PREBUILT_STATIC_LIBRARY) diff --git a/external/chipmunk/prebuilt/android/Android.mk b/external/chipmunk/prebuilt/android/Android.mk deleted file mode 100755 index 1270960..0000000 --- a/external/chipmunk/prebuilt/android/Android.mk +++ /dev/null @@ -1,8 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := ext_chipmunk -LOCAL_MODULE_FILENAME := chipmunk -LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libchipmunk.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include -include $(PREBUILT_STATIC_LIBRARY) diff --git a/external/curl/prebuilt/android/Android.mk b/external/curl/prebuilt/android/Android.mk deleted file mode 100644 index dfe1765..0000000 --- a/external/curl/prebuilt/android/Android.mk +++ /dev/null @@ -1,10 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := ext_curl -LOCAL_MODULE_FILENAME := curl -LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libcurl.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android -LOCAL_STATIC_LIBRARIES += ext_ssl -LOCAL_STATIC_LIBRARIES += ext_crypto -include $(PREBUILT_STATIC_LIBRARY) diff --git a/external/flatbuffers/Android.mk b/external/flatbuffers/Android.mk deleted file mode 100644 index b9eb17c..0000000 --- a/external/flatbuffers/Android.mk +++ /dev/null @@ -1,26 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := ext_flatbuffers - -LOCAL_MODULE_FILENAME := flatbuffers - -LOCAL_ARM_MODE := arm - -LOCAL_SRC_FILES := \ -flatc.cpp \ -idl_gen_cpp.cpp \ -idl_gen_fbs.cpp \ -idl_gen_general.cpp \ -idl_gen_go.cpp \ -idl_gen_text.cpp \ -idl_parser.cpp - -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/..\ - -LOCAL_CPPFLAGS += -fexceptions - -include $(BUILD_STATIC_LIBRARY) diff --git a/external/freetype2/prebuilt/android/Android.mk b/external/freetype2/prebuilt/android/Android.mk deleted file mode 100755 index 267b9bf..0000000 --- a/external/freetype2/prebuilt/android/Android.mk +++ /dev/null @@ -1,9 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := ext_freetype2 -LOCAL_MODULE_FILENAME := freetype2 -LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libfreetype.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android \ - $(LOCAL_PATH)/../../include/android/freetype2 -include $(PREBUILT_STATIC_LIBRARY) diff --git a/external/jpeg/prebuilt/android/Android.mk b/external/jpeg/prebuilt/android/Android.mk deleted file mode 100755 index b42b9ba..0000000 --- a/external/jpeg/prebuilt/android/Android.mk +++ /dev/null @@ -1,8 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := ext_jpeg -LOCAL_MODULE_FILENAME := jpeg -LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libjpeg.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android -include $(PREBUILT_STATIC_LIBRARY) diff --git a/external/lua/luajit/prebuilt/android/Android.mk b/external/lua/luajit/prebuilt/android/Android.mk deleted file mode 100755 index b5dfc38..0000000 --- a/external/lua/luajit/prebuilt/android/Android.mk +++ /dev/null @@ -1,8 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := ext_luajit -LOCAL_MODULE_FILENAME := libluajit -LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libluajit.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include -include $(PREBUILT_STATIC_LIBRARY) diff --git a/external/openssl/prebuilt/android/Android.mk b/external/openssl/prebuilt/android/Android.mk deleted file mode 100644 index 631f72c..0000000 --- a/external/openssl/prebuilt/android/Android.mk +++ /dev/null @@ -1,15 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := ext_crypto -LOCAL_MODULE_FILENAME := crypto -LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libcrypto.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android -include $(PREBUILT_STATIC_LIBRARY) - -LOCAL_MODULE := ext_ssl -LOCAL_MODULE_FILENAME := ssl -LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libssl.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android -include $(PREBUILT_STATIC_LIBRARY) diff --git a/external/png/prebuilt/android/Android.mk b/external/png/prebuilt/android/Android.mk deleted file mode 100755 index 7504379..0000000 --- a/external/png/prebuilt/android/Android.mk +++ /dev/null @@ -1,8 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := ext_png -LOCAL_MODULE_FILENAME := png -LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libpng.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android -include $(PREBUILT_STATIC_LIBRARY) diff --git a/external/recast/Android.mk b/external/recast/Android.mk deleted file mode 100644 index ce1ac85..0000000 --- a/external/recast/Android.mk +++ /dev/null @@ -1,34 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := ext_recast - -LOCAL_MODULE_FILENAME := librecast - -LOCAL_ARM_MODE := arm - -LOCAL_SRC_FILES := \ -DebugUtils/DebugDraw.cpp \ -DebugUtils/DetourDebugDraw.cpp \ -Detour/DetourAlloc.cpp \ -Detour/DetourCommon.cpp \ -Detour/DetourNavMesh.cpp \ -Detour/DetourNavMeshBuilder.cpp \ -Detour/DetourNavMeshQuery.cpp \ -Detour/DetourNode.cpp \ -DetourCrowd/DetourCrowd.cpp \ -DetourCrowd/DetourLocalBoundary.cpp \ -DetourCrowd/DetourObstacleAvoidance.cpp \ -DetourCrowd/DetourPathCorridor.cpp \ -DetourCrowd/DetourPathQueue.cpp \ -DetourCrowd/DetourProximityGrid.cpp \ -DetourTileCache/DetourTileCache.cpp \ -DetourTileCache/DetourTileCacheBuilder.cpp \ -fastlz/fastlz.c - -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. - -include $(BUILD_STATIC_LIBRARY) \ No newline at end of file diff --git a/external/uv/prebuilt/android/Android.mk b/external/uv/prebuilt/android/Android.mk deleted file mode 100644 index 9de3832..0000000 --- a/external/uv/prebuilt/android/Android.mk +++ /dev/null @@ -1,8 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := ext_uv -LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libuv_a.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include - -include $(PREBUILT_STATIC_LIBRARY) diff --git a/external/webp/prebuilt/android/Android.mk b/external/webp/prebuilt/android/Android.mk deleted file mode 100755 index 21d716a..0000000 --- a/external/webp/prebuilt/android/Android.mk +++ /dev/null @@ -1,17 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := ext_webp -LOCAL_MODULE_FILENAME := webp -LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libwebp.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android - -LOCAL_WHOLE_STATIC_LIBRARIES := cpufeatures - -ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) - LOCAL_CFLAGS := -DHAVE_NEON=1 -endif - -include $(PREBUILT_STATIC_LIBRARY) - -$(call import-module, android/cpufeatures) diff --git a/external/websockets/prebuilt/android/Android.mk b/external/websockets/prebuilt/android/Android.mk deleted file mode 100755 index cc5886a..0000000 --- a/external/websockets/prebuilt/android/Android.mk +++ /dev/null @@ -1,15 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := ext_websockets -LOCAL_MODULE_FILENAME := websockets -LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libwebsockets.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android -LOCAL_CPPFLAGS := -D__STDC_LIMIT_MACROS=1 -LOCAL_EXPORT_CPPFLAGS := -D__STDC_LIMIT_MACROS=1 - -LOCAL_STATIC_LIBRARIES += ext_ssl -LOCAL_STATIC_LIBRARIES += ext_crypto -LOCAL_STATIC_LIBRARIES += ext_uv - -include $(PREBUILT_STATIC_LIBRARY) diff --git a/external/zlib/prebuilt/android/Android.mk b/external/zlib/prebuilt/android/Android.mk deleted file mode 100755 index f52bf36..0000000 --- a/external/zlib/prebuilt/android/Android.mk +++ /dev/null @@ -1,8 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := ext_zlib -LOCAL_MODULE_FILENAME := zlib -LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libz.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include -include $(PREBUILT_STATIC_LIBRARY) diff --git a/templates/lua-template-default/src/config.lua b/templates/lua-template-default/src/config.lua index 7dae553..6c4254d 100644 --- a/templates/lua-template-default/src/config.lua +++ b/templates/lua-template-default/src/config.lua @@ -2,9 +2,6 @@ -- 0 - disable debug info, 1 - less debug info, 2 - verbose debug info DEBUG = 2 --- use framework, will disable all deprecated API, false - use legacy API -CC_USE_FRAMEWORK = true - -- show FPS on screen CC_SHOW_FPS = true