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); |
202 |
|
|
203 |
|
|
204 |
|
static |
205 |
< |
x_comin(inp) /* read in a command line */ |
206 |
< |
char *inp; |
205 |
> |
x_comin(inp, prompt) /* read in a command line */ |
206 |
> |
char *inp, *prompt; |
207 |
|
{ |
208 |
|
int x_getc(), x_comout(); |
209 |
|
|
210 |
< |
if (fromcombuf(inp, &x_driver)) |
211 |
< |
return; |
210 |
> |
if (prompt != NULL) |
211 |
> |
if (fromcombuf(inp, &x_driver)) |
212 |
> |
return; |
213 |
> |
else |
214 |
> |
xt_puts(prompt, comline); |
215 |
|
xt_cursor(comline, TBLKCURS); |
216 |
|
editline(inp, x_getc, x_comout); |
217 |
|
xt_cursor(comline, TNOCURS); |
288 |
|
{ |
289 |
|
int planes; |
290 |
|
|
291 |
< |
freepixels(); |
291 |
> |
if (ncolors > 0) |
292 |
> |
return(ncolors); |
293 |
|
for (ncolors=(1<<DisplayPlanes())-3; ncolors>12; ncolors=ncolors*.937){ |
294 |
|
pixval = (int *)malloc(ncolors*sizeof(int)); |
295 |
|
if (pixval == NULL) |
365 |
|
return; |
366 |
|
} |
367 |
|
/* remap colors */ |
368 |
< |
if (ncolors == 0 && getpixels() == 0) { |
368 |
> |
if (getpixels() == 0) { |
369 |
|
stderr_v("cannot allocate colors\n"); |
370 |
|
return; |
371 |
|
} |