about summary refs log tree commit diff stats
path: root/graphics.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-01-05 01:21:39 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-01-05 23:28:02 -0800
commit364c4d04325aa42d47675ba40f834e4cb8b3feaf (patch)
tree01546369eb4ea771cacb4a3a7b879cde33cbdb75 /graphics.mu
parent8577d177168151ae11cfe7fdd3024974bbd15f7d (diff)
downloadmu-364c4d04325aa42d47675ba40f834e4cb8b3feaf.tar.gz
503 - start of a solution for drawing pieces
Dog slow, though. Drawing the sprite for a single piece takes 12s or
30ms/pixel for 400 pixels. A third of that is the actual racket overhead
of drawing pixel by pixel, which would in itself be too much. We need
bitblts.

(Black queen pixels derived from http://www.wpclipart.com/recreation/games/chess/chess_set_1,
after scaling down to 40x40 and replacing external white pixels with
transparent ones in Gimp.)
Diffstat (limited to 'graphics.mu')
-rw-r--r--graphics.mu7
1 files changed, 2 insertions, 5 deletions
diff --git a/graphics.mu b/graphics.mu
index c4520c8f..5f19367b 100644
--- a/graphics.mu
+++ b/graphics.mu
@@ -1,13 +1,10 @@
 ; open a viewport, print coordinates of mouse clicks
 ; currently need to ctrl-c to exit after closing the viewport
 (function main [
-  (graphics-on)
+  (graphics-on (("practice" literal)) 300:literal 300:literal)
   { begin
     (pos:integer-integer-pair click?:boolean <- mouse-position)
-    { begin
-      (break-if click?:boolean)
-      (loop 2:blocks)
-    }
+    (loop-unless click?:boolean)
     (x:integer <- get pos:integer-integer-pair 0:offset)
     (y:integer <- get pos:integer-integer-pair 1:offset)
     (print-primitive x:integer)