+ if(src.surface->clut.colors != 0)
+ {
+ for(int x=0;x<area.width();x++)
+ {
+ pixdata = src.surface->clut.data[*(srcptr+x)];
+ gray_value = ((pixdata.r+pixdata.g +pixdata.b)/3);
+ if(gray_max==gray_min)
+ *(nomptr+x)=gray_value;
+/* else if(y == 0 || y == area.height()-1 || x == 0 || x == area.width()-1)
+ *(nomptr+x) = 255;*/
+ else
+ *(nomptr+x)=( ((gray_value - gray_min)*255)/(gray_max-gray_min) );
+ // printf("%3d ",*(nomptr+x));
+ }
+ // printf("\n");
+ }
+ else