fixed resetting alpha value when preparing envelope request
[rocksndiamonds.git] / src / tools.c
index e56516a016ef5cd04e40b08d3a55ae966e9fc968..9a82f34625db6adc01bf345b869bf18514d1ffe8 100644 (file)
@@ -3056,6 +3056,8 @@ static void PrepareEnvelopeRequestToScreen(Bitmap *bitmap, int sx, int sy,
   SDLFreeBitmapTextures(request.bitmap);
   SDLCreateBitmapTextures(request.bitmap);
 
+  ResetBitmapAlpha(request.bitmap);
+
   // set envelope request run-time values
   request.sx = sx;
   request.sy = sy;
@@ -3176,6 +3178,13 @@ static void DrawEnvelopeRequestText(int sx, int sy, char *text)
   {
     char *src_text_ptr, *dst_text_ptr;
 
+    if (maxWordLengthInRequestString(text) > line_length)
+    {
+      font_nr = FONT_REQUEST_NARROW;
+      font_width = getFontWidth(font_nr);
+      line_length = max_text_width  / font_width;
+    }
+
     text_door_style = checked_malloc(2 * strlen(text) + 1);
 
     src_text_ptr = text;