mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
fix bmfont atlas cache strategy
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user