]> git.draconx.ca Git - liblbx.git/log
liblbx.git
10 years agoliblbx: Improve error handling in lbx_file_seek.
Nick Bowler [Tue, 28 Jan 2014 01:28:09 +0000 (20:28 -0500)]
liblbx: Improve error handling in lbx_file_seek.

  - Return an error code for an invaled whence value instead of
    proceeding with uninitialized values.

  - Set an error code on one of the error paths that did not set one.

10 years agotests: Enable shell traces early in all scripts.
Nick Bowler [Tue, 28 Jan 2014 01:10:30 +0000 (20:10 -0500)]
tests: Enable shell traces early in all scripts.

The result_ function we snarfed from Automake turns on set -x in our
test suite, but since we do not enable it from the beginning the test
logs have traces starting from the first test result and not before.

The result is very strange; enable traces early so we see everything.

10 years agolbximg: Fix management of external palette file handles.
Nick Bowler [Tue, 28 Jan 2014 01:03:34 +0000 (20:03 -0500)]
lbximg: Fix management of external palette file handles.

We leak file handles for the external and override palettes because the
file is opened every time the --palette or --override options are set.
Fix that up, and also close the handles when finished.

10 years agotests: Allow custom test command wrappers
Nick Bowler [Sat, 25 Jan 2014 19:10:33 +0000 (14:10 -0500)]
tests: Allow custom test command wrappers

Add a new environment variable, TESTWRAPPER, which allows the tests
to be run easily in tools like valgrind or qemu.

10 years agodocs: Add palette information for the tanm_xxx animations.
Nick Bowler [Fri, 24 Jan 2014 00:06:08 +0000 (19:06 -0500)]
docs: Add palette information for the tanm_xxx animations.

I thought these all had embedded palettes but at least tanm_001
has some unspecified palette entries.  The only palette for this
image that does not look horrible is fonts.lbx.002, so let's go
with that one.

10 years agobuild: Remove call to AC_CONFIG_MACRO_DIR.
Nick Bowler [Thu, 23 Jan 2014 03:04:38 +0000 (22:04 -0500)]
build: Remove call to AC_CONFIG_MACRO_DIR.

This macro never did anything useful and should not be used.  The new-
fangled way is AC_CONFIG_MACRO_DIRS which might even work, but stick
with the tried-and-true method for now.

10 years agolbximg: Convert to new decoding API.
Nick Bowler [Thu, 23 Jan 2014 02:30:01 +0000 (21:30 -0500)]
lbximg: Convert to new decoding API.

Convert lbximg to the new API.  The implementation looks a lot
like getframe, but we can make the memory usage much more compact.
Not really a coincidence because getframe was originally designed
to support this application.

10 years agoliblbx: Implement new image reading API.
Nick Bowler [Thu, 23 Jan 2014 02:13:45 +0000 (21:13 -0500)]
liblbx: Implement new image reading API.

Add a new API which allows the application to essentially loop over
the drawing commands in an LBX frame.  This requires no runtime memory
allocations in the library, pushing all that out to the caller.

Conceptually this simplifies many applications because they can use
this to handle image data row-at-a-time.

For now, keep the old getframe function but change it to use the new
API under the hood.

10 years agoliblbx: Rename LBX_ENOENT to LBX_EINVAL.
Nick Bowler [Thu, 23 Jan 2014 01:54:33 +0000 (20:54 -0500)]
liblbx: Rename LBX_ENOENT to LBX_EINVAL.

General invalid argument makes more sense to have.

10 years agotests: Source image header in a subshell.
Nick Bowler [Thu, 23 Jan 2014 01:50:33 +0000 (20:50 -0500)]
tests: Source image header in a subshell.

Use a subshell when sourcing the image header in pam-formats so that
the shell variables do not persist past the end of the test.  While
unlikely, a value left over from an earlier test might result in
false positives in later tests.

10 years agotests: Add info on what each MOO2 image is actually testing.
Nick Bowler [Thu, 23 Jan 2014 01:14:16 +0000 (20:14 -0500)]
tests: Add info on what each MOO2 image is actually testing.

