aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--saga/font.cpp414
-rw-r--r--saga/font.h45
-rw-r--r--saga/font_map.cpp522
-rw-r--r--saga/font_mod.h31
4 files changed, 382 insertions, 630 deletions
diff --git a/saga/font.cpp b/saga/font.cpp
index ce3f497396..67f466ebd8 100644
--- a/saga/font.cpp
+++ b/saga/font.cpp
@@ -20,28 +20,16 @@
* $Header$
*
*/
-/*
-
- Description:
-
- Font management and font drawing module
- Notes:
-*/
+// Font management and font drawing module
#include "reinherit.h"
#include "yslib.h"
-/*
- * Uses the following modules:
-\*--------------------------------------------------------------------------*/
#include "rscfile_mod.h"
#include "game_mod.h"
-/*
- * Begin module
-\*--------------------------------------------------------------------------*/
#include "font_mod.h"
#include "font.h"
@@ -49,46 +37,34 @@ namespace Saga {
static R_FONT_MODULE FontModule;
-int FONT_Init(void)
-{
-
+int FONT_Init() {
R_GAME_FONTDESC *gamefonts;
int i;
if (FontModule.init) {
-
FontModule.err_str = "Font module already initialized.";
-
return R_FAILURE;
}
- /* Load font module resource context
- * \*------------------------------------------------------------ */
+ // Load font module resource context
if (GAME_GetFileContext(&FontModule.font_ctxt,
R_GAME_RESOURCEFILE, 0) != R_SUCCESS) {
-
FontModule.err_str = "Couldn't get resource context.";
-
return R_FAILURE;
}
- /* Allocate font table
- * \*------------------------------------------------------------ */
+ // Allocate font table
GAME_GetFontInfo(&gamefonts, &FontModule.n_fonts);
assert(FontModule.n_fonts > 0);
- FontModule.fonts = (R_FONT **)malloc(FontModule.n_fonts *
- sizeof *FontModule.fonts);
+ FontModule.fonts = (R_FONT **)malloc(FontModule.n_fonts * sizeof *FontModule.fonts);
if (FontModule.fonts == NULL) {
-
FontModule.err_str = "Memory allocation failure.";
-
return R_MEM;
}
for (i = 0; i < FontModule.n_fonts; i++) {
-
FONT_Load(gamefonts[i].font_rn, gamefonts[i].font_id);
}
@@ -97,47 +73,38 @@ int FONT_Init(void)
return R_SUCCESS;
}
-int FONT_Shutdown(void)
-{
-
+int FONT_Shutdown() {
// int i;
R_printf(R_STDOUT, "FONT_Shutdown(): Freeing fonts.\n");
/*
- for ( i = 0 ; i < R_FONT_COUNT ; i ++ ) {
-
- if ( FontModule.fonts[i] != NULL ) {
-
- if ( FontModule.fonts[i]->normal_loaded ) {
- free( FontModule.fonts[i]->normal->font_free_p );
- free( FontModule.fonts[i]->normal );
- }
+ for ( i = 0 ; i < R_FONT_COUNT ; i ++ ) {
+ if ( FontModule.fonts[i] != NULL ) {
+ if ( FontModule.fonts[i]->normal_loaded ) {
+ free( FontModule.fonts[i]->normal->font_free_p );
+ free( FontModule.fonts[i]->normal );
+ }
- if ( FontModule.fonts[i]->outline_loaded ) {
- free( FontModule.fonts[i]->outline->font_free_p );
- free( FontModule.fonts[i]->outline );
- }
- }
+ if ( FontModule.fonts[i]->outline_loaded ) {
+ free( FontModule.fonts[i]->outline->font_free_p );
+ free( FontModule.fonts[i]->outline );
+ }
+ }
- free( FontModule.fonts[i] );
- }
+ free( FontModule.fonts[i] );
+ }
*/
return R_SUCCESS;
}
-int FONT_Load(uint32 font_rn, int font_id)
-{
-
+int FONT_Load(uint32 font_rn, int font_id) {
R_FONT_HEADER fh;
R_FONT *font;
R_FONT_STYLE *normal_font;
-
byte *fontres_p;
size_t fontres_len;
size_t remain;
-
const byte *read_p;
-
int nbits;
int c;
@@ -145,35 +112,27 @@ int FONT_Load(uint32 font_rn, int font_id)
return R_FAILURE;
}
- /* Load font resource
- * \*------------------------------------------------------------- */
- if (RSC_LoadResource(FontModule.font_ctxt,
- font_rn, &fontres_p, &fontres_len) != R_SUCCESS) {
-
+ // Load font resource
+ if (RSC_LoadResource(FontModule.font_ctxt, font_rn, &fontres_p, &fontres_len) != R_SUCCESS) {
FontModule.err_str = "Couldn't load font resource.";
-
return R_FAILURE;
}
if (fontres_len < R_FONT_DESCSIZE) {
-
FontModule.err_str = "Invalid font length.";
}
read_p = fontres_p;
remain = fontres_len;
- /* Create new font structure
- * \*------------------------------------------------------------- */
+ // Create new font structure
font = (R_FONT *)malloc(sizeof *font);
if (font == NULL) {
FontModule.err_str = "Memory allocation error.";
-
return R_MEM;
}
- /* Read font header
- * \*------------------------------------------------------------- */
+ // Read font header
fh.c_height = ys_read_u16_le(read_p, &read_p);
fh.c_width = ys_read_u16_le(read_p, &read_p);
fh.row_length = ys_read_u16_le(read_p, &read_p);
@@ -188,14 +147,11 @@ int FONT_Load(uint32 font_rn, int font_id)
R_printf(R_STDOUT, "Row padding:\t%d\n", fh.row_length);
#endif
- /* Create normal font style
- * \*------------------------------------------------------------- */
+ // Create normal font style
normal_font = (R_FONT_STYLE *)malloc(sizeof *normal_font);
if (normal_font == NULL) {
-
FontModule.err_str = "Memory allocation error.";
free(font);
-
return R_MEM;
}
@@ -209,8 +165,7 @@ int FONT_Load(uint32 font_rn, int font_id)
}
for (c = 0; c < R_FONT_CHARCOUNT; c++) {
- nbits = normal_font->fce[c].width =
- ys_read_u8(read_p, &read_p);
+ nbits = normal_font->fce[c].width = ys_read_u8(read_p, &read_p);
normal_font->fce[c].byte_width = GetByteLen(nbits);
}
@@ -223,7 +178,6 @@ int FONT_Load(uint32 font_rn, int font_id)
}
if ((read_p - fontres_p) != R_FONT_DESCSIZE) {
-
R_printf(R_STDERR, "Invalid font resource size.\n");
return R_FAILURE;
}
@@ -233,34 +187,25 @@ int FONT_Load(uint32 font_rn, int font_id)
font->normal = normal_font;
font->normal_loaded = 1;
- /* Create outline font style
- * \*------------------------------------------------------------- */
+ // Create outline font style
font->outline = FONT_CreateOutline(normal_font);
font->outline_loaded = 1;
- /* Set font data
- * \*------------------------------------------------------------- */
-
+ // Set font data
FontModule.fonts[font_id] = font;
return R_SUCCESS;
}
-int FONT_GetHeight(int font_id)
-{
-
+int FONT_GetHeight(int font_id) {
R_FONT *font;
if (!FontModule.init) {
return R_FAILURE;
}
- if ((font_id < 0) ||
- (font_id >= FontModule.n_fonts) ||
- (FontModule.fonts[font_id] == NULL)) {
-
+ if ((font_id < 0) || (font_id >= FontModule.n_fonts) || (FontModule.fonts[font_id] == NULL)) {
FontModule.err_str = "Invalid font id.";
-
return R_FAILURE;
}
@@ -269,55 +214,41 @@ int FONT_GetHeight(int font_id)
return font->normal->hdr.c_height;
}
-static R_FONT_STYLE *FONT_CreateOutline(R_FONT_STYLE * src_font)
-{
-
+static R_FONT_STYLE *FONT_CreateOutline(R_FONT_STYLE *src_font) {
R_FONT_STYLE *new_font;
unsigned char *new_font_data;
size_t new_font_data_len;
-
int s_width = src_font->hdr.c_width;
int s_height = src_font->hdr.c_height;
-
int new_row_len = 0;
int row;
int i;
-
int index;
size_t index_offset = 0;
-
int new_byte_width;
int old_byte_width;
-
int current_byte;
-
unsigned char *base_ptr;
unsigned char *src_ptr;
unsigned char *dest_ptr1;
unsigned char *dest_ptr2;
unsigned char *dest_ptr3;
-
unsigned char c_rep;
- /* Create new font style structure
- * \*------------------------------------------------------------- */
+ // Create new font style structure
new_font = (R_FONT_STYLE *)malloc(sizeof *new_font);
if (new_font == NULL) {
FontModule.err_str = "Memory allocation error.";
-
return NULL;
}
memset(new_font, 0, sizeof *new_font);
- /* Populate new font style character data
- * \*------------------------------------------------------------- */
+ // Populate new font style character data
for (i = 0; i < R_FONT_CHARCOUNT; i++) {
-
new_byte_width = 0;
old_byte_width = 0;
-
index = src_font->fce[i].index;
if ((index > 0) || (i == R_FONT_FIRSTCHAR)) {
index += index_offset;
@@ -328,9 +259,7 @@ static R_FONT_STYLE *FONT_CreateOutline(R_FONT_STYLE * src_font)
new_font->fce[i].flag = src_font->fce[i].flag;
if (src_font->fce[i].width != 0) {
-
- new_byte_width =
- GetByteLen(src_font->fce[i].width + 2);
+ new_byte_width = GetByteLen(src_font->fce[i].width + 2);
old_byte_width = GetByteLen(src_font->fce[i].width);
if (new_byte_width > old_byte_width) {
@@ -351,14 +280,12 @@ static R_FONT_STYLE *FONT_CreateOutline(R_FONT_STYLE * src_font)
new_font->hdr.c_height = s_height + 2;
new_font->hdr.row_length = new_row_len;
- /* Allocate new font representation storage
- * \*------------------------------------------------------------- */
+ // Allocate new font representation storage
new_font_data_len = new_row_len * (s_height + 2);
new_font_data = (unsigned char *)malloc(new_font_data_len);
if (new_font_data == NULL) {
FontModule.err_str = "Memory allocation error.";
-
return NULL;
}
@@ -367,113 +294,60 @@ static R_FONT_STYLE *FONT_CreateOutline(R_FONT_STYLE * src_font)
new_font->font_free_p = new_font_data;
new_font->font_p = new_font_data;
- /* Generate outline font representation
- * \*------------------------------------------------------------- */
+ // Generate outline font representation
for (i = 0; i < R_FONT_CHARCOUNT; i++) {
-
for (row = 0; row < s_height; row++) {
-
- for (current_byte = 0;
- current_byte < new_font->fce[i].byte_width;
- current_byte++) {
-
- base_ptr =
- new_font->font_p + new_font->fce[i].index +
- current_byte;
-
- dest_ptr1 =
- base_ptr + new_font->hdr.row_length * row;
- dest_ptr2 =
- base_ptr +
- new_font->hdr.row_length * (row + 1);
- dest_ptr3 =
- base_ptr +
- new_font->hdr.row_length * (row + 2);
-
+ for (current_byte = 0; current_byte < new_font->fce[i].byte_width; current_byte++) {
+ base_ptr = new_font->font_p + new_font->fce[i].index + current_byte;
+ dest_ptr1 = base_ptr + new_font->hdr.row_length * row;
+ dest_ptr2 = base_ptr + new_font->hdr.row_length * (row + 1);
+ dest_ptr3 = base_ptr + new_font->hdr.row_length * (row + 2);
if (current_byte > 0) {
-
- /* Get last two columns from previous byte */
- src_ptr = src_font->font_p +
- src_font->hdr.row_length * row +
- src_font->fce[i].index +
- (current_byte - 1);
-
+ // Get last two columns from previous byte
+ src_ptr = src_font->font_p + src_font->hdr.row_length * row + src_font->fce[i].index +
+ (current_byte - 1);
c_rep = *src_ptr;
- *dest_ptr1 |=
- ((c_rep << 6) | (c_rep << 7));
- *dest_ptr2 |=
- ((c_rep << 6) | (c_rep << 7));
- *dest_ptr3 |=
- ((c_rep << 6) | (c_rep << 7));
+ *dest_ptr1 |= ((c_rep << 6) | (c_rep << 7));
+ *dest_ptr2 |= ((c_rep << 6) | (c_rep << 7));
+ *dest_ptr3 |= ((c_rep << 6) | (c_rep << 7));
}
if (current_byte < src_font->fce[i].byte_width) {
-
- src_ptr = src_font->font_p +
- src_font->hdr.row_length * row +
- src_font->fce[i].index +
- current_byte;
-
+ src_ptr = src_font->font_p + src_font->hdr.row_length * row + src_font->fce[i].index +
+ current_byte;
c_rep = *src_ptr;
- *dest_ptr1 |=
- c_rep | (c_rep >> 1) | (c_rep >>
- 2);
- *dest_ptr2 |=
- c_rep | (c_rep >> 1) | (c_rep >>
- 2);
- *dest_ptr3 |=
- c_rep | (c_rep >> 1) | (c_rep >>
- 2);
+ *dest_ptr1 |= c_rep | (c_rep >> 1) | (c_rep >> 2);
+ *dest_ptr2 |= c_rep | (c_rep >> 1) | (c_rep >> 2);
+ *dest_ptr3 |= c_rep | (c_rep >> 1) | (c_rep >> 2);
}
}
}
- /* "Hollow out" character to prevent overdraw */
+ // "Hollow out" character to prevent overdraw
for (row = 0; row < s_height; row++) {
-
- for (current_byte = 0;
- current_byte < new_font->fce[i].byte_width;
- current_byte++) {
-
- dest_ptr2 = new_font->font_p +
- new_font->hdr.row_length * (row + 1) +
- new_font->fce[i].index + current_byte;
-
+ for (current_byte = 0; current_byte < new_font->fce[i].byte_width; current_byte++) {
+ dest_ptr2 = new_font->font_p + new_font->hdr.row_length * (row + 1) + new_font->fce[i].index + current_byte;
if (current_byte > 0) {
-
- /* Get last two columns from previous byte */
- src_ptr = src_font->font_p +
- src_font->hdr.row_length * row +
- src_font->fce[i].index +
- (current_byte - 1);
-
- *dest_ptr2 &=
- ((*src_ptr << 7) ^ 0xFFU);
+ // Get last two columns from previous byte
+ src_ptr = src_font->font_p + src_font->hdr.row_length * row + src_font->fce[i].index +
+ (current_byte - 1);
+ *dest_ptr2 &= ((*src_ptr << 7) ^ 0xFFU);
}
if (current_byte < src_font->fce[i].byte_width) {
-
- src_ptr = src_font->font_p +
- src_font->hdr.row_length * row +
- src_font->fce[i].index +
- current_byte;
-
- *dest_ptr2 &=
- ((*src_ptr >> 1) ^ 0xFFU);
+ src_ptr = src_font->font_p + src_font->hdr.row_length * row + src_font->fce[i].index +
+ current_byte;
+ *dest_ptr2 &= ((*src_ptr >> 1) ^ 0xFFU);
}
}
}
}
return new_font;
-
}
-static int GetByteLen(int num_bits)
-{
-
+static int GetByteLen(int num_bits) {
int byte_len;
-
byte_len = num_bits / 8;
if (num_bits % 8) {
@@ -483,17 +357,11 @@ static int GetByteLen(int num_bits)
return byte_len;
}
-int
-FONT_GetStringWidth(int font_id,
- const char *test_str, size_t test_str_ct, int flags)
-/*--------------------------------------------------------------------------*\
- * Returns the horizontal length in pixels of the graphical representation
- * of at most 'test_str_ct' characters of the string 'test_str', taking
- * into account any formatting options specified by 'flags'.
- * If 'test_str_ct' is 0, all characters of 'test_str' are counted.
-\*--------------------------------------------------------------------------*/
-{
-
+// Returns the horizontal length in pixels of the graphical representation
+// of at most 'test_str_ct' characters of the string 'test_str', taking
+// into account any formatting options specified by 'flags'.
+// If 'test_str_ct' is 0, all characters of 'test_str' are counted.
+int FONT_GetStringWidth(int font_id, const char *test_str, size_t test_str_ct, int flags) {
R_FONT *font;
size_t ct;
int width = 0;
@@ -504,12 +372,8 @@ FONT_GetStringWidth(int font_id,
return R_FAILURE;
}
- if ((font_id < 0) ||
- (font_id >= FontModule.n_fonts) ||
- (FontModule.fonts[font_id] == NULL)) {
-
+ if ((font_id < 0) || (font_id >= FontModule.n_fonts) || (FontModule.fonts[font_id] == NULL)) {
FontModule.err_str = "Invalid font id.";
-
return R_FAILURE;
}
@@ -518,15 +382,11 @@ FONT_GetStringWidth(int font_id,
txt_p = (const byte *) test_str;
- for (ct = test_str_ct;
- *txt_p && (!test_str_ct || ct > 0); txt_p++, ct--) {
-
+ for (ct = test_str_ct; *txt_p && (!test_str_ct || ct > 0); txt_p++, ct--) {
ch = *txt_p & 0xFFU;
-
- /* Translate character */
+ // Translate character
ch = CharMap[ch];
assert(ch < R_FONT_CHARCOUNT);
-
width += font->normal->fce[ch].tracking;
}
@@ -537,14 +397,8 @@ FONT_GetStringWidth(int font_id,
return width;
}
-int
-FONT_Draw(int font_id,
- R_SURFACE * ds,
- const char *draw_str,
- size_t draw_str_ct,
- int text_x, int text_y, int color, int effect_color, int flags)
-{
-
+int FONT_Draw(int font_id, R_SURFACE *ds, const char *draw_str, size_t draw_str_ct,
+ int text_x, int text_y, int color, int effect_color, int flags) {
R_FONT *font;
if (!FontModule.init) {
@@ -553,56 +407,31 @@ FONT_Draw(int font_id,
return R_FAILURE;
}
- if ((font_id < 0) ||
- (font_id >= FontModule.n_fonts) ||
- (FontModule.fonts[font_id] == NULL)) {
-
+ if ((font_id < 0) || (font_id >= FontModule.n_fonts) || (FontModule.fonts[font_id] == NULL)) {
FontModule.err_str = "Invalid font id.";
-
return R_FAILURE;
}
font = FontModule.fonts[font_id];
- if (flags & FONT_OUTLINE) {
-
- FONT_Out(font->outline,
- ds,
- draw_str,
- draw_str_ct, text_x - 1, text_y - 1, effect_color);
-
- FONT_Out(font->normal,
- ds, draw_str, draw_str_ct, text_x, text_y, color);
+ if (flags & FONT_OUTLINE) {
+ FONT_Out(font->outline, ds, draw_str, draw_str_ct, text_x - 1, text_y - 1, effect_color);
+ FONT_Out(font->normal, ds, draw_str, draw_str_ct, text_x, text_y, color);
} else if (flags & FONT_SHADOW) {
-
- FONT_Out(font->normal,
- ds,
- draw_str,
- draw_str_ct, text_x - 1, text_y + 1, effect_color);
-
- FONT_Out(font->normal,
- ds, draw_str, draw_str_ct, text_x, text_y, color);
- } else { /* FONT_NORMAL */
-
- FONT_Out(font->normal,
- ds, draw_str, draw_str_ct, text_x, text_y, color);
+ FONT_Out(font->normal, ds, draw_str, draw_str_ct, text_x - 1, text_y + 1, effect_color);
+ FONT_Out(font->normal, ds, draw_str, draw_str_ct, text_x, text_y, color);
+ } else { // FONT_NORMAL
+ FONT_Out(font->normal, ds, draw_str, draw_str_ct, text_x, text_y, color);
}
return R_SUCCESS;
}
-int
-FONT_Out(R_FONT_STYLE * draw_font,
- R_SURFACE * ds,
- const char *draw_str,
- size_t draw_str_ct, int text_x, int text_y, int color)
-{
-
+int FONT_Out(R_FONT_STYLE * draw_font, R_SURFACE * ds, const char *draw_str, size_t draw_str_ct,
+ int text_x, int text_y, int color) {
const byte *draw_str_p;
-
byte *c_data_ptr;
int c_code;
-
int char_row;
byte *output_ptr;
@@ -615,105 +444,78 @@ FONT_Out(R_FONT_STYLE * draw_font,
int c_byte_len;
int c_byte;
int c_bit;
-
int ct;
if ((text_x > ds->buf_w) || (text_y > ds->buf_h)) {
- /* Output string can't be visible */
+ // Output string can't be visible
return R_SUCCESS;
}
draw_str_p = (const byte *) draw_str;
ct = draw_str_ct;
- /* Draw string one character at a time, maximum of 'draw_str'_ct
- * characters, or no limit if 'draw_str_ct' is 0 */
+ // Draw string one character at a time, maximum of 'draw_str'_ct
+ // characters, or no limit if 'draw_str_ct' is 0
for (; *draw_str_p && (!draw_str_ct || ct); draw_str_p++, ct--) {
-
c_code = *draw_str_p & 0xFFU;
- /* Translate character */
+ // Translate character
c_code = CharMap[c_code];
assert(c_code < R_FONT_CHARCOUNT);
- /* Check if character is defined */
- if ((draw_font->fce[c_code].index == 0) &&
- (c_code != R_FONT_FIRSTCHAR)) {
-
-# if R_FONT_SHOWUNDEFINED
-
+ // Check if character is defined
+ if ((draw_font->fce[c_code].index == 0) && (c_code != R_FONT_FIRSTCHAR)) {
+#if R_FONT_SHOWUNDEFINED
if (c_code == R_FONT_CH_SPACE) {
text_x += draw_font->fce[c_code].tracking;
continue;
}
c_code = R_FONT_CH_QMARK;
-
-# else
-
- /* Character code is not defined, but advance tracking
- * ( Not defined if offset is 0, except for 33 ('!') which
- * is defined ) */
+#else
+ // Character code is not defined, but advance tracking
+ // ( Not defined if offset is 0, except for 33 ('!') which
+ // is defined )
text_x += draw_font->fce[c_code].tracking;
continue;
-
#endif
}
- /* Get length of character in bytes */
+ // Get length of character in bytes
c_byte_len = ((draw_font->fce[c_code].width - 1) / 8) + 1;
-
- row_limit = (ds->buf_h < (text_y + draw_font->hdr.c_height))
- ? ds->buf_h : text_y + draw_font->hdr.c_height;
-
+ row_limit = (ds->buf_h < (text_y + draw_font->hdr.c_height)) ? ds->buf_h : text_y + draw_font->hdr.c_height;
char_row = 0;
for (row = text_y; row < row_limit; row++, char_row++) {
-
- /* Clip negative rows */
+ // Clip negative rows */
if (row < 0) {
continue;
}
output_ptr = ds->buf + (ds->buf_pitch * row) + text_x;
-
- output_ptr_min = ds->buf + (ds->buf_pitch * row) +
- (text_x > 0 ? text_x : 0);
-
+ output_ptr_min = ds->buf + (ds->buf_pitch * row) + (text_x > 0 ? text_x : 0);
output_ptr_max = output_ptr + (ds->buf_pitch - text_x);
- /* If character starts off the screen, jump to next character */
+ // If character starts off the screen, jump to next character
if (output_ptr < output_ptr_min) {
break;
}
- c_data_ptr = draw_font->font_p +
- char_row * draw_font->hdr.row_length +
- draw_font->fce[c_code].index;
-
- for (c_byte = 0; c_byte < c_byte_len;
- c_byte++, c_data_ptr++) {
-
- /* Check each bit, draw pixel if bit is set */
- for (c_bit = 7;
- c_bit >= 0
- && (output_ptr < output_ptr_max);
- c_bit--) {
+ c_data_ptr = draw_font->font_p + char_row * draw_font->hdr.row_length + draw_font->fce[c_code].index;
+ for (c_byte = 0; c_byte < c_byte_len; c_byte++, c_data_ptr++) {
+ // Check each bit, draw pixel if bit is set
+ for (c_bit = 7; c_bit >= 0 && (output_ptr < output_ptr_max); c_bit--) {
if ((*c_data_ptr >> c_bit) & 0x01) {
*output_ptr = (byte) color;
}
output_ptr++;
+ } // end per-bit processing
+ } // end per-byte processing
+ } // end per-row processing
- } /* end per-bit processing */
-
- } /* end per-byte processing */
-
- } /* end per-row processing */
-
- /* Advance tracking position */
+ // Advance tracking position
text_x += draw_font->fce[c_code].tracking;
-
- } /* end per-character processing */
+ } // end per-character processing
return R_SUCCESS;
}
diff --git a/saga/font.h b/saga/font.h
index 7370e6b2a4..d3813d3c9b 100644
--- a/saga/font.h
+++ b/saga/font.h
@@ -20,14 +20,8 @@
* $Header$
*
*/
-/*
- Description:
-
- Font management and font drawing header file
-
- Notes:
-*/
+// Font management and font drawing header file
#ifndef SAGA_FONT_H__
#define SAGA_FONT_H__
@@ -36,18 +30,17 @@ namespace Saga {
#define R_FONT_DBGLVL R_DEBUG_NONE
-#define R_FONT_SHOWUNDEFINED 1 /* Define to draw undefined characters
- * as ?'s */
+#define R_FONT_SHOWUNDEFINED 1 // Define to draw undefined characters * as ?'s
-/* The first defined character (!) is the only one that may
- have a valid offset of '0' */
+// The first defined character (!) is the only one that may
+// have a valid offset of '0'
#define R_FONT_FIRSTCHAR 33
#define R_FONT_CH_SPACE 32
#define R_FONT_CH_QMARK 63
-/* Minimum font header size without font data
- (6 + 512 + 256 + 256 + 256 ) */
+// Minimum font header size without font data
+// (6 + 512 + 256 + 256 + 256 )
#define R_FONT_DESCSIZE 1286
#define R_FONT_CHARCOUNT 256
@@ -56,35 +49,27 @@ namespace Saga {
#define SAGA_FONT_HEADER_LEN 6
struct R_FONT_HEADER {
-
int c_height;
int c_width;
int row_length;
-
};
struct FONT_CHAR_ENTRY {
-
int index;
int byte_width;
int width;
int flag;
int tracking;
-
};
struct R_FONT_STYLE {
-
R_FONT_HEADER hdr;
FONT_CHAR_ENTRY fce[256];
-
byte *font_free_p;
byte *font_p;
-
};
struct R_FONT {
-
uint32 font_rn;
int font_id;
@@ -95,13 +80,10 @@ struct R_FONT {
byte *res_data;
size_t res_len;
-
};
struct R_FONT_MODULE {
-
int init;
-
R_RSCFILE_CONTEXT *font_ctxt;
int n_fonts;
@@ -109,24 +91,15 @@ struct R_FONT_MODULE {
int err_n;
const char *err_str;
-
};
int FONT_Load(uint32 font_rn, int font_id);
-
static R_FONT_STYLE *FONT_CreateOutline(R_FONT_STYLE * src_font);
-
-int
-FONT_Out(R_FONT_STYLE * font,
- R_SURFACE * ds,
- const char *draw_str,
- size_t draw_str_ct, int text_x, int text_y, int color);
-
+int FONT_Out(R_FONT_STYLE *font, R_SURFACE * ds, const char *draw_str, size_t draw_str_ct,
+ int text_x, int text_y, int color);
static int GetByteLen(int num_bits);
-
extern int CharMap[];
} // End of namespace Saga
-#endif /* R_FONT_H__ */
-/* end "r_font.h" */
+#endif
diff --git a/saga/font_map.cpp b/saga/font_map.cpp
index fc070d4c36..9f48f5e4b6 100644
--- a/saga/font_map.cpp
+++ b/saga/font_map.cpp
@@ -20,276 +20,270 @@
* $Header$
*
*/
-/*
- Description:
-
- Font module character mapping table ( MS CP-850 to ISO 8859-1 )
+// Font module character mapping table ( MS CP-850 to ISO 8859-1 )
- Notes:
-
- Translation table derived from http://www.kostis.net/charsets/
-*/
+// Translation table derived from http://www.kostis.net/charsets/
namespace Saga {
int CharMap[] = {
- 0, /* 0 */
- 1, /* 1 */
- 2, /* 2 */
- 3, /* 3 */
- 4, /* 4 */
- 5, /* 5 */
- 6, /* 6 */
- 7, /* 7 */
- 8, /* 8 */
- 9, /* 9 */
- 10, /* 10 */
- 11, /* 11 */
- 12, /* 12 */
- 13, /* 13 */
- 14, /* 14 */
- 15, /* 15 */
- 16, /* 16 */
- 17, /* 17 */
- 18, /* 18 */
- 19, /* 19 */
- 20, /* 20 */
- 21, /* 21 */
- 22, /* 22 */
- 23, /* 23 */
- 24, /* 24 */
- 25, /* 25 */
- 26, /* 26 */
- 27, /* 27 */
- 28, /* 28 */
- 29, /* 29 */
- 30, /* 30 */
- 31, /* 31 */
- 32, /* 32 */
- 33, /* 33 */
- 34, /* 34 */
- 35, /* 35 */
- 36, /* 36 */
- 37, /* 37 */
- 38, /* 38 */
- 39, /* 39 */
- 40, /* 40 */
- 41, /* 41 */
- 42, /* 42 */
- 43, /* 43 */
- 44, /* 44 */
- 45, /* 45 */
- 46, /* 46 */
- 47, /* 47 */
- 48, /* 48 */
- 49, /* 49 */
- 50, /* 50 */
- 51, /* 51 */
- 52, /* 52 */
- 53, /* 53 */
- 54, /* 54 */
- 55, /* 55 */
- 56, /* 56 */
- 57, /* 57 */
- 58, /* 58 */
- 59, /* 59 */
- 60, /* 60 */
- 61, /* 61 */
- 62, /* 62 */
- 63, /* 63 */
- 64, /* 64 */
- 65, /* 65 */
- 66, /* 66 */
- 67, /* 67 */
- 68, /* 68 */
- 69, /* 69 */
- 70, /* 70 */
- 71, /* 71 */
- 72, /* 72 */
- 73, /* 73 */
- 74, /* 74 */
- 75, /* 75 */
- 76, /* 76 */
- 77, /* 77 */
- 78, /* 78 */
- 79, /* 79 */
- 80, /* 80 */
- 81, /* 81 */
- 82, /* 82 */
- 83, /* 83 */
- 84, /* 84 */
- 85, /* 85 */
- 86, /* 86 */
- 87, /* 87 */
- 88, /* 88 */
- 89, /* 89 */
- 90, /* 90 */
- 91, /* 91 */
- 92, /* 92 */
- 93, /* 93 */
- 94, /* 94 */
- 95, /* 95 */
- 96, /* 96 */
- 97, /* 97 */
- 98, /* 98 */
- 99, /* 99 */
- 100, /* 100 */
- 101, /* 101 */
- 102, /* 102 */
- 103, /* 103 */
- 104, /* 104 */
- 105, /* 105 */
- 106, /* 106 */
- 107, /* 107 */
- 108, /* 108 */
- 109, /* 109 */
- 110, /* 110 */
- 111, /* 111 */
- 112, /* 112 */
- 113, /* 113 */
- 114, /* 114 */
- 115, /* 115 */
- 116, /* 116 */
- 117, /* 117 */
- 118, /* 118 */
- 119, /* 119 */
- 120, /* 120 */
- 121, /* 121 */
- 122, /* 122 */
- 123, /* 123 */
- 124, /* 124 */
- 125, /* 125 */
- 126, /* 126 */
- 127, /* 127 */
- 199, /* 128 LATIN CAPITAL LETTER C WITH CEDILLA */
- 252, /* 129 LATIN SMALL LETTER U WITH DIAERESIS */
- 233, /* 130 LATIN SMALL LETTER E WITH ACUTE */
- 226, /* 131 LATIN SMALL LETTER A WITH CIRCUMFLEX */
- 228, /* 132 LATIN SMALL LETTER A WITH DIAERESIS */
- 224, /* 133 LATIN SMALL LETTER A WITH GRAVE */
- 229, /* 134 LATIN SMALL LETTER A WITH RING ABOVE */
- 231, /* 135 LATIN SMALL LETTER C WITH CEDILLA */
- 234, /* 136 LATIN SMALL LETTER E WITH CIRCUMFLEX */
- 235, /* 137 LATIN SMALL LETTER E WITH DIAERESIS */
- 232, /* 138 LATIN SMALL LETTER E WITH GRAVE */
- 239, /* 139 LATIN SMALL LETTER I WITH DIAERESIS */
- 238, /* 140 LATIN SMALL LETTER I WITH CIRCUMFLEX */
- 236, /* 141 LATIN SMALL LETTER I WITH GRAVE */
- 196, /* 142 LATIN CAPITAL LETTER A WITH DIAERESIS */
- 197, /* 143 LATIN CAPITAL LETTER A WITH RING ABOVE */
- 201, /* 144 LATIN CAPITAL LETTER E WITH ACUTE */
- 230, /* 145 LATIN SMALL LETTER AE */
- 198, /* 146 LATIN CAPITAL LETTER AE */
- 244, /* 147 LATIN SMALL LETTER O WITH CIRCUMFLEX */
- 246, /* 148 LATIN SMALL LETTER O WITH DIAERESIS */
- 242, /* 149 LATIN SMALL LETTER O WITH GRAVE */
- 251, /* 150 LATIN SMALL LETTER U WITH CIRCUMFLEX */
- 249, /* 151 LATIN SMALL LETTER U WITH GRAVE */
- 255, /* 152 LATIN SMALL LETTER Y WITH DIAERESIS */
- 214, /* 153 LATIN CAPITAL LETTER O WITH DIAERESIS */
- 220, /* 154 LATIN CAPITAL LETTER U WITH DIAERESIS */
- 248, /* 155 LATIN SMALL LETTER O WITH STROKE */
- 163, /* 156 POUND SIGN */
- 216, /* 157 LATIN CAPITAL LETTER O WITH STROKE */
- 215, /* 158 MULTIPLICATION SIGN */
- 0, /* 159 LATIN SMALL LETTER F WITH HOOK */
- 225, /* 160 LATIN SMALL LETTER A WITH ACUTE */
- 237, /* 161 LATIN SMALL LETTER I WITH ACUTE */
- 243, /* 162 LATIN SMALL LETTER O WITH ACUTE */
- 250, /* 163 LATIN SMALL LETTER U WITH ACUTE */
- 241, /* 164 LATIN SMALL LETTER N WITH TILDE */
- 209, /* 165 LATIN CAPITAL LETTER N WITH TILDE */
- 170, /* 166 FEMININE ORDINAL INDICATOR */
- 186, /* 167 MASCULINE ORDINAL INDICATOR */
- 191, /* 168 INVERTED QUESTION MARK */
- 174, /* 169 REGISTERED SIGN */
- 172, /* 170 NOT SIGN */
- 189, /* 171 VULGAR FRACTION ONE HALF */
- 188, /* 172 VULGAR FRACTION ONE QUARTER */
- 161, /* 173 INVERTED EXCLAMATION MARK */
- 171, /* 174 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */
- 187, /* 175 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */
- 0, /* 176 LIGHT SHADE */
- 0, /* 177 MEDIUM SHADE */
- 0, /* 178 DARK SHADE */
- 0, /* 179 BOX DRAWINGS LIGHT VERTICAL */
- 0, /* 180 BOX DRAWINGS LIGHT VERTICAL AND LEFT */
- 193, /* 181 LATIN CAPITAL LETTER A WITH ACUTE */
- 194, /* 182 LATIN CAPITAL LETTER A WITH CIRCUMFLEX */
- 192, /* 183 LATIN CAPITAL LETTER A WITH GRAVE */
- 169, /* 184 COPYRIGHT SIGN */
- 0, /* 185 BOX DRAWINGS DOUBLE VERTICAL AND LEFT */
- 0, /* 186 BOX DRAWINGS DOUBLE VERTICAL */
- 0, /* 187 BOX DRAWINGS DOUBLE DOWN AND LEFT */
- 0, /* 188 BOX DRAWINGS DOUBLE UP AND LEFT */
- 162, /* 189 CENT SIGN */
- 165, /* 190 YEN SIGN */
- 0, /* 191 BOX DRAWINGS LIGHT DOWN AND LEFT */
- 0, /* 192 BOX DRAWINGS LIGHT UP AND RIGHT */
- 0, /* 193 BOX DRAWINGS LIGHT UP AND HORIZONTAL */
- 0, /* 194 BOX DRAWINGS LIGHT DOWN AND HORIZONTAL */
- 0, /* 195 BOX DRAWINGS LIGHT VERTICAL AND RIGHT */
- 0, /* 196 BOX DRAWINGS LIGHT HORIZONTAL */
- 0, /* 197 BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL */
- 227, /* 198 LATIN SMALL LETTER A WITH TILDE */
- 195, /* 199 LATIN CAPITAL LETTER A WITH TILDE */
- 0, /* 200 BOX DRAWINGS DOUBLE UP AND RIGHT */
- 0, /* 201 BOX DRAWINGS DOUBLE DOWN AND RIGHT */
- 0, /* 202 BOX DRAWINGS DOUBLE UP AND HORIZONTAL */
- 0, /* 203 BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL */
- 0, /* 204 BOX DRAWINGS DOUBLE VERTICAL AND RIGHT */
- 0, /* 205 BOX DRAWINGS DOUBLE HORIZONTAL */
- 0, /* 206 BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL */
- 164, /* 207 CURRENCY SIGN */
- 240, /* 208 LATIN SMALL LETTER ETH */
- 208, /* 209 LATIN CAPITAL LETTER ETH */
- 202, /* 210 LATIN CAPITAL LETTER E WITH CIRCUMFLEX */
- 203, /* 211 LATIN CAPITAL LETTER E WITH DIAERESIS */
- 200, /* 212 LATIN CAPITAL LETTER E WITH GRAVE */
- 305, /* 213 LATIN SMALL LETTER DOTLESS I */
- 205, /* 214 LATIN CAPITAL LETTER I WITH ACUTE */
- 206, /* 215 LATIN CAPITAL LETTER I WITH CIRCUMFLEX */
- 207, /* 216 LATIN CAPITAL LETTER I WITH DIAERESIS */
- 0, /* 217 BOX DRAWINGS LIGHT UP AND LEFT */
- 0, /* 218 BOX DRAWINGS LIGHT DOWN AND RIGHT */
- 0, /* 219 FULL BLOCK */
- 0, /* 220 LOWER HALF BLOCK */
- 166, /* 221 BROKEN BAR */
- 204, /* 222 LATIN CAPITAL LETTER I WITH GRAVE */
- 0, /* 223 UPPER HALF BLOCK */
- 211, /* 224 LATIN CAPITAL LETTER O WITH ACUTE */
- 223, /* 225 LATIN SMALL LETTER SHARP S */
- 212, /* 226 LATIN CAPITAL LETTER O WITH CIRCUMFLEX */
- 210, /* 227 LATIN CAPITAL LETTER O WITH GRAVE */
- 245, /* 228 LATIN SMALL LETTER O WITH TILDE */
- 213, /* 229 LATIN CAPITAL LETTER O WITH TILDE */
- 181, /* 230 MICRO SIGN */
- 254, /* 231 LATIN SMALL LETTER THORN */
- 222, /* 232 LATIN CAPITAL LETTER THORN */
- 218, /* 233 LATIN CAPITAL LETTER U WITH ACUTE */
- 219, /* 234 LATIN CAPITAL LETTER U WITH CIRCUMFLEX */
- 217, /* 235 LATIN CAPITAL LETTER U WITH GRAVE */
- 253, /* 236 LATIN SMALL LETTER Y WITH ACUTE */
- 221, /* 237 LATIN CAPITAL LETTER Y WITH ACUTE */
- 175, /* 238 MACRON */
- 180, /* 239 ACUTE ACCENT */
- 173, /* 240 SOFT HYPHEN */
- 177, /* 241 PLUS-MINUS SIGN */
- 0, /* 242 DOUBLE LOW LINE */
- 190, /* 243 VULGAR FRACTION THREE QUARTERS */
- 182, /* 244 PILCROW SIGN */
- 167, /* 245 SECTION SIGN */
- 247, /* 246 DIVISION SIGN */
- 184, /* 247 CEDILLA */
- 176, /* 248 DEGREE SIGN */
- 168, /* 249 DIAERESIS */
- 183, /* 250 MIDDLE DOT */
- 185, /* 251 SUPERSCRIPT ONE */
- 179, /* 252 SUPERSCRIPT THREE */
- 178, /* 253 SUPERSCRIPT TWO */
- 0, /* 254 BLACK SQUARE */
- 160 /* 255 NO-BREAK SPACE */
+ 0, // 0
+ 1, // 1
+ 2, // 2
+ 3, // 3
+ 4, // 4
+ 5, // 5
+ 6, // 6
+ 7, // 7
+ 8, // 8
+ 9, // 9
+ 10, // 10
+ 11, // 11
+ 12, // 12
+ 13, // 13
+ 14, // 14
+ 15, // 15
+ 16, // 16
+ 17, // 17
+ 18, // 18
+ 19, // 19
+ 20, // 20
+ 21, // 21
+ 22, // 22
+ 23, // 23
+ 24, // 24
+ 25, // 25
+ 26, // 26
+ 27, // 27
+ 28, // 28
+ 29, // 29
+ 30, // 30
+ 31, // 31
+ 32, // 32
+ 33, // 33
+ 34, // 34
+ 35, // 35
+ 36, // 36
+ 37, // 37
+ 38, // 38
+ 39, // 39
+ 40, // 40
+ 41, // 41
+ 42, // 42
+ 43, // 43
+ 44, // 44
+ 45, // 45
+ 46, // 46
+ 47, // 47
+ 48, // 48
+ 49, // 49
+ 50, // 50
+ 51, // 51
+ 52, // 52
+ 53, // 53
+ 54, // 54
+ 55, // 55
+ 56, // 56
+ 57, // 57
+ 58, // 58
+ 59, // 59
+ 60, // 60
+ 61, // 61
+ 62, // 62
+ 63, // 63
+ 64, // 64
+ 65, // 65
+ 66, // 66
+ 67, // 67
+ 68, // 68
+ 69, // 69
+ 70, // 70
+ 71, // 71
+ 72, // 72
+ 73, // 73
+ 74, // 74
+ 75, // 75
+ 76, // 76
+ 77, // 77
+ 78, // 78
+ 79, // 79
+ 80, // 80
+ 81, // 81
+ 82, // 82
+ 83, // 83
+ 84, // 84
+ 85, // 85
+ 86, // 86
+ 87, // 87
+ 88, // 88
+ 89, // 89
+ 90, // 90
+ 91, // 91
+ 92, // 92
+ 93, // 93
+ 94, // 94
+ 95, // 95
+ 96, // 96
+ 97, // 97
+ 98, // 98
+ 99, // 99
+ 100, // 100
+ 101, // 101
+ 102, // 102
+ 103, // 103
+ 104, // 104
+ 105, // 105
+ 106, // 106
+ 107, // 107
+ 108, // 108
+ 109, // 109
+ 110, // 110
+ 111, // 111
+ 112, // 112
+ 113, // 113
+ 114, // 114
+ 115, // 115
+ 116, // 116
+ 117, // 117
+ 118, // 118
+ 119, // 119
+ 120, // 120
+ 121, // 121
+ 122, // 122
+ 123, // 123
+ 124, // 124
+ 125, // 125
+ 126, // 126
+ 127, // 127
+ 199, // 128 LATIN CAPITAL LETTER C WITH CEDILLA
+ 252, // 129 LATIN SMALL LETTER U WITH DIAERESIS
+ 233, // 130 LATIN SMALL LETTER E WITH ACUTE
+ 226, // 131 LATIN SMALL LETTER A WITH CIRCUMFLEX
+ 228, // 132 LATIN SMALL LETTER A WITH DIAERESIS
+ 224, // 133 LATIN SMALL LETTER A WITH GRAVE
+ 229, // 134 LATIN SMALL LETTER A WITH RING ABOVE
+ 231, // 135 LATIN SMALL LETTER C WITH CEDILLA
+ 234, // 136 LATIN SMALL LETTER E WITH CIRCUMFLEX
+ 235, // 137 LATIN SMALL LETTER E WITH DIAERESIS
+ 232, // 138 LATIN SMALL LETTER E WITH GRAVE
+ 239, // 139 LATIN SMALL LETTER I WITH DIAERESIS
+ 238, // 140 LATIN SMALL LETTER I WITH CIRCUMFLEX
+ 236, // 141 LATIN SMALL LETTER I WITH GRAVE
+ 196, // 142 LATIN CAPITAL LETTER A WITH DIAERESIS
+ 197, // 143 LATIN CAPITAL LETTER A WITH RING ABOVE
+ 201, // 144 LATIN CAPITAL LETTER E WITH ACUTE
+ 230, // 145 LATIN SMALL LETTER AE
+ 198, // 146 LATIN CAPITAL LETTER AE
+ 244, // 147 LATIN SMALL LETTER O WITH CIRCUMFLEX
+ 246, // 148 LATIN SMALL LETTER O WITH DIAERESIS
+ 242, // 149 LATIN SMALL LETTER O WITH GRAVE
+ 251, // 150 LATIN SMALL LETTER U WITH CIRCUMFLEX
+ 249, // 151 LATIN SMALL LETTER U WITH GRAVE
+ 255, // 152 LATIN SMALL LETTER Y WITH DIAERESIS
+ 214, // 153 LATIN CAPITAL LETTER O WITH DIAERESIS
+ 220, // 154 LATIN CAPITAL LETTER U WITH DIAERESIS
+ 248, // 155 LATIN SMALL LETTER O WITH STROKE
+ 163, // 156 POUND SIGN
+ 216, // 157 LATIN CAPITAL LETTER O WITH STROKE
+ 215, // 158 MULTIPLICATION SIGN
+ 0, // 159 LATIN SMALL LETTER F WITH HOOK
+ 225, // 160 LATIN SMALL LETTER A WITH ACUTE
+ 237, // 161 LATIN SMALL LETTER I WITH ACUTE
+ 243, // 162 LATIN SMALL LETTER O WITH ACUTE
+ 250, // 163 LATIN SMALL LETTER U WITH ACUTE
+ 241, // 164 LATIN SMALL LETTER N WITH TILDE
+ 209, // 165 LATIN CAPITAL LETTER N WITH TILDE
+ 170, // 166 FEMININE ORDINAL INDICATOR
+ 186, // 167 MASCULINE ORDINAL INDICATOR
+ 191, // 168 INVERTED QUESTION MARK
+ 174, // 169 REGISTERED SIGN
+ 172, // 170 NOT SIGN
+ 189, // 171 VULGAR FRACTION ONE HALF
+ 188, // 172 VULGAR FRACTION ONE QUARTER
+ 161, // 173 INVERTED EXCLAMATION MARK
+ 171, // 174 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+ 187, // 175 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+ 0, // 176 LIGHT SHADE
+ 0, // 177 MEDIUM SHADE
+ 0, // 178 DARK SHADE
+ 0, // 179 BOX DRAWINGS LIGHT VERTICAL
+ 0, // 180 BOX DRAWINGS LIGHT VERTICAL AND LEFT
+ 193, // 181 LATIN CAPITAL LETTER A WITH ACUTE
+ 194, // 182 LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+ 192, // 183 LATIN CAPITAL LETTER A WITH GRAVE
+ 169, // 184 COPYRIGHT SIGN
+ 0, // 185 BOX DRAWINGS DOUBLE VERTICAL AND LEFT
+ 0, // 186 BOX DRAWINGS DOUBLE VERTICAL
+ 0, // 187 BOX DRAWINGS DOUBLE DOWN AND LEFT
+ 0, // 188 BOX DRAWINGS DOUBLE UP AND LEFT
+ 162, // 189 CENT SIGN
+ 165, // 190 YEN SIGN
+ 0, // 191 BOX DRAWINGS LIGHT DOWN AND LEFT
+ 0, // 192 BOX DRAWINGS LIGHT UP AND RIGHT
+ 0, // 193 BOX DRAWINGS LIGHT UP AND HORIZONTAL
+ 0, // 194 BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
+ 0, // 195 BOX DRAWINGS LIGHT VERTICAL AND RIGHT
+ 0, // 196 BOX DRAWINGS LIGHT HORIZONTAL
+ 0, // 197 BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
+ 227, // 198 LATIN SMALL LETTER A WITH TILDE
+ 195, // 199 LATIN CAPITAL LETTER A WITH TILDE
+ 0, // 200 BOX DRAWINGS DOUBLE UP AND RIGHT
+ 0, // 201 BOX DRAWINGS DOUBLE DOWN AND RIGHT
+ 0, // 202 BOX DRAWINGS DOUBLE UP AND HORIZONTAL
+ 0, // 203 BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
+ 0, // 204 BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
+ 0, // 205 BOX DRAWINGS DOUBLE HORIZONTAL
+ 0, // 206 BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
+ 164, // 207 CURRENCY SIGN
+ 240, // 208 LATIN SMALL LETTER ETH
+ 208, // 209 LATIN CAPITAL LETTER ETH
+ 202, // 210 LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+ 203, // 211 LATIN CAPITAL LETTER E WITH DIAERESIS
+ 200, // 212 LATIN CAPITAL LETTER E WITH GRAVE
+ 305, // 213 LATIN SMALL LETTER DOTLESS I
+ 205, // 214 LATIN CAPITAL LETTER I WITH ACUTE
+ 206, // 215 LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+ 207, // 216 LATIN CAPITAL LETTER I WITH DIAERESIS
+ 0, // 217 BOX DRAWINGS LIGHT UP AND LEFT
+ 0, // 218 BOX DRAWINGS LIGHT DOWN AND RIGHT
+ 0, // 219 FULL BLOCK
+ 0, // 220 LOWER HALF BLOCK
+ 166, // 221 BROKEN BAR
+ 204, // 222 LATIN CAPITAL LETTER I WITH GRAVE
+ 0, // 223 UPPER HALF BLOCK
+ 211, // 224 LATIN CAPITAL LETTER O WITH ACUTE
+ 223, // 225 LATIN SMALL LETTER SHARP S
+ 212, // 226 LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+ 210, // 227 LATIN CAPITAL LETTER O WITH GRAVE
+ 245, // 228 LATIN SMALL LETTER O WITH TILDE
+ 213, // 229 LATIN CAPITAL LETTER O WITH TILDE
+ 181, // 230 MICRO SIGN
+ 254, // 231 LATIN SMALL LETTER THORN
+ 222, // 232 LATIN CAPITAL LETTER THORN
+ 218, // 233 LATIN CAPITAL LETTER U WITH ACUTE
+ 219, // 234 LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+ 217, // 235 LATIN CAPITAL LETTER U WITH GRAVE
+ 253, // 236 LATIN SMALL LETTER Y WITH ACUTE
+ 221, // 237 LATIN CAPITAL LETTER Y WITH ACUTE
+ 175, // 238 MACRON
+ 180, // 239 ACUTE ACCENT
+ 173, // 240 SOFT HYPHEN
+ 177, // 241 PLUS-MINUS SIGN
+ 0, // 242 DOUBLE LOW LINE
+ 190, // 243 VULGAR FRACTION THREE QUARTERS
+ 182, // 244 PILCROW SIGN
+ 167, // 245 SECTION SIGN
+ 247, // 246 DIVISION SIGN
+ 184, // 247 CEDILLA
+ 176, // 248 DEGREE SIGN
+ 168, // 249 DIAERESIS
+ 183, // 250 MIDDLE DOT
+ 185, // 251 SUPERSCRIPT ONE
+ 179, // 252 SUPERSCRIPT THREE
+ 178, // 253 SUPERSCRIPT TWO
+ 0, // 254 BLACK SQUARE
+ 160 // 255 NO-BREAK SPACE
};
} // End of namespace Saga
diff --git a/saga/font_mod.h b/saga/font_mod.h
index dd3bbe887f..d0d1263066 100644
--- a/saga/font_mod.h
+++ b/saga/font_mod.h
@@ -20,14 +20,8 @@
* $Header$
*
*/
-/*
- Description:
-
- Font management and font drawing module public header
-
- Notes:
-*/
+// Font management and font drawing module public header
#ifndef SAGA_FONT_MOD_H_
#define SAGA_FONT_MOD_H_
@@ -35,14 +29,12 @@
namespace Saga {
enum FONT_ID {
-
SMALL_FONT_ID,
MEDIUM_FONT_ID,
BIG_FONT_ID
};
enum FONT_EFFECT_FLAGS {
-
FONT_NORMAL = 0x00,
FONT_OUTLINE = 0x01,
FONT_SHADOW = 0x02,
@@ -50,22 +42,13 @@ enum FONT_EFFECT_FLAGS {
FONT_CENTERED = 0x08
};
-int FONT_Init(void);
-
-int FONT_Shutdown(void);
-
-int FONT_Draw(int font_id,
- R_SURFACE * ds,
- const char *draw_str,
- size_t draw_str_len,
- int text_x, int text_y, int color, int effect_color, int flags);
-
-int FONT_GetStringWidth(int font_id,
- const char *test_str, size_t test_str_ct, int flags);
-
+int FONT_Init();
+int FONT_Shutdown();
+int FONT_Draw(int font_id, R_SURFACE *ds, const char *draw_str, size_t draw_str_len,
+ int text_x, int text_y, int color, int effect_color, int flags);
+int FONT_GetStringWidth(int font_id, const char *test_str, size_t test_str_ct, int flags);
int FONT_GetHeight(int font_id);
} // End of namespace Saga
-#endif /* R_FONT_MOD_H_ */
-/* end "r_font_mod.h" */
+#endif