Tuesday, November 24, 2009

Wumpus

Copperbox revision 971.

Wumpus optimized!

Wumpus now generates efficient (straight line) PostScript. The only calls to gsave and grestore are now bookends of the file (which is necessary for EPS files). Changing the CTM or the graphics state no longer needs to be done in gsave ... grestore block - changes to CTM are undone by applying the matrix inverse of the transformation on exit of a 'block' this is much more efficient than putting the graphics state on the stack. Similarly, changes of stroke width, dash pattern, ... are undone after a path is drawn.

Colour and font changes are slightly different - here Wumpus uses the fact that all leaves in the tree have a colour attribute and all label leaves have a Font attribute. Wumpus can avoid an undo because the next leaf will do a set-property anyway.

With a bit of tidying up and checking that the examples in wumpus-extra still work, wumpus-core should be ready for Hackage.

Blog Archive

About Me

My photo
Disambiguating biog as there are a few Stephen Tetley's in the world. I'm neither a cage fighter or yachtsman. I studied Fine Art in the nineties (foundation Bradford 1992, degree Cheltenham 1992 - 95) then Computing part-time at Leeds Met graduating in 2003. I'm the Stephen Tetley on Haskell Cafe and Stackoverflow.