+void DrawEnvelopeBackground(int dst_x, int dst_y, int ex, int ey, int font_nr)
+{
+#if 1
+ int font_width = getFontWidth(font_nr);
+ int font_height = getFontHeight(font_nr);
+ int graphic = IMG_GAME_ENVELOPE_BACKGROUND;
+ Bitmap *src_bitmap;
+ int src_x, src_y;
+#if 0
+ int dst_x = SX + sx * font_width;
+ int dst_y = SY + sy * font_height;
+#endif
+ int width = graphic_info[graphic].width;
+ int height = graphic_info[graphic].height;
+ boolean draw_masked = graphic_info[graphic].draw_masked;
+
+ getGraphicSource(graphic, 0, &src_bitmap, &src_x, &src_y);
+
+ if (src_bitmap == NULL)
+ {
+ ClearRectangle(drawto, dst_x, dst_y, font_width, font_height);
+ return;
+ }
+
+ src_x += (ex == -1 ? 0 : ex == +1 ? width - font_width : font_width);
+ src_y += (ey == -1 ? 0 : ey == +1 ? height - font_height : font_height);
+
+ if (draw_masked)
+ {
+ SetClipOrigin(src_bitmap, src_bitmap->stored_clip_gc,
+ dst_x - src_x, dst_y - src_y);
+ BlitBitmapMasked(src_bitmap, drawto, src_x, src_y, font_width, font_height,
+ dst_x, dst_y);
+ }
+ else
+ BlitBitmap(src_bitmap, drawto, src_x, src_y, font_width, font_height,
+ dst_x, dst_y);
+#else
+ int border[8][2] =
+ {
+ { EL_STEELWALL_TOPLEFT, EL_INVISIBLE_STEELWALL_TOPLEFT },
+ { EL_STEELWALL_TOPRIGHT, EL_INVISIBLE_STEELWALL_TOPRIGHT },
+ { EL_STEELWALL_BOTTOMLEFT, EL_INVISIBLE_STEELWALL_BOTTOMLEFT },
+ { EL_STEELWALL_BOTTOMRIGHT, EL_INVISIBLE_STEELWALL_BOTTOMRIGHT },
+ { EL_STEELWALL_VERTICAL, EL_INVISIBLE_STEELWALL_VERTICAL },
+ { EL_STEELWALL_HORIZONTAL, EL_INVISIBLE_STEELWALL_HORIZONTAL },
+ { EL_STEELWALL, EL_INVISIBLE_STEELWALL },
+ { EL_EMPTY, EL_EMPTY }
+ };
+ int steel_type = (BorderElement == EL_STEELWALL ? 0 : 1);
+ int steel_position = (ex == -1 && ey == -1 ? 0 :
+ ex == +1 && ey == -1 ? 1 :
+ ex == -1 && ey == +1 ? 2 :
+ ex == +1 && ey == +1 ? 3 :
+ ex == -1 || ex == +1 ? 4 :
+ ey == -1 || ey == +1 ? 5 : 7);
+ int element = border[steel_position][steel_type];
+
+ DrawMiniGraphic(sx, sy, el2edimg(element));
+#endif
+}
+