rnd-20030825-1-src
[rocksndiamonds.git] / src / tools.c
index 744065cd5923675762f020124912bc5a78a6dd8e..9d48e4b3ba1e7f6ee8a1747dd8cea42f56494645 100644 (file)
@@ -599,6 +599,10 @@ void DrawPlayer(struct PlayerInfo *player)
            player->is_moving ? ACTION_MOVING :
            player->snapped ? ACTION_SNAPPING : ACTION_DEFAULT);
 
+#if 0
+  printf("::: '%s'\n", element_action_info[action].suffix);
+#endif
+
   InitPlayerGfxAnimation(player, action, move_dir);
 
   /* ----------------------------------------------------------------------- */
@@ -1634,8 +1638,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);
@@ -1671,8 +1674,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);
@@ -1883,6 +1886,8 @@ boolean Request(char *text, unsigned int req_state)
 
   SetDrawBackgroundMask(REDRAW_FIELD | REDRAW_DOOR_1);
 
+  SetMouseCursor(CURSOR_DEFAULT);
+
   while(result < 0)
   {
     if (PendingEvent())