From c494123996d026223362ec5d28e23693ce981981 Mon Sep 17 00:00:00 2001 From: rsn8887 Date: Sat, 30 Dec 2017 15:17:38 -0600 Subject: 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 --- backends/platform/psp/png_loader.cpp | 4 ++-- 1 file 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; } -- cgit v1.2.3