]> git.draconx.ca Git - rrace.git/log
rrace.git
23 months agoCurses UI improvements.
Nick Bowler [Wed, 8 Jun 2022 01:38:13 +0000 (21:38 -0400)]
Curses UI improvements.

Add the goal area to the curses UI, and also leverage additional
configure tests to allow building against a wider variety of
curses implementations.

23 months agoFix reconfiguration when using --without-x.
Nick Bowler [Tue, 7 Jun 2022 00:01:41 +0000 (20:01 -0400)]
Fix reconfiguration when using --without-x.

We need to consider the user's selection when checking whether or not
to build the Motif UI, because the cached result may have come from a
prior configure run.

23 months agoAdd initial curses-based UI.
Nick Bowler [Sun, 5 Jun 2022 20:42:45 +0000 (16:42 -0400)]
Add initial curses-based UI.

To start getting an idea of what it takes to implement a game like this
with many different frontends, let's start by implementing a text-mode
user interface based on curses.

23 months agoAdd initial README.
Nick Bowler [Fri, 3 Jun 2022 04:58:57 +0000 (00:58 -0400)]
Add initial README.

23 months agoAdd COPYING
Nick Bowler [Fri, 3 Jun 2022 04:17:17 +0000 (00:17 -0400)]
Add COPYING

23 months agoDisplay a warning if configuring without any UI.
Nick Bowler [Thu, 2 Jun 2022 01:45:21 +0000 (21:45 -0400)]
Display a warning if configuring without any UI.

2 years agoImplement the about dialog.
Nick Bowler [Thu, 17 Mar 2022 00:07:21 +0000 (20:07 -0400)]
Implement the about dialog.

2 years agoCall setlocale on startup.
Nick Bowler [Mon, 14 Mar 2022 04:33:47 +0000 (00:33 -0400)]
Call setlocale on startup.

Failing to call this seems to affect the default X11 font selection
(wrong encodings, perhaps?) causing some display problems on HP-UX.

2 years agoAdd timer display.
Nick Bowler [Sun, 13 Mar 2022 04:21:41 +0000 (23:21 -0500)]
Add timer display.

2 years agoReduce redrawing on resize events.
Nick Bowler [Sat, 12 Mar 2022 23:16:39 +0000 (18:16 -0500)]
Reduce redrawing on resize events.

It is a waste of time redrawing parts of the window on resize that
will be redrawn due to expose events immediately afterwards.  This
is particularly noticeable when the program is first started and
everything is drawn twice.

2 years agoRestructure motif code a bit.
Nick Bowler [Sat, 12 Mar 2022 22:36:07 +0000 (17:36 -0500)]
Restructure motif code a bit.

Move the game input callback into motif.c, which essentially brings all
the user input parts together in one file and all the display parts in
the other file.

2 years agoReport changed positions from game_do_move.
Nick Bowler [Sat, 12 Mar 2022 21:31:12 +0000 (16:31 -0500)]
Report changed positions from game_do_move.

Instead of manually comparing positions before and after the move,
we can just alter the definition of game_do_move to return this
information, since it has already done most of the work internally.

2 years agoOnly redraw changed tiles when right clicking.
Nick Bowler [Sat, 12 Mar 2022 21:11:02 +0000 (16:11 -0500)]
Only redraw changed tiles when right clicking.

By changing the definition of game_check_goal to return a bit-mask
of mismatched positions, we can just pass that to the redraw mask to
reduce the amount of rendering needed.

2 years agoAdd build-time option to help debug X11 rendering.
Nick Bowler [Sat, 12 Mar 2022 21:15:24 +0000 (16:15 -0500)]
Add build-time option to help debug X11 rendering.

Add #define that can be manually set in config.h to enable additional
debug drawing.  This is intended purely for development.  Currently this
causes the system to highlight tiles before they are redrawn, in order
to watch things like expose handling and tile movement.

2 years agoTrack elapsed time of the game.
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.

2 years agoAdd a more direct way to specify the game background.
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.

2 years agoAdd a man page to explain the game and program options.
Nick Bowler [Thu, 10 Mar 2022 03:58:11 +0000 (22:58 -0500)]
Add a man page to explain the game and program options.

