X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/add95ac3784725e1870429ce6763b4548335cda2..1be06faf7318abf88a35b299b90ceb2a49c0353b:/src/common/imagpcx.cpp?ds=sidebyside diff --git a/src/common/imagpcx.cpp b/src/common/imagpcx.cpp index 0f1db27714..348dd9f8f9 100644 --- a/src/common/imagpcx.cpp +++ b/src/common/imagpcx.cpp @@ -276,6 +276,18 @@ int ReadPCX(wxImage *image, wxInputStream& stream) *(p++) = pal[3 * index + 1]; *(p++) = pal[3 * index + 2]; } + + unsigned char* r = new unsigned char[256]; + unsigned char* g = new unsigned char[256]; + unsigned char* b = new unsigned char[256]; + for (i = 0; i < 256; i++) + { + r[i] = pal[3*i + 0]; + g[i] = pal[3*i + 1]; + b[i] = pal[3*i + 2]; + } + image->SetPalette(wxPalette(256, r, g, b)); + delete[] r; delete[] g; delete[] b; } return wxPCX_OK;