Permalink
Browse files

[rbp] changed texture loading assign original size after we sucessful…

…l decoded and allocated the picture.
  • Loading branch information...
1 parent f3d9b77 commit 30fe95928d3cc9bfbe5d1f8280f621d6d92b2e94 @huceke committed Aug 16, 2012
Showing with 7 additions and 7 deletions.
  1. +7 −7 xbmc/guilib/Texture.cpp
View
@@ -247,13 +247,6 @@ bool CBaseTexture::LoadFromFile(const CStdString& texturePath, unsigned int maxW
// TODO: we only decode as half width and height. this is a workaround for the PI memory limitation
if(omx_image.Decode(omx_image.GetWidth() / 2, omx_image.GetHeight() / 2))
{
- if (originalWidth)
- *originalWidth = omx_image.GetOriginalWidth();
- if (originalHeight)
- *originalHeight = omx_image.GetOriginalHeight();
-
- m_hasAlpha = omx_image.IsAlpha();
-
Allocate(omx_image.GetDecodedWidth(), omx_image.GetDecodedHeight(), XB_FMT_A8R8G8B8);
if(!m_pixels)
@@ -263,6 +256,13 @@ bool CBaseTexture::LoadFromFile(const CStdString& texturePath, unsigned int maxW
return false;
}
+ if (originalWidth)
+ *originalWidth = omx_image.GetOriginalWidth();
+ if (originalHeight)
+ *originalHeight = omx_image.GetOriginalHeight();
+
+ m_hasAlpha = omx_image.IsAlpha();
+
if (autoRotate && omx_image.GetOrientation())
m_orientation = omx_image.GetOrientation() - 1;

0 comments on commit 30fe959

Please sign in to comment.