version 1.1 | | version 1.2 |
---|
| | |
* Graphical routines for drawing fonts. | | * Graphical routines for drawing fonts. |
* | | * |
* $Log$ | | * $Log$ |
* Revision 1.1 1999/06/14 21:57:22 donut | | * Revision 1.2 1999/08/31 10:43:13 donut |
* Initial revision | | * added colorization to multiplayer names in user messages |
| | * |
| | * Revision 1.1.1.1 1999/06/14 21:57:22 donut |
| | * Import of d1x 1.37 source. |
* | | * |
* Revision 1.30 1995/01/25 20:02:03 john | | * Revision 1.30 1995/01/25 20:02:03 john |
* Fixed bug with mono clipped fonts only drawing 1 row. | | * Fixed bug with mono clipped fonts only drawing 1 row. |
| | |
return ((grd_curcanv->cv_bitmap.bm_w - w) / 2); | | return ((grd_curcanv->cv_bitmap.bm_w - w) / 2); |
} | | } |
| | |
| | //hack to allow color codes to be embedded in strings -MPM |
| | //note we subtract one from color, since 255 is "transparent" so it'll never be used, and 0 would otherwise end the string. |
| | //function must already have orig_color var set (or they could be passed as args...) |
| | //perhaps some sort of recursive orig_color type thing would be better, but that would be way too much trouble for little gain |
| | #define CHECK_EMBEDDED_COLORS() if (*text_ptr==0x01){ \ |
| | text_ptr++; \ |
| | if (*text_ptr){ \ |
| | FG_COLOR=*text_ptr-1; \ |
| | text_ptr++; \ |
| | } \ |
| | } \ |
| | else if (*text_ptr==0x02){ \ |
| | FG_COLOR=orig_color; \ |
| | text_ptr++; \ |
| | } |
| | |
| | |
| | |
int gr_internal_string0(int x, int y, char *s ) | | int gr_internal_string0(int x, int y, char *s ) |
| | |
| | |
unsigned int VideoOffset, VideoOffset1; | | unsigned int VideoOffset, VideoOffset1; |
| | |
| | int orig_color=FG_COLOR;//to allow easy reseting to default string color with colored strings -MPM |
| | |
bits = 0; | | bits = 0; |
| | |
VideoOffset1 = y * ROWSIZE + x; | | VideoOffset1 = y * ROWSIZE + x; |
| | |
letter = *text_ptr-FMINCHAR; | | letter = *text_ptr-FMINCHAR; |
| | |
if (!INFONT(letter)) { //not in font, draw as space | | if (!INFONT(letter)) { //not in font, draw as space |
| | CHECK_EMBEDDED_COLORS() else{ |
VideoOffset += spacing; | | VideoOffset += spacing; |
text_ptr++; | | text_ptr++; |
| | } |
continue; | | continue; |
} | | } |
| | |