From: Holger Schemel Date: Sun, 5 Jan 2003 20:53:32 +0000 (+0100) Subject: rnd-20030105-2-src X-Git-Tag: 3.0.0^2~189 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=a68dfca84d72a259068484eae45f2ff78b405f94;p=rocksndiamonds.git rnd-20030105-2-src --- diff --git a/src/conftime.h b/src/conftime.h index 73fc3a53..da59e80b 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-01-05 20:26]" +#define COMPILE_DATE_STRING "[2003-01-05 21:26]" diff --git a/src/screens.c b/src/screens.c index e9969781..67b8bd23 100644 --- a/src/screens.c +++ b/src/screens.c @@ -71,6 +71,8 @@ static void HandleChooseTree(int, int, int, int, int, TreeInfo **); static struct GadgetInfo *screen_gadget[NUM_SCREEN_GADGETS]; static int setup_mode = SETUP_MODE_MAIN; +static Bitmap *scrollbar_bitmap[4]; + static void drawCursorExt(int xpos, int ypos, int color, int graphic) { static int cursor_array[SCR_FIELDY]; @@ -2827,7 +2829,11 @@ static struct static struct { +#if 0 int gfx_unpressed, gfx_pressed; +#else + Bitmap **gfx_unpressed, **gfx_pressed; +#endif int x, y; int width, height; int type; @@ -2836,7 +2842,11 @@ static struct } scrollbar_info[NUM_SCREEN_SCROLLBARS] = { { +#if 0 IMG_SCROLLBAR_BLUE, IMG_SCROLLBAR_RED, +#else + &scrollbar_bitmap[0], &scrollbar_bitmap[1], +#endif SX + SC_SCROLL_VERTICAL_XPOS, SY + SC_SCROLL_VERTICAL_YPOS, SC_SCROLL_VERTICAL_XSIZE, SC_SCROLL_VERTICAL_YSIZE, GD_TYPE_SCROLLBAR_VERTICAL, @@ -2907,7 +2917,9 @@ static void CreateScreenScrollbars() for (i=0; iclip_mask = + new_graphic_info[IMG_SCROLLBAR_BLUE + i].clip_mask; + scrollbar_bitmap[i]->stored_clip_gc = + new_graphic_info[IMG_SCROLLBAR_BLUE + i].clip_gc; +#endif + + BlitBitmap(new_graphic_info[IMG_SCROLLBAR_BLUE + i].bitmap, + scrollbar_bitmap[i], + new_graphic_info[IMG_SCROLLBAR_BLUE + i].src_x, + new_graphic_info[IMG_SCROLLBAR_BLUE + i].src_y, + TILEX, TILEY, 0, 0); + +#ifdef TARGET_SDL + SDL_SetColorKey(scrollbar_bitmap[i]->surface, SDL_SRCCOLORKEY, + SDL_MapRGB(scrollbar_bitmap[i]->surface->format, + 0x00, 0x00, 0x00)); + if ((scrollbar_bitmap[i]->surface_masked = + SDL_DisplayFormat(scrollbar_bitmap[i]->surface)) == NULL) + { + SetError("SDL_DisplayFormat(): %s", SDL_GetError()); + Error(ERR_EXIT, "CreateScreenGadgets() failed: %s", GetError()); + } + SDL_SetColorKey(scrollbar_bitmap[i]->surface, 0, 0); +#endif + } + CreateScreenScrollbuttons(); CreateScreenScrollbars(); } @@ -2966,6 +3021,17 @@ void FreeScreenGadgets() { int i; + for (i=0; i<4; i++) + { +#if defined(TARGET_X11_NATIVE) + /* prevent freeing clip mask and GC twice */ + scrollbar_bitmap[i]->clip_mask = None; + scrollbar_bitmap[i]->stored_clip_gc = None; +#endif + + FreeBitmap(scrollbar_bitmap[i]); + } + for (i=0; i