Browse files

fix DDS texture generation after cc5ed3c

  • Loading branch information...
1 parent 36ab6a4 commit 33471ba599a4f7750e8bee00ae0b5ecf54e8b3cc Jonathan Marshall committed Jul 5, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 xbmc/TextureCacheJob.cpp
View
8 xbmc/TextureCacheJob.cpp
@@ -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;
}

0 comments on commit 33471ba

Please sign in to comment.