fix bmfont atlas cache strategy

This commit is contained in:
zilongshanren
2017-07-25 16:40:24 +08:00
parent 30ae97336b
commit 11a2e68a52
+2 -6
View File
@@ -94,10 +94,8 @@ FontAtlas* FontAtlasCache::getFontAtlasFNT(const std::string& fntDataString,
SpriteFrame* spriteFrame,
const Vec2& imageOffset /* = Vec2::ZERO */)
{
auto realFontFilename = spriteFrame->getTexture()->getPath();
char tmp[ATLAS_MAP_KEY_BUFFER];
snprintf(tmp, ATLAS_MAP_KEY_BUFFER, "%.2f %.2f %s %p", imageOffset.x, imageOffset.y, realFontFilename.c_str(), spriteFrame);
snprintf(tmp, ATLAS_MAP_KEY_BUFFER, "%.2f %.2f %p", imageOffset.x, imageOffset.y, spriteFrame);
std::string atlasName = tmp;
auto it = _atlasMap.find(atlasName);
@@ -239,10 +237,8 @@ void FontAtlasCache::reloadFontAtlasFNT(const std::string& fntDataString,
SpriteFrame* spriteFrame,
const Vec2& imageOffset/* = Vec2::ZERO*/)
{
auto realFontFilename = spriteFrame->getTexture()->getPath();
char tmp[ATLAS_MAP_KEY_BUFFER];
snprintf(tmp, ATLAS_MAP_KEY_BUFFER, "%.2f %.2f %s", imageOffset.x, imageOffset.y, realFontFilename.c_str());
snprintf(tmp, ATLAS_MAP_KEY_BUFFER, "%.2f %.2f %p", imageOffset.x, imageOffset.y, spriteFrame);
std::string atlasName = tmp;
auto it = _atlasMap.find(atlasName);