diff options
author | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2015-04-16 14:48:30 +0300 |
---|---|---|
committer | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2015-11-30 16:04:17 +0300 |
commit | 734b0a10b024dac63a26710522683fdb0209a0b5 (patch) | |
tree | 96554add69ea14b6d9e2ed13eb17fdeb3a763eb4 /drape/symbols_texture.cpp | |
parent | 4d6dcfc596953ef570d1d51f11416cdd5298999c (diff) |
Pointers refactoring
Diffstat (limited to 'drape/symbols_texture.cpp')
-rw-r--r-- | drape/symbols_texture.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drape/symbols_texture.cpp b/drape/symbols_texture.cpp index 4056400781..60ed4164d2 100644 --- a/drape/symbols_texture.cpp +++ b/drape/symbols_texture.cpp @@ -113,6 +113,11 @@ Texture::ResourceType SymbolsTexture::SymbolInfo::GetType() const return Symbol; } +SymbolsTexture::SymbolsTexture(string const & skinPathName) +{ + Load(skinPathName); +} + void SymbolsTexture::Load(string const & skinPathName) { vector<unsigned char> rawData; @@ -154,31 +159,31 @@ void SymbolsTexture::Load(string const & skinPathName) unsigned char * data = stbi_png_load_from_memory(&rawData[0], rawData.size(), &w, &h, &bpp, 0); if (width == w && height == h) - Create(width, height, RGBA8, MakeStackRefPointer<void>(data)); + Create(width, height, RGBA8, make_ref<void>(data)); else Fail(); stbi_image_free(data); } -RefPointer<Texture::ResourceInfo> SymbolsTexture::FindResource(Texture::Key const & key, bool & newResource) +ref_ptr<Texture::ResourceInfo> SymbolsTexture::FindResource(Texture::Key const & key, bool & newResource) { newResource = false; if (key.GetType() != Texture::Symbol) - return RefPointer<ResourceInfo>(); + return ref_ptr<ResourceInfo>(); string const & symbolName = static_cast<SymbolKey const &>(key).GetSymbolName(); TSymDefinition::iterator it = m_definition.find(symbolName); ASSERT(it != m_definition.end(), ()); - return MakeStackRefPointer<ResourceInfo>(&it->second); + return make_ref<ResourceInfo>(&it->second); } void SymbolsTexture::Fail() { m_definition.clear(); int32_t alfaTexture = 0; - Create(1, 1, RGBA8, MakeStackRefPointer(&alfaTexture)); + Create(1, 1, RGBA8, make_ref(&alfaTexture)); } } // namespace dp |