Re: [AD] 4.2.0 Beta 4 - PACKFILE / Font Troubles

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 8/1/05, Evert Glebbeek <eglebbk@xxxxxxxxxx> wrote:
> On Monday 01 August 2005 06:05, Shawn Walker wrote:
> > I'm porting some games listed on retrospec.sgn.net, along the way I
> > discovered one of them that has a packfile that is readable using the
> > Allegro 4.0 dll they include, but not with Allegro 4.2.0 Beta 4.
> > tools/dat gives an error trying to list the contents of this .dat file
> > with 4.2.0 beta 4:
> >
> > http://drevil.warpcore.org/styx_mn.dat
> 
> Thanks for reporting! I'll look into it as soon as I can (hopefully tonight
> after work).
> 
> > I'm sure an astute reader will note a few red flags already. First of
> > all, it thinks the color depth is 255 :} This appears to be because of
> > new code in datafile.c to support true colour fonts, as well as
> > possible changes in how packfiles are read in file.c, I'm going to
> > guess there's a wrong assumption about the format of some older
> > packfiles.
> 
> Possibly; it does work with other older datafile though. Does the datafile
> contain a password (I'm guessing not)?

Correct, no password.

> If it's the fonts, you should be able to tell by editing the datafile loading
> code: it does something like `if depth == 0 then depth = 8'; can you change
> that in `if depth != 1 then depth = 8''? This will break true colour fonts,
> but it will make it clear that this is where the bug is.

Saying if (depth == 0 || depth == 255) depth = 8 fixes one current
assert crash only to get another. It dies further on when an assert
fails during read_bitmap because it gets a width and height of -1 from
something in the file. This is what made me question whether the
packfile was even being read in correctly.

> Alternatively, can you test with 4.1.18 WIP if the problem is still there? The
> earlier 4.2 betas can't be downloaded from SourceForge anymore (they're
> hidden), but if you want to retry those as well, let me know.

I might be able to test with 4.1.17 or 4.1.18 using Linux. 4.2.0 beta4
is the first version of Allegro to work without issues on Solaris 10
(with the patches I sent in which have been committed) which is what
I'm developing on right now.

> > I would fix this if I understood what was going on, but I don't. I'm
> > relatively new to digging around in Allegro's guts and there a lot of
> > things done that I don't understand the purpose of. Any help would be
> > appreciated.
> 
> Feel free to ask about that. Maybe we could add some comments to the code to
> help explain things.

The font loading / packfile reading code is probably the hardest to
follow. The inconsistent formatting (mixed tabs and spaces) also makes
it a little more difficult sometimes to piece together.

-- 
Shawn Walker, Software and Systems Analyst
binarycrusader@xxxxxxxxxx - http://binarycrusader.blogspot.com/




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/