X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/44433f650cd3e5f9f66253b74d194fcb01578595..a072a06516d83d3a11c52544bf2f7cb8ab567b4e:/lib/gdi/gpixmap.cpp diff --git a/lib/gdi/gpixmap.cpp b/lib/gdi/gpixmap.cpp index e9c469c4..f0f04d69 100644 --- a/lib/gdi/gpixmap.cpp +++ b/lib/gdi/gpixmap.cpp @@ -74,15 +74,8 @@ gSurfaceSystem::gSurfaceSystem(eSize size, int _bpp) bypp=(bpp+7)/8; } stride=x*bypp; - if (bpp==8) - { - clut.colors=256; - clut.data=new gRGB[clut.colors]; - } else - { - clut.colors=0; - clut.data=0; - } + clut.colors=0; + clut.data=0; data=malloc(x*y*bypp); } @@ -231,10 +224,9 @@ void gPixmap::blit(const gPixmap &src, ePoint pos, const gRegion &clip, int flag void gPixmap::mergePalette(const gPixmap &target) { - eDebug("merge palette! %p %p", surface, target.surface); if ((!surface->clut.colors) || (!target.surface->clut.colors)) return; -#if 0 + gColor *lookup=new gColor[surface->clut.colors]; for (int i=0; iclut.colors; i++) @@ -255,7 +247,6 @@ void gPixmap::mergePalette(const gPixmap &target) } delete [] lookup; -#endif } static inline int sgn(int a) @@ -388,6 +379,8 @@ gColor gPalette::findColor(const gRGB &rgb) const ttd+=td; if (ttd>=difference) continue; + if (!ttd) + return t; difference=ttd; best_choice=t; }