Skip to content

Commit

Permalink
Texture: Fix constness of pixels
Browse files Browse the repository at this point in the history
  • Loading branch information
popcornmix committed Mar 29, 2017
1 parent 2d0e6b5 commit c5f2582
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions xbmc/guilib/Texture.cpp
Expand Up @@ -267,7 +267,7 @@ bool CBaseTexture::LoadFromFileInternal(const std::string& texturePath, unsigned
return false;

return LoadFromMemory(xbtFile.GetImageWidth(), xbtFile.GetImageHeight(), 0, xbtFile.GetImageFormat(),
xbtFile.HasImageAlpha(), reinterpret_cast<unsigned char*>(buf.get()));
xbtFile.HasImageAlpha(), reinterpret_cast<const unsigned char*>(buf.get()));
}

IImage* pImage;
Expand Down Expand Up @@ -330,7 +330,7 @@ bool CBaseTexture::LoadIImage(IImage *pImage, unsigned char* buffer, unsigned in
return false;
}

bool CBaseTexture::LoadFromMemory(unsigned int width, unsigned int height, unsigned int pitch, unsigned int format, bool hasAlpha, unsigned char* pixels)
bool CBaseTexture::LoadFromMemory(unsigned int width, unsigned int height, unsigned int pitch, unsigned int format, bool hasAlpha, const unsigned char* pixels)
{
m_imageWidth = m_originalWidth = width;
m_imageHeight = m_originalHeight = height;
Expand Down
2 changes: 1 addition & 1 deletion xbmc/guilib/Texture.h
Expand Up @@ -73,7 +73,7 @@ class CBaseTexture
static CBaseTexture *LoadFromFileInMemory(unsigned char* buffer, size_t bufferSize, const std::string& mimeType,
unsigned int idealWidth = 0, unsigned int idealHeight = 0);

bool LoadFromMemory(unsigned int width, unsigned int height, unsigned int pitch, unsigned int format, bool hasAlpha, unsigned char* pixels);
bool LoadFromMemory(unsigned int width, unsigned int height, unsigned int pitch, unsigned int format, bool hasAlpha, const unsigned char* pixels);
bool LoadPaletted(unsigned int width, unsigned int height, unsigned int pitch, unsigned int format, const unsigned char *pixels, const COLOR *palette);

bool HasAlpha() const;
Expand Down

0 comments on commit c5f2582

Please sign in to comment.