tweaks to the splash screen easter eggs to make them more responsive

This commit is contained in:
Robby Findler 2011-01-04 15:38:35 -06:00
parent e0c02e66c8
commit 9cd9fd24aa
2 changed files with 16 additions and 17 deletions

View File

@ -91,7 +91,8 @@
(if (eq? special-state match) (if (eq? special-state match)
(begin (set! special-state #f) normal-bitmap) (begin (set! special-state #f) normal-bitmap)
(begin (set! special-state match) (begin (set! special-state match)
(magic-image-bitmap match)))))))))) (magic-image-bitmap match))))
(refresh-splash)))))))
(when (eb-bday?) (install-eb)) (when (eb-bday?) (install-eb))

View File

@ -25,19 +25,17 @@
(define (draw-single-loop str dc offset cx cy radius font-size color) (define (draw-single-loop str dc offset cx cy radius font-size color)
(send dc set-font (send the-font-list find-or-create-font font-size 'modern)) (send dc set-font (send the-font-list find-or-create-font font-size 'modern))
(let loop ([i (string-length str)]) (for ([i (in-range 0 (string-length str))])
(unless (zero? i) (draw-letter dc
(draw-letter dc cx
cx cy
cy (normalize-angle
(normalize-angle (+ (- (* 2 pi) (* (* 2 pi) (/ (- i 1) (string-length str))))
(+ (- (* 2 pi) (* (* 2 pi) (/ (- i 1) (string-length str)))) (/ pi 2)
(/ pi 2) offset))
offset)) radius
radius (substring str i (+ i 1))
(string (string-ref str (- i 1))) color)))
color)
(loop (- i 1)))))
(define (normalize-angle angle) (define (normalize-angle angle)
(cond (cond
@ -46,11 +44,11 @@
[else (normalize-angle (- angle (* 2 pi)))])) [else (normalize-angle (- angle (* 2 pi)))]))
(define splash-canvas (get-splash-canvas)) (define splash-canvas (get-splash-canvas))
(define (draw-single-step dc offset) (define (draw-single-step offset)
(send bdc draw-bitmap eli 0 0) (send bdc draw-bitmap eli 0 0)
(draw-single-loop omega-str bdc offset (/ main-size 2) (/ main-size 2) 120 32 outer-color) (draw-single-loop omega-str bdc offset (/ main-size 2) (/ main-size 2) 120 32 outer-color)
(draw-single-loop hebrew-str bdc (+ (- (* 2 pi) offset) (* 2 pi)) (/ main-size 2) (/ main-size 2) 70 20 inner-color) (draw-single-loop hebrew-str bdc (+ (- (* 2 pi) offset) (* 2 pi)) (/ main-size 2) (/ main-size 2) 70 20 inner-color)
(send splash-canvas on-paint)) (refresh-splash))
(define gc-b (define gc-b
(with-handlers ([exn:fail? (lambda (x) (with-handlers ([exn:fail? (lambda (x)
@ -122,7 +120,7 @@
(parameterize ([current-eventspace splash-eventspace]) (parameterize ([current-eventspace splash-eventspace])
(queue-callback (queue-callback
(λ () (λ ()
(draw-single-step bdc o) (draw-single-step o)
(semaphore-post s)))) (semaphore-post s))))
(semaphore-wait s)) (semaphore-wait s))
(let ([next (+ o (/ pi 60))]) (let ([next (+ o (/ pi 60))])