From 3066991c061dab5224279ab4df988c8f9317f216 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 26 Mar 2002 13:41:46 +0000 Subject: removed unused code git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21 a1c6a512-1295-4272-9138-f99709370657 --- uisimulator/alpha.c | 78 ----------------------------------------------------- 1 file changed, 78 deletions(-) (limited to 'uisimulator/alpha.c') diff --git a/uisimulator/alpha.c b/uisimulator/alpha.c index 22504fcd93..39abd33251 100644 --- a/uisimulator/alpha.c +++ b/uisimulator/alpha.c @@ -135,81 +135,3 @@ initialize_transparency_colormap (Display *dpy, Colormap cmap, XFree ((XPointer) all_colors); } - -Bool -allocate_alpha_colors (Screen *screen, Visual *visual, Colormap cmap, - int *nplanesP, Bool additive_p, - unsigned long **plane_masks, - unsigned long *base_pixelP) -{ - Display *dpy = DisplayOfScreen (screen); - XColor *colors; - int nplanes = *nplanesP; - int i; - - if (!has_writable_cells (screen, visual)) - cmap = 0; - - if (!cmap) /* A TrueColor visual, or similar. */ - { - int depth = visual_depth (screen, visual); - unsigned long masks; - XVisualInfo vi_in, *vi_out; - - /* Find out which bits the R, G, and B components actually occupy - on this visual. */ - vi_in.screen = screen_number (screen); - vi_in.visualid = XVisualIDFromVisual (visual); - vi_out = XGetVisualInfo (dpy, VisualScreenMask|VisualIDMask, - &vi_in, &i); - if (! vi_out) abort (); - masks = vi_out[0].red_mask | vi_out[0].green_mask | vi_out[0].blue_mask; - XFree ((char *) vi_out); - - if (nplanes > depth) - nplanes = depth; - *nplanesP = nplanes; - *base_pixelP = 0; - *plane_masks = (unsigned long *) calloc(sizeof(unsigned long), nplanes); - - /* Pick the planar values randomly, but constrain them to fall within - the bit positions of the R, G, and B fields. */ - for (i = 0; i < nplanes; i++) - (*plane_masks)[i] = random() & masks; - - } - else /* A PseudoColor visual, or similar. */ - { - if (nplanes > 31) nplanes = 31; - *plane_masks = (unsigned long *) malloc(sizeof(unsigned long) * nplanes); - - nplanes = allocate_color_planes (dpy, cmap, nplanes, *plane_masks, - base_pixelP); - *nplanesP = nplanes; - - if (nplanes <= 1) - { - free(*plane_masks); - *plane_masks = 0; - return False; - } - - colors = (XColor *) calloc (nplanes, sizeof (XColor)); - for (i = 0; i < nplanes; i++) - { - /* pick the base colors. If we are in subtractive mode, pick higher - intensities. */ - hsv_to_rgb (random () % 360, - frand (1.0), - frand (0.5) + (additive_p ? 0.2 : 0.5), - &colors[i].red, - &colors[i].green, - &colors[i].blue); - } - initialize_transparency_colormap (dpy, cmap, nplanes, - *base_pixelP, *plane_masks, colors, - additive_p); - XFree ((XPointer) colors); - } - return True; -} -- cgit v1.2.3