#pragma once #include "drape/texture.hpp" #include #include #include namespace dp { class SymbolsTexture : public Texture { public: class SymbolKey : public Key { public: explicit SymbolKey(std::string const & symbolName); ResourceType GetType() const override; std::string const & GetSymbolName() const; private: std::string m_symbolName; }; class SymbolInfo : public ResourceInfo { public: explicit SymbolInfo(m2::RectF const & texRect); ResourceType GetType() const override; }; SymbolsTexture(ref_ptr context, std::string const & skinPathName, std::string const & textureName, ref_ptr allocator); ref_ptr FindResource(Key const & key, bool & newResource) override; void Invalidate(ref_ptr context, std::string const & skinPathName, ref_ptr allocator); bool IsSymbolContained(std::string const & symbolName) const; static bool DecodeToMemory(std::string const & skinPathName, std::string const & textureName, std::vector & symbolsSkin, std::map & symbolsIndex, uint32_t & skinWidth, uint32_t & skinHeight); private: void Fail(ref_ptr context); void Load(ref_ptr context, std::string const & skinPathName, ref_ptr allocator); using TSymDefinition = std::map; std::string m_name; mutable TSymDefinition m_definition; }; } // namespace dp