From 66c5721fc7590b384131d992d319abc6848e6f3d Mon Sep 17 00:00:00 2001 From: carlo morgantini Date: Mon, 5 Aug 2013 18:03:52 -0700 Subject: [PATCH] clean up --- cocos2dx/label_nodes/CCFontDefinition.cpp | 5 +++++ cocos2dx/label_nodes/CCFontDefinition.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cocos2dx/label_nodes/CCFontDefinition.cpp b/cocos2dx/label_nodes/CCFontDefinition.cpp index 5574a51663..eafc84daf7 100644 --- a/cocos2dx/label_nodes/CCFontDefinition.cpp +++ b/cocos2dx/label_nodes/CCFontDefinition.cpp @@ -28,12 +28,17 @@ NS_CC_BEGIN +const int FontDefinitionTTF::_DEFAUL_ATALS_TEXTURE_SIZE = 1024; + FontDefinitionTTF::FontDefinitionTTF():_textImages(0), _commonLineHeight(0) { } FontDefinitionTTF* FontDefinitionTTF::create(Font *font, int textureSize) { + if (textureSize == 0) + textureSize = _DEFAUL_ATALS_TEXTURE_SIZE; + FontDefinitionTTF *ret = new FontDefinitionTTF; if(!ret) diff --git a/cocos2dx/label_nodes/CCFontDefinition.h b/cocos2dx/label_nodes/CCFontDefinition.h index 4e505669d2..9bde06fe67 100644 --- a/cocos2dx/label_nodes/CCFontDefinition.h +++ b/cocos2dx/label_nodes/CCFontDefinition.h @@ -39,7 +39,7 @@ class CC_DLL FontDefinitionTTF : public Object { public: - static FontDefinitionTTF* create(Font *font, int textureSize = DEFAULT_ATLAS_TEXTURE_SIZE); + static FontDefinitionTTF* create(Font *font, int textureSize = 0); FontAtlas * createFontAtlas(); private: @@ -54,6 +54,7 @@ private: TextImage * _textImages; std::map _fontLettersDefinitionUTF16; float _commonLineHeight; + static const int _DEFAUL_ATALS_TEXTURE_SIZE; };