Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[atlas] cleanups

  • Loading branch information...
commit c8e462746c05b556b7fbf40507222027ad5a86bf 1 parent eea31a0
huceke authored
View
4 xbmc/guilib/AtlasReader.cpp
@@ -157,10 +157,6 @@ CXBTFFile* CAtlasReader::Find(const CStdString& name)
CXBTFFile *file = &(iter->second);
CXBTFFrame& frame = file->GetFrames().at(0);
- CLog::Log(LOGDEBUG, "Loading Atlas image %s %d %d %d %d\n", name.c_str(),
- frame.GetTextureXOffset(), frame.GetTextureYOffset(),
- frame.GetWidth(), frame.GetHeight());
-
return &(iter->second);
}
View
13 xbmc/guilib/Texture.cpp
@@ -196,19 +196,19 @@ void CBaseTexture::ClampToEdge()
bool CBaseTexture::LoadFromAtlas(XBMC::TexturePtr texture, unsigned int width, unsigned int height,
unsigned int atlasWidth, unsigned int atlasHeight,
unsigned int texXOffset, unsigned int texYOffset, unsigned int format,
- bool hasAlpha, unsigned char* pixels)
+ bool hasAlpha, unsigned char* pixels, bool loadToGPU)
{
- if (pixels == NULL)
- return false;
-
m_format = format;
- //m_texture = texture;
+ m_texture = 0;
m_textureWidth = width;
m_textureHeight = height;
m_hasAlpha = hasAlpha;
Allocate(width, height, format);
+ if (pixels == NULL)
+ return false;
+
unsigned int srcPitch = GetPitch(atlasWidth);
unsigned int srcPitchX = GetPitch(texXOffset);
unsigned int srcRows = GetRows(atlasHeight);
@@ -225,10 +225,9 @@ bool CBaseTexture::LoadFromAtlas(XBMC::TexturePtr texture, unsigned int width, u
}
ClampToEdge();
- /*
if (loadToGPU)
LoadToGPU();
- */
+
return true;
}
View
2  xbmc/guilib/Texture.h
@@ -72,7 +72,7 @@ class CBaseTexture
bool LoadFromAtlas(XBMC::TexturePtr texture, unsigned int width, unsigned int height,
unsigned int atlasWidth, unsigned int atlasHeight,
unsigned int texXOffset, unsigned int texYOffset, unsigned int format,
- bool hasAlpha, unsigned char* pixels);
+ bool hasAlpha, unsigned char* pixels, bool loadToGPU);
bool LoadFromFile(const CStdString& texturePath, unsigned int maxHeight = 0, unsigned int maxWidth = 0,
bool autoRotate = false, unsigned int *originalWidth = NULL, unsigned int *originalHeight = NULL);
bool LoadFromMemory(unsigned int width, unsigned int height, unsigned int pitch, unsigned int format, bool hasAlpha, unsigned char* pixels);
View
2  xbmc/guilib/TextureBundle.cpp
@@ -39,7 +39,7 @@ bool CTextureBundle::HasFile(const CStdString& Filename)
{
return m_tbAtlas.HasFile(Filename);
}
- if (m_useXBT)
+ else if (m_useXBT)
{
return m_tbXBT.HasFile(Filename);
}
View
7 xbmc/guilib/TextureBundleAtlas.cpp
@@ -174,7 +174,6 @@ bool CTextureBundleAtlas::ConvertFrameToTexture(const CStdString &atlas, const C
if (pAtlas->LoadFromFile((const CStdString)strAtlas))
{
- //pAtlas->LoadToGPU();
m_atlasTexture[strAtlas] = pAtlas;
}
else
@@ -188,7 +187,11 @@ bool CTextureBundleAtlas::ConvertFrameToTexture(const CStdString &atlas, const C
(*ppTexture)->LoadFromAtlas(pAtlas->GetTextureObject(), frame.GetWidth(), frame.GetHeight(),
frame.GetAtlasWidth(), frame.GetAtlasHeight(),
frame.GetTextureXOffset(), frame.GetTextureYOffset(),
- pAtlas->GetFormat(), frame.HasAlpha(), pAtlas->GetPixels());
+ pAtlas->GetFormat(), frame.HasAlpha(), pAtlas->GetPixels(), true);
+
+ CLog::Log(LOGDEBUG, "Loading Atlas image %s %d %d %d %d\n", name.c_str(),
+ frame.GetTextureXOffset(), frame.GetTextureYOffset(),
+ frame.GetWidth(), frame.GetHeight());
return true;
}
Please sign in to comment.
Something went wrong with that request. Please try again.