2 years agoAvoid uninitialized value error in help output.
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.

2 years agoRight clicking on game area now shows the objective.
Nick Bowler [Thu, 10 Mar 2022 02:51:22 +0000 (21:51 -0500)]
Right clicking on game area now shows the objective.

2 years agoSet default program title.
Nick Bowler [Thu, 10 Mar 2022 02:29:57 +0000 (21:29 -0500)]
Set default program title.

2 years agoAvoid motif headers in x11.c.
Nick Bowler [Thu, 10 Mar 2022 01:37:10 +0000 (20:37 -0500)]
Avoid motif headers in x11.c.

We don't actually use any of motif in this module aside from a couple
macros which alias Xt string definitions.  So let's stick with the Xt
names.

2 years agoMake tile colours configurable via X resources.
Nick Bowler [Thu, 10 Mar 2022 01:29:53 +0000 (20:29 -0500)]
Make tile colours configurable via X resources.

2 years agoReduce the amount of redundant drawing in the goal area.
Nick Bowler [Wed, 9 Mar 2022 06:31:27 +0000 (01:31 -0500)]
Reduce the amount of redundant drawing in the goal area.

Same treatment as the game area: on expose events we only need to
redraw the tiles that actually intersect the exposed area.

2 years agoReduce the amount of redundant drawing in the game area.
Nick Bowler [Wed, 9 Mar 2022 05:43:36 +0000 (00:43 -0500)]
Reduce the amount of redundant drawing in the game area.

We only need to redraw tiles that have changed after a move, or
(in the case of expose events) that intersect the exposed region.

2 years agoGenerate and distribute some icon files.
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.

2 years agoFactor out common parts of icon generation.
Nick Bowler [Wed, 9 Mar 2022 02:08:46 +0000 (21:08 -0500)]
Factor out common parts of icon generation.

The row formatting in the four different icon files is basically
the same, and can be adapted into a common function.

2 years agoVery slightly simplify game_reset implementation.
Nick Bowler [Wed, 9 Mar 2022 02:07:48 +0000 (21:07 -0500)]
Very slightly simplify game_reset implementation.

2 years agoUse XPM as icon test output format.
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.

2 years agoAllow compilation without X11.
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.

2 years agoImplement window icons.
Nick Bowler [Tue, 8 Mar 2022 03:47:18 +0000 (22:47 -0500)]
Implement window icons.

2 years agoClean up redundant/unused declarations.
Nick Bowler [Sat, 5 Mar 2022 21:37:36 +0000 (16:37 -0500)]
Clean up redundant/unused declarations.

2 years agoAdjust X11 include ordering.
Nick Bowler [Sat, 5 Mar 2022 21:35:39 +0000 (16:35 -0500)]
Adjust X11 include ordering.

Some versions of Motif require <X11/Intrinsic.h> to be included before
<Xm/XmStrDefs.h> which results in build failures on HP-UX.

2 years agoFix boardmove testcase typo.
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.

2 years agoFix distribution.
Nick Bowler [Sat, 5 Mar 2022 20:51:40 +0000 (15:51 -0500)]
Fix distribution.

2 years agoPull in gnulib for its portability features.
Nick Bowler [Sat, 5 Mar 2022 20:43:33 +0000 (15:43 -0500)]
Pull in gnulib for its portability features.

2 years agoCheck victory condition so the game is winnable.
Nick Bowler [Sat, 5 Mar 2022 07:58:34 +0000 (02:58 -0500)]
Check victory condition so the game is winnable.

2 years agoAdd a menu bar.
Nick Bowler [Sat, 5 Mar 2022 07:56:20 +0000 (02:56 -0500)]
Add a menu bar.

Including a "new game" option to reset the board.

2 years agoBetter colours
Nick Bowler [Fri, 4 Mar 2022 07:32:01 +0000 (02:32 -0500)]
Better colours

2 years agoImplement some basic gameplay.
Nick Bowler [Fri, 4 Mar 2022 07:17:05 +0000 (02:17 -0500)]
Implement some basic gameplay.

2 years agoInitial commit
Nick Bowler [Thu, 3 Mar 2022 04:37:18 +0000 (23:37 -0500)]
Initial commit