Each MOO2 test image was selected to test a particular feature of the
image decoder.  That information was in the old regress.zsh script but
for some reason got dropped in the conversion.  Add that information
back as a TAP diagnostic line for each image.

10 years agotests: Zero out transparent pixels before calculating digest.
Nick Bowler [Thu, 23 Jan 2014 01:12:02 +0000 (20:12 -0500)]
tests: Zero out transparent pixels before calculating digest.

The colour value of transparent pixels is irrelevant from a correctness
perspective, but we are nevertheless including that information in the
tests.  While we could zero out the values in the PAM output code it's
better to make the tests more robust.

This adds an external dependency on netpbm's pamarith and pamchannel
tools for the test suite.  Restructure the tests so that these tools
are optional.  If the tools are not available (or not working) then we
must accept the fact that images with an alpha channel may have false
negatives (but not false positives) -- record a SKIP result for an MD5
mismatch in that case.

10 years agotests: Remove toplevel set -e usage.
Nick Bowler [Thu, 23 Jan 2014 01:06:27 +0000 (20:06 -0500)]
tests: Remove toplevel set -e usage.

Using set -e at the top level affects the entire script and makes it
difficult to work with commands that may legitimately return an error.
Regardless, set -e is still not so great for error checks because it
has some incredibly non-obvious semantics.

Better to just have correct error checks everywhere.  Fortunately, this
is the case for almost all the existing test code -- only the testdir
creation needs fixing.

10 years agoliblbx: Expose image lead-in in public struct.
Nick Bowler [Thu, 2 Jan 2014 01:33:18 +0000 (20:33 -0500)]
liblbx: Expose image lead-in in public struct.

Since we've finally defined the meaning of this value it makes sense to
expose it to the user.  This eliminates another need for lbx_img_getinfo,
but maintain the old functionality there for now.

10 years agolbximg: Fix wart in frame scanline header format
Nick Bowler [Tue, 17 Dec 2013 04:49:30 +0000 (23:49 -0500)]
lbximg: Fix wart in frame scanline header format

The format of frame scanlines has been a little weird since day 1: We
had 2 "types" of scanline headers disambiguated by some non-trivial
logic, including whether or not it was the first decoded scanline in
the frame.

Here's a new, simpler approach, which has only one type of scanline
header, consistent meanings to the header fields, and by interpreting
the first 4 bytes as a "frame header" we get rid of the special case
for the first scanline, too.

Add a document in English which describes the LBX image file format, to
be used as the baseline format specification going forward.

Finally, update the contrived test cases for the new format.  All the
test cases using actual MOO2 data still pass.

10 years agolbximg: Return failure if there was a decoding error.
Nick Bowler [Tue, 17 Dec 2013 01:01:57 +0000 (20:01 -0500)]
lbximg: Return failure if there was a decoding error.

If any frame was not decoded because liblbx returned an error, we should
return a non-zero exit status from the tool.  Previously this would only
happen if *all* frames failed.

10 years agotests: Migrate remaining regress.zsh tests to TAP.
Nick Bowler [Sun, 23 Jun 2013 19:11:14 +0000 (15:11 -0400)]
tests: Migrate remaining regress.zsh tests to TAP.

10 years agotests: Migrate the mainmenu.lbx tests to the TAP system.
Nick Bowler [Sat, 22 Jun 2013 14:01:39 +0000 (10:01 -0400)]
tests: Migrate the mainmenu.lbx tests to the TAP system.

This moves the first set of regress.zsh tests to the new framework.

10 years agobuild: Bump dxcommon for relevant fix-gnulib updates.
Nick Bowler [Fri, 21 Jun 2013 20:01:01 +0000 (16:01 -0400)]
build: Bump dxcommon for relevant fix-gnulib updates.

10 years agoliblbx: Fix framebuffer allocation for 0x0 images.
Nick Bowler [Fri, 21 Jun 2013 14:22:48 +0000 (10:22 -0400)]
liblbx: Fix framebuffer allocation for 0x0 images.

The allocation strategy for the framebuffer is the "array2" method from
c-faq: an array of row pointers into a single large array containing all
rows.  This was not being freed correctly in the case with 0 rows, since
there would be no pointer to the row data at all in order to free it.

