]> git.draconx.ca Git - rrace.git/commit
motif: Avoid constantly recalculating tile size.
authorNick Bowler <nbowler@draconx.ca>
Fri, 30 Dec 2022 17:16:13 +0000 (12:16 -0500)
committerNick Bowler <nbowler@draconx.ca>
Sat, 7 Jan 2023 16:43:12 +0000 (11:43 -0500)
commitceb2df0fe41852ba3f5637dcd04217113b4259ba
tree4efaa0fe7215e2d0fca51d87ac91b0eedef15b12
parentbbe659b000e2c281340953c5fc96bd7ac3b94eaa
motif: Avoid constantly recalculating tile size.

Instead of calculating tile size every time any drawing is needed,
we can just store the value calculated during window layout.  This
involves some code reorganization to give the ResizeGameArea action
implementation direct access to the state structure.

Moreover, avoid dealing with width/height separately in the drawing
functions, as by design the game/goal areas (and therefore the tiles)
are always square.
src/motif.c
src/motif.h
src/motif_ui.c
src/x11.c