Re: [AD] 4.2.0 Beta 4 - PACKFILE / Font Troubles |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Monday 01 August 2005 10:56, Shawn Walker wrote:
> I tested with 4.1.17 on Linux, I was able to use the 4.1.17 dat
> utility to sucessfully list the contents of the .dat file. So, it's
> definitely a breakage since then.
Patch attached. The datafile and font load normally for me in the grabber
with this patch applied.
It's just a one-line fix to check for depth==255 meaning the same thing as
depth==1 (a monochrome font). This wasn't a problem before because
anything != 1 was treated as an 8 bit colour font.
May I ask what programme you used to create the file originally? It puzzles
me that apparently the value 255 has been written to the file instead of
the expected value 1. Can you check if this points to a bug specific to
the dat utility?
If you load the file in an older version of the grabber (say 4.1.18) and
then safe it again, can you load the resulting file without the need for
this patch?
Evert
Index: src/datafile.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/datafile.c,v
retrieving revision 1.36
diff -u -r1.36 datafile.c
--- src/datafile.c 30 May 2005 21:35:11 -0000 1.36
+++ src/datafile.c 1 Aug 2005 21:10:20 -0000
@@ -479,7 +479,7 @@
num_ranges = pack_mgetw(pack);
while (num_ranges--) {
depth = pack_getc(pack);
- if (depth == 1) {
+ if (depth == 1 || depth == 255) {
FONT_MONO_DATA *mf = 0, *iter = (FONT_MONO_DATA *)f->data;
f->vtable = font_vtable_mono;