170 |
|
} else /* just clear */ |
171 |
|
XClear(gwind); |
172 |
|
/* reinitialize color table */ |
173 |
< |
if (ncolors == 0 && getpixels() == 0) |
173 |
> |
if (getpixels() == 0) |
174 |
|
stderr_v("cannot allocate colors\n"); |
175 |
|
else |
176 |
|
new_ctab(ncolors); |
285 |
|
{ |
286 |
|
int planes; |
287 |
|
|
288 |
< |
freepixels(); |
288 |
> |
if (ncolors > 0) |
289 |
> |
return(ncolors); |
290 |
|
for (ncolors=(1<<DisplayPlanes())-3; ncolors>12; ncolors=ncolors*.937){ |
291 |
|
pixval = (int *)malloc(ncolors*sizeof(int)); |
292 |
|
if (pixval == NULL) |
362 |
|
return; |
363 |
|
} |
364 |
|
/* remap colors */ |
365 |
< |
if (ncolors == 0 && getpixels() == 0) { |
365 |
> |
if (getpixels() == 0) { |
366 |
|
stderr_v("cannot allocate colors\n"); |
367 |
|
return; |
368 |
|
} |