diff options
-rw-r--r-- | xbmc/lib/libsquish/squish.cpp | 7 | ||||
-rw-r--r-- | xbmc/lib/libsquish/squish.h | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/xbmc/lib/libsquish/squish.cpp b/xbmc/lib/libsquish/squish.cpp index c8dcbf2dfe..0d1a09fc78 100644 --- a/xbmc/lib/libsquish/squish.cpp +++ b/xbmc/lib/libsquish/squish.cpp @@ -196,6 +196,11 @@ void CompressImage( u8 const* rgba, int width, int height, int pitch, void* bloc void DecompressImage( u8* rgba, int width, int height, void const* blocks, int flags ) { + DecompressImage( rgba, width, height, width*4, blocks, flags ); +} + +void DecompressImage( u8* rgba, int width, int height, int pitch, void const* blocks, int flags ) +{ // fix any bad flags flags = FixFlags( flags ); @@ -223,7 +228,7 @@ void DecompressImage( u8* rgba, int width, int height, void const* blocks, int f int sy = y + py; if( sx < width && sy < height ) { - u8* targetPixel = rgba + 4*( width*sy + sx ); + u8* targetPixel = rgba + pitch*sy + 4*sx; // copy the rgba value CopyRGBA(sourcePixel, targetPixel, flags); diff --git a/xbmc/lib/libsquish/squish.h b/xbmc/lib/libsquish/squish.h index 07dff52dad..c68f5c548e 100644 --- a/xbmc/lib/libsquish/squish.h +++ b/xbmc/lib/libsquish/squish.h @@ -244,6 +244,7 @@ void CompressImage( u8 const* rgba, int width, int height, int pitch, void* bloc @param rgba Storage for the decompressed pixels. @param width The width of the source image. @param height The height of the source image. + @param pitch The pitch of the decompressed pixels. @param blocks The compressed DXT blocks. @param flags Compression flags. @@ -259,6 +260,7 @@ void CompressImage( u8 const* rgba, int width, int height, int pitch, void* bloc Internally this function calls squish::Decompress for each block. */ void DecompressImage( u8* rgba, int width, int height, void const* blocks, int flags ); +void DecompressImage( u8* rgba, int width, int height, int pitch, void const* blocks, int flags ); // ----------------------------------------------------------------------------- |