| 123 | // Load texture data from binary asset content, and place it on the GPU |
| 124 | // |
| 125 | bool FontAsset::LoadFromMemory(std::vector<uint8> const& data) |
| 126 | { |
| 127 | // temp |
| 128 | std::vector<uint8> binaryContent = data; |
| 129 | std::string extension = core::FileUtil::ExtractExtension(GetName()); |
| 130 | |
| 131 | if (extension == "ttf") |
| 132 | { |
| 133 | m_Data = LoadTtf(binaryContent); |
| 134 | } |
| 135 | else if (extension == "fnt") |
| 136 | { |
| 137 | m_Data = LoadFnt(binaryContent); |
| 138 | } |
| 139 | else |
| 140 | { |
| 141 | LOG("FontAsset::LoadFromMemory > Cannot load audio data with this extension! Supported exensions: [.ttf/.fnt]", core::LogLevel::Warning); |
| 142 | return false; |
| 143 | } |
| 144 | |
| 145 | if (m_Data == nullptr) |
| 146 | { |
| 147 | LOG("FontAsset::LoadFromMemory > Loading font failed!", core::LogLevel::Warning); |
| 148 | return false; |
| 149 | } |
| 150 | |
| 151 | return true; |
| 152 | } |
| 153 | |
| 154 | //--------------------------------- |
| 155 | // TextureAsset::LoadTtf |
nothing calls this directly
no outgoing calls
no test coverage detected