X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Ftext.c;h=eb755ba5f41fb55a9c079cbeb4b6dc23a536ef00;hb=f1dae0af49fa331f6fedc6cbdf59eed0909ae391;hp=4c3f30ff143b2434cf66cc4f9d6dd135c6f69d56;hpb=14d7691c65ca4a466ce9b9448153e8fbe8351a81;p=rocksndiamonds.git diff --git a/src/libgame/text.c b/src/libgame/text.c index 4c3f30ff..eb755ba5 100644 --- a/src/libgame/text.c +++ b/src/libgame/text.c @@ -59,6 +59,20 @@ int getFontHeight(int font_nr) return gfx.font_bitmap_info[font_bitmap_id].height; } +int getFontDrawOffsetX(int font_nr) +{ + int font_bitmap_id = gfx.select_font_function(font_nr); + + return gfx.font_bitmap_info[font_bitmap_id].draw_xoffset; +} + +int getFontDrawOffsetY(int font_nr) +{ + int font_bitmap_id = gfx.select_font_function(font_nr); + + return gfx.font_bitmap_info[font_bitmap_id].draw_yoffset; +} + int getTextWidth(char *text, int font_nr) { return (text != NULL ? strlen(text) * getFontWidth(font_nr) : 0); @@ -118,7 +132,7 @@ int maxWordLengthInString(char *text) /* simple text drawing functions */ /* ========================================================================= */ -void DrawInitTextExt(char *text, int ypos, int font_nr, boolean force) +void DrawInitText(char *text, int ypos, int font_nr) { LimitScreenUpdates(TRUE); @@ -141,22 +155,6 @@ void DrawInitTextExt(char *text, int ypos, int font_nr, boolean force) } } -void DrawInitText(char *text, int ypos, int font_nr) -{ - // DrawInitTextExt(text, ypos, font_nr, TRUE); - DrawInitTextExt(text, ypos, font_nr, FALSE); -} - -void DrawInitTextAlways(char *text, int ypos, int font_nr) -{ - DrawInitTextExt(text, ypos, font_nr, TRUE); -} - -void DrawInitTextIfNeeded(char *text, int ypos, int font_nr) -{ - DrawInitTextExt(text, ypos, font_nr, FALSE); -} - void DrawTextF(int x, int y, int font_nr, char *format, ...) { char buffer[MAX_OUTPUT_LINESIZE + 1]; @@ -199,11 +197,6 @@ void DrawTextSCentered(int y, int font_nr, char *text) gfx.sy + y, text, font_nr); } -void DrawTextCentered(int y, int font_nr, char *text) -{ - DrawText((gfx.sxsize - getTextWidth(text, font_nr)) / 2, y, text, font_nr); -} - void DrawTextSAligned(int x, int y, char *text, int font_nr, int align) { DrawText(gfx.sx + ALIGNED_XPOS(x, getTextWidth(text, font_nr), align),