static int gsrunning = 0; /* currently so many gs's are running */
static bool bitmap_waiting = false; /* bitmaps are waiting finished */
-static char bittable[256]; /* bit reversion table */
static bool gs_color; // do we allocate colors for gs?
static bool color_visual; // is the visual color?
static bool gs_xcolor = false; // allocated extended colors
static unsigned long gs_pixels[128]; // allocated pixels
-static int gs_num_pixels; // number of pixels allocated
static int gs_spc; // shades per color
-static bool gs_gray; // is grayscale?
static int gs_allcolors; // number of all colors
static list<int> pidwaitlist; // pid wait list
register XImage * im;
int i;
int y;
- int wid1;
int spc1 = gs_spc - 1;
int spc2 = gs_spc * gs_spc;
int wid = p->wid;
.colormap, cmap,
gs_allcolors);
XFlush(tmpdisp);
- wid1 = p->wid - 1;
// now we process all the image
for (y = 0; y < p->hgh; ++y) {
for (int x = 0; x < wid; ++x) {
if (num > 5) num = 5;
XColor xcol;
for (int i = 0; i < num * num * num; ++i) {
- xcol.red = 65535 * (i / (num * num)) / (num - 1);
- xcol.green = 65535 * ((i / num) % num) / (num - 1);
- xcol.blue = 65535 * (i % num) / (num - 1);
+ xcol.red = short(65535 * (i / (num * num)) / (num - 1));
+ xcol.green = short(65535 * ((i / num) % num) / (num - 1));
+ xcol.blue = short(65535 * (i % num) / (num - 1));
xcol.flags = DoRed | DoGreen | DoBlue;
if (!XAllocColor(fl_display,
fl_state[fl_get_vclass()].colormap, &xcol)) {
gs_pixels[i] = xcol.pixel;
}
gs_color = true;
- gs_gray = false;
gs_spc = num;
- gs_num_pixels = num * num * num;
}
gs_pixels[i] = xcol.pixel;
}
gs_color = true;
- gs_gray = false;
- gs_num_pixels = num;
}
k = 0;
for (unsigned int j = 0; j < 8; ++j)
if (i & (1 << (7-j))) k |= 1 << j;
- bittable[i] = char(~k);
}
// allocate color cube on pseudo-color display