diff options
author | pixel <pixel> | 2002-12-08 20:00:50 +0000 |
---|---|---|
committer | pixel <pixel> | 2002-12-08 20:00:50 +0000 |
commit | 4fde43181e0c726a1e0de1e26ffe1983774d1ed0 (patch) | |
tree | 4ad33126d854b941d972fc744056077f4adae30d /lib/glfont.cc | |
parent | 218f34ad9e9026493fad5ead4dcafafc295b68cd (diff) |
Commit of the day
Diffstat (limited to 'lib/glfont.cc')
-rw-r--r-- | lib/glfont.cc | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/lib/glfont.cc b/lib/glfont.cc index 82058c8..833d18d 100644 --- a/lib/glfont.cc +++ b/lib/glfont.cc @@ -4,13 +4,45 @@ Uint8 prescale2[4] = { 0, 85, 170, 255 }, prescale3[8] = { 0, 36, 72, 109, 145, 182, 218, 255 }; +/* + +font file format +================ + +off|siz|description +---+---+------------------------------- + 0 | 2 | Number of entries + 2 | 1 | Flags + 3 | 1 | maxX (maximum width) + 4 | 1 | maxY (maximum height) + 5 | X | char entries +5+X| Y | char map + +Flags: +----- + +0000000R + +R = RGBA (=1) or Alpha (=0) + +ABGR in 1232 format: +ABBGGGRR + +variables comments +================== + +nbcU = number of chars on X by texture +nbcV = number of chars on Y by texture +nbcT = number of char by texture +nbT = number of textures + +*/ + mogltk::font::font(const String & file) { Input ffont(file); int i; -#ifdef HAVE_ZLIB ffont.SetZ(); -#endif ffont.read(&nbentries, 2); ffont.read(&flags, 1); @@ -44,7 +76,7 @@ mogltk::font::font(const String & file) { for (int u = 0; u < maxX; u++) { Uint8 f; ffont.read(&f, 1); - if (flags) { + if (flags & 1) { Uint8 r, g, b, a; r = f & 3; g = (f >> 2) & 7; |