bool CTextureDDSJob::DoWork() { CTexture texture; if (URIUtils::GetExtension(m_original).Equals(".dds")) return false; if (texture.LoadFromFile(m_original)) { // convert to DDS CDDSImage dds; CLog::Log(LOGDEBUG, "Creating DDS version of: %s", m_original.c_str()); return dds.Create(URIUtils::ReplaceExtension(m_original, ".dds"), texture.GetWidth(), texture.GetHeight(), texture.GetPitch(), texture.GetPixels(), 40); } return false; }
bool CTextureDDSJob::DoWork() { if (URIUtils::HasExtension(m_original, ".dds")) return false; CBaseTexture *texture = CBaseTexture::LoadFromFile(m_original); if (texture) { // convert to DDS CDDSImage dds; CLog::Log(LOGDEBUG, "Creating DDS version of: %s", m_original.c_str()); bool ret = dds.Create(URIUtils::ReplaceExtension(m_original, ".dds"), texture->GetWidth(), texture->GetHeight(), texture->GetPitch(), texture->GetPixels(), 40); delete texture; return ret; } return false; }