Today I finished up the export part of the NextGenGraphics class that will form the core of Gash. This required parsing the font chunks, which fortunately are documented on ModdingWiki. The EGA version of the exporter was very easy; the format in that article is correct. (I did run into a surprise with VB.NET while coding that: non-explicitly-initialized variables inside a loop retain their values across iterations.)
The CGA version was a little trickier. CGA font chunks apparently use what that article calls the version-1 format of fonts, so there are two bits for every pixel. That is, the font chunks are really just a bunch of standard CGA pictures jammed together, whereas EGA fonts are a single plane of EGA data.
I also wrote simple exporters for text chunks (becomes a String) and miscellaneous data chunks (becomes a Byte array). Next, I'll see about importing.
No comments:
Post a Comment