mirror of
https://github.com/geode-sdk/geode.git
synced 2025-03-31 07:10:28 -04:00
add definition of CCArray::exchangeObject on mac
This commit is contained in:
parent
2fd0b02edb
commit
bd67102575
1 changed files with 25 additions and 0 deletions
25
loader/src/cocos2d-ext/MacOS.cpp
Normal file
25
loader/src/cocos2d-ext/MacOS.cpp
Normal file
|
@ -0,0 +1,25 @@
|
|||
#include <Geode/DefaultInclude.hpp>
|
||||
|
||||
#ifdef GEODE_IS_MACOS
|
||||
|
||||
#include <cocos2d.h>
|
||||
using namespace cocos2d;
|
||||
|
||||
// https://github.com/cocos2d/cocos2d-x/blob/cocos2d-x-2.2.3/cocos2dx/cocoa/CCArray.cpp
|
||||
void CCArray::exchangeObject(CCObject* object1, CCObject* object2) {
|
||||
unsigned int index1 = ccArrayGetIndexOfObject(data, object1);
|
||||
if(index1 == UINT_MAX)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int index2 = ccArrayGetIndexOfObject(data, object2);
|
||||
if(index2 == UINT_MAX)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ccArraySwapObjectsAtIndexes(data, index1, index2);
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Add table
Reference in a new issue