Fix that up by simply allocating a 1x1 framebuffer when it would
otherwise be empty.  While we're at it, also add an overflow check
on the multiplication.

10 years agotests: Add a simple test to validate PAM output formats.
Nick Bowler [Fri, 21 Jun 2013 14:18:39 +0000 (10:18 -0400)]
tests: Add a simple test to validate PAM output formats.

This tests that the PAM output produces the correct image type for
all four of the lbximg modes.

10 years agolbximg: Add an option to control the output filenames.
Nick Bowler [Wed, 19 Jun 2013 01:07:51 +0000 (21:07 -0400)]
lbximg: Add an option to control the output filenames.

This will be needed for postmortem analysis of test cases that extract
multiple images, since otherwise there is no easy way to prevent the
tool from overwriting the earlier outputs.

This was clearly intended to be a user setting from the start but for
some reason it was never wired up to a command-line option.

10 years agolbximg: Allow --identify as a long option.
Nick Bowler [Wed, 19 Jun 2013 00:45:04 +0000 (20:45 -0400)]
lbximg: Allow --identify as a long option.

There is no reason to not have a full word here.  The getopt_long
function allows abbreviations anyway, so --ident remains perfectly
fine as an option.

10 years agolbximg: Fix exit status in identify mode.
Nick Bowler [Wed, 19 Jun 2013 00:43:36 +0000 (20:43 -0400)]
lbximg: Fix exit status in identify mode.

The tool was always returning an exit status of failure, because in
identify mode there was no case to set the exit status to success.

10 years agolbximg: Fix --override long option.
Nick Bowler [Wed, 19 Jun 2013 00:40:42 +0000 (20:40 -0400)]
lbximg: Fix --override long option.

The long option for this feature was clearly never tested, as only the
short option spec was actually correct.

10 years agotests: First stab at a proper test suite.
Nick Bowler [Wed, 19 Jun 2013 00:30:08 +0000 (20:30 -0400)]
tests: First stab at a proper test suite.

Not much of a suite at the moment since it consists of a single test,
which exposes a corner-case in the memory allocation spotted by clang.

Eventually we will move the regress.zsh tests into this framework.

10 years agolbximg: Make libpng a soft dependency.
Nick Bowler [Fri, 14 Jun 2013 22:15:25 +0000 (18:15 -0400)]
lbximg: Make libpng a soft dependency.

Now that we have Netpbm output formats which do not depend on
any external libraries, we can make it possible to build lbximg
without libpng.  Adjust the build system so that lbximg is built
unconditionally and PNG output can be selectively disabled.

10 years agolbximg: Add support for Netpbm output.
Nick Bowler [Fri, 14 Jun 2013 22:11:46 +0000 (18:11 -0400)]
lbximg: Add support for Netpbm output.

These netpbm formats are extremely simple image formats which can
be written with a very small amount of code.  Implement the ASCII
PBM and PPM formats for eventual use in test scripts, and PAM as a
fully-featured format so that we can make libpng optional.

10 years agoliblbx: Don't scale palette values internally.
Nick Bowler [Fri, 14 Jun 2013 01:57:11 +0000 (21:57 -0400)]
liblbx: Don't scale palette values internally.

Output the 18-bit palette values unadulterated, leaving it up to the
users to do conversion if necessary.  Push the conversion down into the
consumers (currently PNG output and the GTK GUI) where a 24-bit palette
is required.

While we're at it, adjust the conversion to scale to the full output
range of [0, 255].  This is a slight change to the output, so all the
image hashes need to be adjusted in the regression test.

10 years agolbximg: Fix printf format string in identify mode.
Nick Bowler [Fri, 14 Jun 2013 01:23:52 +0000 (21:23 -0400)]
lbximg: Fix printf format string in identify mode.

One of the flag strings would never be printed because there was
simply not enough conversion specifiers in this format string.  Fix
that up, and also adjust the length modifiers to match the actual
passed integer types.

