mirror of https://github.com/axmolengine/axmol.git
Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into DispatcherBak1
This commit is contained in:
commit
aa0eb36071
1
AUTHORS
1
AUTHORS
|
@ -677,6 +677,7 @@ Developers:
|
||||||
|
|
||||||
seobyeongky
|
seobyeongky
|
||||||
Updates spine runtime.
|
Updates spine runtime.
|
||||||
|
Fixed a potential bug in Data's copy constructor.
|
||||||
|
|
||||||
luocker
|
luocker
|
||||||
Fix a bug that string itself is also modified in `String::componentsSeparatedByString`.
|
Fix a bug that string itself is also modified in `String::componentsSeparatedByString`.
|
||||||
|
|
|
@ -16,6 +16,7 @@ cocos2d-x-3.0beta0 ?? 2013
|
||||||
[FIX] Deprecates FileUtils::getFileData, adds FileUtils::getStringFromFile/getDataFromFile.
|
[FIX] Deprecates FileUtils::getFileData, adds FileUtils::getStringFromFile/getDataFromFile.
|
||||||
[FIX] GUI refactoring: Removes UI prefix, Widget is inherited from Node, uses new containers(Vector<T>, Map<K,V>).
|
[FIX] GUI refactoring: Removes UI prefix, Widget is inherited from Node, uses new containers(Vector<T>, Map<K,V>).
|
||||||
[FIX] String itself is also modified in `String::componentsSeparatedByString`.
|
[FIX] String itself is also modified in `String::componentsSeparatedByString`.
|
||||||
|
[FIX] Sprites with PhysicsBody move to a wrong position when game resume from background.
|
||||||
[Android]
|
[Android]
|
||||||
[NEW] build/android-build.sh: add supporting to generate .apk file
|
[NEW] build/android-build.sh: add supporting to generate .apk file
|
||||||
[FIX] XMLHttpRequest receives wrong binary array.
|
[FIX] XMLHttpRequest receives wrong binary array.
|
||||||
|
|
|
@ -43,7 +43,7 @@ NS_CC_BEGIN;
|
||||||
* Implementation of PointArray
|
* Implementation of PointArray
|
||||||
*/
|
*/
|
||||||
|
|
||||||
PointArray* PointArray::create(int capacity)
|
PointArray* PointArray::create(ssize_t capacity)
|
||||||
{
|
{
|
||||||
PointArray* pointArray = new PointArray();
|
PointArray* pointArray = new PointArray();
|
||||||
if (pointArray)
|
if (pointArray)
|
||||||
|
@ -63,7 +63,7 @@ PointArray* PointArray::create(int capacity)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PointArray::initWithCapacity(int capacity)
|
bool PointArray::initWithCapacity(ssize_t capacity)
|
||||||
{
|
{
|
||||||
_controlPoints = new vector<Point*>();
|
_controlPoints = new vector<Point*>();
|
||||||
|
|
||||||
|
@ -126,19 +126,19 @@ void PointArray::addControlPoint(Point controlPoint)
|
||||||
_controlPoints->push_back(new Point(controlPoint.x, controlPoint.y));
|
_controlPoints->push_back(new Point(controlPoint.x, controlPoint.y));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PointArray::insertControlPoint(Point &controlPoint, int index)
|
void PointArray::insertControlPoint(Point &controlPoint, ssize_t index)
|
||||||
{
|
{
|
||||||
Point *temp = new Point(controlPoint.x, controlPoint.y);
|
Point *temp = new Point(controlPoint.x, controlPoint.y);
|
||||||
_controlPoints->insert(_controlPoints->begin() + index, temp);
|
_controlPoints->insert(_controlPoints->begin() + index, temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
Point PointArray::getControlPointAtIndex(int index)
|
Point PointArray::getControlPointAtIndex(ssize_t index)
|
||||||
{
|
{
|
||||||
index = static_cast<int>(MIN(_controlPoints->size()-1, MAX(index, 0)));
|
index = static_cast<int>(MIN(_controlPoints->size()-1, MAX(index, 0)));
|
||||||
return *(_controlPoints->at(index));
|
return *(_controlPoints->at(index));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PointArray::replaceControlPoint(cocos2d::Point &controlPoint, int index)
|
void PointArray::replaceControlPoint(cocos2d::Point &controlPoint, ssize_t index)
|
||||||
{
|
{
|
||||||
|
|
||||||
Point *temp = _controlPoints->at(index);
|
Point *temp = _controlPoints->at(index);
|
||||||
|
@ -146,7 +146,7 @@ void PointArray::replaceControlPoint(cocos2d::Point &controlPoint, int index)
|
||||||
temp->y = controlPoint.y;
|
temp->y = controlPoint.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PointArray::removeControlPointAtIndex(int index)
|
void PointArray::removeControlPointAtIndex(ssize_t index)
|
||||||
{
|
{
|
||||||
vector<Point*>::iterator iter = _controlPoints->begin() + index;
|
vector<Point*>::iterator iter = _controlPoints->begin() + index;
|
||||||
Point* removedPoint = *iter;
|
Point* removedPoint = *iter;
|
||||||
|
@ -154,9 +154,9 @@ void PointArray::removeControlPointAtIndex(int index)
|
||||||
delete removedPoint;
|
delete removedPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
int PointArray::count() const
|
ssize_t PointArray::count() const
|
||||||
{
|
{
|
||||||
return static_cast<int>(_controlPoints->size());
|
return _controlPoints->size();
|
||||||
}
|
}
|
||||||
|
|
||||||
PointArray* PointArray::reverse() const
|
PointArray* PointArray::reverse() const
|
||||||
|
@ -177,11 +177,11 @@ PointArray* PointArray::reverse() const
|
||||||
|
|
||||||
void PointArray::reverseInline()
|
void PointArray::reverseInline()
|
||||||
{
|
{
|
||||||
auto l = _controlPoints->size();
|
size_t l = _controlPoints->size();
|
||||||
Point *p1 = nullptr;
|
Point *p1 = nullptr;
|
||||||
Point *p2 = nullptr;
|
Point *p2 = nullptr;
|
||||||
int x, y;
|
float x, y;
|
||||||
for (int i = 0; i < l/2; ++i)
|
for (size_t i = 0; i < l/2; ++i)
|
||||||
{
|
{
|
||||||
p1 = _controlPoints->at(i);
|
p1 = _controlPoints->at(i);
|
||||||
p2 = _controlPoints->at(l-i-1);
|
p2 = _controlPoints->at(l-i-1);
|
||||||
|
@ -383,7 +383,7 @@ CardinalSplineBy* CardinalSplineBy::reverse() const
|
||||||
// convert "absolutes" to "diffs"
|
// convert "absolutes" to "diffs"
|
||||||
//
|
//
|
||||||
Point p = copyConfig->getControlPointAtIndex(0);
|
Point p = copyConfig->getControlPointAtIndex(0);
|
||||||
for (unsigned int i = 1; i < copyConfig->count(); ++i)
|
for (ssize_t i = 1; i < copyConfig->count(); ++i)
|
||||||
{
|
{
|
||||||
Point current = copyConfig->getControlPointAtIndex(i);
|
Point current = copyConfig->getControlPointAtIndex(i);
|
||||||
Point diff = current - p;
|
Point diff = current - p;
|
||||||
|
@ -405,7 +405,7 @@ CardinalSplineBy* CardinalSplineBy::reverse() const
|
||||||
p = -p;
|
p = -p;
|
||||||
pReverse->insertControlPoint(p, 0);
|
pReverse->insertControlPoint(p, 0);
|
||||||
|
|
||||||
for (unsigned int i = 1; i < pReverse->count(); ++i)
|
for (ssize_t i = 1; i < pReverse->count(); ++i)
|
||||||
{
|
{
|
||||||
Point current = pReverse->getControlPointAtIndex(i);
|
Point current = pReverse->getControlPointAtIndex(i);
|
||||||
current = -current;
|
current = -current;
|
||||||
|
@ -528,7 +528,7 @@ CatmullRomBy* CatmullRomBy::reverse() const
|
||||||
// convert "absolutes" to "diffs"
|
// convert "absolutes" to "diffs"
|
||||||
//
|
//
|
||||||
Point p = copyConfig->getControlPointAtIndex(0);
|
Point p = copyConfig->getControlPointAtIndex(0);
|
||||||
for (unsigned int i = 1; i < copyConfig->count(); ++i)
|
for (ssize_t i = 1; i < copyConfig->count(); ++i)
|
||||||
{
|
{
|
||||||
Point current = copyConfig->getControlPointAtIndex(i);
|
Point current = copyConfig->getControlPointAtIndex(i);
|
||||||
Point diff = current - p;
|
Point diff = current - p;
|
||||||
|
@ -550,7 +550,7 @@ CatmullRomBy* CatmullRomBy::reverse() const
|
||||||
p = -p;
|
p = -p;
|
||||||
reverse->insertControlPoint(p, 0);
|
reverse->insertControlPoint(p, 0);
|
||||||
|
|
||||||
for (unsigned int i = 1; i < reverse->count(); ++i)
|
for (ssize_t i = 1; i < reverse->count(); ++i)
|
||||||
{
|
{
|
||||||
Point current = reverse->getControlPointAtIndex(i);
|
Point current = reverse->getControlPointAtIndex(i);
|
||||||
current = -current;
|
current = -current;
|
||||||
|
|
|
@ -61,7 +61,7 @@ public:
|
||||||
/** creates and initializes a Points array with capacity
|
/** creates and initializes a Points array with capacity
|
||||||
* @js NA
|
* @js NA
|
||||||
*/
|
*/
|
||||||
static PointArray* create(int capacity);
|
static PointArray* create(ssize_t capacity);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @js NA
|
* @js NA
|
||||||
|
@ -77,7 +77,7 @@ public:
|
||||||
/** initializes a Catmull Rom config with a capacity hint
|
/** initializes a Catmull Rom config with a capacity hint
|
||||||
* @js NA
|
* @js NA
|
||||||
*/
|
*/
|
||||||
bool initWithCapacity(int capacity);
|
bool initWithCapacity(ssize_t capacity);
|
||||||
|
|
||||||
/** appends a control point
|
/** appends a control point
|
||||||
* @js NA
|
* @js NA
|
||||||
|
@ -87,27 +87,27 @@ public:
|
||||||
/** inserts a controlPoint at index
|
/** inserts a controlPoint at index
|
||||||
* @js NA
|
* @js NA
|
||||||
*/
|
*/
|
||||||
void insertControlPoint(Point &controlPoint, int index);
|
void insertControlPoint(Point &controlPoint, ssize_t index);
|
||||||
|
|
||||||
/** replaces an existing controlPoint at index
|
/** replaces an existing controlPoint at index
|
||||||
* @js NA
|
* @js NA
|
||||||
*/
|
*/
|
||||||
void replaceControlPoint(Point &controlPoint, int index);
|
void replaceControlPoint(Point &controlPoint, ssize_t index);
|
||||||
|
|
||||||
/** get the value of a controlPoint at a given index
|
/** get the value of a controlPoint at a given index
|
||||||
* @js NA
|
* @js NA
|
||||||
*/
|
*/
|
||||||
Point getControlPointAtIndex(int index);
|
Point getControlPointAtIndex(ssize_t index);
|
||||||
|
|
||||||
/** deletes a control point at a given index
|
/** deletes a control point at a given index
|
||||||
* @js NA
|
* @js NA
|
||||||
*/
|
*/
|
||||||
void removeControlPointAtIndex(int index);
|
void removeControlPointAtIndex(ssize_t index);
|
||||||
|
|
||||||
/** returns the number of objects of the control point array
|
/** returns the number of objects of the control point array
|
||||||
* @js NA
|
* @js NA
|
||||||
*/
|
*/
|
||||||
int count() const;
|
ssize_t count() const;
|
||||||
|
|
||||||
/** returns a new copy of the array reversed. User is responsible for releasing this copy
|
/** returns a new copy of the array reversed. User is responsible for releasing this copy
|
||||||
* @js NA
|
* @js NA
|
||||||
|
|
|
@ -102,7 +102,8 @@ void AnimationCache::parseVersion1(const ValueMap& animations)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector<AnimationFrame*> frames(static_cast<int>(frameNames.size()));
|
ssize_t frameNameSize = frameNames.size();
|
||||||
|
Vector<AnimationFrame*> frames(frameNameSize);
|
||||||
|
|
||||||
for (auto& frameName : frameNames)
|
for (auto& frameName : frameNames)
|
||||||
{
|
{
|
||||||
|
@ -118,12 +119,12 @@ void AnimationCache::parseVersion1(const ValueMap& animations)
|
||||||
frames.pushBack(animFrame);
|
frames.pushBack(animFrame);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( frames.size() == 0 )
|
if ( frames.empty() )
|
||||||
{
|
{
|
||||||
CCLOG("cocos2d: AnimationCache: None of the frames for animation '%s' were found in the SpriteFrameCache. Animation is not being added to the Animation Cache.", iter->first.c_str());
|
CCLOG("cocos2d: AnimationCache: None of the frames for animation '%s' were found in the SpriteFrameCache. Animation is not being added to the Animation Cache.", iter->first.c_str());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if ( frames.size() != frameNames.size() )
|
else if ( frames.size() != frameNameSize )
|
||||||
{
|
{
|
||||||
CCLOG("cocos2d: AnimationCache: An animation in your dictionary refers to a frame which is not in the SpriteFrameCache. Some or all of the frames for the animation '%s' may be missing.", iter->first.c_str());
|
CCLOG("cocos2d: AnimationCache: An animation in your dictionary refers to a frame which is not in the SpriteFrameCache. Some or all of the frames for the animation '%s' may be missing.", iter->first.c_str());
|
||||||
}
|
}
|
||||||
|
|
|
@ -263,12 +263,12 @@ TextureAtlas * AtlasNode::getTextureAtlas() const
|
||||||
return _textureAtlas;
|
return _textureAtlas;
|
||||||
}
|
}
|
||||||
|
|
||||||
int AtlasNode::getQuadsToDraw() const
|
ssize_t AtlasNode::getQuadsToDraw() const
|
||||||
{
|
{
|
||||||
return _quadsToDraw;
|
return _quadsToDraw;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AtlasNode::setQuadsToDraw(int quadsToDraw)
|
void AtlasNode::setQuadsToDraw(ssize_t quadsToDraw)
|
||||||
{
|
{
|
||||||
_quadsToDraw = quadsToDraw;
|
_quadsToDraw = quadsToDraw;
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,8 +62,8 @@ public:
|
||||||
void setTextureAtlas(TextureAtlas* textureAtlas);
|
void setTextureAtlas(TextureAtlas* textureAtlas);
|
||||||
TextureAtlas* getTextureAtlas() const;
|
TextureAtlas* getTextureAtlas() const;
|
||||||
|
|
||||||
void setQuadsToDraw(int quadsToDraw);
|
void setQuadsToDraw(ssize_t quadsToDraw);
|
||||||
int getQuadsToDraw() const;
|
ssize_t getQuadsToDraw() const;
|
||||||
|
|
||||||
|
|
||||||
// Overrides
|
// Overrides
|
||||||
|
@ -125,7 +125,7 @@ protected:
|
||||||
BlendFunc _blendFunc;
|
BlendFunc _blendFunc;
|
||||||
|
|
||||||
// quads to draw
|
// quads to draw
|
||||||
int _quadsToDraw;
|
ssize_t _quadsToDraw;
|
||||||
// color uniform
|
// color uniform
|
||||||
GLint _uniformColor;
|
GLint _uniformColor;
|
||||||
// This varible is only used for LabelAtlas FPS display. So plz don't modify its value.
|
// This varible is only used for LabelAtlas FPS display. So plz don't modify its value.
|
||||||
|
|
|
@ -847,13 +847,10 @@ void Director::resume()
|
||||||
|
|
||||||
setAnimationInterval(_oldAnimationInterval);
|
setAnimationInterval(_oldAnimationInterval);
|
||||||
|
|
||||||
if (gettimeofday(_lastUpdate, nullptr) != 0)
|
|
||||||
{
|
|
||||||
CCLOG("cocos2d: Director: Error in gettimeofday");
|
|
||||||
}
|
|
||||||
|
|
||||||
_paused = false;
|
_paused = false;
|
||||||
_deltaTime = 0;
|
_deltaTime = 0;
|
||||||
|
// fix issue #3509, skip one fps to avoid incorrect time calculation.
|
||||||
|
setNextDeltaTimeZero(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// display the FPS using a LabelAtlas
|
// display the FPS using a LabelAtlas
|
||||||
|
@ -1076,6 +1073,8 @@ void DisplayLinkDirector::startAnimation()
|
||||||
}
|
}
|
||||||
|
|
||||||
_invalid = false;
|
_invalid = false;
|
||||||
|
|
||||||
|
Application::getInstance()->setAnimationInterval(_animationInterval);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplayLinkDirector::mainLoop()
|
void DisplayLinkDirector::mainLoop()
|
||||||
|
|
|
@ -97,10 +97,10 @@ static EventListener::ListenerID __getListenerID(Event* event)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
EventDispatcher::EventListenerVector::EventListenerVector()
|
EventDispatcher::EventListenerVector::EventListenerVector() :
|
||||||
: _sceneGraphListeners(nullptr)
|
_fixedListeners(nullptr),
|
||||||
, _fixedListeners(nullptr)
|
_sceneGraphListeners(nullptr),
|
||||||
, _gt0Index(0)
|
_gt0Index(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -501,11 +501,12 @@ void EventDispatcher::dispatchEventToListeners(EventListenerVector* listeners, s
|
||||||
auto fixedPriorityListeners = listeners->getFixedPriorityListeners();
|
auto fixedPriorityListeners = listeners->getFixedPriorityListeners();
|
||||||
auto sceneGraphPriorityListeners = listeners->getSceneGraphPriorityListeners();
|
auto sceneGraphPriorityListeners = listeners->getSceneGraphPriorityListeners();
|
||||||
|
|
||||||
int i = 0;
|
ssize_t i = 0;
|
||||||
// priority < 0
|
// priority < 0
|
||||||
if (fixedPriorityListeners)
|
if (fixedPriorityListeners)
|
||||||
{
|
{
|
||||||
for (; !fixedPriorityListeners->empty() && i < listeners->getGt0Index(); ++i)
|
bool isEmpty = fixedPriorityListeners->empty();
|
||||||
|
for (; !isEmpty && i < listeners->getGt0Index(); ++i)
|
||||||
{
|
{
|
||||||
auto l = fixedPriorityListeners->at(i);
|
auto l = fixedPriorityListeners->at(i);
|
||||||
if (!l->isPaused() && l->isRegistered() && onEvent(l))
|
if (!l->isPaused() && l->isRegistered() && onEvent(l))
|
||||||
|
@ -537,7 +538,8 @@ void EventDispatcher::dispatchEventToListeners(EventListenerVector* listeners, s
|
||||||
if (!shouldStopPropagation)
|
if (!shouldStopPropagation)
|
||||||
{
|
{
|
||||||
// priority > 0
|
// priority > 0
|
||||||
for (; i < fixedPriorityListeners->size(); ++i)
|
ssize_t size = fixedPriorityListeners->size();
|
||||||
|
for (; i < size; ++i)
|
||||||
{
|
{
|
||||||
auto l = fixedPriorityListeners->at(i);
|
auto l = fixedPriorityListeners->at(i);
|
||||||
|
|
||||||
|
|
|
@ -67,8 +67,8 @@ EventListenerMouse* EventListenerMouse::clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
EventListenerMouse::EventListenerMouse()
|
EventListenerMouse::EventListenerMouse()
|
||||||
: onMouseUp(nullptr)
|
: onMouseDown(nullptr)
|
||||||
, onMouseDown(nullptr)
|
, onMouseUp(nullptr)
|
||||||
, onMouseMove(nullptr)
|
, onMouseMove(nullptr)
|
||||||
, onMouseScroll(nullptr)
|
, onMouseScroll(nullptr)
|
||||||
{
|
{
|
||||||
|
|
|
@ -102,16 +102,20 @@ Label* Label::createWithAtlas(FontAtlas *atlas, TextHAlignment alignment, int li
|
||||||
|
|
||||||
Label::Label(FontAtlas *atlas, TextHAlignment alignment, bool useDistanceField,bool useA8Shader)
|
Label::Label(FontAtlas *atlas, TextHAlignment alignment, bool useDistanceField,bool useA8Shader)
|
||||||
: _reusedLetter(nullptr)
|
: _reusedLetter(nullptr)
|
||||||
|
, _multilineEnable(true)
|
||||||
|
, _commonLineHeight(0.0f)
|
||||||
, _lineBreakWithoutSpaces(false)
|
, _lineBreakWithoutSpaces(false)
|
||||||
,_multilineEnable(true)
|
, _width(0.0f)
|
||||||
, _alignment(alignment)
|
, _alignment(alignment)
|
||||||
, _currentUTF16String(0)
|
, _currentUTF16String(0)
|
||||||
, _originalUTF16String(0)
|
, _originalUTF16String(0)
|
||||||
, _advances(0)
|
, _advances(nullptr)
|
||||||
, _fontAtlas(atlas)
|
, _fontAtlas(atlas)
|
||||||
, _isOpacityModifyRGB(true)
|
, _isOpacityModifyRGB(true)
|
||||||
,_useDistanceField(useDistanceField)
|
, _useDistanceField(useDistanceField)
|
||||||
,_useA8Shader(useA8Shader)
|
, _useA8Shader(useA8Shader)
|
||||||
|
, _fontSize(0)
|
||||||
|
, _uniformEffectColor(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ bool LabelAtlas::initWithString(const std::string& theString, const std::string&
|
||||||
//CCLabelAtlas - Atlas generation
|
//CCLabelAtlas - Atlas generation
|
||||||
void LabelAtlas::updateAtlasValues()
|
void LabelAtlas::updateAtlasValues()
|
||||||
{
|
{
|
||||||
auto n = _string.length();
|
ssize_t n = _string.length();
|
||||||
|
|
||||||
const unsigned char *s = (unsigned char*)_string.c_str();
|
const unsigned char *s = (unsigned char*)_string.c_str();
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ void LabelAtlas::updateAtlasValues()
|
||||||
|
|
||||||
CCASSERT(n <= _textureAtlas->getCapacity(), "updateAtlasValues: Invalid String length");
|
CCASSERT(n <= _textureAtlas->getCapacity(), "updateAtlasValues: Invalid String length");
|
||||||
V3F_C4B_T2F_Quad* quads = _textureAtlas->getQuads();
|
V3F_C4B_T2F_Quad* quads = _textureAtlas->getQuads();
|
||||||
for(int i = 0; i < n; i++) {
|
for(ssize_t i = 0; i < n; i++) {
|
||||||
|
|
||||||
unsigned char a = s[i] - _mapStartChar;
|
unsigned char a = s[i] - _mapStartChar;
|
||||||
float row = (float) (a % _itemsPerRow);
|
float row = (float) (a % _itemsPerRow);
|
||||||
|
@ -178,7 +178,7 @@ void LabelAtlas::updateAtlasValues()
|
||||||
}
|
}
|
||||||
if (n > 0 ){
|
if (n > 0 ){
|
||||||
_textureAtlas->setDirty(true);
|
_textureAtlas->setDirty(true);
|
||||||
auto totalQuads = _textureAtlas->getTotalQuads();
|
ssize_t totalQuads = _textureAtlas->getTotalQuads();
|
||||||
if (n > totalQuads) {
|
if (n > totalQuads) {
|
||||||
_textureAtlas->increaseTotalQuadsWith(static_cast<int>(n - totalQuads));
|
_textureAtlas->increaseTotalQuadsWith(static_cast<int>(n - totalQuads));
|
||||||
}
|
}
|
||||||
|
@ -188,10 +188,10 @@ void LabelAtlas::updateAtlasValues()
|
||||||
//CCLabelAtlas - LabelProtocol
|
//CCLabelAtlas - LabelProtocol
|
||||||
void LabelAtlas::setString(const std::string &label)
|
void LabelAtlas::setString(const std::string &label)
|
||||||
{
|
{
|
||||||
auto len = label.size();
|
ssize_t len = label.size();
|
||||||
if (len > _textureAtlas->getTotalQuads())
|
if (len > _textureAtlas->getTotalQuads())
|
||||||
{
|
{
|
||||||
_textureAtlas->resizeCapacity(static_cast<int>(len));
|
_textureAtlas->resizeCapacity(len);
|
||||||
}
|
}
|
||||||
_string.clear();
|
_string.clear();
|
||||||
_string = label;
|
_string = label;
|
||||||
|
@ -201,7 +201,7 @@ void LabelAtlas::setString(const std::string &label)
|
||||||
|
|
||||||
this->setContentSize(s);
|
this->setContentSize(s);
|
||||||
|
|
||||||
_quadsToDraw = static_cast<int>(len);
|
_quadsToDraw = len;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string& LabelAtlas::getString(void) const
|
const std::string& LabelAtlas::getString(void) const
|
||||||
|
|
|
@ -947,7 +947,7 @@ void LabelBMFont::updateLabel()
|
||||||
size_t size = multiline_string.size();
|
size_t size = multiline_string.size();
|
||||||
unsigned short* str_new = new unsigned short[size + 1];
|
unsigned short* str_new = new unsigned short[size + 1];
|
||||||
|
|
||||||
for (int j = 0; j < size; ++j)
|
for (size_t j = 0; j < size; ++j)
|
||||||
{
|
{
|
||||||
str_new[j] = multiline_string[j];
|
str_new[j] = multiline_string[j];
|
||||||
}
|
}
|
||||||
|
|
|
@ -200,7 +200,7 @@ bool LabelTextFormatter::multilineText(LabelTextFormatProtocol *theLabel)
|
||||||
size_t size = multiline_string.size();
|
size_t size = multiline_string.size();
|
||||||
unsigned short* strNew = new unsigned short[size + 1];
|
unsigned short* strNew = new unsigned short[size + 1];
|
||||||
|
|
||||||
for (int j = 0; j < size; ++j)
|
for (size_t j = 0; j < size; ++j)
|
||||||
{
|
{
|
||||||
strNew[j] = multiline_string[j];
|
strNew[j] = multiline_string[j];
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,11 +53,11 @@ Layer::Layer()
|
||||||
: _touchEnabled(false)
|
: _touchEnabled(false)
|
||||||
, _accelerometerEnabled(false)
|
, _accelerometerEnabled(false)
|
||||||
, _keyboardEnabled(false)
|
, _keyboardEnabled(false)
|
||||||
, _touchMode(Touch::DispatchMode::ALL_AT_ONCE)
|
|
||||||
, _swallowsTouches(true)
|
|
||||||
, _touchListener(nullptr)
|
, _touchListener(nullptr)
|
||||||
, _keyboardListener(nullptr)
|
, _keyboardListener(nullptr)
|
||||||
, _accelerationListener(nullptr)
|
, _accelerationListener(nullptr)
|
||||||
|
, _touchMode(Touch::DispatchMode::ALL_AT_ONCE)
|
||||||
|
, _swallowsTouches(true)
|
||||||
{
|
{
|
||||||
_ignoreAnchorPointForPosition = true;
|
_ignoreAnchorPointForPosition = true;
|
||||||
setAnchorPoint(Point(0.5f, 0.5f));
|
setAnchorPoint(Point(0.5f, 0.5f));
|
||||||
|
|
|
@ -346,7 +346,7 @@ void Menu::alignItemsInColumns(int columns, va_list args)
|
||||||
void Menu::alignItemsInColumnsWithArray(const ValueVector& rows)
|
void Menu::alignItemsInColumnsWithArray(const ValueVector& rows)
|
||||||
{
|
{
|
||||||
int height = -5;
|
int height = -5;
|
||||||
int row = 0;
|
size_t row = 0;
|
||||||
int rowHeight = 0;
|
int rowHeight = 0;
|
||||||
int columnsOccupied = 0;
|
int columnsOccupied = 0;
|
||||||
int rowColumns = 0;
|
int rowColumns = 0;
|
||||||
|
@ -441,7 +441,7 @@ void Menu::alignItemsInRowsWithArray(const ValueVector& columns)
|
||||||
|
|
||||||
int width = -10;
|
int width = -10;
|
||||||
int columnHeight = -5;
|
int columnHeight = -5;
|
||||||
int column = 0;
|
size_t column = 0;
|
||||||
int columnWidth = 0;
|
int columnWidth = 0;
|
||||||
int rowsOccupied = 0;
|
int rowsOccupied = 0;
|
||||||
int columnRows;
|
int columnRows;
|
||||||
|
|
|
@ -44,7 +44,7 @@ THE SOFTWARE.
|
||||||
#include "CCEventTouch.h"
|
#include "CCEventTouch.h"
|
||||||
#include "CCScene.h"
|
#include "CCScene.h"
|
||||||
|
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
#include "CCPhysicsBody.h"
|
#include "CCPhysicsBody.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ Node::Node(void)
|
||||||
, _isTransitionFinished(false)
|
, _isTransitionFinished(false)
|
||||||
, _updateScriptHandler(0)
|
, _updateScriptHandler(0)
|
||||||
, _componentContainer(nullptr)
|
, _componentContainer(nullptr)
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
, _physicsBody(nullptr)
|
, _physicsBody(nullptr)
|
||||||
#endif
|
#endif
|
||||||
, _displayedOpacity(255)
|
, _displayedOpacity(255)
|
||||||
|
@ -178,7 +178,7 @@ Node::~Node()
|
||||||
|
|
||||||
CC_SAFE_DELETE(_componentContainer);
|
CC_SAFE_DELETE(_componentContainer);
|
||||||
|
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
CC_SAFE_RELEASE(_physicsBody);
|
CC_SAFE_RELEASE(_physicsBody);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -264,7 +264,7 @@ void Node::setRotation(float newRotation)
|
||||||
_rotationX = _rotationY = newRotation;
|
_rotationX = _rotationY = newRotation;
|
||||||
_transformDirty = _inverseDirty = true;
|
_transformDirty = _inverseDirty = true;
|
||||||
|
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
if (_physicsBody)
|
if (_physicsBody)
|
||||||
{
|
{
|
||||||
_physicsBody->setRotation(newRotation);
|
_physicsBody->setRotation(newRotation);
|
||||||
|
@ -354,7 +354,7 @@ void Node::setPosition(const Point& newPosition)
|
||||||
_position = newPosition;
|
_position = newPosition;
|
||||||
_transformDirty = _inverseDirty = true;
|
_transformDirty = _inverseDirty = true;
|
||||||
|
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
if (_physicsBody)
|
if (_physicsBody)
|
||||||
{
|
{
|
||||||
_physicsBody->setPosition(newPosition);
|
_physicsBody->setPosition(newPosition);
|
||||||
|
@ -604,7 +604,7 @@ void Node::addChild(Node *child, int zOrder, int tag)
|
||||||
|
|
||||||
this->insertChild(child, zOrder);
|
this->insertChild(child, zOrder);
|
||||||
|
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
for (Node* node = this->getParent(); node != nullptr; node = node->getParent())
|
for (Node* node = this->getParent(); node != nullptr; node = node->getParent())
|
||||||
{
|
{
|
||||||
if (dynamic_cast<Scene*>(node) != nullptr)
|
if (dynamic_cast<Scene*>(node) != nullptr)
|
||||||
|
@ -739,7 +739,7 @@ void Node::detachChild(Node *child, ssize_t childIndex, bool doCleanup)
|
||||||
child->onExit();
|
child->onExit();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
if (child->_physicsBody != nullptr)
|
if (child->_physicsBody != nullptr)
|
||||||
{
|
{
|
||||||
child->_physicsBody->removeFromWorld();
|
child->_physicsBody->removeFromWorld();
|
||||||
|
@ -848,7 +848,7 @@ void Node::transformAncestors()
|
||||||
|
|
||||||
void Node::transform()
|
void Node::transform()
|
||||||
{
|
{
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
updatePhysicsTransform();
|
updatePhysicsTransform();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1170,8 +1170,8 @@ const kmMat4& Node::getNodeToParentTransform() const
|
||||||
// If skew is needed, apply skew and then anchor point
|
// If skew is needed, apply skew and then anchor point
|
||||||
if (needsSkewMatrix)
|
if (needsSkewMatrix)
|
||||||
{
|
{
|
||||||
kmMat4 skewMatrix = { 1, tanf(CC_DEGREES_TO_RADIANS(_skewY)), 0, 0,
|
kmMat4 skewMatrix = { 1, (float)tanf(CC_DEGREES_TO_RADIANS(_skewY)), 0, 0,
|
||||||
tanf(CC_DEGREES_TO_RADIANS(_skewX)), 1, 0, 0,
|
(float)tanf(CC_DEGREES_TO_RADIANS(_skewX)), 1, 0, 0,
|
||||||
0, 0, 1, 0,
|
0, 0, 1, 0,
|
||||||
0, 0, 0, 1};
|
0, 0, 0, 1};
|
||||||
|
|
||||||
|
@ -1324,7 +1324,7 @@ Point Node::convertTouchToNodeSpaceAR(Touch *touch) const
|
||||||
return this->convertToNodeSpaceAR(point);
|
return this->convertToNodeSpaceAR(point);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
bool Node::updatePhysicsTransform()
|
bool Node::updatePhysicsTransform()
|
||||||
{
|
{
|
||||||
if (_physicsBody != nullptr && _physicsBody->getWorld() != nullptr && !_physicsBody->isResting())
|
if (_physicsBody != nullptr && _physicsBody->getWorld() != nullptr && !_physicsBody->isResting())
|
||||||
|
@ -1374,7 +1374,7 @@ void Node::removeAllComponents()
|
||||||
_componentContainer->removeAll();
|
_componentContainer->removeAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
void Node::setPhysicsBody(PhysicsBody* body)
|
void Node::setPhysicsBody(PhysicsBody* body)
|
||||||
{
|
{
|
||||||
if (_physicsBody != nullptr)
|
if (_physicsBody != nullptr)
|
||||||
|
|
|
@ -54,7 +54,7 @@ class Component;
|
||||||
class ComponentContainer;
|
class ComponentContainer;
|
||||||
class EventDispatcher;
|
class EventDispatcher;
|
||||||
class Scene;
|
class Scene;
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
class PhysicsBody;
|
class PhysicsBody;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -590,7 +590,7 @@ public:
|
||||||
*
|
*
|
||||||
* @return a Node object whose tag equals to the input parameter
|
* @return a Node object whose tag equals to the input parameter
|
||||||
*/
|
*/
|
||||||
Node * getChildByTag(int tag);
|
virtual Node * getChildByTag(int tag);
|
||||||
/**
|
/**
|
||||||
* Return an array of children
|
* Return an array of children
|
||||||
*
|
*
|
||||||
|
@ -615,7 +615,7 @@ public:
|
||||||
*
|
*
|
||||||
* @return The amount of children.
|
* @return The amount of children.
|
||||||
*/
|
*/
|
||||||
ssize_t getChildrenCount() const;
|
virtual ssize_t getChildrenCount() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the parent node
|
* Sets the parent node
|
||||||
|
@ -1341,7 +1341,7 @@ public:
|
||||||
/// @} end of component functions
|
/// @} end of component functions
|
||||||
|
|
||||||
|
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
/**
|
/**
|
||||||
* set the PhysicsBody that let the sprite effect with physics
|
* set the PhysicsBody that let the sprite effect with physics
|
||||||
*/
|
*/
|
||||||
|
@ -1465,7 +1465,7 @@ protected:
|
||||||
|
|
||||||
ComponentContainer *_componentContainer; ///< Dictionary of components
|
ComponentContainer *_componentContainer; ///< Dictionary of components
|
||||||
|
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
PhysicsBody* _physicsBody; ///< the physicsBody the node have
|
PhysicsBody* _physicsBody; ///< the physicsBody the node have
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -47,8 +47,8 @@ NodeGrid* NodeGrid::create()
|
||||||
}
|
}
|
||||||
|
|
||||||
NodeGrid::NodeGrid()
|
NodeGrid::NodeGrid()
|
||||||
: _nodeGrid(nullptr)
|
: _gridTarget(nullptr)
|
||||||
, _gridTarget(nullptr)
|
, _nodeGrid(nullptr)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ THE SOFTWARE.
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
Scene::Scene()
|
Scene::Scene()
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
: _physicsWorld(nullptr)
|
: _physicsWorld(nullptr)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
@ -44,7 +44,7 @@ Scene::Scene()
|
||||||
|
|
||||||
Scene::~Scene()
|
Scene::~Scene()
|
||||||
{
|
{
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
CC_SAFE_DELETE(_physicsWorld);
|
CC_SAFE_DELETE(_physicsWorld);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,22 @@ Scene* Scene::getScene()
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
|
void Scene::addChild(Node* child, int zOrder, int tag)
|
||||||
|
{
|
||||||
|
Node::addChild(child, zOrder, tag);
|
||||||
|
addChildToPhysicsWorld(child);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scene::update(float delta)
|
||||||
|
{
|
||||||
|
Node::update(delta);
|
||||||
|
if (nullptr != _physicsWorld)
|
||||||
|
{
|
||||||
|
_physicsWorld->update(delta);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Scene *Scene::createWithPhysics()
|
Scene *Scene::createWithPhysics()
|
||||||
{
|
{
|
||||||
Scene *ret = new Scene();
|
Scene *ret = new Scene();
|
||||||
|
@ -121,13 +136,6 @@ bool Scene::initWithPhysics()
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::addChild(Node* child, int zOrder, int tag)
|
|
||||||
{
|
|
||||||
Node::addChild(child, zOrder, tag);
|
|
||||||
|
|
||||||
addChildToPhysicsWorld(child);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Scene::addChildToPhysicsWorld(Node* child)
|
void Scene::addChildToPhysicsWorld(Node* child)
|
||||||
{
|
{
|
||||||
if (_physicsWorld)
|
if (_physicsWorld)
|
||||||
|
@ -149,18 +157,6 @@ void Scene::addChildToPhysicsWorld(Node* child)
|
||||||
addToPhysicsWorldFunc(child);
|
addToPhysicsWorldFunc(child);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::update(float delta)
|
|
||||||
{
|
|
||||||
Node::update(delta);
|
|
||||||
|
|
||||||
if (nullptr != _physicsWorld)
|
|
||||||
{
|
|
||||||
_physicsWorld->update(delta);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -52,32 +52,13 @@ class CC_DLL Scene : public Node
|
||||||
public:
|
public:
|
||||||
/** creates a new Scene object */
|
/** creates a new Scene object */
|
||||||
static Scene *create();
|
static Scene *create();
|
||||||
#ifdef CC_USE_PHYSICS
|
|
||||||
static Scene *createWithPhysics();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Overrides
|
// Overrides
|
||||||
virtual Scene *getScene() override;
|
virtual Scene *getScene() override;
|
||||||
|
|
||||||
#ifdef CC_USE_PHYSICS
|
|
||||||
public:
|
|
||||||
|
|
||||||
inline PhysicsWorld* getPhysicsWorld() { return _physicsWorld; }
|
|
||||||
|
|
||||||
using Node::addChild;
|
using Node::addChild;
|
||||||
virtual void addChild(Node* child, int zOrder, int tag) override;
|
|
||||||
virtual void update(float delta) override;
|
|
||||||
virtual std::string getDescription() const override;
|
virtual std::string getDescription() const override;
|
||||||
|
|
||||||
protected:
|
|
||||||
bool initWithPhysics();
|
|
||||||
void addChildToPhysicsWorld(Node* child);
|
|
||||||
|
|
||||||
PhysicsWorld* _physicsWorld;
|
|
||||||
#endif // CC_USE_PHYSICS
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Scene();
|
Scene();
|
||||||
virtual ~Scene();
|
virtual ~Scene();
|
||||||
|
@ -88,6 +69,19 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CC_DISALLOW_COPY_AND_ASSIGN(Scene);
|
CC_DISALLOW_COPY_AND_ASSIGN(Scene);
|
||||||
|
|
||||||
|
#if CC_USE_PHYSICS
|
||||||
|
public:
|
||||||
|
virtual void addChild(Node* child, int zOrder, int tag) override;
|
||||||
|
virtual void update(float delta) override;
|
||||||
|
inline PhysicsWorld* getPhysicsWorld() { return _physicsWorld; }
|
||||||
|
static Scene *createWithPhysics();
|
||||||
|
protected:
|
||||||
|
bool initWithPhysics();
|
||||||
|
void addChildToPhysicsWorld(Node* child);
|
||||||
|
|
||||||
|
PhysicsWorld* _physicsWorld;
|
||||||
|
#endif // CC_USE_PHYSICS
|
||||||
};
|
};
|
||||||
|
|
||||||
// end of scene group
|
// end of scene group
|
||||||
|
|
|
@ -185,6 +185,11 @@ void ShaderCache::reloadDefaultShaders()
|
||||||
p->reset();
|
p->reset();
|
||||||
loadDefaultShader(p, kShaderType_PositionTextureColor);
|
loadDefaultShader(p, kShaderType_PositionTextureColor);
|
||||||
|
|
||||||
|
// Position Texture Color without MVP shader
|
||||||
|
p = getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP);
|
||||||
|
p->reset();
|
||||||
|
loadDefaultShader(p, kShaderType_PositionTextureColor_noMVP);
|
||||||
|
|
||||||
// Position Texture Color alpha test
|
// Position Texture Color alpha test
|
||||||
p = getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST);
|
p = getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST);
|
||||||
p->reset();
|
p->reset();
|
||||||
|
|
|
@ -502,7 +502,7 @@ void Sprite::updateTransform(void)
|
||||||
{
|
{
|
||||||
CCASSERT(_batchNode, "updateTransform is only valid when Sprite is being rendered using an SpriteBatchNode");
|
CCASSERT(_batchNode, "updateTransform is only valid when Sprite is being rendered using an SpriteBatchNode");
|
||||||
|
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
if (updatePhysicsTransform())
|
if (updatePhysicsTransform())
|
||||||
{
|
{
|
||||||
setDirty(true);
|
setDirty(true);
|
||||||
|
@ -711,7 +711,7 @@ bool Sprite::culling() const
|
||||||
|
|
||||||
void Sprite::updateQuadVertices()
|
void Sprite::updateQuadVertices()
|
||||||
{
|
{
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
updatePhysicsTransform();
|
updatePhysicsTransform();
|
||||||
setDirty(true);
|
setDirty(true);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -209,7 +209,7 @@ void TextFieldTTF::deleteBackward()
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the delete byte number
|
// get the delete byte number
|
||||||
int deleteLen = 1; // default, erase 1 byte
|
size_t deleteLen = 1; // default, erase 1 byte
|
||||||
|
|
||||||
while(0x80 == (0xC0 & _inputText.at(len - deleteLen)))
|
while(0x80 == (0xC0 & _inputText.at(len - deleteLen)))
|
||||||
{
|
{
|
||||||
|
|
|
@ -51,7 +51,7 @@ TextPageDef::~TextPageDef()
|
||||||
{
|
{
|
||||||
size_t numLines = _lines.size();
|
size_t numLines = _lines.size();
|
||||||
|
|
||||||
for( int c = 0; c<numLines; ++c )
|
for( size_t c = 0; c<numLines; ++c )
|
||||||
{
|
{
|
||||||
delete _lines[c];
|
delete _lines[c];
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,7 @@ void TextureCache::purgeSharedTextureCache()
|
||||||
|
|
||||||
std::string TextureCache::getDescription() const
|
std::string TextureCache::getDescription() const
|
||||||
{
|
{
|
||||||
return StringUtils::format("<TextureCache | Number of textures = %lu>", _textures.size());
|
return StringUtils::format("<TextureCache | Number of textures = %zd>", _textures.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextureCache::addImageAsync(const std::string &path, Object *target, SEL_CallFuncO selector)
|
void TextureCache::addImageAsync(const std::string &path, Object *target, SEL_CallFuncO selector)
|
||||||
|
|
|
@ -268,7 +268,7 @@ To enable set it to a value different than 0. Disabled by default.
|
||||||
|
|
||||||
/** Use physics integration API */
|
/** Use physics integration API */
|
||||||
#ifndef CC_USE_PHYSICS
|
#ifndef CC_USE_PHYSICS
|
||||||
#define CC_USE_PHYSICS
|
#define CC_USE_PHYSICS 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // __CCCONFIG_H__
|
#endif // __CCCONFIG_H__
|
||||||
|
|
|
@ -1200,7 +1200,8 @@ bool Image::initWithPVRv2Data(const unsigned char * data, ssize_t dataLen)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! configuration->supportsNPOT() &&
|
if (! configuration->supportsNPOT() &&
|
||||||
(header->width != ccNextPOT(header->width) || header->height != ccNextPOT(header->height)))
|
(static_cast<int>(header->width) != ccNextPOT(header->width)
|
||||||
|
|| static_cast<int>(header->height) != ccNextPOT(header->height)))
|
||||||
{
|
{
|
||||||
CCLOG("cocos2d: ERROR: Loading an NPOT texture (%dx%d) but is not supported on this device", header->width, header->height);
|
CCLOG("cocos2d: ERROR: Loading an NPOT texture (%dx%d) but is not supported on this device", header->width, header->height);
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -150,7 +150,7 @@ static Data getData(const std::string& filename, bool forString)
|
||||||
}
|
}
|
||||||
DWORD sizeRead = 0;
|
DWORD sizeRead = 0;
|
||||||
BOOL successed = FALSE;
|
BOOL successed = FALSE;
|
||||||
successed = ::ReadFile(fileHandle, buffer, *size, &sizeRead, NULL);
|
successed = ::ReadFile(fileHandle, buffer, size, &sizeRead, NULL);
|
||||||
::CloseHandle(fileHandle);
|
::CloseHandle(fileHandle);
|
||||||
|
|
||||||
if (!successed)
|
if (!successed)
|
||||||
|
@ -180,22 +180,21 @@ static Data getData(const std::string& filename, bool forString)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string FileUtilsAndroid::getStringFromFile(const std::string& filename)
|
std::string FileUtilsWin32::getStringFromFile(const std::string& filename)
|
||||||
{
|
{
|
||||||
Data data = getData(filename, true);
|
Data data = getData(filename, true);
|
||||||
std::string ret((const char*)data.getBytes());
|
std::string ret((const char*)data.getBytes());
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
Data FileUtilsAndroid::getDataFromFile(const std::string& filename)
|
Data FileUtilsWin32::getDataFromFile(const std::string& filename)
|
||||||
{
|
{
|
||||||
return getData(filename, false);
|
return getData(filename, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char* FileUtilsWin32::getFileData(const char* filename, const char* mode, ssize_t* size)
|
unsigned char* FileUtilsWin32::getFileData(const std::string& filename, const char* mode, ssize_t* size)
|
||||||
{
|
{
|
||||||
unsigned char * pBuffer = NULL;
|
unsigned char * pBuffer = NULL;
|
||||||
CCASSERT(filename != NULL && size != NULL && mode != NULL, "Invalid parameters.");
|
|
||||||
*size = 0;
|
*size = 0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
|
|
@ -58,7 +58,7 @@ protected:
|
||||||
* @return Upon success, a pointer to the data is returned, otherwise NULL.
|
* @return Upon success, a pointer to the data is returned, otherwise NULL.
|
||||||
* @warning Recall: you are responsible for calling delete[] on any Non-NULL pointer returned.
|
* @warning Recall: you are responsible for calling delete[] on any Non-NULL pointer returned.
|
||||||
*/
|
*/
|
||||||
CC_DEPRECATED_ATTRIBUTE virtual unsigned char* getFileData(const char* filename, const char* mode, ssize_t * size) override;
|
CC_DEPRECATED_ATTRIBUTE virtual unsigned char* getFileData(const std::string& filename, const char* mode, ssize_t * size) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets string from a file.
|
* Gets string from a file.
|
||||||
|
|
|
@ -29,9 +29,9 @@ RenderCommandPool<CustomCommand> CustomCommand::_commandPool;
|
||||||
|
|
||||||
CustomCommand::CustomCommand()
|
CustomCommand::CustomCommand()
|
||||||
:RenderCommand()
|
:RenderCommand()
|
||||||
|
, func(nullptr)
|
||||||
, _viewport(0)
|
, _viewport(0)
|
||||||
, _depth(0)
|
, _depth(0)
|
||||||
, func(nullptr)
|
|
||||||
{
|
{
|
||||||
_type = RenderCommand::Type::CUSTOM_COMMAND;
|
_type = RenderCommand::Type::CUSTOM_COMMAND;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,9 +41,9 @@ using namespace std;
|
||||||
|
|
||||||
Renderer::Renderer()
|
Renderer::Renderer()
|
||||||
:_lastMaterialID(0)
|
:_lastMaterialID(0)
|
||||||
,_numQuads(0)
|
|
||||||
,_firstCommand(0)
|
,_firstCommand(0)
|
||||||
,_lastCommand(0)
|
,_lastCommand(0)
|
||||||
|
,_numQuads(0)
|
||||||
,_glViewAssigned(false)
|
,_glViewAssigned(false)
|
||||||
{
|
{
|
||||||
_commandGroupStack.push(DEFAULT_RENDER_QUEUE);
|
_commandGroupStack.push(DEFAULT_RENDER_QUEUE);
|
||||||
|
@ -65,11 +65,14 @@ Renderer::~Renderer()
|
||||||
glDeleteVertexArrays(1, &_quadVAO);
|
glDeleteVertexArrays(1, &_quadVAO);
|
||||||
GL::bindVAO(0);
|
GL::bindVAO(0);
|
||||||
}
|
}
|
||||||
|
#if CC_ENABLE_CACHE_TEXTURE_DATA
|
||||||
|
NotificationCenter::getInstance()->removeObserver(this, EVNET_COME_TO_FOREGROUND);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Renderer::initGLView()
|
void Renderer::initGLView()
|
||||||
{
|
{
|
||||||
#if 0//CC_ENABLE_CACHE_TEXTURE_DATA
|
#if CC_ENABLE_CACHE_TEXTURE_DATA
|
||||||
// listen the event when app go to background
|
// listen the event when app go to background
|
||||||
NotificationCenter::getInstance()->addObserver(this,
|
NotificationCenter::getInstance()->addObserver(this,
|
||||||
callfuncO_selector(Renderer::onBackToForeground),
|
callfuncO_selector(Renderer::onBackToForeground),
|
||||||
|
|
|
@ -39,13 +39,17 @@ _size(0)
|
||||||
CCLOGINFO("In the empty constructor of Data.");
|
CCLOGINFO("In the empty constructor of Data.");
|
||||||
}
|
}
|
||||||
|
|
||||||
Data::Data(Data&& other)
|
Data::Data(Data&& other) :
|
||||||
|
_bytes(nullptr),
|
||||||
|
_size(0)
|
||||||
{
|
{
|
||||||
CCLOGINFO("In the move constructor of Data.");
|
CCLOGINFO("In the move constructor of Data.");
|
||||||
move(other);
|
move(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
Data::Data(const Data& other)
|
Data::Data(const Data& other) :
|
||||||
|
_bytes(nullptr),
|
||||||
|
_size(0)
|
||||||
{
|
{
|
||||||
CCLOGINFO("In the copy constructor of Data.");
|
CCLOGINFO("In the copy constructor of Data.");
|
||||||
copy(other._bytes, other._size);
|
copy(other._bytes, other._size);
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "CCPlatformMacros.h"
|
#include "CCPlatformMacros.h"
|
||||||
#include <stdint.h> // for ssize_t on android
|
#include <stdint.h> // for ssize_t on android
|
||||||
#include <string> // for ssize_t on linux
|
#include <string> // for ssize_t on linux
|
||||||
|
#include "CCStdC.h" // for ssize_t on window
|
||||||
|
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
|
|
|
@ -107,10 +107,22 @@ public:
|
||||||
_data.reserve(capacity);
|
_data.reserve(capacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns capacity of the map */
|
/** Returns the number of buckets in the Map container. */
|
||||||
ssize_t capacity() const
|
ssize_t bucketCount() const
|
||||||
{
|
{
|
||||||
return _data.capacity();
|
return _data.bucket_count();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Returns the number of elements in bucket n. */
|
||||||
|
ssize_t bucketSize(ssize_t n) const
|
||||||
|
{
|
||||||
|
return _data.bucket_size(n);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Returns the bucket number where the element with key k is located. */
|
||||||
|
ssize_t bucket(const K& k) const
|
||||||
|
{
|
||||||
|
return _data.bucket(k);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The number of elements in the map. */
|
/** The number of elements in the map. */
|
||||||
|
|
|
@ -34,18 +34,19 @@ NS_CC_BEGIN
|
||||||
typedef std::vector<std::string> strArray;
|
typedef std::vector<std::string> strArray;
|
||||||
|
|
||||||
// string toolkit
|
// string toolkit
|
||||||
static inline void split(std::string src, const char* token, strArray& vect)
|
static inline void split(const std::string& src, const std::string& token, strArray& vect)
|
||||||
{
|
{
|
||||||
size_t nend=0;
|
size_t nend = 0;
|
||||||
size_t nbegin=0;
|
size_t nbegin = 0;
|
||||||
while(nend != -1)
|
size_t tokenSize = token.size();
|
||||||
|
while(nend != std::string::npos)
|
||||||
{
|
{
|
||||||
nend = src.find(token, nbegin);
|
nend = src.find(token, nbegin);
|
||||||
if(nend == -1)
|
if(nend == std::string::npos)
|
||||||
vect.push_back(src.substr(nbegin, src.length()-nbegin));
|
vect.push_back(src.substr(nbegin, src.length()-nbegin));
|
||||||
else
|
else
|
||||||
vect.push_back(src.substr(nbegin, nend-nbegin));
|
vect.push_back(src.substr(nbegin, nend-nbegin));
|
||||||
nbegin = nend + strlen(token);
|
nbegin = nend + tokenSize;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +70,7 @@ static bool splitWithForm(const std::string& str, strArray& strs)
|
||||||
size_t nPosRight = content.find('}');
|
size_t nPosRight = content.find('}');
|
||||||
|
|
||||||
// don't have '{' and '}'
|
// don't have '{' and '}'
|
||||||
CC_BREAK_IF(nPosLeft == (int)std::string::npos || nPosRight == (int)std::string::npos);
|
CC_BREAK_IF(nPosLeft == std::string::npos || nPosRight == std::string::npos);
|
||||||
// '}' is before '{'
|
// '}' is before '{'
|
||||||
CC_BREAK_IF(nPosLeft > nPosRight);
|
CC_BREAK_IF(nPosLeft > nPosRight);
|
||||||
|
|
||||||
|
@ -80,7 +81,7 @@ static bool splitWithForm(const std::string& str, strArray& strs)
|
||||||
size_t nPos1 = pointStr.find('{');
|
size_t nPos1 = pointStr.find('{');
|
||||||
size_t nPos2 = pointStr.find('}');
|
size_t nPos2 = pointStr.find('}');
|
||||||
// contain '{' or '}'
|
// contain '{' or '}'
|
||||||
CC_BREAK_IF(nPos1 != (int)std::string::npos || nPos2 != (int)std::string::npos);
|
CC_BREAK_IF(nPos1 != std::string::npos || nPos2 != std::string::npos);
|
||||||
|
|
||||||
split(pointStr, ",", strs);
|
split(pointStr, ",", strs);
|
||||||
if (strs.size() != 2 || strs[0].length() == 0 || strs[1].length() == 0)
|
if (strs.size() != 2 || strs[0].length() == 0 || strs[1].length() == 0)
|
||||||
|
@ -111,19 +112,19 @@ Rect RectFromString(const std::string& str)
|
||||||
size_t nPosRight = content.find('}');
|
size_t nPosRight = content.find('}');
|
||||||
for (int i = 1; i < 3; ++i)
|
for (int i = 1; i < 3; ++i)
|
||||||
{
|
{
|
||||||
if (nPosRight == (int)std::string::npos)
|
if (nPosRight == std::string::npos)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
nPosRight = content.find('}', nPosRight + 1);
|
nPosRight = content.find('}', nPosRight + 1);
|
||||||
}
|
}
|
||||||
CC_BREAK_IF(nPosLeft == (int)std::string::npos || nPosRight == (int)std::string::npos);
|
CC_BREAK_IF(nPosLeft == std::string::npos || nPosRight == std::string::npos);
|
||||||
|
|
||||||
content = content.substr(nPosLeft + 1, nPosRight - nPosLeft - 1);
|
content = content.substr(nPosLeft + 1, nPosRight - nPosLeft - 1);
|
||||||
size_t nPointEnd = content.find('}');
|
size_t nPointEnd = content.find('}');
|
||||||
CC_BREAK_IF(nPointEnd == (int)std::string::npos);
|
CC_BREAK_IF(nPointEnd == std::string::npos);
|
||||||
nPointEnd = content.find(',', nPointEnd);
|
nPointEnd = content.find(',', nPointEnd);
|
||||||
CC_BREAK_IF(nPointEnd == (int)std::string::npos);
|
CC_BREAK_IF(nPointEnd == std::string::npos);
|
||||||
|
|
||||||
// get the point string and size string
|
// get the point string and size string
|
||||||
std::string pointStr = content.substr(0, nPointEnd);
|
std::string pointStr = content.substr(0, nPointEnd);
|
||||||
|
|
|
@ -181,9 +181,6 @@ bool Armature::init(const std::string& name)
|
||||||
|
|
||||||
setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));
|
setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));
|
||||||
|
|
||||||
unscheduleUpdate();
|
|
||||||
scheduleUpdate();
|
|
||||||
|
|
||||||
setCascadeOpacityEnabled(true);
|
setCascadeOpacityEnabled(true);
|
||||||
setCascadeColorEnabled(true);
|
setCascadeColorEnabled(true);
|
||||||
|
|
||||||
|
@ -432,6 +429,18 @@ void Armature::draw()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Armature::onEnter()
|
||||||
|
{
|
||||||
|
Node::onEnter();
|
||||||
|
scheduleUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Armature::onExit()
|
||||||
|
{
|
||||||
|
Node::onExit();
|
||||||
|
unscheduleUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Armature::visit()
|
void Armature::visit()
|
||||||
{
|
{
|
||||||
|
|
|
@ -161,6 +161,9 @@ public:
|
||||||
virtual void update(float dt) override;
|
virtual void update(float dt) override;
|
||||||
virtual void draw() override;
|
virtual void draw() override;
|
||||||
|
|
||||||
|
virtual void onEnter() override;
|
||||||
|
virtual void onExit() override;
|
||||||
|
|
||||||
virtual const kmMat4& getNodeToParentTransform() const override;
|
virtual const kmMat4& getNodeToParentTransform() const override;
|
||||||
/**
|
/**
|
||||||
* @js NA
|
* @js NA
|
||||||
|
|
|
@ -246,8 +246,12 @@ void ArmatureAnimation::play(const std::string& animationName, int durationTo,
|
||||||
_armature->update(0);
|
_armature->update(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ArmatureAnimation::playByIndex(int animationIndex, int durationTo, int loop)
|
void ArmatureAnimation::playByIndex(int animationIndex, int durationTo, int loop)
|
||||||
|
{
|
||||||
|
playWithIndex(animationIndex, durationTo, loop);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ArmatureAnimation::playWithIndex(int animationIndex, int durationTo, int loop)
|
||||||
{
|
{
|
||||||
std::vector<std::string> &movName = _animationData->movementNames;
|
std::vector<std::string> &movName = _animationData->movementNames;
|
||||||
CC_ASSERT((animationIndex > -1) && ((unsigned int)animationIndex < movName.size()));
|
CC_ASSERT((animationIndex > -1) && ((unsigned int)animationIndex < movName.size()));
|
||||||
|
@ -257,7 +261,7 @@ void ArmatureAnimation::playByIndex(int animationIndex, int durationTo, int loop
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ArmatureAnimation::play(const std::vector<std::string>& movementNames, int durationTo, bool loop)
|
void ArmatureAnimation::playWithNames(const std::vector<std::string>& movementNames, int durationTo, bool loop)
|
||||||
{
|
{
|
||||||
_movementList.clear();
|
_movementList.clear();
|
||||||
_movementListLoop = loop;
|
_movementListLoop = loop;
|
||||||
|
@ -270,7 +274,7 @@ void ArmatureAnimation::play(const std::vector<std::string>& movementNames, int
|
||||||
updateMovementList();
|
updateMovementList();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArmatureAnimation::playByIndex(const std::vector<int>& movementIndexes, int durationTo, bool loop)
|
void ArmatureAnimation::playWithIndexes(const std::vector<int>& movementIndexes, int durationTo, bool loop)
|
||||||
{
|
{
|
||||||
_movementList.clear();
|
_movementList.clear();
|
||||||
_movementListLoop = loop;
|
_movementListLoop = loop;
|
||||||
|
|
|
@ -127,13 +127,14 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Play animation by index, the other param is the same to play.
|
* Play animation by index, the other param is the same to play.
|
||||||
|
* @deprecated, please use playWithIndex
|
||||||
* @param animationIndex the animation index you want to play
|
* @param animationIndex the animation index you want to play
|
||||||
*/
|
*/
|
||||||
virtual void playByIndex(int animationIndex, int durationTo = -1, int loop = -1);
|
CC_DEPRECATED_ATTRIBUTE virtual void playByIndex(int animationIndex, int durationTo = -1, int loop = -1);
|
||||||
|
virtual void playWithIndex(int animationIndex, int durationTo = -1, int loop = -1);
|
||||||
|
|
||||||
|
virtual void playWithNames(const std::vector<std::string>& movementNames, int durationTo = -1, bool loop = true);
|
||||||
virtual void play(const std::vector<std::string>& movementNames, int durationTo = -1, bool loop = true);
|
virtual void playWithIndexes(const std::vector<int>& movementIndexes, int durationTo = -1, bool loop = true);
|
||||||
virtual void playByIndex(const std::vector<int>& movementIndexes, int durationTo = -1, bool loop = true);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Go to specified frame and play current movement.
|
* Go to specified frame and play current movement.
|
||||||
|
|
|
@ -199,7 +199,7 @@ private:
|
||||||
|
|
||||||
bool _autoLoadSpriteFile;
|
bool _autoLoadSpriteFile;
|
||||||
|
|
||||||
std::map<std::string, RelativeData> _relativeDatas;
|
std::unordered_map<std::string, RelativeData> _relativeDatas;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -299,6 +299,12 @@ void ListView::removeLastItem()
|
||||||
removeItem(_items.size() -1);
|
removeItem(_items.size() -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ListView::removeAllItems()
|
||||||
|
{
|
||||||
|
_items.clear();
|
||||||
|
removeAllChildren();
|
||||||
|
}
|
||||||
|
|
||||||
Widget* ListView::getItem(unsigned int index)
|
Widget* ListView::getItem(unsigned int index)
|
||||||
{
|
{
|
||||||
if ((int)index < 0 || index >= _items.size())
|
if ((int)index < 0 || index >= _items.size())
|
||||||
|
@ -434,7 +440,7 @@ void ListView::onSizeChanged()
|
||||||
|
|
||||||
std::string ListView::getDescription() const
|
std::string ListView::getDescription() const
|
||||||
{
|
{
|
||||||
return "ListViewEx";
|
return "ListView";
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget* ListView::createCloneInstance()
|
Widget* ListView::createCloneInstance()
|
||||||
|
@ -444,7 +450,7 @@ Widget* ListView::createCloneInstance()
|
||||||
|
|
||||||
void ListView::copyClonedWidgetChildren(Widget* model)
|
void ListView::copyClonedWidgetChildren(Widget* model)
|
||||||
{
|
{
|
||||||
auto& arrayItems = getItems();
|
auto& arrayItems = static_cast<ListView*>(model)->getItems();
|
||||||
for (auto& item : arrayItems)
|
for (auto& item : arrayItems)
|
||||||
{
|
{
|
||||||
pushBackCustomItem(item->clone());
|
pushBackCustomItem(item->clone());
|
||||||
|
|
|
@ -112,6 +112,8 @@ public:
|
||||||
*/
|
*/
|
||||||
void removeItem(int index);
|
void removeItem(int index);
|
||||||
|
|
||||||
|
void removeAllItems();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a item whose index is same as the parameter.
|
* Returns a item whose index is same as the parameter.
|
||||||
*
|
*
|
||||||
|
@ -173,9 +175,13 @@ protected:
|
||||||
virtual void addChild(Node* child, int zOrder, int tag) override{ScrollView::addChild(child, zOrder, tag);};
|
virtual void addChild(Node* child, int zOrder, int tag) override{ScrollView::addChild(child, zOrder, tag);};
|
||||||
virtual void removeChild(Node* widget, bool cleanup = true) override{ScrollView::removeChild(widget, cleanup);};
|
virtual void removeChild(Node* widget, bool cleanup = true) override{ScrollView::removeChild(widget, cleanup);};
|
||||||
|
|
||||||
virtual void removeAllChildren() override{ScrollView::removeAllChildren();};
|
virtual void removeAllChildren() override{removeAllChildrenWithCleanup(true);};
|
||||||
|
virtual void removeAllChildrenWithCleanup(bool cleanup) override {ScrollView::removeAllChildrenWithCleanup(cleanup);};
|
||||||
virtual Vector<Node*>& getChildren() override{return ScrollView::getChildren();};
|
virtual Vector<Node*>& getChildren() override{return ScrollView::getChildren();};
|
||||||
virtual const Vector<Node*>& getChildren() const override{return ScrollView::getChildren();};
|
virtual const Vector<Node*>& getChildren() const override{return ScrollView::getChildren();};
|
||||||
|
virtual ssize_t getChildrenCount() const override {return ScrollView::getChildrenCount();};
|
||||||
|
virtual Node * getChildByTag(int tag) override {return ScrollView::getChildByTag(tag);};
|
||||||
|
virtual Widget* getChildByName(const char* name) override {return ScrollView::getChildByName(name);};
|
||||||
virtual bool init() override;
|
virtual bool init() override;
|
||||||
void updateInnerContainerSize();
|
void updateInnerContainerSize();
|
||||||
void remedyLayoutParameter(Widget* item);
|
void remedyLayoutParameter(Widget* item);
|
||||||
|
|
|
@ -217,32 +217,18 @@ void LoadingBar::setPercent(int percent)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_percent = percent;
|
_percent = percent;
|
||||||
float res = _percent/100.0;
|
float res = _percent / 100.0f;
|
||||||
|
|
||||||
int x = 0, y = 0;
|
|
||||||
switch (_renderBarTexType)
|
|
||||||
{
|
|
||||||
case UI_TEX_TYPE_PLIST:
|
|
||||||
{
|
|
||||||
Sprite* barNode = dynamic_cast<Sprite*>(_barRenderer);
|
|
||||||
if (barNode)
|
|
||||||
{
|
|
||||||
Point to = barNode->getTextureRect().origin;
|
|
||||||
x = to.x;
|
|
||||||
y = to.y;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (_scale9Enabled)
|
if (_scale9Enabled)
|
||||||
{
|
{
|
||||||
setScale9Scale();
|
setScale9Scale();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
static_cast<Sprite*>(_barRenderer)->setTextureRect(Rect(x, y, _barRendererTextureSize.width * res, _barRendererTextureSize.height));
|
Sprite* spriteRenderer = static_cast<Sprite*>(_barRenderer);
|
||||||
|
Rect rect = spriteRenderer->getTextureRect();
|
||||||
|
rect.size.width = _barRendererTextureSize.width * res;
|
||||||
|
spriteRenderer->setTextureRect(rect, spriteRenderer->isTextureRectRotated(), rect.size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -324,7 +310,7 @@ void LoadingBar::barRendererScaleChangedWithSize()
|
||||||
|
|
||||||
void LoadingBar::setScale9Scale()
|
void LoadingBar::setScale9Scale()
|
||||||
{
|
{
|
||||||
float width = (float)(_percent) / 100 * _totalLength;
|
float width = (float)(_percent) / 100.0f * _totalLength;
|
||||||
static_cast<extension::Scale9Sprite*>(_barRenderer)->setPreferredSize(Size(width, _size.height));
|
static_cast<extension::Scale9Sprite*>(_barRenderer)->setPreferredSize(Size(width, _size.height));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -295,9 +295,14 @@ void PageView::updateChildrenPosition()
|
||||||
}
|
}
|
||||||
|
|
||||||
void PageView::removeAllChildren()
|
void PageView::removeAllChildren()
|
||||||
|
{
|
||||||
|
removeAllChildrenWithCleanup(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PageView::removeAllChildrenWithCleanup(bool cleanup)
|
||||||
{
|
{
|
||||||
_pages.clear();
|
_pages.clear();
|
||||||
Layout::removeAllChildren();
|
Layout::removeAllChildrenWithCleanup(cleanup);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PageView::scrollToPage(int idx)
|
void PageView::scrollToPage(int idx)
|
||||||
|
@ -602,7 +607,7 @@ Widget* PageView::createCloneInstance()
|
||||||
|
|
||||||
void PageView::copyClonedWidgetChildren(Widget* model)
|
void PageView::copyClonedWidgetChildren(Widget* model)
|
||||||
{
|
{
|
||||||
auto& modelPages = dynamic_cast<PageView*>(model)->getPages();
|
auto& modelPages = static_cast<PageView*>(model)->getPages();
|
||||||
for (auto& page : modelPages)
|
for (auto& page : modelPages)
|
||||||
{
|
{
|
||||||
addPage(dynamic_cast<Layout*>(page->clone()));
|
addPage(dynamic_cast<Layout*>(page->clone()));
|
||||||
|
|
|
@ -165,8 +165,12 @@ protected:
|
||||||
virtual void addChild(Node* child, int zOrder, int tag) override;
|
virtual void addChild(Node* child, int zOrder, int tag) override;
|
||||||
virtual void removeChild(Node* widget, bool cleanup = true) override;
|
virtual void removeChild(Node* widget, bool cleanup = true) override;
|
||||||
virtual void removeAllChildren() override;
|
virtual void removeAllChildren() override;
|
||||||
|
virtual void removeAllChildrenWithCleanup(bool cleanup) override;
|
||||||
virtual Vector<Node*>& getChildren() override{return Widget::getChildren();};
|
virtual Vector<Node*>& getChildren() override{return Widget::getChildren();};
|
||||||
virtual const Vector<Node*>& getChildren() const override{return Widget::getChildren();};
|
virtual const Vector<Node*>& getChildren() const override{return Widget::getChildren();};
|
||||||
|
virtual ssize_t getChildrenCount() const override {return Widget::getChildrenCount();};
|
||||||
|
virtual Node * getChildByTag(int tag) override {return Widget::getChildByTag(tag);};
|
||||||
|
virtual Widget* getChildByName(const char* name) override {return Widget::getChildByName(name);};
|
||||||
virtual bool init() override;
|
virtual bool init() override;
|
||||||
Layout* createPage();
|
Layout* createPage();
|
||||||
float getPositionXByIndex(int idx);
|
float getPositionXByIndex(int idx);
|
||||||
|
|
|
@ -231,7 +231,12 @@ void ScrollView::addChild(Node *child, int zOrder, int tag)
|
||||||
|
|
||||||
void ScrollView::removeAllChildren()
|
void ScrollView::removeAllChildren()
|
||||||
{
|
{
|
||||||
_innerContainer->removeAllChildren();
|
removeAllChildrenWithCleanup(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScrollView::removeAllChildrenWithCleanup(bool cleanup)
|
||||||
|
{
|
||||||
|
_innerContainer->removeAllChildrenWithCleanup(cleanup);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScrollView::removeChild(Node* child, bool cleanup)
|
void ScrollView::removeChild(Node* child, bool cleanup)
|
||||||
|
@ -249,6 +254,21 @@ const Vector<Node*>& ScrollView::getChildren() const
|
||||||
return _innerContainer->getChildren();
|
return _innerContainer->getChildren();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ssize_t ScrollView::getChildrenCount() const
|
||||||
|
{
|
||||||
|
return _innerContainer->getChildrenCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
Node* ScrollView::getChildByTag(int tag)
|
||||||
|
{
|
||||||
|
return _innerContainer->getChildByTag(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget* ScrollView::getChildByName(const char *name)
|
||||||
|
{
|
||||||
|
return _innerContainer->getChildByName(name);
|
||||||
|
}
|
||||||
|
|
||||||
void ScrollView::moveChildren(float offsetX, float offsetY)
|
void ScrollView::moveChildren(float offsetX, float offsetY)
|
||||||
{
|
{
|
||||||
_moveChildPoint = _innerContainer->getPosition() + Point(offsetX, offsetY);
|
_moveChildPoint = _innerContainer->getPosition() + Point(offsetX, offsetY);
|
||||||
|
|
|
@ -259,6 +259,8 @@ public:
|
||||||
//override "removeAllChildrenAndCleanUp" method of widget.
|
//override "removeAllChildrenAndCleanUp" method of widget.
|
||||||
virtual void removeAllChildren() override;
|
virtual void removeAllChildren() override;
|
||||||
|
|
||||||
|
virtual void removeAllChildrenWithCleanup(bool cleanup) override;
|
||||||
|
|
||||||
//override "removeChild" method of widget.
|
//override "removeChild" method of widget.
|
||||||
virtual void removeChild(Node* child, bool cleaup = true) override;
|
virtual void removeChild(Node* child, bool cleaup = true) override;
|
||||||
|
|
||||||
|
@ -266,6 +268,12 @@ public:
|
||||||
virtual Vector<Node*>& getChildren() override;
|
virtual Vector<Node*>& getChildren() override;
|
||||||
virtual const Vector<Node*>& getChildren() const override;
|
virtual const Vector<Node*>& getChildren() const override;
|
||||||
|
|
||||||
|
virtual ssize_t getChildrenCount() const override;
|
||||||
|
|
||||||
|
virtual Node * getChildByTag(int tag) override;
|
||||||
|
|
||||||
|
virtual Widget* getChildByName(const char* name) override;
|
||||||
|
|
||||||
virtual bool onTouchBegan(Touch *touch, Event *unusedEvent) override;
|
virtual bool onTouchBegan(Touch *touch, Event *unusedEvent) override;
|
||||||
virtual void onTouchMoved(Touch *touch, Event *unusedEvent) override;
|
virtual void onTouchMoved(Touch *touch, Event *unusedEvent) override;
|
||||||
virtual void onTouchEnded(Touch *touch, Event *unusedEvent) override;
|
virtual void onTouchEnded(Touch *touch, Event *unusedEvent) override;
|
||||||
|
|
|
@ -339,7 +339,8 @@ void Slider::setPercent(int percent)
|
||||||
percent = 0;
|
percent = 0;
|
||||||
}
|
}
|
||||||
_percent = percent;
|
_percent = percent;
|
||||||
float dis = _barLength*(percent/100.0f);
|
float res = percent / 100.0f;
|
||||||
|
float dis = _barLength * res;
|
||||||
_slidBallRenderer->setPosition(Point(-_barLength/2.0f + dis, 0.0f));
|
_slidBallRenderer->setPosition(Point(-_barLength/2.0f + dis, 0.0f));
|
||||||
if (_scale9Enabled)
|
if (_scale9Enabled)
|
||||||
{
|
{
|
||||||
|
@ -347,24 +348,10 @@ void Slider::setPercent(int percent)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int x = 0, y = 0;
|
Sprite* spriteRenderer = static_cast<Sprite*>(_progressBarRenderer);
|
||||||
switch (_progressBarTexType)
|
Rect rect = spriteRenderer->getTextureRect();
|
||||||
{
|
rect.size.width = _progressBarTextureSize.width * res;
|
||||||
case UI_TEX_TYPE_PLIST:
|
spriteRenderer->setTextureRect(rect, spriteRenderer->isTextureRectRotated(), rect.size);
|
||||||
{
|
|
||||||
Sprite* barNode = dynamic_cast<Sprite*>(_progressBarRenderer);
|
|
||||||
if (barNode)
|
|
||||||
{
|
|
||||||
Point to = barNode->getTextureRect().origin;
|
|
||||||
x = to.x;
|
|
||||||
y = to.y;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
static_cast<Sprite*>(_progressBarRenderer)->setTextureRect(Rect(x, y, _progressBarTextureSize.width * (percent/100.0f), _progressBarTextureSize.height));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -165,7 +165,7 @@ const Vector<Node*>& Widget::getChildren() const
|
||||||
return _widgetChildren;
|
return _widgetChildren;
|
||||||
}
|
}
|
||||||
|
|
||||||
long Widget::getChildrenCount() const
|
ssize_t Widget::getChildrenCount() const
|
||||||
{
|
{
|
||||||
return _widgetChildren.size();
|
return _widgetChildren.size();
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,7 +232,7 @@ public:
|
||||||
*
|
*
|
||||||
* @return a Node object whose tag equals to the input parameter
|
* @return a Node object whose tag equals to the input parameter
|
||||||
*/
|
*/
|
||||||
Node * getChildByTag(int tag);
|
virtual Node * getChildByTag(int tag) override;
|
||||||
|
|
||||||
virtual void sortAllChildren() override;
|
virtual void sortAllChildren() override;
|
||||||
/**
|
/**
|
||||||
|
@ -259,14 +259,14 @@ public:
|
||||||
*
|
*
|
||||||
* @return The amount of children.
|
* @return The amount of children.
|
||||||
*/
|
*/
|
||||||
long getChildrenCount() const;
|
virtual ssize_t getChildrenCount() const override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes this node itself from its parent node with a cleanup.
|
* Removes this node itself from its parent node with a cleanup.
|
||||||
* If the node orphan, then nothing happens.
|
* If the node orphan, then nothing happens.
|
||||||
* @see `removeFromParentAndCleanup(bool)`
|
* @see `removeFromParentAndCleanup(bool)`
|
||||||
*/
|
*/
|
||||||
virtual void removeFromParent();
|
virtual void removeFromParent() override;
|
||||||
/**
|
/**
|
||||||
* Removes this node itself from its parent node.
|
* Removes this node itself from its parent node.
|
||||||
* If the node orphan, then nothing happens.
|
* If the node orphan, then nothing happens.
|
||||||
|
@ -274,7 +274,7 @@ public:
|
||||||
* @js removeFromParent
|
* @js removeFromParent
|
||||||
* @lua removeFromParent
|
* @lua removeFromParent
|
||||||
*/
|
*/
|
||||||
virtual void removeFromParentAndCleanup(bool cleanup);
|
virtual void removeFromParentAndCleanup(bool cleanup) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes a child from the container. It will also cleanup all running actions depending on the cleanup parameter.
|
* Removes a child from the container. It will also cleanup all running actions depending on the cleanup parameter.
|
||||||
|
@ -282,7 +282,7 @@ public:
|
||||||
* @param child The child node which will be removed.
|
* @param child The child node which will be removed.
|
||||||
* @param cleanup true if all running actions and callbacks on the child node will be cleanup, false otherwise.
|
* @param cleanup true if all running actions and callbacks on the child node will be cleanup, false otherwise.
|
||||||
*/
|
*/
|
||||||
virtual void removeChild(Node* child, bool cleanup = true);
|
virtual void removeChild(Node* child, bool cleanup = true) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes a child from the container by tag value. It will also cleanup all running actions depending on the cleanup parameter
|
* Removes a child from the container by tag value. It will also cleanup all running actions depending on the cleanup parameter
|
||||||
|
@ -290,13 +290,13 @@ public:
|
||||||
* @param tag An interger number that identifies a child node
|
* @param tag An interger number that identifies a child node
|
||||||
* @param cleanup true if all running actions and callbacks on the child node will be cleanup, false otherwise.
|
* @param cleanup true if all running actions and callbacks on the child node will be cleanup, false otherwise.
|
||||||
*/
|
*/
|
||||||
virtual void removeChildByTag(int tag, bool cleanup = true);
|
virtual void removeChildByTag(int tag, bool cleanup = true) override;
|
||||||
/**
|
/**
|
||||||
* Removes all children from the container with a cleanup.
|
* Removes all children from the container with a cleanup.
|
||||||
*
|
*
|
||||||
* @see `removeAllChildrenWithCleanup(bool)`
|
* @see `removeAllChildrenWithCleanup(bool)`
|
||||||
*/
|
*/
|
||||||
virtual void removeAllChildren();
|
virtual void removeAllChildren() override;
|
||||||
/**
|
/**
|
||||||
* Removes all children from the container, and do a cleanup to all running actions depending on the cleanup parameter.
|
* Removes all children from the container, and do a cleanup to all running actions depending on the cleanup parameter.
|
||||||
*
|
*
|
||||||
|
@ -304,7 +304,7 @@ public:
|
||||||
* @js removeAllChildren
|
* @js removeAllChildren
|
||||||
* @lua removeAllChildren
|
* @lua removeAllChildren
|
||||||
*/
|
*/
|
||||||
virtual void removeAllChildrenWithCleanup(bool cleanup);
|
virtual void removeAllChildrenWithCleanup(bool cleanup) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a child from the container with its name
|
* Gets a child from the container with its name
|
||||||
|
@ -313,7 +313,7 @@ public:
|
||||||
*
|
*
|
||||||
* @return a Widget object whose name equals to the input parameter
|
* @return a Widget object whose name equals to the input parameter
|
||||||
*/
|
*/
|
||||||
Widget* getChildByName(const char* name);
|
virtual Widget* getChildByName(const char* name);
|
||||||
|
|
||||||
virtual void visit();
|
virtual void visit();
|
||||||
|
|
||||||
|
@ -663,36 +663,27 @@ protected:
|
||||||
bool _focus; ///< is the widget on focus
|
bool _focus; ///< is the widget on focus
|
||||||
BrightStyle _brightStyle; ///< bright style
|
BrightStyle _brightStyle; ///< bright style
|
||||||
bool _updateEnabled; ///< is "update" method scheduled
|
bool _updateEnabled; ///< is "update" method scheduled
|
||||||
// Node* _renderer; ///< base renderer
|
|
||||||
Point _touchStartPos; ///< touch began point
|
Point _touchStartPos; ///< touch began point
|
||||||
Point _touchMovePos; ///< touch moved point
|
Point _touchMovePos; ///< touch moved point
|
||||||
Point _touchEndPos; ///< touch ended point
|
Point _touchEndPos; ///< touch ended point
|
||||||
|
|
||||||
Object* _touchEventListener;
|
Object* _touchEventListener;
|
||||||
SEL_TouchEvent _touchEventSelector;
|
SEL_TouchEvent _touchEventSelector;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::string _name;
|
std::string _name;
|
||||||
WidgetType _widgetType;
|
WidgetType _widgetType;
|
||||||
int _actionTag;
|
int _actionTag;
|
||||||
Size _size;
|
Size _size;
|
||||||
Size _customSize;
|
Size _customSize;
|
||||||
Map<int, LayoutParameter*> _layoutParameterDictionary;
|
|
||||||
bool _ignoreSize;
|
bool _ignoreSize;
|
||||||
Vector<Node*> _widgetChildren;
|
|
||||||
bool _affectByClipping;
|
bool _affectByClipping;
|
||||||
|
|
||||||
SizeType _sizeType;
|
SizeType _sizeType;
|
||||||
Point _sizePercent;
|
Point _sizePercent;
|
||||||
PositionType _positionType;
|
PositionType _positionType;
|
||||||
Point _positionPercent;
|
Point _positionPercent;
|
||||||
|
|
||||||
bool _reorderWidgetChildDirty;
|
bool _reorderWidgetChildDirty;
|
||||||
|
|
||||||
bool _hitted;
|
bool _hitted;
|
||||||
|
|
||||||
EventListenerTouchOneByOne* _touchListener;
|
EventListenerTouchOneByOne* _touchListener;
|
||||||
|
Map<int, LayoutParameter*> _layoutParameterDictionary;
|
||||||
|
Vector<Node*> _widgetChildren;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,18 +16,15 @@
|
||||||
<ClInclude Include="..\UICheckBox.h" />
|
<ClInclude Include="..\UICheckBox.h" />
|
||||||
<ClInclude Include="..\UIHelper.h" />
|
<ClInclude Include="..\UIHelper.h" />
|
||||||
<ClInclude Include="..\UIImageView.h" />
|
<ClInclude Include="..\UIImageView.h" />
|
||||||
<ClInclude Include="..\UIInputManager.h" />
|
|
||||||
<ClInclude Include="..\UILabel.h" />
|
<ClInclude Include="..\UILabel.h" />
|
||||||
<ClInclude Include="..\UILabelAtlas.h" />
|
<ClInclude Include="..\UILabelAtlas.h" />
|
||||||
<ClInclude Include="..\UILabelBMFont.h" />
|
<ClInclude Include="..\UILabelBMFont.h" />
|
||||||
<ClInclude Include="..\UILayer.h" />
|
|
||||||
<ClInclude Include="..\UILayout.h" />
|
<ClInclude Include="..\UILayout.h" />
|
||||||
<ClInclude Include="..\UILayoutDefine.h" />
|
<ClInclude Include="..\UILayoutDefine.h" />
|
||||||
<ClInclude Include="..\UILayoutParameter.h" />
|
<ClInclude Include="..\UILayoutParameter.h" />
|
||||||
<ClInclude Include="..\UIListView.h" />
|
<ClInclude Include="..\UIListView.h" />
|
||||||
<ClInclude Include="..\UILoadingBar.h" />
|
<ClInclude Include="..\UILoadingBar.h" />
|
||||||
<ClInclude Include="..\UIPageView.h" />
|
<ClInclude Include="..\UIPageView.h" />
|
||||||
<ClInclude Include="..\UIRootWidget.h" />
|
|
||||||
<ClInclude Include="..\UIScrollInterface.h" />
|
<ClInclude Include="..\UIScrollInterface.h" />
|
||||||
<ClInclude Include="..\UIScrollView.h" />
|
<ClInclude Include="..\UIScrollView.h" />
|
||||||
<ClInclude Include="..\UISlider.h" />
|
<ClInclude Include="..\UISlider.h" />
|
||||||
|
@ -40,18 +37,15 @@
|
||||||
<ClCompile Include="..\UICheckBox.cpp" />
|
<ClCompile Include="..\UICheckBox.cpp" />
|
||||||
<ClCompile Include="..\UIHelper.cpp" />
|
<ClCompile Include="..\UIHelper.cpp" />
|
||||||
<ClCompile Include="..\UIImageView.cpp" />
|
<ClCompile Include="..\UIImageView.cpp" />
|
||||||
<ClCompile Include="..\UIInputManager.cpp" />
|
|
||||||
<ClCompile Include="..\UILabel.cpp" />
|
<ClCompile Include="..\UILabel.cpp" />
|
||||||
<ClCompile Include="..\UILabelAtlas.cpp" />
|
<ClCompile Include="..\UILabelAtlas.cpp" />
|
||||||
<ClCompile Include="..\UILabelBMFont.cpp" />
|
<ClCompile Include="..\UILabelBMFont.cpp" />
|
||||||
<ClCompile Include="..\UILayer.cpp" />
|
|
||||||
<ClCompile Include="..\UILayout.cpp" />
|
<ClCompile Include="..\UILayout.cpp" />
|
||||||
<ClCompile Include="..\UILayoutDefine.cpp" />
|
<ClCompile Include="..\UILayoutDefine.cpp" />
|
||||||
<ClCompile Include="..\UILayoutParameter.cpp" />
|
<ClCompile Include="..\UILayoutParameter.cpp" />
|
||||||
<ClCompile Include="..\UIListView.cpp" />
|
<ClCompile Include="..\UIListView.cpp" />
|
||||||
<ClCompile Include="..\UILoadingBar.cpp" />
|
<ClCompile Include="..\UILoadingBar.cpp" />
|
||||||
<ClCompile Include="..\UIPageView.cpp" />
|
<ClCompile Include="..\UIPageView.cpp" />
|
||||||
<ClCompile Include="..\UIRootWidget.cpp" />
|
|
||||||
<ClCompile Include="..\UIScrollView.cpp" />
|
<ClCompile Include="..\UIScrollView.cpp" />
|
||||||
<ClCompile Include="..\UISlider.cpp" />
|
<ClCompile Include="..\UISlider.cpp" />
|
||||||
<ClCompile Include="..\UITextField.cpp" />
|
<ClCompile Include="..\UITextField.cpp" />
|
||||||
|
|
|
@ -63,18 +63,9 @@
|
||||||
<ClInclude Include="..\CocosGUI.h">
|
<ClInclude Include="..\CocosGUI.h">
|
||||||
<Filter>System</Filter>
|
<Filter>System</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\UIInputManager.h">
|
|
||||||
<Filter>System</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\UILayer.h">
|
|
||||||
<Filter>System</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\UILayoutDefine.h">
|
<ClInclude Include="..\UILayoutDefine.h">
|
||||||
<Filter>Layouts</Filter>
|
<Filter>Layouts</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\UIRootWidget.h">
|
|
||||||
<Filter>BaseClasses</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\UIWidget.h">
|
<ClInclude Include="..\UIWidget.h">
|
||||||
<Filter>BaseClasses</Filter>
|
<Filter>BaseClasses</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
@ -128,18 +119,9 @@
|
||||||
<ClCompile Include="..\CocosGUI.cpp">
|
<ClCompile Include="..\CocosGUI.cpp">
|
||||||
<Filter>System</Filter>
|
<Filter>System</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\UIInputManager.cpp">
|
|
||||||
<Filter>System</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\UILayer.cpp">
|
|
||||||
<Filter>System</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\UILayoutDefine.cpp">
|
<ClCompile Include="..\UILayoutDefine.cpp">
|
||||||
<Filter>Layouts</Filter>
|
<Filter>Layouts</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\UIRootWidget.cpp">
|
|
||||||
<Filter>BaseClasses</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\UIWidget.cpp">
|
<ClCompile Include="..\UIWidget.cpp">
|
||||||
<Filter>BaseClasses</Filter>
|
<Filter>BaseClasses</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include "CCPhysicsBody.h"
|
#include "CCPhysicsBody.h"
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
|
|
||||||
#include <climits>
|
#include <climits>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#define __CCPHYSICS_BODY_H__
|
#define __CCPHYSICS_BODY_H__
|
||||||
|
|
||||||
#include "ccConfig.h"
|
#include "ccConfig.h"
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
|
|
||||||
#include "CCObject.h"
|
#include "CCObject.h"
|
||||||
#include "CCGeometry.h"
|
#include "CCGeometry.h"
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include "CCPhysicsContact.h"
|
#include "CCPhysicsContact.h"
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
#include "chipmunk.h"
|
#include "chipmunk.h"
|
||||||
|
|
||||||
#include "CCPhysicsBody.h"
|
#include "CCPhysicsBody.h"
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#define __CCPHYSICS_CONTACT_H__
|
#define __CCPHYSICS_CONTACT_H__
|
||||||
|
|
||||||
#include "ccConfig.h"
|
#include "ccConfig.h"
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
|
|
||||||
#include "CCObject.h"
|
#include "CCObject.h"
|
||||||
#include "CCGeometry.h"
|
#include "CCGeometry.h"
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "CCPhysicsJoint.h"
|
#include "CCPhysicsJoint.h"
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
#include "chipmunk.h"
|
#include "chipmunk.h"
|
||||||
|
|
||||||
#include "CCPhysicsBody.h"
|
#include "CCPhysicsBody.h"
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#define __CCPHYSICS_JOINT_H__
|
#define __CCPHYSICS_JOINT_H__
|
||||||
|
|
||||||
#include "ccConfig.h"
|
#include "ccConfig.h"
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
|
|
||||||
#include "CCObject.h"
|
#include "CCObject.h"
|
||||||
#include "CCGeometry.h"
|
#include "CCGeometry.h"
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "CCPhysicsShape.h"
|
#include "CCPhysicsShape.h"
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
|
|
||||||
#include <climits>
|
#include <climits>
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#define __CCPHYSICS_SHAPE_H__
|
#define __CCPHYSICS_SHAPE_H__
|
||||||
|
|
||||||
#include "ccConfig.h"
|
#include "ccConfig.h"
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
|
|
||||||
#include "CCObject.h"
|
#include "CCObject.h"
|
||||||
#include "CCGeometry.h"
|
#include "CCGeometry.h"
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "CCPhysicsWorld.h"
|
#include "CCPhysicsWorld.h"
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
|
|
||||||
#include <climits>
|
#include <climits>
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#define __CCPHYSICS_WORLD_H__
|
#define __CCPHYSICS_WORLD_H__
|
||||||
|
|
||||||
#include "ccConfig.h"
|
#include "ccConfig.h"
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
|
|
||||||
#include "CCVector.h"
|
#include "CCVector.h"
|
||||||
#include "CCObject.h"
|
#include "CCObject.h"
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "CCPhysicsBodyInfo_chipmunk.h"
|
#include "CCPhysicsBodyInfo_chipmunk.h"
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
PhysicsBodyInfo::PhysicsBodyInfo()
|
PhysicsBodyInfo::PhysicsBodyInfo()
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#define __CCPHYSICS_BODY_INFO_CHIPMUNK_H__
|
#define __CCPHYSICS_BODY_INFO_CHIPMUNK_H__
|
||||||
|
|
||||||
#include "ccConfig.h"
|
#include "ccConfig.h"
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
|
|
||||||
#include "chipmunk.h"
|
#include "chipmunk.h"
|
||||||
#include "CCPlatformMacros.h"
|
#include "CCPlatformMacros.h"
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "CCPhysicsContactInfo_chipmunk.h"
|
#include "CCPhysicsContactInfo_chipmunk.h"
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
NS_CC_BEGIN
|
NS_CC_BEGIN
|
||||||
|
|
||||||
PhysicsContactInfo::PhysicsContactInfo(PhysicsContact* contact)
|
PhysicsContactInfo::PhysicsContactInfo(PhysicsContact* contact)
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#define __CCPHYSICS_CONTACT_INFO_CHIPMUNK_H__
|
#define __CCPHYSICS_CONTACT_INFO_CHIPMUNK_H__
|
||||||
|
|
||||||
#include "ccConfig.h"
|
#include "ccConfig.h"
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
|
|
||||||
#include "chipmunk.h"
|
#include "chipmunk.h"
|
||||||
#include "CCPlatformMacros.h"
|
#include "CCPlatformMacros.h"
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#define __CCPHYSICS_HELPER_CHIPMUNK_H__
|
#define __CCPHYSICS_HELPER_CHIPMUNK_H__
|
||||||
|
|
||||||
#include "ccConfig.h"
|
#include "ccConfig.h"
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
|
|
||||||
#include "chipmunk.h"
|
#include "chipmunk.h"
|
||||||
#include "CCPlatformMacros.h"
|
#include "CCPlatformMacros.h"
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "CCPhysicsJointInfo_chipmunk.h"
|
#include "CCPhysicsJointInfo_chipmunk.h"
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#define __CCPHYSICS_JOINT_INFO_CHIPMUNK_H__
|
#define __CCPHYSICS_JOINT_INFO_CHIPMUNK_H__
|
||||||
|
|
||||||
#include "ccConfig.h"
|
#include "ccConfig.h"
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
|
|
||||||
#include "chipmunk.h"
|
#include "chipmunk.h"
|
||||||
#include "CCPlatformMacros.h"
|
#include "CCPlatformMacros.h"
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "CCPhysicsShapeInfo_chipmunk.h"
|
#include "CCPhysicsShapeInfo_chipmunk.h"
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#define __CCPHYSICS_SHAPE_INFO_CHIPMUNK_H__
|
#define __CCPHYSICS_SHAPE_INFO_CHIPMUNK_H__
|
||||||
|
|
||||||
#include "ccConfig.h"
|
#include "ccConfig.h"
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "CCPhysicsWorldInfo_chipmunk.h"
|
#include "CCPhysicsWorldInfo_chipmunk.h"
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
#include "CCPhysicsHelper_chipmunk.h"
|
#include "CCPhysicsHelper_chipmunk.h"
|
||||||
#include "CCPhysicsBodyInfo_chipmunk.h"
|
#include "CCPhysicsBodyInfo_chipmunk.h"
|
||||||
#include "CCPhysicsShapeInfo_chipmunk.h"
|
#include "CCPhysicsShapeInfo_chipmunk.h"
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#define __CCPHYSICS_WORLD_INFO_CHIPMUNK_H__
|
#define __CCPHYSICS_WORLD_INFO_CHIPMUNK_H__
|
||||||
|
|
||||||
#include "ccConfig.h"
|
#include "ccConfig.h"
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "chipmunk.h"
|
#include "chipmunk.h"
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 6f6b1240ecac0cbf3e4a2a0bd7356b708c054daf
|
Subproject commit 331edfd4a379ae9ff746d1b4e2b8decbc6ece1a2
|
|
@ -305,7 +305,7 @@ void TestDirectLoading::onEnter()
|
||||||
ArmatureDataManager::getInstance()->addArmatureFileInfo("armature/bear.ExportJson");
|
ArmatureDataManager::getInstance()->addArmatureFileInfo("armature/bear.ExportJson");
|
||||||
|
|
||||||
Armature *armature = Armature::create("bear");
|
Armature *armature = Armature::create("bear");
|
||||||
armature->getAnimation()->playByIndex(0);
|
armature->getAnimation()->playWithIndex(0);
|
||||||
armature->setPosition(Point(VisibleRect::center().x, VisibleRect::center().y));
|
armature->setPosition(Point(VisibleRect::center().x, VisibleRect::center().y));
|
||||||
addChild(armature);
|
addChild(armature);
|
||||||
}
|
}
|
||||||
|
@ -320,7 +320,7 @@ void TestCSWithSkeleton::onEnter()
|
||||||
ArmatureTestLayer::onEnter();
|
ArmatureTestLayer::onEnter();
|
||||||
Armature *armature = nullptr;
|
Armature *armature = nullptr;
|
||||||
armature = Armature::create("Cowboy");
|
armature = Armature::create("Cowboy");
|
||||||
armature->getAnimation()->playByIndex(0);
|
armature->getAnimation()->playWithIndex(0);
|
||||||
armature->setScale(0.2f);
|
armature->setScale(0.2f);
|
||||||
|
|
||||||
armature->setPosition(Point(VisibleRect::center().x, VisibleRect::center().y/*-100*/));
|
armature->setPosition(Point(VisibleRect::center().x, VisibleRect::center().y/*-100*/));
|
||||||
|
@ -341,7 +341,7 @@ void TestDragonBones20::onEnter()
|
||||||
|
|
||||||
Armature *armature = nullptr;
|
Armature *armature = nullptr;
|
||||||
armature = Armature::create("Dragon");
|
armature = Armature::create("Dragon");
|
||||||
armature->getAnimation()->playByIndex(1);
|
armature->getAnimation()->playWithIndex(1);
|
||||||
armature->getAnimation()->setSpeedScale(0.4f);
|
armature->getAnimation()->setSpeedScale(0.4f);
|
||||||
armature->setPosition(VisibleRect::center().x, VisibleRect::center().y * 0.3f);
|
armature->setPosition(VisibleRect::center().x, VisibleRect::center().y * 0.3f);
|
||||||
armature->setScale(0.6f);
|
armature->setScale(0.6f);
|
||||||
|
@ -415,7 +415,7 @@ void TestPerformance::addArmature(int number)
|
||||||
Armature *armature = nullptr;
|
Armature *armature = nullptr;
|
||||||
armature = new Armature();
|
armature = new Armature();
|
||||||
armature->init("Knight_f/Knight");
|
armature->init("Knight_f/Knight");
|
||||||
armature->getAnimation()->playByIndex(0);
|
armature->getAnimation()->playWithIndex(0);
|
||||||
armature->setPosition(50 + armatureCount * 2, 150);
|
armature->setPosition(50 + armatureCount * 2, 150);
|
||||||
armature->setScale(0.6f);
|
armature->setScale(0.6f);
|
||||||
addArmatureToParent(armature);
|
addArmatureToParent(armature);
|
||||||
|
@ -470,21 +470,21 @@ void TestChangeZorder::onEnter()
|
||||||
currentTag = -1;
|
currentTag = -1;
|
||||||
|
|
||||||
armature = Armature::create("Knight_f/Knight");
|
armature = Armature::create("Knight_f/Knight");
|
||||||
armature->getAnimation()->playByIndex(0);
|
armature->getAnimation()->playWithIndex(0);
|
||||||
armature->setPosition(Point(VisibleRect::center().x, VisibleRect::center().y - 100));
|
armature->setPosition(Point(VisibleRect::center().x, VisibleRect::center().y - 100));
|
||||||
++currentTag;
|
++currentTag;
|
||||||
armature->setScale(0.6f);
|
armature->setScale(0.6f);
|
||||||
addChild(armature, currentTag, currentTag);
|
addChild(armature, currentTag, currentTag);
|
||||||
|
|
||||||
armature = Armature::create("Cowboy");
|
armature = Armature::create("Cowboy");
|
||||||
armature->getAnimation()->playByIndex(0);
|
armature->getAnimation()->playWithIndex(0);
|
||||||
armature->setScale(0.24f);
|
armature->setScale(0.24f);
|
||||||
armature->setPosition(Point(VisibleRect::center().x, VisibleRect::center().y - 100));
|
armature->setPosition(Point(VisibleRect::center().x, VisibleRect::center().y - 100));
|
||||||
++currentTag;
|
++currentTag;
|
||||||
addChild(armature, currentTag, currentTag);
|
addChild(armature, currentTag, currentTag);
|
||||||
|
|
||||||
armature = Armature::create("Dragon");
|
armature = Armature::create("Dragon");
|
||||||
armature->getAnimation()->playByIndex(0);
|
armature->getAnimation()->playWithIndex(0);
|
||||||
armature->setPosition(Point(VisibleRect::center().x , VisibleRect::center().y - 100));
|
armature->setPosition(Point(VisibleRect::center().x , VisibleRect::center().y - 100));
|
||||||
++currentTag;
|
++currentTag;
|
||||||
armature->setScale(0.6f);
|
armature->setScale(0.6f);
|
||||||
|
@ -623,7 +623,7 @@ void TestParticleDisplay::onEnter()
|
||||||
animationID = 0;
|
animationID = 0;
|
||||||
|
|
||||||
armature = Armature::create("robot");
|
armature = Armature::create("robot");
|
||||||
armature->getAnimation()->playByIndex(0);
|
armature->getAnimation()->playWithIndex(0);
|
||||||
armature->setPosition(VisibleRect::center());
|
armature->setPosition(VisibleRect::center());
|
||||||
armature->setScale(0.48f);
|
armature->setScale(0.48f);
|
||||||
armature->getAnimation()->setSpeedScale(0.5f);
|
armature->getAnimation()->setSpeedScale(0.5f);
|
||||||
|
@ -669,7 +669,7 @@ void TestParticleDisplay::onTouchesEnded(const std::vector<Touch*>& touches, Eve
|
||||||
{
|
{
|
||||||
++animationID;
|
++animationID;
|
||||||
animationID = animationID % armature->getAnimation()->getMovementCount();
|
animationID = animationID % armature->getAnimation()->getMovementCount();
|
||||||
armature->getAnimation()->playByIndex(animationID);
|
armature->getAnimation()->playWithIndex(animationID);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestUseMutiplePicture::onEnter()
|
void TestUseMutiplePicture::onEnter()
|
||||||
|
@ -683,7 +683,7 @@ void TestUseMutiplePicture::onEnter()
|
||||||
displayIndex = 0;
|
displayIndex = 0;
|
||||||
|
|
||||||
armature = Armature::create("Knight_f/Knight");
|
armature = Armature::create("Knight_f/Knight");
|
||||||
armature->getAnimation()->playByIndex(0);
|
armature->getAnimation()->playWithIndex(0);
|
||||||
armature->setPosition(Point(VisibleRect::center().x, VisibleRect::left().y));
|
armature->setPosition(Point(VisibleRect::center().x, VisibleRect::left().y));
|
||||||
armature->setScale(1.2f);
|
armature->setScale(1.2f);
|
||||||
addChild(armature);
|
addChild(armature);
|
||||||
|
@ -1080,7 +1080,7 @@ void TestBoundingBox::onEnter()
|
||||||
ArmatureTestLayer::onEnter();
|
ArmatureTestLayer::onEnter();
|
||||||
|
|
||||||
armature = Armature::create("Cowboy");
|
armature = Armature::create("Cowboy");
|
||||||
armature->getAnimation()->playByIndex(0);
|
armature->getAnimation()->playWithIndex(0);
|
||||||
armature->setPosition(VisibleRect::center());
|
armature->setPosition(VisibleRect::center());
|
||||||
armature->setScale(0.2f);
|
armature->setScale(0.2f);
|
||||||
addChild(armature);
|
addChild(armature);
|
||||||
|
@ -1119,7 +1119,7 @@ void TestAnchorPoint::onEnter()
|
||||||
for (int i = 0; i < 5; i++)
|
for (int i = 0; i < 5; i++)
|
||||||
{
|
{
|
||||||
Armature *armature = Armature::create("Cowboy");
|
Armature *armature = Armature::create("Cowboy");
|
||||||
armature->getAnimation()->playByIndex(0);
|
armature->getAnimation()->playWithIndex(0);
|
||||||
armature->setPosition(VisibleRect::center());
|
armature->setPosition(VisibleRect::center());
|
||||||
armature->setScale(0.2f);
|
armature->setScale(0.2f);
|
||||||
addChild(armature, 0, i);
|
addChild(armature, 0, i);
|
||||||
|
@ -1146,7 +1146,7 @@ void TestArmatureNesting::onEnter()
|
||||||
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
|
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
|
||||||
|
|
||||||
armature = Armature::create("cyborg");
|
armature = Armature::create("cyborg");
|
||||||
armature->getAnimation()->playByIndex(1);
|
armature->getAnimation()->playWithIndex(1);
|
||||||
armature->setPosition(VisibleRect::center());
|
armature->setPosition(VisibleRect::center());
|
||||||
armature->setScale(1.2f);
|
armature->setScale(1.2f);
|
||||||
armature->getAnimation()->setSpeedScale(0.4f);
|
armature->getAnimation()->setSpeedScale(0.4f);
|
||||||
|
@ -1172,8 +1172,8 @@ void TestArmatureNesting::onTouchesEnded(const std::vector<Touch*>& touches, Eve
|
||||||
|
|
||||||
if(armature != nullptr)
|
if(armature != nullptr)
|
||||||
{
|
{
|
||||||
armature->getBone("armInside")->getChildArmature()->getAnimation()->playByIndex(weaponIndex);
|
armature->getBone("armInside")->getChildArmature()->getAnimation()->playWithIndex(weaponIndex);
|
||||||
armature->getBone("armOutside")->getChildArmature()->getAnimation()->playByIndex(weaponIndex);
|
armature->getBone("armOutside")->getChildArmature()->getAnimation()->playWithIndex(weaponIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1204,7 +1204,7 @@ void Hero::changeMount(Armature *armature)
|
||||||
{
|
{
|
||||||
retain();
|
retain();
|
||||||
|
|
||||||
playByIndex(0);
|
playWithIndex(0);
|
||||||
//Remove hero from display list
|
//Remove hero from display list
|
||||||
m_pMount->getBone("hero")->removeDisplay(0);
|
m_pMount->getBone("hero")->removeDisplay(0);
|
||||||
m_pMount->stopAllActions();
|
m_pMount->stopAllActions();
|
||||||
|
@ -1236,7 +1236,7 @@ void Hero::changeMount(Armature *armature)
|
||||||
|
|
||||||
setPosition(Point(0,0));
|
setPosition(Point(0,0));
|
||||||
//Change animation
|
//Change animation
|
||||||
playByIndex(1);
|
playWithIndex(1);
|
||||||
|
|
||||||
setScale(1);
|
setScale(1);
|
||||||
|
|
||||||
|
@ -1245,12 +1245,12 @@ void Hero::changeMount(Armature *armature)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Hero::playByIndex(int index)
|
void Hero::playWithIndex(int index)
|
||||||
{
|
{
|
||||||
_animation->playByIndex(index);
|
_animation->playWithIndex(index);
|
||||||
if (m_pMount)
|
if (m_pMount)
|
||||||
{
|
{
|
||||||
m_pMount->getAnimation()->playByIndex(index);
|
m_pMount->getAnimation()->playWithIndex(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1277,7 +1277,7 @@ void TestArmatureNesting2::onEnter()
|
||||||
//Create a hero
|
//Create a hero
|
||||||
hero = Hero::create("hero");
|
hero = Hero::create("hero");
|
||||||
hero->setLayer(this);
|
hero->setLayer(this);
|
||||||
hero->playByIndex(0);
|
hero->playWithIndex(0);
|
||||||
hero->setPosition(Point(VisibleRect::left().x + 20, VisibleRect::left().y));
|
hero->setPosition(Point(VisibleRect::left().x + 20, VisibleRect::left().y));
|
||||||
addChild(hero);
|
addChild(hero);
|
||||||
|
|
||||||
|
@ -1350,7 +1350,7 @@ void TestArmatureNesting2::ChangeMountCallback(Object* pSender)
|
||||||
Armature * TestArmatureNesting2::createMount(const char *name, Point position)
|
Armature * TestArmatureNesting2::createMount(const char *name, Point position)
|
||||||
{
|
{
|
||||||
Armature *armature = Armature::create(name);
|
Armature *armature = Armature::create(name);
|
||||||
armature->getAnimation()->playByIndex(0);
|
armature->getAnimation()->playWithIndex(0);
|
||||||
armature->setPosition(position);
|
armature->setPosition(position);
|
||||||
addChild(armature);
|
addChild(armature);
|
||||||
|
|
||||||
|
@ -1373,8 +1373,8 @@ void TestPlaySeveralMovement::onEnter()
|
||||||
|
|
||||||
Armature *armature = NULL;
|
Armature *armature = NULL;
|
||||||
armature = Armature::create("Cowboy");
|
armature = Armature::create("Cowboy");
|
||||||
armature->getAnimation()->play(names);
|
armature->getAnimation()->playWithNames(names);
|
||||||
// armature->getAnimation()->playByIndex(indexes);
|
// armature->getAnimation()->playWithIndexes(indexes);
|
||||||
armature->setScale(0.2f);
|
armature->setScale(0.2f);
|
||||||
|
|
||||||
armature->setPosition(Point(VisibleRect::center().x, VisibleRect::center().y/*-100*/));
|
armature->setPosition(Point(VisibleRect::center().x, VisibleRect::center().y/*-100*/));
|
||||||
|
@ -1402,7 +1402,7 @@ void TestEasing::onEnter()
|
||||||
animationID = 0;
|
animationID = 0;
|
||||||
|
|
||||||
armature = Armature::create("testEasing");
|
armature = Armature::create("testEasing");
|
||||||
armature->getAnimation()->playByIndex(0);
|
armature->getAnimation()->playWithIndex(0);
|
||||||
armature->setScale(0.8f);
|
armature->setScale(0.8f);
|
||||||
|
|
||||||
armature->setPosition(Point(VisibleRect::center().x, VisibleRect::center().y));
|
armature->setPosition(Point(VisibleRect::center().x, VisibleRect::center().y));
|
||||||
|
@ -1423,7 +1423,7 @@ void TestEasing::onTouchesEnded(const std::vector<Touch*>& touches, Event* event
|
||||||
{
|
{
|
||||||
animationID++;
|
animationID++;
|
||||||
animationID = animationID % armature->getAnimation()->getMovementCount();
|
animationID = animationID % armature->getAnimation()->getMovementCount();
|
||||||
armature->getAnimation()->playByIndex(animationID);
|
armature->getAnimation()->playWithIndex(animationID);
|
||||||
|
|
||||||
updateSubTitle();
|
updateSubTitle();
|
||||||
}
|
}
|
||||||
|
@ -1444,7 +1444,7 @@ void TestChangeAnimationInternal::onEnter()
|
||||||
|
|
||||||
Armature *armature = NULL;
|
Armature *armature = NULL;
|
||||||
armature = Armature::create("Cowboy");
|
armature = Armature::create("Cowboy");
|
||||||
armature->getAnimation()->playByIndex(0);
|
armature->getAnimation()->playWithIndex(0);
|
||||||
armature->setScale(0.2f);
|
armature->setScale(0.2f);
|
||||||
|
|
||||||
armature->setPosition(Point(VisibleRect::center().x, VisibleRect::center().y));
|
armature->setPosition(Point(VisibleRect::center().x, VisibleRect::center().y));
|
||||||
|
|
|
@ -325,7 +325,7 @@ public:
|
||||||
Hero();
|
Hero();
|
||||||
|
|
||||||
virtual void changeMount(cocostudio::Armature *armature);
|
virtual void changeMount(cocostudio::Armature *armature);
|
||||||
virtual void playByIndex(int index);
|
virtual void playWithIndex(int index);
|
||||||
|
|
||||||
CC_SYNTHESIZE(cocostudio::Armature*, m_pMount, Mount);
|
CC_SYNTHESIZE(cocostudio::Armature*, m_pMount, Mount);
|
||||||
CC_SYNTHESIZE(cocos2d::Layer*, m_pLayer, Layer);
|
CC_SYNTHESIZE(cocos2d::Layer*, m_pLayer, Layer);
|
||||||
|
|
|
@ -6,7 +6,7 @@ USING_NS_CC;
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
static std::function<Layer*()> createFunctions[] = {
|
static std::function<Layer*()> createFunctions[] = {
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
CL(PhysicsDemoLogoSmash),
|
CL(PhysicsDemoLogoSmash),
|
||||||
CL(PhysicsDemoPyramidStack),
|
CL(PhysicsDemoPyramidStack),
|
||||||
CL(PhysicsDemoClickAdd),
|
CL(PhysicsDemoClickAdd),
|
||||||
|
@ -55,7 +55,7 @@ namespace
|
||||||
}
|
}
|
||||||
|
|
||||||
PhysicsTestScene::PhysicsTestScene()
|
PhysicsTestScene::PhysicsTestScene()
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
: TestScene(false, true)
|
: TestScene(false, true)
|
||||||
#else
|
#else
|
||||||
: TestScene()
|
: TestScene()
|
||||||
|
@ -73,13 +73,13 @@ void PhysicsTestScene::runThisTest()
|
||||||
|
|
||||||
void PhysicsTestScene::toggleDebug()
|
void PhysicsTestScene::toggleDebug()
|
||||||
{
|
{
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
_debugDraw = !_debugDraw;
|
_debugDraw = !_debugDraw;
|
||||||
getPhysicsWorld()->setDebugDrawMask(_debugDraw ? PhysicsWorld::DEBUGDRAW_ALL : PhysicsWorld::DEBUGDRAW_NONE);
|
getPhysicsWorld()->setDebugDrawMask(_debugDraw ? PhysicsWorld::DEBUGDRAW_ALL : PhysicsWorld::DEBUGDRAW_NONE);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS == 0
|
||||||
void PhysicsDemoDisabled::onEnter()
|
void PhysicsDemoDisabled::onEnter()
|
||||||
{
|
{
|
||||||
auto label = LabelTTF::create("Should define CC_USE_PHYSICS\n to run this test case",
|
auto label = LabelTTF::create("Should define CC_USE_PHYSICS\n to run this test case",
|
||||||
|
|
|
@ -22,7 +22,7 @@ private:
|
||||||
bool _debugDraw;
|
bool _debugDraw;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS == 0
|
||||||
class PhysicsDemoDisabled : public BaseTest
|
class PhysicsDemoDisabled : public BaseTest
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -7,7 +7,7 @@ TestScene::TestScene(bool bPortrait, bool physics/* = false*/)
|
||||||
{
|
{
|
||||||
if (physics)
|
if (physics)
|
||||||
{
|
{
|
||||||
#ifdef CC_USE_PHYSICS
|
#if CC_USE_PHYSICS
|
||||||
TestScene::initWithPhysics();
|
TestScene::initWithPhysics();
|
||||||
#else
|
#else
|
||||||
Scene::init();
|
Scene::init();
|
||||||
|
|
|
@ -153,23 +153,20 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\websockets\prebuilt\win32\*.*" "$
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\CocosGUIScene.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\CocosGUIScene.cpp" />
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIButtonTest\UIButtonTest.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIButtonTest\UIButtonTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest\UICheckBoxTest.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest\UICheckBoxTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIDragPanelTest\UIDragPanelTest.cpp" />
|
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest\UIImageViewTest.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest\UIImageViewTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UILabelAtlasTest\UILabelAtlasTest.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UILabelAtlasTest\UILabelAtlasTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UILabelBMFontTest\UILabelBMFontTest.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UILabelBMFontTest\UILabelBMFontTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UILabelTest\UILabelTest.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UILabelTest\UILabelTest.cpp" />
|
||||||
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UILayoutTest\UILayoutTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIListViewTest\UIListViewTest.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIListViewTest\UIListViewTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest\UILoadingBarTest.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest\UILoadingBarTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UINodeContainerTest\UINodeContainerTest.cpp" />
|
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest\UIPageViewTest.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest\UIPageViewTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIPanelTest\UIPanelTest.cpp" />
|
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIScene.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIScene.cpp" />
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UISceneManager.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UISceneManager.cpp" />
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest\UIScrollViewTest.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest\UIScrollViewTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest\UISliderTest.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest\UISliderTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UITextAreaTest\UITextAreaTest.cpp" />
|
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UITextButtonTest\UITextButtonTest.cpp" />
|
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest\UITextFieldTest.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest\UITextFieldTest.cpp" />
|
||||||
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIWidgetAddNodeTest\UIWidgetAddNodeTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioSceneTest\SceneEditorTest.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioSceneTest\SceneEditorTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\ControlExtensionTest\CCControlPotentiometerTest\CCControlPotentiometerTest.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\ControlExtensionTest\CCControlPotentiometerTest\CCControlPotentiometerTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\ControlExtensionTest\CCControlStepperTest\CCControlStepperTest.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\ControlExtensionTest\CCControlStepperTest\CCControlStepperTest.cpp" />
|
||||||
|
@ -298,23 +295,20 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\websockets\prebuilt\win32\*.*" "$
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\CocosGUIScene.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\CocosGUIScene.h" />
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIButtonTest\UIButtonTest.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIButtonTest\UIButtonTest.h" />
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest\UICheckBoxTest.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest\UICheckBoxTest.h" />
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIDragPanelTest\UIDragPanelTest.h" />
|
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest\UIImageViewTest.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest\UIImageViewTest.h" />
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UILabelAtlasTest\UILabelAtlasTest.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UILabelAtlasTest\UILabelAtlasTest.h" />
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UILabelBMFontTest\UILabelBMFontTest.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UILabelBMFontTest\UILabelBMFontTest.h" />
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UILabelTest\UILabelTest.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UILabelTest\UILabelTest.h" />
|
||||||
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UILayoutTest\UILayoutTest.h" />
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIListViewTest\UIListViewTest.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIListViewTest\UIListViewTest.h" />
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest\UILoadingBarTest.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest\UILoadingBarTest.h" />
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UINodeContainerTest\UINodeContainerTest.h" />
|
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest\UIPageViewTest.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest\UIPageViewTest.h" />
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIPanelTest\UIPanelTest.h" />
|
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIScene.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIScene.h" />
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UISceneManager.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UISceneManager.h" />
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest\UIScrollViewTest.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest\UIScrollViewTest.h" />
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest\UISliderTest.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest\UISliderTest.h" />
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UITextAreaTest\UITextAreaTest.h" />
|
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UITextButtonTest\UITextButtonTest.h" />
|
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest\UITextFieldTest.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest\UITextFieldTest.h" />
|
||||||
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIWidgetAddNodeTest\UIWidgetAddNodeTest.h" />
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioSceneTest\SceneEditorTest.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioSceneTest\SceneEditorTest.h" />
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\ControlExtensionTest\CCControlPotentiometerTest\CCControlPotentiometerTest.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\ControlExtensionTest\CCControlPotentiometerTest\CCControlPotentiometerTest.h" />
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\ControlExtensionTest\CCControlStepperTest\CCControlStepperTest.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\ControlExtensionTest\CCControlStepperTest\CCControlStepperTest.h" />
|
||||||
|
|
|
@ -250,27 +250,15 @@
|
||||||
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest">
|
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest">
|
||||||
<UniqueIdentifier>{493fcd85-c749-482d-9404-905e99aa0103}</UniqueIdentifier>
|
<UniqueIdentifier>{493fcd85-c749-482d-9404-905e99aa0103}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UITextButtonTest">
|
|
||||||
<UniqueIdentifier>{5c1960de-24ba-4b72-be18-cc160dd2a50d}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UITextAreaTest">
|
|
||||||
<UniqueIdentifier>{175b363b-a41a-4b1d-bde1-970e77e64cff}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest">
|
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest">
|
||||||
<UniqueIdentifier>{2e08949f-bf73-4fdc-85e8-34b8c69aa978}</UniqueIdentifier>
|
<UniqueIdentifier>{2e08949f-bf73-4fdc-85e8-34b8c69aa978}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest">
|
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest">
|
||||||
<UniqueIdentifier>{c57c0453-a096-44d7-830b-1cf24c712cfd}</UniqueIdentifier>
|
<UniqueIdentifier>{c57c0453-a096-44d7-830b-1cf24c712cfd}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UIPanelTest">
|
|
||||||
<UniqueIdentifier>{c4dbbfb3-0e91-492f-bbbf-f03fb26f3f54}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest">
|
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest">
|
||||||
<UniqueIdentifier>{01097388-e538-4081-8e16-d1ff3a86292a}</UniqueIdentifier>
|
<UniqueIdentifier>{01097388-e538-4081-8e16-d1ff3a86292a}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UINodeContainerTest">
|
|
||||||
<UniqueIdentifier>{160da6f0-a0f1-4a53-8e5e-cf0a63ee82a3}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest">
|
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest">
|
||||||
<UniqueIdentifier>{fadff96e-c19a-41f5-a755-547cf1f8a5fb}</UniqueIdentifier>
|
<UniqueIdentifier>{fadff96e-c19a-41f5-a755-547cf1f8a5fb}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
@ -289,9 +277,6 @@
|
||||||
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest">
|
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest">
|
||||||
<UniqueIdentifier>{dedcabba-959c-40e3-9959-7ccf4e31c792}</UniqueIdentifier>
|
<UniqueIdentifier>{dedcabba-959c-40e3-9959-7ccf4e31c792}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UIDragPanelTest">
|
|
||||||
<UniqueIdentifier>{cfc87c30-a7b4-4b6f-bc5d-da45360466b6}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest">
|
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest">
|
||||||
<UniqueIdentifier>{5caf2179-ae22-4040-8bac-17e9f22efbf7}</UniqueIdentifier>
|
<UniqueIdentifier>{5caf2179-ae22-4040-8bac-17e9f22efbf7}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
@ -310,6 +295,12 @@
|
||||||
<Filter Include="Classes\NewRendererTest">
|
<Filter Include="Classes\NewRendererTest">
|
||||||
<UniqueIdentifier>{688e201c-77fe-4665-931e-e508a58141f5}</UniqueIdentifier>
|
<UniqueIdentifier>{688e201c-77fe-4665-931e-e508a58141f5}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UIWidgetAddNodeTest">
|
||||||
|
<UniqueIdentifier>{160da6f0-a0f1-4a53-8e5e-cf0a63ee82a3}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Classes\ExtensionsTest\CocoStudioGUITest\UILayoutTest">
|
||||||
|
<UniqueIdentifier>{c4dbbfb3-0e91-492f-bbbf-f03fb26f3f54}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="main.cpp">
|
<ClCompile Include="main.cpp">
|
||||||
|
@ -649,9 +640,6 @@
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest\UICheckBoxTest.cpp">
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest\UICheckBoxTest.cpp">
|
||||||
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest</Filter>
|
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIDragPanelTest\UIDragPanelTest.cpp">
|
|
||||||
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIDragPanelTest</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest\UIImageViewTest.cpp">
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest\UIImageViewTest.cpp">
|
||||||
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest</Filter>
|
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -670,27 +658,15 @@
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest\UILoadingBarTest.cpp">
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest\UILoadingBarTest.cpp">
|
||||||
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest</Filter>
|
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UINodeContainerTest\UINodeContainerTest.cpp">
|
|
||||||
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UINodeContainerTest</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest\UIPageViewTest.cpp">
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest\UIPageViewTest.cpp">
|
||||||
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest</Filter>
|
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIPanelTest\UIPanelTest.cpp">
|
|
||||||
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIPanelTest</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest\UIScrollViewTest.cpp">
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest\UIScrollViewTest.cpp">
|
||||||
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest</Filter>
|
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest\UISliderTest.cpp">
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest\UISliderTest.cpp">
|
||||||
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest</Filter>
|
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UITextAreaTest\UITextAreaTest.cpp">
|
|
||||||
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UITextAreaTest</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UITextButtonTest\UITextButtonTest.cpp">
|
|
||||||
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UITextButtonTest</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest\UITextFieldTest.cpp">
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest\UITextFieldTest.cpp">
|
||||||
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest</Filter>
|
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -718,6 +694,12 @@
|
||||||
<ClCompile Include="..\Classes\NewRendererTest\NewRendererTest.cpp">
|
<ClCompile Include="..\Classes\NewRendererTest\NewRendererTest.cpp">
|
||||||
<Filter>Classes\NewRendererTest</Filter>
|
<Filter>Classes\NewRendererTest</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIWidgetAddNodeTest\UIWidgetAddNodeTest.cpp">
|
||||||
|
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIWidgetAddNodeTest</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UILayoutTest\UILayoutTest.cpp">
|
||||||
|
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UILayoutTest</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="main.h">
|
<ClInclude Include="main.h">
|
||||||
|
@ -1234,9 +1216,6 @@
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest\UICheckBoxTest.h">
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest\UICheckBoxTest.h">
|
||||||
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest</Filter>
|
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UICheckBoxTest</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIDragPanelTest\UIDragPanelTest.h">
|
|
||||||
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIDragPanelTest</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest\UIImageViewTest.h">
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest\UIImageViewTest.h">
|
||||||
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest</Filter>
|
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIImageViewTest</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
@ -1255,27 +1234,15 @@
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest\UILoadingBarTest.h">
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest\UILoadingBarTest.h">
|
||||||
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest</Filter>
|
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UILoadingBarTest</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UINodeContainerTest\UINodeContainerTest.h">
|
|
||||||
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UINodeContainerTest</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest\UIPageViewTest.h">
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest\UIPageViewTest.h">
|
||||||
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest</Filter>
|
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIPageViewTest</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIPanelTest\UIPanelTest.h">
|
|
||||||
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIPanelTest</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest\UIScrollViewTest.h">
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest\UIScrollViewTest.h">
|
||||||
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest</Filter>
|
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIScrollViewTest</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest\UISliderTest.h">
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest\UISliderTest.h">
|
||||||
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest</Filter>
|
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UISliderTest</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UITextAreaTest\UITextAreaTest.h">
|
|
||||||
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UITextAreaTest</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UITextButtonTest\UITextButtonTest.h">
|
|
||||||
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UITextButtonTest</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest\UITextFieldTest.h">
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest\UITextFieldTest.h">
|
||||||
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest</Filter>
|
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UITextFieldTest</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
@ -1318,5 +1285,11 @@
|
||||||
<ClInclude Include="..\Classes\NewRendererTest\NewRendererTest.h">
|
<ClInclude Include="..\Classes\NewRendererTest\NewRendererTest.h">
|
||||||
<Filter>Classes\NewRendererTest</Filter>
|
<Filter>Classes\NewRendererTest</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UIWidgetAddNodeTest\UIWidgetAddNodeTest.h">
|
||||||
|
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UIWidgetAddNodeTest</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\Classes\ExtensionsTest\CocoStudioGUITest\UILayoutTest\UILayoutTest.h">
|
||||||
|
<Filter>Classes\ExtensionsTest\CocoStudioGUITest\UILayoutTest</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
Loading…
Reference in New Issue