From: Holger Schemel Date: Mon, 20 Oct 2014 21:18:43 +0000 (+0200) Subject: fixed using buttons on main screen with size other than 32x32 pixels X-Git-Tag: 4.0.0.0-rc1~326 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=dbe473b63ac67dabfb47c82e104f2b8f33ca2d51;p=rocksndiamonds.git fixed using buttons on main screen with size other than 32x32 pixels --- diff --git a/ChangeLog b/ChangeLog index f50d0154..35d438e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2014-10-20 + * fixed using buttons on main screen with size other than 32x32 pixels + 2014-10-17 * removed some remaining unused X11 stuff * fixed bug with potentially suppressed exit error message on startup diff --git a/src/conftime.h b/src/conftime.h index ed346741..a8916dbc 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2014-10-18 00:15" +#define COMPILE_DATE_STRING "2014-10-20 23:13" diff --git a/src/screens.c b/src/screens.c index 0bd9af84..ae35cda2 100644 --- a/src/screens.c +++ b/src/screens.c @@ -972,18 +972,19 @@ static void InitializeMainControls() /* calculate size for non-clickable text -- needed for text alignment */ boolean calculate_text_size = (pos_button == NULL && text != NULL); + if (pos_text->width == -1 || calculate_text_size) + pos_text->width = text_width; + if (pos_text->height == -1 || calculate_text_size) + pos_text->height = text_height; + if (visibleMenuPos(pos_button)) { if (pos_text->x == -1) pos_text->x = pos_button->x + pos_button->width; if (pos_text->y == -1) - pos_text->y = pos_button->y; + pos_text->y = + pos_button->y + (pos_button->height - pos_text->height) / 2; } - - if (pos_text->width == -1 || calculate_text_size) - pos_text->width = text_width; - if (pos_text->height == -1 || calculate_text_size) - pos_text->height = text_height; } if (pos_input != NULL) /* (x/y may be -1/-1 here) */ diff --git a/src/tools.c b/src/tools.c index e2ce4712..a0423872 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1253,12 +1253,14 @@ void DrawGraphicThruMaskExt(DrawBuffer *d, int dst_x, int dst_y, int graphic, void DrawFixedGraphicThruMaskExt(DrawBuffer *d, int dst_x, int dst_y, int graphic, int frame) { + struct GraphicInfo *g = &graphic_info[graphic]; Bitmap *src_bitmap; int src_x, src_y; getFixedGraphicSource(graphic, frame, &src_bitmap, &src_x, &src_y); - BlitBitmapMasked(src_bitmap, d, src_x, src_y, TILEX, TILEY, dst_x, dst_y); + BlitBitmapMasked(src_bitmap, d, src_x, src_y, g->width, g->height, + dst_x, dst_y); } void DrawSizedGraphic(int x, int y, int graphic, int frame, int tilesize)