Permalink
Browse files

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
  • Loading branch information...
rsn8887 authored and sev- committed Dec 30, 2017
1 parent ce1868a commit c494123996d026223362ec5d28e23693ce981981
Showing with 2 additions and 2 deletions.
  1. +2 −2 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;
}

0 comments on commit c494123

Please sign in to comment.