update gradle project, parallel for-loop based on std::thread on android, fix mipmaps on TextureManager

This commit is contained in:
2019-01-28 14:06:42 +01:00
parent 53fd2d60b5
commit a85918c8b0
8 changed files with 74 additions and 11 deletions

View File

@@ -9,13 +9,14 @@ std::map<uint16_t, Texture2D> TextureManager::m_textures;
bool TextureManager::load(const char* path, bool generate_mipmaps)
{
uint16_t id = const_hash(path);
if (m_textures.count(id) == 0 || !m_textures[id].ready())
auto t = m_textures.find(id);
if (t == m_textures.end() || !m_textures[id].ready())
{
if (!m_textures[id].load(path))
return false;
if (generate_mipmaps)
m_textures[id].create_mipmaps();
}
if (generate_mipmaps && !m_textures[id].has_mips)
m_textures[id].create_mipmaps();
return true;
}