10 years agolbximg: Push no-palette mode down into the PNG writer.
Nick Bowler [Fri, 14 Jun 2013 01:16:36 +0000 (21:16 -0400)]
lbximg: Push no-palette mode down into the PNG writer.

This allows the writer to select the most appropriate output format to
support this mode.  Switch the PNG writer to emit true grayscale images
in this case.

10 years agoliblbx: Properly report errors in lbx_(img_)fopen.
Nick Bowler [Wed, 12 Jun 2013 01:07:30 +0000 (21:07 -0400)]
liblbx: Properly report errors in lbx_(img_)fopen.

The lbx_fopen and lbx_img_fopen functions were not properly pushing an
error code when they failed, leading to extremely helpful messages of
the form:

  lbximg: failed to open image: Success.

It further turns out that pushing negative errors (i.e., -errno) was
documented but never actually tested or used, so fix that up, too.
It is likely that many other sites are lacking appropriate calls to
lbx_error_raise, which can be added later.

10 years agolbximg: Add a new PNG writing routine.
Nick Bowler [Tue, 11 Jun 2013 22:29:07 +0000 (18:29 -0400)]
lbximg: Add a new PNG writing routine.

This splits out the PNG output from the rest of the lbximg processing,
so that it will be easier to add additional output formats (in par-
ticular, it would be nice to have some sort of text-based format to
facilitate automated testing).

Take this opportunity to vastly improve the error handling.

10 years agotools: Add some smarter error printing routines.
Nick Bowler [Wed, 5 Jun 2013 03:34:06 +0000 (23:34 -0400)]
tools: Add some smarter error printing routines.

These ones can fill in strerror(errno) automatically.

10 years agotools: Move progname handling into a common source file.
Nick Bowler [Wed, 5 Jun 2013 03:26:04 +0000 (23:26 -0400)]
tools: Move progname handling into a common source file.

Less code duplication is nice.

11 years agobuild: Remove use of per-target CFLAGS.
Nick Bowler [Sat, 23 Mar 2013 17:12:30 +0000 (13:12 -0400)]
build: Remove use of per-target CFLAGS.

These are not necessary, and result in ugly object file names for no
reason.

11 years agobuild: clean up XML -> C conversion.
Nick Bowler [Sat, 23 Mar 2013 16:28:55 +0000 (12:28 -0400)]
build: clean up XML -> C conversion.

Use a suffix rule so the rule avoids hardcoding names and other details.

11 years agobuild: Flatten the build system.
Nick Bowler [Sat, 23 Mar 2013 15:47:35 +0000 (11:47 -0400)]
build: Flatten the build system.

Move everything into a single Makefile.am so that it's all in one place.

11 years agodocs: Add a more realistic statement about development pace.
Nick Bowler [Thu, 14 Mar 2013 00:14:24 +0000 (20:14 -0400)]
docs: Add a more realistic statement about development pace.

I don't think "under heavy development" even begins to resemble reality.

11 years agobuild: Integrate Gnulib non-recursively using fix-gnulib.
Nick Bowler [Thu, 14 Mar 2013 00:10:47 +0000 (20:10 -0400)]
build: Integrate Gnulib non-recursively using fix-gnulib.

11 years agognulib: Update to latest version.
Nick Bowler [Tue, 12 Mar 2013 22:38:40 +0000 (18:38 -0400)]
gnulib: Update to latest version.

11 years agobuild: Fixes for newer tools.
Nick Bowler [Tue, 12 Mar 2013 22:22:56 +0000 (18:22 -0400)]
build: Fixes for newer tools.

Some trivial updates to fix the build with latest Automake.  Drop
support for Automake versions < 1.11.

12 years agodoc: Update moo2-data.
Nick Bowler [Tue, 6 Dec 2011 23:33:02 +0000 (18:33 -0500)]
doc: Update moo2-data.

12 years agoliblbx: Remove now-redundant fields from lbx_imginfo.
Nick Bowler [Mon, 5 Dec 2011 04:28:37 +0000 (23:28 -0500)]
liblbx: Remove now-redundant fields from lbx_imginfo.

Ideally I'd like to kill this structure completely, but there's still
some non-trivial logic in it.  So leave those fields for now.

