]> gitweb.factorcode.org Git - factor.git/commitdiff
opengl.textures: use cum-sum0 from math.statistics.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 15 Jul 2015 00:49:12 +0000 (17:49 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 15 Jul 2015 00:49:12 +0000 (17:49 -0700)
basis/opengl/textures/textures.factor

index 22150b4355f19e9e6f148b6079d8cc13bbf33488..f5d3af05ce84b5008c233175108da53aadbfb04c 100644 (file)
@@ -1,10 +1,10 @@
 ! Copyright (C) 2009, 2010 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors alien.data assocs cache colors.constants
-destructors kernel opengl opengl.gl opengl.capabilities
-combinators images images.tessellation grouping sequences math
-math.vectors generalizations fry arrays namespaces system locals
-literals specialized-arrays ;
+USING: accessors alien.data arrays assocs colors.constants
+combinators destructors fry images images.tessellation kernel
+literals locals math math.statistics math.vectors namespaces
+opengl opengl.capabilities opengl.gl sequences
+specialized-arrays system ;
 FROM: alien.c-types => int float ;
 SPECIALIZED-ARRAY: float
 IN: opengl.textures
@@ -370,8 +370,7 @@ TUPLE: multi-texture < disposable grid display-list loc ;
 : image-locs ( image-grid -- loc-grid )
     [ first [ image-dim first ] map ]
     [ [ first image-dim second ] map ] bi
-    [ 0 [ + ] accumulate nip ] bi@
-    cartesian-product flip ;
+    [ cum-sum0 ] bi@ cartesian-product flip ;
 
 : <texture-grid> ( image-grid loc -- grid )
     [ dup image-locs ] dip