Merge pull request #7556 from Dhilan007/v3

fixed FontAtlasCache::getFontAtlasCharMap may returns the same instance when using different arguments.
This commit is contained in:
minggo 2014-07-23 11:29:26 +08:00
commit 3662077025
1 changed files with 4 additions and 1 deletions

View File

@ -178,7 +178,10 @@ FontAtlas * FontAtlasCache::getFontAtlasCharMap(Texture2D* texture, int itemWidt
FontAtlas * FontAtlasCache::getFontAtlasCharMap(const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap)
{
std::string atlasName = generateFontName(charMapFile, 0, GlyphCollection::CUSTOM,false);
char tmp[255];
snprintf(tmp,250,"name:%s_%d_%d_%d",charMapFile.c_str(),itemWidth,itemHeight,startCharMap);
std::string atlasName = generateFontName(tmp, 0, GlyphCollection::CUSTOM,false);
auto it = _atlasMap.find(atlasName);
if ( it == _atlasMap.end() )