2 // nazghul - an old-school RPG engine
3 // Copyright (C) 2002, 2003 Gordon McNutt
5 // This program is free software; you can redistribute it and/or modify it
6 // under the terms of the GNU General Public License as published by the Free
7 // Software Foundation; either version 2 of the License, or (at your option)
10 // This program is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 // You should have received a copy of the GNU General Public License along with
16 // this program; if not, write to the Free Foundation, Inc., 59 Temple Place,
17 // Suite 330, Boston, MA 02111-1307 USA
20 // gmcnutt@users.sourceforge.net
31 extern int asciiInit(void);
34 * Print a character using a build-in font and color. In the usual case this
35 * prints the character to the surface using the current font and color. In the
36 * general case, 'c' may be part of a control sequence, where the format is:
38 * <SEQ> := ^c<CMD><COLOR>
39 * <COLOR> := B|w|r|g|b|c|y|m|G|!
43 * The '+' CMD pushes the current color before setting the new color. The '-'
44 * CMD pops the last pushed color and makes it the new color.
58 * @param c is either a character to print or part of a control sequence.
59 * @param x is the pixel x-coord of the upper left corner to paint to.
60 * @param y is the pixel y-coord of the upper left corner to paint to.
61 * @param surface is the surface to paint to.
62 * @returns 1 if a character was painted, 0 if it was part of a control
65 extern int asciiPaint(char c, int x, int y, SDL_Surface * surface);
68 * Get the length of a string NOT including the font and color control
69 * characters. This is useful for determining how much screen space the string
70 * will take when printed with asciiPaint().
72 * The function assumes that the string applies to the current internal state
73 * of the ascii painting engine. This is only important if the last character
74 * to asciiPaint was part of an unfinished control sequence. In that case,
75 * asciiStrlen() assumes that this string continues where that one left off.
77 * @param s is the null-terminated string to check.
78 * @returns strlen(s) minus the number of control characters
80 extern int asciiStrlen(char *s);