12 years agoliblbx: Kill the LBXimg typedef.
Nick Bowler [Mon, 5 Dec 2011 04:22:18 +0000 (23:22 -0500)]
liblbx: Kill the LBXimg typedef.

12 years agoliblbx: Start conversion of LBXimg to public/private structs.
Nick Bowler [Mon, 5 Dec 2011 04:12:40 +0000 (23:12 -0500)]
liblbx: Start conversion of LBXimg to public/private structs.

12 years agoliblbx: Kill the LBX typedef.
Nick Bowler [Sat, 14 May 2011 01:12:13 +0000 (21:12 -0400)]
liblbx: Kill the LBX typedef.

More stuff rendered redundant.

12 years agoliblbx: Kill lbx_numfiles.
Nick Bowler [Sat, 14 May 2011 01:08:37 +0000 (21:08 -0400)]
liblbx: Kill lbx_numfiles.

This function is now redundant.

12 years agoliblbx: Start conversion to public/private structure bits.
Nick Bowler [Sat, 14 May 2011 01:03:17 +0000 (21:03 -0400)]
liblbx: Start conversion to public/private structure bits.

This sort of interface is really a lot nicer, and avoids stupid
accessor functions.

14 years agobuild: Reset pkg_failed before checking pkg-config.
Nick Bowler [Thu, 11 Mar 2010 01:04:16 +0000 (20:04 -0500)]
build: Reset pkg_failed before checking pkg-config.

If this is not done, the first pkg-config check to fail will cause all
subsequent pkg-config checks to "fail".

14 years agoliblbx: Namespace cleanup.
Nick Bowler [Thu, 11 Feb 2010 14:06:00 +0000 (09:06 -0500)]
liblbx: Namespace cleanup.

14 years agolbxgui: Fix an error handling regression.
Nick Bowler [Thu, 11 Feb 2010 13:53:56 +0000 (08:53 -0500)]
lbxgui: Fix an error handling regression.

If the framebuffer allocation fails, it still gets passed to
render_to_pixbuf.  This causes an assertion failure.

14 years agolbxgui: Implement frame dropping for animation.
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.

14 years agoliblbx: Use unconditional includes of <config.h>.
Nick Bowler [Thu, 11 Feb 2010 03:14:13 +0000 (22:14 -0500)]
liblbx: Use unconditional includes of <config.h>.

14 years agoliblbx: Implement improved error reporting mechanism.
Nick Bowler [Thu, 11 Feb 2010 03:08:04 +0000 (22:08 -0500)]
liblbx: Implement improved error reporting mechanism.

We now use a FIFO-of-errors approach (similar to libltdl) as opposed to
an errno-esque approach.

14 years agoliblbx: Replace feof call with lbx_file_ops.
Nick Bowler [Thu, 11 Feb 2010 02:57:21 +0000 (21:57 -0500)]
liblbx: Replace feof call with lbx_file_ops.

This feof call was missed when converting this function.

14 years agoliblbx: Reset EOF flag after a successful seek on a pipe.
Nick Bowler [Thu, 11 Feb 2010 02:48:51 +0000 (21:48 -0500)]
liblbx: Reset EOF flag after a successful seek on a pipe.

This will probably never happen in practice.

14 years agoliblbx: Rename lbx_stat to lbx_file_stat.
Nick Bowler [Thu, 11 Feb 2010 00:42:12 +0000 (19:42 -0500)]
liblbx: Rename lbx_stat to lbx_file_stat.

14 years agoliblbx: Rename LBX_IMG to LBXimg.
Nick Bowler [Thu, 11 Feb 2010 00:36:49 +0000 (19:36 -0500)]
liblbx: Rename LBX_IMG to LBXimg.

This makes it consistent with LBXfile.

14 years agobuild: Implement a better GTK+ detection macro.
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.

14 years agobuild: Split out core logic from libpng detection.
Nick Bowler [Thu, 11 Feb 2010 00:06:52 +0000 (19:06 -0500)]
build: Split out core logic from libpng detection.

This allows it to be used for other libraries.  This new method also
better handles the various mechanisms for setting cflags/libs.

