From 5f6fbc6a33e1ff160b64817d85edbb8f667d4fa0 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Fri, 14 Mar 2014 15:18:45 +0800 Subject: [PATCH] label:fixed getter for font size and font name. --- cocos/2d/CCFontAtlas.cpp | 2 +- cocos/2d/CCLabel.cpp | 18 ++---------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/cocos/2d/CCFontAtlas.cpp b/cocos/2d/CCFontAtlas.cpp index ca43b5a7a8..a0cf4c2070 100644 --- a/cocos/2d/CCFontAtlas.cpp +++ b/cocos/2d/CCFontAtlas.cpp @@ -35,7 +35,7 @@ NS_CC_BEGIN const int FontAtlas::CacheTextureWidth = 1024; const int FontAtlas::CacheTextureHeight = 1024; -const char* FontAtlas::EVENT_PURGE_TEXTURES = "FontAtlasPurgeTextures"; +const char* FontAtlas::EVENT_PURGE_TEXTURES = "__cc_FontAtlasPurgeTextures"; FontAtlas::FontAtlas(Font &theFont) : _font(&theFont) diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index cd23788f4c..448dc2c0b1 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -1036,13 +1036,7 @@ void Label::setFontName(const std::string& fontName) const std::string& Label::getFontName() const { - switch (_currentLabelType) - { - case LabelType::TTF: - return _fontConfig.fontFilePath; - default: - return _fontDefinition._fontName; - } + return _fontName; } void Label::setFontSize(int fontSize) @@ -1056,15 +1050,7 @@ void Label::setFontSize(int fontSize) int Label::getFontSize() const { - switch (_currentLabelType) - { - case LabelType::TTF: - return _fontConfig.fontSize; - case LabelType::STRING_TEXTURE: - return _fontDefinition._fontSize; - default: - return 0; - } + return _fontSize; } ///// PROTOCOL STUFF