]> git.draconx.ca Git - rrace.git/commit
Fix bitmap generation in goal overlay feature.
authorNick Bowler <nbowler@draconx.ca>
Wed, 4 Jan 2023 07:20:16 +0000 (02:20 -0500)
committerNick Bowler <nbowler@draconx.ca>
Sat, 7 Jan 2023 16:43:13 +0000 (11:43 -0500)
commita70b0ef8bf7cb26cc779e9b2da480295f5ebf2bd
tree9ef9046248c6d8f0440da5d34226a25b2a3ca7e7
parentb8d5c7bc17fcb037c23d323d4f8fbdbab9894d9d
Fix bitmap generation in goal overlay feature.

The board initialization procedure no longer ensures that unused bits of
the goal bitmap are zeroed.  When these are ORed with the game bitmaps,
it can result in bogus values for the outer tiles, which will either
render incorrectly or trip the assertion if the tile value is 7.

Normally only the objective area tiles get redrawn when the feature
is toggled on or off, which hides the problem most of the time, as
something else needs to trigger redraw of the outer tiles.  One way
to make this happen is to use the keyboard to start a new game while
holding down the right mouse button.

The best solution seems to be to just mask the goal bitmaps where
they are used.  As the same fix is needed in both the curses and
motif UIs, implement this new logic into a common function and add
a new test case to check for this bug.
Makefile.am
src/curses.c
src/game.h
src/x11.c
t/.gitignore
t/overlaygoal.c [new file with mode: 0644]
tests/game.at
testsuite.at