Remove old, dead code

This commit is contained in:
Tony Garnock-Jones 2019-04-25 12:58:48 +01:00
parent 419bd093d1
commit 4fd2c9895c
1 changed files with 0 additions and 62 deletions

View File

@ -276,68 +276,6 @@
child-xform
final-transformation))
;; (define (compile-instructions instrs)
;; (define touchables '())
;; (define coordinate-maps '())
;; (define resources '())
;; (define child-xform #f)
;; (define (instructions->racket-code instrs xform)
;; (define-values (code-rev new-xform)
;; (for/fold [(code-rev '()) (xform xform)] [(instr (in-list instrs))]
;; (define-values (new-code new-xform) (instruction->racket-code instr xform))
;; (values (cons new-code code-rev) new-xform)))
;; (values (reverse code-rev) new-xform))
;; (define (instruction->racket-code instr xform)
;; (match instr
;; [`(rotate ,(? number? deg))
;; (values `(glRotated ,deg 0 0 -1)
;; (compose-transformation xform (rotation-transformation (- deg))))]
;; [`(scale ,(? number? x) ,(? number? y))
;; (values `(glScaled ,x ,y 1)
;; (compose-transformation xform (stretching-transformation x y)))]
;; [`(translate ,(? number? x) ,(? number? y))
;; (values `(glTranslated ,x ,y 0)
;; (compose-transformation xform (translation-transformation x y)))]
;; [`(color ,(? color-number? r) ,(? color-number? g) ,(? color-number? b) ,(? color-number? a))
;; (values `(glColor4d ,r ,g ,b ,a) xform)]
;; [`(texture ,i)
;; (define entry (image->texture-cache-entry i))
;; (set! resources (cons entry resources))
;; (values `(draw-gl-face ,(send entry get-texture)) xform)]
;; [`(texture ,i ,l ,t ,w ,h) #:when (andmap number? (list l t w h))
;; (define entry (image->texture-cache-entry i))
;; (set! resources (cons entry resources))
;; (values `(draw-gl-face ,(send entry get-texture) ,l ,t ,w ,h) xform)]
;; [`(touchable ,id ,predicate)
;; (set! touchables (cons (touchable id xform predicate) touchables))
;; (values `(void) xform)]
;; [`(coordinate-map ,id)
;; (set! coordinate-maps (cons (coordinate-map id xform) coordinate-maps))
;; (values `(void) xform)]
;; [`(push-matrix ,instr ...)
;; (define-values (code _new-xform) (instructions->racket-code instr xform))
;; (values `(begin (glPushMatrix) ,@code (glPopMatrix)) xform)]
;; [`(begin ,instr ...)
;; (define-values (code new-xform) (instructions->racket-code instr xform))
;; (values `(begin ,@code (void)) new-xform)]
;; [`(render-children) ;; we assume that there will only be one of these
;; (set! child-xform xform)
;; (set! touchables (cons (touchable-map) touchables))
;; (values `(render-sprites! CHILDMAP SELF-ID) xform)]
;; [other
;; (error 'instruction->racket-code "unknown render instruction: ~v" other)]))
;; (define-values (code final-transformation)
;; (instruction->racket-code `(begin ,@instrs) identity-transformation))
;; (define render-proc (eval `(lambda (CHILDMAP SELF-ID) ,code) ns))
;; (compiled-instructions render-proc
;; touchables
;; coordinate-maps
;; resources
;; child-xform))
(define empty-instructions (compile-instructions '()))
(define (compiled-instructions-dispose! i)