adjusted 2htdp/universe (and world) so that it uses the cache disabling support from 2htdp/image
(the caching is not helping when drawing animations; it just allocates extra bitmaps)
This commit is contained in:
parent
670d58d134
commit
1d2b837603
|
@ -1,10 +1,17 @@
|
|||
#lang scheme/base
|
||||
(require (prefix-in 2: 2htdp/image)
|
||||
(prefix-in 2-core: mrlib/image-core)
|
||||
(prefix-in 1: htdp/image)
|
||||
htdp/error)
|
||||
|
||||
(provide image? scene? image-width image-height text 2:image?
|
||||
check-image check-scene check-scene-result)
|
||||
check-image check-scene check-scene-result
|
||||
disable-cache)
|
||||
|
||||
(define (disable-cache x)
|
||||
(if (2:image? x)
|
||||
(2-core:un/cache-image x #f)
|
||||
x))
|
||||
|
||||
(define (scene? x)
|
||||
;; be sure to check 2:image? first so that
|
||||
|
|
|
@ -211,7 +211,7 @@
|
|||
(let ([s (send visible find-first-snip)]
|
||||
[c (send visible get-canvas)])
|
||||
(when s (send visible delete s))
|
||||
(send visible insert (send pict copy) 0 0)
|
||||
(send visible insert (disable-cache (send pict copy)) 0 0)
|
||||
(send visible lock #t)
|
||||
(send visible end-edit-sequence)
|
||||
;; The following flush trades streaming performance (where updates
|
||||
|
|
Loading…
Reference in New Issue
Block a user