mirror of https://github.com/axmolengine/axmol.git
Merge branch 'v3' of https://github.com/cocos2d/cocos2d-x into v3
This commit is contained in:
commit
4929d8102a
1
AUTHORS
1
AUTHORS
|
@ -540,6 +540,7 @@ Developers:
|
||||||
|
|
||||||
hawkwood (Justin Hawkwood)
|
hawkwood (Justin Hawkwood)
|
||||||
Fixing a bug that EditBox doesn't show any text if it's initialized with text.
|
Fixing a bug that EditBox doesn't show any text if it's initialized with text.
|
||||||
|
Fixed a memory leak in new Audio.
|
||||||
|
|
||||||
wtyqm (zhang peng)
|
wtyqm (zhang peng)
|
||||||
Fixing a bug that ccbRootPath wasn't passed to sub ccb nodes.
|
Fixing a bug that ccbRootPath wasn't passed to sub ccb nodes.
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
cocos2d-x-3.6beta0 Apr.14 2015
|
cocos2d-x-3.6beta0 Apr.14 2015
|
||||||
[NEW] 3D: added texturecub supported
|
[NEW] 3D: added texturecub supported
|
||||||
|
[NEW] Animate3D: added `Animate3D::setHighQuality()` to set animation quality
|
||||||
|
|
||||||
|
[FIX] Audio: memory leak
|
||||||
|
[FIX] Particle3D: particles' rotation affect particle system's rotation
|
||||||
[FIX] Sprite3D: memory leak
|
[FIX] Sprite3D: memory leak
|
||||||
|
|
||||||
cocos2d-x-3.5 Mar.23 2015
|
cocos2d-x-3.5 Mar.23 2015
|
||||||
|
|
|
@ -29,9 +29,9 @@ cmake_minimum_required(VERSION 2.8)
|
||||||
# also from cmake's Modules dir, to not clash with per-project files.
|
# also from cmake's Modules dir, to not clash with per-project files.
|
||||||
cmake_policy(SET CMP0017 NEW)
|
cmake_policy(SET CMP0017 NEW)
|
||||||
|
|
||||||
# Use new behaviour with cmake >= 3.0:
|
# Use new behaviour with cmake >= 3.1:
|
||||||
# Only interpret if() arguments as variables or keywords when unquoted.
|
# Only interpret if() arguments as variables or keywords when unquoted.
|
||||||
if(CMAKE_VERSION VERSION_GREATER 3)
|
if(CMAKE_VERSION VERSION_GREATER 3.1)
|
||||||
cmake_policy(SET CMP0054 NEW)
|
cmake_policy(SET CMP0054 NEW)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -157,7 +157,7 @@ Select the test you want from Xcode Scheme chooser.
|
||||||
|
|
||||||
```
|
```
|
||||||
$ cd cocos2d-x/build
|
$ cd cocos2d-x/build
|
||||||
$ open cocos_tests.xcodeproj
|
$ open cocos2d_tests.xcodeproj
|
||||||
```
|
```
|
||||||
|
|
||||||
* For Linux
|
* For Linux
|
||||||
|
|
|
@ -49,6 +49,7 @@ class CC_DLL ActionCamera : public ActionInterval //<NSCopying>
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @js ctor
|
* @js ctor
|
||||||
|
* @lua new
|
||||||
*/
|
*/
|
||||||
ActionCamera();
|
ActionCamera();
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Copyright (c) 2008-2010 Ricardo Quesada
|
Copyright (c) 2008-2010 Ricardo Quesada
|
||||||
Copyright (c) 2010-2012 cocos2d-x.org
|
Copyright (c) 2010-2012 cocos2d-x.org
|
||||||
Copyright (c) 2011 Zynga Inc.
|
Copyright (c) 2011 Zynga Inc.
|
||||||
Copyright (c) 2013-2014 Chukong Technologies Inc.
|
Copyright (c) 2013-2015 Chukong Technologies Inc.
|
||||||
|
|
||||||
http://www.cocos2d-x.org
|
http://www.cocos2d-x.org
|
||||||
|
|
||||||
|
@ -33,13 +33,6 @@ THE SOFTWARE.
|
||||||
#include "deprecated/CCString.h"
|
#include "deprecated/CCString.h"
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#if defined(__GNUC__) && ((__GNUC__ >= 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
|
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
static int _globalFontSize = kItemSize;
|
static int _globalFontSize = kItemSize;
|
||||||
|
@ -65,7 +58,7 @@ MenuItem* MenuItem::create()
|
||||||
MenuItem* MenuItem::create(Ref *target, SEL_MenuHandler selector)
|
MenuItem* MenuItem::create(Ref *target, SEL_MenuHandler selector)
|
||||||
{
|
{
|
||||||
MenuItem *ret = new (std::nothrow) MenuItem();
|
MenuItem *ret = new (std::nothrow) MenuItem();
|
||||||
ret->initWithTarget(target, selector);
|
ret->initWithCallback(std::bind(selector, target, std::placeholders::_1));
|
||||||
ret->autorelease();
|
ret->autorelease();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -81,8 +74,6 @@ MenuItem* MenuItem::create( const ccMenuCallback& callback)
|
||||||
// FIXME: deprecated
|
// FIXME: deprecated
|
||||||
bool MenuItem::initWithTarget(cocos2d::Ref *target, SEL_MenuHandler selector )
|
bool MenuItem::initWithTarget(cocos2d::Ref *target, SEL_MenuHandler selector )
|
||||||
{
|
{
|
||||||
_target = target;
|
|
||||||
CC_SAFE_RETAIN(_target);
|
|
||||||
return initWithCallback( std::bind(selector,target, std::placeholders::_1) );
|
return initWithCallback( std::bind(selector,target, std::placeholders::_1) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +93,6 @@ MenuItem::~MenuItem()
|
||||||
void MenuItem::onExit()
|
void MenuItem::onExit()
|
||||||
{
|
{
|
||||||
Node::onExit();
|
Node::onExit();
|
||||||
CC_SAFE_RELEASE(_target);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuItem::selected()
|
void MenuItem::selected()
|
||||||
|
@ -159,8 +149,6 @@ bool MenuItem::isSelected() const
|
||||||
// FIXME: deprecated
|
// FIXME: deprecated
|
||||||
void MenuItem::setTarget(Ref *target, SEL_MenuHandler selector)
|
void MenuItem::setTarget(Ref *target, SEL_MenuHandler selector)
|
||||||
{
|
{
|
||||||
_target = target;
|
|
||||||
CC_SAFE_RETAIN(_target);
|
|
||||||
setCallback( std::bind( selector, target, std::placeholders::_1) );
|
setCallback( std::bind( selector, target, std::placeholders::_1) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,7 +187,7 @@ void MenuItemLabel::setLabel(Node* var)
|
||||||
MenuItemLabel * MenuItemLabel::create(Node*label, Ref* target, SEL_MenuHandler selector)
|
MenuItemLabel * MenuItemLabel::create(Node*label, Ref* target, SEL_MenuHandler selector)
|
||||||
{
|
{
|
||||||
MenuItemLabel *ret = new (std::nothrow) MenuItemLabel();
|
MenuItemLabel *ret = new (std::nothrow) MenuItemLabel();
|
||||||
ret->initWithLabel(label, target, selector);
|
ret->initWithLabel(label, std::bind(selector, target, std::placeholders::_1));
|
||||||
ret->autorelease();
|
ret->autorelease();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -223,8 +211,6 @@ MenuItemLabel* MenuItemLabel::create(Node *label)
|
||||||
// FIXME:: deprecated
|
// FIXME:: deprecated
|
||||||
bool MenuItemLabel::initWithLabel(Node* label, Ref* target, SEL_MenuHandler selector)
|
bool MenuItemLabel::initWithLabel(Node* label, Ref* target, SEL_MenuHandler selector)
|
||||||
{
|
{
|
||||||
_target = target;
|
|
||||||
CC_SAFE_RETAIN(_target);
|
|
||||||
return initWithLabel(label, std::bind(selector,target, std::placeholders::_1) );
|
return initWithLabel(label, std::bind(selector,target, std::placeholders::_1) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -329,7 +315,7 @@ MenuItemAtlasFont * MenuItemAtlasFont::create(const std::string& value, const st
|
||||||
MenuItemAtlasFont * MenuItemAtlasFont::create(const std::string& value, const std::string& charMapFile, int itemWidth, int itemHeight, char startCharMap, Ref* target, SEL_MenuHandler selector)
|
MenuItemAtlasFont * MenuItemAtlasFont::create(const std::string& value, const std::string& charMapFile, int itemWidth, int itemHeight, char startCharMap, Ref* target, SEL_MenuHandler selector)
|
||||||
{
|
{
|
||||||
MenuItemAtlasFont *ret = new (std::nothrow) MenuItemAtlasFont();
|
MenuItemAtlasFont *ret = new (std::nothrow) MenuItemAtlasFont();
|
||||||
ret->initWithString(value, charMapFile, itemWidth, itemHeight, startCharMap, target, selector);
|
ret->initWithString(value, charMapFile, itemWidth, itemHeight, startCharMap, std::bind(selector, target, std::placeholders::_1));
|
||||||
ret->autorelease();
|
ret->autorelease();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -345,8 +331,6 @@ MenuItemAtlasFont * MenuItemAtlasFont::create(const std::string& value, const st
|
||||||
// FIXME:: deprecated
|
// FIXME:: deprecated
|
||||||
bool MenuItemAtlasFont::initWithString(const std::string& value, const std::string& charMapFile, int itemWidth, int itemHeight, char startCharMap, Ref* target, SEL_MenuHandler selector)
|
bool MenuItemAtlasFont::initWithString(const std::string& value, const std::string& charMapFile, int itemWidth, int itemHeight, char startCharMap, Ref* target, SEL_MenuHandler selector)
|
||||||
{
|
{
|
||||||
_target = target;
|
|
||||||
CC_SAFE_RETAIN(_target);
|
|
||||||
return initWithString(value, charMapFile, itemWidth, itemHeight, startCharMap, std::bind(selector,target, std::placeholders::_1) );
|
return initWithString(value, charMapFile, itemWidth, itemHeight, startCharMap, std::bind(selector,target, std::placeholders::_1) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -395,7 +379,7 @@ const std::string& MenuItemFont::getFontName()
|
||||||
MenuItemFont * MenuItemFont::create(const std::string& value, Ref* target, SEL_MenuHandler selector)
|
MenuItemFont * MenuItemFont::create(const std::string& value, Ref* target, SEL_MenuHandler selector)
|
||||||
{
|
{
|
||||||
MenuItemFont *ret = new (std::nothrow) MenuItemFont();
|
MenuItemFont *ret = new (std::nothrow) MenuItemFont();
|
||||||
ret->initWithString(value, target, selector);
|
ret->initWithString(value, std::bind(selector, target, std::placeholders::_1));
|
||||||
ret->autorelease();
|
ret->autorelease();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -431,8 +415,6 @@ bool MenuItemFont::initWithString(const std::string& value, Ref* target, SEL_Men
|
||||||
{
|
{
|
||||||
CCASSERT( !value.empty(), "Value length must be greater than 0");
|
CCASSERT( !value.empty(), "Value length must be greater than 0");
|
||||||
|
|
||||||
_target = target;
|
|
||||||
CC_SAFE_RETAIN(target);
|
|
||||||
return initWithString(value, std::bind(selector,target, std::placeholders::_1) );
|
return initWithString(value, std::bind(selector,target, std::placeholders::_1) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -552,7 +534,7 @@ MenuItemSprite * MenuItemSprite::create(Node* normalSprite, Node* selectedSprite
|
||||||
// FIXME: deprecated
|
// FIXME: deprecated
|
||||||
MenuItemSprite * MenuItemSprite::create(Node* normalSprite, Node* selectedSprite, Ref* target, SEL_MenuHandler selector)
|
MenuItemSprite * MenuItemSprite::create(Node* normalSprite, Node* selectedSprite, Ref* target, SEL_MenuHandler selector)
|
||||||
{
|
{
|
||||||
return MenuItemSprite::create(normalSprite, selectedSprite, nullptr, target, selector);
|
return MenuItemSprite::create(normalSprite, selectedSprite, nullptr, std::bind(selector, target, std::placeholders::_1));
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuItemSprite * MenuItemSprite::create(Node* normalSprite, Node* selectedSprite, const ccMenuCallback& callback)
|
MenuItemSprite * MenuItemSprite::create(Node* normalSprite, Node* selectedSprite, const ccMenuCallback& callback)
|
||||||
|
@ -564,7 +546,7 @@ MenuItemSprite * MenuItemSprite::create(Node* normalSprite, Node* selectedSprite
|
||||||
MenuItemSprite * MenuItemSprite::create(Node *normalSprite, Node *selectedSprite, Node *disabledSprite, Ref *target, SEL_MenuHandler selector)
|
MenuItemSprite * MenuItemSprite::create(Node *normalSprite, Node *selectedSprite, Node *disabledSprite, Ref *target, SEL_MenuHandler selector)
|
||||||
{
|
{
|
||||||
MenuItemSprite *ret = new (std::nothrow) MenuItemSprite();
|
MenuItemSprite *ret = new (std::nothrow) MenuItemSprite();
|
||||||
ret->initWithNormalSprite(normalSprite, selectedSprite, disabledSprite, target, selector);
|
ret->initWithNormalSprite(normalSprite, selectedSprite, disabledSprite, std::bind(selector, target, std::placeholders::_1));
|
||||||
ret->autorelease();
|
ret->autorelease();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -580,8 +562,6 @@ MenuItemSprite * MenuItemSprite::create(Node *normalSprite, Node *selectedSprite
|
||||||
// FIXME: deprecated
|
// FIXME: deprecated
|
||||||
bool MenuItemSprite::initWithNormalSprite(Node* normalSprite, Node* selectedSprite, Node* disabledSprite, Ref* target, SEL_MenuHandler selector)
|
bool MenuItemSprite::initWithNormalSprite(Node* normalSprite, Node* selectedSprite, Node* disabledSprite, Ref* target, SEL_MenuHandler selector)
|
||||||
{
|
{
|
||||||
_target = target;
|
|
||||||
CC_SAFE_RETAIN(_target);
|
|
||||||
return initWithNormalSprite(normalSprite, selectedSprite, disabledSprite, std::bind(selector,target, std::placeholders::_1) );
|
return initWithNormalSprite(normalSprite, selectedSprite, disabledSprite, std::bind(selector,target, std::placeholders::_1) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -712,7 +692,7 @@ MenuItemImage * MenuItemImage::create(const std::string& normalImage, const std:
|
||||||
// FIXME: deprecated
|
// FIXME: deprecated
|
||||||
MenuItemImage * MenuItemImage::create(const std::string& normalImage, const std::string& selectedImage, Ref* target, SEL_MenuHandler selector)
|
MenuItemImage * MenuItemImage::create(const std::string& normalImage, const std::string& selectedImage, Ref* target, SEL_MenuHandler selector)
|
||||||
{
|
{
|
||||||
return MenuItemImage::create(normalImage, selectedImage, "", target, selector);
|
return MenuItemImage::create(normalImage, selectedImage, "", std::bind(selector, target, std::placeholders::_1));
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuItemImage * MenuItemImage::create(const std::string& normalImage, const std::string& selectedImage, const ccMenuCallback& callback)
|
MenuItemImage * MenuItemImage::create(const std::string& normalImage, const std::string& selectedImage, const ccMenuCallback& callback)
|
||||||
|
@ -724,7 +704,7 @@ MenuItemImage * MenuItemImage::create(const std::string& normalImage, const std:
|
||||||
MenuItemImage * MenuItemImage::create(const std::string& normalImage, const std::string& selectedImage, const std::string& disabledImage, Ref* target, SEL_MenuHandler selector)
|
MenuItemImage * MenuItemImage::create(const std::string& normalImage, const std::string& selectedImage, const std::string& disabledImage, Ref* target, SEL_MenuHandler selector)
|
||||||
{
|
{
|
||||||
MenuItemImage *ret = new (std::nothrow) MenuItemImage();
|
MenuItemImage *ret = new (std::nothrow) MenuItemImage();
|
||||||
if (ret && ret->initWithNormalImage(normalImage, selectedImage, disabledImage, target, selector))
|
if (ret && ret->initWithNormalImage(normalImage, selectedImage, disabledImage, std::bind(selector, target, std::placeholders::_1)))
|
||||||
{
|
{
|
||||||
ret->autorelease();
|
ret->autorelease();
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -760,8 +740,6 @@ MenuItemImage * MenuItemImage::create(const std::string& normalImage, const std:
|
||||||
// FIXME:: deprecated
|
// FIXME:: deprecated
|
||||||
bool MenuItemImage::initWithNormalImage(const std::string& normalImage, const std::string& selectedImage, const std::string& disabledImage, Ref* target, SEL_MenuHandler selector)
|
bool MenuItemImage::initWithNormalImage(const std::string& normalImage, const std::string& selectedImage, const std::string& disabledImage, Ref* target, SEL_MenuHandler selector)
|
||||||
{
|
{
|
||||||
_target = target;
|
|
||||||
CC_SAFE_RETAIN(_target);
|
|
||||||
return initWithNormalImage(normalImage, selectedImage, disabledImage, std::bind(selector,target, std::placeholders::_1) );
|
return initWithNormalImage(normalImage, selectedImage, disabledImage, std::bind(selector,target, std::placeholders::_1) );
|
||||||
}
|
}
|
||||||
bool MenuItemImage::initWithNormalImage(const std::string& normalImage, const std::string& selectedImage, const std::string& disabledImage, const ccMenuCallback& callback)
|
bool MenuItemImage::initWithNormalImage(const std::string& normalImage, const std::string& selectedImage, const std::string& disabledImage, const ccMenuCallback& callback)
|
||||||
|
@ -813,7 +791,7 @@ void MenuItemImage::setDisabledSpriteFrame(SpriteFrame * frame)
|
||||||
MenuItemToggle * MenuItemToggle::createWithTarget(Ref* target, SEL_MenuHandler selector, const Vector<MenuItem*>& menuItems)
|
MenuItemToggle * MenuItemToggle::createWithTarget(Ref* target, SEL_MenuHandler selector, const Vector<MenuItem*>& menuItems)
|
||||||
{
|
{
|
||||||
MenuItemToggle *ret = new (std::nothrow) MenuItemToggle();
|
MenuItemToggle *ret = new (std::nothrow) MenuItemToggle();
|
||||||
ret->MenuItem::initWithTarget(target, selector);
|
ret->MenuItem::initWithCallback(std::bind(selector, target, std::placeholders::_1));
|
||||||
ret->_subItems = menuItems;
|
ret->_subItems = menuItems;
|
||||||
ret->_selectedIndex = UINT_MAX;
|
ret->_selectedIndex = UINT_MAX;
|
||||||
ret->setSelectedIndex(0);
|
ret->setSelectedIndex(0);
|
||||||
|
@ -836,7 +814,7 @@ MenuItemToggle * MenuItemToggle::createWithTarget(Ref* target, SEL_MenuHandler s
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, item);
|
va_start(args, item);
|
||||||
MenuItemToggle *ret = new (std::nothrow) MenuItemToggle();
|
MenuItemToggle *ret = new (std::nothrow) MenuItemToggle();
|
||||||
ret->initWithTarget(target, selector, item, args);
|
ret->initWithCallback(std::bind(selector, target, std::placeholders::_1), item, args);
|
||||||
ret->autorelease();
|
ret->autorelease();
|
||||||
va_end(args);
|
va_end(args);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -877,8 +855,6 @@ MenuItemToggle * MenuItemToggle::create()
|
||||||
// FIXME:: deprecated
|
// FIXME:: deprecated
|
||||||
bool MenuItemToggle::initWithTarget(Ref* target, SEL_MenuHandler selector, MenuItem* item, va_list args)
|
bool MenuItemToggle::initWithTarget(Ref* target, SEL_MenuHandler selector, MenuItem* item, va_list args)
|
||||||
{
|
{
|
||||||
_target = target;
|
|
||||||
CC_SAFE_RETAIN(_target);
|
|
||||||
return initWithCallback(std::bind( selector, target, std::placeholders::_1), item, args);
|
return initWithCallback(std::bind( selector, target, std::placeholders::_1), item, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -995,9 +971,3 @@ MenuItem* MenuItemToggle::getSelectedItem()
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
||||||
#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
|
|
||||||
|
|
|
@ -110,7 +110,6 @@ CC_CONSTRUCTOR_ACCESS:
|
||||||
: _selected(false)
|
: _selected(false)
|
||||||
, _enabled(false)
|
, _enabled(false)
|
||||||
, _callback(nullptr)
|
, _callback(nullptr)
|
||||||
, _target(nullptr)
|
|
||||||
{}
|
{}
|
||||||
/**
|
/**
|
||||||
* @js NA
|
* @js NA
|
||||||
|
@ -133,8 +132,6 @@ protected:
|
||||||
bool _enabled;
|
bool _enabled;
|
||||||
// callback
|
// callback
|
||||||
ccMenuCallback _callback;
|
ccMenuCallback _callback;
|
||||||
// If using the old API, the _target needs to be retained / released
|
|
||||||
Ref *_target;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CC_DISALLOW_COPY_AND_ASSIGN(MenuItem);
|
CC_DISALLOW_COPY_AND_ASSIGN(MenuItem);
|
||||||
|
|
|
@ -621,7 +621,7 @@ Vec2 TMXLayer::calculateLayerOffset(const Vec2& pos)
|
||||||
case TMXOrientationStaggered:
|
case TMXOrientationStaggered:
|
||||||
{
|
{
|
||||||
float diffX = 0;
|
float diffX = 0;
|
||||||
if ((int)abs(pos.y) % 2 == 1)
|
if ((int)std::abs(pos.y) % 2 == 1)
|
||||||
{
|
{
|
||||||
diffX = _mapTileSize.width/2;
|
diffX = _mapTileSize.width/2;
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ TMXLayerInfo::TMXLayerInfo()
|
||||||
TMXLayerInfo::~TMXLayerInfo()
|
TMXLayerInfo::~TMXLayerInfo()
|
||||||
{
|
{
|
||||||
CCLOGINFO("deallocing TMXLayerInfo: %p", this);
|
CCLOGINFO("deallocing TMXLayerInfo: %p", this);
|
||||||
if( _ownTiles && _tiles )
|
if (_ownTiles && _tiles)
|
||||||
{
|
{
|
||||||
free(_tiles);
|
free(_tiles);
|
||||||
_tiles = nullptr;
|
_tiles = nullptr;
|
||||||
|
@ -62,6 +62,7 @@ ValueMap& TMXLayerInfo::getProperties()
|
||||||
{
|
{
|
||||||
return _properties;
|
return _properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TMXLayerInfo::setProperties(ValueMap var)
|
void TMXLayerInfo::setProperties(ValueMap var)
|
||||||
{
|
{
|
||||||
_properties = var;
|
_properties = var;
|
||||||
|
@ -100,7 +101,7 @@ Rect TMXTilesetInfo::getRectForGID(uint32_t gid)
|
||||||
TMXMapInfo * TMXMapInfo::create(const std::string& tmxFile)
|
TMXMapInfo * TMXMapInfo::create(const std::string& tmxFile)
|
||||||
{
|
{
|
||||||
TMXMapInfo *ret = new (std::nothrow) TMXMapInfo();
|
TMXMapInfo *ret = new (std::nothrow) TMXMapInfo();
|
||||||
if(ret->initWithTMXFile(tmxFile))
|
if (ret->initWithTMXFile(tmxFile))
|
||||||
{
|
{
|
||||||
ret->autorelease();
|
ret->autorelease();
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -112,7 +113,7 @@ TMXMapInfo * TMXMapInfo::create(const std::string& tmxFile)
|
||||||
TMXMapInfo * TMXMapInfo::createWithXML(const std::string& tmxString, const std::string& resourcePath)
|
TMXMapInfo * TMXMapInfo::createWithXML(const std::string& tmxString, const std::string& resourcePath)
|
||||||
{
|
{
|
||||||
TMXMapInfo *ret = new (std::nothrow) TMXMapInfo();
|
TMXMapInfo *ret = new (std::nothrow) TMXMapInfo();
|
||||||
if(ret->initWithXML(tmxString, resourcePath))
|
if (ret->initWithXML(tmxString, resourcePath))
|
||||||
{
|
{
|
||||||
ret->autorelease();
|
ret->autorelease();
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -123,12 +124,12 @@ TMXMapInfo * TMXMapInfo::createWithXML(const std::string& tmxString, const std::
|
||||||
|
|
||||||
void TMXMapInfo::internalInit(const std::string& tmxFileName, const std::string& resourcePath)
|
void TMXMapInfo::internalInit(const std::string& tmxFileName, const std::string& resourcePath)
|
||||||
{
|
{
|
||||||
if (tmxFileName.size() > 0)
|
if (!tmxFileName.empty())
|
||||||
{
|
{
|
||||||
_TMXFileName = FileUtils::getInstance()->fullPathForFilename(tmxFileName);
|
_TMXFileName = FileUtils::getInstance()->fullPathForFilename(tmxFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resourcePath.size() > 0)
|
if (!resourcePath.empty())
|
||||||
{
|
{
|
||||||
_resources = resourcePath;
|
_resources = resourcePath;
|
||||||
}
|
}
|
||||||
|
@ -142,6 +143,7 @@ void TMXMapInfo::internalInit(const std::string& tmxFileName, const std::string&
|
||||||
_parentElement = TMXPropertyNone;
|
_parentElement = TMXPropertyNone;
|
||||||
_currentFirstGID = -1;
|
_currentFirstGID = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TMXMapInfo::initWithXML(const std::string& tmxString, const std::string& resourcePath)
|
bool TMXMapInfo::initWithXML(const std::string& tmxString, const std::string& resourcePath)
|
||||||
{
|
{
|
||||||
internalInit("", resourcePath);
|
internalInit("", resourcePath);
|
||||||
|
@ -202,20 +204,19 @@ bool TMXMapInfo::parseXMLFile(const std::string& xmlFilename)
|
||||||
return parser.parse(FileUtils::getInstance()->fullPathForFilename(xmlFilename).c_str());
|
return parser.parse(FileUtils::getInstance()->fullPathForFilename(xmlFilename).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// the XML parser calls here with all the elements
|
// the XML parser calls here with all the elements
|
||||||
void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
|
void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
|
||||||
{
|
{
|
||||||
CC_UNUSED_PARAM(ctx);
|
CC_UNUSED_PARAM(ctx);
|
||||||
TMXMapInfo *tmxMapInfo = this;
|
TMXMapInfo *tmxMapInfo = this;
|
||||||
std::string elementName = (char*)name;
|
std::string elementName = name;
|
||||||
ValueMap attributeDict;
|
ValueMap attributeDict;
|
||||||
if (atts && atts[0])
|
if (atts && atts[0])
|
||||||
{
|
{
|
||||||
for(int i = 0; atts[i]; i += 2)
|
for (int i = 0; atts[i]; i += 2)
|
||||||
{
|
{
|
||||||
std::string key = (char*)atts[i];
|
std::string key = atts[i];
|
||||||
std::string value = (char*)atts[i+1];
|
std::string value = atts[i+1];
|
||||||
attributeDict.insert(std::make_pair(key, Value(value)));
|
attributeDict.insert(std::make_pair(key, Value(value)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -227,16 +228,21 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
|
||||||
CCLOG("cocos2d: TMXFormat: Unsupported TMX version: %s", version.c_str());
|
CCLOG("cocos2d: TMXFormat: Unsupported TMX version: %s", version.c_str());
|
||||||
}
|
}
|
||||||
std::string orientationStr = attributeDict["orientation"].asString();
|
std::string orientationStr = attributeDict["orientation"].asString();
|
||||||
if (orientationStr == "orthogonal")
|
if (orientationStr == "orthogonal") {
|
||||||
tmxMapInfo->setOrientation(TMXOrientationOrtho);
|
tmxMapInfo->setOrientation(TMXOrientationOrtho);
|
||||||
else if (orientationStr == "isometric")
|
}
|
||||||
|
else if (orientationStr == "isometric") {
|
||||||
tmxMapInfo->setOrientation(TMXOrientationIso);
|
tmxMapInfo->setOrientation(TMXOrientationIso);
|
||||||
else if(orientationStr == "hexagonal")
|
}
|
||||||
|
else if (orientationStr == "hexagonal") {
|
||||||
tmxMapInfo->setOrientation(TMXOrientationHex);
|
tmxMapInfo->setOrientation(TMXOrientationHex);
|
||||||
else if(orientationStr == "staggered")
|
}
|
||||||
|
else if (orientationStr == "staggered") {
|
||||||
tmxMapInfo->setOrientation(TMXOrientationStaggered);
|
tmxMapInfo->setOrientation(TMXOrientationStaggered);
|
||||||
else
|
}
|
||||||
|
else {
|
||||||
CCLOG("cocos2d: TMXFomat: Unsupported orientation: %d", tmxMapInfo->getOrientation());
|
CCLOG("cocos2d: TMXFomat: Unsupported orientation: %d", tmxMapInfo->getOrientation());
|
||||||
|
}
|
||||||
|
|
||||||
Size s;
|
Size s;
|
||||||
s.width = attributeDict["width"].asFloat();
|
s.width = attributeDict["width"].asFloat();
|
||||||
|
@ -356,7 +362,6 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
|
||||||
|
|
||||||
// The parent element is now "layer"
|
// The parent element is now "layer"
|
||||||
tmxMapInfo->setParentElement(TMXPropertyLayer);
|
tmxMapInfo->setParentElement(TMXPropertyLayer);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (elementName == "objectgroup")
|
else if (elementName == "objectgroup")
|
||||||
{
|
{
|
||||||
|
@ -372,7 +377,6 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
|
||||||
|
|
||||||
// The parent element is now "objectgroup"
|
// The parent element is now "objectgroup"
|
||||||
tmxMapInfo->setParentElement(TMXPropertyObjectGroup);
|
tmxMapInfo->setParentElement(TMXPropertyObjectGroup);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (elementName == "image")
|
else if (elementName == "image")
|
||||||
{
|
{
|
||||||
|
@ -416,7 +420,7 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
|
||||||
tmxMapInfo->setLayerAttribs(layerAttribs | TMXLayerAttribBase64);
|
tmxMapInfo->setLayerAttribs(layerAttribs | TMXLayerAttribBase64);
|
||||||
tmxMapInfo->setStoringCharacters(true);
|
tmxMapInfo->setStoringCharacters(true);
|
||||||
|
|
||||||
if( compression == "gzip" )
|
if (compression == "gzip")
|
||||||
{
|
{
|
||||||
layerAttribs = tmxMapInfo->getLayerAttribs();
|
layerAttribs = tmxMapInfo->getLayerAttribs();
|
||||||
tmxMapInfo->setLayerAttribs(layerAttribs | TMXLayerAttribGzip);
|
tmxMapInfo->setLayerAttribs(layerAttribs | TMXLayerAttribGzip);
|
||||||
|
@ -428,7 +432,6 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
|
||||||
}
|
}
|
||||||
CCASSERT( compression == "" || compression == "gzip" || compression == "zlib", "TMX: unsupported compression method" );
|
CCASSERT( compression == "" || compression == "gzip" || compression == "zlib", "TMX: unsupported compression method" );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (elementName == "object")
|
else if (elementName == "object")
|
||||||
{
|
{
|
||||||
|
@ -438,11 +441,10 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
|
||||||
// Create an instance of TMXObjectInfo to store the object and its properties
|
// Create an instance of TMXObjectInfo to store the object and its properties
|
||||||
ValueMap dict;
|
ValueMap dict;
|
||||||
// Parse everything automatically
|
// Parse everything automatically
|
||||||
const char* array[] = {"name", "type", "width", "height", "gid"};
|
const char* keys[] = {"name", "type", "width", "height", "gid"};
|
||||||
|
|
||||||
for(size_t i = 0; i < sizeof(array)/sizeof(array[0]); ++i )
|
for (const auto& key : keys)
|
||||||
{
|
{
|
||||||
const char* key = array[i];
|
|
||||||
Value value = attributeDict[key];
|
Value value = attributeDict[key];
|
||||||
dict[key] = value;
|
dict[key] = value;
|
||||||
}
|
}
|
||||||
|
@ -468,9 +470,8 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
|
||||||
// Add the object to the objectGroup
|
// Add the object to the objectGroup
|
||||||
objectGroup->getObjects().push_back(Value(dict));
|
objectGroup->getObjects().push_back(Value(dict));
|
||||||
|
|
||||||
// The parent element is now "object"
|
// The parent element is now "object"
|
||||||
tmxMapInfo->setParentElement(TMXPropertyObject);
|
tmxMapInfo->setParentElement(TMXPropertyObject);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (elementName == "property")
|
else if (elementName == "property")
|
||||||
{
|
{
|
||||||
|
@ -536,23 +537,23 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
|
||||||
// parse points string into a space-separated set of points
|
// parse points string into a space-separated set of points
|
||||||
stringstream pointsStream(value);
|
stringstream pointsStream(value);
|
||||||
string pointPair;
|
string pointPair;
|
||||||
while(std::getline(pointsStream, pointPair, ' '))
|
while (std::getline(pointsStream, pointPair, ' '))
|
||||||
{
|
{
|
||||||
// parse each point combo into a comma-separated x,y point
|
// parse each point combo into a comma-separated x,y point
|
||||||
stringstream pointStream(pointPair);
|
stringstream pointStream(pointPair);
|
||||||
string xStr,yStr;
|
string xStr, yStr;
|
||||||
|
|
||||||
ValueMap pointDict;
|
ValueMap pointDict;
|
||||||
|
|
||||||
// set x
|
// set x
|
||||||
if(std::getline(pointStream, xStr, ','))
|
if (std::getline(pointStream, xStr, ','))
|
||||||
{
|
{
|
||||||
int x = atoi(xStr.c_str()) + (int)objectGroup->getPositionOffset().x;
|
int x = atoi(xStr.c_str()) + (int)objectGroup->getPositionOffset().x;
|
||||||
pointDict["x"] = Value(x);
|
pointDict["x"] = Value(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
// set y
|
// set y
|
||||||
if(std::getline(pointStream, yStr, ','))
|
if (std::getline(pointStream, yStr, ','))
|
||||||
{
|
{
|
||||||
int y = atoi(yStr.c_str()) + (int)objectGroup->getPositionOffset().y;
|
int y = atoi(yStr.c_str()) + (int)objectGroup->getPositionOffset().y;
|
||||||
pointDict["y"] = Value(y);
|
pointDict["y"] = Value(y);
|
||||||
|
@ -581,23 +582,23 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
|
||||||
// parse points string into a space-separated set of points
|
// parse points string into a space-separated set of points
|
||||||
stringstream pointsStream(value);
|
stringstream pointsStream(value);
|
||||||
string pointPair;
|
string pointPair;
|
||||||
while(std::getline(pointsStream, pointPair, ' '))
|
while (std::getline(pointsStream, pointPair, ' '))
|
||||||
{
|
{
|
||||||
// parse each point combo into a comma-separated x,y point
|
// parse each point combo into a comma-separated x,y point
|
||||||
stringstream pointStream(pointPair);
|
stringstream pointStream(pointPair);
|
||||||
string xStr,yStr;
|
string xStr, yStr;
|
||||||
|
|
||||||
ValueMap pointDict;
|
ValueMap pointDict;
|
||||||
|
|
||||||
// set x
|
// set x
|
||||||
if(std::getline(pointStream, xStr, ','))
|
if (std::getline(pointStream, xStr, ','))
|
||||||
{
|
{
|
||||||
int x = atoi(xStr.c_str()) + (int)objectGroup->getPositionOffset().x;
|
int x = atoi(xStr.c_str()) + (int)objectGroup->getPositionOffset().x;
|
||||||
pointDict["x"] = Value(x);
|
pointDict["x"] = Value(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
// set y
|
// set y
|
||||||
if(std::getline(pointStream, yStr, ','))
|
if (std::getline(pointStream, yStr, ','))
|
||||||
{
|
{
|
||||||
int y = atoi(yStr.c_str()) + (int)objectGroup->getPositionOffset().y;
|
int y = atoi(yStr.c_str()) + (int)objectGroup->getPositionOffset().y;
|
||||||
pointDict["y"] = Value(y);
|
pointDict["y"] = Value(y);
|
||||||
|
@ -616,11 +617,9 @@ void TMXMapInfo::endElement(void *ctx, const char *name)
|
||||||
{
|
{
|
||||||
CC_UNUSED_PARAM(ctx);
|
CC_UNUSED_PARAM(ctx);
|
||||||
TMXMapInfo *tmxMapInfo = this;
|
TMXMapInfo *tmxMapInfo = this;
|
||||||
std::string elementName = (char*)name;
|
std::string elementName = name;
|
||||||
|
|
||||||
int len = 0;
|
if (elementName == "data")
|
||||||
|
|
||||||
if(elementName == "data")
|
|
||||||
{
|
{
|
||||||
if (tmxMapInfo->getLayerAttribs() & TMXLayerAttribBase64)
|
if (tmxMapInfo->getLayerAttribs() & TMXLayerAttribBase64)
|
||||||
{
|
{
|
||||||
|
@ -630,14 +629,14 @@ void TMXMapInfo::endElement(void *ctx, const char *name)
|
||||||
|
|
||||||
std::string currentString = tmxMapInfo->getCurrentString();
|
std::string currentString = tmxMapInfo->getCurrentString();
|
||||||
unsigned char *buffer;
|
unsigned char *buffer;
|
||||||
len = base64Decode((unsigned char*)currentString.c_str(), (unsigned int)currentString.length(), &buffer);
|
auto len = base64Decode((unsigned char*)currentString.c_str(), (unsigned int)currentString.length(), &buffer);
|
||||||
if( ! buffer )
|
if (!buffer)
|
||||||
{
|
{
|
||||||
CCLOG("cocos2d: TiledMap: decode data error");
|
CCLOG("cocos2d: TiledMap: decode data error");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( tmxMapInfo->getLayerAttribs() & (TMXLayerAttribGzip | TMXLayerAttribZlib) )
|
if (tmxMapInfo->getLayerAttribs() & (TMXLayerAttribGzip | TMXLayerAttribZlib))
|
||||||
{
|
{
|
||||||
unsigned char *deflated = nullptr;
|
unsigned char *deflated = nullptr;
|
||||||
Size s = layer->_layerSize;
|
Size s = layer->_layerSize;
|
||||||
|
@ -650,7 +649,7 @@ void TMXMapInfo::endElement(void *ctx, const char *name)
|
||||||
free(buffer);
|
free(buffer);
|
||||||
buffer = nullptr;
|
buffer = nullptr;
|
||||||
|
|
||||||
if( ! deflated )
|
if (!deflated)
|
||||||
{
|
{
|
||||||
CCLOG("cocos2d: TiledMap: inflate data error");
|
CCLOG("cocos2d: TiledMap: inflate data error");
|
||||||
return;
|
return;
|
||||||
|
@ -669,7 +668,6 @@ void TMXMapInfo::endElement(void *ctx, const char *name)
|
||||||
{
|
{
|
||||||
_xmlTileIndex = 0;
|
_xmlTileIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (elementName == "map")
|
else if (elementName == "map")
|
||||||
{
|
{
|
||||||
|
@ -701,7 +699,7 @@ void TMXMapInfo::textHandler(void *ctx, const char *ch, int len)
|
||||||
{
|
{
|
||||||
CC_UNUSED_PARAM(ctx);
|
CC_UNUSED_PARAM(ctx);
|
||||||
TMXMapInfo *tmxMapInfo = this;
|
TMXMapInfo *tmxMapInfo = this;
|
||||||
std::string text((char*)ch,0,len);
|
std::string text(ch, 0, len);
|
||||||
|
|
||||||
if (tmxMapInfo->isStoringCharacters())
|
if (tmxMapInfo->isStoringCharacters())
|
||||||
{
|
{
|
||||||
|
|
|
@ -108,10 +108,13 @@ class CC_DLL TextFieldTTF : public Label, public IMEDelegate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
* Default constructor.
|
||||||
* @js ctor
|
* @js ctor
|
||||||
*/
|
*/
|
||||||
TextFieldTTF();
|
TextFieldTTF();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Default destructor.
|
||||||
* @js NA
|
* @js NA
|
||||||
* @lua NA
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -102,6 +102,8 @@ public:
|
||||||
*/
|
*/
|
||||||
void hideOutShowIn(void);
|
void hideOutShowIn(void);
|
||||||
|
|
||||||
|
Scene* getInScene() const{ return _inScene; }
|
||||||
|
float getDuration() const { return _duration; }
|
||||||
//
|
//
|
||||||
// Overrides
|
// Overrides
|
||||||
//
|
//
|
||||||
|
|
|
@ -44,11 +44,13 @@ class CC_DLL AABB
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
* @lua new
|
||||||
*/
|
*/
|
||||||
AABB();
|
AABB();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
* @lua new
|
||||||
*/
|
*/
|
||||||
AABB(const Vec3& min, const Vec3& max);
|
AABB(const Vec3& min, const Vec3& max);
|
||||||
|
|
||||||
|
@ -122,7 +124,7 @@ public:
|
||||||
Vec3 _max;
|
Vec3 _max;
|
||||||
};
|
};
|
||||||
|
|
||||||
// end of actions group
|
// end of 3d group
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include "3d/CCSprite3D.h"
|
#include "3d/CCSprite3D.h"
|
||||||
#include "3d/CCSkeleton3D.h"
|
#include "3d/CCSkeleton3D.h"
|
||||||
#include "platform/CCFileUtils.h"
|
#include "platform/CCFileUtils.h"
|
||||||
|
#include "base/CCConfiguration.h"
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
|
@ -68,6 +69,7 @@ bool Animate3D::init(Animation3D* animation)
|
||||||
animation->retain();
|
animation->retain();
|
||||||
setDuration(animation->getDuration());
|
setDuration(animation->getDuration());
|
||||||
setOriginInterval(animation->getDuration());
|
setOriginInterval(animation->getDuration());
|
||||||
|
setHighQuality(Configuration::getInstance()->isHighAnimate3DQuality());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,6 +85,7 @@ bool Animate3D::init(Animation3D* animation, float fromTime, float duration)
|
||||||
setOriginInterval(duration);
|
setOriginInterval(duration);
|
||||||
_animation = animation;
|
_animation = animation;
|
||||||
animation->retain();
|
animation->retain();
|
||||||
|
setHighQuality(Configuration::getInstance()->isHighAnimate3DQuality());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -310,28 +313,26 @@ void Animate3D::update(float t)
|
||||||
t = 1 - t;
|
t = 1 - t;
|
||||||
|
|
||||||
t = _start + t * _last;
|
t = _start + t * _last;
|
||||||
for (const auto& it : _boneCurves)
|
|
||||||
{
|
for (const auto& it : _boneCurves) {
|
||||||
for (const auto& it : _boneCurves) {
|
auto bone = it.first;
|
||||||
auto bone = it.first;
|
auto curve = it.second;
|
||||||
auto curve = it.second;
|
if (curve->translateCurve)
|
||||||
if (curve->translateCurve)
|
{
|
||||||
{
|
curve->translateCurve->evaluate(t, transDst, _translateEvaluate);
|
||||||
curve->translateCurve->evaluate(t, transDst, EvaluateType::INT_LINEAR);
|
trans = &transDst[0];
|
||||||
trans = &transDst[0];
|
|
||||||
}
|
|
||||||
if (curve->rotCurve)
|
|
||||||
{
|
|
||||||
curve->rotCurve->evaluate(t, rotDst, EvaluateType::INT_QUAT_SLERP);
|
|
||||||
rot = &rotDst[0];
|
|
||||||
}
|
|
||||||
if (curve->scaleCurve)
|
|
||||||
{
|
|
||||||
curve->scaleCurve->evaluate(t, scaleDst, EvaluateType::INT_LINEAR);
|
|
||||||
scale = &scaleDst[0];
|
|
||||||
}
|
|
||||||
bone->setAnimationValue(trans, rot, scale, this, _weight);
|
|
||||||
}
|
}
|
||||||
|
if (curve->rotCurve)
|
||||||
|
{
|
||||||
|
curve->rotCurve->evaluate(t, rotDst, _roteEvaluate);
|
||||||
|
rot = &rotDst[0];
|
||||||
|
}
|
||||||
|
if (curve->scaleCurve)
|
||||||
|
{
|
||||||
|
curve->scaleCurve->evaluate(t, scaleDst, _scaleEvaluate);
|
||||||
|
scale = &scaleDst[0];
|
||||||
|
}
|
||||||
|
bone->setAnimationValue(trans, rot, scale, this, _weight);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& it : _nodeCurves)
|
for (const auto& it : _nodeCurves)
|
||||||
|
@ -341,18 +342,18 @@ void Animate3D::update(float t)
|
||||||
Mat4 transform;
|
Mat4 transform;
|
||||||
if (curve->translateCurve)
|
if (curve->translateCurve)
|
||||||
{
|
{
|
||||||
curve->translateCurve->evaluate(t, transDst, EvaluateType::INT_LINEAR);
|
curve->translateCurve->evaluate(t, transDst, _translateEvaluate);
|
||||||
transform.translate(transDst[0], transDst[1], transDst[2]);
|
transform.translate(transDst[0], transDst[1], transDst[2]);
|
||||||
}
|
}
|
||||||
if (curve->rotCurve)
|
if (curve->rotCurve)
|
||||||
{
|
{
|
||||||
curve->rotCurve->evaluate(t, rotDst, EvaluateType::INT_QUAT_SLERP);
|
curve->rotCurve->evaluate(t, rotDst, _roteEvaluate);
|
||||||
Quaternion qua(rotDst[0], rotDst[1], rotDst[2], rotDst[3]);
|
Quaternion qua(rotDst[0], rotDst[1], rotDst[2], rotDst[3]);
|
||||||
transform.rotate(qua);
|
transform.rotate(qua);
|
||||||
}
|
}
|
||||||
if (curve->scaleCurve)
|
if (curve->scaleCurve)
|
||||||
{
|
{
|
||||||
curve->scaleCurve->evaluate(t, scaleDst, EvaluateType::INT_LINEAR);
|
curve->scaleCurve->evaluate(t, scaleDst, _scaleEvaluate);
|
||||||
transform.scale(scaleDst[0], scaleDst[1], scaleDst[2]);
|
transform.scale(scaleDst[0], scaleDst[1], scaleDst[2]);
|
||||||
}
|
}
|
||||||
node->setAdditionalTransform(&transform);
|
node->setAdditionalTransform(&transform);
|
||||||
|
@ -383,6 +384,28 @@ void Animate3D::setOriginInterval(float interval)
|
||||||
_originInterval = interval;
|
_originInterval = interval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Animate3D::setHighQuality(bool isHighQuality)
|
||||||
|
{
|
||||||
|
if (isHighQuality)
|
||||||
|
{
|
||||||
|
_translateEvaluate = EvaluateType::INT_LINEAR;
|
||||||
|
_roteEvaluate = EvaluateType::INT_QUAT_SLERP;
|
||||||
|
_scaleEvaluate = EvaluateType::INT_LINEAR;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_translateEvaluate = EvaluateType::INT_NEAR;
|
||||||
|
_roteEvaluate = EvaluateType::INT_NEAR;
|
||||||
|
_scaleEvaluate = EvaluateType::INT_NEAR;
|
||||||
|
}
|
||||||
|
_isHighQuality = isHighQuality;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Animate3D::isHighQuality() const
|
||||||
|
{
|
||||||
|
return _isHighQuality;
|
||||||
|
}
|
||||||
|
|
||||||
Animate3D::Animate3D()
|
Animate3D::Animate3D()
|
||||||
: _state(Animate3D::Animate3DState::Running)
|
: _state(Animate3D::Animate3DState::Running)
|
||||||
, _animation(nullptr)
|
, _animation(nullptr)
|
||||||
|
@ -395,7 +418,7 @@ Animate3D::Animate3D()
|
||||||
, _lastTime(0.0f)
|
, _lastTime(0.0f)
|
||||||
, _originInterval(0.0f)
|
, _originInterval(0.0f)
|
||||||
{
|
{
|
||||||
|
setHighQuality(true);
|
||||||
}
|
}
|
||||||
Animate3D::~Animate3D()
|
Animate3D::~Animate3D()
|
||||||
{
|
{
|
||||||
|
@ -410,12 +433,9 @@ void Animate3D::removeFromMap()
|
||||||
if (_target)
|
if (_target)
|
||||||
{
|
{
|
||||||
Sprite3D* sprite = static_cast<Sprite3D*>(_target);
|
Sprite3D* sprite = static_cast<Sprite3D*>(_target);
|
||||||
if (_state == Animate3D::Animate3DState::FadeIn)
|
s_fadeInAnimates.erase(sprite);
|
||||||
s_fadeInAnimates.erase(sprite);
|
s_fadeOutAnimates.erase(sprite);
|
||||||
else if (_state == Animate3D::Animate3DState::FadeOut)
|
s_runningAnimates.erase(sprite);
|
||||||
s_fadeOutAnimates.erase(sprite);
|
|
||||||
else
|
|
||||||
s_runningAnimates.erase(sprite);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -105,6 +105,17 @@ public:
|
||||||
CC_DEPRECATED_ATTRIBUTE bool getPlayBack() const { return _playReverse; }
|
CC_DEPRECATED_ATTRIBUTE bool getPlayBack() const { return _playReverse; }
|
||||||
CC_DEPRECATED_ATTRIBUTE void setPlayBack(bool reverse) { _playReverse = reverse; }
|
CC_DEPRECATED_ATTRIBUTE void setPlayBack(bool reverse) { _playReverse = reverse; }
|
||||||
|
|
||||||
|
/**set high quality
|
||||||
|
* The default value is based on Configuration::isHighAnimate3DQuality(). You can configure it in the config.plist. However, you can modify it using the following function
|
||||||
|
* @param true: is high quality, false: is low quality.
|
||||||
|
*/
|
||||||
|
void setHighQuality(bool isHighQuality);
|
||||||
|
|
||||||
|
/**get high quality
|
||||||
|
* is it high quality
|
||||||
|
*/
|
||||||
|
bool isHighQuality() const;
|
||||||
|
|
||||||
CC_CONSTRUCTOR_ACCESS:
|
CC_CONSTRUCTOR_ACCESS:
|
||||||
|
|
||||||
Animate3D();
|
Animate3D();
|
||||||
|
@ -137,6 +148,13 @@ protected:
|
||||||
float _accTransTime; // acculate transition time
|
float _accTransTime; // acculate transition time
|
||||||
float _lastTime; // last t (0 - 1)
|
float _lastTime; // last t (0 - 1)
|
||||||
float _originInterval;// save origin interval time
|
float _originInterval;// save origin interval time
|
||||||
|
|
||||||
|
// animation quality
|
||||||
|
EvaluateType _translateEvaluate;
|
||||||
|
EvaluateType _roteEvaluate;
|
||||||
|
EvaluateType _scaleEvaluate;
|
||||||
|
bool _isHighQuality; // true: is high quality, false: is low quality
|
||||||
|
|
||||||
std::unordered_map<Bone3D*, Animation3D::Curve*> _boneCurves; //weak ref
|
std::unordered_map<Bone3D*, Animation3D::Curve*> _boneCurves; //weak ref
|
||||||
std::unordered_map<Node*, Animation3D::Curve*> _nodeCurves;
|
std::unordered_map<Node*, Animation3D::Curve*> _nodeCurves;
|
||||||
|
|
||||||
|
@ -146,7 +164,7 @@ protected:
|
||||||
static std::unordered_map<Node*, Animate3D*> s_runningAnimates;
|
static std::unordered_map<Node*, Animate3D*> s_runningAnimates;
|
||||||
};
|
};
|
||||||
|
|
||||||
// end of actions group
|
// end of 3d group
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -54,25 +54,36 @@ public:
|
||||||
public:
|
public:
|
||||||
typedef AnimationCurve<3> AnimationCurveVec3;
|
typedef AnimationCurve<3> AnimationCurveVec3;
|
||||||
typedef AnimationCurve<4> AnimationCurveQuat;
|
typedef AnimationCurve<4> AnimationCurveQuat;
|
||||||
AnimationCurveVec3* translateCurve; //translate curve
|
/**translation curve*/
|
||||||
AnimationCurveQuat* rotCurve;//rotation curve
|
AnimationCurveVec3* translateCurve;
|
||||||
AnimationCurveVec3* scaleCurve;//scale curve
|
/**rotation curve*/
|
||||||
|
AnimationCurveQuat* rotCurve;
|
||||||
|
/**scaling curve*/
|
||||||
|
AnimationCurveVec3* scaleCurve;
|
||||||
|
/**constructor */
|
||||||
Curve();
|
Curve();
|
||||||
|
/**constructor */
|
||||||
~Curve();
|
~Curve();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**read all animation or only the animation with given animationName? animationName == "" read the first.*/
|
/**read all animation or only the animation with given animationName? animationName == "" read the first.*/
|
||||||
static Animation3D* create(const std::string& filename, const std::string& animationName = "");
|
static Animation3D* create(const std::string& filename, const std::string& animationName = "");
|
||||||
|
|
||||||
|
/**the cache method to create or get an Animation3D object*/
|
||||||
CC_DEPRECATED_ATTRIBUTE static Animation3D* getOrCreate(const std::string& filename, const std::string& animationName = ""){ return create(filename, animationName); }
|
CC_DEPRECATED_ATTRIBUTE static Animation3D* getOrCreate(const std::string& filename, const std::string& animationName = ""){ return create(filename, animationName); }
|
||||||
|
|
||||||
/**get duration*/
|
/**get duration*/
|
||||||
float getDuration() const { return _duration; }
|
float getDuration() const { return _duration; }
|
||||||
|
|
||||||
/**get bone curve*/
|
/**
|
||||||
|
* get bone curve
|
||||||
|
*
|
||||||
|
* @lua NA
|
||||||
|
*/
|
||||||
Curve* getBoneCurveByName(const std::string& name) const;
|
Curve* getBoneCurveByName(const std::string& name) const;
|
||||||
|
|
||||||
|
|
||||||
|
/**get the bone Curves set*/
|
||||||
const std::unordered_map<std::string, Curve*>& getBoneCurves() const {return _boneCurves;}
|
const std::unordered_map<std::string, Curve*>& getBoneCurves() const {return _boneCurves;}
|
||||||
|
|
||||||
CC_CONSTRUCTOR_ACCESS:
|
CC_CONSTRUCTOR_ACCESS:
|
||||||
|
@ -120,7 +131,7 @@ protected:
|
||||||
std::unordered_map<std::string, Animation3D*> _animations; //cached animations
|
std::unordered_map<std::string, Animation3D*> _animations; //cached animations
|
||||||
};
|
};
|
||||||
|
|
||||||
// end of actions group
|
// end of 3d group
|
||||||
/// @}
|
/// @}
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,8 @@ enum class EvaluateType
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief curve of bone's position, rotation or scale
|
* @brief curve of bone's position, rotation or scale
|
||||||
|
*
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
template <int componentSize>
|
template <int componentSize>
|
||||||
class AnimationCurve: public Ref
|
class AnimationCurve: public Ref
|
||||||
|
@ -100,7 +102,7 @@ protected:
|
||||||
std::function<void(float time, float* dst)> _evaluateFun; //user defined function
|
std::function<void(float time, float* dst)> _evaluateFun; //user defined function
|
||||||
};
|
};
|
||||||
|
|
||||||
// end of actions group
|
// end of 3d group
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -68,7 +68,7 @@ protected:
|
||||||
mutable Mat4 _transformToParent;
|
mutable Mat4 _transformToParent;
|
||||||
};
|
};
|
||||||
|
|
||||||
// end of actions group
|
// end of 3d group
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -45,7 +45,7 @@ public:
|
||||||
VIEW_POINT_ORIENTED, // orient to the camera
|
VIEW_POINT_ORIENTED, // orient to the camera
|
||||||
VIEW_PLANE_ORIENTED // orient to the XOY plane of camera
|
VIEW_PLANE_ORIENTED // orient to the XOY plane of camera
|
||||||
};
|
};
|
||||||
/// @{
|
|
||||||
/// @name Creators
|
/// @name Creators
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -96,7 +96,11 @@ public:
|
||||||
/** update billboard's transform and turn it towards camera */
|
/** update billboard's transform and turn it towards camera */
|
||||||
virtual void visit(Renderer *renderer, const Mat4& parentTransform, uint32_t parentFlags) override;
|
virtual void visit(Renderer *renderer, const Mat4& parentTransform, uint32_t parentFlags) override;
|
||||||
|
|
||||||
/** draw BillBoard object */
|
/**
|
||||||
|
* draw BillBoard object.
|
||||||
|
*
|
||||||
|
* @lua NA
|
||||||
|
*/
|
||||||
virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override;
|
virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override;
|
||||||
|
|
||||||
|
|
||||||
|
@ -122,7 +126,7 @@ private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// end of actions group
|
// end of 3d group
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -874,9 +874,11 @@ bool Bundle3D::loadMaterialsBinary(MaterialDatas& materialdatas)
|
||||||
{
|
{
|
||||||
NMaterialData materialData;
|
NMaterialData materialData;
|
||||||
materialData.id = _binaryReader.readString();
|
materialData.id = _binaryReader.readString();
|
||||||
|
|
||||||
|
// skip: diffuse(3), ambient(3), emissive(3), opacity(1), specular(3), shininess(1)
|
||||||
float data[14];
|
float data[14];
|
||||||
_binaryReader.read(&data,sizeof(float), 14);
|
_binaryReader.read(&data,sizeof(float), 14);
|
||||||
|
|
||||||
unsigned int textruenum = 1;
|
unsigned int textruenum = 1;
|
||||||
_binaryReader.read(&textruenum, 4, 1);
|
_binaryReader.read(&textruenum, 4, 1);
|
||||||
for(unsigned int j = 0; j < textruenum ; j++ )
|
for(unsigned int j = 0; j < textruenum ; j++ )
|
||||||
|
|
|
@ -45,6 +45,7 @@ class Data;
|
||||||
* c3t text file
|
* c3t text file
|
||||||
* c3b binary file
|
* c3b binary file
|
||||||
* @js NA
|
* @js NA
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
class CC_DLL Bundle3D
|
class CC_DLL Bundle3D
|
||||||
{
|
{
|
||||||
|
@ -181,7 +182,7 @@ protected:
|
||||||
bool _isBinary;
|
bool _isBinary;
|
||||||
};
|
};
|
||||||
|
|
||||||
// end of actions group
|
// end of 3d group
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -37,6 +37,7 @@ NS_CC_BEGIN
|
||||||
|
|
||||||
/**mesh vertex attribute
|
/**mesh vertex attribute
|
||||||
* @js NA
|
* @js NA
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
struct MeshVertexAttrib
|
struct MeshVertexAttrib
|
||||||
{
|
{
|
||||||
|
@ -53,6 +54,7 @@ struct MeshVertexAttrib
|
||||||
|
|
||||||
/** model node data, since 3.3
|
/** model node data, since 3.3
|
||||||
* @js NA
|
* @js NA
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
struct ModelData
|
struct ModelData
|
||||||
{
|
{
|
||||||
|
@ -74,6 +76,7 @@ struct ModelData
|
||||||
|
|
||||||
/** Node data, since 3.3
|
/** Node data, since 3.3
|
||||||
* @js NA
|
* @js NA
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
struct NodeData
|
struct NodeData
|
||||||
{
|
{
|
||||||
|
@ -107,6 +110,7 @@ struct NodeData
|
||||||
|
|
||||||
/** node datas, since 3.3
|
/** node datas, since 3.3
|
||||||
* @js NA
|
* @js NA
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
struct NodeDatas
|
struct NodeDatas
|
||||||
{
|
{
|
||||||
|
@ -130,6 +134,7 @@ struct NodeDatas
|
||||||
|
|
||||||
/**mesh data
|
/**mesh data
|
||||||
* @js NA
|
* @js NA
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
struct MeshData
|
struct MeshData
|
||||||
{
|
{
|
||||||
|
@ -185,6 +190,7 @@ public:
|
||||||
|
|
||||||
/** mesh datas
|
/** mesh datas
|
||||||
* @js NA
|
* @js NA
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
struct MeshDatas
|
struct MeshDatas
|
||||||
{
|
{
|
||||||
|
@ -206,6 +212,7 @@ struct MeshDatas
|
||||||
|
|
||||||
/**skin data
|
/**skin data
|
||||||
* @js NA
|
* @js NA
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
struct SkinData
|
struct SkinData
|
||||||
{
|
{
|
||||||
|
@ -277,6 +284,7 @@ struct SkinData
|
||||||
|
|
||||||
/**material data,
|
/**material data,
|
||||||
* @js NA
|
* @js NA
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
struct MaterialData
|
struct MaterialData
|
||||||
{
|
{
|
||||||
|
@ -290,6 +298,7 @@ struct MaterialData
|
||||||
|
|
||||||
/**new material, since 3.3
|
/**new material, since 3.3
|
||||||
* @js NA
|
* @js NA
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
struct NTextureData
|
struct NTextureData
|
||||||
{
|
{
|
||||||
|
@ -328,6 +337,7 @@ struct NMaterialData
|
||||||
};
|
};
|
||||||
/** material datas, since 3.3
|
/** material datas, since 3.3
|
||||||
* @js NA
|
* @js NA
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
struct MaterialDatas
|
struct MaterialDatas
|
||||||
{
|
{
|
||||||
|
@ -348,6 +358,7 @@ struct MaterialDatas
|
||||||
};
|
};
|
||||||
/**animation data
|
/**animation data
|
||||||
* @js NA
|
* @js NA
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
struct Animation3DData
|
struct Animation3DData
|
||||||
{
|
{
|
||||||
|
@ -420,6 +431,7 @@ public:
|
||||||
|
|
||||||
/**reference data
|
/**reference data
|
||||||
* @js NA
|
* @js NA
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
struct Reference
|
struct Reference
|
||||||
{
|
{
|
||||||
|
|
|
@ -42,6 +42,7 @@ NS_CC_BEGIN
|
||||||
/**
|
/**
|
||||||
* @brief BundleReader is an interface for reading sequence of bytes.
|
* @brief BundleReader is an interface for reading sequence of bytes.
|
||||||
* @js NA
|
* @js NA
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
class BundleReader: public cocos2d::Ref
|
class BundleReader: public cocos2d::Ref
|
||||||
{
|
{
|
||||||
|
@ -128,6 +129,8 @@ private:
|
||||||
char* _buffer;
|
char* _buffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// @cond
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* template read routines
|
* template read routines
|
||||||
*/
|
*/
|
||||||
|
@ -207,7 +210,9 @@ inline bool BundleReader::readArray<std::string>(unsigned int *length, std::vect
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// end of actions group
|
/// @endcond
|
||||||
|
|
||||||
|
// end of 3d group
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -39,6 +39,7 @@ class Camera;
|
||||||
* the frustum is a six-side geometry, usually use the frustum to do fast-culling:
|
* the frustum is a six-side geometry, usually use the frustum to do fast-culling:
|
||||||
* check a entity whether is a potential visible entity
|
* check a entity whether is a potential visible entity
|
||||||
* @js NA
|
* @js NA
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
class CC_DLL Frustum
|
class CC_DLL Frustum
|
||||||
{
|
{
|
||||||
|
|
|
@ -59,14 +59,28 @@ public:
|
||||||
/**create mesh with vertex attributes*/
|
/**create mesh with vertex attributes*/
|
||||||
CC_DEPRECATED_ATTRIBUTE static Mesh* create(const std::vector<float>& vertices, int perVertexSizeInFloat, const IndexArray& indices, int numIndex, const std::vector<MeshVertexAttrib>& attribs, int attribCount){ return create(vertices, perVertexSizeInFloat, indices, attribs); }
|
CC_DEPRECATED_ATTRIBUTE static Mesh* create(const std::vector<float>& vertices, int perVertexSizeInFloat, const IndexArray& indices, int numIndex, const std::vector<MeshVertexAttrib>& attribs, int attribCount){ return create(vertices, perVertexSizeInFloat, indices, attribs); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @lua NA
|
||||||
|
*/
|
||||||
static Mesh* create(const std::vector<float>& vertices, int perVertexSizeInFloat, const IndexArray& indices, const std::vector<MeshVertexAttrib>& attribs);
|
static Mesh* create(const std::vector<float>& vertices, int perVertexSizeInFloat, const IndexArray& indices, const std::vector<MeshVertexAttrib>& attribs);
|
||||||
|
|
||||||
/** create mesh */
|
/**
|
||||||
|
* create mesh
|
||||||
|
* @lua NA
|
||||||
|
*/
|
||||||
static Mesh* create(const std::string& name, MeshIndexData* indexData, MeshSkin* skin = nullptr);
|
static Mesh* create(const std::string& name, MeshIndexData* indexData, MeshSkin* skin = nullptr);
|
||||||
|
|
||||||
/**get vertex buffer*/
|
/**
|
||||||
|
* get vertex buffer
|
||||||
|
*
|
||||||
|
* @lua NA
|
||||||
|
*/
|
||||||
GLuint getVertexBuffer() const;
|
GLuint getVertexBuffer() const;
|
||||||
/**has vertex attribute?*/
|
/**
|
||||||
|
* has vertex attribute?
|
||||||
|
*
|
||||||
|
* @lua NA
|
||||||
|
*/
|
||||||
bool hasVertexAttrib(int attrib) const;
|
bool hasVertexAttrib(int attrib) const;
|
||||||
/**get mesh vertex attribute count*/
|
/**get mesh vertex attribute count*/
|
||||||
ssize_t getMeshVertexAttribCount() const;
|
ssize_t getMeshVertexAttribCount() const;
|
||||||
|
@ -84,13 +98,25 @@ public:
|
||||||
void setVisible(bool visible);
|
void setVisible(bool visible);
|
||||||
bool isVisible() const { return _visible; }
|
bool isVisible() const { return _visible; }
|
||||||
|
|
||||||
/**skin getter */
|
/**
|
||||||
|
* skin getter
|
||||||
|
*
|
||||||
|
* @lua NA
|
||||||
|
*/
|
||||||
MeshSkin* getSkin() const { return _skin; }
|
MeshSkin* getSkin() const { return _skin; }
|
||||||
|
|
||||||
/**mesh index data getter */
|
/**
|
||||||
|
* mesh index data getter
|
||||||
|
*
|
||||||
|
* @lua NA
|
||||||
|
*/
|
||||||
MeshIndexData* getMeshIndexData() const { return _meshIndexData; }
|
MeshIndexData* getMeshIndexData() const { return _meshIndexData; }
|
||||||
|
|
||||||
/**get GLProgramState*/
|
/**
|
||||||
|
* get GLProgramState
|
||||||
|
*
|
||||||
|
* @lua NA
|
||||||
|
*/
|
||||||
GLProgramState* getGLProgramState() const { return _glProgramState; }
|
GLProgramState* getGLProgramState() const { return _glProgramState; }
|
||||||
|
|
||||||
/**name getter */
|
/**name getter */
|
||||||
|
@ -99,13 +125,29 @@ public:
|
||||||
void setBlendFunc(const BlendFunc &blendFunc);
|
void setBlendFunc(const BlendFunc &blendFunc);
|
||||||
const BlendFunc &getBlendFunc() const;
|
const BlendFunc &getBlendFunc() const;
|
||||||
|
|
||||||
/** get primitive type*/
|
/**
|
||||||
|
* get primitive type
|
||||||
|
*
|
||||||
|
* @lua NA
|
||||||
|
*/
|
||||||
GLenum getPrimitiveType() const;
|
GLenum getPrimitiveType() const;
|
||||||
/**get index count*/
|
/**
|
||||||
|
* get index count
|
||||||
|
*
|
||||||
|
* @lua NA
|
||||||
|
*/
|
||||||
ssize_t getIndexCount() const;
|
ssize_t getIndexCount() const;
|
||||||
/**get index format*/
|
/**
|
||||||
|
* get index format
|
||||||
|
*
|
||||||
|
* @lua NA
|
||||||
|
*/
|
||||||
GLenum getIndexFormat() const;
|
GLenum getIndexFormat() const;
|
||||||
/**get index buffer*/
|
/**
|
||||||
|
* get index buffer
|
||||||
|
*
|
||||||
|
* @lua NA
|
||||||
|
*/
|
||||||
GLuint getIndexBuffer() const;
|
GLuint getIndexBuffer() const;
|
||||||
|
|
||||||
/**get AABB*/
|
/**get AABB*/
|
||||||
|
@ -163,7 +205,7 @@ protected:
|
||||||
std::function<void()> _visibleChanged;
|
std::function<void()> _visibleChanged;
|
||||||
};
|
};
|
||||||
|
|
||||||
// end of actions group
|
// end of 3d group
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,7 @@ class Skeleton3D;
|
||||||
* @brief MeshSkin, A class maintain a collection of bones that affect Mesh vertex.
|
* @brief MeshSkin, A class maintain a collection of bones that affect Mesh vertex.
|
||||||
* And it is responsible for computing matrix palletes that used by skin mesh rendering.
|
* And it is responsible for computing matrix palletes that used by skin mesh rendering.
|
||||||
* @js NA
|
* @js NA
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
class CC_DLL MeshSkin: public Ref
|
class CC_DLL MeshSkin: public Ref
|
||||||
{
|
{
|
||||||
|
@ -105,7 +106,7 @@ protected:
|
||||||
Vec4* _matrixPalette;
|
Vec4* _matrixPalette;
|
||||||
};
|
};
|
||||||
|
|
||||||
// end of actions group
|
// end of 3d group
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -52,6 +52,7 @@ class MeshVertexData;
|
||||||
* the MeshIndexData class.
|
* the MeshIndexData class.
|
||||||
* @brief the MeshIndexData contain all of the indices data which mesh need.
|
* @brief the MeshIndexData contain all of the indices data which mesh need.
|
||||||
* @js NA
|
* @js NA
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
class MeshIndexData : public Ref
|
class MeshIndexData : public Ref
|
||||||
{
|
{
|
||||||
|
@ -138,7 +139,7 @@ protected:
|
||||||
int _vertexCount; //vertex count
|
int _vertexCount; //vertex count
|
||||||
};
|
};
|
||||||
|
|
||||||
// end of actions group
|
// end of 3d group
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -46,11 +46,15 @@ public:
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Construct obb from oriented bounding box
|
* Construct obb from oriented bounding box
|
||||||
|
*
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
OBB(const AABB& aabb);
|
OBB(const AABB& aabb);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Construct obb from points
|
* Construct obb from points
|
||||||
|
*
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
OBB(const Vec3* verts, int num);
|
OBB(const Vec3* verts, int num);
|
||||||
|
|
||||||
|
@ -135,7 +139,7 @@ public:
|
||||||
Vec3 _extents; // obb length along each axis
|
Vec3 _extents; // obb length along each axis
|
||||||
};
|
};
|
||||||
|
|
||||||
// end of actions group
|
// end of 3d group
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -24,6 +24,7 @@ NS_CC_BEGIN
|
||||||
/**
|
/**
|
||||||
* @brief .obj file Loader
|
* @brief .obj file Loader
|
||||||
* @js NA
|
* @js NA
|
||||||
|
* @lua NA
|
||||||
**/
|
**/
|
||||||
class ObjLoader
|
class ObjLoader
|
||||||
{
|
{
|
||||||
|
@ -106,7 +107,7 @@ public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// end of actions group
|
// end of 3d group
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -40,6 +40,7 @@ enum class PointSide
|
||||||
/**
|
/**
|
||||||
* Defines plane
|
* Defines plane
|
||||||
* @js NA
|
* @js NA
|
||||||
|
* @lua NA
|
||||||
**/
|
**/
|
||||||
class CC_DLL Plane
|
class CC_DLL Plane
|
||||||
{
|
{
|
||||||
|
|
|
@ -46,11 +46,14 @@ class CC_DLL Ray
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @lua new
|
||||||
*/
|
*/
|
||||||
Ray();
|
Ray();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
Ray(const Ray& ray);
|
Ray(const Ray& ray);
|
||||||
|
|
||||||
|
@ -59,11 +62,13 @@ public:
|
||||||
*
|
*
|
||||||
* @param origin The ray's origin.
|
* @param origin The ray's origin.
|
||||||
* @param direction The ray's direction.
|
* @param direction The ray's direction.
|
||||||
|
* @lua new
|
||||||
*/
|
*/
|
||||||
Ray(const Vec3& origin, const Vec3& direction);
|
Ray(const Vec3& origin, const Vec3& direction);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor.
|
* Destructor.
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
~Ray();
|
~Ray();
|
||||||
|
|
||||||
|
@ -99,7 +104,7 @@ public:
|
||||||
Vec3 _direction; // The ray direction vector.
|
Vec3 _direction; // The ray direction vector.
|
||||||
};
|
};
|
||||||
|
|
||||||
// end of actions group
|
// end of 3d group
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -39,6 +39,7 @@ NS_CC_BEGIN
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Defines a basic hierachial structure of transformation spaces.
|
* @brief Defines a basic hierachial structure of transformation spaces.
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
class CC_DLL Bone3D : public Ref
|
class CC_DLL Bone3D : public Ref
|
||||||
{
|
{
|
||||||
|
@ -189,7 +190,9 @@ protected:
|
||||||
class CC_DLL Skeleton3D: public Ref
|
class CC_DLL Skeleton3D: public Ref
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* @lua NA
|
||||||
|
*/
|
||||||
static Skeleton3D* create(const std::vector<NodeData*>& skeletondata);
|
static Skeleton3D* create(const std::vector<NodeData*>& skeletondata);
|
||||||
|
|
||||||
/**get total bone count*/
|
/**get total bone count*/
|
||||||
|
@ -231,7 +234,7 @@ protected:
|
||||||
Vector<Bone3D*> _rootBones;
|
Vector<Bone3D*> _rootBones;
|
||||||
};
|
};
|
||||||
|
|
||||||
// end of actions group
|
// end of 3d group
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -22,6 +22,14 @@
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "base/ccMacros.h"
|
||||||
|
#include "base/CCConfiguration.h"
|
||||||
|
#include "base/CCDirector.h"
|
||||||
|
#include "renderer/ccGLStateCache.h"
|
||||||
|
#include "renderer/CCGLProgram.h"
|
||||||
|
#include "renderer/CCGLProgramCache.h"
|
||||||
|
#include "renderer/CCGLProgramState.h"
|
||||||
|
#include "renderer/CCRenderer.h"
|
||||||
#include "3d/CCSkybox.h"
|
#include "3d/CCSkybox.h"
|
||||||
#include "3d/CCTextureCube.h"
|
#include "3d/CCTextureCube.h"
|
||||||
|
|
||||||
|
@ -53,6 +61,17 @@ Skybox::~Skybox()
|
||||||
_texture->release();
|
_texture->release();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Skybox* Skybox::create(const std::string& positive_x, const std::string& negative_x,
|
||||||
|
const std::string& positive_y, const std::string& negative_y,
|
||||||
|
const std::string& positive_z, const std::string& negative_z)
|
||||||
|
{
|
||||||
|
auto ret = new (std::nothrow) Skybox();
|
||||||
|
ret->init(positive_x, negative_x, positive_y, negative_y, positive_z, negative_z);
|
||||||
|
|
||||||
|
ret->autorelease();
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
bool Skybox::init()
|
bool Skybox::init()
|
||||||
{
|
{
|
||||||
// create and set our custom shader
|
// create and set our custom shader
|
||||||
|
@ -68,6 +87,19 @@ bool Skybox::init()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Skybox::init(const std::string& positive_x, const std::string& negative_x,
|
||||||
|
const std::string& positive_y, const std::string& negative_y,
|
||||||
|
const std::string& positive_z, const std::string& negative_z)
|
||||||
|
{
|
||||||
|
auto texture = TextureCube::create(positive_x, negative_x, positive_y, negative_y, positive_z, negative_z);
|
||||||
|
if (texture == nullptr)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
init();
|
||||||
|
setTexture(texture);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void Skybox::initBuffers()
|
void Skybox::initBuffers()
|
||||||
{
|
{
|
||||||
if (Configuration::getInstance()->supportsShareableVAO())
|
if (Configuration::getInstance()->supportsShareableVAO())
|
||||||
|
|
|
@ -25,10 +25,18 @@
|
||||||
#ifndef __SKYBOX_H__
|
#ifndef __SKYBOX_H__
|
||||||
#define __SKYBOX_H__
|
#define __SKYBOX_H__
|
||||||
|
|
||||||
#include "cocos2d.h"
|
#include "base/ccTypes.h"
|
||||||
|
#include "platform/CCPlatformMacros.h"
|
||||||
|
#include "renderer/CCCustomCommand.h"
|
||||||
|
#include "2d/CCNode.h"
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @addtogroup _3d
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
class TextureCube;
|
class TextureCube;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -38,6 +46,19 @@ class CC_DLL Skybox : public Node
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CREATE_FUNC(Skybox);
|
CREATE_FUNC(Skybox);
|
||||||
|
|
||||||
|
/** create skybox from 6 textures.
|
||||||
|
@param positive_x texture for the right side of the texture cube face.
|
||||||
|
@param negative_x texture for the up side of the texture cube face.
|
||||||
|
@param positive_y texture for the top side of the texture cube face
|
||||||
|
@param negative_y texture for the bottom side of the texture cube face
|
||||||
|
@param positive_z texture for the forward side of the texture cube face.
|
||||||
|
@param negative_z texture for the rear side of the texture cube face.
|
||||||
|
@return A new skybox inited with given parameters.
|
||||||
|
*/
|
||||||
|
static Skybox* create(const std::string& positive_x, const std::string& negative_x,
|
||||||
|
const std::string& positive_y, const std::string& negative_y,
|
||||||
|
const std::string& positive_z, const std::string& negative_z);
|
||||||
|
|
||||||
/**texture getter and setter*/
|
/**texture getter and setter*/
|
||||||
void setTexture(TextureCube*);
|
void setTexture(TextureCube*);
|
||||||
|
@ -63,6 +84,13 @@ CC_CONSTRUCTOR_ACCESS:
|
||||||
* init Skybox.
|
* init Skybox.
|
||||||
*/
|
*/
|
||||||
virtual bool init();
|
virtual bool init();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* initialize with texture path
|
||||||
|
*/
|
||||||
|
bool init(const std::string& positive_x, const std::string& negative_x,
|
||||||
|
const std::string& positive_y, const std::string& negative_y,
|
||||||
|
const std::string& positive_z, const std::string& negative_z);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -84,6 +112,9 @@ private:
|
||||||
CC_DISALLOW_COPY_AND_ASSIGN(Skybox);
|
CC_DISALLOW_COPY_AND_ASSIGN(Skybox);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// end of 3d group
|
||||||
|
/// @}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
||||||
#endif // __SKYBOX_H__
|
#endif // __SKYBOX_H__
|
||||||
|
|
|
@ -244,6 +244,7 @@ Sprite3D::Sprite3D()
|
||||||
, _aabbDirty(true)
|
, _aabbDirty(true)
|
||||||
, _lightMask(-1)
|
, _lightMask(-1)
|
||||||
, _shaderUsingLight(false)
|
, _shaderUsingLight(false)
|
||||||
|
, _forceDepthWrite(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,11 @@ public:
|
||||||
/**get Mesh by Name, it returns the first one if there are more than one mesh with the same name */
|
/**get Mesh by Name, it returns the first one if there are more than one mesh with the same name */
|
||||||
Mesh* getMeshByName(const std::string& name) const;
|
Mesh* getMeshByName(const std::string& name) const;
|
||||||
|
|
||||||
/** get mesh array by name, returns all meshes with the given name */
|
/**
|
||||||
|
* get mesh array by name, returns all meshes with the given name
|
||||||
|
*
|
||||||
|
* @lua NA
|
||||||
|
*/
|
||||||
std::vector<Mesh*> getMeshArrayByName(const std::string& name) const;
|
std::vector<Mesh*> getMeshArrayByName(const std::string& name) const;
|
||||||
|
|
||||||
/**get mesh*/
|
/**get mesh*/
|
||||||
|
@ -266,10 +270,18 @@ public:
|
||||||
static Sprite3DCache* getInstance();
|
static Sprite3DCache* getInstance();
|
||||||
static void destroyInstance();
|
static void destroyInstance();
|
||||||
|
|
||||||
/**get the SpriteData struct*/
|
/**
|
||||||
|
* get the SpriteData struct
|
||||||
|
*
|
||||||
|
* @lua NA
|
||||||
|
*/
|
||||||
Sprite3DData* getSpriteData(const std::string& key) const;
|
Sprite3DData* getSpriteData(const std::string& key) const;
|
||||||
|
|
||||||
/**add the SpriteData into Sprite3D by given the specified key*/
|
/**
|
||||||
|
* add the SpriteData into Sprite3D by given the specified key
|
||||||
|
*
|
||||||
|
* @lua NA
|
||||||
|
*/
|
||||||
bool addSprite3DData(const std::string& key, Sprite3DData* spritedata);
|
bool addSprite3DData(const std::string& key, Sprite3DData* spritedata);
|
||||||
|
|
||||||
/**remove the SpriteData from Sprite3D by given the specified key*/
|
/**remove the SpriteData from Sprite3D by given the specified key*/
|
||||||
|
@ -289,9 +301,11 @@ protected:
|
||||||
std::unordered_map<std::string, Sprite3DData*> _spriteDatas; //cached sprite datas
|
std::unordered_map<std::string, Sprite3DData*> _spriteDatas; //cached sprite datas
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// @cond
|
||||||
extern std::string CC_DLL s_attributeNames[];//attribute names array
|
extern std::string CC_DLL s_attributeNames[];//attribute names array
|
||||||
|
/// @endcond
|
||||||
|
|
||||||
// end of actions group
|
// end of 3d group
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -41,12 +41,15 @@ class Texture2D;
|
||||||
/**
|
/**
|
||||||
* @brief the sprite3D material is only texture for now
|
* @brief the sprite3D material is only texture for now
|
||||||
* @js NA
|
* @js NA
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
class Sprite3DMaterialCache
|
class Sprite3DMaterialCache
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**get & destroy cache*/
|
/**get & destroy cache*/
|
||||||
static Sprite3DMaterialCache* getInstance();
|
static Sprite3DMaterialCache* getInstance();
|
||||||
|
|
||||||
|
/**destroy the instance*/
|
||||||
static void destroyInstance();
|
static void destroyInstance();
|
||||||
|
|
||||||
/**add to cache*/
|
/**add to cache*/
|
||||||
|
@ -71,7 +74,7 @@ protected:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// end of actions group
|
// end of 3d group
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -26,6 +26,8 @@
|
||||||
#include "platform/CCImage.h"
|
#include "platform/CCImage.h"
|
||||||
#include "platform/CCFileUtils.h"
|
#include "platform/CCFileUtils.h"
|
||||||
|
|
||||||
|
#include "renderer/ccGLStateCache.h"
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
unsigned char* getImageData(Image* img, Texture2D::PixelFormat& ePixFmt)
|
unsigned char* getImageData(Image* img, Texture2D::PixelFormat& ePixFmt)
|
||||||
|
@ -189,7 +191,8 @@ bool TextureCube::init(const std::string& positive_x, const std::string& negativ
|
||||||
|
|
||||||
GLuint handle;
|
GLuint handle;
|
||||||
glGenTextures(1, &handle);
|
glGenTextures(1, &handle);
|
||||||
glBindTexture(GL_TEXTURE_CUBE_MAP, handle);
|
|
||||||
|
GL::bindTextureN(0, handle, GL_TEXTURE_CUBE_MAP);
|
||||||
|
|
||||||
for (int i = 0; i < 6; i++)
|
for (int i = 0; i < 6; i++)
|
||||||
{
|
{
|
||||||
|
@ -231,7 +234,7 @@ bool TextureCube::init(const std::string& positive_x, const std::string& negativ
|
||||||
|
|
||||||
_name = handle;
|
_name = handle;
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_CUBE_MAP, 0);
|
GL::bindTextureN(0, 0, GL_TEXTURE_CUBE_MAP);
|
||||||
|
|
||||||
for (auto img: images)
|
for (auto img: images)
|
||||||
{
|
{
|
||||||
|
@ -245,14 +248,14 @@ void TextureCube::setTexParameters(const TexParams& texParams)
|
||||||
{
|
{
|
||||||
CCASSERT(_name != 0, __FUNCTION__);
|
CCASSERT(_name != 0, __FUNCTION__);
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_CUBE_MAP, _name);
|
GL::bindTextureN(0, _name, GL_TEXTURE_CUBE_MAP);
|
||||||
|
|
||||||
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, texParams.wrapS);
|
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, texParams.minFilter);
|
||||||
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, texParams.wrapS);
|
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, texParams.magFilter);
|
||||||
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, texParams.wrapS);
|
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, texParams.wrapS);
|
||||||
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, texParams.wrapT);
|
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, texParams.wrapT);
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_CUBE_MAP, 0);
|
GL::bindTextureN(0, 0, GL_TEXTURE_CUBE_MAP);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TextureCube::reloadTexture()
|
bool TextureCube::reloadTexture()
|
||||||
|
|
|
@ -33,6 +33,11 @@
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @addtogroup _3d
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
TextureCube is a collection of six separate square textures that are put
|
TextureCube is a collection of six separate square textures that are put
|
||||||
onto the faces of an imaginary cube.
|
onto the faces of an imaginary cube.
|
||||||
|
@ -79,6 +84,9 @@ private:
|
||||||
std::vector<std::string> _imgPath;
|
std::vector<std::string> _imgPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// end of 3d group
|
||||||
|
/// @}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
||||||
#endif // __CCTEXTURECUBE_H__
|
#endif // __CCTEXTURECUBE_H__
|
||||||
|
|
|
@ -99,8 +99,10 @@ void AudioCache::readDataTask()
|
||||||
AudioBufferList theDataBuffer;
|
AudioBufferList theDataBuffer;
|
||||||
ExtAudioFileRef extRef = nullptr;
|
ExtAudioFileRef extRef = nullptr;
|
||||||
|
|
||||||
auto fileURL = (CFURLRef)[[NSURL fileURLWithPath:[NSString stringWithCString:_fileFullPath.c_str() encoding:[NSString defaultCStringEncoding]]] retain];
|
NSString *fileFullPath = [[NSString alloc] initWithCString:_fileFullPath.c_str() encoding:[NSString defaultCStringEncoding]];
|
||||||
|
auto fileURL = (CFURLRef)[[NSURL alloc] initFileURLWithPath:fileFullPath];
|
||||||
|
[fileFullPath release];
|
||||||
|
|
||||||
auto error = ExtAudioFileOpenURL(fileURL, &extRef);
|
auto error = ExtAudioFileOpenURL(fileURL, &extRef);
|
||||||
if(error) {
|
if(error) {
|
||||||
printf("%s: ExtAudioFileOpenURL FAILED, Error = %ld\n", __PRETTY_FUNCTION__, (long)error);
|
printf("%s: ExtAudioFileOpenURL FAILED, Error = %ld\n", __PRETTY_FUNCTION__, (long)error);
|
||||||
|
|
|
@ -64,7 +64,12 @@ public:
|
||||||
|
|
||||||
/* Minimum delay in between sounds */
|
/* Minimum delay in between sounds */
|
||||||
double minDelay;
|
double minDelay;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defautl constructor
|
||||||
|
*
|
||||||
|
* @lua new
|
||||||
|
*/
|
||||||
AudioProfile()
|
AudioProfile()
|
||||||
: maxInstances(0)
|
: maxInstances(0)
|
||||||
, minDelay(0.0)
|
, minDelay(0.0)
|
||||||
|
|
|
@ -73,6 +73,7 @@ public:
|
||||||
* Release the shared Engine object.
|
* Release the shared Engine object.
|
||||||
*
|
*
|
||||||
* @warning It must be called before the application exit, or it will lead to memory leaks.
|
* @warning It must be called before the application exit, or it will lead to memory leaks.
|
||||||
|
* @lua destroyInstance
|
||||||
*/
|
*/
|
||||||
static void end();
|
static void end();
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,7 @@ public:
|
||||||
* @param callback callback when the task is finished. The callback is called in the main thread instead of task thread.
|
* @param callback callback when the task is finished. The callback is called in the main thread instead of task thread.
|
||||||
* @param callbackParam parameter used by the callback.
|
* @param callbackParam parameter used by the callback.
|
||||||
* @param f task can be lambda function.
|
* @param f task can be lambda function.
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
template<class F>
|
template<class F>
|
||||||
inline void enqueue(TaskType type, const TaskCallBack& callback, void* callbackParam, F&& f);
|
inline void enqueue(TaskType type, const TaskCallBack& callback, void* callbackParam, F&& f);
|
||||||
|
|
|
@ -50,6 +50,7 @@ Configuration::Configuration()
|
||||||
, _maxDirLightInShader(1)
|
, _maxDirLightInShader(1)
|
||||||
, _maxPointLightInShader(1)
|
, _maxPointLightInShader(1)
|
||||||
, _maxSpotLightInShader(1)
|
, _maxSpotLightInShader(1)
|
||||||
|
, _isAnimate3DHighQuality(true)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,6 +263,11 @@ int Configuration::getMaxSupportSpotLightInShader() const
|
||||||
return _maxSpotLightInShader;
|
return _maxSpotLightInShader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Configuration::isHighAnimate3DQuality() const
|
||||||
|
{
|
||||||
|
return _isAnimate3DHighQuality;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// generic getters for properties
|
// generic getters for properties
|
||||||
//
|
//
|
||||||
|
@ -350,6 +356,12 @@ void Configuration::loadConfigFile(const std::string& filename)
|
||||||
_maxSpotLightInShader = _valueDict[name].asInt();
|
_maxSpotLightInShader = _valueDict[name].asInt();
|
||||||
else
|
else
|
||||||
_valueDict[name] = Value(_maxSpotLightInShader);
|
_valueDict[name] = Value(_maxSpotLightInShader);
|
||||||
|
|
||||||
|
name = "cocos2d.x.3d.animate_high_quality";
|
||||||
|
if (_valueDict.find(name) != _valueDict.end())
|
||||||
|
_isAnimate3DHighQuality = _valueDict[name].asBool();
|
||||||
|
else
|
||||||
|
_valueDict[name] = Value(_isAnimate3DHighQuality);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -164,6 +164,12 @@ public:
|
||||||
*/
|
*/
|
||||||
int getMaxSupportSpotLightInShader() const;
|
int getMaxSupportSpotLightInShader() const;
|
||||||
|
|
||||||
|
/** is 3d animate quality? Configure it in the config.plist, the key is cocos2d.x.3d.animate_high_quality, it is true by default.
|
||||||
|
* Animation quality of created Animate3D is based on the return value. However, animation quality of Animate3D can be modified by calling setHighQuality after it is created.
|
||||||
|
* @return true: is high quality, false: is low quality
|
||||||
|
*/
|
||||||
|
bool isHighAnimate3DQuality() const;
|
||||||
|
|
||||||
/** Returns whether or not an OpenGL is supported.
|
/** Returns whether or not an OpenGL is supported.
|
||||||
*
|
*
|
||||||
* @param searchName A given search name.
|
* @param searchName A given search name.
|
||||||
|
@ -230,6 +236,7 @@ protected:
|
||||||
int _maxDirLightInShader; //max support directional light in shader
|
int _maxDirLightInShader; //max support directional light in shader
|
||||||
int _maxPointLightInShader; // max support point light in shader
|
int _maxPointLightInShader; // max support point light in shader
|
||||||
int _maxSpotLightInShader; // max support spot light in shader
|
int _maxSpotLightInShader; // max support spot light in shader
|
||||||
|
bool _isAnimate3DHighQuality; // animation 3d quality, true: is high quality, false: is low quality
|
||||||
|
|
||||||
ValueMap _valueDict;
|
ValueMap _valueDict;
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Copyright (c) 2008-2010 Ricardo Quesada
|
Copyright (c) 2008-2010 Ricardo Quesada
|
||||||
Copyright (c) 2010-2013 cocos2d-x.org
|
Copyright (c) 2010-2013 cocos2d-x.org
|
||||||
Copyright (c) 2011 Zynga Inc.
|
Copyright (c) 2011 Zynga Inc.
|
||||||
Copyright (c) 2013-2014 Chukong Technologies Inc.
|
Copyright (c) 2013-2015 Chukong Technologies Inc.
|
||||||
|
|
||||||
http://www.cocos2d-x.org
|
http://www.cocos2d-x.org
|
||||||
|
|
||||||
|
@ -107,6 +107,7 @@ Director* Director::getInstance()
|
||||||
}
|
}
|
||||||
|
|
||||||
Director::Director()
|
Director::Director()
|
||||||
|
: _isStatusLabelUpdated(true)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -386,7 +387,7 @@ void Director::setOpenGLView(GLView *openGLView)
|
||||||
// set size
|
// set size
|
||||||
_winSizeInPoints = _openGLView->getDesignResolutionSize();
|
_winSizeInPoints = _openGLView->getDesignResolutionSize();
|
||||||
|
|
||||||
createStatsLabel();
|
_isStatusLabelUpdated = true;
|
||||||
|
|
||||||
if (_openGLView)
|
if (_openGLView)
|
||||||
{
|
{
|
||||||
|
@ -1110,6 +1111,12 @@ void Director::resume()
|
||||||
// updates the FPS every frame
|
// updates the FPS every frame
|
||||||
void Director::showStats()
|
void Director::showStats()
|
||||||
{
|
{
|
||||||
|
if (_isStatusLabelUpdated)
|
||||||
|
{
|
||||||
|
createStatsLabel();
|
||||||
|
_isStatusLabelUpdated = false;
|
||||||
|
}
|
||||||
|
|
||||||
static unsigned long prevCalls = 0;
|
static unsigned long prevCalls = 0;
|
||||||
static unsigned long prevVerts = 0;
|
static unsigned long prevVerts = 0;
|
||||||
static float prevDeltaTime = 0.016f; // 60FPS
|
static float prevDeltaTime = 0.016f; // 60FPS
|
||||||
|
@ -1255,7 +1262,7 @@ void Director::setContentScaleFactor(float scaleFactor)
|
||||||
if (scaleFactor != _contentScaleFactor)
|
if (scaleFactor != _contentScaleFactor)
|
||||||
{
|
{
|
||||||
_contentScaleFactor = scaleFactor;
|
_contentScaleFactor = scaleFactor;
|
||||||
createStatsLabel();
|
_isStatusLabelUpdated = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Copyright (c) 2008-2010 Ricardo Quesada
|
Copyright (c) 2008-2010 Ricardo Quesada
|
||||||
Copyright (c) 2010-2013 cocos2d-x.org
|
Copyright (c) 2010-2013 cocos2d-x.org
|
||||||
Copyright (c) 2011 Zynga Inc.
|
Copyright (c) 2011 Zynga Inc.
|
||||||
Copyright (c) 2013-2014 Chukong Technologies Inc.
|
Copyright (c) 2013-2015 Chukong Technologies Inc.
|
||||||
|
|
||||||
http://www.cocos2d-x.org
|
http://www.cocos2d-x.org
|
||||||
|
|
||||||
|
@ -597,6 +597,8 @@ protected:
|
||||||
/* Console for the director */
|
/* Console for the director */
|
||||||
Console *_console;
|
Console *_console;
|
||||||
|
|
||||||
|
bool _isStatusLabelUpdated;
|
||||||
|
|
||||||
// GLView will recreate stats labels to fit visible rect
|
// GLView will recreate stats labels to fit visible rect
|
||||||
friend class GLView;
|
friend class GLView;
|
||||||
};
|
};
|
||||||
|
|
|
@ -58,15 +58,22 @@ class CC_DLL IMEDelegate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
* Default constructor.
|
||||||
* @js NA
|
* @js NA
|
||||||
* @lua NA
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
virtual ~IMEDelegate();
|
virtual ~IMEDelegate();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Default destructor.
|
||||||
|
* @js NA
|
||||||
* @lua NA
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
virtual bool attachWithIME();
|
virtual bool attachWithIME();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Determine whether the IME is detached or not.
|
||||||
|
* @js NA
|
||||||
* @lua NA
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
virtual bool detachWithIME();
|
virtual bool detachWithIME();
|
||||||
|
|
|
@ -89,13 +89,18 @@ public:
|
||||||
/** Get previous contact data */
|
/** Get previous contact data */
|
||||||
inline const PhysicsContactData* getPreContactData() const { return _preContactData; }
|
inline const PhysicsContactData* getPreContactData() const { return _preContactData; }
|
||||||
|
|
||||||
/** Get data. */
|
/**
|
||||||
|
* Get data.
|
||||||
|
* @lua NA
|
||||||
|
*/
|
||||||
inline void* getData() const { return _data; }
|
inline void* getData() const { return _data; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set data to contact.
|
* @brief Set data to contact.
|
||||||
|
|
||||||
* You must manage the memory yourself, Generally you can set data at contact begin, and distory it at contact seperate.
|
* You must manage the memory yourself, Generally you can set data at contact begin, and distory it at contact seperate.
|
||||||
|
*
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
inline void setData(void* data) { _data = data; }
|
inline void setData(void* data) { _data = data; }
|
||||||
|
|
||||||
|
|
|
@ -1294,15 +1294,21 @@ bool FileUtils::renameFile(const std::string &path, const std::string &oldname,
|
||||||
|
|
||||||
if(FileUtils::getInstance()->isFileExist(_new))
|
if(FileUtils::getInstance()->isFileExist(_new))
|
||||||
{
|
{
|
||||||
DeleteFileA(_new.c_str());
|
if (!DeleteFileA(_new.c_str()))
|
||||||
|
{
|
||||||
|
CCLOGERROR("Fail to delete file %s !Error code is 0x%x", newPath.c_str(), GetLastError());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MoveFileA(_old.c_str(), _new.c_str());
|
if (MoveFileA(_old.c_str(), _new.c_str()))
|
||||||
|
{
|
||||||
if (0 == GetLastError())
|
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
CCLOGERROR("Fail to rename file %s to %s !Error code is 0x%x", oldPath.c_str(), newPath.c_str(), GetLastError());
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
int errorCode = rename(oldPath.c_str(), newPath.c_str());
|
int errorCode = rename(oldPath.c_str(), newPath.c_str());
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
Copyright (c) 2010-2012 cocos2d-x.org
|
Copyright (c) 2010-2012 cocos2d-x.org
|
||||||
Copyright (c) 2013-2014 Chukong Technologies Inc.
|
Copyright (c) 2013-2015 Chukong Technologies Inc.
|
||||||
|
|
||||||
http://www.cocos2d-x.org
|
http://www.cocos2d-x.org
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ void GLView::updateDesignResolutionSize()
|
||||||
// reset director's member variables to fit visible rect
|
// reset director's member variables to fit visible rect
|
||||||
auto director = Director::getInstance();
|
auto director = Director::getInstance();
|
||||||
director->_winSizeInPoints = getDesignResolutionSize();
|
director->_winSizeInPoints = getDesignResolutionSize();
|
||||||
director->createStatsLabel();
|
director->_isStatusLabelUpdated = true;
|
||||||
director->setGLDefaultValues();
|
director->setGLDefaultValues();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,67 +104,27 @@ LanguageType Application::getCurrentLanguage()
|
||||||
NSDictionary* temp = [NSLocale componentsFromLocaleIdentifier:currentLanguage];
|
NSDictionary* temp = [NSLocale componentsFromLocaleIdentifier:currentLanguage];
|
||||||
NSString * languageCode = [temp objectForKey:NSLocaleLanguageCode];
|
NSString * languageCode = [temp objectForKey:NSLocaleLanguageCode];
|
||||||
|
|
||||||
LanguageType ret = LanguageType::ENGLISH;
|
if ([languageCode isEqualToString:@"zh"]) return LanguageType::CHINESE;
|
||||||
if ([languageCode isEqualToString:@"zh"])
|
if ([languageCode isEqualToString:@"en"]) return LanguageType::ENGLISH;
|
||||||
{
|
if ([languageCode isEqualToString:@"fr"]) return LanguageType::FRENCH;
|
||||||
ret = LanguageType::CHINESE;
|
if ([languageCode isEqualToString:@"it"]) return LanguageType::ITALIAN;
|
||||||
}
|
if ([languageCode isEqualToString:@"de"]) return LanguageType::GERMAN;
|
||||||
else if ([languageCode isEqualToString:@"en"])
|
if ([languageCode isEqualToString:@"es"]) return LanguageType::SPANISH;
|
||||||
{
|
if ([languageCode isEqualToString:@"nl"]) return LanguageType::DUTCH;
|
||||||
ret = LanguageType::ENGLISH;
|
if ([languageCode isEqualToString:@"ru"]) return LanguageType::RUSSIAN;
|
||||||
}
|
if ([languageCode isEqualToString:@"ko"]) return LanguageType::KOREAN;
|
||||||
else if ([languageCode isEqualToString:@"fr"]){
|
if ([languageCode isEqualToString:@"ja"]) return LanguageType::JAPANESE;
|
||||||
ret = LanguageType::FRENCH;
|
if ([languageCode isEqualToString:@"hu"]) return LanguageType::HUNGARIAN;
|
||||||
}
|
if ([languageCode isEqualToString:@"pt"]) return LanguageType::PORTUGUESE;
|
||||||
else if ([languageCode isEqualToString:@"it"]){
|
if ([languageCode isEqualToString:@"ar"]) return LanguageType::ARABIC;
|
||||||
ret = LanguageType::ITALIAN;
|
if ([languageCode isEqualToString:@"nb"]) return LanguageType::NORWEGIAN;
|
||||||
}
|
if ([languageCode isEqualToString:@"pl"]) return LanguageType::POLISH;
|
||||||
else if ([languageCode isEqualToString:@"de"]){
|
if ([languageCode isEqualToString:@"tr"]) return LanguageType::TURKISH;
|
||||||
ret = LanguageType::GERMAN;
|
if ([languageCode isEqualToString:@"uk"]) return LanguageType::UKRAINIAN;
|
||||||
}
|
if ([languageCode isEqualToString:@"ro"]) return LanguageType::ROMANIAN;
|
||||||
else if ([languageCode isEqualToString:@"es"]){
|
if ([languageCode isEqualToString:@"bg"]) return LanguageType::BULGARIAN;
|
||||||
ret = LanguageType::SPANISH;
|
return LanguageType::ENGLISH;
|
||||||
}
|
|
||||||
else if ([languageCode isEqualToString:@"nl"]){
|
|
||||||
ret = LanguageType::DUTCH;
|
|
||||||
}
|
|
||||||
else if ([languageCode isEqualToString:@"ru"]){
|
|
||||||
ret = LanguageType::RUSSIAN;
|
|
||||||
}
|
|
||||||
else if ([languageCode isEqualToString:@"ko"]){
|
|
||||||
ret = LanguageType::KOREAN;
|
|
||||||
}
|
|
||||||
else if ([languageCode isEqualToString:@"ja"]){
|
|
||||||
ret = LanguageType::JAPANESE;
|
|
||||||
}
|
|
||||||
else if ([languageCode isEqualToString:@"hu"]){
|
|
||||||
ret = LanguageType::HUNGARIAN;
|
|
||||||
}
|
|
||||||
else if ([languageCode isEqualToString:@"pt"]){
|
|
||||||
ret = LanguageType::PORTUGUESE;
|
|
||||||
}
|
|
||||||
else if ([languageCode isEqualToString:@"ar"]){
|
|
||||||
ret = LanguageType::ARABIC;
|
|
||||||
}
|
|
||||||
else if ([languageCode isEqualToString:@"nb"]){
|
|
||||||
ret = LanguageType::NORWEGIAN;
|
|
||||||
}
|
|
||||||
else if ([languageCode isEqualToString:@"pl"]){
|
|
||||||
ret = LanguageType::POLISH;
|
|
||||||
}
|
|
||||||
else if ([languageCode isEqualToString:@"tr"]){
|
|
||||||
ret = LanguageType::TURKISH;
|
|
||||||
}
|
|
||||||
else if ([languageCode isEqualToString:@"uk"]){
|
|
||||||
ret = LanguageType::UKRAINIAN;
|
|
||||||
}
|
|
||||||
else if ([languageCode isEqualToString:@"ro"]){
|
|
||||||
ret = LanguageType::ROMANIAN;
|
|
||||||
}
|
|
||||||
else if ([languageCode isEqualToString:@"bg"]){
|
|
||||||
ret = LanguageType::BULGARIAN;
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Application::Platform Application::getTargetPlatform()
|
Application::Platform Application::getTargetPlatform()
|
||||||
|
|
|
@ -160,65 +160,27 @@ LanguageType Application::getCurrentLanguage()
|
||||||
NSDictionary* temp = [NSLocale componentsFromLocaleIdentifier:currentLanguage];
|
NSDictionary* temp = [NSLocale componentsFromLocaleIdentifier:currentLanguage];
|
||||||
NSString * languageCode = [temp objectForKey:NSLocaleLanguageCode];
|
NSString * languageCode = [temp objectForKey:NSLocaleLanguageCode];
|
||||||
|
|
||||||
LanguageType ret = LanguageType::ENGLISH;
|
if ([languageCode isEqualToString:@"zh"]) return LanguageType::CHINESE;
|
||||||
if ([languageCode isEqualToString:@"zh"]){
|
if ([languageCode isEqualToString:@"en"]) return LanguageType::ENGLISH;
|
||||||
ret = LanguageType::CHINESE;
|
if ([languageCode isEqualToString:@"fr"]) return LanguageType::FRENCH;
|
||||||
}
|
if ([languageCode isEqualToString:@"it"]) return LanguageType::ITALIAN;
|
||||||
else if ([languageCode isEqualToString:@"en"]){
|
if ([languageCode isEqualToString:@"de"]) return LanguageType::GERMAN;
|
||||||
ret = LanguageType::ENGLISH;
|
if ([languageCode isEqualToString:@"es"]) return LanguageType::SPANISH;
|
||||||
}
|
if ([languageCode isEqualToString:@"nl"]) return LanguageType::DUTCH;
|
||||||
else if ([languageCode isEqualToString:@"fr"]){
|
if ([languageCode isEqualToString:@"ru"]) return LanguageType::RUSSIAN;
|
||||||
ret = LanguageType::FRENCH;
|
if ([languageCode isEqualToString:@"ko"]) return LanguageType::KOREAN;
|
||||||
}
|
if ([languageCode isEqualToString:@"ja"]) return LanguageType::JAPANESE;
|
||||||
else if ([languageCode isEqualToString:@"it"]){
|
if ([languageCode isEqualToString:@"hu"]) return LanguageType::HUNGARIAN;
|
||||||
ret = LanguageType::ITALIAN;
|
if ([languageCode isEqualToString:@"pt"]) return LanguageType::PORTUGUESE;
|
||||||
}
|
if ([languageCode isEqualToString:@"ar"]) return LanguageType::ARABIC;
|
||||||
else if ([languageCode isEqualToString:@"de"]){
|
if ([languageCode isEqualToString:@"nb"]) return LanguageType::NORWEGIAN;
|
||||||
ret = LanguageType::GERMAN;
|
if ([languageCode isEqualToString:@"pl"]) return LanguageType::POLISH;
|
||||||
}
|
if ([languageCode isEqualToString:@"tr"]) return LanguageType::TURKISH;
|
||||||
else if ([languageCode isEqualToString:@"es"]){
|
if ([languageCode isEqualToString:@"uk"]) return LanguageType::UKRAINIAN;
|
||||||
ret = LanguageType::SPANISH;
|
if ([languageCode isEqualToString:@"ro"]) return LanguageType::ROMANIAN;
|
||||||
}
|
if ([languageCode isEqualToString:@"bg"]) return LanguageType::BULGARIAN;
|
||||||
else if ([languageCode isEqualToString:@"nl"]){
|
return LanguageType::ENGLISH;
|
||||||
ret = LanguageType::DUTCH;
|
|
||||||
}
|
|
||||||
else if ([languageCode isEqualToString:@"ru"]){
|
|
||||||
ret = LanguageType::RUSSIAN;
|
|
||||||
}
|
|
||||||
else if ([languageCode isEqualToString:@"ko"]){
|
|
||||||
ret = LanguageType::KOREAN;
|
|
||||||
}
|
|
||||||
else if ([languageCode isEqualToString:@"ja"]){
|
|
||||||
ret = LanguageType::JAPANESE;
|
|
||||||
}
|
|
||||||
else if ([languageCode isEqualToString:@"hu"]){
|
|
||||||
ret = LanguageType::HUNGARIAN;
|
|
||||||
}
|
|
||||||
else if ([languageCode isEqualToString:@"pt"]){
|
|
||||||
ret = LanguageType::PORTUGUESE;
|
|
||||||
}
|
|
||||||
else if ([languageCode isEqualToString:@"ar"]){
|
|
||||||
ret = LanguageType::ARABIC;
|
|
||||||
}
|
|
||||||
else if ([languageCode isEqualToString:@"nb"]){
|
|
||||||
ret = LanguageType::NORWEGIAN;
|
|
||||||
}
|
|
||||||
else if ([languageCode isEqualToString:@"pl"]){
|
|
||||||
ret = LanguageType::POLISH;
|
|
||||||
}
|
|
||||||
else if ([languageCode isEqualToString:@"tr"]){
|
|
||||||
ret = LanguageType::TURKISH;
|
|
||||||
}
|
|
||||||
else if ([languageCode isEqualToString:@"uk"]){
|
|
||||||
ret = LanguageType::UKRAINIAN;
|
|
||||||
}
|
|
||||||
else if ([languageCode isEqualToString:@"ro"]){
|
|
||||||
ret = LanguageType::ROMANIAN;
|
|
||||||
}
|
|
||||||
else if ([languageCode isEqualToString:@"bg"]){
|
|
||||||
ret = LanguageType::BULGARIAN;
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Application::openURL(const std::string &url)
|
bool Application::openURL(const std::string &url)
|
||||||
|
|
|
@ -75,7 +75,9 @@ void Device::setAccelerometerEnabled(bool isEnabled)
|
||||||
|
|
||||||
if(sAccelerometer == nullptr)
|
if(sAccelerometer == nullptr)
|
||||||
{
|
{
|
||||||
MessageBox("This device does not have an accelerometer.","Alert");
|
// It's not a friendly experience and may cause crash.
|
||||||
|
//MessageBox("This device does not have an accelerometer.","Alert");
|
||||||
|
log("This device does not have an accelerometer.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,9 @@ class EventListenerCustom;
|
||||||
class EventCustom;
|
class EventCustom;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Uniform Value, which is used to store to value send to openGL pipe line by glUniformXXX.
|
* Uniform Value, which is used to store to value send to openGL pipe line by glUniformXXX.
|
||||||
|
*
|
||||||
|
* @lua NA
|
||||||
*/
|
*/
|
||||||
class CC_DLL UniformValue
|
class CC_DLL UniformValue
|
||||||
{
|
{
|
||||||
|
@ -134,7 +136,11 @@ protected:
|
||||||
*/
|
*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/**Vertex Attribute Value, which is an abstraction of VertexAttribute and data pointer.*/
|
/**
|
||||||
|
* Vertex Attribute Value, which is an abstraction of VertexAttribute and data pointer.
|
||||||
|
*
|
||||||
|
* @lua NA
|
||||||
|
*/
|
||||||
class CC_DLL VertexAttribValue
|
class CC_DLL VertexAttribValue
|
||||||
{
|
{
|
||||||
friend class GLProgram;
|
friend class GLProgram;
|
||||||
|
|
|
@ -66,7 +66,8 @@
|
||||||
-- @return ActionCamera#ActionCamera ret (return value: cc.ActionCamera)
|
-- @return ActionCamera#ActionCamera ret (return value: cc.ActionCamera)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- js ctor
|
-- js ctor<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#ActionCamera] ActionCamera
|
-- @function [parent=#ActionCamera] ActionCamera
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return ActionCamera#ActionCamera self (return value: cc.ActionCamera)
|
-- @return ActionCamera#ActionCamera self (return value: cc.ActionCamera)
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Sets the Animation object to be animated <br>
|
-- Sets the Animation object to be animated <br>
|
||||||
-- param A certain animation.
|
-- param animation certain animation.
|
||||||
-- @function [parent=#Animate] setAnimation
|
-- @function [parent=#Animate] setAnimation
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #cc.Animation animation
|
-- @param #cc.Animation animation
|
||||||
|
|
|
@ -10,6 +10,15 @@
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return float#float ret (return value: float)
|
-- @return float#float ret (return value: float)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- set high quality<br>
|
||||||
|
-- The default value is based on Configuration::isHighAnimate3DQuality(). You can configure it in the config.plist. However, you can modify it using the following function<br>
|
||||||
|
-- param true: is high quality, false: is low quality.
|
||||||
|
-- @function [parent=#Animate3D] setHighQuality
|
||||||
|
-- @param self
|
||||||
|
-- @param #bool isHighQuality
|
||||||
|
-- @return Animate3D#Animate3D self (return value: cc.Animate3D)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
--
|
--
|
||||||
-- @function [parent=#Animate3D] setWeight
|
-- @function [parent=#Animate3D] setWeight
|
||||||
|
@ -30,6 +39,13 @@
|
||||||
-- @param #float speed
|
-- @param #float speed
|
||||||
-- @return Animate3D#Animate3D self (return value: cc.Animate3D)
|
-- @return Animate3D#Animate3D self (return value: cc.Animate3D)
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- get high quality<br>
|
||||||
|
-- is it high quality
|
||||||
|
-- @function [parent=#Animate3D] isHighQuality
|
||||||
|
-- @param self
|
||||||
|
-- @return bool#bool ret (return value: bool)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- get & set origin interval
|
-- get & set origin interval
|
||||||
-- @function [parent=#Animate3D] setOriginInterval
|
-- @function [parent=#Animate3D] setOriginInterval
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
-- @parent_module ccexp
|
-- @parent_module ccexp
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
--
|
-- Defautl constructor<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#AudioProfile] AudioProfile
|
-- @function [parent=#AudioProfile] AudioProfile
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return experimental::AudioProfile#experimental::AudioProfile self (return value: cc.experimental::AudioProfile)
|
-- @return experimental::AudioProfile#experimental::AudioProfile self (return value: cc.experimental::AudioProfile)
|
||||||
|
|
|
@ -3,13 +3,6 @@
|
||||||
-- @module CSLoader
|
-- @module CSLoader
|
||||||
-- @parent_module cc
|
-- @parent_module cc
|
||||||
|
|
||||||
--------------------------------
|
|
||||||
--
|
|
||||||
-- @function [parent=#CSLoader] setJsonPath
|
|
||||||
-- @param self
|
|
||||||
-- @param #string jsonPath
|
|
||||||
-- @return CSLoader#CSLoader self (return value: cc.CSLoader)
|
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
--
|
--
|
||||||
-- @function [parent=#CSLoader] createNodeFromJson
|
-- @function [parent=#CSLoader] createNodeFromJson
|
||||||
|
@ -43,8 +36,9 @@
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
--
|
--
|
||||||
-- @function [parent=#CSLoader] purge
|
-- @function [parent=#CSLoader] setJsonPath
|
||||||
-- @param self
|
-- @param self
|
||||||
|
-- @param #string jsonPath
|
||||||
-- @return CSLoader#CSLoader self (return value: cc.CSLoader)
|
-- @return CSLoader#CSLoader self (return value: cc.CSLoader)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Set the selector target.<br>
|
-- Set the selector target.<br>
|
||||||
-- param The selector target.
|
-- param sel The selector target.
|
||||||
-- @function [parent=#CallFunc] setTargetCallback
|
-- @function [parent=#CallFunc] setTargetCallback
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #cc.Ref sel
|
-- @param #cc.Ref sel
|
||||||
|
|
|
@ -112,7 +112,6 @@
|
||||||
-- Creates an orthographic camera.<br>
|
-- Creates an orthographic camera.<br>
|
||||||
-- param zoomX The zoom factor along the X-axis of the orthographic projection (the width of the ortho projection).<br>
|
-- param zoomX The zoom factor along the X-axis of the orthographic projection (the width of the ortho projection).<br>
|
||||||
-- param zoomY The zoom factor along the Y-axis of the orthographic projection (the height of the ortho projection).<br>
|
-- param zoomY The zoom factor along the Y-axis of the orthographic projection (the height of the ortho projection).<br>
|
||||||
-- param aspectRatio The aspect ratio of the orthographic projection.<br>
|
|
||||||
-- param nearPlane The near plane distance.<br>
|
-- param nearPlane The near plane distance.<br>
|
||||||
-- param farPlane The far plane distance.
|
-- param farPlane The far plane distance.
|
||||||
-- @function [parent=#Camera] createOrthographic
|
-- @function [parent=#Camera] createOrthographic
|
||||||
|
|
|
@ -43,11 +43,11 @@
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Load cross texture for checkbox.<br>
|
-- Load cross texture for checkbox.<br>
|
||||||
-- param cross The cross texture name.<br>
|
-- param crossTextureName The cross texture name.<br>
|
||||||
-- param texType @see `Widget::TextureResType`
|
-- param texType @see `Widget::TextureResType`
|
||||||
-- @function [parent=#CheckBox] loadTextureFrontCross
|
-- @function [parent=#CheckBox] loadTextureFrontCross
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #string
|
-- @param #string crossTextureName
|
||||||
-- @param #int texType
|
-- @param #int texType
|
||||||
-- @return CheckBox#CheckBox self (return value: ccui.CheckBox)
|
-- @return CheckBox#CheckBox self (return value: ccui.CheckBox)
|
||||||
|
|
||||||
|
@ -60,17 +60,18 @@
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Load all textures for initializing a checkbox.<br>
|
-- Load all textures for initializing a checkbox.<br>
|
||||||
-- param backGround The background image name.<br>
|
-- param background The background image name.<br>
|
||||||
-- param backGroundSelected The background selected image name.<br>
|
-- param backgroundSelected The background selected image name.<br>
|
||||||
-- param cross The cross image name.<br>
|
-- param cross The cross image name.<br>
|
||||||
|
-- param backgroundDisabled The background disabled state texture.<br>
|
||||||
-- param frontCrossDisabled The front cross disabled state image name.<br>
|
-- param frontCrossDisabled The front cross disabled state image name.<br>
|
||||||
-- param texType @see `Widget::TextureResType`
|
-- param texType @see `Widget::TextureResType`
|
||||||
-- @function [parent=#CheckBox] loadTextures
|
-- @function [parent=#CheckBox] loadTextures
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #string backGround
|
-- @param #string background
|
||||||
-- @param #string backGroundSelected
|
-- @param #string backgroundSelected
|
||||||
-- @param #string cross
|
-- @param #string cross
|
||||||
-- @param #string backGroundDisabled
|
-- @param #string backgroundDisabled
|
||||||
-- @param #string frontCrossDisabled
|
-- @param #string frontCrossDisabled
|
||||||
-- @param #int texType
|
-- @param #int texType
|
||||||
-- @return CheckBox#CheckBox self (return value: ccui.CheckBox)
|
-- @return CheckBox#CheckBox self (return value: ccui.CheckBox)
|
||||||
|
@ -86,7 +87,7 @@
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Load background texture for checkbox.<br>
|
-- Load background texture for checkbox.<br>
|
||||||
-- param backGround The background image name.<br>
|
-- param backGround The background image name.<br>
|
||||||
-- param texType @see `Widget::TextureResType`
|
-- param type @see `Widget::TextureResType`
|
||||||
-- @function [parent=#CheckBox] loadTextureBackGround
|
-- @function [parent=#CheckBox] loadTextureBackGround
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #string backGround
|
-- @param #string backGround
|
||||||
|
@ -119,7 +120,7 @@
|
||||||
-- @function [parent=#CheckBox] create
|
-- @function [parent=#CheckBox] create
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #string backGround
|
-- @param #string backGround
|
||||||
-- @param #string backGroundSeleted
|
-- @param #string backGroundSelected
|
||||||
-- @param #string cross
|
-- @param #string cross
|
||||||
-- @param #string backGroundDisabled
|
-- @param #string backGroundDisabled
|
||||||
-- @param #string frontCrossDisabled
|
-- @param #string frontCrossDisabled
|
||||||
|
@ -151,7 +152,8 @@
|
||||||
-- @return size_table#size_table ret (return value: size_table)
|
-- @return size_table#size_table ret (return value: size_table)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Default constructor.
|
-- Default constructor.<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#CheckBox] CheckBox
|
-- @function [parent=#CheckBox] CheckBox
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return CheckBox#CheckBox self (return value: ccui.CheckBox)
|
-- @return CheckBox#CheckBox self (return value: ccui.CheckBox)
|
||||||
|
|
|
@ -11,7 +11,8 @@
|
||||||
-- By default returns true if has any children attached.<br>
|
-- By default returns true if has any children attached.<br>
|
||||||
-- return If you have custom stencil-based node with stencil drawing mechanics other then children-based,<br>
|
-- return If you have custom stencil-based node with stencil drawing mechanics other then children-based,<br>
|
||||||
-- then this method should return true every time you wish stencil to be visited.<br>
|
-- then this method should return true every time you wish stencil to be visited.<br>
|
||||||
-- By default returns true if has any children attached.
|
-- By default returns true if has any children attached.<br>
|
||||||
|
-- js NA
|
||||||
-- @function [parent=#ClippingNode] hasContent
|
-- @function [parent=#ClippingNode] hasContent
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return bool#bool ret (return value: bool)
|
-- @return bool#bool ret (return value: bool)
|
||||||
|
|
|
@ -86,7 +86,8 @@
|
||||||
-- @return ControlColourPicker#ControlColourPicker self (return value: cc.ControlColourPicker)
|
-- @return ControlColourPicker#ControlColourPicker self (return value: cc.ControlColourPicker)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- js ctor
|
-- js ctor<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#ControlColourPicker] ControlColourPicker
|
-- @function [parent=#ControlColourPicker] ControlColourPicker
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return ControlColourPicker#ControlColourPicker self (return value: cc.ControlColourPicker)
|
-- @return ControlColourPicker#ControlColourPicker self (return value: cc.ControlColourPicker)
|
||||||
|
|
|
@ -180,7 +180,8 @@
|
||||||
-- @return bool#bool ret (return value: bool)
|
-- @return bool#bool ret (return value: bool)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- js ctor
|
-- js ctor<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#ControlPotentiometer] ControlPotentiometer
|
-- @function [parent=#ControlPotentiometer] ControlPotentiometer
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return ControlPotentiometer#ControlPotentiometer self (return value: cc.ControlPotentiometer)
|
-- @return ControlPotentiometer#ControlPotentiometer self (return value: cc.ControlPotentiometer)
|
||||||
|
|
|
@ -173,7 +173,8 @@
|
||||||
-- @return ControlSlider#ControlSlider self (return value: cc.ControlSlider)
|
-- @return ControlSlider#ControlSlider self (return value: cc.ControlSlider)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- js ctor
|
-- js ctor<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#ControlSlider] ControlSlider
|
-- @function [parent=#ControlSlider] ControlSlider
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return ControlSlider#ControlSlider self (return value: cc.ControlSlider)
|
-- @return ControlSlider#ControlSlider self (return value: cc.ControlSlider)
|
||||||
|
|
|
@ -178,7 +178,8 @@
|
||||||
-- @return bool#bool ret (return value: bool)
|
-- @return bool#bool ret (return value: bool)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- js ctor
|
-- js ctor<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#ControlStepper] ControlStepper
|
-- @function [parent=#ControlStepper] ControlStepper
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return ControlStepper#ControlStepper self (return value: cc.ControlStepper)
|
-- @return ControlStepper#ControlStepper self (return value: cc.ControlStepper)
|
||||||
|
|
|
@ -98,7 +98,8 @@
|
||||||
-- @return bool#bool ret (return value: bool)
|
-- @return bool#bool ret (return value: bool)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- js ctor
|
-- js ctor<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#ControlSwitch] ControlSwitch
|
-- @function [parent=#ControlSwitch] ControlSwitch
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return ControlSwitch#ControlSwitch self (return value: cc.ControlSwitch)
|
-- @return ControlSwitch#ControlSwitch self (return value: cc.ControlSwitch)
|
||||||
|
|
|
@ -8,7 +8,8 @@
|
||||||
-- Draw an line from origin to destination with color. <br>
|
-- Draw an line from origin to destination with color. <br>
|
||||||
-- param origin The line origin.<br>
|
-- param origin The line origin.<br>
|
||||||
-- param destination The line destination.<br>
|
-- param destination The line destination.<br>
|
||||||
-- param color The line color.
|
-- param color The line color.<br>
|
||||||
|
-- js NA
|
||||||
-- @function [parent=#DrawNode] drawLine
|
-- @function [parent=#DrawNode] drawLine
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #vec2_table origin
|
-- @param #vec2_table origin
|
||||||
|
@ -43,7 +44,7 @@
|
||||||
-- @return DrawNode#DrawNode self (return value: cc.DrawNode)
|
-- @return DrawNode#DrawNode self (return value: cc.DrawNode)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
--
|
-- js NA
|
||||||
-- @function [parent=#DrawNode] onDrawGLPoint
|
-- @function [parent=#DrawNode] onDrawGLPoint
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #mat4_table transform
|
-- @param #mat4_table transform
|
||||||
|
@ -78,14 +79,13 @@
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Get the color mixed mode.<br>
|
-- Get the color mixed mode.<br>
|
||||||
-- js NA<br>
|
|
||||||
-- lua NA
|
-- lua NA
|
||||||
-- @function [parent=#DrawNode] getBlendFunc
|
-- @function [parent=#DrawNode] getBlendFunc
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return BlendFunc#BlendFunc ret (return value: cc.BlendFunc)
|
-- @return BlendFunc#BlendFunc ret (return value: cc.BlendFunc)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
--
|
-- js NA
|
||||||
-- @function [parent=#DrawNode] onDraw
|
-- @function [parent=#DrawNode] onDraw
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #mat4_table transform
|
-- @param #mat4_table transform
|
||||||
|
@ -124,7 +124,7 @@
|
||||||
-- @return DrawNode#DrawNode self (return value: cc.DrawNode)
|
-- @return DrawNode#DrawNode self (return value: cc.DrawNode)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
--
|
-- js NA
|
||||||
-- @function [parent=#DrawNode] onDrawGLLine
|
-- @function [parent=#DrawNode] onDrawGLLine
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #mat4_table transform
|
-- @param #mat4_table transform
|
||||||
|
@ -136,7 +136,8 @@
|
||||||
-- param p1 The triangle vertex point.<br>
|
-- param p1 The triangle vertex point.<br>
|
||||||
-- param p2 The triangle vertex point.<br>
|
-- param p2 The triangle vertex point.<br>
|
||||||
-- param p3 The triangle vertex point.<br>
|
-- param p3 The triangle vertex point.<br>
|
||||||
-- param color The triangle color.
|
-- param color The triangle color.<br>
|
||||||
|
-- js NA
|
||||||
-- @function [parent=#DrawNode] drawTriangle
|
-- @function [parent=#DrawNode] drawTriangle
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #vec2_table p1
|
-- @param #vec2_table p1
|
||||||
|
@ -168,7 +169,8 @@
|
||||||
-- The origin and the destination can not have the same x and y coordinate.<br>
|
-- The origin and the destination can not have the same x and y coordinate.<br>
|
||||||
-- param origin The rectangle origin.<br>
|
-- param origin The rectangle origin.<br>
|
||||||
-- param destination The rectangle destination.<br>
|
-- param destination The rectangle destination.<br>
|
||||||
-- param color The rectangle color.
|
-- param color The rectangle color.<br>
|
||||||
|
-- js NA
|
||||||
-- @function [parent=#DrawNode] drawSolidRect
|
-- @function [parent=#DrawNode] drawSolidRect
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #vec2_table origin
|
-- @param #vec2_table origin
|
||||||
|
@ -180,7 +182,8 @@
|
||||||
-- Draw a point.<br>
|
-- Draw a point.<br>
|
||||||
-- param point A Vec2 used to point.<br>
|
-- param point A Vec2 used to point.<br>
|
||||||
-- param pointSize The point size.<br>
|
-- param pointSize The point size.<br>
|
||||||
-- param color The point color.
|
-- param color The point color.<br>
|
||||||
|
-- js NA
|
||||||
-- @function [parent=#DrawNode] drawPoint
|
-- @function [parent=#DrawNode] drawPoint
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #vec2_table point
|
-- @param #vec2_table point
|
||||||
|
|
|
@ -284,7 +284,8 @@
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Constructor.<br>
|
-- Constructor.<br>
|
||||||
-- js ctor
|
-- js ctor<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#EditBox] EditBox
|
-- @function [parent=#EditBox] EditBox
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return EditBox#EditBox self (return value: ccui.EditBox)
|
-- @return EditBox#EditBox self (return value: ccui.EditBox)
|
||||||
|
|
|
@ -12,7 +12,8 @@
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- @{<br>
|
-- @{<br>
|
||||||
-- Getter and Setter for depth test state when blit.
|
-- Getter and Setter for depth test state when blit.<br>
|
||||||
|
-- js NA
|
||||||
-- @function [parent=#Grid3D] setNeedDepthTestForBlit
|
-- @function [parent=#Grid3D] setNeedDepthTestForBlit
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #bool neededDepthTest
|
-- @param #bool neededDepthTest
|
||||||
|
|
|
@ -106,7 +106,8 @@
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- @{<br>
|
-- @{<br>
|
||||||
-- Interface for custom action when before or after draw.
|
-- Interface for custom action when before or after draw.<br>
|
||||||
|
-- js NA
|
||||||
-- @function [parent=#GridBase] beforeBlit
|
-- @function [parent=#GridBase] beforeBlit
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return GridBase#GridBase self (return value: cc.GridBase)
|
-- @return GridBase#GridBase self (return value: cc.GridBase)
|
||||||
|
|
|
@ -13,7 +13,9 @@
|
||||||
-- @return HBox#HBox ret (return value: ccui.HBox)
|
-- @return HBox#HBox ret (return value: ccui.HBox)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Default constructor
|
-- Default constructor<br>
|
||||||
|
-- js ctor<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#HBox] HBox
|
-- @function [parent=#HBox] HBox
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return HBox#HBox self (return value: ccui.HBox)
|
-- @return HBox#HBox self (return value: ccui.HBox)
|
||||||
|
|
|
@ -6,9 +6,11 @@
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- brief Get a UTF8 substring from a std::string with a given start position and length<br>
|
-- brief Get a UTF8 substring from a std::string with a given start position and length<br>
|
||||||
-- Sample: std::string str = "中国中国中国"; substr = getSubStringOfUTF8String(str,0,2) will = "中国"<br>
|
-- Sample: std::string str = "中国中国中国"; substr = getSubStringOfUTF8String(str,0,2) will = "中国"<br>
|
||||||
|
-- param str The source string.<br>
|
||||||
-- param start The start position of the substring.<br>
|
-- param start The start position of the substring.<br>
|
||||||
-- param length The length of the substring in UTF8 count<br>
|
-- param length The length of the substring in UTF8 count<br>
|
||||||
-- return a UTF8 substring
|
-- return a UTF8 substring<br>
|
||||||
|
-- js NA
|
||||||
-- @function [parent=#Helper] getSubStringOfUTF8String
|
-- @function [parent=#Helper] getSubStringOfUTF8String
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #string str
|
-- @param #string str
|
||||||
|
|
|
@ -16,10 +16,10 @@
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Enable scale9 renderer.<br>
|
-- Enable scale9 renderer.<br>
|
||||||
-- param enable Set to true will use scale9 renderer, false otherwise.
|
-- param enabled Set to true will use scale9 renderer, false otherwise.
|
||||||
-- @function [parent=#ImageView] setScale9Enabled
|
-- @function [parent=#ImageView] setScale9Enabled
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #bool able
|
-- @param #bool enabled
|
||||||
-- @return ImageView#ImageView self (return value: ccui.ImageView)
|
-- @return ImageView#ImageView self (return value: ccui.ImageView)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
|
@ -95,7 +95,9 @@
|
||||||
-- @return ImageView#ImageView self (return value: ccui.ImageView)
|
-- @return ImageView#ImageView self (return value: ccui.ImageView)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Default constructor
|
-- Default constructor<br>
|
||||||
|
-- js ctor<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#ImageView] ImageView
|
-- @function [parent=#ImageView] ImageView
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return ImageView#ImageView self (return value: ccui.ImageView)
|
-- @return ImageView#ImageView self (return value: ccui.ImageView)
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
-- @return LabelAtlas#LabelAtlas self (return value: cc.LabelAtlas)
|
-- @return LabelAtlas#LabelAtlas self (return value: cc.LabelAtlas)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
--
|
-- js NA
|
||||||
-- @function [parent=#LabelAtlas] getDescription
|
-- @function [parent=#LabelAtlas] getDescription
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return string#string ret (return value: string)
|
-- @return string#string ret (return value: string)
|
||||||
|
|
|
@ -269,7 +269,7 @@
|
||||||
-- @function [parent=#Layout] addChild
|
-- @function [parent=#Layout] addChild
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #cc.Node child
|
-- @param #cc.Node child
|
||||||
-- @param #int zOrder
|
-- @param #int localZOrder
|
||||||
-- @param #string name
|
-- @param #string name
|
||||||
-- @return Layout#Layout self (return value: ccui.Layout)
|
-- @return Layout#Layout self (return value: ccui.Layout)
|
||||||
|
|
||||||
|
@ -299,7 +299,7 @@
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- When a widget is in a layout, you could call this method to get the next focused widget within a specified direction.<br>
|
-- When a widget is in a layout, you could call this method to get the next focused widget within a specified direction.<br>
|
||||||
-- If the widget is not in a layout, it will return itself<br>
|
-- If the widget is not in a layout, it will return itself<br>
|
||||||
-- param dir the direction to look for the next focused widget in a layout<br>
|
-- param direction the direction to look for the next focused widget in a layout<br>
|
||||||
-- param current the current focused widget<br>
|
-- param current the current focused widget<br>
|
||||||
-- return the next focused widget in a layout
|
-- return the next focused widget in a layout
|
||||||
-- @function [parent=#Layout] findNextFocusedWidget
|
-- @function [parent=#Layout] findNextFocusedWidget
|
||||||
|
@ -317,7 +317,9 @@
|
||||||
-- @return Layout#Layout self (return value: ccui.Layout)
|
-- @return Layout#Layout self (return value: ccui.Layout)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Default constructor
|
-- Default constructor<br>
|
||||||
|
-- js ctor<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#Layout] Layout
|
-- @function [parent=#Layout] Layout
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return Layout#Layout self (return value: ccui.Layout)
|
-- @return Layout#Layout self (return value: ccui.Layout)
|
||||||
|
|
|
@ -270,7 +270,7 @@
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Percent content size is used to adapt node's content size based on parent's content size.<br>
|
-- Percent content size is used to adapt node's content size based on parent's content size.<br>
|
||||||
-- If set to true then node's content size will be changed based on the value setted by @setPercentContentSize<br>
|
-- If set to true then node's content size will be changed based on the value setted by @see setPercentContentSize<br>
|
||||||
-- param isUsed True to enable percent content size, false otherwise.
|
-- param isUsed True to enable percent content size, false otherwise.
|
||||||
-- @function [parent=#LayoutComponent] setUsingPercentContentSize
|
-- @function [parent=#LayoutComponent] setUsingPercentContentSize
|
||||||
-- @param self
|
-- @param self
|
||||||
|
@ -361,7 +361,7 @@
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Change the bottom margin of owner relative to its parent.<br>
|
-- Change the bottom margin of owner relative to its parent.<br>
|
||||||
-- param Margin in float.
|
-- param margin in float.
|
||||||
-- @function [parent=#LayoutComponent] setBottomMargin
|
-- @function [parent=#LayoutComponent] setBottomMargin
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #float margin
|
-- @param #float margin
|
||||||
|
@ -399,7 +399,8 @@
|
||||||
-- @return bool#bool ret (return value: bool)
|
-- @return bool#bool ret (return value: bool)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Default constructor
|
-- Default constructor<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#LayoutComponent] LayoutComponent
|
-- @function [parent=#LayoutComponent] LayoutComponent
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return LayoutComponent#LayoutComponent self (return value: ccui.LayoutComponent)
|
-- @return LayoutComponent#LayoutComponent self (return value: ccui.LayoutComponent)
|
||||||
|
|
|
@ -42,7 +42,8 @@
|
||||||
-- @return LayoutParameter#LayoutParameter ret (return value: ccui.LayoutParameter)
|
-- @return LayoutParameter#LayoutParameter ret (return value: ccui.LayoutParameter)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Default constructor.
|
-- Default constructor.<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#LayoutParameter] LayoutParameter
|
-- @function [parent=#LayoutParameter] LayoutParameter
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return LayoutParameter#LayoutParameter self (return value: ccui.LayoutParameter)
|
-- @return LayoutParameter#LayoutParameter self (return value: ccui.LayoutParameter)
|
||||||
|
|
|
@ -42,7 +42,8 @@
|
||||||
-- @return LinearLayoutParameter#LinearLayoutParameter self (return value: ccui.LinearLayoutParameter)
|
-- @return LinearLayoutParameter#LinearLayoutParameter self (return value: ccui.LinearLayoutParameter)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Default constructor.
|
-- Default constructor.<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#LinearLayoutParameter] LinearLayoutParameter
|
-- @function [parent=#LinearLayoutParameter] LinearLayoutParameter
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return LinearLayoutParameter#LinearLayoutParameter self (return value: ccui.LinearLayoutParameter)
|
-- @return LinearLayoutParameter#LinearLayoutParameter self (return value: ccui.LinearLayoutParameter)
|
||||||
|
|
|
@ -180,8 +180,8 @@
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Changes scroll direction of scrollview.<br>
|
-- Changes scroll direction of scrollview.<br>
|
||||||
-- Direction Direction::VERTICAL means vertical scroll, Direction::HORIZONTAL means horizontal scroll<br>
|
-- Direction Direction::VERTICAL means vertical scroll, Direction::HORIZONTAL means horizontal scroll.<br>
|
||||||
-- param dir, set the list view's scroll direction
|
-- param dir Set the list view's scroll direction.
|
||||||
-- @function [parent=#ListView] setDirection
|
-- @function [parent=#ListView] setDirection
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #int dir
|
-- @param #int dir
|
||||||
|
@ -215,7 +215,9 @@
|
||||||
-- @return ListView#ListView self (return value: ccui.ListView)
|
-- @return ListView#ListView self (return value: ccui.ListView)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Default constructor
|
-- Default constructor<br>
|
||||||
|
-- js ctor<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#ListView] ListView
|
-- @function [parent=#ListView] ListView
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return ListView#ListView self (return value: ccui.ListView)
|
-- @return ListView#ListView self (return value: ccui.ListView)
|
||||||
|
|
|
@ -120,7 +120,9 @@
|
||||||
-- @return LoadingBar#LoadingBar self (return value: ccui.LoadingBar)
|
-- @return LoadingBar#LoadingBar self (return value: ccui.LoadingBar)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Default constructor.
|
-- Default constructor.<br>
|
||||||
|
-- js ctor<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#LoadingBar] LoadingBar
|
-- @function [parent=#LoadingBar] LoadingBar
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return LoadingBar#LoadingBar self (return value: ccui.LoadingBar)
|
-- @return LoadingBar#LoadingBar self (return value: ccui.LoadingBar)
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
-- @return rect_table#rect_table ret (return value: rect_table)
|
-- @return rect_table#rect_table ret (return value: rect_table)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
--
|
-- js NA
|
||||||
-- @function [parent=#MenuItem] getDescription
|
-- @function [parent=#MenuItem] getDescription
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return string#string ret (return value: string)
|
-- @return string#string ret (return value: string)
|
||||||
|
|
|
@ -6,14 +6,16 @@
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- get font size .<br>
|
-- get font size .<br>
|
||||||
-- js getFontSize
|
-- js getFontSize<br>
|
||||||
|
-- js NA
|
||||||
-- @function [parent=#MenuItemFont] getFontSizeObj
|
-- @function [parent=#MenuItemFont] getFontSizeObj
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return int#int ret (return value: int)
|
-- @return int#int ret (return value: int)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Returns the name of the Font.<br>
|
-- Returns the name of the Font.<br>
|
||||||
-- js getFontNameObj
|
-- js getFontNameObj<br>
|
||||||
|
-- js NA
|
||||||
-- @function [parent=#MenuItemFont] getFontNameObj
|
-- @function [parent=#MenuItemFont] getFontNameObj
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return string#string ret (return value: string)
|
-- @return string#string ret (return value: string)
|
||||||
|
@ -22,7 +24,8 @@
|
||||||
-- Set font size.<br>
|
-- Set font size.<br>
|
||||||
-- c++ can not overload static and non-static member functions with the same parameter types.<br>
|
-- c++ can not overload static and non-static member functions with the same parameter types.<br>
|
||||||
-- so change the name to setFontSizeObj.<br>
|
-- so change the name to setFontSizeObj.<br>
|
||||||
-- js setFontSize
|
-- js setFontSize<br>
|
||||||
|
-- js NA
|
||||||
-- @function [parent=#MenuItemFont] setFontSizeObj
|
-- @function [parent=#MenuItemFont] setFontSizeObj
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #int size
|
-- @param #int size
|
||||||
|
@ -32,7 +35,8 @@
|
||||||
-- Set the font name .<br>
|
-- Set the font name .<br>
|
||||||
-- c++ can not overload static and non-static member functions with the same parameter types.<br>
|
-- c++ can not overload static and non-static member functions with the same parameter types.<br>
|
||||||
-- so change the name to setFontNameObj.<br>
|
-- so change the name to setFontNameObj.<br>
|
||||||
-- js setFontName
|
-- js setFontName<br>
|
||||||
|
-- js NA
|
||||||
-- @function [parent=#MenuItemFont] setFontNameObj
|
-- @function [parent=#MenuItemFont] setFontNameObj
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #string name
|
-- @param #string name
|
||||||
|
|
|
@ -567,7 +567,7 @@
|
||||||
-- Executes an action, and returns the action that is executed.<br>
|
-- Executes an action, and returns the action that is executed.<br>
|
||||||
-- This node becomes the action's target. Refer to Action::getTarget().<br>
|
-- This node becomes the action's target. Refer to Action::getTarget().<br>
|
||||||
-- warning Actions don't retain their target.<br>
|
-- warning Actions don't retain their target.<br>
|
||||||
-- param An Action pointer
|
-- param action An Action pointer.
|
||||||
-- @function [parent=#Node] runAction
|
-- @function [parent=#Node] runAction
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #cc.Action action
|
-- @param #cc.Action action
|
||||||
|
|
|
@ -166,7 +166,9 @@
|
||||||
-- @return PageView#PageView self (return value: ccui.PageView)
|
-- @return PageView#PageView self (return value: ccui.PageView)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Default constructor
|
-- Default constructor<br>
|
||||||
|
-- js ctor<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#PageView] PageView
|
-- @function [parent=#PageView] PageView
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return PageView#PageView self (return value: ccui.PageView)
|
-- @return PageView#PageView self (return value: ccui.PageView)
|
||||||
|
|
|
@ -390,7 +390,7 @@
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Sets the source position of the emitter.<br>
|
-- Sets the source position of the emitter.<br>
|
||||||
-- param The source position of the emitter.
|
-- param pos The source position of the emitter.
|
||||||
-- @function [parent=#ParticleSystem] setSourcePosition
|
-- @function [parent=#ParticleSystem] setSourcePosition
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #vec2_table pos
|
-- @param #vec2_table pos
|
||||||
|
@ -713,7 +713,7 @@
|
||||||
-- This plist files can be created manually or with Particle Designer:<br>
|
-- This plist files can be created manually or with Particle Designer:<br>
|
||||||
-- http:particledesigner.71squared.com/<br>
|
-- http:particledesigner.71squared.com/<br>
|
||||||
-- since v2.0<br>
|
-- since v2.0<br>
|
||||||
-- param Particle plist file name.<br>
|
-- param plistFile Particle plist file name.<br>
|
||||||
-- return An autoreleased ParticleSystem object.
|
-- return An autoreleased ParticleSystem object.
|
||||||
-- @function [parent=#ParticleSystem] create
|
-- @function [parent=#ParticleSystem] create
|
||||||
-- @param self
|
-- @param self
|
||||||
|
|
|
@ -37,14 +37,14 @@
|
||||||
-- @return float#float ret (return value: float)
|
-- @return float#float ret (return value: float)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Set the distance between “clicks”.
|
-- Set the distance between "clicks".
|
||||||
-- @function [parent=#PhysicsJointRatchet] setRatchet
|
-- @function [parent=#PhysicsJointRatchet] setRatchet
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #float ratchet
|
-- @param #float ratchet
|
||||||
-- @return PhysicsJointRatchet#PhysicsJointRatchet self (return value: cc.PhysicsJointRatchet)
|
-- @return PhysicsJointRatchet#PhysicsJointRatchet self (return value: cc.PhysicsJointRatchet)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Get the distance between “clicks”.
|
-- Get the distance between "clicks".
|
||||||
-- @function [parent=#PhysicsJointRatchet] getRatchet
|
-- @function [parent=#PhysicsJointRatchet] getRatchet
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return float#float ret (return value: float)
|
-- @return float#float ret (return value: float)
|
||||||
|
@ -54,7 +54,7 @@
|
||||||
-- param a A is the body to connect.<br>
|
-- param a A is the body to connect.<br>
|
||||||
-- param b B is the body to connect.<br>
|
-- param b B is the body to connect.<br>
|
||||||
-- param phase Phase is the initial offset to use when deciding where the ratchet angles are.<br>
|
-- param phase Phase is the initial offset to use when deciding where the ratchet angles are.<br>
|
||||||
-- param ratchet Ratchet is the distance between “clicks”.<br>
|
-- param ratchet Ratchet is the distance between "clicks".<br>
|
||||||
-- return A object pointer.
|
-- return A object pointer.
|
||||||
-- @function [parent=#PhysicsJointRatchet] construct
|
-- @function [parent=#PhysicsJointRatchet] construct
|
||||||
-- @param self
|
-- @param self
|
||||||
|
|
|
@ -107,7 +107,7 @@
|
||||||
-- @return ProtectedNode#ProtectedNode self (return value: cc.ProtectedNode)
|
-- @return ProtectedNode#ProtectedNode self (return value: cc.ProtectedNode)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- / @} end of Children and Parent
|
-- js NA
|
||||||
-- @function [parent=#ProtectedNode] visit
|
-- @function [parent=#ProtectedNode] visit
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #cc.Renderer renderer
|
-- @param #cc.Renderer renderer
|
||||||
|
|
|
@ -13,7 +13,9 @@
|
||||||
-- @return RelativeBox#RelativeBox ret (return value: ccui.RelativeBox)
|
-- @return RelativeBox#RelativeBox ret (return value: ccui.RelativeBox)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Default constructor.
|
-- Default constructor.<br>
|
||||||
|
-- js ctor<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#RelativeBox] RelativeBox
|
-- @function [parent=#RelativeBox] RelativeBox
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return RelativeBox#RelativeBox self (return value: ccui.RelativeBox)
|
-- @return RelativeBox#RelativeBox self (return value: ccui.RelativeBox)
|
||||||
|
|
|
@ -72,7 +72,8 @@
|
||||||
-- @return RelativeLayoutParameter#RelativeLayoutParameter self (return value: ccui.RelativeLayoutParameter)
|
-- @return RelativeLayoutParameter#RelativeLayoutParameter self (return value: ccui.RelativeLayoutParameter)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Default constructor
|
-- Default constructor<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#RelativeLayoutParameter] RelativeLayoutParameter
|
-- @function [parent=#RelativeLayoutParameter] RelativeLayoutParameter
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return RelativeLayoutParameter#RelativeLayoutParameter self (return value: ccui.RelativeLayoutParameter)
|
-- @return RelativeLayoutParameter#RelativeLayoutParameter self (return value: ccui.RelativeLayoutParameter)
|
||||||
|
|
|
@ -77,7 +77,8 @@
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Flag: Use stack matrix computed from scene hierarchy or generate new modelView and projection matrix.<br>
|
-- Flag: Use stack matrix computed from scene hierarchy or generate new modelView and projection matrix.<br>
|
||||||
-- param keepMatrix Wether or not use stack matrix computed from scene hierarchy or generate new modelView and projection matrix.
|
-- param keepMatrix Wether or not use stack matrix computed from scene hierarchy or generate new modelView and projection matrix.<br>
|
||||||
|
-- js NA
|
||||||
-- @function [parent=#RenderTexture] setKeepMatrix
|
-- @function [parent=#RenderTexture] setKeepMatrix
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #bool keepMatrix
|
-- @param #bool keepMatrix
|
||||||
|
@ -125,7 +126,8 @@
|
||||||
-- @return RenderTexture#RenderTexture self (return value: cc.RenderTexture)
|
-- @return RenderTexture#RenderTexture self (return value: cc.RenderTexture)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- End is key word of lua, use other name to export to lua.
|
-- End is key word of lua, use other name to export to lua.<br>
|
||||||
|
-- js NA
|
||||||
-- @function [parent=#RenderTexture] endToLua
|
-- @function [parent=#RenderTexture] endToLua
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return RenderTexture#RenderTexture self (return value: cc.RenderTexture)
|
-- @return RenderTexture#RenderTexture self (return value: cc.RenderTexture)
|
||||||
|
@ -238,7 +240,8 @@
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- FIXME: should be procted.<br>
|
-- FIXME: should be procted.<br>
|
||||||
-- but due to a bug in PowerVR + Android,<br>
|
-- but due to a bug in PowerVR + Android,<br>
|
||||||
-- the constructor is public again.
|
-- the constructor is public again.<br>
|
||||||
|
-- js ctor
|
||||||
-- @function [parent=#RenderTexture] RenderTexture
|
-- @function [parent=#RenderTexture] RenderTexture
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return RenderTexture#RenderTexture self (return value: cc.RenderTexture)
|
-- @return RenderTexture#RenderTexture self (return value: cc.RenderTexture)
|
||||||
|
|
|
@ -18,7 +18,9 @@
|
||||||
-- @return bool#bool ret (return value: bool)
|
-- @return bool#bool ret (return value: bool)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- brief Default constructor.
|
-- brief Default constructor.<br>
|
||||||
|
-- js ctor<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#RichElement] RichElement
|
-- @function [parent=#RichElement] RichElement
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return RichElement#RichElement self (return value: ccui.RichElement)
|
-- @return RichElement#RichElement self (return value: ccui.RichElement)
|
||||||
|
|
|
@ -35,7 +35,9 @@
|
||||||
-- @return RichElementCustomNode#RichElementCustomNode ret (return value: ccui.RichElementCustomNode)
|
-- @return RichElementCustomNode#RichElementCustomNode ret (return value: ccui.RichElementCustomNode)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- brief Default constructor.
|
-- brief Default constructor.<br>
|
||||||
|
-- js ctor<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#RichElementCustomNode] RichElementCustomNode
|
-- @function [parent=#RichElementCustomNode] RichElementCustomNode
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return RichElementCustomNode#RichElementCustomNode self (return value: ccui.RichElementCustomNode)
|
-- @return RichElementCustomNode#RichElementCustomNode self (return value: ccui.RichElementCustomNode)
|
||||||
|
|
|
@ -35,7 +35,9 @@
|
||||||
-- @return RichElementImage#RichElementImage ret (return value: ccui.RichElementImage)
|
-- @return RichElementImage#RichElementImage ret (return value: ccui.RichElementImage)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- brief Default constructor.
|
-- brief Default constructor.<br>
|
||||||
|
-- js ctor<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#RichElementImage] RichElementImage
|
-- @function [parent=#RichElementImage] RichElementImage
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return RichElementImage#RichElementImage self (return value: ccui.RichElementImage)
|
-- @return RichElementImage#RichElementImage self (return value: ccui.RichElementImage)
|
||||||
|
|
|
@ -43,7 +43,9 @@
|
||||||
-- @return RichElementText#RichElementText ret (return value: ccui.RichElementText)
|
-- @return RichElementText#RichElementText ret (return value: ccui.RichElementText)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- brief Default constructor.
|
-- brief Default constructor.<br>
|
||||||
|
-- js ctor<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#RichElementText] RichElementText
|
-- @function [parent=#RichElementText] RichElementText
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return RichElementText#RichElementText self (return value: ccui.RichElementText)
|
-- @return RichElementText#RichElementText self (return value: ccui.RichElementText)
|
||||||
|
|
|
@ -79,7 +79,9 @@
|
||||||
-- @return RichText#RichText self (return value: ccui.RichText)
|
-- @return RichText#RichText self (return value: ccui.RichText)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- brief Default constructor.
|
-- brief Default constructor.<br>
|
||||||
|
-- js ctor<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#RichText] RichText
|
-- @function [parent=#RichText] RichText
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return RichText#RichText self (return value: ccui.RichText)
|
-- @return RichText#RichText self (return value: ccui.RichText)
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
-- @return RotateTo#RotateTo ret (return value: cc.RotateTo)
|
-- @return RotateTo#RotateTo ret (return value: cc.RotateTo)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- param dt In seconds.
|
-- param time In seconds.
|
||||||
-- @function [parent=#RotateTo] update
|
-- @function [parent=#RotateTo] update
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #float time
|
-- @param #float time
|
||||||
|
|
|
@ -37,7 +37,8 @@
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- brief Toggle 9-slice feature.<br>
|
-- brief Toggle 9-slice feature.<br>
|
||||||
-- If Scale9Sprite is 9-slice disabled, the Scale9Sprite will rendered as a normal sprite.<br>
|
-- If Scale9Sprite is 9-slice disabled, the Scale9Sprite will rendered as a normal sprite.<br>
|
||||||
-- param enabled True to enable 9-slice, false otherwise.
|
-- param enabled True to enable 9-slice, false otherwise.<br>
|
||||||
|
-- js NA
|
||||||
-- @function [parent=#Scale9Sprite] setScale9Enabled
|
-- @function [parent=#Scale9Sprite] setScale9Enabled
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #bool enabled
|
-- @param #bool enabled
|
||||||
|
@ -177,7 +178,8 @@
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- brief Query whether the Scale9Sprite is enable 9-slice or not.<br>
|
-- brief Query whether the Scale9Sprite is enable 9-slice or not.<br>
|
||||||
-- return True if 9-slice is enabled, false otherwise.
|
-- return True if 9-slice is enabled, false otherwise.<br>
|
||||||
|
-- js NA
|
||||||
-- @function [parent=#Scale9Sprite] isScale9Enabled
|
-- @function [parent=#Scale9Sprite] isScale9Enabled
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return bool#bool ret (return value: bool)
|
-- @return bool#bool ret (return value: bool)
|
||||||
|
@ -399,7 +401,8 @@
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Default constructor.<br>
|
-- Default constructor.<br>
|
||||||
-- js ctor
|
-- js ctor<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#Scale9Sprite] Scale9Sprite
|
-- @function [parent=#Scale9Sprite] Scale9Sprite
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return Scale9Sprite#Scale9Sprite self (return value: ccui.Scale9Sprite)
|
-- @return Scale9Sprite#Scale9Sprite self (return value: ccui.Scale9Sprite)
|
||||||
|
|
|
@ -134,7 +134,7 @@
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Move inner container to vertical percent position of scrollview.<br>
|
-- Move inner container to vertical percent position of scrollview.<br>
|
||||||
-- param A value between 0 and 100.
|
-- param percent A value between 0 and 100.
|
||||||
-- @function [parent=#ScrollView] jumpToPercentVertical
|
-- @function [parent=#ScrollView] jumpToPercentVertical
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #float percent
|
-- @param #float percent
|
||||||
|
@ -164,7 +164,7 @@
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Move inner container to horizontal percent position of scrollview.<br>
|
-- Move inner container to horizontal percent position of scrollview.<br>
|
||||||
-- param A value between 0 and 100.
|
-- param percent A value between 0 and 100.
|
||||||
-- @function [parent=#ScrollView] jumpToPercentHorizontal
|
-- @function [parent=#ScrollView] jumpToPercentHorizontal
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #float percent
|
-- @param #float percent
|
||||||
|
@ -202,7 +202,7 @@
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Move inner container to both direction percent position of scrollview.<br>
|
-- Move inner container to both direction percent position of scrollview.<br>
|
||||||
-- param A value between 0 and 100.
|
-- param percent A value between 0 and 100.
|
||||||
-- @function [parent=#ScrollView] jumpToPercentBothDirection
|
-- @function [parent=#ScrollView] jumpToPercentBothDirection
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #vec2_table percent
|
-- @param #vec2_table percent
|
||||||
|
@ -293,7 +293,7 @@
|
||||||
-- @function [parent=#ScrollView] addChild
|
-- @function [parent=#ScrollView] addChild
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @param #cc.Node child
|
-- @param #cc.Node child
|
||||||
-- @param #int zOrder
|
-- @param #int localZOrder
|
||||||
-- @param #string name
|
-- @param #string name
|
||||||
-- @return ScrollView#ScrollView self (return value: ccui.ScrollView)
|
-- @return ScrollView#ScrollView self (return value: ccui.ScrollView)
|
||||||
|
|
||||||
|
@ -341,7 +341,7 @@
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- When a widget is in a layout, you could call this method to get the next focused widget within a specified direction.<br>
|
-- When a widget is in a layout, you could call this method to get the next focused widget within a specified direction.<br>
|
||||||
-- If the widget is not in a layout, it will return itself<br>
|
-- If the widget is not in a layout, it will return itself<br>
|
||||||
-- param dir the direction to look for the next focused widget in a layout<br>
|
-- param direction the direction to look for the next focused widget in a layout<br>
|
||||||
-- param current the current focused widget<br>
|
-- param current the current focused widget<br>
|
||||||
-- return the next focused widget in a layout
|
-- return the next focused widget in a layout
|
||||||
-- @function [parent=#ScrollView] findNextFocusedWidget
|
-- @function [parent=#ScrollView] findNextFocusedWidget
|
||||||
|
@ -388,7 +388,9 @@
|
||||||
-- @return ScrollView#ScrollView self (return value: ccui.ScrollView)
|
-- @return ScrollView#ScrollView self (return value: ccui.ScrollView)
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
-- Default constructor
|
-- Default constructor<br>
|
||||||
|
-- js ctor<br>
|
||||||
|
-- lua new
|
||||||
-- @function [parent=#ScrollView] ScrollView
|
-- @function [parent=#ScrollView] ScrollView
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return ScrollView#ScrollView self (return value: ccui.ScrollView)
|
-- @return ScrollView#ScrollView self (return value: ccui.ScrollView)
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue