]> git.draconx.ca Git - rrace.git/commit
Improve exposure mask calculation.
authorNick Bowler <nbowler@draconx.ca>
Wed, 7 Dec 2022 05:16:41 +0000 (00:16 -0500)
committerNick Bowler <nbowler@draconx.ca>
Fri, 9 Dec 2022 03:13:58 +0000 (22:13 -0500)
commit777611df8df4522752b3a85a14523f18bf695a0f
treef799c07c232498d762616584b26068ea1c3f3bf3
parent384c634555c6c65635abfcb819e37221d236b410
Improve exposure mask calculation.

By assuming that a >= b, the computation of

  board_left(a) & board_right(b)

can be simplified to

  board_left(a-b) << a.

which avoids some computation.  A similar improvement can be done
for board_above/board_below.  Add a new board_rect function that
incorporates these improvements, and use it to generate exposure
update bitmaps in the Motif UI.

A new test case exhaustively tests all possible inputs to this
function.

Furthermore, update board_above and board_below to have simpler
implementations.
Makefile.am
src/game.h
src/motif_ui.c
t/.gitignore
t/boardrect.c [new file with mode: 0644]
tests/game.at
testsuite.at