Skip to content

Commit

Permalink
PSP: Fix loading of 4-bit PNG images
Browse files Browse the repository at this point in the history
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 Aug 18, 2018
1 parent ce1868a commit c494123
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backends/platform/psp/png_loader.cpp
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit c494123

Please sign in to comment.