Nick Bowler [Thu, 11 Feb 2010 05:06:54 +0000 (00:06 -0500)]
lbxgui: Implement frame dropping for animation.
Currently, if it takes longer than 1/15th of a second to draw a frame,
the next frame will be queued before it has a chance to finish, which
then takes longer than 1/15th of a second to draw, so the next one gets
queued, ad infinitum.
We do two things to solve this problem. First, the timer runs at a
low priority so that a redraw doesn't get queued while a redraw is in
progress. Second, the timer skips queueing any frames that have missed
their time.
Nick Bowler [Thu, 11 Feb 2010 00:08:25 +0000 (19:08 -0500)]
build: Implement a better GTK+ detection macro.
This macro uses the same ideas behind the libpng detection, does not
suffer from the POSIXLY_CORRECT nonsense, doesn't duplicate checks
for pkg-config, supports caching, and properly fails when it should.
Nick Bowler [Wed, 10 Feb 2010 06:24:37 +0000 (01:24 -0500)]
lbxgui: Fix pointer type error.
The XBM format is an array of unsigned char, yet for some reason
unknown to me, the gdk_bitmap_create_from_data function wants a
char pointer. Add the appropriate cast.
Nick Bowler [Wed, 10 Feb 2010 05:40:17 +0000 (00:40 -0500)]
lbxgui: Compile in the glade UI description.
I don't think it makes any sense to try and jump through hoops to find
this data at runtime, given that the data and the code are so intimately
connected.
Nick Bowler [Tue, 9 Feb 2010 05:27:30 +0000 (00:27 -0500)]
liblbx: Add support for "chunked" images.
It appears that the frame count fields aren't actually two 16-bit
fields, but rather four 8-bit fields. The images in monster.lbx
appear to have "chunks" of animation and what was previously thought to
be the most significant byte of the lead-in now seems to be the length
of a "chunk".
These images are much like any other, except that the first frame of
every chunk is drawn on a clean slate. Examples are found in
monster.lbx.
Nick Bowler [Tue, 9 Feb 2010 04:14:16 +0000 (23:14 -0500)]
liblbx: Add support for "raw" LBX images.
There is a new image format in town. If a particular flag bit is set,
then there are no row headers and data for every pixel of a frame is
simply stored in row-major order. An example of such an image is
starbg.lbx.009, as well as several others in the same archive.
Don't you just *love* the designers of this format?
Nick Bowler [Mon, 8 Feb 2010 04:24:06 +0000 (23:24 -0500)]
liblbx: Add new flag.
Building images have a previously-unknown flag, 0x0800. The images have
a part that looks like a shadow, but it does not have any palette entry.
I suspect that this flag is related to that shadow.
Nick Bowler [Sun, 7 Feb 2010 22:11:26 +0000 (17:11 -0500)]
liblbx: Add a field to lbx_colour indicating which entries are used.
An LBX palette might not contain values for all 256 entries. Currently,
there is no way to tell which entries were assigned when the palette is
retrieved from an image. This patch adds an extra marker which can be
used to skip over unused palette entries.
Nick Bowler [Thu, 4 Feb 2010 19:02:44 +0000 (14:02 -0500)]
lbxtool: Remove - as a synonym for stdin.
Modern Unix-like systems have interfaces such as /dev/stdin which mean
the same thing. Furthermore, the tools read from stdin by default.
Lastly, -f some_file -f - doesn't work anyway.
Nick Bowler [Thu, 4 Feb 2010 16:47:18 +0000 (11:47 -0500)]
liblbx: Don't ignore whence parameter in pipe_seek.
The code from which this derived only supported SEEK_SET-like
operations, so SEEK_CUR was forgotten when converting it.
SEEK_END obviously cannot be supported on pipes.
Nick Bowler [Thu, 4 Feb 2010 05:07:20 +0000 (00:07 -0500)]
build: Don't use a semicolon after sed's 't' command.
Some (namely, FreeBSD's) sed implementations fail when a semicolon is
used after a 't' command. This behaviour appears to be acceptable
according to POSIX, so appease these implementations.
Nick Bowler [Thu, 4 Feb 2010 01:47:40 +0000 (20:47 -0500)]
liblbx: Parameterise I/O functions to allow custom streams.
This eliminates the need for lbx_mopen and friends, so remove them. We
also now leave it to the caller to handle "seeking" on pipes, to
eliminate yet another hack. Only the core LBX handling code is updated
for now.
Nick Bowler [Wed, 3 Feb 2010 20:13:06 +0000 (15:13 -0500)]
test: Fix up regression test script.
The script uses a hodge-podge of portable and non-portable constructs
and declares the interpreter as /bin/sh. Change it to use my favourite
shell and exploit its features.