14 years agolbxgui: Fix pointer type error.
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.

14 years agolbxgui: Compile in the glade UI description.
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.

14 years agolicense: Fix copyright years in source files.
Nick Bowler [Wed, 10 Feb 2010 04:54:52 +0000 (23:54 -0500)]
license: Fix copyright years in source files.

14 years agolbxgui: Add copyright notices.
Nick Bowler [Wed, 10 Feb 2010 04:51:11 +0000 (23:51 -0500)]
lbxgui: Add copyright notices.

14 years agodoc: Update man pages to reflect reality.
Nick Bowler [Wed, 10 Feb 2010 04:48:33 +0000 (23:48 -0500)]
doc: Update man pages to reflect reality.

14 years agolbximg: Clean up option list.
Nick Bowler [Wed, 10 Feb 2010 04:42:38 +0000 (23:42 -0500)]
lbximg: Clean up option list.

Despite it being very useful, --nopalette did not have a single
character option.  While we're at it, use --no-palette for consistency
with GNU tools.

14 years agolbximg: Use the new lbximg_fopen interface.
Nick Bowler [Wed, 10 Feb 2010 04:29:40 +0000 (23:29 -0500)]
lbximg: Use the new lbximg_fopen interface.

14 years agoliblbx: Update lbximg_fopen to work like lbx_fopen.
Nick Bowler [Wed, 10 Feb 2010 04:24:56 +0000 (23:24 -0500)]
liblbx: Update lbximg_fopen to work like lbx_fopen.

14 years agolbximg: Fix improper free.
Nick Bowler [Wed, 10 Feb 2010 04:14:27 +0000 (23:14 -0500)]
lbximg: Fix improper free.

We were freeing the row buffer twice on the error path, and not at all
on the success path.

14 years agolbximg: Zero frame bitmap before use.
Nick Bowler [Wed, 10 Feb 2010 04:11:05 +0000 (23:11 -0500)]
lbximg: Zero frame bitmap before use.

14 years agolbxgui: Add a toggle between patterned and solid background.
Nick Bowler [Wed, 10 Feb 2010 04:03:32 +0000 (23:03 -0500)]
lbxgui: Add a toggle between patterned and solid background.

The patterned background makes it hard to see images that consist mostly
of transparent pixels.

14 years agolbxgui: Add a scrolled window around the image viewport.
Nick Bowler [Wed, 10 Feb 2010 03:21:12 +0000 (22:21 -0500)]
lbxgui: Add a scrolled window around the image viewport.

This solves a weird problem with the canvas resizing when one clears the
image selection.

14 years agolbxgui: Simplify image loading.
Nick Bowler [Wed, 10 Feb 2010 03:01:08 +0000 (22:01 -0500)]
lbxgui: Simplify image loading.

This also fixes an oversight whereby the framebuffer was re-allocated
every time the image is re-rendered.

14 years agolbxgui: Split frame rendering into a separate source file.
Nick Bowler [Wed, 10 Feb 2010 01:38:32 +0000 (20:38 -0500)]
lbxgui: Split frame rendering into a separate source file.

14 years agolbxgui: Clean up function names and linkage.
Nick Bowler [Wed, 10 Feb 2010 00:04:02 +0000 (19:04 -0500)]
lbxgui: Clean up function names and linkage.

14 years agolbxgui: Add interface to clear a combo box.
Nick Bowler [Tue, 9 Feb 2010 23:38:22 +0000 (18:38 -0500)]
lbxgui: Add interface to clear a combo box.

14 years agodoc: Update moo2-data.
Nick Bowler [Tue, 9 Feb 2010 06:06:56 +0000 (01:06 -0500)]
doc: Update moo2-data.

14 years agoliblbx: Add support for "chunked" images.
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.

14 years agoliblbx: Add support for "raw" LBX images.
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?

14 years agolbxgui: Make an effort to not leak resources.
Nick Bowler [Tue, 9 Feb 2010 04:13:50 +0000 (23:13 -0500)]
lbxgui: Make an effort to not leak resources.

