replace ccstring create implementation

This commit is contained in:
altalk23 2022-11-22 14:01:55 +03:00 committed by alk
parent c6f62f3b68
commit caac958c37
2 changed files with 4 additions and 4 deletions
bindings
loader/include/Geode/cocos/cocoa

View file

@ -833,6 +833,7 @@ class cocos2d::CCString {
virtual auto isEqual(cocos2d::CCObject const*) = mac 0x44c8f0, ios 0x1a1e6c;
virtual auto acceptVisitor(cocos2d::CCDataVisitor&) = mac 0x44ccb0, ios 0x1a2168;
virtual cocos2d::CCObject* copyWithZone(cocos2d::CCZone*) = mac 0x44c870, ios 0x1a1e14;
static cocos2d::CCString* createWithData(unsigned char const*, unsigned long) = mac 0x44c9d0;
// cocos2d::CCString::create(gd::string const&) = mac 0x44c960;
// CCString(gd::string const&) = mac 0x44c310;
auto boolValue() const = mac 0x44c810, ios 0x1a1d88;

View file

@ -113,10 +113,9 @@ public:
* @return A CCString pointer which is an autorelease object pointer,
* it means that you needn't do a release operation unless you retain it.
*/
static inline CCString* create(const gd::string& str) {
CCString* pRet = new CCString(str);
pRet->autorelease();
return pRet;
// Geode change: this is kind of a hack but i think it will work
static inline CCString* create(std::string& str) {
return CCString::createWithData(str.c_str(), str.size());
}
/** create a string with format, it's similar with the c function 'sprintf', the default buffer size is (1024*100) bytes,