# Graphical damage

When drawing, we often want to keep track of the area we've drawn to for the
purpose of invalidating another buffer later. The idea is that we compound
multiple draw operations into the smallest rectangle that encompass all of those
operations. Then, we know what to invalidate in our other buffer.

A damage struct is a 16 bytes struct with 4 fields, minX minY maxX maxY.
Damage field minX and maxX values are always divisible by 4.

Initially, the damage struct will correspond exactly to the "opening" drawing
instructions, but it will grow as more drawing operations are added to it.

## API

### Constants

DAMAGESZ  16. Size in bytes of a damage struct.

### Words

align4- ( n -- n )
  Align "n" to 4 "downwards", that is, do "3 ^ and", but quickly.

damage+ ( x y w h a -- )
  "Expand" existing damage struct at address "a" with specified rectangle.

damage$ ( a -- )
  Reset damage struct at address "a" with a value indicating no damage.

?damagedrect ( a -- ?x ?y ?w ?h f )
  If damage at "a" is not empty, yield f=1 and a rectangle of the damage.
  Otherwise, yield f=0 and nothing else.
