mirror of https://github.com/axmolengine/axmol.git
fix warnings caused by deprecating some functions of Array
This commit is contained in:
parent
3476a843e2
commit
2de8963a0a
|
@ -622,7 +622,7 @@ void Director::popScene(void)
|
|||
else
|
||||
{
|
||||
_sendCleanupToScene = true;
|
||||
_nextScene = (Scene*)_scenesStack->objectAtIndex(c - 1);
|
||||
_nextScene = (Scene*)_scenesStack->getObjectAtIndex(c - 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -650,7 +650,7 @@ void Director::popToSceneStackLevel(int level)
|
|||
// pop stack until reaching desired level
|
||||
while (c > level)
|
||||
{
|
||||
Scene *current = (Scene*)_scenesStack->lastObject();
|
||||
Scene *current = (Scene*)_scenesStack->getLastObject();
|
||||
|
||||
if (current->isRunning())
|
||||
{
|
||||
|
@ -663,7 +663,7 @@ void Director::popToSceneStackLevel(int level)
|
|||
--c;
|
||||
}
|
||||
|
||||
_nextScene = (Scene*)_scenesStack->lastObject();
|
||||
_nextScene = (Scene*)_scenesStack->getLastObject();
|
||||
_sendCleanupToScene = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -687,7 +687,7 @@ void Scheduler::unscheduleScriptEntry(unsigned int uScheduleScriptEntryID)
|
|||
{
|
||||
for (int i = _scriptHandlerEntries->count() - 1; i >= 0; i--)
|
||||
{
|
||||
SchedulerScriptHandlerEntry* pEntry = static_cast<SchedulerScriptHandlerEntry*>(_scriptHandlerEntries->objectAtIndex(i));
|
||||
SchedulerScriptHandlerEntry* pEntry = static_cast<SchedulerScriptHandlerEntry*>(_scriptHandlerEntries->getObjectAtIndex(i));
|
||||
if (pEntry->getEntryId() == (int)uScheduleScriptEntryID)
|
||||
{
|
||||
pEntry->markedForDeletion();
|
||||
|
@ -909,7 +909,7 @@ void Scheduler::update(float dt)
|
|||
{
|
||||
for (int i = _scriptHandlerEntries->count() - 1; i >= 0; i--)
|
||||
{
|
||||
SchedulerScriptHandlerEntry* pEntry = static_cast<SchedulerScriptHandlerEntry*>(_scriptHandlerEntries->objectAtIndex(i));
|
||||
SchedulerScriptHandlerEntry* pEntry = static_cast<SchedulerScriptHandlerEntry*>(_scriptHandlerEntries->getObjectAtIndex(i));
|
||||
if (pEntry->isMarkedForDeletion())
|
||||
{
|
||||
_scriptHandlerEntries->removeObjectAtIndex(i);
|
||||
|
|
|
@ -206,13 +206,13 @@ Sequence* Sequence::create(Array* arrayOfActions)
|
|||
unsigned int count = arrayOfActions->count();
|
||||
CC_BREAK_IF(count == 0);
|
||||
|
||||
FiniteTimeAction* prev = static_cast<FiniteTimeAction*>( arrayOfActions->objectAtIndex(0) );
|
||||
FiniteTimeAction* prev = static_cast<FiniteTimeAction*>(arrayOfActions->getObjectAtIndex(0));
|
||||
|
||||
if (count > 1)
|
||||
{
|
||||
for (unsigned int i = 1; i < count; ++i)
|
||||
{
|
||||
prev = createWithTwoActions(prev, static_cast<FiniteTimeAction*>( arrayOfActions->objectAtIndex(i)) );
|
||||
prev = createWithTwoActions(prev, static_cast<FiniteTimeAction*>(arrayOfActions->getObjectAtIndex(i)));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -578,12 +578,12 @@ Spawn* Spawn::create(Array *arrayOfActions)
|
|||
{
|
||||
unsigned int count = arrayOfActions->count();
|
||||
CC_BREAK_IF(count == 0);
|
||||
FiniteTimeAction* prev = static_cast<FiniteTimeAction*>( arrayOfActions->objectAtIndex(0) );
|
||||
FiniteTimeAction* prev = static_cast<FiniteTimeAction*>(arrayOfActions->getObjectAtIndex(0));
|
||||
if (count > 1)
|
||||
{
|
||||
for (unsigned int i = 1; i < arrayOfActions->count(); ++i)
|
||||
{
|
||||
prev = createWithTwoActions(prev, static_cast<FiniteTimeAction*>( arrayOfActions->objectAtIndex(i)) );
|
||||
prev = createWithTwoActions(prev, static_cast<FiniteTimeAction*>(arrayOfActions->getObjectAtIndex(i)));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -2107,7 +2107,7 @@ void Animate::update(float t)
|
|||
float splitTime = _splitTimes->at(i);
|
||||
|
||||
if( splitTime <= t ) {
|
||||
AnimationFrame* frame = static_cast<AnimationFrame*>(frames->objectAtIndex(i));
|
||||
AnimationFrame* frame = static_cast<AnimationFrame*>(frames->getObjectAtIndex(i));
|
||||
frameToDisplay = frame->getSpriteFrame();
|
||||
static_cast<Sprite*>(_target)->setDisplayFrame(frameToDisplay);
|
||||
|
||||
|
|
|
@ -129,12 +129,12 @@ Array* Array::createWithCapacity(unsigned int capacity)
|
|||
|
||||
Array* Array::createWithContentsOfFile(const char* fileName)
|
||||
{
|
||||
Array* pRet = Array::createWithContentsOfFileThreadSafe(fileName);
|
||||
if (pRet != NULL)
|
||||
Array* ret = Array::createWithContentsOfFileThreadSafe(fileName);
|
||||
if (ret != nullptr)
|
||||
{
|
||||
pRet->autorelease();
|
||||
}
|
||||
return pRet;
|
||||
return ret;
|
||||
}
|
||||
|
||||
Array* Array::createWithContentsOfFileThreadSafe(const char* fileName)
|
||||
|
@ -163,7 +163,7 @@ bool Array::initWithObjects(Object* object, ...)
|
|||
bool ret = false;
|
||||
do
|
||||
{
|
||||
CC_BREAK_IF(object == NULL);
|
||||
CC_BREAK_IF(object == nullptr);
|
||||
|
||||
va_list args;
|
||||
va_start(args, object);
|
||||
|
@ -200,10 +200,6 @@ bool Array::initWithArray(Array* otherArray)
|
|||
|
||||
int Array::getIndexOfObject(Object* object) const
|
||||
{
|
||||
// auto it = std::find(data.begin(), data.end(), object );
|
||||
// if( it == data.end() )
|
||||
// return -1;
|
||||
// return it - std::begin(data);
|
||||
auto it = data.begin();
|
||||
|
||||
for (int i = 0; it != data.end(); ++it, ++i)
|
||||
|
@ -282,14 +278,6 @@ void Array::removeLastObject(bool releaseObj)
|
|||
|
||||
void Array::removeObject(Object* object, bool releaseObj /* ignored */)
|
||||
{
|
||||
// auto begin = data.begin();
|
||||
// auto end = data.end();
|
||||
//
|
||||
// auto it = std::find( begin, end, object);
|
||||
// if( it != end ) {
|
||||
// data.erase(it);
|
||||
// }
|
||||
|
||||
auto it = data.begin();
|
||||
for (; it != data.end(); ++it)
|
||||
{
|
||||
|
@ -344,7 +332,6 @@ void Array::exchangeObjectAtIndex(unsigned int index1, unsigned int index2)
|
|||
|
||||
void Array::replaceObjectAtIndex(unsigned int index, Object* object, bool releaseObject /* ignored */)
|
||||
{
|
||||
// auto obj = data[index];
|
||||
data[index] = object;
|
||||
}
|
||||
|
||||
|
@ -368,9 +355,9 @@ Array* Array::clone() const
|
|||
ret->autorelease();
|
||||
ret->initWithCapacity(this->data.size() > 0 ? this->data.size() : 1);
|
||||
|
||||
Object* obj = NULL;
|
||||
Object* tmpObj = NULL;
|
||||
Clonable* clonable = NULL;
|
||||
Object* obj = nullptr;
|
||||
Object* tmpObj = nullptr;
|
||||
Clonable* clonable = nullptr;
|
||||
CCARRAY_FOREACH(this, obj)
|
||||
{
|
||||
clonable = dynamic_cast<Clonable*>(obj);
|
||||
|
@ -402,13 +389,13 @@ void Array::acceptVisitor(DataVisitor &visitor)
|
|||
#else
|
||||
|
||||
Array::Array()
|
||||
: data(NULL)
|
||||
: data(nullptr)
|
||||
{
|
||||
// init();
|
||||
}
|
||||
|
||||
Array::Array(unsigned int capacity)
|
||||
: data(NULL)
|
||||
: data(nullptr)
|
||||
{
|
||||
initWithCapacity(capacity);
|
||||
}
|
||||
|
@ -494,12 +481,12 @@ Array* Array::createWithCapacity(unsigned int capacity)
|
|||
|
||||
Array* Array::createWithContentsOfFile(const char* fileName)
|
||||
{
|
||||
Array* pRet = Array::createWithContentsOfFileThreadSafe(fileName);
|
||||
if (pRet != NULL)
|
||||
Array* ret = Array::createWithContentsOfFileThreadSafe(fileName);
|
||||
if (ret != nullptr)
|
||||
{
|
||||
pRet->autorelease();
|
||||
ret->autorelease();
|
||||
}
|
||||
return pRet;
|
||||
return ret;
|
||||
}
|
||||
|
||||
Array* Array::createWithContentsOfFileThreadSafe(const char* fileName)
|
||||
|
@ -534,7 +521,7 @@ bool Array::initWithObjects(Object* object, ...)
|
|||
bool ret = false;
|
||||
do
|
||||
{
|
||||
CC_BREAK_IF(object == NULL);
|
||||
CC_BREAK_IF(object == nullptr);
|
||||
|
||||
va_list args;
|
||||
va_start(args, object);
|
||||
|
@ -590,7 +577,7 @@ Object* Array::getRandomObject()
|
|||
{
|
||||
if (data->num == 0)
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
float r = CCRANDOM_0_1();
|
||||
|
@ -639,7 +626,8 @@ void Array::setObject(Object* object, int index)
|
|||
{
|
||||
CCASSERT(index>=0 && index < count(), "Invalid index");
|
||||
|
||||
if( object != data->arr[index] ) {
|
||||
if (object != data->arr[index])
|
||||
{
|
||||
data->arr[index]->release();
|
||||
data->arr[index] = object;
|
||||
object->retain();
|
||||
|
@ -721,7 +709,7 @@ void Array::reverseObjects()
|
|||
for (int i = 0; i < count ; i++)
|
||||
{
|
||||
ccArraySwapObjectsAtIndexes(data, i, maxIndex);
|
||||
maxIndex--;
|
||||
--maxIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -742,9 +730,9 @@ Array* Array::clone() const
|
|||
ret->autorelease();
|
||||
ret->initWithCapacity(this->data->num > 0 ? this->data->num : 1);
|
||||
|
||||
Object* obj = NULL;
|
||||
Object* tmpObj = NULL;
|
||||
Clonable* clonable = NULL;
|
||||
Object* obj = nullptr;
|
||||
Object* tmpObj = nullptr;
|
||||
Clonable* clonable = nullptr;
|
||||
CCARRAY_FOREACH(this, obj)
|
||||
{
|
||||
clonable = dynamic_cast<Clonable*>(obj);
|
||||
|
|
|
@ -297,7 +297,7 @@ public:
|
|||
/** Returns an element with a certain index */
|
||||
Object* getObjectAtIndex(int index)
|
||||
{
|
||||
CCASSERT(index>=0 && index < count(), "index out of range in objectAtIndex()");
|
||||
CCASSERT(index>=0 && index < count(), "index out of range in getObjectAtIndex()");
|
||||
#if CC_USE_ARRAY_VECTOR
|
||||
return data[index].get();
|
||||
#else
|
||||
|
|
|
@ -165,10 +165,10 @@ void PoolManager::pop()
|
|||
|
||||
// if(nCount > 1)
|
||||
// {
|
||||
// _curReleasePool = _releasePoolStack->objectAtIndex(nCount - 2);
|
||||
// _curReleasePool = _releasePoolStack->getObjectAtIndex(nCount - 2);
|
||||
// return;
|
||||
// }
|
||||
_curReleasePool = (AutoreleasePool*)_releasePoolStack->objectAtIndex(nCount - 2);
|
||||
_curReleasePool = (AutoreleasePool*)_releasePoolStack->getObjectAtIndex(nCount - 2);
|
||||
}
|
||||
|
||||
/*_curReleasePool = NULL;*/
|
||||
|
|
|
@ -340,7 +340,7 @@ Object* Dictionary::randomObject()
|
|||
return NULL;
|
||||
}
|
||||
|
||||
Object* key = allKeys()->randomObject();
|
||||
Object* key = allKeys()->getRandomObject();
|
||||
|
||||
if (_dictType == kDictInt)
|
||||
{
|
||||
|
|
|
@ -444,7 +444,7 @@ Sprite * Label::getSprite()
|
|||
{
|
||||
if (_spriteArrayCache.count())
|
||||
{
|
||||
Sprite *retSprite = (Sprite *) _spriteArrayCache.lastObject();
|
||||
Sprite *retSprite = (Sprite *) _spriteArrayCache.getLastObject();
|
||||
_spriteArrayCache.removeLastObject();
|
||||
return retSprite;
|
||||
}
|
||||
|
|
|
@ -1088,7 +1088,7 @@ bool LayerMultiplex::initWithLayers(Layer *layer, va_list params)
|
|||
}
|
||||
|
||||
_enabledLayer = 0;
|
||||
this->addChild((Node*)_layers->objectAtIndex(_enabledLayer));
|
||||
this->addChild((Node*)_layers->getObjectAtIndex(_enabledLayer));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1104,7 +1104,7 @@ bool LayerMultiplex::initWithArray(Array* arrayOfLayers)
|
|||
_layers->retain();
|
||||
|
||||
_enabledLayer = 0;
|
||||
this->addChild((Node*)_layers->objectAtIndex(_enabledLayer));
|
||||
this->addChild((Node*)_layers->getObjectAtIndex(_enabledLayer));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -1114,25 +1114,25 @@ void LayerMultiplex::switchTo(unsigned int n)
|
|||
{
|
||||
CCASSERT( n < _layers->count(), "Invalid index in MultiplexLayer switchTo message" );
|
||||
|
||||
this->removeChild((Node*)_layers->objectAtIndex(_enabledLayer), true);
|
||||
this->removeChild((Node*)_layers->getObjectAtIndex(_enabledLayer), true);
|
||||
|
||||
_enabledLayer = n;
|
||||
|
||||
this->addChild((Node*)_layers->objectAtIndex(n));
|
||||
this->addChild((Node*)_layers->getObjectAtIndex(n));
|
||||
}
|
||||
|
||||
void LayerMultiplex::switchToAndReleaseMe(unsigned int n)
|
||||
{
|
||||
CCASSERT( n < _layers->count(), "Invalid index in MultiplexLayer switchTo message" );
|
||||
|
||||
this->removeChild((Node*)_layers->objectAtIndex(_enabledLayer), true);
|
||||
this->removeChild((Node*)_layers->getObjectAtIndex(_enabledLayer), true);
|
||||
|
||||
//[layers replaceObjectAtIndex:enabledLayer withObject:[NSNull null]];
|
||||
_layers->replaceObjectAtIndex(_enabledLayer, NULL);
|
||||
|
||||
_enabledLayer = n;
|
||||
|
||||
this->addChild((Node*)_layers->objectAtIndex(n));
|
||||
this->addChild((Node*)_layers->getObjectAtIndex(n));
|
||||
}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -808,7 +808,7 @@ MenuItemToggle * MenuItemToggle::createWithTarget(Object* target, SEL_MenuHandle
|
|||
|
||||
for (unsigned int z=0; z < menuItems->count(); z++)
|
||||
{
|
||||
MenuItem* menuItem = (MenuItem*)menuItems->objectAtIndex(z);
|
||||
MenuItem* menuItem = (MenuItem*)menuItems->getObjectAtIndex(z);
|
||||
pRet->_subItems->addObject(menuItem);
|
||||
}
|
||||
|
||||
|
@ -826,7 +826,7 @@ MenuItemToggle * MenuItemToggle::createWithCallback(const ccMenuCallback &callba
|
|||
|
||||
for (unsigned int z=0; z < menuItems->count(); z++)
|
||||
{
|
||||
MenuItem* menuItem = (MenuItem*)menuItems->objectAtIndex(z);
|
||||
MenuItem* menuItem = (MenuItem*)menuItems->getObjectAtIndex(z);
|
||||
pRet->_subItems->addObject(menuItem);
|
||||
}
|
||||
|
||||
|
@ -939,7 +939,7 @@ void MenuItemToggle::setSelectedIndex(unsigned int index)
|
|||
currentItem->removeFromParentAndCleanup(false);
|
||||
}
|
||||
|
||||
MenuItem* item = (MenuItem*)_subItems->objectAtIndex(_selectedIndex);
|
||||
MenuItem* item = (MenuItem*)_subItems->getObjectAtIndex(_selectedIndex);
|
||||
this->addChild(item, 0, kCurrentItem);
|
||||
Size s = item->getContentSize();
|
||||
this->setContentSize(s);
|
||||
|
@ -950,13 +950,13 @@ void MenuItemToggle::setSelectedIndex(unsigned int index)
|
|||
void MenuItemToggle::selected()
|
||||
{
|
||||
MenuItem::selected();
|
||||
static_cast<MenuItem*>(_subItems->objectAtIndex(_selectedIndex))->selected();
|
||||
static_cast<MenuItem*>(_subItems->getObjectAtIndex(_selectedIndex))->selected();
|
||||
}
|
||||
|
||||
void MenuItemToggle::unselected()
|
||||
{
|
||||
MenuItem::unselected();
|
||||
static_cast<MenuItem*>(_subItems->objectAtIndex(_selectedIndex))->unselected();
|
||||
static_cast<MenuItem*>(_subItems->getObjectAtIndex(_selectedIndex))->unselected();
|
||||
}
|
||||
|
||||
void MenuItemToggle::activate()
|
||||
|
@ -989,7 +989,7 @@ void MenuItemToggle::setEnabled(bool enabled)
|
|||
|
||||
MenuItem* MenuItemToggle::getSelectedItem()
|
||||
{
|
||||
return static_cast<MenuItem*>(_subItems->objectAtIndex(_selectedIndex));
|
||||
return static_cast<MenuItem*>(_subItems->getObjectAtIndex(_selectedIndex));
|
||||
}
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -186,7 +186,7 @@ void ParticleBatchNode::addChild(Node * aChild, int zOrder, int tag)
|
|||
|
||||
if (pos != 0)
|
||||
{
|
||||
ParticleSystem* p = (ParticleSystem*)_children->objectAtIndex(pos-1);
|
||||
ParticleSystem* p = (ParticleSystem*)_children->getObjectAtIndex(pos-1);
|
||||
atlasIndex = p->getAtlasIndex() + p->getTotalParticles();
|
||||
|
||||
}
|
||||
|
@ -274,7 +274,7 @@ void ParticleBatchNode::reorderChild(Node * aChild, int zOrder)
|
|||
int newAtlasIndex = 0;
|
||||
for( unsigned int i=0;i < _children->count();i++)
|
||||
{
|
||||
ParticleSystem* pNode = (ParticleSystem*)_children->objectAtIndex(i);
|
||||
ParticleSystem* pNode = (ParticleSystem*)_children->getObjectAtIndex(i);
|
||||
if( pNode == child )
|
||||
{
|
||||
newAtlasIndex = child->getAtlasIndex();
|
||||
|
@ -302,7 +302,7 @@ void ParticleBatchNode::getCurrentIndex(unsigned int* oldIndex, unsigned int* ne
|
|||
|
||||
for( unsigned int i=0; i < count; i++ )
|
||||
{
|
||||
Node* pNode = (Node *)_children->objectAtIndex(i);
|
||||
Node* pNode = (Node *)_children->getObjectAtIndex(i);
|
||||
|
||||
// new index
|
||||
if( pNode->getZOrder() > z && ! foundNewIdx )
|
||||
|
@ -349,7 +349,7 @@ unsigned int ParticleBatchNode::searchNewPositionInChildrenForZ(int z)
|
|||
|
||||
for( unsigned int i=0; i < count; i++ )
|
||||
{
|
||||
Node *child = (Node *)_children->objectAtIndex(i);
|
||||
Node *child = (Node *)_children->getObjectAtIndex(i);
|
||||
if (child->getZOrder() > z)
|
||||
{
|
||||
return i;
|
||||
|
@ -385,7 +385,7 @@ void ParticleBatchNode::removeChild(Node* aChild, bool cleanup)
|
|||
|
||||
void ParticleBatchNode::removeChildAtIndex(unsigned int index, bool doCleanup)
|
||||
{
|
||||
removeChild((ParticleSystem *)_children->objectAtIndex(index),doCleanup);
|
||||
removeChild((ParticleSystem *)_children->getObjectAtIndex(index),doCleanup);
|
||||
}
|
||||
|
||||
void ParticleBatchNode::removeAllChildrenWithCleanup(bool doCleanup)
|
||||
|
|
|
@ -989,7 +989,7 @@ void Sprite::setDisplayFrameWithAnimationName(const char *animationName, int fra
|
|||
|
||||
CCASSERT(a, "CCSprite#setDisplayFrameWithAnimationName: Frame not found");
|
||||
|
||||
AnimationFrame* frame = static_cast<AnimationFrame*>( a->getFrames()->objectAtIndex(frameIndex) );
|
||||
AnimationFrame* frame = static_cast<AnimationFrame*>( a->getFrames()->getObjectAtIndex(frameIndex) );
|
||||
|
||||
CCASSERT(frame, "CCSprite#setDisplayFrame. Invalid frame");
|
||||
|
||||
|
|
|
@ -226,7 +226,7 @@ void SpriteBatchNode::removeChild(Node *child, bool cleanup)
|
|||
|
||||
void SpriteBatchNode::removeChildAtIndex(unsigned int uIndex, bool bDoCleanup)
|
||||
{
|
||||
removeChild((Sprite*)(_children->objectAtIndex(uIndex)), bDoCleanup);
|
||||
removeChild((Sprite*)(_children->getObjectAtIndex(uIndex)), bDoCleanup);
|
||||
}
|
||||
|
||||
void SpriteBatchNode::removeAllChildrenWithCleanup(bool bCleanup)
|
||||
|
@ -470,7 +470,7 @@ unsigned int SpriteBatchNode::highestAtlasIndexInChild(Sprite *pSprite)
|
|||
}
|
||||
else
|
||||
{
|
||||
return highestAtlasIndexInChild((Sprite*)(children->lastObject()));
|
||||
return highestAtlasIndexInChild((Sprite*)(children->getLastObject()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -484,14 +484,14 @@ unsigned int SpriteBatchNode::lowestAtlasIndexInChild(Sprite *pSprite)
|
|||
}
|
||||
else
|
||||
{
|
||||
return lowestAtlasIndexInChild((Sprite*)(children->objectAtIndex(0)));
|
||||
return lowestAtlasIndexInChild((Sprite*)(children->getObjectAtIndex(0)));
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int SpriteBatchNode::atlasIndexForChild(Sprite *sprite, int nZ)
|
||||
{
|
||||
Array *pBrothers = sprite->getParent()->getChildren();
|
||||
unsigned int uChildIndex = pBrothers->indexOfObject(sprite);
|
||||
unsigned int uChildIndex = pBrothers->getIndexOfObject(sprite);
|
||||
|
||||
// ignore parent Z if parent is spriteSheet
|
||||
bool bIgnoreParent = (SpriteBatchNode*)(sprite->getParent()) == this;
|
||||
|
@ -499,7 +499,7 @@ unsigned int SpriteBatchNode::atlasIndexForChild(Sprite *sprite, int nZ)
|
|||
if (uChildIndex > 0 &&
|
||||
uChildIndex < UINT_MAX)
|
||||
{
|
||||
pPrevious = (Sprite*)(pBrothers->objectAtIndex(uChildIndex - 1));
|
||||
pPrevious = (Sprite*)(pBrothers->getObjectAtIndex(uChildIndex - 1));
|
||||
}
|
||||
|
||||
// first child of the sprite sheet
|
||||
|
@ -622,7 +622,7 @@ void SpriteBatchNode::removeSpriteFromAtlas(Sprite *sprite)
|
|||
// Cleanup sprite. It might be reused (issue #569)
|
||||
sprite->setBatchNode(NULL);
|
||||
|
||||
unsigned int uIndex = _descendants->indexOfObject(sprite);
|
||||
unsigned int uIndex = _descendants->getIndexOfObject(sprite);
|
||||
if (uIndex != UINT_MAX)
|
||||
{
|
||||
_descendants->removeObjectAtIndex(uIndex);
|
||||
|
@ -632,7 +632,7 @@ void SpriteBatchNode::removeSpriteFromAtlas(Sprite *sprite)
|
|||
|
||||
for(; uIndex < count; ++uIndex)
|
||||
{
|
||||
Sprite* s = (Sprite*)(_descendants->objectAtIndex(uIndex));
|
||||
Sprite* s = (Sprite*)(_descendants->getObjectAtIndex(uIndex));
|
||||
s->setAtlasIndex( s->getAtlasIndex() - 1 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -332,7 +332,7 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
|
|||
{
|
||||
if (pTMXMapInfo->getParentElement() == TMXPropertyLayer)
|
||||
{
|
||||
TMXLayerInfo* layer = (TMXLayerInfo*)pTMXMapInfo->getLayers()->lastObject();
|
||||
TMXLayerInfo* layer = (TMXLayerInfo*)pTMXMapInfo->getLayers()->getLastObject();
|
||||
Size layerSize = layer->_layerSize;
|
||||
unsigned int gid = (unsigned int)atoi(valueForKey("gid", attributeDict));
|
||||
int tilesAmount = layerSize.width*layerSize.height;
|
||||
|
@ -366,7 +366,7 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
|
|||
}
|
||||
else
|
||||
{
|
||||
TMXTilesetInfo* info = (TMXTilesetInfo*)pTMXMapInfo->getTilesets()->lastObject();
|
||||
TMXTilesetInfo* info = (TMXTilesetInfo*)pTMXMapInfo->getTilesets()->getLastObject();
|
||||
Dictionary *dict = new Dictionary();
|
||||
pTMXMapInfo->setParentGID(info->_firstGid + atoi(valueForKey("id", attributeDict)));
|
||||
pTMXMapInfo->getTileProperties()->setObject(dict, pTMXMapInfo->getParentGID());
|
||||
|
@ -427,7 +427,7 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
|
|||
}
|
||||
else if (elementName == "image")
|
||||
{
|
||||
TMXTilesetInfo* tileset = (TMXTilesetInfo*)pTMXMapInfo->getTilesets()->lastObject();
|
||||
TMXTilesetInfo* tileset = (TMXTilesetInfo*)pTMXMapInfo->getTilesets()->getLastObject();
|
||||
|
||||
// build full path
|
||||
std::string imagename = valueForKey("source", attributeDict);
|
||||
|
@ -451,7 +451,7 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
|
|||
{
|
||||
pTMXMapInfo->setLayerAttribs(pTMXMapInfo->getLayerAttribs() | TMXLayerAttribNone);
|
||||
|
||||
TMXLayerInfo* layer = (TMXLayerInfo*)pTMXMapInfo->getLayers()->lastObject();
|
||||
TMXLayerInfo* layer = (TMXLayerInfo*)pTMXMapInfo->getLayers()->getLastObject();
|
||||
Size layerSize = layer->_layerSize;
|
||||
int tilesAmount = layerSize.width*layerSize.height;
|
||||
|
||||
|
@ -497,7 +497,7 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
|
|||
else if (elementName == "object")
|
||||
{
|
||||
char buffer[32] = {0};
|
||||
TMXObjectGroup* objectGroup = (TMXObjectGroup*)pTMXMapInfo->getObjectGroups()->lastObject();
|
||||
TMXObjectGroup* objectGroup = (TMXObjectGroup*)pTMXMapInfo->getObjectGroups()->getLastObject();
|
||||
|
||||
// The value for "type" was blank or not a valid class name
|
||||
// Create an instance of TMXObjectInfo to store the object and its properties
|
||||
|
@ -569,7 +569,7 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
|
|||
else if ( pTMXMapInfo->getParentElement() == TMXPropertyLayer )
|
||||
{
|
||||
// The parent element is the last layer
|
||||
TMXLayerInfo* layer = (TMXLayerInfo*)pTMXMapInfo->getLayers()->lastObject();
|
||||
TMXLayerInfo* layer = (TMXLayerInfo*)pTMXMapInfo->getLayers()->getLastObject();
|
||||
String *value = new String(valueForKey("value", attributeDict));
|
||||
std::string key = valueForKey("name", attributeDict);
|
||||
// Add the property to the layer
|
||||
|
@ -580,7 +580,7 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
|
|||
else if ( pTMXMapInfo->getParentElement() == TMXPropertyObjectGroup )
|
||||
{
|
||||
// The parent element is the last object group
|
||||
TMXObjectGroup* objectGroup = (TMXObjectGroup*)pTMXMapInfo->getObjectGroups()->lastObject();
|
||||
TMXObjectGroup* objectGroup = (TMXObjectGroup*)pTMXMapInfo->getObjectGroups()->getLastObject();
|
||||
String *value = new String(valueForKey("value", attributeDict));
|
||||
const char* key = valueForKey("name", attributeDict);
|
||||
objectGroup->getProperties()->setObject(value, key);
|
||||
|
@ -590,8 +590,8 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
|
|||
else if ( pTMXMapInfo->getParentElement() == TMXPropertyObject )
|
||||
{
|
||||
// The parent element is the last object
|
||||
TMXObjectGroup* objectGroup = (TMXObjectGroup*)pTMXMapInfo->getObjectGroups()->lastObject();
|
||||
Dictionary* dict = (Dictionary*)objectGroup->getObjects()->lastObject();
|
||||
TMXObjectGroup* objectGroup = (TMXObjectGroup*)pTMXMapInfo->getObjectGroups()->getLastObject();
|
||||
Dictionary* dict = (Dictionary*)objectGroup->getObjects()->getLastObject();
|
||||
|
||||
const char* propertyName = valueForKey("name", attributeDict);
|
||||
String *propertyValue = new String(valueForKey("value", attributeDict));
|
||||
|
@ -611,8 +611,8 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
|
|||
else if (elementName == "polygon")
|
||||
{
|
||||
// find parent object's dict and add polygon-points to it
|
||||
TMXObjectGroup* objectGroup = (TMXObjectGroup*)_objectGroups->lastObject();
|
||||
Dictionary* dict = (Dictionary*)objectGroup->getObjects()->lastObject();
|
||||
TMXObjectGroup* objectGroup = (TMXObjectGroup*)_objectGroups->getLastObject();
|
||||
Dictionary* dict = (Dictionary*)objectGroup->getObjects()->getLastObject();
|
||||
|
||||
// get points value string
|
||||
const char* value = valueForKey("points", attributeDict);
|
||||
|
@ -690,7 +690,7 @@ void TMXMapInfo::endElement(void *ctx, const char *name)
|
|||
{
|
||||
pTMXMapInfo->setStoringCharacters(false);
|
||||
|
||||
TMXLayerInfo* layer = (TMXLayerInfo*)pTMXMapInfo->getLayers()->lastObject();
|
||||
TMXLayerInfo* layer = (TMXLayerInfo*)pTMXMapInfo->getLayers()->getLastObject();
|
||||
|
||||
std::string currentString = pTMXMapInfo->getCurrentString();
|
||||
unsigned char *buffer;
|
||||
|
@ -733,7 +733,7 @@ void TMXMapInfo::endElement(void *ctx, const char *name)
|
|||
}
|
||||
else if (pTMXMapInfo->getLayerAttribs() & TMXLayerAttribNone)
|
||||
{
|
||||
TMXLayerInfo* layer = (TMXLayerInfo*)pTMXMapInfo->getLayers()->lastObject();
|
||||
TMXLayerInfo* layer = (TMXLayerInfo*)pTMXMapInfo->getLayers()->getLastObject();
|
||||
Size layerSize = layer->_layerSize;
|
||||
int tilesAmount = layerSize.width * layerSize.height;
|
||||
|
||||
|
|
|
@ -230,7 +230,7 @@ void Bone::addChildBone(Bone *child)
|
|||
childrenAlloc();
|
||||
}
|
||||
|
||||
if (_children->indexOfObject(child) == UINT_MAX)
|
||||
if (_children->getIndexOfObject(child) == UINT_MAX)
|
||||
{
|
||||
_children->addObject(child);
|
||||
child->setParentBone(this);
|
||||
|
@ -239,7 +239,7 @@ void Bone::addChildBone(Bone *child)
|
|||
|
||||
void Bone::removeChildBone(Bone *bone, bool recursion)
|
||||
{
|
||||
if ( _children->indexOfObject(bone) != UINT_MAX )
|
||||
if ( _children->getIndexOfObject(bone) != UINT_MAX )
|
||||
{
|
||||
if(recursion)
|
||||
{
|
||||
|
|
|
@ -224,7 +224,7 @@ void BoneData::addDisplayData(DisplayData *displayData)
|
|||
|
||||
DisplayData *BoneData::getDisplayData(int index)
|
||||
{
|
||||
return (DisplayData *)displayDataList.objectAtIndex(index);
|
||||
return (DisplayData *)displayDataList.getObjectAtIndex(index);
|
||||
}
|
||||
|
||||
ArmatureData::ArmatureData()
|
||||
|
@ -301,7 +301,7 @@ void MovementBoneData::addFrameData(FrameData *frameData)
|
|||
|
||||
FrameData *MovementBoneData::getFrameData(int index)
|
||||
{
|
||||
return (FrameData *)frameList.objectAtIndex(index);
|
||||
return (FrameData *)frameList.getObjectAtIndex(index);
|
||||
}
|
||||
|
||||
|
||||
|
@ -406,7 +406,7 @@ void TextureData::addContourData(ContourData *contourData)
|
|||
|
||||
ContourData *TextureData::getContourData(int index)
|
||||
{
|
||||
return (ContourData *)contourDataList.objectAtIndex(index);
|
||||
return (ContourData *)contourDataList.getObjectAtIndex(index);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ void DisplayManager::addDisplay(DisplayData *displayData, int index)
|
|||
|
||||
if(index >= 0 && (unsigned int)index < _decoDisplayList->count())
|
||||
{
|
||||
decoDisplay = (DecorativeDisplay *)_decoDisplayList->objectAtIndex(index);
|
||||
decoDisplay = (DecorativeDisplay *)_decoDisplayList->getObjectAtIndex(index);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -145,7 +145,7 @@ void DisplayManager::changeDisplayByIndex(int index, bool force)
|
|||
}
|
||||
|
||||
|
||||
DecorativeDisplay *decoDisplay = (DecorativeDisplay *)_decoDisplayList->objectAtIndex(_displayIndex);
|
||||
DecorativeDisplay *decoDisplay = (DecorativeDisplay *)_decoDisplayList->getObjectAtIndex(_displayIndex);
|
||||
|
||||
setCurrentDecorativeDisplay(decoDisplay);
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ DecorativeDisplay *DisplayManager::getCurrentDecorativeDisplay()
|
|||
|
||||
DecorativeDisplay *DisplayManager::getDecorativeDisplayByIndex( int index)
|
||||
{
|
||||
return (DecorativeDisplay *)_decoDisplayList->objectAtIndex(index);
|
||||
return (DecorativeDisplay *)_decoDisplayList->getObjectAtIndex(index);
|
||||
}
|
||||
|
||||
void DisplayManager::initDisplayList(BoneData *boneData)
|
||||
|
|
|
@ -359,12 +359,12 @@ ActionInterval* CCBAnimationManager::getAction(CCBKeyframe *pKeyframe0, CCBKeyfr
|
|||
{
|
||||
// Get position type
|
||||
Array *array = static_cast<Array*>(getBaseValue(pNode, propName));
|
||||
CCBReader::PositionType type = (CCBReader::PositionType)((CCBValue*)array->objectAtIndex(2))->getIntValue();
|
||||
CCBReader::PositionType type = (CCBReader::PositionType)((CCBValue*)array->getObjectAtIndex(2))->getIntValue();
|
||||
|
||||
// Get relative position
|
||||
Array *value = static_cast<Array*>(pKeyframe1->getValue());
|
||||
float x = ((CCBValue*)value->objectAtIndex(0))->getFloatValue();
|
||||
float y = ((CCBValue*)value->objectAtIndex(1))->getFloatValue();
|
||||
float x = ((CCBValue*)value->getObjectAtIndex(0))->getFloatValue();
|
||||
float y = ((CCBValue*)value->getObjectAtIndex(1))->getFloatValue();
|
||||
|
||||
Size containerSize = getContainerSize(pNode->getParent());
|
||||
|
||||
|
@ -376,12 +376,12 @@ ActionInterval* CCBAnimationManager::getAction(CCBKeyframe *pKeyframe0, CCBKeyfr
|
|||
{
|
||||
// Get position type
|
||||
Array *array = (Array*)getBaseValue(pNode, propName);
|
||||
CCBReader::ScaleType type = (CCBReader::ScaleType)((CCBValue*)array->objectAtIndex(2))->getIntValue();
|
||||
CCBReader::ScaleType type = (CCBReader::ScaleType)((CCBValue*)array->getObjectAtIndex(2))->getIntValue();
|
||||
|
||||
// Get relative scale
|
||||
Array *value = (Array*)pKeyframe1->getValue();
|
||||
float x = ((CCBValue*)value->objectAtIndex(0))->getFloatValue();
|
||||
float y = ((CCBValue*)value->objectAtIndex(1))->getFloatValue();
|
||||
float x = ((CCBValue*)value->getObjectAtIndex(0))->getFloatValue();
|
||||
float y = ((CCBValue*)value->getObjectAtIndex(1))->getFloatValue();
|
||||
|
||||
if (type == CCBReader::ScaleType::MULTIPLY_RESOLUTION)
|
||||
{
|
||||
|
@ -396,8 +396,8 @@ ActionInterval* CCBAnimationManager::getAction(CCBKeyframe *pKeyframe0, CCBKeyfr
|
|||
{
|
||||
// Get relative skew
|
||||
Array *value = (Array*)pKeyframe1->getValue();
|
||||
float x = ((CCBValue*)value->objectAtIndex(0))->getFloatValue();
|
||||
float y = ((CCBValue*)value->objectAtIndex(1))->getFloatValue();
|
||||
float x = ((CCBValue*)value->getObjectAtIndex(0))->getFloatValue();
|
||||
float y = ((CCBValue*)value->getObjectAtIndex(1))->getFloatValue();
|
||||
|
||||
return SkewTo::create(duration, x, y);
|
||||
}
|
||||
|
@ -432,12 +432,12 @@ void CCBAnimationManager::setAnimatedProperty(const char *propName, Node *pNode,
|
|||
{
|
||||
// Get position type
|
||||
Array *array = (Array*)getBaseValue(pNode, propName);
|
||||
CCBReader::PositionType type = (CCBReader::PositionType)((CCBValue*)array->objectAtIndex(2))->getIntValue();
|
||||
CCBReader::PositionType type = (CCBReader::PositionType)((CCBValue*)array->getObjectAtIndex(2))->getIntValue();
|
||||
|
||||
// Get relative position
|
||||
Array *value = (Array*)pValue;
|
||||
float x = ((CCBValue*)value->objectAtIndex(0))->getFloatValue();
|
||||
float y = ((CCBValue*)value->objectAtIndex(1))->getFloatValue();
|
||||
float x = ((CCBValue*)value->getObjectAtIndex(0))->getFloatValue();
|
||||
float y = ((CCBValue*)value->getObjectAtIndex(1))->getFloatValue();
|
||||
|
||||
pNode->setPosition(getAbsolutePosition(Point(x,y), type, getContainerSize(pNode->getParent()), propName));
|
||||
}
|
||||
|
@ -445,12 +445,12 @@ void CCBAnimationManager::setAnimatedProperty(const char *propName, Node *pNode,
|
|||
{
|
||||
// Get scale type
|
||||
Array *array = (Array*)getBaseValue(pNode, propName);
|
||||
CCBReader::ScaleType type = (CCBReader::ScaleType)((CCBValue*)array->objectAtIndex(2))->getIntValue();
|
||||
CCBReader::ScaleType type = (CCBReader::ScaleType)((CCBValue*)array->getObjectAtIndex(2))->getIntValue();
|
||||
|
||||
// Get relative scale
|
||||
Array *value = (Array*)pValue;
|
||||
float x = ((CCBValue*)value->objectAtIndex(0))->getFloatValue();
|
||||
float y = ((CCBValue*)value->objectAtIndex(1))->getFloatValue();
|
||||
float x = ((CCBValue*)value->getObjectAtIndex(0))->getFloatValue();
|
||||
float y = ((CCBValue*)value->getObjectAtIndex(1))->getFloatValue();
|
||||
|
||||
setRelativeScale(pNode, x, y, type, propName);
|
||||
}
|
||||
|
@ -458,8 +458,8 @@ void CCBAnimationManager::setAnimatedProperty(const char *propName, Node *pNode,
|
|||
{
|
||||
// Get relative scale
|
||||
Array *value = (Array*)pValue;
|
||||
float x = ((CCBValue*)value->objectAtIndex(0))->getFloatValue();
|
||||
float y = ((CCBValue*)value->objectAtIndex(1))->getFloatValue();
|
||||
float x = ((CCBValue*)value->getObjectAtIndex(0))->getFloatValue();
|
||||
float y = ((CCBValue*)value->getObjectAtIndex(1))->getFloatValue();
|
||||
|
||||
pNode->setSkewX(x);
|
||||
pNode->setSkewY(y);
|
||||
|
@ -524,7 +524,7 @@ void CCBAnimationManager::setFirstFrame(Node *pNode, CCBSequenceProperty *pSeqPr
|
|||
else
|
||||
{
|
||||
// Use first keyframe
|
||||
CCBKeyframe *keyframe = (CCBKeyframe*)keyframes->objectAtIndex(0);
|
||||
CCBKeyframe *keyframe = (CCBKeyframe*)keyframes->getObjectAtIndex(0);
|
||||
setAnimatedProperty(pSeqProp->getName(), pNode, keyframe->getValue(), fTweenDuration);
|
||||
}
|
||||
}
|
||||
|
@ -610,7 +610,7 @@ Object* CCBAnimationManager::actionForCallbackChannel(CCBSequenceProperty* chann
|
|||
for (int i = 0; i < numKeyframes; ++i)
|
||||
{
|
||||
|
||||
CCBKeyframe *keyframe = (CCBKeyframe*)keyframes->objectAtIndex(i);
|
||||
CCBKeyframe *keyframe = (CCBKeyframe*)keyframes->getObjectAtIndex(i);
|
||||
float timeSinceLastKeyframe = keyframe->getTime() - lastKeyframeTime;
|
||||
lastKeyframeTime = keyframe->getTime();
|
||||
if(timeSinceLastKeyframe > 0) {
|
||||
|
@ -618,8 +618,8 @@ Object* CCBAnimationManager::actionForCallbackChannel(CCBSequenceProperty* chann
|
|||
}
|
||||
|
||||
Array* keyVal = static_cast<Array *>(keyframe->getValue());
|
||||
std::string selectorName = static_cast<String *>(keyVal->objectAtIndex(0))->getCString();
|
||||
CCBReader::TargetType selectorTarget = (CCBReader::TargetType)atoi(static_cast<String *>(keyVal->objectAtIndex(1))->getCString());
|
||||
std::string selectorName = static_cast<String *>(keyVal->getObjectAtIndex(0))->getCString();
|
||||
CCBReader::TargetType selectorTarget = (CCBReader::TargetType)atoi(static_cast<String *>(keyVal->getObjectAtIndex(1))->getCString());
|
||||
|
||||
if(_jsControlled) {
|
||||
String* callbackName = String::createWithFormat("%d:%s", selectorTarget, selectorName.c_str());
|
||||
|
@ -683,7 +683,7 @@ Object* CCBAnimationManager::actionForSoundChannel(CCBSequenceProperty* channel)
|
|||
|
||||
for (int i = 0; i < numKeyframes; ++i) {
|
||||
|
||||
CCBKeyframe *keyframe = (CCBKeyframe*)keyframes->objectAtIndex(i);
|
||||
CCBKeyframe *keyframe = (CCBKeyframe*)keyframes->getObjectAtIndex(i);
|
||||
float timeSinceLastKeyframe = keyframe->getTime() - lastKeyframeTime;
|
||||
lastKeyframeTime = keyframe->getTime();
|
||||
if(timeSinceLastKeyframe > 0) {
|
||||
|
@ -692,18 +692,18 @@ Object* CCBAnimationManager::actionForSoundChannel(CCBSequenceProperty* channel)
|
|||
|
||||
stringstream ss (stringstream::in | stringstream::out);
|
||||
Array* keyVal = (Array*)keyframe->getValue();
|
||||
std::string soundFile = ((String *)keyVal->objectAtIndex(0))->getCString();
|
||||
std::string soundFile = ((String *)keyVal->getObjectAtIndex(0))->getCString();
|
||||
|
||||
float pitch, pan, gain;
|
||||
ss << ((String *)keyVal->objectAtIndex(1))->getCString();
|
||||
ss << ((String *)keyVal->getObjectAtIndex(1))->getCString();
|
||||
ss >> pitch;
|
||||
ss.flush();
|
||||
|
||||
ss << ((String *)keyVal->objectAtIndex(2))->getCString();
|
||||
ss << ((String *)keyVal->getObjectAtIndex(2))->getCString();
|
||||
ss >> pan;
|
||||
ss.flush();
|
||||
|
||||
ss << ((String *)keyVal->objectAtIndex(3))->getCString();
|
||||
ss << ((String *)keyVal->getObjectAtIndex(3))->getCString();
|
||||
ss >> gain;
|
||||
ss.flush();
|
||||
|
||||
|
@ -727,7 +727,7 @@ void CCBAnimationManager::runAction(Node *pNode, CCBSequenceProperty *pSeqProp,
|
|||
// Make an animation!
|
||||
Array *actions = Array::create();
|
||||
|
||||
CCBKeyframe *keyframeFirst = (CCBKeyframe*)keyframes->objectAtIndex(0);
|
||||
CCBKeyframe *keyframeFirst = (CCBKeyframe*)keyframes->getObjectAtIndex(0);
|
||||
float timeFirst = keyframeFirst->getTime() + fTweenDuration;
|
||||
|
||||
if (timeFirst > 0)
|
||||
|
@ -737,8 +737,8 @@ void CCBAnimationManager::runAction(Node *pNode, CCBSequenceProperty *pSeqProp,
|
|||
|
||||
for (int i = 0; i < numKeyframes - 1; ++i)
|
||||
{
|
||||
CCBKeyframe *kf0 = (CCBKeyframe*)keyframes->objectAtIndex(i);
|
||||
CCBKeyframe *kf1 = (CCBKeyframe*)keyframes->objectAtIndex(i+1);
|
||||
CCBKeyframe *kf0 = (CCBKeyframe*)keyframes->getObjectAtIndex(i);
|
||||
CCBKeyframe *kf1 = (CCBKeyframe*)keyframes->getObjectAtIndex(i+1);
|
||||
|
||||
ActionInterval *action = getAction(kf0, kf1, pSeqProp->getName(), pNode);
|
||||
if (action)
|
||||
|
|
|
@ -967,8 +967,8 @@ Node * NodeLoader::parsePropTypeCCBFile(Node * pNode, Node * pParent, CCBReader
|
|||
|
||||
for (int i = 0 ; i < nCount; i++)
|
||||
{
|
||||
pCCBReader->addOwnerCallbackName((dynamic_cast<String*>(ownerCallbackNames->objectAtIndex(i)))->getCString());
|
||||
pCCBReader->addOwnerCallbackNode(dynamic_cast<Node*>(ownerCallbackNodes->objectAtIndex(i)) );
|
||||
pCCBReader->addOwnerCallbackName((dynamic_cast<String*>(ownerCallbackNames->getObjectAtIndex(i)))->getCString());
|
||||
pCCBReader->addOwnerCallbackNode(dynamic_cast<Node*>(ownerCallbackNodes->getObjectAtIndex(i)) );
|
||||
}
|
||||
}
|
||||
//set variables
|
||||
|
@ -982,8 +982,8 @@ Node * NodeLoader::parsePropTypeCCBFile(Node * pNode, Node * pParent, CCBReader
|
|||
|
||||
for (int i = 0 ; i < nCount; i++)
|
||||
{
|
||||
pCCBReader->addOwnerOutletName((static_cast<String*>(ownerOutletNames->objectAtIndex(i)))->getCString());
|
||||
pCCBReader->addOwnerOutletNode(static_cast<Node*>(ownerOutletNodes->objectAtIndex(i)));
|
||||
pCCBReader->addOwnerOutletName((static_cast<String*>(ownerOutletNames->getObjectAtIndex(i)))->getCString());
|
||||
pCCBReader->addOwnerOutletNode(static_cast<Node*>(ownerOutletNodes->getObjectAtIndex(i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -626,11 +626,11 @@ bool ScrollView::ccTouchBegan(Touch* touch, Event* event)
|
|||
}
|
||||
else if (_touches->count() == 2)
|
||||
{
|
||||
_touchPoint = (this->convertTouchToNodeSpace((Touch*)_touches->objectAtIndex(0)).getMidpoint(
|
||||
this->convertTouchToNodeSpace((Touch*)_touches->objectAtIndex(1))));
|
||||
_touchPoint = (this->convertTouchToNodeSpace((Touch*)_touches->getObjectAtIndex(0)).getMidpoint(
|
||||
this->convertTouchToNodeSpace((Touch*)_touches->getObjectAtIndex(1))));
|
||||
|
||||
_touchLength = _container->convertTouchToNodeSpace((Touch*)_touches->objectAtIndex(0)).getDistance(
|
||||
_container->convertTouchToNodeSpace((Touch*)_touches->objectAtIndex(1)));
|
||||
_touchLength = _container->convertTouchToNodeSpace((Touch*)_touches->getObjectAtIndex(0)).getDistance(
|
||||
_container->convertTouchToNodeSpace((Touch*)_touches->getObjectAtIndex(1)));
|
||||
|
||||
_dragging = false;
|
||||
}
|
||||
|
@ -654,7 +654,7 @@ void ScrollView::ccTouchMoved(Touch* touch, Event* event)
|
|||
|
||||
frame = getViewRect();
|
||||
|
||||
newPoint = this->convertTouchToNodeSpace((Touch*)_touches->objectAtIndex(0));
|
||||
newPoint = this->convertTouchToNodeSpace((Touch*)_touches->getObjectAtIndex(0));
|
||||
moveDistance = newPoint - _touchPoint;
|
||||
|
||||
float dis = 0.0f;
|
||||
|
@ -711,8 +711,8 @@ void ScrollView::ccTouchMoved(Touch* touch, Event* event)
|
|||
}
|
||||
else if (_touches->count() == 2 && !_dragging)
|
||||
{
|
||||
const float len = _container->convertTouchToNodeSpace((Touch*)_touches->objectAtIndex(0)).getDistance(
|
||||
_container->convertTouchToNodeSpace((Touch*)_touches->objectAtIndex(1)));
|
||||
const float len = _container->convertTouchToNodeSpace((Touch*)_touches->getObjectAtIndex(0)).getDistance(
|
||||
_container->convertTouchToNodeSpace((Touch*)_touches->getObjectAtIndex(1)));
|
||||
this->setZoomScale(this->getZoomScale()*len/_touchLength);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ void ArrayForObjectSorting::removeSortedObject(SortableObject* object)
|
|||
idx = this->indexOfSortedObject(object);
|
||||
|
||||
if (idx < this->count() && idx != CC_INVALID_INDEX) {
|
||||
foundObj = dynamic_cast<SortableObject*>(this->objectAtIndex(idx));
|
||||
foundObj = dynamic_cast<SortableObject*>(this->getObjectAtIndex(idx));
|
||||
|
||||
if(foundObj->getObjectID() == object->getObjectID()) {
|
||||
this->removeObjectAtIndex(idx);
|
||||
|
@ -96,7 +96,7 @@ void ArrayForObjectSorting::setObjectID_ofSortedObject(unsigned int tag, Sortabl
|
|||
idx = this->indexOfSortedObject(object);
|
||||
if (idx < this->count() && idx != CC_INVALID_INDEX)
|
||||
{
|
||||
foundObj = dynamic_cast<SortableObject*>(this->objectAtIndex(idx));
|
||||
foundObj = dynamic_cast<SortableObject*>(this->getObjectAtIndex(idx));
|
||||
Object* pObj = dynamic_cast<Object*>(foundObj);
|
||||
pObj->retain();
|
||||
|
||||
|
@ -130,7 +130,7 @@ SortableObject* ArrayForObjectSorting::objectWithObjectID(unsigned int tag)
|
|||
|
||||
if (idx < this->count() && idx != CC_INVALID_INDEX)
|
||||
{
|
||||
foundObj = dynamic_cast<SortableObject*>(this->objectAtIndex(idx));
|
||||
foundObj = dynamic_cast<SortableObject*>(this->getObjectAtIndex(idx));
|
||||
if (foundObj->getObjectID() != tag) {
|
||||
foundObj = NULL;
|
||||
}
|
||||
|
|
|
@ -187,7 +187,7 @@ void TableView::insertCellAtIndex(unsigned int idx)
|
|||
newIdx = _cellsUsed->indexOfSortedObject(cell);
|
||||
for (unsigned int i=newIdx; i<_cellsUsed->count(); i++)
|
||||
{
|
||||
cell = (TableViewCell*)_cellsUsed->objectAtIndex(i);
|
||||
cell = (TableViewCell*)_cellsUsed->getObjectAtIndex(i);
|
||||
this->_setIndexForCell(cell->getIdx()+1, cell);
|
||||
}
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ void TableView::removeCellAtIndex(unsigned int idx)
|
|||
// [_indices shiftIndexesStartingAtIndex:idx+1 by:-1];
|
||||
for (unsigned int i=_cellsUsed->count()-1; i > newIdx; i--)
|
||||
{
|
||||
cell = (TableViewCell*)_cellsUsed->objectAtIndex(i);
|
||||
cell = (TableViewCell*)_cellsUsed->getObjectAtIndex(i);
|
||||
this->_setIndexForCell(cell->getIdx()-1, cell);
|
||||
}
|
||||
}
|
||||
|
@ -246,7 +246,7 @@ TableViewCell *TableView::dequeueCell()
|
|||
if (_cellsFreed->count() == 0) {
|
||||
cell = NULL;
|
||||
} else {
|
||||
cell = (TableViewCell*)_cellsFreed->objectAtIndex(0);
|
||||
cell = (TableViewCell*)_cellsFreed->getObjectAtIndex(0);
|
||||
cell->retain();
|
||||
_cellsFreed->removeObjectAtIndex(0);
|
||||
cell->autorelease();
|
||||
|
@ -510,7 +510,7 @@ void TableView::scrollViewDidScroll(ScrollView* view)
|
|||
|
||||
if (_cellsUsed->count() > 0)
|
||||
{
|
||||
TableViewCell* cell = (TableViewCell*)_cellsUsed->objectAtIndex(0);
|
||||
TableViewCell* cell = (TableViewCell*)_cellsUsed->getObjectAtIndex(0);
|
||||
|
||||
idx = cell->getIdx();
|
||||
while(idx <startIdx)
|
||||
|
@ -518,7 +518,7 @@ void TableView::scrollViewDidScroll(ScrollView* view)
|
|||
this->_moveCellOutOfSight(cell);
|
||||
if (_cellsUsed->count() > 0)
|
||||
{
|
||||
cell = (TableViewCell*)_cellsUsed->objectAtIndex(0);
|
||||
cell = (TableViewCell*)_cellsUsed->getObjectAtIndex(0);
|
||||
idx = cell->getIdx();
|
||||
}
|
||||
else
|
||||
|
@ -529,7 +529,7 @@ void TableView::scrollViewDidScroll(ScrollView* view)
|
|||
}
|
||||
if (_cellsUsed->count() > 0)
|
||||
{
|
||||
TableViewCell *cell = (TableViewCell*)_cellsUsed->lastObject();
|
||||
TableViewCell *cell = (TableViewCell*)_cellsUsed->getLastObject();
|
||||
idx = cell->getIdx();
|
||||
|
||||
while(idx <= maxIdx && idx > endIdx)
|
||||
|
@ -537,7 +537,7 @@ void TableView::scrollViewDidScroll(ScrollView* view)
|
|||
this->_moveCellOutOfSight(cell);
|
||||
if (_cellsUsed->count() > 0)
|
||||
{
|
||||
cell = (TableViewCell*)_cellsUsed->lastObject();
|
||||
cell = (TableViewCell*)_cellsUsed->getLastObject();
|
||||
idx = cell->getIdx();
|
||||
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ static void networkThread(void)
|
|||
|
||||
if (0 != s_requestQueue->count())
|
||||
{
|
||||
request = dynamic_cast<HttpRequest*>(s_requestQueue->objectAtIndex(0));
|
||||
request = dynamic_cast<HttpRequest*>(s_requestQueue->getObjectAtIndex(0));
|
||||
s_requestQueue->removeObjectAtIndex(0);
|
||||
}
|
||||
|
||||
|
@ -485,7 +485,7 @@ void HttpClient::dispatchResponseCallbacks(float delta)
|
|||
|
||||
if (s_responseQueue->count())
|
||||
{
|
||||
response = dynamic_cast<HttpResponse*>(s_responseQueue->objectAtIndex(0));
|
||||
response = dynamic_cast<HttpResponse*>(s_responseQueue->getObjectAtIndex(0));
|
||||
s_responseQueue->removeObjectAtIndex(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -1649,7 +1649,7 @@ void AddAndDeleteParticleSystems::removeSystem(float dt)
|
|||
{
|
||||
CCLOG("remove random system");
|
||||
unsigned int uRand = rand() % (nChildrenCount - 1);
|
||||
_batchNode->removeChild((Node*)_batchNode->getChildren()->objectAtIndex(uRand), true);
|
||||
_batchNode->removeChild((Node*)_batchNode->getChildren()->getObjectAtIndex(uRand), true);
|
||||
|
||||
auto particleSystem = ParticleSystemQuad::create("Particles/Spiral.plist");
|
||||
//add new
|
||||
|
@ -1796,7 +1796,7 @@ void ReorderParticleSystems::onEnter()
|
|||
|
||||
void ReorderParticleSystems::reorderSystem(float time)
|
||||
{
|
||||
auto system = (ParticleSystem*)_batchNode->getChildren()->objectAtIndex(1);
|
||||
auto system = (ParticleSystem*)_batchNode->getChildren()->getObjectAtIndex(1);
|
||||
_batchNode->reorderChild(system, system->getZOrder() - 1);
|
||||
}
|
||||
|
||||
|
|
|
@ -445,7 +445,7 @@ void AddSpriteSheet::update(float dt)
|
|||
|
||||
for( int i=0; i < totalToAdd;i++ )
|
||||
{
|
||||
batchNode->addChild((Node*) (sprites->objectAtIndex(i)), zs[i], kTagBase+i);
|
||||
batchNode->addChild((Node*) (sprites->getObjectAtIndex(i)), zs[i], kTagBase+i);
|
||||
}
|
||||
|
||||
batchNode->sortAllChildren();
|
||||
|
@ -503,7 +503,7 @@ void RemoveSpriteSheet::update(float dt)
|
|||
// add them with random Z (very important!)
|
||||
for( int i=0; i < totalToAdd;i++ )
|
||||
{
|
||||
batchNode->addChild((Node*) (sprites->objectAtIndex(i)), CCRANDOM_MINUS1_1() * 50, kTagBase+i);
|
||||
batchNode->addChild((Node*) (sprites->getObjectAtIndex(i)), CCRANDOM_MINUS1_1() * 50, kTagBase+i);
|
||||
}
|
||||
|
||||
// remove them
|
||||
|
@ -559,7 +559,7 @@ void ReorderSpriteSheet::update(float dt)
|
|||
// add them with random Z (very important!)
|
||||
for( int i=0; i < totalToAdd;i++ )
|
||||
{
|
||||
batchNode->addChild((Node*) (sprites->objectAtIndex(i)), CCRANDOM_MINUS1_1() * 50, kTagBase+i);
|
||||
batchNode->addChild((Node*) (sprites->getObjectAtIndex(i)), CCRANDOM_MINUS1_1() * 50, kTagBase+i);
|
||||
}
|
||||
|
||||
batchNode->sortAllChildren();
|
||||
|
@ -569,7 +569,7 @@ void ReorderSpriteSheet::update(float dt)
|
|||
|
||||
for( int i=0;i < totalToAdd;i++)
|
||||
{
|
||||
auto node = (Node*) (batchNode->getChildren()->objectAtIndex(i));
|
||||
auto node = (Node*) (batchNode->getChildren()->getObjectAtIndex(i));
|
||||
batchNode->reorderChild(node, CCRANDOM_MINUS1_1() * 50);
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
6b5ddb2c8e2b4b8dea01e8ff068ff9a15795db69
|
||||
7b8ff30c1fc482c4d7485032c73c1145a60168b4
|
|
@ -166,7 +166,7 @@ void KeyboardNotificationLayer::keyboardWillShow(IMEKeyboardNotificationInfo& in
|
|||
Point pos;
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
node = (Node*)children->objectAtIndex(i);
|
||||
node = (Node*)children->getObjectAtIndex(i);
|
||||
pos = node->getPosition();
|
||||
pos.y += adjustVert;
|
||||
node->setPosition(pos);
|
||||
|
|
|
@ -722,8 +722,8 @@ void ScriptingCore::pauseSchedulesAndActions(js_proxy_t* p)
|
|||
|
||||
Node* node = (Node*)p->ptr;
|
||||
for(unsigned int i = 0; i < arr->count(); ++i) {
|
||||
if (arr->objectAtIndex(i)) {
|
||||
node->getScheduler()->pauseTarget(arr->objectAtIndex(i));
|
||||
if (arr->getObjectAtIndex(i)) {
|
||||
node->getScheduler()->pauseTarget(arr->getObjectAtIndex(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -736,8 +736,8 @@ void ScriptingCore::resumeSchedulesAndActions(js_proxy_t* p)
|
|||
|
||||
Node* node = (Node*)p->ptr;
|
||||
for(unsigned int i = 0; i < arr->count(); ++i) {
|
||||
if (!arr->objectAtIndex(i)) continue;
|
||||
node->getScheduler()->resumeTarget(arr->objectAtIndex(i));
|
||||
if (!arr->getObjectAtIndex(i)) continue;
|
||||
node->getScheduler()->resumeTarget(arr->getObjectAtIndex(i));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
d17c1939227c62cebcc30a071cf81b12bfa08db3
|
||||
c89d590602b0d7e1d6a9f556da352dd33af7ea72
|
Loading…
Reference in New Issue