X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Flibgame%2Ftext.c;h=e21acc03955d46c6db0ef61fb2f246968fd93a22;hp=29f558f4b2101033f8e21b1d253f3d26690bd27d;hb=27a283729bf1e7b956c5ceba87215a6d177b4bc7;hpb=b8114966908299df586165e00446f21c2ce343bb diff --git a/src/libgame/text.c b/src/libgame/text.c index 29f558f4..e21acc03 100644 --- a/src/libgame/text.c +++ b/src/libgame/text.c @@ -115,12 +115,18 @@ void InitFontInfo(struct FontBitmapInfo *font_bitmap_info, int num_fonts, gfx.num_fonts = num_fonts; gfx.font_bitmap_info = font_bitmap_info; gfx.select_font_function = select_font_function; + gfx.inverse_text_color = WHITE_PIXEL; #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND) InitFontClipmasks(); #endif } +void SetInverseTextColor(Pixel inverse_text_color) +{ + gfx.inverse_text_color = inverse_text_color; +} + int getFontWidth(int font_nr) { int font_bitmap_id = gfx.select_font_function(font_nr); @@ -265,6 +271,15 @@ void DrawTextExt(DrawBuffer *dst_bitmap, int dst_x, int dst_y, char *text, { if (print_inverse) /* special mode for text gadgets */ { +#if defined(TARGET_SDL) + /* blit normally (non-masked) */ + BlitBitmap(font->bitmap, dst_bitmap, src_x, src_y, + font->width, font->height, dst_x, dst_y); + + /* invert character */ + SDLInvertArea(dst_bitmap, dst_x, dst_y, font->width, font->height, + gfx.inverse_text_color); +#else /* first step: draw solid colored rectangle (use "cursor" character) */ if (print_inverse_cursor) BlitBitmap(font->bitmap, dst_bitmap, @@ -277,6 +292,7 @@ void DrawTextExt(DrawBuffer *dst_bitmap, int dst_x, int dst_y, char *text, dst_x - src_x, dst_y - src_y); BlitBitmapMasked(font->bitmap, dst_bitmap, 0, 0, font->width, font->height, dst_x, dst_y); +#endif } else if (mask_mode == BLIT_MASKED) {