fixed drawing preferred network player in setup menu
authorHolger Schemel <info@artsoft.org>
Tue, 2 Oct 2018 13:04:31 +0000 (15:04 +0200)
committerHolger Schemel <info@artsoft.org>
Tue, 2 Oct 2018 13:04:31 +0000 (15:04 +0200)
src/screens.c

index 43198fa8a2d5138fdd78c631588cd19802985b79..14bcc409384931bee65b53b1973db4e37267cd61 100644 (file)
@@ -6596,10 +6596,17 @@ static void drawSetupValue(int screen_pos, int setup_info_pos_raw)
 
   if (type & TYPE_PLAYER)
   {
+    struct FontBitmapInfo *font = getFontBitmapInfo(font_nr);
     int player_nr = *(int *)value;
-    int xoff = getFontWidth(font_nr);
+    int xoff = font->draw_xoffset + getFontWidth(font_nr);
+    int yoff = font->draw_yoffset + (getFontHeight(font_nr) - TILEY) / 2;
+    int startx2 = startx + xoff;
+    int starty2 = starty + yoff;
 
-    DrawFixedGraphicThruMaskExt(drawto, startx + xoff, starty,
+    if (DrawingOnBackground(startx2, starty2))
+      ClearRectangleOnBackground(drawto, startx2, starty2, TILEX, TILEY);
+
+    DrawFixedGraphicThruMaskExt(drawto, startx2, starty2,
                                PLAYER_NR_GFX(IMG_PLAYER_1, player_nr), 0);
   }