Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix DDS texture generation after cc5ed3c

  • Loading branch information...
commit 33471ba599a4f7750e8bee00ae0b5ecf54e8b3cc 1 parent 36ab6a4
Jonathan Marshall authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 xbmc/TextureCacheJob.cpp
8 xbmc/TextureCacheJob.cpp
View
@@ -242,14 +242,16 @@ bool CTextureDDSJob::operator==(const CJob* job) const
bool CTextureDDSJob::DoWork()
{
- CTexture texture;
if (URIUtils::GetExtension(m_original).Equals(".dds"))
return false;
- if (texture.LoadFromFile(m_original))
+ 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());
- return dds.Create(URIUtils::ReplaceExtension(m_original, ".dds"), texture.GetWidth(), texture.GetHeight(), texture.GetPitch(), texture.GetPixels(), 40);
+ bool ret = dds.Create(URIUtils::ReplaceExtension(m_original, ".dds"), texture->GetWidth(), texture->GetHeight(), texture->GetPitch(), texture->GetPixels(), 40);
+ delete texture;
+ return ret;
}
return false;
}
Please sign in to comment.
Something went wrong with that request. Please try again.