projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20031129-3-src
[rocksndiamonds.git]
/
src
/
libgame
/
text.h
diff --git
a/src/libgame/text.h
b/src/libgame/text.h
index 18dd2ba4d5195453d5bfbc6b5ffcfec16a39d4a6..10c91d242c21837ee49487f50e520c0a2dc37d32 100644
(file)
--- a/
src/libgame/text.h
+++ b/
src/libgame/text.h
@@
-17,58
+17,59
@@
#include "system.h"
#include "system.h"
-/*
font type
s */
-#define F
S_INITIAL
0
-#define F
S_BIG
1
-#define F
S_MEDIUM
2
-#define F
S_SMALL
3
+/*
default font
s */
+#define F
ONT_INITIAL_1
0
+#define F
ONT_INITIAL_2
1
+#define F
ONT_INITIAL_3
2
+#define F
ONT_INITIAL_4
3
/* font colors */
/* font colors */
-#define FC_RED
0
-#define FC_BLUE
1
-#define FC_GREEN
2
-#define FC_YELLOW
3
+#define FC_RED
FONT_INITIAL_1
+#define FC_BLUE
FONT_INITIAL_2
+#define FC_GREEN
FONT_INITIAL_3
+#define FC_YELLOW
FONT_INITIAL_4
-/* 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)
+/* text output definitions */
+#define MAX_OUTPUT_LINESIZE 1024
-#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)
+/* special character mapping for default fonts */
+#define FONT_ASCII_CURSOR ((char)160)
+#define MAP_FONT_ASCII(c) ((c) >= 'a' && (c) <= 'z' ? 'A' + (c) - 'a' : \
+ (c) == '©' ? 96 : \
+ (c) == 'ä' || (c) == 'Ä' ? 97 : \
+ (c) == 'ö' || (c) == 'Ö' ? 98 : \
+ (c) == 'ü' || (c) == 'Ü' ? 99 : \
+ (c) == '°' ? 100 : \
+ (c) == '®' ? 101 : \
+ (c) == FONT_ASCII_CURSOR ? 102 : \
+ (c))
-#define FONT_CHARS_PER_LINE 16
-#define FONT_LINES_PER_FONT 4
+/* 64 regular ordered ASCII characters, 6 special characters, 1 cursor char. */
+#define MIN_NUM_CHARS_PER_FONT 64
+#define DEFAULT_NUM_CHARS_PER_FONT (MIN_NUM_CHARS_PER_FONT + 6 +1)
+#define DEFAULT_NUM_CHARS_PER_LINE 16
-#define FONT_OPAQUE 0
-#define FONT_MASKED 1
-
-/* text output definitions */
-#define MAX_OUTPUT_LINESIZE 1024
/* font structure definitions */
/* font structure definitions */
-void InitFontInfo(struct FontBitmapInfo *, int);
+void InitFontInfo(struct FontBitmapInfo *, int, int (*function)(int));
+void FreeFontInfo(struct FontBitmapInfo *);
+
int getFontWidth(int);
int getFontHeight(int);
int getFontWidth(int);
int getFontHeight(int);
+int getTextWidth(char *, int);
+
+void getFontCharSource(int, char, Bitmap **, int *, int *);
+
void DrawInitText(char *, int, int);
void DrawTextF(int, int, int, char *, ...);
void DrawTextFCentered(int, int, char *, ...);
void DrawInitText(char *, int, int);
void DrawTextF(int, int, int, char *, ...);
void DrawTextFCentered(int, int, char *, ...);
+void DrawTextS(int, int, int, char *);
+void DrawTextSCentered(int, int, char *);
void DrawText(int, int, char *, int);
void DrawTextExt(DrawBuffer *, int, int, char *, int, int);
void DrawText(int, int, char *, int);
void DrawTextExt(DrawBuffer *, int, int, char *, int, int);
+void DrawTextToTextArea(int, int, char *, int, int, int, int, int);
+boolean RenderLineToBuffer(char **, char *, int *, boolean, int);
+void DrawTextWrapped(int, int, char *, int, int, int);
#endif /* TEXT_H */
#endif /* TEXT_H */