#include "sdi.h" #include "sdi_color.h" init_colors(canvas) Xv_Window canvas; { Display *dpy = (Display *)xv_get(controlframe, XV_DISPLAY); if (DefaultDepth(dpy, DefaultScreen(dpy) ) < 2 ) { use_color = 0; num_colors = 2; color0 = 0; color1 = color2 = color3 = color4 = color5 = color6 = color7 = color8 = 1; } else { use_color = 1; num_colors = 9; color0 = 0; color1 = 1; color2 = 2; color3 = 3; color4 = 4; color5 = 5; color6 = 6; color7 = 7; color8 = 8; sdi_colormap = xv_create(NULL, CMS, CMS_SIZE, NUM_SDI_COLORS, CMS_NAMED_COLORS, "SkyBlue", /* 0 - SKY, BACKGROUND */ "LawnGreen", /* 1 - GRASS */ "OrangeRed", /* 2 - MISSILE_ACTIVE */ "Grey", /* 3 - MISSILE_TRACK */ "DimGrey", /* 4 - CITY_BASE */ "DarkSlateGrey", /* 5 - CITY_MELTED */ "DarkOrange", /* 6 - LASERKILL_COLOR */ "Brown", /* 7 - BROWN */ "Black", /* 8 - BLACK */ NULL, CMS_NAME, sdi_colormap_name, NULL); /* need two color maps because openlook won't let us change the background color, but it is very convenient for our canvases to have a blue background. */ sdi_panel_colormap = xv_create(NULL, CMS, CMS_CONTROL_CMS, TRUE, CMS_SIZE, 9+CMS_CONTROL_COLORS, CMS_NAMED_COLORS, "SkyBlue", /* 0 - SKY, BACKGROUND */ "LawnGreen", /* 1 - GRASS */ "OrangeRed", /* 2 - MISSILE_ACTIVE */ "Grey", /* 3 - MISSILE_TRACK */ "DimGrey", /* 4 - CITY_BASE */ "DarkSlateGrey", /* 5 - CITY_MELTED */ "DarkOrange", /* 6 - LASERKILL_COLOR */ "Brown", /* 7 - BROWN */ "Black", /* 8 - BLACK */ NULL, CMS_NAME, sdi_panel_colormap_name, NULL); } }