From fba80949ebd9d9b4844169f52c90601e12cb30de Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 16 Apr 2009 23:14:41 -0500 Subject: [PATCH] draw-scaled-texture now uses the display list if there's no scaling to be done --- basis/opengl/textures/textures.factor | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/basis/opengl/textures/textures.factor b/basis/opengl/textures/textures.factor index 76e0c473b9..6bed17f7ab 100755 --- a/basis/opengl/textures/textures.factor +++ b/basis/opengl/textures/textures.factor @@ -128,7 +128,9 @@ M: single-texture dispose* [ display-list>> [ delete-dlist ] when* ] bi ; M: single-texture draw-scaled-texture - dup texture>> [ draw-textured-rect ] [ 2drop ] if ; + 2dup dim>> = [ nip draw-texture ] [ + dup texture>> [ draw-textured-rect ] [ 2drop ] if + ] if ; TUPLE: multi-texture grid display-list loc disposed ; @@ -166,6 +168,8 @@ TUPLE: multi-texture grid display-list loc disposed ; f multi-texture boa ] with-destructors ; +M: multi-texture draw-scaled-texture nip draw-texture ; + M: multi-texture dispose* grid>> [ [ dispose ] each ] each ; CONSTANT: max-texture-size { 512 512 }