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);
}
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; i<surface->clut.colors; i++)
}
delete [] lookup;
-#endif
}
static inline int sgn(int a)
ttd+=td;
if (ttd>=difference)
continue;
+ if (!ttd)
+ return t;
difference=ttd;
best_choice=t;
}