diff --git a/cocos/2d/CCFont.cpp b/cocos/2d/CCFont.cpp index 2f97fe1d76..961e165cb9 100644 --- a/cocos/2d/CCFont.cpp +++ b/cocos/2d/CCFont.cpp @@ -99,7 +99,7 @@ const char * Font::getCurrentGlyphCollection() const } } -unsigned short int * Font::getUTF16Text(const char *text, int &outNumLetters) const +unsigned short* Font::getUTF16Text(const char *text, int &outNumLetters) const { unsigned short* utf16String = cc_utf8_to_utf16(text); @@ -115,7 +115,7 @@ int Font::getUTF16TextLenght(unsigned short int *text) const return cc_wcslen(text); } -unsigned short int * Font::trimUTF16Text(unsigned short int *text, int newBegin, int newEnd) const +unsigned short * Font::trimUTF16Text(unsigned short int *text, int newBegin, int newEnd) const { if ( newBegin < 0 || newEnd <= 0 ) return 0; diff --git a/cocos/2d/CCFont.h b/cocos/2d/CCFont.h index 692134ec47..719d424a49 100644 --- a/cocos/2d/CCFont.h +++ b/cocos/2d/CCFont.h @@ -49,8 +49,8 @@ public: virtual int getFontMaxHeight() const { return 0; } virtual int getUTF16TextLenght(unsigned short int *text) const; - virtual unsigned short int * getUTF16Text(const char *text, int &outNumLetters) const; - virtual unsigned short int * trimUTF16Text(unsigned short int *text, int newBegin, int newEnd) const; + virtual unsigned short * getUTF16Text(const char *text, int &outNumLetters) const; + virtual unsigned short * trimUTF16Text(unsigned short int *text, int newBegin, int newEnd) const; protected: diff --git a/cocos/2d/CCFontFreeType.cpp b/cocos/2d/CCFontFreeType.cpp index 808d91bf10..dbfdffbb8f 100644 --- a/cocos/2d/CCFontFreeType.cpp +++ b/cocos/2d/CCFontFreeType.cpp @@ -136,7 +136,9 @@ FontAtlas * FontFreeType::createFontAtlas() FontAtlas *atlas = new FontAtlas(*this); if (_usedGlyphs != GlyphCollection::DYNAMIC) { - atlas->prepareLetterDefinitions(cc_utf8_to_utf16(getCurrentGlyphCollection())); + unsigned short* utf16 = cc_utf8_to_utf16(getCurrentGlyphCollection()); + atlas->prepareLetterDefinitions(utf16); + CC_SAFE_DELETE_ARRAY(utf16); } this->release(); return atlas; diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id b/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id index e620f7d9df..ee22cb131d 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp.REMOVED.git-id @@ -1 +1 @@ -46dca55d2395fb839c8600236372e35e0f59f016 \ No newline at end of file +c5f8d4a3ea721a2ecb36fe381430b7ac6fad1740 \ No newline at end of file