2 #include "sprites/font.c"
6 #define STRSWITCH_LETTERS_UC 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': \
7 case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': \
8 case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z'
10 #define STRSWITCH_LETTERS_LC 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': case 'i': \
11 case 'j': case 'k': case 'l': case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': \
12 case 's': case 't': case 'u': case 'v': case 'w': case 'x': case 'y': case 'z'
14 #define STRSWITCH_LETTERS STRSWITCH_LETTERS_UC: case STRSWITCH_LETTERS_LC
16 #define STRSWITCH_NUMBERS '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9'
19 extern SDL_Surface
*surface
;
20 extern struct vo_desc video
;
22 static int chartofontindex(int c
) {
24 case STRSWITCH_NUMBERS
:
26 case STRSWITCH_LETTERS_UC
:
28 case STRSWITCH_LETTERS_LC
:
41 void font_print(int x
, int y
, const char *str
, size_t len
, unsigned scale
, prgb color
) {
43 prgb col
[2] = {PRGB(0,0,0), color
};
44 for(i
= 0; i
< len
; i
++, x
+=8*scale
)
45 blit_sprite(x
,y
, &video
, scale
, &font
.header
, chartofontindex(str
[i
]), col
);