X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Ftext.c;h=5328f18b28200c8eee5e50adcff86aea78e74da1;hb=994cb017022c658f115e3c9fc927d8a0cc83832c;hp=1a5dcefe2a543122fef6521c260b0d863065ff2f;hpb=14089dac2cbe56e563863e1e5adb8847944fd262;p=rocksndiamonds.git diff --git a/src/libgame/text.c b/src/libgame/text.c index 1a5dcefe..5328f18b 100644 --- a/src/libgame/text.c +++ b/src/libgame/text.c @@ -25,6 +25,7 @@ #define NUM_FONT_COLORS 4 #define NUM_FONT_CHARS (FONT_LINES_PER_FONT * FONT_CHARS_PER_LINE) +#if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND) static GC tile_clip_gc = None; static Pixmap tile_clipmask[NUM_FONTS][NUM_FONT_COLORS][NUM_FONT_CHARS]; @@ -40,7 +41,6 @@ static struct static void InitFontClipmasks() { -#if defined(TARGET_X11_NATIVE) static boolean clipmasks_initialized = FALSE; boolean fonts_initialized = TRUE; XGCValues clip_gc_values; @@ -105,9 +105,8 @@ static void InitFontClipmasks() XFreeGC(display, copy_clipmask_gc); clipmasks_initialized = TRUE; - -#endif /* TARGET_X11_NATIVE */ } +#endif /* TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND */ void InitFontInfo(Bitmap *bitmap_initial, Bitmap *bitmap_big, Bitmap *bitmap_medium, @@ -119,7 +118,9 @@ void InitFontInfo(Bitmap *bitmap_initial, font.bitmap_small = bitmap_small; font.bitmap_tile = bitmap_tile; +#if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND) InitFontClipmasks(); +#endif } int getFontWidth(int font_size, int font_type) @@ -295,6 +296,7 @@ void DrawTextExt(DrawBuffer *bitmap, int x, int y, char *text, dest_x - gfx.real_sx, dest_y - gfx.real_sy, font_width, font_height, dest_x, dest_y); +#if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND) /* use special font tile clipmasks, if available */ if (font_size == FS_BIG || font_size == FS_MEDIUM) { @@ -310,6 +312,10 @@ void DrawTextExt(DrawBuffer *bitmap, int x, int y, char *text, SetClipOrigin(font_bitmap, font_bitmap->stored_clip_gc, dest_x - src_x, dest_y - src_y); } +#else + SetClipOrigin(font_bitmap, font_bitmap->stored_clip_gc, + dest_x - src_x, dest_y - src_y); +#endif BlitBitmapMasked(font_bitmap, bitmap, src_x, src_y, font_width, font_height, dest_x, dest_y);