14 years agolbxgui: Make transparent pixels more obvious.
Nick Bowler [Tue, 9 Feb 2010 02:19:36 +0000 (21:19 -0500)]
lbxgui: Make transparent pixels more obvious.

14 years agolbxgui: Don't use as much horizontal space in GUI.
Nick Bowler [Mon, 8 Feb 2010 23:20:43 +0000 (18:20 -0500)]
lbxgui: Don't use as much horizontal space in GUI.

14 years agobuild: Update project dependencies.
Nick Bowler [Mon, 8 Feb 2010 16:32:30 +0000 (11:32 -0500)]
build: Update project dependencies.

14 years agodoc: Update moo2-data.
Nick Bowler [Mon, 8 Feb 2010 05:13:30 +0000 (00:13 -0500)]
doc: Update moo2-data.

14 years agoliblbx: Clear the image mask when backtracking frames.
Nick Bowler [Mon, 8 Feb 2010 04:58:57 +0000 (23:58 -0500)]
liblbx: Clear the image mask when backtracking frames.

Without this, undrawn pixels in the first frame will have the pixel
values from the previously drawn frame.

14 years agodoc: Update moo2-data.
Nick Bowler [Mon, 8 Feb 2010 04:26:22 +0000 (23:26 -0500)]
doc: Update moo2-data.

14 years agoliblbx: Add new flag.
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.

14 years agolbxgui: Add support for override palettes.
Nick Bowler [Mon, 8 Feb 2010 03:32:07 +0000 (22:32 -0500)]
lbxgui: Add support for override palettes.

14 years agolbxgui: Add support for external palettes.
Nick Bowler [Mon, 8 Feb 2010 03:14:39 +0000 (22:14 -0500)]
lbxgui: Add support for external palettes.

14 years agoliblbx: Use lbx_file_ops for lbximg_loadpalette.
Nick Bowler [Mon, 8 Feb 2010 02:44:31 +0000 (21:44 -0500)]
liblbx: Use lbx_file_ops for lbximg_loadpalette.

14 years agolbxgui: Recognise *.LBX as an LBX archive.
Nick Bowler [Mon, 8 Feb 2010 02:29:05 +0000 (21:29 -0500)]
lbxgui: Recognise *.LBX as an LBX archive.

The files on the Moo2 CD show up in ALL CAPITALS, so it's useful to
match them with the file filter.

14 years agolbxgui: Add support for animating images.
Nick Bowler [Mon, 8 Feb 2010 02:24:32 +0000 (21:24 -0500)]
lbxgui: Add support for animating images.

14 years agolbxgui: Allow frame to be specified.
Nick Bowler [Mon, 8 Feb 2010 01:20:48 +0000 (20:20 -0500)]
lbxgui: Allow frame to be specified.

14 years agoliblbx: Set the file offset in lbx_file_seek.
Nick Bowler [Mon, 8 Feb 2010 01:19:31 +0000 (20:19 -0500)]
liblbx: Set the file offset in lbx_file_seek.

This function previously would do the underlying seek correctly, but not
actually record what it did.  This breaks lots of things, fix it.

14 years agolbxgui: Add initial support for decoding and displaying images.
Nick Bowler [Sun, 7 Feb 2010 23:37:29 +0000 (18:37 -0500)]
lbxgui: Add initial support for decoding and displaying images.

14 years agoliblbx: Add a field to lbx_colour indicating which entries are used.
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.

14 years agolbximg: Properly convert lbx_colour to png_color.
Nick Bowler [Sun, 7 Feb 2010 22:10:21 +0000 (17:10 -0500)]
lbximg: Properly convert lbx_colour to png_color.

Now lbximg does not depend on these two libraries using the same
underlying palette representation.

14 years agoliblbx: Add file operations for handling LBX archive members.
Nick Bowler [Sun, 7 Feb 2010 22:05:25 +0000 (17:05 -0500)]
liblbx: Add file operations for handling LBX archive members.

This allows, for example, the image handling code to read directly from
the archive.

14 years agolbxgui: New tool.
Nick Bowler [Sun, 7 Feb 2010 04:55:42 +0000 (23:55 -0500)]
lbxgui: New tool.