From: Holger Schemel Date: Sat, 7 Jun 2003 01:47:47 +0000 (+0200) Subject: rnd-20030607-2-src X-Git-Tag: 3.0.0^2~56 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=213773d641290a743d56c17165d0bafec72cc0aa;p=rocksndiamonds.git rnd-20030607-2-src --- diff --git a/src/conftime.h b/src/conftime.h index 071efa6c..9caa92bb 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-06-07 01:19]" +#define COMPILE_DATE_STRING "[2003-06-07 03:28]" diff --git a/src/editor.c b/src/editor.c index 778232e2..2f64e92c 100644 --- a/src/editor.c +++ b/src/editor.c @@ -4402,6 +4402,51 @@ static void DrawPropertiesAdvanced() DrawCustomChangedArea(); } +static void DrawElementName(int x, int y, int element) +{ + char *element_name = getElementInfoText(element); + int font_nr = FONT_TEXT_1; + int font_width = getFontWidth(font_nr); + int font_height = getFontHeight(font_nr); + int max_text_width = SXSIZE - x - ED_SETTINGS_XPOS(0); + int max_chars_per_line = max_text_width / font_width; + char buffer[max_chars_per_line + 1]; + + if (strlen(element_name) <= max_chars_per_line) + DrawTextF(x, y, font_nr, element_name); + else + { + int next_pos = max_chars_per_line; + + strncpy(buffer, element_name, max_chars_per_line); + buffer[max_chars_per_line] = '\0'; + + if (element_name[max_chars_per_line] == ' ') + next_pos++; + else + { + int i; + + for (i = max_chars_per_line - 1; i >= 0; i--) + if (buffer[i] == ' ') + break; + + if (strlen(&element_name[i + 1]) <= max_chars_per_line) + { + buffer[i] = '\0'; + next_pos = i + 1; + } + } + + DrawTextF(x, y - font_height / 2, font_nr, buffer); + + strncpy(buffer, &element_name[next_pos], max_chars_per_line); + buffer[max_chars_per_line] = '\0'; + + DrawTextF(x, y + font_height / 2, font_nr, buffer); + } +} + static void DrawPropertiesWindow() { int xstart = 2; @@ -4441,8 +4486,8 @@ static void DrawPropertiesWindow() FrameCounter = 0; /* restart animation frame counter */ - DrawTextF((xstart + 3) * MINI_TILEX, (ystart + 1) * MINI_TILEY, - FONT_TEXT_1, getElementInfoText(properties_element)); + DrawElementName((xstart + 3) * MINI_TILEX, (ystart + 1) * MINI_TILEY, + properties_element); DrawPropertiesTabulatorGadgets(); diff --git a/src/game.c b/src/game.c index 948d46bb..7af0d617 100644 --- a/src/game.c +++ b/src/game.c @@ -2363,7 +2363,7 @@ void Impact(int x, int y) if (object_hit && IS_PLAYER(x, y+1)) KillHeroUnlessProtected(x, y+1); else if (object_hit && smashed == EL_PENGUIN) - Bang(x, y+1); + Bang(x, y + 1); else { Feld[x][y] = EL_AMOEBA_GROWING; diff --git a/src/screens.c b/src/screens.c index 1012b6ed..91ec3550 100644 --- a/src/screens.c +++ b/src/screens.c @@ -888,10 +888,17 @@ void DrawHelpScreenElAction(int start) } j++; +#if 1 + ClearRectangleOnBackground(drawto, xstart, ystart + (i - start) * ystep, + TILEX, TILEY); + DrawGraphicAnimationExt(drawto, xstart, ystart + (i - start) * ystep, + graphic, sync_frame, USE_MASKING); +#else frame = getGraphicAnimationFrame(graphic, sync_frame); DrawGraphicExt(drawto, xstart, ystart + (i-start) * ystep, graphic, frame); +#endif i++; }