X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Ftools.c;h=0c9cd1766e69264bcacc83ed69a7f278ac7d9e96;hp=775bc0dc9dae4c4e3997e9143784a5ac893d7b05;hb=8d46c5298f0fcce7bdb52f3835b2fbbdc403dfe0;hpb=a16126b0981ba82ddcd5f7b0f763bc4ce6aa9bdc diff --git a/src/tools.c b/src/tools.c index 775bc0dc..0c9cd176 100644 --- a/src/tools.c +++ b/src/tools.c @@ -338,6 +338,15 @@ int getFontHeight(int font_size, int font_type) void DrawInitText(char *text, int ypos, int color) { +#ifdef USE_SDL_LIBRARY + if (sdl_window && sdl_pix[PIX_SMALLFONT]) + { + SDLFillRectangle(sdl_window, 0, ypos, WIN_XSIZE, FONT2_YSIZE, 0x000000); + DrawTextExt(window, gc, (WIN_XSIZE - strlen(text) * FONT2_XSIZE)/2, + ypos,text,FS_SMALL,color); + SDL_Flip(sdl_window); + } +#else if (display && window && pix[PIX_SMALLFONT]) { XFillRectangle(display, window, gc, 0, ypos, WIN_XSIZE, FONT2_YSIZE); @@ -345,6 +354,7 @@ void DrawInitText(char *text, int ypos, int color) ypos,text,FS_SMALL,color); XFlush(display); } +#endif } void DrawTextFCentered(int y, int font_type, char *format, ...) @@ -447,8 +457,15 @@ void DrawTextExt(Drawable d, GC gc, int x, int y, 0, 0, font_width, font_height, dest_x, dest_y); } else + { +#ifdef USE_SDL_LIBRARY + SDLCopyArea(sdl_pix[font_pixmap], sdl_window, + src_x, src_y, font_width, font_height, dest_x, dest_y); +#else XCopyArea(display, pix[font_pixmap], d, gc, src_x, src_y, font_width, font_height, dest_x, dest_y); +#endif + } } x += font_width;