X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=45d37436a325dec9840a38644e2fba606f3d4208;hb=62348584aaa84b398942cea019d772048a6b6f13;hp=d37a7b0e991b821c3979602a3689758ccdf3504d;hpb=ddaae9de458b7f07b05461101655a1da4c63b380;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index d37a7b0e..45d37436 100644 --- a/src/tools.c +++ b/src/tools.c @@ -666,14 +666,13 @@ void DrawPlayer(struct PlayerInfo *player) if (player_is_moving && GfxElement[jx][jy] != EL_UNDEFINED) { #if 1 - /* !!! insert DrawLevelFieldCrumbledSandDigging code here !!! */ - if (player->is_digging && CAN_BE_CRUMBLED(GfxElement[jx][jy])) + if (CAN_BE_CRUMBLED(GfxElement[jx][jy])) DrawLevelFieldCrumbledSandDigging(jx, jy, move_dir, player->StepFrame); #else if (GfxElement[jx][jy] == EL_SAND) DrawLevelFieldCrumbledSandDigging(jx, jy, move_dir, player->StepFrame); #endif - else /* player->is_collecting */ + else { int old_element = GfxElement[jx][jy]; int old_graphic = el_act_dir2img(old_element, action, move_dir); @@ -1323,9 +1322,7 @@ void DrawLevelFieldCrumbledSandDigging(int x, int y, int direction, int sx = SCREENX(x), sy = SCREENY(y); DrawGraphic(sx, sy, graphic1, frame1); - - if (graphic1 != IMG_EMPTY_SPACE) - DrawLevelFieldCrumbledSandExt(x, y, graphic2, frame2); + DrawLevelFieldCrumbledSandExt(x, y, graphic2, frame2); } void DrawLevelFieldCrumbledSandNeighbours(int x, int y) @@ -1637,8 +1634,7 @@ static void DrawMicroLevelLabelExt(int mode) if (strlen(label_text) > 0) { - int text_width = strlen(label_text) * getFontWidth(font_nr); - int lxpos = SX + (SXSIZE - text_width) / 2; + int lxpos = SX + (SXSIZE - getTextWidth(label_text, font_nr)) / 2; int lypos = MICROLABEL_YPOS; DrawText(lxpos, lypos, label_text, font_nr); @@ -1674,8 +1670,8 @@ void DrawMicroLevel(int xpos, int ypos, boolean restart) if (leveldir_current->name) { - int len = strlen(leveldir_current->name); - int lxpos = SX + (SXSIZE - len * getFontWidth(FONT_TEXT_1)) / 2; + int text_width = getTextWidth(leveldir_current->name, FONT_TEXT_1); + int lxpos = SX + (SXSIZE - text_width) / 2; int lypos = SY + 352; DrawText(lxpos, lypos, leveldir_current->name, FONT_TEXT_1); @@ -1886,6 +1882,8 @@ boolean Request(char *text, unsigned int req_state) SetDrawBackgroundMask(REDRAW_FIELD | REDRAW_DOOR_1); + SetMouseCursor(CURSOR_DEFAULT); + while(result < 0) { if (PendingEvent())