From d44ca77cff7c873cc9e8d0bb9b7212a747420c6e Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Tue, 14 Jul 2015 17:49:12 -0700 Subject: [PATCH] opengl.textures: use cum-sum0 from math.statistics. --- basis/opengl/textures/textures.factor | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/basis/opengl/textures/textures.factor b/basis/opengl/textures/textures.factor index 22150b4355..f5d3af05ce 100644 --- a/basis/opengl/textures/textures.factor +++ b/basis/opengl/textures/textures.factor @@ -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 ; : ( image-grid loc -- grid ) [ dup image-locs ] dip