opengl.textures: use cum-sum0 from math.statistics.

db4
John Benediktsson 2015-07-14 17:49:12 -07:00
parent 20ff03f5c0
commit d44ca77cff
1 changed files with 6 additions and 7 deletions

View File

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