aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/psp
diff options
context:
space:
mode:
authorrsn88872017-12-30 15:17:38 -0600
committerEugene Sandulenko2018-08-18 13:49:15 +0200
commitc494123996d026223362ec5d28e23693ce981981 (patch)
tree0036d5e026836f51ad6a843f4d687e0e6882ac53 /backends/platform/psp
parentce1868a28abea643e3b4fe7797ec4328d6b54091 (diff)
downloadscummvm-rg350-c494123996d026223362ec5d28e23693ce981981.tar.gz
scummvm-rg350-c494123996d026223362ec5d28e23693ce981981.tar.bz2
scummvm-rg350-c494123996d026223362ec5d28e23693ce981981.zip
PSP: Fix loading of 4-bit PNG images
This fixes the loading of vkbd images from kbd subfolder: kbd/keys_s_c4.png kbd/keys_s4.png kbd/nums_s4.png kbd/keys_c4.png kbd/syms_s4.png kbd/keys4.png kbd/nums4.png kbd/syms4.png
Diffstat (limited to 'backends/platform/psp')
-rw-r--r--backends/platform/psp/png_loader.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/backends/platform/psp/png_loader.cpp b/backends/platform/psp/png_loader.cpp
index 277546a413..91187ae4d8 100644
--- a/backends/platform/psp/png_loader.cpp
+++ b/backends/platform/psp/png_loader.cpp
@@ -44,7 +44,7 @@ PngLoader::Status PngLoader::allocate() {
_buffer->setSize(_width, _height, _sizeBy);
- uint32 bitsPerPixel = _bitDepth * _channels;
+ uint32 bitsPerPixel = _bitDepth;
if (_paletteSize) { // 8 or 4-bit image
if (bitsPerPixel == 4) {
@@ -87,7 +87,7 @@ bool PngLoader::load() {
PSP_DEBUG_PRINT("succeded in loading image\n");
- if (_paletteSize == 16) // 4-bit
+ if (_bitDepth == 4) // 4-bit
_buffer->flipNibbles(); // required because of PNG 4-bit format
return true;
}