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 ccawley2011 committed Dec 30, 2017
1 parent 3239ea8 commit ec4d7e30de1cc965572c108cb526cc697486f274
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 ec4d7e3

Please sign in to comment.