Nick Bowler [Thu, 10 Mar 2022 04:44:39 +0000 (23:44 -0500)]
Track elapsed time of the game.
Since this is a speed solving game, it is kind of important to know
how much time it took to solve the puzzle. Start by adding a timer to
the game state so we can print elapsed time at the end. Related GUI
elements will be coming later.
The game will no longer start immediately. When the program is
launched, it will begin in a winning state.
Nick Bowler [Thu, 10 Mar 2022 04:18:18 +0000 (23:18 -0500)]
Add a more direct way to specify the game background.
Rather than the user needing to know any details of the widget
hierarchy, add an application resource to set the game background
too (along with the tile colours).
We can also leverage Xt to allocate colours for us, which simplifies
things a bit.
Nick Bowler [Thu, 10 Mar 2022 03:53:18 +0000 (22:53 -0500)]
Avoid uninitialized value error in help output.
Technically simply passing an unitialized (indeterminate) arg value
to the help_print_option function has undefined behaviour even though
it is only unset in cases where it will not actually be used by the
function. But it is easy to just ensure it has a well-defined value.
Nick Bowler [Wed, 9 Mar 2022 02:03:48 +0000 (21:03 -0500)]
Generate and distribute some icon files.
Since we now have code that generates nifty icons in various sizes,
we can fairly easily make use of it to generate and install icon
files. These files need to be distributed because the application
cannot be run in the cross-compilation case, which will also avoid
the distribution depending on external image conversion utilities.
Nick Bowler [Tue, 8 Mar 2022 06:08:29 +0000 (01:08 -0500)]
Use XPM as icon test output format.
The output of this test program is very close to XPM format.
So why not make it actually produce XPM format. This gives
us a good way to have it output actual colour icons too.
Nick Bowler [Tue, 8 Mar 2022 04:35:22 +0000 (23:35 -0500)]
Allow compilation without X11.
At the moment this means nothing useful gets installed, but "make check"
is possible. The icon functions being tested don't _really_ depend on
X11, just the XColor structure for which we can supply a suitable
definition.
Nick Bowler [Sat, 5 Mar 2022 21:32:48 +0000 (16:32 -0500)]
Fix boardmove testcase typo.
Comparing "if (argv > 0)" is an obvious typo, totally invalid and bogus.
Weirdly GCC fails to complain without "-pedantic", but HP-UX cc is happy
to inform us about the error.