mirror of https://github.com/axmolengine/axmol.git
commit
bdce345b51
1
AUTHORS
1
AUTHORS
|
@ -540,6 +540,7 @@ Developers:
|
|||
|
||||
hawkwood (Justin Hawkwood)
|
||||
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)
|
||||
Fixing a bug that ccbRootPath wasn't passed to sub ccb nodes.
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
cocos2d-x-3.6beta0 Apr.14 2015
|
||||
[NEW] 3D: added texturecub supported
|
||||
[NEW] Animate3D: added `Animate3D::setHighQuality()` to set animation quality
|
||||
|
||||
[FIX] Audio: memory leak
|
||||
[FIX] Sprite3D: memory leak
|
||||
|
||||
cocos2d-x-3.5 Mar.23 2015
|
||||
|
|
|
@ -157,7 +157,7 @@ Select the test you want from Xcode Scheme chooser.
|
|||
|
||||
```
|
||||
$ cd cocos2d-x/build
|
||||
$ open cocos_tests.xcodeproj
|
||||
$ open cocos2d_tests.xcodeproj
|
||||
```
|
||||
|
||||
* For Linux
|
||||
|
|
|
@ -1282,6 +1282,8 @@
|
|||
38B8E2E219E671D2002D7CE7 /* UILayoutComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38B8E2DF19E671D2002D7CE7 /* UILayoutComponent.cpp */; };
|
||||
38B8E2E319E671D2002D7CE7 /* UILayoutComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 38B8E2E019E671D2002D7CE7 /* UILayoutComponent.h */; };
|
||||
38B8E2E419E671D2002D7CE7 /* UILayoutComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 38B8E2E019E671D2002D7CE7 /* UILayoutComponent.h */; };
|
||||
38D9629D1ACA9721007C6FAF /* CocoStudio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38D9629C1ACA9721007C6FAF /* CocoStudio.cpp */; };
|
||||
38D9629E1ACA9721007C6FAF /* CocoStudio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38D9629C1ACA9721007C6FAF /* CocoStudio.cpp */; };
|
||||
38F5263E1A48363B000DB7F7 /* ArmatureNodeReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38F5263B1A48363B000DB7F7 /* ArmatureNodeReader.cpp */; };
|
||||
38F5263F1A48363B000DB7F7 /* ArmatureNodeReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38F5263B1A48363B000DB7F7 /* ArmatureNodeReader.cpp */; };
|
||||
38F526401A48363B000DB7F7 /* ArmatureNodeReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 38F5263C1A48363B000DB7F7 /* ArmatureNodeReader.h */; };
|
||||
|
@ -3113,6 +3115,7 @@
|
|||
38B8E2D419E66581002D7CE7 /* CSLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSLoader.h; sourceTree = "<group>"; };
|
||||
38B8E2DF19E671D2002D7CE7 /* UILayoutComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UILayoutComponent.cpp; sourceTree = "<group>"; };
|
||||
38B8E2E019E671D2002D7CE7 /* UILayoutComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UILayoutComponent.h; sourceTree = "<group>"; };
|
||||
38D9629C1ACA9721007C6FAF /* CocoStudio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CocoStudio.cpp; sourceTree = "<group>"; };
|
||||
38F5263B1A48363B000DB7F7 /* ArmatureNodeReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ArmatureNodeReader.cpp; sourceTree = "<group>"; };
|
||||
38F5263C1A48363B000DB7F7 /* ArmatureNodeReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArmatureNodeReader.h; sourceTree = "<group>"; };
|
||||
38F5263D1A48363B000DB7F7 /* CSArmatureNode_generated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSArmatureNode_generated.h; sourceTree = "<group>"; };
|
||||
|
@ -4876,6 +4879,7 @@
|
|||
1A8C5984180E930E00EF57C3 /* CCUtilMath.cpp */,
|
||||
1A8C5985180E930E00EF57C3 /* CCUtilMath.h */,
|
||||
1A8C5986180E930E00EF57C3 /* CocoStudio.h */,
|
||||
38D9629C1ACA9721007C6FAF /* CocoStudio.cpp */,
|
||||
1A8C5989180E930E00EF57C3 /* DictionaryHelper.cpp */,
|
||||
1A8C598A180E930E00EF57C3 /* DictionaryHelper.h */,
|
||||
);
|
||||
|
@ -8617,6 +8621,7 @@
|
|||
B665E2561AA80A6500DDB1C5 /* CCPUDoAffectorEventHandlerTranslator.cpp in Sources */,
|
||||
15AE18A419AAD33D00C27E9E /* CCScale9SpriteLoader.cpp in Sources */,
|
||||
182C5CD61A98F30500C30D34 /* Sprite3DReader.cpp in Sources */,
|
||||
38D9629D1ACA9721007C6FAF /* CocoStudio.cpp in Sources */,
|
||||
B665E3D61AA80A6600DDB1C5 /* CCPUScriptParser.cpp in Sources */,
|
||||
15AE1B5719AADA9900C27E9E /* UISlider.cpp in Sources */,
|
||||
B665E2F61AA80A6500DDB1C5 /* CCPUListener.cpp in Sources */,
|
||||
|
@ -9060,6 +9065,7 @@
|
|||
B665E3AF1AA80A6500DDB1C5 /* CCPURender.cpp in Sources */,
|
||||
382383FB1A258FA7002C4610 /* idl_gen_go.cpp in Sources */,
|
||||
B665E2EF1AA80A6500DDB1C5 /* CCPULineEmitter.cpp in Sources */,
|
||||
38D9629E1ACA9721007C6FAF /* CocoStudio.cpp in Sources */,
|
||||
50ABBDBA1925AB4100A911A9 /* CCTextureAtlas.cpp in Sources */,
|
||||
1A5702FB180BCE750088DEC7 /* CCTMXXMLParser.cpp in Sources */,
|
||||
B665E40B1AA80A6600DDB1C5 /* CCPUSphereSurfaceEmitterTranslator.cpp in Sources */,
|
||||
|
|
|
@ -49,6 +49,7 @@ class CC_DLL ActionCamera : public ActionInterval //<NSCopying>
|
|||
public:
|
||||
/**
|
||||
* @js ctor
|
||||
* @lua new
|
||||
*/
|
||||
ActionCamera();
|
||||
/**
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
Copyright (c) 2008-2010 Ricardo Quesada
|
||||
Copyright (c) 2010-2012 cocos2d-x.org
|
||||
Copyright (c) 2011 Zynga Inc.
|
||||
Copyright (c) 2013-2014 Chukong Technologies Inc.
|
||||
Copyright (c) 2013-2015 Chukong Technologies Inc.
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
|
@ -33,13 +33,6 @@ THE SOFTWARE.
|
|||
#include "deprecated/CCString.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
|
||||
|
||||
static int _globalFontSize = kItemSize;
|
||||
|
@ -65,7 +58,7 @@ MenuItem* MenuItem::create()
|
|||
MenuItem* MenuItem::create(Ref *target, SEL_MenuHandler selector)
|
||||
{
|
||||
MenuItem *ret = new (std::nothrow) MenuItem();
|
||||
ret->initWithTarget(target, selector);
|
||||
ret->initWithCallback(std::bind(selector, target, std::placeholders::_1));
|
||||
ret->autorelease();
|
||||
return ret;
|
||||
}
|
||||
|
@ -81,8 +74,6 @@ MenuItem* MenuItem::create( const ccMenuCallback& callback)
|
|||
// FIXME: deprecated
|
||||
bool MenuItem::initWithTarget(cocos2d::Ref *target, SEL_MenuHandler selector )
|
||||
{
|
||||
_target = target;
|
||||
CC_SAFE_RETAIN(_target);
|
||||
return initWithCallback( std::bind(selector,target, std::placeholders::_1) );
|
||||
}
|
||||
|
||||
|
@ -102,7 +93,6 @@ MenuItem::~MenuItem()
|
|||
void MenuItem::onExit()
|
||||
{
|
||||
Node::onExit();
|
||||
CC_SAFE_RELEASE(_target);
|
||||
}
|
||||
|
||||
void MenuItem::selected()
|
||||
|
@ -159,8 +149,6 @@ bool MenuItem::isSelected() const
|
|||
// FIXME: deprecated
|
||||
void MenuItem::setTarget(Ref *target, SEL_MenuHandler selector)
|
||||
{
|
||||
_target = target;
|
||||
CC_SAFE_RETAIN(_target);
|
||||
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 *ret = new (std::nothrow) MenuItemLabel();
|
||||
ret->initWithLabel(label, target, selector);
|
||||
ret->initWithLabel(label, std::bind(selector, target, std::placeholders::_1));
|
||||
ret->autorelease();
|
||||
return ret;
|
||||
}
|
||||
|
@ -223,8 +211,6 @@ MenuItemLabel* MenuItemLabel::create(Node *label)
|
|||
// FIXME:: deprecated
|
||||
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) );
|
||||
}
|
||||
|
||||
|
@ -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 *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();
|
||||
return ret;
|
||||
}
|
||||
|
@ -345,8 +331,6 @@ MenuItemAtlasFont * MenuItemAtlasFont::create(const std::string& value, const st
|
|||
// FIXME:: deprecated
|
||||
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) );
|
||||
}
|
||||
|
||||
|
@ -395,7 +379,7 @@ const std::string& MenuItemFont::getFontName()
|
|||
MenuItemFont * MenuItemFont::create(const std::string& value, Ref* target, SEL_MenuHandler selector)
|
||||
{
|
||||
MenuItemFont *ret = new (std::nothrow) MenuItemFont();
|
||||
ret->initWithString(value, target, selector);
|
||||
ret->initWithString(value, std::bind(selector, target, std::placeholders::_1));
|
||||
ret->autorelease();
|
||||
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");
|
||||
|
||||
_target = target;
|
||||
CC_SAFE_RETAIN(target);
|
||||
return initWithString(value, std::bind(selector,target, std::placeholders::_1) );
|
||||
}
|
||||
|
||||
|
@ -552,7 +534,7 @@ MenuItemSprite * MenuItemSprite::create(Node* normalSprite, Node* selectedSprite
|
|||
// FIXME: deprecated
|
||||
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)
|
||||
|
@ -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 *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();
|
||||
return ret;
|
||||
}
|
||||
|
@ -580,8 +562,6 @@ MenuItemSprite * MenuItemSprite::create(Node *normalSprite, Node *selectedSprite
|
|||
// FIXME: deprecated
|
||||
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) );
|
||||
}
|
||||
|
||||
|
@ -712,7 +692,7 @@ MenuItemImage * MenuItemImage::create(const std::string& normalImage, const std:
|
|||
// FIXME: deprecated
|
||||
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)
|
||||
|
@ -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 *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();
|
||||
return ret;
|
||||
|
@ -760,8 +740,6 @@ MenuItemImage * MenuItemImage::create(const std::string& normalImage, const std:
|
|||
// FIXME:: deprecated
|
||||
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) );
|
||||
}
|
||||
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 *ret = new (std::nothrow) MenuItemToggle();
|
||||
ret->MenuItem::initWithTarget(target, selector);
|
||||
ret->MenuItem::initWithCallback(std::bind(selector, target, std::placeholders::_1));
|
||||
ret->_subItems = menuItems;
|
||||
ret->_selectedIndex = UINT_MAX;
|
||||
ret->setSelectedIndex(0);
|
||||
|
@ -836,7 +814,7 @@ MenuItemToggle * MenuItemToggle::createWithTarget(Ref* target, SEL_MenuHandler s
|
|||
va_list args;
|
||||
va_start(args, item);
|
||||
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();
|
||||
va_end(args);
|
||||
return ret;
|
||||
|
@ -877,8 +855,6 @@ MenuItemToggle * MenuItemToggle::create()
|
|||
// FIXME:: deprecated
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -995,9 +971,3 @@ MenuItem* MenuItemToggle::getSelectedItem()
|
|||
}
|
||||
|
||||
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)
|
||||
, _enabled(false)
|
||||
, _callback(nullptr)
|
||||
, _target(nullptr)
|
||||
{}
|
||||
/**
|
||||
* @js NA
|
||||
|
@ -133,8 +132,6 @@ protected:
|
|||
bool _enabled;
|
||||
// callback
|
||||
ccMenuCallback _callback;
|
||||
// If using the old API, the _target needs to be retained / released
|
||||
Ref *_target;
|
||||
|
||||
private:
|
||||
CC_DISALLOW_COPY_AND_ASSIGN(MenuItem);
|
||||
|
|
|
@ -62,6 +62,7 @@ ValueMap& TMXLayerInfo::getProperties()
|
|||
{
|
||||
return _properties;
|
||||
}
|
||||
|
||||
void TMXLayerInfo::setProperties(ValueMap var)
|
||||
{
|
||||
_properties = var;
|
||||
|
@ -123,12 +124,12 @@ TMXMapInfo * TMXMapInfo::createWithXML(const std::string& tmxString, const std::
|
|||
|
||||
void TMXMapInfo::internalInit(const std::string& tmxFileName, const std::string& resourcePath)
|
||||
{
|
||||
if (tmxFileName.size() > 0)
|
||||
if (!tmxFileName.empty())
|
||||
{
|
||||
_TMXFileName = FileUtils::getInstance()->fullPathForFilename(tmxFileName);
|
||||
}
|
||||
|
||||
if (resourcePath.size() > 0)
|
||||
if (!resourcePath.empty())
|
||||
{
|
||||
_resources = resourcePath;
|
||||
}
|
||||
|
@ -142,6 +143,7 @@ void TMXMapInfo::internalInit(const std::string& tmxFileName, const std::string&
|
|||
_parentElement = TMXPropertyNone;
|
||||
_currentFirstGID = -1;
|
||||
}
|
||||
|
||||
bool TMXMapInfo::initWithXML(const std::string& tmxString, const std::string& resourcePath)
|
||||
{
|
||||
internalInit("", resourcePath);
|
||||
|
@ -202,20 +204,19 @@ bool TMXMapInfo::parseXMLFile(const std::string& xmlFilename)
|
|||
return parser.parse(FileUtils::getInstance()->fullPathForFilename(xmlFilename).c_str());
|
||||
}
|
||||
|
||||
|
||||
// the XML parser calls here with all the elements
|
||||
void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
|
||||
{
|
||||
CC_UNUSED_PARAM(ctx);
|
||||
TMXMapInfo *tmxMapInfo = this;
|
||||
std::string elementName = (char*)name;
|
||||
std::string elementName = name;
|
||||
ValueMap attributeDict;
|
||||
if (atts && atts[0])
|
||||
{
|
||||
for (int i = 0; atts[i]; i += 2)
|
||||
{
|
||||
std::string key = (char*)atts[i];
|
||||
std::string value = (char*)atts[i+1];
|
||||
std::string key = atts[i];
|
||||
std::string value = atts[i+1];
|
||||
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());
|
||||
}
|
||||
std::string orientationStr = attributeDict["orientation"].asString();
|
||||
if (orientationStr == "orthogonal")
|
||||
if (orientationStr == "orthogonal") {
|
||||
tmxMapInfo->setOrientation(TMXOrientationOrtho);
|
||||
else if (orientationStr == "isometric")
|
||||
}
|
||||
else if (orientationStr == "isometric") {
|
||||
tmxMapInfo->setOrientation(TMXOrientationIso);
|
||||
else if(orientationStr == "hexagonal")
|
||||
}
|
||||
else if (orientationStr == "hexagonal") {
|
||||
tmxMapInfo->setOrientation(TMXOrientationHex);
|
||||
else if(orientationStr == "staggered")
|
||||
}
|
||||
else if (orientationStr == "staggered") {
|
||||
tmxMapInfo->setOrientation(TMXOrientationStaggered);
|
||||
else
|
||||
}
|
||||
else {
|
||||
CCLOG("cocos2d: TMXFomat: Unsupported orientation: %d", tmxMapInfo->getOrientation());
|
||||
}
|
||||
|
||||
Size s;
|
||||
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"
|
||||
tmxMapInfo->setParentElement(TMXPropertyLayer);
|
||||
|
||||
}
|
||||
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"
|
||||
tmxMapInfo->setParentElement(TMXPropertyObjectGroup);
|
||||
|
||||
}
|
||||
else if (elementName == "image")
|
||||
{
|
||||
|
@ -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" );
|
||||
}
|
||||
|
||||
}
|
||||
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
|
||||
ValueMap dict;
|
||||
// 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];
|
||||
dict[key] = value;
|
||||
}
|
||||
|
@ -470,7 +472,6 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
|
|||
|
||||
// The parent element is now "object"
|
||||
tmxMapInfo->setParentElement(TMXPropertyObject);
|
||||
|
||||
}
|
||||
else if (elementName == "property")
|
||||
{
|
||||
|
@ -616,9 +617,7 @@ void TMXMapInfo::endElement(void *ctx, const char *name)
|
|||
{
|
||||
CC_UNUSED_PARAM(ctx);
|
||||
TMXMapInfo *tmxMapInfo = this;
|
||||
std::string elementName = (char*)name;
|
||||
|
||||
int len = 0;
|
||||
std::string elementName = name;
|
||||
|
||||
if (elementName == "data")
|
||||
{
|
||||
|
@ -630,7 +629,7 @@ void TMXMapInfo::endElement(void *ctx, const char *name)
|
|||
|
||||
std::string currentString = tmxMapInfo->getCurrentString();
|
||||
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)
|
||||
{
|
||||
CCLOG("cocos2d: TiledMap: decode data error");
|
||||
|
@ -669,7 +668,6 @@ void TMXMapInfo::endElement(void *ctx, const char *name)
|
|||
{
|
||||
_xmlTileIndex = 0;
|
||||
}
|
||||
|
||||
}
|
||||
else if (elementName == "map")
|
||||
{
|
||||
|
@ -701,7 +699,7 @@ void TMXMapInfo::textHandler(void *ctx, const char *ch, int len)
|
|||
{
|
||||
CC_UNUSED_PARAM(ctx);
|
||||
TMXMapInfo *tmxMapInfo = this;
|
||||
std::string text((char*)ch,0,len);
|
||||
std::string text(ch, 0, len);
|
||||
|
||||
if (tmxMapInfo->isStoringCharacters())
|
||||
{
|
||||
|
|
|
@ -108,10 +108,13 @@ class CC_DLL TextFieldTTF : public Label, public IMEDelegate
|
|||
{
|
||||
public:
|
||||
/**
|
||||
* Default constructor.
|
||||
* @js ctor
|
||||
*/
|
||||
TextFieldTTF();
|
||||
|
||||
/**
|
||||
* Default destructor.
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
|
|
|
@ -102,6 +102,8 @@ public:
|
|||
*/
|
||||
void hideOutShowIn(void);
|
||||
|
||||
Scene* getInScene() const{ return _inScene; }
|
||||
float getDuration() const { return _duration; }
|
||||
//
|
||||
// Overrides
|
||||
//
|
||||
|
|
|
@ -515,6 +515,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\chipmunk\prebuilt\win32\release-lib\*.*
|
|||
<ClCompile Include="..\editor-support\cocostudio\CCTween.cpp" />
|
||||
<ClCompile Include="..\editor-support\cocostudio\CCUtilMath.cpp" />
|
||||
<ClCompile Include="..\editor-support\cocostudio\CocoLoader.cpp" />
|
||||
<ClCompile Include="..\editor-support\cocostudio\CocoStudio.cpp" />
|
||||
<ClCompile Include="..\editor-support\cocostudio\DictionaryHelper.cpp" />
|
||||
<ClCompile Include="..\editor-support\cocostudio\FlatBuffersSerialize.cpp" />
|
||||
<ClCompile Include="..\editor-support\cocostudio\TriggerBase.cpp" />
|
||||
|
|
|
@ -1798,6 +1798,9 @@
|
|||
<ClCompile Include="..\editor-support\cocostudio\CCObjectExtensionData.cpp">
|
||||
<Filter>cocostudio\json</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\editor-support\cocostudio\CocoStudio.cpp">
|
||||
<Filter>cocostudio\json</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\physics\CCPhysicsBody.h">
|
||||
|
|
|
@ -949,6 +949,7 @@
|
|||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\CCTween.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\CCUtilMath.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\CocoLoader.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\CocoStudio.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\DictionaryHelper.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\FlatBuffersSerialize.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\TriggerBase.cpp" />
|
||||
|
|
|
@ -3318,6 +3318,9 @@
|
|||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\3d\CCTerrain.cpp">
|
||||
<Filter>3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\..\..\editor-support\cocostudio\CocoStudio.cpp">
|
||||
<Filter>cocostudio\json</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="2d">
|
||||
|
|
|
@ -538,6 +538,7 @@
|
|||
<ClInclude Include="..\editor-support\cocostudio\CCTween.h" />
|
||||
<ClInclude Include="..\editor-support\cocostudio\CCUtilMath.h" />
|
||||
<ClInclude Include="..\editor-support\cocostudio\CocoLoader.h" />
|
||||
<ClInclude Include="..\editor-support\cocostudio\CocoStudio.h" />
|
||||
<ClInclude Include="..\editor-support\cocostudio\CSParseBinary_generated.h" />
|
||||
<ClInclude Include="..\editor-support\cocostudio\CSParse3DBinary_generated.h" />
|
||||
<ClInclude Include="..\editor-support\cocostudio\DictionaryHelper.h" />
|
||||
|
@ -1179,6 +1180,7 @@
|
|||
<ClCompile Include="..\editor-support\cocostudio\CCTween.cpp" />
|
||||
<ClCompile Include="..\editor-support\cocostudio\CCUtilMath.cpp" />
|
||||
<ClCompile Include="..\editor-support\cocostudio\CocoLoader.cpp" />
|
||||
<ClCompile Include="..\editor-support\cocostudio\CocoStudio.cpp" />
|
||||
<ClCompile Include="..\editor-support\cocostudio\DictionaryHelper.cpp" />
|
||||
<ClCompile Include="..\editor-support\cocostudio\FlatBuffersSerialize.cpp" />
|
||||
<ClCompile Include="..\editor-support\cocostudio\TriggerBase.cpp" />
|
||||
|
|
|
@ -1815,6 +1815,9 @@
|
|||
<ClCompile Include="..\3d\CCTextureCube.cpp">
|
||||
<Filter>3d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\editor-support\cocostudio\CocoStudio.cpp">
|
||||
<Filter>cocostudio\json</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="CCAction.h">
|
||||
|
@ -3528,6 +3531,9 @@
|
|||
<ClInclude Include="..\3d\CCTextureCube.h">
|
||||
<Filter>3d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\editor-support\cocostudio\CocoStudio.h">
|
||||
<Filter>cocostudio\json</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\math\Mat4.inl">
|
||||
|
|
|
@ -44,11 +44,13 @@ class CC_DLL AABB
|
|||
public:
|
||||
/**
|
||||
* Constructor.
|
||||
* @lua new
|
||||
*/
|
||||
AABB();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* @lua new
|
||||
*/
|
||||
AABB(const Vec3& min, const Vec3& max);
|
||||
|
||||
|
@ -122,7 +124,7 @@ public:
|
|||
Vec3 _max;
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
// end of 3d group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "3d/CCSprite3D.h"
|
||||
#include "3d/CCSkeleton3D.h"
|
||||
#include "platform/CCFileUtils.h"
|
||||
#include "base/CCConfiguration.h"
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
|
@ -68,6 +69,7 @@ bool Animate3D::init(Animation3D* animation)
|
|||
animation->retain();
|
||||
setDuration(animation->getDuration());
|
||||
setOriginInterval(animation->getDuration());
|
||||
setHighQuality(Configuration::getInstance()->isHighAnimate3DQuality());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -83,6 +85,7 @@ bool Animate3D::init(Animation3D* animation, float fromTime, float duration)
|
|||
setOriginInterval(duration);
|
||||
_animation = animation;
|
||||
animation->retain();
|
||||
setHighQuality(Configuration::getInstance()->isHighAnimate3DQuality());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -310,29 +313,27 @@ void Animate3D::update(float t)
|
|||
t = 1 - t;
|
||||
|
||||
t = _start + t * _last;
|
||||
for (const auto& it : _boneCurves)
|
||||
{
|
||||
|
||||
for (const auto& it : _boneCurves) {
|
||||
auto bone = it.first;
|
||||
auto curve = it.second;
|
||||
if (curve->translateCurve)
|
||||
{
|
||||
curve->translateCurve->evaluate(t, transDst, EvaluateType::INT_LINEAR);
|
||||
curve->translateCurve->evaluate(t, transDst, _translateEvaluate);
|
||||
trans = &transDst[0];
|
||||
}
|
||||
if (curve->rotCurve)
|
||||
{
|
||||
curve->rotCurve->evaluate(t, rotDst, EvaluateType::INT_QUAT_SLERP);
|
||||
curve->rotCurve->evaluate(t, rotDst, _roteEvaluate);
|
||||
rot = &rotDst[0];
|
||||
}
|
||||
if (curve->scaleCurve)
|
||||
{
|
||||
curve->scaleCurve->evaluate(t, scaleDst, EvaluateType::INT_LINEAR);
|
||||
curve->scaleCurve->evaluate(t, scaleDst, _scaleEvaluate);
|
||||
scale = &scaleDst[0];
|
||||
}
|
||||
bone->setAnimationValue(trans, rot, scale, this, _weight);
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto& it : _nodeCurves)
|
||||
{
|
||||
|
@ -341,18 +342,18 @@ void Animate3D::update(float t)
|
|||
Mat4 transform;
|
||||
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]);
|
||||
}
|
||||
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]);
|
||||
transform.rotate(qua);
|
||||
}
|
||||
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]);
|
||||
}
|
||||
node->setAdditionalTransform(&transform);
|
||||
|
@ -383,6 +384,28 @@ void Animate3D::setOriginInterval(float 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()
|
||||
: _state(Animate3D::Animate3DState::Running)
|
||||
, _animation(nullptr)
|
||||
|
@ -395,7 +418,7 @@ Animate3D::Animate3D()
|
|||
, _lastTime(0.0f)
|
||||
, _originInterval(0.0f)
|
||||
{
|
||||
|
||||
setHighQuality(true);
|
||||
}
|
||||
Animate3D::~Animate3D()
|
||||
{
|
||||
|
@ -410,11 +433,8 @@ void Animate3D::removeFromMap()
|
|||
if (_target)
|
||||
{
|
||||
Sprite3D* sprite = static_cast<Sprite3D*>(_target);
|
||||
if (_state == Animate3D::Animate3DState::FadeIn)
|
||||
s_fadeInAnimates.erase(sprite);
|
||||
else if (_state == Animate3D::Animate3DState::FadeOut)
|
||||
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 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:
|
||||
|
||||
Animate3D();
|
||||
|
@ -137,6 +148,13 @@ protected:
|
|||
float _accTransTime; // acculate transition time
|
||||
float _lastTime; // last t (0 - 1)
|
||||
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<Node*, Animation3D::Curve*> _nodeCurves;
|
||||
|
||||
|
@ -146,7 +164,7 @@ protected:
|
|||
static std::unordered_map<Node*, Animate3D*> s_runningAnimates;
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
// end of 3d group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -54,25 +54,36 @@ public:
|
|||
public:
|
||||
typedef AnimationCurve<3> AnimationCurveVec3;
|
||||
typedef AnimationCurve<4> AnimationCurveQuat;
|
||||
AnimationCurveVec3* translateCurve; //translate curve
|
||||
AnimationCurveQuat* rotCurve;//rotation curve
|
||||
AnimationCurveVec3* scaleCurve;//scale curve
|
||||
|
||||
/**translation curve*/
|
||||
AnimationCurveVec3* translateCurve;
|
||||
/**rotation curve*/
|
||||
AnimationCurveQuat* rotCurve;
|
||||
/**scaling curve*/
|
||||
AnimationCurveVec3* scaleCurve;
|
||||
/**constructor */
|
||||
Curve();
|
||||
/**constructor */
|
||||
~Curve();
|
||||
};
|
||||
|
||||
/**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 = "");
|
||||
|
||||
/**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); }
|
||||
|
||||
/**get duration*/
|
||||
float getDuration() const { return _duration; }
|
||||
|
||||
/**get bone curve*/
|
||||
/**
|
||||
* get bone curve
|
||||
*
|
||||
* @lua NA
|
||||
*/
|
||||
Curve* getBoneCurveByName(const std::string& name) const;
|
||||
|
||||
|
||||
/**get the bone Curves set*/
|
||||
const std::unordered_map<std::string, Curve*>& getBoneCurves() const {return _boneCurves;}
|
||||
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
@ -120,7 +131,7 @@ protected:
|
|||
std::unordered_map<std::string, Animation3D*> _animations; //cached animations
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
// end of 3d group
|
||||
/// @}
|
||||
NS_CC_END
|
||||
|
||||
|
|
|
@ -54,6 +54,8 @@ enum class EvaluateType
|
|||
|
||||
/**
|
||||
* @brief curve of bone's position, rotation or scale
|
||||
*
|
||||
* @lua NA
|
||||
*/
|
||||
template <int componentSize>
|
||||
class AnimationCurve: public Ref
|
||||
|
@ -100,7 +102,7 @@ protected:
|
|||
std::function<void(float time, float* dst)> _evaluateFun; //user defined function
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
// end of 3d group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -68,7 +68,7 @@ protected:
|
|||
mutable Mat4 _transformToParent;
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
// end of 3d group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
VIEW_POINT_ORIENTED, // orient to the camera
|
||||
VIEW_PLANE_ORIENTED // orient to the XOY plane of camera
|
||||
};
|
||||
/// @{
|
||||
|
||||
/// @name Creators
|
||||
|
||||
/**
|
||||
|
@ -96,7 +96,11 @@ public:
|
|||
/** update billboard's transform and turn it towards camera */
|
||||
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;
|
||||
|
||||
|
||||
|
@ -122,7 +126,7 @@ private:
|
|||
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
// end of 3d group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -874,6 +874,8 @@ bool Bundle3D::loadMaterialsBinary(MaterialDatas& materialdatas)
|
|||
{
|
||||
NMaterialData materialData;
|
||||
materialData.id = _binaryReader.readString();
|
||||
|
||||
// skip: diffuse(3), ambient(3), emissive(3), opacity(1), specular(3), shininess(1)
|
||||
float data[14];
|
||||
_binaryReader.read(&data,sizeof(float), 14);
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ class Data;
|
|||
* c3t text file
|
||||
* c3b binary file
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
class CC_DLL Bundle3D
|
||||
{
|
||||
|
@ -181,7 +182,7 @@ protected:
|
|||
bool _isBinary;
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
// end of 3d group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -37,6 +37,7 @@ NS_CC_BEGIN
|
|||
|
||||
/**mesh vertex attribute
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
struct MeshVertexAttrib
|
||||
{
|
||||
|
@ -53,6 +54,7 @@ struct MeshVertexAttrib
|
|||
|
||||
/** model node data, since 3.3
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
struct ModelData
|
||||
{
|
||||
|
@ -74,6 +76,7 @@ struct ModelData
|
|||
|
||||
/** Node data, since 3.3
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
struct NodeData
|
||||
{
|
||||
|
@ -107,6 +110,7 @@ struct NodeData
|
|||
|
||||
/** node datas, since 3.3
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
struct NodeDatas
|
||||
{
|
||||
|
@ -130,6 +134,7 @@ struct NodeDatas
|
|||
|
||||
/**mesh data
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
struct MeshData
|
||||
{
|
||||
|
@ -185,6 +190,7 @@ public:
|
|||
|
||||
/** mesh datas
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
struct MeshDatas
|
||||
{
|
||||
|
@ -206,6 +212,7 @@ struct MeshDatas
|
|||
|
||||
/**skin data
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
struct SkinData
|
||||
{
|
||||
|
@ -277,6 +284,7 @@ struct SkinData
|
|||
|
||||
/**material data,
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
struct MaterialData
|
||||
{
|
||||
|
@ -290,6 +298,7 @@ struct MaterialData
|
|||
|
||||
/**new material, since 3.3
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
struct NTextureData
|
||||
{
|
||||
|
@ -328,6 +337,7 @@ struct NMaterialData
|
|||
};
|
||||
/** material datas, since 3.3
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
struct MaterialDatas
|
||||
{
|
||||
|
@ -348,6 +358,7 @@ struct MaterialDatas
|
|||
};
|
||||
/**animation data
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
struct Animation3DData
|
||||
{
|
||||
|
@ -420,6 +431,7 @@ public:
|
|||
|
||||
/**reference data
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
struct Reference
|
||||
{
|
||||
|
|
|
@ -42,6 +42,7 @@ NS_CC_BEGIN
|
|||
/**
|
||||
* @brief BundleReader is an interface for reading sequence of bytes.
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
class BundleReader: public cocos2d::Ref
|
||||
{
|
||||
|
@ -128,6 +129,8 @@ private:
|
|||
char* _buffer;
|
||||
};
|
||||
|
||||
/// @cond
|
||||
|
||||
/**
|
||||
* template read routines
|
||||
*/
|
||||
|
@ -207,7 +210,9 @@ inline bool BundleReader::readArray<std::string>(unsigned int *length, std::vect
|
|||
return true;
|
||||
}
|
||||
|
||||
// end of actions group
|
||||
/// @endcond
|
||||
|
||||
// end of 3d group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -39,6 +39,7 @@ class Camera;
|
|||
* the frustum is a six-side geometry, usually use the frustum to do fast-culling:
|
||||
* check a entity whether is a potential visible entity
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
class CC_DLL Frustum
|
||||
{
|
||||
|
|
|
@ -59,14 +59,28 @@ public:
|
|||
/**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); }
|
||||
|
||||
/**
|
||||
* @lua NA
|
||||
*/
|
||||
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);
|
||||
|
||||
/**get vertex buffer*/
|
||||
/**
|
||||
* get vertex buffer
|
||||
*
|
||||
* @lua NA
|
||||
*/
|
||||
GLuint getVertexBuffer() const;
|
||||
/**has vertex attribute?*/
|
||||
/**
|
||||
* has vertex attribute?
|
||||
*
|
||||
* @lua NA
|
||||
*/
|
||||
bool hasVertexAttrib(int attrib) const;
|
||||
/**get mesh vertex attribute count*/
|
||||
ssize_t getMeshVertexAttribCount() const;
|
||||
|
@ -84,13 +98,25 @@ public:
|
|||
void setVisible(bool visible);
|
||||
bool isVisible() const { return _visible; }
|
||||
|
||||
/**skin getter */
|
||||
/**
|
||||
* skin getter
|
||||
*
|
||||
* @lua NA
|
||||
*/
|
||||
MeshSkin* getSkin() const { return _skin; }
|
||||
|
||||
/**mesh index data getter */
|
||||
/**
|
||||
* mesh index data getter
|
||||
*
|
||||
* @lua NA
|
||||
*/
|
||||
MeshIndexData* getMeshIndexData() const { return _meshIndexData; }
|
||||
|
||||
/**get GLProgramState*/
|
||||
/**
|
||||
* get GLProgramState
|
||||
*
|
||||
* @lua NA
|
||||
*/
|
||||
GLProgramState* getGLProgramState() const { return _glProgramState; }
|
||||
|
||||
/**name getter */
|
||||
|
@ -99,13 +125,29 @@ public:
|
|||
void setBlendFunc(const BlendFunc &blendFunc);
|
||||
const BlendFunc &getBlendFunc() const;
|
||||
|
||||
/** get primitive type*/
|
||||
/**
|
||||
* get primitive type
|
||||
*
|
||||
* @lua NA
|
||||
*/
|
||||
GLenum getPrimitiveType() const;
|
||||
/**get index count*/
|
||||
/**
|
||||
* get index count
|
||||
*
|
||||
* @lua NA
|
||||
*/
|
||||
ssize_t getIndexCount() const;
|
||||
/**get index format*/
|
||||
/**
|
||||
* get index format
|
||||
*
|
||||
* @lua NA
|
||||
*/
|
||||
GLenum getIndexFormat() const;
|
||||
/**get index buffer*/
|
||||
/**
|
||||
* get index buffer
|
||||
*
|
||||
* @lua NA
|
||||
*/
|
||||
GLuint getIndexBuffer() const;
|
||||
|
||||
/**get AABB*/
|
||||
|
@ -163,7 +205,7 @@ protected:
|
|||
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.
|
||||
* And it is responsible for computing matrix palletes that used by skin mesh rendering.
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
class CC_DLL MeshSkin: public Ref
|
||||
{
|
||||
|
@ -105,7 +106,7 @@ protected:
|
|||
Vec4* _matrixPalette;
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
// end of 3d group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -52,6 +52,7 @@ class MeshVertexData;
|
|||
* the MeshIndexData class.
|
||||
* @brief the MeshIndexData contain all of the indices data which mesh need.
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
class MeshIndexData : public Ref
|
||||
{
|
||||
|
@ -138,7 +139,7 @@ protected:
|
|||
int _vertexCount; //vertex count
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
// end of 3d group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -46,11 +46,15 @@ public:
|
|||
|
||||
/*
|
||||
* Construct obb from oriented bounding box
|
||||
*
|
||||
* @lua NA
|
||||
*/
|
||||
OBB(const AABB& aabb);
|
||||
|
||||
/*
|
||||
* Construct obb from points
|
||||
*
|
||||
* @lua NA
|
||||
*/
|
||||
OBB(const Vec3* verts, int num);
|
||||
|
||||
|
@ -135,7 +139,7 @@ public:
|
|||
Vec3 _extents; // obb length along each axis
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
// end of 3d group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -24,6 +24,7 @@ NS_CC_BEGIN
|
|||
/**
|
||||
* @brief .obj file Loader
|
||||
* @js NA
|
||||
* @lua NA
|
||||
**/
|
||||
class ObjLoader
|
||||
{
|
||||
|
@ -106,7 +107,7 @@ public:
|
|||
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
// end of 3d group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -40,6 +40,7 @@ enum class PointSide
|
|||
/**
|
||||
* Defines plane
|
||||
* @js NA
|
||||
* @lua NA
|
||||
**/
|
||||
class CC_DLL Plane
|
||||
{
|
||||
|
|
|
@ -46,11 +46,14 @@ class CC_DLL Ray
|
|||
public:
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @lua new
|
||||
*/
|
||||
Ray();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* @lua NA
|
||||
*/
|
||||
Ray(const Ray& ray);
|
||||
|
||||
|
@ -59,11 +62,13 @@ public:
|
|||
*
|
||||
* @param origin The ray's origin.
|
||||
* @param direction The ray's direction.
|
||||
* @lua new
|
||||
*/
|
||||
Ray(const Vec3& origin, const Vec3& direction);
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
* @lua NA
|
||||
*/
|
||||
~Ray();
|
||||
|
||||
|
@ -99,7 +104,7 @@ public:
|
|||
Vec3 _direction; // The ray direction vector.
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
// end of 3d group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -39,6 +39,7 @@ NS_CC_BEGIN
|
|||
|
||||
/**
|
||||
* @brief Defines a basic hierachial structure of transformation spaces.
|
||||
* @lua NA
|
||||
*/
|
||||
class CC_DLL Bone3D : public Ref
|
||||
{
|
||||
|
@ -189,7 +190,9 @@ protected:
|
|||
class CC_DLL Skeleton3D: public Ref
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* @lua NA
|
||||
*/
|
||||
static Skeleton3D* create(const std::vector<NodeData*>& skeletondata);
|
||||
|
||||
/**get total bone count*/
|
||||
|
@ -231,7 +234,7 @@ protected:
|
|||
Vector<Bone3D*> _rootBones;
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
// end of 3d group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -22,6 +22,14 @@
|
|||
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/CCTextureCube.h"
|
||||
|
||||
|
@ -53,6 +61,17 @@ Skybox::~Skybox()
|
|||
_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()
|
||||
{
|
||||
// create and set our custom shader
|
||||
|
@ -68,6 +87,19 @@ bool Skybox::init()
|
|||
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()
|
||||
{
|
||||
if (Configuration::getInstance()->supportsShareableVAO())
|
||||
|
@ -121,6 +153,9 @@ void Skybox::onDraw(const Mat4& transform, uint32_t flags)
|
|||
auto state = getGLProgramState();
|
||||
state->apply(transform);
|
||||
|
||||
Vec4 color(_displayedColor.r / 255.f, _displayedColor.g / 255.f, _displayedColor.b / 255.f, 1.f);
|
||||
state->setUniformVec4("u_color", color);
|
||||
|
||||
GLboolean depthFlag = glIsEnabled(GL_DEPTH_TEST);
|
||||
GLint depthFunc;
|
||||
glGetIntegerv(GL_DEPTH_FUNC, &depthFunc);
|
||||
|
@ -179,12 +214,6 @@ void Skybox::setTexture(TextureCube* texture)
|
|||
|
||||
void Skybox::reload()
|
||||
{
|
||||
auto glProgram = getGLProgramState()->getGLProgram();
|
||||
glProgram->reset();
|
||||
glProgram->initWithFilenames("Shaders3D/Skybox.vert", "Shaders3D/Skybox.frag");
|
||||
glProgram->link();
|
||||
glProgram->updateUniforms();
|
||||
|
||||
initBuffers();
|
||||
}
|
||||
|
||||
|
|
|
@ -25,10 +25,18 @@
|
|||
#ifndef __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
|
||||
|
||||
/**
|
||||
* @addtogroup _3d
|
||||
* @{
|
||||
*/
|
||||
|
||||
class TextureCube;
|
||||
|
||||
/**
|
||||
|
@ -39,6 +47,19 @@ class CC_DLL Skybox : public Node
|
|||
public:
|
||||
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*/
|
||||
void setTexture(TextureCube*);
|
||||
|
||||
|
@ -64,6 +85,13 @@ CC_CONSTRUCTOR_ACCESS:
|
|||
*/
|
||||
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:
|
||||
|
||||
/**
|
||||
|
@ -84,6 +112,9 @@ private:
|
|||
CC_DISALLOW_COPY_AND_ASSIGN(Skybox);
|
||||
};
|
||||
|
||||
// end of 3d group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
||||
#endif // __SKYBOX_H__
|
||||
|
|
|
@ -244,6 +244,7 @@ Sprite3D::Sprite3D()
|
|||
, _aabbDirty(true)
|
||||
, _lightMask(-1)
|
||||
, _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 */
|
||||
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;
|
||||
|
||||
/**get mesh*/
|
||||
|
@ -266,10 +270,18 @@ public:
|
|||
static Sprite3DCache* getInstance();
|
||||
static void destroyInstance();
|
||||
|
||||
/**get the SpriteData struct*/
|
||||
/**
|
||||
* get the SpriteData struct
|
||||
*
|
||||
* @lua NA
|
||||
*/
|
||||
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);
|
||||
|
||||
/**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
|
||||
};
|
||||
|
||||
/// @cond
|
||||
extern std::string CC_DLL s_attributeNames[];//attribute names array
|
||||
/// @endcond
|
||||
|
||||
// end of actions group
|
||||
// end of 3d group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -41,12 +41,15 @@ class Texture2D;
|
|||
/**
|
||||
* @brief the sprite3D material is only texture for now
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
class Sprite3DMaterialCache
|
||||
{
|
||||
public:
|
||||
/**get & destroy cache*/
|
||||
static Sprite3DMaterialCache* getInstance();
|
||||
|
||||
/**destroy the instance*/
|
||||
static void destroyInstance();
|
||||
|
||||
/**add to cache*/
|
||||
|
@ -71,7 +74,7 @@ protected:
|
|||
|
||||
};
|
||||
|
||||
// end of actions group
|
||||
// end of 3d group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
#include "platform/CCImage.h"
|
||||
#include "platform/CCFileUtils.h"
|
||||
|
||||
#include "renderer/ccGLStateCache.h"
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
||||
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;
|
||||
glGenTextures(1, &handle);
|
||||
glBindTexture(GL_TEXTURE_CUBE_MAP, handle);
|
||||
|
||||
GL::bindTextureN(0, handle, GL_TEXTURE_CUBE_MAP);
|
||||
|
||||
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;
|
||||
|
||||
glBindTexture(GL_TEXTURE_CUBE_MAP, 0);
|
||||
GL::bindTextureN(0, 0, GL_TEXTURE_CUBE_MAP);
|
||||
|
||||
for (auto img: images)
|
||||
{
|
||||
|
@ -245,14 +248,14 @@ void TextureCube::setTexParameters(const TexParams& texParams)
|
|||
{
|
||||
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_MAG_FILTER, texParams.wrapS);
|
||||
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, texParams.minFilter);
|
||||
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_T, texParams.wrapT);
|
||||
|
||||
glBindTexture(GL_TEXTURE_CUBE_MAP, 0);
|
||||
GL::bindTextureN(0, 0, GL_TEXTURE_CUBE_MAP);
|
||||
}
|
||||
|
||||
bool TextureCube::reloadTexture()
|
||||
|
|
|
@ -33,6 +33,11 @@
|
|||
|
||||
NS_CC_BEGIN
|
||||
|
||||
/**
|
||||
* @addtogroup _3d
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
TextureCube is a collection of six separate square textures that are put
|
||||
onto the faces of an imaginary cube.
|
||||
|
@ -79,6 +84,9 @@ private:
|
|||
std::vector<std::string> _imgPath;
|
||||
};
|
||||
|
||||
// end of 3d group
|
||||
/// @}
|
||||
|
||||
NS_CC_END
|
||||
|
||||
#endif // __CCTEXTURECUBE_H__
|
||||
|
|
|
@ -99,7 +99,9 @@ void AudioCache::readDataTask()
|
|||
AudioBufferList theDataBuffer;
|
||||
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);
|
||||
if(error) {
|
||||
|
|
|
@ -65,6 +65,11 @@ public:
|
|||
/* Minimum delay in between sounds */
|
||||
double minDelay;
|
||||
|
||||
/**
|
||||
* Defautl constructor
|
||||
*
|
||||
* @lua new
|
||||
*/
|
||||
AudioProfile()
|
||||
: maxInstances(0)
|
||||
, minDelay(0.0)
|
||||
|
|
|
@ -73,6 +73,7 @@ public:
|
|||
* Release the shared Engine object.
|
||||
*
|
||||
* @warning It must be called before the application exit, or it will lead to memory leaks.
|
||||
* @lua destroyInstance
|
||||
*/
|
||||
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 callbackParam parameter used by the callback.
|
||||
* @param f task can be lambda function.
|
||||
* @lua NA
|
||||
*/
|
||||
template<class F>
|
||||
inline void enqueue(TaskType type, const TaskCallBack& callback, void* callbackParam, F&& f);
|
||||
|
|
|
@ -50,6 +50,7 @@ Configuration::Configuration()
|
|||
, _maxDirLightInShader(1)
|
||||
, _maxPointLightInShader(1)
|
||||
, _maxSpotLightInShader(1)
|
||||
, _isAnimate3DHighQuality(true)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -262,6 +263,11 @@ int Configuration::getMaxSupportSpotLightInShader() const
|
|||
return _maxSpotLightInShader;
|
||||
}
|
||||
|
||||
bool Configuration::isHighAnimate3DQuality() const
|
||||
{
|
||||
return _isAnimate3DHighQuality;
|
||||
}
|
||||
|
||||
//
|
||||
// generic getters for properties
|
||||
//
|
||||
|
@ -350,6 +356,12 @@ void Configuration::loadConfigFile(const std::string& filename)
|
|||
_maxSpotLightInShader = _valueDict[name].asInt();
|
||||
else
|
||||
_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
|
||||
|
|
|
@ -164,6 +164,12 @@ public:
|
|||
*/
|
||||
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.
|
||||
*
|
||||
* @param searchName A given search name.
|
||||
|
@ -230,6 +236,7 @@ protected:
|
|||
int _maxDirLightInShader; //max support directional light in shader
|
||||
int _maxPointLightInShader; // max support point 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;
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
Copyright (c) 2008-2010 Ricardo Quesada
|
||||
Copyright (c) 2010-2013 cocos2d-x.org
|
||||
Copyright (c) 2011 Zynga Inc.
|
||||
Copyright (c) 2013-2014 Chukong Technologies Inc.
|
||||
Copyright (c) 2013-2015 Chukong Technologies Inc.
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
|
@ -107,6 +107,7 @@ Director* Director::getInstance()
|
|||
}
|
||||
|
||||
Director::Director()
|
||||
: _isStatusLabelUpdated(true)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -386,7 +387,7 @@ void Director::setOpenGLView(GLView *openGLView)
|
|||
// set size
|
||||
_winSizeInPoints = _openGLView->getDesignResolutionSize();
|
||||
|
||||
createStatsLabel();
|
||||
_isStatusLabelUpdated = true;
|
||||
|
||||
if (_openGLView)
|
||||
{
|
||||
|
@ -1110,6 +1111,12 @@ void Director::resume()
|
|||
// updates the FPS every frame
|
||||
void Director::showStats()
|
||||
{
|
||||
if (_isStatusLabelUpdated)
|
||||
{
|
||||
createStatsLabel();
|
||||
_isStatusLabelUpdated = false;
|
||||
}
|
||||
|
||||
static unsigned long prevCalls = 0;
|
||||
static unsigned long prevVerts = 0;
|
||||
static float prevDeltaTime = 0.016f; // 60FPS
|
||||
|
@ -1255,7 +1262,7 @@ void Director::setContentScaleFactor(float scaleFactor)
|
|||
if (scaleFactor != _contentScaleFactor)
|
||||
{
|
||||
_contentScaleFactor = scaleFactor;
|
||||
createStatsLabel();
|
||||
_isStatusLabelUpdated = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
Copyright (c) 2008-2010 Ricardo Quesada
|
||||
Copyright (c) 2010-2013 cocos2d-x.org
|
||||
Copyright (c) 2011 Zynga Inc.
|
||||
Copyright (c) 2013-2014 Chukong Technologies Inc.
|
||||
Copyright (c) 2013-2015 Chukong Technologies Inc.
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
|
@ -597,6 +597,8 @@ protected:
|
|||
/* Console for the director */
|
||||
Console *_console;
|
||||
|
||||
bool _isStatusLabelUpdated;
|
||||
|
||||
// GLView will recreate stats labels to fit visible rect
|
||||
friend class GLView;
|
||||
};
|
||||
|
|
|
@ -58,15 +58,22 @@ class CC_DLL IMEDelegate
|
|||
{
|
||||
public:
|
||||
/**
|
||||
* Default constructor.
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
virtual ~IMEDelegate();
|
||||
|
||||
/**
|
||||
* Default destructor.
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
virtual bool attachWithIME();
|
||||
|
||||
/**
|
||||
* Determine whether the IME is detached or not.
|
||||
* @js NA
|
||||
* @lua NA
|
||||
*/
|
||||
virtual bool detachWithIME();
|
||||
|
|
|
@ -72,7 +72,8 @@ public:
|
|||
static void destroyInstance();
|
||||
|
||||
CSLoader();
|
||||
void purge();
|
||||
/** @deprecated Use method destroyInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE void purge();
|
||||
|
||||
void init();
|
||||
|
||||
|
|
|
@ -75,7 +75,8 @@ ActionTimeline/CSLoader.cpp \
|
|||
FlatBuffersSerialize.cpp \
|
||||
WidgetCallBackHandlerProtocol.cpp \
|
||||
WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp \
|
||||
CCObjectExtensionData.cpp
|
||||
CCObjectExtensionData.cpp \
|
||||
CocoStudio.cpp
|
||||
|
||||
|
||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/..
|
||||
|
|
|
@ -44,6 +44,7 @@ set(COCOS_CS_SRC
|
|||
editor-support/cocostudio/TriggerObj.cpp
|
||||
editor-support/cocostudio/FlatBuffersSerialize.cpp
|
||||
editor-support/cocostudio/CCObjectExtensionData.cpp
|
||||
editor-support/cocostudio/CocoStudio.cpp
|
||||
editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.cpp
|
||||
editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp
|
||||
editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
|
||||
#include "CocoStudio.h"
|
||||
|
||||
#include "cocostudio/WidgetReader/NodeReader/NodeReader.h"
|
||||
#include "cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h"
|
||||
#include "cocostudio/WidgetReader/SpriteReader/SpriteReader.h"
|
||||
#include "cocostudio/WidgetReader/ParticleReader/ParticleReader.h"
|
||||
#include "cocostudio/WidgetReader/GameMapReader/GameMapReader.h"
|
||||
#include "cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h"
|
||||
#include "cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h"
|
||||
|
||||
#include "cocostudio/WidgetReader/ButtonReader/ButtonReader.h"
|
||||
#include "cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h"
|
||||
#include "cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h"
|
||||
#include "cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h"
|
||||
#include "cocostudio/WidgetReader/TextReader/TextReader.h"
|
||||
#include "cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h"
|
||||
#include "cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h"
|
||||
#include "cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h"
|
||||
#include "cocostudio/WidgetReader/SliderReader/SliderReader.h"
|
||||
#include "cocostudio/WidgetReader/LayoutReader/LayoutReader.h"
|
||||
#include "cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h"
|
||||
#include "cocostudio/WidgetReader/PageViewReader/PageViewReader.h"
|
||||
#include "cocostudio/WidgetReader/ListViewReader/ListViewReader.h"
|
||||
#include "cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h"
|
||||
#include "cocostudio/WidgetReader/Node3DReader/Node3DReader.h"
|
||||
#include "cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.h"
|
||||
#include "cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h"
|
||||
#include "cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h"
|
||||
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
void destroyCocosStudio()
|
||||
{
|
||||
NodeReader::destroyInstance();
|
||||
SingleNodeReader::destroyInstance();
|
||||
SpriteReader::destroyInstance();
|
||||
ParticleReader::destroyInstance();
|
||||
GameMapReader::destroyInstance();
|
||||
ProjectNodeReader::destroyInstance();
|
||||
ComAudioReader::destroyInstance();
|
||||
|
||||
WidgetReader::destroyInstance();
|
||||
ButtonReader::destroyInstance();
|
||||
CheckBoxReader::destroyInstance();
|
||||
ImageViewReader::destroyInstance();
|
||||
TextBMFontReader::destroyInstance();
|
||||
TextReader::destroyInstance();
|
||||
TextFieldReader::destroyInstance();
|
||||
TextAtlasReader::destroyInstance();
|
||||
LoadingBarReader::destroyInstance();
|
||||
SliderReader::destroyInstance();
|
||||
LayoutReader::destroyInstance();
|
||||
ScrollViewReader::destroyInstance();
|
||||
PageViewReader::destroyInstance();
|
||||
ListViewReader::destroyInstance();
|
||||
|
||||
ArmatureNodeReader::destroyInstance();
|
||||
Node3DReader::destroyInstance();
|
||||
Sprite3DReader::destroyInstance();
|
||||
UserCameraReader::destroyInstance();
|
||||
Particle3DReader::destroyInstance();
|
||||
|
||||
cocos2d::CSLoader::destroyInstance();
|
||||
}
|
||||
}
|
|
@ -65,4 +65,11 @@ THE SOFTWARE.
|
|||
#include "cocostudio/CocosStudioExport.h"
|
||||
#include "cocostudio/ActionTimeline/CSLoader.h"
|
||||
|
||||
#include "cocostudio/CocosStudioExport.h"
|
||||
|
||||
namespace cocostudio
|
||||
{
|
||||
void CC_STUDIO_DLL destroyCocosStudio();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -111,7 +111,7 @@ FlatBuffersSerialize::FlatBuffersSerialize()
|
|||
|
||||
FlatBuffersSerialize::~FlatBuffersSerialize()
|
||||
{
|
||||
purge();
|
||||
|
||||
}
|
||||
|
||||
FlatBuffersSerialize* FlatBuffersSerialize::getInstance()
|
||||
|
@ -130,6 +130,12 @@ void FlatBuffersSerialize::purge()
|
|||
|
||||
}
|
||||
|
||||
void FlatBuffersSerialize::destroyInstance()
|
||||
{
|
||||
CC_SAFE_DELETE(_instanceFlatBuffersSerialize);
|
||||
|
||||
}
|
||||
|
||||
void FlatBuffersSerialize::deleteFlatBufferBuilder()
|
||||
{
|
||||
if (_builder != nullptr)
|
||||
|
|
|
@ -91,7 +91,9 @@ class CC_STUDIO_DLL FlatBuffersSerialize
|
|||
|
||||
public:
|
||||
static FlatBuffersSerialize* getInstance();
|
||||
static void purge();
|
||||
/** @deprecated Use method destroyInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE static void purge();
|
||||
static void destroyInstance();
|
||||
|
||||
FlatBuffersSerialize();
|
||||
~FlatBuffersSerialize();
|
||||
|
|
|
@ -34,6 +34,11 @@ ArmatureNodeReader* ArmatureNodeReader::getInstance()
|
|||
return _instanceArmatureNodeReader;
|
||||
}
|
||||
|
||||
void ArmatureNodeReader::destroyInstance()
|
||||
{
|
||||
CC_SAFE_DELETE(_instanceArmatureNodeReader);
|
||||
}
|
||||
|
||||
Offset<Table> ArmatureNodeReader::createOptionsWithFlatBuffers(const tinyxml2::XMLElement *objectData,
|
||||
flatbuffers::FlatBufferBuilder *builder)
|
||||
{
|
||||
|
|
|
@ -26,7 +26,6 @@ THE SOFTWARE.
|
|||
#define __ARMATURENODEREADER_H_
|
||||
|
||||
#include "cocos2d.h"
|
||||
#include "cocostudio/FlatBuffersSerialize.h"
|
||||
#include "cocostudio/WidgetReader/NodeReaderProtocol.h"
|
||||
#include "cocostudio/WidgetReader/NodeReaderDefine.h"
|
||||
|
||||
|
@ -50,7 +49,9 @@ public:
|
|||
~ArmatureNodeReader();
|
||||
|
||||
static ArmatureNodeReader* getInstance();
|
||||
static void purge();
|
||||
/** @deprecated Use method destroyInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE static void purge();
|
||||
static void destroyInstance();
|
||||
|
||||
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData,
|
||||
flatbuffers::FlatBufferBuilder* builder) override;
|
||||
|
|
|
@ -64,6 +64,11 @@ namespace cocostudio
|
|||
CC_SAFE_DELETE(instanceButtonReader);
|
||||
}
|
||||
|
||||
void ButtonReader::destroyInstance()
|
||||
{
|
||||
CC_SAFE_DELETE(instanceButtonReader);
|
||||
}
|
||||
|
||||
void ButtonReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode *cocoNode)
|
||||
{
|
||||
WidgetReader::setPropsFromBinary(widget, cocoLoader, cocoNode);
|
||||
|
|
|
@ -39,7 +39,9 @@ namespace cocostudio
|
|||
virtual ~ButtonReader();
|
||||
|
||||
static ButtonReader* getInstance();
|
||||
static void purge();
|
||||
/** @deprecated Use method destroyInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE static void purge();
|
||||
static void destroyInstance();
|
||||
|
||||
virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget,
|
||||
const rapidjson::Value& options);
|
||||
|
|
|
@ -45,6 +45,11 @@ namespace cocostudio
|
|||
return instanceCheckBoxReader;
|
||||
}
|
||||
|
||||
void CheckBoxReader::destroyInstance()
|
||||
{
|
||||
CC_SAFE_DELETE(instanceCheckBoxReader);
|
||||
}
|
||||
|
||||
void CheckBoxReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode *cocoNode)
|
||||
{
|
||||
|
||||
|
|
|
@ -39,7 +39,9 @@ namespace cocostudio
|
|||
virtual ~CheckBoxReader();
|
||||
|
||||
static CheckBoxReader* getInstance();
|
||||
static void purge();
|
||||
/** @deprecated Use method destroyInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE static void purge();
|
||||
static void destroyInstance();
|
||||
|
||||
virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options);
|
||||
virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode);
|
||||
|
|
|
@ -63,6 +63,11 @@ namespace cocostudio
|
|||
CC_SAFE_DELETE(_instanceComAudioReader);
|
||||
}
|
||||
|
||||
void ComAudioReader::destroyInstance()
|
||||
{
|
||||
CC_SAFE_DELETE(_instanceComAudioReader);
|
||||
}
|
||||
|
||||
Offset<Table> ComAudioReader::createOptionsWithFlatBuffers(const tinyxml2::XMLElement *objectData,
|
||||
flatbuffers::FlatBufferBuilder *builder)
|
||||
{
|
||||
|
|
|
@ -40,7 +40,9 @@ namespace cocostudio
|
|||
~ComAudioReader();
|
||||
|
||||
static ComAudioReader* getInstance();
|
||||
static void purge();
|
||||
/** @deprecated Use method destroyInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE static void purge();
|
||||
static void destroyInstance();
|
||||
|
||||
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData,
|
||||
flatbuffers::FlatBufferBuilder* builder);
|
||||
|
|
|
@ -61,7 +61,7 @@ namespace cocostudio
|
|||
return _instanceTMXTiledMapReader;
|
||||
}
|
||||
|
||||
void GameMapReader::purge()
|
||||
void GameMapReader::destroyInstance()
|
||||
{
|
||||
CC_SAFE_DELETE(_instanceTMXTiledMapReader);
|
||||
}
|
||||
|
|
|
@ -42,7 +42,9 @@ namespace cocostudio
|
|||
~GameMapReader();
|
||||
|
||||
static GameMapReader* getInstance();
|
||||
static void purge();
|
||||
/** @deprecated Use method destroyInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE static void purge();
|
||||
static void destroyInstance();
|
||||
|
||||
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData,
|
||||
flatbuffers::FlatBufferBuilder* builder);
|
||||
|
|
|
@ -49,6 +49,11 @@ namespace cocostudio
|
|||
return instanceImageViewReader;
|
||||
}
|
||||
|
||||
void ImageViewReader::destroyInstance()
|
||||
{
|
||||
CC_SAFE_DELETE(instanceImageViewReader);
|
||||
}
|
||||
|
||||
void ImageViewReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode *cocoNode)
|
||||
{
|
||||
WidgetReader::setPropsFromBinary(widget, cocoLoader, cocoNode);
|
||||
|
|
|
@ -41,7 +41,9 @@ namespace cocostudio
|
|||
virtual ~ImageViewReader();
|
||||
|
||||
static ImageViewReader* getInstance();
|
||||
static void purge();
|
||||
/** @deprecated Use method destroyInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE static void purge();
|
||||
static void destroyInstance();
|
||||
|
||||
virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options);
|
||||
virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode);
|
||||
|
|
|
@ -64,6 +64,11 @@ namespace cocostudio
|
|||
return instanceLayoutReader;
|
||||
}
|
||||
|
||||
void LayoutReader::destroyInstance()
|
||||
{
|
||||
CC_SAFE_DELETE(instanceLayoutReader);
|
||||
}
|
||||
|
||||
void LayoutReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode *cocoNode)
|
||||
{
|
||||
WidgetReader::setPropsFromBinary(widget, cocoLoader, cocoNode);
|
||||
|
|
|
@ -40,7 +40,9 @@ namespace cocostudio
|
|||
virtual ~LayoutReader();
|
||||
|
||||
static LayoutReader* getInstance();
|
||||
static void purge();
|
||||
/** @deprecated Use method destroyInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE static void purge();
|
||||
static void destroyInstance();
|
||||
|
||||
virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options);
|
||||
virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ;
|
||||
|
|
|
@ -42,6 +42,11 @@ namespace cocostudio
|
|||
return instanceListViewReader;
|
||||
}
|
||||
|
||||
void ListViewReader::destroyInstance()
|
||||
{
|
||||
CC_SAFE_DELETE(instanceListViewReader);
|
||||
}
|
||||
|
||||
void ListViewReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode* cocoNode)
|
||||
{
|
||||
ScrollViewReader::setPropsFromBinary(widget, cocoLoader, cocoNode);
|
||||
|
|
|
@ -39,7 +39,9 @@ namespace cocostudio
|
|||
virtual ~ListViewReader();
|
||||
|
||||
static ListViewReader* getInstance();
|
||||
static void purge();
|
||||
/** @deprecated Use method destroyInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE static void purge();
|
||||
static void destroyInstance();
|
||||
|
||||
virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options);
|
||||
virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ;
|
||||
|
|
|
@ -48,6 +48,11 @@ namespace cocostudio
|
|||
return instanceLoadingBar;
|
||||
}
|
||||
|
||||
void LoadingBarReader::destroyInstance()
|
||||
{
|
||||
CC_SAFE_DELETE(instanceLoadingBar);
|
||||
}
|
||||
|
||||
void LoadingBarReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode *cocoNode)
|
||||
{
|
||||
WidgetReader::setPropsFromBinary(widget, cocoLoader, cocoNode);
|
||||
|
|
|
@ -39,7 +39,9 @@ namespace cocostudio
|
|||
virtual ~LoadingBarReader();
|
||||
|
||||
static LoadingBarReader* getInstance();
|
||||
static void purge();
|
||||
/** @deprecated Use method destroyInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE static void purge();
|
||||
static void destroyInstance();
|
||||
|
||||
virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options);
|
||||
virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ;
|
||||
|
|
|
@ -67,6 +67,11 @@ namespace cocostudio
|
|||
CC_SAFE_DELETE(_instanceNode3DReader);
|
||||
}
|
||||
|
||||
void Node3DReader::destroyInstance()
|
||||
{
|
||||
CC_SAFE_DELETE(_instanceNode3DReader);
|
||||
}
|
||||
|
||||
Vec3 Node3DReader::getVec3Attribute(const tinyxml2::XMLAttribute* attribute) const
|
||||
{
|
||||
if(!attribute)
|
||||
|
|
|
@ -46,7 +46,9 @@ namespace cocostudio
|
|||
~Node3DReader();
|
||||
|
||||
static Node3DReader* getInstance();
|
||||
static void purge();
|
||||
/** @deprecated Use method destroyInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE static void purge();
|
||||
static void destroyInstance();
|
||||
|
||||
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData,
|
||||
flatbuffers::FlatBufferBuilder* builder);
|
||||
|
|
|
@ -79,7 +79,7 @@ namespace cocostudio
|
|||
return _instanceNodeReader;
|
||||
}
|
||||
|
||||
void NodeReader::purge()
|
||||
void NodeReader::destroyInstance()
|
||||
{
|
||||
CC_SAFE_DELETE(_instanceNodeReader);
|
||||
}
|
||||
|
|
|
@ -41,7 +41,9 @@ namespace cocostudio
|
|||
~NodeReader();
|
||||
|
||||
static NodeReader* getInstance();
|
||||
static void purge();
|
||||
/** @deprecated Use method destroyInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE static void purge();
|
||||
static void destroyInstance();
|
||||
|
||||
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData,
|
||||
flatbuffers::FlatBufferBuilder* builder);
|
||||
|
|
|
@ -40,6 +40,11 @@ namespace cocostudio
|
|||
return instancePageViewReader;
|
||||
}
|
||||
|
||||
void PageViewReader::destroyInstance()
|
||||
{
|
||||
CC_SAFE_DELETE(instancePageViewReader);
|
||||
}
|
||||
|
||||
void PageViewReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode *cocoNode)
|
||||
{
|
||||
LayoutReader::setPropsFromBinary(widget, cocoLoader, cocoNode);
|
||||
|
|
|
@ -39,7 +39,9 @@ namespace cocostudio
|
|||
virtual ~PageViewReader();
|
||||
|
||||
static PageViewReader* getInstance();
|
||||
static void purge();
|
||||
/** @deprecated Use method destroyInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE static void purge();
|
||||
static void destroyInstance();
|
||||
|
||||
virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options);
|
||||
virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) ;
|
||||
|
|
|
@ -68,6 +68,11 @@ namespace cocostudio
|
|||
CC_SAFE_DELETE(_instanceParticle3DReader);
|
||||
}
|
||||
|
||||
void Particle3DReader::destroyInstance()
|
||||
{
|
||||
CC_SAFE_DELETE(_instanceParticle3DReader);
|
||||
}
|
||||
|
||||
Offset<Table> Particle3DReader::createOptionsWithFlatBuffers(const tinyxml2::XMLElement *objectData,
|
||||
flatbuffers::FlatBufferBuilder *builder)
|
||||
{
|
||||
|
|
|
@ -41,7 +41,9 @@ namespace cocostudio
|
|||
~Particle3DReader();
|
||||
|
||||
static Particle3DReader* getInstance();
|
||||
static void purge();
|
||||
/** @deprecated Use method destroyInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE static void purge();
|
||||
static void destroyInstance();
|
||||
|
||||
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData,
|
||||
flatbuffers::FlatBufferBuilder* builder);
|
||||
|
|
|
@ -64,6 +64,11 @@ namespace cocostudio
|
|||
CC_SAFE_DELETE(_instanceParticleReader);
|
||||
}
|
||||
|
||||
void ParticleReader::destroyInstance()
|
||||
{
|
||||
CC_SAFE_DELETE(_instanceParticleReader);
|
||||
}
|
||||
|
||||
Offset<Table> ParticleReader::createOptionsWithFlatBuffers(const tinyxml2::XMLElement *objectData,
|
||||
flatbuffers::FlatBufferBuilder *builder)
|
||||
{
|
||||
|
|
|
@ -42,7 +42,9 @@ namespace cocostudio
|
|||
~ParticleReader();
|
||||
|
||||
static ParticleReader* getInstance();
|
||||
static void purge();
|
||||
/** @deprecated Use method destroyInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE static void purge();
|
||||
static void destroyInstance();
|
||||
|
||||
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData,
|
||||
flatbuffers::FlatBufferBuilder* builder);
|
||||
|
|
|
@ -62,6 +62,11 @@ namespace cocostudio
|
|||
CC_SAFE_DELETE(_instanceProjectNodeReader);
|
||||
}
|
||||
|
||||
void ProjectNodeReader::destroyInstance()
|
||||
{
|
||||
CC_SAFE_DELETE(_instanceProjectNodeReader);
|
||||
}
|
||||
|
||||
Offset<Table> ProjectNodeReader::createOptionsWithFlatBuffers(const tinyxml2::XMLElement *objectData,
|
||||
flatbuffers::FlatBufferBuilder *builder)
|
||||
{
|
||||
|
|
|
@ -40,7 +40,9 @@ namespace cocostudio
|
|||
~ProjectNodeReader();
|
||||
|
||||
static ProjectNodeReader* getInstance();
|
||||
static void purge();
|
||||
/** @deprecated Use method destroyInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE static void purge();
|
||||
static void destroyInstance();
|
||||
|
||||
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData,
|
||||
flatbuffers::FlatBufferBuilder* builder);
|
||||
|
|
|
@ -44,6 +44,11 @@ namespace cocostudio
|
|||
return instanceScrollViewReader;
|
||||
}
|
||||
|
||||
void ScrollViewReader::destroyInstance()
|
||||
{
|
||||
CC_SAFE_DELETE(instanceScrollViewReader);
|
||||
}
|
||||
|
||||
void ScrollViewReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode* cocoNode)
|
||||
{
|
||||
//TODO: need to refactor...
|
||||
|
|
|
@ -39,7 +39,9 @@ namespace cocostudio
|
|||
virtual ~ScrollViewReader();
|
||||
|
||||
static ScrollViewReader* getInstance();
|
||||
static void purge();
|
||||
/** @deprecated Use method destroyInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE static void purge();
|
||||
static void destroyInstance();
|
||||
|
||||
virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options);
|
||||
virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ;
|
||||
|
|
|
@ -67,6 +67,11 @@ namespace cocostudio
|
|||
CC_SAFE_DELETE(_instanceSingleNodeReader);
|
||||
}
|
||||
|
||||
void SingleNodeReader::destroyInstance()
|
||||
{
|
||||
CC_SAFE_DELETE(_instanceSingleNodeReader);
|
||||
}
|
||||
|
||||
Offset<Table> SingleNodeReader::createOptionsWithFlatBuffers(const tinyxml2::XMLElement *objectData,
|
||||
flatbuffers::FlatBufferBuilder *builder)
|
||||
{
|
||||
|
|
|
@ -42,7 +42,9 @@ namespace cocostudio
|
|||
~SingleNodeReader();
|
||||
|
||||
static SingleNodeReader* getInstance();
|
||||
static void purge();
|
||||
/** @deprecated Use method destroyInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE static void purge();
|
||||
static void destroyInstance();
|
||||
|
||||
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData,
|
||||
flatbuffers::FlatBufferBuilder* builder);
|
||||
|
|
|
@ -48,6 +48,11 @@ namespace cocostudio
|
|||
return instanceSliderReader;
|
||||
}
|
||||
|
||||
void SliderReader::destroyInstance()
|
||||
{
|
||||
CC_SAFE_DELETE(instanceSliderReader);
|
||||
}
|
||||
|
||||
void SliderReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode* cocoNode)
|
||||
{
|
||||
this->beginSetBasicProperties(widget);
|
||||
|
|
|
@ -39,7 +39,9 @@ namespace cocostudio
|
|||
virtual ~SliderReader();
|
||||
|
||||
static SliderReader* getInstance();
|
||||
static void purge();
|
||||
/** @deprecated Use method destroyInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE static void purge();
|
||||
static void destroyInstance();
|
||||
|
||||
virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options);
|
||||
virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ;
|
||||
|
|
|
@ -67,6 +67,11 @@ namespace cocostudio
|
|||
CC_SAFE_DELETE(_instanceSprite3DReader);
|
||||
}
|
||||
|
||||
void Sprite3DReader::destroyInstance()
|
||||
{
|
||||
CC_SAFE_DELETE(_instanceSprite3DReader);
|
||||
}
|
||||
|
||||
Vec2 Sprite3DReader::getVec2Attribute(const tinyxml2::XMLAttribute* attribute) const
|
||||
{
|
||||
if(!attribute)
|
||||
|
|
|
@ -46,7 +46,9 @@ namespace cocostudio
|
|||
~Sprite3DReader();
|
||||
|
||||
static Sprite3DReader* getInstance();
|
||||
static void purge();
|
||||
/** @deprecated Use method destroyInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE static void purge();
|
||||
static void destroyInstance();
|
||||
|
||||
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData,
|
||||
flatbuffers::FlatBufferBuilder* builder);
|
||||
|
|
|
@ -65,6 +65,11 @@ namespace cocostudio
|
|||
CC_SAFE_DELETE(_instanceSpriteReader);
|
||||
}
|
||||
|
||||
void SpriteReader::destroyInstance()
|
||||
{
|
||||
CC_SAFE_DELETE(_instanceSpriteReader);
|
||||
}
|
||||
|
||||
Offset<Table> SpriteReader::createOptionsWithFlatBuffers(const tinyxml2::XMLElement *objectData,
|
||||
flatbuffers::FlatBufferBuilder *builder)
|
||||
{
|
||||
|
|
|
@ -42,7 +42,9 @@ namespace cocostudio
|
|||
~SpriteReader();
|
||||
|
||||
static SpriteReader* getInstance();
|
||||
static void purge();
|
||||
/** @deprecated Use method destroyInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE static void purge();
|
||||
static void destroyInstance();
|
||||
|
||||
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData,
|
||||
flatbuffers::FlatBufferBuilder* builder);
|
||||
|
|
|
@ -45,6 +45,11 @@ namespace cocostudio
|
|||
return instanceTextAtalsReader;
|
||||
}
|
||||
|
||||
void TextAtlasReader::destroyInstance()
|
||||
{
|
||||
CC_SAFE_DELETE(instanceTextAtalsReader);
|
||||
}
|
||||
|
||||
void TextAtlasReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode *cocoNode)
|
||||
{
|
||||
this->beginSetBasicProperties(widget);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue