added enabling/disabling virtual button overlay depending on input events
[rocksndiamonds.git] / src / libgame / text.c
index 36cb6dd5a90bf61e89fe9bcd2b907fb414120d25..eb755ba5f41fb55a9c079cbeb4b6dc23a536ef00 100644 (file)
@@ -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),
@@ -307,9 +300,6 @@ void DrawTextExt(DrawBuffer *dst_bitmap, int dst_x, int dst_y, char *text,
                                   font_width, font_height);
       }
 
-      SetClipOrigin(src_bitmap, src_bitmap->stored_clip_gc,
-                   dst_x - src_x, dst_y - src_y);
-
       BlitBitmapMasked(src_bitmap, dst_bitmap, src_x, src_y,
                       font_width, font_height, dst_x, dst_y);
     }