rnd-20030223-3-src
[rocksndiamonds.git] / src / libgame / text.h
index cd2f04d57609059203eaf206606911b75c95e578..5f8fb21d9b823ec8e324f5bf2c8ee68a52cd8cb9 100644 (file)
 
 
 /* font types */
-#define FS_SMALL               0
+#define FS_INITIAL             0
 #define FS_BIG                 1
 #define FS_MEDIUM              2
-#define FS_TILE                        3
+#define FS_SMALL               3
 
 /* font colors */
 #define FC_RED                 0
 #define FC_BLUE                        1
 #define FC_GREEN               2
 #define FC_YELLOW              3
-#define FC_SPECIAL1            4
-#define FC_SPECIAL2            5
-#define FC_SPECIAL3            6
 
-/* font graphics definitions */
-#define FONT1_XSIZE            32
-#define FONT1_YSIZE            32
-#define FONT2_XSIZE            14
-#define FONT2_YSIZE            14
-#define FONT3_XSIZE            11
-#define FONT3_YSIZE            14
-#define FONT4_XSIZE            16
-#define FONT4_YSIZE            16
-#define FONT5_XSIZE            10
-#define FONT5_YSIZE            14
-#define FONT6_XSIZE            16
-#define FONT6_YSIZE            32
+/* special fonts */
+#define FC_SPECIAL_TAPE                4
+#define FC_SPECIAL_GAME                5
+#define FC_SPECIAL_NARROW      6
+
+#define FONT(fs, fc)           ((      (fs) == FS_INITIAL ?            \
+                                       IMG_FONT_INITIAL_1 + (fc) :     \
+                                       (fs) == FS_BIG ?                \
+                                       IMG_FONT_BIG_1 + (fc) :         \
+                                       (fs) == FS_MEDIUM ?             \
+                                       IMG_FONT_MEDIUM_1 + (fc) :      \
+                                       (fs) == FS_SMALL ?              \
+                                       IMG_FONT_SMALL_1 + (fc) :       \
+                                       IMG_FONT_SMALL_1                \
+                                ) - FIRST_IMG_FONT)
+
+#define FONT_DEFAULT_BIG       FONT(FS_BIG,   FC_YELLOW)
+#define FONT_DEFAULT_SMALL     FONT(FS_SMALL, FC_YELLOW)
+#define FONT_SPECIAL_TAPE      FONT(FS_SMALL, FC_SPECIAL_TAPE)
+#define FONT_SPECIAL_GAME      FONT(FS_SMALL, FC_SPECIAL_GAME)
+#define FONT_SPECIAL_NARROW    FONT(FS_SMALL, FC_SPECIAL_NARROW)
 
 #define FONT_CHARS_PER_LINE    16
 #define FONT_LINES_PER_FONT    4
 
+#define FONT_OPAQUE            0
+#define FONT_MASKED            1
+
 /* text output definitions */
-#define MAX_OUTPUT_LINESIZE    256
+#define MAX_OUTPUT_LINESIZE    1024
 
 /* font structure definitions */
 
-struct FontInfo
-{
-  Bitmap *bitmap_big;
-  Bitmap *bitmap_medium;
-  Bitmap *bitmap_small;
-  Bitmap *bitmap_tile;
-};
-
-
-void InitFontInfo(Bitmap *, Bitmap *, Bitmap *, Bitmap *);
-int getFontWidth(int, int);
-int getFontHeight(int, int);
+void InitFontInfo(struct FontBitmapInfo *, int,
+                 int (*select_font_function)(int));
+int getFontWidth(int);
+int getFontHeight(int);
 void DrawInitText(char *, int, int);
 void DrawTextF(int, int, int, char *, ...);
 void DrawTextFCentered(int, int, char *, ...);
-void DrawText(int, int, char *, int, int);
+void DrawText(int, int, char *, int);
 void DrawTextExt(DrawBuffer *, int, int, char *, int, int);
 
 #endif /* TEXT_H */